/* ==========================================================================
   공모레이더 (IPORadar) Design System
   Mobile-First Financial Dashboard · Korean Stock Market Semantics (Red=Up)
   ========================================================================== */

:root {
  --bg: #f4f6fa;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef2f7;
  --bg-hover: #f8fafc;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --brand: #2563eb;
  --brand-soft: rgba(37, 99, 235, 0.1);
  --brand-dark: #1d4ed8;

  /* 한국 증시 표준: 상승=레드, 하락=블루 */
  --up: #e11d48;
  --up-soft: rgba(225, 29, 72, 0.1);
  --down: #2563eb;
  --down-soft: rgba(37, 99, 235, 0.1);

  --good: #059669;
  --good-soft: rgba(5, 150, 105, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.13);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, 0.11);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.07);
  --max-width: 1180px;
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-elevated: #121826;
  --bg-subtle: #1a2234;
  --bg-hover: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #232f46;
  --border-strong: #334155;

  --brand: #3b82f6;
  --brand-soft: rgba(59, 130, 246, 0.18);
  --brand-dark: #60a5fa;

  --up: #fb7185;
  --up-soft: rgba(251, 113, 133, 0.16);
  --down: #60a5fa;
  --down-soft: rgba(96, 165, 250, 0.16);

  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.16);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.16);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.16);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.18);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Top Ticker Strip ---------- */
.ticker-bar {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 7px 16px;
  scrollbar-width: none;
}
.ticker-inner::-webkit-scrollbar { display: none; }

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}
.ticker-item strong { color: #ffffff; font-weight: 700; }
.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28);
}
.ticker-up { color: #fb7185; font-weight: 700; }
.ticker-down { color: #60a5fa; font-weight: 700; }

/* ---------- Header & Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb 0%, #e11d48 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 6px;
  border-radius: 5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-subtle);
}

.bookmark-pill {
  background: var(--up-soft);
  color: var(--up);
  border-color: transparent;
}

/* ---------- Main Layout ---------- */
main {
  flex: 1;
  padding: 20px 0 48px;
}

.section {
  margin-bottom: 24px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-desc {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Cards & Grids ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 18px 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.kpi-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.kpi-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Action Board (Today's Urgent IPOs) ---------- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.action-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}
.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}
.action-card.urgent {
  border-color: color-mix(in srgb, var(--up) 45%, var(--border));
}

.action-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.action-name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.action-sector {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.action-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: 10px;
  font-size: 12.5px;
}
.metric-k { color: var(--text-muted); display: block; font-size: 11.5px; }
.metric-v { font-weight: 700; font-size: 13.5px; }

.action-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
}

/* ---------- Badges & Grades ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-hot { background: var(--up); color: #fff; }
.badge-live { background: var(--up-soft); color: var(--up); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-info { background: var(--brand-soft); color: var(--brand); }
.badge-upcoming { background: var(--bg-subtle); color: var(--text-secondary); }
.badge-muted { background: var(--bg-subtle); color: var(--text-muted); }
.badge-market {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.grade-s { background: var(--up-soft); color: var(--up); }
.grade-a { background: var(--good-soft); color: var(--good); }
.grade-b { background: var(--warn-soft); color: var(--warn); }
.grade-c { background: var(--bad-soft); color: var(--bad); }
.grade-spac { background: var(--brand-soft); color: var(--brand); }
.grade-wait { background: var(--bg-subtle); color: var(--text-muted); }

/* ---------- My Broker Filter (Sticky Habit Feature) ---------- */
.broker-filter-box {
  padding: 14px 16px;
}
.broker-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.broker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.broker-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.broker-chip:hover {
  border-color: var(--brand);
  color: var(--text);
}
.broker-chip.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}
.broker-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  margin: 1px 2px 1px 0;
}
.broker-tag.mine {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent);
}

