/* ===== Design tokens ===== */
:root {
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --border: #E3E7EC;
  --text: #14181F;
  --muted: #5B6472;
  --accent: #C2410C;
  --accent-strong: #9A3412;
  --accent-tint: #FDEDE3;
  --on-accent: #FFFFFF;
  --danger: #B4262E;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --max-width: 720px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0B1220;
  --card: #121A2A;
  --border: #223047;
  --text: #E7ECF5;
  --muted: #93A0B4;
  --accent: #FB923C;
  --accent-strong: #FDBA74;
  --accent-tint: rgba(251, 146, 60, 0.14);
  --on-accent: #2A1204;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

@font-face { font-family: "Manrope"; src: local("Manrope"); }
@font-face { font-family: "Inter"; src: local("Inter"); }

* { box-sizing: border-box; }

/* Author rules that set `display` (e.g. .tool-actions { display: flex }) win over
   the browser's default [hidden] { display: none } regardless of specificity, since
   author styles always beat UA styles. Restore `hidden` as an authoritative override. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

/* Offsets in-page anchor jumps (e.g. breadcrumb category links) so their
   target isn't scrolled directly under the sticky .site-header. */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

h1, h2, h3, .brand__name { font-family: var(--font-ui); font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--accent-strong); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: var(--on-accent); padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* ===== Header ===== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.site-header__inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand__mark { width: 22px; height: 22px; color: var(--accent); }
.brand__name { font-size: 17px; }

.site-search { position: relative; flex: 1; max-width: 380px; margin-left: auto; }
.site-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.site-search input {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14px;
}
/* The search-results dropdown, the theme menu, the consent banner, and the extra
   theme palettes are all in site-kit.css (they pair with the shared JS libs). */

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; }
.site-footer__inner {
  max-width: 1080px; margin: 0 auto; padding: 28px 24px;
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  color: var(--muted); font-size: 14px;
}
.site-footer nav a { color: var(--muted); margin-right: 16px; text-decoration: none; }
.site-footer nav a:hover { color: var(--accent-strong); }

/* ===== Breadcrumbs ===== */
.breadcrumbs { margin: 0 0 16px; }
.breadcrumbs ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted);
}
.breadcrumbs li { display: flex; align-items: center; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--border); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover, .breadcrumbs a:focus-visible { color: var(--accent-strong); text-decoration: underline; }
.breadcrumbs li[aria-current="page"] { color: var(--text); }

/* ===== Eyebrow ===== */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em;
  color: var(--accent-strong); text-transform: uppercase; margin: 0 0 10px;
}

/* ===== Homepage ===== */
.home { max-width: 1080px; margin: 0 auto; padding: 48px 24px 64px; }
.hero { max-width: 640px; margin-bottom: 48px; }
.hero h1 { font-size: 40px; margin: 0 0 12px; }
.hero__lede { color: var(--muted); font-size: 17px; margin: 0; }

.home-section { margin-bottom: 48px; }
.home-section h2 { font-size: 20px; margin: 0 0 16px; }

.home-prose { max-width: 720px; margin: 0 0 48px; }
.home-prose h2 { font-size: 20px; margin: 0 0 12px; }
.home-prose p { color: var(--muted); margin: 0 0 14px; }
.home-prose a { text-decoration: underline; }
.home-prose dl { margin: 0; }
.home-prose dt { font-weight: 700; margin-top: 16px; }
.home-prose dd { margin: 4px 0 0; color: var(--muted); }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px;
}
.tool-tile {
  display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-tile:hover, .tool-tile:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.tool-tile__icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center;
}
.tool-tile__icon svg { width: 18px; height: 18px; }
.tool-tile__title { font-family: var(--font-ui); font-weight: 700; font-size: 15px; }
.tool-tile__desc { color: var(--muted); font-size: 13px; margin: 0; }

/* ===== Tool page ===== */
.tool-page { max-width: var(--max-width); margin: 0 auto; padding: 48px 24px 64px; }
.tool-page h1 { font-size: 30px; margin: 0 0 8px; }
.tool-page__lede { color: var(--muted); margin: 0 0 28px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin-bottom: 32px;
}

