:root {
  --bg: #ffffff;
  --surface: #f6f8fb;
  --surface-alt: #eef2f7;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --emerald: #047857;
  --emerald-dark: #065f46;
  --emerald-soft: #ecfdf5;
  --blue: #1d4ed8;
  --blue-soft: #eff6ff;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.section-head p a, .prose a, .faq-body a, .privacy-note a, .text-muted a, p a:not(.btn):not(.card-link) {
  text-decoration: underline; text-underline-offset: 2px;
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-emerald { color: var(--emerald-dark); }
.text-blue { color: var(--blue); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Header & Navigation */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand-link { display: inline-flex; align-items: center; text-decoration: none !important; flex-shrink: 1; min-width: 0; }
.brand-logo-img { height: 38px; width: auto; max-width: 100%; }
.nav-desktop { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  text-decoration: none !important; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface); color: var(--ink); }
.nav-link.active { background: var(--emerald-soft); color: var(--emerald-dark); font-weight: 600; }
.header-cta { flex-shrink: 0; }

.mobile-menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border);
  background: var(--bg); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink);
}
.mobile-nav-drawer {
  display: none; border-top: 1px solid var(--border);
  background: var(--bg); padding: 12px 20px 20px;
}
.mobile-nav-drawer.open { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-link {
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; text-decoration: none !important;
}
.mobile-nav-link.active { background: var(--emerald-soft); color: var(--emerald-dark); font-weight: 600; }

@media (max-width: 960px) {
  .site-header .nav-desktop, .site-header .header-cta { display: none; }
  .mobile-menu-btn { display: inline-flex; flex-shrink: 0; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 14.5px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 13.5px; }
.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:hover { background: var(--emerald-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--ink); }

/* Hero & Breadcrumbs */
.hero-section {
  padding: 34px 0 42px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}
.page-hero {
  padding: 28px 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--muted); margin-bottom: 14px;
}
.breadcrumb a { color: var(--ink-2); }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--emerald-dark); background: var(--emerald-soft);
  padding: 4px 11px; border-radius: 999px; margin-bottom: 12px;
}
h1, h2, h3, h4 {
  font-family: var(--font-display); color: var(--ink); line-height: 1.22;
  letter-spacing: -0.02em; margin-top: 0;
}
h1 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 800; margin-bottom: 12px; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); font-weight: 800; margin-bottom: 12px; }
h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: 8px; }
.hero-lead { font-size: 1.06rem; color: var(--ink-2); max-width: 780px; margin: 0 0 16px; }

.trust-strip {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  margin-bottom: 24px; font-size: 13.5px; color: var(--ink-2); font-weight: 500;
}
.trust-item { display: inline-flex; align-items: center; gap: 6px; }
.trust-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); flex-shrink: 0; }

/* Calculator Workbench */
.calc-workbench {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px; align-items: start;
}
@media (max-width: 920px) { .calc-workbench { grid-template-columns: 1fr; } }

.panel {
  min-width: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.panel-muted { background: var(--surface); }

.mode-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  background: var(--surface-alt); padding: 5px; border-radius: var(--radius-md);
  margin-bottom: 18px;
}
@media (max-width: 560px) { .mode-tabs { grid-template-columns: repeat(2, 1fr); } }
.mode-tab {
  border: 0; background: transparent; color: var(--ink-2);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  padding: 9px 8px; border-radius: var(--radius-sm); cursor: pointer;
  min-height: 40px; transition: background .15s, color .15s, box-shadow .15s;
}
.mode-tab[aria-selected="true"], .mode-tab.active {
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 540px) { .form-grid { grid-template-columns: 1fr; } }
.field-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.hint-badge { font-size: 12px; font-weight: 500; color: var(--muted); }
.input, .select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: #fff;
}
.input:focus, .select:focus { border-color: var(--emerald); outline: 2px solid rgba(5, 150, 105, 0.16); }
.input-group { position: relative; display: flex; align-items: center; }
.input-prefix, .input-suffix {
  position: absolute; font-size: 14px; font-weight: 600; color: var(--muted); pointer-events: none;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }
.has-prefix { padding-left: 34px; }
.has-suffix { padding-right: 34px; }

.schedule-disclosure {
  margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; background: var(--surface);
}
.schedule-disclosure summary {
  cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.schedule-disclosure[open] summary { margin-bottom: 12px; }

.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.error-banner {
  margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--danger-soft); border: 1px solid #fecdd3; color: var(--danger);
  font-size: 14px; font-weight: 500; display: none;
}
.error-banner.visible { display: block; }

