/* Tanod Tools: shared tokens, chrome and tool-board components.
   Built into site/tools/tools.css by ops/tools_site/build.py (parts concatenated in name order).
   Fonts are the main site's self-hosted files (SIL OFL 1.1, see /fonts/). */

@font-face {
  font-family: "Bungee";
  src: url("/fonts/bungee-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var.woff2") format("woff2-variations"), url("/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-var.woff2") format("woff2-variations"), url("/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  --enamel: #f3c11a;
  --enamel-hi: #ffd43f;
  --enamel-deep: #dba705;
  --enamel-wash: #fdf3cf;
  --ink: #16140f;              /* lettering on enamel, in both themes */
  --ink-soft-on-enamel: #3d3412;
  --route: #1636a3;
  --route-on-enamel: #11298a;
  --go: #1d6b38;

  --ground: #e9eced;           /* steel body, lightened for long tasks */
  --ground-2: #dde1e2;
  --surface: #ffffff;          /* the posted board */
  --surface-2: #f5f6f6;        /* wells inside the board */
  --text: #16140f;
  --text-soft: #4a4f52;
  --hair: #cfd4d6;
  --frame: #16140f;
  --slot: #8c9497;             /* drop-slot dashes */
  --selected: #f3c11a;
  --focus: #1636a3;
  --code-ground: #16181a;
  --code-ink: #e9ece8;

  --stripe-a: #1636a3;
  --stripe-c: #ffffff;

  --font-sign: "Bungee", "Archivo", sans-serif;
  --font-text: "Archivo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1120px;
  --gutter: 16px;
  --radius: 6px;
  --radius-sm: 4px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --route: #8eabff;
    --go: #5fc583;
    --ground: #15181b;
    --ground-2: #0f1113;
    --surface: #1d2125;
    --surface-2: #171a1d;
    --text: #eef0f0;
    --text-soft: #aab3b7;
    --hair: #353c41;
    --frame: #6f7a80;
    --slot: #6f7a80;
    --focus: #f3c11a;
    --enamel-wash: #2f2a14;
    --code-ground: #0b0c0d;
    --stripe-c: #15181b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --route: #8eabff;
  --go: #5fc583;
  --ground: #15181b;
  --ground-2: #0f1113;
  --surface: #1d2125;
  --surface-2: #171a1d;
  --text: #eef0f0;
  --text-soft: #aab3b7;
  --hair: #353c41;
  --frame: #6f7a80;
  --slot: #6f7a80;
  --focus: #f3c11a;
  --enamel-wash: #2f2a14;
  --code-ground: #0b0c0d;
  --stripe-c: #15181b;
}

/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--slot) var(--ground);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
@media (min-width: 720px) { body { font-size: 1.0625rem; } }

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

a {
  color: var(--route);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 3px; }

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

h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; text-wrap: pretty; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.9em; }
p code, li code, td code, dd code {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  padding: 0.05em 0.3em;
  border-radius: 3px;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 20;
  background: var(--ink);
  color: var(--enamel);
  padding: 10px 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.skip:focus { top: 8px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.mark {
  width: 1.5em;
  height: 1.5em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

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

.top {
  background: var(--enamel);
  color: var(--ink);
}
.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-block: 10px;
}
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-family: var(--font-sign);
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  text-shadow: 0.045em 0.05em 0 var(--route-on-enamel);
  white-space: nowrap;
}
.wordmark span {
  color: var(--route-on-enamel);
  text-shadow: 0.045em 0.05em 0 var(--ink);
}
.wordmark:hover { text-decoration: none; }
.wordmark:focus-visible { outline-color: var(--ink); }

.catnav { margin-left: auto; min-width: 0; }
.catnav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.catnav a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}
.catnav a:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.catnav a[aria-current] { box-shadow: inset 0 -3px 0 var(--ink); border-radius: 0; }
.catnav a:focus-visible { outline-color: var(--ink); }

@media (max-width: 600px) {
  .top__inner { padding-bottom: 0; gap: 4px; }
  .catnav {
    flex-basis: 100%;
    margin-inline: calc(var(--gutter) * -1);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .catnav::-webkit-scrollbar { display: none; }
  .catnav ul { padding-inline: calc(var(--gutter) - 10px); }
}

/* the painted side-stripe under the signboard */
.stripe {
  height: 12px;
  background: linear-gradient(
    to bottom,
    var(--enamel) 0 3px,
    var(--stripe-c) 3px 4px,
    var(--stripe-a) 4px 8px,
    var(--stripe-c) 8px 9px,
    var(--enamel) 9px 12px
  );
}

/* ------------------------------------------------------------------ page head */

.page { flex: 1 0 auto; padding-top: 20px; padding-bottom: 64px; }
@media (min-width: 720px) { .page { padding-top: 28px; } }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-soft);
}
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--slot); }
.crumbs a { color: var(--text-soft); }

.intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  margin-bottom: 20px;
}
.intro__mark {
  grid-row: 1 / span 2;
  align-self: start;
  width: 52px;
  height: 52px;
  padding: 8px;
  background: var(--enamel);
  color: var(--ink);
  border-radius: var(--radius);
  stroke-width: 4;
}
.intro h1 {
  font-size: clamp(1.625rem, 4.6vw, 2.375rem);
  font-weight: 800;
  font-stretch: 88%;
  letter-spacing: -0.01em;
}
.lede {
  grid-column: 2;
  color: var(--text-soft);
  max-width: 62ch;
}
@media (max-width: 520px) {
  .intro { grid-template-columns: 1fr; }
  .intro__mark { display: none; }
  .lede { grid-column: 1; }
}

.local-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--frame);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--route);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
}
.local-tag .mark { width: 16px; height: 16px; stroke-width: 5; }
.intro .local-tag { grid-column: 2; justify-self: start; }
@media (max-width: 520px) { .intro .local-tag { grid-column: 1; } }

/* ------------------------------------------------------------------ the tool board */

.board {
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 14px 30px -24px rgba(0, 0, 0, 0.6);
}
@media (min-width: 720px) { .board { padding: 24px; } }

.board { display: flex; flex-direction: column; gap: 16px; }
.board > * { min-width: 0; }

.limits {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--text-soft);
}

/* drop slot */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: clamp(220px, 38vh, 340px);
  padding: 28px 16px;
  text-align: center;
  border: 2px dashed var(--slot);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.drop.is-compact { min-height: 0; padding: 14px 16px; flex-direction: row; flex-wrap: wrap; }
.drop.is-compact .drop__mark, .drop.is-compact .drop__title { display: none; }
.drop.is-compact .btn--primary { background: var(--surface); color: var(--text); border-color: var(--frame); min-height: 44px; padding: 9px 16px; font-size: 0.9375rem; }
.drop.is-compact .btn--primary:hover { background: var(--surface-2); }
.drop.is-over {
  background: var(--enamel-wash);
  border-color: var(--ink);
  border-style: solid;
}
:root[data-theme="dark"] .drop.is-over { border-color: var(--enamel); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .drop.is-over { border-color: var(--enamel); } }
.drop__mark { width: 48px; height: 48px; color: var(--text-soft); }
.drop__title { font-size: 1.25rem; font-weight: 800; font-stretch: 92%; }
.drop__hint { font-size: 0.875rem; color: var(--text-soft); }
.drop__local {
  text-wrap: balance;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--route);
}
.drop__local .mark { width: 15px; height: 15px; stroke-width: 5; vertical-align: -2px; margin-right: 6px; }
.drop.is-compact .drop__local { display: none; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 28px; }
@media (max-width: 560px) { .checks, .util-checks { flex-direction: column; } }
.opts--pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 280px)); }
.drop__hint kbd {
  padding: 0 0.3em;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: var(--surface);
  font-size: 0.85em;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border: 2px solid var(--frame);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms var(--ease), transform 80ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .mark { width: 18px; height: 18px; stroke-width: 5; }

.btn--primary {
  background: var(--enamel);
  border-color: var(--ink);
  color: var(--ink);
}
.btn--primary:hover { background: var(--enamel-hi); }
.btn--primary:focus-visible { outline-color: var(--focus); }
.btn--lg { min-height: 52px; padding: 12px 22px; font-size: 1.0625rem; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--route); padding-inline: 10px; }
.btn--quiet:hover { background: color-mix(in srgb, var(--route) 10%, transparent); }
.btn--sm { min-height: 36px; padding: 6px 10px; font-size: 0.875rem; }
.btn--icon { min-width: 44px; padding: 8px; }
.btn--icon.btn--sm { min-width: 36px; padding: 6px; }

/* file inputs ride inside a label styled as a button */
.btn input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.actions--end { justify-content: flex-end; }
.actions .spacer { flex: 1; }

/* form controls */
.opts {
  display: grid;
  gap: 14px 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: start;
}
.opts--wide { grid-template-columns: 1fr; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label, fieldset > legend, .label {
  font-weight: 700;
  font-size: 0.875rem;
}
.field .help, .help { font-size: 0.8125rem; color: var(--text-soft); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset > legend { padding: 0; margin-bottom: 6px; }

input[type="text"], input[type="number"], input[type="search"], input[type="password"], input[type="url"],
input[type="date"], input[type="time"], input[type="datetime-local"],
select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1.5px solid var(--slot);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  caret-color: var(--route);
}
textarea { line-height: 1.5; resize: vertical; min-height: 180px; display: block; }
input[type="date"], input[type="time"], input[type="datetime-local"] { font-variant-numeric: tabular-nums; }
textarea.mono, input.mono { font-family: var(--font-mono); font-size: 0.875rem; }
input:hover, select:hover, textarea:hover { border-color: var(--text-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  border-color: var(--frame);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--frame); border-width: 2px; border-style: dashed; }
::placeholder { color: var(--text-soft); opacity: 0.85; }
select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

input[type="checkbox"], input[type="radio"] {
  width: 20px; height: 20px;
  margin: 0;
  accent-color: var(--enamel-deep);
  flex: none;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 0.9375rem;
  cursor: pointer;
}

input[type="range"] { width: 100%; accent-color: var(--enamel-deep); min-height: 32px; }
input[type="color"] {
  width: 52px; height: 44px; padding: 3px;
  border: 1.5px solid var(--slot); border-radius: var(--radius-sm); background: var(--surface);
}

/* segmented choice (radio group) */
.seg {
  display: inline-flex;
  width: fit-content;
  justify-self: start;
  align-self: flex-start;
  flex-wrap: wrap;
  border: 2px solid var(--frame);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 100%;
}
.seg { gap: 1.5px; background: var(--hair); }
.seg label {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  background: var(--surface);
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked) { background: var(--enamel); color: var(--ink); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }

/* value readouts */
.num { font-family: var(--font-mono); font-weight: 700; letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ file list */

.files {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
}
.files li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 8px 8px 12px;
}
.files li + li { border-top: 1px solid var(--hair); }
.files__idx { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-soft); min-width: 1.5em; }
.files__name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.files__meta { display: block; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-soft); font-weight: 400; }
.files__btns { display: flex; gap: 2px; }

