:root {
  --bg: #f4f5f9; --surface: #ffffff; --ink: #0d1224; --ink2: #475069; --muted: #6f7891; --line: #e6e8f0;
  --accent: #6a4cf5; --accent-ink: #ffffff; --accent-soft: #eeebfe; --accent-text: #5236d6;
  --up: #d92d3a; --down: #1f5fd1; --market: #868da1; --grid: #eceef4; --zero: #c3c7d4;
  --hero1: #121834; --hero2: #33237c; --shadow: 0 1px 2px rgba(13,18,36,.05), 0 10px 30px rgba(13,18,36,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f1a; --surface: #141a29; --ink: #eef0f8; --ink2: #b7bdd2; --muted: #8b93ab; --line: #252d42;
    --accent: #8f7bff; --accent-ink: #0b0f1a; --accent-soft: #231f47; --accent-text: #b5a8ff;
    --up: #ff6b72; --down: #6ea5ff; --market: #6b7388; --grid: #212839; --zero: #3a435c;
    --hero1: #171f40; --hero2: #3a2a86; --shadow: none;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); line-height: 1.5; min-height: 100vh;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
b, dd, .num, td { font-variant-numeric: tabular-nums; }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.up { color: var(--up); } .down { color: var(--down); } .flat, .mute { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 머리 */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .08em; font-size: 15px; }
.top .brand { margin-right: auto; }
.mark { width: 28px; height: 28px; flex: none; }
.mark-bg { fill: var(--accent); }
.mark-line { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.mark-dot { fill: #fff; }
.seg { display: flex; background: var(--line); border-radius: 10px; padding: 3px; }
.seg a { padding: 4px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink2); }
.seg a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 8px 0 8px 4px; }
.tabs { display: flex; gap: 22px; }
.tabs a { padding: 8px 0 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--accent); }
main.wrap { padding-top: 18px; padding-bottom: 8px; }
.foot { color: var(--muted); font-size: 12px; padding-top: 14px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); text-align: center; }

/* 첫머리 */
.hero { color: #fff; border-radius: 22px; padding: 26px 22px 20px; background: radial-gradient(120% 140% at 100% 0%, var(--hero2), var(--hero1) 62%); box-shadow: var(--shadow); }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--accent-text); }
.hero .eyebrow { color: #c3b8ff; }
.hero h1 { font-size: clamp(25px, 6.4vw, 34px); line-height: 1.22; margin: 8px 0 8px; letter-spacing: -.02em; }
.hero .lead { color: #cdd2ea; max-width: 34em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; }
.stats dt { font-size: 12px; color: #aab1d2; }
.stats dd { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stats small { font-size: 14px; font-weight: 600; margin-left: 2px; }

/* 날짜 */
.datenav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 12px; }
.arrow { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 22px; line-height: 1; }
.arrow.off { opacity: .35; }
select { font: inherit; font-size: 16px; font-weight: 600; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.when { margin-left: auto; color: var(--muted); font-size: 13px; }

/* 카드 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.flush { padding: 4px 10px; }
.card.center { text-align: center; padding: 44px 20px; margin-top: 24px; }
.card.center p { margin-top: 10px; color: var(--ink2); }
h2 { font-size: 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
h2 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.fine { font-size: 12px; color: var(--muted); margin-top: 12px; }
.empty { color: var(--muted); padding: 14px 0 4px; }
.track { font-size: 12.5px; color: var(--ink2); background: var(--bg); border-radius: 10px; padding: 9px 12px; margin-bottom: 2px; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--ink2); vertical-align: 1px; white-space: nowrap; }
.chip.on { background: var(--accent-soft); color: var(--accent-text); }
.tag { font-size: 12px; font-weight: 800; color: var(--accent-text); margin-right: 2px; }

/* 종목·모델 줄 */
.stocks li, .rows li a { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.stocks li + li, .rows li + li { border-top: 1px solid var(--line); }
.rank { width: 22px; flex: none; text-align: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.stocks li.hot .rank { color: var(--accent-text); }
.who { flex: 1; min-width: 0; }
.name { font-weight: 700; }
.meta { font-size: 12px; color: var(--muted); }
.num { text-align: right; flex: none; }
.num b { display: block; font-size: 15px; }
.num span { display: block; font-size: 12px; color: var(--muted); }
.votes { display: block; width: 100%; max-width: 220px; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--grid); }
.votes rect { fill: var(--accent); }
.rows li a:hover .name { color: var(--accent-text); }

/* 모델 성적 */
.headline { margin: 4px 0 12px; }
.headline h1 { font-size: 22px; letter-spacing: -.02em; }
.headline p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.back { margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.sorts { display: flex; gap: 6px; margin-bottom: 10px; }
.sorts a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink2); }
.sorts a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 700; }
.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: right; padding: 8px 4px; vertical-align: bottom; line-height: 1.3; white-space: nowrap; }
.grid td { text-align: right; padding: 10px 4px; border-top: 1px solid var(--line); white-space: nowrap; }
.grid th:first-child, .grid td:first-child { text-align: left; }
.grid td:first-child { white-space: normal; width: 100%; }
.grid td small { display: block; font-size: 11px; color: var(--muted); }
.history { margin-top: 12px; }
.history td:first-child { white-space: nowrap; width: auto; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.tiles div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; min-width: 0; }
.tiles dt { font-size: 12px; color: var(--muted); }
.tiles dd { font-size: clamp(17px, 5vw, 24px); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.tiles small { display: block; font-size: 11px; color: var(--muted); }
.past { font-size: 12.5px; color: var(--ink2); margin: 0 2px 14px; }

/* 그림 */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.k-model { background: var(--accent); } .k-market { background: var(--market); }
.chart { display: block; width: 100%; max-width: 520px; height: auto; margin: 8px auto 0; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .zero { stroke: var(--zero); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10px; }
.chart .b-model { fill: var(--accent); }
.chart .b-market { fill: var(--market); }
.chart .hit { fill: transparent; }
.chart .day:hover .hit { fill: var(--grid); opacity: .55; }

/* 입구 */
.primary { display: inline-block; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; padding: 12px 20px; cursor: pointer; text-align: center; }
.primary[disabled] { opacity: .45; cursor: not-allowed; }
body.landing { background: radial-gradient(90% 70% at 90% -10%, #3b2a91, #121834 55%, #0b0f1f) fixed; color: #fff; }
.land { max-width: 980px; margin: 0 auto; min-height: 100vh; display: grid; gap: 28px; align-content: center;
  padding: calc(32px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom)); }
.land .brand { margin-bottom: 34px; }
.land .mark-bg { fill: #7a60ff; }
.land .eyebrow { color: #c3b8ff; }
.land h1 { font-size: clamp(34px, 9.4vw, 54px); line-height: 1.16; letter-spacing: -.035em; margin: 10px 0 14px; }
.land .lead { color: #cdd2ea; font-size: 16px; max-width: 30em; }
.points { margin-top: 24px; display: grid; gap: 12px; }
.points li { display: grid; gap: 1px; border-left: 3px solid #7a60ff; padding-left: 12px; }
.points span { color: #aab1d2; font-size: 13.5px; }
.land-form .card { color: var(--ink); border: 0; padding: 24px 20px; margin: 0; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.land-form h2 { margin-bottom: 16px; }
.land-form label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 6px; }
.land-form input[type=password] { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); margin-bottom: 12px; }
.land-form .primary { width: 100%; }
.alert { background: var(--accent-soft); color: var(--accent-text); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; }
@media (min-width: 820px) {
  .land { grid-template-columns: 1.25fr .75fr; align-items: center; gap: 56px; }
}
