/* ---------------------------------------------------------------------------
   Avatar Tools - design system
   Hand-written rather than Tailwind-from-CDN: the play CDN compiles in the
   browser on every load, which costs a render-blocking script and a flash of
   unstyled content. This file is ~10KB and ships as one cached request.
   --------------------------------------------------------------------------- */

/* Light is the base. Every colour is defined here so nothing depends on a
   media query resolving; dark only overrides. */
:root {
  --bg:            #ffffff;
  --bg-sunken:     #f2f5f7;
  --bg-raised:     #ffffff;
  --bg-inset:      #e9eef2;
  --border:        #dde4ea;
  --border-strong: #b9c4ce;
  --text:          #0e1620;
  --text-muted:    #55636f;
  --text-faint:    #8592a0;

  /* The old palette was one desaturated green over a lot of grey, which read
     as flat. Same hues carried further, so surfaces separate from each other
     and the accent actually looks like an accent. */
  --brand:         #0a8f63;
  --brand-hover:   #077553;
  --brand-fg:      #ffffff;
  --brand-tint:    #e7f7f0;
  --brand-deep:    #06563d;

  --accent:        #5250d6;
  --accent-tint:   #ecebfc;
  --warn:          #a86400;
  --warn-tint:     #fdf3e0;
  --danger:        #cc2200;
  --danger-tint:   #fdeeeb;
  --ok:            #0a8f63;
  --ok-tint:       #e7f7f0;

  /* Category accents, so the four groups are distinguishable at a glance. */
  --cat-calculators: #0a8f63;
  --cat-lists:       #2f6fd0;
  --cat-csv:         #a86400;
  --cat-audit:       #7c3aed;

  --shadow-sm: 0 1px 2px rgba(14, 22, 32, .05), 0 2px 6px rgba(14, 22, 32, .05);
  --shadow-md: 0 2px 6px rgba(14, 22, 32, .05), 0 12px 32px rgba(14, 22, 32, .10);
  --shadow-lg: 0 4px 12px rgba(14, 22, 32, .07), 0 24px 56px rgba(14, 22, 32, .14);

  --radius:    10px;
  --radius-lg: 16px;
  --maxw:      1120px;
  --header-h:  64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  color-scheme: light;
}

/* System preference, unless the user explicitly chose light. */
:root:not([data-theme="light"]) { }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0a0e13;
    --bg-sunken:     #11171f;
    --bg-raised:     #161d26;
    --bg-inset:      #1f2833;
    --border:        #263341;
    --border-strong: #3a4a5c;
    --text:          #eef2f6;
    --text-muted:    #a3b1c0;
    --text-faint:    #74838f;

    --brand:         #2ee0a0;
    --brand-hover:   #55edb5;
    --brand-fg:      #04241a;
    --brand-tint:    #0d2a22;
    --brand-deep:    #7df3c8;

    --accent:        #8b8bf0;
    --accent-tint:   #1b1b38;
    --warn:          #f0b429;
    --warn-tint:     #2e2410;
    --danger:        #ff7a63;
    --danger-tint:   #331813;
    --ok:            #2ee0a0;
    --ok-tint:       #0d2a22;

    --cat-calculators: #2ee0a0;
    --cat-lists:       #6aa8ff;
    --cat-csv:         #f0b429;
    --cat-audit:       #a78bfa;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, .55);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, .6);

    color-scheme: dark;
  }
}

/* Explicit choice wins over the media query, in both directions. */
:root[data-theme="dark"] {
  --bg:            #0a0e13;
  --bg-sunken:     #11171f;
  --bg-raised:     #161d26;
  --bg-inset:      #1f2833;
  --border:        #263341;
  --border-strong: #3a4a5c;
  --text:          #eef2f6;
  --text-muted:    #a3b1c0;
  --text-faint:    #74838f;

  --brand:         #2ee0a0;
  --brand-hover:   #55edb5;
  --brand-fg:      #04241a;
  --brand-tint:    #0d2a22;
  --brand-deep:    #7df3c8;

  --accent:        #8b8bf0;
  --accent-tint:   #1b1b38;
  --warn:          #f0b429;
  --warn-tint:     #2e2410;
  --danger:        #ff7a63;
  --danger-tint:   #331813;
  --ok:            #2ee0a0;
  --ok-tint:       #0d2a22;

  --cat-calculators: #2ee0a0;
  --cat-lists:       #6aa8ff;
  --cat-csv:         #f0b429;
  --cat-audit:       #a78bfa;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, .6);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); letter-spacing: -.022em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); letter-spacing: -.018em; }
h3 { font-size: 1.175rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.mono  { font-family: var(--mono); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--gap, 16px); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--brand-fg);
  padding: 10px 18px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* --- header ------------------------------------------------------------- */

.hdr {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.hdr.is-scrolled { border-bottom-color: var(--border); }
.hdr .wrap { display: flex; align-items: center; gap: 16px; width: 100%; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.02em;
  color: var(--text); flex: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: var(--brand); color: var(--brand-fg);
  display: grid; place-items: center;
  font-size: .8125rem; font-weight: 800;
}

.hdr-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.hdr-nav a {
  color: var(--text-muted); font-size: .9375rem; font-weight: 500;
  padding: 7px 12px; border-radius: 8px;
}
.hdr-nav a:hover { color: var(--text); background: var(--bg-inset); text-decoration: none; }
.hdr-nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 640px) { .hdr-nav a.opt { display: none; } }

.theme-btn {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-raised); color: var(--text-muted);
  cursor: pointer; padding: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-btn svg { width: 17px; height: 17px; }
:root:not([data-theme="dark"]) .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun  { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: block; }
}

