/* ==========================================================================
   TZAP Blog — Design System
   blog.tzapmarketing.com

   One file. No framework. No build step.
   Brand tokens come from the approved TZAP Blog & Tools prototype;
   the elevation, type scale and surface treatment are the premium pass.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */
:root {
  /* Surfaces */
  --paper:      #FFFFFF;
  --wash:       #FAFAFE;   /* barely there — sections breathe rather than band */
  --wash-2:     #F4F2FD;
  --line:       #EFEDF9;   /* card borders whisper */
  --line-2:     #E6E2F5;   /* structural rules speak */

  /* Ink */
  --ink:        #0F1533;
  --ink-2:      #4A5070;
  --ink-3:      #8D91AB;
  --ink-4:      #B4B7C8;

  /* Brand */
  --brand:      #5B34E8;
  --brand-600:  #4B25CE;
  --brand-700:  #3D1CAE;
  --brand-50:   #F1EDFE;
  --brand-100:  #E4DEFB;
  --brand-glow: rgba(91, 52, 232, .26);

  /* Semantic */
  --money:      #0F7A52;   /* every computed value, and nothing else */
  --money-50:   #E8F5EF;
  --alert:      #C2261F;
  --alert-50:   #FCEDEC;

  /* Tool accents — tonal, not saturated. Tint is the field, colour is the glyph. */
  --a-violet: #6D3BEA; --a-violet-bg: #F0EBFE;
  --a-green:  #0E8A4F; --a-green-bg:  #E8F6EE;
  --a-blue:   #1F5FE0; --a-blue-bg:   #E9F0FE;
  --a-orange: #C2560A; --a-orange-bg: #FDF0E6;
  --a-pink:   #C21D63; --a-pink-bg:   #FDECF3;
  --a-teal:   #0B7C77; --a-teal-bg:   #E5F4F3;
  --a-red:    #C42B2B; --a-red-bg:    #FCECEC;

  /* Type */
  --ui:   "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --read: "Newsreader", Georgia, "Times New Roman", serif;
  --data: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --t-2xs:  0.6875rem;
  --t-xs:   0.75rem;
  --t-sm:   0.8125rem;
  --t-base: 0.9375rem;
  --t-md:   1rem;
  --t-lg:   1.125rem;
  --t-xl:   1.3125rem;
  --t-2xl:  1.625rem;
  --t-3xl:  2.125rem;
  --t-4xl:  2.75rem;
  --t-5xl:  3.5rem;

  /* Rhythm */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 104px;

  /* Shape */
  --r-xs: 8px;  --r-sm: 10px; --r: 12px;
  --r-lg: 16px; --r-xl: 20px; --r-2xl: 26px;

  /* Elevation — layered, low opacity, never a grey blur */
  --e1: 0 1px 2px rgba(15,21,51,.04), 0 1px 3px rgba(15,21,51,.03);
  --e2: 0 2px 4px -1px rgba(15,21,51,.04), 0 12px 28px -14px rgba(15,21,51,.16);
  --e3: 0 4px 8px -2px rgba(15,21,51,.05), 0 28px 56px -24px rgba(15,21,51,.22);
  --e-hover: 0 2px 4px -1px rgba(15,21,51,.04), 0 20px 40px -20px var(--brand-glow);

  --ease: cubic-bezier(.22, .61, .36, 1);

  --maxw: 1240px;
  --readw: 700px;
  --header-h: 72px;
}