/* ------------------------------------------------------------------ status */

.status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
}
.status .mark { width: 20px; height: 20px; margin-top: 1px; stroke-width: 5; }
.status[data-state="working"] { background: var(--surface-2); }
.status[data-state="working"] .status__bar {
  display: block;
}
.status[data-state="done"] { background: var(--surface-2); border: 1.5px solid var(--hair); color: var(--text); }
.status[data-state="done"] .mark { color: var(--text); }
.status[data-state="error"] {
  background: var(--enamel);
  color: var(--ink);
  border: 2px solid var(--ink);
}
.status__body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.status__bar {
  display: none;
  height: 6px;
  border-radius: 3px;
  background: var(--hair);
  overflow: hidden;
}
.status__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--enamel-deep);
  transition: width 200ms linear;
}
.status__bar.is-indeterminate i {
  width: 35%;
  animation: slide 1.1s var(--ease) infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) {
  .status__bar.is-indeterminate i { animation: none; width: 100%; opacity: 0.6; }
}

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

.result {
  border: 2px solid var(--frame);
  border-radius: var(--radius-sm);
  overflow: hidden;
  animation: rise 220ms var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .result { animation: none; } }
.result__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 14px;
  background: var(--enamel);
  color: var(--ink);
}
.result__title { font-weight: 800; font-size: 1.0625rem; font-stretch: 92%; overflow-wrap: anywhere; min-width: 0; }
.result__size { display: block; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; color: var(--ink-soft-on-enamel); }
.result__head .btn { border-color: var(--ink); }
.result__head .btn:not(.btn--primary) { background: transparent; color: var(--ink); }
.result__head .btn:not(.btn--primary):hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.result__head :focus-visible { outline-color: var(--ink); }
.dl {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 420px;
  overflow: auto;
}
.dl li {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  flex-wrap: wrap;
}
.dl li + li { border-top: 1px solid var(--hair); }
.dl__name { flex: 1 1 12rem; min-width: 0; font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.dl__size { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-soft); white-space: nowrap; }
.result__note { padding: 10px 14px; font-size: 0.875rem; color: var(--text-soft); border-top: 1px solid var(--hair); }

/* ------------------------------------------------------------------ previews and thumbnails */

.preview {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--ground-2) 25%, transparent 25%, transparent 75%, var(--ground-2) 75%),
    linear-gradient(45deg, var(--ground-2) 25%, transparent 25%, transparent 75%, var(--ground-2) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  overflow: hidden;
}
.preview canvas, .preview img { max-width: 100%; max-height: 60vh; height: auto; display: block; }

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) { .thumbs { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; } }
.thumb {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 2px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  user-select: none;
}
.thumb__img {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  overflow: hidden;
}
.thumb__img canvas { position: absolute; inset: 0; margin: auto; width: auto !important; height: auto; max-width: 100%; max-height: 100%; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); transition: transform 200ms var(--ease); }
.thumb__label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-soft); }
.thumb.is-selected { border-color: var(--ink); background: var(--enamel-wash); box-shadow: inset 0 0 0 2px var(--enamel); }
:root[data-theme="dark"] .thumb.is-selected { border-color: var(--enamel); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thumb.is-selected { border-color: var(--enamel); } }
.thumb.is-removed .thumb__img { opacity: 0.3; }
.thumb.is-removed .thumb__label { text-decoration: line-through; }
.thumb button.thumb__hit {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
}
.thumb__tools { display: flex; justify-content: center; gap: 2px; position: relative; }
.thumb.is-dragging { opacity: 0.4; }
.thumb.is-drop-target { border-color: var(--route); border-style: dashed; }
.thumb__badge {
  position: absolute;
  top: 4px; right: 4px;
  z-index: 1;
  min-width: 24px; height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--enamel);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 24px;
  pointer-events: none;
}

/* ------------------------------------------------------------------ stats (label grid) */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  margin: 0;
  border: 2px solid var(--frame);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--hair);
  gap: 1px;
}
.stats div { background: var(--surface); padding: 10px 14px 12px; min-width: 0; }
.stats dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.stats dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.stats dd small { font-size: 0.8125rem; font-weight: 400; color: var(--text-soft); letter-spacing: 0; }

/* output text / code wells */
.out {
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 60vh;
  overflow: auto;
}

.note {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-soft);
}

/* ------------------------------------------------------------------ ad slots: reserved, empty in v1 */

.ad-slot:empty { display: none; }
.ad-slot { margin-top: 24px; }

/* ------------------------------------------------------------------ below the board */

.below {
  display: grid;
  gap: 40px;
  margin-top: 48px;
}
@media (min-width: 960px) {
  .below {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px 56px;
    align-items: start;
  }
  .below > .related { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 20px; }
}

.below h2 {
  font-size: 1.375rem;
  font-weight: 800;
  font-stretch: 90%;
  margin-bottom: 14px;
}
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 0.9em; }
.prose h3 { font-size: 1.0625rem; font-weight: 800; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }

.steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  max-width: 68ch;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 12px;
  align-items: start;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--enamel);
  font-family: var(--font-sign);
  font-size: 0.9375rem;
  line-height: 1;
}
:root[data-theme="dark"] .steps li::before { background: var(--enamel); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .steps li::before { background: var(--enamel); color: var(--ink); } }
.steps li > span { padding-top: 0.2em; }

.faq { max-width: 68ch; }
.faq details { border-top: 1.5px solid var(--hair); }
.faq details:last-child { border-bottom: 1.5px solid var(--hair); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  margin-top: 0.4em;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 0.65em; }
.faq summary:hover { color: var(--route); }
.faq .faq__a { padding: 0 0 16px; color: var(--text-soft); }
.faq .faq__a > * + * { margin-top: 0.6em; }

.related {
  padding: 16px;
  border: 2px solid var(--frame);
  border-radius: var(--radius);
  background: var(--surface);
}
.related h2 { font-size: 1.0625rem; margin-bottom: 8px; }
.related ul { margin: 0; padding: 0; list-style: none; }
.related a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  margin-inline: -6px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.related a:hover { background: var(--surface-2); color: var(--route); }
.related .mark { width: 22px; height: 22px; color: var(--text-soft); }
.related__all { margin-top: 8px; font-size: 0.9375rem; }

/* ------------------------------------------------------------------ footer */

.foot {
  background: var(--enamel);
  color: var(--ink);
  border-top: 6px solid var(--ink);
  padding: 32px 0 28px;
  font-size: 0.9375rem;
}
.foot a { color: var(--ink); font-weight: 600; }
.foot a:focus-visible { outline-color: var(--ink); }
.foot__grid {
  display: grid;
  gap: 24px 48px;
}
@media (min-width: 800px) { .foot__grid { grid-template-columns: 1.1fr 1fr; } }
.foot__mark {
  font-family: var(--font-sign);
  font-size: 1.75rem;
  line-height: 1;
  text-shadow: 0.045em 0.05em 0 var(--route-on-enamel);
  margin-bottom: 10px;
}
.foot__privacy { max-width: 60ch; color: var(--ink-soft-on-enamel); }
.foot__privacy strong { color: var(--ink); }
.foot__privacy p + p { margin-top: 0.6em; }
.foot__cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; }
.foot__cats h2 {
  font-family: var(--font-sign);
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.foot__cats ul { margin: 0; padding: 0; list-style: none; font-size: 0.875rem; line-height: 1.9; }
.foot__note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-size: 0.875rem;
  color: var(--ink-soft-on-enamel);
}

/* Tools index: category route boards whose stops are tools, plus the filter. */

.hub-head { margin-bottom: 24px; }
.hub-head h1 {
  font-size: clamp(1.75rem, 5.2vw, 2.75rem);
  font-weight: 800;
  font-stretch: 86%;
  letter-spacing: -0.015em;
  max-width: 20ch;
}
.hub-head .lede { margin-top: 10px; grid-column: auto; }
.hub-head .local-tag { margin-top: 14px; }

.finder {
  position: relative;
  max-width: 560px;
  margin-bottom: 28px;
}
.finder input {
  min-height: 52px;
  padding-left: 46px;
  border: 2px solid var(--frame);
  font-size: 1.0625rem;
  background: var(--surface);
}
.finder .mark {
  position: absolute;
  left: 14px;
  top: 26px;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}
.finder__count { margin-top: 8px; font-size: 0.875rem; color: var(--text-soft); min-height: 1.4em; }

.routes {
  columns: 3 300px;
  column-gap: 20px;
}
.routes > .route { break-inside: avoid; margin-bottom: 20px; }
.route {
  border: 2px solid var(--frame);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  scroll-margin-top: 16px;
}
.route__plate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--enamel);
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.route__plate .mark { width: 30px; height: 30px; }
.route__plate h2 {
  font-family: var(--font-sign);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--route-on-enamel);
  text-shadow: 0.045em 0.05em 0 var(--ink);
}
.route__count { margin-left: auto; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft-on-enamel); }
.stops { margin: 0; padding: 6px 0; list-style: none; }
.stops a {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 2px 12px;
  align-items: center;
  padding: 9px 16px;
  color: var(--text);
  text-decoration: none;
}
.stops a:hover { background: var(--surface-2); }
.stops a:hover .stops__name { color: var(--route); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
.stops .mark { width: 26px; height: 26px; grid-row: 1 / span 2; color: var(--text-soft); }
.stops__name { font-weight: 700; line-height: 1.3; }
.stops__desc { grid-column: 2; font-size: 0.875rem; color: var(--text-soft); line-height: 1.35; }
.stops li + li { border-top: 1px solid var(--hair); }
.stops li { margin-inline: 0; }
.route.is-empty { display: none; }
.finder__empty { margin-top: 8px; }

.hub-about {
  margin-top: 56px;
  display: grid;
  gap: 32px 56px;
}
@media (min-width: 900px) { .hub-about { grid-template-columns: 1fr 1fr; } }
.hub-about h2 { font-size: 1.375rem; font-weight: 800; font-stretch: 90%; margin-bottom: 12px; }

/* Single-PDF page tools: file bar, page grid toolbars, split plan. */

.filebar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 10px 12px;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
}
.filebar__name { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.filebar__meta { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-soft); }

.gridbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.gridbar .field { flex: 1 1 220px; }
.gridbar .count { font-size: 0.875rem; color: var(--text-soft); }

.thumbs--square .thumb__img { aspect-ratio: 1 / 1; }

.plan {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.plan li {
  padding: 6px 10px;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.875rem;
}
.plan b { font-family: var(--font-mono); font-weight: 700; }
.plan__more { color: var(--text-soft); }

/* Remove pages: chosen pages read as struck out rather than highlighted */
.is-remove .thumb.is-selected { background: var(--surface-2); box-shadow: none; border-style: dashed; }
.is-remove .thumb.is-selected .thumb__img { opacity: 0.3; }
.is-remove .thumb.is-selected .thumb__label { text-decoration: line-through; color: var(--text); font-weight: 700; }
.thumb .thumb__img:empty::after { content: ""; width: 40%; height: 4px; border-radius: 2px; background: var(--hair); }

/* PDF tools, part 2: page numbers, watermark, PDF to JPG, JPG to PDF, metadata. */
.pdf2-filebar { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; overflow-wrap: anywhere; }
.opts__full { grid-column: 1 / -1; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#work { display: grid; gap: 16px; }
#previews { display: grid; gap: 8px; }
#previews .thumbs { margin: 0; padding: 0; list-style: none; }
.files--img li { grid-template-columns: auto 52px minmax(0, 1fr) auto; }
.files__thumb { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; }
.files__thumb canvas { max-width: 100%; max-height: 100%; display: block; }
#stats { margin: 0; }

/* Image tools: compare, crop stage, rotate toolbar, EXIF report, favicon previews. */

.compare .label { margin-bottom: 8px; }
.compare__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.compare figure { margin: 0; display: grid; gap: 6px; min-width: 0; }
.compare figcaption { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-soft); }
.compare .preview { min-height: 120px; padding: 6px; }

/* crop */
.cropstage { display: grid; place-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--hair); }
.crop { position: relative; display: block; line-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; max-width: 100%; }
.crop canvas { display: block; }
.crop__box {
  position: absolute;
  border: 2px solid var(--enamel);
  box-shadow: 0 0 0 9999px color-mix(in srgb, var(--ink) 58%, transparent);
  cursor: move;
  touch-action: none;
  box-sizing: border-box;
}
.crop__box:focus-visible { outline: 3px solid var(--focus); outline-offset: -5px; }
.crop__h {
  position: absolute;
  width: 18px; height: 18px;
  background: var(--enamel);
  border: 1.5px solid var(--ink);
  box-sizing: border-box;
  touch-action: none;
}
.crop__h::before { content: ""; position: absolute; inset: -13px; }
.crop__h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop__h[data-h="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.crop__h[data-h="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.crop__h[data-h="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.crop-opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); }
.crop-opts__ratio { grid-column: 1 / -1; }

/* rotate */
.rot-tools .btn { flex: 0 1 auto; }

/* EXIF report */
.exif { margin-top: 8px; display: grid; gap: 8px; font-weight: 400; }
.exif__none { font-size: 0.8125rem; color: var(--text-soft); }
.exif__rows { margin: 0; display: grid; gap: 1px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--hair); overflow: hidden; }
.exif__rows > div { display: grid; grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr); gap: 8px; padding: 6px 10px; background: var(--surface); font-size: 0.8125rem; }
.exif__rows dt { font-weight: 700; color: var(--text-soft); }
.exif__rows dd { margin: 0; font-family: var(--font-mono); overflow-wrap: anywhere; }
.exif__rows > .is-flag { background: var(--enamel); color: var(--ink); }
.exif__rows > .is-flag dt { color: var(--ink); }
.exif__flags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.exif__flags li { font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); color: var(--text-soft); }
@media (max-width: 480px) { .exif__rows > div { grid-template-columns: 1fr; gap: 0; } }

/* favicon */
.fav { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.fav__item { margin: 0; display: grid; gap: 6px; justify-items: start; }
.fav__well { min-height: 0; padding: 10px; }
.fav__item canvas { image-rendering: auto; }
.fav__item figcaption { font-size: 0.75rem; color: var(--text-soft); }
.fav__snippet { display: grid; gap: 8px; justify-items: start; padding: 14px; border-top: 1px solid var(--hair); }
.fav__snippet .out { width: 100%; }

/* favicon: image pane stacks its meta line and options with the board rhythm */
#pane-image, #pane-text { display: grid; gap: 16px; }

/* Image tools, batch 2: SVG to PNG preview, Image to Base64, Image color picker. */

.svgp__preview canvas { max-width: 100%; height: auto; }

/* image to base64 */
.b64i { display: grid; gap: 16px; }
.b64i__head { display: grid; gap: 16px; }
@media (min-width: 760px) { .b64i__head { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: start; } }
.b64i__preview { min-height: 140px; }
.b64i__stats { grid-template-columns: 1fr 1fr; }
.b64i__stats dd { font-size: 1.125rem; }
.b64i__out { min-height: 160px; word-break: break-all; }
@media (max-width: 480px) { .b64i__seg { flex-wrap: wrap; } .b64i__seg label { flex: 1 1 30%; } }

/* image color picker */
.cp { display: grid; gap: 18px; }
@media (min-width: 900px) { .cp { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } .cp__pal, .cp > .actions { grid-column: 1 / -1; } }
.cp__stage { display: grid; gap: 8px; justify-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid var(--hair); min-width: 0; }
.cp__img { position: relative; display: block; line-height: 0; cursor: crosshair; touch-action: manipulation; max-width: 100%; }
.cp__img canvas { display: block; max-width: 100%; }
.cp__img:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.cp__cross {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 1.5px #000, inset 0 0 0 1.5px #000;
  pointer-events: none;
}
.cp__stage .help { line-height: 1.4; justify-self: start; }
.cp__side { display: grid; gap: 16px; min-width: 0; }
.cp__aim { display: flex; gap: 14px; align-items: center; }
.cp__loupe { width: 121px; height: 121px; flex: none; border: 2px solid var(--frame); border-radius: var(--radius-sm); image-rendering: pixelated; background: var(--surface-2); }
.cp__now { display: flex; gap: 8px; align-items: center; font-size: 1.125rem; margin-top: 4px; }
.cp__chip { display: inline-block; flex: none; width: 22px; height: 22px; border: 1.5px solid var(--frame); border-radius: var(--radius-sm); }
.cp__picked { display: grid; gap: 10px; }
.cp__big { height: 72px; border: 2px solid var(--frame); border-radius: var(--radius-sm); }
.cp__codes { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cp__codes li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cp__k { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-soft); }
.cp__codes code { font-size: 0.9375rem; overflow-wrap: anywhere; }
.cp__h { font-size: 1.125rem; font-weight: 800; font-stretch: 90%; margin: 0 0 10px; }
.cp__swatches, .cp__palette { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
.cp__swatches { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.cp__sw {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px;
  border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; font-size: 0.875rem; cursor: pointer; text-align: left;
}
.cp__sw:hover { border-color: var(--frame); }
.cp__sw:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cp__sw.is-copied { border-color: var(--frame); background: var(--enamel-wash); }
.cp__share { margin-left: auto; font-weight: 400; color: var(--text-soft); font-size: 0.75rem; }
.cp__palette .cp__chip { width: 26px; height: 26px; }

/* Image tools, batch 3: merge images, add text, filters, borders, placeholder generator. */

/* merge */
.mrg-list { max-height: 360px; overflow: auto; }
.mrg-preview canvas { max-width: 100%; max-height: 60vh; width: auto; height: auto; }
.mrg-opts > .field > .seg { max-width: 100%; }

/* add text */
.txt-stage canvas { cursor: crosshair; touch-action: manipulation; max-width: 100%; }
.txt-stage canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.txt-opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.txt-opts__wide { grid-column: 1 / -1; }
.txt-pair { display: flex; gap: 10px; align-items: center; }
.txt-pair input[type="range"] { flex: 1; min-width: 0; }
.pos { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; }
.pos label { position: relative; display: block; width: 40px; height: 40px; border: 1.5px solid var(--slot); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.pos label:hover { border-color: var(--text-soft); }
.pos input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pos label::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--text-soft); pointer-events: none; }
.pos label:has(input:checked) { background: var(--enamel); border-color: var(--frame); }
.pos label:has(input:checked)::after { background: var(--ink); }
.pos label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* filters */
.flt-view { display: grid; gap: 10px; }
.flt-view .preview canvas { max-width: 100%; }
.flt-opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.flt-slider input { min-width: 0; }

/* border */
.brd-opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.brd-pair { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.brd-pair input[type="number"] { flex: 1 1 90px; min-width: 0; width: auto; }

/* placeholder */
.ph-wide { grid-column: 1 / -1; }
.util-split__side .preview canvas.ph-canvas { max-width: 100%; }
.txt-opts textarea { min-height: 84px; }
.seg label { white-space: nowrap; }

/* Text tools (40-text.css) */

/* word counter layout */
.wc { display: grid; gap: 16px; }
.wc__bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin: -16px -16px 0; padding: 8px 16px;
  background: var(--surface); border-bottom: 2px solid var(--frame);
  font-size: 0.8125rem; color: var(--text-soft);
}
.wc__bar b { color: var(--text); font-size: 1rem; }
.wc__text { min-height: 260px; }
.drop.wc__open { padding: 0; border: 0; background: none; min-height: 0; }
.wc__open .btn--primary { min-height: 44px; }
.wc .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); }
.wc .stats dd { font-size: 1.25rem; }
@media (min-width: 960px) {
  .wc { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 20px; }
  .wc__bar { display: none; }
  .wc__text { min-height: 380px; }
  .wc .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 959px) { .wc__side { order: 3; } }