/* --- header menus -------------------------------------------------------
   The home page lists one category, so these are the route to everything
   else. Hover opens them on a pointer; click and keyboard work everywhere,
   which matters because hover alone strands touch users. */

.nav-menu { position: relative; }
.nav-top {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: .9375rem; font-weight: 500;
  color: var(--text-muted); background: none; border: 0; cursor: pointer;
  padding: 7px 11px; border-radius: 9px;
}
.nav-top svg { width: 14px; height: 14px; transition: transform .18s; }
.nav-top:hover { color: var(--text); background: var(--bg-inset); }
.nav-menu[data-open] .nav-top { color: var(--text); background: var(--bg-inset); }
.nav-menu[data-open] .nav-top svg { transform: rotate(180deg); }

/* Shown by toggling display rather than fading visibility. Transitioning
   visibility alongside opacity is a well-known source of half-painted panels,
   and it cost an afternoon here: the box rendered, its contents did not. */
.nav-drop {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  width: min(23rem, 88vw); z-index: 60;
  background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
}
.nav-menu[data-open] .nav-drop { display: block; animation: nav-drop-in .16s ease; }
@keyframes nav-drop-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%); }
}
.nav-drop::before {
  content: ''; position: absolute; inset: -10px 0 auto 0; height: 10px;
}
.nav-drop ul { list-style: none; margin: 0; padding: 0; }
.nav-drop li + li { margin-top: 2px; }
.nav-drop li {
  border-radius: var(--radius); padding: 9px 11px;
  border-left: 3px solid transparent; transition: background .14s, border-color .14s;
}
.nav-drop li:hover { background: var(--bg-sunken); border-left-color: var(--cat, var(--brand)); }
.nav-drop a {
  display: block; font-size: .9375rem; font-weight: 560; color: var(--text);
}
.nav-drop a:hover { text-decoration: none; color: var(--cat, var(--brand)); }
.nav-drop span {
  display: block; font-size: .8125rem; line-height: 1.45;
  color: var(--text-muted); margin-top: 2px;
}
.nav-drop[data-cat="calculators"] { --cat: var(--cat-calculators); }
.nav-drop[data-cat="lists"]       { --cat: var(--cat-lists); }
.nav-drop[data-cat="csv"]         { --cat: var(--cat-csv); }
.nav-drop[data-cat="audit"]       { --cat: var(--cat-audit); }

.nav-burger {
  display: none; width: 36px; height: 36px; padding: 0;
  align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-raised); color: var(--text-muted); cursor: pointer;
}
.nav-burger svg { width: 18px; height: 18px; }
.nav-burger:hover { color: var(--text); border-color: var(--border-strong); }

/* Below the fold-out width the menus stack instead of hanging off the bar. */
@media (max-width: 860px) {
  .nav-burger { display: inline-flex; }
  .hdr-nav .nav-menu { display: none; }
  .hdr-nav.is-open {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg-raised); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md); padding: 12px 20px 18px;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .hdr-nav.is-open .nav-menu { display: block; }
  .hdr-nav.is-open .nav-top { width: 100%; justify-content: space-between; }
  .hdr-nav.is-open .nav-drop {
    position: static; transform: none; width: auto; opacity: 1;
    visibility: visible; box-shadow: none; border: 0; padding: 0 0 0 8px;
    display: none;
  }
  .hdr-nav.is-open .nav-menu[data-open] .nav-drop { display: block; }
}

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: .9375rem; font-weight: 550;
  padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--brand) 92%, white), var(--brand));
  color: var(--brand-fg);
  box-shadow: 0 1px 2px rgba(14,22,32,.16), 0 4px 14px color-mix(in srgb, var(--brand) 32%, transparent);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--brand), var(--brand-hover));
  box-shadow: 0 2px 4px rgba(14,22,32,.18), 0 8px 22px color-mix(in srgb, var(--brand) 42%, transparent);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-raised); color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-inset); }