/* --- 2. Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--ui); font-size: var(--t-base); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.028em; line-height: 1.18; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: var(--s6) 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; }

/* --- 3. Layout ----------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s5); }
.section { padding-block: var(--s8); }
.section--tight { padding-block: var(--s7); }
.section--wash { background: var(--wash); border-block: 1px solid var(--line); }
.grid { display: grid; gap: var(--s4); }
.mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); } .mt-7 { margin-top: var(--s7); }
.muted { color: var(--ink-2); }
.center { text-align: center; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s5); margin-bottom: var(--s6); flex-wrap: wrap;
}
.section-head h2 { font-size: var(--t-2xl); letter-spacing: -.03em; }
.section-head p { color: var(--ink-2); margin-top: var(--s3); max-width: 54ch; line-height: 1.55; }

/* Label: hairline + small caps. Marks the section, does not decorate it. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--t-2xs); font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s3);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--ink-4); }

/* --- 4. Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: var(--t-base); font-weight: 600; letter-spacing: -.008em;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              box-shadow .18s var(--ease), transform .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(15,21,51,.08), 0 8px 18px -10px var(--brand-glow);
}
.btn--primary:hover { background: var(--brand-600); color: #fff; box-shadow: 0 2px 4px rgba(15,21,51,.1), 0 14px 26px -12px var(--brand-glow); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--line-2); box-shadow: var(--e1); }
.btn--ghost:hover { border-color: #D6D0EE; color: var(--ink); box-shadow: var(--e2); }
.btn--quiet { background: transparent; color: var(--brand); padding-inline: 0; font-weight: 650; }
.btn--quiet:hover { color: var(--brand-600); gap: 10px; }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 24px; font-size: var(--t-md); border-radius: var(--r); }
.btn--sm { padding: 8px 14px; font-size: var(--t-sm); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* --- 5. Header ----------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header__bar { height: var(--header-h); display: flex; align-items: center; gap: var(--s5); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo__mark { width: 42px; height: 32px; flex: none; display: block; }
.logo__text { font-size: 0.9375rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.logo__text small {
  display: block; font-size: 9px; font-weight: 700; letter-spacing: .16em;
  color: var(--ink-3); text-transform: uppercase; margin-top: 4px;
}

.nav { display: flex; align-items: center; margin-left: auto; }
.nav a {
  position: relative; color: var(--ink-2); font-size: var(--t-base); font-weight: 550;
  padding: 8px 11px; border-radius: var(--r-xs); white-space: nowrap;
  transition: color .16s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 0;
  height: 2px; background: var(--brand); border-radius: 2px;
}
@media (max-width: 1280px) { .nav a { font-size: var(--t-sm); padding: 8px 8px; } }
.header__actions { display: flex; align-items: center; gap: var(--s2); margin-left: var(--s4); }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: var(--r-xs);
  background: var(--paper); color: var(--ink-2); transition: all .16s var(--ease);
}
.icon-btn:hover { background: var(--wash-2); color: var(--ink); }
.nav-toggle { display: none; }
@media (max-width: 1040px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .header__actions .btn { display: none; }
}

/* --- 6. Drawer ----------------------------------------------------------- */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(15,21,51,.4); z-index: 150;
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease);
}
.drawer-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; inset: 0 auto 0 0; width: min(330px, 88vw); background: var(--paper);
  z-index: 160; transform: translateX(-100%); transition: transform .26s var(--ease);
  display: flex; flex-direction: column; overflow-y: auto; box-shadow: var(--e3);
}
.drawer[data-open="true"] { transform: none; }
.drawer__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 1;
}
.drawer__body { padding: var(--s3) var(--s4) var(--s7); }
.drawer__body a {
  display: flex; align-items: center; gap: var(--s3); padding: 11px var(--s3);
  border-radius: var(--r-sm); color: var(--ink); font-weight: 600; font-size: var(--t-md);
}
.drawer__body a:hover { background: var(--wash-2); }
.drawer__body a[aria-current="page"] { background: var(--brand-50); color: var(--brand); }
.drawer__body a svg { color: var(--ink-3); flex: none; }
.drawer__body a[aria-current="page"] svg { color: var(--brand); }
.drawer__label {
  padding: var(--s5) var(--s3) var(--s2); font-size: var(--t-2xs); font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
.drawer hr { margin: var(--s4) var(--s3); }
.drawer__cta {
  margin: var(--s4) var(--s3) 0; padding: var(--s5); border-radius: var(--r-lg);
  background: var(--brand-50); border: 1px solid var(--brand-100);
}
.drawer__cta b { display: block; font-size: var(--t-base); }
.drawer__cta p { font-size: var(--t-sm); color: var(--ink-2); margin: 6px 0 var(--s4); line-height: 1.5; }

/* --- 7. Bottom tab bar (mobile) ------------------------------------------ */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; display: none;
  background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 2px; color: var(--ink-3); font-size: 10px; font-weight: 700;
}
.bottomnav a[aria-current="page"] { color: var(--brand); }
@media (max-width: 780px) {
  .bottomnav { display: flex; }
  body { padding-bottom: 64px; }
  .header__bar { height: 62px; }
}

