:root {
  --ink: #10243d;
  --navy: #10243d;
  --cream: #f4f0e6;
  --paper: #fffdf8;
  --lime: #c9f06a;
  --orange: #ff7048;
  --sky: #bfe5ff;
  --gain: #ff6257;
  --loss: #5b9cff;
  --muted: #667180;
  --line: #d7d4ca;
  --shadow: 0 20px 60px rgba(13, 33, 55, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(16, 36, 61, 0.16);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -0.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--orange); font-size: 19px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.view-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid rgba(16,36,61,.2); border-radius: 999px; }
.view-tab { padding: 7px 12px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 850; }
.view-tab span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; border-radius: 999px; background: rgba(16,36,61,.1); font-size: 9px; }
.view-tab.active { color: white; background: var(--navy); }
.view-tab.active span { color: var(--navy); background: var(--lime); }
.demo-badge { padding: 7px 10px; border: 1px solid var(--ink); border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--paper); background: var(--navy); }

main { overflow: hidden; }
[data-view][hidden] { display: none !important; }
.hero { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 78px 0 54px; position: relative; }
.hero::after { content: "₩"; position: absolute; right: 2%; top: 18px; color: rgba(16, 36, 61, .05); font-family: Georgia, serif; font-size: 300px; font-weight: 900; line-height: 1; transform: rotate(8deg); pointer-events: none; }
.eyebrow { margin: 0 0 18px; color: var(--orange); font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.hero h1 { max-width: 800px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(54px, 8vw, 104px); font-weight: 500; line-height: .95; letter-spacing: -.065em; }
.hero h1 em { position: relative; color: var(--orange); font-weight: 500; }
.hero h1 em::after { content: ""; position: absolute; height: 9px; left: 0; right: 0; bottom: -8px; background: var(--lime); transform: rotate(-1.5deg); z-index: -1; }
.hero-copy { max-width: 510px; margin: 30px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }

.calculator-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto 110px; display: grid; grid-template-columns: .86fr 1.14fr; align-items: start; box-shadow: var(--shadow); background: var(--navy); }
.control-panel { align-self: start; padding: 42px; background: var(--paper); }
.result-panel { min-width: 0; padding: 42px; color: white; background: var(--navy); }
.result-error { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--orange); border-radius: 4px; background: rgba(255,112,72,.12); color: #ffcdbd; font-size: 13px; font-weight: 700; }
.calc-period-note { margin: 0 0 24px; color: #8292a1; font-size: 11px; font-weight: 700; }
.result-panel.is-empty > *:not(#resultError) { opacity: .25; pointer-events: none; filter: grayscale(1); }
.section-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 34px; }
.step { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 50%; background: var(--lime); color: var(--navy); font-size: 12px; font-weight: 900; }
.section-heading h2 { margin: -4px 0 5px; font-family: Georgia, serif; font-size: 30px; letter-spacing: -.04em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.field { display: grid; align-content: start; gap: 9px; margin-bottom: 19px; color: var(--muted); font-size: 12px; font-weight: 800; }
.field-wide { margin-bottom: 20px; }
.field-help { margin-top: -2px; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field input, .field select { width: 100%; height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: white; font-weight: 750; color-scheme: light; transition: border .2s, box-shadow .2s; }
.field select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(16, 36, 61, .1); }
.money-input { position: relative; width: 100%; height: 52px; }
.money-input input { display: block; height: 100%; padding-right: 43px; }
.money-input b { position: absolute; right: 15px; top: 50%; color: var(--muted); line-height: 1; transform: translateY(-50%); pointer-events: none; }
.primary-button { width: 100%; height: 58px; margin-top: 5px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 3px; color: white; background: var(--orange); font-weight: 900; box-shadow: 5px 5px 0 var(--navy); transition: transform .16s, box-shadow .16s; }
.primary-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--navy); }
.data-note { margin: 22px 0 0; padding-left: 12px; border-left: 3px solid var(--lime); color: var(--muted); font-size: 11px; line-height: 1.6; }
.condition-option { margin: 1px 0 20px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); background: rgba(191,229,255,.22); }
.condition-option strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; }
.condition-option div > span { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }

.result-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.result-label { display: block; margin-bottom: 8px; color: #aeb9c6; font-size: 12px; font-weight: 750; }
.result-topline strong { display: block; font-family: Georgia, serif; font-size: clamp(37px, 4vw, 54px); font-weight: 500; letter-spacing: -.05em; }
.return-pill { padding: 9px 12px; border-radius: 999px; color: white; background: var(--gain); font-weight: 900; font-size: 13px; white-space: nowrap; }
.return-pill.negative { color: white; background: var(--loss); }
.chart-card { border-top: 1px solid rgba(255,255,255,.16); border-bottom: 1px solid rgba(255,255,255,.16); padding: 20px 0 13px; }
.chart-head { display: flex; justify-content: space-between; gap: 15px; color: #d9e1e8; font-size: 12px; }
.legend { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 10px; color: #91a1b0; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-item i { width: 13px; height: 3px; background: var(--legend-color); }
#chart { width: 100%; height: 235px; overflow: visible; }
.range-analysis { margin-top: 22px; padding: 20px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.035); }
.range-analysis-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.range-analysis-head h3 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.range-analysis-head small, .range-analysis-note { color: #93a4b5; font-size: 11px; }
.range-analysis-kicker { color: #aeb9c6; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.range-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.range-card { position: relative; min-width: 0; padding: 17px 18px 16px; border-left: 4px solid; background: rgba(255,255,255,.055); }
.range-card-best { border-left-color: #ff6257; }
.range-card-worst { border-left-color: #5b9cff; }
.range-card-label { display: block; margin-bottom: 7px; color: #c6d0da; font-size: 12px; font-weight: 750; }
.range-card strong { display: block; font-family: Georgia, serif; font-size: clamp(25px, 3vw, 34px); font-weight: 500; }
.range-card-best strong { color: #ff746b; }
.range-card-worst strong { color: #78adff; }
.range-card p { margin: 9px 0 4px; color: #eef3f7; font-size: 12px; font-weight: 700; }
.range-card small { color: #93a4b5; font-size: 11px; }
.range-analysis-note { margin: 12px 0 0; line-height: 1.55; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; padding: 1px 0; border-bottom: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.12); }
.metric { min-width: 0; padding: 15px 13px 17px; display: grid; align-content: center; gap: 6px; white-space: nowrap; background: var(--navy); }
.metric span { display: block; color: #aeb9c6; font-size: 11px; font-weight: 750; line-height: 1.1; }
.metric b { display: block; overflow: visible; color: white; font-size: clamp(15px, 1.4vw, 18px); font-weight: 900; line-height: 1.25; letter-spacing: -.035em; }
.metric:nth-child(2) b { color: var(--gain); }
.metric:nth-child(2) b.negative { color: var(--loss); }
.tax-disclaimer { color: var(--muted); }
.comparison { display: flex; align-items: stretch; flex-direction: column; gap: 13px; padding-top: 16px; }
.comparison-summary { padding: 17px 19px; display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 7px 14px; border-left: 4px solid var(--lime); background: rgba(201,240,106,.08); }
.comparison-kicker { display: block; color: #b8c4cf; font-size: 12px; font-weight: 800; line-height: 1.6; }
.comparison strong { color: white; font-family: Georgia, serif; font-size: 25px; font-weight: 500; letter-spacing: -.03em; }
.comparison small { color: var(--loss); font-size: 12px; font-weight: 850; }
.comparison small.positive { color: var(--gain); }
.secondary-button { min-width: 96px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; color: white; background: transparent; font-size: 12px; font-weight: 800; }
.secondary-button:hover { color: var(--navy); background: white; }
.result-actions { display: flex; justify-content: flex-end; gap: 8px; }
.save-button { color: var(--navy); border-color: var(--lime); background: var(--lime); }
.candidate-result-button { border-color: var(--lime); }
.candidate-result-button:disabled { cursor: default; color: #a9b879; border-color: rgba(201,240,106,.35); background: rgba(201,240,106,.08); }

.workspace-section { width: min(1180px, calc(100% - 40px)); margin: -70px auto 100px; display: grid; grid-template-columns: 1fr; gap: 20px; }
.workspace-card { min-width: 0; padding: 34px; border: 1px solid var(--line); background: var(--paper); }
.workspace-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.workspace-kicker { color: #657384; font-size: 11px; font-weight: 950; letter-spacing: .14em; }
.workspace-heading h2 { margin: 7px 0 6px; font-family: Georgia, serif; font-size: 28px; letter-spacing: -.04em; }
.workspace-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.selection-count { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--navy); background: var(--lime); font-size: 11px; font-weight: 900; }
.etf-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.etf-chip { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; }
.etf-chip.selected { color: white; border-color: var(--navy); background: var(--navy); }
.compare-list { display: grid; gap: 14px; padding-top: 22px; }
.compare-row { display: grid; grid-template-columns: 145px 1fr 72px 78px; align-items: center; gap: 12px; }
.compare-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 850; }
.compare-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 600; }
.compare-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e3e0d7; }
.compare-bar { height: 100%; min-width: 3px; border-radius: inherit; background: #8a98a7; transition: width .35s ease; }
.compare-row.is-selected .compare-bar { background: var(--lime); }
.compare-return { text-align: right; font-size: 13px; font-weight: 900; }
.compare-return { color: var(--gain); }
.compare-return.negative { color: var(--loss); }
.add-candidate-button { padding: 8px 9px; border: 1px solid var(--navy); border-radius: 4px; color: var(--navy); background: transparent; font-size: 10px; font-weight: 900; white-space: nowrap; }
.add-candidate-button:hover { color: white; background: var(--navy); }
.add-candidate-button:disabled { cursor: default; color: #6a7b42; border-color: #b9d66f; background: rgba(201,240,106,.2); }
.candidate-save-row { margin-top: 23px; padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #b9d66f; background: rgba(201,240,106,.16); }
.candidate-save-row strong, .candidate-save-row span { display: block; }
.candidate-save-row strong { margin-bottom: 4px; font-size: 13px; }
.candidate-save-row span { color: var(--muted); font-size: 11px; }
.candidate-save-button, .tracker-refresh, .tracker-save { flex: 0 0 auto; padding: 11px 16px; border: 0; border-radius: 4px; color: white; background: var(--navy); font-size: 12px; font-weight: 900; }
.switch { position: relative; flex: 0 0 46px; width: 46px; height: 26px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #c8c8c3; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.22); transition: .2s; }
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(255,112,72,.25); }
.extreme-table-wrap { margin-top: 7px; padding-top: 25px; border-top: 1px solid var(--line); }
.comparison-workspace > .extreme-table-wrap { margin-top: 0; padding-top: 0; border-top: 0; }
.extreme-table-wrap.hidden { display: none; }
.table-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.table-title-row h3 { margin: 6px 0 0; font-family: Georgia, serif; font-size: 21px; }
.table-title-row small { color: var(--muted); font-size: 9px; }
.table-scroll { overflow-x: visible; }
.extreme-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.extreme-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: right; font-size: 11px; font-weight: 800; }
.extreme-table th:nth-child(1) { width: 10%; }
.extreme-table th:nth-child(2) { width: 20%; }
.extreme-table th:nth-child(3), .extreme-table th:nth-child(4) { width: 14%; }
.extreme-table th:nth-child(5) { width: 10%; }
.extreme-table th:nth-child(6) { width: 22%; }
.extreme-table th:nth-child(7) { width: 10%; }
.table-candidate-button { width: 100%; padding: 7px 3px; border: 1px solid var(--navy); border-radius: 4px; color: var(--navy); background: transparent; font-size: 9px; font-weight: 900; white-space: normal; }
.extreme-table td:last-child { padding-left: 4px; padding-right: 4px; white-space: normal; }
.table-candidate-button:hover { color: white; background: var(--navy); }
.table-candidate-button:disabled { cursor: default; color: #6a7b42; border-color: #b9d66f; background: rgba(201,240,106,.2); }
.extreme-table th:first-child, .extreme-table th:nth-child(2), .extreme-table td:first-child, .extreme-table td:nth-child(2) { text-align: left; }
.extreme-table td { padding: 13px 8px; border-bottom: 1px solid var(--line); text-align: right; font-weight: 700; white-space: nowrap; }
.extreme-table tbody tr:last-child td { border-bottom: 0; }
.extreme-table tbody tr.is-user { background: rgba(201,240,106,.25); box-shadow: inset 4px 0 0 var(--lime); }
.extreme-table tbody tr.is-user td:first-child { color: #5f781f; }
.extreme-table tbody tr.is-best td:first-child { color: var(--gain); }
.extreme-table tbody tr.is-worst td:first-child { color: var(--loss); }
.row-role { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; }
.row-role::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.delta-positive { color: var(--gain); }
.delta-negative { color: var(--loss); }
.value-positive { color: var(--gain); }
.value-negative { color: var(--loss); }
.universe-note { margin: 12px 0 0; color: var(--muted); font-size: 9px; }
.text-button { padding: 5px 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; text-decoration: underline; }
.saved-list { display: grid; gap: 10px; max-height: 355px; overflow: auto; }
.empty-state { padding: 32px 18px; border: 1px dashed var(--line); color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }
.saved-item { display: grid; grid-template-columns: 1fr auto; gap: 15px; padding: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.35); cursor: pointer; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.saved-item:hover, .saved-item:focus-visible { border-color: var(--orange); background: rgba(255,255,255,.7); transform: translateY(-2px); outline: none; }
.saved-item.expanded { border-color: var(--orange); transform: none; }
.saved-item h3 { margin: 0 0 6px; font-size: 13px; }
.saved-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.saved-item strong { display: block; margin-top: 8px; font-family: Georgia, serif; font-size: 20px; }
.saved-item strong { color: var(--gain); }
.saved-item strong.negative { color: var(--loss); }
.saved-controls { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.saved-controls button { padding: 3px; border: 0; color: var(--muted); background: none; font-size: 10px; }
.load-saved { color: var(--orange) !important; font-weight: 900; }
.share-saved { color: var(--navy) !important; font-weight: 800; }
.share-link-button { border-color: var(--orange); color: var(--orange); }
.saved-detail-wrap { grid-column: 1 / -1; }
.record-detail-card { margin-top: 8px; padding: 24px; color: white; background: var(--navy); cursor: default; }
.record-detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.record-detail-top span, .record-period { color: #aebdcc; font-size: 10px; }
.record-detail-top strong { display: block; margin-top: 7px; color: white; font-family: Georgia, serif; font-size: clamp(28px, 4vw, 42px); font-weight: 500; }
.record-detail-top b { padding: 8px 12px; border-radius: 999px; color: white; background: var(--gain); font-size: 13px; }
.record-detail-top b.negative { background: var(--loss); }
.record-period { margin: 13px 0 18px; }
.record-detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.18); border-bottom: 1px solid rgba(255,255,255,.18); }
.record-detail-metrics span { padding: 13px 12px; color: #aebdcc; font-size: 9px; border-right: 1px solid rgba(255,255,255,.14); }
.record-detail-metrics span:last-child { border-right: 0; }
.record-detail-metrics b { display: block; margin-top: 5px; color: white; font-size: 13px; }
.record-detail-metrics b.negative { color: #76a9ff; }
.record-sparkline { display: block; width: 100%; height: 100px; margin: 18px 0 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.record-detail-actions { display: flex; justify-content: flex-end; gap: 8px; }
.record-detail-actions button { padding: 8px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; color: white; background: transparent; font-size: 10px; font-weight: 800; }
.record-detail-actions button:first-child { border-color: var(--lime); color: var(--navy); background: var(--lime); }
.record-detail-error { padding: 18px; color: var(--loss); background: rgba(255,98,87,.08); }

.saved-workspace.hidden { display: none; }
.tracker-section { min-height: calc(100vh - 78px); padding: 72px max(20px, calc((100vw - 1180px) / 2)) 100px; background: var(--cream); }
.tracker-section[hidden] { display: none; }
.tracker-hero { position: relative; padding: 50px; color: white; background: var(--navy); overflow: hidden; }
.tracker-hero::after { content: "↗"; position: absolute; right: 5%; top: -40px; color: rgba(201,240,106,.1); font-size: 230px; font-weight: 900; }
.tracker-hero .workspace-kicker { color: var(--lime); }
.tracker-hero h1 { position: relative; z-index: 1; max-width: 720px; margin: 14px 0 18px; font-family: Georgia, serif; font-size: clamp(42px, 6vw, 72px); font-weight: 500; line-height: .98; letter-spacing: -.055em; }
.tracker-hero h1 em { color: var(--lime); font-weight: 500; }
.tracker-hero p { position: relative; z-index: 1; max-width: 650px; margin: 0 0 25px; color: #b9c5d0; font-size: 15px; line-height: 1.7; }
.tracker-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; }
.tracker-refresh { color: var(--navy); background: var(--lime); }
.tracker-save { color: white; border: 1px solid rgba(255,255,255,.45); background: transparent; }
.tracker-content { padding-top: 42px; }
.tracker-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.tracker-heading h2 { margin: 7px 0 0; font-family: Georgia, serif; font-size: 32px; }
.tracker-heading small { color: var(--muted); font-size: 11px; }
.compound-section { min-height: calc(100vh - 78px); padding: 72px max(20px, calc((100vw - 1180px) / 2)) 100px; background: var(--cream); }
.compound-section[hidden] { display: none; }
.compound-hero { position: relative; padding: 50px; overflow: hidden; color: white; background: var(--navy); }
.compound-hero::after { content: "%"; position: absolute; right: 5%; top: -58px; color: rgba(201,240,106,.09); font-family: Georgia, serif; font-size: 260px; line-height: 1; }
.compound-hero .workspace-kicker { color: var(--lime); }
.compound-hero h1 { position: relative; z-index: 1; margin: 14px 0 18px; font-family: Georgia, serif; font-size: clamp(42px, 6vw, 72px); font-weight: 500; line-height: .98; letter-spacing: -.055em; }
.compound-hero h1 em { color: var(--lime); font-weight: 500; }
.compound-hero p { position: relative; z-index: 1; max-width: 680px; margin: 0; color: #b9c5d0; font-size: 15px; line-height: 1.7; }
.compound-shell { display: grid; grid-template-columns: .78fr 1.22fr; align-items: stretch; margin-top: 24px; box-shadow: var(--shadow); }
.compound-controls { padding: 38px; background: var(--paper); }
.compound-controls .field:last-of-type { margin-bottom: 0; }
.compound-disclaimer { margin: 22px 0 0; padding: 13px 14px; border-left: 3px solid var(--lime); color: var(--muted); background: rgba(191,229,255,.18); font-size: 10px; line-height: 1.65; }
.compound-result { min-width: 0; padding: 38px; color: white; background: var(--navy); }
.compound-result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.16); }
.compound-result-top span { display: block; margin-bottom: 8px; color: #aeb9c6; font-size: 12px; font-weight: 750; }
.compound-result-top strong { display: block; font-family: Georgia, serif; font-size: clamp(36px, 5vw, 58px); font-weight: 500; letter-spacing: -.05em; }
.compound-result-top > b { padding: 9px 12px; border-radius: 999px; color: var(--navy); background: var(--lime); font-size: 12px; white-space: nowrap; }
.compound-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid rgba(255,255,255,.16); }
.compound-metrics div { min-width: 0; padding: 18px 15px; border-right: 1px solid rgba(255,255,255,.13); }
.compound-metrics div:last-child { border-right: 0; }
.compound-metrics span { display: block; margin-bottom: 6px; color: #aeb9c6; font-size: 11px; }
.compound-metrics strong { display: block; overflow-wrap: anywhere; font-size: 17px; }
.compound-metrics div:nth-child(2) strong { color: var(--gain); }
.compound-chart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 25px 0 16px; }
.compound-chart-head .workspace-kicker { color: var(--lime); }
.compound-chart-head h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.compound-chart-head small { color: #93a4b5; font-size: 10px; }
.compound-chart { height: 260px; display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding: 10px 2px 3px; }
.compound-year { flex: 1 0 40px; min-width: 40px; display: grid; grid-template-rows: 1fr auto; gap: 8px; text-align: center; }
.compound-bars { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 190px; border-bottom: 1px solid rgba(255,255,255,.18); }
.compound-bar { width: min(30px, 72%); min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(to top, #c9f06a var(--principal-share), #ff6257 var(--principal-share)); transition: height .25s ease; }
.compound-year b { color: #aeb9c6; font-size: 9px; font-weight: 700; white-space: nowrap; }
.compound-year:hover .compound-bar { filter: brightness(1.12); }
.compound-table-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 28px 0 12px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.16); }
.compound-table-head .workspace-kicker { color: var(--lime); }
.compound-table-head h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.compound-table-head small { color: #93a4b5; font-size: 10px; }
.compound-table-wrap { max-height: 390px; overflow: auto; border: 1px solid rgba(255,255,255,.14); }
.compound-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.compound-table th { position: sticky; top: 0; z-index: 1; padding: 11px 13px; color: #aeb9c6; background: #10243d; border-bottom: 1px solid rgba(255,255,255,.2); text-align: right; font-size: 10px; }
.compound-table td { padding: 11px 13px; border-bottom: 1px solid rgba(255,255,255,.09); text-align: right; white-space: nowrap; }
.compound-table th:first-child, .compound-table td:first-child { text-align: left; }
.compound-table tbody tr:last-child td { border-bottom: 0; }
.compound-table tbody tr:hover { background: rgba(255,255,255,.055); }
.compound-table .compound-table-profit { color: var(--gain); font-weight: 800; }
.compound-table .compound-table-profit.negative { color: var(--loss); }
.compound-table td:last-child { color: var(--lime); font-weight: 850; }
.watchlist-grid { display: grid; gap: 18px; }
.watchlist-empty { padding: 54px 25px; border: 1px dashed var(--line); background: var(--paper); text-align: center; }
.watchlist-empty strong { display: block; margin-bottom: 8px; font-family: Georgia, serif; font-size: 24px; }
.watchlist-empty p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.watchlist-card { padding: 28px; border: 1px solid var(--line); background: var(--paper); }
.watchlist-card-head { display: flex; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.watchlist-card-head h3 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 24px; }
.watchlist-card-head p { margin: 0; color: var(--muted); font-size: 11px; }
.watchlist-card-head button { padding: 5px; border: 0; color: var(--muted); background: none; font-size: 11px; text-decoration: underline; }

.sector-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sector-filter-btn, .ticker-filter-btn { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 12px; cursor: pointer; }
.sector-filter-btn.active, .ticker-filter-btn.active { border-color: var(--navy); background: var(--navy); color: white; }
.ticker-filter-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 10px; }
.ticker-filter-group { display: flex; gap: 6px; }
.sector-item-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sector-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; background: var(--paper); }
.sector-item-name { font-size: 14px; }
.sector-item-code { margin-left: 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sector-item-tags { display: flex; align-items: center; gap: 10px; }
.sector-item-sector { color: var(--muted); font-size: 11px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; }
.sector-item-market { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tracking-table-wrap { overflow-x: auto; }
.candidate-row { cursor: pointer; transition: background .18s ease; }
.candidate-row:hover, .candidate-row:focus-visible { background: rgba(201,240,106,.14); outline: none; }
.row-open-hint { display: inline-block; margin-left: 10px; color: var(--orange); font-size: 9px; font-weight: 900; white-space: nowrap; }
.candidate-detail-row td { padding: 0 12px 18px !important; background: var(--paper); }
.candidate-detail-row .record-detail-card { margin-top: 0; }
.tracking-table { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.tracking-table th, .tracking-table td { padding: 12px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tracking-table th { color: var(--muted); font-size: 10px; }
.tracking-table th:first-child, .tracking-table td:first-child { width: 32%; text-align: left; }
.tracking-table tbody tr:last-child td { border-bottom: 0; }
.tracking-table small { color: var(--muted); }
.tracking-up { color: var(--gain); font-weight: 900; }
.tracking-down { color: var(--loss); font-weight: 900; }
.tracking-flat { color: var(--muted); font-weight: 850; }
.watchlist-foot { margin-top: 15px; padding-top: 14px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.explain-section { padding: 85px max(20px, calc((100vw - 1180px) / 2)) 95px; border-top: 1px solid var(--line); background: var(--cream); }
.light-heading { margin-bottom: 40px; }
.explain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.explain-grid article { min-height: 190px; padding: 28px; border: 1px solid var(--line); background: var(--paper); }
.explain-grid article > span { display: inline-block; color: var(--orange); font-family: Georgia, serif; font-size: 20px; }
.explain-grid h3 { margin: 22px 0 10px; font-family: Georgia, serif; font-size: 23px; }
.explain-grid p { margin: 0; color: #526173; line-height: 1.7; font-size: 14px; }
footer { padding: 34px 20px; display: flex; justify-content: space-between; gap: 30px; color: #dce2e8; background: #09192a; font-size: 12px; }
footer strong { font-size: 14px; }
footer p { margin: 0; color: #8493a2; text-align: right; }

body.dark { --cream: #0c1c2d; --paper: #132a42; --ink: #f1f0ea; --muted: #abb8c5; --line: #36506a; }
body.dark .control-panel, body.dark .field input, body.dark .field select { color: #f5f2e8; background: #132a42; }
body.dark .primary-button { box-shadow: 5px 5px 0 var(--lime); }
body.dark .hero::after { color: rgba(255,255,255,.035); }
body.dark .topbar { border-bottom-color: rgba(255,255,255,.16); }
body.dark .saved-item { background: rgba(255,255,255,.03); }
body.dark .compare-track { background: #31465a; }

@media (max-width: 900px) {
  .hero { padding-top: 56px; }
  .calculator-shell { grid-template-columns: 1fr; }
  .workspace-section { grid-template-columns: 1fr; }
  .result-panel { min-height: 650px; }
  .explain-grid { grid-template-columns: 1fr; }
  .compound-shell { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar, .hero, .calculator-shell { width: min(100% - 24px, 1180px); }
  .topbar { height: 68px; }
  .demo-badge { display: none; }
  .view-tab { padding: 7px 9px; }
  .view-tabs { max-width: calc(100vw - 92px); overflow-x: auto; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 51px; }
  .hero-copy { font-size: 15px; }
  .control-panel, .result-panel { padding: 29px 21px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .result-topline { align-items: center; }
  .result-topline strong { font-size: 36px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .comparison-summary { grid-template-columns: 1fr; }
  .chart-head { align-items: flex-start; flex-direction: column; }
  .range-analysis-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .range-cards { grid-template-columns: 1fr; }
  .legend { justify-content: flex-start; }
  .result-actions, .secondary-button { width: 100%; }
  .compare-row { grid-template-columns: 1fr 62px 76px; gap: 9px; }
  .compare-name { grid-column: 1 / -1; }
  .workspace-section { width: min(100% - 24px, 1180px); margin-top: -75px; }
  .workspace-card { padding: 25px 20px; }
  .candidate-save-row { align-items: stretch; flex-direction: column; }
  .candidate-save-button { width: 100%; }
  .tracker-section { padding: 30px 12px 70px; }
  .compound-section { padding: 30px 12px 70px; }
  .compound-hero { padding: 34px 23px; }
  .compound-controls, .compound-result { padding: 27px 21px; }
  .compound-result-top, .compound-chart-head { align-items: flex-start; flex-direction: column; }
  .compound-table-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .compound-metrics { grid-template-columns: 1fr; }
  .compound-metrics div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.13); }
  .tracker-hero { padding: 34px 23px; }
  .watchlist-card { padding: 22px 18px; }
  .record-detail-card { padding: 19px 15px; }
  .record-detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .record-detail-metrics span:nth-child(2) { border-right: 0; }
  .table-scroll { overflow-x: auto; }
  .extreme-table { min-width: 680px; }
  .explain-section { padding-top: 65px; padding-bottom: 70px; }
  footer { flex-direction: column; }
  footer p { text-align: left; line-height: 1.6; }
}
