:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #121821;
  --panel2: #19212c;
  --border: #273242;
  --text: #e9eef5;
  --muted: #a7b1be;
  --accent: #72c7ff;
  --gold: #ffd75e;
  --green: #78d7a1;
  --red: #ff9292;
  --radius: 14px;
  font-family: Arial, Helvetica, "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px; color: var(--text); background: var(--bg);
  font-size: 14px; line-height: 1.55; -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, select, input { color: var(--text); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 8px; left: -100vw; z-index: 20; padding: 10px 14px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.skip-link:focus { left: 8px; }
.topbar {
  min-height: 58px; display: flex; gap: 18px; align-items: center; padding: 8px max(18px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid var(--border); background: rgba(11, 13, 16, .95);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px);
}
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.brand img { display: block; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 700; padding: 7px 11px; border: 1px solid rgba(167,177,190,.14); border-radius: 8px; background: rgba(255,255,255,.012); white-space: nowrap; transition: color .16s ease,border-color .16s ease,background .16s ease,transform .2s cubic-bezier(.2,1.3,.35,1); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); border-color: rgba(114,199,255,.4); background: rgba(114,199,255,.08); }
.site-nav a:active { transform: scale(.97); }
.page-shell { width: min(1600px, 100%); margin: 0 auto; padding: 8px 22px 44px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
.page-heading-compact { align-items: center; margin-bottom: 12px; }
.page-heading-compact .eyebrow { margin-bottom: 2px; }
.page-heading-compact h1 { margin: 0; font-size: clamp(21px, 2vw, 27px); }
.page-heading-compact .snapshot { max-width: 46%; white-space: normal; }
.tool-title { min-width: 0; padding: 2px 5px 0; }
.tool-title .eyebrow { margin-bottom: 2px; }
.tool-title h1 { margin: 0 0 2px; font-size: clamp(21px, 2vw, 26px); }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 10px; letter-spacing: .16em; line-height: 1.3; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -.025em; }
h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.intro { max-width: 800px; margin-bottom: 0; color: var(--muted); }
.snapshot { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; padding-bottom: 3px; }
.range-snapshot { max-width: 100%; margin: 0 0 8px; padding: 0; font-size: 9px; line-height: 1.35; text-align: left; white-space: normal; }
.app-layout { display: grid; grid-template-columns: minmax(240px, 266px) minmax(320px, 340px) minmax(440px, 1fr); align-items: start; gap: 14px; }
.middle-column { display: grid; align-content: start; gap: 14px; min-width: 0; }
.content-column { display: grid; gap: 16px; min-width: 0; }
.result-column { padding-top: 48px; }
.panel {
  min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(21, 29, 40, .98), rgba(16, 22, 30, .98));
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}
.selector-panel { position: static; }
.range-sidebar { position: sticky; top: 70px; display: flex; height: calc(100vh - 84px); flex-direction: column; min-height: 0; overflow: hidden; padding: 14px; }
.range-disclosure { display: block; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; }
.range-disclosure-summary { display: grid; grid-template-columns: minmax(0,1fr) auto 12px; align-items: center; gap: 8px; padding: 0 0 10px; border-bottom: 1px solid rgba(157,184,203,.14); list-style: none; cursor: pointer; }
.range-disclosure-summary::-webkit-details-marker { display: none; }
.range-disclosure-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 5px; }
.range-disclosure-heading { display: grid; gap: 3px; min-width: 0; }
.range-disclosure-heading .eyebrow { margin-bottom: 1px; }
.range-disclosure-heading h2 { font-size: 15px; }
.range-disclosure-heading .range-weapon { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.range-disclosure-heading .range-format { margin: 0; }
.range-disclosure-chevron { width: 8px; height: 8px; border-right: 1.5px solid #a7b1be; border-bottom: 1.5px solid #a7b1be; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.range-disclosure[open] .range-disclosure-chevron { transform: rotate(225deg) translate(-1px,-1px); }
.range-disclosure[open] .range-sidebar-top { padding-top: 9px; }
.range-sidebar-top { flex: 0 0 auto; }
.range-disposition { color: var(--accent); font-size: 19px; font-variant-numeric: tabular-nums; font-weight: 800; }
.range-weapon { margin: 0; font-size: 19px; line-height: 1.2; font-weight: 800; }
.range-format { display: inline-block; margin: 2px 0 9px; color: var(--muted); font-size: 11px; }
.range-sidebar .search-label { min-width: 0; }
.range-sidebar .search-label input { min-height: 34px; margin-top: 4px; }
.range-list-scroll { height: max(100px, calc(100vh - 360px)); max-height: calc(100vh - 360px); margin: 8px -4px 0 0; padding-right: 4px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #73869b #111720; scrollbar-width: auto; }
.range-list-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 5px; }
.range-group + .range-group { margin-top: 14px; }
.range-group h3 { display: flex; justify-content: space-between; margin: 0 0 5px; color: var(--accent); font-size: 12px; font-weight: 700; }
.range-group h3 span { color: var(--muted); font-size: 10px; font-weight: 500; }
.range-item { padding: 6px 1px 7px; border-bottom: 1px solid rgba(39,50,66,.68); }
.range-item-head { display: flex; justify-content: space-between; align-items: start; gap: 5px; }
.range-item-name { min-width: 0; font-size: 11px; line-height: 1.35; font-weight: 700; }
.range-item-name small { display: block; color: var(--muted); font-size: 9px; font-weight: 400; }
.range-status { flex: 0 0 auto; color: #a9ebc4; font-size: 8px; line-height: 1.5; }
.status-unresolved .range-status { color: #ffe09a; }
.status-vintage .range-status { color: #d4c1ff; }
.range-item-value { margin: 2px 0 0; color: #dce7f3; font-size: 11px; line-height: 1.4; font-weight: 650; font-variant-numeric: tabular-nums; }
.range-item-value.range-missing { color: #778392; }
.range-item-recipe { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.status-spliced .range-status { color: #b9a6ff; }
.status-spliced.status-unresolved .range-status { color: #ffe09a; }
.splice-range-group { padding-top: 10px; border-top: 1px solid rgba(114,199,255,.18); }
.range-legend { display: flex; justify-content: space-between; gap: 4px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.range-legend span:first-child { color: #a9ebc4; }
.range-legend span:nth-child(2) { color: #ffe09a; }
.range-legend span:last-child { color: #d4c1ff; }
.selector-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 10px; }
.selector-field { min-width: 0; }
.selector-field > label { display: block; margin: 0 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.selector-field > select, .selector-field > input { width: 100%; min-height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; background: #0d1218; }
.selector-field .field-hint { margin-top: 3px; font-size: 9px; }
.selector-field-wide { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.range-heading { align-items: end; }
.quiet-button { border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; color: var(--muted); background: transparent; cursor: pointer; white-space: nowrap; }
.quiet-button:hover { color: var(--text); background: var(--panel2); }
.selector-panel > label, .lock-control > label, .search-label, .acquire-controls > label {
  display: block; margin: 13px 0 5px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.selector-panel select, .selector-panel input, .search-label input, .positive-slot select,
.lock-control select, .acquire-controls select {
  width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; background: #0d1218;
}
.subtle, .field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.search-label { min-width: 180px; margin: 0; }
.search-label input { display: block; margin-top: 5px; min-height: 36px; }
.disposition-box { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; margin: 14px 0 4px; padding: 11px 12px; border: 1px solid var(--border); background: rgba(8,12,17,.5); border-radius: 10px; }
.disposition-box > span { color: var(--muted); font-size: 12px; }
.disposition-box strong { color: var(--gold); font-size: 20px; font-variant-numeric: tabular-nums; }
.disposition-box small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.field-hint { display: block; margin: 5px 0 0; line-height: 1.45; }
.side-note { margin-top: 18px; padding: 13px; background: rgba(114,199,255,.07); border: 1px solid rgba(114,199,255,.18); border-radius: 10px; }
.side-note strong { color: #cdeaff; font-size: 12px; }
.side-note p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.section-intro { color: var(--muted); font-size: 12px; margin: -4px 0 13px; }
.table-scroll { overflow-x: auto; width: 100%; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid rgba(39,50,66,.75); }
thead th { color: var(--muted); font-size: 11px; font-weight: 700; background: rgba(8,12,17,.4); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.stat-table { min-width: 710px; }
.stat-table th:first-child { width: 30%; }
.stat-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
.stat-name { font-weight: 700; color: var(--text); }
.stat-name small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; }
.range-value { white-space: nowrap; }
.range-missing { color: #748090; }
.status-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag, .pill { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.tag.allowed { color: #a9ebc4; border-color: rgba(120,215,161,.35); background: rgba(120,215,161,.08); }
.tag.unresolved { color: #ffe09a; border-color: rgba(255,215,94,.35); background: rgba(255,215,94,.08); }
.tag.vintage { color: #d4c1ff; border-color: rgba(183,145,255,.35); background: rgba(183,145,255,.08); }
.tag.excluded { color: #818d9b; }
.pill { padding: 4px 9px; background: var(--panel2); color: var(--accent); font-weight: 700; }
.empty-state { margin: 12px 0 0; color: var(--muted); text-align: center; padding: 14px; }
.target-preview-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 14px; }
.riven-card-preview { min-width: 0; }
.riven-card { position: relative; width: 100%; max-width: 280px; margin: 0 auto; aspect-ratio: 292 / 380; container-type: inline-size; isolation: isolate; --riven: #d7b6ed; }
.riven-card-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; border: 1px solid rgba(196, 160, 221, .2); border-radius: 4%; pointer-events: none; }
.card-frame-space { position: absolute; inset: 0 0 auto; width: 100%; aspect-ratio: 292 / 512; transform: translateY(-12.890625%); }
.card-backing { position: absolute; left: 6.1644%; top: 0; width: 87.6712%; height: 100%; object-fit: fill; }
.riven-card-art::after { content: ""; position: absolute; inset: 39% 7.8% 11%; background: linear-gradient(180deg, transparent, #111019 23%, #111019cc); }
.card-illustration { position: absolute; left: 7.8767%; top: 17%; width: 83.2192%; height: 30%; object-fit: cover; opacity: .92; mask-image: linear-gradient(#000 78%, transparent); }
.card-top { position: absolute; z-index: 2; top: 14%; left: 50%; width: 96.2329%; transform: translateX(-50%); }
.card-side { position: absolute; top: 21%; width: 5.4795%; }
.card-side-right { left: 87.6986%; }
.card-side-left { left: 6.1644%; transform: scaleX(-1); }
.card-bottom { position: absolute; z-index: 2; top: 65%; left: 0; width: 100%; }
.card-rank-line { position: absolute; top: 84.6875%; left: 6.1644%; width: 87.6712%; }
.card-content { position: absolute; top: 40%; left: 9.5%; right: 9.5%; bottom: 12%; display: flex; flex-direction: column; }
.card-type { display: block; color: #d0c1dc; text-align: center; opacity: .85; font-size: 2.5cqw; line-height: 1.2; letter-spacing: .16em; }
.card-content h3 { margin: 3px 0 7px; overflow: hidden; color: var(--riven); text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 6.6cqw; font-weight: 500; line-height: 1.12; text-shadow: 0 2px 4px #000; }
.stat-fields { display: flex; flex-direction: column; gap: 1.1cqw; }
.card-stat-row { display: flex; align-items: center; min-width: 0; gap: 1px; color: #d7b6ed; }
.card-stat-row[hidden] { display: none; }
.card-stat-select { min-width: 0; height: 8.6cqw; flex: 1; padding: 0 1.8cqw; overflow: hidden; border: 1px solid #564062; border-radius: 3px; background: #21182ae6; color: inherit; text-overflow: ellipsis; white-space: nowrap; font-size: 3.5cqw; line-height: 1; }
.card-stat-row.negative .card-stat-select { border-color: #694a58; background: #271a24e8; }
.card-lock-toggle { display: grid; width: 8.6cqw; height: 8.6cqw; flex: 0 0 8.6cqw; place-items: center; padding: 0; border: 1px solid #564062; border-radius: 3px; background: #17131ce8; color: #b8a7c4; cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.card-lock-toggle svg { width: 4.8cqw; height: 4.8cqw; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.card-lock-toggle:hover:not(:disabled) { border-color: #d7b6ed; color: #f2d9ff; }
.card-lock-toggle[aria-pressed="true"] { border-color: #83d9ff; background: #174056e8; color: #9be4ff; box-shadow: 0 0 0 1px #5ccfff66, 0 0 9px #34b8ed44; }
.card-lock-toggle:active:not(:disabled) { transform: scale(.92); }
.card-lock-toggle:focus-visible, .card-stat-select:focus-visible { outline: 2px solid #8bdfff; outline-offset: 1px; }
.card-lock-toggle:disabled { cursor: not-allowed; opacity: .48; }
.card-stat-row .stat-sign { flex: 0 0 3.5cqw; width: 3.5cqw; color: #c8a5e5; text-align: center; font-size: 5cqw; }
.card-stat-row.negative, .card-stat-row.negative .stat-sign { color: #cb9bac; }
.card-stat-row small { display: none; }
.card-footer { margin: auto 0 0; padding: 4px 0 0; color: var(--riven); text-align: center; font-size: 3cqw; line-height: 1.3; }
.preview-caption { margin: 8px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.negative-fieldset { margin: 14px 0 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.negative-fieldset legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.negative-choices { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px 10px; }
.negative-choice { display: flex; align-items: flex-start; gap: 7px; padding: 6px; border-radius: 7px; background: rgba(8,12,17,.3); line-height: 1.35; }
.negative-choice input { margin: 2px 0 0; accent-color: var(--accent); }
.negative-choice span { font-size: 11px; }
.negative-choice small { display: block; color: var(--muted); font-size: 9px; }
.negative-choice.is-unresolved { outline: 1px dashed rgba(255,215,94,.4); }
.notice { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0; padding: 10px 12px; border-radius: 9px; font-size: 12px; }
.notice.warning { color: #ffe3a7; border: 1px solid rgba(255,215,94,.3); background: rgba(255,215,94,.07); }
.notice.error { color: #ffd2d2; border: 1px solid rgba(255,120,120,.35); background: rgba(255,120,120,.08); }
.load-pending { color: #b9d7ec; border: 1px solid rgba(114,199,255,.22); background: rgba(114,199,255,.055); }
.load-retry-button { min-height: 38px; flex: 0 0 auto; padding: 7px 12px; border: 1px solid rgba(255,170,170,.38); border-radius: 7px; color: #ffe4e4; background: rgba(255,255,255,.045); font: inherit; font-weight: 700; cursor: pointer; }
.load-retry-button:hover:not(:disabled) { border-color: rgba(255,190,190,.72); background: rgba(255,180,180,.1); }
.load-retry-button:disabled { opacity: .55; cursor: progress; }
.odds-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 10px 0 14px; }
.odds-lead, .metric { min-height: 99px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(8,12,17,.42); }
.odds-lead { border-color: rgba(114,199,255,.32); }
.odds-lead span, .metric span { color: var(--muted); font-size: 11px; }
.odds-lead strong { color: var(--accent); font-size: 17px; }
.metric strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.odds-lead small, .metric small { color: var(--muted); font-size: 10px; }
.reroll-count-control { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 10px; }
.reroll-count-control input { width: 54px; min-height: 25px; padding: 2px 5px; border: 1px solid var(--border); border-radius: 6px; background: #0d1218; color: var(--text); font: inherit; font-variant-numeric: tabular-nums; text-align: center; }
.reroll-count-control input[aria-invalid="true"] { border-color: #ff8181; box-shadow: 0 0 0 2px rgba(255,129,129,.14); }
.reroll-count-control input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.strategy-table { min-width: 560px; }
.strategy-table tbody tr[data-active="true"] { background: rgba(114,199,255,.08); }
.strategy-table tbody tr:hover { background: rgba(114,199,255,.045); }
.strategy-choice { display: flex; align-items: center; gap: 8px; min-height: 37px; cursor: pointer; }
.strategy-choice input { flex: 0 0 auto; appearance: none; width: 13px; height: 13px; margin: 0; border: 1px solid #8292a3; border-radius: 2px; background: #101720; cursor: pointer; }
.strategy-choice input:checked { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #101720; }
.strategy-choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.strategy-choice input:disabled { opacity: .45; cursor: not-allowed; }
.strategy-choice > span { display: flex; flex-direction: column; min-width: 0; }
.strategy-name { color: var(--text); font-weight: 700; }
.strategy-caption { display: block; color: var(--muted); font-size: 10px; font-weight: 400; }
.strategy-prob, .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.positive-color { color: var(--green); }
.negative-color { color: #ffbd87; }
.footnote { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.explain-box { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(8,12,17,.35); color: var(--muted); font-size: 12px; }
.explain-box strong { color: var(--text); }
.explain-box .highlight { color: var(--gold); font-weight: 700; }
.acquire-controls { display: grid; grid-template-columns: 130px minmax(180px,1fr) 120px minmax(160px,.8fr); align-items: center; gap: 8px 10px; margin: 0 0 10px; }
.acquire-controls > label { margin: 0; }
.acquire-controls select { min-height: 36px; padding: 6px 8px; }
.grade-table { min-width: 700px; }
.grade-table tr[data-selected="true"] { background: rgba(255,215,94,.07); }
.grade-name { color: var(--gold); font-weight: 800; }
.splice-table { min-width: 620px; }
.splice-row-selected { background: rgba(114,199,255,.06); }
.splice-setup { margin: 16px 0 3px; padding-top: 14px; border-top: 1px solid var(--border); }
.splice-setup h3 { margin: 0 0 9px; font-size: 13px; }
.setup-result-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 9px; }
.setup-result-grid .derivation-item { font-variant-numeric: tabular-nums; }
.math-panel { padding: 0; overflow: hidden; }
.math-panel > summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none; }
.math-panel > summary::-webkit-details-marker { display: none; }
.math-panel > summary p { margin-bottom: 3px; }
.math-panel > summary strong { font-size: 15px; }
.math-panel[open] .chevron { transform: rotate(180deg); }
.chevron { color: var(--muted); font-size: 20px; transition: transform .15s ease; }
.math-body { padding: 0 18px 18px; color: var(--muted); font-size: 12px; }
.math-body ul { padding-left: 20px; }
.math-body li { margin: 5px 0; }
.derivation { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.derivation-item { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: rgba(8,12,17,.3); }
.derivation-item strong { display: block; color: var(--text); margin-bottom: 3px; }
.source-note { margin: 12px 0 0; font-size: 11px; }
.site-footer { width: min(1480px, 100%); margin: 0 auto; padding: 18px 22px 30px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: #9fd9ff; }
@media (max-width: 1450px) {
  .acquire-controls { grid-template-columns: 120px minmax(0,1fr); }
}
@media (max-width: 1120px) {
  .app-layout { grid-template-columns: minmax(225px, .7fr) minmax(0, 1.3fr); gap: 12px; }
  .result-column { grid-column: 2; }
  .range-sidebar { height: calc(100vh - 78px); }
  .panel { padding: 15px; }
  .odds-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .negative-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .acquire-controls { grid-template-columns: 125px minmax(160px,1fr); }
  .setup-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .app-layout { display: flex; flex-direction: column; }
  .range-sidebar { position: static; width: 100%; height: auto; min-height: 0; overflow: visible; }
  .range-disclosure { flex: 0 1 auto; overflow: visible; }
  .range-list-scroll { height: auto; min-height: 100px; max-height: min(50vh, 360px); }
  .middle-column, .result-column { width: 100%; }
  .result-column { grid-column: auto; }
  .result-column { padding-top: 0; }
  .target-preview-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; }
}
@media (max-height: 640px) and (min-width: 901px) {
  .range-sidebar { position: static; height: auto; max-height: none; overflow: visible; }
  .range-disclosure { overflow: visible; }
  .range-list-scroll { height: auto; min-height: 100px; max-height: 45vh; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 7px 12px; gap: 8px; }
  .brand { gap: 7px; font-size: 12px; }
  .brand img { width: 32px; height: 32px; }
  .site-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; min-width: 0; margin-left: 0; gap: 4px; }
  .site-nav a { padding: 7px 5px; font-size: 11px; text-align: center; }
  .page-shell { padding: 15px 12px 38px; }
  .page-heading { display: block; margin-bottom: 16px; }
  .page-heading-compact { margin-bottom: 9px; }
  .page-heading-compact h1 { font-size: 21px; }
  .page-heading-compact .snapshot { max-width: none; margin-top: 4px; text-align: left; }
  .snapshot { margin-top: 9px; text-align: left; }
  .app-layout { display: flex; flex-direction: column; }
  .range-disclosure-summary { grid-template-columns: minmax(0,1fr) auto 12px; gap: 7px; padding-bottom: 8px; }
  .range-disclosure-heading { grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 2px 8px; }
  .range-disclosure-heading > div { grid-column: 1 / -1; }
  .range-disclosure-heading .range-weapon { font-size: 14px; }
  .range-disclosure-heading .range-format { justify-self: end; }
  .range-disposition { font-size: 17px; }
  .selector-panel { position: static; width: 100%; }
  .content-column { width: 100%; }
  .panel { padding: 13px; border-radius: 12px; }
  .panel-heading { gap: 8px; }
  .range-heading { align-items: stretch; flex-direction: column; }
  .search-label { min-width: 0; }
  .target-preview-layout { grid-template-columns: minmax(0, 1fr); }
  .selector-grid { grid-template-columns: minmax(0,1fr); }
  .selector-field-wide { grid-column: auto; }
  .riven-card { max-width: min(330px, 82vw); }
  .negative-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .odds-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .odds-lead, .metric { min-height: 88px; padding: 10px; }
  .acquire-controls { grid-template-columns: 1fr; gap: 5px; }
  .acquire-controls > label:not(:first-child) { margin-top: 7px; }
  .derivation { grid-template-columns: 1fr; }
  .setup-result-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 16px 12px 24px; }
}
@media (max-width: 390px) {
  body { min-width: 0; }
  .brand span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  .site-nav a { font-size: 10px; padding-inline: 3px; }
  .negative-choices { grid-template-columns: 1fr; }
  .odds-summary { grid-template-columns: 1fr 1fr; }
  .metric strong { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