.wc__more > * + * { margin-top: 12px; }
.wc__h { font-size: 1.125rem; font-weight: 800; font-stretch: 90%; margin: 8px 0 0; }
.dens { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.dens th, .dens td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--hair); }
.dens thead th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); border-bottom: 2px solid var(--frame); }
.dens tbody th { font-weight: 600; overflow-wrap: anywhere; }
.dens td:nth-child(3) { white-space: nowrap; }
.dens__bar { display: inline-block; width: 80px; height: 8px; background: var(--hair); vertical-align: middle; margin-right: 8px; }
.dens__bar i { display: block; height: 100%; background: var(--enamel-deep); }
.dens__pct { font-size: 0.8125rem; font-weight: 400; }
.dens__empty { color: var(--text-soft); }

/* shared two-pane text layout */
.tt { display: grid; gap: 12px; }
.tt__panes { display: grid; gap: 14px; }
@media (min-width: 820px) { .tt__panes--2 { grid-template-columns: 1fr 1fr; } }
.tt textarea { min-height: 220px; }
.tt .modes { display: flex; flex-wrap: wrap; gap: 8px; }
.tt .modes .btn { font-size: 0.9375rem; }
.tt__report { font-family: var(--font-text); font-size: 0.875rem; color: var(--text-soft); }
.tt__err { font-weight: 700; font-size: 0.875rem; }
.tt .opts .check { min-height: 36px; }

/* diff view */
.diff { border: 1.5px solid var(--hair); border-radius: var(--radius-sm); overflow: auto; max-height: 70vh; font-family: var(--font-mono); font-size: 0.8125rem; background: var(--surface); }
.diff__row { display: grid; grid-template-columns: 1fr; }
.diff--side .diff__row { grid-template-columns: 1fr 1fr; }
.diff__cell { display: grid; grid-template-columns: 3.4em 1.4em minmax(0, 1fr); border-bottom: 1px solid var(--hair); min-width: 0; }
.diff--side .diff__cell + .diff__cell { border-left: 1px solid var(--hair); }
.diff__no { padding: 1px 6px; text-align: right; color: var(--text-soft); user-select: none; }
.diff__sign { text-align: center; font-weight: 700; user-select: none; }
.diff__txt { padding: 1px 6px 1px 2px; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.diff__cell--add { background: color-mix(in srgb, var(--go) 16%, var(--surface)); }
.diff__cell--add .diff__sign { color: var(--go); }
.diff__cell--del { background: var(--surface-2); }
.diff__cell--del .diff__txt { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--text-soft); }
.diff__cell--empty { background: var(--surface-2); }
.diff__fold { display: block; width: 100%; padding: 4px 10px; border: 0; border-bottom: 1px solid var(--hair); background: var(--surface-2); color: var(--route); font: inherit; cursor: pointer; text-align: left; }
.diff__flow { padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.diff__flow ins { text-decoration: none; background: color-mix(in srgb, var(--go) 22%, var(--surface)); border-bottom: 2px solid var(--go); }
.diff__flow del { text-decoration: line-through; background: var(--surface-2); color: var(--text-soft); }
.diff--side .diff__flows { display: grid; grid-template-columns: 1fr 1fr; }
.diff--side .diff__flows > * + * { border-left: 1px solid var(--hair); }
@media (max-width: 719px) {
  .diff--side .diff__row, .diff--side .diff__flows { grid-template-columns: 1fr; }
  .diff--side .diff__cell + .diff__cell { border-left: 0; }
}
.diff__sum { display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 700; font-size: 0.9375rem; }
.diff__sum .add { color: var(--go); }
@media (min-width: 960px) { .wc .stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* Text tools, batch 2 (41-text2.css): character counter limits, slug preview, Morse playback. */

/* character counter: length limits table */
.cc-scroll { overflow-x: auto; }
.cc-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cc-lim td { white-space: nowrap; }
.cc-lim tbody th { overflow-wrap: normal; }
/* phones: each limit becomes a small card with labelled values */
@media (max-width: 600px) {
  .cc-lim thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cc-lim tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
  .cc-lim th, .cc-lim td { display: block; padding: 0; border: 0; }
  .cc-lim tbody th { grid-column: 1 / -1; }
  .cc-lim td, .cc-lim td:nth-child(n) { white-space: normal; font-size: 0.875rem; }
  .cc-lim td::before { content: attr(data-label); display: block; font-family: var(--font-text); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
}
.cc-lim td.num { font-family: var(--font-mono); }
.cc-over { font-weight: 800; }
.cc-over__mark {
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  background: var(--enamel);
  border: 1.5px solid var(--ink);
  vertical-align: 1px;
}

/* slug generator: short inputs, address preview */
.tt .slug-io textarea { min-height: 120px; }
.slug-preview { color: var(--text-soft); max-height: none; }
.slug-preview b { color: var(--text); }

/* Morse code: playback row */
.mc-play { align-items: center; }
.mc-wpm { font-weight: 700; font-size: 0.875rem; }
.mc-wpm__sel { width: auto; max-width: 100%; }

/* Text conversions (42-text3.css): Markdown to HTML result switcher and preview. */

.md-result__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.md-result__head .seg label { min-height: 36px; padding-block: 4px; font-size: 0.875rem; }
.tt .md-pane { min-height: 280px; }
@media (min-width: 820px) { .md-label { min-height: 38px; display: flex; align-items: center; } }
@media (min-width: 820px) { .tt .md-pane { min-height: 380px; } }

.md-preview {
  padding: 14px 16px;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface);
  max-height: 70vh;
  overflow: auto;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.md-preview:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.md-preview > * + * { margin-top: 0.75em; }
.md-preview > :first-child { margin-top: 0; }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4, .md-preview h5, .md-preview h6 { font-weight: 800; font-stretch: 92%; margin-top: 1.1em; }
.md-preview h1 { font-size: 1.625rem; }
.md-preview h2 { font-size: 1.375rem; }
.md-preview h3 { font-size: 1.1875rem; }
.md-preview h4, .md-preview h5, .md-preview h6 { font-size: 1rem; }
.md-preview ul, .md-preview ol { padding-left: 1.4em; margin-bottom: 0; }
.md-preview li + li { margin-top: 0.25em; }
.md-preview li > input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0 6px 0 0; vertical-align: -2px; }
.md-preview blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 14px; border-left: 4px solid var(--hair); color: var(--text-soft); }
.md-preview pre { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--code-ground); color: var(--code-ink); overflow: auto; overflow-wrap: normal; }
.md-preview pre code { background: none; padding: 0; color: inherit; font-size: 0.8125rem; }
.md-preview :not(pre) > code { padding: 1px 4px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--hair); font-size: 0.85em; }
.md-preview table { border-collapse: collapse; display: block; max-width: 100%; overflow: auto; font-size: 0.9375rem; }
.md-preview th, .md-preview td { border: 1px solid var(--hair); padding: 5px 10px; text-align: left; }
.md-preview th { background: var(--surface-2); font-weight: 700; }
.md-preview th[align="center"], .md-preview td[align="center"] { text-align: center; }
.md-preview th[align="right"], .md-preview td[align="right"] { text-align: right; }
.md-preview hr { border: 0; border-top: 2px solid var(--hair); }
.md-preview img { max-width: 100%; height: auto; }
.md-img {
  display: inline-block;
  padding: 4px 8px;
  border: 1.5px dashed var(--slot);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-soft);
}
.md-img small { font-family: var(--font-mono); font-size: 0.75rem; overflow-wrap: anywhere; }

