/* ── 색 토큰: 어둡게(기본) · 밝게(시스템 또는 선택). 빨강=상승, 파랑=하락 ── */
:root {
  --bg: #0b0f14; --surface: #131a23; --surface2: #1a2330; --line: #243041; --line-soft: #1d2735;
  --text: #e6ebf1; --dim: #8b96a5; --faint: #5c6878;
  --accent: #e8b339; --accent-ink: #1a1405; --accent-soft: rgba(232,179,57,.14);
  --up: #f0524d; --up-soft: rgba(240,82,77,.14);
  --down: #4d7cf0; --down-soft: rgba(77,124,240,.14);
  --ok: #3fb950; --ok-soft: rgba(63,185,80,.14);
  --warn: #e8a33a; --warn-soft: rgba(232,163,58,.16);
  --bad: #f85149;
  --ma50: #e8b339; --ma150: #3fb950; --ma200: #b06cd9;
  --grid: rgba(125,133,144,.14);
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6f9; --surface: #ffffff; --surface2: #eef1f5; --line: #dbe1e8; --line-soft: #e8ecf1;
    --text: #131a23; --dim: #5b6676; --faint: #8a94a3;
    --accent: #b8860b; --accent-ink: #ffffff; --accent-soft: rgba(184,134,11,.12);
    --up: #d93a35; --up-soft: rgba(217,58,53,.10);
    --down: #2f63d6; --down-soft: rgba(47,99,214,.10);
    --ok: #1f8f3a; --ok-soft: rgba(31,143,58,.10);
    --warn: #b86e00; --warn-soft: rgba(184,110,0,.12);
    --bad: #cf2f2a;
    --ma50: #c98a00; --ma150: #1f8f3a; --ma200: #8a4cc0;
    --grid: rgba(90,100,115,.14);
    --shadow: 0 8px 28px rgba(20,30,45,.14);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f6f9; --surface: #ffffff; --surface2: #eef1f5; --line: #dbe1e8; --line-soft: #e8ecf1;
  --text: #131a23; --dim: #5b6676; --faint: #8a94a3;
  --accent: #b8860b; --accent-ink: #ffffff; --accent-soft: rgba(184,134,11,.12);
  --up: #d93a35; --up-soft: rgba(217,58,53,.10);
  --down: #2f63d6; --down-soft: rgba(47,99,214,.10);
  --ok: #1f8f3a; --ok-soft: rgba(31,143,58,.10);
  --warn: #b86e00; --warn-soft: rgba(184,110,0,.12);
  --bad: #cf2f2a;
  --ma50: #c98a00; --ma150: #1f8f3a; --ma200: #8a4cc0;
  --grid: rgba(90,100,115,.14);
  --shadow: 0 8px 28px rgba(20,30,45,.14);
  color-scheme: light;
}
/* 예전 이름 (화면 곳곳의 인라인 스타일이 쓴다) */
:root {
  --bg2: var(--surface); --bg3: var(--surface2); --border: var(--line);
  --text-dim: var(--dim); --pass: var(--ok); --fail: var(--bad);
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', sans-serif;
  font-size: 14px; font-variant-numeric: tabular-nums;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
svg { display: block; }

/* 본문 종목 하이퍼링크 — 기본 파랑/밑줄 대신 테마에 맞게 (호버 시에만 강조) */
td a, .sub a { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--text-dim); }
td a:hover, .sub a:hover { color: var(--accent); border-bottom: 1px solid var(--accent); }
td a:visited, .sub a:visited { color: var(--text); }

/* ── 상단바 ── */
#topbar {
  position: sticky; top: 0; z-index: 100; height: 56px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; white-space: nowrap; }
.brand span { color: var(--accent); }
.brand .kr-tag { font-size: 11px; color: var(--accent); border: 1px solid currentColor; border-radius: 4px; padding: 1px 5px; vertical-align: middle; margin-left: 4px; }
.top-sp { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--dim); background: none; border: 0; flex: none; }
.icon-btn:active, .icon-btn:hover { background: var(--surface2); }
.icon-btn svg { width: 22px; height: 22px; }
.mkt-switch, .seg { display: inline-flex; background: var(--surface2); border-radius: 10px; padding: 3px; flex: none; }
.mkt-switch button, .seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.mkt-switch button.on, .seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: default; }
#data-status { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.hidden { display: none !important; }

/* ── 하단 탭 (넓은 화면은 왼쪽 레일) ── */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
#nav button { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--faint); border: 0; background: none; border-radius: 10px; white-space: nowrap; min-width: 0; }
#nav button svg { width: 24px; height: 24px; }
#nav button.active { color: var(--accent); }

