/* 로또 분석실 — 밝은/어두운 모드 공통 토큰. 차트 색은 데이터 시각화 기본 팔레트(검증됨)를 쓴다. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6e69;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e3eefc;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --pos: #e34948;
  --neg: #2a78d6;
  --up: #b42318;
  --down: #1c5cab;
  --good: #006300;
  --warn-bg: #fff4e0;
  --warn-ink: #7a4b00;
  --high-bg: #fde8e8;
  --high-ink: #a1201f;
  --low-bg: #e4f4e4;
  --low-ink: #135c13;
  --ball-y: #fbc400;
  --ball-b: #69c8f2;
  --ball-r: #ff7272;
  --ball-g: #aaaaaa;
  --ball-l: #b0d840;
  --ball-ink: #111111;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232322;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #9a9890;
    --grid: #2c2c2a;
    --axis: #45453f;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-ink: #ffffff;
    --accent-soft: #16273d;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --pos: #e66767;
    --neg: #3987e5;
    --up: #f08a8a;
    --down: #86b6ef;
    --good: #0ca30c;
    --warn-bg: #3a2a0c;
    --warn-ink: #f5c46b;
    --high-bg: #3d1717;
    --high-ink: #f4a3a3;
    --low-bg: #12301a;
    --low-ink: #8fd99a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232322; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a9890;
  --grid: #2c2c2a; --axis: #45453f; --border: rgba(255, 255, 255, 0.10); --accent: #3987e5; --accent-soft: #16273d;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --pos: #e66767; --neg: #3987e5; --up: #f08a8a; --down: #86b6ef; --good: #0ca30c;
  --warn-bg: #3a2a0c; --warn-ink: #f5c46b; --high-bg: #3d1717; --high-ink: #f4a3a3; --low-bg: #12301a; --low-ink: #8fd99a; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
[hidden] { display: none !important; }

/* ── 머리말·탭 ── */
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; }
.brand-mark .ball { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.brand-mark .ball:first-child { margin-left: 0; }
.data-note { margin: 0; color: var(--muted); font-size: 13px; }
.tabs-wrap { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; padding-bottom: 0; }
.tabs::-webkit-scrollbar { display: none; }
.top { position: relative; }
.tab {
  flex: none; padding: 10px 12px 11px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; white-space: nowrap;
  border-bottom: 2px solid transparent; border-radius: 0;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

main.wrap { padding-top: 18px; padding-bottom: 24px; min-height: 60vh; }
.panel { display: flex; flex-direction: column; gap: 16px; }
.loading { display: flex; gap: 8px; justify-content: center; padding: 80px 0; }
.loading .ball { animation: bob 1s ease-in-out infinite; }
.loading .ball:nth-child(2) { animation-delay: 0.15s; }
.loading .ball:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .loading .ball { animation: none; } }

/* ── 배치 ── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.grid-side { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 880px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2 > .span-2 { grid-column: 1 / -1; }
  .grid-side { grid-template-columns: 340px 1fr; }
}

/* ── 카드 ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.card-title { margin: 0 0 10px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head .card-title { margin: 0; }
.sub-title { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; font-size: 15px; font-weight: 700; }
.sub-title + .hbars { margin-bottom: 18px; }
.note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px; border-radius: 8px; margin: 0 0 10px; }
.lead { margin: 0 0 10px; font-size: 15.5px; color: var(--ink-2); }
.chart-summary { margin: 0 0 12px; color: var(--ink-2); }
.chart-summary .ball { vertical-align: -5px; }
.error-text { color: var(--high-ink); margin: 8px 0 0; min-height: 0; font-size: 14px; }
.error-text:empty { display: none; }
.card.error { border-color: var(--high-ink); }

/* ── 공 ── */
.balls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ball {
  --c: var(--ball-g);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 46%), var(--c);
  color: var(--ball-ink); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.ball-y { --c: var(--ball-y); }
.ball-b { --c: var(--ball-b); }
.ball-r { --c: var(--ball-r); }
.ball-g { --c: var(--ball-g); }
.ball-l { --c: var(--ball-l); }
.ball-sm { width: 26px; height: 26px; font-size: 12.5px; }
.ball-lg { width: 44px; height: 44px; font-size: 19px; }
.ball.is-dim { opacity: 0.28; }
.plus { color: var(--muted); font-weight: 700; margin: 0 -1px; }
@media (max-width: 400px) {
  .ball-lg { width: 38px; height: 38px; font-size: 16.5px; }
  .balls { gap: 5px; }
}

/* ── 요약 ── */
.hero-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hero-balls { margin: 6px 0 12px; }
.hero-prize { margin: 12px 0; font-size: 16px; }
.hero-prize strong { font-size: 18px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.chip.grade-low { background: var(--low-bg); color: var(--low-ink); }
.chip.grade-mid { background: var(--warn-bg); color: var(--warn-ink); }
.chip.grade-high { background: var(--high-bg); color: var(--high-ink); }
.prize-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.prize-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.prize-table th:not(:first-child) { text-align: right; }
.prize-table td { padding: 6px 0; border-bottom: 1px solid var(--grid); }
.prize-table tr:last-child td { border-bottom: 0; }
.next { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.next-title { font-weight: 700; font-size: 16px; margin: 2px 0; }
.dday { flex: none; font-size: 26px; font-weight: 800; color: var(--accent); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 880px) { .tiles-4 { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; height: 100%; box-shadow: var(--shadow); }
.card .tile { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card .tiles { margin-bottom: 14px; }
.tile-label { color: var(--muted); font-size: 13px; }
.tile-value { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; margin: 4px 0 2px; line-height: 1.25; }
.tile-sub { color: var(--muted); font-size: 12.5px; }
.tile-ball { display: inline-flex; align-items: center; gap: 8px; }
.tile-link { color: inherit; display: block; }
.tile-link:hover { text-decoration: none; }
.tile-link:hover .tile { border-color: var(--accent); }
.hot-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0; padding: 0; }
.hot-list li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; }
.facts { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); }
.facts strong { color: var(--ink); }
.draw-list { list-style: none; margin: 0; padding: 0; }
.draw-row { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.draw-row:last-child { border-bottom: 0; }
.draw-meta { display: flex; flex-direction: column; line-height: 1.3; }
.draw-prize { grid-column: 2; color: var(--ink-2); }
@media (min-width: 720px) {
  .draw-row { grid-template-columns: 92px auto 1fr; }
  .draw-prize { grid-column: auto; text-align: right; }
}
.more { display: inline-block; margin-top: 10px; font-weight: 600; }
.more-btn { margin-top: 12px; width: 100%; }

/* ── 조작 ── */
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.seg-btn { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.06); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--axis); position: relative; transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch-input:checked + .switch-track { background: var(--accent); }
.switch-input:checked + .switch-track::after { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.is-disabled { opacity: 0.45; pointer-events: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-lg { padding: 13px 28px; font-size: 16.5px; border-radius: 12px; min-width: 220px; }
.btn-text { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 6px 8px; font-size: 14px; font-weight: 600; }
.action { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; }
.text-input { flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.text-input.narrow { max-width: 140px; }
.text-input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.input-row .text-input { min-width: 160px; }
.counter { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.option-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 12px 0 8px; }
.option-label { font-weight: 650; min-width: 84px; }

/* 번호판(로또 용지처럼 7칸) */
.pad { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.pad-compact { max-width: 360px; gap: 5px; }
.pad-cell {
  --c: var(--ball-g);
  aspect-ratio: 1; border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); background: var(--surface);
  border-radius: 10px; cursor: pointer; font-weight: 650; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; padding: 0; position: relative;
}
.pad-compact .pad-cell { font-size: 14px; border-radius: 8px; }
.pad-cell:hover { background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.pad-cell[data-state="on"], .pad-cell[data-state="in"] { background: var(--c); border-color: var(--c); color: var(--ball-ink); }
.pad-cell[data-state="in"]::after { content: "고정"; position: absolute; bottom: 1px; font-size: 9px; font-weight: 700; line-height: 1; }
.pad-cell[data-state="out"] { background: var(--surface-2); border-color: var(--grid); color: var(--muted); text-decoration: line-through; }
.pad-cell[data-state="out"]::after { content: "제외"; position: absolute; bottom: 1px; font-size: 9px; font-weight: 700; line-height: 1; text-decoration: none; }
.pad-cell.ball-y { --c: var(--ball-y); }
.pad-cell.ball-b { --c: var(--ball-b); }
.pad-cell.ball-r { --c: var(--ball-r); }
.pad-cell.ball-g { --c: var(--ball-g); }
.pad-cell.ball-l { --c: var(--ball-l); }

/* ── 차트 ── */
.chart-box { width: 100%; min-height: 40px; }
.chart { display: block; overflow: visible; font-family: var(--font); }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 650; }
.chart .ref { stroke: var(--ink-2); stroke-width: 1; }
.chart .ref-label { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.chart .hit { fill: transparent; }
.chart .mk { cursor: default; outline: none; }
.chart .mk.is-pickable { cursor: pointer; }
.chart .mk-1 .bar { fill: var(--s1); }
.chart .mk-2 .bar { fill: var(--s2); }
.chart .mk-3 .bar { fill: var(--s3); }
.chart .mk-hl .bar { fill: var(--s2); }
.chart .mk-pos .bar { fill: var(--pos); }
.chart .mk-neg .bar { fill: var(--neg); }
.chart .mk.is-hover .bar, .chart .mk:focus-visible .bar { filter: brightness(1.15); }
.chart .mk.is-hover .hit, .chart .mk:focus-visible .hit { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.chart .theory { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .dot { fill: var(--s1); opacity: 0.55; }
.chart .dot-note { opacity: 1; stroke: var(--surface); stroke-width: 2; }
.chart .dot-ring { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.chart .seg-label { fill: var(--ball-ink); font-size: 13px; font-weight: 700; }
.chart .seg-label.on-dark { fill: #fff; }
.heat-box { overflow-x: auto; }
.heat-wrap { display: inline-block; }
.heat rect { cursor: pointer; }
.heat rect.is-hover { stroke: var(--ink); stroke-width: 1.5; }
.heat rect.heat-sel { stroke: var(--s2); stroke-width: 1; }
.heat-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.heat-scale { width: 140px; height: 10px; border-radius: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--ink-2); font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.key-rect { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.key-line { width: 16px; height: 2px; background: var(--ink); border-radius: 1px; flex: none; }
.mk-1-bg { background: var(--s1); }
.mk-2-bg { background: var(--s2); }
.mk-3-bg { background: var(--s3); }
.mk-pos-bg { background: var(--pos); }
.mk-neg-bg { background: var(--neg); }

/* 툴팁: 값이 먼저, 이름은 흐리게 */
.tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 120px; max-width: 260px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}
.tip-title { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tip-row strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.tip-label { color: var(--muted); }
.tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tip-key.k-bar { background: var(--s1); height: 8px; border-radius: 2px; }
.tip-key.k-line { background: var(--ink); }

/* 가로 막대 목록 */
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar-row { display: grid; grid-template-columns: 34px 1fr 52px; align-items: center; gap: 10px; }
.hbar-label { display: flex; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-2); }

/* 번호표 */
.num-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.num-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.num-table th.num { text-align: right; }
.num-table td { padding: 5px 8px; border-bottom: 1px solid var(--grid); }
.num-table tr.is-link { cursor: pointer; }
.num-table tr.is-link:hover td { background: var(--surface-2); }
.num-table td:first-child, .num-table th:first-child { padding-left: 0; }
.col-bar { width: 45%; }
.cell-bar { display: grid; grid-template-columns: 1fr 48px; gap: 8px; align-items: center; }
.cell-bar .num { font-size: 14px; }
.up { color: var(--up); }
.down { color: var(--down); }
@media (max-width: 560px) { .hide-sm { display: none; } .col-bar { width: 40%; } .num-table td, .num-table th { padding-left: 4px; padding-right: 4px; } }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--grid); flex-wrap: wrap; }
.rank-list li:last-child { border-bottom: 0; }
.rank { width: 20px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.rank-list strong { min-width: 40px; }
.rounds { flex-basis: 100%; padding-left: 30px; }
@media (min-width: 560px) { .rounds { flex-basis: auto; padding-left: 0; } }

.table-view { margin-top: 8px; }
.table-view summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.mini-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 6px; border-bottom: 1px solid var(--grid); }
.mini-table th.num { text-align: right; }
.mini-table tbody th { color: var(--ink-2); font-size: 13.5px; }
.mini-table td { padding: 6px 6px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.mini-table tr:last-child td, .mini-table tr:last-child th { border-bottom: 0; }
.mini-table .ball { vertical-align: middle; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 4px; border-bottom: 1px solid var(--grid); }
.rank-table th.num { text-align: right; }
.rank-table td { padding: 8px 4px; border-bottom: 1px solid var(--grid); }
.rank-table .balls { gap: 3px; }
.rank-table .ball-sm { width: 24px; height: 24px; font-size: 11.5px; }

/* ── 추천 ── */
.notice { background: var(--accent-soft); border-color: transparent; }
.notice p { margin: 0 0 8px; color: var(--ink-2); }
.notice p:last-child { margin-bottom: 0; }
.methods { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 720px) { .methods { grid-template-columns: repeat(3, 1fr); } .methods .method:first-child { grid-column: span 3; } }
@media (min-width: 1000px) { .methods { grid-template-columns: repeat(5, 1fr); } .methods .method:first-child { grid-column: auto; } }
.method {
  text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.method:hover { border-color: var(--axis); }
.method[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.method-title { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.method-desc { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.badge { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent); padding: 1px 7px; border-radius: 999px; }
.games { list-style: none; margin: 0; padding: 0; }
.game { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.game:last-child { border-bottom: 0; }
.game-letter { font-weight: 800; color: var(--muted); padding-top: 6px; }
.game-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.game-body .chips { margin: 0; }
.game-check { padding-top: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ── 내 번호 ── */
.check-out { display: flex; flex-direction: column; gap: 16px; }
.check-out:empty { display: none; }
.check-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grade { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; }
.grade-label { font-size: 22px; font-weight: 800; flex: none; }
.grade.grade-low { background: var(--low-bg); color: var(--low-ink); }
.grade.grade-mid { background: var(--warn-bg); color: var(--warn-ink); }
.grade.grade-high { background: var(--high-bg); color: var(--high-ink); }
.pop-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0; margin: 10px 0 0; }
.pop-chips li { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-size: 14px; }
.rank-compare { margin-top: 4px; }

/* ── 바닥글 ── */
.foot { padding-top: 8px; padding-bottom: 40px; color: var(--muted); font-size: 12.5px; }
.foot p { margin: 4px 0; }

@media (max-width: 560px) {
  .card { padding: 14px; border-radius: 12px; }
  .tile-value { font-size: 19px; }
  .next-title { font-size: 15px; }
  .dday { font-size: 22px; }
  .btn-lg { width: 100%; }
}
@media (forced-colors: active) {
  .ball, .pad-cell { border: 1px solid CanvasText; }
  .chart .bar { fill: CanvasText; }
}

/* 카드 안 타일은 폭이 좁아 두 칸으로 */
.card .tiles-4 { grid-template-columns: 1fr 1fr; }
.card .tile-value { font-size: 19px; }
.mini-table td strong { white-space: nowrap; }

/* ── 결론 카드 ── */
.verdict { border: 1.5px solid var(--accent); }
.verdict-title { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.verdict-lead { margin: 0 0 16px; font-size: 17px; color: var(--ink-2); }
.verdict-lead strong { color: var(--ink); }
.verdict-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 880px) { .verdict-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.verdict-col { min-width: 0; }
.verdict-col > .small { margin: 0 0 8px; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 800; flex: none; }
.verdict-table tr.is-base td { background: var(--accent-soft); }
.verdict-table td:first-child { padding-left: 8px; }
.share { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.share-row { display: grid; grid-template-columns: 9.5em 1fr 4.2em; align-items: center; gap: 10px; font-size: 14px; }
.share-label { color: var(--ink-2); }
.share-track { position: relative; height: 12px; background: var(--surface-2); border-radius: 4px; }
.share-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--axis); }
.share-fill { position: absolute; top: 0; bottom: 0; }
.share-fill.is-up { background: var(--pos); border-radius: 0 4px 4px 0; }
.share-fill.is-down { background: var(--neg); border-radius: 4px 0 0 4px; }
.verdict-point { margin: 6px 0 10px; font-weight: 700; font-size: 15.5px; }
.num-groups { display: flex; flex-direction: column; gap: 8px; }
.num-groups > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.num-groups .small { min-width: 6.5em; }
.verdict-rules { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--grid); }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.rules strong { color: var(--ink); }
.verdict-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.verdict-actions .btn:hover { text-decoration: none; }
@media (max-width: 560px) { .share-row { grid-template-columns: 7.5em 1fr 3.8em; font-size: 13px; } .verdict-title { font-size: 18px; } .verdict-lead { font-size: 16px; } }
.verdict-table { table-layout: auto; }
.verdict-table th.num { white-space: nowrap; }
@media (max-width: 560px) { .verdict-table td, .verdict-table th { padding-left: 4px; padding-right: 4px; font-size: 13px; } }
.grade { background: var(--surface-2); color: var(--ink); }
.verdict-balls { margin: 4px 0 12px; }
.verdict-tip { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; }
.verdict-tip strong { color: var(--ink); }