.field-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mode-tab { position: relative; }
.mode-tab input { position: absolute; opacity: 0; }
.mode-tab span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.mode-tab input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mode-tab input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 16px;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
/* a measurement field with its unit menu */
.unit-field { display: flex; gap: 8px; }
.unit-field input { flex: 1; min-width: 0; }
.field .unit-field select { width: auto; flex: none; }
.field .unit-field select, .unit-echo { width: 5.2em; box-sizing: border-box; font-size: 15px; }
.unit-echo { align-self: center; flex: none; padding-left: 14px; color: var(--muted); }

/* printable sheets (scripts/printables.js): the SVG unit is 1 mm. On screen the
   sheet shrinks to fit and isn't to scale; on paper it is 180 mm wide. */
.print-sheet { margin: 0 0 24px; }
.print-sheet svg { display: block; width: 100%; max-width: 180mm; height: auto; border: 1px solid var(--border); }
@media print {
  @page { margin: 10mm; }
  .site-header, .site-footer, .consent-banner, .skip-link, .no-print { display: none !important; }
  body:has(.print-sheet) { background: #fff; }
  body:has(.print-sheet) .tool-page { max-width: none; margin: 0; padding: 0; }
  body:has(.print-sheet) .tool-page h1 { display: none; }
  .print-sheet { margin: 0; break-inside: avoid; }
  .print-sheet + .print-sheet { break-before: page; }
  .print-sheet svg { width: 180mm; max-width: none; border: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* every size in the table on one scale (scale-drawing.js) */
.scale-drawing { margin: 18px 0 4px; }
.scale-drawing svg { display: block; width: 100%; height: auto; max-height: 340px; }
.scale-drawing .sd-other { fill: none; stroke: var(--muted); stroke-width: 1; opacity: 0.65; }
.scale-drawing .sd-chosen { fill: var(--accent); opacity: 0.22; }
.scale-drawing .sd-edge { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.scale-drawing__caption { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 0; }

/* hand-drawn "where to measure" diagrams, coloured by the theme */
.measure-figure { margin: 8px 0 20px; text-align: center; }
.measure-figure svg { width: 100%; max-width: 420px; height: auto; }
.measure-figure svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.measure-figure .mf-body { stroke: var(--muted); stroke-width: 2; }
.measure-figure .mf-tape { stroke: var(--accent); stroke-width: 3.5; stroke-dasharray: 8 5; }
.measure-figure .mf-ghost { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 5; opacity: 0.6; }
.measure-figure .mf-lead { stroke: var(--accent); stroke-width: 1; }
.measure-figure text { fill: var(--text); font: 12.5px var(--font-ui); }
.measure-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
html[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393A0B4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.field__hint { font-size: 12px; color: var(--danger); margin: 6px 0 0; min-height: 14px; }

.result-block { text-align: center; padding: 20px 0 8px; }
.result-block--secondary { padding: 4px 0; }
.result-block__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 4px; }
.result-block__value { font-family: var(--font-mono); font-size: 40px; font-weight: 600; color: var(--accent-strong); margin: 0; word-break: break-word; }
.result-block__value--small { font-size: 16px; font-weight: 500; color: var(--text); }

.contrast-gauge { margin: 8px 0 20px; }
.contrast-gauge__track { position: relative; height: 14px; margin-bottom: 6px; }
.contrast-gauge__zones { display: flex; height: 100%; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); }
.contrast-gauge__zones > div { height: 100%; }
.contrast-gauge__pin {
  position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--text); border-radius: 2px;
  transform: translateX(-50%); box-shadow: 0 0 0 2px var(--card); transition: left 0.15s ease;
}
.contrast-gauge__pin-label {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700;
  color: var(--text); background: var(--card); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border);
  white-space: nowrap;
}
.contrast-gauge__ticks { position: relative; height: 14px; margin-bottom: 10px; font-size: 11px; color: var(--muted); }
.contrast-gauge__ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.contrast-gauge__ticks span:first-child { transform: translateX(0); }
.contrast-gauge__ticks span:last-child { transform: translateX(-100%); }
.contrast-gauge__legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.contrast-gauge__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* range-slider / value-slider / sortable-list / thermo-gauge (vendor/*.js, from
   the sibling animated-tools catalog) — themed via their own CSS custom
   properties to match this site's design tokens. */
range-slider, value-slider {
  --track-color: var(--border);
  --fill-color: var(--accent);
  --thumb-color: var(--card);
  --thumb-border: var(--accent);
  --text-color: var(--muted);
}
sortable-list {
  --item-bg: var(--card);
  --border-color: var(--border);
  --text-color: var(--text);
  --handle-color: var(--muted);
}
thermo-gauge {
  --stroke: var(--border);
  --track-color: var(--bg);
  --color-normal: var(--accent);
  --color-hot: var(--danger);
}

/* Reference tables — the core content type on this site (cups-to-grams,
   size charts, etc.), so this is a shared style rather than per-tool inline CSS. */
.reference-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.reference-table caption { text-align: left; font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.reference-table th, .reference-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.reference-table th { font-weight: 700; color: var(--text); background: var(--bg); }
.reference-table td { color: var(--muted); }
.reference-table tbody tr:hover td { background: var(--accent-tint); color: var(--text); }

/* build.js wraps every table in this. When a table is wider than the screen it
   scrolls here, and a shadow on the edge shows there is more to see: the two
   plain gradients move with the table and hide the shadows at either end. */
.table-scroll {
  --scroll-bg: var(--card);
  --scroll-shadow: color-mix(in srgb, var(--text) 28%, transparent);
  overflow-x: auto; margin: 18px 0;
  background:
    linear-gradient(to right, var(--scroll-bg) 40%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--scroll-bg) 40%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) right / 12px 100% no-repeat scroll;
}
.table-scroll > .reference-table { margin: 0; }
.guide .table-scroll { --scroll-bg: var(--bg); margin: 0 0 20px; }
.guide .table-scroll > table { margin: 0; }

.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.tool-actions__status { min-height: 18px; font-size: 13px; color: var(--muted); margin: 8px 0 0; }

.btn {
  font-family: var(--font-ui); font-weight: 600; font-size: 14px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer;
}
/* the 404 panel sets its own --accent, which the button inside it would inherit;
   pass the theme's through instead */
empty-state-panel { --accent: inherit; }
.btn--ghost { background: transparent; color: var(--accent-strong); }
.btn:hover { filter: brightness(0.95); }
#btn-fullscreen[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #fff; }

.content-block { margin-bottom: 32px; }
.content-block h2 { font-size: 18px; margin: 0 0 12px; }
.content-block p, .content-block li { color: var(--muted); }
.content-block dt { font-weight: 700; color: var(--text); margin-top: 14px; }
.content-block dd { margin: 4px 0 0; color: var(--muted); }

.home-section h2 a { color: inherit; }
.home-section h2 a:hover { color: var(--accent-strong); }
.category-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.category-links a { text-decoration: underline; }
.related__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
/* When .related__grid is reused as a multi-column field layout, reserve two
   lines of label height so inputs stay aligned across columns even when only
   some labels wrap (e.g. "Annual business expenses" vs "Billable hours per week"). */
.related__grid .field label { min-height: 2.4em; line-height: 1.2; }

code {
  font-family: var(--font-mono); font-size: 0.9em; background: var(--accent-tint);
  color: var(--accent-strong); padding: 2px 5px; border-radius: 4px;
}
pre {
  font-family: var(--font-mono); font-size: 13px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  overflow-x: auto; margin: 0 0 14px;
}
pre code {
  background: none; color: inherit; padding: 0; border-radius: 0;
}

@media (max-width: 640px) {
  /* minmax(0, …) lets a column be narrower than its longest word, so the grid
     can't push the page sideways. Link tiles and fields drop to one column when
     two of 150px don't fit. */
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related__grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
  .related__grid:has(> .field) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field input, .field select { min-width: 0; }
  .tool-tile { padding: 14px; overflow-wrap: break-word; }
  .tool-page { padding-left: 16px; padding-right: 16px; }
  .card { padding-left: 16px; padding-right: 16px; }
  /* tighter cells let most tables fit without scrolling */
  .reference-table { font-size: 13px; }
  .reference-table th, .reference-table td { padding: 8px 6px; }
  .guide th, .guide td { padding: 6px; }
  .hero h1 { font-size: 30px; }
  .site-header__inner { padding: 14px 16px; gap: 10px; }
  .brand { flex-shrink: 0; }
  .brand__name { display: none; }
  .site-search { flex: 1 1 auto; min-width: 0; max-width: none; margin-left: 0; }
}

/* ===== Guides (/guides, /guides/<slug>) ===== */
.guide { color: var(--muted); }
.guide > p, .guide li { color: var(--muted); }
.guide h2 { font-size: 21px; margin: 36px 0 12px; color: var(--text); }
.guide h3 { font-size: 17px; margin: 24px 0 8px; color: var(--text); }
.guide p { margin: 0 0 16px; }
.guide ul, .guide ol { margin: 0 0 16px; padding-left: 22px; }
.guide li { margin: 4px 0; }
.guide a { text-decoration: underline; }
.guide strong { color: var(--text); }
.guide table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14px; }
.guide th, .guide td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.guide th { background: var(--accent-tint); color: var(--text); font-family: var(--font-ui); }
.guide blockquote {
  margin: 0 0 16px; padding: 8px 16px; border-left: 3px solid var(--accent);
  background: var(--accent-tint); border-radius: 0 8px 8px 0;
}
.guide__meta { font-size: 13px; margin: 0 0 28px; }

/* Inline guide figures — SVG diagrams and, on a couple of guides, a gauge
   component ported from the animated-tools sibling project (radial-gauge.js,
   tank-gauge.js, thermo-gauge.js) — to break up long guide articles visually. */
.guide-figure {
  margin: 8px 0 24px; padding: 24px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
}
.guide-figure svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.guide-figure figcaption { margin-top: 14px; font-size: 13px; color: var(--muted); }
.guide-figure--widget { display: flex; flex-direction: column; align-items: center; }
.guide-figure__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 24px; }
.guide-figure__item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.guide-figure__item strong { color: var(--text); font-size: 13px; }
.gfig-label { font: 11px/1.3 var(--font-ui); fill: var(--muted); }
.gfig-value { font: 700 13px/1.3 var(--font-ui); fill: var(--text); }
.gfig-strong { font: 700 13px/1.3 var(--font-ui); fill: var(--accent-strong); }
.gfig-accent { fill: var(--accent); }
.gfig-accent-line { stroke: var(--accent); }
.gfig-line { stroke: var(--border); }

