/* =============================================================================
   Calquly — design system
   Single stylesheet, mobile-first, no preprocessor, no framework.
   No web fonts: the system stack renders instantly and costs zero requests,
   which matters more on a calculator page than a bespoke typeface would.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
          Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  /* Neutrals — very slightly warm so the page does not read as clinical blue */
  --bg:            #fbfbfc;
  --surface:       #ffffff;
  --surface-2:     #f5f6f8;
  --surface-3:     #eef0f4;
  --border:        #e4e7ec;
  --border-strong: #d0d5dd;

  --ink:     #101319;
  --ink-2:   #3c4552;
  --muted:   #6b7484;
  --faint:   #98a1b0;

  --accent:      #1c50d8;
  --accent-ink:  #1741b0;
  --accent-soft: #eaf0ff;
  --accent-line: #c3d3fb;

  --good:      #087f5b;
  --good-soft: #e6f6f0;
  --warn:      #9a5b00;
  --warn-soft: #fdf3e2;
  --bad:       #b42318;
  --bad-soft:  #fdeceb;

  --radius:    12px;
  --radius-lg: 16px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 19, 25, .05);
  --shadow:    0 1px 3px rgba(16, 19, 25, .07), 0 8px 24px -12px rgba(16, 19, 25, .12);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(1rem, 4vw, 1.75rem);
  --measure: 68ch;
  --page: 1120px;
  --page-narrow: 780px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0c0e13;
    --surface:       #14171e;
    --surface-2:     #1a1e27;
    --surface-3:     #232833;
    --border:        #262b36;
    --border-strong: #363d4b;

    --ink:   #eef1f6;
    --ink-2: #c2c9d6;
    --muted: #939cad;
    --faint: #6c7686;

    --accent:      #7ea2ff;
    --accent-ink:  #a6c0ff;
    --accent-soft: #16203a;
    --accent-line: #2b3b63;

    --good:      #4ade9f;
    --good-soft: #10251e;
    --warn:      #f0b95b;
    --warn-soft: #2a2113;
    --bad:       #ff8b80;
    --bad-soft:  #2c1614;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 1px 3px rgba(0, 0, 0, .5), 0 8px 24px -12px rgba(0, 0, 0, .7);
  }
}

