/* finance.koreacharts.com — Tone A (모던 핀테크 클린) Consolidated Production Stylesheet */
:root {
  color-scheme: light;
  --font-sans: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  --bg-canvas: #f3f6fb;
  --bg-surface: #ffffff;
  --bg-subtle: #eef2f8;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #dce3ee;
  --border-subtle: #e7edf5;

  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-contrast: #ffffff;
  --accent-soft: #e0ebff;

  --color-up: #dc2626;
  --up-soft: #fee2e2;
  --color-down: #2563eb;
  --down-soft: #dbeafe;
  --color-ok: #047857;
  --ok-soft: #d1fae5;
  --color-warn: #b45309;
  --warn-soft: #fef3c7;

  --header-bg: rgba(255, 255, 255, 0.92);
  --header-fg: #0f172a;
  --header-muted: #475569;
  --header-border: #dce3ee;
  --header-hover: #eef2f8;
  --header-active-bg: #e0ebff;
  --header-input-bg: #f8fafc;
  --header-input-border: #cbd5e1;

  --brand-mark-bg: linear-gradient(135deg, #1d4ed8, #2563eb);
  --brand-mark-fg: #ffffff;

  --ad-bg: #f8fafc;

  --chart-bar: #2563eb;
  --chart-bar-hover: #1d4ed8;
  --chart-muted: #94a3b8;
  --chart-grid: #e2e8f0;
  --chart-text: #475569;
  --chart-radius: 8;

  --container-max: 1180px;
  --radius-card: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 18px rgba(15, 23, 42, 0.045);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #0b1120;
  --bg-surface: #131c31;
  --bg-subtle: #1a2640;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #26344f;
  --border-subtle: #1e2a42;

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-contrast: #0b1120;
  --accent-soft: #1e3a5f;

  --color-up: #f87171;
  --up-soft: #450a0a;
  --color-down: #60a5fa;
  --down-soft: #172554;
  --color-ok: #34d399;
  --ok-soft: #064e3b;
  --color-warn: #fbbf24;
  --warn-soft: #451a03;

  --header-bg: rgba(19, 28, 49, 0.92);
  --header-fg: #f1f5f9;
  --header-muted: #94a3b8;
  --header-border: #26344f;
  --header-hover: #1e293b;
  --header-active-bg: #1e3a5f;
  --header-input-bg: #0f172a;
  --header-input-border: #334155;

  --brand-mark-bg: linear-gradient(135deg, #3b82f6, #60a5fa);
  --brand-mark-fg: #0b1120;

  --ad-bg: #0f172a;

  --chart-bar: #60a5fa;
  --chart-bar-hover: #93c5fd;
  --chart-muted: #64748b;
  --chart-grid: #1e293b;
  --chart-text: #cbd5e1;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, h4, p, dl, dd, dt, ul, ol { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.number, .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.is-up { color: var(--color-up) !important; }
.is-down { color: var(--color-down) !important; }
.is-flat { color: var(--text-muted) !important; }
.is-ok { color: var(--color-ok) !important; }
.is-warn { color: var(--color-warn) !important; }

/* ===================== HEADER & NAVIGATION ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  color: var(--header-fg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  font-weight: 800;
  font-size: clamp(14px, 3.6vw, 16px);
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark svg {
  width: 28px;
  height: 28px;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.nav-link {
  color: var(--header-muted);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--header-fg);
  background: var(--header-hover);
  text-decoration: none;
}
.nav-link.is-active {
  color: var(--accent);
  background: var(--header-active-bg);
}

.search-wrap {
  position: relative;
  width: min(300px, 100%);
  flex: 0 1 300px;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--header-input-border);
  background: var(--header-input-bg);
  color: var(--header-fg);
  font-size: 13.5px;
}
.search-input::placeholder { color: var(--header-muted); }
.search-input:focus { outline: none; border-color: var(--accent); }

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--header-muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: min(280px, 100%);
  max-height: min(360px, 55vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  padding: 6px;
  z-index: 60;
}

.search-result-item {
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: inherit;
  text-decoration: none;
}
.search-result-item:hover,
.search-result-item.is-highlighted {
  background: var(--bg-subtle);
  text-decoration: none;
}
.search-result-item.is-highlighted {
  outline: 1.5px solid var(--accent);
}
.sr-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.sr-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}
.sr-right {
  text-align: right;
  flex-shrink: 0;
}
.sr-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.sr-rate {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.search-empty {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--header-input-border);
  background: var(--header-input-bg);
  color: var(--header-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover {
  background: var(--header-hover);
  border-color: var(--accent);
  color: var(--accent);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:root[data-theme="dark"] .icon-moon { display: none; }
:root:not([data-theme="dark"]) .icon-sun { display: none; }
.menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.menu-btn:not([aria-expanded="true"]) .icon-close { display: none; }
.search-toggle-btn[aria-expanded="true"] .icon-search { display: none; }
.search-toggle-btn:not([aria-expanded="true"]) .icon-close { display: none; }

.menu-btn,
.search-toggle-btn {
  display: none;
}

.mobile-nav {
  border-top: 1px solid var(--header-border);
  padding: 10px 16px 14px;
  display: grid;
  gap: 4px;
  background: var(--header-bg);
}
.mobile-nav .nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 14.5px;
}

/* ===================== MAIN SHELL & COMMON CARDS ===================== */
.page-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 20px 16px 52px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  min-width: 0;
}

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

.section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.45;
}

.section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.page-head {
  margin-bottom: 18px;
}

.page-title {
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.page-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.55;
}

/* ===================== BADGES & PILLS ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--color-ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--color-warn); border-color: transparent; }

.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-tab {
  min-height: 36px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pill-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.pill-tab.is-active,
.pill-tab[aria-selected="true"],
.pill-tab[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.pill-tab:disabled { opacity: 0.42; cursor: not-allowed; }

/* ===================== HOME PAGE ===================== */
.hero-card {
  position: relative;
  background:
    radial-gradient(640px 280px at 92% 8%, rgba(29, 78, 216, 0.085), transparent 70%),
    linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-subtle) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3.6vw, 34px) clamp(18px, 3.6vw, 32px);
  margin-bottom: 18px;
}

