/* FireToolLand public site: "forge" design.
   Ink-dark slabs (header, home intro, the result display, footer) carry the brand; light pages carry the reading.
   Fire is the one brand colour, used sparingly: buttons, highlights, step numbers. Every category has its own hue
   ([data-cat], below) for icons and accents, so the catalogue reads like a map.
   All colours, radii and shadows are tokens on :root. Light is the default; dark follows the system or the visitor's
   choice (data-theme on <html>, set by theme.js). */

/* Bricolage Grotesque (headings) and Onest (text), SIL Open Font License 1.1, variable weight, one file per script.
   The browser downloads only the files whose characters a page uses. Arabic, Devanagari, Japanese and Chinese text
   uses the system fonts; Russian headings fall back to Onest. */
@font-face { font-family: "Bricolage"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("/fonts/bricolage-latin.woff2?v=5.3.0") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("/fonts/bricolage-latin-ext.woff2?v=5.3.0") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/onest-latin.woff2?v=5.3.1") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/onest-latin-ext.woff2?v=5.3.1") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/onest-cyrillic.woff2?v=5.3.1") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/onest-cyrillic-ext.woff2?v=5.3.1") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --bg: #f6f6fa;
  --surface: #ffffff;
  --field: #eef0f6;
  --field-hover: #e7e9f2;
  --tint: #fff1e7;
  --tint-strong: #ffdcc6;
  --text: #14162b;
  --text-2: #3d4163;
  --muted: #696e91;
  --border: #e2e4ee;
  --border-strong: #cbcfe0;
  --ink: #12142b;
  --ink-2: #1b1e3b;
  --ink-3: #252949;
  --ink-line: #30355c;
  --on-ink: #f4f5fb;
  --on-ink-2: #bcc0db;
  --on-ink-3: #8c91b6;
  --fire-1: #ff3b30;
  --fire-2: #ff6a13;
  --fire-3: #ffb01a;
  --fire: linear-gradient(115deg, var(--fire-1) 0%, var(--fire-2) 48%, var(--fire-3) 100%);
  --on-fire: #1d0c03;
  --brand: #ff5a14;
  --accent: #c2410c;
  --accent-hover: #a3360a;
  --on-accent: #ffffff;
  --link: #b93d0b;
  --focus: #ff6a13;
  --ok: #11804a;
  --ok-tint: #e6f6ed;
  --error: #c81e3a;
  --error-tint: #fdebef;
  --chart-1: #ff5a14;
  --chart-2: #3b5bdb;
  --chart-3: #0d9488;
  --chart-4: #c026d3;
  --chart-5: #65a30d;
  --chart-6: #78716c;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgb(18 20 43 / 6%);
  --shadow: 0 1px 2px rgb(18 20 43 / 5%), 0 10px 28px -10px rgb(18 20 43 / 16%);
  --shadow-lg: 0 2px 6px rgb(18 20 43 / 6%), 0 28px 60px -18px rgb(18 20 43 / 30%);
  --glow: 0 10px 30px -8px rgb(255 90 20 / 45%);
  --page: 1220px;
  --header-h: 64px;
  --display: "Bricolage", "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hue: var(--brand);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d1c; --surface: #13162b; --field: #1b1f39; --field-hover: #222644; --tint: #2a160c; --tint-strong: #3d1f10;
    --text: #eef0fb; --text-2: #c4c8e3; --muted: #9196ba; --border: #242947; --border-strong: #353b63;
    --ink: #070915; --ink-2: #10132b; --ink-3: #191d3b; --ink-line: #2a2f57;
    --accent: #ff8a4a; --accent-hover: #ffa06a; --on-accent: #1d0c03; --link: #ff9a5c;
    --ok: #4ade80; --ok-tint: #10261b; --error: #fb7185; --error-tint: #2c1219;
    --chart-1: #ff8a4a; --chart-2: #7c95ff; --chart-3: #2dd4bf; --chart-4: #e879f9; --chart-5: #a3e635; --chart-6: #a8a29e;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 28px -10px rgb(0 0 0 / 60%);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 40%), 0 28px 60px -18px rgb(0 0 0 / 70%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d1c; --surface: #13162b; --field: #1b1f39; --field-hover: #222644; --tint: #2a160c; --tint-strong: #3d1f10;
  --text: #eef0fb; --text-2: #c4c8e3; --muted: #9196ba; --border: #242947; --border-strong: #353b63;
  --ink: #070915; --ink-2: #10132b; --ink-3: #191d3b; --ink-line: #2a2f57;
  --accent: #ff8a4a; --accent-hover: #ffa06a; --on-accent: #1d0c03; --link: #ff9a5c;
  --ok: #4ade80; --ok-tint: #10261b; --error: #fb7185; --error-tint: #2c1219;
  --chart-1: #ff8a4a; --chart-2: #7c95ff; --chart-3: #2dd4bf; --chart-4: #e879f9; --chart-5: #a3e635; --chart-6: #a8a29e;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 28px -10px rgb(0 0 0 / 60%);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / 40%), 0 28px 60px -18px rgb(0 0 0 / 70%);
  color-scheme: dark;
}

/* Japanese, Chinese, Hindi and Arabic have no web font here: their text uses the system family of its script, and no
   file is downloaded. The rules name the language on :root, so a lang attribute inside the page (the language menu) changes
   nothing. Hindi needs more line height than Latin: the matras (vowel signs above and below the line) are clipped by the
   tight line boxes of Latin text, and Arabic harakat need the same room. Latin letters keep the site face (Onest has no
   glyphs of these scripts, so the browser takes them from the next family). Negative or wide letter-spacing is removed for these four: it breaks Arabic joining and
   closes the gaps between kanji and hanzi. */
:root:lang(ja) { --script: "Onest", "Hiragino Sans", "Yu Gothic UI", Meiryo, "Noto Sans JP", sans-serif; --font: var(--script); --display: var(--script); }
:root:lang(zh) { --script: "Onest", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; --font: var(--script); --display: var(--script); }
:root:lang(hi) { --script: "Onest", "Nirmala UI", "Noto Sans Devanagari", Mangal, sans-serif; --font: var(--script); --display: var(--script); }
:root:lang(ar) { --script: "Onest", Tahoma, "Segoe UI", "Noto Sans Arabic", "Geeza Pro", sans-serif; --font: var(--script); --display: var(--script); }
:root:is(:lang(hi), :lang(ar)) body { line-height: 1.75; }
:root:lang(hi) :is(h1, h2, h3, .tool-card-name, .cat-tile-name, .stat-value, .button) { line-height: 1.3; }
:root:lang(hi) :is(.lead, .steps li, .howto li, .toc a) { line-height: 1.75; }
:root:lang(hi) .tool-card-text { line-height: 1.7; }
:root:is(:lang(ja), :lang(zh), :lang(ar), :lang(hi)) *,
:root:is(:lang(ja), :lang(zh), :lang(ar), :lang(hi)) *::before,
:root:is(:lang(ja), :lang(zh), :lang(ar), :lang(hi)) *::after { letter-spacing: 0; }

