:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --ink: #1d1d1b;
  --muted: #6b6b66;
  --line: #e3e2dd;
  --soft: #efeeea;
  --up: #d23c3c;          /* 상승 빨강 (국내 관례) */
  --down: #2b66c9;        /* 하락 파랑 */
  --accent: #1d1d1b;
  --warn-bg: #fff4e0;
  --warn-ink: #8a5300;
  --stop-bg: #fde8e8;
  --stop-ink: #a12626;
  --ok-ink: #2f7a3d;
  --radius: 6px;
  color-scheme: light dark;   /* 스크롤바·입력칸 같은 브라우저 기본 부품도 테마를 따른다 */
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --panel: #1c1c1a; --ink: #ecebe6; --muted: #9a9993; --line: #2f2e2b; --soft: #252522;
    --up: #ff6b6b; --down: #6ea2ff; --accent: #ecebe6;
    --warn-bg: #3a2c12; --warn-ink: #f0c070; --stop-bg: #3d1c1c; --stop-ink: #ff9d9d; --ok-ink: #7fcf8c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413; --panel: #1c1c1a; --ink: #ecebe6; --muted: #9a9993; --line: #2f2e2b; --soft: #252522;
  --up: #ff6b6b; --down: #6ea2ff; --accent: #ecebe6;
  --warn-bg: #3a2c12; --warn-ink: #f0c070; --stop-bg: #3d1c1c; --stop-ink: #ff9d9d; --ok-ink: #7fcf8c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