/* Utilities group: QR code, password, UUID, Base64, JSON. */
.util-split { display: grid; gap: 20px; }
@media (min-width: 860px) { .util-split { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: start; } }
.util-split__main, .util-split__side, .util-stack { display: grid; gap: 16px; min-width: 0; }
.util-split__side .preview { min-height: 200px; }
.util-split__side canvas { width: 100%; max-width: 320px; height: auto; }
.util-pair { display: grid; grid-template-columns: 1fr 92px; gap: 12px; align-items: center; }
.util-checks { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.util-h { font-size: 1.125rem; margin: 12px 0 0; }
.util-tall { min-height: 220px; }
.util-small { font-size: 1rem !important; }
.util-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.util-list li { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 12px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.util-pw { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 1rem; overflow-wrap: anywhere; word-break: break-all; }
.util-json { white-space: pre; overflow-wrap: normal; max-height: 70vh; tab-size: 4; }
.util-err { white-space: pre; overflow-wrap: normal; border-color: var(--frame); }
#uu-out { white-space: pre; overflow-wrap: normal; max-height: 50vh; }

/* Developer tools: URL encode/decode, hash generator, JWT decoder, number base converter. */

/* label / value rows with an optional copy button */
.dv-rows {
  margin: 0;
  display: grid;
  gap: 1px;
  border: 2px solid var(--frame);
  border-radius: var(--radius-sm);
  background: var(--hair);
  overflow: hidden;
}
.dv-rows > div {
  display: grid;
  grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 8px 10px 8px 14px;
  background: var(--surface);
  min-height: 52px;
}
.dv-rows dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.dv-rows dd { margin: 0; font-family: var(--font-mono); font-size: 0.875rem; overflow-wrap: anywhere; min-width: 0; }
.dv-rows dd.dv-plain { font-family: var(--font-text); word-break: normal; }
.dv-rows > .is-match { background: var(--enamel-wash); box-shadow: inset 5px 0 0 var(--enamel-deep); }
.dv-rows > .is-match dt { color: var(--text); }
.dv-rows > div > .btn { justify-self: end; }
@media (max-width: 560px) {
  .dv-rows > div { grid-template-columns: minmax(0, 1fr) auto; }
  .dv-rows dd { grid-column: 1 / -1; grid-row: 2; }
}

/* caution notice: enamel and ink */
.dv-caution {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--enamel);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
}
.dv-caution .mark { width: 20px; height: 20px; flex: none; margin-top: 1px; stroke-width: 5; }
.dv-caution strong { font-weight: 800; }

/* compact data tables that wrap instead of widening the page */
.dv-scroll { overflow-x: auto; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); }
.dv-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.dv-table th, .dv-table td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--hair); }
.dv-table tr:last-child > * { border-bottom: 0; }
.dv-table thead th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); border-bottom: 2px solid var(--frame); }
.dv-table tbody th { font-weight: 700; }
.dv-table .mono, .dv-table code { font-family: var(--font-mono); font-size: 0.8125rem; overflow-wrap: anywhere; word-break: break-all; }
.dv-table .dv-soft { color: var(--text-soft); }
.dv-table td.dv-nowrap { white-space: nowrap; }
.dv-bits { font-family: var(--font-mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.dv-table .dv-label { font-family: var(--font-text); font-size: 0.75rem; color: var(--text-soft); margin-right: 4px; }

/* verdict line under an input (match / no match, validity) */
.dv-verdict { font-weight: 700; font-size: 0.9375rem; display: flex; gap: 8px; align-items: center; }
.dv-verdict .mark { width: 18px; height: 18px; stroke-width: 5; flex: none; }
.dv-verdict[data-ok="no"] { padding: 6px 10px; background: var(--enamel); color: var(--ink); border-radius: var(--radius-sm); }

.dv-json { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; }
.dv-sub { font-size: 1rem; font-weight: 800; margin: 4px 0 0; }

/* keep wide tables and wells inside the board on phones */
.dv-stack { grid-template-columns: minmax(0, 1fr); }
.dv-table .dv-date { font-family: var(--font-mono); font-size: 0.8125rem; white-space: normal; }
.dv-nowrap { white-space: nowrap; }
.dv-bits { font-family: var(--font-mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.dv-table .dv-label { font-family: var(--font-text); font-size: 0.75rem; color: var(--text-soft); margin-right: 4px; }

/* JWT times on phones: claim and relative time on one line, the dates below, so nothing hides off to the side */
@media (max-width: 560px) {
  #jw-times-box thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #jw-times tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 8px 10px; border-bottom: 1px solid var(--hair); }
  #jw-times tr:last-child { border-bottom: 0; }
  #jw-times th, #jw-times td { padding: 0; border: 0; }
  #jw-times td[data-rel] { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
  #jw-times td:not([data-rel]) { grid-column: 1 / -1; margin-top: 4px; }
}

/* Developer tools set 2: Unix timestamp, cron, regex tester, colour converter. */

/* label / value / copy rows */
.dv-rows { margin: 0; display: grid; gap: 1px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--hair); overflow: hidden; }
.dv-rows > div { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 6px 6px 6px 12px; background: var(--surface); }
.dv-rows dt { font-size: 0.8125rem; font-weight: 700; color: var(--text-soft); overflow-wrap: anywhere; }
.dv-rows dd { margin: 0; font-family: var(--font-mono); font-size: 0.875rem; overflow-wrap: anywhere; min-width: 0; }
.dv-copy { justify-self: end; }
@media (max-width: 560px) {
  .dv-rows > div { grid-template-columns: minmax(0, 1fr) auto; }
  .dv-rows dt { grid-column: 1; }
  .dv-rows dd { grid-column: 1; grid-row: 2; }
  .dv-rows .dv-copy { grid-column: 2; grid-row: 1 / span 2; }
}
.ts-h:first-child { margin-top: 0; }
.ts-now { display: grid; gap: 12px; }
.ts-now__stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.ts-now__stats dd { font-size: 1.375rem; }

/* cron */
.cron-in { font-size: 1.25rem !important; letter-spacing: 0.04em; }
.cron-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--hair); overflow: hidden; }
.cron-fields > div { background: var(--surface); padding: 8px 10px; min-width: 0; }
.cron-fields dt { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.cron-fields dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 700; overflow-wrap: anywhere; }
.cron-fields .is-bad { background: var(--enamel); color: var(--ink); }
.cron-fields .is-bad dt { color: var(--ink); }
@media (max-width: 560px) { .cron-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cron-say { font-size: 1.25rem; font-weight: 800; font-stretch: 92%; line-height: 1.3; }
.cron-runs { margin: 0; padding: 0; list-style: none; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); overflow: hidden; counter-reset: run; }
.cron-runs li { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; padding: 7px 12px; counter-increment: run; }
.cron-runs li + li { border-top: 1px solid var(--hair); }
.cron-runs li::before { content: counter(run); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-soft); min-width: 1.6em; }
.cron-runs time { font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 700; }
.cron-runs .cron-rel { font-size: 0.8125rem; color: var(--text-soft); }
.cron-presets { display: flex; flex-wrap: wrap; gap: 6px; }

/* regex tester */
.rx-pattern { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); }
.rx-pattern:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--frame); }
.rx-pattern > span { font-family: var(--font-mono); font-size: 1.125rem; color: var(--text-soft); padding: 0 6px 0 12px; user-select: none; }
.rx-pattern > span:last-child { padding: 0 12px 0 6px; overflow-wrap: anywhere; }
.rx-pattern input { border: 0 !important; outline: none !important; background: transparent; padding-inline: 0; font-size: 1rem; min-width: 0; }
.rx-pattern:has(input[aria-invalid="true"]) { border: 2px dashed var(--frame); }
.rx-flags { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.rx-flags .check { font-family: var(--font-text); }
.rx-flags code { font-weight: 700; }
.rx-view { min-height: 6em; line-height: 1.7; }
.rx-view mark { background: color-mix(in srgb, var(--enamel) 70%, transparent); color: inherit; border-radius: 2px; box-shadow: inset 0 -2px 0 var(--enamel-deep); }
.rx-view mark.rx-alt { background: color-mix(in srgb, var(--route) 22%, transparent); box-shadow: inset 0 -2px 0 var(--route); }
.rx-view mark.rx-empty { display: inline-block; width: 2px; height: 1.2em; vertical-align: -0.2em; padding: 0; background: var(--route); box-shadow: none; }
.rx-table-wrap { overflow-x: auto; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); max-height: 60vh; }
.rx-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rx-table th, .rx-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.rx-table thead th { position: sticky; top: 0; background: var(--surface); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); border-bottom: 2px solid var(--frame); }
.rx-table td { font-family: var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 5ch; }
.rx-table .rx-none { color: var(--text-soft); font-style: italic; font-family: var(--font-text); }
.rx-g { display: block; }
.rx-g b { color: var(--text-soft); font-weight: 700; margin-right: 6px; }

/* colour converter */
.col-top { display: grid; gap: 16px; }
@media (min-width: 760px) { .col-top { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; } }
.col-in { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 10px; align-items: end; }
.col-in input[type="color"] { width: 56px; height: 46px; }
.col-swatch {
  position: relative; min-height: 132px; border: 2px solid var(--frame); border-radius: var(--radius-sm); overflow: hidden;
  background-color: #fff;
  background-image: linear-gradient(45deg, #ccd 25%, transparent 25%, transparent 75%, #ccd 75%), linear-gradient(45deg, #ccd 25%, transparent 25%, transparent 75%, #ccd 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.col-swatch i { position: absolute; inset: 0; }
.col-pair { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; }
.col-sample { border: 2px solid var(--frame); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 4px; }
.col-sample__big { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.col-sample__small { font-size: 0.9375rem; }
.col-ratio { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.col-checks { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.col-checks th, .col-checks td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--hair); }
.col-checks thead th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); border-bottom: 2px solid var(--frame); }
.col-checks tbody th { font-weight: 600; }
.col-badge { display: inline-block; min-width: 4.2em; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 800; text-align: center; border: 1.5px solid var(--hair); }
.col-badge.is-pass { background: color-mix(in srgb, var(--go) 16%, var(--surface)); border-color: var(--go); color: var(--text); }
.col-badge.is-fail { background: var(--enamel); border-color: var(--ink); color: var(--ink); }
.cron-fields .cron-sum { display: block; margin-top: 2px; font-family: var(--font-text); font-weight: 400; }
@media (max-width: 560px) { .cron-fields > div:last-child { grid-column: 1 / -1; } }

/* Code formatters: SQL, XML, HTML, CSS, YAML <-> JSON. */
.fmt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.fmt-head > label { font-weight: 700; font-size: 0.875rem; }
.fmt-head__btns { display: flex; flex-wrap: wrap; gap: 2px; margin-right: -10px; }
.fmt-note { align-items: flex-start; }
.fmt-note__text { min-width: 0; overflow-wrap: anywhere; }
/* caution: enamel and ink, never red */
.fmt-note.fmt-warn {
  border: 2px solid var(--ink);
  background: var(--enamel);
  color: var(--ink);
  font-weight: 600;
}
.fmt-head + textarea { tab-size: 4; }
.opts .check code { font-size: 0.8125rem; }

/* Developer tools set 3: JSON to TypeScript, subnet calculator, chmod calculator, HTTP status codes, user agent parser, cron generator. */

/* JSON to TypeScript */
.j2t { display: grid; gap: 16px; }
@media (min-width: 900px) { .j2t { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.j2t .util-tall { min-height: 20rem; }
.j2t__out { min-height: 20rem; max-height: 32rem; margin: 0; white-space: pre; overflow-wrap: normal; tab-size: 2; }

/* subnet calculator */
.sn-in { font-size: 1.25rem !important; letter-spacing: 0.02em; }
.sn-rows dd .sn-net { font-weight: 800; color: var(--route); }
.sn-table-wrap { overflow-x: auto; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); max-height: 28rem; overflow-y: auto; }
.sn-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.sn-table th, .sn-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.sn-table thead th { position: sticky; top: 0; background: var(--surface); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); border-bottom: 2px solid var(--frame); }
.sn-table td { font-family: var(--font-mono); overflow-wrap: anywhere; min-width: 6ch; }
.sn-table tbody th { font-weight: 700; }
#m-means td, #m-means tbody th { font-family: var(--font-text); }
#m-means td { min-width: 12ch; }

/* chmod calculator */
.cm { display: grid; gap: 20px; }
@media (min-width: 760px) { .cm { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.cm__grid { margin: 0; padding: 14px; min-width: 0; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface); }
.cm__grid > legend { padding: 0 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.cm-table { width: 100%; border-collapse: collapse; }
.cm-table th, .cm-table td { text-align: center; padding: 6px 4px; }
.cm-table thead th { font-size: 0.8125rem; font-weight: 700; }
.cm-table tbody th { text-align: left; font-weight: 700; font-size: 0.9375rem; }
.cm-table td input { display: block; margin: 0 auto; width: 26px; height: 26px; }
.cm-val { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; color: var(--text-soft); margin-left: 4px; }
.cm-special { display: grid; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); }
.cm__side { display: grid; gap: 14px; min-width: 0; }
.cm-big { font-size: 1.5rem !important; font-weight: 700; letter-spacing: 0.06em; }
.cm-warn { border-style: dashed; border-color: var(--frame); color: var(--text); }

/* HTTP status codes */
.hs-q { font-size: 1.125rem !important; }
.hs-groups { margin: 0; padding: 0; border: 0; min-width: 0; }
.hs-list { display: grid; gap: 8px; }
.hs { border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); scroll-margin-top: 16px; min-width: 0; }
.hs[hidden] { display: none; }
.hs[open] { border-color: var(--frame); }
.hs summary { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 10px 12px; cursor: pointer; list-style: none; }
.hs summary::-webkit-details-marker { display: none; }
.hs summary:hover { background: var(--surface-2); }
.hs summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.hs-code { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.hs-main { display: grid; gap: 2px; min-width: 0; }
.hs-name { font-weight: 800; font-stretch: 92%; font-size: 1.0625rem; overflow-wrap: anywhere; }
.hs-mean { font-size: 0.9375rem; color: var(--text-soft); }
.hs-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border: 1.5px solid var(--frame); border-radius: 999px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 2px; }
.hs--un .hs-tag, .hs--res .hs-tag { background: var(--enamel-wash); }
.hs-body { margin: 0; padding: 4px 12px 12px calc(12px + 3.4rem + 10px); display: grid; gap: 8px; }
.hs-body > div { min-width: 0; }
.hs-body dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.hs-body dd { margin: 0; font-size: 0.9375rem; overflow-wrap: anywhere; }
.hs-link { margin-left: 6px; font-family: var(--font-mono); font-size: 0.8125rem; }
.hs.is-target { background: var(--enamel-wash); border-color: var(--frame); box-shadow: inset 5px 0 0 var(--enamel-deep); }
.hs.is-target summary:hover { background: transparent; }
@media (max-width: 560px) {
  .hs summary { grid-template-columns: 2.9rem minmax(0, 1fr); gap: 8px; padding: 10px; }
  .hs-body { padding-left: 12px; }
  .hs-tag { margin-left: 0; margin-top: 4px; display: table; }
}

/* user agent parser */
.ua-in { min-height: 5.5rem !important; }

/* cron generator */
.cg-out { display: grid; gap: 10px; padding: 14px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.cg-expr-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.cg-expr { margin: 0; flex: 1 1 14rem; min-width: 0; font-size: clamp(1.5rem, 6vw, 2.25rem); font-weight: 700; letter-spacing: 0.04em; overflow-wrap: anywhere; line-height: 1.2; }
.cg-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.cg-field { margin: 0; padding: 12px 14px 14px; min-width: 0; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); display: grid; gap: 10px; align-content: start; }
.cg-field > legend { padding: 0 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.cg-field.is-bad { border: 2px dashed var(--frame); background: var(--enamel-wash); }
.cg-body { display: grid; gap: 10px; min-width: 0; }
.cg-body:empty { display: none; }
.cg-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cg-chip { position: relative; display: flex; align-items: center; justify-content: center; min-width: 40px; min-height: 36px; padding: 4px 8px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-mono); font-size: 0.875rem; font-weight: 700; cursor: pointer; user-select: none; }
.cg-chip:hover { border-color: var(--text-soft); }
.cg-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cg-chip:has(input:checked) { background: var(--enamel); border-color: var(--frame); color: var(--ink); box-shadow: inset 0 -3px 0 var(--enamel-deep); }
.cg-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.cg-load-row { display: flex; gap: 8px; }
.cg-load-row input { flex: 1 1 auto; min-width: 0; }

/* Calculators (55-calc.css): percentage, unit converter, age, date difference, aspect ratio. */

/* the headline answer of a calculator */
.calc-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.calc-main__label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.calc-main__val { font-size: clamp(1.25rem, 4.5vw, 1.75rem); font-weight: 800; font-stretch: 92%; line-height: 1.2; overflow-wrap: anywhere; }
.calc-res { display: grid; gap: 14px; }
.calc-res[hidden] { display: none; }
.stats dd.calc-small { font-size: 1rem; letter-spacing: 0; line-height: 1.35; }
.stats dd .calc-sub { display: block; margin-top: 2px; }
.calc-today { justify-self: start; }
.calc-dt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 8.5rem); gap: 8px; }
.calc-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 8rem); gap: 8px; }
.calc-table { overflow-x: auto; }
.calc-table .dens td { font-family: var(--font-mono); overflow-wrap: anywhere; }
.calc-table tr.is-src th, .calc-table tr.is-src td { background: var(--enamel-wash); }

