@charset "UTF-8";
/* ======================================
   TradeCrunch — Design System
   Pure CSS, zero external dependencies
====================================== */

/* ─── Custom Properties ─────────────── */
:root {
  --primary:        #1565C0;
  --primary-dark:   #0D47A1;
  --primary-mid:    #1976D2;
  --primary-light:  #DBEAFE;
  --primary-xlight: #EFF6FF;
  --accent:         #F57C00;
  --accent-dark:    #E65100;
  --bg:             #F0F4F8;
  --bg-card:        #FFFFFF;
  --text:           #0F172A;
  --text-secondary: #334155;
  --text-muted:     #475569;
  --text-faint:     #64748B;
  --border:         #CBD5E1;
  --border-light:   #E2E8F0;
  --success:        #15803D;
  --success-bg:     #F0FDF4;
  --success-border: #86EFAC;
  --error:          #DC2626;
  --error-bg:       #FEF2F2;
  --shadow-xs:      0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:      0 2px 6px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 6px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.07);
  --shadow-primary: 0 4px 16px rgba(21,101,192,.30);
  --radius:         12px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --tr:             0.18s ease;
  --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:      'SF Mono', 'Fira Code', 'Consolas', 'Menlo', monospace;
}

/* ─── Reset ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); }

/* ─── Header / Navbar ────────────────── */
.site-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 2px 16px rgba(0,0,0,.06);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.75px;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; opacity: 0.9; }

/* Primary nav pills (desktop) */
.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--tr), background var(--tr);
}
.nav-link:hover { color: var(--primary); background: var(--primary-xlight); text-decoration: none; }
.nav-link.active { color: var(--primary-dark); background: var(--primary-xlight); font-weight: 700; }

/* More dropdown */
.nav-more-wrap { position: relative; }
.nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: color var(--tr), background var(--tr);
}
.nav-more-btn:hover,
.nav-more-btn[aria-expanded="true"] { color: var(--primary); background: var(--primary-xlight); }
.more-icon { transition: transform 0.2s ease; flex-shrink: 0; }
.nav-more-btn[aria-expanded="true"] .more-icon { transform: rotate(180deg); }

.nav-megamenu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.625rem;
  min-width: 360px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.125rem;
  z-index: 300;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.nav-megamenu.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mega-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--tr), color var(--tr);
}
.mega-link:hover { background: var(--primary-xlight); color: var(--primary-dark); text-decoration: none; }
.mega-link.active { background: var(--primary-xlight); color: var(--primary-dark); font-weight: 700; }

/* Right side: CTA + hamburger */
.nav-right { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-primary);
  transition: background var(--tr), transform var(--tr);
}
.nav-cta:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-1px); }
.nav-cta.active { background: var(--primary-dark); }