/* --- 8. Search ----------------------------------------------------------- */
.searchbox { position: relative; }
.searchbox input {
  width: 100%; padding: 13px 16px 13px 46px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--paper); font-size: var(--t-md); color: var(--ink);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.searchbox input::placeholder { color: var(--ink-3); }
.searchbox input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.searchbox__icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.searchbox--lg input { padding-block: 17px; font-size: var(--t-lg); border-radius: var(--r-lg); }

.searchrow {
  display: flex; gap: var(--s2); align-items: center; background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 7px 7px 7px 0;
  box-shadow: var(--e2);
}
.searchrow .searchbox { flex: 1; min-width: 0; }
.searchrow .searchbox input { border: 0; box-shadow: none !important; background: transparent; }
.searchrow .btn { flex: none; }
@media (max-width: 560px) { .searchrow { padding: 5px 5px 5px 0; } .searchrow .btn span { display: none; } }

.results {
  position: absolute; z-index: 90; left: 0; right: 0; top: calc(100% + 10px);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--e3); overflow: hidden; display: none; max-height: 62vh; overflow-y: auto;
}
.results[data-open="true"] { display: block; }
.results__group { padding: var(--s2) 0; border-top: 1px solid var(--line); }
.results__group:first-child { border-top: 0; }
.results__label {
  padding: var(--s2) var(--s4); font-size: var(--t-2xs); font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
.results a { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s4); color: var(--ink); }
.results a:hover, .results a.is-active { background: var(--brand-50); }
.results__name { font-weight: 600; font-size: var(--t-base); }
.results__meta { color: var(--ink-3); font-size: var(--t-sm); margin-left: auto; white-space: nowrap; }
.results__empty { padding: var(--s5) var(--s4); color: var(--ink-2); text-align: center; }

/* --- 9. Hero ------------------------------------------------------------- */
.hero {
  position: relative; padding-block: var(--s8) var(--s7); overflow: hidden;
  background:
    radial-gradient(720px 420px at 12% -10%, rgba(124,77,255,.13), transparent 62%),
    radial-gradient(620px 380px at 88% 0%, rgba(91,52,232,.07), transparent 60%);
}
.hero__grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: var(--s8); align-items: start; }
.hero__grid > * { min-width: 0; }
.hero h1 { font-size: 3.05rem; font-weight: 800; letter-spacing: -.042em; line-height: 1.06; max-width: 13ch; }
.hero h1 em { max-width: none; }
.hero h1 em { font-style: normal; color: var(--brand); display: block; }
.hero__sub { color: var(--ink-2); font-size: var(--t-lg); margin-top: var(--s5); max-width: 46ch; line-height: 1.55; }
.hero__actions { display: flex; gap: var(--s3); margin-top: var(--s6); flex-wrap: wrap; }

/* Assurances read as one quiet line, not three shouting pills */
.assure {
  display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); margin-bottom: var(--s5);
}
.assure span { display: inline-flex; align-items: center; gap: 7px; }
.assure svg { color: var(--brand); }
.assure i { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }

.hero__stats {
  display: flex; gap: var(--s7); margin-top: var(--s7);
  padding-top: var(--s6); border-top: 1px solid var(--line-2); flex-wrap: wrap;
}
.hero__stats div { display: flex; flex-direction: column; gap: 3px; }
.hero__stats b {
  font-size: var(--t-2xl); font-weight: 800; letter-spacing: -.035em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.hero__stats span { font-size: var(--t-sm); color: var(--ink-3); font-weight: 550; }

@media (max-width: 980px) {
  .hero { padding-block: var(--s7) var(--s6); }
  .hero h1 { max-width: none; margin-inline: auto; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s7); text-align: center; }
  .hero h1 { font-size: 2.375rem; }
  .hero__sub { margin-inline: auto; font-size: var(--t-md); }
  .assure, .hero__actions { justify-content: center; }
  .hero__stats { justify-content: center; gap: var(--s6); margin-top: var(--s6); }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 2rem; }
  .hero__actions { flex-wrap: nowrap; gap: var(--s2); }
  .hero__actions .btn { flex: 1; padding-inline: 12px; font-size: var(--t-base); }
  .hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); text-align: center; }
  .hero__stats b { font-size: var(--t-lg); }
  .hero__stats span { font-size: var(--t-2xs); }
}

/* --- 10. Tool cards ------------------------------------------------------ */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
@media (max-width: 1040px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .tool-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s3); } }
@media (max-width: 420px)  { .tool-grid { grid-template-columns: minmax(0, 1fr); } }