.btn-ghost { background: transparent; color: var(--text-muted); padding: 7px 12px; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-inset); color: var(--text); }

.btn-sm { font-size: .8125rem; padding: 6px 11px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- forms -------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field > label, .label {
  display: block; margin-bottom: 6px;
  font-size: .875rem; font-weight: 550; color: var(--text);
}
.hint { font-size: .8125rem; color: var(--text-muted); margin: 5px 0 0; }

.input, .select, .textarea {
  width: 100%; font: inherit; font-size: .9375rem;
  color: var(--text); background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 9px 12px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
.textarea {
  min-height: 160px; resize: vertical;
  font-family: var(--mono); font-size: .8125rem; line-height: 1.6;
}
.textarea[readonly] { background: var(--bg-sunken); }

/* A currency/percent affix that sits inside the field frame. */
.affix { display: flex; align-items: stretch; }
.affix > span {
  display: grid; place-items: center; flex: none;
  padding-inline: 11px; font-size: .875rem; color: var(--text-muted);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: 0;
}
.affix > span.suffix {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-right: 1px solid var(--border-strong); border-left: 0;
}
.affix > .input { border-radius: 0 var(--radius) var(--radius) 0; }
.affix > span.suffix + .input,
.affix > .input:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.affix > span:first-child + .input:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.grid-2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.file-drop {
  display: block; padding: 22px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg-sunken); color: var(--text-muted);
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.is-over {
  border-color: var(--brand); background: var(--brand-tint); color: var(--text);
}
.file-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop b { color: var(--text); font-weight: 600; }

/* --- cards & layout ----------------------------------------------------- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card > h2:first-child { margin-bottom: 14px; }
.card + .card { margin-top: 20px; }
.card > :last-child { margin-bottom: 0; }

.panel {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.tool-layout { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .tool-layout > aside { position: sticky; top: calc(var(--header-h) + 20px); }
}

/* --- disclosures --------------------------------------------------------
   Long result lists are collapsed behind one of these. Native <details>, so
   it works without JavaScript, is keyboard-operable and announces its own
   state to a screen reader - all of which a div-and-click would have to
   reimplement badly. */

.disclose { margin-top: 14px; }
.disclose > summary {
  display: flex; align-items: center; gap: 9px;
  list-style: none; cursor: pointer;
  padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--bg-sunken);
  font-size: .875rem; font-weight: 550; color: var(--text);
  transition: background .15s, border-color .15s;
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary:hover { background: var(--bg-inset); border-color: var(--brand); }
.disclose > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.disclose > summary .chev {
  width: 15px; height: 15px; flex: none; color: var(--text-muted);
  transition: transform .2s;
}
.disclose[open] > summary .chev { transform: rotate(90deg); }
.disclose[open] > summary { border-color: var(--brand); color: var(--brand); }
.disclose > summary .count {
  margin-left: auto; font-weight: 600; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.disclose[open] > summary .count { color: var(--brand); }
.disclose-body { padding-top: 6px; }
.disclose-body > .table-scroll:first-child { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .disclose > summary .chev { transition: none; }
}

/* In the sidebar the disclosure is the card's heading, so it should read as
   one rather than as a button sitting inside a box. */
aside .card > .disclose { margin-top: 0; }
aside .card > .disclose > summary {
  border: 0; background: none; padding: 0;
  font-size: 1.175rem; font-weight: 650; letter-spacing: -.011em;
}
aside .card > .disclose > summary:hover { background: none; color: var(--brand); }
aside .card > .disclose[open] > summary { color: var(--text); margin-bottom: 8px; }
aside .card > .disclose > summary .chev { width: 13px; height: 13px; }

/* --- bucket boxes ------------------------------------------------------- */

.bucket-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 4px;
}
.bucket {
  font: inherit; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-sunken); color: var(--text);
  transition: border-color .15s, background .15s, transform .1s;
  display: flex; flex-direction: column; gap: 2px;
}
.bucket:hover { border-color: var(--brand); background: var(--bg-inset); }
.bucket:active { transform: translateY(1px); }
.bucket[aria-expanded="true"] {
  border-color: var(--brand); background: var(--brand-tint);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.bucket[disabled] { opacity: .45; cursor: default; }
.bucket[disabled]:hover { border-color: var(--border); background: var(--bg-sunken); }
.bucket-n {
  font-size: 1.5rem; font-weight: 680; line-height: 1.1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.bucket[aria-expanded="true"] .bucket-n { color: var(--brand); }
.bucket-l { font-size: .8125rem; color: var(--text-muted); }
.bucket.is-ok   .bucket-n { color: var(--ok); }
.bucket.is-warn .bucket-n { color: var(--warn); }
.bucket.is-bad  .bucket-n { color: var(--danger); }

.bucket-panel {
  margin-top: 14px; padding: 18px;
  border: 1px solid var(--brand); border-radius: var(--radius-lg);
  background: var(--bg-raised);
}
.bucket-panel h3 { margin-bottom: 4px; }
.bucket-panel .sub-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0;
}
.sub-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: .8125rem;
  border: 1px solid var(--border-strong); background: var(--bg-sunken);
}
.sub-chip b { font-variant-numeric: tabular-nums; }
.sub-chip button {
  font: inherit; font-size: .75rem; cursor: pointer;
  background: none; border: 0; color: var(--brand); padding: 0;
  text-decoration: underline;
}
.sub-chip button:hover { color: var(--brand-hover); }
.sub-chip.is-empty { opacity: .5; }

.src-link { color: var(--brand); font-size: .8125rem; }
.src-none { color: var(--text-faint); }

/* --- results ------------------------------------------------------------ */

.results { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat {
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat dt { font-size: .8125rem; color: var(--text-muted); margin-bottom: 3px; }
.stat dd {
  margin: 0; font-size: 1.5rem; font-weight: 660;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat.is-hero {
  background: linear-gradient(160deg, var(--brand-tint), var(--bg-raised));
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
}
.stat.is-hero dd { color: var(--brand); }
.stat.is-warn { background: var(--warn-tint); border-color: var(--warn); }
.stat.is-warn dd { color: var(--warn); }
.stat.is-bad  { background: var(--danger-tint); border-color: var(--danger); }
.stat.is-bad dd { color: var(--danger); }

.note {
  border-left: 3px solid var(--border-strong);
  padding: 10px 14px; margin: 16px 0;
  background: var(--bg-sunken); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .875rem; color: var(--text-muted);
}
.note.is-warn { border-left-color: var(--warn); background: var(--warn-tint); }
.note.is-bad  { border-left-color: var(--danger); background: var(--danger-tint); }
.note.is-ok   { border-left-color: var(--ok); background: var(--ok-tint); }
.note > :last-child { margin-bottom: 0; }

.chunk { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.chunk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.chunk-head h4 { margin: 0; }
.chunk-head .btn { margin-left: auto; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; letter-spacing: .01em;
  background: var(--bg-inset); color: var(--text-muted);
}
.pill.is-ok   { background: var(--ok-tint); color: var(--ok); }
.pill.is-warn { background: var(--warn-tint); color: var(--warn); }
.pill.is-bad  { background: var(--danger-tint); color: var(--danger); }

.table-scroll { overflow-x: auto; margin: 16px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th, table.data td {
  text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data th { font-weight: 600; color: var(--text-muted); font-size: .8125rem; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- tool index cards --------------------------------------------------- */

.tool-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
.tool-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 20px 20px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
/* A coloured edge tells the four groups apart without another badge. */
.tool-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--cat, var(--brand));
  opacity: .85; transition: height .18s, opacity .18s;
}
.tool-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--cat, var(--brand)) 55%, var(--border));
  transform: translateY(-3px); box-shadow: var(--shadow-md);
}
.tool-card:hover::before { height: 5px; opacity: 1; }
.tool-card h3 { transition: color .18s; }
.tool-card:hover h3 { color: var(--cat, var(--brand)); }
.tool-card h3 { margin-bottom: 6px; font-size: 1.0625rem; }
.tool-card p { margin: 0; font-size: .875rem; color: var(--text-muted); }
.tool-card .pill { align-self: flex-start; margin-bottom: 12px; }

/* --- hero & sections ---------------------------------------------------- */

.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 68px; text-align: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60rem 22rem at 50% -6rem,
      color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-sunken), var(--bg));
}
.hero h1 { max-width: 18ch; margin-inline: auto; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand), var(--brand-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--brand);
}
.hero p.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 620px; margin-inline: auto; }
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 28px; }
.section-head h2 { position: relative; padding-left: 14px; }
.section-head h2::before {
  content: ''; position: absolute; left: 0; top: .18em; bottom: .18em;
  width: 4px; border-radius: 3px; background: var(--cat, var(--brand));
}
.section-head.center h2 { padding-left: 0; }
.section-head.center h2::before { display: none; }
.section-head p { color: var(--text-muted); margin: 0; }

