/* 화면 모양. 값은 tokens.css 의 변수만 씀. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, p { margin: 0; }

/* 키보드로 옮겨 다닐 때 어디에 있는지 보이게 */
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--radius); }

.skip {
  position: absolute; left: var(--s2); top: -40px; z-index: 50;
  padding: var(--s1) var(--s2); background: var(--raised); color: var(--text); border-radius: var(--radius);
}
.skip:focus { top: var(--s2); }

/* ── 위 메뉴 ── */
.top {
  flex: none;
  display: flex; align-items: center; gap: var(--s4);
  height: calc(44px * var(--fz)); padding: 0 var(--s4);
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.logo { flex: none; display: flex; align-items: center; padding: var(--s1); border-radius: var(--radius); }
.logo img { display: block; height: 28px; width: auto; }
.logo .logo-mark { display: none; } /* 좁은 화면에서만 마크로 바꿈 */
.nav {
  display: flex; align-items: center; gap: var(--s1); flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; /* 메뉴가 넘치면 줄을 바꾸지 않고 옆으로 밀어 봄 */
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 6px var(--s3); border-radius: var(--radius);
  color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--raised); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ── 단추 ── */
.btn {
  height: var(--ctl-h); padding: 0 var(--s3);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-primary:hover { border-color: var(--on-accent); }
.btn-lg { height: calc(36px * var(--fz)); padding: 0 var(--s4); display: inline-flex; align-items: center; text-decoration: none; }

.chip {
  flex: none; height: var(--ctl-h); padding: 0 var(--s3);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--muted); white-space: nowrap;
}
.chip:hover { color: var(--text); background: var(--raised); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] {
  color: var(--text); background: var(--accent-soft); border-color: var(--accent);
}
.chip:disabled { cursor: default; opacity: 0.7; border-style: dashed; border-color: var(--line); }
.chip:disabled:hover { background: transparent; color: var(--muted); }

/* ── 주의 띠(인터넷 끊김·쉬는 중) ── */
.banner {
  flex: none; padding: 3px var(--s4);
  background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn);
  font-size: var(--fs-sm); text-align: center;
}

main { flex: 1; min-height: 0; overflow: auto; }
main:focus-visible { box-shadow: none; } /* 건너뛰기 링크로 초점만 받는 자리라 테두리를 그리지 않음 */

/* ── 맨 아래 ── */
.foot {
  flex: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); justify-content: space-between;
  padding: var(--s1) var(--s4);
  border-top: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: var(--fs-sm);
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }

/* ── 준비 중 화면 ── */
.soon {
  max-width: 560px; margin: 12vh auto 0; padding: var(--s4);
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3);
}
.soon h1 { font-size: var(--fs-xl); }
.soon p { color: var(--muted); font-size: var(--fs-lg); }
.tag-soon {
  display: inline-block; padding: 2px var(--s2);
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: var(--fs-sm);
}

/* ── 차트 화면 ── */
.chart-page { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.bar {
  flex: none; display: flex; align-items: center; gap: var(--s1);
  min-height: calc(38px * var(--fz)); padding: var(--s1) var(--s3);
  background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.bar::-webkit-scrollbar { display: none; }
.bar .gap { flex: 1; min-width: var(--s3); }
.bar-group { flex: none; display: flex; align-items: center; gap: 2px; }
.bar .label { flex: none; color: var(--muted); font-size: var(--fs-sm); margin-right: var(--s1); white-space: nowrap; }
.bar .sep { flex: none; width: 1px; height: 18px; background: var(--line); margin: 0 var(--s2); }
/* 봉 단추가 먹는 칸을 알려 주는 꼬리표 — 지금 칸 테두리와 같은 색 점 */
.now-tag {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: var(--ctl-h); padding: 0 var(--s2); margin-right: var(--s2);
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--text); font-size: var(--fs-sm); white-space: nowrap;
}
.now-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.info { gap: var(--s4); white-space: nowrap; }
.info-name { display: flex; align-items: baseline; gap: var(--s2); flex: none; }
.info-name b { font-size: var(--fs-lg); }
.info-name small { color: var(--muted); font-size: var(--fs-sm); }
.info-price { font-size: var(--fs-lg); font-weight: 700; flex: none; }
.info-item { flex: none; color: var(--muted); font-size: var(--fs-sm); }
.info-item b { color: var(--text); font-weight: 600; font-size: var(--fs); margin-left: var(--s1); }
.info-pct { margin-left: var(--s1); font-size: var(--fs); font-weight: 600; }

.is-up { color: var(--up); }
.is-down { color: var(--down-text); }
.is-flat { color: var(--flat); }

.work { flex: 1; min-height: 0; display: flex; }
/* 차트 영역: 아래에 차트 격자, 그 위에 같은 격자로 경계 손잡이를 겹침 */
.grid-wrap { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; }
.grid-handles {
  position: absolute; inset: 0; z-index: 5;
  display: grid; gap: var(--s1); padding: var(--s1);
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  pointer-events: none; /* 손잡이만 눌리고 나머지는 아래 차트로 통과 */
}
/* 손잡이: 잡히는 영역은 12px, 보이는 선은 4px(틈 한가운데). 격자가 경계 바로 다음 줄의 시작에 놓아 주므로 틈 쪽으로 당겨 놓음 */
.gh { pointer-events: auto; position: relative; touch-action: none; user-select: none; z-index: 1; }
.gh-col { justify-self: start; width: 12px; margin-left: -8px; cursor: col-resize; }
.gh-row { align-self: start; height: 12px; margin-top: -8px; cursor: row-resize; }
.gh::after { content: ""; position: absolute; border-radius: 2px; background: transparent; }
.gh-col::after { left: 4px; top: 0; bottom: 0; width: 4px; }
.gh-row::after { top: 4px; left: 0; right: 0; height: 4px; }
.gh:hover::after, .gh.is-dragging::after, .gh:focus-visible::after { background: var(--accent); }
.gh:focus-visible { box-shadow: none; }
/* 영역이 좁아 그 방향으로는 크기를 못 바꿀 때 */
.gh.is-off { cursor: default; }
.gh.is-off:hover::after { background: transparent; }
.gh.is-off:focus-visible::after { background: var(--muted); }
/* 끄는 동안: 차트가 마우스를 받지 않게(차트가 같이 끌려 움직이지 않음), 글자가 선택되지 않게 */
.grid-wrap.is-resizing .grid { pointer-events: none; }
.grid-wrap.is-resizing { user-select: none; }
.grid {
  flex: 1; min-width: 0; min-height: 0;
  display: grid; gap: var(--s1); padding: var(--s1);
  /* 열·행과 칸 자리는 모양 자료(js/util/shapes.js)에서 chart-page.js 가 넣음 — 여기에 칸 수별 규칙을 두지 않음 */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
.grid-msg { place-self: center; color: var(--muted); text-align: center; padding: var(--s4); }

.pane {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.pane.is-active { border-color: var(--accent); }
.pane:focus-visible { box-shadow: none; border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -2px; }
.pane-chart { position: absolute; inset: 0; }
.pane-legend {
  position: absolute; left: var(--s2); top: var(--s1); right: 64px; z-index: 3;
  display: flex; flex-wrap: nowrap; gap: 0 var(--s2); align-items: baseline;
  pointer-events: none; font-size: var(--fs-sm);
  white-space: nowrap; overflow: hidden; /* 줄을 바꾸지 않음 — 글자가 캔들 위로 내려오지 않게 */
}
/* 자리가 모자라면 이름·봉은 지키고 값 쪽이 잘림 */
.pane-title { pointer-events: auto; appearance: none; border: 0; color: inherit; font-family: inherit; cursor: pointer; text-align: left; line-height: inherit; }
.pane-title:hover { outline: 1px solid var(--accent); }
.pane-title::after { content: ' ▾'; color: var(--muted); font-weight: 400; }
.pane-title { flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: var(--fs); }
/* 글자 뒤에 차트 바탕색을 반투명하게 깔아, 지표 선이 지나가도 읽히게 */
.pane-title, .pane-ohlc { padding: 0 var(--s1); background: var(--veil); border-radius: 3px; }
.pane-ohlc { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--muted); display: flex; flex-wrap: nowrap; gap: 0 var(--s2); }
.pane-ohlc > * { flex: none; }
/* 좁은 칸(너비는 chart-pane.js 가 재서 붙임): 시·고·저를 숨기고, 더 좁으면 이름·봉만 */
.pane.is-compact .ohlc-extra { display: none; }
.pane.is-compact .pane-legend { right: var(--s2); }
.pane.is-tiny .pane-ohlc { display: none; }
/* 켜진 지표의 꼬리표(이름 아래 줄). 줄 자체는 눌리지 않고(캔들로 통과) × 단추만 눌림 */
.pane-ind {
  /* z-index 5: "이 종목은 지금 없어요" 덮개(4)보다 위 — 못 받은 칸에서도 × 로 지표를 끌 수 있게 */
  position: absolute; left: var(--s2); top: calc(26px * var(--fz)); right: 64px; z-index: 5;
  display: flex; flex-wrap: nowrap; gap: var(--s1); align-items: center;
  pointer-events: none; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden;
}
.ind-tags { flex: none; display: flex; gap: var(--s1); }
.ind-tag, .method-tag {
  display: inline-flex; align-items: center; height: calc(20px * var(--fz)); padding-left: 6px;
  background: var(--veil); border: 1px solid var(--muted); border-radius: var(--radius); color: var(--text);
}
.ind-tag-x, .method-x {
  pointer-events: auto; width: calc(20px * var(--fz)); height: calc(18px * var(--fz)); padding: 0; margin-left: 2px;
  background: transparent; border: 0; border-radius: var(--radius); color: var(--muted); line-height: 1;
}
.ind-tag-x:hover, .method-x:hover { color: var(--text); background: var(--raised); }
.ind-count { display: none; padding: 0 6px; height: calc(20px * var(--fz)); line-height: calc(18px * var(--fz)); background: var(--veil); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); pointer-events: auto; }
.ind-note { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); padding: 0 var(--s1); background: var(--veil); border-radius: 3px; }
/* 아래 칸 이름표: 그 칸의 왼쪽 위. 자리(top)는 chart-pane.js 가 넣음 */
.pane-subs { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.pane-sub {
  position: absolute; left: var(--s2); display: flex; gap: 6px; align-items: baseline;
  padding: 0 var(--s1); background: var(--veil); border-radius: 3px;
  font-size: var(--fs-sm); color: var(--muted); white-space: nowrap;
}
.pane-sub b { font-weight: 700; color: var(--text); }
.pane.is-compact .sub-value { display: none; }
/* 좁은 칸: 꼬리표 대신 개수만("지표 3"), 안내 글은 개수에 올리면 보임 */
.pane.is-compact .pane-ind { right: var(--s2); }
.pane.is-compact .ind-tags, .pane.is-compact .ind-note { display: none; }
.pane.is-compact .ind-count { display: inline-block; }
.pane-ohlc b { color: var(--text); font-weight: 500; margin-left: 2px; }
.pane-ohlc .is-up { color: var(--up); }
.pane-ohlc .is-down { color: var(--down-text); }
.pane-msg {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s4); text-align: center;
  background: var(--veil);
}
.pane-msg.is-soft { background: transparent; pointer-events: none; }
.pane-msg-text { font-size: var(--fs-lg); font-weight: 700; }
.pane-msg-hint { color: var(--muted); }