.tool-card {
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
  padding: var(--s5); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--ink); box-shadow: var(--e1);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.tool-card:hover { color: var(--ink); border-color: var(--brand-100); box-shadow: var(--e-hover); transform: translateY(-3px); }
.tool-card__icon {
  width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center;
  margin-bottom: var(--s3); background: var(--brand-50); color: var(--brand);
  transition: transform .2s var(--ease);
}
.tool-card:hover .tool-card__icon { transform: scale(1.06); }
.tool-card__name { font-size: var(--t-md); font-weight: 700; letter-spacing: -.02em; line-height: 1.28; }
.tool-card__desc { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.5; }
.tool-card__cta {
  margin-top: auto; padding-top: var(--s4); font-size: var(--t-sm); font-weight: 650;
  color: var(--brand); display: inline-flex; align-items: center; gap: 6px;
}
.tool-card__cta svg { transition: transform .2s var(--ease); }
.tool-card:hover .tool-card__cta svg { transform: translateX(4px); }

.tool-card__icon[data-c="violet"] { background: var(--a-violet-bg); color: var(--a-violet); }
.tool-card__icon[data-c="green"]  { background: var(--a-green-bg);  color: var(--a-green); }
.tool-card__icon[data-c="blue"]   { background: var(--a-blue-bg);   color: var(--a-blue); }
.tool-card__icon[data-c="orange"] { background: var(--a-orange-bg); color: var(--a-orange); }
.tool-card__icon[data-c="pink"]   { background: var(--a-pink-bg);   color: var(--a-pink); }
.tool-card__icon[data-c="teal"]   { background: var(--a-teal-bg);   color: var(--a-teal); }
.tool-card__icon[data-c="red"]    { background: var(--a-red-bg);    color: var(--a-red); }

/* Compact variant for the homepage grid */
.tool-grid--tight { grid-template-columns: repeat(5, 1fr); gap: var(--s3); }
.tool-grid--tight .tool-card { padding: var(--s4); gap: 4px; }
.tool-grid--tight .tool-card__icon { width: 36px; height: 36px; margin-bottom: var(--s3); border-radius: var(--r-sm); }
.tool-grid--tight .tool-card__name { font-size: var(--t-base); }
.tool-grid--tight .tool-card__desc {
  font-size: var(--t-xs); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.tool-grid--tight .tool-card__cta { display: none; }
@media (max-width: 1180px) { .tool-grid--tight { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .tool-grid--tight { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .tool-grid--tight { grid-template-columns: repeat(2, 1fr); } }

/* --- 11. The calculator — signature component ---------------------------- */
.calc {
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-2xl);
  box-shadow: var(--e3); overflow: hidden; min-width: 0;
}
.calc__head {
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s3);
  background: linear-gradient(180deg, #FCFBFF, var(--paper));
}
.calc__title { font-size: var(--t-md); font-weight: 700; letter-spacing: -.02em; }
.calc__head .eyebrow {
  margin: 0 0 0 auto; background: var(--money-50); color: var(--money);
  padding: 4px 10px; border-radius: 999px; font-size: 10px; letter-spacing: .1em;
}
.calc__head .eyebrow::before { display: none; }
.calc__body { padding: var(--s5); display: grid; gap: var(--s5); min-width: 0; }

.field { display: grid; gap: 7px; min-width: 0; }
.field > label { font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); }
.field__hint { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.45; }
.field__wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.field__prefix, .field__suffix {
  position: absolute; color: var(--ink-2); font-size: var(--t-md); font-weight: 600; pointer-events: none;
}
.field__prefix { left: 14px; }
.field__suffix { right: 15px; }
.field input[type="text"], .field input[type="number"], .field input[type="url"],
.field input[type="email"], .field input[type="date"], .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--paper); font-size: var(--t-md); font-family: var(--data);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field textarea { font-family: var(--ui); resize: vertical; min-height: 92px; letter-spacing: 0; }
.field select { font-family: var(--ui); cursor: pointer; max-width: 100%; text-overflow: ellipsis; }
.field input:hover, .field select:hover { border-color: #DDD8F0; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50);
}
/* These must out-specify the `.field input[type=...]` rule above (0,2,1). */
.field--prefixed input[type="number"],
.field--prefixed input[type="text"],
.field--prefixed input[type="url"] { padding-left: 36px; }
.field--suffixed input[type="number"],
.field--suffixed input[type="text"] { padding-right: 44px; }
.field input[aria-invalid="true"] { border-color: var(--alert); }
.field__error {
  font-size: var(--t-sm); color: var(--alert); font-weight: 600;
  background: var(--alert-50); padding: 10px 13px; border-radius: var(--r-sm);
}