/* -----------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

/* Must come before any component rule. A class like .grid { display: grid }
   outranks the user-agent [hidden] rule, so without this every hidden field
   group in the shape and project pickers would render at once. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -.021em; font-weight: 650; }
h1 { font-size: clamp(1.85rem, 1.35rem + 2.1vw, 2.6rem); line-height: 1.08; letter-spacing: -.03em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .85vw, 1.6rem); }
h3 { font-size: 1.08rem; }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: .35rem; }
code, kbd { font-family: var(--mono); font-size: .92em; }

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

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* -----------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: var(--page-narrow); }
.prose { max-width: var(--measure); }
.stack > * + * { margin-top: 1rem; }

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

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .6rem 1rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* -----------------------------------------------------------------------------
   4. Header & footer
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 56px;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; letter-spacing: -.03em; font-size: 1.05rem; color: var(--ink);
}
.brand:hover { text-decoration: none; }
/* The glyph inherits the brand colour, so it flips with the theme on its own. */
.brand__mark { flex: 0 0 auto; color: var(--ink); }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.site-nav a {
  padding: .4rem .6rem; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: .9rem; font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
/* Category shortcuts appear once there is room; on a phone the header stays
   one compact row with the single link that matters. */
.site-nav .nav-secondary { display: none; }
@media (min-width: 720px) { .site-nav .nav-secondary { display: inline-block; } }

.site-footer {
  margin-top: 4rem; padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: .9rem; color: var(--muted);
}
.site-footer h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: .6rem; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li + li { margin-top: .3rem; }
.site-footer a { color: var(--ink-2); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.footer-note { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* -----------------------------------------------------------------------------
   5. Breadcrumbs & page head
   -------------------------------------------------------------------------- */
.crumbs { padding: 1rem 0 .25rem; font-size: .84rem; color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.crumbs li { display: flex; align-items: center; gap: .35rem; margin: 0; }
.crumbs li + li::before { content: "/"; color: var(--faint); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current="page"] { color: var(--ink-2); }

.page-head { padding: .5rem 0 1.25rem; }
.page-head p.lede { color: var(--ink-2); font-size: 1.03rem; max-width: 62ch; margin-top: .6rem; }
.eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .5rem;
}

/* -----------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .6rem 1.1rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: .95rem; font-weight: 600; letter-spacing: -.01em;
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); }
@media (prefers-color-scheme: dark) { .btn--primary { color: #0b1020; } }
.btn--ghost { border-color: var(--border-strong); color: var(--ink-2); background: var(--surface); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--quiet { color: var(--muted); padding-inline: .6rem; }
.btn--quiet:hover { color: var(--ink); background: var(--surface-2); }
.btn--sm { min-height: 36px; padding: .35rem .7rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* -----------------------------------------------------------------------------
   7. The calculator card — the focal point of every page
   -------------------------------------------------------------------------- */
.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calc__body { padding: var(--gutter); }
.calc__foot {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  padding: .85rem var(--gutter);
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.calc__foot .spacer { margin-left: auto; }

/* Mode tabs (percentage, discount, date…) */
.modes { display: flex; gap: .3rem; padding: .4rem; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.modes::-webkit-scrollbar { display: none; }
.modes__btn {
  flex: 0 0 auto; padding: .5rem .8rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 550; color: var(--muted); white-space: nowrap;
  min-height: 38px;
}
.modes__btn:hover { color: var(--ink); background: var(--surface); }
.modes__btn[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.modes--stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; overflow: visible; }
@media (min-width: 720px) { .modes--stack { grid-template-columns: repeat(3, 1fr); } }

/* Fields */
.grid { display: grid; gap: .9rem; }
@media (min-width: 560px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}
/* Two columns even on the narrowest phone — for short numeric pairs where
   stacking would push the result below the fold. */
.grid--tight { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.grid--tight3 { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.grid--tight3 .input { padding-inline: .5rem; }

/* Secondary settings, collapsed so the result stays close to the inputs. */
.calc-options { margin-top: .25rem; }
.calc-options > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 600; color: var(--muted);
  padding: .5rem 0; min-height: 40px;
}
.calc-options > summary::-webkit-details-marker { display: none; }
.calc-options > summary::before {
  content: ""; width: 6px; height: 6px; flex: 0 0 auto;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s var(--ease-out);
}
.calc-options[open] > summary::before { transform: rotate(45deg); }
.calc-options[open] > summary { color: var(--ink-2); }
.calc-options > div { padding-top: .3rem; }

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > label, .fieldset__legend {
  font-size: .82rem; font-weight: 600; color: var(--ink-2); letter-spacing: -.005em;
}
.field__hint { font-size: .78rem; color: var(--muted); }
.field__wrap { position: relative; display: flex; align-items: stretch; }

.input, .select {
  width: 100%; min-height: 46px; padding: .6rem .75rem;
  font-size: 1rem; font-family: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
  font-variant-numeric: tabular-nums;
}
.select {
  appearance: none; padding-right: 2.1rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236b7484' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input::placeholder { color: var(--faint); }
.input[type="number"] { -moz-appearance: textfield; }
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.field__wrap .input:not(:only-child) { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.field__wrap .affix {
  display: grid; place-items: center; flex: 0 0 auto; min-width: 2.6rem; padding-inline: .65rem;
  border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2); color: var(--muted); font-size: .9rem; font-weight: 550;
}
.field__wrap .affix--select { padding: 0; border: 0; }
.field__wrap .affix--select .select { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; min-width: 5.5rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .45rem .75rem; min-height: 40px; display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  font-size: .875rem; font-weight: 550; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--accent-line); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

.checkline { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; color: var(--ink-2); }
.checkline input { width: 18px; height: 18px; margin-top: .2rem; accent-color: var(--accent); flex: 0 0 auto; }

/* Repeatable rows (work hours, areas, pours) */
.rows { display: grid; gap: .75rem; }
.row-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem;
  background: var(--surface-2);
}
.row-card__head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.row-card__title { font-size: .8rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.row-card__remove { margin-left: auto; color: var(--muted); font-size: .82rem; padding: .25rem .5rem; border-radius: 6px; }
.row-card__remove:hover { color: var(--bad); background: var(--bad-soft); }

/* Error message */
.calc__error {
  display: flex; gap: .55rem; align-items: flex-start;
  margin-top: .9rem; padding: .7rem .85rem;
  background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent);
  border-radius: var(--radius-sm); color: var(--bad); font-size: .88rem;
}
.calc__error[hidden] { display: none; }

/* -----------------------------------------------------------------------------
   8. Results
   -------------------------------------------------------------------------- */
.result {
  margin-top: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden;
}
.result[hidden] { display: none; }
.result__main {
  padding: 1.1rem var(--gutter) 1rem;
  background: var(--good-soft);
  border-bottom: 1px solid var(--border);
}
.result__label { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--good); }
.result__value {
  margin-top: .2rem; font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.75rem);
  font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--ink);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.result__sub { margin-top: .3rem; font-size: .92rem; color: var(--ink-2); }
.result__rows { display: grid; }
.rrow {
  display: flex; align-items: baseline; gap: 1rem; justify-content: space-between;
  padding: .6rem var(--gutter); font-size: .92rem;
}
.rrow + .rrow { border-top: 1px solid var(--border); }
.rrow__label { color: var(--muted); }
.rrow__value { font-weight: 620; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.rrow--em .rrow__value { color: var(--good); }
.rrow__hint { display: block; font-weight: 400; font-size: .78rem; color: var(--faint); }

.result__foot {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .7rem var(--gutter); border-top: 1px solid var(--border);
}

/* Formula + steps */
.formula {
  margin-top: 1rem; padding: .85rem 1rem;
  background: var(--surface-3); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .88rem; color: var(--ink-2);
  overflow-x: auto; white-space: nowrap;
}
.formula__label { display: block; font-family: var(--sans); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: .35rem; }

.steps { margin-top: 1rem; }
.steps > summary {
  cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--ink-2);
  padding: .5rem .1rem; list-style: none; display: flex; align-items: center; gap: .4rem;
}
.steps > summary::-webkit-details-marker { display: none; }
.steps > summary::before {
  content: ""; width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s var(--ease-out); margin-right: .15rem;
}
.steps[open] > summary::before { transform: rotate(45deg); }
.steps ol { margin: .3rem 0 0; padding-left: 1.3rem; font-size: .89rem; color: var(--ink-2); }
.steps li { margin-top: .4rem; overflow-wrap: anywhere; }

.copied { color: var(--good); font-size: .85rem; font-weight: 600; }

/* -----------------------------------------------------------------------------
   9. Content sections below the tool
   -------------------------------------------------------------------------- */
.section { margin-top: 2.75rem; }
/* Homepage rhythm: the sections there are card grids rather than prose, so
   they sit closer together without the page feeling crowded. */
.section--tight { margin-top: 2rem; }
.section--tight > .cat-head { margin-top: 0; }
.section--tight > h2 { margin-bottom: .6rem; }
.section > h2 { margin-bottom: .75rem; }
.section p + p, .section p + ul, .section ul + p { margin-top: .8rem; }
.section p, .section li { color: var(--ink-2); }

.example {
  border: 1px solid var(--border); border-left: 3px solid var(--accent-line);
  border-radius: var(--radius-sm); padding: .9rem 1rem; background: var(--surface);
}
.example + .example { margin-top: .7rem; }
.example__q { font-weight: 620; color: var(--ink); }
.example__a { margin-top: .35rem; font-size: .93rem; }
.example__a code { background: var(--surface-3); padding: .1rem .35rem; border-radius: 4px; }

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; padding: .95rem .5rem .95rem 0; font-weight: 600; color: var(--ink);
  list-style: none; display: flex; gap: .75rem; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--muted); font-weight: 500;
  font-size: 1.25rem; line-height: 1; flex: 0 0 auto;
}
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 2rem .95rem 0; color: var(--ink-2); font-size: .95rem; }

.note {
  padding: .85rem 1rem; border-radius: var(--radius-sm);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
  color: var(--ink-2); font-size: .9rem;
}
.note strong { color: var(--ink); }

/* -----------------------------------------------------------------------------
   10. Calculator cards / grids / search
   -------------------------------------------------------------------------- */
.card-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; list-style: none; padding: 0; }
@media (min-width: 620px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.card-grid li { margin: 0; }

.tile {
  display: flex; flex-direction: column; gap: .3rem; height: 100%;
  padding: 1rem 1.1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), transform .15s var(--ease-out);
}
.tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.tile__name { font-weight: 640; color: var(--ink); letter-spacing: -.012em; display: flex; align-items: center; gap: .5rem; }
.tile__desc { font-size: .875rem; color: var(--muted); line-height: 1.5; }
.tile__cat { margin-top: auto; padding-top: .5rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.tile__icon { flex: 0 0 auto; color: var(--accent); }

.searchbox { position: relative; }
.searchbox .input { min-height: 52px; padding-left: 2.75rem; font-size: 1.02rem; }
.searchbox svg { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-empty { padding: 1rem 0; color: var(--muted); font-size: .93rem; }
.search-empty[hidden] { display: none; }

.cat-head { display: flex; align-items: baseline; gap: .75rem; margin: 0 0 .85rem; }

/* One category on the All-calculators page. The hairline and the generous
   top padding are what make it obvious, mid-scroll, where one category ends
   and the next begins — without shouting. */
.cat-block { margin-top: 2.5rem; }
.cat-block + .cat-block {
  margin-top: 3.25rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--border);
}
.cat-block > .cat-head { margin-bottom: .45rem; }
.cat-block > .cat-head h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); letter-spacing: -.025em; }
.cat-desc {
  margin: 0 0 1.6rem;
  max-width: 62ch;
  color: var(--muted);
  font-size: .95rem;
}
.cat-head h2 { margin: 0; }
.cat-head a { font-size: .85rem; font-weight: 550; margin-left: auto; }

