/* ToolsDodo: cyberpunk minimalist. Near-black base, 1px hairlines, sharp 2–4px corners with a clipped corner here and there,
   neon cyan accent with magenta second (acid yellow only for warnings), glow only on hover / focus.
   Chakra Petch headings over Inter; JetBrains Mono for code, numbers and small lowercase "// labels". Dark is the default;
   the light theme ([data-theme="light"]) keeps the same shapes on off-white. */
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch-500.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch-700.woff2") format("woff2"); font-weight: 650 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

/* Light theme (only when chosen) */
:root {
    --bg: #F2F4F7; --card: #FFFFFF; --card-2: #EBEFF3; --ink: #0A0E14; --ink-2: #47515E; --ink-3: #5E6874;
    --line: #D3D9E0; --line-2: #B3BCC7; --soft: #E8ECF0; --shade: rgba(10, 14, 20, .08);
    --brand: #00E0EF; --brand-2: #00C8D6; --brand-ink: #001417; --brand-soft: #DAF8FA; --brand-text: #006B74;
    --coral: #C4005E; --coral-soft: #FCE2EE; --warn: #8A7B00;
    --yellow: #F4F7A8; --green: #C2F5DA; --cyan: #C9F6F9; --pink: #FFD3E6; --red: #FFC2C9; --blue: #1B7FE0;
    --ok: #0F8A4C; --bad: #D1173D;
    --grid: rgba(10, 14, 20, .045); --edge: linear-gradient(90deg, transparent, #00C8D6 30%, #E0006B 70%, transparent);
    --glow: 0 0 0 1px var(--brand-2), 0 0 14px rgba(0, 200, 214, .28);
    --r: 3px; --r2: 4px; --cut: 10px;
    --sh-sm: 0 0 #0000;
    --sh: 0 0 #0000;
    --sh-lg: 0 18px 44px rgba(10, 14, 20, .16);
    --font: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
    --head: "Chakra Petch", "Inter", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --wide: 1200px; --nav-h: 64px;
    color-scheme: light;
}
/* Dark (the default: the head script sets data-theme="dark" unless the visitor picked light) */
:root:not([data-theme="light"]) {
    --bg: #07090C; --card: #0D1117; --card-2: #121821; --ink: #E6EDF3; --ink-2: #9AA7B4; --ink-3: #7D8996;
    --line: #1C2430; --line-2: #2C3846; --soft: #111821; --shade: rgba(0, 0, 0, .5);
    --brand: #00F0FF; --brand-2: #6AF6FF; --brand-ink: #001417; --brand-soft: #062A30; --brand-text: #00F0FF;
    --coral: #FF2E88; --coral-soft: #3A0F22; --warn: #F5FF3B;
    --yellow: #3A3D0A; --green: #0E3A29; --cyan: #073A40; --pink: #3D0F27; --red: #4A1420; --blue: #3DA9FF;
    --ok: #3DFF9A; --bad: #FF4D6D;
    --grid: rgba(0, 240, 255, .035); --edge: linear-gradient(90deg, transparent, rgba(0, 240, 255, .7) 30%, rgba(255, 46, 136, .7) 70%, transparent);
    --glow: 0 0 0 1px var(--brand), 0 0 18px rgba(0, 240, 255, .35);
    --sh-lg: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, .65);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.01em; }
/* Clipped top-right corner: .cut on any bordered box; the ::after draws the diagonal so the border stays whole */
.cut { position: relative; clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.cut::after { content: ""; position: absolute; top: 0; right: 0; width: var(--cut); height: var(--cut); pointer-events: none; background: linear-gradient(to top right, transparent calc(50% - 1px), var(--cut-line, var(--line)) calc(50% - .5px), var(--cut-line, var(--line)) calc(50% + .5px), transparent calc(50% + 1px)); }
.tag { font: 500 12px var(--mono); color: var(--ink-3); text-transform: lowercase; letter-spacing: 0; }
.tag::before { content: "// "; color: var(--brand-text); }
img, svg, canvas, video { max-width: 100%; }
.ic { flex: none; vertical-align: middle; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: var(--r); font-weight: 600; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--brand); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }

/* ---------- Frame: top bar, Tools menu, sub bar, footer ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--edge); opacity: .55; pointer-events: none; }
.nav-in { display: flex; align-items: center; gap: 10px; height: var(--nav-h); max-width: var(--wide); margin: 0 auto; padding: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 21px var(--head); letter-spacing: .01em; margin-right: 8px; }
.brand:hover .logo { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--brand) 60%, transparent)); }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r); background: none; color: var(--ink); font: 600 15px var(--head); letter-spacing: .02em; cursor: pointer; }
.nav-btn:hover { background: var(--card); border-color: var(--line-2); }
.nav-btn[aria-expanded="true"] { background: var(--card); border-color: var(--brand); color: var(--brand-text); }
.nav-btn .chev { color: var(--ink-3); transition: transform .15s; }
.nav-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-search { flex: 1; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px 0 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); color: var(--ink-3); font: 500 14.5px var(--font); cursor: text; text-align: left; transition: border-color .12s, box-shadow .12s; }
.nav-search .ic { color: var(--brand-text); }
.nav-search:hover { border-color: var(--brand); box-shadow: var(--glow); }
.nav-search span { flex: 1; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 11px; border-radius: var(--r); text-decoration: none; font: 600 15px var(--head); letter-spacing: .02em; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); background: var(--card); }
.nav-links a.on { color: var(--brand-text); box-shadow: inset 0 -2px var(--brand); border-radius: 0; }
.nav-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); color: var(--ink); cursor: pointer; flex: none; transition: border-color .12s, box-shadow .12s, color .12s; }
.nav-icon:hover { border-color: var(--brand); color: var(--brand-text); box-shadow: var(--glow); }
.menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line-2); box-shadow: var(--sh-lg); max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.menu-in { max-width: var(--wide); margin: 0 auto; padding: 18px 24px 14px; }
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.menu-grid a { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border: 1px solid transparent; border-radius: var(--r); text-decoration: none; transition: border-color .12s, background .12s; }
.menu-grid a:hover, .menu-grid a.on { background: var(--card); border-color: var(--line-2); box-shadow: inset 2px 0 var(--tile-c, var(--brand)); }
.menu-grid a:hover b, .menu-grid a.on b { color: var(--brand-text); }
.menu-grid a > span:not(.tile) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-grid b { font: 600 15.5px var(--head); letter-spacing: .01em; }
.menu-grid small { color: var(--ink-2); font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-grid em { font: normal 500 12px var(--mono); color: var(--ink-3); padding-top: 2px; }
.menu-grid .tile { width: 36px; height: 36px; }
.menu-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.menu-foot a { display: inline-flex; align-items: center; gap: 7px; font: 600 14.5px var(--head); letter-spacing: .02em; text-decoration: none; color: var(--brand-text); padding: 4px 0; }
.menu-foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.menu-foot .sp { flex: 1; }
.menu-foot .muted { display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--mono); }
.tile { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--tile) 45%, transparent); background: color-mix(in srgb, var(--tile) 14%, var(--card)); color: color-mix(in srgb, var(--tile) 55%, var(--ink)); flex: none; }
.content { flex: 1; width: 100%; max-width: var(--wide); margin: 0 auto; padding: 40px 24px 72px; }
.site-foot { position: relative; border-top: 1px solid var(--line); background: var(--bg); margin-top: auto; }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--edge); opacity: .35; }
.foot-in { display: grid; grid-template-columns: 1.3fr 1.6fr .8fr; gap: 40px; max-width: var(--wide); margin: 0 auto; padding: 40px 24px 26px; }
.foot-brand p { color: var(--ink-2); font-size: 14px; max-width: 30em; margin: 12px 0 0; }
.site-foot h2 { font: 500 12px var(--mono); color: var(--ink-3); margin: 4px 0 10px; text-transform: lowercase; letter-spacing: 0; }
.site-foot h2::before { content: "// "; color: var(--brand-text); }
.foot-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 18px; align-content: start; }
.foot-cats h2 { grid-column: 1 / -1; }
.foot-site { display: flex; flex-direction: column; gap: 6px; }
.site-foot nav a { text-decoration: none; color: var(--ink-2); font-size: 14px; }
.site-foot nav a:hover { color: var(--brand-text); }
.foot-line { display: flex; justify-content: space-between; gap: 16px; max-width: var(--wide); margin: 0 auto; padding: 14px 24px 22px; border-top: 1px solid var(--line); color: var(--ink-3); font: 500 12px var(--mono); }
.kbd { display: inline-block; font: 500 11px var(--mono); min-width: 20px; text-align: center; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--card-2); color: var(--ink-2); line-height: 1.5; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); margin-right: 6px; }
.badge-local.sm { padding: 1px 8px; font-size: 11px; margin-left: 8px; vertical-align: middle; }
:root[data-theme="light"] .when-dark { display: none; }
:root:not([data-theme="light"]) .when-light { display: none; }
.phone-only { display: none; }

/* ---------- Type and buttons ---------- */
.display { font-family: var(--head); font-weight: 700; letter-spacing: -.02em; line-height: 1.02; margin: 0; font-size: clamp(40px, 5.6vw, 64px); text-wrap: balance; }
.display .sub { font-size: .62em; letter-spacing: -.01em; color: var(--ink-2); }
.hero .display { font-size: clamp(38px, 4.6vw, 58px); }
.display.md { font-size: clamp(32px, 4vw, 46px); }
.display.sm { font-size: clamp(26px, 3vw, 32px); }
mark { background: none; color: var(--brand-text); padding: 0; }
.lead { font-size: 18px; max-width: 34em; color: var(--ink-2); margin: 18px 0; }
.lead b { color: var(--ink); font-weight: 600; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); color: var(--ink); font: 600 15px var(--head); letter-spacing: .02em; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, color .12s; }
.btn:hover { border-color: var(--brand); color: var(--brand-text); }
.btn:active, .btn.pressed { background: var(--soft); }
.btn.yellow { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.yellow:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-ink); box-shadow: var(--glow); }
.btn.sm { padding: 6px 11px; font-size: 13.5px; }
.btn.xs { padding: 3px 8px; font-size: 13px; gap: 5px; border-radius: 2px; }
.btn.ghost { box-shadow: none; border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--soft); border-color: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }

/* ---------- Home: terminal search hero ---------- */
.hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 0 10px; isolation: isolate; }
/* faint grid + scanlines behind the hero, fading out at the edges */
.hero::before { content: ""; position: absolute; z-index: -1; inset: -40px -24px -10px; pointer-events: none;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px), repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 4px);
    background-size: 40px 40px, 40px 40px, 100% 4px; background-position: center top;
    -webkit-mask-image: radial-gradient(ellipse 65% 75% at 50% 40%, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse 65% 75% at 50% 40%, #000 30%, transparent 80%); }
.hero-tag { margin: 0 0 18px; font-size: 12.5px; }
.hero .display { font-size: clamp(36px, 5vw, 60px); letter-spacing: -.02em; }
.hero .lead { margin: 16px auto 28px; }
.find-card { --cut: 16px; position: relative; width: min(100%, 720px); text-align: left; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r2); transition: border-color .15s, background .15s; }
.find-card:focus-within { border-color: var(--brand); --cut-line: var(--brand); }
.find-row { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 64px; color: var(--ink-3); }
.prompt { font: 700 22px var(--mono); color: var(--brand-text); flex: none; }
.find-field { position: relative; flex: 1; min-width: 0; display: flex; }
.find-row input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font: 500 18px var(--mono); caret-color: var(--brand); }
.find-row input::-webkit-search-cancel-button { cursor: pointer; }
.find-ghost { position: absolute; inset: 0; display: none; align-items: center; gap: 2px; pointer-events: none; font: 500 18px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.find-row input:placeholder-shown + .find-ghost { display: flex; }
.ghost-text { overflow: hidden; text-overflow: ellipsis; }
.caret { flex: none; display: inline-block; width: .6em; height: 1.1em; background: var(--brand); animation: blink 1.1s steps(1) infinite; }
.find-row input:focus + .find-ghost .caret { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.find-list { border-top: 1px solid var(--line); padding: 6px; max-height: 420px; overflow-y: auto; }
.find-list a[data-i] { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); border-left: 2px solid transparent; text-decoration: none; }
.find-list a[data-i] > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.find-list a[data-i] .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-list a.sel { background: var(--soft); border-left-color: var(--brand); }
.find-list a.sel b { color: var(--brand-text); }
.find-list .tile { width: 34px; height: 34px; }
.find-list .all { display: block; padding: 9px 10px 5px; font: 500 13px var(--mono); color: var(--brand-text); text-decoration: none; }
.find-list .all::before { content: "> "; }
.find-list .none { margin: 0; padding: 12px 10px; color: var(--ink-2); }
.find-list .none a { color: var(--brand-text); }
/* drop zone: a dashed scan frame with corner brackets */
.find-drop { --fc: color-mix(in srgb, var(--brand) 70%, transparent); display: flex; align-items: center; gap: 14px; margin: 0 10px 10px; padding: 16px 18px; border: 1px dashed var(--line-2); border-radius: 2px; background-color: var(--card-2);
    background-image: linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc));
    background-repeat: no-repeat; background-size: 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px;
    background-position: left 3px top 3px, left 3px top 3px, right 3px top 3px, right 3px top 3px, left 3px bottom 3px, left 3px bottom 3px, right 3px bottom 3px, right 3px bottom 3px;
    transition: background-color .15s, border-color .15s; }