/* ── 오른쪽 칸 ── */
.side {
  flex: none; width: var(--side-w); min-height: 0;
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line);
}
.side-head { flex: none; display: flex; align-items: center; gap: 2px; padding: var(--s1); border-bottom: 1px solid var(--line); }
.side-head .chip { padding: 0 var(--s2); }
/* 탭 줄: 한 줄로(줄바꿈 없음). 탭이 많아 좁은 폭에서 넘치면 옆으로 밀어 봄(글자는 줄이지 않음 — 간격 · 안쪽 여백만 좁힘) */
.side-tabs {
  display: flex; flex-wrap: nowrap; gap: 1px; min-width: 0; flex: 0 1 auto;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
}
.side-tabs::-webkit-scrollbar { display: none; }
.side-head .side-tab { flex: none; padding: 0 4px; }
.side-head .gap { flex: 1; }
.side-fold { width: var(--ctl-h); padding: 0; flex: none; }
.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-soon { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.side-soon b { font-size: var(--fs-lg); }
.side-soon p { color: var(--muted); }
.side.is-folded { width: calc(36px * var(--fz)); }
.side.is-folded .side-head { flex-direction: column; border-bottom: 0; }
.side.is-folded .side-tabs, .side.is-folded .side-body, .side.is-folded .side-head .gap { display: none; }

.symlist { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.symlist-tools { flex: none; display: flex; flex-direction: column; gap: var(--s1); padding: var(--s2); border-bottom: 1px solid var(--line); }
.symlist-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.symlist-row .label { color: var(--muted); font-size: var(--fs-sm); margin-right: var(--s1); }
.symlist-row .chip { padding: 0 var(--s2); }
.input {
  width: 100%; height: calc(30px * var(--fz)); padding: 0 var(--s2);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.input::placeholder { color: var(--muted); }
.input:focus-visible { box-shadow: none; border-color: var(--accent); }
.symlist-view { flex: 1; min-height: 0; overflow-y: auto; position: relative; overscroll-behavior: contain; }
.symlist-space { position: relative; width: 100%; }
.symlist-empty { padding: var(--s4); color: var(--muted); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }

/* 종목 줄 — 칸은 언제나 머리줄과 같은 넷: 종목 · 현재가 · 변동(금액+변동률) · 거래대금(값+단위).
   좁으면(.is-two) 칸 안에서 두 줄로 쌓고, 넓으면(.is-one) 한 줄로 늘어놓음.
   줄 높이는 symbol-list.js 의 ROW_TWO · ROW_ONE · ROW_ONE_TOUCH 와 같은 값 */
.symlist { --c-price: 56px; --c-chg: 56px; --c-vol: 60px; --c-gap: 4px; --c-star: 22px; --c-pad: 4px; } /* 거래대금 칸은 머리 이름 「거래대금 ↓」이 들어갈 폭 */
.symlist.is-one { --c-price: 88px; --c-chg: 140px; --c-vol: 100px; --c-gap: 8px; --c-star: 28px; --c-pad: 8px; }
.symlist-view { scroll-padding-top: calc(30px * var(--fz)); }
.symlist-wide { margin-left: auto; }
.symlist-cols {
  position: sticky; top: 0; z-index: 2; height: calc(28px * var(--fz));
  display: grid; grid-template-columns: minmax(0, 1fr) var(--c-price) var(--c-chg) var(--c-vol);
  align-items: center; column-gap: var(--c-gap); padding: 0 var(--c-pad) 0 var(--c-star);
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.sym-col {
  min-width: 0; height: 100%; padding: 0; background: transparent; border: 0;
  display: flex; align-items: center; justify-content: flex-end; /* 칸보다 긴 이름(「거래대금 ↓」)은 왼쪽으로 넘쳐 화살표가 안 잘림 */
  color: var(--muted); font-size: var(--fs-sm); white-space: nowrap;
}
.sym-col:first-child { justify-content: flex-start; }
.sym-col:hover { color: var(--text); }
.sym-col[aria-pressed="true"] { color: var(--text); font-weight: 700; }
.sym-col:focus-visible { box-shadow: none; outline: 2px solid var(--accent); outline-offset: -2px; }
.sym-col-dir { font-style: normal; margin-left: 2px; }

.sym-row {
  position: absolute; left: 0; right: 0; height: 46px; height: calc(46px * var(--fz)); /* 앞 값 = 보통 크기(symbol-list.js 의 ROW_TWO × 배율) */
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line-soft);
}
.symlist.is-one .sym-row { height: 34px; }
.symlist.is-one .sym-row { height: calc(34px * var(--fz)); }
/* 글자 크기 고르기: 칸 폭도 배율을 따라감(보통일 때는 위 값과 같음) */
.symlist { --c-price: calc(56px * var(--fz)); --c-chg: calc(56px * var(--fz)); --c-vol: calc(60px * var(--fz)); --c-star: calc(22px * var(--fz)); }
.symlist.is-one { --c-price: calc(88px * var(--fz)); --c-chg: calc(140px * var(--fz)); --c-vol: calc(100px * var(--fz)); --c-star: calc(28px * var(--fz)); }
.sym-row.is-current { background: var(--accent-soft); }
.sym-row:hover { background: var(--raised); }
.sym-head { flex: 1; padding: 0 var(--s2); color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.sym-row.is-head, .sym-row.is-head:hover { background: var(--bg); }
.sym-star {
  flex: none; width: var(--c-star); height: 100%; padding: 0;
  background: transparent; border: 0; color: var(--muted); font-size: 0.875rem;
}
.sym-star[aria-pressed="true"] { color: var(--accent); } /* 주의 색은 띠·경고에만 씀 */
.sym-star:focus-visible, .sym-main:focus-visible { box-shadow: none; outline: 2px solid var(--accent); outline-offset: -2px; }
.sym-main {
  flex: 1; min-width: 0; height: 100%; padding: 0 var(--c-pad) 0 0;
  display: grid; grid-template-columns: 24px minmax(0, 1fr) var(--c-price) var(--c-chg) var(--c-vol);
  align-items: center; column-gap: var(--c-gap);
  background: transparent; border: 0; text-align: left; white-space: nowrap;
}
/* 로고: 넣어 둔 그림이 없으면 글자 동그라미. 바탕색은 종목마다 고정(tokens.css 의 --logo-0 … 7, 오름·내림 색과 다른 차분한 색) */
.sym-logo {
  grid-column: 1; width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--logo-text); font-size: var(--fs-sm); font-weight: 700; letter-spacing: -0.5px; line-height: 1;
}
.sym-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* 밝은 바탕용으로 그려진 회사 로고(주식)는 밝은 동그란 받침 위에 — 어두운 바탕에서도 보이게 */
.sym-logo.on-plate { background: var(--logo-text); }
.sym-logo.on-plate img { box-sizing: border-box; padding: 4px; }
.sym-logo.c0 { background: var(--logo-0); }
.sym-logo.c1 { background: var(--logo-1); }
.sym-logo.c2 { background: var(--logo-2); }
.sym-logo.c3 { background: var(--logo-3); }
.sym-logo.c4 { background: var(--logo-4); }
.sym-logo.c5 { background: var(--logo-5); }
.sym-logo.c6 { background: var(--logo-6); }
.sym-logo.c7 { background: var(--logo-7); }
.sym-name { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.sym-name b { font-weight: 700; }
.sym-name small { color: var(--muted); font-size: var(--fs-sm); margin-left: var(--s1); }
.symlist.is-two .sym-name small { display: block; margin-left: 0; overflow: hidden; text-overflow: ellipsis; }
.sym-tag {
  margin-left: var(--s1); padding: 0 var(--s1); border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); font-size: var(--fs-sm); font-style: normal;
}
.sym-price { grid-column: 3; text-align: right; overflow: hidden; }
/* 「변동」 칸: 금액과 변동률을 한 칸에(좁으면 위아래, 넓으면 나란히) */
.sym-chg {
  grid-column: 4; min-width: 0; display: flex; flex-direction: column; align-items: flex-end;
  font-size: var(--fs-sm); line-height: 1.25;
}
.symlist.is-one .sym-chg { flex-direction: row; justify-content: flex-end; align-items: baseline; gap: var(--s2); }
/* 「거래대금」 칸: 값과 단위(USDT) */
.sym-vol {
  grid-column: 5; min-width: 0; display: flex; flex-direction: column; align-items: flex-end;
  color: var(--text); font-size: var(--fs-sm); line-height: 1.25;
}
.symlist.is-one .sym-vol { flex-direction: row; justify-content: flex-end; align-items: baseline; gap: 3px; }
.sym-vol-num { flex: none; }
.sym-vol-unit { color: var(--muted); font-style: normal; font-size: var(--fs-sm); } /* 14단계: 10px → 12px(작아서 안 읽힘) */
/* 「넓게」: 종목 탭이 보일 때만 오른쪽 칸을 넓힘(다른 탭 · 접힌 칸은 원래 폭) */
@media (min-width: 861px) {
  .side:not(.is-folded):has(.side-panel:not([hidden]) .symlist.is-wide) { width: min(var(--side-w-wide), 55vw); }
  /* 「경제 이벤트」 탭이 보일 때도 조금 넓힘(탭 이름 다섯 개 · 발표마다 표 다섯 칸이 한 줄에 들어가게) */
  .side:not(.is-folded):has(#side-panel-econ:not([hidden])) { width: min(var(--side-w-econ), 45vw); }
}
@media (max-width: 860px) {
  .symlist-wide { display: none; } /* 좁은 화면은 오른쪽 칸이 이미 화면 폭 전체 */
  .symlist-cols { height: calc(34px * var(--fz)); }
  .symlist-view { scroll-padding-top: calc(36px * var(--fz)); }
  .symlist.is-one .sym-row { height: 40px; }
  .symlist.is-one .sym-row { height: calc(40px * var(--fz)); }
}

/* ── 시세 띠 ── */
.strip {
  flex: none; display: flex; align-items: center; gap: var(--s4);
  height: calc(30px * var(--fz)); padding: 0 var(--s3);
  background: var(--panel); border-top: 1px solid var(--line);
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip-item { flex: none; display: flex; align-items: baseline; gap: var(--s2); }
.strip-item b { font-weight: 700; }
.strip-item .pct { font-size: var(--fs-sm); }

/* ── 토스트(화면 안 작은 안내) ── */
.toasts {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); pointer-events: none;
}
.toast {
  padding: var(--s2) var(--s4);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toast.has-action { display: flex; align-items: center; gap: var(--s3); pointer-events: auto; padding-right: var(--s2); }

/* ── [화면 분할] 단추와 판 ── */
.chart-page { position: relative; }
.split-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.split-btn[aria-expanded="true"] { border-color: var(--accent); }
.split-btn-thumb { display: inline-flex; }
.split-btn-count { color: var(--muted); font-size: var(--fs-sm); }
.thumb { display: block; flex: none; }
.thumb rect { fill: var(--muted); opacity: 0.55; }
.split-panel, .ind-panel {
  position: absolute; z-index: 20; width: calc(400px * var(--fz));
  display: flex; flex-direction: column; gap: var(--s3);
  padding: var(--s3); overflow-y: auto; overscroll-behavior: contain;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.split-section { display: flex; flex-direction: column; gap: var(--s1); }
.split-section + .split-section { padding-top: var(--s3); border-top: 1px solid var(--line); }
.split-title { margin: 0 0 var(--s1); font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.split-row { display: flex; align-items: center; gap: var(--s2); }
.split-count { flex: none; width: calc(36px * var(--fz)); color: var(--muted); font-size: var(--fs-sm); text-align: right; }
.split-shapes { display: flex; flex-wrap: wrap; gap: var(--s1); }
.shape-btn {
  display: inline-flex; padding: 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.shape-btn:hover { border-color: var(--muted); }
.shape-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.shape-btn[aria-pressed="true"] .thumb rect, .saved-main[aria-pressed="true"] .thumb rect { fill: var(--accent); opacity: 1; }
.saved-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.saved-row { display: flex; align-items: center; gap: var(--s1); min-height: 40px; }
.saved-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2);
  padding: var(--s1) var(--s2); text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
}
.saved-main:hover { background: var(--panel); }
.saved-main[aria-pressed="true"] { border-color: var(--accent); }
.saved-text { min-width: 0; display: flex; flex-direction: column; }
.saved-name { display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.saved-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-text small { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-tag {
  flex: none; padding: 0 var(--s1); font-style: normal; font-size: var(--fs-sm);
  color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius);
}
.saved-del { flex: none; height: var(--ctl-h); padding: 0 var(--s2); background: transparent; border: 0; color: var(--muted); border-radius: var(--radius); }
.saved-del:hover { color: var(--text); background: var(--panel); }
.saved-row.is-confirm { padding: 0 var(--s2); background: var(--panel); border-radius: var(--radius); }
.saved-ask { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s1); }
.save-box small { color: var(--muted); font-size: var(--fs-sm); }
.save-actions { width: 100%; display: flex; align-items: center; gap: var(--s1); }
.save-actions small { flex: 1; }

/* ── 오류 표시(개발 중 버그를 숨기지 않게 화면 구석에) ── */
.errbox { position: fixed; left: var(--s2); bottom: 40px; z-index: 70; max-width: min(520px, calc(100vw - 16px)); }
.errbox-btn {
  height: var(--ctl-h); padding: 0 var(--s2);
  background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--radius); color: var(--warn);
}
.errbox-list {
  margin: var(--s1) 0 0; padding: var(--s2); list-style: none;
  max-height: 40vh; overflow: auto;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: var(--fs-sm); word-break: break-all;
}
.errbox-list li + li { margin-top: var(--s1); padding-top: var(--s1); border-top: 1px solid var(--line); }

/* ── 좁은 화면: 오른쪽 칸을 아래로 ── */
@media (max-width: 860px) {
  .top { gap: var(--s2); padding: 0 var(--s2); }
  .logo .logo-wide { display: none; }
  .logo .logo-mark { display: block; }
  .nav a { padding: 6px var(--s2); }
  .work { flex-direction: column; }
  .side { width: 100%; height: 42%; border-left: 0; border-top: 1px solid var(--line); }
  .side.is-folded { width: 100%; height: auto; }
  .side.is-folded .side-head { flex-direction: row; justify-content: flex-end; }
  .foot { justify-content: flex-start; }
}

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

/* ── 칸 크기 같게 · 차트 연동 ── */
.split-extra { margin-top: var(--s1); }
.even-btn:disabled { opacity: 0.5; cursor: default; }
.even-btn:disabled:hover { border-color: var(--line); }
.split-title .link-sum { margin-left: var(--s2); font-weight: 400; }
.link-btns { display: flex; flex-wrap: wrap; gap: var(--s1); }
.link-btn { border-color: var(--line); }
.link-box.is-dim { opacity: 0.55; }
.link-badge {
  flex: none; height: var(--ctl-h); display: inline-flex; align-items: center; padding: 0 var(--s2); margin-right: var(--s1);
  border: 1px dashed var(--accent); border-radius: var(--radius);
  color: var(--accent); font-size: var(--fs-sm); white-space: nowrap;
}

/* ── [지표] 단추와 판 ── */
.ind-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: var(--s1); }
.ind-btn[aria-expanded="true"] { border-color: var(--accent); }
.ind-btn-count { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-sm); text-align: center; }
.ind-panel { width: calc(300px * var(--fz)); }
.ind-body { display: flex; flex-direction: column; gap: var(--s2); }
.ind-lock { margin: 0; color: var(--text); line-height: var(--lh); word-break: keep-all; }
.ind-rows { display: flex; flex-direction: column; gap: 2px; }
.ind-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  min-height: var(--row-h); padding: 0 var(--s2); text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
button.ind-row:hover { border-color: var(--muted); }
.ind-row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ind-row-state { font-style: normal; font-size: var(--fs-sm); color: var(--muted); }
.ind-row[aria-pressed="true"] .ind-row-state { color: var(--accent); }
.ind-row.is-locked { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding: var(--s1) var(--s2); color: var(--muted); border-style: dashed; }
.ind-row.is-locked small { font-size: var(--fs-sm); word-break: keep-all; }
.ind-foot { display: flex; justify-content: flex-end; }
.ind-foot .btn:disabled { opacity: 0.5; cursor: default; }

/* ── 매매법: 단추·판·칸 꼬리표·상태 문구 ── */
.method-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.method-btn[aria-expanded="true"] { border-color: var(--accent); }
.method-btn-name { max-width: calc(160px * var(--fz)); overflow: hidden; text-overflow: ellipsis; color: var(--accent); font-size: var(--fs-sm); }
.method-panel { width: calc(360px * var(--fz)); }
.method-tabs { display: flex; gap: var(--s1); }
.method-tabs .chip { border-color: var(--line); }
.method-rows { display: flex; flex-direction: column; gap: 2px; }
.method-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 6px var(--s2); text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
button.method-row:hover { border-color: var(--muted); }
.method-row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.method-row[aria-pressed="true"] .ind-row-state { color: var(--accent); }
.method-row.is-soon, .method-row.is-locked { opacity: 0.85; border-style: dashed; }
.method-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.method-text b { font-weight: 700; }
.method-text small { color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.method-chips { display: flex; flex-wrap: wrap; gap: var(--s1); }
.method-chips i { font-style: normal; font-size: var(--fs-sm); color: var(--muted); padding: 0 6px; border: 1px solid var(--line); border-radius: 9px; }
.method-foot { color: var(--muted); font-size: var(--fs-sm); }
/* 칸 꼬리표: 매매법은 강조색 테두리 */
.method-tag { flex: none; border-color: var(--accent); color: var(--accent); max-width: 60%; overflow: hidden; }
.method-tag > span { overflow: hidden; text-overflow: ellipsis; }
.method-warn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: calc(20px * var(--fz)); padding-left: 6px;
  background: var(--veil); border: 1px solid var(--warn); border-radius: var(--radius); color: var(--warn);
}
.method-warn-btn { pointer-events: auto; height: calc(18px * var(--fz)); padding: 0 6px; background: var(--warn-soft); border: 0; border-radius: var(--radius); color: var(--warn); font-size: var(--fs-sm); }
.method-warn-btn:hover { color: var(--text); }
.warn-narrow { display: none; }
/* 좁은 칸: 안내 글은 숨기고 단추 글을 "15분봉에서 봐요 ›"로 바꿔 단추만으로 뜻이 통하게 */
.pane.is-compact .method-warn > span { display: none; }
.pane.is-compact .method-warn { padding-left: 0; }
.pane.is-compact .warn-wide { display: none; }
.pane.is-compact .warn-narrow { display: inline; }
/* 매매법 묶음에 든 지표의 꼬리표: × 없이 흐리게(매매법 꼬리표의 × 하나로 끔) */
.ind-tag.is-bundled { padding-right: 6px; color: var(--muted); border-color: var(--line); }
/* 권한이 없어 못 그리는 지표(이평) 안내 + 빼기 */
.ind-locked {
  flex: none; display: inline-flex; align-items: center; height: calc(20px * var(--fz)); padding-left: 6px;
  background: var(--veil); border: 1px dashed var(--muted); border-radius: var(--radius); color: var(--muted);
}
.pane.is-compact .ind-locked { display: none; }
/* 좁은 칸에서 개수를 누르면: 숨어 있던 안내(잠금·기준·봉 안내 글)가 아래로 펼쳐짐 */
.ind-count { font: inherit; cursor: pointer; }
.pane.is-compact .pane-ind.is-open { flex-wrap: wrap; white-space: normal; overflow: visible; }
.pane.is-compact .pane-ind.is-open .ind-note,
.pane.is-compact .pane-ind.is-open .ind-locked { display: inline-flex; }
.pane.is-compact .pane-ind.is-open .method-warn > span { display: inline; }
/* 상태 문구 한 줄: 꼬리표 줄 아래. 기본은 흐린 글자, 눈여겨볼 것만 주의 색 */
.pane-status {
  position: absolute; left: var(--s2); top: calc(50px * var(--fz)); right: 64px; z-index: 3;
  display: flex; flex-wrap: nowrap; gap: var(--s2); overflow: hidden; white-space: nowrap;
  pointer-events: none; font-size: var(--fs-sm); color: var(--muted);
}
.pane-status span { flex: none; padding: 0 var(--s1); background: var(--veil); border-radius: 3px; }
.pane-status .is-warn { color: var(--warn); }
.pane.is-compact .pane-status, .pane.is-low .pane-status { display: none; }
/* ── 매매법 화면(#/method) ── */
.method-page { padding: var(--s4); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s4); }
.method-page h1 { margin: 0; font-size: var(--fs-xl); }
.method-page h2 { margin: 0 0 var(--s2); font-size: var(--fs-lg); }
.method-page > p { margin: 0; color: var(--muted); }
.method-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(260px * var(--fz))), 1fr)); gap: var(--s3); }
.method-card {
  display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.method-card h3 { margin: 0; font-size: var(--fs); }
.method-card p { margin: 0; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.method-card .btn { align-self: flex-start; margin-top: auto; }
.method-card.is-soon { opacity: 0.85; border-style: dashed; }
@media (max-width: 600px) { .method-cards { grid-template-columns: 1fr; } }

/* ── 포착(오른쪽 칸의 「포착」 탭) ── */
.side-tab { display: inline-flex; align-items: center; gap: 4px; }
.side-badge {
  font-style: normal; min-width: calc(16px * var(--fz)); height: calc(16px * var(--fz)); padding: 0 4px; border-radius: calc(8px * var(--fz));
  background: var(--accent); color: var(--on-accent); font-size: var(--fs-sm); line-height: calc(16px * var(--fz)); font-weight: 700; text-align: center;
}
.scan { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scan-tools { flex: none; display: flex; flex-direction: column; gap: var(--s1); padding: var(--s2); border-bottom: 1px solid var(--line); }
.scan-tools .gap { flex: 1; }
.scan-tools .chip { padding: 0 var(--s2); }
.scan-view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.scan-msg { margin: 0; padding: var(--s4); color: var(--muted); line-height: var(--lh); word-break: keep-all; }
.scan-msg.is-lock { color: var(--text); }
.scan-sec h4 {
  position: sticky; top: 0; z-index: 1; margin: 0; padding: var(--s2) var(--s2) var(--s1);
  background: var(--bg); color: var(--muted); font-size: var(--fs-sm); font-weight: 700;
}
.scan-kind { border-bottom: 1px solid var(--line-soft); }
.scan-kind-head { display: flex; align-items: center; height: var(--row-h); }
.scan-kind-main {
  flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: var(--s1); padding: 0 2px 0 var(--s2);
  background: transparent; border: 0; color: var(--text); text-align: left;
}
.scan-kind-main:hover, .scan-item:hover { background: var(--raised); }
.scan-caret { flex: none; width: 10px; font-style: normal; color: var(--muted); transition: transform 0.12s; }
.scan-kind.is-open .scan-caret { transform: rotate(90deg); }
.scan-kind-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.scan-kind.is-dim .scan-kind-name { font-weight: 400; color: var(--muted); }
.scan-kind-count { flex: none; color: var(--muted); font-size: var(--fs-sm); }
.scan-kind-count.is-on { color: var(--accent); font-weight: 700; }
.scan-kind-ago { flex: none; margin-left: 2px; text-align: right; color: var(--muted); font-size: var(--fs-sm); }
.scan-item-ago { flex: none; min-width: calc(52px * var(--fz)); text-align: right; color: var(--muted); font-size: var(--fs-sm); }
/* 🔔·★: 꺼져 있으면 흐린 회색, 켜면 제 색(켜짐·꺼짐은 aria-pressed 와 이름표 글자로도 전함) */
.scan-ico {
  flex: none; width: calc(24px * var(--fz)); height: calc(26px * var(--fz)); padding: 0; background: transparent; border: 0; border-radius: var(--radius);
  color: var(--muted); font-size: var(--fs); filter: grayscale(1); opacity: 0.6;
}
.scan-ico:hover { opacity: 0.8; }
.scan-ico[aria-pressed="true"] { filter: none; opacity: 1; color: var(--accent); }
.scan-list { display: flex; flex-direction: column; padding-bottom: var(--s1); }
.scan-item {
  display: flex; align-items: center; gap: var(--s2); min-height: calc(28px * var(--fz)); padding: 0 var(--s2) 0 26px;
  background: transparent; border: 0; color: var(--text); text-align: left;
}
.scan-item.is-old { opacity: 0.8; } /* 14단계: 0.55 → 0.8(흐린 글자도 대비 4.5:1 이상) */
.scan-item.is-missing .scan-item-name b { color: var(--muted); text-decoration: line-through; }
.scan-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-item-name b { font-weight: 700; }
.scan-item-name small { margin-left: var(--s1); color: var(--muted); font-size: var(--fs-sm); }
.scan-none { margin: 0; padding: var(--s1) var(--s2) var(--s1) 26px; color: var(--muted); font-size: var(--fs-sm); }
.scan-more { align-self: flex-start; margin: var(--s1) 0 0 26px; }
.scan-foot { flex: none; border-top: 1px solid var(--line); }
.scan-bots {
  width: 100%; min-height: var(--ctl-h); padding: 0 var(--s2); background: transparent; border: 0;
  color: var(--muted); font-size: var(--fs-sm); text-align: left;
}
.scan-bots.is-warn, .scr-bots.is-warn { color: var(--warn); }
.scan-kind-main:focus-visible, .scan-item:focus-visible, .scan-ico:focus-visible, .scan-bots:focus-visible {
  box-shadow: none; outline: 2px solid var(--accent); outline-offset: -2px;
}

/* ── 검색기 화면 ── */
.scr-page { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.scr-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); }
.scr-head h1 { margin: 0; font-size: var(--fs-xl); }
.scr-head .gap { flex: 1; }
.scr-page > p { margin: 0; color: var(--muted); }
.scr-page h2 { margin: 0 0 var(--s2); font-size: var(--fs-lg); }
.scr-bots { color: var(--muted); font-size: var(--fs-sm); }
.scr-body { display: flex; flex-direction: column; gap: var(--s4); }
.scr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(260px * var(--fz))), 1fr)); gap: var(--s3); align-items: start; }
.scr-card {
  min-width: 0; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.scr-card.is-dim { border-style: dashed; }
.scr-card.is-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.scr-link { align-self: flex-start; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--accent); font-size: var(--fs-sm); }
.scr-card-head { display: flex; align-items: center; gap: var(--s2); }
.scr-card-head h3 { flex: 1; min-width: 0; margin: 0; font-size: var(--fs); }
.scr-card > p { margin: 0; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.scr-list { display: flex; flex-direction: column; }
.scr-list .scan-item { padding: 0 var(--s1); border-radius: var(--radius); }
.scr-more { color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 600px) { .scr-cards { grid-template-columns: 1fr; } }

/* ══════════ 첫 화면(#/) — 세로로 읽는 문서형 화면. 좁은지는 창이 아니라 이 화면이 놓인 폭으로 가름(@container) ══════════ */
.home, .data-page { container-type: inline-size; }
.home-in { max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 40px; }
.home h2, .home h3, .data-page h2, .data-page h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 시장 한눈에(카드 둘) — .hcard 는 실시간 데이터 화면도 씀 */
.hcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.hcard {
  min-width: 0; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
/* 제목 옆에 고르기 단추가 안 들어가면 단추가 아랫줄로 내려감(제목은 자르지 않음) */
.hcard-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); min-height: 26px; }
.hcard-head h2 { flex: 1 0 auto; font-size: var(--fs); font-weight: 600; color: var(--muted); white-space: nowrap; }
.hcard-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--s2); }
.hcard-foot { margin-top: auto; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.hcard-note, .hcard-err { margin: 0; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }

/* 둘 · 셋 가운데 하나 고르기 */
.seg { flex: none; display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius); }
.seg-btn { height: calc(24px * var(--fz)); padding: 0 7px; background: transparent; border: 0; border-radius: 4px; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; }
.seg-btn:focus-visible, .hmover:focus-visible, .htaste-row:focus-visible, .dnav-btn:focus-visible, .dsym:focus-visible {
  box-shadow: none; outline: 2px solid var(--accent); outline-offset: 1px;
}

