/* 토스 증권 웹의 구성과 색 쓰는 방식을 따름(2026-11-09 사용자 요청). 로고, 이름, 전용 서체는 쓰지 않는다 */
:root {
  --page: #101013; --panel: #17171c; --panel2: #1d1d23; --chip: rgba(214, 224, 239, .09); --chip2: rgba(217, 217, 255, .13); --line: rgba(214, 224, 239, .08);
  --text: rgba(242, 246, 255, .9); --text2: #c3c3c6; --muted: rgba(216, 223, 237, .59); --dim: rgba(211, 224, 243, .42);
  --blue: #3182f6; --up: #f5445a; --down: #4391ff;
  --entry: rgba(242, 246, 255, .75); --stop: #ffb020; --tp: #2ec27e;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  --side-w: 340px;
  /* 글자 단계: 12 · 13 · 14 · 15 · 16 · 20 · 24 */
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 15px; --fs-xl: 16px; --fs-2xl: 20px; --fs-3xl: 24px;
  /* 간격 단계(4px): 4 · 8 · 12 · 16 · 24 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px;
  --r-sm: 8px; --r-md: 10px; --r-lg: 12px;
  --sb: rgba(214, 224, 239, .14); --sb-hover: rgba(214, 224, 239, .3);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--text2); font: var(--fs-md)/1.5 var(--font); }
body { display: grid; grid-template-rows: 52px minmax(0, 1fr) 34px; overflow: hidden; font-feature-settings: "tnum"; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-radius: 6px; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); } .dim { color: var(--dim); }
.b { color: var(--text); font-weight: 600; }

/* 스크롤바: 어두운 바탕에 얇은 막대, 올리면 밝아짐(크롬·엣지·사파리 = webkit, 파이어폭스 = scrollbar-color) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sb); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--sb-hover); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--sb) transparent; } }

header.top { display: flex; align-items: center; gap: 22px; padding: 0 var(--s4); }
.logo { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--text); font-size: var(--fs-lg); }
.logo svg { width: 20px; height: 20px; }
nav.menu { display: flex; gap: var(--s1); }
nav.menu a { padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; }
nav.menu a.on { color: var(--text); background: var(--chip); }
nav.menu a:hover { background: var(--chip); color: var(--text); }
.search { margin-left: auto; position: relative; display: flex; align-items: center; gap: 6px; width: 260px; height: 34px; padding: 0 10px; background: var(--chip); border-radius: var(--r-md); }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search kbd { font: 600 var(--fs-xs) var(--font); color: var(--muted); background: var(--chip2); border-radius: 4px; padding: 1px 6px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: var(--fs-md) var(--font); outline: none; }
.search input::placeholder { color: var(--dim); }
.search .hint { position: absolute; top: 40px; left: 0; right: 0; padding: 10px var(--s3); background: var(--panel); border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-sm); z-index: 20; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }

.body { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w) 64px; min-height: 0; }
body.side-off .body { grid-template-columns: minmax(0, 1fr) 0 64px; }
body.side-off aside.side { display: none; }
main { overflow: auto; min-height: 0; padding: var(--s1) 10px 14px; scrollbar-gutter: stable; }
.view { display: flex; flex-direction: column; gap: 10px; }
.panel { background: var(--panel); border-radius: var(--r-lg); min-width: 0; }
.phead { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) 14px var(--s2); min-height: 44px; }
.phead h2 { margin: 0; font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.phead .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.chiptitle { display: inline-flex; align-items: center; padding: var(--s1) var(--s2); background: var(--chip); border-radius: 7px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.pills { display: inline-flex; background: var(--chip); border-radius: var(--r-sm); padding: 2px; }
.pills button { padding: var(--s1) 10px; border-radius: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); white-space: nowrap; }
.pills button.on { background: var(--chip2); color: var(--text); }
.pills button:hover { color: var(--text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { padding: 5px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.chips button.on { background: var(--text); color: var(--page); }
.chips button:hover:not(.on) { color: var(--text); }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--text2); font-size: var(--fs-xs); font-weight: 500; margin-right: var(--s1); white-space: nowrap; }
.tag.warn { background: rgba(255, 176, 32, .16); color: var(--stop); }
.tag.good { background: rgba(46, 194, 126, .16); color: var(--tp); }
.tag.info { background: rgba(49, 130, 246, .18); color: #8fb8ff; }
.note { font-size: var(--fs-xs); color: var(--dim); }
.err { color: var(--stop); padding: 14px var(--s4); }
.empty { color: var(--muted); padding: 18px var(--s4); font-size: var(--fs-sm); }
.src { font-size: var(--fs-xs); color: var(--dim); padding: 0 14px var(--s3); }

/* 불러오는 동안 회색 뼈대(움직임 줄이기 설정이면 멈춤) */
.sk { padding: 14px var(--s4); display: grid; gap: 10px; }
.sk i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--chip) 0%, var(--chip2) 50%, var(--chip) 100%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.sk i:nth-child(3n) { width: 62%; } .sk i:nth-child(3n+2) { width: 84%; }
.sk .msg { font-size: var(--fs-xs); color: var(--dim); }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; letter-spacing: -.02em; }
.av.lg { width: 34px; height: 34px; font-size: 11.5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px var(--s3); border-radius: 9px; background: var(--chip); color: var(--text); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--chip2); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.wide { width: 100%; padding: 11px; }
.btn.sm { padding: var(--s1) var(--s2); font-size: var(--fs-xs); border-radius: 7px; }
.heart { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--dim); }
.heart:hover { background: var(--chip); color: var(--text); }
.heart.on { color: var(--up); }
.heart svg { width: 17px; height: 17px; }

