/* Every top-level section stacks in a single centered column at the same width
   with a consistent gap, so panels read as one aligned column of cards. */
.product-top-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.product-hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  margin-bottom: 0;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  background: var(--wa-surface);
  padding: 1.25rem;
}
.product-hero-heading {
  position: relative;
  margin-bottom: 0.15rem;
}
.product-hero-heading.has-secondary-market-price {
  padding-right: min(48%, 17.5rem);
}
.product-hero-heading h1 {
  margin-right: 0;
  min-width: 0;
}
.product-secondary-market-price {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  max-width: 17rem;
  padding: 0;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--wa-muted);
}
.product-secondary-market-price-value {
  display: inline;
  margin: 0 0.15rem;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--wa-text);
  font-variant-numeric: tabular-nums;
  vertical-align: -0.08em;
}
.product-secondary-market-price-value.is-redacted {
  color: var(--wa-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.25rem;
  vertical-align: baseline;
}
.product-secondary-market-price.is-locked {
  opacity: 0.92;
}
.product-allocated-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wa-accent);
  border: 1px solid color-mix(in srgb, var(--wa-accent) 45%, transparent);
  background: color-mix(in srgb, var(--wa-accent) 12%, transparent);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  line-height: 1.2;
}
.product-insight {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--wa-surface) 92%, var(--wa-accent) 8%);
}
.product-insight--locked {
  margin-top: 0.75rem;
  padding: 0.85rem 0.9rem 1rem;
}
.product-insight-gate-lead {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--wa-text);
}
.product-insight-gate-points {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--wa-muted);
}
.product-insight-gate-points li {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
}
.product-insight-gate-points li::before {
  content: "+";
  flex-shrink: 0;
  font-family: var(--wa-font-mono);
  font-weight: 700;
  color: var(--wa-accent);
}
.product-insight-gate-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}
.product-insight-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.35rem;
}
.product-insight-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wa-muted-2);
}
.product-insight-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  line-height: 1.2;
  border: 1px solid var(--wa-border);
  color: var(--wa-text);
  background: var(--wa-surface);
}
.product-insight-status[data-status="due_soon"] {
  color: #8a5a00;
  border-color: color-mix(in srgb, #e8a317 55%, transparent);
  background: color-mix(in srgb, #e8a317 18%, transparent);
}
.product-insight-status[data-status="cool_down"] {
  color: var(--wa-muted);
  border-color: var(--wa-border);
  background: color-mix(in srgb, var(--wa-muted) 10%, transparent);
}
.product-insight-status[data-status="available_now"] {
  color: #0f6b3c;
  border-color: color-mix(in srgb, #3ddc97 55%, transparent);
  background: color-mix(in srgb, #3ddc97 16%, transparent);
}
.product-insight-status[data-status="watching"] {
  color: #1d4f91;
  border-color: color-mix(in srgb, #7eb6ff 55%, transparent);
  background: color-mix(in srgb, #7eb6ff 16%, transparent);
}
.product-insight-summary {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--wa-text);
}
.product-insight-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--wa-muted);
}
.product-insight-facts strong {
  color: var(--wa-text);
  font-weight: 600;
}
.product-secondary-market-trend-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wa-muted-2);
}
.product-secondary-market-trend-wrap {
  position: relative;
  height: 160px;
  margin-top: 0.35rem;
}
.product-insight-legend {
  margin: 0.7rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--wa-border);
}
.product-insight-legend > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wa-muted-2);
  user-select: none;
}
.product-insight-legend > summary::-webkit-details-marker {
  display: none;
}
.product-insight-legend > summary::before {
  content: ">";
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 0.15s ease;
}
.product-insight-legend[open] > summary::before {
  transform: rotate(90deg);
}
.product-insight-legend-list {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}
.product-insight-legend-list li {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--wa-muted);
}
.product-insight-legend-list strong {
  color: var(--wa-text);
  font-weight: 600;
}
.product-insight-redacted {
  color: var(--wa-muted);
  font-style: italic;
  font-weight: 500;
}
.product-insight-upgrade {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
}
.product-insight-status.is-redacted {
  color: var(--wa-muted);
  border-color: var(--wa-border);
  background: color-mix(in srgb, var(--wa-muted) 8%, transparent);
}
.product-insight.is-ai {
  border-color: color-mix(in srgb, var(--wa-accent, #c45c26) 40%, var(--wa-border, #ddd));
}
.product-insight-ai-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #fff;
  background: color-mix(in srgb, var(--wa-accent, #c45c26) 85%, #222);
}
.product-ai-history {
  margin-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--wa-border, #ddd) 80%, transparent);
  padding-top: 0.65rem;
}
.product-ai-history > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wa-muted, #666);
  list-style: none;
}
.product-ai-history > summary::-webkit-details-marker { display: none; }
.product-ai-history > summary::before {
  content: "▸ ";
  font-size: 0.75rem;
}
.product-ai-history[open] > summary::before { content: "▾ "; }
.product-ai-history-wrap {
  margin-top: 0.55rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.product-ai-history-table {
  width: 100%;
  min-width: 28rem;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.product-ai-history-table th {
  font-weight: 600;
  color: var(--wa-muted, #666);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 0.35rem 0.55rem 0.4rem 0;
  border-bottom: 1px solid var(--wa-border, #ddd);
  white-space: nowrap;
}
.product-ai-history-table td {
  padding: 0.45rem 0.55rem 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--wa-border, #ddd) 55%, transparent);
  vertical-align: top;
  color: var(--wa-text, #222);
}
.product-ai-history-table tr:last-child td {
  border-bottom: none;
}
.product-ai-history-table .col-conf,
.product-ai-history-table .col-predicted-on {
  color: var(--wa-muted, #666);
  white-space: nowrap;
}
.product-ai-history-table .col-predicted-on {
  font-size: 0.74rem;
}
.product-ai-history-accuracy {
  font-weight: 700;
}
.product-ai-history-accuracy[data-accuracy="exact"],
.product-ai-history-accuracy[data-accuracy="within_1d"] {
  color: #2e7d32;
}
.product-ai-history-accuracy[data-accuracy="within_3d"],
.product-ai-history-accuracy[data-accuracy="within_7d"] {
  color: #ef6c00;
}
.product-ai-history-accuracy[data-accuracy="missed"],
.product-ai-history-accuracy[data-accuracy="no_restock"],
.product-ai-history-accuracy[data-accuracy="no_date"] {
  color: #c62828;
}
.product-ai-history-accuracy[data-accuracy="pending"] {
  color: var(--wa-muted, #666);
}
@media (max-width: 768px) {
  .product-hero { grid-template-columns: 1fr; }
  .product-hero-heading.has-secondary-market-price {
    padding-right: 0;
  }
  .product-secondary-market-price {
    position: static;
    max-width: none;
    margin: 0 0 0.55rem;
    text-align: left;
  }
}
.product-hero img,
.product-image-placeholder {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  padding: 0.5rem;
}
.product-watcher-count {
  width: 100%;
}
.product-widget {
  border: 1px solid var(--wa-border);
  border-radius: 0.5rem;
  background: var(--wa-surface);
  padding: 1rem 1.25rem;
}
.product-widget--flush {
  padding: 0;
  overflow: hidden;
}
.product-widget--nested {
  padding: 1rem;
}
.alias-block {
  margin-bottom: 1rem;
}
.alias-block h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.alias-row {
  font-size: 0.9rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--wa-border);
}
.alias-row:first-of-type { border-top: none; }
.alias-meta { color: var(--wa-muted); font-size: 0.8rem; }
.product-aliases-compact {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
.product-alias-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.2rem 0;
}
.product-alias-state {
  font-weight: 600;
  color: var(--wa-muted-2);
  flex-shrink: 0;
}
.product-alias-query {
  color: var(--wa-text);
  font-family: var(--wa-font-mono);
  font-size: 0.82rem;
  word-break: break-word;
}
.availability-table {
  font-size: 0.88rem;
}
.availability-table th {
  font-weight: 600;
  color: var(--wa-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-color: var(--wa-border);
  white-space: nowrap;
}
.availability-table td {
  border-bottom-color: var(--wa-border);
  vertical-align: middle;
}
.availability-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.product-availability-layout {
  align-items: flex-start;
}
.product-state-filter-panel {
  position: sticky;
  top: 1rem;
}
.product-state-filter-panel h6 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}
.product-state-filter-panel .form-check {
  margin-bottom: 0.65rem;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}
.product-state-filter-panel .form-check-input {
  margin-top: 0.2rem;
}
.product-state-option-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.35;
  flex: 1;
}
.product-state-filter-unavailable {
  opacity: 0.6;
  color: var(--wa-muted);
}
.product-state-filter-unavailable .form-check-input,
.product-state-filter-unavailable .product-state-option-label {
  cursor: pointer;
}
.product-state-filter-unavailable .form-check-input:checked {
  opacity: 1;
}
.product-state-filter-flag {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border: 1px solid var(--wa-border);
  flex-shrink: 0;
}
.availability-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.availability-toolbar .form-select {
  width: auto;
  min-width: 8rem;
}
.availability-stock-increase-filter-disabled {
  opacity: 0.55;
}
.unicorn-auctions-panel--unavailable {
  opacity: 0.55;
  pointer-events: none;
  background: var(--wa-surface);
}
.product-stock-chart-panel {
  margin-bottom: 0;
  min-width: 0;
}
.product-stock-chart-panel .product-stock-chart-lead {
  font-size: 0.78rem;
  line-height: 1.45;
}
.product-stock-chart-wrap {
  position: relative;
  height: 240px;
}
.product-stock-chart-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--wa-muted);
  font-size: 0.9rem;
}
.product-stock-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.65rem;
}
.product-stock-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--wa-text);
}
.product-stock-chart-legend-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.product-stock-chart-legend-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.product-stock-chart-preview {
  position: relative;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid var(--wa-border);
  background: var(--wa-surface);
}
.product-stock-chart-shell {
  height: 240px;
  padding: 0.75rem 0.85rem 0.45rem 0.55rem;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 0.35rem;
  row-gap: 0.35rem;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}
.product-stock-chart-shell-y {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--wa-muted);
  text-align: right;
  line-height: 1;
}
.product-stock-chart-shell-plot {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  border-left: 1px solid var(--wa-border);
  border-bottom: 1px solid var(--wa-border);
  background-image: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent calc(25% - 1px),
    var(--wa-border) calc(25% - 1px),
    var(--wa-border) 25%
  );
}
.product-stock-chart-shell-line {
  position: absolute;
  inset: 0.35rem 0.15rem 0.2rem;
  width: calc(100% - 0.3rem);
  height: calc(100% - 0.55rem);
  color: var(--wa-accent);
  opacity: 0.7;
}
.product-stock-chart-shell-x {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  font-size: 0.68rem;
  color: var(--wa-muted);
  text-align: center;
}
.product-stock-chart-shell-x span {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}
.product-stock-chart-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(248, 248, 248, 0.15) 0%,
    rgba(248, 248, 248, 0.82) 45%,
    rgba(248, 248, 248, 0.95) 100%
  );
}
html[data-theme="dark"] .product-stock-chart-preview-overlay {
  background: linear-gradient(
    180deg,
    rgba(17, 17, 17, 0.1) 0%,
    rgba(17, 17, 17, 0.78) 45%,
    rgba(17, 17, 17, 0.94) 100%
  );
}
.product-stock-chart-preview-states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  justify-content: center;
  margin-bottom: 0.85rem;
}
.product-stock-chart-preview-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--wa-muted);
}
.product-secondary-panels {
  align-items: stretch;
}
.product-secondary-panels .sightings-panel,
.product-secondary-panels .unicorn-auctions-panel {
  margin-bottom: 0;
  height: 100%;
}

/* Cap long lists so one full panel cannot stretch its neighbor into empty
   space. Only applies where the panels sit side by side (lg and up); when they
   stack on smaller screens they grow naturally with no nested scroll trap. */
@media (min-width: 992px) {
  .product-scroll-list {
    max-height: 420px;
    overflow-y: auto;
  }
}
