/* Legendary Method — 웹 디자인 시스템 v2 (docs/design.md)
   레이아웃: 데스크탑 사이드바 셸 + 1240px 콘텐츠 그리드 / 폰은 상단바 + 가로 nav.
   색: 토큰만. 라이트 기본 → 시스템 다크 → 강제 다크 3단. */

:root {
  color-scheme: light;
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-2: #EAEEF3;
  --line: #D9DFE7; --line-2: #C5CDD8;
  --fg: #121820; --fg-2: #4E5A68; --fg-3: #7A8696;
  --accent: #0E7C86; --accent-2: #D8EFF1; --accent-fg: #FFFFFF;
  --up: #D12F3F; --up-bg: #FBE6E8; --down: #2563EB; --down-bg: #E3ECFD;
  --good: #1E8A5A; --good-bg: #E1F3EA; --warn: #B7791F; --warn-bg: #FBF0D9; --bad: #C2342B; --bad-bg: #FBE4E1;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 6px rgba(16,24,40,.06);
  --shadow-pop: 0 8px 24px rgba(16,24,40,.16);
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --side: 236px; --content-max: 1240px; --read-max: 760px;
  --theme-color: var(--accent-2); /* theme_highlight.js 가 카드별로 덮어씀 */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F1318; --surface: #171C23; --surface-2: #1F2630;
    --line: #2A323D; --line-2: #3A4452;
    --fg: #E7ECF2; --fg-2: #A6B1BE; --fg-3: #76838F;
    --accent: #3CC0C9; --accent-2: #113B40; --accent-fg: #06181A;
    --up: #FF6B6B; --up-bg: #3A1E22; --down: #6EA8FF; --down-bg: #1C2A45;
    --good: #4CCB8F; --good-bg: #16352A; --warn: #E6B04C; --warn-bg: #3A2F14; --bad: #F07167; --bad-bg: #3F1F1D;
    --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-pop: 0 10px 28px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1318; --surface: #171C23; --surface-2: #1F2630;
  --line: #2A323D; --line-2: #3A4452;
  --fg: #E7ECF2; --fg-2: #A6B1BE; --fg-3: #76838F;
  --accent: #3CC0C9; --accent-2: #113B40; --accent-fg: #06181A;
  --up: #FF6B6B; --up-bg: #3A1E22; --down: #6EA8FF; --down-bg: #1C2A45;
  --good: #4CCB8F; --good-bg: #16352A; --warn: #E6B04C; --warn-bg: #3A2F14; --bad: #F07167; --bad-bg: #3F1F1D;
  --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-pop: 0 10px 28px rgba(0,0,0,.55);
}

/* ── 리셋 ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
code, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── 셸 ── */
.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
.side {
  background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0;
  display: flex; flex-direction: column; gap: 6px; padding: 10px 16px;
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--fg); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 600; font-size: 11px; color: var(--fg-3); letter-spacing: .06em; text-transform: uppercase; }
.side nav { display: flex; gap: 14px; overflow-x: auto; min-width: 0; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.side nav::-webkit-scrollbar { display: none; }
.nav-grp { display: flex; gap: 4px; align-items: center; flex: none; }
.nav-grp .grp-label { display: none; }
.nav-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--fg-2); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.nav-item:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
.nav-item.on { background: var(--accent-2); color: var(--accent); }
.nav-item .ic { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.nav-item.soon { color: var(--fg-3); cursor: default; }
.nav-item.soon:hover { background: none; color: var(--fg-3); }
.nav-item .soon-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px; color: var(--fg-3); }
.side-foot { display: none; }
.theme-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--fg-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.theme-btn:hover { border-color: var(--line-2); color: var(--fg); }

.main { min-width: 0; }
.page { max-width: var(--content-max); margin: 0 auto; padding: 20px 16px 56px; min-width: 0; }
.page.read { max-width: var(--read-max); }
.foot { max-width: var(--content-max); margin: 0 auto; padding: 18px 16px 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-3); }