/* Paired fields, e.g. width and height on the image tools */
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--s4); }
@media (max-width: 560px) { .field-row { grid-template-columns: minmax(0,1fr); } }

/* File picker sits inside the same field rhythm as the text inputs */
.field input[type="file"] { font-family: var(--ui); font-size: var(--t-base); cursor: pointer; }

/* Rate slabs — drawn from the real GST bands */
.slabs { display: flex; flex-wrap: wrap; gap: var(--s2); }
.slab {
  padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--paper); font-size: var(--t-base); font-weight: 650;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
  transition: all .16s var(--ease);
}
.slab:hover { border-color: #D6D0EE; color: var(--ink); }
.slab[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 6px 14px -8px var(--brand-glow);
}

.calc__actions { display: flex; gap: var(--s3); }
.calc__actions .btn--primary { flex: 1; }

/* The Result Strip — a ledger, read the way a bill reads */
.strip {
  border-top: 1px solid var(--line-2); padding: var(--s5); display: none;
  background: linear-gradient(180deg, #FBFAFF, #F7F5FE);
}
.strip[data-open="true"] { display: block; }
.strip__lead {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  padding-bottom: var(--s4); border-bottom: 1px solid var(--line-2); flex-wrap: wrap;
}
.strip__lead-label { font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); }
.strip__lead-value {
  font-family: var(--data); font-variant-numeric: tabular-nums;
  font-size: var(--t-3xl); font-weight: 600; letter-spacing: -.045em;
  color: var(--money); line-height: 1.05; margin-left: auto;
}
.strip__rows { list-style: none; margin-top: var(--s2); }
.strip__rows li {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--t-base);
}
.strip__rows li:last-child { border-bottom: 0; }
.strip__rows .k { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.strip__rows .v {
  font-family: var(--data); font-variant-numeric: tabular-nums;
  font-weight: 600; letter-spacing: -.025em; white-space: nowrap;
}
.strip__rows li[data-emphasis="true"] {
  border-bottom: 0; border-top: 2px solid var(--ink); margin-top: var(--s3); padding-top: var(--s4);
}
.strip__rows li[data-emphasis="true"] .k { color: var(--ink); font-weight: 700; }
.strip__rows li[data-emphasis="true"] .v { font-size: var(--t-lg); }
.strip__foot { display: flex; gap: var(--s3); margin-top: var(--s5); align-items: center; flex-wrap: wrap; }
.strip__note { font-size: var(--t-xs); color: var(--ink-3); flex: 1; min-width: 190px; line-height: 1.5; }
.strip__out {
  font-family: var(--data); font-size: var(--t-sm); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: var(--s4);
  color: var(--ink-2); overflow-wrap: anywhere; margin-top: var(--s4);
}
.copied { color: var(--money); font-weight: 650; }

/* --- 12. Tool page ------------------------------------------------------- */
.toolpage { padding-block: var(--s6) var(--s8); }
.toolpage__grid { display: grid; grid-template-columns: minmax(0,1fr) 304px; gap: var(--s8); align-items: start; }
@media (max-width: 980px) { .toolpage__grid { grid-template-columns: minmax(0,1fr); gap: var(--s7); } }
.toolpage__grid > * { min-width: 0; }
.toolpage__head { max-width: 62ch; margin-bottom: var(--s6); }
.toolpage__head h1 { font-size: var(--t-4xl); margin-top: var(--s4); letter-spacing: -.038em; }
.toolpage__head p { color: var(--ink-2); font-size: var(--t-lg); margin-top: var(--s4); line-height: 1.55; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; font-size: var(--t-sm); color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-current] { color: var(--ink-2); }

.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--s4); }
@media (max-width: 980px) { .sidebar { position: static; } }
.panel {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5);
  background: var(--paper); box-shadow: var(--e1);
}
.panel h3 {
  font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .13em;
  color: var(--ink-3); margin-bottom: var(--s4); font-weight: 700;
}
.panel ul { list-style: none; display: grid; gap: 1px; }
.panel ul:not(.rank-list) a {
  display: block; padding: 8px 10px; margin-inline: -10px; border-radius: var(--r-xs);
  color: var(--ink); font-size: var(--t-base); font-weight: 550;
}
.panel ul:not(.rank-list) a:hover { background: var(--wash-2); color: var(--ink); }
.panel--cta {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-700) 100%);
  border-color: transparent; color: #fff; box-shadow: 0 18px 36px -20px var(--brand-glow);
}
.panel--cta h3 { color: rgba(255,255,255,.62); }
.panel--cta p { color: rgba(255,255,255,.88); font-size: var(--t-base); margin-bottom: var(--s5); line-height: 1.5; }
.panel--cta .btn { background: #fff; color: var(--brand); width: 100%; box-shadow: none; }
.panel--cta .btn:hover { background: #F4F1FE; color: var(--brand-700); }

.toc {
  border: 1px solid var(--line); border-left: 2px solid var(--brand-100);
  border-radius: var(--r-lg); padding: var(--s5); background: var(--wash); margin-block: var(--s7);
}
.toc h2 { font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .13em; color: var(--ink-3); margin-bottom: var(--s4); font-weight: 700; }
.toc ol { list-style: none; counter-reset: toc; display: grid; gap: 9px; }
.toc li { counter-increment: toc; display: flex; gap: var(--s3); font-size: var(--t-base); }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--data); font-size: var(--t-xs); color: var(--ink-4); padding-top: 3px;
}
.toc a { color: var(--ink-2); font-weight: 550; }
.toc a:hover { color: var(--brand); }