.find-drop p { flex: 1; margin: 0; font-size: 14.5px; line-height: 1.45; }
.fd-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); border-radius: var(--r); background: var(--brand-soft); color: var(--brand-text); flex: none; }
.find-card.over { border-color: var(--brand); --cut-line: var(--brand); }
.find-card.over .find-drop { --fc: var(--brand); border-color: var(--brand); background-color: var(--brand-soft); }
.drop-result { margin: 0 10px 10px; padding: 12px 14px; border: 1px solid var(--line); border-left: 2px solid var(--brand); border-radius: 2px; background: var(--card); }
.drop-result p { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 600; }
.drop-result p .btn { margin-left: auto; }
.drop-result .links { display: flex; flex-wrap: wrap; gap: 6px; }
.drop-result a { font-weight: 600; font-size: 13.5px; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: var(--r); text-decoration: none; background: var(--card); }
.drop-result a:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.try { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; margin: 20px 0 0; font-size: 14px; }
.try .tag { margin-right: 4px; }
.try a { color: var(--ink-2); font-weight: 600; text-decoration: none; padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); transition: border-color .12s, color .12s; }
.try a:hover { color: var(--brand-text); border-color: var(--brand); }

.block { margin-top: 56px; }
.block.tight { margin-top: 26px; }
.label { display: flex; align-items: center; gap: 10px; font: 700 21px var(--head); letter-spacing: -.01em; color: var(--ink); margin: 0 0 16px; }
.label::before { content: "//"; font: 500 15px var(--mono); color: var(--brand-text); }
.browse-cat .label::before { content: none; }
.label .code { font: 500 12px var(--mono); color: var(--ink-3); }
.label a { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font: 500 13px var(--mono); letter-spacing: 0; color: var(--brand-text); text-decoration: none; }
.label a:hover { text-decoration: underline; text-underline-offset: 4px; }
/* Recent / favourites: one horizontal row */
.row-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row-scroll a { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 10px; max-width: 260px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); text-decoration: none; font-weight: 600; font-size: 14px; transition: border-color .12s; }
.row-scroll a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-scroll .tile { width: 28px; height: 28px; }
.row-scroll a:hover { border-color: var(--brand); color: var(--brand-text); }
/* Categories: cards with a coloured left edge, an index code and three example tools */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cat-card { position: relative; display: flex; flex-direction: column; padding: 18px 18px 14px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: inset 2px 0 var(--tile); transition: border-color .15s, box-shadow .15s; }
.cat-card:hover { border-color: color-mix(in srgb, var(--tile) 55%, var(--line)); box-shadow: inset 2px 0 var(--tile), 0 0 18px color-mix(in srgb, var(--tile) 14%, transparent); }
.cat-code { position: absolute; top: 12px; right: 14px; font: 500 11.5px var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.cat-card:hover .cat-code { color: color-mix(in srgb, var(--tile) 70%, var(--ink)); }
.cat-main { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; padding-right: 48px; }
.cat-main > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.cat-main .tile { width: 42px; height: 42px; }
.cat-main strong { font: 700 20px var(--head); letter-spacing: -.01em; }
.cat-main:hover strong { color: var(--brand-text); }
.cat-main .muted { font-size: 14px; line-height: 1.4; }
.cat-eg { list-style: none; margin: 14px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 1px; }
.cat-eg a { display: block; padding: 4px 0; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.cat-eg a::before { content: ">"; font-family: var(--mono); color: var(--ink-3); margin-right: 9px; }
.cat-eg a:hover { color: var(--brand-text); }
.cat-eg a:hover::before { color: var(--brand-text); }
.cat-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 4px; font: 500 13px var(--mono); color: var(--brand-text); text-decoration: none; }
.cat-more:hover { text-decoration: underline; text-underline-offset: 4px; }
/* Most used: thin-outlined icon grid (shared hairlines) */
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.icon-grid a { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px 16px; background: var(--bg); text-align: center; text-decoration: none; font-size: 13.5px; font-weight: 600; line-height: 1.3; transition: background .12s, color .12s; }
.icon-grid a:hover { background: var(--card); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand); }
.icon-grid .tile, :root:not([data-theme="light"]) .icon-grid .tile { width: 44px; height: 44px; background: none; border-color: color-mix(in srgb, var(--tile) 45%, transparent); }
.privacy-strip { --cut: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 32px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.privacy-strip p { font-size: 16px; color: var(--ink-2); margin: 12px 0 18px; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks .ic { margin-top: 1px; padding: 3px; border-radius: 2px; width: 22px; height: 22px; border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); color: var(--brand-text); }
.ticks.small li { font-size: 14.5px; }

/* ---------- Category / list pages ---------- */
.page-head { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 8px; }
.page-head .lead { margin: 10px 0 0; }
.page-head .lead .muted { white-space: nowrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 500 12.5px var(--mono); color: var(--ink-3); margin-bottom: 10px; text-transform: lowercase; }
.crumbs .sl { color: var(--ink-3); opacity: .7; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--brand-text); }
.ph-code { color: color-mix(in srgb, var(--tile, var(--brand)) 70%, var(--ink)); text-transform: none; }
.ph-tile { --cut: 12px; --cut-line: color-mix(in srgb, var(--tile) 45%, transparent); display: grid; place-items: center; width: 76px; height: 76px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--tile) 45%, transparent); background: color-mix(in srgb, var(--tile) 14%, var(--card)); color: color-mix(in srgb, var(--tile) 55%, var(--ink)); flex: none; margin-top: 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--sh); }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-grid.compact { grid-template-columns: repeat(4, 1fr); }
.card.tool { --tile: var(--brand); display: flex; align-items: flex-start; gap: 13px; padding: 14px 14px 14px 16px; border-radius: var(--r); text-decoration: none; box-shadow: inset 2px 0 color-mix(in srgb, var(--tile) 70%, transparent); transition: box-shadow .15s, border-color .15s; }
.card.tool:hover { border-color: color-mix(in srgb, var(--tile) 55%, var(--line)); box-shadow: inset 2px 0 var(--tile), 0 0 16px color-mix(in srgb, var(--tile) 12%, transparent); }
.card.tool:hover strong { color: var(--brand-text); }
.card.tool .tile { width: 36px; height: 36px; }
.card.tool .tc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card.tool strong { font-size: 15px; font-weight: 650; line-height: 1.3; }
.card.tool .muted { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-grid.compact .card.tool { padding: 12px 12px 12px 14px; }
.tool-grid.compact .card.tool .tile { width: 32px; height: 32px; }
.list-bar { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.list-bar .label { margin: 0; flex: 1; }
.list-tools { display: flex; gap: 8px; margin-left: auto; flex: none; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; }
.chip { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink-2); font: 600 13.5px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: border-color .12s, color .12s; }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip span:not(.tile) { font: 500 11.5px var(--mono); color: var(--ink-3); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.chip.on span:not(.tile) { color: var(--brand-text); }
.chip .tile { width: 22px; height: 22px; margin-left: -6px; }
.chip-row.jump { margin-top: 18px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); color: var(--ink-3); transition: border-color .12s, box-shadow .12s; }
.field-inline:focus-within { border-color: var(--brand); box-shadow: var(--glow); }
.field-inline .ic { color: var(--brand-text); }
.field-inline input { border: 0; background: none; outline: none; font: 500 14px var(--font); color: var(--ink); width: 170px; }
.list-bar select { height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); color: var(--ink); font: 600 13.5px var(--font); }
.list-bar select option { background: var(--card); color: var(--ink); }
.field-inline.big { width: min(100%, 520px); height: 50px; margin-top: 20px; padding: 0 16px; }
.field-inline.big input { width: 100%; font: 500 16px var(--mono); }
.browse-cat { scroll-margin-top: calc(var(--nav-h) + 16px); }
.browse-cat .label .tile { width: 30px; height: 30px; }
.empty { color: var(--ink-2); padding: 20px 0; font-family: var(--mono); font-size: 14px; }