:root[data-theme="dark"] .hero-card {
  background:
    radial-gradient(640px 280px at 92% 8%, rgba(96, 165, 250, 0.14), transparent 70%),
    linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-subtle) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.85fr);
  gap: 24px;
  align-items: center;
}

.hero-main { min-width: 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(23px, 3.3vw, 33px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.24;
  margin-bottom: 9px;
}
.hero-accent { color: var(--accent); }

.hero-desc {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 560px;
  margin-bottom: 18px;
}

.hero-search-row {
  display: flex;
  gap: 8px;
  max-width: 620px;
  margin-bottom: 12px;
}

.hero-search-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.hero-search-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 40px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  font-size: 15px;
}
.hero-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.hero-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.hero-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}
.hero-search-btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.chips-label {
  color: var(--text-muted);
  font-weight: 700;
  margin-right: 2px;
  white-space: nowrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.hero-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.hero-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13.5px;
}

.action-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.action-stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
a.action-stat-card:hover { border-color: var(--accent); text-decoration: none; }
.action-stat-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.action-stat-val {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.action-stat-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.home-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.rank-list { display: grid; }

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 6px;
  border-top: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.rank-item:hover {
  background: var(--bg-subtle);
  border-radius: 8px;
  text-decoration: none;
}

.rank-num {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.rank-num.is-top { background: var(--accent-soft); color: var(--accent); }

.rank-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rank-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-metric {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.rank-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}
.rank-unit {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.rank-card-more-mobile {
  display: none;
  margin-top: 10px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.highlight-tabs {
  margin-bottom: 14px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.highlight-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-subtle);
  color: inherit;
  min-width: 0;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.highlight-card:hover { border-color: var(--accent); text-decoration: none; }
.highlight-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.highlight-head > div:first-child { min-width: 0; }
.highlight-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.highlight-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.highlight-body {
  font-size: 13.5px;
  color: var(--text-secondary);
}
.highlight-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

/* ===================== SECURITIES LIST PAGE ===================== */
.toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.toolbar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.toolbar-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-search {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 14px;
}
.filter-search:focus { outline: none; border-color: var(--accent); }

.toolbar-submit-btn {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.toolbar-submit-btn:hover { background: var(--accent-hover); }

.filter-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-toggle-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 800;
}

.toolbar-selects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sort-select {
  flex: 1 1 155px;
  min-width: 0;
  height: 38px;
  padding: 0 28px 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--bg-surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
                    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: right 16px center, right 12px center;
  background-repeat: no-repeat;
  background-size: 4px 4px;
  font-size: 13px;
  font-weight: 600;
}

@media (forced-colors: active) {
  .sort-select {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
    padding-right: 10px;
  }
}

.toolbar-apply-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.toolbar-apply-btn:hover { border-color: var(--accent); color: var(--accent); }

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
  white-space: nowrap;
}
.data-table th:first-child,
.data-table td:first-child { text-align: left; }
.data-table thead th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: var(--bg-subtle); }
.data-table tbody tr[data-href] { cursor: pointer; }
.data-table tbody tr[data-href]:hover .row-link { color: var(--accent); text-decoration: underline; }
.data-table tbody tr:last-child td { border-bottom: 0; }

.row-link {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}
.row-link:hover { color: var(--accent); text-decoration: underline; }
.sub-code { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }

.mobile-cards { display: none; gap: 10px; }

.m-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  padding: 13px 14px;
  color: inherit;
  min-width: 0;
  text-decoration: none;
}
.m-card:hover { border-color: var(--accent); text-decoration: none; }
.m-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.m-card-head > div:first-child { min-width: 0; flex: 1 1 auto; }
.m-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.m-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.m-card-right { text-align: right; flex-shrink: 0; }
.m-card-price { font-size: 15.5px; font-weight: 800; color: var(--text-primary); }
.m-card-rate { font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.m-card-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.pagination {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.page-btn:hover:not(.is-disabled):not([aria-current="page"]) {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.page-btn[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.page-btn.is-disabled { opacity: 0.4; cursor: not-allowed; }
.page-ellipsis { padding: 0 4px; color: var(--text-muted); font-size: 13px; }

/* ===================== RANKINGS PAGE ===================== */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.podium-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-surface);
  padding: 16px;
  display: grid;
  gap: 7px;
  color: inherit;
  min-width: 0;
  text-decoration: none;
  box-shadow: var(--shadow-card);
}
.podium-card.is-first {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-surface) 44%);
}
.podium-card:hover { border-color: var(--accent); text-decoration: none; }
.podium-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.podium-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}
.podium-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.podium-code { font-size: 12px; color: var(--text-muted); }
.podium-val {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.podium-sub { font-size: 12px; color: var(--text-secondary); }

/* ===================== DETAIL PAGE ===================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.crumb-link { color: var(--text-muted); }
.crumb-current { color: var(--text-primary); font-weight: 600; }

.badges-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }

.security-title {
  font-size: clamp(23px, 3.6vw, 31px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.22;
  margin-bottom: 14px;
}

/* KPI 3-Cards */
.kpi-cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.kpi-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.kpi-card-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.kpi-card-subdate {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.kpi-card-value {
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.kpi-card-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.kpi-mini-list {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
}
.kpi-mini-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 10px;
}
.kpi-mini-row span:first-child { color: var(--text-muted); }
.kpi-mini-row strong { font-weight: 700; text-align: right; }

/* TL;DR Summary Box */
.tldr-box {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.tldr-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.tldr-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  font-weight: 500;
}

/* Calculator Widget */
.calc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.calc-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.calc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 16px;
}
.calc-mode-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  background: var(--bg-subtle);
}
.calc-mode-btn {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}
.calc-mode-btn.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.calc-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  min-width: 0;
}
.calc-input {
  width: 180px;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}