/* 목록 성과 사용법 카드 */
.edge-card { border-left: 3px solid var(--accent); }
.edge-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.edge-step { display: flex; gap: 10px; align-items: flex-start; background: var(--bg3); border-radius: 8px; padding: 10px 12px; line-height: 1.6; }
.edge-no { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.edge-avoid { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; line-height: 1.7; }
.edge-avoid ul { margin: 4px 0 0; padding-left: 18px; }

/* ── 레이아웃 ── */
#main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); max-width: 1500px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.grid { display: grid; gap: 16px; }
.card {
  background: var(--bg2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 16px; min-width: 0;
}
.card h3 { font-size: 14px; color: var(--text-dim); margin-bottom: 12px; font-weight: 600; }
.big-num { font-size: 28px; font-weight: 800; }
.sub { font-size: 12px; color: var(--text-dim); }

/* ── 테이블 ── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; }
th {
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg2);
  cursor: pointer; user-select: none;
}
th:first-child, td:first-child { text-align: left; }
td { border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--bg3); }
.up { color: var(--up); }
.down { color: var(--down); }
.dim { color: var(--text-dim); }

/* RS 배지 */
.rs-badge {
  display: inline-block; min-width: 34px; text-align: center;
  padding: 2px 6px; border-radius: 6px; font-weight: 700; font-size: 12px;
}
.rs-hot { background: rgba(232,179,57,0.18); color: var(--accent); }
.rs-good { background: rgba(63,185,80,0.15); color: var(--pass); }
.rs-mid { background: var(--bg3); color: var(--text); }
.rs-low { background: rgba(248,81,73,0.12); color: var(--fail); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
}
.badge-vcp { background: rgba(232,179,57,0.15); color: var(--accent); }
.badge-stage2 { background: rgba(63,185,80,0.15); color: var(--pass); }
.badge-pivot { background: rgba(77,124,240,0.18); color: var(--down); }

/* ── 스크리너 탭 ── */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text-dim);
  min-height: 32px; padding: 0 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
}
.tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  padding: 6px 10px; border-radius: 8px;
}

