/* ==================================================================================================================
   usefulweb platform layouts (extends styles.css): header, footer, home & directory, category pages, tool pages,
   results, guides, blog, docs, site/legal pages, feedback, consent dialog, ad slots, print.
   Logical properties throughout (RTL Arabic). No inline styles anywhere (CSP style-src 'self'): colours per category
   come from [data-cat] below, per app from /static/apps/themes.css.
   ================================================================================================================== */

/* ---- category accents (generated from CATEGORIES; light value ≥ 4.5:1 with white text and on its tints) ----
   w42-tooltpl: one family derived from the system teal (--primary ≈ oklch(.50 .09 205)): every light value sits at
   OKLCH L .53–.56, C ≤ .115, hue spread over the wheel except 270–330 (no violet/indigo); ≥ 4.6:1 on white, canvas and
   its own tint. Dark values at L ≈ .72–.74, ≥ 4.8:1 on every dark surface and ≥ 7.5:1 under the dark on-accent text.
   Used only as small marks (dots, icon badges, chart bars); actions and links on tool pages stay teal. */
[data-cat="everyday"] { --accent: #4f70b5; }
[data-cat="money"] { --accent: #377f45; }
[data-cat="home-travel"] { --accent: #a85d2f; }
[data-cat="internet"] { --accent: #087b9a; }
[data-cat="high-value"] { --accent: #ad5848; }
[data-cat="developer"] { --accent: #107c8b; }
[data-cat="web3"] { --accent: #4073b3; }
[data-cat="infrastructure"] { --accent: #0879a9; }
[data-cat="security"] { --accent: #ae5658; }
[data-cat="devcloud"] { --accent: #0b815d; }
[data-cat="ai-infra"] { --accent: #0c7e7b; }
[data-cat="public-data"] { --accent: #8f6c0a; }
[data-cat="explorer"] { --accent: #4f70b5; }
[data-cat="fun"] { --accent: #ad5669; }
[data-cat="calculators"] { --accent: #607a26; }
[data-cat="documents"] { --accent: #9f6414; }
[data-cat="media"] { --accent: #aa5675; }
[data-cat="charts"] { --accent: #05806a; }
[data-cat="math"] { --accent: #7b7303; }
[data-cat="crypto"] { --accent: #5c7582; }
[data-cat="apps"] { --accent: #2c75af; }
/* dark variants: ≥ 4.5:1 as text on every dark surface and with the dark on-accent text */
[data-cat="everyday"] { --accent-dk: #89a8e6; }
[data-cat="money"] { --accent-dk: #79b581; }
[data-cat="home-travel"] { --accent-dk: #da9670; }
[data-cat="internet"] { --accent-dk: #58b2d3; }
[data-cat="high-value"] { --accent-dk: #e09282; }
[data-cat="developer"] { --accent-dk: #4db5c6; }
[data-cat="web3"] { --accent-dk: #7daae4; }
[data-cat="infrastructure"] { --accent-dk: #66b0dc; }
[data-cat="security"] { --accent-dk: #e0908f; }
[data-cat="devcloud"] { --accent-dk: #63b794; }
[data-cat="ai-infra"] { --accent-dk: #4cb7b3; }
[data-cat="public-data"] { --accent-dk: #c2a25b; }
[data-cat="explorer"] { --accent-dk: #89a8e6; }
[data-cat="fun"] { --accent-dk: #df8f9e; }
[data-cat="calculators"] { --accent-dk: #97b06a; }
[data-cat="documents"] { --accent-dk: #d19c62; }
[data-cat="media"] { --accent-dk: #dd90aa; }
[data-cat="charts"] { --accent-dk: #59b8a0; }
[data-cat="math"] { --accent-dk: #afa95e; }
[data-cat="crypto"] { --accent-dk: #95abb7; }
[data-cat="apps"] { --accent-dk: #71ade0; }
:root[data-theme="dark"]:not(.uwapp-html), :root[data-theme="dark"]:not(.uwapp-html) [data-cat] { --accent: var(--accent-dk); }
:root[data-theme="dark"][data-app]:not(.uwapp-html), :root[data-theme="dark"]:not(.uwapp-html) [data-app], :root.uwapp-html[data-theme="dark"] .uwapp-bar { --accent: color-mix(in srgb, var(--app-accent, #0b5cad) 50%, #fff); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"], .uwapp-html), :root:not([data-theme="light"], .uwapp-html) [data-cat] { --accent: var(--accent-dk); }
  :root:not([data-theme="light"], .uwapp-html)[data-app], :root:not([data-theme="light"], .uwapp-html) [data-app], :root.uwapp-html:not([data-theme="light"]) .uwapp-bar { --accent: color-mix(in srgb, var(--app-accent, #0b5cad) 50%, #fff); }
}

/* script-specific system font fallbacks (no web fonts are downloaded) */
:lang(ja) body { font-family: system-ui, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }
:lang(zh) body { font-family: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
:lang(ko) body { font-family: system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
:lang(hi) body { font-family: system-ui, "Nirmala UI", "Kohinoor Devanagari", "Noto Sans Devanagari", sans-serif; }
:lang(ar) body { font-family: system-ui, "Segoe UI", "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; }

/* ================================================================== header (docs/DESIGN_SYSTEM.md "Header")
   One row on every host and width: brand · nav (≥ 1280 px) · search · theme · language (shows EN) · sign-in · menu
   (< 1280 px). Its height is --header-h + 1px line at every width (the home's fixed header and scroll padding rely on
   it). The wrap is the page's own --wrap, so header, content and footer share their left and right edges. */
.site-header { position: sticky; top: 0; z-index: 30; background-color: var(--canvas); border-bottom: 1px solid var(--line); }
.site-header > .wrap.header-inner { max-width: var(--wrap); }
.header-inner { display: flex; align-items: center; gap: 8px 20px; min-height: var(--header-h); flex-wrap: nowrap; padding-block: 0; }
/* Brand block (top left on every site): the brand logo → main site, then the current site */
.brand-block { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; min-height: 44px; }
.brand svg { flex: none; border-radius: 10px; width: 36px; height: 36px; }
.brand-text { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; line-height: 1.1; }
.brand-word { font-family: var(--font-display); font-size: 1.28rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.brand-word .bw-main { color: var(--ink); }
.brand-word .bw-tld, .brand-word .bw-tld.bw-app { color: var(--primary-text); }
.brand:hover .bw-main { color: var(--primary-text); }
/* width 0 + min-width 100%: the tagline never widens the brand; it wraps under the wordmark instead. */
.brand-tagline { width: 0; min-width: 100%; font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: 0; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.brand-sep { color: var(--line-strong); font-size: 1.5rem; font-weight: 300; }
.site-name { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 600; min-width: 0; }
.site-name svg { border-radius: 6px; flex: none; }
.site-name span { max-width: 14rem; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.site-name:hover { color: var(--primary-text); }

/* main nav (inline from 1280 px) */
.site-header nav:not(.nav-menu-nav) { margin-inline-start: auto; min-width: 0; }
.site-header nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.site-header nav li { margin: 0; }
.site-header nav:not(.nav-menu-nav) a { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-size: .95rem; font-weight: 500; white-space: nowrap; }
.site-header nav:not(.nav-menu-nav) a:hover { color: var(--ink); background: var(--surface-2); }
/* Current section (shell() sets aria-current="page"): weight plus a teal underline, never colour alone. */
.site-header nav a[aria-current="page"] { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.site-header nav a .nav-short { display: none; }
.header-tools { display: flex; align-items: center; gap: 6px; flex: none; }
@media (min-width: 1280px) { .site-header nav.site-nav + .header-tools { margin-inline-start: 4px; } }
.header-inner:not(:has(nav)) .header-tools, .header-inner:has(.nav-menu) .header-tools { margin-inline-start: auto; }

/* icon buttons of the header: search, theme, menu (one look; 40 px, 44 px on touch widths) */
.site-header :is(.hdr-search, .theme-switch, .nav-menu) > summary { list-style: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--ink-2); background: var(--surface); cursor: pointer; }
.site-header :is(.hdr-search, .theme-switch, .nav-menu) > summary::-webkit-details-marker { display: none; }
.site-header :is(.hdr-search, .theme-switch, .nav-menu) > summary:hover, .site-header :is(.hdr-search, .theme-switch, .nav-menu)[open] > summary { color: var(--ink); background: var(--surface-2); border-color: var(--control); }

/* theme switch: <details> disclosure with three POST buttons (no JS needed) */
.theme-switch { position: relative; }
.theme-switch > summary { list-style: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--r-md); color: var(--ink-2); background: var(--surface); }
.theme-switch > summary::-webkit-details-marker { display: none; }
.theme-switch > summary:hover, .theme-switch[open] > summary { color: var(--ink); background: var(--surface-2); }
.theme-switch .theme-icon { display: none; }
.theme-switch[data-current="auto"] summary .theme-icon-auto, .theme-switch[data-current="light"] summary .theme-icon-light, .theme-switch[data-current="dark"] summary .theme-icon-dark { display: block; }
.theme-pop, .hdr-search-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 40; min-width: 17rem; padding: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.theme-pop-h { margin: 4px 10px 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.theme-pop ul { list-style: none; margin: 0; padding: 0; }
.theme-pop li { margin: 0; }
.theme-pop form { margin: 0; }
.theme-pop button[data-theme-set] { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: inherit; font-weight: 500; text-align: start; cursor: pointer; box-shadow: none; transform: none; }
.theme-pop button[data-theme-set] .theme-icon { display: block; flex: none; color: var(--muted); }
.theme-pop button[data-theme-set]:hover { background: var(--surface-2); color: var(--ink); }
.theme-pop button[data-theme-set][aria-current="true"] { background: var(--info-bg); font-weight: 600; }
.theme-pop button[data-theme-set][aria-current="true"] .theme-icon { color: var(--primary-text); }
.theme-pop button[data-theme-set][aria-current="true"]::after { content: "✓"; margin-inline-start: auto; color: var(--primary-text); font-weight: 700; }
.theme-hint { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }

/* header search: a disclosure with one GET form (desktop); the same form opens the phone/tablet menu */
.hdr-search { position: relative; }
.hdr-search-pop { width: min(26rem, calc(100vw - 32px)); padding: 14px; }
.hdr-search-form { display: grid; gap: 8px; margin: 0; }
.hdr-search-form label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.hdr-search-row { display: flex; gap: 8px; }
.hdr-search-row input { flex: 1 1 auto; min-width: 0; }
.hdr-search-row button { flex: none; background: var(--primary); color: var(--on-accent); border-radius: var(--r-btn); }
.hdr-search-row button:hover { background: color-mix(in srgb, var(--primary) 86%, var(--ink)); color: var(--on-accent); }

/* language picker: the globe and the language code (EN, DE, AR) over a narrow select; the select keeps its accessible
   name (the visually hidden label text) and value; its own text is transparent, the options keep the ink colour. */
.lang-switch { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.lang-switch label { display: inline-flex; color: var(--muted); }
.lang-switch select { min-height: 38px; font-size: .9rem; padding: 6px 30px 6px 10px; border: 1px solid var(--control); border-radius: var(--r-md); background-color: var(--surface); max-width: 13rem; }
[dir=rtl] .lang-switch select { padding: 6px 10px 6px 30px; }
.lang-switch .lang-apply { min-height: 38px; font-size: .85rem; padding: 6px 12px; }
.site-header .lang-switch label { position: absolute; inset-inline-start: 11px; top: 50%; translate: 0 -50%; z-index: 1; pointer-events: none; color: var(--ink-2); }
.site-header .lang-switch select, [dir=rtl] .site-header .lang-switch select { width: 5.25rem; max-width: 5.25rem; min-height: 40px; padding-block: 6px; padding-inline: 34px 22px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: transparent; cursor: pointer; }
.site-header .lang-switch select:hover { border-color: var(--control); background-color: var(--surface-2); }
.site-header .lang-switch select option { color: var(--ink); background: var(--surface); }
.site-header .lang-short[hidden] { position: absolute; inset-block: 0; inset-inline-start: 32px; width: 1.9rem; display: grid; place-items: center; font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--ink); pointer-events: none; }
/* Language switcher with JS: picking with the mouse applies at once; keyboard users get the Apply button while the select
 * or the button has keyboard focus (3.2.2 On Input). Without JS the button is always visible. */
.lang-switch.js-lang .lang-apply { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.lang-switch.js-lang select:focus-visible + .lang-apply, .lang-switch.js-lang .lang-apply:focus { position: static; width: auto; height: auto; min-height: 38px; padding: 6px 12px; margin: 0; overflow: visible; clip-path: none; }
/* Same state from the first paint when scripting is on (no header jump when the deferred platform.js adds .js-lang, CLS);
 * the button also shows as soon as another language is picked, in case the script has not run yet. */
@media (scripting: enabled) {
  .lang-switch .lang-apply { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .lang-switch select:focus-visible + .lang-apply, .lang-switch .lang-apply:focus, .lang-switch:has(option:checked:not([selected])) .lang-apply { position: static; width: auto; height: auto; min-height: 38px; padding: 6px 12px; margin: 0; overflow: visible; clip-path: none; }
}
.lang-note { margin: 8px auto 0; color: var(--muted); }

/* sign-in / account slot (account.css styles the controls) */
.hdr-account:empty, .nav-menu-account:empty { display: none; }
.site-header .account-signin { min-height: 40px; border-radius: var(--r-sm); border-color: var(--line-strong); color: var(--ink); }
.site-header .account-signin:hover, .site-header .account-signin:focus-visible { border-color: var(--control); background: var(--surface-2); color: var(--ink); }

/* phone and tablet menu (< 1280 px): full-screen panel under the header, 52 px rows */
.nav-menu { display: none; }
.nav-menu-btn .nav-menu-close, .nav-menu[open] .nav-menu-btn .nav-menu-open { display: none; }
.nav-menu[open] .nav-menu-btn .nav-menu-close { display: block; }
.nav-menu-panel { position: fixed; inset: calc(var(--header-h) + 1px) 0 0 0; z-index: 29; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 24px; padding: 20px max(clamp(16px, 4vw, 28px), calc((100vw - var(--wrap)) / 2 + 28px)) 40px; background: var(--canvas); color: var(--ink); }
.site-header .nav-menu-nav ul { display: grid; gap: 0; }
.nav-menu-nav li { border-bottom: 1px solid var(--line); }
.nav-menu-nav a { display: flex; align-items: center; min-height: 52px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; letter-spacing: -.01em; }
.nav-menu-nav a:hover { color: var(--primary-text); }
.nav-menu-nav a[aria-current="page"] { text-underline-offset: 6px; }
.nav-menu-nav a .nav-long { display: inline; }
.nav-menu-nav a .nav-short { display: none; }
.nav-menu-account .account-signin { min-height: 48px; padding-inline: 20px; font-size: 1rem; }
.nav-menu-account .account-menu { display: block; }
@media (max-width: 1279px) {
  .header-inner:has(.nav-menu) > nav { display: none; }
  .nav-menu { display: block; }
  .header-inner:has(.nav-menu) .hdr-search { display: none; }
  /* the open menu keeps the page behind it still (and the header in view on phones, where it is not sticky) */
  html:has(.nav-menu[open]) { overflow: hidden; }
  html:has(.nav-menu[open]) .fb-fab { display: none; }
  .site-header:has(.nav-menu[open]) { position: fixed; top: 0; inset-inline: 0; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
  .site-header nav a .nav-long { display: none; }
  .site-header nav a .nav-short { display: inline; }
  .site-header nav:not(.nav-menu-nav) a { padding-inline: 8px; }
}
/* the account slot takes the room of the long "More tools on …" label */
.header-inner:has(.hdr-account .account-signin, .hdr-account .account-menu) nav:not(.nav-menu-nav) a .nav-long { display: none; }
.header-inner:has(.hdr-account .account-signin, .hdr-account .account-menu) nav:not(.nav-menu-nav) a .nav-short { display: inline; }
@media (max-width: 640px) {
  :root { --header-h: 56px; }
  /* static (not sticky) on phones, but still the containing block of the seasonal band (background hairline) */
  .site-header { position: relative; }
  .header-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand svg { width: 32px; height: 32px; }
  .brand-word { font-size: 1.08rem; }
  .brand-tagline { display: none; }
  .header-tools { gap: 4px; }
  .site-header :is(.theme-switch, .nav-menu) > summary { width: 44px; height: 44px; }
  .site-header .lang-switch select, [dir=rtl] .site-header .lang-switch select { min-height: 44px; width: 4.25rem; max-width: 4.25rem; padding-inline: 10px 20px; }
  .site-header .lang-switch label svg { display: none; }
  .site-header .lang-short[hidden] { inset-inline-start: 4px; }
  /* sign-in moves into the menu on phones (the header row keeps brand, theme, language and the menu) */
  .hdr-account { display: none; }
  .theme-switch { position: static; } /* the theme menu opens under the header row, aligned to its end: never off-screen */
  .header-tools { position: relative; }
  /* On tool, category and app sites the site name repeats the page's H1; the wordmark gives way to the logo there */
  .site-header:not([data-site-kind="platform"]) .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-header[data-site-kind="tool"] .brand-sep, .site-header[data-site-kind="tool"] .site-name,
  .site-header[data-site-kind="category"] .brand-sep, .site-header[data-site-kind="category"] .site-name { display: none; }
  .site-name span { max-width: 9rem; }
}
/* Headers without the menu (src/views/layout.ts, HeaderLens pages): below 1280 px the nav takes its own scrolling row. */
@media (max-width: 1279px) {
  .header-inner:not(:has(.nav-menu)) { flex-wrap: wrap; }
  .header-inner:not(:has(.nav-menu)) > nav { order: 3; width: 100%; margin: 0; border-top: 1px solid var(--line); }
  .header-inner:not(:has(.nav-menu)) > nav ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .header-inner:not(:has(.nav-menu)) > nav li { flex: none; }
}
@media (min-width: 641px) { .nav-menu-account { display: none; } }
@media (max-width: 359px) {
  .brand-text, .site-name span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (forced-colors: active) {
  .site-header .lang-switch select { color: CanvasText; width: auto; max-width: 11rem; padding-inline-start: 34px; }
  .site-header .lang-short[hidden] { display: none; }
}

/* ================================================================== footer (docs/DESIGN_SYSTEM.md "Footer")
   Brand + disclaimer, then three link columns (developers · legal and consent · site pages), then the seasonal
   effects control. Same wrap as the header. */
.site-footer { margin-top: var(--sp-8); padding: var(--sp-7) 0 var(--sp-6); background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: .94rem; }
.site-footer > .wrap { max-width: var(--wrap); }
/* 12 columns with 24px gaps (the page's grid): brand on columns 1–6, the link lists on 7–8, 9–10, 11–12 */
.footer-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-6) 24px; align-items: start; }
.footer-brand { grid-column: 1 / span 6; }
.footer-col:nth-of-type(1) { grid-column: 7 / span 2; }
.footer-col:nth-of-type(2) { grid-column: 9 / span 2; }
.footer-col:nth-of-type(3) { grid-column: 11 / span 2; }
.footer-brand { display: block; max-width: 30rem; color: var(--ink-2); }
.footer-mark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; }
.footer-mark svg { border-radius: 8px; flex: none; }
.footer-mark strong { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.footer-mark:hover strong { color: var(--primary-text); }
.footer-brand p { margin: 8px 0 0; color: var(--muted); max-width: 42ch; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer-links li { margin: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--primary-text); text-decoration: underline; text-underline-offset: .2em; }
.site-footer .season-ctl { grid-column: 1 / -1; padding-top: var(--sp-5); border-top: 1px solid var(--line); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } .footer-col:nth-of-type(n) { grid-column: auto; } }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-5); }
  .footer-links a { min-height: 44px; }
  /* the seasonal control: legend, then one option per row on the page's left line */
  .site-footer .season-ctl { display: grid; justify-items: start; gap: 4px; }
  .site-footer .season-ctl legend { float: none; margin: 0 0 4px; }
  .site-footer .season-opt { min-height: 44px; }
}
/* keep the end of the page (footer links) reachable above the floating feedback button */
body:has(.fb-fab) .site-footer { padding-bottom: 88px; }

/* ================================================================== hero bands */
.hero-brand { background: linear-gradient(180deg, var(--accent-tint) 0%, color-mix(in srgb, var(--accent-tint) 35%, var(--canvas)) 60%, var(--canvas) 100%); }
.hero-brand { padding: clamp(28px, 5vw, 56px) 0 clamp(24px, 4vw, 40px); }
.hero-brand h1 { letter-spacing: -.028em; }
.hero-home h1 { font-size: var(--fs-display); max-width: 24ch; }
.hero-home .lede { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); max-width: 40em; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); align-items: center; }
.has-art > .hero-grid { grid-template-columns: minmax(0, 1.45fr) minmax(240px, .95fr); }
.hero-copy { min-width: 0; }
.art { display: block; }
.art img { display: block; width: 100%; height: auto; }
.hero-art img { border-radius: var(--r-xl); }
.art img { border-radius: var(--r-xl); }
/* the artwork has a pale background: dim it a little in the dark theme so it does not glare */
:root[data-theme="dark"]:not(.uwapp-html) .art img { filter: brightness(.82) saturate(.95); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not(.uwapp-html) .art img { filter: brightness(.82) saturate(.95); } }
@media (max-width: 760px) { .has-art > .hero-grid { grid-template-columns: minmax(0, 1fr); } .hero-art { display: none; } }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-text); }
.eyebrow a { color: inherit; text-decoration: none; padding-block: 4px; }
.eyebrow a:hover { text-decoration: underline; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-solid); flex: none; }

/* search */
.tool-search { margin-top: var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px 16px; box-shadow: var(--shadow-2); max-width: 52rem; }
.tool-search label { display: block; font-weight: 600; margin-bottom: 8px; }
.tool-search .check-row input { min-height: 50px; font-size: 1.05rem; padding-inline: 14px; }
.tool-search .check-row button { min-height: 50px; padding-inline: 24px; }

/* home hero routes, quick tasks, "what runs where" (docs/capability-expansion/positioning-2026-11.md) */
.home-routes { list-style: none; margin: var(--sp-5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 10px; max-width: 52rem; }
.home-routes li { margin: 0; }
.home-routes a { display: grid; gap: 2px; height: 100%; padding: 12px 16px; border: 1px solid var(--accent-line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--accent-tint) 55%, var(--surface)); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); }
.home-routes a:hover { border-color: var(--accent-line); background: var(--accent-tint); }
.home-routes a:hover strong { text-decoration: underline; }
.home-routes strong { font-size: var(--fs-lg, 1.2rem); color: var(--accent-text); }
.home-routes span { font-size: var(--fs-sm); color: var(--ink-2); }
.home-quick { margin-top: var(--sp-4); max-width: 52rem; }
.home-quick > p { margin: 0 0 6px; font-weight: 600; color: var(--ink-2); }
.home-quick .quick-chips { gap: 6px; }
.home-quick .quick-chips a { padding: 5px 12px; font-size: .85rem; min-height: 32px; display: inline-flex; align-items: center; }
.home-local { margin: 0 0 var(--sp-6); padding: clamp(16px, 2.5vw, 24px) clamp(18px, 3vw, 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
.home-local h2 { margin: 0 0 .5em; font-size: var(--fs-xl); }
.home-local-list { margin: 0 0 .6em; padding-inline-start: 1.2em; display: grid; gap: 4px; color: var(--ink-2); }
.home-local p { margin: 0; }
.tools-apps-hint { margin: var(--sp-3) 0 0; color: var(--ink-2); }
.tools-apps-hint a { font-weight: 600; display: inline-block; padding-block: 4px; }
.app-results .card-meta, .app-result .card-meta { color: var(--accent-text); font-weight: 600; }
.app-result .card-meta { margin-top: 0; padding-top: 0; }
.app-result > p:last-child { margin-top: auto; }
/* /tools search: one ranked list (src/platform/search-rank.ts) */
.search-results { margin: var(--sp-5, 24px) 0 var(--sp-6, 32px); }
.search-results h2 { margin: 0 0 var(--sp-3, 12px); }
.app-result { border-color: var(--accent-line, var(--line)); }
/* App results look like apps, not tools: logo beside the name, an "App" label, a solid Launch button. */
.app-result { background: color-mix(in srgb, var(--accent-tint) 45%, var(--surface)); }
.app-result h3 a { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.app-result h3 .app-logo { flex: none; width: 32px; height: 32px; border-radius: 8px; }
.app-result-badge { display: inline-block; margin-inline-end: 4px; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--accent-line); background: var(--surface); color: var(--accent-text); font-size: .78rem; font-weight: 700; }
.app-result-actions { margin: 10px 0 0; }
.app-result-actions .app-launch { position: relative; z-index: 1; min-height: 40px; padding: 8px 18px; }
/* /tools: a few cards per category, the rest behind "Show all" (pages.ts DIRECTORY_PREVIEW) */
.cat-more { margin-top: 12px; }
.cat-more > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--accent-line); border-radius: var(--r-pill); background: var(--surface); color: var(--accent-text); font-weight: 600; cursor: pointer; list-style: none; }
.cat-more > summary::-webkit-details-marker { display: none; }
.cat-more > summary::after { content: ""; width: .5em; height: .5em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.cat-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.cat-more > summary:hover { background: var(--accent-tint); }
.cat-more[open] > summary { margin-bottom: 12px; }

/* ================================================================== home: tools teaser + intro */
.home-body { padding-top: var(--sp-6); }
.home-tools { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--sp-5) var(--sp-7); align-items: center; padding: clamp(18px, 3vw, 32px); margin: 0 0 var(--sp-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
.home-tools h2 { margin: 0 0 .5em; font-size: var(--fs-xl); }
.home-tools p { margin: 0 0 .8em; color: var(--ink-2); }
.home-tools-text p:last-child { margin-bottom: 0; }
.home-stats { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(5.25rem, 1fr)); gap: 8px; }
.home-stats li { margin: 0; padding: 10px 12px; border-radius: var(--r-lg); background: var(--accent-tint); border: 1px solid var(--accent-line); display: grid; gap: 2px; }
.home-stats strong { font-size: var(--fs-xl); line-height: 1.1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.home-stats span { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.home-tools .home-tools-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.home-tools-actions .button-link { flex: 1 1 auto; justify-content: center; text-align: center; }
[dir="rtl"] .home-tools-actions [aria-hidden="true"] { display: inline-block; transform: scaleX(-1); }
.home-intro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--sp-5) var(--sp-7); padding: clamp(18px, 3vw, 32px); margin: 0 0 var(--sp-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
.home-intro.home-intro-single { grid-template-columns: minmax(0, 1fr); }
.home-intro h2 { margin: 0 0 .6em; font-size: var(--fs-xl); }
.home-intro p { margin: 0 0 .8em; color: var(--ink-2); }
.home-intro-text p:last-child, .home-start p:last-child { margin-bottom: 0; }
.home-start { padding-inline-start: var(--sp-6); border-inline-start: 1px solid var(--line); }
.home-start .start-posts { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; }
.home-start .start-posts li { margin: 0; }
.home-start .start-posts a { font-weight: 600; text-decoration: none; display: inline-block; padding-block: 2px; }
.home-start .start-posts a:hover { text-decoration: underline; }
.start-posts-h { font-size: var(--fs-md); margin: 0 0 4px; }
@media (max-width: 860px) {
  .home-tools, .home-intro { grid-template-columns: minmax(0, 1fr); }
  .home-start { padding-inline-start: 0; border-inline-start: 0; border-top: 1px solid var(--line); padding-top: var(--sp-5); }
}

/* ================================================================== tool directory (/tools) */
.crumbs ol { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; font-size: var(--fs-sm); }
.crumbs li { margin: 0; color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-inline: .5em; color: var(--muted); }
.crumbs a, .crumbs [aria-current] { display: inline-block; padding-block: 4px; }
.crumbs a { color: var(--accent-text); }
.hero-tools h1 { margin: 0 0 .3em; }
.hero-tools .lede { max-width: 46em; }
.search-status { margin: 10px 0 0; font-weight: 600; color: var(--ink-2); }
.search-reset { margin: 10px 0 0; }
.search-reset a { display: inline-block; padding-block: 4px; }
.tools-start { margin-top: var(--sp-5); }
.tools-start h2 { font-size: var(--fs-md); margin: 0 0 8px; }
.start-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.start-chips li { margin: 0; }
.start-chips a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.start-chips a:hover { border-color: var(--accent-line); color: var(--accent-text); text-decoration: underline; }

/* ================================================================== categories & directory */
.cat-icon { display: block; }
.cat-badge { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; color: var(--accent-text); background: var(--accent-tint-2); border: 1px solid var(--accent-line); }
.cat-head { display: flex; gap: 14px; align-items: flex-start; }
.cat-head > div { min-width: 0; }
.cat-head h1, .cat-head h2 { margin: 0; }
.cat-head p { margin: 4px 0 0; }
.hero-category .cat-badge { width: 56px; height: 56px; border-radius: 16px; }
.hero-category .cat-badge svg { width: 30px; height: 30px; }
.hero-category .cat-head p.muted { font-size: var(--fs-lg); color: var(--ink-2); }
.cat-link { font-weight: 600; color: var(--accent-text); padding-block: 4px; display: inline-block; }

.themes { margin-top: var(--sp-6); }
.themes > h2 { margin: 0 0 var(--sp-2); }
.group-h { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: var(--sp-5) 0 var(--sp-2); font-weight: 700; }
.theme-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: 10px; }
.theme-grid > li { margin: 0; }
.theme a { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1); transition: transform .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease); }
.theme a:hover { transform: translateY(-1px); border-color: var(--accent-line); box-shadow: var(--shadow-2); color: var(--ink); }
.theme .cat-badge { grid-row: 1 / span 2; }
.theme strong { font-size: .96rem; line-height: 1.25; }
.small-themes .theme a { grid-template-rows: auto; }
.small-themes .theme .cat-badge { grid-row: auto; width: 36px; height: 36px; border-radius: 10px; }
.small-themes .theme a { grid-template-columns: 36px minmax(0, 1fr); padding: 10px 12px; }

.cat-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: var(--sp-5) 0; }
.cat-nav li { margin: 0; }
.cat-nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 500; }
.cat-nav a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-solid); flex: none; }
.cat-nav a:hover { border-color: var(--accent-line); color: var(--ink); background: var(--accent-tint); }
.group { margin-top: var(--sp-7); }
.group-label { margin: 0 0 var(--sp-2); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.category { margin-top: var(--sp-6); }
.category .cat-head { margin-bottom: 14px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.cards > li { margin: 0; }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; transition: transform .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease); }
/* No accent stripe on cards (design system: flat card, line border, 2px lift on hover). */
.card::before { content: none; }
.card:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.card h2, .card h3 { margin: 2px 0 6px; font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* the whole card is the link target */
.card h2 a:hover, .card h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.card:has(h2 a:focus-visible, h3 a:focus-visible) { outline: 3px solid var(--focus-color); outline-offset: 2px; }
.card h2 a:focus-visible, .card h3 a:focus-visible { outline: none; text-decoration: underline; }
.card p { margin: 0 0 6px; color: var(--ink-2); font-size: .94rem; }
.card .card-meta { margin-top: auto; padding-top: 6px; font-size: var(--fs-xs); color: var(--muted); letter-spacing: .01em; }
.card[hidden] { display: none; }
.wf-step { border-top: 1px solid var(--line); margin-top: var(--sp-5); padding-top: var(--sp-2); }

/* ================================================================== tool page */
/* w42-tooltpl: the tool template on the design system (docs/DESIGN_SYSTEM.md "Tool pages"). Inside the tool page every
   action, link and tint is the system teal; the category colour (--cat, read from [data-cat] on <html>) only marks the
   category dot and small data marks. Hierarchy: H1 → lede → one flat form card → examples → context; result pages:
   H1 → the answer block → files/tables/charts → assumptions → JSON → change inputs → guide. */
.tool-hero, .tool-info, .tool-guide-wrap, .wrap[data-tool-id] {
  --cat: var(--accent);
  --accent-text: var(--primary-text); --accent-solid: var(--primary); --accent-hover: color-mix(in srgb, var(--primary) 86%, var(--ink));
  --accent-tint: var(--info-bg); --accent-tint-2: var(--info-bg); --accent-line: var(--info-line);
}
.tool-hero { background: none; padding: clamp(20px, 3vw, 40px) 0 var(--sp-6); }
.tool-hero h1 { margin: 0 0 var(--sp-2); }
.tool-hero .lede { max-width: 62ch; margin-bottom: var(--sp-5); color: var(--ink-2); }
.tool-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.6vw, 32px); box-shadow: none; }
/* short fields (numbers, selects, dates, single-line text) pair up on wide forms; everything else spans the full row */
.tool-form > :not(.field-number, .field-integer, .field-select, .field-date, .field-time, .field-datetime, .field-text, .field-url, .field-boolean) { grid-column: 1 / -1; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend, .table-field > legend { font-weight: 600; color: var(--ink); padding: 0; }
.field input:not([type=checkbox], [type=radio], [type=file]), .field select, .field textarea { width: 100%; min-width: 0; }
.field .hint, .field label { overflow-wrap: anywhere; }
.field .hint { margin: 0; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit input { flex: 1; min-width: 0; }
.unit { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.req { color: var(--muted); font-weight: 400; font-size: .85rem; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check, .bool { display: inline-flex; align-items: center; gap: 10px; font-weight: 400; min-height: 44px; }
.bool label { font-weight: 600; }
.field-boolean { align-self: center; }
.table-field { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; background: var(--surface-2); }
.table-field > legend { padding-inline: 6px; }
.table-field .table-wrap { background: var(--surface); }
.input-table td, .input-table th { padding: 4px; border-bottom: 0; }
.input-table tbody tr:nth-child(even) { background: none; }
.input-table input, .input-table select { min-height: 38px; padding: 6px 8px; min-width: 76px; width: 100%; }
.input-table thead th { font-size: .82rem; background: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: var(--sp-2); }
.actions button[type=submit] { min-width: 11rem; min-height: 48px; }
.error-summary { border: 1.5px solid var(--danger); border-radius: var(--r-md); padding: 10px 16px; background: var(--danger-bg); }
.error-summary h2 { font-size: 1.05rem; margin: 4px 0; color: var(--danger); }
.error-summary a { color: var(--danger); font-weight: 600; }
.examples { margin: var(--sp-4) 0 0; color: var(--ink-2); max-width: 75ch; }
.examples a { padding-block: 4px; }
/* Example buttons look like the links they replaced (src/platform/pages.ts: a GET form keeps crawlers off /tool?…). */
.examples button.example-link { display: inline-block; min-height: 0; margin: 0; padding: 4px 0; border: 0; border-radius: 0; background: none; color: var(--accent-text); font: inherit; font-weight: inherit; line-height: inherit; text-align: start; text-decoration: underline; text-decoration-thickness: from-font; text-underline-offset: .18em; cursor: pointer; box-shadow: none; transform: none; width: auto; }
.examples button.example-link:hover { background: none; color: var(--ink); }
.tool-more { margin: 4px 0 0; }
.tool-more a { display: inline-block; padding-block: 4px; }
/* "More options": optional fields of long forms, collapsed by default (no JS), right before the submit button */
.more-options { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; }
.more-options > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 2px; cursor: pointer; font-weight: 700; color: var(--primary-text); list-style: none; }
.more-options > summary::-webkit-details-marker { display: none; }
.more-options > summary::before { content: ""; width: .55em; height: .55em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; flex: none; }
[dir=rtl] .more-options > summary::before { transform: rotate(135deg); }
.more-options[open] > summary::before { transform: rotate(45deg); }
.more-options > summary:hover { text-decoration: underline; }
.more-options > summary:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 2px; border-radius: var(--r-sm); }
.more-options-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px 22px; padding-top: 12px; }
.more-options-body > :not(.field-number, .field-integer, .field-select, .field-date, .field-time, .field-datetime, .field-text, .field-url, .field-boolean) { grid-column: 1 / -1; }
@media (prefers-reduced-motion: reduce) { .more-options > summary::before { transition: none; } }
/* Phones: H1 + one-line tagline + the form's first fields and button in the first screen */
@media (max-width: 640px) {
  .tool-hero { padding-top: 12px; padding-bottom: var(--sp-5); }
  .tool-hero .eyebrow { margin-bottom: 4px; }
  .tool-hero h1 { font-size: clamp(1.45rem, 1.1rem + 2.2vw, 1.75rem); margin: 0 0 4px; }
  .tool-hero .lede { font-size: 1rem; line-height: 1.4; margin-bottom: 12px; }
  .tool-form { gap: 14px; padding: 14px; }
  .tool-form .hint { font-size: .84rem; line-height: 1.35; }
  .tool-form textarea { max-height: 11em; } /* tall rows=… boxes keep the button in view; the text scrolls inside */
  .actions button[type=submit] { width: 100%; }
}

.tool-info { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--sp-6) var(--sp-7); margin-top: var(--sp-6); }
.tool-how > h2:first-child { margin-top: 0; }
.tool-how { color: var(--ink-2); }
.tool-how > p, .tool-how li { max-width: 70ch; }
.tool-how li + li { margin-top: .45em; }
.tool-aside { display: grid; gap: var(--sp-4); align-content: start; }
.tool-aside > section { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tool-aside > section > h2 { margin: 0 0 8px; font-size: var(--fs-lg); }
.tool-aside > section ul { margin: 0; padding-inline-start: 1.1em; }
.tool-aside > section li { color: var(--ink-2); }
.tool-aside > section li + li { margin-top: .5em; }
.tool-info:not(:has(.tool-aside > *)) { grid-template-columns: minmax(0, 1fr); }
.tool-info:not(:has(.tool-aside > *)) > .tool-how { max-width: calc(var(--measure) + 80px); }
.tool-info:not(:has(.tool-aside > *)) > .tool-aside { display: none; }
@media (max-width: 860px) { .tool-info { grid-template-columns: minmax(0, 1fr); } }

/* "For scripts and AI agents" + machine-readable result */
.machine { margin-top: var(--sp-5); padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.tool-aside > .machine { background: var(--surface-2); margin: 0; }
/* "Use this tool in an app" / "Part of <App>" (pages.ts toolAppsBlock): apps whose toolIds list the tool. */
/* "Use this tool in an app": a tinted card with a full accent border (no side stripe). */
.tool-aside > section.tool-apps { background: var(--surface); border-color: var(--line); }
.tool-aside > section.tool-apps ul.tool-apps-list, .tool-apps-list { list-style: none; padding: 0; margin: 0; }
.tool-apps-list > li + li { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tool-apps-list p { margin: 0 0 4px; }
.tool-apps-name a { font-weight: 700; }
.tool-apps-actions { margin-top: 8px !important; }
.tool-apps-open { white-space: normal; text-align: start; padding-block: 8px; }
.tool-apps-result { margin: 24px 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tool-apps-result > h2 { margin: 0 0 8px; font-size: var(--fs-lg); }

.machine h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fs-lg); }
.machine h2::before { content: "{ }"; display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 5px; border-radius: var(--r-sm); background: var(--code-bg); color: var(--code-ink); font: 700 .72rem/1 var(--font-mono); }
.machine ul { margin: 0 0 8px; padding-inline-start: 1.1em; font-size: .92rem; }
.machine li + li { margin-top: .45em; }
.machine code { background: var(--surface); }
.machine details { margin-top: 8px; }
.machine summary { font-weight: 600; padding-block: 4px; }
.machine pre { margin: 8px 0 0; }

/* ================================================================== results */
.tool-result .result-head { padding-top: var(--sp-5); }
/* The answer is the page's strongest block: teal tint, display type one step under the H2. */
.result .verdict { padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-lg); background: var(--info-bg); border: 1px solid var(--info-line); }
.result .verdict-text { max-width: 62ch; font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem); font-weight: 500; line-height: 1.32; letter-spacing: -.01em; color: var(--ink); }
.block { margin: var(--sp-5) 0; min-width: 0; }
.block > h2 { font-size: var(--fs-xl); margin: 0 0 12px; }
.block > p, .block > ul, .block > ol { max-width: 75ch; }
.block > h3, .checklist h3 { font-size: var(--fs-lg); margin: 16px 0 6px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; margin: 0; }
.metric { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; background: var(--surface); min-width: 0; }
.metric dt { font-size: var(--fs-sm); color: var(--muted); }
.metric dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.32rem; font-weight: 600; letter-spacing: -.01em; word-break: break-word; font-variant-numeric: tabular-nums; color: var(--ink); }
.metric.emphasis { border-color: var(--info-line); background: var(--info-bg); }
.checklist ul { list-style: none; padding-inline-start: 0; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
.due { font-size: .82rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1px 6px; }
.bars .bar-cell { width: 45%; }
.bars svg { width: 100%; height: 14px; display: block; }
.bars rect.pos { fill: var(--cat, var(--accent-solid)); }
.bars rect.neg { fill: var(--danger); }
.graph-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); padding: .5rem; }
svg.graph { min-width: 100%; height: auto; font: 12px/1.2 var(--font-sans); }
.graph-node rect { fill: var(--surface); stroke: var(--accent-solid); stroke-width: 1.5; }
.graph-node text { fill: var(--ink); }
.graph-node .graph-kind { fill: var(--muted); font-size: 10px; }
.graph-edge { stroke: var(--control); stroke-width: 1.4; }
.graph-arrow { fill: var(--control); }
ol.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 3px solid var(--accent-line); }
ol.timeline li { position: relative; padding-block: .4rem .9rem; padding-inline-start: 1.25rem; display: grid; gap: .15rem; margin: 0; }
ol.timeline li::before { content: ""; position: absolute; inset-inline-start: -.6rem; top: .7rem; width: .85rem; height: .85rem; border-radius: 50%; background: var(--accent-solid); border: 2px solid var(--canvas); }
ol.timeline li.tl-good::before { background: var(--success); }
ol.timeline li.tl-warning::before { background: var(--warning); }
ol.timeline li.tl-bad::before { background: var(--danger); }
ol.timeline time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.image-block img { max-width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); }
.artifact-block { margin: 1rem 0; }
.artifact-block .artifact-preview { display: block; max-width: 100%; height: auto; margin: 0 0 .7rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.artifact-block audio.artifact-preview { width: 100%; border: 0; background: none; }
.artifact-block figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; overflow-wrap: anywhere; }
/* Tool charts are self-contained SVG images (also downloadable) with their own light background: in both themes they
   sit on a light "paper" so their internal colours keep their contrast. */
.svg-block { margin: 1rem 0; }
.svg-block svg { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--r-md); }
.svg-block > svg { background: #fff; border: 1px solid var(--line); }
:root[data-theme="dark"] .svg-block > svg { filter: brightness(.9); } /* less glare; contrast inside the image is kept */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .svg-block > svg { filter: brightness(.9); } }
.svg-block figcaption { margin-top: .5rem; }
.local-result { min-width: 0; }

/* ================================================================== tool guide (below "How it works") */
.tool-guide-wrap { margin-top: var(--sp-7); }
.wrap.narrow.tool-guide-wrap { max-width: var(--wrap); }
.tool-guide-wrap > * { max-width: calc(var(--measure) + 80px); }
.tool-guide { padding: var(--sp-7) 0 0; margin: var(--sp-7) 0 var(--sp-6); background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; overflow-wrap: anywhere; }
.tool-result ~ .tool-guide, .wrap > .tool-guide { max-width: calc(var(--measure) + 80px); }
.tool-guide > h2 { margin-top: 0; font-size: var(--fs-2xl); }
.tool-guide .lede { font-size: var(--fs-lg); }
.guide-body { font-size: 1.03rem; line-height: 1.7; color: var(--ink-2); }
.guide-body h3 { margin: 2em 0 .55em; padding-top: 1.1em; border-top: 1px solid var(--line); font-size: var(--fs-xl); color: var(--ink); }
.guide-body h3:first-child { margin-top: .6em; padding-top: 0; border-top: 0; }
.guide-body h4 { margin: 1.5em 0 .35em; font-size: 1.04rem; color: var(--ink); }
.guide-body h4 + p { margin-top: 0; }
.guide-body strong { color: var(--ink); }
.guide-body li + li { margin-top: .4em; }
.guide-body table { font-size: .93rem; line-height: 1.5; }
.tool-guide .guide-updated { margin: 1.6em 0 0; }

/* ================================================================== reading pages (w42-content; docs/DESIGN_SYSTEM.md "Reading pages")
   Docs, blog, changelog, guides, tutorials, site and legal pages, account and error pages. The page stands on the
   header's left line (the full .wrap; .narrow no longer centres a thin column): headings and running text are held to
   --read (about 68 characters), tables, code, figures and forms to --read-wide, and a contents list (.read-toc,
   .blog-toc) floats into the free space at the inline end from 1100 px. Margins collapse as before (no grid on prose). */
.wrap.narrow { max-width: var(--wrap); }
main > .wrap.narrow, .wrap.narrow.prose { padding-top: var(--sp-7); padding-bottom: var(--sp-8); }
main > .wrap:first-child > h1:first-child { margin-top: var(--sp-6); }
.prose { color: var(--ink-2); line-height: 1.7; display: flow-root; }
@media (min-width: 900px) { .prose { font-size: 1.0625rem; } .prose :where(.small, small) { font-size: var(--fs-sm); } }
.prose :where(h1, h2, h3, h4, p, ul, ol, dl, blockquote, details, hr, address, .callout) { max-width: var(--read); }
.prose :where(pre, table, .table-wrap, figure, form, .legal-address, .blog-cta, .fb-callout) { max-width: var(--read-wide); }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); }
.prose > h1:first-child, .prose > :first-child > h1:first-child { margin-top: 0; }
.prose h1 { max-width: 22em; }
.prose :where(h2, h3, h4) { max-width: 40rem; }
.prose h2 { margin: 2em 0 .55em; }
.prose h3 { margin: 1.7em 0 .45em; }
.prose h1 + .lede, .prose .lede { font-size: var(--fs-lg); line-height: 1.6; color: var(--ink-2); max-width: var(--read); }
.prose li + li { margin-top: .4em; }
.prose pre { line-height: 1.55; }
.prose figure { margin: var(--sp-6) 0; }
.prose figure img { display: block; border-radius: var(--r-lg); border: 1px solid var(--line); }
.prose figcaption { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
/* quotes: set larger in the display face, no side stripe (design system: no side-stripe borders) */
.prose blockquote { margin: 1.6em 0; padding: 0; border: 0; font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.5; color: var(--ink); }
.prose blockquote > :last-child { margin-bottom: 0; }
/* the "Contents" list: a quiet panel in the text column on phones; in the free inline-end space from 1100 px */
.read-toc, .blog-toc { margin: var(--sp-5) 0 var(--sp-6); padding: var(--sp-4) var(--sp-5); max-width: var(--read); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); font-size: var(--fs-sm); line-height: 1.45; }
.read-toc p, .blog-toc p { margin: 0 0 var(--sp-2); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md); }
.read-toc ol, .blog-toc ol { margin: 0; padding-inline-start: 1.25rem; }
.read-toc li + li, .blog-toc li + li { margin-top: 0; }
.read-toc a, .blog-toc a { display: block; padding-block: 4px; color: var(--ink-2); text-decoration-color: var(--line-strong); }
.read-toc a:hover, .blog-toc a:hover { color: var(--primary-text); text-decoration-color: currentColor; }
@media (min-width: 1100px) {
  .read-toc, .blog-toc { float: inline-end; clear: inline-end; width: var(--aside); margin: var(--sp-2) 0 var(--sp-6) var(--sp-7); }
}
@media print { .read-toc, .blog-toc { display: none; } .wrap.narrow, .prose :where(*) { max-width: none; } }

/* blog index: one card per post (cover on top, flush), three across from 900 px */
.blog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--sp-5); margin: var(--sp-7) 0 var(--sp-6); }
.blog-card.card { padding: 0; overflow: hidden; }
.blog-card-cover { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.blog-card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.blog-card:hover .blog-card-cover img { transform: scale(1.025); }
.blog-card-body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-5); }
.card.blog-card h2 { order: 0; margin: 0 0 var(--sp-2); font-size: var(--fs-xl); line-height: 1.25; letter-spacing: -.015em; }
.blog-card p { margin: 0 0 var(--sp-3); font-size: var(--fs-md); line-height: 1.6; color: var(--ink-2); }
/* the newest post leads: picture and words side by side across the row from 900 px */
@media (min-width: 900px) {
  .blog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-list > .blog-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .blog-list > .blog-card:first-child .blog-card-cover { aspect-ratio: auto; height: 100%; min-height: 320px; border-bottom: 0; border-inline-end: 1px solid var(--line); }
  .blog-list > .blog-card:first-child .blog-card-body { padding: var(--sp-7) var(--sp-6); justify-content: center; }
  .blog-list > .blog-card:first-child h2 { font-size: var(--fs-2xl); }
  .blog-list > .blog-card:first-child .blog-card-meta { margin-top: var(--sp-4); }
}
@media (min-width: 1200px) { .blog-list:has(> .blog-card:nth-child(4)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.blog-card .blog-card-meta { order: 1; margin: auto 0 0; padding-top: var(--sp-3); font-size: var(--fs-sm); color: var(--muted); }
.blog-card .blog-card-meta a { position: relative; z-index: 1; } /* the tool link stays clickable above the card link */
.blog-feed { margin: 0; }

/* blog post (and app tutorials, which reuse .blog-post): title block and picture across the page, text in the column */
.blog-post { display: flow-root; }
.blog-post > .small:first-child { margin: 0 0 var(--sp-5); }
.blog-post h1 { margin: 0 0 var(--sp-3); font-size: var(--fs-3xl); max-width: 20em; }
.blog-post > h1 + .small { margin-bottom: var(--sp-5); }
.blog-cover, .blog-hero-figure { margin: 0 0 var(--sp-6); max-width: none; }
.blog-cover img, .blog-hero, .blog-hero-img { display: block; width: 100%; height: auto; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); }
.blog-post > .lede { font-size: clamp(1.125rem, 1rem + .4vw, 1.3rem); line-height: 1.55; color: var(--ink); }
.blog-content { font-size: 1.0625rem; line-height: 1.72; }
.blog-content > * { max-width: var(--read); }
.blog-content > :is(figure, pre, .table-wrap, table) { max-width: var(--read-wide); }
.blog-content h2 { margin-top: 2.2em; font-size: var(--fs-2xl); }
.blog-content img, .blog-img { display: block; width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.blog-figure { margin: var(--sp-6) 0; }
.blog-hero-figure figcaption, .blog-figure figcaption { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); }
.blog-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5); clear: both; margin: var(--sp-7) 0 0; padding: var(--sp-5) var(--sp-5); border-radius: var(--r-lg); }
.blog-cta p { margin: 0; }

/* Changelog (/changelog): one release per row; date and version in a rail at the inline start from 900 px */
.changelog .fb-callout-bottom { margin-top: var(--sp-7); }
.cl-feed { margin: 0 0 var(--sp-6); }
.cl-release { padding: var(--sp-6) 0; border-top: 1px solid var(--line); }
.cl-release > h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-xl); line-height: 1.25; }
.cl-meta { margin: 0 0 var(--sp-3); }
.cl-meta > * { white-space: nowrap; }
.cl-body h3 { font-size: var(--fs-md); margin: var(--sp-4) 0 var(--sp-1); color: var(--ink); }
.cl-body { line-height: 1.6; }
.cl-body ul { margin: 0; }
.cl-body li { margin-bottom: .3rem; }
@media (min-width: 900px) {
  .cl-release { display: grid; grid-template-columns: 12rem minmax(0, var(--read)); column-gap: var(--sp-7); align-items: start; }
  .cl-release > * { grid-column: 2; }
  .cl-release > .cl-meta { grid-column: 1; grid-row: 1 / span 2; margin: .3rem 0 0; display: grid; gap: var(--sp-1); }
  .cl-meta .cl-sep { display: none; }
}
.cl-badge { display: inline-block; margin-inline-end: .3em; padding: 0 .5em; border-radius: var(--r-pill); background: var(--success-bg); border: 1px solid var(--success-line); color: var(--ink); font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; white-space: nowrap; }

/* site pages (about / contact / accessibility) + legal */
.site-page ul { padding-inline-start: 1.3em; }
.page-art { margin: var(--sp-5) 0 var(--sp-6); max-width: var(--read-wide); }
.page-art img { border-radius: var(--r-xl); border: 1px solid var(--line); }
.legal-section h3 { font-size: var(--fs-lg); margin: 1.4rem 0 .4rem; }
.legal-address { font-style: normal; line-height: 1.6; padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); margin: var(--sp-2) 0 var(--sp-4); }

/* credits: the tables use the whole page width */
.credits-page, .credits-page :where(.table-wrap, table) { max-width: none; }
.credits-group { margin-top: var(--sp-7); }
.credits-table { font-size: var(--fs-sm); }
.credits-table th, .credits-table td { vertical-align: top; text-align: start; }
.credits-table tbody th { white-space: normal; min-width: 9rem; }

/* 404 and other error pages: the message on the left line, the picture beside it */
.not-found { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-7); align-items: center; padding-block: var(--sp-6); min-height: min(60vh, 560px); }
.not-found.has-art { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.not-found-code { margin: 0; font-family: var(--font-display); font-size: var(--fs-display); font-weight: var(--display-weight); line-height: 1; letter-spacing: var(--display-tracking); color: var(--primary-text); }
.prose .not-found h1 { margin: var(--sp-3) 0 var(--sp-4); }
.not-found-links { list-style: none; padding: 0; margin: var(--sp-6) 0 0; display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.not-found-links li, .prose .not-found-links li + li { margin: 0; }
.not-found-art img { border-radius: var(--r-xl); }
@media (max-width: 640px) {
  .not-found, .not-found.has-art { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: var(--sp-6); }
  .not-found-art { max-width: 260px; }
  .not-found-links .btn { width: 100%; }
  .not-found-links li { flex: 1 1 100%; }
}

/* ================================================================== feedback */
.fb-fab { position: fixed; z-index: 40; inset-inline-end: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-accent); font-weight: 700; text-decoration: none; box-shadow: var(--shadow-3); border: 2px solid var(--surface); line-height: 1.1; }
.fb-fab:hover { color: var(--on-accent); text-decoration: underline; filter: brightness(1.06); }
.fb-fab:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 3px; }
.fb-fab svg { flex: none; }
.fb-fab-sub { font-weight: 500; }
@media (max-width: 760px) { .fb-fab-sub { display: none; } }
@media (max-width: 600px) {
  .fb-fab { padding: 8px 14px; gap: 6px; font-size: .9rem; inset-inline-end: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
  .fb-fab svg { width: 18px; height: 18px; }
}
@media (max-width: 360px) {
  .fb-fab .fb-fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fb-fab { padding: 10px; }
}
.feedback-page { padding-bottom: var(--sp-8); }
.feedback-page > * { max-width: var(--read-wide); }
.feedback-page > h1:first-child { margin-top: 0; }
.feedback-page .fb-form { display: grid; gap: 20px; margin-top: var(--sp-6); padding: var(--sp-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
@media (max-width: 560px) { .feedback-page .fb-form { padding: var(--sp-4); } }
.fb-form input[type=email] { width: 100%; }
.fb-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.fb-radio { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; font-weight: 500; background: var(--surface); }
.fb-radio:hover { border-color: var(--accent-line); }
.fb-radio:has(input:checked) { border-color: var(--accent-text); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent-text); }
.fb-radio:has(input:focus-visible) { outline: 3px solid var(--focus-color); outline-offset: 2px; }
.fb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.fb-privacy { padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); }
.fb-privacy h2 { font-size: 1rem; margin: 2px 0 4px; }
.fb-hp { position: absolute !important; inset-inline-start: 0; top: auto; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fb-count { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }

/* feedback invitation on tool listings */
.fb-callout { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin: var(--sp-6) 0; padding: 14px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.fb-callout-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--info-bg); color: var(--primary-text); border: 1px solid var(--info-line); }
.fb-callout-text { flex: 1 1 200px; min-width: 0; } /* 200px: on phones the icon stays beside the heading, not stacked above it */
.fb-callout h2 { font-size: 1.06rem; margin: 0 0 2px; color: var(--ink); }
.fb-callout p { margin: 0; }
.fb-callout-text p { color: var(--ink-2); font-size: .95rem; overflow-wrap: anywhere; }
.fb-callout-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-callout-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 18px; border-radius: var(--r-md); background: var(--primary); color: var(--on-accent); font-weight: 700; text-decoration: none; border: 1.5px solid var(--primary); line-height: 1.2; }
.fb-callout-btn:hover { color: var(--on-accent); text-decoration: underline; filter: brightness(1.06); }
.fb-callout-btn:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 3px; }
.fb-callout-btn-secondary { background: var(--surface); color: var(--primary-text); border-color: var(--info-line); }
.fb-callout-btn-secondary:hover { color: var(--primary-text); background: var(--info-bg); filter: none; }
.fb-callout-top { padding: 10px 14px; margin: var(--sp-5) 0; }
.fb-callout-top .fb-callout-icon { width: 36px; height: 36px; border-radius: 10px; }
.fb-callout-top h2 { font-size: 1rem; }
.fb-callout-top .fb-callout-text p { font-size: .9rem; }
.fb-callout-bottom { margin-top: var(--sp-7); padding: 22px 24px; background: var(--info-bg); border-color: var(--info-line); }
.fb-callout-bottom .fb-callout-icon { background: var(--surface); }
.fb-callout-bottom h2 { font-size: 1.25rem; }

/* ================================================================== ad slots (consent-gated; reserved space avoids layout shift) */
.uw-ad { position: relative; display: block; box-sizing: border-box; width: 100%; max-width: var(--wrap, 1160px); margin: 18px auto; padding-top: 18px; min-height: 120px; overflow: hidden; text-align: center; }
.uw-ad::before { content: attr(data-label); position: absolute; top: 0; left: 0; right: 0; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); line-height: 18px; }
.uw-ad-after_tool, .uw-ad-after_result, .uw-ad-content_bottom { min-height: 120px; }
.uw-ad-content_mid { min-height: 280px; }
.uw-ad-sidebar { min-height: 270px; max-width: 336px; }
@media (max-width: 720px) { .uw-ad-content_mid, .uw-ad-sidebar { min-height: 120px; } .uw-ad-sidebar { max-width: none; } }
.uw-ad ins.adsbygoogle { display: block; width: 100%; }
.uw-ad.uw-ad-off { display: none; }
.uw-ad-placeholder, .uw-ad[data-preview] { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line-strong); border-radius: var(--r-md); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface-3) 10px, var(--surface-3) 20px); color: var(--muted); font-size: .85rem; }

/* ================================================================== consent bar (public/consent.js)
 * NON-BLOCKING (docs/CONSENT_CMP_SETUP.md): a compact bar fixed to the bottom; the page stays usable (no backdrop, nothing
 * inert, no scroll lock) and keeps free space at the bottom (body padding + scroll-padding = bar height, --uw-cb-h).
 * Wide screens: text left, the three choices right (≈ 1/5 of a 768 px tall screen). Phones: bottom sheet ≤ 30 % of the
 * viewport — the text scrolls inside the sheet while Accept/Reject stay visible. Accept and Reject look identical. */
.uw-cb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000; display: flex; justify-content: center; padding: 0 12px 12px; pointer-events: none; }
.uw-cb-inner { pointer-events: auto; box-sizing: border-box; width: 100%; max-width: 1120px; max-height: 80vh; max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: 14px 18px; font-size: .92rem; line-height: 1.45; }
.uw-cb-title { font-size: 1.02rem; margin: 0 0 4px; color: var(--ink); }
.uw-cb-ptitle { font-size: 1rem; margin: 0 0 4px; color: var(--ink); }
.uw-cb-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; }
.uw-cb-text, .uw-cb-more, .uw-cb-intro { margin: 0 0 6px; overflow-wrap: anywhere; color: var(--ink-2); }
.uw-cb-copy .uw-cb-more { margin: 0; }
.uw-cb-link { font-weight: 600; color: var(--primary-text); display: inline-block; padding-block: 2px; }
.uw-cb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.uw-cb-main > .uw-cb-actions { flex-wrap: nowrap; }
.uw-cb-btn { flex: 1 1 auto; min-height: 44px; padding: 8px 16px; font: inherit; font-weight: 700; line-height: 1.2; border-radius: var(--r-md); border: 1.5px solid var(--primary); background: var(--primary); color: var(--on-accent); cursor: pointer; }
.uw-cb-main .uw-cb-btn { white-space: nowrap; }
.uw-cb-panel .uw-cb-btn { flex-basis: 10rem; }
.uw-cb-btn:hover { background: var(--primary-text); border-color: var(--primary-text); color: var(--on-accent); filter: brightness(.95); }
.uw-cb-btn-secondary { background: var(--surface); color: var(--primary-text); }
.uw-cb-btn-secondary:hover { background: var(--info-bg); color: var(--primary-text); filter: none; }
.uw-cb-btn:disabled { opacity: .6; cursor: progress; }
.uw-cb a:focus-visible, .uw-cb-btn:focus-visible, .uw-cb input:focus-visible, .uw-cb-title:focus-visible, .uw-cb-ptitle:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 2px; }
.uw-cb-title:focus:not(:focus-visible), .uw-cb-ptitle:focus:not(:focus-visible) { outline: none; }
.uw-cb [hidden] { display: none !important; }
.uw-cb-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.uw-cb-row input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); }
.uw-cb-label { font-weight: 700; cursor: pointer; }
.uw-cb-badge { grid-column: 2; font-size: .78rem; font-weight: 700; color: var(--success); }
.uw-cb-desc { grid-column: 2; margin: 0; color: var(--muted); font-size: .88rem; }
.uw-cb-panel .uw-cb-actions { margin-top: 10px; }
html.uw-cb-open body { padding-bottom: var(--uw-cb-h, 0px); }
/* The floating feedback button would sit under the bar; moving it up would be a layout shift (CLS). It steps aside while
 * the bar is open — the footer's feedback link stays. */
html.uw-cb-open .fb-fab { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .uw-cb-inner { animation: uw-cb-in .2s ease-out; }
  @keyframes uw-cb-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
/* Medium widths: buttons under the text, in one row. */
@media (max-width: 1099px) {
  .uw-cb-main { grid-template-columns: minmax(0, 1fr); }
  .uw-cb-main > .uw-cb-actions { flex-wrap: wrap; }
}
/* Wide screens: a card in the bottom inline-end corner. Tool forms, their submit button and the page's main column start
 * at the inline-start side, so the card never covers the primary action. */
@media (min-width: 1100px) {
  .uw-cb { left: auto; right: 0; justify-content: flex-end; padding: 0 16px 16px; }
  [dir=rtl] .uw-cb { right: auto; left: 0; }
  .uw-cb-inner { width: 500px; max-width: calc(100vw - 32px); }
  .uw-cb-main { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .uw-cb-main > .uw-cb-actions { flex-wrap: wrap; }
  .uw-cb-main .uw-cb-btn { padding-inline: 12px; }
  html.uw-cb-open body { padding-bottom: 0; }
  html.uw-cb-open .site-footer { padding-bottom: calc(var(--uw-cb-h, 0px) + 16px); }
}
/* Phones: bottom sheet, at most 30 % of the viewport while only the bar is shown (the options panel, opened by the
 * visitor, may use more). Text scrolls inside; Accept + Reject side by side (equal size), Manage below. */
@media (max-width: 640px) {
  .uw-cb { padding: 0; }
  .uw-cb-inner { border-radius: var(--r-lg) var(--r-lg) 0 0; border-inline-width: 0; border-bottom-width: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); font-size: .86rem; line-height: 1.38; max-height: 85vh; max-height: 85dvh; }
  .uw-cb-inner:has(> .uw-cb-main:not([hidden])) { max-height: 30vh; max-height: 30dvh; display: flex; flex-direction: column; overflow: hidden; }
  .uw-cb-title { font-size: .95rem; margin-bottom: 2px; flex: none; }
  .uw-cb-main { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
  .uw-cb-copy { min-height: 2.8em; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
  .uw-cb-text { margin-bottom: 2px; }
  .uw-cb-main > .uw-cb-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .uw-cb-main .uw-cb-btn { white-space: normal; min-height: 40px; padding: 6px 8px; font-size: .86rem; }
  .uw-cb-main .uw-cb-btn-secondary { grid-column: 1 / -1; min-height: 32px; padding-block: 4px; border-color: transparent; text-decoration: underline; }
  .uw-cb-panel .uw-cb-btn { flex-basis: 100%; }
}

/* ================================================================== accessibility helpers (WCAG 2.2 AA)
 * Reflow (1.4.10) + text spacing (1.4.12): long words (German compounds, URLs, e-mail addresses, API paths) wrap instead
 * of widening the page at 320 CSS px. Tables keep their own min-content layout (they scroll inside .table-wrap). */
main :is(h1, h2, h3, h4, p, li, dd, dt, figcaption, legend, label, summary, a, code):not(table *, pre *), .site-footer :is(p, a) { overflow-wrap: anywhere; }
@media (max-width: 480px) { :is(h1, h2, h3) { hyphens: auto; } }
.grid-2 > *, .block, .machine, .tool-hero .wrap, .fb-callout-text, .card { min-width: 0; }
.grid-2 p, .grid-2 li, .block p, .block li, .machine li, .callout { overflow-wrap: anywhere; }
details, .machine, .tool-form, fieldset { min-width: 0; max-width: 100%; }
.tool-form textarea, .tool-form input, .tool-form select { max-width: 100%; }
/* Scrollable tables/charts are keyboard-focusable regions (2.1.1); show where focus is. */
.table-wrap[tabindex]:focus-visible, .graph-wrap[tabindex]:focus-visible, pre[tabindex]:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 2px; }
/* Focus not obscured (2.4.11): keep focused fields clear of the fixed feedback button and the consent bar. */
html:has(.fb-fab) { scroll-padding-bottom: 88px; }
html.uw-cb-open { scroll-padding-bottom: calc(var(--uw-cb-h, 0px) + 16px); }
@media (max-width: 640px) { html { scroll-padding-top: 16px; } }
/* Target size (2.5.8): small inline-only links get a ≥ 24 px tall hit area without changing the line layout. */
.footer-links a, .eyebrow a, .examples a, .cat-link, .card-meta a, .themes > p > a, .app-showcase-more a, .blog > p.small > a { display: inline-block; padding-block: 4px; }
.themes > p { margin-top: var(--sp-4); }
@media (prefers-reduced-motion: reduce) { .theme a, .card { transition: none; transform: none !important; } }
@media (forced-colors: active) {
  .card::before, .eyebrow::before, .cat-nav a::before { forced-color-adjust: none; background: CanvasText; }
  .theme-pop button[data-theme-set][aria-current="true"] { outline: 2px solid Highlight; }
}

/* ================================================================== print */
@media print {
  :root { color-scheme: light; --canvas: #fff; --surface: #fff; --surface-2: #f4f4f5; --line: #ccc; --ink: #000; --ink-2: #111; --muted: #333; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header nav, .header-tools, .skip, .fb-fab, .fb-callout, .uw-ad, .uw-cb, .tool-form .actions, .check-another, .footer-links, .theme-switch, .hero-art, .tool-search { display: none !important; }
  .site-header, .site-footer { position: static; border: 0; background: none; }
  .hero-brand, .tool-hero { background: none; }
  .card, .theme a, .tool-guide, .tool-form, .metric, .machine, .home-intro, .tool-aside > section { box-shadow: none; break-inside: avoid; }
  pre { white-space: pre-wrap; max-height: none; background: #f4f4f5; color: #000; border-color: #ccc; }
  .table-wrap { overflow: visible; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #333; overflow-wrap: anywhere; }
  h1, h2, h3 { break-after: avoid; }
}

/* App utility results: keep wide data tables and generated media inside the viewport. */
.everyday-result { min-width: 0; max-width: 100%; }
.everyday-result > .table-wrap { max-width: 100%; }
.everyday-result :is(img, canvas, audio) { max-width: 100%; height: auto; }
.everyday-result pre { overflow: auto; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }

.everyday-toolbar { min-width: 0; max-width: 100%; }
.everyday-toolbar > label { display: grid; gap: .3rem; min-width: 0; max-width: 100%; }
.everyday-toolbar input[type=file] { min-width: 0; max-width: 100%; width: 100%; }

/* ---- Tool page template refinements (w41: docs/capability-expansion/implementation-log.md) ---- */
/* Mode-dependent fields (fields.ts showWhen) are hidden by platform.js with the hidden attribute. */
.tool-form [hidden] { display: none !important; }
/* Owning app and category: a quiet line under the form instead of an uppercase eyebrow above the H1. */
.tool-context { margin: 2px 0 0; color: var(--muted); }
.tool-context a { color: var(--accent-text); padding-block: 4px; }
/* the category's own colour, as a dot before its name (never colour alone: the name is the information) */
.tool-cat::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; background: var(--cat, var(--accent)); vertical-align: .1em; }
.tool-context .tool-owner { font-weight: 600; }
/* Result page: the main file right under the verdict (big preview, filled Download), the edit link next to the actions. */
.result-head h1 { overflow-wrap: anywhere; }
.artifact-block.artifact-primary { margin: 14px 0 6px; }
.artifact-block img.artifact-preview { width: auto; min-width: min(100%, 280px); max-width: min(100%, 720px); max-height: 70vh; object-fit: contain; }
.artifact-block figcaption .btn { white-space: normal; padding-block: 8px; }
.result-edit { margin: 10px 0 0; }
.result-edit a { display: inline-block; padding-block: 6px; font-weight: 600; }
.check-another { scroll-margin-top: 16px; }
/* Long tables: the first rows, then a disclosure with the rest. */
.long-table .table-wrap + .table-more { margin-top: -6px; }
.table-more > summary { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 2px; cursor: pointer; font-weight: 700; color: var(--primary-text); }
.table-more > summary:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 2px; border-radius: var(--r-sm); }
.block td.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Stat cards: two per row on phones (one card per row made 8 cards ~800 px tall). */
@media (max-width: 640px) { .metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); } }
/* Charts from src/tools/lib/chart-svg.ts follow the dark theme (attribute colours are overridden; the exported SVG
   file keeps its white background). Other drawings keep their white paper. */
:root[data-theme="dark"] .svg-chart > svg { background: var(--surface); filter: none; }
:root[data-theme="dark"] .svg-chart > svg rect[fill="#ffffff"] { fill: var(--surface); }
:root[data-theme="dark"] .svg-chart > svg [fill="#1f2937"], :root[data-theme="dark"] .svg-chart > svg [fill="#000000"] { fill: var(--ink); }
:root[data-theme="dark"] .svg-chart > svg [fill="#6b7280"] { fill: var(--muted); }
:root[data-theme="dark"] .svg-chart > svg [stroke="#1f2937"], :root[data-theme="dark"] .svg-chart > svg [stroke="#000000"] { stroke: var(--ink); }
:root[data-theme="dark"] .svg-chart > svg [stroke="#6b7280"] { stroke: var(--muted); }
:root[data-theme="dark"] .svg-chart > svg [stroke="#e5e7eb"] { stroke: var(--line); }
:root[data-theme="dark"] .svg-chart > svg [stroke="#ffffff"] { stroke: var(--surface); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .svg-chart > svg { background: var(--surface); filter: none; }
  :root:not([data-theme="light"]) .svg-chart > svg rect[fill="#ffffff"] { fill: var(--surface); }
  :root:not([data-theme="light"]) .svg-chart > svg [fill="#1f2937"], :root:not([data-theme="light"]) .svg-chart > svg [fill="#000000"] { fill: var(--ink); }
  :root:not([data-theme="light"]) .svg-chart > svg [fill="#6b7280"] { fill: var(--muted); }
  :root:not([data-theme="light"]) .svg-chart > svg [stroke="#1f2937"], :root:not([data-theme="light"]) .svg-chart > svg [stroke="#000000"] { stroke: var(--ink); }
  :root:not([data-theme="light"]) .svg-chart > svg [stroke="#6b7280"] { stroke: var(--muted); }
  :root:not([data-theme="light"]) .svg-chart > svg [stroke="#e5e7eb"] { stroke: var(--line); }
  :root:not([data-theme="light"]) .svg-chart > svg [stroke="#ffffff"] { stroke: var(--surface); }
}
/* Feedback pill: icon + "Feedback" only, category accent, and out of the way while the form or verdict is on screen. */
.fb-fab { background: var(--primary); color: var(--on-accent); }
.fb-fab:hover { color: var(--on-accent); }
.fb-fab .fb-fab-sub { display: none; }
.fb-fab { transition: opacity .2s ease-out, visibility .2s; }
.fb-fab.fb-fab-away { opacity: 0; visibility: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .fb-fab { transition: none; } }
/* No card inside a card: tables inside the form, the guide and the side cards lose their own frame. */
.tool-form .table-wrap, .tool-aside > section .table-wrap { border-inline: 0; border-radius: 0; background: transparent; }
.tool-form .table-field { border: 0; border-radius: 0; background: transparent; padding: 0; }
.tool-form .table-field > legend { padding-inline: 0; }
/* Notes that tool scripts put into the form read as plain lines with their icon, not a box inside the form card. */
.tool-form > .callout { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
/* Reading measure of the guide (≈70 characters per line). */
.guide-body p, .guide-body li, .tool-guide > .lede { max-width: 70ch; }
.tool-form .hint { max-width: 75ch; }
/* Feedback callout on phones: icon beside the heading, not stacked above it. */
.fb-callout-text { flex-basis: 200px; }

/* ---- w42-tooltpl: tool template on the design system (docs/DESIGN_SYSTEM.md "Tool pages") ---- */
/* File fields: the native input is the drop target (browsers accept a dropped file on it), drawn as a quiet dashed
   area with the system's secondary button inside; no script, no claim the page cannot keep. */
.tool-form .field-file input[type=file] { width: 100%; min-height: 104px; padding: 22px 20px; border: 1.5px dashed var(--control); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); cursor: pointer; transition: border-color .12s var(--ease), background-color .12s var(--ease); }
.tool-form .field-file input[type=file]:hover { border-color: var(--primary-text); background: var(--info-bg); }
.tool-form input[type=file]::file-selector-button { min-height: 44px; margin-inline-end: 14px; padding: 0 18px; border: 1.5px solid color-mix(in srgb, var(--ink) 35%, transparent); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; }
.tool-form input[type=file]::file-selector-button:hover { background: var(--surface-2); }
/* Result page: the main file's buttons and the side tables keep the page on the wrap's left line. */
.tool-result .result-head h1 { margin-bottom: var(--sp-4); }
.tool-result .share-bar { margin-top: var(--sp-4); }
.tool-result > .block:first-of-type { margin-top: var(--sp-6); }
.check-another { margin-top: var(--sp-7); padding-top: var(--sp-6); border-top: 1px solid var(--line); }
.check-another > h2 { margin-top: 0; }
.tool-send .btn, .tool-apps-result .btn { white-space: normal; padding-block: 8px; }
.tool-apps-result { background: var(--surface); }
@media (max-width: 640px) {
  .tool-hero { padding-top: 16px; }
  .tool-form .field-file input[type=file] { min-height: 88px; padding: 16px 14px; }
  .artifact-block.artifact-primary figcaption .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .tool-form .field-file input[type=file] { transition: none; } }
@media (forced-colors: active) {
  .tool-cat::before { forced-color-adjust: none; background: CanvasText; }
  .result .verdict, .tool-form, .metric { border-color: CanvasText; }
}
@media print { .tool-guide { border-top: 0; padding-top: 0; } .result .verdict { background: none; } }