.tool-page.guide-index-page { max-width: 1080px; }
.guide-index__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 0;
}
.guide-card {
  display: flex; flex-direction: column; padding: 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.guide-card:hover, .guide-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.guide-card__head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.guide-card__icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.guide-card__icon svg { width: 18px; height: 18px; }
.guide-card__title { font-size: 17px; margin: 0; }
.guide-card__desc { color: var(--muted); margin: 0; font-size: 14px; flex: 1; }

/* radial-gauge / tank-gauge (vendor/*.js, from the sibling animated-tools
   catalog) — themed via their own CSS custom properties, same pattern as
   thermo-gauge above. Used inside guide-figure widgets, not on tool pages. */
radial-gauge {
  --stroke: var(--muted);
  --track-color: var(--bg);
  --color-normal: var(--accent);
  --color-warn: var(--accent);
  --color-danger: var(--danger);
  --text-color: var(--text);
}
tank-gauge {
  --stroke: var(--muted);
  --bg-track: var(--bg);
  --color-normal: var(--accent);
  --color-low: var(--accent);
  --color-high: var(--accent);
  --color-fault: var(--danger);
  --text-color: var(--text);
  --pct-color: var(--on-accent);
}
/* The "Idle/Filling/Draining/Fault" state label is meaningful for a live
   dashboard gauge; in a guide figure the tank represents a fixed reference
   quantity (e.g. "1 cup"), so the state text underneath would just read
   "Idle" and add noise — hide it via its exposed shadow-DOM part. */
tank-gauge::part(state-label) { display: none; }

.result-panel__header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; margin-bottom: 6px;
}
.result-panel.is-fullscreen {
  display: flex; flex-direction: column; padding: 20px; background: var(--bg);
}
.result-panel.is-fullscreen .result-panel__header { flex: 0 0 auto; margin-bottom: 12px; }
.result-panel.is-fullscreen textarea,
.result-panel.is-fullscreen .json-tree,
.result-panel.is-fullscreen .code-highlight {
  flex: 1 1 auto; width: 100%; height: auto; max-height: none;
  resize: none !important; /* the textarea sets resize:vertical inline; only !important can win over that */
}

