/* Dexaloop Tools (tools.dexaloop.com)
 *
 * Design system
 * - Palette from the Dexaloop brand: ink navy + cool paper, one accent
 *   (brand cyan: deep teal in light mode, #3FE0D0 in dark), coral only in
 *   the logo dot. Buttons are filled with ink.
 * - Shapes: controls (buttons, inputs, segmented toggles) 10px; containers
 *   (panels, cards, result boxes) 16px. Nothing else.
 * - Type: Geist (SIL OFL 1.1, self-hosted), tabular figures for numbers.
 * - Motion: feedback only (hover, press, result update), off under
 *   prefers-reduced-motion.
 * - Layers: header 20, menu 30, toast 40. No other z-index.
 */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  /* optional: never swap fonts after the page has drawn (no layout shift);
     a slow first visit keeps the system font, later visits get Geist. */
  font-display: optional;
}

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-3: #e6eaf3;
  --ink: #0b1020;
  --ink-2: #454e63;
  --ink-3: #636c82;
  --line: #e0e4ee;
  --line-2: #c8cfdd;
  --accent: #0a7d72;
  --accent-strong: #06655c;
  --accent-soft: #e2f5f2;
  --accent-line: #a9e3db;
  --btn: #0e1530;
  --btn-hover: #1b2550;
  --btn-ink: #ffffff;
  --dot: #ff6b5a;
  --ring: #3fe0d0;
  --error: #b42318;
  --error-soft: #fdeeec;
  --warn-soft: #fff6e5;
  --warn-ink: #7a4b00;
  --shadow-1: 0 1px 2px rgb(14 21 48 / 0.06);
  --shadow-2: 0 1px 2px rgb(14 21 48 / 0.05), 0 12px 32px -12px rgb(14 21 48 / 0.16);
  --r-control: 10px;
  --r-box: 16px;
  --font: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070b18;
    --surface: #0d1326;
    --surface-2: #131a31;
    --surface-3: #1a2240;
    --ink: #eef2ff;
    --ink-2: #b4bcd4;
    --ink-3: #8f98b3;
    --line: #1f2742;
    --line-2: #2d3758;
    --accent: #3fe0d0;
    --accent-strong: #7cebe0;
    --accent-soft: #0f2a33;
    --accent-line: #1d5a5c;
    --btn: #3fe0d0;
    --btn-hover: #7cebe0;
    --btn-ink: #06121a;
    --error: #ff9a8f;
    --error-soft: #3a1714;
    --warn-soft: #2e230d;
    --warn-ink: #ffd27a;
    --shadow-1: none;
    --shadow-2: 0 0 0 1px rgb(255 255 255 / 0.02), 0 20px 40px -20px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -0.022em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); letter-spacing: -0.032em; line-height: 1.06; }
h2 { font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.85rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.012em; }
p { margin: 0; text-wrap: pretty; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 40; background: var(--btn); color: var(--btn-ink); padding: 10px 14px; border-radius: var(--r-control); }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) { .site-head { background: var(--bg); } }
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -0.02em; font-size: 1.04rem; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }
.brand b { font-weight: 650; }
.brand span { color: var(--ink-3); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.94rem; font-weight: 500;
  padding: 8px 12px; border-radius: var(--r-control); display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  transition: background-color .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav .ext .icon { width: 0.95em; height: 0.95em; opacity: .7; }
.menu { display: none; margin-left: auto; position: relative; }
.menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 12px; border-radius: var(--r-control); border: 1px solid var(--line-2);
  font-weight: 550; font-size: 0.94rem; color: var(--ink);
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--surface-2); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(320px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-2);
  padding: 8px; display: grid;
}
.menu-panel a { color: var(--ink); text-decoration: none; padding: 12px; border-radius: var(--r-control); display: flex; align-items: center; gap: 10px; font-weight: 500; }
.menu-panel a:hover { background: var(--surface-2); }
.menu-panel .icon { color: var(--accent); }
@media (max-width: 1023px) {
  .nav { display: none; }
  .menu { display: block; }
}

/* ------------------------------------------------------------ buttons */
.btn {
  --b: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: 44px; padding: 10px 18px; border-radius: var(--r-control);
  border: 1px solid var(--b); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 560; font-size: 0.95rem; letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease), box-shadow .15s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn .icon { width: 1.1em; height: 1.1em; }
.btn-primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-ink); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding-inline: 12px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 1rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; }

/* ------------------------------------------------------------- forms */
label, .label { font-size: 0.86rem; font-weight: 560; color: var(--ink-2); letter-spacing: -0.003em; }
.field { display: grid; gap: 6px; align-content: start; }
.hint { font-size: 0.82rem; color: var(--ink-3); }
input[type="time"], input[type="number"], input[type="text"], input[type="date"], select {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  min-height: 44px; width: 100%; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-control);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder { color: var(--ink-3); opacity: 1; }
input:hover, select:hover { border-color: color-mix(in srgb, var(--line-2) 60%, var(--ink-3)); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[aria-invalid="true"] { border-color: var(--error); background: var(--error-soft); }
input[type="time"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
@media (prefers-color-scheme: dark) { input[type="time"]::-webkit-calendar-picker-indicator, input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); } }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.affix { position: relative; }
.affix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-variant-numeric: tabular-nums; }
.affix > input { padding-left: 28px; }