/* --- 13. Editorial prose ------------------------------------------------- */
.prose {
  max-width: var(--readw); font-family: var(--read); font-size: 1.1875rem;
  line-height: 1.68; color: #1B2038;
}
.prose > * + * { margin-top: var(--s5); }
.prose h2 {
  font-family: var(--ui); font-size: var(--t-2xl); margin-top: var(--s8);
  letter-spacing: -.03em; scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h3 { font-family: var(--ui); font-size: var(--t-xl); margin-top: var(--s7); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h4 { font-family: var(--ui); font-size: var(--t-md); margin-top: var(--s5); }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: 10px; }
.prose li::marker { color: var(--ink-4); }
.prose strong { font-weight: 650; color: var(--ink); }
.prose code { font-family: var(--data); font-size: .84em; background: var(--wash-2); padding: 3px 7px; border-radius: 6px; }
.prose blockquote { border-left: 2px solid var(--brand); padding-left: var(--s5); color: var(--ink-2); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--ui); font-size: var(--t-base); }
.prose th, .prose td { text-align: left; padding: 12px var(--s4); border-bottom: 1px solid var(--line); }
.prose th {
  background: var(--wash); font-weight: 700; font-size: var(--t-2xs);
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2);
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:not(:first-child), .prose th:not(:first-child) { font-variant-numeric: tabular-nums; text-align: right; }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }

.example {
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: var(--s5) var(--s6); background: var(--wash);
  font-family: var(--ui); font-size: var(--t-base);
}
.example h4 {
  margin: 0 0 var(--s4); font-size: var(--t-2xs); text-transform: uppercase;
  letter-spacing: .13em; color: var(--ink-3); font-weight: 700;
}
.example dl { display: grid; grid-template-columns: 1fr auto; gap: 10px var(--s5); margin: 0; }
.example dt { color: var(--ink-2); }
.example dd { margin: 0; font-family: var(--data); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.example dd[data-result="true"] { color: var(--money); font-size: var(--t-md); }

.formula {
  font-family: var(--data); font-size: var(--t-base); background: #171C3A; color: #DCD8F2;
  padding: var(--s5) var(--s6); border-radius: var(--r-lg); overflow-x: auto; line-height: 1.8;
}
.formula b { color: #A78BFA; font-weight: 600; }

.faq { display: grid; border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s5) 0; font-weight: 650;
  font-family: var(--ui); font-size: var(--t-md); letter-spacing: -.015em;
  display: flex; gap: var(--s5); align-items: flex-start; justify-content: space-between; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--data); font-size: var(--t-xl); color: var(--ink-3); line-height: 1; flex: none; }