/* ---------- Tool page: header, work card, how-to + FAQ with related tools beside ---------- */
.tool-page { max-width: var(--wide); margin: 0 auto; }
.tool-head { margin: -6px 0 22px; }
.tool-head .crumbs { margin-bottom: 14px; }
.th-main { display: flex; align-items: center; gap: 16px; }
.tool-tile { --cut: 10px; --cut-line: color-mix(in srgb, var(--tile) 60%, transparent); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 2px; border: 1px solid color-mix(in srgb, var(--tile) 50%, transparent); background: color-mix(in srgb, var(--tile) 10%, var(--card)); color: color-mix(in srgb, var(--tile) 65%, var(--ink)); flex: none; text-decoration: none; transition: box-shadow .15s; }
.tool-tile:hover { box-shadow: 0 0 16px color-mix(in srgb, var(--tile) 30%, transparent); }
.crumbs .th-code { text-transform: none; }
.th-code { font: 500 12px var(--mono); color: color-mix(in srgb, var(--tile) 70%, var(--ink-2)); letter-spacing: .04em; }
/* Light theme: neon category colours are too pale for small text, so the codes lean on the ink (WCAG AA) */
:root[data-theme="light"] .th-code, :root[data-theme="light"] .ph-code { color: color-mix(in srgb, var(--tile, var(--brand)) 40%, var(--ink)); }
.th-text { flex: 1; min-width: 0; }
.th-name { font: 700 clamp(28px, 3.4vw, 38px)/1.1 var(--head); letter-spacing: -.01em; margin: 0; }
.th-desc { margin: 6px 0 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.45; max-width: 46em; }
.fav-btn { flex: none; align-self: flex-start; margin-top: 4px; }
.fav-btn[aria-pressed="true"] { border-color: var(--coral); background: var(--coral-soft); color: var(--ink); }
.fav-btn[aria-pressed="true"] svg { fill: var(--coral); stroke: var(--coral); }
.th-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 0; padding: 0 0 0 72px; color: var(--ink-2); font: 500 12.5px var(--mono); text-transform: lowercase; }
.th-facts li { display: inline-flex; align-items: center; gap: 6px; }
.th-facts .ic { color: var(--brand-text); }
/* the work card: hairline frame, category-colour left edge, clipped top-right corner (.cut) */
.work { --cut: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: inset 2px 0 var(--tile); padding: 22px 22px 22px 24px; }
.tool-root { display: flex; flex-direction: column; gap: 16px; }
.tool-more { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; margin-top: 60px; align-items: start; }
.sec-h { display: flex; align-items: center; gap: 10px; font: 700 21px/1.2 var(--head); letter-spacing: -.01em; margin: 0 0 16px; }
.sec-h::before { content: "//"; font: 500 15px var(--mono); color: var(--brand-text); }
.about-tool .sec-h ~ .sec-h { margin-top: 40px; }
.steps { list-style: none; counter-reset: st; padding: 0; margin: 0; display: flex; flex-direction: column; }
.steps li { counter-increment: st; position: relative; padding: 4px 0 18px 48px; font-size: 15px; }
.steps li::before { content: counter(st, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 32px; height: 30px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); border-radius: 2px; color: var(--brand-text); font: 500 13px var(--mono); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 34px; bottom: 4px; border-left: 1px dashed var(--line-2); }
.steps li:last-child { padding-bottom: 0; }
.faq { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; gap: 12px; padding: 15px 18px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--soft); }
.faq summary { box-shadow: inset 2px 0 transparent; transition: box-shadow .12s, color .12s; }
.faq details[open] summary { color: var(--brand-text); box-shadow: inset 2px 0 var(--brand); }
.faq summary .chev { margin-left: auto; color: var(--ink-3); transition: transform .15s; }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--ink-2); }
.tool-side { position: sticky; top: calc(var(--nav-h) + 20px); scroll-margin-top: calc(var(--nav-h) + 20px); }
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-list a { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; margin: 0 -10px; border-radius: var(--r); text-decoration: none; }
.side-list a:hover { background: var(--card); box-shadow: inset 2px 0 var(--brand); }
.side-list a:hover b { color: var(--brand-text); }
.side-list .tile { width: 32px; height: 32px; }
.side-list a > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.side-list b { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.side-list small { color: var(--ink-2); font-size: 12.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-all { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font: 500 13px var(--mono); text-transform: lowercase; color: var(--brand-text); text-decoration: none; }
.side-all:hover { text-decoration: underline; text-underline-offset: 4px; }
.loading { padding: 40px; text-align: center; font: 500 13px var(--mono); }

/* ---------- Tool kit: panels and fields ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 18px; min-width: 0; }
.panel:not(.work .panel) { box-shadow: var(--sh-sm); }
.panel.accent { background: color-mix(in srgb, var(--brand) 5%, var(--card)); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: inset 2px 0 var(--brand); }
.panel.yellow { background: color-mix(in srgb, var(--coral) 5%, var(--card)); border-color: color-mix(in srgb, var(--coral) 35%, var(--line)); box-shadow: inset 2px 0 var(--coral); }
.panel.flat { box-shadow: none; }
.panel > h3, .panel-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 600 15.5px var(--head); letter-spacing: .01em; color: var(--ink); }
.panel-h .sp, .row .sp { flex: 1; }
.panel-h .btn, .panel-h .val, .panel-h .tag { font-family: var(--font); text-transform: none; letter-spacing: 0; }
.panel-h > span:first-child { white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.field > span:first-child { display: flex; justify-content: space-between; gap: 8px; }
.field .val { font: 600 12.5px var(--mono); color: var(--brand-text); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.tool-root input[type=text], .tool-root input[type=number], .tool-root input[type=search], .tool-root input[type=password], .tool-root input[type=url],
.tool-root input[type=date], .tool-root input[type=datetime-local], .tool-root input[type=time], .tool-root input[type=email], .tool-root select, .tool-root textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink); font: 500 15px var(--font); min-width: 0;
}
.tool-root :is(input, select, textarea):not([type=range], [type=checkbox], [type=radio], [type=color]):focus { outline: none; border-color: var(--brand); background: var(--card); box-shadow: var(--glow); }
.tool-root :is(input, textarea) { caret-color: var(--brand); }
.tool-root :is(input, select, textarea):hover:not(:focus, [type=range], [type=checkbox], [type=radio]) { border-color: var(--line-2); }
.tool-root select { padding-right: 28px; }
.tool-root select option { background: var(--card); color: var(--ink); }
.tool-root textarea { min-height: 200px; resize: vertical; font: 14px/1.55 var(--mono); }
.tool-root textarea.prose { font: 15px/1.6 var(--font); }
.tool-root textarea.out, .tool-root .out { background: var(--card-2); }
.tool-root input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); cursor: pointer; }
.tool-root input[type=range] { width: 100%; accent-color: var(--brand); }
.tool-root input[type=checkbox], .tool-root input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: 2px; gap: 2px; overflow-x: auto; }
.seg button { flex: 1; padding: 6px 12px; border: 0; border-radius: 2px; background: none; font: 600 14px var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.seg button:hover:not(.on) { color: var(--ink); background: var(--soft); }
.seg button.on { background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent); }
.big-out { font: 600 clamp(20px, 3.2vw, 30px)/1.25 var(--mono); word-break: break-all; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); }
.stat b { display: block; font: 600 20px/1.25 var(--mono); letter-spacing: -.03em; color: var(--ink); overflow-wrap: anywhere; }
.stat small { font: 500 12px var(--mono); color: var(--ink-3); text-transform: lowercase; }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 14px 0 8px; }
.meter i { height: 6px; border-radius: 1px; background: var(--soft); }
.meter i.on { background: var(--ok); }
.meter.weak i.on { background: var(--bad); }
.meter.fair i.on { background: var(--warn); }
.lines { display: flex; flex-direction: column; }
.lines .ln { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font: 14px var(--mono); word-break: break-all; }
.lines .ln:last-child { border-bottom: 0; }
.lines .ln span { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--r); background: none; color: inherit; cursor: pointer; flex: none; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.note { font-size: 13px; color: var(--ink-2); margin: 0; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; margin: 0; }
.ok { color: var(--ok); font-weight: 600; }
/* file drop: a dashed scan frame with corner brackets (as on the home page), tinted by the category colour */
.drop { --fc: color-mix(in srgb, var(--tile, var(--brand)) 75%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; padding: 28px; border: 1px dashed var(--line-2); border-radius: 2px; text-align: center; cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s;
    background-color: color-mix(in srgb, var(--tile, var(--brand)) 5%, var(--card-2));
    background-image: linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc)), linear-gradient(var(--fc), var(--fc));
    background-repeat: no-repeat; background-size: 16px 1px, 1px 16px, 16px 1px, 1px 16px, 16px 1px, 1px 16px, 16px 1px, 1px 16px;
    background-position: left 4px top 4px, left 4px top 4px, right 4px top 4px, right 4px top 4px, left 4px bottom 4px, left 4px bottom 4px, right 4px bottom 4px, right 4px bottom 4px; }
.drop:hover, .drop.over { --fc: var(--brand); background-color: var(--brand-soft); border-color: var(--brand); }
.drop.over { box-shadow: var(--glow); }
.drop strong { font-size: 19px; font-weight: 700; font-family: var(--head); letter-spacing: -.01em; }
.drop .note { color: var(--ink-2); font: 500 12.5px var(--mono); text-transform: lowercase; }
.drop .plus { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--brand); border-radius: 2px; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 4px; transition: box-shadow .12s, background .12s, color .12s; }
.drop:hover .plus { background: var(--brand); color: var(--brand-ink); box-shadow: var(--glow); }
.drop.slim { --fc: transparent; border-color: var(--line-2); background-color: var(--card-2); }
.drop.slim { min-height: 0; padding: 14px; flex-direction: row; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-size: 14px; }
.file-chip b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.preview { display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-height: 200px; max-height: 70vh; position: relative; }
.preview canvas, .preview img, .preview video { max-width: 100%; max-height: 68vh; display: block; object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 6px; text-align: center; font: 600 12px var(--mono); }
.thumb canvas, .thumb img { width: 100%; height: auto; display: block; margin-bottom: 4px; background: #fff; }
.thumb.sel { outline: 1px solid var(--brand); border-color: var(--brand); box-shadow: var(--glow); }
.thumb.off { opacity: .35; }
.thumb .x { position: absolute; top: 2px; right: 2px; background: var(--card); border: 1px solid var(--line); }
.thumb[draggable=true] { cursor: grab; }
.table-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--line); border-radius: var(--r); }
.table { border-collapse: collapse; width: 100%; font-size: 13.5px; background: var(--card); }
.table th, .table td { padding: 6px 10px; border-bottom: 1px solid var(--soft); border-right: 1px solid var(--soft); text-align: left; white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.table th { position: sticky; top: 0; background: var(--card-2); font-weight: 650; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.table tbody tr:hover td { background: var(--soft); }
.table td.num { text-align: right; font-family: var(--mono); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 96px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); cursor: pointer; font: 600 11.5px var(--mono); text-align: center; }
.swatch i { display: block; height: 64px; border-bottom: 1px solid var(--line); }
.swatch span { display: block; padding: 4px; }
.code { font: 13.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); }
.hl { background: color-mix(in srgb, var(--brand) 28%, transparent); color: var(--ink); box-shadow: inset 0 -1px var(--brand); border-radius: 1px; }
.hl2 { background: color-mix(in srgb, var(--coral) 28%, transparent); color: var(--ink); box-shadow: inset 0 -1px var(--coral); border-radius: 1px; }
.diff-add { background: color-mix(in srgb, var(--green) 55%, transparent); }
.diff-del { background: color-mix(in srgb, var(--red) 45%, transparent); text-decoration: line-through; }
.md-out { line-height: 1.6; overflow: auto; }
.md-out img { max-width: 100%; }
.md-out pre { background: var(--card-2); padding: 10px; border-radius: var(--r); overflow: auto; }
.md-out table { border-collapse: collapse; } .md-out td, .md-out th { border: 1px solid var(--ink-3); padding: 4px 8px; }
.tree { font: 13.5px/1.6 var(--mono); }
.tree details { padding-left: 16px; }
.tree summary { cursor: pointer; margin-left: -16px; }
.tree .k { color: var(--ink-2); } .tree .s { color: #2c7a4b; } .tree .n { color: #2f5fb3; } .tree .b { color: #b0452f; }
:root:not([data-theme="light"]) .tree .s { color: #8fe0ae; } :root:not([data-theme="light"]) .tree .n { color: #9cc0ff; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 100; padding: 10px 18px; border: 1px solid var(--brand); border-radius: var(--r); background: var(--card); color: var(--ink); font: 500 13.5px var(--mono); box-shadow: var(--glow), var(--sh-lg); }
.toast::before { content: "> "; color: var(--brand-text); }
.progress { height: 8px; border: 1px solid var(--line); border-radius: 1px; overflow: hidden; background: var(--bg); }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); box-shadow: 0 0 10px var(--brand); transition: width .15s; }
.crop-box { position: absolute; border: 2px solid #fff; outline: 1px solid #000; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); cursor: move; touch-action: none; }
.crop-box i { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid #000; }
.crop-box i[data-h=nw] { left: -8px; top: -8px; cursor: nwse-resize; } .crop-box i[data-h=ne] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-box i[data-h=sw] { left: -8px; bottom: -8px; cursor: nesw-resize; } .crop-box i[data-h=se] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.stage { position: relative; display: inline-block; line-height: 0; touch-action: none; }
.stage canvas { max-width: 100%; height: auto; }
.cmp { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.cmp canvas { display: block; max-width: 100%; height: auto; }
.cmp .top-img { position: absolute; inset: 0; overflow: hidden; }
.cmp .bar { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 0 1px #000; }
.preview .cmp { cursor: ew-resize; touch-action: pan-y; user-select: none; }
.preview .cmp > img { display: block; }
.cmp .top-img img { width: 100%; height: 100%; max-width: none; max-height: none; }
.cmp .bar { transform: translateX(-1px); pointer-events: none; }
.cmp-tag { position: absolute; top: 6px; padding: 2px 6px; border-radius: 2px; background: rgba(7,9,12,.75); color: #fff; font: 500 11.5px/1.4 var(--mono); pointer-events: none; }
.preview.zoom { overflow: auto; place-items: start; }
.preview.zoom img, .preview.zoom .cmp { max-width: none; max-height: none; }
.btn.xs.on { border-color: var(--brand); color: var(--brand-text); }
.wave { width: 100%; height: 130px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); display: block; touch-action: none; cursor: crosshair; }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.calc-keys .btn { padding: 12px 0; font-size: 17px; }
.calc-screen { font: 700 34px var(--mono); text-align: right; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); word-break: break-all; min-height: 78px; }
.calc-screen small { display: block; font-size: 14px; color: var(--ink-2); min-height: 20px; }
.big-time { font: 800 clamp(48px, 10vw, 110px)/1 var(--mono); letter-spacing: -.03em; text-align: center; margin: 10px 0; }
.doc-sheet { background: #fff; color: #222; border: 1px solid var(--line); border-radius: 2px; padding: 36px; font-size: 14px; }
.doc-sheet table { width: 100%; border-collapse: collapse; }
.doc-sheet th, .doc-sheet td { padding: 7px 6px; border-bottom: 1px solid #ddd; text-align: left; }
.doc-sheet .r { text-align: right; }
.items-table input { padding: 6px 8px !important; font-size: 14px !important; }
.items-table td { padding: 3px; }
@media print {
    body * { visibility: hidden; }
    .printable, .printable * { visibility: visible; }
    .printable { position: absolute; left: 0; top: 0; width: 100%; border: 0 !important; padding: 0 !important; }
}

/* ---------- Search palette ---------- */
.palette { border: 0; padding: 0; background: none; width: min(640px, calc(100vw - 24px)); margin-top: 12vh; color: var(--ink); }
.palette::backdrop { background: rgba(3, 5, 8, .62); backdrop-filter: blur(3px); }
.palette-box { --cut: 16px; --cut-line: var(--brand); background: var(--card); border: 1px solid var(--brand); border-radius: 0; box-shadow: var(--sh-lg); overflow: hidden; }
.palette-in input:focus-visible { outline: none; }
.palette-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--brand-text); }
.palette-in input::-webkit-search-cancel-button { display: none; }
.palette-in input { flex: 1; border: 0; outline: none; background: none; font: 500 18px var(--font); color: var(--ink); caret-color: var(--brand); }
.palette-in input::placeholder { color: var(--ink-3); }
.palette-list { max-height: 56vh; overflow-y: auto; padding: 8px; }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); text-decoration: none; }
.palette-list a.sel { background: var(--brand-soft); box-shadow: inset 2px 0 var(--brand); }
.palette-list a.sel b { color: var(--brand-text); }
.palette-list a .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list a > span:not(.tile) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-list a b { font-size: 15px; font-weight: 600; }
.palette-list .tile { width: 34px; height: 34px; }
.palette-list .cat { font: 500 11.5px var(--mono); color: var(--ink-3); text-transform: lowercase; }
.palette-list p { padding: 14px; margin: 0; color: var(--ink-2); }

/* ---------- Text pages ---------- */
.prose-page { max-width: 780px; margin: 0 auto; }
.prose-page .display { margin-top: 6px; }
.prose-page h2 { font-size: 22px; font-weight: 700; font-family: var(--head); letter-spacing: -.02em; margin: 38px 0 8px; }
.prose-page p, .prose-page li { font-size: 16px; color: var(--ink-2); }
.prose-page li { margin: 4px 0; }
.prose-page p a, .prose-page li a { color: var(--brand-text); }
.prose-page code { font: 500 .88em var(--mono); background: var(--soft); border: 1px solid var(--line); padding: 0 5px; border-radius: 2px; color: var(--brand-text); }
.prose-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r2); background: var(--card); margin: 14px 0; }
.prose-page table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose-page td, .prose-page th { border-bottom: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.prose-page tr:last-child td { border-bottom: 0; }
.prose-page th { background: var(--card-2); color: var(--ink-2); font: 500 12px var(--mono); text-transform: lowercase; }
.prose-page th::before { content: "// "; color: var(--brand-text); }
.prose-page h2::before { content: "// "; font: 500 .8em var(--mono); color: var(--brand-text); }
.prose-page td a { color: var(--brand-text); font-weight: 600; text-decoration: none; }
.prose-page td a:hover { text-decoration: underline; }
.prose-page td:nth-child(2) { white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0 8px; }
.facts div { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-left: 2px solid var(--brand); border-radius: var(--r2); background: var(--card); font-size: 14px; color: var(--ink-2); }
.facts b { display: flex; align-items: center; gap: 8px; color: var(--ink); font: 700 16px var(--head); letter-spacing: -.01em; }
.facts b svg { color: var(--brand-text); }
.lost { max-width: 640px; margin: 4vh auto 0; text-align: center; }
.lost-num { position: relative; display: inline-block; font: 700 clamp(88px, 15vw, 150px)/1 var(--head); letter-spacing: -.03em; color: var(--ink); text-shadow: 0 0 24px color-mix(in srgb, var(--brand) 35%, transparent); margin: 0 0 6px; }
/* Glitch: two copies in cyan and magenta, sliced and nudged now and then (the only glitch on the site) */
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: .8; }
.glitch::before { color: var(--brand); transform: translate(-3px, 0); clip-path: inset(0 0 62% 0); animation: glitch-a 3.2s steps(1) infinite; mix-blend-mode: screen; }
.glitch::after { color: var(--coral); transform: translate(3px, 0); clip-path: inset(58% 0 0 0); animation: glitch-b 3.2s steps(1) infinite; mix-blend-mode: screen; }
:root[data-theme="light"] .glitch::before, :root[data-theme="light"] .glitch::after { mix-blend-mode: multiply; opacity: .55; }
@keyframes glitch-a { 0%, 86%, 100% { transform: translate(-3px, 0); clip-path: inset(0 0 62% 0); } 88% { transform: translate(-9px, -2px); clip-path: inset(12% 0 70% 0); } 90% { transform: translate(6px, 1px); clip-path: inset(40% 0 38% 0); } 92% { transform: translate(-5px, 0); clip-path: inset(70% 0 8% 0); } 94% { transform: translate(2px, 0); clip-path: inset(0 0 62% 0); } }
@keyframes glitch-b { 0%, 86%, 100% { transform: translate(3px, 0); clip-path: inset(58% 0 0 0); } 88% { transform: translate(8px, 2px); clip-path: inset(66% 0 14% 0); } 90% { transform: translate(-6px, -1px); clip-path: inset(22% 0 60% 0); } 92% { transform: translate(5px, 0); clip-path: inset(4% 0 80% 0); } 94% { transform: translate(-2px, 0); clip-path: inset(58% 0 0 0); } }
.lost-path { margin: 4px 0 0; overflow-wrap: anywhere; }
.lost-path span { color: var(--coral); }
.lost .lead { margin: 10px auto 24px; }
.lost h1 { margin-top: 18px; }
.lost .btn-row { justify-content: center; }
.lost .chip-row { justify-content: center; margin-top: 30px; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1150px) {
    .tool-grid.compact { grid-template-columns: repeat(3, 1fr); }
    .cat-grid, .tool-grid { grid-template-columns: repeat(2, 1fr); }
    .icon-grid { grid-template-columns: repeat(4, 1fr); }
    .list-bar { flex-direction: column-reverse; }
    .list-tools { margin-left: 0; }
    .list-bar .chip-row { max-width: 100%; }
}
@media (max-width: 1100px) {
    .nav-links span { display: none; }
    .menu-grid { grid-template-columns: repeat(3, 1fr); }
    .foot-in { grid-template-columns: 1fr 1.6fr; }
    .foot-site { grid-column: 2; }
}
@media (max-width: 900px) {
    :root { --nav-h: 58px; }
    .desk-only, .nav-search, .nav-links { display: none !important; }
    .phone-only { display: grid; }
    .nav-in { padding: 0 12px 0 16px; gap: 6px; }
    .brand { font-size: 18px; margin-right: auto; }
    .menu-btn span { display: none; }
    .menu-btn { order: 3; width: 40px; padding: 0; justify-content: center; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); }
    .menu-btn .chev { display: none; }
    .menu { height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); max-height: none; }
    .menu-in { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
    .menu-grid { grid-template-columns: 1fr; }
    .menu-foot .sp, .menu-foot .muted { display: none; }
    .content { padding: 26px 16px 56px; }
    .foot-in { grid-template-columns: 1fr; gap: 26px; padding: 30px 16px 20px; }
    .foot-site { grid-column: auto; }
    .foot-cats { grid-template-columns: repeat(2, 1fr); }
    .foot-line { flex-direction: column; gap: 4px; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
    .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
    .palette { margin-top: 8vh; }
    .palette-list .cat, .palette-in .kbd { display: none; }
    .palette-in input { font-size: 17px; min-width: 0; }
    .cat-grid, .tool-grid, .tool-grid.compact, .privacy-strip, .grid2, .grid3 { grid-template-columns: 1fr; }
    .hero { padding-top: 6px; }
    .hero .lead { margin-bottom: 22px; }
    .find-row { height: 56px; padding: 0 14px; }
    .find-drop { flex-wrap: wrap; padding: 12px; }
    .find-drop p { flex-basis: calc(100% - 60px); font-size: 14px; }
    .find-drop .btn-row { width: 100%; }
    .find-drop .btn-row > * { flex: 1; }
    .block { margin-top: 40px; }
    .label { font-size: 19px; }
    .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cat-card { padding: 14px 12px 12px 14px; }
    .cat-main { flex-direction: column; gap: 10px; }
    .cat-main .tile { width: 40px; height: 40px; }
    .cat-main strong { font-size: 17px; }
    .cat-main .muted { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .cat-eg { display: none; }
    .cat-more { font-size: 13px; margin-top: 10px; }
    .icon-grid { grid-template-columns: repeat(4, 1fr); }
    .icon-grid a { padding: 12px 2px 10px; font-size: 12px; gap: 7px; }
    .icon-grid .tile, :root:not([data-theme="light"]) .icon-grid .tile { width: 40px; height: 40px; }
    .find-row input, .find-ghost { font-size: 16px; }
    .prompt { font-size: 19px; }
    .cat-code { top: 10px; right: 10px; font-size: 10.5px; }
    .cat-main { padding-right: 0; }
    .privacy-strip { padding: 22px; gap: 22px; }
    .facts { grid-template-columns: 1fr; gap: 8px; }
    .facts div { padding: 12px 14px; }
    .prose-page td:nth-child(2) { white-space: normal; }
    .lost { margin-top: 0; }
    .page-head { gap: 14px; }
    .ph-tile { display: none; }
    .page-head .lead .muted { white-space: normal; }
    .list-bar .chip-row:not(.wrap) { margin: 0 -16px; padding: 1px 16px; max-width: none; width: calc(100% + 32px); }
    .list-tools { width: 100%; }
    .list-tools .field-inline { flex: 1; }
    .list-tools .field-inline input { width: 100%; }
    .lead { font-size: 16px; }
    .panel { padding: 15px; }
    .tool-head { margin: -10px 0 16px; }
    .tool-head .crumbs { margin-bottom: 10px; }
    .th-main { gap: 12px; align-items: flex-start; }
    .tool-tile { width: 44px; height: 44px; }
    .th-name { font-size: 26px; }
    .th-desc { font-size: 15px; }
    .th-facts { padding: 0; gap: 4px 14px; font-size: 13px; }
    .work { padding: 0; border: 0; background: none; box-shadow: none; border-radius: 0; }
    .work.cut { clip-path: none; }
    .stats { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .stat b { font-size: 17px; }
    .work.cut::after { content: none; }
    .work .panel { box-shadow: var(--sh-sm); }
    .tool-more { grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 44px; }
    .tool-side { position: static; }
    .sec-h { font-size: 20px; }
    .faq summary { padding: 14px 15px; }
    .faq p { padding: 0 15px 14px; }
    .tool-root textarea { min-height: 150px; }
    .doc-sheet { padding: 18px; }
    .calc-keys .btn { padding: 14px 0; }
}
@media (max-width: 420px) {
    .fav-btn .fav-label { display: none; }
    .fav-btn { padding: 8px; }
    .icon-grid a { font-size: 11.5px; padding: 12px 3px 10px; }
    .find-drop .muted { display: none; }
}

/* PDF page editor (pdfedit.js): the tool bar stays in view on wide screens; on phones it scrolls away and shows icons only */
.pe-bar { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 5; }
@media (max-width: 900px) { .pe-bar { position: static; } .pe-bar .tl { display: none; } .pe-bar .seg button { padding: 8px 10px; } }
@media (max-width: 900px) { body.menu-open { overflow: hidden; } }
/* Category tiles on dark: a dim tint, a neon edge and the colour itself as the icon */
:root:not([data-theme="light"]) .tile, :root:not([data-theme="light"]) .ph-tile, :root:not([data-theme="light"]) .tool-tile { background: color-mix(in srgb, var(--tile) 10%, var(--card)); border-color: color-mix(in srgb, var(--tile) 38%, transparent); color: var(--tile); }
/* No blinking caret or scanlines for people who ask for less motion */
@media (prefers-reduced-motion: reduce) {
    .caret, .glitch::before, .glitch::after { animation: none; }
    .hero::before { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 40px 40px; }
    * { transition-duration: 0s !important; }
}