@media (min-width: 1024px) {
  .shell { grid-template-columns: var(--side) minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; height: 100vh; border-bottom: 0; border-right: 1px solid var(--line);
    padding: 22px 16px 18px; gap: 18px; overflow-y: auto;
  }
  .side-top .theme-btn { display: none; }
  .brand { font-size: 17px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .side nav { flex-direction: column; gap: 18px; overflow: visible; }
  .nav-grp { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-grp .grp-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); padding: 0 10px 6px; }
  .nav-item { font-size: 14px; padding: 8px 10px; }
  .side-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-3); }
  .page { padding: 32px 36px 72px; }
  .foot { padding: 20px 36px 40px; }
}

/* ── 페이지 헤더 ── */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ph-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ph h1 { font-size: 26px; font-weight: 800; }
.ph .sub { color: var(--fg-2); font-size: 14px; }
.ph-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-head { composes: ph; } /* 구 템플릿 호환 — 아래 .hero-head 규칙 */
.hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-title h1 { font-size: 26px; font-weight: 800; }
.hero-title .muted, .hero-title p { color: var(--fg-2); font-size: 14px; margin: 4px 0 0; }
@media (max-width: 639px) { .ph h1, .hero-title h1 { font-size: 22px; } }

.datebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.date { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.live-dot { font-size: 11px; font-weight: 700; color: var(--good); border: 1px solid var(--good); border-radius: 999px; padding: 1px 8px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--r-sm); }
.tab { padding: 6px 14px; border-radius: 4px; color: var(--fg-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab:hover { text-decoration: none; color: var(--fg); }
.tab.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.tab.off { opacity: .45; cursor: default; }
.reload-pill { margin: 0 0 14px; padding: 10px 14px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); text-align: center; border-radius: var(--r-sm); font-weight: 700; cursor: pointer; }

/* ── 텍스트 유틸 ── */
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.sec { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin: 26px 0 10px; }
.ph + .sec, .ph + section > .sec:first-child { margin-top: 0; }
.count { font-size: 12px; font-weight: 700; color: var(--fg-2); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
.empty { color: var(--fg-2); padding: 28px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); }
.empty code { font-size: 13px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }

/* ── 배지 / 칩 ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--fg-2); }
.badge.t-neutral { background: var(--surface-2); color: var(--fg-2); }
.badge.t-accent { background: var(--accent-2); color: var(--accent); }
.badge.t-good { background: var(--good-bg); color: var(--good); }
.badge.t-warn { background: var(--warn-bg); color: var(--warn); }
.badge.t-bad { background: var(--bad-bg); color: var(--bad); }
.badge.t-up { background: var(--up-bg); color: var(--up); }
.badge.t-down { background: var(--down-bg); color: var(--down); }
.badge.lim { background: var(--up-bg); color: var(--up); }
.badge.top { background: var(--accent-2); color: var(--accent); }
.regime { font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.regime.bull { background: var(--good-bg); color: var(--good); }
.regime.bear { background: var(--bad-bg); color: var(--bad); }
.kbadge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.kbadge.v0 { background: var(--surface-2); color: var(--fg-2); }
.kbadge.v1 { background: var(--accent-2); color: var(--accent); }
.kbadge.v2 { background: var(--good-bg); color: var(--good); }
.kbadge.vx { background: var(--bad-bg); color: var(--bad); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--fg); line-height: 1.3; }
a.chip:hover { border-color: var(--line-2); text-decoration: none; }
.chip b { color: var(--accent); font-weight: 700; }
.tchip { display: inline-flex; font-size: 12px; color: var(--fg-2); background: var(--surface-2); border-radius: var(--r-sm); padding: 3px 8px; }
a.tchip:hover { color: var(--fg); text-decoration: none; }
.card-themes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* 주도테마 팝오버 + 강조 (theme_pop.js / theme_highlight.js) */
.chip.has-pop { position: relative; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chip.has-pop::after { content: "›"; color: var(--fg-3); margin-left: 2px; font-size: 12px; transform: rotate(90deg); display: inline-block; }
.chip-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; display: none; min-width: 140px; max-width: 260px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-pop); white-space: normal; }
.chip-pop-item { display: block; font-size: 13px; line-height: 1.7; color: var(--fg); }
.chip-pop-item + .chip-pop-item { border-top: 1px solid var(--line); }
.chip.has-pop:hover .chip-pop, .chip.has-pop.pop-open .chip-pop { display: block; }
.chip[data-theme] { cursor: pointer; user-select: none; -webkit-user-select: none; }
.chip.theme-active { background: var(--theme-color); color: #16191E; border-color: rgba(0,0,0,.2); font-weight: 600; }
.chip.theme-active b, .chip.theme-active::after { color: rgba(0,0,0,.6); }

/* ── 카드 그리드 (종배 후보) ── */
.cands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 420px) { .cands-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; position: relative; min-width: 0; transition: background .12s ease; }
.card.top3 { border-left: 3px solid var(--accent); padding-left: 14px; }
.card.theme-hl { --fg: #16191E; --fg-2: #4A5563; --fg-3: #5F6B79; --line: rgba(0,0,0,.14); --line-2: rgba(0,0,0,.24); --surface-2: rgba(255,255,255,.55); --up: #B3122A; --down: #1649A8; --accent: #0B5F67; --accent-2: rgba(255,255,255,.6); --good: #176A46; --warn: #7A5A00; --bad: #A3271F; color: #16191E; border-color: rgba(0,0,0,.14); }
.card-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-top .rk { font-family: var(--mono); font-size: 12px; color: var(--fg-3); font-weight: 600; }
.card-top .nm { font-size: 17px; font-weight: 700; }
.card-top .cd { font-family: var(--mono); color: var(--fg-3); font-size: 12px; }
.card-top .ret { margin-left: auto; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ret.up { color: var(--up); } .ret.down { color: var(--down); }
.card-sub { margin-top: 6px; font-size: 13px; color: var(--fg-2); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.card-sub b { color: var(--fg); font-variant-numeric: tabular-nums; }
.card-sub em { font-style: normal; color: var(--fg-3); }

details.more { margin-top: 10px; }
details.more > summary, details.rawreport > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker, details.rawreport > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.rawreport > summary::before { content: "▸"; font-size: 11px; transition: transform .12s; }
details[open].more > summary::before, details[open].rawreport > summary::before { transform: rotate(90deg); }
.detail { margin-top: 10px; background: var(--surface-2); border-radius: var(--r-sm); padding: 4px 12px 12px; font-size: 13px; }
.dsec { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin: 14px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.dsec .warn { text-transform: none; letter-spacing: 0; color: var(--warn); font-weight: 600; }
.dnote { color: var(--fg-2); font-size: 13px; margin: 4px 0; }
.drow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.drow:first-of-type { border-top: 0; }
.drow .k { color: var(--fg-2); }
.drow span:last-child { font-variant-numeric: tabular-nums; text-align: right; }
.sizing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.sz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 6px; text-align: center; }
.sz .k { display: block; font-size: 11px; color: var(--fg-3); }
.sz .v { display: block; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sz .v.big { font-size: 17px; color: var(--accent); }
.mtx { border-collapse: collapse; width: 100%; font-size: 12px; margin: 6px 0; }
.mtx th, .mtx td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; font-variant-numeric: tabular-nums; }
.mtx th { color: var(--fg-3); font-weight: 600; }
.mtx td small { display: block; color: var(--fg-3); font-size: 10px; }

details.rawreport { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
details.rawreport .md { margin-top: 12px; }

/* ── 마크다운 본문 ── */
.md { font-size: 15px; line-height: 1.7; overflow-x: auto; max-width: 76ch; }
.md h1, .md h2, .md h3 { margin: 26px 0 10px; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 12px; }
.md li { margin: 3px 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 12px 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 9px; text-align: right; font-variant-numeric: tabular-nums; }
.md th { color: var(--fg-2); font-weight: 600; background: var(--surface-2); }
.md th:first-child, .md td:first-child { text-align: left; }
.md pre { background: var(--surface-2); padding: 12px 14px; border-radius: var(--r-sm); overflow-x: auto; font-size: 12.5px; line-height: 1.45; }
.md code { font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md pre code { background: none; padding: 0; white-space: pre; }
.md blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); color: var(--fg-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.md strong { font-weight: 700; }
.md-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; }
.md-card .md { max-width: none; }

/* ── 표 ── */
.tbl, .ktable { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td, .ktable th, .ktable td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl thead th, .ktable thead th { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); background: var(--surface-2); }
.ktable > tbody > tr > th, .ktable > tr > th { width: 120px; color: var(--fg-2); font-weight: 600; white-space: nowrap; }
.kclaims thead th { width: auto; }
.tbl-wrap { overflow-x: auto; }

/* ── 폼 / 툴바 / 버튼 ── */
.toolbar, .kfilters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 18px; }
.toolbar input[type=search], .kfilters input[type=search] { flex: 1 1 260px; min-width: 180px; }
input[type=search], input[type=text], input[type=password], select {
  height: 36px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 14px;
}
select { padding-right: 28px; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.btn, .kfilters button, .toolbar button { height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 600; font-size: 14px; cursor: pointer; }
.btn:hover, .kfilters button:hover { border-color: var(--line-2); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.ghost { background: none; border-color: transparent; color: var(--accent); }

/* ── 보관함 ── */
.archive { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.archive li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.archive li:last-child { border-bottom: 0; }
.adate { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--fg); }
.alabels { display: flex; gap: 6px; }
.albl { font-size: 12px; font-weight: 600; background: var(--surface-2); border-radius: 999px; padding: 4px 10px; color: var(--fg-2); }
.albl:hover { color: var(--accent); text-decoration: none; }

/* ── 지식 카드 ── */
.klist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.kitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.kitem:last-child { border-bottom: 0; }
.ktitle { font-weight: 700; font-size: 16px; color: var(--fg); }
.kmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--fg-2); }
.kitem .kmeta { grid-column: 1; }
.kitem .kside { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--fg-3); text-align: right; white-space: nowrap; }
.kclaim { grid-column: 1; font-size: 13px; color: var(--fg-2); }
@media (max-width: 639px) { .kitem { grid-template-columns: 1fr; } .kitem .kside { grid-column: 1; grid-row: auto; flex-direction: row; align-items: center; } }
.kback { margin: 0 0 12px; font-size: 13px; }
.kback a::before { content: "← "; }
.khead-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; margin: 18px 0; font-size: 14px; }
.khead-meta .k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 4px; }
.ktable { margin: 8px 0 18px; }
.kclaims td:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kclaims code { font-size: 12px; color: var(--fg-3); }
.kimgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.kimgs img { width: 100%; height: 130px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }
.glossary .md { max-width: none; }
.glossary .md table { display: table; }