.faq details[open] summary { padding-bottom: var(--s3); }
.faq details[open] summary::after { content: "\2212"; color: var(--brand); }
.faq details > div { padding-bottom: var(--s5); color: var(--ink-2); font-family: var(--read); font-size: 1.0625rem; line-height: 1.65; }

/* --- 14. Article -------------------------------------------------------- */
.article__head { max-width: var(--readw); }
.article__head h1 { font-size: var(--t-4xl); margin-top: var(--s4); letter-spacing: -.038em; }
.article__standfirst {
  font-family: var(--read); font-size: var(--t-xl); color: var(--ink-2);
  margin-top: var(--s5); line-height: 1.55;
}
.byline {
  display: flex; align-items: center; gap: var(--s4); margin-top: var(--s6);
  padding-block: var(--s5); border-block: 1px solid var(--line-2); flex-wrap: wrap;
}
.byline__avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand-50);
  color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none;
}
.byline__who b { font-weight: 700; }
.byline__meta { font-size: var(--t-sm); color: var(--ink-3); display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: 2px; }

.card-list { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--s5); }
@media (max-width: 900px) { .card-list { grid-template-columns: repeat(2,1fr); gap: var(--s4); } }
@media (max-width: 600px) { .card-list { grid-template-columns: minmax(0,1fr); } }
.post {
  display: flex; flex-direction: column; gap: var(--s3); color: var(--ink); min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5);
  background: var(--paper); box-shadow: var(--e1);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.post:hover { color: var(--ink); border-color: var(--brand-100); box-shadow: var(--e-hover); transform: translateY(-3px); }
.post__cat { font-size: var(--t-2xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.post__title { font-size: var(--t-md); font-weight: 700; letter-spacing: -.022em; line-height: 1.34; }
.post__excerpt { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }
.post__meta { margin-top: auto; padding-top: var(--s4); font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.post-row {
  display: flex; gap: var(--s4); padding: var(--s4) 0;
  border-bottom: 1px solid var(--line); color: var(--ink); align-items: baseline;
}
.post-row:hover { color: var(--brand); }
.post-row__idx { font-family: var(--data); font-size: var(--t-sm); color: var(--ink-4); flex: none; width: 26px; }
.post-row__title { font-weight: 600; font-size: var(--t-md); letter-spacing: -.018em; }

/* --- 15. Rail and categories -------------------------------------------- */
.home-split { display: grid; grid-template-columns: minmax(0,1fr) 304px; gap: var(--s7); align-items: start; }
@media (max-width: 1040px) { .home-split { grid-template-columns: minmax(0,1fr); } }
.home-split > * { min-width: 0; }
.rail { display: grid; gap: var(--s4); position: sticky; top: calc(var(--header-h) + 20px); }
@media (max-width: 1040px) { .rail { position: static; } }

.rank-list { list-style: none; display: grid; }
.rank-list li { border-top: 1px solid var(--line); }
.rank-list li:first-child { border-top: 0; }
.rank-list a { display: flex; align-items: flex-start; gap: var(--s3); padding: 11px 0; color: var(--ink); }
.rank-list a:hover { color: var(--brand); }
.rank-list .n {
  width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--wash-2);
  color: var(--ink-2); font-size: 10px; font-weight: 700; display: grid; place-items: center;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.rank-list a:hover .n { background: var(--brand-50); color: var(--brand); }
.rank-list a > span:nth-child(2) { flex: 1; min-width: 0; font-size: var(--t-sm); font-weight: 600; line-height: 1.4; }
.rank-list .uses { flex: none; white-space: nowrap; font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 2px; }

.panel--news { background: var(--wash); }
.panel--news h3 {
  color: var(--ink); font-size: var(--t-md); text-transform: none;
  letter-spacing: -.022em; font-weight: 700; margin-bottom: var(--s3);
}
.panel--news p { color: var(--ink-2); font-size: var(--t-sm); margin-bottom: var(--s4); line-height: 1.5; }
.panel--news form { display: grid; gap: var(--s2); }
.panel--news input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--paper); font-size: var(--t-base);
}
.panel--news input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.panel--news small { display: block; margin-top: var(--s3); color: var(--ink-3); font-size: var(--t-xs); }

.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s3); }
@media (max-width: 1040px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .cat-grid { grid-template-columns: minmax(0,1fr); } }
.cat-card {
  display: flex; flex-direction: column; gap: 5px; padding: var(--s5);
  border-radius: var(--r-lg); border: 1px solid var(--line); color: var(--ink);
  background: var(--paper); box-shadow: var(--e1); min-width: 0;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.cat-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--e-hover); border-color: var(--brand-100); }