/* ---------- Controls & Tabs ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { background: var(--bg-subtle); color: var(--text); }
.tab-btn.active {
  background: var(--text);
  color: var(--bg-elevated);
}

.search-input {
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  min-width: 210px;
  font-size: 13.5px;
}
.search-input:focus {
  outline: 2px solid var(--brand-soft);
  border-color: var(--brand);
}

/* ---------- Data Table (Kimpga-grade Scannability) ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ipo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.ipo-table th {
  text-align: left;
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ipo-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ipo-table tbody tr {
  transition: background 0.12s;
}
.ipo-table tbody tr:hover {
  background: var(--bg-hover);
}
.ipo-table tbody tr:last-child td {
  border-bottom: none;
}

.ipo-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.star-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--border-strong);
  transition: transform 0.12s, color 0.12s;
}
.star-btn:hover { transform: scale(1.15); }
.star-btn.starred { color: #f59e0b; }

.ipo-title-link {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text);
  display: block;
}
.ipo-title-link:hover { color: var(--brand); text-decoration: underline; }
.ipo-table td.num {
  white-space: nowrap;
}
.ipo-sub-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  white-space: nowrap;
}

.text-right { text-align: right; }
.text-up { color: var(--up); font-weight: 700; }
.text-down { color: var(--down); font-weight: 700; }
.text-good { color: var(--good); font-weight: 700; }
.text-warn { color: var(--warn); font-weight: 700; }
.text-bad { color: var(--bad); font-weight: 700; }
.text-muted { color: var(--text-muted); }

/* ---------- Detail Page & Checklist Signals ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a:hover { color: var(--brand); }

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.detail-title {
  margin: 6px 0 4px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.signal-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.signal-card.good { border-left: 4px solid var(--good); }
.signal-card.warn { border-left: 4px solid var(--warn); }
.signal-card.bad { border-left: 4px solid var(--bad); }
.signal-card.wait { border-left: 4px solid var(--border-strong); }

.signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}
.signal-val {
  font-size: 18px;
  font-weight: 800;
  margin: 4px 0 3px;
}
.signal-note {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Timeline Strip ---------- */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.timeline-step {
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.timeline-step.active {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.timeline-label { font-size: 11.5px; color: var(--text-muted); font-weight: 700; }
.timeline-date { font-size: 14.5px; font-weight: 800; margin-top: 3px; }

/* ---------- Calculator Widget ---------- */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.field input, .field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 700;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--brand-soft);
  border-color: var(--brand);
}
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.quick-chip {
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.quick-chip:hover { border-color: var(--brand); color: var(--brand); }

.calc-result-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-subtle);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.calc-res-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.calc-res-val { font-size: 19px; font-weight: 900; margin-top: 2px; }

/* ---------- Ttatteul Price Table ---------- */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.price-table th, .price-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}
.price-table th {
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
  background: var(--bg-subtle);
}
.price-table tr.row-max {
  background: var(--up-soft);
  font-weight: 800;
}
.price-table tr.row-down td:nth-child(2),
.price-table tr.row-down td:nth-child(3) { color: var(--down); }
.price-table tr.row-up td:nth-child(2),
.price-table tr.row-up td:nth-child(3),
.price-table tr.row-up-strong td:nth-child(2),
.price-table tr.row-up-strong td:nth-child(3),
.price-table tr.row-max td:nth-child(2),
.price-table tr.row-max td:nth-child(3) { color: var(--up); }

/* ---------- Calendar Grid ---------- */
.cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-legend {
  display: flex;
  gap: 12px;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 4px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cal-dow {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.cal-cell {
  min-height: 106px;
  padding: 6px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.other-month { opacity: 0.42; }
.cal-cell.today { background: var(--brand-soft); }
.cal-day-num {
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}
.cal-ev {
  display: block;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev.sub { background: var(--up-soft); color: var(--up); }
.cal-ev.refund { background: var(--warn-soft); color: var(--warn); }
.cal-ev.list { background: var(--purple-soft); color: var(--purple); }
.cal-ev.demand { background: var(--bg-subtle); color: var(--text-secondary); }

/* ---------- AdSense CLS-Safe Slots & Affiliate Banner ---------- */
.ad-slot {
  width: 100%;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-slot-placeholder {
  width: 100%;
  min-height: 92px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-subtle),
    var(--bg-subtle) 10px,
    var(--bg-elevated) 10px,
    var(--bg-elevated) 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
  padding: 12px;
}
.ad-slot-label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.7;
}

.affiliate-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--bg-elevated)), var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border));
  flex-wrap: wrap;
}

/* ---------- FAQ Accordion (SEO Rich Snippet) ---------- */
.faq-list {
  display: grid;
  gap: 10px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.faq-item summary {
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 600;
}
.faq-item[open] summary::after { content: '−'; }
.faq-body {
  padding: 0 18px 15px;
  font-size: 14px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 28px 0 36px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--brand); }
.disclaimer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .header-inner { height: 56px; }
  .brand-sub { display: none; }
  .action-grid { grid-template-columns: 1fr; }
  .signal-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-result-box { grid-template-columns: 1fr; }
  .detail-title { font-size: 22px; }
  .cal-cell { min-height: 76px; padding: 4px; }
  .cal-ev { font-size: 10px; padding: 2px 4px; }
  .hide-sm { display: none; }
}