/* 홈: 지수 카드 */
.idx { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); padding: var(--s1) var(--s1) 10px; }
.ic { padding: 10px var(--s3) var(--s1); border-right: 1px solid var(--line); min-width: 0; }
.ic:last-child { border-right: 0; }
.ic .n { font-size: var(--fs-sm); font-weight: 600; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic .v { font-size: var(--fs-xl); font-weight: 700; color: var(--text); white-space: nowrap; }
.ic .c { font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.ic .d { font-size: var(--fs-xs); color: var(--dim); margin-left: var(--s1); font-weight: 500; }
.ic svg { width: 100%; height: 34px; display: block; margin-top: var(--s1); }
.mid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.wl a.row, .wl .row { display: grid; grid-template-columns: auto minmax(0, 1fr) 70px auto; align-items: center; gap: 10px; padding: 7px 14px; }
.wl .row:hover { background: rgba(214, 224, 239, .04); }
.wl .nm .t { color: var(--text); font-weight: 600; }
.wl .nm .s { font-size: var(--fs-xs); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl .px { text-align: right; }
.wl .px .p { color: var(--text); font-weight: 600; }
.wl .px .c { font-size: var(--fs-xs); font-weight: 600; }
.wl svg.sp, svg.sp { width: 70px; height: 24px; display: block; }
.alerts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px var(--s2); }
.breadth { padding: 2px 14px var(--s3); display: grid; gap: 9px; }
.br .l { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.br .l b { color: var(--text); font-weight: 600; }
.br .bar { height: 5px; border-radius: 3px; background: var(--chip); margin-top: var(--s1); overflow: hidden; display: flex; }
.br .bar i { display: block; height: 100%; }
.brief { padding: 0 14px var(--s3); }
.brief p { margin: 0; font-size: var(--fs-md); color: var(--text2); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }
.brief.open p { -webkit-line-clamp: unset; }

/* 업종 막대(홈·시장) */
.sbars { padding: 2px 14px var(--s3); display: grid; gap: 6px; }
.sbar { display: grid; grid-template-columns: 82px minmax(0, 1fr) 62px; align-items: center; gap: 10px; font-size: var(--fs-sm); padding: 2px 6px; margin: 0 -6px; border-radius: 6px; }
button.sbar { width: calc(100% + 12px); text-align: left; }
button.sbar:hover, button.sbar.on { background: var(--chip); }
.sbar .nm { color: var(--text2); font-weight: 600; white-space: nowrap; }
.sbar .track { position: relative; height: 8px; }
.sbar .track::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line); }
.sbar .track i { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.sbar .v { text-align: right; font-weight: 600; }
.mini { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); table-layout: fixed; }
.mini td:first-child { overflow: hidden; text-overflow: ellipsis; } .mini td.r { width: 84px; }
.mini td { padding: 6px 14px; white-space: nowrap; }
.mini tr.click { cursor: pointer; } .mini tr.click:hover td { background: rgba(214, 224, 239, .04); }
.mini td.r { text-align: right; font-weight: 600; }
.mini .t { color: var(--text); font-weight: 600; margin-right: 6px; }

/* 찾기: 후보 보드 */
.tabs { display: flex; gap: 18px; padding: 14px var(--s4) 0; border-bottom: 1px solid var(--line); align-items: flex-end; }
.tabs button { padding: 0 0 10px; font-size: var(--fs-xl); font-weight: 700; color: var(--dim); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs.sm button { font-size: var(--fs-md); }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.tabs button .c { font-size: var(--fs-sm); color: var(--dim); margin-left: var(--s1); font-weight: 600; }
.tabs .right { margin-left: auto; padding-bottom: 10px; }
.subbar { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
.subbar .rule { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 272px; border-top: 1px solid var(--line); }
.split > div:first-child { overflow-x: auto; min-width: 0; }
table.grid { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
table.grid th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: right; font-weight: 500; color: var(--dim); font-size: var(--fs-sm); padding: 9px var(--s2); white-space: nowrap; }
table.grid th.l, table.grid td.l { text-align: left; }
table.grid td { padding: var(--s2); text-align: right; white-space: nowrap; color: var(--text); font-weight: 500; }
table.grid tbody tr.click { cursor: pointer; }
#btp table.grid th { position: static; }  /* 지난 성적: 머리줄 두 줄이 붙어 다니면 겹친다 */
table.grid tbody tr:hover td { background: rgba(214, 224, 239, .04); }
table.grid tbody tr.sel td { background: var(--chip); }
table.grid tbody tr.sel td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); } table.grid tbody tr.sel td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
td.rk { color: var(--muted); width: 28px; text-align: center !important; }
.name { display: flex; align-items: center; gap: 10px; }
.name .t { font-weight: 600; color: var(--text); }
.name .c { font-size: var(--fs-xs); color: var(--dim); max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.scroll .name .c { max-width: 130px; }
a.name:hover .t { text-decoration: underline; }
td.stop { color: var(--stop); } td.tp { color: var(--tp); }
td small { color: var(--dim); font-size: var(--fs-xs); margin-left: var(--s1); font-weight: 500; }
.scroll { max-height: 480px; overflow: auto; }
.preview { background: var(--panel); }
.preview { border-left: 1px solid var(--line); padding: 14px var(--s4); position: sticky; top: 0; align-self: start; }
.preview .hd { display: flex; align-items: center; gap: 10px; }
.preview .px { font-size: 18px; font-weight: 700; color: var(--text); margin-top: var(--s2); }
.preview svg.area { width: 100%; height: 150px; display: block; margin: var(--s2) 0; }
dl.rows { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: var(--fs-md); }
dl.rows dt { color: var(--muted); padding: 5px 0; }
dl.rows dd { margin: 0; padding: 5px 0; text-align: right; color: var(--text); font-weight: 600; }
dl.rows dd small { color: var(--dim); font-weight: 500; font-size: var(--fs-xs); margin-left: 6px; }
dl.rows dd.stop { color: var(--stop); } dl.rows dd.tp { color: var(--tp); }

/* 시장 */
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; }
.mrow.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.heat { position: relative; height: 520px; margin: 0 var(--s3) var(--s2); border-radius: var(--r-sm); overflow: hidden; background: var(--panel2); }
.heat .tl { position: absolute; overflow: hidden; border: 1px solid var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; line-height: 1.15; cursor: pointer; }
.heat .tl:hover { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px; z-index: 2; }
.heat .tl b { font-weight: 700; } .heat .tl span { opacity: .92; font-weight: 600; }
.heat .sh { position: absolute; z-index: 3; padding: 1px 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--text); background: rgba(16, 16, 19, .72); border-radius: 0 0 6px 0; pointer-events: none; white-space: nowrap; }
.heat.focus .tl { opacity: .28; } .heat.focus .tl.in { opacity: 1; }
.scale { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--dim); }
.scale i { display: block; width: 18px; height: 10px; border-radius: 2px; }
.bstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 6px var(--s2); }
.bstats > div { padding: 6px var(--s2); }
.bstats .l { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.bstats .v { font-size: 18px; font-weight: 700; color: var(--text); }
.cbox { height: 220px; position: relative; margin: 0 var(--s2) var(--s2); }
.cbox > div { position: absolute; inset: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--fs-xs); color: var(--muted); padding: 0 var(--s3) 10px; }
.legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: var(--s1); }
svg.curve { width: 100%; height: 230px; display: block; }
svg.curve text { font: 13px var(--font); fill: var(--dim); }
.macro { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.macro > div { padding: var(--s3) 14px; border-top: 1px solid var(--line); min-width: 0; }
.macro > div:nth-child(odd) { border-right: 1px solid var(--line); }
.macro .l { font-size: var(--fs-sm); font-weight: 600; color: var(--text2); }
.macro .v { font-size: var(--fs-2xl); font-weight: 700; color: var(--text); }
.macro .c { font-size: var(--fs-xs); color: var(--muted); }
.macro svg { width: 100%; height: 44px; display: block; margin-top: 6px; }

/* 종목 */
.shead { display: flex; align-items: center; gap: var(--s3); padding: 10px 6px 6px; flex-wrap: wrap; }
.shead .nm { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.shead .tk { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.shead .px { font-size: var(--fs-3xl); font-weight: 700; color: var(--text); }
.shead .ch { font-size: var(--fs-lg); font-weight: 600; }
.stats { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.stat .l { font-size: var(--fs-xs); color: var(--dim); font-weight: 500; }
.stat .v { font-size: var(--fs-sm); color: var(--text); font-weight: 600; white-space: nowrap; }
.range { display: flex; align-items: center; gap: var(--s2); }
.range .rb { position: relative; width: 90px; height: 4px; border-radius: 2px; background: var(--chip2); }
.range .rb i { position: absolute; top: -3px; width: 4px; height: 10px; border-radius: 2px; background: var(--text); }
.sgrid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 10px; }
.sgrid .left, .sgrid .right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chartbox { height: calc(100vh - 52px - 34px - 92px - 52px - 230px); min-height: 380px; position: relative; margin: 0 var(--s2) var(--s2); }
#chart { position: absolute; inset: 0; }
table.ind { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
table.ind th { text-align: left; font-weight: 500; color: var(--dim); font-size: var(--fs-sm); padding: 6px 14px; }
table.ind td { padding: 6px 14px; color: var(--text); font-weight: 500; text-align: right; }
.indwrap { display: grid; grid-template-columns: 1fr 1fr; }
.indwrap > div + div { border-left: 1px solid var(--line); }
.order { padding: var(--s1) 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.order .orow { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 10px; }
.order .ol { font-size: var(--fs-md); color: var(--text2); font-weight: 600; }
.order .box { display: flex; justify-content: space-between; align-items: center; height: 40px; padding: 0 var(--s3); border-radius: 9px; background: var(--chip); color: var(--text); font-weight: 600; }
.order .box small { color: var(--dim); font-size: var(--fs-xs); font-weight: 500; }
.order .box.stop { color: var(--stop); } .order .box.tp { color: var(--tp); }
.order .pills { display: grid; grid-template-columns: 1fr 1fr; }
.order .pills button { padding: 7px 0; }
.order .sum { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; font-size: var(--fs-sm); }
.order .sum div { display: flex; justify-content: space-between; } .order .sum span:last-child { color: var(--text); font-weight: 600; }
.order .rule { font-size: var(--fs-xs); color: var(--dim); line-height: 1.55; }
.warnbox { padding: 10px var(--s3); border-radius: 9px; background: rgba(255, 176, 32, .1); color: var(--stop); font-size: var(--fs-sm); line-height: 1.5; }
.order .sum .warnline { display: block; color: var(--stop); font-size: var(--fs-xs); }
.stopc { color: var(--stop) !important; }
.riskp { border-bottom: 1px solid var(--line); padding-bottom: var(--s1); }

/* 내 투자 */
.sumstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sumstrip > div { padding: 14px var(--s4); border-right: 1px solid var(--line); }
.sumstrip > div:last-child { border-right: 0; }
.sumstrip .l { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.sumstrip .v { font-size: var(--fs-2xl); font-weight: 700; color: var(--text); margin-top: 2px; }
.sumstrip .s { font-size: var(--fs-sm); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis > div { padding: var(--s3) var(--s4); border-right: 1px solid var(--line); }
.kpis > div:last-child { border-right: 0; }
.kpis .l { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.kpis .v { font-size: 18px; font-weight: 700; color: var(--text); }
.kpis .s { font-size: var(--fs-xs); color: var(--dim); }
.eqbox { height: 260px; position: relative; margin: 0 var(--s2) 10px; }
#eqchart { position: absolute; inset: 0; }
.toolbar { display: flex; gap: 6px; align-items: center; }
.csvhelp { padding: 0 var(--s4) var(--s3); font-size: var(--fs-sm); color: var(--dim); }
.csvhelp code { background: var(--chip); padding: 1px 5px; border-radius: 4px; color: var(--text2); }
.problems { margin: 0 var(--s4) var(--s3); padding: 10px var(--s3); border-radius: 9px; background: rgba(255, 176, 32, .1); color: var(--stop); font-size: var(--fs-sm); }

/* 사이드바 */
aside.side { background: var(--panel); border-radius: var(--r-lg) 0 0 0; display: flex; flex-direction: column; min-height: 0; margin-top: var(--s1); }
.shd { padding: 14px var(--s4) var(--s2); }
.shd h2 { margin: 0; font-size: var(--fs-lg); font-weight: 700; color: var(--text); display: flex; align-items: center; gap: var(--s2); }
.shd h2 button { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; padding: 3px var(--s2); border-radius: 6px; background: var(--chip); }
.shd .sub { margin-top: var(--s1); font-size: var(--fs-sm); color: var(--muted); }
.ctx { display: inline-block; margin-top: var(--s2); padding: 3px var(--s2); border-radius: 6px; background: var(--chip); font-size: var(--fs-xs); color: var(--text2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { flex: 1; overflow: auto; padding: var(--s2) var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s3); }
.msg { font-size: var(--fs-md); line-height: 1.6; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 88%; background: var(--blue); color: #fff; border-radius: 14px 14px 4px 14px; padding: var(--s2) var(--s3); white-space: pre-wrap; }
.msg.bot { color: var(--text2); }
.msg.bot b { color: var(--text); }
.msg.bot ul { margin: var(--s1) 0; padding-left: 18px; }
.msg .steps { margin-top: var(--s1); font-size: var(--fs-xs); color: var(--dim); }
.msg.wait { color: var(--dim); }
.examples { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s1); }
.examples button { text-align: left; padding: 9px var(--s3); border-radius: var(--r-md); background: var(--chip); color: var(--text2); font-size: var(--fs-sm); }
.examples button:hover { background: var(--chip2); color: var(--text); }
form.ask { padding: 10px var(--s3) var(--s3); display: flex; gap: var(--s2); align-items: flex-end; }
form.ask textarea { flex: 1; resize: none; height: 42px; max-height: 140px; padding: 10px var(--s3); background: var(--chip); border: 0; border-radius: var(--r-lg); color: var(--text); font: var(--fs-md)/1.5 var(--font); overflow-y: hidden; outline: none; }
form.ask textarea::placeholder { color: var(--dim); }
form.ask button { height: 42px; padding: 0 14px; background: var(--blue); color: #fff; border-radius: var(--r-lg); font-weight: 600; }
form.ask button:disabled { opacity: .45; cursor: default; }
.slist { padding: var(--s1) var(--s2); overflow: auto; }
.slist a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: var(--s2); border-radius: var(--r-md); }
.slist a:hover { background: var(--chip); }
.slist .t { color: var(--text); font-weight: 600; }
.slist .s { font-size: var(--fs-xs); color: var(--dim); }
.slist .r { text-align: right; font-size: var(--fs-sm); }

nav.rail { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding-top: 6px; }
nav.rail button { width: 52px; padding: 7px 0 5px; border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
nav.rail button svg { width: 19px; height: 19px; }
nav.rail button:hover, nav.rail button.on { color: var(--text); }
nav.rail button.on svg { background: var(--chip2); border-radius: var(--r-sm); padding: var(--s1); width: 27px; height: 27px; margin: -4px 0; }

footer.bottom { display: flex; align-items: center; gap: 18px; padding: 0 var(--s4); font-size: var(--fs-xs); color: var(--dim); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
footer.bottom .right { margin-left: auto; display: flex; gap: var(--s4); color: var(--muted); }
footer.bottom b { color: var(--text); font-weight: 600; }

dialog { background: var(--panel); color: var(--text2); border: 0; border-radius: var(--s4); padding: 0; width: 460px; box-shadow: 0 16px 48px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog form { padding: 20px; display: grid; gap: 11px; }
dialog h3 { margin: 0; font-size: 18px; color: var(--text); }
dialog label { display: grid; grid-template-columns: 1fr 170px; align-items: center; gap: 10px; font-size: var(--fs-md); color: var(--text2); font-weight: 600; }
dialog label small { display: block; color: var(--dim); font-size: var(--fs-xs); font-weight: 500; }
dialog input, dialog select { height: 38px; background: var(--chip); border: 0; border-radius: 9px; color: var(--text); padding: 0 var(--s3); font: 600 var(--fs-md) var(--font); outline: none; width: 100%; }
dialog input:focus-visible, dialog select:focus-visible { outline: 2px solid var(--blue); }
dialog input.num { text-align: right; }
dialog select option { background: var(--panel); }
dialog .row { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s2); margin-top: var(--s1); }
dialog .formerr { color: var(--stop); font-size: var(--fs-sm); min-height: 18px; white-space: pre-wrap; }
.toast { position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); background: #2a2a33; color: var(--text); padding: 10px var(--s4); border-radius: var(--r-md); font-size: var(--fs-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); z-index: 50; max-width: 70vw; white-space: pre-wrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 손절가 올리기(내 투자 포지션 · 종목 내 포지션) */
.stopcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--s2); padding: 0 14px var(--s2); }
.stopcard { background: var(--panel2); border-radius: var(--r-md); padding: 10px var(--s3); min-width: 0; }
.sc-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: var(--fs-sm); }
.sc-h .t { font-weight: 700; color: var(--text); font-size: var(--fs-md); }
.sugs { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sug { display: grid; grid-template-columns: 52px 76px minmax(0, 1fr) auto; align-items: center; gap: var(--s2); font-size: var(--fs-sm); padding: 3px 0; border-top: 1px solid var(--line); }
.sug .sn { color: var(--text); font-weight: 600; }
.sug .sv { color: var(--stop); font-variant-numeric: tabular-nums; text-align: right; }
.sug .sw { color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug .sa { justify-self: end; }
.sug.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-xs); }
#mypos .sugs .sug { grid-template-columns: 46px 70px minmax(0, 1fr) auto; }

/* 소식: 뉴스 헤드라인 + SEC 공시 */
.news { display: flex; flex-direction: column; padding: 0 14px var(--s2); }
.ni { display: block; padding: var(--s2) 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.ni:first-child { border-top: 0; }
.ni:hover .ni-h { color: #8fb8ff; }
.ni-h { color: var(--text); font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; }
.ni-s { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ni-m { color: var(--dim); font-size: var(--fs-xs); margin-top: 2px; }
.ni.heavy .ni-h { color: var(--stop); }

/* 종목 재무 탭(8e) */
.fov { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2) var(--s3); padding: 0 14px var(--s3); }
.fk .l { font-size: var(--fs-xs); color: var(--dim); }
.fk .v { font-size: var(--fs-md); font-weight: 600; color: var(--text); white-space: nowrap; }
.fk .v small { font-size: var(--fs-xs); color: var(--dim); font-weight: 500; margin-right: 6px; }
.fbar { display: flex; align-items: center; gap: var(--s2); padding: 0 14px var(--s2); }
.fbar .pills { margin-left: auto; }
#stabs table.grid th { position: static; }
table.grid.fin td, table.grid.fin th { font-size: var(--fs-sm); }
#stabs .phead { flex-wrap: wrap; }
.offmark { color: var(--stop); font-weight: 700; margin-left: 1px; cursor: help; }
@media (max-width: 900px) { .fov { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