.cat-card__icon { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: var(--s3); }
.cat-card__name { font-weight: 700; font-size: var(--t-base); letter-spacing: -.02em; }
.cat-card__desc { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.5; }
.cat-card[data-c="violet"] .cat-card__icon { background: var(--a-violet-bg); color: var(--a-violet); }
.cat-card[data-c="green"]  .cat-card__icon { background: var(--a-green-bg);  color: var(--a-green); }
.cat-card[data-c="blue"]   .cat-card__icon { background: var(--a-blue-bg);   color: var(--a-blue); }
.cat-card[data-c="pink"]   .cat-card__icon { background: var(--a-pink-bg);   color: var(--a-pink); }
.cat-card[data-c="orange"] .cat-card__icon { background: var(--a-orange-bg); color: var(--a-orange); }

/* --- 16. CTA, newsletter, footer ---------------------------------------- */
.cta-band {
  border-radius: var(--r-2xl); padding: var(--s7);
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #fff; display: flex; gap: var(--s6); align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-block: var(--s8);
  box-shadow: 0 24px 48px -28px var(--brand-glow);
}
.cta-band h3 { font-size: var(--t-xl); letter-spacing: -.028em; }
.cta-band p { color: rgba(255,255,255,.82); margin-top: var(--s3); max-width: 52ch; line-height: 1.55; }
.cta-band .btn { background: #fff; color: var(--brand); box-shadow: none; }
.cta-band .btn:hover { background: #F4F1FE; color: var(--brand-700); }

.newsletter { background: #12172F; border-radius: var(--r-2xl); padding: var(--s8); color: #fff; }
.newsletter__grid { display: grid; grid-template-columns: 1fr 420px; gap: var(--s8); align-items: center; }
@media (max-width: 860px) { .newsletter { padding: var(--s6) var(--s5); } .newsletter__grid { grid-template-columns: minmax(0,1fr); gap: var(--s5); } }
.newsletter h2 { font-size: var(--t-2xl); color: #fff; letter-spacing: -.03em; }
.newsletter p { color: rgba(255,255,255,.62); margin-top: var(--s4); line-height: 1.55; }
.newsletter form { display: flex; gap: var(--s2); }
.newsletter input {
  flex: 1; min-width: 0; padding: 13px 16px; border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
  color: #fff; font-size: var(--t-md);
}
.newsletter input::placeholder { color: rgba(255,255,255,.4); }
.newsletter input:focus { outline: none; border-color: var(--brand); background: rgba(255,255,255,.09); }
.newsletter small { display: block; margin-top: var(--s4); color: rgba(255,255,255,.42); font-size: var(--t-xs); }
@media (max-width: 480px) { .newsletter form { flex-direction: column; } }

.footer { border-top: 1px solid var(--line); background: var(--wash); padding-block: var(--s8) var(--s5); margin-top: var(--s9); }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: var(--s6); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s5); } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: minmax(0,1fr); } }
.footer h4 { font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .13em; color: var(--ink-3); margin-bottom: var(--s4); font-weight: 700; }
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer a { color: var(--ink-2); font-size: var(--t-base); }
.footer a:hover { color: var(--brand); }
.footer__about p { color: var(--ink-2); font-size: var(--t-sm); margin-top: var(--s4); max-width: 34ch; line-height: 1.55; }
.footer__legal {
  margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  font-size: var(--t-sm); color: var(--ink-3);
}

/* --- 17. Chips ----------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--paper); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2);
  transition: all .16s var(--ease);
}
a.chip:hover { border-color: var(--brand); color: var(--brand); }
a.chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }

@media print {
  .header, .footer, .sidebar, .newsletter, .cta-band, .bottomnav, .drawer, .drawer-scrim { display: none; }
}

/* Nav carries nine items now; tighten earlier so the CTA never clips. */
@media (max-width: 1400px) { .nav a { font-size: var(--t-sm); padding: 8px 7px; } .header__bar { gap: var(--s4); } }
@media (max-width: 1200px) { .nav a { padding: 8px 6px; letter-spacing: -.01em; } .header__actions .btn { padding: 8px 12px; } }
@media (max-width: 1120px) { .nav { display: none; } .nav-toggle { display: grid; } }