/* percentage rows */
.pc { display: grid; gap: 12px; }
.pc__row { display: grid; gap: 8px; padding: 14px 16px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface-2); }
.pc__h { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.pc__q { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 1.0625rem; font-weight: 600; }
.pc__q input.pc__in { flex: 1 1 4rem; width: auto; min-width: 3.5rem; max-width: 9rem; font-family: var(--font-mono); font-size: 1rem; padding-inline: 10px; }
@media (max-width: 480px) { .pc__row { padding: 12px; } .pc__q { font-size: 1rem; gap: 8px 6px; } }
.pc__q select.pc__sel { width: auto; font-weight: 600; }
.pc__ans { min-height: 1.5em; display: grid; gap: 2px; }
.pc__res { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pc__val { font-size: 1.5rem; overflow-wrap: anywhere; }
.pc__extra { font-weight: 700; color: var(--text-soft); }
.pc__formula { font-size: 0.875rem; color: var(--text-soft); overflow-wrap: anywhere; }
.pc__formula code { font-size: 0.875rem; }
.pc__empty { font-size: 0.875rem; color: var(--text-soft); }
.pc__ans.is-error .pc__msg { font-size: 0.875rem; font-weight: 700; }

/* unit converter */
.uc-cats label { font-size: 0.9375rem; }
.uc { display: grid; gap: 12px; align-items: end; }
.uc__side { display: grid; gap: 8px; }
.uc__val { font-family: var(--font-mono); font-size: 1.25rem !important; font-weight: 700; }
.uc__swap { justify-self: center; }
.uc__swap .mark { transform: rotate(90deg); }
@media (min-width: 680px) {
  .uc { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .uc__swap { margin-bottom: 52px; }
  .uc__swap .mark { transform: none; }
}
.uc__formula { font-size: 0.9375rem; color: var(--text-soft); overflow-wrap: anywhere; min-height: 1.4em; }
.uc__more { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 20px; }
.uc__more .util-h { margin: 0; }
.uc__sig { grid-auto-flow: column; align-items: center; gap: 10px; }
.uc__sig select { width: auto; }

/* aspect ratio */
.ar__h { margin: 0; }
.ar { display: grid; gap: 16px; align-items: start; }
.ar__inputs, .ar__pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; }
.ar__pair { align-items: center; }
.ar__x { padding-bottom: 10px; font-weight: 700; color: var(--text-soft); }
.ar__inputs input, .ar__pair input { font-family: var(--font-mono); }
.ar__out { display: grid; gap: 8px; }
.ar__frame { display: grid; place-items: center; height: 170px; padding: 10px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface-2); }
.ar__box { display: grid; place-items: center; border: 2px solid var(--frame); background: var(--enamel-wash); overflow: hidden; }
.ar__box[hidden] { display: none; }
.ar__box span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text); white-space: nowrap; padding: 0 4px; }
@media (min-width: 900px) { .ar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 270px; } }

/* Generators: colour palette, CSS gradient, meta tags, Wi-Fi and vCard QR, barcode. */

.gen-out { font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.55; min-height: 0; white-space: pre; overflow: auto; tab-size: 2; }
.gen-out--tall { min-height: 260px; }
.gen-readout {
  margin: 0; padding: 10px 12px; max-height: 280px; overflow: auto;
  border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: 0.8125rem; line-height: 1.55; white-space: pre; tab-size: 2;
}
.gen-warn { margin: 0; font-size: 0.8125rem; color: var(--text-soft); }
.gen-warn:empty { display: none; }
.gen-warn.is-on {
  padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--enamel); color: var(--ink); font-weight: 600;
}
.gen-fs { margin: 0; padding: 14px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); display: grid; gap: 14px; min-width: 0; }
.gen-fs > legend { padding: 0 6px; margin: 0; font-weight: 800; font-size: 0.9375rem; }