/* 값을 기다리는 동안의 뼈대 */
.sk { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.sk i { display: block; height: 12px; border-radius: 4px; background: var(--raised); animation: sk-pulse 1.6s ease-in-out infinite; }
.sk i:nth-child(odd) { width: 72%; }
.sk i:first-child { height: 18px; width: 46%; }
@keyframes sk-pulse { 50% { opacity: 0.45; } }

/* 시장 한눈에: 오른 · 보합 · 내린 종목 수를 한 줄 막대로(조각 사이 2px 틈) */
.breadth { display: flex; gap: 2px; height: 8px; margin-top: 2px; }
.breadth span { min-width: 0; border-radius: 2px; }
.breadth-up { background: var(--up); }
.breadth-flat { background: var(--flat); opacity: 0.45; }
.breadth-down { background: var(--down); }
.breadth-legend { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s1); }
.hrow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 0 var(--s2); min-height: 24px; padding-top: var(--s1); border-top: 1px solid var(--line-soft); white-space: nowrap; }
.hrow-k { color: var(--muted); font-weight: 600; }
.hrow-k { margin-right: auto; }
/* 가격은 자르지 않음: 자리가 모자라면 등락률이 아랫줄로 내려감 */
.hrow b { flex: none; text-align: right; }
.hrow > span:last-child { flex: none; font-size: var(--fs-sm); font-weight: 600; }

/* 뜨는 종목 */
.hmovers { display: flex; flex-direction: column; margin: 0 calc(var(--s2) * -1); }
.hmover {
  display: flex; align-items: center; gap: var(--s2); width: 100%; height: calc(28px * var(--fz)); padding: 0 var(--s2);
  background: transparent; border: 0; border-radius: var(--radius); text-align: left; white-space: nowrap;
}
.hmover:hover { background: var(--raised); }
.hmover i { flex: none; width: 10px; color: var(--muted); font-style: normal; font-size: var(--fs-sm); }
.hmover-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; }
.hmover-name b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hmover-name small { flex: none; color: var(--muted); font-size: var(--fs-sm); }
.hmover > span:last-child { flex: none; font-size: var(--fs-sm); font-weight: 600; }

/* 선물 시장 */
.hstat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); white-space: nowrap; }
.hstat + .hstat { padding-top: var(--s2); border-top: 1px solid var(--line-soft); }
.hstat-k { flex: 1 0 100%; color: var(--muted); font-size: var(--fs-sm); }
.hstat b { font-size: var(--fs-lg); }
.hstat small { min-width: 0; color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; }