.calc-basis-select {
  height: 40px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}
.calc-outputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.calc-out-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}
.calc-out-box.is-highlight {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.calc-out-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.calc-out-val { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.calc-out-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.calc-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* YTD & Notices */
.ytd-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent);
  margin-bottom: 14px;
}
.ytd-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.ytd-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.ytd-value { font-size: 18px; font-weight: 800; color: var(--accent); }
.ytd-date { font-size: 12px; color: var(--text-muted); }

.notice-inline {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}
.notice-inline.is-warn-box {
  background: var(--warn-soft);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--text-primary);
}

.badge-anomaly {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--color-warn);
  margin-left: 4px;
}

/* Annual Charts & Tables */
.annual-charts-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.annual-chart-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-canvas);
  padding: 14px 16px;
  min-width: 0;
}
.chart-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 10px;
}
.chart-card-title { font-size: 14.5px; font-weight: 800; letter-spacing: -0.02em; }
.chart-card-kpi { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.chart-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: -4px 0 10px;
  line-height: 1.45;
}
.chart-box { position: relative; height: 215px; min-width: 0; }
.chart-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 16px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.annual-table { width: 100%; min-width: 400px; border-collapse: collapse; font-size: 13px; }
.annual-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.annual-table th, .annual-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
  white-space: nowrap;
}
.annual-table thead th { background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.annual-table th:first-child, .annual-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  z-index: 1;
}
.annual-table thead th:first-child { background: var(--bg-subtle); z-index: 2; }
.annual-table tbody tr:last-child th, .annual-table tbody tr:last-child td { border-bottom: 0; }

