/* worker's terminal — Koyfin식 위젯 판을 개인용으로.
   PC: 왼쪽 메뉴 + 위쪽 검색 + 3열 위젯(묶음 표). 휴대폰: 한 줄로 쌓고 아래 탭.
   색: 한국식 상승 빨강 · 하락 파랑. 강조색은 하락 파랑과 헷갈리지 않게 초록.
   글꼴: Pretendard(숫자는 tabular). 아이콘: Lucide. */

:root {
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --r: 10px;
  --rail-w: 224px;
  --top-h: 54px;
  --bg: #eef1f5;
  --rail: #ffffff;
  --surface: #ffffff;
  --band: #f1f4f8;
  --hover: #f5f7fa;
  --ink: #0f1723;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e8ee;
  --line-2: #d0d7e1;
  --accent: #0b7a5c;
  --up: #d92d36;
  --down: #1f63d6;
  --flat: #8a94a6;
  --warn: #b54708;
  --tile: #e8ecf1;
  --shadow: 0 12px 32px rgb(16 24 40 / 0.14);
  --logo-ring: transparent;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090d14;
    --rail: #0d121a;
    --surface: #111722;
    --band: #18202d;
    --hover: #161e2a;
    --ink: #e8edf4;
    --ink-2: #c3cbd7;
    --muted: #8692a5;
    --line: #1e2734;
    --line-2: #2a3445;
    --accent: #35c48f;
    --up: #ff5d63;
    --down: #5c9bff;
    --flat: #7e8a9c;
    --warn: #f2a541;
    --tile: #1b2331;
    --shadow: 0 16px 40px rgb(0 0 0 / 0.5);
  --logo-ring: #2a3445;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090d14;
  --rail: #0d121a;
  --surface: #111722;
  --band: #18202d;
  --hover: #161e2a;
  --ink: #e8edf4;
  --ink-2: #c3cbd7;
  --muted: #8692a5;
  --line: #1e2734;
  --line-2: #2a3445;
  --accent: #35c48f;
  --up: #ff5d63;
  --down: #5c9bff;
  --flat: #7e8a9c;
  --warn: #f2a541;
  --tile: #1b2331;
  --shadow: 0 16px 40px rgb(0 0 0 / 0.5);
  --logo-ring: #2a3445;
  color-scheme: dark;
}
:root { --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }
.warn { color: var(--warn); }
.ic { width: 17px; height: 17px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 틀 */
.app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
@media (min-width: 1100px) { .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); } }
.main { min-width: 0; padding-bottom: 72px; }
@media (min-width: 820px) { .main { padding-bottom: 0; } }

/* 왼쪽 메뉴 */
.rail { display: none; }
@media (min-width: 1100px) {
  .rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 12px 10px 16px; background: var(--rail); border-right: 1px solid var(--line); }
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.rail .brand { padding: 6px 8px 14px; }
/* 로고 마크(프롬프트 막대): 터미널 입력 기호 > 와 오르는 막대 셋. 다크 화면에선 타일이 묻히지 않게 얇은 테두리 */
.logo { display: grid; flex: none; width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 0 0 1px var(--logo-ring); }
.logo svg { display: block; width: 100%; height: 100%; }
.rail-sec { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.nav { display: grid; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; text-decoration: none; }
.nav a .ic { color: var(--muted); }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav a.on .ic { color: var(--accent); }
.rail-foot { margin: auto 10px 0; padding-top: 16px; font-size: 11px; color: var(--muted); }

/* 위쪽 막대 */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: var(--top-h); padding: 0 16px; background: color-mix(in srgb, var(--rail) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
@media (min-width: 1100px) { .brand-m { display: none; } }
.search { position: relative; flex: 1; max-width: 440px; }
@media (max-width: 639px) { .search { display: none; } }
.search .lead { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search .lead .ic { width: 16px; height: 16px; }
.search input, .inline-search input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--band); color: var(--ink); font: 13.5px var(--font); }
.search input { padding: 0 34px; }
.search input:focus, .inline-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); min-width: 18px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 5px; font: 600 11px var(--font); color: var(--muted); text-align: center; }
.results { list-style: none; margin: 6px 0 0; padding: 4px; display: grid; gap: 1px; }
.search .results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); z-index: 40; }
.results button { width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; font-size: 13.5px; text-align: left; cursor: pointer; }
.results button:hover, .results button:focus-visible { background: var(--hover); }
.results small { font-size: 11.5px; color: var(--muted); }
.results .empty { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }

/* 출근 · 장중 · 퇴근 노선 */
.line { display: none; list-style: none; margin: 0 0 0 auto; padding: 0; align-items: center; font-size: 12.5px; color: var(--muted); }
@media (min-width: 900px) { .line { display: flex; } }
.line li { position: relative; display: flex; align-items: center; gap: 5px; padding: 0 9px; }
.line li + li { margin-left: 14px; }
.line li + li::before { content: ""; position: absolute; left: -14px; top: 50%; width: 16px; height: 2px; background: var(--line-2); }
.line li.done + li::before, .line li.on::before { background: var(--accent); }
.line .stop { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.line li.done .stop { border-color: var(--accent); background: var(--accent); }
.line li.on { color: var(--ink); font-weight: 700; }
.line li.on .stop { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.line small { font-size: 11px; font-weight: 500; color: var(--muted); }
.clock { margin: 0 0 0 auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.line + .clock { margin-left: 4px; }
.clock .live { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.icon-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }

/* ---------- 위젯 판: 휴대폰은 한 줄(order로 순서), 820px부터 2열, 1280px부터 3열 */
.board { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.col { display: contents; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; }
.o7 { order: 7; } .o8 { order: 8; } .o9 { order: 9; } .o10 { order: 10; } .o11 { order: 11; } .o12 { order: 12; } .o13 { order: 13; } .o14 { order: 14; }
.foot { order: 99; }
@media (min-width: 820px) {
  .board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; padding: 14px; }
  .col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .col-c { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .foot { grid-column: 1 / -1; }
}
@media (min-width: 1280px) {
  .board { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 0.92fr); }
  .col-c { grid-column: auto; display: flex; flex-direction: column; align-items: stretch; }
}

/* 위젯 */
.panel { display: block; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); scroll-margin-top: calc(var(--top-h) + 12px); transition: border-color 0.2s, box-shadow 0.2s; }
/* 왼쪽 메뉴(또는 아래 탭)로 고른 칸: 테두리만 살짝 강조색으로 */
.panel.picked { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.ph { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--line); }
.ph h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.ph h2 .ic { width: 16px; height: 16px; color: var(--muted); }
.act { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.pb { padding: 12px 14px 14px; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--band); color: var(--ink-2); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.band-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: color-mix(in srgb, currentColor 14%, transparent); white-space: nowrap; }
.band-chip.sm { padding: 1px 8px; font-size: 12px; }
.text-btn { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-size: 12.5px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.text-btn:hover { text-decoration: underline; }
.empty-note { margin: 0; padding: 14px; font-size: 12.5px; color: var(--muted); }

/* ---------- 브리핑 */
.temp { display: flex; align-items: center; gap: 16px; }
.score { display: flex; align-items: baseline; gap: 2px; }
.score span { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.score small { font-size: 13px; color: var(--muted); }
.temp-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.thermo { margin: 14px 0 4px; }
.thermo-bar { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--down), var(--flat) 50%, var(--up)); }
.thermo-mark { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); transition: left 0.4s; }
.thermo-scale { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11px; color: var(--muted); }
.lines { list-style: none; counter-reset: ln; display: grid; gap: 8px; margin: 14px 0 0; padding: 0; }
.lines li { counter-increment: ln; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.5; }
.lines li::before { content: counter(ln); display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; background: var(--band); color: var(--ink-2); font-size: 12px; font-weight: 800; }
.why { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.why summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.why ul { list-style: none; display: grid; gap: 6px; margin: 10px 0 0; padding: 0; }
.why li { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: baseline; gap: 10px; }
.why li small { display: block; font-size: 11px; color: var(--muted); }
.why li b { text-align: right; }
.why.pad { margin: 0; padding: 10px 14px 12px; }
.why.pad p { margin: 8px 0 0; }
.why .sub { grid-template-columns: 1fr; margin-top: 2px; font-size: 12px; font-weight: 700; }
.sg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 10px 14px 6px; border-top: 1px solid var(--line); }
.sg-h { margin-bottom: 4px; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.sg-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 22px; align-items: center; gap: 6px; min-height: 21px; font-size: 12px; }
.sg-row b { text-align: right; }
.sg-bar { position: relative; height: 6px; border-radius: 3px; overflow: hidden; background: var(--band); }
.sg-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.sg-bar span.up { background: var(--up); } .sg-bar span.down { background: var(--down); } .sg-bar span.flat { background: var(--flat); }
.why .grp { grid-template-columns: 1fr; margin-top: 4px; font-size: 11.5px; font-weight: 800; color: var(--muted); }

/* 브리핑 안 미국장 */
.us { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.us-h { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.us-idx { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 14px; }
.us-idx a { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; }
.us-idx a:hover b { text-decoration: underline; }
.us-idx b { font-weight: 600; }
.us-idx .c { font-size: 14px; }
.us-line { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.us-line a { text-decoration: none; font-weight: 600; }
.us-line a:hover { text-decoration: underline; }

/* 공포탐욕지수: 기존(CNN) · 실질 S&P 500 · 실질 나스닥 100 */
.fg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fg-tile { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 12px 10px; border-left: 1px solid var(--line); }
.fg-tile:first-child { border-left: 0; }
.fg-l { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fg-s { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fg-s .num { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
.fg-tile .c { font-size: 11.5px; }
.fg-tile .spark { height: 26px; margin-top: 4px; }

/* ---------- 표 (div 격자) */
.tbl { font-size: 13px; }
.tr { display: grid; align-items: center; gap: 10px; min-height: 38px; padding: 4px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.tbl > :first-child { border-top: 0; }
a.tr:hover, .tr.hov:hover { background: var(--hover); }
.tr > :not(:first-child) { text-align: right; }
.tr.head { min-height: 28px; padding-block: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.tr.band { min-height: 26px; padding-block: 3px; border-top: 1px solid var(--line); background: var(--band); color: var(--muted); font-size: 11.5px; font-weight: 800; }
.tbl > .tr.band:first-child { border-top: 0; }
.nm { display: flex; align-items: baseline; gap: 6px; min-width: 0; text-decoration: none; }
.nm.col { flex-direction: column; align-items: flex-start; gap: 0; }
.nm b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.nm:hover b { text-decoration: underline; }
.open-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; align-self: center; }
.v { font-weight: 700; white-space: nowrap; }
.c { font-weight: 700; white-space: nowrap; font-size: 12.5px; }
.tr .spark { height: 22px; margin: 0; }
.tbl.q .tr { grid-template-columns: minmax(0, 1fr) auto 66px 64px; }
.tbl.w .tr { grid-template-columns: minmax(0, 1fr) auto 60px 52px 26px; }
.tbl.kv .tr { grid-template-columns: minmax(0, 1fr) auto 66px; }
.tbl.s .tr { grid-template-columns: minmax(0, 1fr) auto; }
.tbl.s .tr:not(.band) { min-height: 46px; }
.del { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.del .ic { width: 14px; height: 14px; }
.del:hover { background: var(--band); color: var(--ink); }
.inline-search { position: relative; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.inline-search .results { margin-top: 6px; }
.ind-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ind-chips:empty { display: none; }
.ind-chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.ind-chip:hover { border-color: var(--accent); color: var(--accent); }

/* 추세선 */
.spark { position: relative; height: 36px; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark .dot { position: absolute; right: -3px; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: currentColor; }
.spark .dot.up { color: var(--up); } .spark .dot.down { color: var(--down); } .spark .dot.flat { color: var(--flat); }
.spark.wide { height: 40px; margin: 0 14px 8px; }

/* 금리 · 물가 · 아파트 큰 숫자 줄 */
.big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 12px 14px 10px; }
.big .num { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.big small { font-size: 12px; color: var(--muted); }
.big .c { margin-left: auto; }
.big .band-chip { align-self: center; }
.pfoot { margin: 0; padding: 8px 14px 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.panel-link { color: inherit; text-decoration: none; transition: border-color 0.15s; }
.panel-link:hover { border-color: var(--accent); }
.panel-link:hover .pfoot, .panel-link:hover .ext { color: var(--accent); }
.ext { display: flex; color: var(--muted); }
.ext .ic { width: 15px; height: 15px; }

/* 대장주 히트맵 */
.heat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 54px; gap: 3px; padding: 10px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 6px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; overflow: hidden; }
.tile:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
.tile.big { grid-column: span 2; grid-row: span 2; }
.tile.wide { grid-column: span 2; }
.tile.light { color: #fff; }
.t-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-pct { font-size: 12.5px; font-weight: 800; }
.tile.big .t-name { font-size: 14px; }
.tile.big .t-pct { font-size: 22px; letter-spacing: -0.02em; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--band); }
.seg button { padding: 3px 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.18); }

/* 수급 */
.flows { display: grid; gap: 16px; }
.fl-h { margin-bottom: 4px; font-size: 12.5px; font-weight: 800; }
.fl-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 76px; align-items: center; gap: 10px; min-height: 26px; font-size: 12.5px; }
.fl-bar { position: relative; height: 8px; border-radius: 4px; background: var(--band); }
.fl-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.fl-bar span { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.fl-bar span.up { background: var(--up); } .fl-bar span.down { background: var(--down); } .fl-bar span.flat { background: var(--flat); }
.fl-val { text-align: right; font-weight: 700; white-space: nowrap; }
.breadth { display: flex; gap: 2px; height: 6px; margin-top: 8px; border-radius: 3px; overflow: hidden; }
.b-up { background: var(--up); } .b-flat { background: var(--flat); } .b-down { background: var(--down); }
.breadth-cap { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* 해외 핵심 기사: 옆으로 넘기는 카드 */
.st-count { min-width: 36px; font-size: 12px; color: var(--muted); text-align: right; }
.stories { display: grid; grid-auto-flow: column; grid-auto-columns: 88%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px; margin: -2px; }
.stories::-webkit-scrollbar { display: none; }
.story { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 210px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--band); color: inherit; text-decoration: none; }
.story:hover { border-color: var(--line-2); }
.story:hover h3 { text-decoration: underline; }
.st-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.st-src { font-weight: 800; color: var(--ink); }
.st-also { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--surface); font-weight: 600; }
.story h3 { margin: 2px 0 0; font-size: 15.5px; font-weight: 800; line-height: 1.4; letter-spacing: -0.01em; }
.st-orig { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.st-sum { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.st-why { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.st-go { margin-top: auto; padding-top: 4px; font-size: 11.5px; color: var(--muted); }

/* 핵심 이슈 */
.ni { padding: 12px 14px; border-top: 1px solid var(--line); }
.news > .ni:first-child { border-top: 0; }
.ni-h { display: block; font-size: 14.5px; font-weight: 800; line-height: 1.45; letter-spacing: -0.01em; text-decoration: none; }
.ni-h:hover { text-decoration: underline; }
.ni-sum { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.ni-rel { list-style: none; display: grid; gap: 2px; margin: 6px 0 0; padding: 0; font-size: 12.5px; }
.ni-rel li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.ni-rel a { text-decoration: none; }
.ni-rel a:hover { text-decoration: underline; }
.ni-rel small { margin-left: 6px; font-size: 11px; color: var(--muted); }
.ni-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.tag { padding: 1px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* 주요 일정 */
.cal { list-style: none; margin: 0; padding: 0; }
.ci { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.cal > .ci:first-child { border-top: 0; }
.dday { display: grid; place-items: center; height: 26px; border-radius: 6px; background: var(--band); font-size: 12px; font-weight: 800; }
.dday.soon { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ci-when { font-size: 11.5px; color: var(--muted); }
.ci-t { font-size: 14px; font-weight: 800; }
.ci-t a { text-decoration: none; }
.ci-t a:hover { text-decoration: underline; }
.ci-why { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* 바닥글 */
.foot { padding: 4px 2px 16px; font-size: 11.5px; color: var(--muted); }
.foot p { margin: 3px 0; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* 아래 탭 (휴대폰) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--rail) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-top: 1px solid var(--line); }
@media (min-width: 820px) { .tabbar { display: none; } }
/* 아래 탭이 보이는 폭에서는 고른 탭의 칸만(819px은 app.js의 NARROW와 같은 값) */
@media (max-width: 819px) { .panel.tab-off { display: none !important; } }
.tab-empty { margin: 0; padding: 40px 16px; text-align: center; font-size: 13px; color: var(--muted); }
@media (min-width: 820px) { .tab-empty { display: none !important; } }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none; }
.tabbar a .ic { width: 20px; height: 20px; }
.tabbar a.on { color: var(--accent); }

@media (max-width: 420px) {
  .board { padding: 10px; gap: 10px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .score span { font-size: 42px; }
  .lines li { font-size: 14.5px; }
  .tbl.q .tr { grid-template-columns: minmax(0, 1fr) auto 62px 52px; gap: 8px; padding-inline: 12px; }
  .tbl.w .tr { grid-template-columns: minmax(0, 1fr) auto 58px 44px 24px; gap: 8px; padding-inline: 12px; }
}

/* ---------- ETF 섹터 페이지 */
.topbar.solo .brand-m { display: inline-flex; }
.page { max-width: 1000px; margin: 0 auto; padding: 14px 14px 32px; }
.back { display: inline-block; margin-bottom: 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.sectors { list-style: none; display: grid; gap: 8px; margin: 12px 0 0; padding: 0; }
.sx { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); scroll-margin-top: calc(var(--top-h) + 12px); }
.sx-head { width: 100%; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 70px; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.sx-head:hover { background: var(--hover); }
.sx-name { display: flex; flex-direction: column; min-width: 0; }
.sx-name b { font-size: 15px; font-weight: 800; }
.sx-name small { font-size: 11px; color: var(--muted); }
.sx-bar { position: relative; height: 10px; border-radius: 5px; background: var(--band); }
.sx-bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line-2); }
.sx-bar span { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.sx-bar span.up { background: var(--up); } .sx-bar span.down { background: var(--down); } .sx-bar span.flat { background: var(--flat); }
.sx-val { text-align: right; font-size: 14px; font-weight: 800; }
.sx-body { padding: 0 14px 12px; overflow-x: auto; border-top: 1px solid var(--line); }
.etf-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.etf-t th { padding: 8px 4px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.etf-t th:first-child, .etf-t td:first-child { text-align: left; }
.etf-t td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 600; }
.etf-t td:first-child { min-width: 120px; white-space: normal; line-height: 1.35; font-weight: 500; }
.etf-t tr:last-child td { border-bottom: 0; }
.etf-t td a { text-decoration: none; }
.etf-t td a:hover { text-decoration: underline; }
.etf-t td.on { font-weight: 800; }
@media (max-width: 480px) { .etf-t .per:not(.on) { display: none; } .etf-t td:first-child { min-width: 0; } }
.vbar { display: block; height: 3px; margin-top: 3px; border-radius: 2px; background: var(--band); }
.vbar span { display: block; height: 100%; border-radius: 2px; background: var(--warn); }
@media (max-width: 480px) {
  .sx-head { grid-template-columns: minmax(0, 1fr) 76px 62px; gap: 8px; }
  .etf-t { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 토스 미니앱의 ETF 섹터 쪽: 이름·뒤로가기는 토스 내비게이션 바가 맡는다(우리 것과 겹치면 안 됨) */
html.toss .topbar.solo, html.toss .page > .back { display: none !important; }