/* 공포 · 탐욕 눈금: 다섯 구간, 지금 구간만 밝게, 값 자리에 금색 표시선 */
.fng { display: flex; flex-direction: column; gap: var(--s2); }
.fng-now { display: flex; align-items: baseline; gap: var(--s2); }
.fng-value { font-size: var(--fs-xl); line-height: 1.2; }
.fng-label { font-weight: 600; }
.fng-track { position: relative; display: flex; gap: 2px; height: 8px; margin-top: 6px; }
.fng-track span { min-width: 0; border-radius: 2px; background: var(--line); }
.fng-track span.is-on { background: var(--muted); }
.fng-mark { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 1px; background: var(--accent); }
.fng-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-sm); }

/* 한 줄 소개 */
.hintro { display: flex; flex-direction: column; align-items: flex-start; }
.eyebrow { display: flex; align-items: center; gap: var(--s2); margin: 0; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.hintro h1 { margin: 12px 0; font-size: clamp(28px, 3.6vw, 42px); font-size: clamp(28px, 3.6cqi, 42px); line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; word-break: keep-all; }
/* 글자 크기 고르기: 큰 제목도 같은 배율로(앞 선언은 calc 안 clamp 를 모르는 브라우저용) */
.hintro h1 { font-size: calc(clamp(28px, 3.6vw, 42px) * var(--fz)); font-size: calc(clamp(28px, 3.6cqi, 42px) * var(--fz)); }
.hintro h1 em { font-style: normal; color: var(--accent); }
.hintro-desc { margin: 0; max-width: 30em; color: var(--muted); font-size: var(--fs-lg); word-break: keep-all; }
.hintro-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: 24px; }
.btn-xl { height: calc(44px * var(--fz)); padding: 0 20px; display: inline-flex; align-items: center; font-size: var(--fs-lg); font-weight: 700; text-decoration: none; }
.dsec-head .gap { flex: 1; }

/* 바로 해 보는 세 입구 */
.hgos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.hgo {
  min-width: 0; display: flex; flex-direction: column; gap: var(--s3); padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.hgo-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.hgo-head h2 { font-size: var(--fs-lg); word-break: keep-all; }
.hgo-tag { flex: none; padding: 1px 8px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.hgo-desc { margin: 0; color: var(--muted); word-break: keep-all; }
.hgo-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--s2); }
.hgo-foot { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; }
/* 공포지수 지금 값: 큰 숫자 + 구간 + 구간 눈금 */
.hfear-num { display: flex; align-items: baseline; gap: var(--s2); }
.hfear-value { font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hfear-zone { font-size: var(--fs-lg); font-weight: 700; }
.hfear-meter { display: flex; flex-direction: column; gap: var(--s2); }
.hfear-msg { margin: 0; }
/* 마법사가 붙이는 번호표 */
.hwiz { list-style: none; margin: 0; padding: 0; flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
.hwiz li { display: inline-flex; align-items: center; gap: 6px; height: calc(28px * var(--fz)); padding: 0 10px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); font-size: var(--fs-sm); white-space: nowrap; }
.hwiz i { color: var(--wiz-badge); font-style: normal; font-size: var(--fs-lg); line-height: 1; }
/* 검색기 · 매매법: 포착 수(누구나) · 맛보기(권한 회원) */
.hcap-box { display: flex; flex-direction: column; gap: var(--s2); }
.hcap { display: flex; flex-wrap: wrap; gap: var(--s4); }
.hcap-g { display: flex; flex-direction: column; min-width: 0; }
.hcap-g b { font-size: var(--fs-xl); line-height: 1.2; }
.hcap-g span { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.hcap-lock { margin: 0; }
.htaste-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.htaste-msg { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s3); }
.htaste-msg > .sk { align-self: stretch; }
.htaste-row {
  display: flex; align-items: center; gap: var(--s3); min-height: 36px; padding: 0 var(--s3);
  background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap;
}
.htaste-row:last-of-type { border-bottom: 0; }
.htaste-row:hover { background: var(--raised); }
.htaste-row:focus-visible { outline-offset: -2px; }
.htaste-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; }
.htaste-name b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.htaste-name small, .htaste-kind, .htaste-ago { color: var(--muted); font-size: var(--fs-sm); }
.htaste-kind { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.htaste-ago { flex: none; min-width: calc(52px * var(--fz)); text-align: right; }
.hmethods { display: flex; flex-wrap: wrap; gap: var(--s1); }
.hmethod { max-width: 100%; overflow: hidden; text-overflow: ellipsis; border-color: var(--line); color: var(--text); }

/* 무료 회원 안내 한 줄: 로그인 → 운영진 확인 → 이용 */
.hjoin { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); padding: var(--s4) 20px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.hjoin-lead { font-size: var(--fs-lg); }
.hjoin-steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; padding: 0; list-style: none; counter-reset: hstep; }
.hjoin-steps li { counter-increment: hstep; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hjoin-steps li::before { content: counter(hstep); width: calc(20px * var(--fz)); height: calc(20px * var(--fz)); display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: var(--fs-sm); font-weight: 700; }
.hjoin-steps li:not(:last-child)::after { content: "→"; margin-left: var(--s1); color: var(--muted); }
.hjoin-text { margin: 0; word-break: keep-all; }
.hjoin .btn { margin-left: auto; }
.hjoin-link { color: var(--accent); font-size: var(--fs-sm); }
.home-foot { display: flex; flex-direction: column; align-items: center; gap: var(--s1); }
.home-note { margin: 0; color: var(--muted); font-size: var(--fs-sm); text-align: center; word-break: keep-all; }
.home-links { margin: 0; display: flex; gap: var(--s3); font-size: var(--fs-sm); }
.home-links a { color: var(--muted); }

@container (max-width: 1080px) {
  /* 입구 셋을 2 + 1 로(검색기 입구가 한 줄을 다 씀) */
  .hgos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hgo[data-go="scan"] { grid-column: 1 / -1; }
}
@container (max-width: 720px) {
  .home-in { padding: 20px var(--s4) 32px; gap: 28px; }
  /* 입구 · 시장 카드는 한 줄에 하나 */
  .hgos, .hcards { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .hgo[data-go="scan"] { grid-column: auto; }
  .hgo, .hcard { padding: var(--s4); }
  .hintro-cta { width: 100%; margin-top: 20px; }
  .btn-xl { flex: 1 1 auto; justify-content: center; }
  .hjoin { padding: var(--s3) var(--s4); }
  .hjoin .btn { margin-left: 0; }
}

/* ══════════ 실시간 데이터 화면(#/data) ══════════ */
.data-in { max-width: 1200px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.data-head h1 { font-size: var(--fs-xl); }
.data-head p { margin-top: var(--s1); color: var(--muted); }
.data-cols { display: grid; grid-template-columns: calc(200px * var(--fz)) minmax(0, 1fr); gap: 24px; align-items: start; }
.dnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--s4); }
.dnav-btn {
  flex: none; height: calc(36px * var(--fz)); padding: 0 var(--s3); text-align: left; white-space: nowrap;
  background: transparent; border: 0; border-left: 2px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted); font-weight: 600;
}
.dnav-btn:hover { color: var(--text); background: var(--raised); }
.dnav-btn[aria-pressed="true"] { color: var(--text); background: var(--raised); border-left-color: var(--accent); }
.dnav-more { padding: var(--s3); color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.dsec {
  min-width: 0; min-height: 420px; display: flex; flex-direction: column; gap: var(--s2); padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.dsec-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); min-height: 28px; }