/* Results Dashboard */
.result-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff; border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px;
}
.result-hero-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; font-weight: 600; }
.result-hero-value { font-family: var(--font-mono); font-size: clamp(1.75rem, 3vw, 2.3rem); font-weight: 800; color: #34d399; margin: 4px 0 8px; }
.result-hero-sub { font-size: 13.5px; color: #cbd5e1; display: flex; flex-wrap: wrap; gap: 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 440px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--surface);
}
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-val { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-top: 2px; }

/* Worth Cards (Hour / Week / Month / Year) */
.worth-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .worth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .worth-grid { grid-template-columns: 1fr; } }
.worth-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.worth-card-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--emerald-dark); }
.worth-card-val { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 800; color: var(--ink); margin: 6px 0 4px; }
.worth-card-sub { font-size: 13px; color: var(--muted); margin: 0; }

/* SVG Bar & Chart Wrappers */
.svg-bar-compare { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.bar-meta { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.bar-track { height: 12px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .25s ease; }
.bar-before { background: #64748b; }
.bar-after { background: var(--emerald); }
.bar-danger { background: var(--danger); }
.chart-box {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; background: #fff; margin-top: 14px;
}
.chart-svg { width: 100%; height: auto; }

.export-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.privacy-note {
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: flex-start; gap: 6px;
}

/* Sections & Cards */
.section { padding: 48px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 24px; max-width: 780px; }
.section-head p { color: var(--ink-2); margin: 0; }

.card-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .card-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .card-grid-3, .card-grid-2 { grid-template-columns: 1fr; } }

.tool-card, .article-card {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.tool-card:hover, .article-card:hover { border-color: var(--emerald); box-shadow: var(--shadow-md); }
.card-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--blue); background: var(--blue-soft);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; width: fit-content;
}
.card-link { font-weight: 600; font-size: 14px; color: var(--emerald-dark); margin-top: 12px; display: inline-flex; align-items: center; gap: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface); font-weight: 700; color: var(--ink); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Formula & Callout Boxes */
.formula-box {
  background: var(--surface); border-left: 4px solid var(--emerald);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px; margin: 16px 0; font-family: var(--font-mono); font-size: 14px;
}
.callout-note {
  background: var(--blue-soft); border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: var(--ink-2);
}
.callout-warn {
  background: var(--amber-soft); border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: #78350f;
}

/* FAQ Accordion */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg); overflow: hidden;
}
.faq-item summary {
  list-style: none; cursor: pointer; padding: 16px 18px;
  font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--emerald-dark); font-weight: 700; }
.faq-item[open] summary::after { content: '−'; }
.faq-body { padding: 0 18px 16px; color: var(--ink-2); border-top: 1px solid var(--border); padding-top: 12px; }

/* Article Layout */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 32px; align-items: start; }
@media (max-width: 920px) { .article-layout { grid-template-columns: 1fr; } }
.prose h2 { margin-top: 28px; }
.prose h3 { margin-top: 20px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.sidebar-box {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px; background: var(--surface); margin-bottom: 18px;
}
.sidebar-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }

/* Variable Compound Rows */
.year-raise-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.year-raise-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }

/* Ad Placements */
.ad-slot-inline {
  padding: 18px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow-x: hidden;
}
.ad-banner-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; margin: 0 auto; width: 100%; max-width: 100%; overflow-x: auto;
}
.ad-banner-468 { min-height: 82px; }
@media (max-width: 520px) { .ad-banner-468 { align-items: flex-start; } }
.ad-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); line-height: 1;
}

.sticky-footer-ad {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  padding: 8px 44px 8px 12px;
  display: flex; align-items: center; justify-content: center;
}
.sticky-ad-inner {
  width: 100%; max-width: 100%; min-height: 90px; overflow-x: auto;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 780px) { .sticky-ad-inner { justify-content: flex-start; } }
.sticky-ad-close {
  position: absolute; right: 8px; top: 8px;
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--ink);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.sticky-ad-close:hover { background: var(--surface); }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 48px 0 124px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 920px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-title { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-links a { color: #94a3b8; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid #1e293b;
  font-size: 13px; color: #94a3b8; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
}

@media print {
  .site-header, .site-footer, .calc-actions, .export-bar, .no-print, .ad-slot-inline, .sticky-footer-ad { display: none !important; }
  .calc-workbench { grid-template-columns: 1fr; }
}