.annual-mobile-cards {
  display: none;
  gap: 10px;
}
.annual-m-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  padding: 13px 14px;
  min-width: 0;
}
.annual-m-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 10px;
  padding-bottom: 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--border-subtle);
}
.annual-m-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.annual-m-year { font-size: 15px; font-weight: 800; }
.annual-m-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.annual-m-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.annual-m-item span { font-size: 11.5px; color: var(--text-muted); }
.annual-m-item strong { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }

/* Glossary */
.glossary-inline-lead {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 12px;
}
.glossary-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  padding: 11px 14px;
}
.glossary-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.glossary-summary::-webkit-details-marker { display: none; }
.glossary-summary::after {
  content: "펼치기 ▾";
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.glossary-panel[open] .glossary-summary::after { content: "접기 ▴"; }
.glossary-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.glossary-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.glossary-item dt { font-size: 12.5px; font-weight: 800; color: var(--text-primary); }
.glossary-item dd { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Payment History */
.events-list { display: grid; gap: 12px; }
[data-collapsed-extra="true"] { display: none !important; }
.events-more-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.btn-outline-more {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-outline-more:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.event-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  padding: 14px 16px;
}
.event-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-date-label { font-size: 12px; color: var(--text-muted); }
.event-date { font-size: 14.5px; font-weight: 800; }
.event-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.event-items { display: grid; gap: 8px; }
.payment-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}
.pay-main { display: flex; align-items: baseline; gap: 10px; }
.pay-type { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.pay-amount { font-size: 16px; font-weight: 800; }
.pay-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.status-pill { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); }
.status-pill.is-paid { background: var(--ok-soft); color: var(--color-ok); }
.status-pill.is-scheduled { background: var(--warn-soft); color: var(--color-warn); }
.pay-date { font-size: 12.5px; color: var(--text-muted); }

.empty-state {
  padding: 22px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: grid;
  gap: 8px;
  justify-items: start;
}
.empty-title { font-size: 15px; font-weight: 700; }
.empty-desc { font-size: 13.5px; color: var(--text-secondary); }

/* FAQ Accordion & Related Links */
.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-canvas);
  padding: 0;
  overflow: hidden;
}
.faq-q {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.45;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q-text { min-width: 0; flex: 1 1 auto; }
.faq-q::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
  flex-shrink: 0;
  margin-right: 2px;
}
.faq-item[open] .faq-q::after {
  transform: rotate(-135deg);
}
.faq-a {
  padding: 0 16px 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.related-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-canvas);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.related-card:hover { border-color: var(--accent); text-decoration: none; }
.related-card-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.related-card-meta { font-size: 12px; color: var(--text-muted); }