/* ---------------------------------------------------------------- colour palette */
.gen-base { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; }
.gen-base__hex { width: 11rem; }
.gen-base__info { flex: 1 1 100%; margin: 0; }
.gen-group { display: grid; gap: 8px; min-width: 0; }
.gen-group .util-h, #cp-harmonies .util-h { margin: 8px 0 0; }
.gen-group .help { margin: 0; }
.gen-sws { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.gen-sw { display: grid; grid-template-rows: auto 1fr; min-width: 0; border: 2px solid var(--frame); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.gen-sw__chip { display: grid; place-items: center; height: 72px; font-weight: 800; font-size: 1.5rem; border-bottom: 2px solid var(--frame); }
.gen-sw__body { display: grid; gap: 4px; padding: 10px; align-content: start; min-width: 0; }
.gen-sw__body p { margin: 0; }
.gen-sw__hex { font-weight: 700; font-size: 1rem; }
.gen-sw__rgb { font-size: 0.8125rem; color: var(--text-soft); }
.gen-sw__c { font-size: 0.8125rem; display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.gen-sw__c b { font-size: 0.8125rem; }
.gen-sw__tag { font-weight: 700; }
.gen-sw__act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.btn[aria-pressed="true"] { background: var(--enamel); border-color: var(--ink); color: var(--ink); font-weight: 800; }

/* ---------------------------------------------------------------- gradient */
.gen-grad { display: grid; gap: 20px; }
.gen-grad__show, .gen-grad__ctl { display: grid; gap: 12px; min-width: 0; align-content: start; }
.gen-gpreview { height: 160px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: linear-gradient(90deg, #1636a3, #6dd5ed); }
@media (min-width: 900px) {
  .gen-grad { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
  .gen-gpreview { height: 240px; }
  .gen-grad__show { position: sticky; top: 16px; }
}
.gen-stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gen-stop {
  display: grid; gap: 8px 10px; align-items: end; padding: 10px;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 5.5rem);
  border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface-2);
}
.gen-stop__n { grid-column: 1 / -1; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.gen-stop__btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.gen-stop .field > label { font-size: 0.75rem; }
.gen-stop__pick { align-self: end; }

/* ---------------------------------------------------------------- meta tags */
.gen-side { min-width: 0; }
.gen-serp { display: grid; gap: 2px; padding: 14px; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.gen-serp p { margin: 0; overflow-wrap: anywhere; }
.gen-serp__url { font-size: 0.8125rem; color: var(--text-soft); }
.gen-serp__title { font-size: 1.125rem; font-weight: 600; color: var(--route); line-height: 1.3; }
.gen-serp__desc { font-size: 0.875rem; color: var(--text); line-height: 1.45; }
.gen-card { border: 1.5px solid var(--hair); border-radius: var(--radius); overflow: hidden; background: var(--surface); min-width: 0; display: grid; }
.gen-card__img {
  display: grid; place-items: center; padding: 12px; min-height: 150px; text-align: center;
  background: var(--surface-2); border-bottom: 1.5px solid var(--hair);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-soft); overflow-wrap: anywhere; word-break: break-all;
}
.gen-card__img.is-empty { font-family: var(--font-text); font-style: italic; }
.gen-card__body { display: grid; gap: 2px; padding: 10px 12px; min-width: 0; }
.gen-card__body p { margin: 0; overflow-wrap: anywhere; }
.gen-card__host { font-size: 0.6875rem; letter-spacing: 0.04em; color: var(--text-soft); }
.gen-card__title { font-weight: 700; font-size: 0.9375rem; }
.gen-card__desc { font-size: 0.8125rem; color: var(--text-soft); }
.gen-card[data-layout="summary"] { grid-template-columns: 96px minmax(0, 1fr); }
.gen-card[data-layout="summary"] .gen-card__img { min-height: 96px; border-bottom: 0; border-right: 1.5px solid var(--hair); font-size: 0.625rem; padding: 6px; overflow: hidden; }

/* ---------------------------------------------------------------- QR and barcode */
.gen-qr .util-split__side canvas { width: 100%; max-width: 320px; height: auto; }
.gen-bc__prev { overflow-x: auto; }
.gen-bc__prev svg { display: block; max-width: 100%; height: auto; }
@media (min-width: 860px) { .gen-meta.util-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 860px) { .gen-vc.util-split { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); } }

/* Calculators, batch 2 (57-calc2.css): scientific, fraction, Roman numerals, BMI, date calculator, time zone converter. */

/* hatch used for "working hours" and BMI bands: a pattern, so meaning never rests on colour alone */
.tzc__sw--work, .tzc__plan td.is-work, .bm__seg--ok {
  background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--enamel-deep) 55%, transparent) 0 2px, transparent 2px 6px);
  background-color: var(--enamel-wash);
}

/* ------------------------------------------------------------------ scientific calculator */
.sc { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.sc > * { min-width: 0; }
@media (min-width: 900px) {
  .sc { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); column-gap: 32px; }
  .sc__hist { grid-column: 2; grid-row: 1 / span 6; }
}
.sc__angle { margin: 0; }
.sc__screen { display: grid; gap: 6px; padding: 12px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface-2); }
.sc__label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
input.sc__expr { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; padding-inline: 10px; background: var(--surface); }
.sc__out { display: grid; gap: 2px; text-align: right; }
.sc__echo { min-height: 1.3em; font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-soft); overflow-wrap: anywhere; }
.sc__result { font-size: clamp(1.75rem, 9vw, 2.5rem); line-height: 1.15; overflow-wrap: anywhere; font-weight: 800; }
.sc__result[data-state="idle"] { color: var(--text-soft); }
.sc__error { font-weight: 700; font-size: 0.9375rem; text-align: left; padding: 8px 10px; border-left: 5px solid var(--enamel-deep); background: var(--surface); overflow-wrap: anywhere; }
.sc__error[hidden], .sc__note[hidden] { display: none; }
.sc__preview { min-height: 1.3em; text-align: right; font-size: 0.9375rem; color: var(--text-soft); overflow-wrap: anywhere; }
.sc__note { font-size: 0.875rem; padding: 6px 10px; border-left: 5px solid var(--hair); overflow-wrap: anywhere; }
.sc__pad, .sc__morepad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sc__k {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 4px; min-width: 0;
  border: 1.5px solid var(--frame); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-family: var(--font-mono); font-size: 1.125rem; font-weight: 700; cursor: pointer;
}
.sc__k:hover { background: var(--surface-2); }
.sc__k:active { transform: translateY(1px); }
.sc__k--fn { font-size: 0.9375rem; background: var(--surface-2); }
.sc__k--op { background: var(--hair); }
.sc__k--act { background: var(--hair); font-size: 1rem; }
.sc__k--zero { grid-column: span 2; }
.btn.sc__k--eq { grid-row: span 2; grid-column: 5; min-height: 0; padding: 4px; font-size: 1.5rem; }
.sc__more > summary { cursor: pointer; font-weight: 700; font-size: 0.875rem; min-height: 40px; display: flex; align-items: center; color: var(--route); }
.sc__morepad { margin-top: 6px; }
.sc__histhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc__histhead .util-h { margin: 0; }
.sc__histlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.sc__h {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; min-height: 44px; padding: 8px 4px;
  border: 0; border-bottom: 1px solid var(--hair); background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.sc__h:hover { background: var(--surface-2); }
.sc__hexpr { font-family: var(--font-mono); font-size: 0.9375rem; overflow-wrap: anywhere; min-width: 0; }
.sc__hres { white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ fraction calculator */
.fc__mode { margin: 0 0 12px; }
.fc__form { display: grid; gap: 12px; align-items: end; }
@media (min-width: 720px) { .fc__form { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } }
.fc__form input, #fc-conv input { font-family: var(--font-mono); font-size: 1.125rem; }
.fc__op { margin: 0; }
.fc__op .seg label { min-width: 52px; font-size: 1.125rem; }
.fc__steps { border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface-2); padding: 0 14px; }
.fc__steps > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.fc__steps ol { margin: 0 0 12px; padding-left: 1.3em; display: grid; gap: 6px; }
.fc__steps li { overflow-wrap: anywhere; font-size: 0.9375rem; }
#fc-main { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ Roman numerals */
.rn { display: grid; gap: 14px; }
.rn__pair { display: grid; gap: 12px; }
@media (min-width: 600px) { .rn__pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.rn__pair input { font-family: var(--font-mono); font-size: 1.375rem; font-weight: 700; letter-spacing: 0.02em; }
.rn__msg { min-height: 1.4em; font-weight: 600; font-size: 0.9375rem; overflow-wrap: anywhere; }
.rn__msg:not(:empty) { padding: 8px 10px; border-left: 5px solid var(--enamel-deep); background: var(--surface-2); }
.rn__big { font-family: var(--font-mono); overflow-wrap: anywhere; letter-spacing: 0.02em; }
.rn__break { display: grid; gap: 8px; }
.rn__break .util-h { margin: 0; }
.rn__parts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.rn__parts li { display: grid; gap: 2px; justify-items: center; min-width: 64px; padding: 8px 12px; border: 1.5px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface); }
.rn__sym { font-family: var(--font-mono); font-size: 1.375rem; font-weight: 800; }
.rn__parts .num { font-size: 0.875rem; color: var(--text-soft); }
.rn__x { font-size: 0.75rem; color: var(--text-soft); }
.rn__sum { font-size: 0.9375rem; overflow-wrap: anywhere; }
.rn__tables { display: grid; gap: 20px; align-items: start; }
@media (min-width: 720px) { .rn__tables { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.rn__tables .util-h { margin: 0 0 8px; }
.rn__years { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.rn__years .btn { font-family: var(--font-mono); min-height: 44px; }

/* ------------------------------------------------------------------ BMI */
.bm { display: grid; gap: 14px; }
.bm__units { margin: 0; }
.bm__msg { min-height: 1.4em; font-size: 0.9375rem; font-weight: 600; overflow-wrap: anywhere; }
.bm input[type="text"] { font-family: var(--font-mono); font-size: 1.125rem; }
.bm__cat { font-weight: 800; font-size: 1.0625rem; padding: 2px 10px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--enamel); color: var(--ink); }
.bm__scale { display: grid; gap: 6px; padding-top: 14px; }
.bm__bar { position: relative; display: flex; height: 26px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface); }
.bm__seg { display: block; height: 100%; }
.bm__seg + .bm__seg { border-left: 2px solid var(--frame); }
.bm__seg--under { width: 14%; background-image: repeating-linear-gradient(90deg, var(--slot) 0 2px, transparent 2px 6px); }
.bm__seg--ok { width: 26%; }
.bm__seg--over { width: 20%; background-image: repeating-linear-gradient(45deg, var(--slot) 0 2px, transparent 2px 7px); }
.bm__seg--obese { width: 40%; background-image: repeating-linear-gradient(45deg, var(--slot) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, var(--slot) 0 2px, transparent 2px 6px); }
.bm__marker { position: absolute; top: -12px; bottom: -8px; width: 6px; margin-left: -3px; background: var(--text); border: 2px solid var(--surface); border-radius: 3px; left: 0; }
.bm__ticks { position: relative; height: 1.3em; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-soft); }
.bm__ticks span { position: absolute; transform: translateX(-50%); }
.bm__ticks span:nth-child(1) { left: 0; transform: none; }
.bm__ticks span:nth-child(2) { left: 14%; }
.bm__ticks span:nth-child(3) { left: 40%; }
.bm__ticks span:nth-child(4) { left: 60%; }
.bm__ticks span:nth-child(5) { left: 100%; transform: translateX(-100%); }
.bm__note { margin: 0; }

/* ------------------------------------------------------------------ date calculator */
.dc { display: grid; gap: 14px; }
.dc__op, .dc__kind { margin: 0; }
.dc__fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); }
.dc__fields--one { grid-template-columns: minmax(0, 260px); }
.dc__fields[hidden] { display: none; }
.dc input[type="number"] { font-family: var(--font-mono); }
#dc-main { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ time zone converter */
.tzc { display: grid; gap: 14px; }
.tzc > * { min-width: 0; }
.tzc__amb { margin: 0; }
.tzc__note[hidden] { display: none; }
.tzc__bar { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; }
.tzc__add { flex: 1 1 300px; max-width: 460px; }
.tzc__fmt { margin: 0; }
#tzc-msg:empty { display: none; }
.tzc__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tzc__row {
  display: grid; gap: 4px 12px; align-items: center; padding: 10px 12px;
  border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface);
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "place place" "time date" "off off";
}
.tzc__row.is-source { border-color: var(--frame); border-left: 6px solid var(--enamel-deep); background: var(--enamel-wash); }
.tzc__place { grid-area: place; display: grid; min-width: 0; padding-right: 84px; }
.tzc__place b { font-size: 1.0625rem; overflow-wrap: anywhere; }
.tzc__id { font-size: 0.75rem; color: var(--text-soft); overflow-wrap: anywhere; }
.tzc__time { grid-area: time; font-size: 1.5rem; line-height: 1.2; white-space: nowrap; }
.tzc__date { grid-area: date; font-size: 0.9375rem; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.tzc__day { font-size: 0.75rem; font-weight: 700; padding: 0 6px; border: 1.5px solid var(--frame); border-radius: 3px; background: var(--surface); }
.tzc__off { grid-area: off; font-size: 0.875rem; display: flex; gap: 8px; align-items: baseline; }
.tzc__abbr { font-family: var(--font-text); font-weight: 700; color: var(--text-soft); }
.tzc__rm, .tzc__src { grid-area: place; justify-self: end; align-self: start; }
.tzc__src { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
@media (min-width: 760px) {
  .tzc__row { grid-template-columns: minmax(150px, 1.3fr) 120px minmax(190px, 1.4fr) minmax(120px, 1fr) 90px; grid-template-areas: "place time date off rm"; }
  .tzc__place { padding-right: 0; }
  .tzc__rm, .tzc__src { grid-area: rm; align-self: center; }
}
.tzc__legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; }
.tzc__legend li { display: flex; gap: 8px; align-items: center; }
.tzc__sw { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--frame); font-size: 0.8125rem; font-weight: 800; background: var(--surface); }
.tzc__sw--sel { box-shadow: inset 0 0 0 3px var(--frame); }
.tzc__sw--all { background: var(--enamel); color: var(--ink); }
.tzc__strip { position: relative; overflow-x: auto; max-width: 100%; border: 1.5px solid var(--hair); border-radius: var(--radius-sm); }
.tzc__plan { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-family: var(--font-mono); font-size: 0.8125rem; }
.tzc__plan th { position: sticky; left: 0; z-index: 1; min-width: 120px; max-width: 150px; padding: 6px 10px; text-align: left; font-family: var(--font-text); font-size: 0.8125rem; background: var(--surface-2); border-right: 2px solid var(--frame); border-bottom: 1px solid var(--hair); }
.tzc__plan th small { display: block; font-family: var(--font-mono); font-weight: 400; color: var(--text-soft); }
.tzc__plan td { min-width: 42px; height: 44px; padding: 2px; text-align: center; border-bottom: 1px solid var(--hair); border-left: 1px solid var(--hair); background: var(--surface); vertical-align: middle; }
.tzc__plan td small { display: block; font-size: 0.625rem; line-height: 1; color: var(--text-soft); }
.tzc__plan td.is-work { font-weight: 800; }
.tzc__plan td.is-mid { border-left: 2px solid var(--frame); }
.tzc__plan td.is-sel { box-shadow: inset 0 0 0 3px var(--frame); }
.tzc__plan td.is-all { background: var(--enamel); color: var(--ink); font-weight: 800; }
.tzc__all th, .tzc__all td { border-bottom: 0; }