h1 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 6px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* 머리 */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top-row, .tabs, main { max-width: 1080px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top-row { display: flex; align-items: center; gap: 12px; padding-top: 12px; flex-wrap: wrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.who { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.gear { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none;
  border-radius: var(--radius); color: var(--muted); border: 1px solid transparent; }
.gear svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gear:hover { color: var(--ink); background: var(--soft); }
.gear.on { color: var(--ink); border-color: var(--line); background: var(--soft); }
.gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tabs { display: flex; gap: 20px; overflow-x: auto; }
.tabs a { text-decoration: none; padding: 10px 0 9px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tag { font-size: 12px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.stop { background: var(--stop-bg); color: var(--stop-ink); border-color: transparent; font-weight: 600; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }

main { padding-top: 18px; padding-bottom: 48px; }
section, .dec-main, .facts dd { min-width: 0; overflow-wrap: anywhere; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* 한눈에 */
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; }
.glance > div { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.glance > div:first-child { border-left: 0; }
.glance .label { font-size: 13px; color: var(--muted); }
.glance .big { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; margin: 2px 0 4px; }
.glance .cmp { font-size: 13px; }
@media (max-width: 760px) {
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance > div:nth-child(3) { border-left: 0; }
  .glance > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* 표 */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 13px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
table.runs td:not(:last-child) { white-space: nowrap; }
table.runs td:last-child { min-width: 260px; }

/* 운영 */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.facts.gap { margin-top: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.switch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
button {
  font: inherit; font-size: 14px; padding: 6px 14px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
button:hover { background: var(--soft); }
button.danger { border-color: var(--stop-ink); color: var(--stop-ink); }
button.primary { background: var(--accent); color: var(--panel); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }

/* 판단 일지 */
.dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.dates a { text-decoration: none; font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; background: var(--panel); }
.dates a.on { background: var(--accent); color: var(--panel); border-color: var(--accent); }
.run-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.run-head h2 { margin: 0; }
.view { background: var(--soft); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0 12px; font-size: 14px; }
.view .who-said { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.sectors { margin: 0 0 12px; padding: 0; list-style: none; font-size: 14px; }
.sectors li { padding: 4px 0; }
.sectors b { font-weight: 600; margin-right: 6px; }
.dec { border-top: 1px solid var(--line); padding: 12px 0; display: grid; grid-template-columns: 1fr 120px; gap: 4px 16px; }
.dec:first-of-type { border-top: 0; }
.dec-main { min-width: 0; }
.dec-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.act { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius); border: 1px solid var(--line); }
.act.buy { color: var(--up); border-color: var(--up); }
.act.sell { color: var(--down); border-color: var(--down); }
.act.hold { color: var(--muted); }
.sym { font-weight: 600; }
.rationale { margin: 6px 0 4px; font-size: 14px; white-space: pre-wrap; }
.rationale.folded { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { font-size: 13px; color: var(--muted); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.order { font-size: 13px; }
.order.filled { color: var(--ok-ink); }
.order.blocked, .order.rejected { color: var(--stop-ink); }
.spark { width: 120px; height: 36px; align-self: center; }
.spark path { fill: none; stroke: var(--muted); stroke-width: 1.4; }
@media (max-width: 560px) { .dec { grid-template-columns: 1fr; } .spark { width: 100%; } }
details { margin-top: 10px; font-size: 14px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details ul { margin: 6px 0; padding-left: 18px; }
details li { margin: 2px 0; }
code { font-size: 12px; background: var(--soft); padding: 1px 5px; border-radius: 4px; }

/* 곡선 */
.chart { width: 100%; height: 180px; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ledger { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .bench { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--ink); vertical-align: middle; margin-right: 6px; }
.legend i.b { border-top: 2px dashed var(--muted); }

/* 실행 기록 */
.st { font-size: 12px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line); }
.st.ok { color: var(--ok-ink); }
.st.failed, .st.missed { background: var(--stop-bg); color: var(--stop-ink); border-color: transparent; }
.st.throttled, .st.skipped { color: var(--muted); }
.st.running { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.error { background: var(--stop-bg); color: var(--stop-ink); padding: 12px 16px; border-radius: var(--radius); }
.login { text-align: center; padding: 48px 16px; }

/* 좁은 화면 — 운영 정보는 한 줄에 하나 */
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }

/* 내 계좌 */
h2.part { font-size: 13px; color: var(--muted); font-weight: 600; margin: 22px 0 8px; letter-spacing: 0.02em; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.strip .label { font-size: 13px; color: var(--muted); }
.strip b { font-size: 17px; font-weight: 650; }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.alloc { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--soft); }
.alloc span { flex-basis: 0; flex-shrink: 0; min-width: 2px; }
.a-kr { background: #c9a227; }
.a-us { background: #6f7f96; }
.a-cash { background: var(--line); }
.legend i.dot { width: 10px; height: 10px; border: 0; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend { flex-wrap: wrap; }

/* 서버 종료 */
.push-right { margin-left: auto; }

/* 설정 */
.notice { border-color: var(--accent); }
.form { display: grid; gap: 10px; margin: 12px 0; max-width: 560px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.field input { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); }
.check { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.facts.keys { margin: 10px 0; }
.facts.keys dd { min-width: 0; }
button.link { border: 0; background: none; padding: 0 6px; font-size: 13px; color: var(--muted); text-decoration: underline; }
.ok-line { color: var(--ok-ink); font-size: 14px; }
.accounts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.accounts p { margin: 0 6px 0 0; }
.flow { margin-top: 12px; padding: 12px; background: var(--soft); border-radius: var(--radius); }
.button-link { display: inline-block; padding: 6px 14px; border-radius: var(--radius); background: var(--accent);
  color: var(--panel); text-decoration: none; font-size: 14px; }

/* 갈래 (모의 · 실전) */
.lanes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.lanes a { text-decoration: none; font-size: 14px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); }
.lanes a.on { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.lanes a .small { color: var(--muted); }
section .lanes { margin: 10px 0 0; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: var(--panel); }
.tag.muted-tag { color: var(--muted); border-style: dashed; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.two > section { margin-bottom: 0; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.row.gap { margin-top: 12px; }
pre.prompt { white-space: pre-wrap; font-size: 12.5px; background: var(--soft); padding: 10px 12px; border-radius: var(--radius);
  max-height: 320px; overflow: auto; }
.account-block { margin-top: 4px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .lanes { margin-bottom: 0; }
.glance .cmp.ccy { font-size: 13px; }

/* 평가 — 채점 · 판정 · 리포트 · 회고 */
.score { font-size: 12px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.score.success { color: var(--ok-ink); }
.score.failure { background: var(--stop-bg); color: var(--stop-ink); border-color: transparent; }
.score.missed { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.score.neutral { color: var(--muted); }
.dec-eval { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.verdict { display: flex; gap: 4px 6px; flex-wrap: wrap; align-items: baseline; margin-top: 6px; font-size: 14px; }
.vtag { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius); border: 1px solid var(--line); }
.vtag.good { color: var(--ok-ink); border-color: var(--ok-ink); }
.vtag.bad { color: var(--stop-ink); border-color: var(--stop-ink); }
.vtag.lucky, .vtag.unlucky { color: var(--warn-ink); border-color: var(--warn-ink); }
.verdict-edit { flex-basis: 100%; }
.verdict-edit summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.verdict-edit[open] { background: var(--soft); border-radius: var(--radius); padding: 8px 10px; margin-top: 4px; }
.verdict-edit .seg { margin-top: 6px; }
.verdict input, .retro textarea { font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); color: var(--ink); min-width: 0; }
.verdict input { flex: 1 1 220px; }
.retro textarea { width: 100%; resize: vertical; }
.picks { list-style: none; margin: 0 0 12px; padding: 0; }
.pick { border-top: 1px solid var(--line); padding: 10px 0; }
.pick:first-child { border-top: 0; }
.picks li.small { padding: 3px 0; }
.dist { display: grid; gap: 4px; margin-bottom: 12px; }
.dist-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.dist-bar { height: 10px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; width: 0; background: var(--muted); }
.dist-bar i.success, .dist-bar i.good { background: var(--ok-ink); }
.dist-bar i.failure, .dist-bar i.bad { background: var(--stop-ink); }
.dist-bar i.missed, .dist-bar i.lucky, .dist-bar i.unlucky { background: var(--warn-ink); }
.cells { display: flex; gap: 6px; flex-wrap: wrap; }
.cell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.st.none { border-color: var(--stop-ink); color: var(--stop-ink); }
@media (max-width: 760px) { .dec { grid-template-columns: minmax(0, 1fr); } }
/* 좁은 화면 — 표는 글자를 쪼개지 않고 옆으로 밀고, 큰 숫자는 한 줄에 */
@media (max-width: 760px) { .table-wrap > table { min-width: 560px; } }
@media (max-width: 480px) { .glance .big { font-size: 21px; } }
.table-wrap td { word-break: keep-all; }
@media (max-width: 760px) { .table-wrap td:first-child { min-width: 150px; } }
.table-wrap .sym { white-space: nowrap; }

/* 머리의 갈래 고르기 — 모의 · 실전 (모든 탭이 이 갈래를 본다) */
.lane-top { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lane-top a { text-decoration: none; font-size: 14px; padding: 4px 12px; color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap; }
.lane-top a:first-child { border-left: 0; }
.lane-top a b { font-weight: 600; }
.lane-top a.on { background: var(--accent); color: var(--panel); }
.lane-top a.on .small { color: inherit; opacity: .8; }

/* 설정 — 옵션 칸 · 실전 잠금 */
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; }
.opt { display: grid; gap: 4px; align-content: start; min-width: 0; }
.opt > label { font-size: 14px; font-weight: 500; }
.opt input[type=text], .opt input[type=number], .opt select, .lock input[type=text] {
  font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); min-width: 0; }
.opt input[type=checkbox] { justify-self: start; width: 18px; height: 18px; }
.multi { display: flex; gap: 12px; flex-wrap: wrap; }
.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; font-size: 14px; }
.checks li.ok b { color: var(--ok-ink); }
.checks li.no b { color: var(--stop-ink); }
.lock.open { border-color: var(--stop-ink); }

/* 판단 일지 — 일기장 (평일마다 한 칸) */
.diary { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.diary .day { flex: none; display: grid; gap: 2px; min-width: 96px; text-decoration: none; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 12px; }
.diary .day .d { font-size: 13px; font-weight: 600; }
.diary .day.quiet { background: transparent; }
.diary .day.on { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.diary .m { color: var(--muted); white-space: nowrap; }
.diary .m.st-failed, .diary .m.st-missed, .diary .m.st-none { color: var(--stop-ink); }
.day-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.day-head .section-head { align-items: center; }
.st.holiday, .st.today { color: var(--muted); }

/* 보유 종목 줄 — 누르면 그 종목의 판단·매매 기록 */
tr.click { cursor: pointer; }
tr.click:hover td, tr.click:focus-visible td { background: var(--soft); }
tr.click:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sym-dec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.sym-dec:first-of-type { border-top: 0; }
.sym-dec .dec { border-top: 0; padding-top: 4px; }

/* 돌아가는 표시 — 기다리는 버튼·로그인 단계 */
.spin { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 6px; vertical-align: -0.12em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border-right-color: currentColor; opacity: .6; } }
button[aria-busy="true"] { cursor: progress; }
button .secs { opacity: .7; font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.steps li { color: var(--muted); display: flex; align-items: baseline; gap: 2px; }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.done { color: var(--ok-ink); }
.steps .mark { display: inline-block; width: 1.2em; margin-right: 6px; text-align: center; }
.steps .mark.bad { color: var(--stop-ink); }
.ok-flow { border: 1px solid var(--ok-ink); }

/* 판단 일지 — 매매 먼저, 섹터마다 */
.trades-first { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px 8px; margin: 10px 0 12px; }
.trades-first > h3 { margin-top: 8px; }
.part-sub { margin-top: 14px; }
.sector-block { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.sector-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sector-head h3 { margin: 0; }
.sector-why { margin: 4px 0 6px; }
.holds > summary { font-size: 13px; color: var(--muted); cursor: pointer; padding: 4px 0; }
.hold-line { border-top: 1px dashed var(--line); }
.hold-line > summary { cursor: pointer; padding: 6px 0; font-size: 14px; list-style: none; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.hold-line > summary::-webkit-details-marker { display: none; }
.hold-line .why { flex: 1 1 260px; min-width: 0; }
.hold-line[open] > summary .why { display: none; }
.day-trades { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.chip { font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; }
.chip.buy { color: var(--up); border-color: var(--up); }
.chip.sell { color: var(--down); border-color: var(--down); }

/* 감시 조건 · Claude 사용량 (taeyoon_event) — 첫 화면 위쪽의 작은 칸 */
section.mini { padding: 12px 14px; }
.two.watch-panel { align-items: start; }
section.mini h2 { margin-bottom: 6px; }
.watch-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.watch-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.watch-list li:first-child { border-top: 0; }
.watch-list .tag { margin-left: 6px; }
.watch-list .sym { font-weight: 600; text-decoration: none; }
.watch-list .sym:hover { text-decoration: underline; }
h3.sub { margin: 10px 0 2px; color: var(--muted); }
.meter { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; margin: 6px 0 8px; }
.meter > span { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.meter.over > span { background: var(--stop-ink); }
.warn-text { color: var(--warn-ink); }
.tag.view-bullish { color: var(--up); border-color: currentColor; }
.tag.view-bearish { color: var(--down); border-color: currentColor; }
ul.rules { margin: 0; padding-left: 18px; }
ul.rules li { margin: 2px 0; }

/* 업데이트 — 패치 예정 내역 */
section.update.safety { border-color: var(--warn-ink); }
section.update.past { padding: 12px 14px; }
section.update .lead { font-size: 15px; }
.changes { margin: 10px 0; }
.changes h3 { margin-bottom: 4px; }
.changes .area { margin: 6px 0 10px; }
.changes .area > .tag { display: inline-block; margin-bottom: 4px; }
.changes ul { margin: 0; padding-left: 18px; }
.changes li { margin: 3px 0; }
details.files { margin-top: 2px; font-size: 13px; }
details.files ul { padding-left: 16px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px; border-radius: var(--radius); }
.ok-text { color: var(--ok-ink); }
p.md { white-space: pre-wrap; }

/* 승인 대기 업데이트 수 — 설정 아이콘·설정 탭 이름 옆 */
.gear { position: relative; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--warn-ink); color: var(--panel); font-size: 11px; font-weight: 700; line-height: 1; }
.gear .count { position: absolute; top: -4px; right: -4px; }
nav.lanes a .count { margin-left: 6px; }

/* 평가 — 접힌 칸 */
details.fold { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; }
details.fold > summary { font-size: 14px; color: var(--ink); font-weight: 600; }

/* 분석 보고서 — 근거 기사 */
ul.articles { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 14px; }
ul.articles li { padding: 3px 0; border-top: 1px solid var(--line); }
ul.articles li:first-child { border-top: 0; }

/* [계정] 탭 — 키 묶음의 필수·선택 · 연결 상태 */
.tag.ok { color: var(--ok-ink); border-color: currentColor; }
section.key-group .section-head .tag { margin-left: 4px; }
p.need { margin-top: -4px; }

/* 시장 분석 — 캔들 차트 · 근거 기사 · 날짜별 접기 */
.chart.candle { height: auto; aspect-ratio: 760 / 300; }
.chart .ch-up { fill: var(--up); stroke: var(--up); stroke-width: 1; }
.chart .ch-down { fill: var(--down); stroke: var(--down); stroke-width: 1; }
.chart .ch-sma { fill: none; stroke-width: 1.3; }
.chart .ch-sma.s5 { stroke: #c08a2b; }
.chart .ch-sma.s20 { stroke: #2f9e8f; }
.chart .ch-sma.s60 { stroke: #7a5cc8; }
.chart .ch-sma.s120 { stroke: #8a8a85; }
.chart .ch-sma.s200 { stroke: var(--ink); stroke-width: 1.6; }
.chart .ch-level { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ch-stop { stroke: var(--stop-ink); stroke-width: 1.6; }
.chart .ch-stop-label { fill: var(--stop-ink); font-weight: 600; }
.chart .ch-watch { stroke: var(--warn-ink); stroke-width: 1.2; stroke-dasharray: 6 3; }
.chart .ch-watch-label { fill: var(--warn-ink); }
.candle-wrap .legend i.s5 { border-top-color: #c08a2b; }
.candle-wrap .legend i.s20 { border-top-color: #2f9e8f; }
.candle-wrap .legend i.s60 { border-top-color: #7a5cc8; }
.candle-wrap .legend i.s120 { border-top-color: #8a8a85; }
.candle-wrap .legend i.s200 { border-top-color: var(--ink); }
.candle-wrap .legend i.lv { border-top: 2px dashed var(--muted); }
.candle-wrap .legend i.stop { border-top-color: var(--stop-ink); }
.candle-wrap .legend i.watch { border-top: 2px dashed var(--warn-ink); }
.chart-slot { margin: 6px 0 10px; min-height: 24px; }
details.day > summary { font-size: 15px; }
details.day[open] > summary { margin-bottom: 10px; }
details.day > section { margin-bottom: 12px; }
ul.articles li.evidence { font-weight: 500; }
ul.articles li.evidence .tag { margin-right: 6px; }
section.research-card .section-head .sym { font-weight: 700; }

/* 공개 보기 — 모의투자만 (로그인 안 한 방문자) */
.public-note { max-width: 1080px; margin: 0 auto; padding: 6px 16px 8px; color: var(--muted); }
.public-note a { color: inherit; }

[hidden] { display: none !important; }   /* 클래스의 display 가 hidden 을 덮지 않게 */

/* 머리 우측 상단 — 로그인 · 계정 · 로그아웃 (휴대폰 폭에서도 한 줄) */
.who { white-space: nowrap; flex-shrink: 0; }
.who-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.who .btn, .who button { padding: 3px 10px; font-size: 13px; }
a.btn { display: inline-block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink);
  text-decoration: none; }
a.btn:hover { background: var(--soft); }
@media (max-width: 560px) { .who-name { max-width: 8ch; } .top-row { gap: 8px; } }

/* 판단 일지 달력 — 월~금 5칸, 칸 = 그 시장 현지 날짜 */
section.calendar { padding: 12px 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 0; }
.cal-cell { display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 5px 6px; border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); font-size: 12px; min-width: 0; overflow: hidden; }
a.cal-cell:hover { background: var(--soft); }
.cal-cell.blank { border: 0; }
.cal-cell.out, .cal-cell.quiet { color: var(--muted); }
.cal-cell.out { border-style: dashed; opacity: .5; }
.cal-cell.holiday { opacity: .55; background: var(--soft); }
.cal-cell.today { border-color: var(--ink); border-width: 2px; padding: 4px 5px; }
.cal-cell.on { background: var(--soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-top { display: flex; align-items: center; gap: 4px; }
.cal-d { font-weight: 600; font-size: 13px; }
.cal-woke { color: var(--warn-ink); font-size: 10px; }
.cal-warn { margin-left: auto; color: var(--stop-ink); font-weight: 700; }
.cal-acts { display: flex; flex-wrap: wrap; gap: 0 6px; }
.cal-acts .hold, .cal-note { color: var(--muted); }
.cal-acts .buy, .cal-legend .buy { color: var(--up); }
.cal-acts .sell, .cal-legend .sell { color: var(--down); }
.cal-ret { font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .cal-cell { min-height: 48px; padding: 3px 4px; font-size: 11px; }
  .cal-acts .hold, .cal-legend { display: none; }
}
@media (max-width: 560px) {   /* 휴대폰 폭 — 머리가 한 줄에 들도록 갈래의 작은 설명과 시장 배지를 접는다 */
  .lane-top .small { display: none; }
  .badges .tag:not(.stop) { display: none; }
}

/* 설정 → 계정 → Claude 구독 안의 오늘 사용량 */
.usage { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