/* Hamburger (hidden on desktop) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  padding: 0.375rem;
  transition: background var(--tr);
}
.nav-hamburger:hover { background: var(--bg); }
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  background: #FFFFFF;
  border-top: 1px solid var(--border-light);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  display: none;
}
.nav-mobile.open { display: block; max-height: 600px; }
.nav-mobile > * { display: block; }
.mobile-calc-all {
  display: block;
  padding: 0.7rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.375rem;
}
.mobile-calc-all:hover { text-decoration: none; background: var(--primary-xlight); }
.mobile-calc-all.active { background: var(--primary-xlight); }
.mobile-nav-link {
  display: block;
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--tr), color var(--tr);
}
.mobile-nav-link:hover { background: var(--primary-xlight); color: var(--primary-dark); text-decoration: none; }
.mobile-nav-link.active { background: var(--primary-xlight); color: var(--primary-dark); font-weight: 700; }

/* ─── Comparison Table (brokerage-comparison.html) ─── */
.comparison-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-md); margin: 1.5rem 0; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 0.9rem;
}
.comparison-table thead th {
  background: var(--primary);
  color: #FFFFFF;
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.comparison-table thead th:first-child { border-radius: var(--radius) 0 0 0; }
.comparison-table thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
.comparison-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
  background: #FFFFFF;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:nth-child(even) td { background: var(--primary-xlight); }
.comparison-table .broker-name { font-weight: 700; color: var(--text); }
.comparison-table .free { color: var(--success); font-weight: 700; }
.comparison-table .paid { color: var(--text-secondary); }
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 0.375rem;
  vertical-align: middle;
}
.badge-popular { background: var(--accent); color: #FFFFFF; }
.badge-new     { background: var(--success); color: #FFFFFF; }
.info-banner {
  background: #FFF7ED;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1.125rem;
  font-size: 0.875rem;
  color: #92400E;
  line-height: 1.7;
  margin: 1.25rem 0;
}
.source-list {
  margin: 0.75rem 0 0;
  padding-left: 1rem;
}
.source-list li + li {
  margin-top: 0.45rem;
}
.source-list span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ─── Ad Slots ───────────────────────── */
.ad-slot {
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 1rem;
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot.ad-live {
  background: transparent;
  border-style: solid;
  border-color: var(--border-light);
  color: transparent;
  padding: 0.75rem;
}
.ad-slot.ad-live .adsbygoogle {
  width: 100%;
  min-height: 90px;
}
.ad-top {
  max-width: 1200px;
  margin: 1rem auto 0;
  width: calc(100% - 3rem);
}
.ad-mid { max-width: 800px; margin: 2.5rem 0; width: 100%; }
.ad-sidebar {
  width: 300px;
  min-height: 600px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}
.ad-sidebar .ad-slot.ad-live .adsbygoogle {
  min-height: 600px;
}

/* ─── Page Layout ────────────────────── */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}
.content-with-sidebar {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}
.main-content { flex: 1; min-width: 0; }

/* ─── Calculator Hero Strip ──────────── */
.calc-section {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: 2rem 0 1.5rem;
}
.calc-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(112px, 18vw, 152px);
  background: linear-gradient(165deg, #EEF5FF 0%, #F4F8FE 50%, var(--bg) 100%);
  border-radius: 0 0 var(--radius) var(--radius);
  pointer-events: none;
  z-index: 0;
}
.calc-header, .calc-card { position: relative; z-index: 1; }

.calc-header { margin-bottom: 1.5rem; }
.calc-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.375rem;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.calc-header .subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}
.tools-grid {
  position: relative;
  z-index: 1;
  padding-top: 0.35rem;
}

/* ─── Calculator Card ────────────────── */
.calc-card {
  background: var(--bg-card);
  border: 1px solid rgba(21,101,192,.15);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

/* ─── Form ───────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.375rem;
  margin-bottom: 1.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  position: relative;
}
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.form-group label .hint {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper.currency::before {
  content: '\20B9';
  position: absolute;
  left: 0.875rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.925rem;
  pointer-events: none;
  z-index: 1;
}
.input-wrapper.percent::after {
  content: '\25';
  position: absolute;
  right: 0.875rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.925rem;
  pointer-events: none;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: #FAFBFC;
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
  outline: none;
  -moz-appearance: textfield;
  height: 48px;
}
.form-group input::-webkit-outer-spin-button,
.form-group input::-webkit-inner-spin-button { -webkit-appearance: none; }
.form-group select { height: 48px; cursor: pointer; }

.input-wrapper.currency input { padding-left: 2.125rem; }
.input-wrapper.percent input  { padding-right: 2.125rem; }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(21,101,192,.15);
}
.form-group input::placeholder { color: var(--text-faint); }
.form-group input.error,
.form-group select.error {
  border-color: var(--error);
  background: var(--error-bg);
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}
.error-msg {
  font-size: 0.775rem;
  color: var(--error);
  font-weight: 500;
  display: none;
  margin-top: 0.125rem;
}
.error-msg.visible { display: block; }

/* ─── Buttons ────────────────────────── */
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background var(--tr), transform var(--tr), box-shadow var(--tr), opacity var(--tr);
  font-family: var(--font);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary) 0%, #0B3D91 100%);
  box-shadow: 0 6px 20px rgba(21,101,192,.40);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
  background: #FFFFFF;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* ─── Result Panel ───────────────────── */
.result-panel {
  display: none;
  margin-top: 1.75rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1.75rem;
  animation: fadeUp 0.28s ease;
}
.result-panel.visible { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.result-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.generic-result-grid { grid-template-columns: repeat(2, 1fr); }

.result-card {
  background: linear-gradient(145deg, var(--primary-xlight), #DBEAFE);
  border: 1px solid rgba(21,101,192,.18);
  border-radius: var(--radius-sm);
  padding: 1.125rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
}
.result-card .rc-label {
  font-size: 0.7rem;
  color: var(--primary-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}
.result-card .rc-value {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.result-card .rc-value.large { font-size: 2rem; }
.result-card .rc-sub {
  font-size: 0.7rem;
  color: var(--primary);
  margin-top: 0.3rem;
  font-weight: 500;
  opacity: 0.75;
}

.share-box {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  align-items: center;
}
.share-box input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.85rem;
  color: var(--text-secondary);
  background: #FFFFFF;
  font-family: var(--font);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 4rem;
}
.tool-card {
  display: block;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  min-height: 130px;
}
.tool-card:hover {
  text-decoration: none;
  border-color: rgba(21,101,192,.35);
  box-shadow: var(--shadow-md);
}
.tool-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.45rem;
  color: var(--primary-dark);
}
.tool-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Charges Table ──────────────────── */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.result-table th {
  background: var(--bg);
  padding: 0.7rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}
.result-table th.right { text-align: right; }
.result-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.result-table tr:last-child td { border-bottom: none; }
.result-table .amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text);
}
.result-table .total-row td {
  background: #F8FAFC;
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  border-top: 2px solid var(--border);
}
.pnl-positive { color: var(--success) !important; font-weight: 700 !important; }
.pnl-negative { color: var(--error)   !important; font-weight: 700 !important; }

.disclaimer-small {
  font-size: 0.775rem;
  color: var(--text-muted);
  background: var(--primary-xlight);
  border: 1px solid rgba(21,101,192,.12);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-xs);
  border-left: 3px solid var(--primary);
  line-height: 1.6;
  margin-top: 1rem;
}