/* Lower ISIN & Inline Disclaimer */
.lower-meta-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 18px;
}
.inline-disclaimer-box {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Guides & Static Pages */
.prose-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
  display: grid;
  gap: 16px;
}
.prose-card h2 { font-size: 19px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.prose-card h3 { font-size: 15.5px; font-weight: 700; margin-top: 4px; }
.prose-card p, .prose-card li { font-size: 14.5px; line-height: 1.75; color: var(--text-secondary); }
.prose-card ul, .prose-card ol { padding-left: 20px; display: grid; gap: 6px; }
.prose-card .ad-slot-mid { margin: 8px 0; }

.guide-diagram {
  margin: 4px 0 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
}
.guide-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.guide-diagram figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.guide-card:hover { border-color: var(--accent); text-decoration: none; }
.guide-card-title { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.guide-card-desc { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }

/* ===================== AD SLOTS ===================== */
.ad-slot {
  margin: 24px 0;
  min-height: 90px;
  max-width: 100%;
  overflow: hidden;
  background: var(--ad-bg);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  text-align: center;
}
.ad-slot-top { margin: 20px 0; }
.ad-slot-mid { margin: 24px 0; }
.ad-slot-bottom { margin: 24px 0 8px; }

/* ===================== FOOTER ===================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 22px 16px 32px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
}
.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.footer-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 4px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-disclaimer {
  width: 100%;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===================== RESPONSIVE BREAKPOINTS ===================== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .search-wrap { flex: 1 1 auto; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .home-two-col {
    grid-template-columns: 1fr;
  }
  .kpi-cards-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-cards-3 > .kpi-card:last-child {
    grid-column: 1 / -1;
  }
  .highlights-grid,
  .related-links-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calc-outputs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ad-slot { min-height: 100px; }
  .data-table-wrap,
  .table-scroll {
    display: none;
  }
  .mobile-cards,
  .annual-mobile-cards {
    display: grid;
  }

  /* Horizontal single-row scrollable pills */
  .pill-tabs-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .pill-tabs-scroll::-webkit-scrollbar {
    display: none;
  }
  .pill-tabs-scroll .pill-tab {
    flex: 0 0 auto;
    min-height: 40px;
  }

  /* Rankings overview mobile TOP 5 compression */
  .rank-item-mobile-extra {
    display: none;
  }
  .rank-card-more-mobile {
    display: flex;
  }

  /* Detail page mobile vertical chart stack */
  .annual-charts-stack {
    grid-template-columns: 1fr;
  }

  /* Securities collapsible filter drawer */
  .toolbar {
    padding: 14px;
    margin-bottom: 14px;
  }
  .toolbar-search-row {
    gap: 6px;
  }
  .filter-search {
    height: 42px;
    font-size: 16px;
  }
  .toolbar-submit-btn {
    height: 42px;
    padding: 0 14px;
  }
  .filter-toggle-btn {
    display: inline-flex;
    height: 42px;
  }
  .toolbar-selects {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }
  .toolbar-selects.is-open {
    display: grid;
  }
  .sort-select {
    width: 100%;
    height: 42px;
    font-size: 16px;
  }
  .toolbar-apply-btn {
    grid-column: 1 / -1;
    height: 42px;
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
  }

  /* iOS zoom guard on inputs */
  .search-input,
  .hero-search-input,
  .calc-input,
  .calc-basis-select {
    font-size: 16px;
  }

  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .podium-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Header & Shell keyline (16px) */
  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 16px;
  }
  .brand { margin-right: auto; }
  .search-toggle-btn { display: inline-flex; }
  .search-wrap {
    display: none;
    order: 3;
    flex: 1 0 100%;
    width: 100%;
  }
  .search-wrap.is-open {
    display: block;
  }
  .search-input {
    height: 42px;
  }
  .search-results {
    min-width: 0;
  }

  .page-shell { padding: 12px 0 40px; }
  .page-shell > .hero-card:first-child { margin-top: -12px; border-top: 0; }
  .breadcrumb { padding-inline: 16px; margin-bottom: 10px; }
  .page-head { padding-inline: 16px; margin-bottom: 14px; }
  .page-shell > .pill-tabs-scroll { padding-inline: 16px; margin-bottom: 12px !important; }
  .pagination { padding-inline: 16px; }

  /* Full-bleed section bands */
  .card,
  .hero-card,
  .toolbar,
  .calc-card,
  .prose-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .card { padding: 18px 16px; }
  .hero-card { padding: 20px 16px 18px; margin-bottom: 12px; }
  .toolbar { padding: 14px 16px; margin-bottom: 12px; }
  .calc-card { padding: 18px 16px; margin-bottom: 12px; }
  .prose-card { padding: 20px 16px; }

  .page-shell > .card,
  article[itemscope] > .card,
  .page-shell > .home-two-col {
    margin-bottom: 12px !important;
  }
  .home-two-col { gap: 12px; }

  .tldr-box {
    border-radius: 0;
    border-right: 0;
    padding: 13px 16px;
    margin-bottom: 12px;
  }
  .lower-meta-strip {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 12px 16px;
    margin-top: 12px;
  }
  .inline-disclaimer-box {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 14px 16px;
    margin-top: 12px;
  }
  .page-shell > .notice-inline,
  article[itemscope] > .notice-inline {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 12px 16px;
    margin-bottom: 12px;
  }
  .page-shell > .ad-slot,
  article[itemscope] > .ad-slot {
    border-radius: 0;
    margin: 12px 0;
    padding: 14px 16px;
  }

  /* Full-bleed grouped card lists */
  .kpi-cards-3 {
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }
  .kpi-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 14px 16px;
    background: transparent;
  }
  .kpi-card + .kpi-card { border-top: 1px solid var(--border-subtle); }

  .mobile-cards {
    gap: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .m-card {
    border: 0;
    border-radius: 0;
    padding: 14px 16px;
    background: transparent;
  }
  .m-card + .m-card { border-top: 1px solid var(--border-subtle); }
  .m-card:active { background: var(--bg-subtle); }

  .podium-grid {
    gap: 8px;
    margin-bottom: 12px;
  }
  .podium-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    padding: 15px 16px;
  }

  .page-shell > .guide-grid {
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px !important;
  }
  .page-shell > .guide-grid .guide-card {
    border: 0;
    border-radius: 0;
    padding: 16px;
    background: transparent;
  }
  .page-shell > .guide-grid .guide-card + .guide-card { border-top: 1px solid var(--border-subtle); }

  /* Flatten nested boxes inside full-bleed cards */
  .hero-panel {
    padding: 14px 0 0;
    border: 0;
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .rank-item { padding: 11px 0; }

  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .highlight-card {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
    padding: 13px 0;
  }
  .highlight-card:last-child { padding-bottom: 2px; }
  .highlight-foot { border-top: 0; padding-top: 2px; }

  .card .guide-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .card .guide-card {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
    padding: 13px 0;
  }
  .card .guide-card:last-child { padding-bottom: 2px; }

  .annual-charts-stack {
    gap: 16px;
    margin-bottom: 18px;
  }
  .annual-chart-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 4px 0 0;
  }
  .annual-chart-card + .annual-chart-card {
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
  }
  .annual-chart-card .chart-box { height: 205px; }

  .annual-mobile-cards {
    gap: 0;
    border-top: 1px solid var(--border-subtle);
  }
  .annual-m-card {
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
    padding: 13px 0;
  }
  .annual-m-card:last-child { border-bottom: 0; padding-bottom: 2px; }

  .events-list {
    gap: 0;
    border-top: 1px solid var(--border-subtle);
  }
  .event-card {
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
    padding: 13px 0;
  }
  .event-card:last-child { border-bottom: 0; padding-bottom: 2px; }

  .faq-list {
    gap: 0;
    border-top: 1px solid var(--border-subtle);
  }
  .faq-item {
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
  }
  .faq-q { padding: 13px 0; }
  .faq-a { padding: 0 0 14px; }

  .related-links-grid {
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid var(--border-subtle);
  }
  .related-card {
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
    padding: 12px 0;
  }
  .related-card:last-child { border-bottom: 0; padding-bottom: 2px; }

  .guide-diagram { padding: 10px 8px; border-radius: 10px; }

  /* Edge-to-Edge horizontal scroll strips inside cards */
  .hero-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-inline: -16px;
    padding: 0 16px 2px;
  }
  .hero-chips::-webkit-scrollbar { display: none; }
  .toolbar .pill-tabs-scroll {
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .card .section-head .pill-tabs-scroll {
    flex: 0 0 calc(100% + 32px);
    max-width: calc(100% + 32px);
    margin-inline: -16px;
    padding-inline: 16px;
  }
}