.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--r-control) + 3px); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px; border-radius: var(--r-control); font-size: 0.9rem; font-weight: 550; color: var(--ink-2); white-space: nowrap; transition: background-color .15s, color .15s, box-shadow .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.92rem; font-weight: 500; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* ------------------------------------------------------------- footer */
.site-foot { margin-top: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); background: var(--surface); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-block: 48px 32px; }
.foot-grid h2 { font-size: 0.86rem; letter-spacing: 0; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; font-size: 0.92rem; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.foot-about p { color: var(--ink-2); font-size: 0.92rem; max-width: 36ch; margin-top: 12px; }
.foot-legal { margin: 0; padding: 0 0 28px; max-width: 110ch; font-size: 0.74rem; line-height: 1.5; color: var(--ink-3); }
.foot-legal a { color: var(--ink-3); }
.foot-base { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-block: 20px 12px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.85rem; }
@media (max-width: 899px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- home */
.hero { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(40px, 7vw, 88px) clamp(40px, 6vw, 72px); }
/* Brand atmosphere, as on the Dexaloop app icon: a faint cyan and violet glow
   and a fine dot grid behind the live calculator. Decoration only. */
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hero::before {
  inset: -30% -20% -10% 35%;
  background:
    radial-gradient(38% 46% at 62% 48%, color-mix(in srgb, var(--ring) 20%, transparent), transparent 72%),
    radial-gradient(30% 38% at 92% 12%, rgb(139 107 255 / 0.14), transparent 70%);
}
.hero::after {
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(48% 70% at 74% 46%, #000, transparent 78%);
  mask-image: radial-gradient(48% 70% at 74% 46%, #000, transparent 78%);
}
@media (max-width: 899px) { .hero::before { inset: 30% -40% -20% -10%; } .hero::after { display: none; } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { max-width: 19ch; }
.hero .lead { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-2); max-width: 44ch; margin-top: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 899px) { .hero-grid { grid-template-columns: 1fr; } }

/* The hero's live mini calculator: a real tool, not a picture of one. */
.mini {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box);
  box-shadow: var(--shadow-2); padding: clamp(20px, 3vw, 28px); overflow: hidden;
}
.mini::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
}
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.mini-head h2 { font-size: 1.02rem; letter-spacing: -0.01em; }
.mini-head a { font-size: 0.88rem; font-weight: 550; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.mini-fields { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 12px; }
.mini-out { margin-top: 20px; padding: 18px 20px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mini-out .big { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.mini-out .big small { font-size: 0.45em; font-weight: 550; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.mini-out .alt { color: var(--ink-2); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.mini-note { margin-top: 14px; font-size: 0.84rem; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.mini-note .icon { color: var(--accent); }
@media (max-width: 520px) { .mini-fields { grid-template-columns: 1fr 1fr; } .mini-fields .field:last-child { grid-column: 1 / -1; } }

/* Three plain facts under the hero: a ruled strip, not cards. */
.facts { border-block: 1px solid var(--line); }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.facts li { display: flex; gap: 14px; align-items: flex-start; padding: 24px clamp(16px, 2.5vw, 32px); }
.facts li + li { border-left: 1px solid var(--line); }
.facts .icon { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.facts strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.facts span { color: var(--ink-2); font-size: 0.92rem; }
@media (max-width: 899px) { .facts ul { grid-template-columns: 1fr; } .facts li + li { border-left: 0; border-top: 1px solid var(--line); } .facts li { padding-inline: 0; } }

/* Tool directory: categories as indexed lists. */
.section { padding-top: clamp(56px, 8vw, 104px); }
.section-head { max-width: 62ch; margin-bottom: 32px; }
.section-head p { color: var(--ink-2); margin-top: 12px; font-size: 1.04rem; }
.directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.directory .cat-block:first-child { grid-column: 1 / -1; }
.directory .cat-block:first-child .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.cat-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); padding: 24px; display: flex; flex-direction: column; }
.cat-block > header { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.cat-block > header .badge-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.cat-block > header .badge-icon .icon { width: 22px; height: 22px; }
.cat-block h3 a { color: var(--ink); text-decoration: none; }
.cat-block h3 a:hover { color: var(--accent); }
.cat-block > header p { color: var(--ink-2); font-size: 0.9rem; margin-top: 4px; }
.tool-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.tool-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin-inline: -8px; border-radius: var(--r-control); color: var(--ink); text-decoration: none; }
a.tool-row:hover { background: var(--surface-2); color: var(--ink); }
a.tool-row:hover .go { transform: translateX(3px); color: var(--accent); }
.tool-row .ti { color: var(--ink-3); width: 20px; height: 20px; }
.tool-row .tname { font-weight: 550; letter-spacing: -0.008em; }
.tool-row .tdesc { display: block; color: var(--ink-3); font-size: 0.86rem; font-weight: 400; line-height: 1.4; }
.tool-row .go { margin-left: auto; color: var(--ink-3); transition: transform .2s var(--ease), color .15s; }
.tool-row.is-soon { color: var(--ink-2); }
.tag { margin-left: auto; font-size: 0.74rem; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.tag-live { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
@media (max-width: 999px) { .directory { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .directory { grid-template-columns: 1fr; } .directory .cat-block:first-child .tool-list { grid-template-columns: 1fr; } }

/* "How we check": text beside a worked example. */
.method { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.method .prose p + p { margin-top: 14px; }
.method .prose { color: var(--ink-2); }
.method .prose h2 { color: var(--ink); margin-bottom: 16px; }
.working { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); overflow: hidden; }
.working header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.working header strong { font-weight: 600; }
.working header span { color: var(--ink-3); }
.working dl { margin: 0; padding: 8px 20px; display: grid; grid-template-columns: 1fr auto; font-variant-numeric: tabular-nums; }
.working dt, .working dd { padding: 10px 0; margin: 0; }
.working dt { color: var(--ink-2); }
.working dd { text-align: right; font-weight: 550; }
.working .sum { border-top: 1px solid var(--line); font-weight: 650; color: var(--ink); }
.working footer { padding: 14px 20px; background: var(--surface-2); font-size: 0.84rem; color: var(--ink-2); }
@media (max-width: 899px) { .method { grid-template-columns: 1fr; } }

.sister { margin-top: clamp(56px, 8vw, 104px); }
.sister-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px clamp(20px, 3vw, 36px); border-radius: var(--r-box); background: var(--btn); color: var(--btn-ink); }
.sister-inner p { opacity: .82; margin-top: 6px; max-width: 52ch; }
.sister-inner h2 { font-size: 1.3rem; }
.sister .btn { background: var(--btn-ink); color: var(--btn); border-color: var(--btn-ink); }
.sister .btn:hover { opacity: .92; }

/* ----------------------------------------------------------- hub page */
.page-head { padding-block: clamp(32px, 5vw, 56px) 24px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.86rem; color: var(--ink-3); margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { color: var(--line-2); }
.page-head .lead { color: var(--ink-2); font-size: 1.1rem; max-width: 60ch; margin-top: 14px; }
.hub-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); }
.hub-list .tool-row { padding: 18px 8px; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
@media (max-width: 760px) { .hub-list { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- tool page */
.tool-intro { padding-block: clamp(28px, 4vw, 48px) 28px; }
.tool-intro h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); }
.tool-intro .lead { color: var(--ink-2); font-size: 1.08rem; max-width: 62ch; margin-top: 12px; }
.assurances { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; padding: 0; list-style: none; font-size: 0.88rem; color: var(--ink-2); }
.assurances li { display: inline-flex; align-items: center; gap: 7px; }
.assurances .icon { color: var(--accent); width: 18px; height: 18px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.tool-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1); }
.panel-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 16px 20px; padding: 20px; border-bottom: 1px solid var(--line); }
.panel-bar .field { min-width: 0; }
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-box) var(--r-box); }
.saved-note { font-size: 0.84rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; }
.saved-note .icon { width: 16px; height: 16px; }
.aside { position: sticky; top: 88px; display: grid; gap: 16px; }
@media (max-width: 999px) { .workspace { grid-template-columns: 1fr; } .aside { position: static; } }

/* Time card grid */
.tc-week + .tc-week { border-top: 1px solid var(--line); }
.tc-week-title { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px 4px; font-size: 0.9rem; }
.tc-week-title strong { font-weight: 620; }
.tc-week-title span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tc-cols, .tc-row { display: grid; grid-template-columns: 108px repeat(2, minmax(0, 1fr)) minmax(0, 0.8fr) 84px; gap: 10px; align-items: center; padding-inline: 20px; }
.tc-cols { padding-block: 10px 6px; font-size: 0.8rem; font-weight: 560; color: var(--ink-3); }
.tc-cols span:last-child { text-align: right; }
.tc-row { padding-block: 6px; border: 0; margin: 0; min-width: 0; }
.tc-row legend { float: left; padding: 0; font-weight: 560; font-size: 0.95rem; line-height: 1.2; }
.tc-row legend small { display: block; color: var(--ink-3); font-weight: 400; font-size: 0.8rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tc-row .field label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tc-row .out { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.tc-row .out.is-zero { color: var(--ink-3); font-weight: 450; }
.tc-row .err { grid-column: 2 / -1; font-size: 0.82rem; color: var(--error); margin-top: -2px; }
.tc-row .night { display: block; font-size: 0.72rem; font-weight: 500; color: var(--ink-3); }
.tc-row:last-of-type { padding-bottom: 16px; }
.tc-row .field, .tc-row input, .panel-bar .field, .panel-bar input, .panel-bar select { min-width: 0; }
@media (max-width: 640px) {
  .tc-cols { display: none; }
  .tc-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding-block: 14px; box-shadow: inset 0 1px 0 var(--line); }
  .tc-row legend { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; width: 100%; }
  .tc-row legend small { display: inline; margin-left: 8px; }
  .tc-row .field label { position: static !important; width: auto; height: auto; clip: auto; font-size: 0.78rem; }
  .tc-row .out { align-self: end; padding-bottom: 10px; font-size: 1.05rem; }
  .tc-row .err { grid-column: 1 / -1; }
  .panel-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .panel-bar .field:first-child { grid-column: 1 / -1; }
  .panel-bar .segmented { width: 100%; }
  .panel-bar #tc-example { grid-column: 1 / -1; margin-left: 0 !important; }
}

.options { border-top: 1px solid var(--line); }
.options summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; font-weight: 600; }
.options summary::-webkit-details-marker { display: none; }
.options summary .hint { font-weight: 400; }
.options summary .chev { transition: transform .2s var(--ease); color: var(--ink-3); }
.options[open] summary .chev { transform: rotate(180deg); }
.options-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; padding: 4px 20px 20px; }

/* Results */
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-2); overflow: hidden; }
.result-top { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); position: relative; }
.result-top::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.result-label { font-size: 0.86rem; color: var(--ink-2); font-weight: 550; }
.result-big { font-size: clamp(2.4rem, 2rem + 1.6vw, 3rem); font-weight: 660; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: 6px; }
.result-big small { font-size: 0.38em; color: var(--ink-3); font-weight: 550; letter-spacing: 0; margin-left: 6px; }
.result-sub { color: var(--ink-2); font-size: 0.92rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.result dl { margin: 0; padding: 6px 22px 14px; display: grid; grid-template-columns: 1fr auto; font-variant-numeric: tabular-nums; }
.result dt, .result dd { margin: 0; padding: 9px 0; font-size: 0.95rem; }
.result dt { color: var(--ink-2); }
.result dd { text-align: right; font-weight: 560; }
.result .rule { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 6px 0; padding: 0; }
.result .strong { color: var(--ink); font-weight: 650; }
.result-actions { display: grid; gap: 8px; padding: 4px 22px 22px; }
#r-weeks { border-top: 1px solid var(--line); padding-top: 10px; margin-top: -6px; }
.result-actions .btn { width: 100%; }
.result-warn { margin: 0 22px 16px; padding: 10px 12px; border-radius: var(--r-control); background: var(--warn-soft); color: var(--warn-ink); font-size: 0.86rem; display: flex; gap: 8px; }
.result-warn .icon { margin-top: 2px; }
.flash { animation: flash .5s var(--ease); }
@keyframes flash { from { color: var(--accent); } to { color: inherit; } }
.fineprint { font-size: 0.82rem; color: var(--ink-3); padding: 0 4px; }

/* Article under a tool */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(32px, 6vw, 80px); padding-top: clamp(48px, 7vw, 88px); }
.prose { max-width: 68ch; color: var(--ink-2); font-size: 1.02rem; }
.prose > * + * { margin-top: 16px; }
.prose h2 { color: var(--ink); margin-top: 48px; scroll-margin-top: 96px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { color: var(--ink); margin-top: 28px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prose blockquote { margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r-control) var(--r-control) 0; color: var(--ink); }
.prose blockquote cite { display: block; margin-top: 6px; font-style: normal; font-size: 0.86rem; color: var(--ink-3); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); overflow: hidden; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); font-weight: 600; background: var(--surface-2); font-size: 0.88rem; }
.prose tr:last-child td { border-bottom: 0; }
.prose td.r, .prose th.r { text-align: right; }
.faq { margin-top: 20px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--ink-3); transition: transform .2s var(--ease); margin-top: 3px; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { padding-bottom: 16px; }
.sources { font-size: 0.9rem; }
.sources li { overflow-wrap: anywhere; }
.toc { position: sticky; top: 88px; align-self: start; font-size: 0.9rem; }
.toc h2 { font-size: 0.86rem; letter-spacing: 0; color: var(--ink); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); border-left-color: var(--ink-3); }
.toc .related { margin-top: 28px; }
.toc .related a { border: 0; padding-left: 0; display: flex; gap: 8px; align-items: center; }
@media (max-width: 999px) { .article { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
/* Wide tables scroll inside their own box on small screens, never the page. */
@media (max-width: 720px) { .prose table { display: block; position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; } .prose th, .prose td { white-space: nowrap; } }

.related-tools { margin-top: clamp(48px, 7vw, 80px); }
.related-tools h2 { margin-bottom: 20px; }

/* Text pages (about, privacy, contact) */
.text-page { max-width: 72ch; padding-top: clamp(32px, 5vw, 56px); }
.text-page .prose { margin-top: 24px; }

/* Ads: reserved, labelled, kept away from buttons (AdSense placement policy). */
.ad { margin-top: 8px; }
.ad-label { font-size: 0.72rem; color: var(--ink-3); margin-bottom: 6px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; z-index: 40; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-control); font-size: 0.92rem; font-weight: 550; box-shadow: var(--shadow-2); transition: opacity .2s, transform .25s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 404 */
.notfound { padding-block: clamp(56px, 10vw, 120px); max-width: 60ch; }
.notfound p { color: var(--ink-2); margin-top: 14px; font-size: 1.06rem; }
.notfound .hero-actions { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}

/* Print: the time card as a clean sheet. */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --line: #bbb; --shadow-1: none; --shadow-2: none; }
  body { font-size: 11pt; }
  .site-head, .site-foot, .assurances, .panel-foot, .result-actions, .article, .related-tools, .ad, .options, .skip, .toast, .crumbs, #tc-example, .fineprint { display: none !important; }
  .workspace { grid-template-columns: 1fr; gap: 12pt; }
  .aside { position: static; }
  .tool-panel, .result { box-shadow: none; break-inside: avoid; }
  input { border: 0; padding: 0; min-height: 0; background: none; }
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
  a { color: #000; text-decoration: none; }
}

/* Quick answer at the top of a tool article (featured snippets, AI answers). */
.quick-answer { margin: 0 0 8px; padding: 18px 20px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-box); color: var(--ink); }
.quick-answer h2 { font-size: 1rem; letter-spacing: -0.005em; margin: 0 0 6px; }
.quick-answer p { margin: 0; }
/* Category page guide */
.hub-guide { max-width: 72ch; margin-top: clamp(40px, 6vw, 64px); }
.hub-guide > * + * { margin-top: 14px; }
.hub-guide h2 { margin-top: 36px; }
.more-in-cat { margin-top: clamp(40px, 6vw, 64px); }
.more-in-cat h2 { margin-bottom: 20px; }

/* ---- cron.css ---- */
/* Cron expression generator (/cron-expression-generator/). Tokens only.
 * Monospace for code values uses the system's own monospace fonts (no web fonts). */
#cr-form .mono, .cr-runs ol, .cr-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
#cr-form .cr-expr { padding: 20px; border-bottom: 1px solid var(--line); display: grid; gap: 16px; }
#cr-input { font-size: 1.25rem; letter-spacing: 0.02em; min-height: 52px; }
#cr-form .err { font-size: 0.86rem; color: var(--error); }
.cr-parts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cr-part { min-width: 0; display: grid; gap: 2px; padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); text-align: center; }
.cr-part-val { font-size: 1rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; min-height: 1.5em; }
.cr-part-name { font-size: 0.78rem; font-weight: 560; color: var(--ink-2); }
.cr-part-range { font-size: 0.72rem; color: var(--ink-3); line-height: 1.3; }
.cr-part.is-bad { border-color: var(--error); background: var(--error-soft); }
.cr-part.is-bad .cr-part-val { color: var(--error); }
#cr-form .cr-section { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-build { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.cr-build .field { min-width: 0; }
.cr-build input[type="time"] { width: 130px; }
.cr-build select { width: 160px; }
.cr-build input[type="number"] { width: 110px; }
#cr-form .panel-foot { align-items: end; }
.cr-desc { font-size: 1.32rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.3; margin-top: 6px; color: var(--ink); overflow-wrap: anywhere; }
.cr-runs { padding: 14px 22px 10px; }
.cr-runs h3 { font-size: 0.86rem; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.cr-runs ol { margin: 8px 0 0; padding-left: 1.9em; display: grid; gap: 4px; font-size: 0.86rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.cr-runs li::marker { color: var(--ink-3); }
@media (max-width: 640px) {
  .cr-parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cr-part-range { display: none; }
  .cr-build { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-build .field:first-child { grid-column: 1 / -1; }
  .cr-build .segmented { width: 100%; }
  .cr-build input[type="time"], .cr-build select, .cr-build input[type="number"] { width: 100%; }
  #cr-form .panel-foot .segmented { width: 100%; }
  #cr-form .panel-foot .field { width: 100%; }
  #cr-form .panel-foot .segmented span { white-space: normal; text-align: center; }
}
main:has(#cr-form) .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; color: var(--ink); overflow-wrap: anywhere; }

/* ---- cubic-yards.css ---- */
/* Cubic yards calculator (tokens only, see site.css). */
.cy-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 20px; }
.cy-body .field, .cy-body input { min-width: 0; }
.cy-dim[hidden] { display: none; }
.cy-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cy-unit { position: relative; min-width: 0; }
.cy-unit > input { width: 100%; padding-right: 40px; }
.cy-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: 0.86rem; }
.cy-count input { width: 100%; }
.cy-body .err { grid-column: 1 / -1; font-size: 0.86rem; color: var(--error); margin: 0; }
.result .cy-bags-head .hint { display: block; font-weight: 400; margin-top: 2px; }
.result dt .hint { font-weight: 400; }
#r-cy-thin { margin-top: 0; }
@media (max-width: 640px) {
  .cy-body { grid-template-columns: 1fr; }
  .panel-bar #cy-example { margin-left: 0 !important; }
  #cy-form .panel-bar .field, .panel-bar #cy-example { grid-column: 1 / -1; }
}

/* ---- days-between.css ---- */
/* Date tools (days between dates, business days, week number): shared
 * layout for the date fields, the date-sized result and the result lists.
 * Tokens only. Used by ui/days-between.mjs, ui/business-days.mjs and
 * ui/week-number.mjs. */
.dt-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; padding: 20px; }
.dt-fields .field, .dt-fields input, .dt-fields select { min-width: 0; }
.dt-wide { grid-column: 1 / -1; }
.dt-fields .err, .dt-panel .err { font-size: 0.82rem; color: var(--error); }
.dt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.result-big.is-date { font-size: clamp(1.7rem, 1.45rem + 1vw, 2.15rem); letter-spacing: -0.025em; }
.dt-list { padding: 0 22px 14px; }
.dt-list h3 { font-size: 0.86rem; font-weight: 600; color: var(--ink); letter-spacing: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.dt-list ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.88rem; }
.dt-list li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.dt-list .dt-when { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 520; }
@media (max-width: 640px) {
  .dt-fields { grid-template-columns: 1fr; gap: 14px; }
  .dt-form .panel-bar .field { grid-column: 1 / -1; }
  .dt-form .segmented { width: 100%; }
  .dt-form .segmented span { white-space: normal; text-align: center; padding-inline: 8px; }
}

/* ---- degree-class.css ---- */
/* Degree classification calculator (/degree-classification-calculator/). Tokens only. */
#dc-form .dc-presets { display: flex; flex-wrap: wrap; gap: 6px; }
#dc-form .dc-tip { display: flex; gap: 8px; align-items: flex-start; padding: 16px 20px 4px; }
#dc-form .dc-tip .icon { color: var(--ink-3); width: 1.1em; height: 1.1em; margin-top: 2px; }
#dc-form .dc-y1-toggle { padding: 10px 20px 14px; }
#dc-form .dc-year { border-top: 1px solid var(--line); }
#dc-form .dc-year-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 16px 20px 4px; }
#dc-form .dc-year-head h3 { margin-right: auto; }
#dc-form .dc-weight { display: flex; align-items: center; gap: 8px; }
#dc-form .dc-weight input { width: 84px; min-height: 40px; }
#dc-form .dc-year-head .err { flex-basis: 100%; text-align: right; }
#dc-form .dc-cols, #dc-form .dc-row { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 0.9fr) 40px; gap: 10px; align-items: center; padding-inline: 20px; }
#dc-form .dc-cols { padding-block: 10px 4px; font-size: 0.8rem; font-weight: 560; color: var(--ink-3); }
#dc-form .dc-row { padding-block: 5px; border: 0; margin: 0; min-width: 0; }
#dc-form .dc-row .field, #dc-form .dc-row input { min-width: 0; }
#dc-form .dc-row .field label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#dc-form .dc-suffix > span { left: auto; right: 12px; }
#dc-form .dc-suffix > input { padding-left: 12px; padding-right: 30px; }
#dc-form .dc-remove { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
#dc-form .dc-remove:disabled { opacity: .35; cursor: not-allowed; }
#dc-form .err { font-size: 0.82rem; color: var(--error); }
#dc-form .dc-row .err { grid-column: 1 / -1; margin-top: -2px; }
#dc-form .dc-add-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 20px 18px; }
#dc-form .dc-add-bar .btn:disabled { opacity: .5; cursor: not-allowed; }
#dc-breakdown:empty { display: none; }
#dc-breakdown { padding-bottom: 0; }
#dc-breakdown dt .hint { display: block; }
@media (max-width: 640px) {
  #dc-form .dc-cols { display: none; }
  #dc-form .dc-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 40px; gap: 8px 10px; padding-block: 12px; box-shadow: inset 0 1px 0 var(--line); }
  #dc-form .dc-row .dc-name { grid-column: 1 / 3; }
  #dc-form .dc-row .dc-remove { grid-column: 3; grid-row: 1; align-self: end; }
  #dc-form .dc-row .field label { position: static !important; width: auto; height: auto; clip: auto; font-size: 0.78rem; }
  #dc-form .panel-bar #dc-example { margin-left: 0 !important; }
}

/* ---- electricity.css ---- */
/* Electricity cost calculator (tokens only, see site.css). */
.elc-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 20px; }
#elc-form .field, #elc-form input { min-width: 0; }
#elc-form .field[hidden], .elc-amps[hidden] { display: none; }
.elc-amps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.elc-unit { position: relative; min-width: 0; }
.elc-unit > input { width: 100%; padding-right: 52px; }
.elc-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: 0.86rem; }
#elc-qty { width: 100%; }
.elc-price { grid-column: 1 / -1; }
.elc-price .affix { max-width: 260px; }
.elc-avg { justify-self: start; white-space: normal; text-align: left; }
.elc-body .elc-err { grid-column: 1 / -1; font-size: 0.86rem; color: var(--error); margin: 0; }
#r-elc-big { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .elc-body, .elc-amps { grid-template-columns: 1fr; }
  .elc-price .affix { max-width: none; }
  .panel-bar #elc-example { margin-left: 0 !important; grid-column: 1 / -1; }
}