/* One hue per category: icon tiles, accents and the tool box's top edge. */
[data-cat="finance"] { --hue: #12a150; }
[data-cat="work"] { --hue: #0e9384; }
[data-cat="legal"] { --hue: #6d3fd6; }
[data-cat="education"] { --hue: #2c63e6; }
[data-cat="math"] { --hue: #4b4fd9; }
[data-cat="health"] { --hue: #e0244f; }
[data-cat="date"] { --hue: #0a8fb8; }
[data-cat="developer"] { --hue: #a735c9; }
[data-cat="web"] { --hue: #1677d2; }
[data-cat="text"] { --hue: #c27a06; }
[data-cat="pdf"] { --hue: #d9312b; }
[data-cat="image"] { --hue: #e85d0c; }
[data-cat="media"] { --hue: #d42c86; }
[data-cat="art"] { --hue: #c9620a; }
[data-cat="astrology"] { --hue: #7b4fe0; }
[data-cat="aviation"] { --hue: #0b6fa8; }
[data-cat="sports"] { --hue: #5d9a0b; }
[data-cat="home"] { --hue: #a8560c; }
[data-cat="auto"] { --hue: #4b5875; }
[data-cat="cooking"] { --hue: #d5501a; }
[data-cat="engineering"] { --hue: #5a6170; }
[data-cat="fun"] { --hue: #e23a74; }
[data-cat="local"] { --hue: #d22630; }

/* ------------------------------------------------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.65 var(--font); overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--text); font-family: var(--display); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.8rem, 1.25rem + 2.1vw, 2.55rem); font-weight: 750; letter-spacing: -.025em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
strong { font-weight: 650; }
code, pre, kbd { font-family: var(--mono); font-size: .92em; direction: ltr; unicode-bidi: isolate; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--tint-strong); }

.icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; vertical-align: -.2em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: -999px; top: .5rem; background: var(--surface); color: var(--text); padding: .6rem 1rem; border-radius: var(--radius); z-index: 100; box-shadow: var(--shadow); }
.skip-link:focus { inset-inline-start: .5rem; }

.container { max-width: var(--page); margin: 0 auto; padding-inline: 1.25rem; }
.eyebrow { font: 650 .74rem/1.4 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; }
.fire-text { background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------------------------------------------------------
   Buttons, chips, badges, icon tiles
   ------------------------------------------------------------------------------------------------------------------ */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.8rem; padding: .55rem 1.15rem;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text);
  font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, filter .15s ease, transform .15s ease;
}
.button:hover { background: var(--field); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--fire); border-color: transparent; color: var(--on-fire); font-weight: 700; box-shadow: var(--glow); }
.button-primary:hover { background: var(--fire); filter: brightness(1.06) saturate(1.05); }
.button-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.button-ghost:hover { background: var(--field); color: var(--text); }
.button-small { min-height: 2.3rem; padding: .35rem .8rem; font-size: .88rem; border-radius: 10px; }
.button[disabled] { opacity: .5; cursor: not-allowed; filter: none; box-shadow: none; }

.icon-button { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text-2); cursor: pointer; flex: none; }
.icon-button:hover { background: var(--field); color: var(--text); }
.icon-button[disabled] { opacity: .35; cursor: not-allowed; background: var(--surface); }

.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .9rem; font-weight: 550; text-decoration: none; }
.chip:hover { border-color: var(--border-strong); text-decoration: none; }
.chip .icon { color: var(--hue); }

.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; background: var(--field); color: var(--text-2); font-size: .82rem; font-weight: 550; }
.badge .icon { width: 1em; height: 1em; color: var(--ok); }

/* Icon tiles: a solid square in the category's hue with a white glyph. */
.icon-tile { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--hue); color: #fff; flex: none; box-shadow: inset 0 -2px 0 rgb(0 0 0 / 14%), 0 6px 14px -8px var(--hue); }
.icon-tile .icon { width: 1.3rem; height: 1.3rem; }
.icon-tile--large { width: 3.75rem; height: 3.75rem; border-radius: 17px; }
.icon-tile--large .icon { width: 1.85rem; height: 1.85rem; }
.icon-tile--soft { background: color-mix(in srgb, var(--hue) 14%, var(--surface)); color: var(--hue); box-shadow: none; }

/* ------------------------------------------------------------------------------------------------------------------
   Header: an ink bar in both themes
   ------------------------------------------------------------------------------------------------------------------ */

.site-header { position: sticky; top: 0; z-index: 40; background: var(--ink); color: var(--on-ink); border-bottom: 1px solid var(--ink-line); }
.header-inner { display: flex; align-items: center; gap: .75rem; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--on-ink); text-decoration: none; font: 750 1.22rem/1 var(--display); letter-spacing: -.03em; flex: none; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: block; }
.logo-accent { background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }

.search { position: relative; display: flex; align-items: center; flex: 1; max-width: 30rem; margin-inline: auto; }
.search .icon { position: absolute; inset-inline-start: .9rem; color: var(--on-ink-3); pointer-events: none; }
.search input {
  width: 100%; min-width: 0; height: 2.6rem; padding-inline: 2.6rem 2.6rem; border: 1px solid var(--ink-line); border-radius: 999px;
  background: var(--ink-2); color: var(--on-ink); font: 400 .95rem var(--font); outline: none;
}
.search input::placeholder { color: var(--on-ink-3); }
.search input:hover { background: var(--ink-3); }
.search input:focus { background: var(--ink-3); border-color: var(--fire-2); box-shadow: 0 0 0 3px rgb(255 106 19 / 25%); }
.search kbd { position: absolute; inset-inline-end: .7rem; padding: .05rem .45rem; border: 1px solid var(--ink-line); border-radius: 6px; color: var(--on-ink-3); font-size: .75rem; pointer-events: none; }
.search input:focus + kbd { display: none; }

.header-actions { display: flex; align-items: center; gap: .35rem; flex: none; }
.site-header .icon-button { background: transparent; border-color: transparent; color: var(--on-ink-2); }
.site-header .icon-button:hover { background: var(--ink-2); color: var(--on-ink); }

.menu { position: relative; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: .45rem; height: 2.5rem; padding: 0 .85rem; border: 1px solid transparent; border-radius: 999px; color: var(--on-ink-2); font-weight: 600; font-size: .92rem; cursor: pointer; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--ink-2); color: var(--on-ink); }
.menu .caret { width: .75em; height: .75em; transition: transform .15s ease; }
.menu[open] .caret { transform: rotate(180deg); }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + .55rem); z-index: 50; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: .5rem; }
.menu-panel a { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 11px; color: var(--text); text-decoration: none; font-size: .93rem; font-weight: 500; }
.menu-panel a:hover, .menu-panel a.is-current { background: var(--field); }
.menu-panel a .count { margin-inline-start: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.menu--categories .menu-panel { width: min(46rem, calc(100vw - 2rem)); display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .15rem; max-height: min(75vh, 36rem); overflow: auto; }
.menu--categories .menu-panel .icon-tile { width: 2rem; height: 2rem; border-radius: 9px; }
.menu--categories .menu-panel .icon-tile .icon { width: 1rem; height: 1rem; }
.menu--language .menu-panel { min-width: 12rem; max-height: 70vh; overflow: auto; }
.menu--language summary .label { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-bar { background: var(--ink-2); color: var(--on-ink); font-size: .92rem; border-bottom: 1px solid var(--ink-line); }
.lang-bar .container { display: flex; align-items: center; justify-content: center; gap: .75rem; min-height: 2.6rem; flex-wrap: wrap; padding-block: .35rem; }
.lang-bar a { color: var(--fire-3); font-weight: 650; }
.lang-bar button { border: 0; background: transparent; color: var(--on-ink-3); cursor: pointer; padding: .25rem; border-radius: 6px; display: inline-grid; place-items: center; }
.lang-bar button:hover { color: var(--on-ink); background: var(--ink-3); }

/* ------------------------------------------------------------------------------------------------------------------
   Page frame
   ------------------------------------------------------------------------------------------------------------------ */

.site-main { padding-block: 1.75rem 1.5rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; list-style: none; margin: 0 0 1.1rem; padding: 0; font-size: .86rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb li + li::before { content: "›"; margin-inline-end: .5rem; color: var(--border-strong); }
/* No RTL rule: "›" is a bidi-mirrored character, so an RTL page draws it as "‹", pointing back to the start. */
.lead { font-size: 1.1rem; line-height: 1.6; color: var(--text-2); max-width: 46rem; }

.page-head { display: flex; gap: 1.1rem; align-items: flex-start; margin-bottom: 1.6rem; }
.page-head > .icon-tile { margin-top: .3rem; }
.page-head > :not(.icon-tile) { min-width: 0; }
/* Long German compounds must wrap on a phone: hyphenate by the page language, break as a last resort. */
.page-head h1 { margin-bottom: .3rem; hyphens: auto; overflow-wrap: break-word; }
.page-head .lead { margin: 0; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin-top: .7rem; color: var(--muted); font-size: .86rem; }
.page-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.page-meta .icon { color: var(--ok); }

.section { margin-block: 3rem; }
.section--flush { margin-top: 0; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem .8rem; margin-bottom: 1.1rem; }
.section-head h2 { margin: 0; }
.section-head h2 a { color: var(--text); text-decoration: none; }
.section-head h2 a:hover { color: var(--accent); }
.section-head .count { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.6rem; padding-inline: .45rem; border-radius: 999px; background: var(--field); color: var(--text-2); font-size: .8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.section-head .more { margin-inline-start: auto; font-weight: 600; font-size: .92rem; text-decoration: none; }
.section-head .more:hover { text-decoration: underline; }

/* ------------------------------------------------------------------------------------------------------------------
   Home: the forge slab (intro, command search, category dock), ranked popular tools, the category mosaic
   ------------------------------------------------------------------------------------------------------------------ */

.forge { position: relative; isolation: isolate; margin: -1.75rem 0 0; padding: clamp(2.75rem, 2rem + 4vw, 5.5rem) 0 clamp(2.25rem, 1.75rem + 2vw, 3.5rem); background: var(--ink); color: var(--on-ink); border-radius: 0 0 var(--radius-xl) var(--radius-xl); overflow: hidden; }
.forge::before { content: ""; position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1; background: radial-gradient(48% 55% at 50% 0%, rgb(255 106 19 / 34%), transparent 70%), radial-gradient(30% 40% at 18% 20%, rgb(255 59 48 / 16%), transparent 70%), radial-gradient(30% 40% at 82% 24%, rgb(255 176 26 / 14%), transparent 70%); }
.forge-inner { display: grid; justify-items: center; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.3rem; padding-block: .35rem; padding-inline: .45rem .85rem; border: 1px solid var(--ink-line); border-radius: 999px; background: rgb(255 255 255 / 4%); color: var(--on-ink-2); font-size: .86rem; font-weight: 550; }
.kicker b { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.45rem; padding-inline: .4rem; border-radius: 999px; background: var(--fire); color: var(--on-fire); font-size: .78rem; font-weight: 800; }
.forge h1 { max-width: 19ch; margin: 0 auto .9rem; color: var(--on-ink); font-size: clamp(2.3rem, 1.4rem + 4vw, 4.2rem); font-weight: 800; line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.forge .lead { max-width: 40rem; margin: 0 auto; color: var(--on-ink-2); font-size: clamp(1.02rem, .97rem + .3vw, 1.2rem); text-wrap: pretty; }

.command { position: relative; display: flex; align-items: center; width: min(100%, 44rem); margin: 2rem auto 0; padding: .4rem; background: #fff; color-scheme: light; --text: #14162b; --muted: #696e91; border-radius: 999px; box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), 0 24px 60px -20px rgb(0 0 0 / 70%), 0 0 0 8px rgb(255 106 19 / 10%); }
.command:focus-within { box-shadow: 0 0 0 2px var(--fire-2), 0 24px 60px -20px rgb(0 0 0 / 70%), 0 0 0 9px rgb(255 106 19 / 18%); }
.command .icon { position: absolute; inset-inline-start: 1.25rem; width: 1.3rem; height: 1.3rem; color: var(--muted); }
.command input { flex: 1; min-width: 0; height: 3.3rem; padding-inline: 2.9rem .75rem; border: 0; background: transparent; color: var(--text); font: 450 1.08rem var(--font); outline: none; }
.command .button { min-height: 3.1rem; padding-inline: 1.5rem; border-radius: 999px; }

.dock { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; max-width: 62rem; margin: 1.9rem auto 0; padding: 0; list-style: none; }
.dock a { display: inline-flex; align-items: center; gap: .5rem; padding-block: .3rem; padding-inline: .3rem .85rem; border: 1px solid var(--ink-line); border-radius: 999px; background: rgb(255 255 255 / 3%); color: var(--on-ink); font-size: .88rem; font-weight: 550; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.dock a:hover { background: rgb(255 255 255 / 8%); border-color: color-mix(in srgb, var(--hue) 70%, white); text-decoration: none; }
.dock .icon-tile { width: 1.85rem; height: 1.85rem; border-radius: 999px; box-shadow: none; }
.dock .icon-tile .icon { width: .95rem; height: .95rem; }

.rank-list { display: grid; gap: .6rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.rank-list li { counter-increment: rank; }
.rank-list a { display: grid; grid-template-columns: 2.6rem 2.6rem minmax(0, 1fr); align-items: center; gap: .85rem; padding-block: .7rem; padding-inline: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.rank-list a::before { content: counter(rank, decimal-leading-zero); font: 800 1.45rem/1 var(--display); letter-spacing: -.04em; background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank-list a:hover { border-color: color-mix(in srgb, var(--hue) 45%, var(--border)); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.rank-name { display: block; font-weight: 650; line-height: 1.3; }
.rank-cat { display: block; color: var(--muted); font-size: .84rem; }

.mosaic { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); grid-auto-flow: dense; }
.cat-tile { position: relative; display: flex; flex-direction: column; padding: 1.15rem 1.15rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.cat-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--hue); }
.cat-tile-head { display: flex; align-items: center; gap: .8rem; color: var(--text); text-decoration: none; margin-bottom: .75rem; }
.cat-tile-head:hover { text-decoration: none; }
.cat-tile-head:hover .cat-tile-name { color: var(--hue); }
.cat-tile-name { display: block; font: 700 1.08rem/1.25 var(--display); letter-spacing: -.01em; }
.cat-tile-count { display: block; color: var(--muted); font-size: .84rem; }
.cat-tile-list { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .05rem; }
.cat-tile-list a { display: block; padding: .32rem .5rem; margin-inline: -.5rem; border-radius: 8px; color: var(--text-2); font-size: .93rem; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-tile-list a:hover { background: color-mix(in srgb, var(--hue) 9%, var(--surface)); color: var(--text); }
.cat-tile-more { margin-top: auto; padding-top: .35rem; color: var(--hue); font-size: .88rem; font-weight: 650; text-decoration: none; }
.cat-tile-more:hover { text-decoration: underline; }
@media (min-width: 900px) {
  .cat-tile.is-wide { grid-column: span 2; }
  .cat-tile.is-wide .cat-tile-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.25rem; }
}

.pillars { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.pillars li { padding: 1.25rem 1.3rem; border-radius: var(--radius-lg); background: var(--field); }
.pillars .icon { width: 1.6rem; height: 1.6rem; color: var(--brand); margin-bottom: .6rem; }
.pillars h3 { margin: 0 0 .35rem; }
.pillars p { margin: 0; color: var(--text-2); font-size: .95rem; }

/* ------------------------------------------------------------------------------------------------------------------
   Category pages and tool lists
   ------------------------------------------------------------------------------------------------------------------ */

.cat-hero { position: relative; margin: -1.75rem 0 2rem; padding: 2.25rem 0 2rem; background: linear-gradient(180deg, color-mix(in srgb, var(--hue) 13%, var(--bg)), var(--bg)); border-bottom: 1px solid var(--border); }
.cat-hero .page-head { margin-bottom: 0; }
.cat-hero .icon-tile--large { width: 4.25rem; height: 4.25rem; border-radius: 20px; }

.tool-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.tool-card { position: relative; display: flex; gap: .9rem; align-items: center; padding-block: .9rem; padding-inline: 1rem 2.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.tool-card::after { content: ""; position: absolute; inset-inline-end: 1rem; top: 50%; width: .5rem; height: .5rem; border-top: 2px solid var(--border-strong); border-inline-end: 2px solid var(--border-strong); transform: translateY(-50%) rotate(45deg); transition: border-color .15s ease, inset-inline-end .15s ease; }
[dir="rtl"] .tool-card::after { transform: translateY(-50%) rotate(-135deg); }
.tool-card:hover { border-color: color-mix(in srgb, var(--hue) 45%, var(--border)); box-shadow: var(--shadow); text-decoration: none; }
.tool-card:hover::after { border-color: var(--hue); inset-inline-end: .8rem; }
.tool-card-body { display: grid; gap: .15rem; min-width: 0; }
.tool-card-name { font-weight: 650; font-size: 1rem; line-height: 1.35; }
.tool-card-text { color: var(--muted); font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.filter { position: relative; max-width: 26rem; margin-bottom: 1.1rem; }
.filter .icon { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filter input { width: 100%; height: 2.75rem; padding-inline: 2.6rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; outline: none; }
.filter input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.filter-empty { color: var(--muted); }

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.link-list a { display: flex; align-items: center; gap: .65rem; padding: .45rem .5rem; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .92rem; line-height: 1.35; }
.link-list a:hover { background: var(--field); }
.link-list .icon-tile { width: 1.9rem; height: 1.9rem; border-radius: 9px; box-shadow: none; }
.link-list .icon-tile .icon { width: .95rem; height: .95rem; }

.language-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.language-grid a { display: grid; gap: .2rem; padding: 1.15rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); text-decoration: none; }
.language-grid a:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.language-grid a.is-suggested { border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint); }
.language-name { font: 700 1.15rem/1.3 var(--display); }
.language-tagline { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------------------------------------------------------------
   Tool page: the box (inputs on the left, the ink result display on the right), then the article and the rail
   ------------------------------------------------------------------------------------------------------------------ */

.tool-layout { display: grid; gap: 2rem 2.75rem; grid-template-columns: minmax(0, 1fr); margin-top: 1.25rem; }
@media (min-width: 1080px) { .tool-layout { grid-template-columns: minmax(0, 1fr) 18.5rem; } }
.tool-main { min-width: 0; max-width: 50rem; }

.tool-card-box { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: clamp(1rem, .55rem + 1.7vw, 1.75rem); overflow: hidden; }
.tool-card-box::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--hue), color-mix(in srgb, var(--hue) 40%, var(--fire-3))); }
.tool-split { display: grid; gap: 1.5rem 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) {
  .tool-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .tool-split .tool-result { position: sticky; top: calc(var(--header-h) + 1rem); }
  .tool-split .fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }
}
.tool-extras:has(> *) { border-top: 1px solid var(--border); margin-top: 1.6rem; padding-top: .2rem; }
.tool-privacy { display: flex; gap: .45rem; align-items: center; margin: .85rem .3rem 0; color: var(--muted); font-size: .85rem; }
.tool-privacy .icon { color: var(--ok); }
.tool-root { min-height: 18rem; }
/* The image compression tool draws its whole interface when it mounts: about 990 px tall at 412 px wide, 760 px at 600
   and 660 px at 768 (measured). Its root reserves that height, so the page below does not move (layout shift). */
.tool-root[data-tool="image-compress"] { min-height: 66rem; }
@media (min-width: 600px) { .tool-root[data-tool="image-compress"] { min-height: 48rem; } }
@media (min-width: 768px) { .tool-root[data-tool="image-compress"] { min-height: 42rem; } }

/* Form */
.fields { display: grid; gap: 1.1rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }
.field { min-width: 0; }
.field--textarea, .field--wide { grid-column: 1 / -1; }
.field > label, .field legend { display: block; margin-bottom: .45rem; color: var(--text); font-size: .9rem; font-weight: 600; line-height: 1.3; }
.field fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { display: block; margin-bottom: .45rem; padding: 0; color: var(--text); font-size: .9rem; font-weight: 600; line-height: 1.3; }
.control {
  display: flex; align-items: center; min-height: 3rem; background: var(--field); border: 1.5px solid transparent; border-radius: 13px;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.control:hover { background: var(--field-hover); }
.control:focus-within { background: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 15%, transparent); }
.control input, .control select, .control textarea {
  flex: 1; min-width: 0; width: 100%; padding: .7rem .95rem; border: 0; background: transparent; color: var(--text);
  font: 550 1.02rem/1.4 var(--font); font-variant-numeric: tabular-nums; outline: none;
}
.control select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 2.4rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23696e91'%3E%3Cpath d='M1.6 4.6a.75.75 0 0 1 1.06 0L8 9.94l5.34-5.34a.75.75 0 1 1 1.06 1.06l-5.87 5.87a.75.75 0 0 1-1.06 0L1.6 5.66a.75.75 0 0 1 0-1.06'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .95rem center; background-size: .85rem; }
[dir="rtl"] .control select { background-position: left .95rem center; }
.control textarea { font: 400 .95rem/1.55 var(--mono); resize: vertical; min-height: 8rem; }
.control input[type="date"], .control input[type="month"], .control input[type="time"] { font-family: var(--font); }
/* Numbers stay left to right in an RTL page, so the digits and the minus sign keep their order. */
input[type="number"], input[inputmode="decimal"], input[inputmode="numeric"] { direction: ltr; }
/* Colour fields: the swatch fills the field. With the text padding browsers draw it as a thin bar. */
.control input[type="color"], .custom-tool input[type="color"] { padding: .35rem; min-height: 2.9rem; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border-strong); border-radius: calc(var(--radius-sm) - 3px); }
input[type="color"]::-moz-color-swatch { border: 1px solid var(--border-strong); border-radius: calc(var(--radius-sm) - 3px); }
.control .unit { padding-inline: .2rem 1rem; color: var(--muted); font-size: .9rem; font-weight: 650; white-space: nowrap; }
.field [aria-invalid="true"] { color: var(--error); }
.field:has([aria-invalid="true"]) .control { border-color: var(--error); background: var(--error-tint); }
.help, .field-read { margin: .4rem .15rem 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.field-read { color: var(--text-2); }
.field-error { margin: .4rem .15rem 0; color: var(--error); font-size: .86rem; font-weight: 550; }

.segmented { display: flex; gap: .25rem; padding: .25rem; min-height: 3rem; background: var(--field); border-radius: 13px; }
.segmented label { flex: 1; position: relative; display: grid; place-items: center; min-height: 2.5rem; margin: 0; padding: .3rem .7rem; border-radius: 10px; color: var(--text-2); font-size: .93rem; font-weight: 600; cursor: pointer; text-align: center; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented label:has(input:checked) { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-sm); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }

.check { display: inline-flex; align-items: center; gap: .6rem; min-height: 3rem; font-weight: 550; cursor: pointer; }
.field > label.check { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 0; font-weight: 550; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--brand); }
.radio-list { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.custom-tool .fields { align-items: end; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.4rem; }
.form-actions .button-primary { min-width: 9.5rem; }

/* Results. Outside the split (custom tools, narrow screens) they sit on the light card; in a calculator's split
   they form the ink display. */
.tool-result { margin-top: 1.5rem; min-height: 8rem; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .9rem; }
.result-head h2 { margin: 0; color: var(--muted); font: 700 .76rem/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; }
.result-actions { display: flex; gap: .25rem; flex-wrap: wrap; }
.result-grid { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); }
.stat { display: grid; align-content: start; gap: .2rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); min-width: 0; }
.stat-label { color: var(--muted); font-size: .83rem; font-weight: 550; line-height: 1.3; }
.stat-value { font: 700 1.22rem/1.25 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat-help { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.stat--primary { grid-column: 1 / -1; padding: 1.1rem 1.2rem; border-color: var(--tint-strong); background: var(--tint); }
.stat--primary .stat-label { color: var(--text-2); font-size: .9rem; }
.stat--primary .stat-value { font-size: clamp(2rem, 1.45rem + 2.3vw, 2.85rem); font-weight: 800; letter-spacing: -.035em; color: var(--text); }
.stat.is-long { grid-column: 1 / -1; }
.stat.is-long .stat-value { font: 500 .98rem/1.55 var(--font); letter-spacing: 0; }
.stat--primary.is-long .stat-value { font-size: 1.15rem; font-weight: 600; }
.stat--ok { background: var(--ok-tint); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.stat--ok .stat-value { color: var(--ok); }
.stat--bad { background: var(--error-tint); border-color: color-mix(in srgb, var(--error) 35%, transparent); }
.stat--bad .stat-value { color: var(--error); }
.tool-card-box.is-empty .result-grid, .tool-card-box.is-empty .result-block, .tool-card-box.is-empty .result-details { opacity: .35; filter: grayscale(1); }
.tool-message { display: flex; gap: .5rem; align-items: flex-start; margin: 0 0 1rem; padding: .75rem .95rem; border: 1px solid color-mix(in srgb, var(--error) 35%, transparent); border-radius: 12px; background: var(--error-tint); color: var(--text); font-size: .93rem; }
.tool-notes { margin: .9rem 0 0; padding-inline-start: 1.2rem; color: var(--text-2); font-size: .9rem; }
.result-block { margin-top: 1.4rem; }
.result-block > h3 { font-size: 1rem; margin-bottom: .6rem; }

.tool-split .tool-result { margin-top: 0; padding: 1.2rem; border-radius: 22px; background: var(--ink); color: var(--on-ink); box-shadow: inset 0 0 0 1px var(--ink-line), var(--shadow); }
.tool-split .result-head h2 { color: var(--on-ink-3); }
.tool-split .result-actions .button-ghost { color: var(--on-ink-2); }
.tool-split .result-actions .button-ghost:hover { background: var(--ink-2); color: var(--on-ink); }
.tool-split .stat { background: var(--ink-2); border-color: var(--ink-line); }
.tool-split .stat-label, .tool-split .stat-help { color: var(--on-ink-3); }
.tool-split .stat-value { color: var(--on-ink); }
.tool-split .stat--primary { position: relative; background: linear-gradient(160deg, var(--ink-3), var(--ink-2)); border-color: transparent; box-shadow: inset 0 0 0 1px rgb(255 106 19 / 35%); }
.tool-split .stat--primary .stat-label { color: var(--fire-3); }
.tool-split .stat--primary .stat-value { color: #fff; }
.tool-split .stat--ok { background: rgb(74 222 128 / 9%); border-color: rgb(74 222 128 / 35%); }
.tool-split .stat--ok .stat-value { color: #6ee7a1; }
.tool-split .stat--bad { background: rgb(251 113 133 / 10%); border-color: rgb(251 113 133 / 38%); }
.tool-split .stat--bad .stat-value { color: #ff9aaa; }
.tool-split .tool-notes { color: var(--on-ink-2); }
.tool-split .tool-message { background: rgb(255 59 48 / 12%); border-color: rgb(255 59 48 / 40%); color: var(--on-ink); }
/* Tools whose answer is only tables, charts or steps: one column, and the result panel is a plain bar of actions. */
.tool-split--extras { grid-template-columns: minmax(0, 1fr); }
.tool-split--extras .tool-result { position: static; min-height: 0; padding: 0; border-radius: 0; background: none; color: inherit; box-shadow: none; }
.tool-split--extras .result-head h2 { color: var(--muted); }
.tool-split--extras .result-actions .button-ghost { color: var(--muted); }
.tool-split--extras .result-actions .button-ghost:hover { background: var(--tint); color: var(--text); }
.tool-split--extras .tool-notes { color: var(--muted); }
.tool-split--extras .tool-message { background: var(--error-tint); border-color: var(--error); color: var(--text); }
.tool-split .tool-result a { color: var(--fire-3); }

.result-details { margin-top: 1.25rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.result-details > summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; cursor: pointer; font-weight: 650; }
.result-details > summary::-webkit-details-marker { display: none; }
.result-details > summary .icon { transition: transform .15s ease; color: var(--muted); }
.result-details[open] > summary .icon { transform: rotate(90deg); }
[dir="rtl"] .result-details > summary .icon { transform: scaleX(-1); }
[dir="rtl"] .result-details[open] > summary .icon { transform: rotate(90deg); }
.result-details > summary .count { margin-inline-start: auto; padding: .1rem .5rem; border-radius: 999px; background: var(--field); color: var(--muted); font-size: .8rem; font-weight: 600; }
.result-details > div { padding: 0 1rem 1rem; }

.table-scroll { overflow: auto; max-height: 32rem; border: 1px solid var(--border); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: .55rem .8rem; border-bottom: 1px solid var(--border); text-align: start; white-space: nowrap; }
.data-table thead th { position: sticky; top: 0; z-index: 1; background: var(--field); color: var(--text-2); font-size: .8rem; font-weight: 700; }
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--field) 45%, transparent); }
.data-table tbody tr:hover { background: var(--tint); }
.data-table tfoot th, .data-table tfoot td { position: sticky; bottom: 0; background: var(--surface); font-weight: 700; border-top: 2px solid var(--border-strong); border-bottom: 0; }
.data-table .num { text-align: end; }
.table-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: .45rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 1.9rem 1fr; gap: .65rem; align-items: start; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: .95rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 9px; background: var(--ink); color: var(--fire-3); font: 800 .82rem/1 var(--display); }

.chart { margin: 0; }
.chart-svg { display: block; width: 100%; height: auto; direction: ltr; }
.chart-pie { max-width: 17rem; margin-inline: auto; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font: 500 11px var(--font); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; list-style: none; margin: .6rem 0 0; padding: 0; color: var(--text-2); font-size: .87rem; }
.chart-legend li { display: inline-flex; align-items: center; gap: .45rem; }
.swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 4px; }
.chart figcaption { margin-top: .4rem; color: var(--muted); font-size: .85rem; }

/* Long text results (formatted JSON, encoded text...): a scrollable box with Copy and Download. */
.code-output { margin-top: .9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; direction: ltr; }
.result-head + .tool-message + .code-output, .result-head + .tool-message + .result-grid + .code-output { margin-top: 0; }
.code-output-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .5rem; padding-inline: .95rem .55rem; border-bottom: 1px solid var(--border); background: var(--field); font-weight: 600; font-size: .9rem; }
.code-output-actions { display: flex; gap: .35rem; }
.code-output-body { margin: 0; padding: .9rem 1rem; min-height: 8rem; max-height: 28rem; overflow: auto; font: 400 .9rem/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text); }
.code-output-body code:empty::before { content: "—"; color: var(--muted); }
.tool-split .code-output { background: var(--ink-2); border-color: var(--ink-line); }
.tool-split .code-output-head { background: var(--ink-3); border-color: var(--ink-line); color: var(--on-ink-2); }
.tool-split .code-output-body { color: var(--on-ink); }
.tool-split .code-output .button { background: var(--ink-2); border-color: var(--ink-line); color: var(--on-ink); }
.tool-split .code-output .button:hover { background: var(--ink); }

mark { padding: 0 .12em; border-radius: 4px; background: color-mix(in srgb, var(--brand) 26%, transparent); color: inherit; }

/* File tools */
.tool-card-box--custom { padding: clamp(1rem, .6rem + 1.6vw, 1.9rem); }
.custom-tool { display: grid; gap: 1.25rem; }
.file-picker { display: grid; gap: .9rem; }
.drop-zone { display: grid; justify-items: center; gap: .35rem; padding: 2.4rem 1rem; border: 2px dashed color-mix(in srgb, var(--hue) 40%, var(--border-strong)); border-radius: 22px; background: color-mix(in srgb, var(--hue) 5%, var(--field)); text-align: center; transition: border-color .15s ease, background .15s ease; }
.drop-zone.is-over { border-color: var(--hue); background: color-mix(in srgb, var(--hue) 12%, var(--surface)); }
.drop-zone.is-compact { padding: 1.1rem 1rem; }
.drop-zone.is-compact .icon-tile, .drop-zone.is-compact .drop-zone-limit { display: none; }
.drop-zone p { margin: 0; }
.drop-zone-title { margin-top: .5rem !important; }
.drop-zone-hint { color: var(--text-2); }
.drop-zone-limit { color: var(--muted); font-size: .85rem; }
.file-list, .file-results { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.file-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.file-row .icon-tile { width: 2.4rem; height: 2.4rem; box-shadow: none; }
.file-row--result { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-tint); }
.file-row--result .icon-tile { background: var(--ok); color: #fff; }
.file-row--bad { border-color: color-mix(in srgb, var(--error) 45%, transparent); background: var(--error-tint); }
.file-row--bad .file-row-size { color: var(--error); white-space: normal; }
.file-row--bad .file-row-extra { display: none; }
.file-row-body { display: grid; min-width: 0; flex: 1; }
.file-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-size { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.file-row-actions { display: flex; gap: .3rem; flex: none; }
.file-row-actions .icon-button { width: 2.2rem; height: 2.2rem; }
.file-row-extra { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; color: var(--text-2); font-size: .85rem; font-weight: 600; }
.file-row-extra input { flex: 1; min-width: 0; max-width: 14rem; min-height: 2.1rem; padding: .3rem .6rem; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--field); color: var(--text); font: 500 .9rem/1.3 var(--font); font-variant-numeric: tabular-nums; }
.file-row-extra input:focus { outline: none; background: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent); }
.file-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; }
.file-options { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); padding-top: 1.1rem; border-top: 1px dashed var(--border-strong); }
.file-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.file-actions .file-status { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 500; }
.file-result-area { display: grid; gap: .6rem; }
.file-status { color: var(--text-2); font-weight: 500; }
.file-progress { width: 100%; height: .5rem; accent-color: var(--brand); }

/* The article below the tool */
.prose { color: var(--text-2); font-size: 1.02rem; }
.prose h2 { margin-top: 2.75rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-inline-start: 1.35rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--hue); }
.prose strong { color: var(--text); }
.prose .data-table { font-size: .93rem; }
.prose .table-scroll { max-height: none; margin: 1rem 0; }
.formula { margin: 1rem 0; padding: 1.05rem 1.2rem; background: var(--ink); border-radius: 14px; color: var(--on-ink); font: 500 .93rem/1.65 var(--mono); white-space: pre-wrap; overflow-x: auto; }

/* How to use: a vertical track of numbered stops. */
.howto { position: relative; list-style: none; counter-reset: step; margin: 0; padding: 0 !important; display: grid; gap: .25rem; }
.howto::before { content: ""; position: absolute; inset-inline-start: .95rem; top: 1rem; bottom: 1rem; width: 2px; background: linear-gradient(var(--fire-2), color-mix(in srgb, var(--hue) 60%, var(--border))); border-radius: 2px; }
.howto li { counter-increment: step; position: relative; margin: 0; padding-block: .55rem .7rem; padding-inline: 3.1rem 0; color: var(--text-2); line-height: 1.55; }
.howto li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: .45rem; display: grid; place-items: center; width: 1.95rem; height: 1.95rem; border-radius: 999px; background: var(--fire); color: var(--on-fire); font: 800 .85rem/1 var(--display); box-shadow: 0 0 0 4px var(--bg); }

.example { margin-top: 2.75rem; padding: 1.35rem 1.4rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: inset 4px 0 0 var(--hue); }
[dir="rtl"] .example { box-shadow: inset -4px 0 0 var(--hue); }
.example h2 { margin-top: 0; font-size: 1.22rem; }

/* FAQ: a ruled list, not a stack of cards. */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem .2rem; color: var(--text); font: 650 1.02rem/1.4 var(--font); cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { flex: none; width: 1.75rem; height: 1.75rem; padding: .4rem; border-radius: 999px; background: var(--field); color: var(--text-2); transition: transform .2s ease, background .2s ease, color .2s ease; }
.faq details[open] summary .icon { transform: rotate(45deg); background: var(--ink); color: var(--fire-3); }
.faq details > div { padding: 0 .2rem 1.1rem; color: var(--text-2); max-width: 44rem; }
.faq details > div p:last-child { margin-bottom: 0; }

.sources { margin-top: 2.75rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--field); font-size: .92rem; }
.sources h2 { font-size: 1rem; margin: 0 0 .5rem; }
.sources ul { margin: 0 0 .75rem; }
.updated { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .88rem; }

.tool-aside { display: grid; align-content: start; gap: 1.25rem; min-width: 0; }
@media (min-width: 1080px) { .tool-aside-inner { position: sticky; top: calc(var(--header-h) + 1.25rem); display: grid; gap: 1.1rem; } }
.aside-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem .65rem .65rem; }
.aside-box h2 { margin: 0 .5rem .55rem; color: var(--muted); font: 700 .72rem/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; }
.aside-box .more { display: block; margin: .35rem .5rem .2rem; font-size: .88rem; font-weight: 650; text-decoration: none; }

/* On this page */
.toc ol { list-style: none; margin: 0; padding-block: 0; padding-inline: .5rem 0; border-inline-start: 2px solid var(--border); display: grid; gap: .1rem; }
.toc a { display: block; margin-inline-start: -2px; padding: .3rem .75rem; border-inline-start: 2px solid transparent; color: var(--text-2); font-size: .9rem; line-height: 1.35; text-decoration: none; }
.toc a:hover { border-color: var(--hue); color: var(--text); }

/* ------------------------------------------------------------------------------------------------------------------
   Ad slots: each shape reserves the height of the unit it carries, at every width, so the page never moves.
   ------------------------------------------------------------------------------------------------------------------ */

.ad-slot { margin: 2.25rem auto; text-align: center; overflow: hidden; }
.ad-label { display: block; margin-bottom: .3rem; color: var(--muted); font: 600 .66rem var(--font); letter-spacing: .14em; text-transform: uppercase; }
.ad-slot ins { display: block; margin: 0 auto; }
.ad-slot--leaderboard { min-height: calc(100px + 1.4rem); }
.ad-slot--leaderboard ins { width: 320px; height: 100px; }
.ad-slot--rectangle { min-height: calc(250px + 1.4rem); }
.ad-slot--rectangle ins { width: 300px; height: 250px; }
.ad-slot--skyscraper { min-height: calc(600px + 1.4rem); margin: 0; }
.ad-slot--skyscraper ins { width: 300px; height: 600px; }
@media (min-width: 800px) {
  .ad-slot--leaderboard { min-height: calc(90px + 1.4rem); }
  .ad-slot--leaderboard ins { width: 728px; height: 90px; }
  .ad-slot--rectangle { min-height: calc(280px + 1.4rem); }
  .ad-slot--rectangle ins { width: 336px; height: 280px; }
}
@media (max-width: 1079px) { .ad-slot--skyscraper { display: none; } }

/* ------------------------------------------------------------------------------------------------------------------
   Footer: ink, with the wordmark set large
   ------------------------------------------------------------------------------------------------------------------ */

.site-footer { position: relative; margin-top: 3rem; background: var(--ink); color: var(--on-ink-2); font-size: .92rem; border-radius: var(--radius-xl) var(--radius-xl) 0 0; overflow: hidden; }
.footer-wordmark { margin: 0; padding: 2.5rem 1.25rem 0; text-align: center; font: 800 clamp(3rem, 1rem + 9vw, 8.5rem)/.9 var(--display); letter-spacing: -.05em; background: linear-gradient(180deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 2%)); -webkit-background-clip: text; background-clip: text; color: transparent; user-select: none; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); padding-block: 2.25rem 2rem; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.3fr 2fr 1fr; } }
.site-footer .logo { color: var(--on-ink); }
.footer-brand p { margin: .75rem 0 0; color: var(--on-ink-3); max-width: 22rem; }
.footer-col h2 { margin: 0 0 .85rem; color: var(--on-ink-3); font: 700 .72rem/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-col--wide ul { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .45rem 1.25rem; }
.footer-col a { color: var(--on-ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--on-ink); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-block: 1.1rem 1.6rem; border-top: 1px solid var(--ink-line); color: var(--on-ink-3); font-size: .85rem; }
.footer-languages { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.footer-languages a { color: var(--on-ink-3); text-decoration: none; }
.footer-languages a:hover { color: var(--on-ink); }
.footer-languages a[aria-current] { color: var(--on-ink); font-weight: 600; }
.sister { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1rem; padding: .45rem .85rem; border: 1px solid var(--ink-line); border-radius: 999px; color: var(--on-ink-2); font-weight: 550; text-decoration: none; }
.sister:hover { border-color: var(--on-ink-3); color: var(--on-ink); text-decoration: none; }

/* ------------------------------------------------------------------------------------------------------------------
   Error page, content pages
   ------------------------------------------------------------------------------------------------------------------ */

.error-code { margin: 0 0 .5rem; font: 800 clamp(4rem, 3rem + 5vw, 7rem)/1 var(--display); letter-spacing: -.05em; background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.content-page { max-width: 46rem; }
.content-page h1 { margin-bottom: 1.25rem; }
/* The tables of the legal pages scroll inside their own box on a phone instead of widening the page; long links wrap. */
.content-page table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.content-page th, .content-page td { padding: .45rem .7rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.content-page a { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------------------------------------------------------
   Consent
   ------------------------------------------------------------------------------------------------------------------ */

.consent-banner { position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 60; max-width: 46rem; margin-inline: auto; background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.consent-inner { padding: 1.15rem 1.25rem; display: grid; gap: .9rem; }
.consent-copy p { margin: 0; color: var(--on-ink-2); font-size: .9rem; }
.consent-banner .consent-title { color: var(--on-ink); }
.consent-banner .button { background: var(--ink-2); border-color: var(--ink-line); color: var(--on-ink); }
.consent-banner .button:hover { background: var(--ink-3); }
.consent-banner .button-ghost { background: transparent; border-color: transparent; color: var(--on-ink-2); }
.consent-title { margin: 0 0 .3rem; font-size: 1.05rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.consent-dialog { width: min(34rem, calc(100% - 2rem)); padding: 1.35rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.consent-dialog::backdrop { background: rgb(7 9 21 / 60%); }
.consent-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.consent-option { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--border); }
.consent-option h3 { margin: 0 0 .2rem; font-size: 1rem; }
.consent-option p { margin: 0; color: var(--muted); font-size: .88rem; }
.consent-always { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.consent-switch { width: 2.6rem; height: 1.4rem; accent-color: var(--brand); flex: none; }

/* ------------------------------------------------------------------------------------------------------------------
   Small screens, print, motion
   ------------------------------------------------------------------------------------------------------------------ */

@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .header-inner { flex-wrap: wrap; gap: .5rem; padding-block: .55rem; }
  .logo { margin-inline-end: auto; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .search kbd { display: none; }
  .menu > summary .label { display: none; }
  .menu > summary { padding: 0 .7rem; }
  .menu--categories .menu-panel { position: fixed; inset-inline: .75rem; top: 7.2rem; width: auto; }
  .page-head { align-items: flex-start; }
  .page-head .icon-tile--large { width: 3rem; height: 3rem; border-radius: 14px; }
  .page-head .icon-tile--large .icon { width: 1.45rem; height: 1.45rem; }
  .forge { border-radius: 0 0 22px 22px; }
  .command { border-radius: 18px; }
  .command input { height: 3rem; font-size: 1rem; }
  .command .button { display: none; }
  .dock { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -1.25rem; padding-inline: 1.25rem; scrollbar-width: none; }
  .dock::-webkit-scrollbar { display: none; }
  .dock a { flex: none; }
  .tool-card-box { border-radius: 22px; }
  .data-table th, .data-table td { padding: .5rem .6rem; }
  .site-footer { border-radius: 22px 22px 0 0; }
}

@media print {
  .site-header, .site-footer, .lang-bar, .ad-slot, .tool-aside, .consent-banner, .form-actions, .result-actions, .table-actions, .tool-privacy, .breadcrumb { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-card-box { border: 0; box-shadow: none; padding: 0; }
  .tool-card-box::before { display: none; }
  .tool-split .tool-result { background: #fff; color: #000; box-shadow: none; border: 1px solid #ccc; }
  .tool-split .stat, .tool-split .stat--primary { background: #fff; border-color: #ccc; box-shadow: none; }
  .tool-split .stat-value, .tool-split .stat--primary .stat-value { color: #000; }
  .tool-layout { display: block; }
  .result-details > div { display: block !important; }
  .table-scroll { max-height: none; overflow: visible; }
  .data-table tr[hidden] { display: table-row !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------------------------------------------------------
   Image and PDF tool parts: range sliders, previews, the crop box, page thumbnails
   ------------------------------------------------------------------------------------------------------------------ */

.range-value { display: flex; align-items: center; gap: .7rem; min-height: 3rem; padding-inline: .9rem; border-radius: 13px; background: var(--field); font-variant-numeric: tabular-nums; font-weight: 650; }
.range-value input[type="range"], .control input[type="range"] { flex: 1; min-width: 0; width: 100%; padding: 0; accent-color: var(--brand); }

.rotate-stage, .watermark-stage, .collage-stage, .meme-stage { display: flex; justify-content: center; padding: .75rem; border-radius: 18px; overflow: hidden; background-color: var(--field); background-image: linear-gradient(45deg, var(--field-hover) 25%, transparent 25%, transparent 75%, var(--field-hover) 75%), linear-gradient(45deg, var(--field-hover) 25%, transparent 25%, transparent 75%, var(--field-hover) 75%); background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.rotate-preview, .watermark-preview, .collage-preview, .meme-preview { display: block; max-width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow); }
.collage-preview, .meme-preview { touch-action: none; cursor: grab; }
.collage-preview:active, .meme-preview:active { cursor: grabbing; }

.image-compare { position: relative; overflow: hidden; border-radius: 18px; background: var(--field); box-shadow: var(--shadow-sm); }
.image-compare img { display: block; width: 100%; height: auto; }
.image-compare-before { position: absolute; inset: 0; height: 100%; object-fit: contain; }
.image-compare-after { display: block; }

.crop-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; overflow: hidden; border-radius: 12px; background: var(--ink); }
.crop-canvas { display: block; max-width: 100%; height: auto; }
.crop-box { position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid rgb(0 0 0 / 35%); box-shadow: 0 0 0 9999px rgb(7 9 21 / 58%); cursor: move; touch-action: none; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 0 solid rgb(255 255 255 / 45%); }
.crop-box::before { border-width: 0 1px; inset-inline: 33.333%; }
.crop-box::after { border-width: 1px 0; inset-block: 33.333%; }
.crop-box.is-circle { border-radius: 50%; }
.crop-box:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.crop-handle { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid var(--ink); border-radius: 5px; background: #fff; touch-action: none; }
.crop-handle--nw { left: 0; top: 0; cursor: nwse-resize; }
.crop-handle--n { left: 50%; top: 0; cursor: ns-resize; }
.crop-handle--ne { left: 100%; top: 0; cursor: nesw-resize; }
.crop-handle--e { left: 100%; top: 50%; cursor: ew-resize; }
.crop-handle--se { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-handle--s { left: 50%; top: 100%; cursor: ns-resize; }
.crop-handle--sw { left: 0; top: 100%; cursor: nesw-resize; }
.crop-handle--w { left: 0; top: 50%; cursor: ew-resize; }

/* PDF page lists: thumbnails sit in the row's icon tile (sized by the script), on white like paper. */
.file-row > .icon-tile:has(canvas), .file-row > .icon-tile:has(img) { padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.file-row > .icon-tile canvas, .file-row > .icon-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }
.file-row-handle { display: inline-grid; place-items: center; width: 1.6rem; color: var(--muted); cursor: grab; touch-action: none; }
.file-row-handle:active { cursor: grabbing; }
.file-row.is-dragging { opacity: .55; border-style: dashed; }
.file-row.is-drop-target { border-color: var(--hue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hue) 20%, transparent); }
.page-selector { display: grid; gap: .9rem; }
.page-selector .file-list { max-height: 34rem; overflow: auto; padding-inline-end: .25rem; }
.file-row .check { min-height: auto; }

/* Drawings inside custom tools (resistor bands, wheels): centred on a quiet panel. */
.resistor-drawing { display: grid; place-items: center; padding: 1.1rem; border-radius: 18px; background: var(--field); }
.resistor-svg { display: block; width: 100%; max-width: 26rem; height: auto; }
.tool-heading { margin: 0 0 .6rem; font: 700 1.05rem/1.3 var(--display); }