@media (max-width: 540px) {
  .section-title { font-size: 16.5px; }

  .hero-search-row { flex-direction: column; }
  .hero-search-field { width: 100%; }
  .hero-search-input { height: 46px; }
  .hero-search-btn { width: 100%; }
  .action-panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .action-stat-card { padding: 10px 11px; }
  .action-stat-val { font-size: 14.5px; }

  /* Compact calculator on narrow phones */
  .calc-controls { gap: 8px; }
  .calc-mode-tabs { width: 100%; }
  .calc-mode-btn { flex: 1 1 0; min-height: 40px; }
  .calc-input-group { flex: 1 0 100%; width: 100%; }
  .calc-input { flex: 1 1 auto; width: 100%; height: 42px; }
  .calc-basis-select { width: 100%; height: 42px; }
  .calc-outputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .calc-out-box { padding: 11px 12px; }
  .calc-out-box.is-highlight {
    grid-column: 1 / -1;
    order: -1;
  }
  .calc-out-val { font-size: 17px; }

  .annual-chart-card .chart-box { height: 200px; }
  .payment-row { flex-direction: column; align-items: flex-start; }

  .footer-links a { min-height: 40px; padding: 6px; }
}

@media (max-width: 420px) {
  .toolbar-selects {
    grid-template-columns: minmax(0, 1fr);
  }
}