/* ─── Affiliate CTA ──────────────────── */
.affiliate-cta {
  background: linear-gradient(135deg, #FFF7ED, #FFFBEB);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 0.875rem 1.125rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}
.affiliate-cta p {
  font-size: 0.85rem;
  font-weight: 700;
  color: #92400E;
  flex-shrink: 0;
}
.affiliate-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.425rem 1rem;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--tr), transform var(--tr), box-shadow var(--tr);
  box-shadow: 0 2px 8px rgba(245,124,0,.30);
}
.affiliate-cta a:hover {
  background: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,124,0,.40);
}

/* ─── Scrollable Year Table ──────────── */
.table-wrapper {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  box-shadow: var(--shadow-xs);
}
.table-wrapper::-webkit-scrollbar { width: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: var(--bg); }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── SIP SVG Chart ──────────────────── */
.chart-wrap { margin: 1.5rem 0 0.625rem; }
.chart-wrap h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
#sipChart { width: 100%; height: auto; display: block; }
.chart-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.legend-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }

/* ─── SEO Content Section ────────────── */
.seo-section { padding: 2.5rem 0 4rem; }
.seo-content { max-width: 800px; }

.seo-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 0.875rem;
  padding-left: 0.875rem;
  border-left: 4px solid var(--primary);
  line-height: 1.3;
  scroll-margin-top: 80px;
}
.seo-content h2:first-child { margin-top: 0; }

.seo-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}
.seo-content ul, .seo-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.seo-content li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
}
.seo-content strong { color: var(--text); font-weight: 700; }

.formula-block {
  background: #1E293B;
  color: #BAE6FD;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.85;
  margin: 0.875rem 0;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.formula-block .comment { color: #475569; }

.example-block {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-left: 4px solid var(--success);
  padding: 1.25rem 1.375rem;
  border-radius: var(--radius-sm);
  margin: 0.875rem 0;
}
.example-block p {
  color: var(--text-secondary);
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  line-height: 1.7;
}
.example-block p:last-child { margin-bottom: 0; }
.example-block strong { color: var(--success); }

/* ─── FAQ Accordion ──────────────────── */
.faq-list { list-style: none; padding: 0; }
.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow var(--tr), border-color var(--tr);
}
.faq-item:hover { border-color: var(--border); }
.faq-item.open {
  border-color: rgba(21,101,192,.25);
  box-shadow: 0 2px 12px rgba(21,101,192,.08);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background var(--tr);
}
.faq-question:hover { background: var(--primary-xlight); }
.faq-item.open .faq-question {
  background: var(--primary-xlight);
  color: var(--primary-dark);
}
.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--primary);
  transition: transform var(--tr);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease;
}
.faq-item.open .faq-answer { max-height: 600px; }
.faq-answer-inner {
  padding: 0.25rem 1.25rem 1.125rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.8;
  border-top: 1px solid rgba(21,101,192,.10);
  background: var(--primary-xlight);
}