/* ── 종목 상세 ── */
.stock-header { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.stock-header h2 { font-size: 24px; }
.stock-header .price { font-size: 24px; font-weight: 800; }
.tt-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tt-check {
  font-size: 12px; padding: 4px 10px; border-radius: 6px; background: var(--bg3);
  border: 1px solid var(--border);
}
.tt-check.ok { border-color: rgba(63,185,80,0.4); color: var(--pass); }
.tt-check.no { border-color: rgba(248,81,73,0.35); color: var(--fail); }
#chart-wrap { position: relative; }
#chart-canvas { width: 100%; display: block; border-radius: var(--radius); }
.back-btn {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 14px; border-radius: 8px; margin-bottom: 12px;
}
.back-btn:hover { color: var(--text); }

/* ── 폼/버튼 ── */
.btn {
  background: var(--accent); color: var(--accent-ink); border: none;
  padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 13px;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 13px;
}
.btn-danger { background: none; border: none; color: var(--fail); font-size: 12px; }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.form-row label { font-size: 12px; color: var(--text-dim); min-width: 90px; }
.form-row input {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: 8px; width: 130px;
}

/* ── 계산기 결과 ── */
.calc-result { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.calc-result .item { background: var(--bg3); border-radius: 8px; padding: 12px; }
.calc-result .item .lb { font-size: 11px; color: var(--text-dim); }
.calc-result .item .val { font-size: 18px; font-weight: 800; margin-top: 4px; }
.warn { color: var(--fail); font-size: 13px; margin-top: 8px; }

/* ── 가이드 ── */
#view-guide { max-width: 860px; }
#view-guide h2 { margin: 24px 0 10px; font-size: 20px; }
#view-guide h3 { margin: 18px 0 8px; font-size: 16px; color: var(--accent); }
#view-guide p, #view-guide li { line-height: 1.7; color: var(--text); }
#view-guide ul { padding-left: 22px; margin: 8px 0; }
#view-guide .note { background: var(--bg2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 10px 0; font-size: 13px; color: var(--text-dim); }

.empty { text-align: center; color: var(--text-dim); padding: 40px 0; }
.has-tip { text-decoration: underline dotted rgba(125,133,144,0.6); text-underline-offset: 3px; cursor: help; }
.sector-row { cursor: pointer; }

/* 상단바 업데이트 진행률 */
.upd-wrap { display: flex; align-items: center; gap: 8px; }
.upd-label { font-size: 12px; color: var(--accent); white-space: nowrap; }
.upd-bar {
  width: 120px; height: 6px; background: var(--bg3);
  border-radius: 3px; overflow: hidden;
}
.upd-fill {
  height: 100%; background: var(--accent); border-radius: 3px;
  transition: width 0.6s ease;
}
.upd-indef { animation: upd-pulse 1.2s ease-in-out infinite; }
@keyframes upd-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.upd-pct { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* 베스트 셋업 카드 */
.best-pick { border-color: rgba(232,179,57,0.45); }
.bp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bp-rank {
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
  padding: 2px 10px; border-radius: 8px; font-size: 13px;
}
.bp-symbol { font-size: 22px; font-weight: 800; }
.bp-score { margin-left: auto; font-size: 24px; font-weight: 800; color: var(--accent); }
.bp-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bp-chip {
  font-size: 12px; padding: 3px 10px; border-radius: 12px;
  background: var(--bg3); border: 1px solid var(--border);
}
.bp-chip.good { border-color: rgba(63,185,80,0.4); }
.bp-chip.mid { border-color: rgba(232,179,57,0.35); }
.bp-chip.bad { border-color: rgba(248,81,73,0.3); color: var(--text-dim); }
.bp-runner:hover { color: var(--accent); }
.biz-desc {
  font-size: 13px; color: var(--text); line-height: 1.65; margin-top: 8px;
}
.active-filter { border-color: var(--accent) !important; color: var(--accent) !important; }

/* AI 인프라 상대성과 */
.ai-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ai-leg {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  font-size: 12px; padding: 4px 10px; border-radius: 14px;
  background: var(--bg3); border: 1px solid var(--border);
}
.ai-leg.off { opacity: 0.35; text-decoration: line-through; }
.ai-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ai-tip {
  position: absolute; z-index: 50; min-width: 240px; max-width: 300px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ai-tip-row { margin-bottom: 3px; line-height: 1.5; }
/* 폰: 차트 아래에 붙는 짧은 목록(차트를 덮지 않는다, 2026-10-24) */
.ai-tip.inline { position: static; max-width: none; min-width: 0; box-shadow: none; pointer-events: auto; margin-top: 8px; padding: 8px 10px; }
.ai-tip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.ai-tip-head .dim { font-size: 11px; }
.ai-tip-x { margin-left: auto; min-width: 32px; min-height: 32px; border: 0; background: none; color: var(--dim); font-size: 14px; cursor: pointer; }
.ai-tip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.ai-tip-cell { display: grid; grid-template-columns: 10px 1fr auto 34px; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.ai-tip-cell .nm { overflow: hidden; text-overflow: ellipsis; }
.ai-tip-cell .dim { text-align: right; font-size: 11px; }
.ai-tip-cell .pos { color: var(--up, #f0524d); } .ai-tip-cell .neg { color: var(--down, #4d7cf0); }
.ai-vline { position: absolute; top: 0; width: 1px; background: var(--dim); opacity: .6; pointer-events: none; }
#ai-chart { width: 100%; display: block; cursor: crosshair; }

/* 관심종목 — TradingView식 섹션 리스트 */
.wl-sec td {
  background: var(--bg3); cursor: pointer; user-select: none;
  padding: 8px 10px !important; border-bottom: 1px solid var(--border);
  text-align: left !important; position: relative;
}
.wl-fold { display: inline-block; width: 14px; color: var(--accent); }
.wl-sec-actions { float: right; display: inline-flex; gap: 2px; opacity: 0.35; }
.wl-sec:hover .wl-sec-actions { opacity: 1; }
.wl-sec-actions button {
  background: none; border: 1px solid transparent; color: var(--text-dim);
  padding: 1px 6px; border-radius: 5px; font-size: 11px;
}
.wl-sec-actions button:hover { color: var(--text); border-color: var(--border); background: var(--bg2); }
.wl-handle { color: var(--text-dim); cursor: grab; font-size: 11px; letter-spacing: -2px; }
.wl-row.dragging { opacity: 0.4; }
.wl-row.drag-over td { border-top: 2px solid var(--accent); }
.wl-sec.drag-over td { border-top: 2px solid var(--accent); }
.wl-grpsel {
  background: var(--bg); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; padding: 2px 4px; font-size: 11px; max-width: 90px;
}

.alert-type-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px;
}
.at-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 8px 10px; border-radius: 8px; cursor: pointer; user-select: none;
}
.at-item input { accent-color: var(--accent); width: 16px; height: 16px; }

.news-item {
  display: block; padding: 7px 0; text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}
.news-item:last-child { border-bottom: none; }
.news-item:hover .news-title { color: var(--accent); }
.news-title { display: block; color: var(--text); font-size: 13px; line-height: 1.45; }
.news-meta { display: block; color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.biz-desc.collapsed {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.bench-sel { padding: 4px 10px; font-size: 12px; }
.bench-sel.active { border-color: var(--accent); color: var(--accent); }
#chart-bench-canvas { width: 100%; display: block; border-radius: var(--radius); }

/* ── 모바일 (컴팩트 레이아웃) ── */
@media (max-width: 768px) {
  #topbar { padding: 0 6px 0 12px; gap: 6px; }
  .brand { font-size: 17px; }
  #data-status { display: none; }               /* 데이터 상태는 더보기 시트에서 */

  th, td { padding: 6px 6px; font-size: 12px; }
  .card { padding: 14px; }
  .big-num { font-size: 22px; }
  .stock-header h2, .stock-header .price { font-size: 20px; }
  .stock-header { gap: 8px; }
  .tt-check { font-size: 11px; padding: 3px 8px; }
  .bp-symbol { font-size: 19px; }
  .bp-score { font-size: 20px; }
  .bp-chip { font-size: 11px; padding: 2px 8px; }
  .tabs button { padding: 0 12px; font-size: 12px; }
  .form-row label { min-width: 100%; margin-bottom: -4px; } /* 라벨 위, 입력 아래 */
  .form-row input { flex: 1; min-width: 120px; }
  .btn, .btn-ghost { padding: 9px 14px; }        /* 터치 타깃 확대 */
  .calc-result { grid-template-columns: repeat(2, 1fr); }
  .btn-ghost { min-height: 32px; }
  .mt-min { margin-bottom: 6px; }
  details > summary.sub { min-height: 32px; display: flex; align-items: center; }
  #view-guide p.sub a, #view-guide .twitter-timeline, #view-krmarket a[href^="#stock/"] { display: inline-block; line-height: 32px; min-width: 32px; text-align: center; }
  #fx-q, #fx-peak, #ai-base { min-height: 32px; }
}

/* 환율 제외 주가 탭 (KR) */
#fx-chart { width: 100%; display: block; cursor: crosshair; }
.fx-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) { .fx-grid { grid-template-columns: repeat(2, 1fr); } }

/* ════ 2026-10 리모델링: 판정 문장·행 카드·시트 ════ */
.up { color: var(--up); } .down { color: var(--down); } .dim { color: var(--dim); } .acc-t { color: var(--accent); }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.stack > .card, .stack > div { min-width: 0; }
.stack + .stack, .stack + .card, .card + .stack { margin-top: 12px; }
.card-h { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.card-h .t { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.card-h .s { font-size: 12px; color: var(--dim); margin-top: 1px; }
.card-h .r { margin-left: auto; flex: none; }
.kicker { font-size: 12px; color: var(--dim); font-weight: 600; }
.help { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--faint); margin: -6px -6px -6px 0; background: none; border: 0; }
.help svg { width: 18px; height: 18px; }
.page-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 2px 10px; }
.page-h h1 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.page-h .seg { margin-left: auto; }
.src { font-size: 11px; color: var(--faint); margin-top: 12px; line-height: 1.5; }

/* 상태 배지 (점 + 글자) */
.vbadge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.vbadge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-warn { color: var(--warn); background: var(--warn-soft); }
.b-up { color: var(--up); background: var(--up-soft); }
.b-down { color: var(--down); background: var(--down-soft); }
.b-ok { color: var(--ok); background: var(--ok-soft); }
.b-dim { color: var(--dim); background: var(--surface2); }
.b-acc { color: var(--accent); background: var(--accent-soft); }

/* 오늘: 시장 판정 */
.hero h2 { font-size: 21px; line-height: 1.35; font-weight: 800; letter-spacing: -.5px; margin: 8px 0 6px; }
.hero p.hsub { font-size: 14px; color: var(--dim); line-height: 1.55; }
.hero p.hsub b { color: var(--text); font-weight: 700; }
.idx-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 14px; }
.idx { background: var(--surface2); border: 0; border-radius: 12px; padding: 10px 10px 8px; min-width: 0; text-align: left; }
.idx .nm { font-size: 12px; font-weight: 800; color: var(--dim); display: flex; justify-content: space-between; gap: 4px; }
.idx .px { font-size: 16px; font-weight: 800; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idx .ch { font-size: 12px; font-weight: 700; }
.idx svg.sp { width: 100%; height: 30px; margin: 6px 0 4px; }
.dots { display: flex; gap: 8px; font-size: 11px; color: var(--dim); flex-wrap: wrap; }
.dots span { display: inline-flex; align-items: center; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }
.dd { margin-top: 6px; }
.dd-bar { display: flex; gap: 2px; margin-top: 3px; }
.dd-bar i { flex: 1; height: 5px; border-radius: 2px; background: var(--line); }
.dd-bar i.f { background: var(--dim); }
.dd-bar i.f.w { background: var(--warn); }
.dd-lab { font-size: 11px; color: var(--dim); display: flex; justify-content: space-between; }
.dd-lab b.w { color: var(--warn); }
.breadth { margin-top: 14px; display: grid; gap: 10px; }
.meter .lab { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.meter .lab b { font-weight: 800; }
.meter .bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface2); margin-top: 5px; overflow: hidden; }
.meter .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; opacity: .85; }
.meter .bar u { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface2); font-size: 12px; color: var(--dim); white-space: nowrap; border: 0; }
.chip b { color: var(--text); }

/* 검증 띠 */
.proof { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--surface2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.proof .vbadge { flex: none; height: 22px; font-size: 11px; }
.proof .vbadge.b-dim { background: var(--surface); }
.proof b { font-weight: 800; }

/* 종목 행 카드 */
.llist { display: grid; grid-template-columns: minmax(0, 1fr); }
.lrow {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 84px 38px; gap: 8px; align-items: center;
  min-height: 60px; padding: 8px 0; border: 0; border-top: 1px solid var(--line-soft); background: none;
  text-align: left; width: 100%; font-size: 14px;
}
.lrow:first-child { border-top: 0; }
.lrow:active { background: var(--surface2); }
.lrow.norank { grid-template-columns: minmax(0, 1fr) 84px 38px; }
.lrow.plain { grid-template-columns: minmax(0, 1fr) 38px; }
.lrow .rk { font-size: 12px; color: var(--faint); font-weight: 700; text-align: center; }
.lrow .main { min-width: 0; }
.lrow .l1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.lrow .sym { font-weight: 800; font-size: 15px; white-space: nowrap; }
.lrow .nm { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lrow .l2 { display: flex; gap: 8px; font-size: 12px; color: var(--dim); margin-top: 3px; white-space: nowrap; min-width: 0; }
.lrow .l2 > span { flex: none; }
.lrow .l2 > .sec { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lrow .l2 b { font-weight: 700; }
.spc { display: flex; flex-direction: column; align-items: center; line-height: 1.25; white-space: nowrap; }
.spc small { font-size: 11px; color: var(--dim); font-weight: 600; }
.spc b { font-size: 14px; font-weight: 800; }
.rs { width: 38px; height: 38px; position: relative; justify-self: end; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.rs svg { position: absolute; inset: 0; width: 38px; height: 38px; transform: rotate(-90deg); }
.rs.hot { color: var(--accent); }
.pv { font-size: 11px; color: var(--dim); text-align: center; white-space: nowrap; }
.pv .trk { position: relative; height: 16px; margin: 0 6px 1px; }
.pv .trk::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--line); border-radius: 1px; }
.pv .trk u { position: absolute; left: 50%; top: 2px; bottom: 2px; width: 2px; background: var(--accent); }
.pv .trk i { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; border: 2px solid var(--surface); }
.pv b { font-weight: 800; color: var(--text); }
/* 컴팩트 행(2026-10-24 사용자가 고른 시안 B): 두 줄은 그대로, 높이 46px, RS는 숫자 칩 */
.lrow.compact { grid-template-columns: 18px minmax(0, 1fr) 58px 32px; gap: 8px; min-height: 46px; padding: 4px 0; }
.lrow.compact.norank { grid-template-columns: minmax(0, 1fr) 58px 32px; }
.lrow.compact.setup { grid-template-columns: 18px minmax(0, 1fr) 76px 32px; }
.lrow.compact .rk { font-size: 11px; }
.lrow.compact .sym { font-size: 14px; }
.lrow.compact .nm { font-size: 11.5px; }
.lrow.compact .l2 { font-size: 11.5px; margin-top: 1px; gap: 8px; }
.spc.c { align-items: flex-end; line-height: 1.15; }
.spc.c b { font-size: 14px; } .spc.c small { font-size: 10.5px; }
.rsc { justify-self: end; min-width: 30px; padding: 2px 0; border-radius: 7px; text-align: center; font-size: 12px; font-weight: 800; background: var(--surface2); color: var(--dim); font-variant-numeric: tabular-nums; }
.rsc.hot { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.lrow.compact .pv { font-size: 10.5px; } .lrow.compact .pv .trk { height: 12px; } .lrow.compact .pv .trk::before { top: 6px; } .lrow.compact .pv .trk i { top: 2px; }
.more-btn { width: 100%; min-height: 44px; margin-top: 6px; border: 0; border-radius: 12px; background: var(--surface2); font-size: 14px; font-weight: 700; color: var(--dim); }

/* 점수 1위 */
.top-pick { border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.top-pick .l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-pick .sym { font-size: 18px; font-weight: 800; white-space: nowrap; }
.top-pick .nm { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top-pick .sc { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--accent); flex: none; }
.top-pick .sc small { font-size: 12px; color: var(--dim); font-weight: 600; }
.parts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 10px; }
.part { font-size: 12px; color: var(--dim); min-width: 0; }
.part .pb { height: 5px; border-radius: 3px; background: var(--line); margin-top: 3px; overflow: hidden; }
.part .pb i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.part .pl { display: flex; justify-content: space-between; gap: 4px; }
.part .pl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-note { font-size: 12px; color: var(--dim); margin-top: 8px; line-height: 1.5; }
.tp-note .runner { color: var(--text); font-weight: 700; cursor: pointer; display: inline-block; min-height: 28px; line-height: 28px; padding: 0 2px; }
.linkish { background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 12px; min-height: 32px; padding: 0 4px; }

/* 시트 */
.scrim { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .18s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 410; max-height: 86vh; overflow: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .22s ease; visibility: hidden;
  max-width: 640px; margin: 0 auto;
}
.sheet.on { transform: none; visibility: visible; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; }
.sheet h3 .icon-btn { margin-left: auto; }
.sheet p { font-size: 14px; line-height: 1.65; color: var(--dim); margin-bottom: 10px; }
.sheet p b { color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { min-height: 84px; border: 0; border-radius: 14px; background: var(--surface2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 8px 4px; text-align: center; }
.tile svg { width: 26px; height: 26px; color: var(--accent); }
.tile small { font-size: 11px; color: var(--dim); font-weight: 600; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.set-row small { display: block; font-size: 12px; color: var(--dim); }
.search-in { width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); padding: 0 14px; font-size: 16px; outline: none; }
.search-in:focus { border-color: var(--accent); }
.data-box { background: var(--surface2); border-radius: 12px; padding: 12px; margin-top: 12px; font-size: 13px; color: var(--dim); line-height: 1.6; }
.data-box b { color: var(--text); }

/* 찾기 */
.hscroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px; }
.hscroll::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--dim); background: var(--surface); white-space: nowrap; }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ftool { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; font-size: 13px; color: var(--dim); flex-wrap: wrap; }
.ftool .sp { flex: 1; }
.ftool b { color: var(--text); }
.sel { min-height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; font-size: 13px; font-weight: 700; max-width: 100%; }
.toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 13px; background: none; border: 0; color: var(--dim); }
.toggle i { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle.on i { background: var(--accent); }
.toggle.on i::after { transform: translateX(14px); }

/* 섹터 */
.sec-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 40px; gap: 10px; align-items: center; min-height: 56px; border: 0; border-top: 1px solid var(--line-soft); background: none; padding: 6px 2px; width: 100%; text-align: left; font-size: 14px; }
.sec-row:first-child { border-top: 0; }
.sec-row .n { font-weight: 800; font-size: 14px; }
.sec-row .m { font-size: 12px; color: var(--dim); }
.minibar { display: block; height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.minibar i { display: block; height: 100%; border-radius: 4px; }

/* 관심 */
.stackbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 10px 0 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--dim); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
details.grp { border-top: 1px solid var(--line-soft); }
details.grp:first-of-type { border-top: 0; }
details.grp summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 800; font-size: 15px; cursor: pointer; }
details.grp summary::-webkit-details-marker { display: none; }
details.grp summary .cnt { font-size: 12px; color: var(--dim); font-weight: 600; }
details.grp summary .mini { margin-left: auto; display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
details.grp summary .mini i { width: 8px; height: 8px; border-radius: 50%; }
details.grp summary svg, details.acc summary svg { width: 18px; height: 18px; color: var(--faint); transition: transform .15s; flex: none; }
details.grp[open] summary svg, details.acc[open] summary svg { transform: rotate(90deg); }
.wrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; min-height: 56px; border: 0; border-top: 1px solid var(--line-soft); background: none; padding: 4px 2px; width: 100%; text-align: left; font-size: 14px; }
.wrow .w1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrow .w2 { font-size: 12px; color: var(--dim); }
.state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.state i { width: 8px; height: 8px; border-radius: 50%; }

/* 성적 */
.hbar { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 40px; font-size: 13px; }
.hbar .n { font-weight: 700; line-height: 1.25; }
.hbar .n small { display: block; font-size: 11px; color: var(--dim); font-weight: 600; }
.hbar .tr { position: relative; height: 22px; }
.hbar .tr i { position: absolute; top: 3px; height: 16px; border-radius: 4px; }
.hbar .tr span { position: absolute; top: 2px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.axis0 { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--line); }

/* 종목 상세 */
.st-head { display: flex; align-items: center; gap: 6px; margin: -2px -4px 2px; }
.st-head .sym { font-size: 22px; font-weight: 800; letter-spacing: -.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-head .star { margin-left: auto; }
.st-head .star.on { color: var(--accent); }
.st-head .star.on svg { fill: currentColor; }
.st-name { font-size: 13px; color: var(--dim); padding: 0 2px; }
.st-px { display: flex; align-items: baseline; gap: 8px; margin: 6px 2px 0; flex-wrap: wrap; }
.st-px .p { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.st-px .c { font-size: 15px; font-weight: 800; }
.verdict h2 { font-size: 19px; font-weight: 800; letter-spacing: -.4px; margin: 8px 0 4px; line-height: 1.35; }
.verdict p { font-size: 14px; color: var(--dim); line-height: 1.55; }
.verdict p b { color: var(--text); }
.tt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.tt { background: var(--surface2); border-radius: 10px; padding: 8px 4px 7px; text-align: center; font-size: 11px; line-height: 1.3; color: var(--dim); min-height: 62px; }
.tt i { display: grid; place-items: center; width: 22px; height: 22px; margin: 0 auto 4px; border-radius: 50%; font-style: normal; font-weight: 800; font-size: 12px; }
.tt.y i { background: var(--ok-soft); color: var(--ok); }
.tt.n i { background: var(--up-soft); color: var(--up); }
.chart-box { position: relative; margin: 0 -4px; touch-action: pan-y; }
.chart-box canvas { width: 100%; display: block; }
.chart-tip { display: inline-block; margin: 0 0 6px 2px; font-size: 12px; background: var(--surface2); border-radius: 8px; padding: 3px 8px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.legend-ma { display: flex; gap: 12px; font-size: 11px; color: var(--dim); margin: 6px 2px 0; flex-wrap: wrap; }
.legend-ma span { display: inline-flex; align-items: center; gap: 5px; }
.legend-ma i { width: 14px; height: 3px; border-radius: 2px; }
.nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.num { background: var(--surface2); border-radius: 12px; padding: 10px 12px; }
.num .k { font-size: 12px; color: var(--dim); }
.num .v { font-size: 19px; font-weight: 800; margin-top: 1px; }
.num .v small { font-size: 12px; font-weight: 600; color: var(--dim); }
.plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.plan .k { font-size: 12px; color: var(--dim); }
.plan .v { font-size: 16px; font-weight: 800; }
.plan-line { position: relative; height: 34px; margin: 14px 10px 4px; }
.plan-line::before { content: ''; position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--down) 0%, var(--line) 30%, var(--line) 70%, var(--up) 100%); opacity: .7; }
.plan-line span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; font-weight: 800; white-space: nowrap; }
.plan-line span::after { content: ''; display: block; width: 3px; height: 14px; margin: 1px auto 0; border-radius: 2px; background: currentColor; }
.abtn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; font-weight: 800; font-size: 14px; background: var(--surface2); }
.abtn.pri { background: var(--accent); color: var(--accent-ink); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.caveat { font-size: 12px; color: var(--dim); margin-top: 10px; line-height: 1.5; }
.caveat a { color: var(--accent); font-weight: 700; text-decoration: none; }
.lcard .big-num { font-size: 26px; letter-spacing: -.5px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lcard .sub { font-size: 13px; margin-top: 2px; line-height: 1.5; }
.st-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 2px 0; }
.tt-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 12px 0 0; }
.ttc { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-soft); font-size: 12px; color: var(--dim); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttc i { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-weight: 800; font-size: 11px; }
.ttc.y { color: var(--text); }
.ttc.y i { background: var(--ok-soft); color: var(--ok); }
.ttc.n i { background: var(--up-soft); color: var(--up); }
.st-vcp { font-size: 13px; color: var(--dim); margin: 10px 2px 0; line-height: 1.6; }
.st-vcp b { color: var(--text); font-weight: 700; }
.bench-h { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.bench-h .t { font-size: 15px; font-weight: 800; }
.bench-h .seg { margin-left: auto; }
.brief-v { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.brief-sec { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.brief-sec .h { font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 3px; }
.brief-sec .b { font-size: 13px; color: var(--dim); line-height: 1.65; }
.brief-sec .b b { color: var(--text); }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.card-h + .kv { border-top: 0; padding-top: 0; }
.kv > span:first-child { color: var(--dim); flex: none; }
.kv > span:last-child { text-align: right; font-weight: 600; }
details.acc { border-top: 1px solid var(--line-soft); }
details.acc:first-of-type { border-top: 0; }
details.acc summary { list-style: none; min-height: 48px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary .vbadge { margin-left: auto; }
details.acc .body { font-size: 14px; color: var(--dim); padding: 0 0 12px 26px; line-height: 1.65; }
details.acc .body b { color: var(--text); }

.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 500; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; padding: 10px 16px; border-radius: 12px; transition: all .2s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* 표는 넓은 화면, 행 카드는 폰 */
.only-m { display: none; }
@media (max-width: 768px) {
  .only-m { display: block; }
  .only-d { display: none !important; }
}

/* 넓은 화면: 탭을 왼쪽 레일로, 오늘 화면은 두 칸 */
@media (min-width: 900px) {
  #nav { top: 56px; right: auto; width: 88px; grid-auto-flow: row; grid-template-columns: 1fr; grid-auto-rows: 72px; align-content: start; padding: 10px 6px; border-top: 0; border-right: 1px solid var(--line-soft); }
  #main { padding: 20px 24px 40px 112px; }
  .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .two > .span { grid-column: 1 / -1; }
  .toast { bottom: 24px; }
}

/* 종목 표: 한 줄 행, 가로 스크롤 없이 모든 칸 (2026-10-14 사용자)
   숫자 칸은 자르지 않는다. 이름·업종·테마 칸만 화면 폭에 맞춰 줄이고 말줄임 */
.fit-wrap { width: 100%; overflow-x: auto; }
table.fit { font-size: 13px; }
table.fit th, table.fit td { padding: 7px 4px; }
table.fit th:first-child, table.fit td:first-child { padding-left: 6px; }
table.fit th:last-child, table.fit td:last-child { padding-right: 6px; }
table.fit th { font-size: 11.5px; }
table.fit .badge, table.fit .rs-badge { font-size: 11px; padding: 1px 5px; min-width: 0; }
table.fit th:nth-child(-n+3), table.fit td:nth-child(-n+3) { text-align: left; }
table.fit td.c-name, table.fit td.c-sec, table.fit.kr td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.fit td.c-name { max-width: clamp(56px, calc(30vw - 250px), 200px); }
table.fit td.c-sec { max-width: clamp(52px, calc(20vw - 150px), 150px); }
table.fit.kr td:first-child { max-width: clamp(90px, calc(20vw - 100px), 170px); }
table.fit.kr td.c-sec { max-width: clamp(70px, calc(25vw - 170px), 220px); }
@media (min-width: 900px) { .tt-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }/* 종목 상세 아래 카드: 짧은 3장은 한 줄 3칸(같은 높이), 기업 개요·뉴스는 한 줄 전체, 뉴스는 넓은 화면에서 2칸 (2026-10-14) */
.st-row3 { display: grid; gap: 12px; margin: 12px 0; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.news-grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; }
@media (min-width: 900px) {
  .st-row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid .news-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}
@media (min-width: 769px) { .hbar { grid-template-columns: 170px minmax(0, 1fr); } }

/* 펀더멘털 카드 (2026-10-14) */
.fv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .fv-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.fv { background: var(--surface2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.fv .k { font-size: 12px; color: var(--dim); }
.fv .v { font-size: 19px; font-weight: 800; margin-top: 1px; white-space: nowrap; }
.fv .s { font-size: 11px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fnote { font-size: 13px; color: var(--dim); margin: 10px 2px 0; line-height: 1.5; }
.fsec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.fsec.two-col { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .fsec.two-col { grid-template-columns: 1fr 1fr; } }
.fh { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.fh .q { font-size: 12px; font-weight: 500; color: var(--dim); margin-left: 4px; }
svg.fbars { width: 100%; height: auto; display: block; max-height: 230px; }
svg.fbars text { fill: var(--text); font-family: inherit; }
svg.fbars text.q { fill: var(--dim); }
svg.fbars text.up { fill: var(--up); } svg.fbars text.down { fill: var(--down); }
table.ftable { font-size: 13px; }
table.ftable th, table.ftable td { padding: 7px 6px; text-align: left; }
table.ftable .n { text-align: right; }
table.ftable td small { display: block; font-size: 11px; color: var(--dim); }
table.ftable tr.est td { color: var(--dim); }
table.ftable tr { cursor: default; }
table.ftable tr:hover { background: none; }
@media (max-width: 600px) { table.ftable .hide-m { display: none; } }
.idx .sp-cap { font-size: 10.5px; color: var(--faint); margin: -2px 0 4px; }

.chip b.up { color: var(--up); } .chip b.down { color: var(--down); }
.idx-facts { display: grid; gap: 6px; margin-top: 6px; max-width: 420px; } .idx-facts .dd { margin-top: 0; } .hero .breadth { margin-top: 14px; }
.lcard .legend-ma i { opacity: .55; height: 2px; }
.kr-cols { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); } .kr-col { display: grid; gap: 12px; align-content: start; min-width: 0; } @media (min-width: 900px) { .kr-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 국장 특징주 탭 (2026-10-14) */
.kr-feat .card-h { margin-bottom: 8px; }
.kgrp { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.kgrp:first-of-type { border-top: 0; padding-top: 0; }
.kgh { display: flex; align-items: baseline; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.kgh .dim { font-size: 12px; }
.kchips { display: flex; flex-wrap: wrap; gap: 6px; }
.kchip { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--surface2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.kchip b { font-weight: 800; margin-left: 2px; }
.krows { display: grid; }
.krow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line-soft); background: none; padding: 9px 0; min-height: 56px; }
.krow:first-child { border-top: 0; }
.krow:active { background: var(--surface2); }
.krow .main { min-width: 0; display: grid; gap: 2px; }
.krow .l1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 15px; }
.krow .l1 b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krow .code { font-size: 12px; color: var(--dim); flex: none; }
.krow .l2 { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krow .l2 b { color: var(--text); font-weight: 700; }
.krow .l3 { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
/* 왜 올랐나 한 줄 (2026-10-22) */
.kr-feat .why { min-width: 0; max-width: 100%; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.4; color: var(--text); opacity: .82; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.kr-feat .why i { font-style: normal; font-size: 11px; font-weight: 700; color: var(--dim); }
table.krt td .why { margin-top: 2px; font-weight: 400; max-width: 420px; }
.kwhy { display: grid; gap: 2px; margin-top: 8px; }
.kwhy-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: baseline; text-align: left; border: 0; background: none; padding: 5px 0; min-height: 32px; font-size: 13px; color: var(--text); }
.kwhy-row b { white-space: nowrap; font-weight: 700; }
.kwhy-row:active { background: var(--surface2); }
.krow .ret { font-size: 15px; font-weight: 800; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--surface2); color: var(--dim); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.ok { color: var(--ok); background: var(--ok-soft); }
.tag.acc { color: var(--accent); background: var(--accent-soft); }
.tag.up { color: var(--up); background: var(--up-soft); }
table.krt td, table.krt th { padding: 7px 8px; }
table.krt td:first-child a { border: 0; }
table.krt td.tags { text-align: left; }
table.krt td.tags .tag { margin-right: 4px; }
.kstats { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .kstats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kstat .kh { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.kstat .kh .dim { font-size: 11px; font-weight: 500; }
.kstat p { font-size: 13px; color: var(--dim); line-height: 1.6; margin: 2px 0; }
.kstat p b { color: var(--text); }
.kstat p b.up { color: var(--up); } .kstat p b.down { color: var(--down); }


/* 국장 오늘: 수급·강한 업종 (2026-10-14) */
.kr-pulse { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.kr-pulse:empty { display: none; }
@media (min-width: 900px) { .kr-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; } .th-sub { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 6px; } .th-sub .th-bar { margin: 0; } .th-row { padding: 9px 0; } .kr-pulse .kchip { min-height: 30px; padding: 0 10px; font-size: 12.5px; } }
.fl-grid { display: grid; gap: 14px; }
.fl-h { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.fl-h .dim { font-size: 12px; font-weight: 500; }
.fl-head, .fl-row { display: grid; grid-template-columns: 52px 86px minmax(0, 1fr) 80px; gap: 8px; align-items: center; }
.fl-head { font-size: 11px; color: var(--faint); }
.fl-head span:nth-child(2), .fl-head span:nth-child(4) { text-align: right; }
.fl-row { min-height: 36px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.fl-row .fl-n { color: var(--dim); }
.fl-row > b { text-align: right; font-size: 14px; white-space: nowrap; }
.fl-row .fl-sum { text-align: right; font-size: 12px; font-weight: 700; white-space: nowrap; }
svg.fbar { width: 100%; height: 30px; display: block; }
.th-row { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.th-row:first-of-type { border-top: 0; padding-top: 0; }
.th-top { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.th-top .dim { font-size: 12px; }
.th-bar { height: 5px; border-radius: 3px; background: var(--surface2); margin: 6px 0 8px; overflow: hidden; }
.th-bar i { display: block; height: 100%; background: var(--up); opacity: .7; border-radius: 3px; }

.opt-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (min-width: 900px) { .opt-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); } } .opt-nums .num .v { font-size: 18px; } .opt-points { margin: 12px 0 4px; display: grid; gap: 6px; } .opt-points li { list-style: none; position: relative; padding-left: 14px; font-size: 13.5px; line-height: 1.6; color: var(--dim); } .opt-points li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); } a.abtn { color: var(--accent-ink); }

/* 트레이딩랩 (모의계좌) 행 카드·접기 (2026-10-14) */
.tag.down { color: var(--down); background: var(--down-soft, var(--surface2)); }
.lab-total { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; flex-wrap: wrap; }
.lab-total > b { font-size: 18px; font-weight: 800; }
.lab-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 60px; padding: 8px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; text-align: left; width: 100%; font-size: 14px; color: inherit; cursor: pointer; }
.lab-row:first-child { border-top: 0; }
.lab-row:active { background: var(--surface2); }
.lab-row.lab-pos, .lab-row:not(:has(.lab-rk)) { grid-template-columns: minmax(0, 1fr) auto; }
.lab-rk { font-size: 15px; font-weight: 800; text-align: center; }
.lab-main { min-width: 0; }
.lab-l1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.lab-l1 b { font-size: 15px; font-weight: 800; white-space: nowrap; }
.lab-l1 .nm { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lab-l2 { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--dim); margin-top: 3px; }
.lab-l2 b { font-weight: 700; color: var(--text); }
.lab-l2 b.up, .lab-l2 b.down { color: inherit; }
.lab-l2 b.up { color: var(--up); } .lab-l2 b.down { color: var(--down); }
.lab-v { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.lab-v b { font-size: 16px; font-weight: 800; white-space: nowrap; }
.lab-v small { font-size: 11px; color: var(--dim); white-space: nowrap; }
.lab-r { margin-left: auto; font-size: 12px; color: var(--dim); font-weight: 600; }
.lab-acc { font-size: 13.5px; color: var(--dim); line-height: 1.65; padding: 0 0 12px; }
.lab-acc b { color: var(--text); }
.lab-acc p { margin: 0; }
.lab-ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.lab-task + .lab-task { margin-top: 10px; }
.lab-j { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.lab-j:first-child { border-top: 0; }
.lab-head { font-size: 14px; line-height: 1.6; color: var(--text); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.lab-head.open { -webkit-line-clamp: unset; display: block; }
.lab-row + .lab-row {}
.chip.mt-min { min-height: 34px; padding: 0 12px; font-weight: 700; cursor: pointer; }
.lab-min { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.6; background: var(--surface2); border-radius: 10px; padding: 12px; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.lab-tr .card-h .t { display: flex; gap: 8px; align-items: baseline; }