/* ---- feet-inches.css ---- */
/* Feet and inches calculator (tokens only, see site.css). */
.fti-intro { color: var(--ink-2); font-size: 0.92rem; flex: 1 1 260px; min-width: 0; align-self: center; }
.fti-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; margin: 0; padding: 14px 20px; border: 0; min-width: 0; }
.fti-row + .fti-row { border-top: 1px solid var(--line); }
#fti-form .field, #fti-form input, #fti-form select { min-width: 0; }
#fti-form .fti-row select, #fti-form .fti-row input { width: 100%; }
.fti-unit { position: relative; min-width: 0; }
.fti-unit > input { width: 100%; padding-right: 34px; }
.fti-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: 0.86rem; }
.fti-remove { align-self: end; min-height: 44px; }
.fti-row .err { grid-column: 1 / -1; font-size: 0.82rem; color: var(--error); margin: 0; }
.fti-add { padding: 4px 20px 18px; }
.fti-op { display: grid; grid-template-columns: auto minmax(0, 180px); gap: 12px 18px; align-items: start; padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.fti-op .err { grid-column: 1 / -1; font-size: 0.86rem; color: var(--error); margin: 0; }
.fti-op #fti-by { width: 100%; }
.fti-big { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .fti-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fti-row .fti-sign { grid-column: 1 / 2; }
  .fti-remove { grid-column: 2 / 3; grid-row: 1; justify-self: end; }
  .fti-op { grid-template-columns: 1fr; }
  .fti-op .segmented { width: 100%; }
  .panel-bar #fti-example { margin-left: 0 !important; grid-column: 1 / -1; }
  #fti-form .panel-bar .fti-intro { grid-column: 1 / -1; }
}

/* ---- final-grade.css ---- */
/* Final grade calculator (/final-grade-calculator/). Tokens only. */
#fg-form .fg-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px 20px 8px; }
#fg-form .fg-fields .field { min-width: 0; }
#fg-form .fg-fields input { width: 100%; min-width: 0; }
#fg-form .fg-suffix > span { left: auto; right: 12px; }
#fg-form .fg-suffix > input { padding-left: 12px; padding-right: 32px; }
#fg-form .err { font-size: 0.82rem; color: var(--error); }
#fg-form .fg-targets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 20px 20px; border-bottom: 1px solid var(--line); }
#fg-form .fg-target-btns { display: flex; flex-wrap: wrap; gap: 8px; }
#fg-form .fg-whatif { padding: 20px; }
#fg-form .fg-whatif h2 { font-size: 1.02rem; letter-spacing: -0.01em; margin-bottom: 12px; }
#fg-form .fg-table-wrap { max-width: none; font-size: 0.95rem; }
#fg-form .fg-table-wrap .hint { font-weight: 400; }
#fg-form .fg-foot-btns { display: flex; gap: 8px; }
@media (max-width: 640px) {
  #fg-form .fg-fields { grid-template-columns: 1fr; }
}

/* ---- flooring.css ---- */
/* Flooring and tile calculator (tokens only, see site.css). */
.flr-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.7fr); gap: 10px 14px; align-items: end; margin: 0; padding: 18px 20px; border: 0; min-width: 0; }
.flr-row + .flr-row { border-top: 1px solid var(--line); }
.flr-row legend { float: left; width: 100%; padding: 0; font-weight: 600; font-size: 0.95rem; grid-column: 1 / -1; }
#flr-form .field, #flr-form input { min-width: 0; }
.flr-remove { position: absolute; top: 10px; right: 12px; }
.flr-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.flr-unit { position: relative; min-width: 0; }
.flr-unit > input { width: 100%; padding-right: 40px; }
.flr-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: 0.86rem; }
.flr-unit.flr-wide > input { padding-right: 52px; }
.flr-out { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); padding-bottom: 12px; overflow-wrap: anywhere; }
.flr-out.is-zero { color: var(--ink-3); font-weight: 450; }
.flr-row .err { grid-column: 1 / -1; font-size: 0.82rem; color: var(--error); margin: 0; }
.flr-add { padding: 4px 20px 18px; }
.flr-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 18px 20px 20px; border-top: 1px solid var(--line); }
#flr-form .flr-err { grid-column: 1 / -1; font-size: 0.86rem; color: var(--error); margin: 0; }
#flr-form .options-body .segmented { width: 100%; }
@media (max-width: 640px) {
  .flr-row, .flr-main { grid-template-columns: 1fr; }
  .flr-out { text-align: left; padding-bottom: 0; }
  .panel-bar #flr-example { margin-left: 0 !important; grid-column: 1 / -1; }
}