.crumbs { font-size: .875rem; color: var(--text-muted); padding: 20px 0 0; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--brand); }

.tool-head { padding: 12px 0 28px; }
.tool-head h1 { margin-bottom: 10px; }
.tool-head p { color: var(--text-muted); font-size: 1.0625rem; max-width: 62ch; margin: 0; }

/* --- counters ----------------------------------------------------------- */

.counters { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.counter {
  text-align: center; padding: 26px 16px;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-sunken));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.counter .n {
  display: block; font-size: 2.5rem; font-weight: 750;
  letter-spacing: -.035em; line-height: 1.05;
  /* Stays within the brand green. Running it to the indigo accent made a
     two-digit number land almost entirely in the indigo half and read blue. */
  background: linear-gradient(160deg, var(--brand), var(--brand-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--brand);
  font-variant-numeric: tabular-nums;
}
@supports not (background-clip: text) {
  .counter .n { -webkit-text-fill-color: currentColor; color: var(--brand); }
}
.counter .l { font-size: .875rem; color: var(--text-muted); }

/* --- CTA & footer ------------------------------------------------------- */

.cta {
  position: relative; overflow: hidden;
  background:
    radial-gradient(32rem 14rem at 50% -4rem,
      color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    linear-gradient(160deg, var(--brand-tint), var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
  border-radius: var(--radius-lg); padding: 34px 28px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.cta h2 { margin-bottom: 8px; font-size: 1.375rem; }
.cta p { color: var(--text-muted); max-width: 52ch; margin-inline: auto; }

.ft { border-top: 1px solid var(--border); background: var(--bg-sunken); padding: 44px 0 32px; font-size: .875rem; }
.ft-cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 32px; }
.ft h4 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 12px; }
.ft ul { list-style: none; margin: 0; padding: 0; }
.ft li + li { margin-top: 7px; }
.ft a { color: var(--text-muted); }
.ft a:hover { color: var(--brand); }
.ft-base { border-top: 1px solid var(--border); padding-top: 20px; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* --- toast -------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90;
  transform: translate(-50%, 14px);
  background: var(--text); color: var(--bg);
  padding: 9px 18px; border-radius: 999px;
  font-size: .875rem; font-weight: 550;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- tabs --------------------------------------------------------------- */

.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.tab {
  font: inherit; font-size: .9375rem; font-weight: 550;
  padding: 9px 16px; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-muted); margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--brand); border-bottom-color: var(--brand); }

/* --- announcement banner ------------------------------------------------ */

.banner {
  background: var(--brand-tint);
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.banner .wrap { display: flex; align-items: center; gap: 10px; padding-block: 9px; }
.banner svg { width: 16px; height: 16px; flex: none; color: var(--brand); }
.banner p { margin: 0; color: var(--text); }

/* --- tool search -------------------------------------------------------- */

.search-wrap { position: relative; max-width: 460px; margin: 0 auto 8px; }
.search-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-faint); pointer-events: none;
}
.search-input {
  width: 100%; font: inherit; font-size: .9375rem;
  padding: 11px 14px 11px 40px;
  color: var(--text); background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: 999px;
}
.search-input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.search-count { text-align: center; font-size: .8125rem; color: var(--text-muted); min-height: 1.4em; }
.tool-card[hidden] { display: none; }
.section.is-empty { display: none; }

/* --- reviews carousel --------------------------------------------------- */

.rev {
  position: relative;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.rev-slide { display: none; }
.rev-slide.is-active { display: block; animation: rev-in .4s ease; }
@keyframes rev-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rev-stars { color: #e0a800; letter-spacing: 3px; font-size: 1rem; margin-bottom: 12px; }
.rev blockquote { margin: 0 0 16px; font-size: 1.0625rem; line-height: 1.65; }
.rev-who { font-weight: 620; }
.rev-meta { color: var(--text-muted); font-size: .875rem; }
.rev-nav { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.rev-nav .spacer { flex: 1; }
.rev-arrow {
  width: 34px; height: 34px; border-radius: 999px; padding: 0; cursor: pointer;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text);
}
.rev-arrow:hover { border-color: var(--brand); color: var(--brand); }
.rev-dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--border-strong); transition: background .2s, width .2s;
}
.rev-dot[aria-current="true"] { background: var(--brand); width: 22px; }

/* --- contact ------------------------------------------------------------ */

.contact { max-width: 620px; margin-inline: auto; }
.contact .btn-primary { width: 100%; }

/* --- print (audit report) ----------------------------------------------- */

@media print {
  .hdr, .ft, .cta, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