.json-tree {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); font-family: var(--font-mono); font-size: 14px;
  overflow: auto; height: 220px; resize: vertical;
}
.json-tree .json-formatter-row { font-family: var(--font-mono); }

/* json-formatter-js (vendor/json-formatter.min.js) self-injects its own <style>
   after this stylesheet loads, so overrides here are scoped under .json-tree
   to out-specificity it rather than relying on source order. */
.json-tree .json-formatter-row, .json-tree .json-formatter-row a, .json-tree .json-formatter-row a:hover { color: var(--text); text-decoration: none; }
.json-tree .json-formatter-row .json-formatter-string, .json-tree .json-formatter-row .json-formatter-stringifiable { color: #2a9d5c; white-space: pre; word-wrap: break-word; }
.json-tree .json-formatter-row .json-formatter-number { color: #2b6cb0; }
.json-tree .json-formatter-row .json-formatter-boolean { color: #c0392b; }
.json-tree .json-formatter-row .json-formatter-null, .json-tree .json-formatter-row .json-formatter-undefined { color: #a0682a; }
.json-tree .json-formatter-row .json-formatter-bracket { color: var(--muted); }
.json-tree .json-formatter-row .json-formatter-key { color: var(--accent-strong); padding-right: 0.2rem; }
.json-tree .json-formatter-row .json-formatter-toggler-link { cursor: pointer; }
.json-tree .json-formatter-row > a > .json-formatter-preview-text { color: var(--muted); }
.json-tree .json-formatter-dark.json-formatter-row .json-formatter-string, .json-tree .json-formatter-dark.json-formatter-row .json-formatter-stringifiable { color: #6ee7a8; }
.json-tree .json-formatter-dark.json-formatter-row .json-formatter-number { color: #7ec2ff; }
.json-tree .json-formatter-dark.json-formatter-row .json-formatter-boolean { color: #ff8a7a; }
.json-tree .json-formatter-dark.json-formatter-row .json-formatter-null, .json-tree .json-formatter-dark.json-formatter-row .json-formatter-undefined { color: #eec97d; }

/* Prism.js (vendor/prism.min.js) — highlighted output uses tokens we color
   ourselves rather than one of Prism's bundled themes, so it matches the
   .json-tree palette above and stays in sync with light/dark mode. */
.code-highlight {
  margin: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-family: var(--font-mono); font-size: 13px;
  line-height: 1.5; overflow: auto; height: 220px; resize: vertical; white-space: pre;
}
.code-highlight code { font-family: var(--font-mono); white-space: pre; }
.code-highlight .token.comment, .code-highlight .token.prolog, .code-highlight .token.doctype, .code-highlight .token.cdata,
.result-block__value .token.comment, .result-block__value .token.prolog, .result-block__value .token.doctype, .result-block__value .token.cdata { color: var(--muted); }
.code-highlight .token.punctuation, .result-block__value .token.punctuation { color: var(--muted); }
.code-highlight .token.property, .code-highlight .token.tag, .code-highlight .token.boolean, .code-highlight .token.number, .code-highlight .token.constant, .code-highlight .token.symbol, .code-highlight .token.deleted,
.result-block__value .token.property, .result-block__value .token.tag, .result-block__value .token.boolean, .result-block__value .token.number, .result-block__value .token.constant, .result-block__value .token.symbol, .result-block__value .token.deleted { color: #2b6cb0; }
.code-highlight .token.selector, .code-highlight .token.attr-name, .code-highlight .token.string, .code-highlight .token.char, .code-highlight .token.builtin, .code-highlight .token.inserted,
.result-block__value .token.selector, .result-block__value .token.attr-name, .result-block__value .token.string, .result-block__value .token.char, .result-block__value .token.builtin, .result-block__value .token.inserted { color: #2a9d5c; }
.code-highlight .token.operator, .code-highlight .token.entity, .code-highlight .token.url, .result-block__value .token.operator, .result-block__value .token.entity, .result-block__value .token.url { color: var(--text); }
.code-highlight .token.atrule, .code-highlight .token.attr-value, .code-highlight .token.keyword,
.result-block__value .token.atrule, .result-block__value .token.attr-value, .result-block__value .token.keyword { color: #a0682a; }
.code-highlight .token.function, .code-highlight .token.class-name, .result-block__value .token.function, .result-block__value .token.class-name { color: var(--accent-strong); }
.code-highlight .token.regex, .code-highlight .token.important, .code-highlight .token.variable,
.result-block__value .token.regex, .result-block__value .token.important, .result-block__value .token.variable { color: #c0392b; }
.code-highlight .token.important, .code-highlight .token.bold, .result-block__value .token.important, .result-block__value .token.bold { font-weight: 700; }
.code-highlight .token.italic, .result-block__value .token.italic { font-style: italic; }
html[data-theme="dark"] .code-highlight .token.property, html[data-theme="dark"] .code-highlight .token.tag, html[data-theme="dark"] .code-highlight .token.boolean, html[data-theme="dark"] .code-highlight .token.number, html[data-theme="dark"] .code-highlight .token.constant, html[data-theme="dark"] .code-highlight .token.symbol, html[data-theme="dark"] .code-highlight .token.deleted,
html[data-theme="dark"] .result-block__value .token.property, html[data-theme="dark"] .result-block__value .token.tag, html[data-theme="dark"] .result-block__value .token.boolean, html[data-theme="dark"] .result-block__value .token.number, html[data-theme="dark"] .result-block__value .token.constant, html[data-theme="dark"] .result-block__value .token.symbol, html[data-theme="dark"] .result-block__value .token.deleted { color: #7ec2ff; }
html[data-theme="dark"] .code-highlight .token.selector, html[data-theme="dark"] .code-highlight .token.attr-name, html[data-theme="dark"] .code-highlight .token.string, html[data-theme="dark"] .code-highlight .token.char, html[data-theme="dark"] .code-highlight .token.builtin, html[data-theme="dark"] .code-highlight .token.inserted,
html[data-theme="dark"] .result-block__value .token.selector, html[data-theme="dark"] .result-block__value .token.attr-name, html[data-theme="dark"] .result-block__value .token.string, html[data-theme="dark"] .result-block__value .token.char, html[data-theme="dark"] .result-block__value .token.builtin, html[data-theme="dark"] .result-block__value .token.inserted { color: #6ee7a8; }
html[data-theme="dark"] .code-highlight .token.atrule, html[data-theme="dark"] .code-highlight .token.attr-value, html[data-theme="dark"] .code-highlight .token.keyword,
html[data-theme="dark"] .result-block__value .token.atrule, html[data-theme="dark"] .result-block__value .token.attr-value, html[data-theme="dark"] .result-block__value .token.keyword { color: #eec97d; }
html[data-theme="dark"] .code-highlight .token.regex, html[data-theme="dark"] .code-highlight .token.important, html[data-theme="dark"] .code-highlight .token.variable,
html[data-theme="dark"] .result-block__value .token.regex, html[data-theme="dark"] .result-block__value .token.important, html[data-theme="dark"] .result-block__value .token.variable { color: #ff8a7a; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
