:root { --bg: #f3f4f6; --card: #fff; --line: #e4e7eb; --line-soft: #eef0f3; --text: #1d2229; --muted: #586170; --up: #c62828; --down: #1565c0; --chip: #eef1f5; --accent: #0d47a1; --accent-soft: #e8f0fb; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Pretendard Variable", Pretendard, -apple-system, system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.logo { width: 24px; height: 24px; border-radius: 6px; display: block; }
.status { color: var(--muted); font-size: 14px; font-weight: 350; }
.brand { display: flex; gap: 10px; align-items: center; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.tabs { position: sticky; top: 45px; z-index: 2; display: flex; gap: 2px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 12px 8px; font: inherit; font-size: 15px; cursor: pointer; color: var(--muted); white-space: nowrap; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.tabs button { font-weight: 400; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.subnav button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 14px; cursor: pointer; color: var(--muted); }
.subnav button:hover { color: var(--text); }
.subnav button.on { background: var(--text); border-color: var(--text); color: #fff; font-weight: 500; }
.subnav button.on .cnt { background: rgba(255, 255, 255, 0.2); color: #fff; }
.cnt { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12px; text-align: center; }
.subnav button.on .cnt, .stagefilter button.on .cnt { background: #0d47a1; color: #fff; }
.stagefilter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.stagefilter button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.stagefilter button.on { background: var(--text); color: #fff; border-color: var(--text); }
.content { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2::before { content: "▸ "; color: var(--muted); }
details.card[open] > summary h2::before { content: "▾ "; }
.chip { display: inline-block; white-space: nowrap; background: var(--chip); border-radius: 999px; padding: 2px 9px; font-size: 13px; font-weight: 400; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; font-weight: 350; }
.note { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; font-weight: 350; }
.note b { font-weight: 500; color: var(--text); }
.alert { background: #fff3e0; border: 1px solid #ffcc80; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kpi { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.kpi b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; white-space: nowrap; }
.kpi span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; font-weight: 350; }
.steps { padding-left: 18px; margin: 4px 0 8px; }
.steps li { margin: 3px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 7px 5px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-weight: 400; font-size: 13px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
th.l, td.l { text-align: left; }
td.wrap { white-space: normal; min-width: 230px; max-width: 420px; line-height: 1.4; font-size: 13px; }
/* 가로 스크롤 표: 첫 열(종목)을 왼쪽에 고정해 어느 행인지 보이게 */
.table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.table-wrap th:first-child { background: #fafbfc; z-index: 2; }
tr.row-chart:hover td:first-child { background: #f7f9fc; } tr.row-chart.open td:first-child { background: #eef3fb; } tr.base td:first-child { background: #f0f6ff; }
.table-wrap td:first-child::after { content: ""; position: absolute; top: 0; right: -1px; bottom: 0; width: 1px; background: var(--line-soft); }
td .muted { font-size: 12.5px; font-weight: 350; }
td.l { font-weight: 450; }
.up { color: var(--up); } .down { color: var(--down); }
.ev { padding-left: 18px; margin: 6px 0; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { body { font-size: 14px; } table { font-size: 13.5px; } .content { padding: 10px; } .card { padding: 12px; } .top { padding: 8px 12px; } .top { position: static; } .tabs { top: 0; padding: 0 8px; } .tabs button { padding: 9px 10px 7px; font-size: 13px; } .top .muted { font-size: 12px; } .chart-tools .ind label { margin-left: 6px; } }
tr.base td { background: #f0f6ff; }
details > summary { cursor: pointer; margin: 8px 0 4px; }
details.sub { border-top: 1px solid var(--line); padding: 8px 0 4px; }
details.sub > summary { list-style: none; cursor: pointer; margin: 0; }
details.sub > summary::-webkit-details-marker { display: none; }
details.sub > summary h3 { font-size: 14px; margin: 0; font-weight: 500; }
details.sub > summary h3::before { content: "▸ "; color: var(--muted); }
details.sub[open] > summary h3::before { content: "▾ "; }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px 18px; margin: 4px 0 10px; }
.funnel .step { position: relative; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.funnel .step::after { content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%); color: #b0b8c4; font-size: 13px; }
.funnel .step:last-of-type::after { content: none; }
.funnel .step b { display: block; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.funnel .step span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 350; line-height: 1.35; margin-top: 2px; }
.funnel .step.hot { background: var(--accent-soft); }
.funnel .arrow { display: none; }
.stage { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 13px; font-weight: 500; }
.stage.s1 { background: #f1f3f5; color: #555; } .stage.s2 { background: #fff3e0; color: #b26a00; } .stage.s3 { background: #e8f5e9; color: #1b7f3b; } .stage.s4 { background: #e3f2fd; color: #0d47a1; }
.book { margin-bottom: 18px; }
tr.row-chart { cursor: pointer; }
tr.row-chart:hover td { background: #f7f9fc; }
tr.row-chart.open td { background: #eef3fb; }
tr.chart-tr td { padding: 4px 0 10px; background: #fff; position: sticky; left: 0; white-space: normal; }
.chart-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.chart-head { margin-bottom: 4px; } .chart-head > b { font-weight: 600; } .chart-head .muted { font-weight: 350; }
svg.chart { display: block; max-width: 100%; font-family: inherit; }
svg.chart .grid { stroke: #eceff3; stroke-width: 1; }
svg.chart .vgrid { stroke: #f1f3f6; stroke-width: 1; }
svg.chart .panel { fill: #fafbfc; }
svg.chart .lane { fill: #f6f7f9; }
svg.chart .lab { font-size: 12.5px; fill: #586170; }
svg.chart .lab.small { font-size: 12px; }
svg.chart .ptitle { font-size: 12px; font-weight: 400; fill: #6b7380; }
/* 볼린저·이평 */
svg.chart .bbfill { fill: rgba(91, 127, 181, 0.06); stroke: none; }
svg.chart .bb { fill: none; stroke: #5b7fb5; stroke-width: 1; }
svg.chart .bbmid { fill: none; stroke: #b0b8c4; stroke-width: 1; stroke-dasharray: 4 3; }
svg.chart .ma { fill: none; stroke-width: 1.6; }
svg.chart .ma5 { stroke: #e58a00; } svg.chart .ma20 { stroke: #7b3fb5; } svg.chart .ma60 { stroke: #3c8d6b; }
/* 캔들: 상승 빨강·하락 파랑 */
svg.chart .wick { stroke-width: 1; } svg.chart .body { stroke-width: 1; }
svg.chart .cu { stroke: #c62828; fill: #e53935; } svg.chart .cd { stroke: #1565c0; fill: #1e88e5; }
svg.chart .vol { opacity: 0.45; }
/* 거래 구간 띠·선 */
svg.chart .zone.win { fill: rgba(27, 127, 59, 0.10); } svg.chart .zone.loss { fill: rgba(198, 40, 40, 0.10); }
svg.chart .hl { stroke-width: 1.4; }
svg.chart .hl.entry { stroke: #0d47a1; } svg.chart .hl.stop { stroke: #c62828; stroke-dasharray: 6 3; } svg.chart .hl.target { stroke: #1b7f3b; stroke-dasharray: 6 3; } svg.chart .hl.exit { stroke: #6a1b9a; }
svg.chart .hl.dip { stroke: #3c8d6b; stroke-width: 1.2; stroke-dasharray: 2 3; }
svg.chart .tag rect, svg.chart .tag text { stroke: none; }
svg.chart .tag text { font-size: 12px; font-weight: 500; fill: #fff; }
/* 캔들 위 작은 점과 사건 레인 */
svg.chart .sigband { stroke: none; }
svg.chart .sigband.m4 { fill: rgba(13, 71, 161, 0.14); } svg.chart .sigband.buy { fill: rgba(13, 71, 161, 0.08); } svg.chart .sigband.sell { fill: rgba(198, 40, 40, 0.10); }
svg.chart .mark.onbar circle { stroke: #fff; stroke-width: 1.5; }
svg.chart .trade.onbar polygon { stroke: #fff; stroke-width: 1.2; }
svg.chart .sdot { stroke: #fff; stroke-width: 1; }
svg.chart .sdot.m1 { fill: #8a95a3; } svg.chart .sdot.m2 { fill: #e58a00; } svg.chart .sdot.m3 { fill: #1b7f3b; } svg.chart .sdot.m4 { fill: #0d47a1; }
svg.chart .sdot.on { r: 5; stroke: #1d2229; }
svg.chart .mark circle { stroke: #fff; stroke-width: 1.5; }
svg.chart .mark text { font-size: 12px; font-weight: 600; fill: #fff; }
svg.chart .m1 circle { fill: #8a95a3; } svg.chart .m2 circle { fill: #e58a00; } svg.chart .m3 circle { fill: #1b7f3b; } svg.chart .m4 circle { fill: #0d47a1; }
svg.chart .mark.on circle { stroke: #1d2229; stroke-width: 2.5; }
svg.chart .trade polygon { stroke: #fff; stroke-width: 1; }
svg.chart .trade.buy polygon { fill: #0d47a1; }
svg.chart .trade.sell.stop polygon { fill: #c62828; } svg.chart .trade.sell.target polygon { fill: #1b7f3b; } svg.chart .trade.sell.time polygon { fill: #6b7380; }
svg.chart .trade.open polygon { fill: #7b3fb5; }
svg.chart .trade.on polygon { stroke: #1d2229; stroke-width: 2; }
svg.chart .llabel { font-size: 12px; font-weight: 500; }
svg.chart .llabel.m4, svg.chart .llabel.buy { font-weight: 600; }
svg.chart .llabel.m4 { fill: #0d47a1; } svg.chart .llabel.buy { fill: #0d47a1; }
svg.chart .llabel.sell.stop { fill: #c62828; } svg.chart .llabel.sell.target { fill: #1b7f3b; } svg.chart .llabel.sell.time { fill: #6b7380; } svg.chart .llabel.open { fill: #7b3fb5; }
/* 다음 봉 조건 */
svg.chart .ghost { stroke-width: 2; stroke-dasharray: 5 3; }
svg.chart .ghost.bull { stroke: #1b7f3b; fill: rgba(27, 127, 59, 0.12); } svg.chart .ghost.bear { stroke: #b26a00; fill: rgba(178, 106, 0, 0.12); }
/* RSI */
svg.chart .rsi { fill: none; stroke: #2d3748; stroke-width: 1.5; }
svg.chart .rsizone { fill: rgba(198, 40, 40, 0.07); }
svg.chart .rsi30 { stroke: #c62828; stroke-width: 1; stroke-dasharray: 3 3; }
svg.chart .rsidot { fill: #c62828; }
/* 마우스 */
svg.chart .hit { fill: transparent; }
svg.chart .xhair { stroke: #4a5568; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
svg.chart .nowline line { stroke: #1d2229; stroke-width: 1; stroke-dasharray: 2 2; }
svg.chart .nowline rect { fill: #1d2229; } svg.chart .nowline text { font-size: 12px; font-weight: 500; fill: #fff; }
.svgwrap { position: relative; }
.tip { position: absolute; top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 13px; line-height: 1.5; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); pointer-events: none; white-space: nowrap; z-index: 3; }
.tip b, .tip span { display: block; }
.tip .ev { font-weight: 500; color: #1d2229; margin-top: 2px; }
.tip b { font-weight: 600; } .tip .muted { font-weight: 350; }
.tip .ev4 { color: #0d47a1; } .tip .evbuy { color: #0d47a1; } .tip .evstop { color: #c62828; } .tip .evtarget { color: #1b7f3b; } .tip .evtime { color: #6b7380; } .tip .evhold { color: #7b3fb5; font-weight: 500; }
.tl li { cursor: default; border-radius: 4px; padding: 1px 4px; margin-left: -4px; }
.tl li.on { background: #fff3cd; }
td.q b { font-weight: 500; } td.q .muted { font-size: 11.5px; }
.qhead { font-size: 14px; margin-left: 4px; }
.qhead b { font-weight: 500; } .qhead .muted { font-size: 12.5px; }
.tl-wrap { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.tl { margin: 6px 0 10px; font-size: 14px; }
.tl > b { display: block; margin-bottom: 2px; }
.tl ol { margin: 0; padding-left: 22px; }
.tl li { margin: 3px 0; white-space: normal; line-height: 1.45; }
.tl li b { color: #1d2229; font-weight: 500; }
.tl > b { font-weight: 600; }
.tl li.muted, .tl li .muted { font-weight: 350; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin: 2px 0 6px; font-weight: 350; }
.legend .sw { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: #999; }
.legend i.dot { width: 12px; height: 12px; border-radius: 50%; }
.legend i.tri { width: 0; height: 0; background: transparent; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid #999; border-radius: 0; }
.legend i.tri.buy { border-bottom-color: #0d47a1; }
.legend i.tri.sellstop, .legend i.tri.selltarget, .legend i.tri.selltime { border-bottom: none; border-top: 10px solid #999; }
.legend i.tri.sellstop { border-top-color: #c62828; } .legend i.tri.selltarget { border-top-color: #1b7f3b; } .legend i.tri.selltime { border-top-color: #6b7380; }
.legend i.box { width: 14px; height: 10px; border: 2px dashed; background: transparent; border-radius: 2px; }
.legend i.m1 { background: #6b7380; } .legend i.m2 { background: #e58a00; } .legend i.m3 { background: #1b7f3b; } .legend i.m4 { background: #0d47a1; }
.legend i.bb { background: #2161be; } .legend i.ma5 { background: #e58a00; } .legend i.ma20 { background: #7b3fb5; } .legend i.ma60 { background: #3c8d6b; }
.legend i.stop { background: repeating-linear-gradient(90deg, #c62828 0 5px, transparent 5px 8px); } .legend i.entry { background: #0d47a1; } .legend i.target { background: repeating-linear-gradient(90deg, #1b7f3b 0 5px, transparent 5px 8px); }
.legend i.box.zone { border: none; background: linear-gradient(180deg, rgba(27,127,59,0.35) 0 50%, rgba(198,40,40,0.35) 50% 100%); width: 18px; height: 12px; }
.legend i.bull { border-color: #1b7f3b; } .legend i.bear { border-color: #b26a00; } .legend i.rsidot { background: #c62828; }
.cond { margin: 6px 0; padding: 8px 10px; background: #f3f8f3; border-radius: 6px; font-size: 14px; font-weight: 400; }
.cond b { font-weight: 500; }
.cond.sell { background: #fdf3f3; }
.cond ul { margin: 4px 0 0; padding-left: 18px; }
.chart-tools { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; }
.chart-tools .tf { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chart-tools .tf button { border: 0; border-right: 1px solid var(--line); background: #fff; padding: 4px 12px; cursor: pointer; font: inherit; font-size: 14px; color: var(--muted); }
.chart-tools .tf button:last-child { border-right: 0; }
.chart-tools .tf button.on { background: var(--text); color: #fff; }
.chart-tools .ind label { margin-left: 10px; cursor: pointer; color: var(--muted); }


/* 거래 장부 */
table.ledger td { vertical-align: top; }
table.ledger td.l { white-space: nowrap; }
table.ledger tr.total td { border-top: 2px solid var(--line); background: var(--bg); font-weight: 500; }

.top .logout { margin-left: 10px; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.top .logout:hover { color: var(--text); }