/* ---- fuel.css ---- */
/* Fuel cost and MPG calculator (/fuel-cost-calculator/). Tokens only. */
#fu-form .fu-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; padding: 20px; }
#fu-form .fu-group .field { min-width: 0; }
#fu-form .fu-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
#fu-form .fu-pair > *, #fu-form .fu-pair input, #fu-form .fu-pair select { min-width: 0; }
#fu-form .fu-check { margin-top: 4px; font-size: 0.88rem; }
#fu-form .fu-suffix { max-width: 220px; }
#fu-form .fu-suffix > span { left: auto; right: 12px; }
#fu-form .fu-suffix > input { padding-left: 12px; padding-right: 72px; }
#fu-form .err { font-size: 0.82rem; color: var(--error); }
#fu-form .fu-foot-btns { display: flex; gap: 8px; }
#fu-form .fu-mode { min-width: 0; max-width: 100%; }
#fu-form .fu-mode .segmented { max-width: 100%; }
#fu-form .fu-mode .segmented span { gap: 6px; }
#fu-form .fu-mode .segmented .icon { width: 1em; height: 1em; }
#fu-dl .hint { font-weight: 400; }
@media (max-width: 640px) {
  #fu-form .fu-group { grid-template-columns: 1fr; }
  #fu-form .fu-mode .segmented { grid-auto-flow: row; width: 100%; }
}

/* ---- holiday.css ---- */
/* Holiday entitlement: field grid in the panel body. Tokens only. */
.hol-body { padding: 20px; }
.hol-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.hol-grid[hidden] { display: none; }
.hol-grid .field, .hol-grid input, .hol-grid select { min-width: 0; }
.hol-grid .hol-wide { grid-column: 1 / -1; }
.hol-grid .err { font-size: 0.82rem; color: var(--error); }
.hol-basis { max-width: 100%; }
.hol-basis span { padding-inline: 10px; }
@media (max-width: 520px) {
  .hol-grid { grid-template-columns: minmax(0, 1fr); }
  .hol-basis { display: grid; grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); width: 100%; }
}