/* Home hero */
.hero { padding: 1.75rem 0 1.25rem; }
.hero__top { display: grid; gap: .7rem; }
.hero h1 { max-width: 14ch; }
.hero p { font-size: 1rem; color: var(--ink-2); max-width: 58ch; }
.hero__search { margin-top: 1.15rem; max-width: 580px; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 550; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: .3rem .7rem;
}
.badge svg { color: var(--good); }

/* -----------------------------------------------------------------------------
   11. Ad slots — reserved space, empty during development
   -------------------------------------------------------------------------- */
.ad-slot {
  display: grid; place-items: center;
  margin: 2rem 0; padding: .5rem;
  min-height: 100px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  color: var(--faint); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.ad-slot--leaderboard { min-height: 100px; }
@media (min-width: 980px) { .ad-slot--leaderboard { min-height: 110px; } }
.ad-slot--incontent { min-height: 250px; }
html.ads-live .ad-slot { border: 0; background: none; min-height: 0; padding: 0; }

/* -----------------------------------------------------------------------------
   12. Tables (used by the concrete bag table and content pages)
   -------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; margin-top: .9rem; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; min-width: 380px; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }

/* -----------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; }
  .hero p { font-size: 1.05rem; }
  .hero { padding: 3rem 0 1.75rem; }
}
@media (min-width: 960px) {
  /* Wide screens: the headline and the supporting line share one band instead
     of leaving half the viewport empty under a narrow column of text. */
  .hero__top {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 3rem; align-items: start;
  }
  .hero h1 { max-width: none; }
  /* Optically aligns the paragraph's first line with the headline's cap height
     rather than its line box. */
  .hero p { padding-top: .45rem; }
  .hero__search { max-width: 640px; }
  .calc-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
}

/* Print: results should survive a printout, chrome should not. */
@media print {
  .site-header, .site-footer, .ad-slot, .calc__foot, .modes, .skip-link { display: none !important; }
  body { background: #fff; }
  .calc, .result { box-shadow: none; border-color: #ccc; }
  .steps { display: block; }
  .steps[open] > summary { display: none; }
}

/* -----------------------------------------------------------------------------
   14. No-JS fallback
   -------------------------------------------------------------------------- */
.nojs-warning {
  display: none;
  margin-bottom: 1rem; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
  color: var(--ink-2); font-size: .9rem;
}
html.no-js .nojs-warning { display: block; }
html.no-js .calc__foot, html.no-js .modes { display: none; }