/* ─── Footer ─────────────────────────── */
.site-footer {
  background: linear-gradient(175deg, #0F172A 0%, #1E293B 100%);
  color: #94A3B8;
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  list-style: none;
}
.footer-calculators {
  margin: 0 auto 1.5rem;
  max-width: 980px;
}
.footer-title {
  margin-bottom: 0.75rem;
  color: #CBD5E1;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-calculator-links {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  list-style: none;
  margin-bottom: 1rem;
}
.footer-calculator-links a,
.footer-calculator-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.footer-calculator-links a {
  background: rgba(255,255,255,.06);
  color: #CBD5E1;
}
.footer-calculator-links a:hover {
  text-decoration: none;
  background: rgba(255,255,255,.11);
  color: #F8FAFC;
}
.footer-calculator-links span.active {
  background: var(--primary);
  color: #FFFFFF;
  cursor: default;
}
.footer-links a {
  color: #CBD5E1;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--tr);
}
.footer-links a:hover { color: #F1F5F9; text-decoration: none; }
.footer-disclaimer {
  font-size: 0.8rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  color: #94A3B8;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.footer-copy { font-size: 0.75rem; color: #475569; }

/* ─── Legal Pages ────────────────────── */
.legal-section { padding: 2.5rem 0 4rem; }
.legal-content { max-width: 780px; }
.legal-content h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.375rem;
  color: var(--text);
}
.legal-content .meta {
  font-size: 0.825rem;
  color: var(--text-faint);
  margin-bottom: 2rem;
  font-weight: 500;
}
.legal-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2.25rem 0 0.625rem;
  color: var(--text);
  padding-left: 0.75rem;
  border-left: 3px solid var(--primary);
}
.legal-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.875rem;
  font-size: 0.9375rem;
}
.legal-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-content li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.3rem;
  font-size: 0.9375rem;
}
.legal-content a { color: var(--primary); font-weight: 500; }
.legal-content code {
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--primary-dark);
}

/* ─── 404 Page ───────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem;
  text-align: center;
  flex: 1;
}
.error-code {
  font-size: 6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.75rem;
  letter-spacing: -4px;
}
.error-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
  color: var(--text);
}
.error-page p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.7; }
.error-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Responsive ─────────────────────── */
@media (max-width: 960px) {
  .ad-sidebar { display: none; }
  .content-with-sidebar { gap: 0; }
}

@media (max-width: 768px) {
  .nav-primary { display: none; }
  .nav-cta     { display: none; }
  .nav-hamburger { display: flex; }
  .nav-container { height: 56px; gap: 0.5rem; }

  .calc-section::before {
    left: -1.5rem;
    right: -1.5rem;
  }
  .calc-header h1 { font-size: 1.5rem; }
  .calc-card { padding: 1.375rem; }
  .form-grid { grid-template-columns: 1fr; gap: 1rem; }
  .result-grid, .result-grid.two-col { grid-template-columns: 1fr; }
  .generic-result-grid, .tools-grid { grid-template-columns: 1fr; }
  .share-box { flex-direction: column; align-items: stretch; }
  .affiliate-cta { flex-direction: column; align-items: flex-start; gap: 0.625rem; }
  .ad-mid { margin: 1.75rem 0; }
  .seo-content h2 { font-size: 1.15rem; }
  .result-card .rc-value { font-size: 1.4rem; }
  .result-card .rc-value.large { font-size: 1.75rem; }
  .footer-links { gap: 1.25rem; }
}

@media (max-width: 480px) {
  .nav-container { padding: 0 1rem; }
  .page-wrapper { padding: 0 1rem; }
  .calc-card { padding: 1.125rem; }
  .btn { padding: 0.75rem 1.5rem; font-size: 0.875rem; }
  .error-code { font-size: 4.5rem; }
  .ad-top { width: calc(100% - 2rem); margin-top: 0.75rem; }
}

/* ─── Print ──────────────────────────── */
@media print {
  .site-header, .ad-slot, .ad-sidebar, .affiliate-cta, .site-footer { display: none !important; }
  .result-panel { display: block !important; }
  .calc-section::before { display: none; }
}
