:root {
  color-scheme: dark;
  --bg: #0d0f0f;
  --panel: #151918;
  --line: #303735;
  --text: #f0f1ed;
  --muted: #9ca5a0;
  --acid: #b9f35a;
  --amber: #f2bf63;
  --max: 1160px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, sans-serif; }
button, a { font: inherit; }
.shell { width: min(calc(100% - 32px), var(--max)); margin-inline: auto; }
.masthead { min-height: 72px; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; font-weight: 900; letter-spacing: .08em; }
nav { display: flex; gap: 6px; flex: 1; }
.nav-button { border: 0; background: transparent; color: var(--muted); padding: 10px 12px; cursor: pointer; }
.nav-button.is-active { color: var(--text); background: var(--panel); }
.nav-link { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.status, .pro-badge { border: 1px solid #4f682c; color: var(--acid); padding: 5px 9px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.status.is-stale { border-color: #775d2e; color: var(--amber); }
.hero { padding: 72px 0 40px; }
.eyebrow { color: var(--acid); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 6px 0 12px; font-size: clamp(38px, 7vw, 82px); line-height: .96; letter-spacing: -.04em; }
h2 { margin: 4px 0 18px; font-size: 25px; }
.lede { max-width: 760px; color: #c5cbc7; font-size: 19px; }
.profile-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.profile-line > * { border: 1px solid var(--line); padding: 7px 10px; }
.as-of, .metric-note, footer, .caution { color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.metric { min-height: 154px; background: var(--panel); padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-label { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.metric strong { font-size: 38px; letter-spacing: -.04em; }
.metric small { color: var(--muted); font-size: 13px; letter-spacing: 0; }
.warning strong { color: var(--amber); }
.panel { margin-top: 28px; border: 1px solid var(--line); background: var(--panel); padding: clamp(22px, 4vw, 44px); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.two-column > div + div { border-left: 1px solid var(--line); padding-left: 48px; }
.range { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0; }
.range span { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 14px; }
.range b { font-size: 28px; }
.range small { color: var(--muted); }
.movement-list { list-style: none; padding: 0; }
.movement-list li { display: grid; grid-template-columns: 60px 1fr; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.movement-list strong { font-size: 28px; }
.movement-list span { color: #c7cdc9; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h1, #evidence h1 { font-size: clamp(36px, 5vw, 62px); }
.compact { margin-top: 32px; grid-template-columns: repeat(3, 1fr); }
.pro-explanation { max-width: 760px; margin-top: 34px; }
.pro-watch { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.pro-watch-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; gap: 12px; align-items: end; }
.pro-watch-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pro-watch-form select, .pro-watch-form input, .pro-watch-form button { min-height: 42px; border: 1px solid var(--line); background: #0d100f; color: var(--text); padding: 8px 10px; }
.pro-watch-form button { cursor: pointer; color: var(--acid); }
.pro-watch-status { margin: 20px 0 6px; padding: 14px; border-left: 3px solid var(--acid); background: #151a17; font-weight: 800; }
.pro-watch-status[data-state="suppressed"] { border-color: var(--amber); color: var(--amber); }
.pro-watch-status[data-state="triggered"] { box-shadow: inset 0 0 0 1px #4f682c; }
.pro-watch-evidence { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.evidence-grid div { background: #111413; padding: 18px; }
.evidence-grid dt { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.evidence-grid dd { margin: 5px 0 0; }
code { overflow-wrap: anywhere; color: var(--acid); }
.limitations { color: #c6ccc8; }
.map-hero { padding-bottom: 28px; }
.map-span { color: var(--muted); font-size: 13px; }
.map-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.map-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.map-table th, .map-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.map-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.map-table td:nth-child(3) { color: var(--acid); }
.map-table tbody tr:last-child td { border-bottom: 0; }
#hot-zone-base { font-size: 25px; letter-spacing: -.02em; }
.hot-zone-table td:nth-child(2), .hot-zone-table td:nth-child(6) { color: var(--acid); }
.temporal-table td:nth-child(2), .temporal-table td:nth-child(7) { color: var(--acid); }
.explorer-hero { padding-bottom: 28px; }
.explorer-metrics { margin-bottom: 28px; }
.static-catalog-state a { color: var(--acid); }
.explorer-controls { margin-top: 0; }
.clear-filters, .pagination button {
  border: 1px solid var(--line);
  background: #111413;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}
.clear-filters:disabled, .pagination button:disabled { color: #69716d; cursor: not-allowed; }
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 0; border: 0; }
.filter-grid label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.filter-grid input, .filter-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0f1211;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.filter-grid input:focus, .filter-grid select:focus, .clear-filters:focus-visible, .pagination button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}
.filter-grid:disabled { opacity: .64; }
.search-filter { grid-column: span 2; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.results-heading { align-items: end; }
.results-heading .map-span { margin: 0 0 18px; text-align: right; }
.explorer-table { min-width: 1120px; }
.explorer-table th:first-child { min-width: 290px; }
.explorer-table th:nth-child(3) { min-width: 180px; }
.explorer-table th:nth-child(4) { min-width: 200px; }
.explorer-table td { vertical-align: top; }
.explorer-table td:nth-child(3) { color: var(--text); }
.item-identity, .price-cell { display: flex; align-items: flex-start; gap: 12px; }
.item-identity > div, .price-cell > span, .stacked-cell { display: flex; flex-direction: column; gap: 2px; }
.item-identity span, .item-identity small, .price-cell small, .stacked-cell small { color: var(--muted); font-size: 12px; }
.item-icon {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  object-fit: contain;
  background: #0d100f;
  border: 1px solid var(--line);
}
.currency-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  object-fit: contain;
  background: #0d100f;
  border: 1px solid var(--line);
}
.item-icon.is-missing, .currency-icon.is-missing {
  background-color: #202522;
  background-image: linear-gradient(135deg, transparent 47%, #3b433f 48%, #3b433f 52%, transparent 53%);
}
.item-details { min-width: 130px; }
.item-details summary { color: var(--acid); cursor: pointer; white-space: nowrap; }
.item-details-content { width: min(440px, 70vw); padding-top: 14px; }
.item-details-content h3 { margin: 14px 0 6px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.mod-list { margin: 0; padding-left: 18px; color: #d5dad7; }
.mod-list li { margin: 4px 0; }
.mod-list li > span, .mod-list li > small, .mod-list li > code { display: block; }
.mod-list li > small { color: var(--muted); font-size: 11px; }
.mod-list li > code { margin-top: 2px; font-size: 10px; }
.scope-list { margin: 0; padding-left: 18px; }
.scope-list li { margin: 6px 0; }
.scope-list small { display: block; color: var(--muted); }
.item-metadata { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 16px 0 0; font-size: 12px; }
.item-metadata dt { color: var(--muted); }
.item-metadata dd { margin: 0; overflow-wrap: anywhere; }
.pagination { justify-content: flex-end; align-items: center; gap: 12px; margin-top: 18px; }
.asset-provenance code { font-size: 12px; }
footer { min-height: 90px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
[hidden] { display: none !important; }

@media (max-width: 800px) {
  .masthead { align-items: flex-start; padding: 18px 0; flex-wrap: wrap; gap: 10px; }
  nav { order: 3; width: 100%; overflow-x: auto; }
  .status { margin-left: auto; }
  .hero { padding-top: 48px; }
  .metric-grid, .compact { grid-template-columns: 1fr 1fr; }
  .two-column { grid-template-columns: 1fr; gap: 28px; }
  .two-column > div + div { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .evidence-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .pro-watch-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .metric-grid, .compact { grid-template-columns: 1fr; }
  .metric { min-height: 124px; }
  .filter-grid { grid-template-columns: 1fr; }
  .pro-watch-form { grid-template-columns: 1fr; }
  .search-filter { grid-column: auto; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .results-heading .map-span { text-align: left; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

/* Ritual Market V0.1 reuses the established shell and adds its evidence views. */
.ritual-shell { padding-bottom: 64px; }
.ritual-title-row { display: flex; align-items: center; gap: 20px; }
.ritual-icon { width: 76px; height: 76px; object-fit: contain; filter: drop-shadow(0 0 18px rgba(206, 156, 74, .28)); }
.cohort-list { display: grid; gap: 16px; }
.cohort-card { border: 1px solid var(--line); background: rgba(12, 15, 18, .55); padding: 18px; }
.cohort-card.is-pending { border-style: dashed; opacity: .78; }
.cohort-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cohort-head h3 { margin: 6px 0 8px; font-size: 16px; line-height: 1.45; }
.cohort-rank { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.status-pill { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.status-pill.ready { color: var(--positive); }
.status-pill.pending { color: var(--warning); }
.coverage-line { color: var(--muted); font-size: 13px; }
.denomination-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.denomination-card { border-left: 2px solid var(--accent); background: rgba(0, 0, 0, .18); padding: 14px; }
.denomination-heading, .price-with-icon { display: flex; align-items: center; gap: 7px; text-transform: capitalize; }
.currency-icon { width: 22px; height: 22px; object-fit: contain; }
.denomination-metrics { display: grid; gap: 6px; margin: 11px 0; }
.denomination-metrics div { display: flex; justify-content: space-between; gap: 16px; }
.denomination-metrics dt { color: var(--muted); }
.denomination-metrics dd { margin: 0; font-weight: 700; }
.filter-panel { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.filter-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.filter-panel input, .filter-panel select { min-width: 190px; color: var(--text); background: #0d1013; border: 1px solid var(--line); padding: 10px 11px; }
.item-identity { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.item-identity div { display: grid; gap: 3px; }
.table-item-icon { width: 46px; height: 46px; object-fit: contain; }
.modifier-list { margin: 0; padding-left: 16px; min-width: 260px; }
.modifier-list li + li { margin-top: 6px; }
.pagination { display: flex; justify-content: center; }
.pagination button { color: var(--text); background: transparent; border: 1px solid var(--line); padding: 9px 13px; }
.pagination button:disabled { opacity: .35; }
.empty-state { color: var(--muted); }

@media (max-width: 800px) {
  .ritual-title-row { align-items: flex-start; }
  .ritual-icon { width: 54px; height: 54px; }
  .cohort-head { display: grid; }
  .filter-panel { display: grid; align-items: stretch; }
  .filter-panel input, .filter-panel select { width: 100%; min-width: 0; }
}
