:root{
  --navy:#001234;
  --navy-2:#082049;
  --navy-3:#0d2c5c;
  --blue:#0055F3;
  --blue-dark:#0041c4;
  --green:#32C002;
  --green-dark:#279a02;
  --bg:#F5F7FA;
  --surface:#FFFFFF;
  --text:#101827;
  --muted:#5B6B82;
  --border:#E3E8F0;
  --radius:14px;
  --radius-sm:9px;
  --shadow:0 1px 2px rgba(16,24,39,.04), 0 8px 24px -12px rgba(16,24,39,.12);
  --maxw:1180px;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family:'IBM Plex Sans',system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.display{font-family:'Space Grotesk',system-ui,sans-serif;}
.mono{font-family:'IBM Plex Mono',monospace;}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer;}
img{max-width:100%;}
:focus-visible{outline:2px solid var(--blue); outline-offset:2px;}
.container{max-width:var(--maxw); margin:0 auto; padding:0 24px;}
@media (prefers-reduced-motion: reduce){ *{animation-duration:.001ms !important; transition-duration:.001ms !important;} }

/* ---------- Header ---------- */
.site-header{
  position:sticky; top:0; z-index:50;
  background:rgba(245,247,250,.9); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{display:flex; align-items:center; gap:26px; padding:13px 24px;}
.brand-link{display:flex; align-items:center; gap:10px; flex-shrink:0;}
.brand-link img{height:30px; width:auto; display:block;}
.brand-tagline{display:none;}
.main-nav{display:flex; gap:22px; margin-left:6px;}
.main-nav a{font-size:14px; font-weight:500; color:var(--muted); padding:6px 0; border-bottom:2px solid transparent;}
.main-nav a:hover, .main-nav a.active{color:var(--text); border-color:var(--blue);}
.header-actions{display:flex; align-items:center; gap:10px; margin-left:auto;}
.icon-button{
  width:36px; height:36px; border-radius:9px; border:1px solid var(--border); background:#fff;
  display:flex; align-items:center; justify-content:center; color:var(--muted);
}
.icon-button:hover{color:var(--blue); border-color:var(--blue);}
.menu-button{display:none;}
.button{
  display:inline-flex; align-items:center; gap:7px; padding:10px 17px; border-radius:10px;
  font-size:14px; font-weight:600; border:1px solid transparent;
}
.button-small{padding:8px 13px; font-size:13px;}
.button-primary{background:var(--navy); color:#fff;}
.button-primary:hover{background:var(--navy-3);}
.button-outline{background:#fff; border-color:var(--border); color:var(--text);}
.button-outline:hover{border-color:var(--blue); color:var(--blue);}
.text-link{display:inline-flex; align-items:center; gap:5px; font-size:13.5px; font-weight:600; color:var(--blue);}
.text-link:hover{color:var(--blue-dark);}

.mobile-drawer{display:none; position:fixed; inset:0; z-index:60; background:rgba(0,10,30,.5);}
.mobile-drawer.open{display:block;}
.mobile-drawer-panel{
  position:absolute; top:0; right:0; width:78%; max-width:300px; height:100%;
  background:#fff; padding:20px; display:flex; flex-direction:column; gap:4px;
  box-shadow:-10px 0 30px rgba(0,0,0,.15);
}
.mobile-drawer-panel a{padding:12px 8px; font-size:15px; font-weight:600; border-bottom:1px solid var(--border); color:var(--text);}
.mobile-drawer-close{align-self:flex-end; margin-bottom:6px;}

@media (max-width:860px){
  .main-nav{display:none;}
  .menu-button{display:flex;}
  .header-cta{display:none;}
}

/* ---------- Hero ---------- */
.hero{padding:56px 0 64px; position:relative; overflow:hidden;}
.hero-grid{display:grid; grid-template-columns:1.1fr 1fr; gap:40px; align-items:center;}
@media (max-width:900px){.hero-grid{grid-template-columns:1fr;}}
.eyebrow{
  display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:600;
  color:var(--blue); background:#eaf1ff; padding:6px 12px; border-radius:20px; margin-bottom:16px;
}
.hero h1{font-size:clamp(30px,4.4vw,46px); line-height:1.12; letter-spacing:-.02em; margin:0 0 16px; font-weight:700;}
.hero h1 em{color:var(--blue); font-style:normal;}
.hero p{font-size:16px; color:var(--muted); max-width:460px; line-height:1.6; margin:0 0 24px;}
.hero-actions{display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin-bottom:26px;}
.hero-proof{display:flex; align-items:center; gap:12px;}
.proof-avatars{display:flex;}
.proof-avatars span{
  width:30px; height:30px; border-radius:50%; background:var(--navy); color:#fff;
  font-size:10.5px; font-weight:700; display:flex; align-items:center; justify-content:center;
  font-family:'IBM Plex Mono'; border:2px solid var(--bg); margin-left:-8px;
}
.proof-avatars span:first-child{margin-left:0;}
.hero-proof>span:last-child{font-size:12.5px; color:var(--muted);}

/* hero art: mirrors the FinToolkit calculator+chart mark */
.hero-art{position:relative; background:linear-gradient(150deg,var(--navy),var(--navy-3)); border-radius:22px; padding:28px; min-height:340px;}
.art-header{display:flex; gap:10px; align-items:center; margin-bottom:22px;}
.art-sym{font-family:'IBM Plex Mono'; font-weight:600; color:var(--green); background:rgba(50,192,2,.12); width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px;}
.art-dot{width:9px; height:9px; border-radius:50%; background:var(--green); margin-left:auto;}
.art-chart-area{position:relative; height:170px; display:flex; align-items:flex-end; padding-bottom:4px;}
.art-bars{display:flex; align-items:flex-end; gap:14px; width:100%;}
.art-bars i{flex:1; background:linear-gradient(180deg,var(--blue),var(--blue-dark)); border-radius:6px 6px 0 0; display:block;}
.art-bars i:nth-child(1){height:30%;}
.art-bars i:nth-child(2){height:48%;}
.art-bars i:nth-child(3){height:40%;}
.art-bars i:nth-child(4){height:68%;}
.art-bars i:nth-child(5){height:92%;}
.art-trend-line{
  position:absolute; left:0; right:0; bottom:22%; height:2px; background:var(--green);
  clip-path:polygon(0 100%,100% 0,100% 100%,0 100%); opacity:0; /* decorative fallback */
}
.art-card{
  position:absolute; right:24px; bottom:-22px; background:#fff; border-radius:12px; padding:14px 16px;
  box-shadow:0 14px 30px -10px rgba(0,0,0,.35); min-width:170px;
}
.art-card span{display:block; font-size:11px; color:var(--muted); margin-bottom:3px;}
.art-card strong{font-family:'IBM Plex Mono'; font-size:19px; color:var(--navy); display:block;}
.art-card small{color:var(--green-dark); font-size:11.5px; font-weight:600;}

/* ---------- Search band ---------- */
.search-band{padding:8px 0 46px;}
.search-wrap{
  background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:26px 30px;
  display:flex; align-items:center; justify-content:space-between; gap:26px; flex-wrap:wrap;
}
.search-wrap h2{font-size:19px; margin:6px 0 0; font-weight:700;}
.search-box{
  flex:1; min-width:260px; max-width:420px; display:flex; align-items:center; gap:10px;
  border:1px solid var(--border); border-radius:12px; padding:12px 16px; background:#fbfcfe; color:var(--muted);
}
.search-box input{border:none; background:none; outline:none; font-size:14.5px; width:100%; color:var(--text);}

/* ---------- Sections ---------- */
.section{padding:52px 0;}
.section-tint{background:linear-gradient(180deg,#fff,#eef2f8);}
.section-heading{display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:26px; flex-wrap:wrap;}
.section-heading h2{font-size:25px; margin:6px 0 0; font-weight:700; letter-spacing:-.01em;}

.calculator-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px;}
.calculator-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:19px; display:flex; flex-direction:column; gap:9px; transition:.15s;
}
.calculator-card:hover{border-color:var(--blue); box-shadow:var(--shadow); transform:translateY(-2px);}
.card-top{display:flex; justify-content:space-between; align-items:flex-start;}
.calc-icon{
  width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  background:#eaf1ff; color:var(--blue);
}
.card-arrow{color:var(--muted); opacity:0; transition:.15s;}
.calculator-card:hover .card-arrow{opacity:1; color:var(--blue);}
.card-category{font-size:11px; font-weight:600; color:var(--blue); text-transform:uppercase; letter-spacing:.04em;}
.calculator-card h3{margin:0; font-size:16.5px; font-weight:700;}
.calculator-card p{margin:0; font-size:13px; color:var(--muted); line-height:1.5; flex:1;}
.card-cta{font-size:12.5px; font-weight:600; color:var(--blue); display:inline-flex; align-items:center; gap:5px;}

.split-section{display:grid; grid-template-columns:.9fr 1.1fr; gap:50px; align-items:start;}
@media (max-width:860px){.split-section{grid-template-columns:1fr;}}
.lead{font-size:15.5px; color:var(--muted); line-height:1.7; max-width:420px;}
.principles{display:flex; flex-direction:column; gap:26px;}
.principle-number{font-family:'IBM Plex Mono'; color:var(--blue); font-size:13px; font-weight:600;}
.principles h3{margin:6px 0 6px; font-size:17px; font-weight:700;}
.principles p{margin:0; color:var(--muted); font-size:14px; line-height:1.6;}

.category-list{display:flex; flex-wrap:wrap; gap:10px;}
.category-pill{
  display:inline-flex; align-items:center; gap:9px; padding:11px 16px; border-radius:11px;
  background:#fff; border:1px solid var(--border); font-size:13.5px; font-weight:600;
}
.category-pill span{font-family:'IBM Plex Mono'; font-size:11px; color:var(--muted);}
.category-pill:hover{border-color:var(--blue); color:var(--blue);}

/* ---------- Newsletter ---------- */
.newsletter-section{padding:54px 0;}
.newsletter-card{
  background:linear-gradient(120deg,var(--navy),var(--navy-3)); border-radius:22px; padding:38px 34px;
  color:#fff; display:flex; align-items:center; justify-content:space-between; gap:26px; flex-wrap:wrap;
}
.newsletter-card h2{font-size:21px; margin:6px 0 6px; font-weight:700;}
.newsletter-card p{color:#b9c9e6; font-size:13.5px; margin:0; max-width:360px;}
.newsletter-card .eyebrow{background:rgba(255,255,255,.1); color:#cfe0ff;}
.newsletter-form{display:flex; gap:10px; flex-wrap:wrap;}
.newsletter-form input{
  padding:11px 15px; border-radius:10px; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.08);
  color:#fff; font-size:14px; min-width:220px;
}
.newsletter-form input::placeholder{color:#93a8cc;}
.newsletter-form .button-primary{background:var(--green); color:var(--navy);}
.newsletter-form .button-primary:hover{background:var(--green-dark); color:#fff;}
.newsletter-note{font-size:11.5px; color:#93a8cc; width:100%; margin-top:2px;}

/* ---------- FAQ ---------- */
.faq-list{display:flex; flex-direction:column; gap:10px;}
.faq-item{background:#fff; border:1px solid var(--border); border-radius:12px; overflow:hidden;}
.faq-item button{
  width:100%; display:flex; justify-content:space-between; align-items:center; gap:16px;
  padding:16px 18px; background:none; border:none; font-size:14.5px; font-weight:600; text-align:left; color:var(--text);
}
.faq-item svg{flex-shrink:0; transition:.2s transform; color:var(--muted);}
.faq-item.open svg{transform:rotate(180deg); color:var(--blue);}
.faq-answer{max-height:0; overflow:hidden; transition:.22s ease;}
.faq-item.open .faq-answer{max-height:420px;}
.faq-answer p{margin:0; padding:0 18px 16px; font-size:13.5px; color:var(--muted); line-height:1.6;}

/* ---------- Footer ---------- */
.site-footer{background:var(--navy); color:#c7d5ee; padding:44px 0 20px; margin-top:20px;}
.footer-grid{display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:30px; padding-bottom:28px; border-bottom:1px solid rgba(255,255,255,.1);}
@media (max-width:760px){.footer-grid{grid-template-columns:1fr 1fr;}}
.footer-logo{height:26px; margin-bottom:10px;}
.footer-tagline{font-size:12px; color:#8ba4d1; margin:0 0 10px; text-transform:uppercase; letter-spacing:.05em;}
.footer-copy{font-size:12.5px; color:#93a8cc; line-height:1.6; max-width:240px; margin:0;}
.footer-heading{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:#6f87b3; margin:0 0 12px; font-weight:600;}
.site-footer a{display:block; font-size:13.5px; color:#c7d5ee; margin-bottom:9px;}
.site-footer a:hover{color:#fff;}
.footer-note{font-size:11.5px; color:#6f87b3; margin-top:8px;}
.footer-bottom{display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; padding-top:18px; font-size:12px; color:#6f87b3;}

/* ---------- Calculator page ---------- */
.calc-page-header{padding:30px 0 6px;}
.breadcrumb{font-size:12.5px; color:var(--muted); margin-bottom:14px;}
.breadcrumb a:hover{color:var(--blue);}
.calc-title-row{display:flex; align-items:center; gap:12px; margin-bottom:8px;}
.calc-title-row h1{font-size:26px; margin:0; font-weight:700;}
.calc-ticker{font-family:'IBM Plex Mono'; font-size:11px; font-weight:600; padding:4px 9px; border-radius:6px;}
.calc-sub{color:var(--muted); font-size:14px; margin:0 0 30px; max-width:600px;}

.calc-layout{display:grid; grid-template-columns:1fr 1fr; gap:22px; align-items:start; padding-bottom:20px;}
@media (max-width:840px){.calc-layout{grid-template-columns:1fr;}}
.panel{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px;}
.panel-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.panel-head h4{margin:0;}
.mode-toggle{display:flex; background:#eef1f6; border-radius:9px; padding:3px; gap:2px;}
.mode-toggle button{
  border:none; background:none; padding:6px 11px; border-radius:7px; font-size:12px; font-weight:600;
  color:var(--muted); display:flex; align-items:center; gap:5px; font-family:'IBM Plex Sans';
}
.mode-toggle button.active{background:#fff; color:var(--blue); box-shadow:0 1px 2px rgba(16,24,39,.08);}
.panel h4{margin:0 0 16px; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600;}
.field{margin-bottom:16px;}
.field label{display:flex; justify-content:space-between; font-size:13px; font-weight:500; margin-bottom:6px; color:var(--text);}
.field label .val{font-family:'IBM Plex Mono'; color:var(--blue); font-weight:600;}
.field input[type=number], .field input[type=text], .field select{
  width:100%; padding:10px 12px; border-radius:9px; border:1px solid var(--border);
  font-size:14.5px; font-family:'IBM Plex Mono'; background:#fbfcfe; color:var(--text);
}
.field input[type=number]:focus, .field input[type=text]:focus, .field select:focus{border-color:var(--blue);}
.field input[type=range]{width:100%; accent-color:var(--blue); margin-top:2px;}
.field select{font-family:'IBM Plex Sans';}

.results{display:flex; flex-direction:column; gap:10px;}
.result-row{
  display:flex; justify-content:space-between; align-items:baseline;
  padding:13px 15px; border-radius:10px; background:#f8fafc; border:1px solid var(--border);
}
.result-row.hi{background:linear-gradient(120deg,var(--navy),var(--navy-3)); border:none; color:#fff;}
.result-row .rlabel{font-size:12.5px; color:var(--muted);}
.result-row.hi .rlabel{color:#b9c9e6;}
.result-row .rvalue{font-family:'IBM Plex Mono'; font-weight:600; font-size:15.5px;}
.result-row.hi .rvalue{color:var(--green); font-size:19px;}

.breakdown{margin-top:16px;}
.bar{height:11px; border-radius:6px; overflow:hidden; display:flex; background:#eef1f6; margin-bottom:10px;}
.bar span{height:100%;}
.legend{display:flex; gap:16px; flex-wrap:wrap;}
.legend .li{display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted);}
.legend .dot{width:9px; height:9px; border-radius:3px;}
.note{font-size:12px; color:var(--muted); margin-top:14px; line-height:1.6; padding-top:14px; border-top:1px dashed var(--border);}

.related{margin-top:8px; padding-bottom:50px;}
.related h4{font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:10px; font-weight:600;}

/* ---------- Directory page (calculators hub) ---------- */
.directory-toolbar{
  display:flex; gap:14px; flex-wrap:wrap; align-items:center; margin-bottom:26px;
  background:#fff; border:1px solid var(--border); border-radius:14px; padding:14px 16px;
}
.directory-search{flex:1; min-width:220px; display:flex; align-items:center; gap:8px; color:var(--muted);}
.directory-search input{border:none; outline:none; background:none; font-size:14px; width:100%; color:var(--text);}
.chip-row{display:flex; gap:8px; flex-wrap:wrap;}
.chip{
  padding:7px 13px; border-radius:20px; border:1px solid var(--border); background:#fff; font-size:12.5px; font-weight:600; color:var(--muted);
}
.chip.active{background:var(--navy); color:#fff; border-color:var(--navy);}
.cat-section{margin-bottom:34px;}
.cat-head{display:flex; align-items:center; gap:10px; margin-bottom:14px;}
.cat-head .badge-icon{width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:10.5px; font-family:'IBM Plex Mono'; font-weight:600; color:#fff;}
.cat-head h2{font-size:16.5px; margin:0; font-weight:700;}
.cat-head .sub{font-size:12.5px; color:var(--muted); margin-left:2px;}

/* ---------- Static/legal page ---------- */
.static-page{padding:44px 0 70px;}
.static-page h1{font-size:30px; margin:0 0 8px;}
.static-page .updated{font-size:12.5px; color:var(--muted); margin-bottom:34px;}
.static-page h2{font-size:18px; margin:34px 0 10px;}
.static-page p, .static-page li{font-size:14.5px; line-height:1.75; color:#33415c;}
.static-page ul{padding-left:20px;}
.static-page .callout{background:#fff; border:1px solid var(--border); border-radius:14px; padding:20px 22px; margin:22px 0;}

.empty{text-align:center; padding:60px 20px; color:var(--muted);}

/* ================= Dark mode ================= */
html{color-scheme:light;}
html[data-theme="dark"]{color-scheme:dark;}
body, .panel, .calculator-card, .icon-button, .button, .chip, .field input, .field select,
.result-row, .faq-item, .category-pill, .site-header{transition:background-color .18s ease, color .18s ease, border-color .18s ease;}

html[data-theme="dark"]{
  --bg:#0A1020;
  --surface:#111A2E;
  --text:#E6ECF7;
  --muted:#93A4BF;
  --border:#23314F;
  --navy:#0E1930;
  --navy-2:#12203c;
  --navy-3:#16274a;
  --blue:#5C93FF;
  --blue-dark:#3F79EE;
  --green:#4FD32A;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}
html[data-theme="dark"] .site-header{background:rgba(10,16,32,.92);}
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .button-outline,
html[data-theme="dark"] .mobile-drawer-panel,
html[data-theme="dark"] .art-card,
html[data-theme="dark"] .search-wrap,
html[data-theme="dark"] .category-pill,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .directory-toolbar,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .static-page .callout{background:var(--surface); color:var(--text);}
html[data-theme="dark"] .section-tint{background:linear-gradient(180deg,#0D1526,#0A1020);}
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .field input[type=number],
html[data-theme="dark"] .field input[type=text],
html[data-theme="dark"] .field select,
html[data-theme="dark"] .result-row,
html[data-theme="dark"] .mode-toggle,
html[data-theme="dark"] .schedule-table thead th{background:#0D1526; color:var(--text);}
html[data-theme="dark"] .mode-toggle button.active{background:var(--surface); color:var(--blue);}
html[data-theme="dark"] .bar{background:#1A2540;}
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .calc-icon{background:rgba(92,147,255,.16); color:var(--blue);}
html[data-theme="dark"] .button-primary{background:var(--blue); color:#04102b;}
html[data-theme="dark"] .button-primary:hover{background:var(--blue-dark); color:#fff;}
html[data-theme="dark"] .chip.active{background:var(--blue); color:#04102b; border-color:var(--blue);}
html[data-theme="dark"] .site-footer{background:#070C18;}
html[data-theme="dark"] .art-card strong{color:var(--text);}
html[data-theme="dark"] .static-page p, html[data-theme="dark"] .static-page li{color:#c3cee2;}
html[data-theme="dark"] .proof-avatars span{border-color:var(--bg);}
html[data-theme="dark"] .result-row.hi{background:linear-gradient(120deg,#16274a,#1d3462);}
html[data-theme="dark"] .newsletter-card{background:linear-gradient(120deg,#12203c,#1d3462);}

.theme-toggle svg{display:block;}
html[data-theme="dark"] .theme-toggle .icon-sun{display:block;}
html[data-theme="dark"] .theme-toggle .icon-moon{display:none;}
html[data-theme="light"] .theme-toggle .icon-sun{display:none;}
html[data-theme="light"] .theme-toggle .icon-moon{display:block;}

/* ================= Calculator actions, table & educational content ================= */
.calc-actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; padding-top:16px; border-top:1px dashed var(--border);}
.calc-actions .button{padding:8px 12px; font-size:12.5px;}
.calc-actions .button-outline{background:var(--surface); border-color:var(--border); color:var(--text);}
.calc-actions .button-outline:hover{border-color:var(--blue); color:var(--blue);}
.field-error{display:block; font-size:11.5px; color:#d7263d; margin-top:5px;}
html[data-theme="dark"] .field-error{color:#ff8496;}
.field input.invalid{border-color:#d7263d;}
.toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(10px);
  background:var(--navy); color:#fff; padding:11px 18px; border-radius:10px; font-size:13px; font-weight:600;
  box-shadow:var(--shadow); opacity:0; pointer-events:none; transition:.2s; z-index:200;
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
html[data-theme="dark"] .toast{background:#1d3462;}

.schedule-wrap{margin-top:26px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; overflow:hidden;}
.schedule-head{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px;}
.schedule-scroll{overflow-x:auto; max-height:420px;}
.schedule-table{width:100%; border-collapse:collapse; font-size:13px;}
.schedule-table th, .schedule-table td{padding:9px 12px; text-align:right; border-bottom:1px solid var(--border); white-space:nowrap;}
.schedule-table th:first-child, .schedule-table td:first-child{text-align:left;}
.schedule-table thead th{position:sticky; top:0; background:#f8fafc; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); cursor:pointer;}
.schedule-table tbody td{font-family:'IBM Plex Mono'; }
.schedule-table tbody tr:hover{background:rgba(0,85,243,.05);}

.edu-section{padding:10px 0 50px;}
.edu-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px;}
@media (max-width:840px){.edu-grid{grid-template-columns:1fr;}}
.edu-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px;}
.edu-card h3{margin:0 0 10px; font-size:16px; font-weight:700;}
.edu-card p, .edu-card li{font-size:13.5px; line-height:1.7; color:var(--muted); margin:0 0 8px;}
.edu-card ul{padding-left:18px; margin:0;}
.formula-box{
  font-family:'IBM Plex Mono'; font-size:13px; background:rgba(0,85,243,.07); color:var(--text);
  border-left:3px solid var(--blue); border-radius:8px; padding:12px 14px; margin-bottom:12px; overflow-x:auto;
}
.skip-link{position:absolute; left:-9999px; top:0; background:var(--blue); color:#fff; padding:10px 16px; border-radius:0 0 8px 0; z-index:999;}
.skip-link:focus{left:0;}

@media print{
  .site-header, .site-footer, .mobile-drawer, .calc-actions, .related, .mode-toggle, .breadcrumb{display:none !important;}
  body{background:#fff; color:#000;}
  .panel, .edu-card, .schedule-wrap{break-inside:avoid; border-color:#ccc;}
}

/* ================= Upgrade: search panel, showcase, actions, exports ================= */
.sr-only{position:absolute!important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}
.smart-search-host{position:relative;}
.search-panel{
  position:absolute; left:0; right:0; top:calc(100% + 10px); z-index:80; display:none;
  background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow);
  padding:6px; max-height:min(60vh,420px); overflow:auto;
}
.search-panel.open{display:block;}
.search-hint{display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:10px 10px 6px;}
.search-row{display:flex; align-items:center; gap:11px; width:100%; padding:9px 10px; border-radius:10px; border:none; background:none; text-align:left; color:var(--text);}
.search-row.active{background:rgba(0,85,243,.08);}
html[data-theme="dark"] .search-row.active{background:rgba(92,147,255,.14);}
.sr-badge{width:32px; height:32px; flex:0 0 32px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-family:'IBM Plex Mono'; font-size:11px; font-weight:700;}
.sr-badge-plain{background:var(--bg); color:var(--muted);}
.sr-main{display:flex; flex-direction:column; min-width:0; flex:1;}
.sr-main strong{font-size:13.5px; font-weight:600;}
.sr-main small{font-size:11.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.sr-go{color:var(--muted);}
.search-empty{padding:18px 12px; font-size:13px; color:var(--muted); text-align:center;}

/* Hero upgrade */
.hero-stats{display:flex; gap:26px; flex-wrap:wrap; margin:22px 0 20px;}
.hero-stats div strong{display:block; font-family:'Space Grotesk'; font-size:22px; font-weight:700;}
.hero-stats div span{font-size:12px; color:var(--muted);}
.trust-row{display:flex; gap:14px; flex-wrap:wrap; font-size:12px; color:var(--muted);}
.trust-row span{display:inline-flex; align-items:center; gap:6px;}
.trust-row i{width:6px; height:6px; border-radius:50%; background:var(--green); display:inline-block;}

/* Hero showcase carousel */
.showcase{background:linear-gradient(150deg,var(--navy),var(--navy-3)); border-radius:22px; padding:20px; color:#fff;}
.showcase-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.showcase-live{display:inline-flex; align-items:center; gap:7px; font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color:#b9c9e6;}
.showcase-live i{width:8px; height:8px; border-radius:50%; background:var(--green); animation:ftPulse 1.8s infinite;}
@keyframes ftPulse{0%,100%{opacity:1;}50%{opacity:.25;}}
.showcase-nav{display:flex; gap:6px;}
.sc-btn{width:30px; height:30px; border-radius:9px; border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.08); color:#fff; display:flex; align-items:center; justify-content:center;}
.sc-btn:hover{background:rgba(255,255,255,.18);}
.showcase-stage{outline:none;}
.sc-slide{background:#fff; border-radius:16px; padding:16px; color:var(--text); animation:ftFade .35s ease;}
html[data-theme="dark"] .sc-slide{background:var(--surface);}
@keyframes ftFade{from{opacity:0; transform:translateY(8px);}to{opacity:1; transform:none;}}
.sc-slide-head{display:flex; align-items:center; gap:10px; margin-bottom:12px;}
.sc-slide-head strong{display:block; font-size:15px; font-family:'Space Grotesk';}
.sc-slide-head small{font-size:11px; color:var(--muted);}
.sc-badge{width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-family:'IBM Plex Mono'; font-size:11px; font-weight:700;}
.sc-inputs{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px;}
.sc-input{background:var(--bg); border-radius:9px; padding:7px 10px; min-width:88px;}
.sc-input small{display:block; font-size:10px; color:var(--muted);}
.sc-input b{font-family:'IBM Plex Mono'; font-size:12.5px;}
.sc-results{display:flex; flex-direction:column; gap:6px; margin-bottom:12px;}
.sc-row{display:flex; justify-content:space-between; gap:10px; font-size:12.5px; color:var(--muted);}
.sc-row b{font-family:'IBM Plex Mono'; color:var(--text); font-size:13px;}
.sc-row.hi b{color:var(--blue); font-size:16px;}
.sc-chart{display:flex; height:10px; border-radius:6px; overflow:hidden; background:var(--bg); margin-bottom:8px;}
.sc-chart span{transition:width .5s ease;}
.sc-legend{display:flex; gap:12px; flex-wrap:wrap; font-size:11px; color:var(--muted); margin-bottom:12px;}
.sc-legend i{width:8px; height:8px; border-radius:3px; display:inline-block; margin-right:5px;}
.sc-open{width:100%; justify-content:center;}
.showcase-dots{display:flex; gap:6px; justify-content:center; margin-top:14px;}
.showcase-dots button{width:7px; height:7px; padding:0; border-radius:50%; border:none; background:rgba(255,255,255,.3);}
.showcase-dots button.active{background:var(--green); width:18px; border-radius:4px;}
.showcase-chips{display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; justify-content:center;}
.chip-lite{font-size:11.5px; font-weight:600; color:var(--muted); background:var(--surface); border:1px solid var(--border); padding:6px 11px; border-radius:20px;}

/* Calculator: primary actions, empty state, chart, exports */
.calc-primary-actions{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:18px; padding-top:16px; border-top:1px dashed var(--border);}
.calc-primary-actions .button{justify-content:center;}
.input-row{display:flex; gap:8px;}
.input-row.has-unit input{flex:1; min-width:0;}
.unit-select{width:110px; flex:0 0 110px; padding:10px 8px; border-radius:9px; border:1px solid var(--border); background:#fbfcfe; color:var(--text); font-family:'IBM Plex Sans'; font-size:13.5px;}
html[data-theme="dark"] .unit-select{background:#0D1526;}
.result-empty{text-align:center; padding:34px 16px; border:1px dashed var(--border); border-radius:12px; color:var(--muted);}
.result-empty-icon{display:inline-flex; width:40px; height:40px; align-items:center; justify-content:center; border-radius:12px; background:rgba(0,85,243,.09); color:var(--blue); margin-bottom:10px;}
.result-empty strong{display:block; color:var(--text); font-size:14.5px; margin-bottom:4px;}
.result-empty p{margin:0; font-size:13px;}
.panel.is-loading{position:relative;}
.panel.is-loading::after{content:''; position:absolute; inset:0; border-radius:var(--radius); background:linear-gradient(90deg,transparent,rgba(0,85,243,.07),transparent); background-size:200% 100%; animation:ftShimmer .9s linear infinite;}
@keyframes ftShimmer{from{background-position:200% 0;}to{background-position:-200% 0;}}
.chart-block{display:grid; grid-template-columns:auto 1fr; gap:18px; align-items:center;}
@media (max-width:520px){.chart-block{grid-template-columns:1fr;}}
.donut-wrap{position:relative;}
.donut{transform:rotate(-90deg);}
.donut-seg{transition:stroke-width .18s ease, opacity .18s ease; cursor:pointer;}
.donut-seg:hover, .donut-seg:focus{stroke-width:24; outline:none;}
.donut-cap, .donut-total{transform:rotate(90deg); transform-origin:70px 70px; fill:var(--muted); font-size:9px; font-family:'IBM Plex Sans';}
.donut-total{fill:var(--text); font-size:13px; font-family:'IBM Plex Mono'; font-weight:600;}
.chart-tip{position:absolute; left:50%; top:-6px; transform:translate(-50%,-100%); background:var(--navy); color:#fff; padding:6px 10px; border-radius:8px; font-size:11.5px; white-space:nowrap; opacity:0; transition:.15s; pointer-events:none;}
html[data-theme="dark"] .chart-tip{background:#1d3462;}
.chart-tip.show{opacity:1;}
.chart-side .legend{flex-direction:column; gap:8px; margin-bottom:10px;}
.chart-side .li{justify-content:flex-start; gap:8px;}
.li-text{display:flex; flex-direction:column; font-size:12px;}
.li-text b{font-family:'IBM Plex Mono'; color:var(--text); font-size:13px;}
.li-pct{margin-left:auto; font-size:11.5px; color:var(--muted);}
.button-tiny{padding:7px 11px; font-size:12px;}
.export-wrap{padding-bottom:10px;}
.export-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px 22px; margin-top:18px;
  display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;}
.export-head h4{margin:0 0 4px; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted);}
.export-head p{margin:0; font-size:13px; color:var(--muted);}
.export-actions{display:flex; gap:8px; flex-wrap:wrap;}
.export-actions .button{padding:9px 13px; font-size:12.5px;}
.edu-steps{padding-left:18px; color:var(--muted); font-size:13.5px; line-height:1.7;}
.drawer-brand img{height:26px;}
@media (max-width:520px){
  .export-actions{width:100%;}
  .export-actions .button{flex:1 1 44%; justify-content:center;}
}
@media print{ .export-wrap, .search-panel, .showcase{display:none !important;} }

/* ---------- Offline indicator ---------- */
.offline-bar{
  position:fixed; left:50%; bottom:18px; transform:translate(-50%,140%);
  display:flex; align-items:center; gap:9px;
  background:var(--surface,#fff); color:var(--text,#101827);
  border:1px solid var(--border,#e3e8f0); border-radius:999px;
  padding:10px 18px; font-size:13.5px; font-weight:500;
  box-shadow:0 12px 30px rgba(0,18,52,.16); z-index:80;
  transition:transform .28s ease; max-width:calc(100vw - 32px);
}
.offline-bar.show{ transform:translate(-50%,0); }
.offline-dot{ width:8px; height:8px; border-radius:50%; background:#E0A82E; flex:none; }
@media print{ .offline-bar{ display:none !important; } }

/* ================= FinToolkit article, EEAT & category nav ================= */
.ft-byline{
  max-width:var(--maxw); margin:34px auto 0; padding:16px 24px;
  display:flex; flex-wrap:wrap; gap:10px 34px;
  border-top:1px solid var(--border); border-bottom:1px solid var(--border);
}
.ft-byline > div{display:flex; flex-direction:column; gap:2px;}
.ft-byline-label{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted);}
.ft-byline a, .ft-byline span:not(.ft-byline-label), .ft-byline time{font-size:13.5px; font-weight:600; color:var(--text);}
.ft-byline a{color:var(--blue);}

.ft-article{padding:30px 24px 4px; max-width:860px;}
.ft-article h2{font-size:22px; margin:34px 0 12px; line-height:1.3;}
.ft-article h3{font-size:16.5px; margin:24px 0 8px;}
.ft-article p, .ft-article li{font-size:15px; line-height:1.78; color:#33415c;}
.ft-article ul, .ft-article ol{padding-left:20px;}
.ft-article li{margin-bottom:6px;}
.ft-article a{color:var(--blue); text-decoration:underline; text-underline-offset:2px;}
.ft-article blockquote{margin:18px 0; padding:14px 18px; background:var(--surface); border-left:3px solid var(--blue); border-radius:0 10px 10px 0;}
.ft-article table{width:100%; border-collapse:collapse; margin:18px 0; font-size:14px; background:var(--surface); border:1px solid var(--border); border-radius:10px; overflow:hidden;}
.ft-article th, .ft-article td{padding:10px 12px; text-align:left; border-bottom:1px solid var(--border);}
.ft-article th{background:rgba(0,85,243,.06); font-weight:600;}
.ft-article tr:last-child td{border-bottom:none;}
.ft-article .formula-box, .ft-article .ft-formula{font-family:'IBM Plex Mono',monospace; font-size:13.5px; background:var(--surface); border:1px dashed var(--border); border-radius:10px; padding:12px 14px; margin:16px 0; overflow-x:auto;}
.ft-article .faq-q{font-size:15.5px; margin:22px 0 6px;}
.ft-article .faq-a{margin-top:0;}
.ft-article .ft-keytakeaway{background:rgba(50,192,2,.07); border:1px solid rgba(50,192,2,.28); border-radius:12px; padding:16px 18px; margin:20px 0;}

.ft-trust{padding:26px 24px 46px; max-width:var(--maxw);}
.ft-trust h2{font-size:20px; margin:0 0 16px;}
.ft-trust-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:14px;}
.ft-trust-grid > div{background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:16px 18px;}
.ft-trust-grid h3{font-size:14px; margin:0 0 6px;}
.ft-trust-grid p{font-size:13.4px; line-height:1.65; color:var(--muted); margin:0;}
.ft-trust-grid a{color:var(--blue);}

.ft-catnav{display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; margin:14px 0 8px;}
.ft-catnav a{display:flex; align-items:center; gap:10px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px 14px; font-size:14px; font-weight:600;}
.ft-catnav a:hover{border-color:var(--blue); color:var(--blue);}
.ft-catnav em{margin-left:auto; font-style:normal; font-size:12px; color:var(--muted); font-weight:500;}

html[data-theme="dark"] .ft-article p, html[data-theme="dark"] .ft-article li{color:#c3cee2;}
html[data-theme="dark"] .ft-article th{background:rgba(0,85,243,.16);}

.static-page .calculator-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; margin:14px 0 8px;}
.static-page .calculator-card{display:block; background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:18px;}
.static-page .calculator-card:hover{border-color:var(--blue); box-shadow:var(--shadow);}
.static-page .calculator-card h3{font-size:15.5px; margin:10px 0 6px;}
.static-page .calculator-card p{font-size:13.4px; color:var(--muted); margin:0; line-height:1.6;}
.static-page .badge-icon, .ft-catnav .badge-icon{display:inline-flex; align-items:center; justify-content:center; width:auto; min-width:30px; height:20px; padding:0 7px; border-radius:6px; color:#fff; font-size:11px; font-weight:700; font-family:'IBM Plex Mono',monospace;}

/* ================= FinToolkit icon family ================= */
.ft-icon{display:block; flex:none;}
.calc-icon{overflow:hidden;}
.calc-icon .ft-icon{width:20px; height:20px;}
.sr-badge .ft-icon,.sc-badge .ft-icon{width:18px; height:18px;}
.cat-head .badge-icon{color:#fff;}
.cat-head .badge-icon .ft-icon{width:16px; height:16px;}
.calc-ticker.calc-ticker-icon{display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; padding:0; border-radius:9px; flex:none;}
.category-pill .pill-icon{display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:8px; flex:none;}

/* ================= Footer branding block ================= */
.footer-brand-heading{
  font-family:'Space Grotesk',system-ui,sans-serif; font-size:17px; font-weight:700; color:#fff;
  margin:0 0 8px; line-height:1.25; letter-spacing:-.01em;
}
.site-footer .footer-copy{max-width:300px;}
.footer-trust{list-style:none; margin:14px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:8px 16px;}
.footer-trust li{display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:#c7d5ee; line-height:1.35;}
.footer-trust li svg{color:var(--green); flex:none;}

/* ================= Export: new Excel / Sheets row ================= */
.export-actions .button svg{flex:none;}
.mode-toggle button svg{flex:none;}
.export-actions .button.export-half{min-width:0;}

/* ================= Responsive polish (mobile first priority) =================
   Desktop layout above 900px is intentionally left untouched. */
html,body{max-width:100%; overflow-x:hidden;}
img,svg,table{max-width:100%;}
.schedule-scroll{-webkit-overflow-scrolling:touch;}
.ft-article,.static-page{overflow-wrap:anywhere;}
.ft-article table,.static-page table{display:block; overflow-x:auto;}

@media (max-width:900px){
  .container{padding:0 18px;}
  .ft-article,.ft-trust,.ft-byline{padding-left:18px; padding-right:18px;}
  .hero{padding:34px 0 40px;}
  .hero h1{font-size:clamp(27px,7.2vw,36px); line-height:1.16; margin-bottom:12px;}
  .hero p{font-size:15px; margin-bottom:20px;}
  .hero-actions{gap:12px; margin-bottom:20px;}
  .hero-stats{gap:18px; margin:18px 0 16px;}
  .hero-stats div strong{font-size:19px;}
  .search-band{padding:4px 0 32px;}
  .search-wrap{padding:18px; gap:14px;}
  .search-wrap h2{font-size:17px;}
  .search-box{max-width:none; width:100%;}
  .section{padding:36px 0;}
  .section-heading{margin-bottom:18px; gap:10px;}
  .section-heading h2{font-size:21px;}
  .split-section{gap:26px;}
  .newsletter-section{padding:34px 0;}
  .newsletter-card{padding:24px 20px; gap:18px;}
  .newsletter-card h2{font-size:19px;}
  .calc-page-header{padding:20px 0 4px;}
  .calc-title-row h1{font-size:22px; line-height:1.2;}
  .calc-sub{font-size:13.5px; margin-bottom:20px;}
  .calc-layout{gap:16px;}
  .panel{padding:18px;}
  .schedule-wrap{padding:16px;}
  .edu-card{padding:18px;}
  .edu-section{padding:6px 0 34px;}
  .static-page{padding:28px 0 46px;}
  .static-page h1{font-size:25px; line-height:1.2;}
  .static-page .updated{margin-bottom:22px;}
  .static-page h2{font-size:17px; margin:26px 0 8px;}
  .static-page p,.static-page li{font-size:14.5px; line-height:1.72;}
  .static-page ul{padding-left:18px;}
  .static-page li{margin-bottom:6px;}
  .static-page .callout{padding:16px 17px; margin:18px 0;}
  .ft-article h2{font-size:19.5px; margin:26px 0 10px;}
  .ft-article h3{font-size:16px; margin:20px 0 6px;}
  .ft-article p,.ft-article li{font-size:15px; line-height:1.72;}
  .ft-trust{padding-top:18px; padding-bottom:34px;}
  .site-footer{padding:32px 0 16px;}
  .footer-grid{gap:22px; padding-bottom:20px;}
}

@media (max-width:640px){
  .container{padding:0 16px;}
  .ft-article,.ft-trust,.ft-byline{padding-left:16px; padding-right:16px;}
  .header-inner{padding:10px 16px; gap:12px;}
  .brand-link img{height:26px;}
  .icon-button{width:38px; height:38px;}
  .hero{padding:26px 0 34px;}
  .hero-grid{gap:26px;}
  .eyebrow{margin-bottom:12px; font-size:11.5px;}
  .hero-actions{gap:10px;}
  .hero-actions .button{width:100%; justify-content:center;}
  .hero-stats{gap:14px 22px; margin:16px 0 14px;}
  .trust-row{gap:8px 14px;}
  .search-wrap{padding:16px; border-radius:16px;}
  .section{padding:30px 0;}
  .section-heading h2{font-size:20px;}
  .calculator-grid{grid-template-columns:1fr; gap:12px;}
  .calculator-card{padding:16px; gap:7px;}
  .calculator-card h3{font-size:16px; line-height:1.3;}
  .calculator-card p{font-size:13px;}
  .card-arrow{opacity:1; color:var(--muted);}
  .static-page .calculator-grid{grid-template-columns:1fr; gap:12px;}
  .ft-catnav{grid-template-columns:1fr; gap:8px;}
  .ft-catnav a{padding:12px 13px; font-size:13.5px;}
  .category-list{gap:8px;}
  .category-pill{padding:9px 13px; font-size:13px;}
  .principles{gap:20px;}
  .newsletter-card{padding:22px 18px; border-radius:18px;}
  .newsletter-form{width:100%;}
  .newsletter-form input{min-width:0; flex:1 1 100%;}
  .newsletter-form .button{width:100%; justify-content:center;}
  .faq-item button{padding:14px 15px; font-size:14px; gap:12px;}
  .faq-answer p{padding:0 15px 14px; font-size:13.5px;}
  .breadcrumb{font-size:12px; margin-bottom:10px; line-height:1.6; word-break:break-word;}
  .calc-title-row{gap:10px; align-items:flex-start;}
  .calc-title-row h1{font-size:20.5px;}
  .panel{padding:16px; border-radius:12px;}
  .panel-head{gap:10px; flex-wrap:wrap;}
  .mode-toggle button{padding:6px 9px; font-size:11.5px;}
  .field{margin-bottom:14px;}
  .field label{font-size:12.5px;}
  .field input[type=number],.field input[type=text],.field select{font-size:16px; padding:11px 12px;}
  .unit-select{width:96px; flex:0 0 96px; font-size:13px;}
  .result-row{padding:11px 13px;}
  .result-row .rvalue{font-size:14.5px;}
  .result-row.hi .rvalue{font-size:17px;}
  .chart-block{gap:14px;}
  .schedule-wrap{padding:14px; border-radius:12px;}
  .schedule-head{gap:10px;}
  .schedule-table{font-size:12.5px;}
  .schedule-table th,.schedule-table td{padding:8px 10px;}
  .export-card{padding:16px; gap:14px; flex-direction:column; align-items:stretch;}
  .edu-card{padding:16px;}
  .edu-card h3{font-size:15.5px;}
  .related{padding-bottom:34px;}
  .footer-grid{grid-template-columns:1fr 1fr; gap:20px 18px;}
  .footer-brand-heading{font-size:16px;}
  .site-footer .footer-copy{max-width:none;}
  .footer-bottom{gap:8px; font-size:11.5px;}
  .directory-toolbar{padding:12px 13px; gap:10px;}
  .chip{padding:7px 11px; font-size:12px;}
  .cat-head{gap:9px; flex-wrap:wrap;}
  .cat-head h2{font-size:15.5px;}
  .toast{left:16px; right:16px; bottom:16px; transform:translateY(10px); text-align:center;}
  .toast.show{transform:translateY(0);}
}

/* Export buttons: two per row, PDF full width, from tablet down */
@media (max-width:899px){
  .export-actions{width:100%; display:grid; grid-template-columns:1fr 1fr; gap:8px;}
  .export-actions .button{justify-content:center; padding:11px 8px; font-size:12.5px; width:100%; min-width:0; gap:6px;}
  .export-actions .button[data-act="pdf"]{grid-column:1 / -1;}
}

@media (max-width:380px){
  .container{padding:0 14px;}
  .hero h1{font-size:25px;}
  .section-heading h2{font-size:18.5px;}
  .calc-title-row h1{font-size:19px;}
  .footer-grid{grid-template-columns:1fr;}
  .export-actions .button{font-size:12px; padding:10px 8px;}
  .mode-toggle{width:100%; justify-content:space-between;}
}

/* Problem #1: Category page heading icon */
.cat-page-head{display:flex; align-items:center; gap:14px; margin:0 0 10px 0;}
.cat-page-head h1{margin:0; font-size:30px; font-weight:700;}
.cat-page-head .badge-icon{width:36px; height:36px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; color:#fff; flex-shrink:0;}
.cat-page-head .badge-icon .ft-icon{width:20px; height:20px;}
@media(max-width:768px){
  .cat-page-head h1{font-size:24px;}
  .cat-page-head .badge-icon{width:32px; height:32px;}
  .cat-page-head .badge-icon .ft-icon{width:18px; height:18px;}
}

/* ================= Google Sheets Interactive Export Modal ================= */
.ft-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 25, 47, 0.72);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: ftModalFadeIn 0.2s ease-out;
}
@keyframes ftModalFadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

/* Light Mode Card (Default) */
.ft-modal-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 520px;
  width: 100%;
  padding: 24px 28px;
  box-sizing: border-box;
  color: var(--text, #101827);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.ft-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ft-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 85, 243, 0.1);
  color: var(--blue, #0055F3);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(0, 85, 243, 0.15);
}
.ft-modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted, #5B6B82);
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.ft-modal-close:hover { color: var(--text, #101827); transform: scale(1.1); }
.ft-modal-close:focus-visible { outline: 2px solid var(--blue, #0055F3); outline-offset: 2px; border-radius: 4px; }
.ft-modal-body h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy, #001234);
}
.ft-modal-body p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted, #5B6B82);
  line-height: 1.5;
}
.ft-modal-body p strong {
  color: var(--text, #101827);
}
.ft-modal-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  padding: 11px 14px;
  border-radius: 9px;
  margin-bottom: 9px;
  font-size: 13.5px;
  color: var(--text, #101827);
  line-height: 1.45;
}
.ft-modal-step strong {
  color: var(--text, #101827);
}
.ft-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue, #0055F3);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.ft-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #E2E8F0);
}
.ft-modal-actions button:focus-visible {
  outline: 2px solid var(--blue, #0055F3);
  outline-offset: 2px;
}

/* ================= Dark Mode Dedicated Overrides ================= */
html[data-theme="dark"] .ft-modal-backdrop {
  background: rgba(5, 10, 20, 0.82);
  backdrop-filter: blur(8px);
}
html[data-theme="dark"] .ft-modal-card {
  background: var(--surface, #111A2E);
  border: 1px solid var(--border, #23314F);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(92, 147, 255, 0.1);
  color: var(--text, #E6ECF7);
}
html[data-theme="dark"] .ft-modal-badge {
  background: rgba(92, 147, 255, 0.15);
  color: #79A9FF;
  border-color: rgba(92, 147, 255, 0.3);
}
html[data-theme="dark"] .ft-modal-close {
  color: var(--muted, #93A4BF);
}
html[data-theme="dark"] .ft-modal-close:hover {
  color: #FFFFFF;
}
html[data-theme="dark"] .ft-modal-body h3 {
  color: #FFFFFF;
}
html[data-theme="dark"] .ft-modal-body p {
  color: var(--muted, #93A4BF);
}
html[data-theme="dark"] .ft-modal-body p strong {
  color: #FFFFFF;
}
html[data-theme="dark"] .ft-modal-step {
  background: #0B1325;
  border: 1px solid #1E2D4A;
  color: #DDE5F4;
}
html[data-theme="dark"] .ft-modal-step strong {
  color: #FFFFFF;
}
html[data-theme="dark"] .ft-step-num {
  background: #3B7BF6;
  color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(59, 123, 246, 0.25);
}
html[data-theme="dark"] .ft-modal-actions {
  border-top: 1px solid var(--border, #23314F);
}
html[data-theme="dark"] .ft-modal-actions .button-outline {
  background: #0B1325;
  border-color: #23314F;
  color: #DCE5F5;
}
html[data-theme="dark"] .ft-modal-actions .button-outline:hover {
  background: rgba(92, 147, 255, 0.12);
  border-color: var(--blue, #5C93FF);
  color: #FFFFFF;
}
html[data-theme="dark"] .ft-modal-actions .button-primary {
  background: #0055F3;
  color: #FFFFFF;
}
html[data-theme="dark"] .ft-modal-actions .button-primary:hover {
  background: #0041c4;
}

@media (max-width: 480px) {
  .ft-modal-actions { flex-direction: column-reverse; }
  .ft-modal-actions button { width: 100%; justify-content: center; }
}
