:root {
  --bg: #0b0f19;
  --surface: #121826;
  --surface-2: #1a2235;
  --border: #253047;
  --text: #eef2ff;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 64px; }

/* Header */
header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff;
}
.brand h1 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.brand p { font-size: 12px; color: var(--muted); }
.meta-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.pill.live { color: var(--green); border-color: rgba(16,185,129,0.35); background: var(--green-soft); }

/* Navigation Tabs (Multi-page Links) */
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--surface); padding: 6px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 22px;
}
.tab-btn {
  display: block; text-align: center; text-decoration: none;
  background: transparent; color: var(--muted);
  padding: 11px 10px; border-radius: 9px; font-size: 14px; font-weight: 700;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent); color: #fff; }

/* Cards & Grids */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Hero Regime */
.regime-banner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 16px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.regime-banner.bull { border-color: rgba(16,185,129,0.45); background: linear-gradient(135deg, rgba(16,185,129,0.12), var(--surface)); }
.regime-banner.bear { border-color: rgba(239,68,68,0.45); background: linear-gradient(135deg, rgba(239,68,68,0.12), var(--surface)); }
.regime-status { font-size: 22px; font-weight: 800; margin-top: 4px; }
.regime-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.price-pair { display: flex; gap: 18px; flex-wrap: wrap; }
.price-box .lbl { font-size: 12px; color: var(--muted); }
.price-box .val { font-size: 22px; font-weight: 800; }
.up { color: var(--green); }
.down { color: var(--red); }
.warn { color: var(--amber); }

/* Stat mini card */
.kpi {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.kpi .k-lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi .k-val { font-size: 20px; font-weight: 800; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; margin-left: 4px;
}
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.danger { background: var(--red-soft); color: var(--red); }
.tag.caution { background: var(--amber-soft); color: var(--amber); }

/* Chart */
.chart-box { width: 100%; overflow: hidden; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* Briefing */
.brief-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.brief-list li {
  background: var(--surface-2); border-left: 3px solid var(--accent);
  padding: 12px 14px; border-radius: 8px; font-size: 14px;
}

/* Calculator Controls */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.preset-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.preset-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.ctrl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ctrl-item label {
  display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
.ctrl-item label strong { color: var(--text); font-size: 14px; }
input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; height: 6px; }
.tax-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.tax-opt {
  display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer;
  background: var(--surface-2); padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border);
}
.tax-opt input { accent-color: var(--accent); }

/* Bar Chart */
.bars-wrap {
  display: flex; align-items: flex-end; gap: 6px; height: 190px;
  padding: 16px 8px 6px; background: var(--surface-2); border-radius: 12px; margin-bottom: 16px;
}
.bar-col {
  flex: 1; height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; gap: 4px; min-width: 0;
}
.bar-stack {
  width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse;
  border-radius: 5px 5px 0 0; overflow: hidden;
}
.seg-prin { background: #475569; }
.seg-gain { background: #3b82f6; }
.seg-tax  { background: #ef4444; opacity: 0.85; }
.bar-lbl { font-size: 10px; color: var(--muted); }

/* Table */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr.milestone td { background: rgba(59, 130, 246, 0.08); font-weight: 700; }

/* Buttons & CTA */
.btn-primary {
  display: inline-block; text-decoration: none;
  background: var(--accent); color: #fff; border: none; padding: 10px 16px;
  border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  display: inline-block; text-decoration: none;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
}
.btn-ghost:hover { border-color: var(--accent); }
.copy-msg { font-size: 12px; color: var(--green); margin-left: 10px; }

.cta-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 16px;
}
.cta-box p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Report & Policy */
.report-card h2, .report-card h3 { font-size: 16px; margin-bottom: 8px; color: #fff; }
.report-card p, .report-card li { font-size: 14px; color: #cbd5e1; margin-bottom: 10px; }
.report-card ul { padding-left: 18px; margin-bottom: 10px; }
.report-metric { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.report-metric span {
  font-size: 12px; background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 8px; color: var(--text);
}

footer {
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); text-align: center;
}
.footer-links {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-bottom: 10px;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 768px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .ctrl-grid { grid-template-columns: 1fr; }
  .tab-btn { font-size: 12px; padding: 10px 6px; }
  .regime-status { font-size: 18px; }
}