/* fraction result: on phones the decimal (often long) takes a full row instead of leaving an empty cell */
@media (max-width: 520px) { #fc-res .stats > div:last-child { grid-column: 1 / -1; } }

/* Utilities, batch 2 (58-util2.css): random numbers, name picker, countdown, stopwatch, text to speech. */

/* random number generator */
.rn-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 12px 16px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.rn-big__val { font-family: var(--font-mono); font-size: clamp(2rem, 9vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; min-width: 0; }
.rn-out { white-space: pre; overflow-wrap: normal; max-height: 40vh; min-height: 3rem; }

/* random name picker */
.rp { display: grid; gap: 20px; }
.rp > * { min-width: 0; }
.rp__wheel { display: grid; place-items: start center; }
.rp-wheel { width: 100%; max-width: 380px; height: auto; aspect-ratio: 1; }
.rp-names { min-height: 10rem; font-family: var(--font-text); }
@media (min-width: 900px) {
  .rp { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); grid-template-areas: "in wheel" "out wheel"; align-items: start; }
  .rp__in { grid-area: in; }
  .rp__wheel { grid-area: wheel; }
  .rp__out { grid-area: out; }
}
.rp-result:empty { display: none; }
.rp-result { padding: 14px 16px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 10px; }
.rp-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.rp-win { font-size: clamp(1.5rem, 6vw, 2.25rem); font-weight: 800; font-stretch: 92%; line-height: 1.15; overflow-wrap: anywhere; }
.rp-wins { margin: 0; padding-left: 1.6em; font-size: 1.25rem; font-weight: 700; display: grid; gap: 2px; }
.rp-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.rp-team { border: 1.5px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); padding: 10px 12px; min-width: 0; }
.rp-team__h { font-size: 1rem; font-weight: 800; margin: 0 0 6px; }
.rp-team__h span { font-weight: 400; color: var(--text-soft); }
.rp-team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 0.9375rem; }
.rp-team li { overflow-wrap: anywhere; }
.rp-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp-hist-head .util-h { margin: 0; }
.rp-hist { margin: 8px 0 0; padding-left: 2em; display: grid; gap: 4px; font-size: 0.9375rem; max-height: 14rem; overflow: auto; }
.rp-hist li { overflow-wrap: anywhere; }

/* countdown timer */
.ct { min-width: 0; }
.ct-digits { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2.75rem, 15vw, 6.5rem); letter-spacing: -0.04em; line-height: 1.05; text-align: center; padding: 18px 8px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.ct-digits[data-state="running"] { background: var(--enamel-wash); }
.ct-digits[data-state="paused"] { color: var(--text-soft); }
.ct-digits[data-state="finished"] { background: var(--enamel); color: var(--ink); }
.ct-done { margin: 0; font-weight: 800; font-size: 1.125rem; text-align: center; }
.ct-hms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 28rem; }
.ct-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-err { font-weight: 700; color: var(--text); }
.ct-err:empty { display: none; }
.ct-when { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ct-zone { grid-column: 1 / -1; }
@media (min-width: 760px) { .ct-when { grid-template-columns: minmax(0, 12rem) minmax(0, 9rem) minmax(0, 1fr); } .ct-zone { grid-column: auto; } }
.ct-stats dd { font-size: clamp(1.75rem, 8vw, 3rem); }
.ct-stats[data-state="past"] dd { color: var(--text-soft); }

/* stopwatch */
.sw { min-width: 0; }
.sw-display { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2rem, 11.5vw, 5.5rem); letter-spacing: -0.04em; line-height: 1.05; text-align: center; padding: 18px 6px; border: 2px solid var(--frame); border-radius: var(--radius-sm); background: var(--surface-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sw-display[data-state="running"] { background: var(--enamel-wash); }
.sw-display[data-state="stopped"] { color: var(--text-soft); }
.sw-keys kbd { padding: 0 0.3em; border: 1px solid var(--hair); border-radius: 3px; font-family: var(--font-mono); font-size: 0.8125rem; }
.sw-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.sw-head .util-h { margin: 0; }
.sw-table td.num, .sw-table th[scope="row"] { font-family: var(--font-mono); }
.sw-table td.num { white-space: nowrap; }
.sw-table tr.is-fastest td, .sw-table tr.is-fastest th, .sw-table tr.is-slowest td, .sw-table tr.is-slowest th { background: var(--enamel-wash); font-weight: 700; }

/* text to speech */
.tts { min-width: 0; }
.tts-text { min-height: 11rem; }
.tts-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 0.875rem; color: var(--text-soft); }
.tts-meta .btn { margin-left: auto; }
.tts-sliders { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.tts-sliders output { font-family: var(--font-mono); font-weight: 400; color: var(--text-soft); margin-left: 6px; }
.tts-follow { white-space: pre-wrap; max-height: 12rem; position: relative; font-family: var(--font-text); font-size: 1rem; line-height: 1.5; }
.tts-follow mark { background: var(--enamel); color: var(--ink); border-radius: 2px; padding: 0 1px; }
.tts-online { font-weight: 700; color: var(--text); }
#tts-voice-status[data-state="none"], #tts-voice-status[data-state="unsupported"] { font-weight: 700; color: var(--text); }
.tts-note { display: block; }

/* Server-backed tools (compress PDF, OCR, image to text, web page to PDF, protect / unlock PDF): the honest
   "processed on our server" tag in place of the on-device lock, the daily-quota line, the human-check box. */

.server-tag { color: var(--text); background: var(--enamel-wash); }
.server-tag .mark { stroke-width: 4; }
.drop__server { color: var(--text-soft); }
.drop__server .mark { stroke-width: 4; }

.srvbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.quota {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-soft);
}
.quota .mark { width: 18px; height: 18px; flex: none; stroke-width: 4; }
.quota strong { color: var(--text); }
.quota[data-state="empty"], .quota[data-state="off"] {
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--enamel);
  color: var(--ink);
  font-weight: 600;
}
.quota[data-state="empty"] strong, .quota[data-state="off"] strong { color: var(--ink); }
.quota__note { font-weight: 400; }
@media (max-width: 520px) { .quota__note { display: block; } }

/* Turnstile renders its own iframe here, only when it needs an interaction. */
.human:empty { display: none; }
.human { max-width: 100%; min-width: 0; }
.human.is-asking { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--radius-sm); }

/* index: a small plate on server tools */
.stops__srv {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border: 1.5px solid var(--frame);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 0.12em;
  color: var(--text-soft);
  text-decoration: none;
}
.stops a:hover .stops__srv { color: var(--text-soft); text-decoration: none; }

/* web page to PDF: an address form instead of a drop slot */
.urlform { display: grid; gap: 16px; }
.urlform input[type="url"] { font-size: 1.0625rem; min-height: 52px; border-width: 2px; border-color: var(--frame); }

/* OCR */
.ocr-preview { min-height: 120px; max-height: 46vh; }
.ocr-preview canvas { max-height: 40vh; width: auto; }
.ocr-out__wrap { padding: 12px 14px; }
.ocr-out { min-height: 220px; max-height: 60vh; font-size: 1rem; }
.ocr-more { border-top: 1px solid var(--hair); }
.ocr-more summary {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
}
.ocr-more summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.ocr-more .ocr-text { margin: 0 14px 14px; max-height: 40vh; font-size: 0.8125rem; }