.dsec-head h2 { font-size: var(--fs-lg); }
.dsec-desc { color: var(--muted); word-break: keep-all; }
.dsec-status { min-height: 18px; color: var(--muted); font-size: var(--fs-sm); }
.dsec-note { margin: 0; padding: 24px 0; color: var(--muted); }
.dsec-body { min-width: 0; overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { padding: 6px var(--s2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-align: left; white-space: nowrap; }
.dtable td { height: calc(34px * var(--fz)); padding: 0 var(--s2); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.dtable tbody tr:hover td { background: var(--raised); }
.dtable .dcol-num { text-align: right; }
.dtable .dcol-n { width: calc(36px * var(--fz)); color: var(--muted); }
.dtable .dcol-time { width: calc(84px * var(--fz)); color: var(--muted); }
.dtable .dcol-side { font-weight: 600; }
.dtable .is-big { font-weight: 700; }
.dsym { max-width: 100%; display: inline-flex; align-items: baseline; gap: 6px; padding: var(--s1) 0; background: transparent; border: 0; text-align: left; }
.dsym b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.dsym small { color: var(--muted); font-size: var(--fs-sm); }
.dsym:hover b { text-decoration: underline; }
/* 지금 차트가 없는 종목: 흐리게, 눌리지 않음 */
.dsym.is-off { cursor: default; opacity: 0.8; }
.dsym.is-off:hover b { text-decoration: none; }
.dsec-tools { display: flex; align-items: center; gap: var(--s2); }
.dsec-again:disabled { cursor: default; opacity: 0.5; }
.dsec-again:disabled:hover { border-color: var(--line); }
.dbig-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.dbig { font-size: var(--fs-xl); }
.dbig-row > span { font-weight: 600; }
.dbig-row .btn { margin-left: auto; align-self: center; }
.dmini { position: relative; height: 280px; margin: var(--s3) 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dmini-chart { position: absolute; inset: 0; }
.ddom .dsec-note { padding: var(--s3) 0; }
.dfng { max-width: 560px; display: flex; flex-direction: column; gap: 20px; padding-top: var(--s2); }
.dfng-hist h3 { margin-bottom: var(--s2); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.dfng-hist .dsec-note { display: block; padding: var(--s2) 0 0; font-size: var(--fs-sm); }
.fng-bars { display: flex; align-items: flex-end; gap: 2px; height: 96px; border-bottom: 1px solid var(--line); }
.fng-bars span { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: var(--muted); opacity: 0.45; }
.fng-bars span:hover, .fng-bars span.is-now { opacity: 1; }
.fng-bars span.is-now { background: var(--accent); }

@container (max-width: 720px) {
  .data-in { padding: var(--s4); gap: var(--s3); }
  .data-cols { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  /* 항목 목록은 위쪽 한 줄로(넘치면 옆으로 밀어 봄) */
  .dnav { position: static; flex-direction: row; align-items: center; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding: 2px; }
  .dnav::-webkit-scrollbar { display: none; }
  .dnav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 20px; }
  .dnav-btn { padding: 0 10px; border-left: 0; border-bottom: 2px solid transparent; border-radius: var(--radius) var(--radius) 0 0; }
  .dnav-btn[aria-pressed="true"] { border-bottom-color: var(--accent); }
  .dnav-btn:focus-visible { outline-offset: -2px; }
  .dnav-more { flex: none; padding: 0 var(--s2); }
  .dsec { padding: var(--s3); min-height: 320px; }
  .dtable .dcol-opt { display: none; }
  .dmini { height: 200px; }
}

/* ── 좁은 화면의 위 메뉴 · 항목 줄: 옆으로 밀어 봄. 더 있다는 표시로 오른쪽 끝이 살짝 흐려짐 ── */
@media (max-width: 640px) {
  .nav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 20px; }
  .top { gap: var(--s2); padding: 0 var(--s2); }
  .logo .logo-wide { display: none; }
  .logo .logo-mark { display: block; }
}

/* ── @container 를 모르는 브라우저용 대체: 위의 좁은 화면 규칙을 창 폭 기준으로 한 벌 더(내용은 위와 같게 유지) ── */
@supports not (container-type: inline-size) {
  @media (max-width: 1080px) {
    /* 입구 셋을 2 + 1 로(검색기 입구가 한 줄을 다 씀) */
    .hgos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hgo[data-go="scan"] { grid-column: 1 / -1; }
  }
  @media (max-width: 720px) {
    .home-in { padding: 20px var(--s4) 32px; gap: 28px; }
    /* 입구 · 시장 카드는 한 줄에 하나 */
    .hgos, .hcards { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
    .hgo[data-go="scan"] { grid-column: auto; }
    .hgo, .hcard { padding: var(--s4); }
    .hintro-cta { width: 100%; margin-top: 20px; }
    .btn-xl { flex: 1 1 auto; justify-content: center; }
    .hjoin { padding: var(--s3) var(--s4); }
    .hjoin .btn { margin-left: 0; }
  }
  @media (max-width: 720px) {
    .data-in { padding: var(--s4); gap: var(--s3); }
    .data-cols { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
    /* 항목 목록은 위쪽 한 줄로(넘치면 옆으로 밀어 봄) */
    .dnav { position: static; flex-direction: row; align-items: center; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding: 2px; }
    .dnav::-webkit-scrollbar { display: none; }
    .dnav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 20px; }
    .dnav-btn { padding: 0 10px; border-left: 0; border-bottom: 2px solid transparent; border-radius: var(--radius) var(--radius) 0 0; }
    .dnav-btn[aria-pressed="true"] { border-bottom-color: var(--accent); }
    .dnav-btn:focus-visible { outline-offset: -2px; }
    .dnav-more { flex: none; padding: 0 var(--s2); }
    .dsec { padding: var(--s3); min-height: 320px; }
    .dtable .dcol-opt { display: none; }
    .dmini { height: 200px; }
  }
}

/* ══════════ 5단계: 내용 자리 — 매매법 설명 틀 · 비밀 병기 종목 · 일기장 · 지원 ══════════ */
/* 매매법 카드의 단추 줄과, [자세히]를 누르면 그 줄 아래 전체 폭으로 펼쳐지는 설명 틀 */
/* 펼친 설명 틀은 문서에서도 그 줄의 마지막 카드 뒤에 놓임(method-page.js 의 placePanel) — 보이는 순서 = 키보드 순서 */
.method-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; }
.method-card .method-actions .btn { margin-top: 0; }
.method-more[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.method-guide {
  grid-column: 1 / -1; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3);
  background: var(--raised); border: 1px solid var(--accent); border-radius: var(--radius);
}
.method-guide h3 { margin: 0; font-size: var(--fs); }
.method-guide h4 { margin: var(--s1) 0 0; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.guide-facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--s3); }
.guide-facts dt { color: var(--muted); font-size: var(--fs-sm); }
.guide-facts dd { margin: 0; word-break: keep-all; }
.guide-read { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.guide-read li { display: inline-flex; align-items: center; gap: 6px; min-height: 20px; font-size: var(--fs-sm); }
.guide-read li.has-means { flex-basis: 100%; }
.guide-read small { color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.guide-read small::before { content: '= '; }
/* 기호 견본: 색은 받은 지표 설정의 것(글자색으로 넣어 둠) */
.guide-sw { flex: none; display: inline-block; width: 18px; height: 0; color: var(--muted); border-top: 2px solid currentColor; font-style: normal; }
.guide-sw.is-dots { border-top-style: dotted; border-top-width: 3px; }
.guide-sw.is-step { height: 6px; width: 9px; margin-right: 9px; border-right: 2px solid currentColor; position: relative; }
.guide-sw.is-step::after { content: ''; position: absolute; left: 9px; bottom: 0; width: 9px; border-top: 2px solid currentColor; }
.guide-sw.is-level { border-top-width: 1px; }
.guide-sw.is-level.is-dashed { border-top-style: dashed; }
.guide-sw.is-level.is-dotted { border-top-style: dotted; }
.guide-sw.is-dot { width: 8px; height: 8px; margin: 0 5px; border: 0; border-radius: 50%; background: currentColor; }
.guide-sw.is-label { width: auto; height: auto; padding: 0 4px; border: 1px solid currentColor; border-radius: 3px; font-size: var(--fs-sm); line-height: 1.25; }
.guide-sw.is-fill { height: 10px; border: 0; display: inline-flex; }
.guide-sw.is-fill b { flex: 1; }
.guide-sw.is-ma { height: 8px; border-top: 2px solid var(--muted); border-bottom: 2px solid var(--muted); }
.guide-sw.is-lock, .guide-sw.is-note { display: none; }
.guide-list { margin: 0; padding-left: var(--s4); display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); word-break: keep-all; }
.guide-list.is-caution li::marker { color: var(--warn); }
.guide-pending { margin: 0; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s1); }
/* 검색기 화면: 매매법 화면에서 넘어온 종류의 카드 */

/* 비밀 병기 종목 */
.pick-card {
  display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.pick-card p { margin: 0; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.pick-card h3 { margin: 0; font-size: var(--fs); display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.pick-card .pick-why.is-soon { font-style: normal; opacity: 0.8; }
.pick-note { color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }

/* 일기장(차트 오른쪽 칸) */
.diary { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2); }
.diary-list { display: flex; flex-direction: column; gap: var(--s2); }
.diary-msg { margin: 0; padding: var(--s3) var(--s2); color: var(--muted); word-break: keep-all; }
.diary-card {
  display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3); min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.diary-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); color: var(--muted); font-size: var(--fs-sm); }
.diary-card h3 { margin: 0; font-size: var(--fs); overflow-wrap: anywhere; }
.diary-text {
  margin: 0; line-height: var(--lh); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.diary-text.is-open { display: block; overflow: visible; }
.diary-note { color: var(--muted); font-size: var(--fs-sm); }
.diary-toggle { align-self: flex-start; padding: 0; background: none; border: 0; color: var(--accent); font-size: var(--fs-sm); cursor: pointer; }
.diary-toggle:hover { text-decoration: underline; }
.diary-symbols { display: flex; flex-wrap: wrap; gap: var(--s1); }
.diary-symbol.is-off { opacity: 0.5; cursor: default; }
.diary-more-list { align-self: center; }
.diary-foot { color: var(--muted); font-size: var(--fs-sm); text-align: center; }

/* 경제 이벤트(차트 오른쪽 칸) — 글자 크기는 --fs · --fs-sm(「가」 단추를 따름) */
.econ { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2); }
.econ-bar { display: flex; gap: var(--s1); }
.econ-bar .chip { padding: 0 var(--s2); }
.econ-list { display: flex; flex-direction: column; gap: var(--s2); }
.econ-msg { margin: 0; padding: var(--s3) var(--s2); color: var(--muted); word-break: keep-all; }
.econ-card {
  display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3); min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.econ-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s1) var(--s2); }
.econ-head h3 { margin: 0; font-size: var(--fs); overflow-wrap: anywhere; word-break: keep-all; }
.econ-tag { padding: 0 6px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: var(--fs-sm); }
.econ-tag.is-core { border-color: var(--accent); color: var(--accent); }
.econ-when { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); }
.econ-until { color: var(--accent); }
.econ-for { color: var(--muted); font-size: var(--fs-sm); }
.econ-last { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s2); font-size: var(--fs-sm); }
.econ-last dt { color: var(--muted); }
.econ-last dd { margin: 0; font-variant-numeric: tabular-nums; }
.econ-toggle { align-self: flex-start; padding: 0; background: none; border: 0; color: var(--accent); font-size: var(--fs-sm); cursor: pointer; }
.econ-toggle:hover { text-decoration: underline; }
.econ-react { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.econ-react table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.econ-react caption { text-align: left; color: var(--muted); padding-bottom: 2px; }
.econ-react th, .econ-react td { padding: 2px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.econ-react th:first-child { text-align: left; }
.econ-react thead th { color: var(--muted); font-weight: 400; }
.econ-sum td { white-space: normal; }
.econ-sum td span { display: block; }
.econ-rows .is-up { color: var(--up); }
.econ-rows .is-down { color: var(--down-text); }
.econ-rows .is-none { color: var(--muted); }
.econ-note { color: var(--muted); font-size: var(--fs-sm); }
.econ-more { align-self: center; }
.econ-foot { display: flex; flex-direction: column; gap: 2px; padding-top: var(--s1); }
.econ-advice { color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.econ-src { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* 지원 화면(#/help) */
.help-page { max-width: 720px; width: 100%; margin: 0 auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.help-page h1 { margin: 0; font-size: var(--fs-xl); }
.help-page h2 { margin: 0 0 var(--s2); font-size: var(--fs-lg); }
.help-intro { margin: 0; color: var(--muted); }
.help-list { display: flex; flex-direction: column; gap: var(--s1); }
.help-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.help-item h3 { margin: 0; font-size: var(--fs); }
.help-q {
  width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) var(--s3); background: none; border: 0; border-radius: var(--radius); color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; word-break: keep-all;
}
.help-q:hover { background: var(--raised); }
.help-caret { flex: none; font-style: normal; color: var(--muted); }
.help-q[aria-expanded="true"] .help-caret { transform: rotate(180deg); }
.help-a { padding: 0 var(--s3) var(--s3); }
.help-a p { margin: 0; color: var(--muted); line-height: var(--lh); word-break: keep-all; }
.help-contact p { margin: 0; }
.help-contact p.is-soon { color: var(--muted); }

/* 자바스크립트가 꺼져 있을 때의 안내(스타일을 속성으로 적지 않음 — CSP 의 style-src 에 unsafe-inline 이 없음) */
.noscript { padding: 16px; }

/* [지표] 판: 서버가 계산해 주는 지표의 안내 한 줄 */
.ind-remote-note { color: var(--muted); font-size: var(--fs-sm); line-height: var(--lh); word-break: keep-all; }

/* [지표] 판: 줄 아래 작은 안내(선은 구매자에게만 등) */
.ind-row-text { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.ind-row-text small { color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.ind-row:has(.ind-row-text) { min-height: calc(var(--row-h) + 14px); }

/* 선별 값 줄(이평 선을 받는 사람): 상태 문구 아래. 색 점 + 번호 이름 + 값, 길면 줄바꿈. 접으면 [값] 단추만 */
.pane-values {
  position: absolute; left: var(--s2); top: calc(68px * var(--fz)); right: 64px; z-index: 5;
  display: flex; gap: var(--s1); align-items: flex-start; pointer-events: none; font-size: var(--fs-sm); color: var(--muted);
}
.pane-values-btn {
  pointer-events: auto; flex: none; font: inherit; color: var(--muted); cursor: pointer;
  padding: 0 var(--s1); background: var(--veil); border: 1px solid var(--line); border-radius: 3px;
}
.pane-values-btn[aria-expanded="true"] { color: var(--text); }
.pane-values-list { display: none; flex-wrap: wrap; gap: 0 var(--s2); min-width: 0; }
.pane-values.is-open .pane-values-list { display: flex; }
.pane-value { display: inline-flex; align-items: center; gap: 3px; padding: 0 var(--s1); background: var(--veil); border-radius: 3px; white-space: nowrap; }
.pane-value-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pane-value-num { color: var(--text); font-variant-numeric: tabular-nums; }
/* 이평: 굵은 선(더 중요한 선)의 값은 굵은 글자, 나머지는 흐리게 — 값은 그대로 보임 */
.pane-value.is-strong .pane-value-name, .pane-value.is-strong .pane-value-num { font-weight: 700; color: var(--text); }
.pane-value.is-strong .pane-value-dot { width: 9px; height: 9px; }
.pane-value.is-weak { opacity: 0.75; }
.pane.is-compact .pane-values, .pane.is-low .pane-values { top: calc(46px * var(--fz)); }
/* 값 자리가 낱말(구간 이름)인 아래 칸 이름표: 숫자 값과 달리 좁은 칸에서도 보이고, 구간 색으로 또렷하게 */
.sub-value.is-word { font-weight: 700; }
.pane.is-compact .sub-value.is-word { display: inline; }

/* 캔들 출처 표시(주식 종목): 제목 옆 작은 꼬리표. 좁은 칸은 짧은 말만 */
.pane-src { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 0 var(--s1); background: var(--veil); border: 1px solid var(--line); border-radius: 3px; color: var(--muted); pointer-events: auto; }
.pane-src.is-warn { color: var(--warn); }
.pane-src .src-narrow { display: none; }
.pane.is-compact .pane-src .src-wide { display: none; }
.pane.is-compact .pane-src .src-narrow { display: inline; }
.pane.is-tiny .pane-src { display: none; }

/* 실시간 데이터: 묶음 제목 · 준비 중 항목 · 서버에서 받는 항목(지금 값 칸 + 큰 그림 + 설명) */
.dnav-group { margin: var(--s3) 0 var(--s1); padding: 0 var(--s3); color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.dnav-group:first-child { margin-top: 0; }
.dnav-soon { display: flex; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3); color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.dpulse { display: flex; flex-direction: column; gap: var(--s3); max-width: 960px; }
.dpulse h3 { margin-top: var(--s2); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.dpulse-tiles { display: flex; flex-wrap: wrap; gap: var(--s3); }
.dpulse-tile { min-width: calc(140px * var(--fz)); padding: var(--s3); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 2px; }
.dpulse-tile small { color: var(--muted); }
.dpulse-tile b { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.dpulse-chart { height: 320px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.dpulse-legend { display: flex; flex-wrap: wrap; gap: var(--s3); color: var(--muted); font-size: var(--fs-sm); }
.dpulse-legend span { display: inline-flex; align-items: center; gap: var(--s1); }
.dpulse-legend i { width: 10px; height: 3px; border-radius: 2px; }
.dpulse-text { margin: 0; padding-left: 18px; word-break: keep-all; }
@media (max-width: 860px) { .dnav-group { display: none; } .dnav-soon { display: none; } }

.dpulse-range { color: var(--muted); font-size: var(--fs-sm); }
.dpulse-table { min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.dmonth { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.dmonth th, .dmonth td { padding: 6px var(--s2); border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.dmonth th { color: var(--muted); font-weight: 600; }
.dmonth tbody tr:last-child th, .dmonth tbody tr:last-child td { border-bottom: 0; }
.dmonth .is-now { font-weight: 700; }

/* ── 휴대폰 · 좁은 화면(7-가): 손가락으로 누르는 것은 크게, 차트 분할은 1 · 2칸까지 ── */
/* 넓은 화면의 모습은 그대로 — 아래는 창 폭 860px 이하에서만 */
@media (max-width: 860px) {
  /* 단추 · 줄 높이를 토큰으로 한꺼번에(28 → 38, 32 → 40) */
  :root { --ctl-h: 38px; --row-h: 40px; }
  /* 글자 크기 고르기(크게 · 아주 크게): 손가락 크기에서 조금 더(tokens.css 의 넓은 화면 값보다 우선) */
  :root[data-fs="lg"] { --ctl-h: 42px; --row-h: 44px; }
  :root[data-fs="xl"] { --ctl-h: 46px; --row-h: 48px; }
  .seg-btn { height: 34px; padding: 0 var(--s3); height: max(34px, calc(30px * var(--fz))); }
  .hmover { height: 38px; height: max(38px, calc(34px * var(--fz))); }
  .dsym { min-height: 38px; align-items: center; }
  .dnav-btn { height: 40px; height: max(40px, calc(36px * var(--fz))); }
  .ind-tag-x, .method-x { min-width: 28px; min-height: 28px; }
  .pane-values-btn { min-height: 28px; padding: 0 var(--s2); }
  .shape-btn { padding: var(--s2); }
  .dpulse-tile { flex: 1 1 40%; min-width: 0; }
}
@media (max-width: 600px) {
  /* 좁은 화면에서는 한 칸이 너무 작아져 차트를 읽을 수 없음 → 분할은 1 · 2칸 모양만 고르게 함(이미 여러 칸인 배치는 그대로 보임) */
  .shape-btn[data-shape^="3"], .shape-btn[data-shape^="4"], .shape-btn[data-shape^="5"], .shape-btn[data-shape^="6"],
  .shape-btn[data-shape^="8"], .shape-btn[data-shape^="9"], .shape-btn[data-shape^="1"]:not([data-shape="1"]) { display: none; }
}
.dpulse-tile small { font-size: var(--fs-sm); }
@media (max-width: 600px) {
  /* 단추 줄이 옆으로 밀려 있어도 판은 화면 안에: 왼쪽 · 오른쪽 여백만 두고 폭을 다 씀(코드가 넣는 left 값보다 우선) */
  .ind-panel, .split-panel, .method-panel { left: var(--s2) !important; right: var(--s2); width: auto; max-width: none !important; }
}

/* ══════════ 8차 점검 고침 ══════════ */
/* 도구 줄: 옆으로 잘리지 않고 다음 줄로 접힘. [화면 분할] 은 늘 첫 줄 오른쪽 끝(.bar-main 밖) */
.bar.tools { align-items: flex-start; overflow: visible; gap: var(--s2); }
.bar-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); }
.bar-main .bar-group { flex: 0 1 auto; flex-wrap: wrap; }
.bar-main .sep { margin: 0 var(--s1); }
.bar-main .now-tag { max-width: 100%; margin-right: 0; overflow: hidden; }
.bar-main .now-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar-main .draw-box { flex: 0 1 auto; flex-wrap: wrap; }
.bar-main .draw-group { flex-wrap: wrap; }
@media (max-width: 600px) {
  /* 휴대폰: 첫 줄 = 봉 단추, 둘째 줄 = 매매법 · 지표 · 그리기 + [화면 분할](오른쪽 끝). [그리기] 를 펴면 도구가 그 아래 줄로 */
  .bar.tools { flex-wrap: wrap; align-items: center; padding: var(--s1) var(--s2); gap: var(--s1); }
  .bar-main { display: contents; }
  .bar-main .bar-group { flex: 1 0 100%; }
  .bar-main .chip { padding: 0 var(--s2); }
  .bar-main .sep { display: none; }
  .bar.tools > .split-btn { order: 1; margin-left: auto; }
  .bar-main .draw-box.is-open { order: 2; flex: 1 0 100%; }
}

/* 주의 띠: 화면을 밀지 않고 겹쳐 띄움(뜨고 사라질 때 아래 내용이 움직이지 않음). 눌리지 않음(아래 것이 그대로 눌림) */
.banner {
  position: fixed; top: calc(50px * var(--fz)); right: var(--s2); z-index: 40; max-width: calc(100vw - 2 * var(--s2));
  padding: 3px var(--s3); border: 1px solid var(--warn); border-radius: var(--radius);
  background: var(--raised); box-shadow: var(--shadow); pointer-events: none; text-align: left;
}
@media (max-width: 860px) {
  /* 좁은 화면: 위쪽은 종목 정보 줄이 차지하므로 아래(시세 띠 자리)에 띄움 */
  .banner { top: auto; bottom: 34px; left: var(--s2); right: var(--s2); text-align: center; }
}

/* 잠금 안내 + [로그인] 한 묶음(매매법 · 검색기 화면) */
.gate-box { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.method-body { display: flex; flex-direction: column; gap: var(--s4); }

/* 없는 화면 */
.soon .btn-lg { margin-top: var(--s2); }

/* 종목 찾기: 다른 묶음에 있을 때의 안내 단추 */
.symlist-hint {
  flex: none; margin: var(--s2); padding: var(--s1) var(--s2); text-align: left;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); color: var(--text);
}
.symlist-hint:hover { border-color: var(--text); }
.symlist-empty .symlist-hint { margin: 0; }

/* 칸 왼쪽 위 글자는 가격 눈금 위로 넘어가지 않음(눈금 폭은 chart-pane.js 가 재서 --axis-w 로 넣음). 아주 좁은 칸은 이름이 먼저 */
.pane-legend, .pane-ind, .pane-status, .pane-values,
.pane.is-compact .pane-legend, .pane.is-compact .pane-ind { right: calc(var(--axis-w, 60px) + var(--s1)); }
.pane.is-tiny .pane-legend { right: var(--s2); }
.pane.is-tiny .pane-title { background: var(--panel); }

/* 선별 값 줄: 접힌 상태 = 한 줄(넘치는 값은 잘림 — [값] 을 누르면 전부 펼쳐짐), 펼친 상태 = 줄바꿈해 전부 */
.pane-values-list { display: flex; flex-wrap: nowrap; overflow: hidden; }
.pane-values:not(.is-open) .pane-values-list { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
.pane-values.is-open .pane-values-list { flex-wrap: wrap; overflow: visible; }
.pane-value { flex: none; }
.pane-values-btn::after { content: " ▸"; }
.pane-values-btn[aria-expanded="true"]::after { content: " ▾"; }

/* 매매법 [자세히]: 누른 카드 바로 옆(같은 줄 오른쪽 두 칸 — 자리가 없으면 바로 아랫줄)에 펼쳐짐. 좁은 화면은 카드 바로 아래 한 줄 */
.method-cards.has-guide { align-items: start; }
@media (min-width: 620px) { .method-guide { grid-column: span 2; } }

/* 맨 아래 고정 글: 좁은 화면에서는 한 줄(넘치면 옆으로 밀어 봄 — 글은 그대로) */
@media (max-width: 860px) {
  .foot { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .foot::-webkit-scrollbar { display: none; }
  .foot > span { flex: none; }
}
/* 아주 좁은 화면의 위 메뉴: 로고 + [로그인] 한 줄, 메뉴 한 줄(단추가 메뉴 끝을 가리지 않음) */
@media (max-width: 480px) {
  .top { flex-wrap: wrap; height: auto; padding: var(--s1) var(--s2); gap: var(--s1) var(--s2); }
  .top .nav { order: 3; flex: 1 0 100%; padding-right: 0; -webkit-mask-image: none; mask-image: none; justify-content: space-between; }
  .top #login-btn { margin-left: auto; }
  /* 언어 고르기(지구 단추)가 있으면 그것이 로고 줄 오른쪽 끝으로 가고 [로그인]은 바로 옆에 붙음(메뉴 줄을 가리지 않음) */
  .top .lang-pick { margin-left: auto; }
  .top .lang-pick + #login-btn { margin-left: 0; }
  /* 「가」 단추(글자 크기)는 지구 단추 바로 왼쪽 — 둘이 붙어 로고 줄 오른쪽 끝으로 */
  .top .font-pick { margin-left: auto; }
  .top .font-pick + .lang-pick, .top .font-pick + #login-btn { margin-left: 0; }
  /* 「가」 판은 머리줄 전체를 기준으로 오른쪽에 붙여 화면 밖으로 나가지 않게(.top 이 기준 — 판 규칙은 맨 아래 「14단계」 묶음) */
  .top .font-pick { position: static; }
  .top .font-list { right: var(--s2); max-width: calc(100vw - 2 * var(--s2)); }
  .btn-lang-code { display: none; }
  .banner { bottom: 34px; }
}

/* ── 그리기 도구(도구 줄의 한 묶음). 좁은 화면에서는 [그리기] 단추 하나로 접힘 ── */
.draw-box { flex: none; display: flex; align-items: center; gap: 2px; }
.draw-fold { display: none; }
.draw-fold.is-on { color: var(--text); border-color: var(--accent); }
.pane-chart.is-drawing { cursor: crosshair; touch-action: none; }
@media (max-width: 860px) {
  .draw-fold { display: inline-flex; align-items: center; }
  .draw-box:not(.is-open) .draw-group { display: none; }
}

/* ── 8-마 · 8-바: 검색기의 맨 위 자리 · 종목별 지수 화면 · 글 화면 · 내 정보 판 · 로그인 화면 ── */
.scr-feature { border: 1px solid var(--accent); border-radius: var(--radius); padding: var(--s3); background: var(--accent-soft); display: flex; flex-direction: column; gap: var(--s2); }
.scr-feature h2 { margin: 0; color: var(--accent); }
.scr-feature-note { margin: 0; color: var(--text); line-height: var(--lh); word-break: keep-all; }
.scr-feature .scr-cards { grid-template-columns: minmax(0, 520px); }

.fear-page { max-width: 960px; width: 100%; margin: 0 auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.fear-page h1 { margin: 0; font-size: var(--fs-xl); }
.fear-page h2 { margin: 0 0 var(--s2); font-size: var(--fs-lg); }
.fear-page h3 { margin: var(--s3) 0 var(--s1); font-size: var(--fs); }
.fear-lead { margin: 0; color: var(--muted); line-height: var(--lh); word-break: keep-all; }
.fear-view { display: flex; flex-direction: column; gap: var(--s3); }
.fear-tool { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s2) var(--s3); }
.fear-pick { position: relative; flex: 1 1 220px; max-width: calc(320px * var(--fz)); }
.fear-search { width: 100%; height: calc(32px * var(--fz)); padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); font: inherit; }
.fear-search:focus-visible { outline: none; box-shadow: var(--focus); }
.fear-results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(36px * var(--fz)); display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.fear-hit { display: flex; align-items: baseline; gap: var(--s2); padding: var(--s2) var(--s3); border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fear-hit:hover, .fear-hit:focus-visible { background: var(--panel); }
.fear-hit small { color: var(--muted); font-size: var(--fs-sm); }
.fear-nohit { margin: 0; padding: var(--s2) var(--s3); color: var(--muted); }
.fear-quick, .fear-iv { display: flex; flex-wrap: wrap; gap: var(--s1); }
.fear-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.fear-who { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.fear-name { font-size: var(--fs-lg); }
.fear-sub, .fear-asof { color: var(--muted); font-size: var(--fs-sm); }
.fear-num { display: flex; align-items: baseline; gap: var(--s2); }
.fear-value { font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fear-zone { font-size: var(--fs-lg); font-weight: 700; }
.fear-note { margin: 0; color: var(--muted); }
.fear-basket-note, .fear-iv-note { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.fear-chart { height: 320px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.fear-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-sm); }
.fear-legend li { display: inline-flex; align-items: center; gap: var(--s1); }
.fear-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.fear-read { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3); }
.fear-read summary { cursor: pointer; font-weight: 600; }
.fear-read p { margin: var(--s2) 0 0; word-break: keep-all; }
.fear-read-zones { margin: var(--s2) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s1); font-size: var(--fs-sm); }
.fear-read-zones li { display: grid; grid-template-columns: 10px 5em minmax(0, 1fr); align-items: baseline; gap: var(--s2); }
.fear-read-zones i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.fear-read-zones span { word-break: keep-all; }
.fear-read-zones span, .fear-read-note { color: var(--muted); }
.fear-read-note { font-size: var(--fs-sm); }
.fear-scan { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.fear-scan a, .hfear-scan { text-decoration: none; }
.fear-scan p { margin: 0; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.fear-guide { border-top: 1px solid var(--line); padding-top: var(--s4); }
.fear-guide p { margin: 0; }
.fear-guide p.is-soon { color: var(--muted); }
@media (max-width: 600px) { .fear-pick { max-width: none; flex-basis: 100%; } .fear-value { font-size: 1.5rem; } }

.doc-body { display: flex; flex-direction: column; gap: var(--s2); }
.doc-body p { margin: 0; line-height: 1.6; word-break: keep-all; }
.doc-body p.is-soon { color: var(--muted); }
.doc-body p.doc-item { padding-left: 1em; text-indent: -1em; overflow-wrap: anywhere; }
.doc-body h2 { margin: var(--s3) 0 0; }
/* 약관 · 개인정보 번역본의 맨 위 한 줄("번역본 · 한국어 원문이 우선") + [한국어 원문 보기] — js/ui/doc-page.js */
.doc-translated { margin: 0 0 var(--s3); padding: var(--s2) var(--s3); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }
.doc-translated a { color: var(--accent); white-space: nowrap; }
/* 일본어는 띄어쓰기가 없어 keep-all 이면 쉼표에서만 줄이 바뀜 — 글 화면은 글자 단위로(금칙 처리는 strict) */
.doc-body:lang(ja) p, .doc-translated:lang(ja) { word-break: normal; line-break: strict; }
.doc-back { margin: 0; }
.doc-back a, .help-doc-list a, .acct-link, .login-page a { color: var(--accent); }
.help-doc-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }

.top { position: relative; }
#login-btn.is-member { max-width: calc(140px * var(--fz)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { position: absolute; z-index: 30; right: var(--s3); top: calc(100% + var(--s1)); min-width: calc(200px * var(--fz)); max-width: calc(100vw - 2 * var(--s3)); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s3); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.acct-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-line { margin: 0; color: var(--muted); }

.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-page { width: 100%; max-width: 420px; margin: 0 auto; padding: var(--s4); display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; }
.login-page h1 { margin: var(--s2) 0 0; font-size: var(--fs-xl); }
.login-page p { margin: 0; color: var(--muted); line-height: var(--lh); word-break: keep-all; }
.login-lead { color: var(--text); }
.login-slot { min-height: 48px; display: flex; align-items: center; justify-content: center; }
.login-agree { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--fs-sm); }
/* 카카오 로그인 단추: 카카오 디자인 가이드(바탕 · 말풍선 · 글자 색, 모서리 12px, 말풍선 + "카카오 로그인") — 그림은 받지 않고 화면 안의 말풍선 모양(svg)으로 */
.login-page a.kakao-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-width: 220px; height: 44px; padding: 0 var(--s4); border-radius: 12px; background: var(--kakao-bg); color: var(--kakao-label); font-size: 15px; font-weight: 600; text-decoration: none; }
.login-page a.kakao-btn[hidden] { display: none; }
.login-page a.kakao-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kakao-btn svg { width: 18px; height: 18px; flex: none; fill: var(--kakao-symbol); }
.fear-meter { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.fear-meter-track { position: relative; height: 8px; border-radius: 4px; background: var(--line); }
.fear-meter-dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--panel); transform: translate(-50%, -50%); }
.fear-meter-cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s1); color: var(--muted); font-size: var(--fs-sm); text-align: center; word-break: keep-all; }
.fear-meter-cell.is-on { font-weight: 700; }
.fear-login-hint { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); color: var(--muted); }

/* ── 차트 마법사(도구 줄의 [마법사 ▾] · 「차트 읽기」 목록 · 칸 위 알약). 선 색은 tokens.css 의 --wiz-* ── */
.wiz-box { flex: none; position: relative; display: flex; align-items: center; gap: 2px; }
.wiz-btn.is-on { color: var(--text); border-color: var(--wiz-level); }
.wiz-more { padding: 0 6px; }
.wiz-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; max-width: calc(100vw - 2 * var(--s2));
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: var(--s1);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.wiz-menu .chip { text-align: left; }
.wiz-menu .chip[aria-pressed="true"] { color: var(--text); border-color: var(--wiz-level); }
.wiz-panel {
  flex: none; width: calc(260px * var(--fz)); min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2) var(--s3);
  background: var(--panel); border-left: 1px solid var(--line); font-size: var(--fs-sm);
}
.wiz-head { display: flex; align-items: center; gap: 2px; }
.wiz-head .chip { padding: 0 var(--s2); }
.wiz-title { flex: 1; margin: 0; font-size: var(--fs); }
.wiz-basis, .wiz-status, .wiz-notes p { margin: 0; color: var(--muted); line-height: var(--lh); word-break: keep-all; overflow-wrap: anywhere; }
.wiz-status { color: var(--warn); }
.wiz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wiz-row {
  width: 100%; display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 6px; align-items: baseline;
  padding: var(--s1); text-align: left; background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text); font: inherit; cursor: pointer;
}
.wiz-row:hover, .wiz-row.is-hl { border-color: var(--wiz-level); background: var(--raised); }
.wiz-num { color: var(--wiz-badge); }
.wiz-tag { color: var(--muted); white-space: nowrap; }
.wiz-text { min-width: 0; line-height: var(--lh); word-break: keep-all; overflow-wrap: anywhere; }
.wiz-side { margin: 0; padding-left: var(--s4); line-height: var(--lh); }
.wiz-notes { display: flex; flex-direction: column; gap: 2px; padding-top: var(--s2); border-top: 1px solid var(--line); }
.wiz-words-btn { align-self: flex-start; padding: 0; background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.wiz-words { margin: 0; }
.wiz-words dt { margin-top: var(--s1); font-weight: 600; }
.wiz-words dd { margin: 0; color: var(--muted); line-height: var(--lh); word-break: keep-all; }
@media (max-width: 860px) {
  .wiz-panel { width: 100%; max-height: 30vh; border-left: 0; border-top: 1px solid var(--line); }
  .work:has(> .wiz-panel:not([hidden])) .side:not(.is-folded) { height: 30%; }
}
/* 휴대폰: 마법사를 켠 동안은 차트 + 「차트 읽기」만(오른쪽 칸은 접어 둠 — 끄면 돌아옴). 차트가 납작해지지 않게 */
@media (max-width: 600px) {
  .wiz-panel { max-height: 28vh; }
  .work:has(> .wiz-panel:not([hidden])) .side { display: none; }
}
.wiz-pill {
  position: absolute; left: var(--s2); bottom: calc(36px * var(--fz)); z-index: 4; height: calc(24px * var(--fz)); padding: 0 var(--s2);
  background: var(--wiz-badge); color: var(--wiz-badge-text); border: 0; border-radius: 12px;
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
}
.wiz-corner {
  position: absolute; left: var(--s2); bottom: calc(36px * var(--fz)); z-index: 4; padding: 1px 6px; pointer-events: none;
  background: var(--veil); color: var(--text); border: 1px solid var(--wiz-level); border-radius: var(--radius); font-size: var(--fs-sm);
}
.pane.is-low .wiz-pill, .pane.is-low .wiz-corner { bottom: var(--s1); }

/* ── 세계 지수 띠(모든 화면 맨 위 한 줄) ──
   넓은 화면: 항목이 여러 줄로 감기고 보이는 것은 한 줄 — ▲▼ 단추가 한 줄씩 위 · 아래로(저절로 넘기지 않음).
   좁은 화면(휴대폰): 단추 없이 옆으로 밀어 보는 한 줄 */
.idx-band {
  flex: none; display: flex; align-items: stretch;
  height: calc(30px * var(--fz)); background: var(--panel); border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.idx-band-view {
  flex: 1; min-width: 0; height: calc(30px * var(--fz)); overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s4); padding: 0 var(--s3);
}
.idx-item {
  flex: none; height: calc(30px * var(--fz)); display: inline-flex; align-items: center; gap: 6px;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.idx-item:hover .idx-name { color: var(--text); text-decoration: underline; }
.idx-name { color: var(--muted); }
.idx-value { font-weight: 700; }
.idx-src { flex: none; height: calc(30px * var(--fz)); display: inline-flex; align-items: center; color: var(--muted); white-space: nowrap; }
.idx-band-btns { flex: none; display: flex; align-items: center; gap: 2px; padding: 0 var(--s2); border-left: 1px solid var(--line); }
.idx-band-btn {
  width: calc(24px * var(--fz)); height: calc(22px * var(--fz)); padding: 0; line-height: 1;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); font-size: 0.625rem;
}
.idx-band-btn:hover:not(:disabled) { color: var(--text); background: var(--raised); }
.idx-band-btn:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 720px) {
  .idx-band-view { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .idx-band-view::-webkit-scrollbar { display: none; }
  .idx-band-btns { display: none; }
}

/* ── 지수 화면(#/index/<id>) ── */
.idx-page {
  max-width: 1200px; margin: 0 auto; padding: var(--s4);
  display: grid; grid-template-columns: minmax(0, 1fr) calc(280px * var(--fz)); gap: var(--s4); align-items: start;
}
.idx-main { min-width: 0; display: flex; flex-direction: column; gap: var(--s3); }
.idx-head { display: flex; flex-direction: column; gap: var(--s1); }
.idx-title { font-size: var(--fs-xl); }
.idx-quote { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.idx-big { font-size: 1.75rem; font-weight: 700; }
.idx-quote .idx-diff, .idx-quote .idx-pct { font-size: var(--fs-lg); font-weight: 600; }
.idx-delay {
  padding: 1px var(--s2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: var(--fs-sm);
}
.idx-delay:empty { display: none; }
.idx-desc { color: var(--muted); }
.idx-stats { display: flex; flex-wrap: wrap; gap: var(--s4); }
.idx-stat { display: inline-flex; gap: var(--s2); color: var(--muted); font-size: var(--fs-sm); align-items: baseline; }
.idx-stat b { color: var(--text); font-size: var(--fs); }
.idx-ranges { display: flex; flex-wrap: wrap; gap: var(--s1); }
.idx-chart { width: 100%; min-height: 300px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.idx-wait { padding: var(--s4); color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.idx-daily h2, .idx-side-group h2 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.idx-table-wrap { overflow-x: auto; }
.idx-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.idx-table th, .idx-table td { padding: 6px var(--s2); text-align: right; border-bottom: 1px solid var(--line); }
.idx-table th:first-child, .idx-table td:first-child { text-align: left; }
.idx-table th { color: var(--muted); font-weight: 600; font-size: var(--fs-sm); }
.idx-pager { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-top: var(--s2); }
.idx-page-no { color: var(--muted); font-size: var(--fs-sm); }
.idx-note { color: var(--muted); font-size: var(--fs-sm); }
.idx-side { display: flex; flex-direction: column; gap: var(--s4); }
.idx-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.idx-side-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; align-items: center; gap: var(--s2);
  padding: 6px var(--s2); border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.idx-side-item:hover { background: var(--raised); }
.idx-side-item[aria-current="page"] { background: var(--accent-soft); }
.idx-side-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idx-spark { display: block; width: 96px; height: 28px; }
.idx-side-num { display: flex; flex-direction: column; align-items: flex-end; font-size: var(--fs-sm); }
@media (max-width: 860px) {
  .idx-page { grid-template-columns: minmax(0, 1fr); padding: var(--s3); }
  .idx-big { font-size: var(--fs-xl); }
}

/* ── 언어 고르기(위 메뉴 오른쪽 지구 단추 — LANG_SWITCH 가 켜졌을 때만 생김, js/ui/lang-menu.js) ── */
.lang-pick { position: relative; flex: none; }
.btn-lang { display: inline-flex; align-items: center; gap: var(--s1); padding: 0 var(--s2); }
.btn-lang svg { display: block; }
.btn-lang-code { font-size: var(--fs-sm); color: var(--muted); }
.lang-list { position: absolute; z-index: 31; right: 0; top: calc(100% + var(--s1)); min-width: calc(150px * var(--fz)); display: flex; flex-direction: column; padding: var(--s1); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lang-list[hidden] { display: none; }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--row-h); padding: 0 var(--s2); background: none; border: 0; border-radius: var(--radius); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lang-item:hover, .lang-item:focus-visible { background: var(--accent-soft); outline: none; }
.lang-item[aria-checked="true"] { color: var(--accent); }
.lang-item[aria-checked="true"]::after { content: "✓"; }
/* 다른 언어로 쓴 이름은 그 언어 글꼴로(한국어 화면에서도 हिन्दी · 日本語 · Tiếng Việt 가 깨지지 않게) */
.lang-item:lang(ja) { font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", var(--font); }
.lang-item:lang(hi) { font-family: "Nirmala UI", "Kohinoor Devanagari", "Noto Sans Devanagari", "Mangal", var(--font); }
.lang-item:lang(vi) { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, var(--font); }
/* (휴대폰 폭의 지구 단추 자리는 위 「아주 좁은 화면의 위 메뉴」 묶음 안에 있음) */

/* ── 14단계 가독성: 글자 크기 고르기(위 메뉴의 「가」 단추 — js/ui/font-menu.js · js/util/font-scale.js) ──
   배율(--fz)은 tokens.css 의 :root[data-fs]. 각 줄은 그 크기의 글자로 미리 보여 줌(지금 고른 크기와 상관없이 고정 px). */
.font-pick { position: relative; flex: none; }
.btn-font { display: inline-flex; align-items: center; justify-content: center; min-width: var(--ctl-h); padding: 0 var(--s2); font-size: var(--fs-lg); font-weight: 700; line-height: 1; }
.btn-font[aria-expanded="true"] { border-color: var(--accent); }
.font-list { position: absolute; z-index: 31; right: 0; top: calc(100% + var(--s1)); min-width: calc(190px * var(--fz)); display: flex; flex-direction: column; gap: 2px; padding: var(--s1); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.font-list[hidden] { display: none; }
.font-list-title { margin: 0; padding: var(--s1) var(--s2); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.font-item { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s2); background: none; border: 1px solid transparent; border-radius: var(--radius); color: var(--text); font-family: inherit; text-align: left; white-space: nowrap; cursor: pointer; }
.font-item:hover, .font-item:focus-visible { background: var(--accent-soft); outline: none; box-shadow: none; border-color: var(--accent); }
.font-item[aria-checked="true"] { color: var(--accent); font-weight: 700; }
.font-item[aria-checked="true"]::after { content: "✓"; margin-left: auto; padding-left: var(--s3); }
.font-item-glyph { flex: none; min-width: 1.4em; text-align: center; font-weight: 700; }
.font-item-md { font-size: 13px; }
.font-item-lg { font-size: 16px; }
.font-item-xl { font-size: 18px; min-height: 48px; }

/* 손가락으로 쓰는 넓은 화면(태블릿): 휴대폰과 같은 누르는 크기(창 폭 860px 이하는 위 좁은 화면 묶음이 이미 맡음) */
@media (pointer: coarse) and (min-width: 861px) {
  :root { --ctl-h: 38px; --row-h: 40px; }
  :root[data-fs="lg"] { --ctl-h: 42px; --row-h: 44px; }
  :root[data-fs="xl"] { --ctl-h: 46px; --row-h: 48px; }
}

/* 주소로 가는 단추(<a class="btn">): 글자가 단추 위쪽에 붙지 않고 가운데(글자를 키워도 단추 안) */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* 칸 제목을 누르면 뜨는 「종목 찾기」 창(ui/symbol-popover.js) — 화면 가운데 큰 창, 휴대폰(600px 이하)은 화면 가득 */
.sympop-back {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: var(--s4); background: var(--veil);
}
.sympop-back[hidden] { display: none; }
.sympop {
  /* 칸 폭(머리줄과 줄이 같은 값) */
  --sp-logo: calc(28px * var(--fz)); --sp-price: calc(112px * var(--fz)); --sp-pct: calc(88px * var(--fz));
  --sp-vol: calc(104px * var(--fz)); --sp-star: calc(40px * var(--fz)); --sp-gap: var(--s3);
  width: min(calc(760px * var(--fz)), 100%); height: min(calc(700px * var(--fz)), 100%);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.sympop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s4) var(--s4) var(--s3); }
.sympop-head h2 { margin: 0; font-size: var(--fs-xl); line-height: 1.2; }
.sympop-x {
  flex: none; width: calc(36px * var(--fz)); height: calc(36px * var(--fz)); padding: 0;
  background: transparent; border: 0; border-radius: var(--radius); color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.sympop-x:hover { background: var(--raised); color: var(--text); }
.sympop-search {
  flex: none; display: flex; align-items: center; gap: var(--s2); margin: 0 var(--s4) var(--s3);
  height: calc(48px * var(--fz)); padding: 0 var(--s3);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: text;
}
.sympop-search:focus-within { border-color: var(--accent); }
/* 돋보기: 동그라미 + 손잡이(그림 파일 없이) */
.sympop-glass { flex: none; position: relative; width: 14px; height: 14px; margin-right: 4px; border: 2px solid var(--muted); border-radius: 50%; }
.sympop-glass::after { content: ""; position: absolute; right: -5px; bottom: -6px; width: 2px; height: 7px; background: var(--muted); transform: rotate(-45deg); }
.sympop-input {
  flex: 1; min-width: 0; height: 100%; padding: 0;
  background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: var(--fs-lg);
}
.sympop-input::placeholder { color: var(--muted); }
.sympop-esc {
  flex: none; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); font-family: inherit; font-size: var(--fs-sm);
}
.sympop-tabs { flex: none; display: flex; gap: var(--s4); padding: 0 var(--s4); border-bottom: 1px solid var(--line); overflow-x: auto; }
.sympop-tab {
  flex: none; min-height: calc(40px * var(--fz)); padding: var(--s2) 2px;
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-size: var(--fs-lg); font-weight: 700; white-space: nowrap; cursor: pointer;
}
.sympop-tab:hover { color: var(--text); }
.sympop-tab[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); }
.sympop-subs { flex: none; display: flex; flex-wrap: wrap; gap: var(--s1); padding: var(--s2) var(--s4); }
/* 머리줄 · 줄 · 빈 글을 한 스크롤 안에(머리줄은 위에 붙박이 — 스크롤 막대가 있어도 칸이 맞음) */
.sympop-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--s2) var(--s2); }
.sympop-cols {
  position: sticky; top: 0; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--sp-price) var(--sp-pct) var(--sp-vol) var(--sp-star); column-gap: var(--sp-gap);
  padding: var(--s1) 0 var(--s1) var(--s2); background: var(--panel); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: var(--fs-sm);
}
.sympop-c-price, .sympop-c-pct, .sympop-c-vol { text-align: right; }
.sympop-group { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) var(--s2) var(--s1); }
.sympop-group b { font-size: var(--fs); }
.sympop-group small { color: var(--muted); font-size: var(--fs-sm); }
.sympop-row { display: flex; align-items: stretch; border-radius: 8px; }
.sympop-row:hover { background: var(--raised); }
.sympop-row.is-sel { background: var(--accent-soft); }
.sympop-main {
  flex: 1; min-width: 0; min-height: calc(52px * var(--fz)); padding: var(--s1) 0 var(--s1) var(--s2);
  display: grid; grid-template-columns: var(--sp-logo) minmax(0, 1fr) var(--sp-price) var(--sp-pct) var(--sp-vol);
  align-items: center; column-gap: var(--sp-gap);
  background: transparent; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.sympop-main:focus-visible, .sympop-star:focus-visible { box-shadow: none; outline: 2px solid var(--accent); outline-offset: -2px; }
.sympop .sympop-logo { width: var(--sp-logo); height: var(--sp-logo); }
.sympop-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sympop-line1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.sympop-sym { flex: none; font-size: var(--fs-lg); font-weight: 700; }
.sympop-row.is-current .sympop-sym { color: var(--accent); }
.sympop-ko { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sympop-en { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sympop-price, .sympop-pct, .sympop-vol { text-align: right; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.sympop-pct.is-flat { color: var(--muted); }
.sympop-vol i { margin-left: 3px; color: var(--muted); font-size: var(--fs-sm); font-style: normal; }
.sympop-star {
  flex: none; width: var(--sp-star); padding: 0;
  background: transparent; border: 0; color: var(--muted); font-size: 1.125rem; cursor: pointer;
}
.sympop-star:hover { color: var(--text); }
.sympop-star[aria-pressed="true"] { color: var(--accent); }
.sympop-empty, .sympop-more { margin: 0; padding: var(--s3) var(--s2); color: var(--muted); }
.sympop-more { font-size: var(--fs-sm); }
.sympop-foot {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s4);
  padding: var(--s2) var(--s4); background: var(--bg); border-top: 1px solid var(--line);
  color: var(--muted); font-size: var(--fs-sm);
}
.sympop-session { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.sympop-session[hidden] { display: none; }
.sympop-session b { color: var(--text); }
.sympop-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--flat); }
.sympop-dot.is-open { background: var(--up); }
.sympop-dot.is-pre, .sympop-dot.is-after { background: var(--accent); }
/* 휴대폰: 화면 가득 · 변동%는 현재가 아래로(한 칸에 두 줄) · 크게 · 아주 크게에서는 거래대금 칸을 숨겨 이름 칸을 지킴 */
@media (max-width: 600px) {
  .sympop-back { padding: 0; }
  .sympop {
    --sp-price: calc(88px * var(--fz)); --sp-vol: calc(68px * var(--fz)); --sp-star: calc(36px * var(--fz)); --sp-gap: var(--s2);
    width: 100%; height: 100%; border: 0; border-radius: 0;
  }
  .sympop-head { padding: var(--s3) var(--s3) var(--s2); }
  .sympop-search { margin: 0 var(--s3) var(--s2); }
  .sympop-esc { display: none; }
  .sympop-tabs { gap: var(--s3); padding: 0 var(--s3); }
  .sympop-subs { padding: var(--s2) var(--s3); }
  .sympop-cols { grid-template-columns: minmax(0, 1fr) var(--sp-price) var(--sp-vol) var(--sp-star); }
  .sympop-c-pct { display: none; }
  .sympop-main { grid-template-columns: var(--sp-logo) minmax(0, 1fr) var(--sp-price) var(--sp-vol); grid-template-rows: auto auto; row-gap: 1px; }
  .sympop .sympop-logo, .sympop-name, .sympop-vol { grid-row: 1 / 3; }
  .sympop-name { grid-column: 2; }
  .sympop-price { grid-column: 3; grid-row: 1; }
  .sympop-pct { grid-column: 3; grid-row: 2; font-size: var(--fs-sm); }
  .sympop-vol { grid-column: 4; }
  .sympop-vol i { display: none; } /* 단위(USDT)는 좁은 화면에서 숨김 — 값만 */
  .sympop-foot { padding: var(--s2) var(--s3); }
  :root[data-fs="lg"] .sympop-cols, :root[data-fs="xl"] .sympop-cols { grid-template-columns: minmax(0, 1fr) var(--sp-price) var(--sp-star); }
  :root[data-fs="lg"] .sympop-main, :root[data-fs="xl"] .sympop-main { grid-template-columns: var(--sp-logo) minmax(0, 1fr) var(--sp-price); }
  :root[data-fs="lg"] .sympop-c-vol, :root[data-fs="lg"] .sympop-vol, :root[data-fs="xl"] .sympop-c-vol, :root[data-fs="xl"] .sympop-vol { display: none; }
}

/* ══════════ 15단계 차트 꾸미기: 봉 메뉴 · 차트 모양 메뉴 · 지표 창 ══════════ */
/* 도구 줄의 작은 판(봉 메뉴 · 차트 모양) — 위치는 코드가 top · left 로 잡음 */
.pop-panel {
  position: absolute; z-index: 21; display: flex; flex-direction: column; gap: var(--s2);
  padding: var(--s3); overflow-y: auto; overscroll-behavior: contain;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.pop-panel[hidden] { display: none; }
.pop-title { margin: 0 0 var(--s1); font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.pop-note { color: var(--muted); font-size: var(--fs-sm); line-height: var(--lh); word-break: keep-all; }
.bar-more { display: inline-flex; align-items: center; gap: 2px; padding: 0 var(--s2); }
.bar-more[aria-expanded="true"] { color: var(--text); border-color: var(--accent); }
.bar-more-caret { font-size: var(--fs-sm); }
.bar-panel { width: calc(260px * var(--fz)); }
.bar-sec { display: flex; flex-direction: column; gap: 2px; }
.bar-sec + .bar-sec { padding-top: var(--s2); border-top: 1px solid var(--line); }
.bar-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--s1); }
.bar-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.bar-pick {
  flex: 1; min-width: 0; height: var(--ctl-h); padding: 0 var(--s2); text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--text);
}
.bar-pick:hover { background: var(--panel); }
.bar-pick[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.bar-star, .ind-fav {
  flex: none; width: var(--ctl-h); height: var(--ctl-h); padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); opacity: 0.45; font-size: var(--fs);
}
.bar-star:hover, .ind-fav:hover { opacity: 0.8; background: var(--panel); }
.bar-star[aria-pressed="true"], .ind-fav[aria-pressed="true"] { color: var(--accent); opacity: 1; }
.style-btn { display: inline-flex; align-items: center; padding: 0 var(--s2); }
.style-btn[aria-expanded="true"] { border-color: var(--accent); }
.style-panel { width: calc(220px * var(--fz)); }
.style-rows { display: flex; flex-direction: column; gap: 2px; }
.style-row {
  display: flex; align-items: center; gap: var(--s2); min-height: var(--row-h); padding: 0 var(--s2); text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--text);
}
.style-row:hover { background: var(--panel); }
.style-row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.style-icon { display: block; flex: none; }
.style-icon .si-stroke { stroke: currentColor; stroke-width: 1.4; }
.style-icon .si-thin { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.style-icon .si-fill { fill: currentColor; stroke: currentColor; stroke-width: 1; }
.style-icon .si-hollow { fill: none; stroke: currentColor; stroke-width: 1.2; }
.style-icon .si-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.style-icon .si-area { fill: var(--accent-soft); stroke: none; }
.style-btn-icon { display: inline-flex; color: var(--muted); }
.style-btn:hover .style-btn-icon, .style-btn[aria-expanded="true"] .style-btn-icon { color: var(--text); }

/* 지표 창: 큰 창(넓은 화면 = 차트 화면 한가운데, 휴대폰 = 화면 가득). 위 찾기 · 왼쪽 묶음 · 오른쪽 목록 · 아래 모두 끄기 */
.ind-panel.is-big {
  left: 50%; transform: translateX(-50%); width: min(calc(760px * var(--fz)), calc(100% - 2 * var(--s3)));
  max-width: none; height: min(calc(600px * var(--fz)), 80vh); padding: 0; gap: 0; overflow: hidden;
}
.ind-panel.is-big[hidden] { display: none; }
.ind-panel.is-big .ind-body { flex: 1; min-height: 0; gap: 0; }
.ind-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s3) var(--s2); }
.ind-win-title { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.ind-head .split-title { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ind-close {
  flex: none; margin-left: auto; width: var(--ctl-h); height: var(--ctl-h); padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); font-size: var(--fs-lg);
}
.ind-close:hover { color: var(--text); background: var(--panel); }
.ind-panel.is-big .ind-body > .ind-lock, .ind-panel.is-big .ind-body > .btn { margin: 0 var(--s3) var(--s3); align-self: flex-start; }
.ind-search {
  margin: 0 var(--s3) var(--s2); height: calc(34px * var(--fz)); padding: 0 var(--s3);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font: inherit;
}
.ind-search:focus-visible { border-color: var(--accent); }
.ind-main { flex: 1; min-height: 0; display: flex; border-top: 1px solid var(--line); }
.ind-nav { flex: none; width: calc(150px * var(--fz)); display: flex; flex-direction: column; gap: 2px; padding: var(--s2); border-right: 1px solid var(--line); overflow-y: auto; }
.ind-cat {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--row-h); padding: 0 var(--s2); text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted);
}
.ind-cat:hover { color: var(--text); background: var(--panel); }
.ind-cat[aria-current="true"] { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.ind-cat-n { font-style: normal; font-size: var(--fs-sm); color: var(--muted); }
.ind-list { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: var(--s3); }
.ind-sec { display: flex; flex-direction: column; gap: var(--s1); }
.ind-sec-title { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.ind-panel.is-big .ind-rows { gap: var(--s1); }
.ind-item { display: flex; flex-direction: column; gap: 2px; }
.ind-item-main { display: flex; align-items: stretch; gap: var(--s1); }
.ind-item-main .ind-fav { align-self: center; }
.ind-item-main > .ind-row { flex: 1; min-width: 0; }
.ind-panel.is-big button.ind-row:not(.ind-opt) {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name state" "desc state" "bars state" "sub state";
  align-items: center; column-gap: var(--s3); row-gap: 1px; padding: 6px var(--s3);
}
.ind-panel.is-big .ind-name { grid-area: name; font-weight: 700; }
.ind-panel.is-big .ind-desc { grid-area: desc; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.ind-panel.is-big .ind-bars { grid-area: bars; color: var(--muted); font-size: var(--fs-sm); }
.ind-panel.is-big .ind-sub { grid-area: sub; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.ind-desc:empty, .ind-bars:empty { display: none; }
/* 켜기 스위치(글자 켜짐 · 꺼짐 + 손잡이 그림 — 색만으로 전하지 않음) */
.ind-panel.is-big button.ind-row:not(.ind-opt) > .ind-row-state { grid-area: state; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ind-panel.is-big button.ind-row:not(.ind-opt) > .ind-row-state::after {
  content: ""; width: 30px; height: 16px; border-radius: 8px; border: 1px solid var(--line); background-color: var(--bg);
  background-image: radial-gradient(circle at 8px 50%, var(--muted) 5px, transparent 5.5px);
}
.ind-panel.is-big button.ind-row[aria-pressed="true"]:not(.ind-opt) > .ind-row-state::after {
  border-color: var(--accent); background-color: var(--accent-soft);
  background-image: radial-gradient(circle at 21px 50%, var(--accent) 5px, transparent 5.5px);
}
.ind-panel.is-big .ind-row.is-locked { flex: 1; min-width: 0; }
.ind-opts { display: flex; flex-direction: column; gap: 2px; margin-left: calc(var(--ctl-h) + var(--s1) + var(--s3)); }
.ind-opts .ind-opt { min-height: calc(var(--row-h) - 4px); font-size: var(--fs-sm); background: transparent; border-style: dashed; }
.ind-empty { margin: var(--s4) 0; color: var(--muted); text-align: center; }
.ind-panel.is-big .ind-foot { flex: none; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }
.ind-panel.is-big .ind-foot .ind-remote-note { flex: 1; min-width: 0; color: var(--muted); font-size: var(--fs-sm); word-break: keep-all; }
.ind-panel.is-big .ind-foot .btn { flex: none; margin-left: auto; }
@media (max-width: 600px) {
  /* 휴대폰: 지표 창은 화면 가득, 왼쪽 묶음은 위쪽 한 줄 */
  .ind-panel.is-big { position: fixed; inset: 0; left: 0 !important; top: 0 !important; transform: none; width: auto; height: auto; max-height: none !important; border-radius: 0; z-index: 70; }
  .ind-main { flex-direction: column; }
  .ind-nav { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s1) var(--s2); }
  .ind-cat { flex: none; }
  .ind-list { padding: var(--s2); }
  .ind-opts { margin-left: var(--s4); }
  .bar-panel, .style-panel { left: var(--s2) !important; right: var(--s2); width: auto; }
}
@media (max-width: 600px) {
  /* 휴대폰: 창 아래 안내는 두 줄까지(목록 자리를 지킴) */
  .ind-panel.is-big .ind-foot .ind-remote-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* 도구 줄의 봉 단추 줄(★ 고른 봉 + [▾]) + 차트 모양 단추 */
.bar-itv-row { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--s1); }
.bar-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
@media (max-width: 600px) {
  /* 휴대폰: 첫 줄 = 봉 단추(넘치면 옆으로 밀어 봄) · [▾] · 차트 모양 — 둘째 줄은 예전처럼 매매법 · 지표 · 그리기 · 화면 분할 */
  .bar-main .bar-itv-row { flex: 1 0 100%; }
  .bar-main .bar-itv-row .bar-group { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
  .bar-chips { flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .bar-chips::-webkit-scrollbar { display: none; }
}