/* ── 로그인 ── */
.login { max-width: 380px; margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow); }
.login .eyebrow { margin-bottom: 6px; }
.login h1 { font-size: 24px; font-weight: 800; }
.login p { color: var(--fg-2); margin: 6px 0 0; font-size: 14px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.login input[type=password] { height: 44px; font-size: 16px; }
.login button { height: 44px; font-size: 15px; font-weight: 700; border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-fg); cursor: pointer; }
.login-err { color: var(--bad); font-size: 13px; margin: 0; }

/* ── 지식 카드 추가 폼 ── */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .page.read .form-grid { grid-template-columns: 1fr; } }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.flabel { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin-top: 6px; }
.fcard input[type=text], .fcard select, .fcard textarea { width: 100%; }
.fcard textarea { padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 14px; line-height: 1.6; resize: vertical; min-height: 160px; }
.fcard textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.factions { display: flex; gap: 8px; margin-top: 8px; }
.notice { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; margin: 0 0 16px; }
.notice.ok { background: var(--good-bg); color: var(--good); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.pending-pill { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 4px 10px; }

/* ── 레전드 오더 ── */
.legend-tbl td { vertical-align: top; }
.legend-tbl tr.dim { opacity: .55; }
.legend-tbl .num { white-space: nowrap; }
.ltabs { margin-bottom: 18px; flex-wrap: wrap; }
.ltabs .count { margin-left: 4px; }
.chat { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chat li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 5px 8px; border-radius: 6px; font-size: 14px; align-items: baseline; }
.chat li.hit { background: var(--accent-2); }
.chat li .t { color: var(--fg-3); font-size: 12px; }
.chat li .b { white-space: pre-wrap; min-width: 0; overflow-wrap: anywhere; }
.chat .chat-img { display: block; margin-top: 4px; }
.chat .chat-img img { max-width: min(100%, 420px); max-height: 320px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); }
.quote { margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; font-size: 15px; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 1100px) { .two-col { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); } }
.col-main, .col-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.why { margin: 10px 0 0; display: grid; grid-template-columns: 100px 1fr; gap: 10px 14px; }
.why dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
.why dd { margin: 0; line-height: 1.65; }
.why.small dd { font-size: 14px; color: var(--fg-2); }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 22px; }
.why-grid ul, .why-grid ol { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.why-grid li { margin: 3px 0; }
.why-grid p { font-size: 14px; margin: 4px 0 0; }
.kv2 { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv2 .k { color: var(--fg-2); white-space: nowrap; }
.kv2 .v { text-align: right; }
.news { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.spark { width: 100%; height: 70px; color: var(--accent); margin: 6px 0; }
.snapjson { font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: var(--r-sm); white-space: pre-wrap; max-height: 260px; overflow: auto; margin: 0; }

.legend-tbl tr.gone td { text-decoration: line-through; text-decoration-color: var(--fg-3); }
.legend-tbl tr.gone td .badge { text-decoration: none; }

.news { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.news li { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.news-tbl td { vertical-align: top; }
.news-tbl td:last-child { min-width: 0; }
pre.disc { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.6; margin: 0; overflow-wrap: anywhere; }

.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select { font: inherit; font-size: 13px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.curve-wrap { overflow-x: auto; }
svg.curve { width: 100%; max-width: 760px; height: auto; display: block; }
svg.curve .line { fill: none; stroke: var(--accent); stroke-width: 2; }
svg.curve .zero { stroke: var(--line); stroke-dasharray: 4 4; }
svg.curve .lbl { fill: var(--fg-3); font-size: 11px; }

/* ── 문 1 데스크 — 데스크탑 가로 화면이 기본 (2026-11-02 Zeta: 양옆 공백이 너무 많다, 세로·폰도 되지만 기본은 가로) ──
   본문 1240px·읽기 화면 760px·글 76ch(한글 약 42자) 는 1920 가로에서 양옆 220~460px 이 비었다.
   문 2(AI Study) 도 이 파일을 쓰므로 데스크 메뉴(.desk-nav) 가 있는 화면만 넓힌다. */
:root:has(.desk-nav) { --content-max: 1880px; --read-max: 1320px; }
:root:has(.desk-nav) .md { max-width: none; }
@media (min-width: 1024px) {
  .desk-nav { gap: 14px !important; }
  .desk-nav .nav-item { padding: 6px 10px; }
  .subtabs { display: none; }          /* 자동매매 하위 탭 — 데스크탑은 왼쪽 메뉴에 있다 (폰에선 그대로) */
}
.jgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 22px; align-items: start; }
@media (min-width: 1500px) { .jgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.two-col > *, .jgrid > * { min-width: 0; }   /* 그리드 칸이 표·그래프 폭만큼 커져 폰에서 가로로 밀리던 것 (2026-11-02) */