/* ---- hourly-salary.css ---- */
/* Hourly to salary (/hourly-to-salary-calculator/). Tokens only. */
.hs-body { display: grid; gap: 18px; padding: 20px; }
.hs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hs-body .field, .hs-body input { min-width: 0; }
.hs-amount { max-width: 320px; }
#hs-form .err { font-size: 0.82rem; color: var(--error); }
.hs-foot-btns { display: flex; gap: 8px; }
@media (max-width: 640px) { .hs-grid { grid-template-columns: minmax(0, 1fr); } .hs-amount { max-width: none; } }
#hs-form .panel-bar .field { min-width: 0; max-width: 100%; }
@media (max-width: 420px) { #hs-form .panel-bar .segmented { grid-auto-flow: row; width: 100%; } }

/* ---- hours.css ---- */
/* Hours calculator (/hours-calculator/). Tokens only. */
.hr-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px 20px 8px; }
.hr-fields .field, .hr-fields input { min-width: 0; }
.hr-fields .err { font-size: 0.82rem; color: var(--error); }
.hr-note { display: flex; gap: 8px; align-items: flex-start; padding: 4px 20px 16px; }
.hr-note .icon { margin-top: 1px; color: var(--ink-3); width: 1.1em; height: 1.1em; }
.hr-presets { display: grid; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.hr-preset-list { display: flex; flex-wrap: wrap; gap: 8px; }
.hr-night { display: flex; gap: 8px; align-items: center; margin: -4px 22px 14px; font-size: 0.86rem; color: var(--ink-2); }
.hr-night .icon { color: var(--accent); width: 1.1em; height: 1.1em; }
@media (max-width: 640px) {
  .hr-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-fields .field:last-child { grid-column: 1 / -1; }
}

/* ---- inflation.css ---- */
/* Inflation calculator (/inflation-calculator/). Tokens only. */
.inf-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px 10px; align-items: end; padding: 20px 20px 8px; }
.inf-fields .field, .inf-fields input, .inf-fields select { min-width: 0; }
.inf-fields .err { font-size: 0.82rem; color: var(--error); }
.inf-swap .btn { width: 44px; min-height: 44px; padding: 0; }
.inf-note { padding: 4px 20px 16px; }
.inf-latest { display: flex; gap: 8px; align-items: flex-start; margin: -4px 22px 14px; font-size: 0.86rem; color: var(--ink-2); }
.inf-latest .icon { color: var(--accent); width: 1.1em; height: 1.1em; margin-top: 2px; }
@media (max-width: 640px) {
  .inf-fields { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .inf-fields .inf-amount { grid-column: 1 / -1; }
  #inf-form .panel-bar #inf-example { margin-left: 0 !important; }
}

/* ---- invoice.css ---- */
/* Invoice generator (/invoice-generator/). Tokens only.
   Screen: form on the left, total and a paper-like preview on the right.
   Print: only the invoice (#inv-paper) prints, on whatever paper size the
   browser is set to (A4 or Letter). Scoped with body:has(#inv-form) so no
   other page's printing changes. */

/* ------------------------------------------------------------ layout */
@media (min-width: 1000px) {
  .inv-ws { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.inv-ws .aside { position: static; }

/* ------------------------------------------------------------- form */
#inv-form .inv-example { margin-left: auto; }
#inv-form .panel-bar .field { min-width: 120px; }
#inv-form .inv-set { border: 0; margin: 0; padding: 16px 0 4px; min-width: 0; }
#inv-form .inv-set + .inv-set { border-top: 1px solid var(--line); }
#inv-form .inv-set legend { float: left; width: 100%; padding: 0 20px 8px; font-weight: 620; font-size: 0.95rem; color: var(--ink); }
#inv-form .inv-grid { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 4px 20px 16px; }
#inv-form .inv-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#inv-form .inv-grid-1 { grid-template-columns: minmax(0, 1fr); }
#inv-form .inv-grid .field, #inv-form .inv-stack { min-width: 0; }
#inv-form .inv-stack { display: grid; gap: 14px; }
#inv-form .inv-pad { clear: both; padding: 0 20px 14px; }
#inv-form .inv-remember { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 0 20px 16px; }
#inv-form .inv-remember .hint { flex-basis: 100%; }
#inv-form .err { font-size: 0.82rem; color: var(--error); }
#inv-form textarea, #inv-form input[type="email"], #inv-form input[type="tel"] {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-control);
  transition: border-color .15s, box-shadow .15s;
}
#inv-form textarea { resize: vertical; line-height: 1.45; }
#inv-form textarea:focus, #inv-form input[type="email"]:focus, #inv-form input[type="tel"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
#inv-form .inv-pct { max-width: 160px; }
#inv-form .inv-pct > span { left: auto; right: 12px; }
#inv-form .inv-pct > input { padding-left: 12px; padding-right: 32px; }

/* Item rows */
#inv-form .inv-cols, #inv-form .inv-line { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 0.7fr) minmax(0, 1.2fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; padding-inline: 20px; }
#inv-form .inv-cols { clear: both; font-size: 0.8rem; font-weight: 560; color: var(--ink-3); padding-bottom: 6px; }
#inv-form .inv-cols span:nth-child(4) { text-align: right; }
#inv-form .inv-lines { list-style: none; margin: 0; padding: 0 0 8px; }
#inv-form .inv-line { padding-block: 4px; min-width: 0; }
#inv-form .inv-line .field { min-width: 0; }
#inv-form .inv-line .field label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#inv-form .inv-l-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#inv-form .inv-remove { padding-inline: 8px; min-height: 44px; }
#inv-form .inv-remove[disabled] { opacity: .4; cursor: not-allowed; }
#inv-form .inv-line .err { grid-column: 1 / -1; margin: 0; }
#inv-form .inv-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

@media (max-width: 640px) {
  #inv-form .inv-grid, #inv-form .inv-grid-4 { grid-template-columns: minmax(0, 1fr); }
  #inv-form .panel-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #inv-form .inv-example { grid-column: 1 / -1; margin-left: 0; }
  #inv-form .inv-cols { display: none; }
  #inv-form .inv-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; padding-block: 12px; box-shadow: inset 0 1px 0 var(--line); }
  #inv-form .inv-l-desc { grid-column: 1 / 3; }
  #inv-form .inv-remove { grid-column: 3; grid-row: 1; }
  #inv-form .inv-l-amount { grid-column: 1 / -1; }
  #inv-form .inv-line .field label { position: static !important; width: auto; height: auto; clip: auto; font-size: 0.78rem; }
}

/* ---------------------------------------------------------- preview */
.inv-preview { display: grid; gap: 8px; min-width: 0; }
.inv-preview-label { font-size: 0.86rem; font-weight: 560; color: var(--ink-2); padding: 0 4px; }
.inv-paper {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-box);
  box-shadow: var(--shadow-2); padding: clamp(20px, 4vw, 40px); font-size: 0.9rem; line-height: 1.5;
  display: grid; gap: 24px; min-width: 0; overflow-wrap: anywhere;
}
.inv-paper p { margin: 0; }
.inv-paper .inv-missing { color: var(--ink-3); font-style: italic; }
.inv-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.inv-from { color: var(--ink-2); min-width: 0; flex: 1 1 180px; }
.inv-from-name, .inv-to-name { font-weight: 650; color: var(--ink); font-size: 1.05rem; }
.inv-titlebox { text-align: right; min-width: 0; flex: 0 1 auto; }
.inv-word { font-size: 1.6rem; font-weight: 660; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.inv-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 10px 0 0; justify-content: end; font-variant-numeric: tabular-nums; }
.inv-meta dt { color: var(--ink-3); }
.inv-meta dd { margin: 0; font-weight: 560; }
.inv-cap { font-size: 0.78rem; font-weight: 620; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px !important; }
.inv-to { color: var(--ink-2); }
.inv-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.inv-table th { text-align: left; font-size: 0.78rem; font-weight: 620; color: var(--ink-3); padding: 8px 6px; border-bottom: 1px solid var(--line-2); }
.inv-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-table .r { text-align: right; white-space: nowrap; }
.inv-table .inv-desc { width: 55%; }
.inv-sum { display: grid; grid-template-columns: auto auto; gap: 6px 24px; justify-content: end; margin: -8px 0 0; font-variant-numeric: tabular-nums; }
.inv-sum dt { color: var(--ink-2); text-align: right; }
.inv-sum dd { margin: 0; text-align: right; font-weight: 560; }
.inv-sum .inv-total { font-weight: 680; color: var(--ink); font-size: 1.1rem; border-top: 1px solid var(--line-2); padding-top: 8px; }
.inv-terms { color: var(--ink-2); }
.inv-notes { color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 14px; }

/* ------------------------------------------------------------ print */
@media print {
  body:has(#inv-form) .tool-intro,
  body:has(#inv-form) #inv-form,
  body:has(#inv-form) .inv-ws .result,
  body:has(#inv-form) .inv-preview-label,
  body:has(#inv-form) .inv-ws .fineprint,
  body:has(#inv-form) .inv-ws .ad,
  body:has(#inv-form) .article,
  body:has(#inv-form) .related-tools,
  body:has(#inv-form) .site-head,
  body:has(#inv-form) .site-foot,
  body:has(#inv-form) .toast { display: none !important; }
  body:has(#inv-form) main.wrap { max-width: none; padding: 0; }
  body:has(#inv-form) .inv-ws { display: block; }
  body:has(#inv-form) .inv-ws .aside { display: block; }
  body:has(#inv-form) .inv-paper { border: 0; border-radius: 0; box-shadow: none; padding: 0; font-size: 10.5pt; gap: 18pt; }
  body:has(#inv-form) .inv-paper .inv-missing { display: none; }
  body:has(#inv-form) .inv-table tr { break-inside: avoid; }
  body:has(#inv-form) .inv-sum, body:has(#inv-form) .inv-notes { break-inside: avoid; }
}

/* ---- jwt.css ---- */
/* JWT decoder (/jwt-decoder/). Tokens only.
 * Monospace for code values uses the system's own monospace fonts (no web fonts). */
.jw-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
#jw-form .err { font-size: 0.86rem; color: var(--error); overflow-wrap: anywhere; }
.jw-input { padding: 20px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
#jw-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; line-height: 1.5; color: var(--ink);
  background: var(--surface); width: 100%; min-height: 140px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line-2); border-radius: var(--r-control); word-break: break-all;
  transition: border-color .15s, box-shadow .15s;
}
#jw-token:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
#jw-token[aria-invalid="true"] { border-color: var(--error); background: var(--error-soft); }
.jw-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.jw-safe { display: flex; gap: 8px; align-items: flex-start; font-size: 0.84rem; color: var(--ink-2); }
.jw-safe .icon { color: var(--accent); margin-top: 2px; }
.jw-part { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; min-width: 0; }
.jw-part:last-child { border-bottom: 0; }
.jw-part-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jw-h { font-size: 1.02rem; letter-spacing: -0.01em; }
.jw-pre { margin: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-control); font-size: 0.86rem; line-height: 1.55; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.jw-sig { font-size: 0.9rem; color: var(--ink-2); }
.jw-status { font-size: clamp(1.6rem, 1.4rem + 0.8vw, 2rem); font-weight: 660; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; color: var(--ink); }
.jw-status[data-state="bad"] { color: var(--error); }
.jw-status[data-state="ok"] { color: var(--accent); }
#jw-r-rows { grid-template-columns: minmax(0, 1fr); }
#jw-r-rows dt { padding-bottom: 0; font-size: 0.82rem; }
#jw-r-rows dd { text-align: left; padding-top: 2px; font-size: 0.86rem; font-weight: 520; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
#jw-r-rows dd:last-of-type { border-bottom: 0; }
#jw-r-rows dd.jw-warn { color: var(--error); }
main:has(#jw-form) .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; color: var(--ink); overflow-wrap: anywhere; }

/* ---- markup.css ---- */
/* Markup and margin calculator (/markup-calculator/). Tokens only. */
#mk-form .mk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; }
#mk-form .mk-fields .field { min-width: 0; }
#mk-form .mk-pct > span { left: auto; right: 12px; }
#mk-form .mk-pct > input { padding-left: 12px; padding-right: 32px; }
#mk-form .err { font-size: 0.82rem; color: var(--error); }
#mk-form .mk-foot-btns { display: flex; gap: 8px; }
#mk-form .mk-mode { min-width: 0; max-width: 100%; }
#mk-form .mk-mode .segmented { max-width: 100%; }
@media (max-width: 640px) {
  #mk-form .mk-fields { grid-template-columns: 1fr; }
  #mk-form .mk-mode .segmented { grid-auto-flow: row; width: 100%; }
}

/* ---- military-time.css ---- */
/* Military time converter (/military-time-converter/): converter panes and
 * the printable 24-hour chart. Tokens only. Print rules apply only on the
 * page that has the chart (#military-chart), so other tools' printing is
 * untouched. */
.mt-fields { padding: 20px; }
.mt-fields .field { max-width: 360px; min-width: 0; }
.mt-fields input { min-width: 0; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
#mt-form .err { font-size: 0.82rem; color: var(--error); }
#mt-form .mt-mode { min-width: 0; max-width: 100%; }
#mt-form .mt-mode .segmented { max-width: 100%; }
.mt-foot-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-note { margin: -4px 22px 16px; padding: 10px 12px; border-radius: var(--r-control); background: var(--surface-2); color: var(--ink-2); font-size: 0.86rem; }

.mt-chart { margin-top: clamp(32px, 5vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1); padding: 20px; scroll-margin-top: 96px; }
.mt-chart-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.mt-chart-head h2 { font-size: 1.3rem; }
.mt-chart-head .hint { margin-top: 6px; }
.mt-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mt-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: var(--r-control); overflow: hidden; }
.mt-table caption { text-align: left; font-weight: 600; color: var(--ink); padding: 0 0 8px; }
.mt-table th, .mt-table td { padding: 5px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.mt-table th { background: var(--surface-2); color: var(--ink); font-size: 0.84rem; font-weight: 600; }
.mt-table td { color: var(--ink-2); }
.mt-table td:first-child { color: var(--ink); font-weight: 600; }
.mt-table tbody tr:last-child td { border-bottom: 0; }
.mt-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.mt-table tr.is-key td { color: var(--ink); font-weight: 650; }
.mt-word { color: var(--ink-3); font-weight: 500; }
.mt-chart-note { margin-top: 14px; font-size: 0.88rem; color: var(--ink-2); }
.mt-print-only { display: none; }
@media (max-width: 640px) {
  .mt-chart-grid { grid-template-columns: minmax(0, 1fr); }
  #mt-form .mt-mode .segmented { grid-auto-flow: row; width: 100%; }
}
@media (max-width: 380px) { .mt-table th, .mt-table td { padding: 5px 8px; } }

/* Print: only the chart, on one page. */
@media print {
  body:has(#military-chart) .tool-intro,
  body:has(#military-chart) .workspace,
  body:has(#military-chart) #mt-print { display: none !important; }
  body:has(#military-chart) main { padding: 0; }
  .mt-chart { margin: 0; padding: 0; border: 0; box-shadow: none; break-inside: avoid; }
  .mt-chart-head { margin-bottom: 10pt; }
  .mt-chart-head h2 { font-size: 16pt; }
  .mt-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14pt; }
  .mt-table { font-size: 11pt; border-color: #999; }
  .mt-table caption { color: #000; }
  .mt-table th, .mt-table td { padding: 3pt 8pt; border-color: #bbb; color: #000; }
  .mt-table th { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mt-table tbody tr:nth-child(even) td { background: #f3f3f3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mt-word { color: #333; }
  .mt-chart-note { font-size: 10pt; color: #000; }
  .mt-print-only { display: block; margin-top: 8pt; font-size: 9pt; color: #555; }
}

/* ---- overtime.css ---- */
/* Overtime calculator (/overtime-calculator/). Tokens only. */
.ot-rule-note { padding: 14px 20px 0; }
.ot-cols, .ot-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; align-items: center; padding-inline: 20px; }
.ot-cols { padding-block: 14px 6px; font-size: 0.8rem; font-weight: 560; color: var(--ink-3); }
.ot-cols span:last-child { text-align: right; }
.ot-row { padding-block: 6px; min-width: 0; }
.ot-row label { font-size: 0.95rem; font-weight: 560; color: var(--ink); line-height: 1.2; }
.ot-row label small { display: block; color: var(--ink-3); font-weight: 400; font-size: 0.8rem; margin-top: 2px; }
.ot-row input { min-width: 0; width: 100%; }
.ot-out { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 8px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.ot-out.is-zero { color: var(--ink-3); font-weight: 450; }
.ot-x { font-size: 0.82rem; font-weight: 560; color: var(--accent); }
.ot-x2 { color: var(--ink); }
.ot-row .err { grid-column: 2 / -1; font-size: 0.82rem; color: var(--error); margin-top: -2px; }
.ot-days { padding-bottom: 8px; }
.ot-format { padding: 6px 20px 18px; }
.ot-seventh { display: flex; gap: 8px; align-items: flex-start; margin: -4px 22px 16px; padding: 10px 12px; border-radius: var(--r-control); background: var(--accent-soft); color: var(--ink); font-size: 0.86rem; }
.ot-seventh .icon { color: var(--accent); margin-top: 1px; width: 1.1em; height: 1.1em; }
.panel-bar #ot-rate, .panel-bar #ot-start { width: 150px; max-width: 100%; }
@media (max-width: 640px) {
  .ot-cols { display: none; }
  .ot-row { grid-template-columns: 96px minmax(0, 1fr); gap: 6px 10px; padding-block: 10px; box-shadow: inset 0 1px 0 var(--line); }
  .ot-out { grid-column: 2; justify-content: flex-start; text-align: left; }
  .ot-row .err { grid-column: 1 / -1; }
  #ot-form .panel-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  #ot-form .panel-bar .field:first-child { grid-column: 1 / -1; }
  #ot-form .panel-bar .segmented { width: 100%; }
  .panel-bar #ot-rate, .panel-bar #ot-start { width: 100%; }
}

/* ---- paint.css ---- */
/* Paint calculator (tokens only, see site.css). */
#pnt-form .pnt-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 20px; }
#pnt-form .field, #pnt-form input { min-width: 0; }
#pnt-form .pnt-dim[hidden] { display: none; }
.pnt-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pnt-unit { position: relative; min-width: 0; }
.pnt-unit > input { width: 100%; padding-right: 40px; }
.pnt-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: 0.86rem; }
.pnt-unit.pnt-wide > input { padding-right: 132px; }
.pnt-ceiling { align-self: end; padding-bottom: 12px; }
.pnt-wall { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.7fr); gap: 10px 14px; align-items: end; margin: 0; padding: 18px 20px; border: 0; min-width: 0; }
.pnt-wall + .pnt-wall { border-top: 1px solid var(--line); }
.pnt-wall legend { float: left; width: 100%; padding: 0; font-weight: 600; font-size: 0.95rem; grid-column: 1 / -1; }
.pnt-remove { position: absolute; top: 10px; right: 12px; }
.pnt-out { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); padding-bottom: 12px; overflow-wrap: anywhere; }
.pnt-out.is-zero { color: var(--ink-3); font-weight: 450; }
.pnt-add { padding: 4px 20px 18px; }
#pnt-form .pnt-err { font-size: 0.86rem; color: var(--error); margin: 0; padding: 0 20px 16px; }
.pnt-section { border-top: 1px solid var(--line); padding: 18px 20px 20px; }
.pnt-h { margin-bottom: 12px; }
.pnt-h .hint { display: block; margin-top: 2px; }
.pnt-opens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.pnt-open { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pnt-open legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; }
.pnt-open input[type="number"] { width: 100%; }
.pnt-paint { display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr) minmax(0, 0.8fr); gap: 16px 18px; }
.pnt-paint .field[hidden] { display: none; }
.pnt-why { padding: 0 22px 16px; font-size: 0.86rem; color: var(--ink-2); }
@media (max-width: 640px) {
  #pnt-form .pnt-body, .pnt-opens, .pnt-paint { grid-template-columns: 1fr; }
  .pnt-wall { grid-template-columns: 1fr; }
  .pnt-out { text-align: left; padding-bottom: 0; }
  .panel-bar #pnt-example { margin-left: 0 !important; grid-column: 1 / -1; }
  #pnt-form .panel-bar .field { grid-column: 1 / -1; }
  .pnt-ceiling { padding-bottom: 0; }
}

/* ---- pay-rise.css ---- */
/* Pay rise calculator (/pay-rise-calculator/). Tokens only. */
.rs-body { padding: 20px; }
.rs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rs-grid .field, .rs-grid input, #rs-form .rs-seg { min-width: 0; }
.rs-grid .field[hidden] { display: none; }
#rs-form .rs-suffix > span { left: auto; right: 12px; }
#rs-form .rs-suffix > input { padding-left: 12px; padding-right: 32px; }
#rs-form .err { font-size: 0.82rem; color: var(--error); }
#rs-form .rs-inf-note { grid-column: 1 / -1; }
#rs-form .rs-foot-btns { display: flex; gap: 8px; }
@media (max-width: 640px) { .rs-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { #rs-form .rs-seg, #rs-form .rs-seg .segmented { width: 100%; } }
#rs-form select, #rs-form .options-body .field { min-width: 0; max-width: 100%; }

/* ---- percent-change.css ---- */
/* Percentage change calculator (/percentage-increase-calculator/). Tokens only. */
#pc-form .pc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px 20px 8px; }
#pc-form .pc-fields .field { min-width: 0; }
#pc-form .pc-suffix > span { left: auto; right: 12px; }
#pc-form .pc-suffix > input { padding-left: 12px; padding-right: 32px; }
#pc-form .err { font-size: 0.82rem; color: var(--error); }
#pc-form .pc-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 20px 20px; }
#pc-form .pc-actions .segmented span { gap: 6px; }
#pc-form .pc-actions .segmented .icon { width: 1em; height: 1em; }
#pc-form .pc-foot-btns { display: flex; gap: 8px; }
#pc-form .pc-mode { min-width: 0; max-width: 100%; }
#pc-form .pc-mode .segmented { max-width: 100%; }
@media (max-width: 640px) {
  #pc-form .pc-fields { grid-template-columns: 1fr; }
  #pc-form .pc-mode .segmented { grid-auto-flow: row; width: 100%; }
}

/* ---- pro-rata.css ---- */
/* Pro-rata salary: two-column field grid in the panel body. Tokens only. */
.pr-body { display: grid; gap: 18px; padding: 20px; }
.pr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pr-grid[hidden] { display: none; }
.pr-body .field, .pr-body input { min-width: 0; }
.pr-body .err, .pr-part-err { font-size: 0.82rem; color: var(--error); }
.pr-part-err { grid-column: 1 / -1; }
@media (max-width: 520px) { .pr-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- pto.css ---- */
/* PTO calculator (/pto-calculator/). Tokens only. */
.pt-body { display: grid; gap: 18px; padding: 20px; }
.pt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pt-grid[hidden] { display: none; }
.pt-body .field, .pt-body input, .pt-body select { min-width: 0; }
#pt-form .err { font-size: 0.82rem; color: var(--error); }
#pt-form .pt-mode { min-width: 0; max-width: 100%; }
#pt-form .pt-mode .segmented { max-width: 100%; }
@media (max-width: 640px) {
  .pt-grid { grid-template-columns: minmax(0, 1fr); }
  #pt-form .pt-mode .segmented { grid-auto-flow: row; width: 100%; }
}
#pt-form .options-body .field, #pt-form .options-body input { min-width: 0; }

/* ---- sleep.css ---- */
/* Sleep calculator (/sleep-calculator/). Tokens only. */
.sl-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.sl-fields .field, .sl-fields input, .sl-fields select { min-width: 0; }
.sl-fields .err, #sl-form .options .err { font-size: 0.82rem; color: var(--error); }
.sl-time-row { display: flex; gap: 8px; min-width: 0; }
.sl-time-row input { flex: 1; min-width: 0; }
.sl-time-row .btn { min-height: 44px; }
#sl-list dt .hint { display: block; }
#sl-list dt { position: relative; padding-left: 18px; }
#sl-list dt.sl-fit::before { content: ""; position: absolute; left: 2px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
#sl-list dd .hint { display: block; font-weight: 400; }
#sl-list:empty { display: none; }
.sl-key { display: flex; gap: 8px; align-items: flex-start; margin: -4px 22px 14px; font-size: 0.86rem; color: var(--ink-2); }
.sl-key .icon { color: var(--accent); width: 1.1em; height: 1.1em; margin-top: 2px; }
.sl-key:has(span:empty) { display: none; }
@media (max-width: 640px) {
  .sl-fields { grid-template-columns: minmax(0, 1fr); }
}

/* ---- split-bill.css ---- */
/* Split the bill (/split-bill-calculator/). Tokens only. */
#sb-form .sb-amounts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 20px; }
#sb-form .sb-amounts .field { min-width: 0; }
#sb-form .sb-pct > span { left: auto; right: 12px; }
#sb-form .sb-pct > input { padding-left: 12px; padding-right: 32px; }
#sb-form .sb-check { margin-top: 4px; font-size: 0.86rem; }
#sb-form .err { font-size: 0.82rem; color: var(--error); }
#sb-form .sb-people { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 16px 20px 20px; min-width: 0; display: grid; gap: 10px; }
#sb-form .sb-legend { float: left; width: 100%; display: flex; justify-content: space-between; align-items: baseline; padding: 0; font-weight: 620; font-size: 0.95rem; color: var(--ink); }
#sb-form .sb-legend .hint { font-weight: 400; font-variant-numeric: tabular-nums; }
#sb-form .sb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: sb; }
#sb-form .sb-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); min-width: 0; }
#sb-form .sb-row .field { min-width: 0; }
#sb-form .sb-row .sb-remove { min-height: 44px; }
#sb-form .sb-row .sb-remove[disabled] { opacity: .4; cursor: not-allowed; }
#sb-form .sb-row .err { grid-column: 1 / -1; }
#sb-form[data-mode="equal"] .sb-income { display: none; }
#sb-form[data-mode="equal"] .sb-row { grid-template-columns: minmax(0, 1fr) auto; }
#sb-form .sb-add { display: flex; }
#sb-form .sb-foot-btns { display: flex; gap: 8px; }
.sb-shares { border-top: 1px solid var(--line); }
.sb-shares dt { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  #sb-form .sb-amounts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #sb-form .sb-amounts .sb-bill { grid-column: 1 / -1; }
  #sb-form .sb-row { grid-template-columns: minmax(0, 1fr) auto; }
  #sb-form .sb-row .sb-income { grid-column: 1 / 2; grid-row: 2; }
  #sb-form .sb-row .sb-remove { grid-column: 2; grid-row: 1; }
}

/* ---- square-footage.css ---- */
/* Square footage calculator: area rows (tokens only, see site.css). */
.sf-row { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 10px 14px; align-items: end; margin: 0; padding: 18px 20px; border: 0; min-width: 0; }
.sf-row + .sf-row { border-top: 1px solid var(--line); }
.sf-row legend { float: left; width: 100%; padding: 0; font-weight: 600; font-size: 0.95rem; grid-column: 1 / -1; }
.sf-row .field, .sf-row select, .sf-row input { min-width: 0; }
.sf-row select { width: 100%; }
.sf-remove { position: absolute; top: 10px; right: 12px; }
.sf-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sf-unit { position: relative; min-width: 0; }
.sf-unit > input { width: 100%; padding-right: 34px; }
.sf-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: 0.86rem; }
.sf-dim[hidden] { display: none; }
.sf-out { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); padding-bottom: 12px; overflow-wrap: anywhere; }
.sf-out.is-zero { color: var(--ink-3); font-weight: 450; }
.sf-row .err { grid-column: 1 / -1; font-size: 0.82rem; color: var(--error); margin: 0; }
.sf-add { padding: 4px 20px 18px; }
.options-body .err { font-size: 0.82rem; color: var(--error); }
/* The shape list sits on its own line so its longest name is never cut off. */
.sf-shape { grid-column: 1 / -1; max-width: 280px; }
@media (max-width: 640px) {
  .sf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-shape { max-width: none; }
  .sf-shape { grid-column: 1 / -1; }
  .sf-dim { grid-column: 1 / -1; }
  .sf-out { grid-column: 1 / -1; text-align: left; padding-bottom: 0; font-size: 1.05rem; }
  .panel-bar #sf-example { margin-left: 0 !important; }
  .panel-bar #sf-example { grid-column: 1 / -1; }
}

/* ---- time-decimal.css ---- */
/* Time to decimal (/time-to-decimal/): converter panes and the printable
 * minutes chart. Tokens only. Print rules apply only on the page that has the
 * chart (#minutes-chart), so other tools' printing is untouched. */
.td-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px 20px 8px; }
.td-fields .field, .td-fields input { min-width: 0; }
.td-pane > .err { padding: 0 20px; font-size: 0.82rem; color: var(--error); }
.td-help { padding: 4px 20px 20px; }
.td-note { margin: -4px 22px 16px; padding: 10px 12px; border-radius: var(--r-control); background: var(--surface-2); color: var(--ink-2); font-size: 0.86rem; }

.td-chart { margin-top: clamp(32px, 5vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1); padding: 20px; scroll-margin-top: 96px; }
.td-chart-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.td-chart-head h2 { font-size: 1.3rem; }
.td-chart-head .hint { margin-top: 6px; }
.td-chart-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.td-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: var(--r-control); overflow: hidden; }
.td-table th, .td-table td { padding: 5px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.td-table th { background: var(--surface-2); color: var(--ink); font-size: 0.84rem; font-weight: 600; }
.td-table td { color: var(--ink-2); }
.td-table .r { text-align: right; }
.td-table tbody tr:last-child td { border-bottom: 0; }
.td-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.td-table tr.is-exact td.r { color: var(--ink); font-weight: 650; }
.td-chart-note { margin-top: 14px; font-size: 0.88rem; color: var(--ink-2); }
.td-print-only { display: none; }
@media (max-width: 999px) { .td-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .td-chart-grid { gap: 10px; } .td-table th, .td-table td { padding: 5px 8px; } }

/* Print: only the chart, on one page. */
@media print {
  body:has(#minutes-chart) .tool-intro,
  body:has(#minutes-chart) .workspace,
  body:has(#minutes-chart) #td-print { display: none !important; }
  body:has(#minutes-chart) main { padding: 0; }
  .td-chart { margin: 0; padding: 0; border: 0; box-shadow: none; break-inside: avoid; }
  .td-chart-head { margin-bottom: 10pt; }
  .td-chart-head h2 { font-size: 16pt; }
  .td-chart-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10pt; }
  .td-table { font-size: 11pt; border-color: #999; }
  .td-table th, .td-table td { padding: 3pt 8pt; border-color: #bbb; color: #000; }
  .td-table th { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .td-table tbody tr:nth-child(even) td { background: #f3f3f3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .td-chart-note { font-size: 10pt; color: #000; }
  .td-print-only { display: block; margin-top: 8pt; font-size: 9pt; color: #555; }
}

/* ---- timestamp.css ---- */
/* Unix timestamp converter (/unix-timestamp-converter/). Tokens only.
 * Monospace for code values uses the system's own monospace fonts (no web fonts). */
.ts-mono, #ts-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
#ts-form .err { font-size: 0.86rem; color: var(--error); }
.ts-now { padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-box) var(--r-box) 0 0; }
.ts-now-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ts-now-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.ts-now-item { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control); }
.ts-now-unit { grid-column: 1; font-size: 0.78rem; font-weight: 560; color: var(--ink-3); }
.ts-now-val { grid-column: 1; font-size: 1.3rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ts-now-item .btn { grid-column: 2; grid-row: 1 / span 2; }
.ts-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; padding: 20px; border-bottom: 1px solid var(--line); }
.ts-fields .field, .ts-fields input { min-width: 0; }
.ts-wide { grid-column: 1 / -1; }
.ts-row { display: flex; gap: 8px; }
.ts-row input { flex: 1; min-width: 0; font-size: 1.15rem; }
.ts-units { width: max-content; max-width: 100%; }
.ts-units span { padding-inline: 12px; }
input[type="datetime-local"]#ts-date {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  min-height: 44px; width: 100%; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-control); font-variant-numeric: tabular-nums;
}
#ts-date:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
#ts-date[aria-invalid="true"] { border-color: var(--error); background: var(--error-soft); }
@media (prefers-color-scheme: dark) { #ts-date::-webkit-calendar-picker-indicator { filter: invert(1); } }
.ts-discord { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ts-scroll { position: relative; min-width: 0; overflow-x: auto; }
.ts-h { font-size: 1.02rem; letter-spacing: -0.01em; }
.ts-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-control); }
.ts-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ts-table th, .ts-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ts-table th { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); }
.ts-table tr:last-child td { border-bottom: 0; }
.ts-table td:first-child { color: var(--ink-2); white-space: nowrap; }
.ts-table td.ts-mono { color: var(--ink); white-space: nowrap; }
.ts-table td:nth-child(3) { color: var(--ink); }
.ts-table td:last-child { width: 1%; padding-block: 2px; }
.ts-table .btn-quiet { min-height: 36px; padding-inline: 10px; }
.ts-big { font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem); font-weight: 640; letter-spacing: -0.02em; line-height: 1.25; margin-top: 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
#ts-r-rows { grid-template-columns: minmax(0, 1fr); }
#ts-r-rows dt { padding-bottom: 0; font-size: 0.82rem; }
#ts-r-rows dd { text-align: left; padding-top: 2px; font-size: 0.9rem; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
#ts-r-rows dd:last-of-type { border-bottom: 0; }
main:has(#ts-form) .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .ts-now-grid, .ts-fields { grid-template-columns: 1fr; }
  .ts-units { width: 100%; }
  .ts-fields .segmented { width: 100%; }
}

/* Phones: the Discord codes table scrolls inside its own box, never the page. */
@media (max-width: 640px) {
  .ts-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- vat.css ---- */
/* VAT calculator: amount and rate stacked in the panel body. Tokens only. */
.vat-body { display: grid; gap: 18px; padding: 20px; }
.vat-body .field { min-width: 0; }
.vat-body input { width: 100%; min-width: 0; }
.vat-body .err { font-size: 0.82rem; color: var(--error); }
.vat-rates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 420px; }
.vat-rates span { padding-inline: 8px; }
.vat-pct { max-width: 180px; }
.vat-pct > span { left: auto; right: 12px; }
.vat-pct > input { padding-left: 12px; padding-right: 32px; }

/* ---- week-number.css ---- */
/* Week number: the year bar and the table of ISO weeks. Tokens only. */
.wn-yearbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 20px 20px 12px; }
.wn-title { font-size: 1.12rem; letter-spacing: -0.012em; }
.wn-year { display: flex; align-items: center; gap: 4px; }
.wn-year input { width: 6.5em; text-align: center; }
.wn-yearbar .hint, .wn-yearbar .err { grid-column: 1 / -1; }
.wn-yearbar .err { font-size: 0.82rem; color: var(--error); }
.wn-scroll { padding: 0 20px 20px; overflow-x: auto; }
.wn-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: var(--r-box); overflow: hidden; }
.wn-table th, .wn-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.wn-table thead th { background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 0.86rem; }
.wn-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.wn-table td { color: var(--ink-2); }
.wn-table tr:last-child th, .wn-table tr:last-child td { border-bottom: 0; }
.wn-table tr.is-on th, .wn-table tr.is-on td { background: var(--accent-soft); color: var(--ink); }
.wn-table .tag { margin-left: 6px; }
.panel-bar #wn-today { align-self: end; }
@media (max-width: 640px) {
  .wn-yearbar { grid-template-columns: 1fr; }
  .wn-yearbar { padding-inline: 14px; }
  .wn-scroll { padding-inline: 14px; }
  .wn-table th, .wn-table td { padding: 7px 8px; font-size: 0.82rem; }
  .wn-table .tag { display: block; margin: 4px 0 0; width: max-content; }
  .panel-bar #wn-today { grid-column: 1 / -1; }
}
@media print {
  .wn-yearbar .wn-year, #wn-today { display: none !important; }
}

/* ---- weighted-grade.css ---- */
/* Weighted grade calculator (/weighted-grade-calculator/). Tokens only. */
#wg-form .wg-cols, #wg-form .wg-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding-inline: 20px; }
#wg-form[data-mode="pts"] .wg-cols, #wg-form[data-mode="pts"] .wg-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 0.9fr) 40px; }
#wg-form[data-mode="pct"] .wg-pts, #wg-form[data-mode="pts"] .wg-pct { display: none; }
#wg-form .wg-cols { padding-block: 14px 6px; font-size: 0.8rem; font-weight: 560; color: var(--ink-3); }
#wg-form .wg-row { padding-block: 6px; border: 0; margin: 0; min-width: 0; }
#wg-form .wg-row:last-child { padding-bottom: 12px; }
#wg-form .wg-row .field { min-width: 0; }
#wg-form .wg-row .field label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#wg-form .wg-row input { min-width: 0; }
#wg-form .wg-suffix > span { left: auto; right: 12px; }
#wg-form .wg-suffix > input { padding-left: 12px; padding-right: 30px; }
#wg-form .wg-remove { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
#wg-form .wg-remove:disabled { opacity: .35; cursor: not-allowed; }
#wg-form .wg-row .err { grid-column: 1 / -1; font-size: 0.82rem; color: var(--error); margin-top: -2px; }
#wg-form .wg-add-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 20px 20px; }
#wg-form .wg-add-bar .btn:disabled { opacity: .5; cursor: not-allowed; }
#wg-breakdown:empty { display: none; }
#wg-breakdown { padding-bottom: 0; }
#wg-breakdown dt .hint { display: block; }
@media (max-width: 640px) {
  #wg-form .wg-cols { display: none; }
  #wg-form .wg-row, #wg-form[data-mode="pts"] .wg-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 40px; gap: 8px 10px; padding-block: 14px; box-shadow: inset 0 1px 0 var(--line); }
  #wg-form .wg-row .wg-name { grid-column: 1 / 3; }
  #wg-form .wg-row .wg-remove { grid-column: 3; grid-row: 1; align-self: end; }
  #wg-form[data-mode="pts"] .wg-row .wg-weight { grid-column: 1 / 3; }
  #wg-form .wg-row .field label { position: static !important; width: auto; height: auto; clip: auto; font-size: 0.78rem; }
  #wg-form .panel-bar #wg-example { margin-left: 0 !important; }
}

/* ---- zakat.css ---- */
/* Zakat calculator (/zakat-calculator/). Tokens only. */
#zk-form .zk-group { border: 0; margin: 0; padding: 18px 20px 6px; min-width: 0; }
#zk-form .zk-group + .zk-group { border-top: 1px solid var(--line); }
#zk-form .zk-group legend { padding: 0; font-weight: 600; font-size: 0.98rem; margin-bottom: 12px; float: left; width: 100%; }
#zk-form .zk-group legend + * { clear: both; }
#zk-form .zk-group legend .hint { font-weight: 400; margin-left: 4px; }
#zk-form .zk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
#zk-form .zk-grid .field, #zk-form .zk-grid input, #zk-form .zk-grid select { min-width: 0; }
#zk-form .err { font-size: 0.82rem; color: var(--error); }
#zk-form .zk-metal { display: grid; gap: 10px; padding-top: 4px; }
#zk-form .zk-metal .segmented { justify-self: start; }
#zk-form .zk-suffix > span { left: auto; right: 12px; }
#zk-form .zk-suffix > input { padding-left: 12px; padding-right: 30px; }
#zk-form .zk-note { display: flex; gap: 8px; align-items: flex-start; margin: -2px 0 14px; }
#zk-form .zk-note .icon { color: var(--ink-3); width: 1.1em; height: 1.1em; margin-top: 2px; }
#zk-form .zk-options { grid-template-columns: minmax(0, 1fr); }
#zk-form .zk-weights span { padding-inline: 10px; }
@media (max-width: 640px) {
  #zk-form .zk-grid { grid-template-columns: minmax(0, 1fr); }
  #zk-form .zk-weights { grid-auto-flow: row; }
  #zk-form .panel-bar #zk-example { margin-left: 0 !important; }
}
