/* Toolkitty · app styles
   Theme: Paper & Ink (light) + Night Desk (dark) · Pairing: Neo Grotesk Mono · Family: Soft
   Shelf colours: Sanzo Wada swatches (js/tool-icons.js)
   Designed using Design Lounge (https://www.designlounge.live) */

/* ---------- Fonts (self-hosted, SIL OFL: fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Familjen Grotesk"; src: url("../fonts/FamiljenGrotesk-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Familjen Grotesk"; src: url("../fonts/FamiljenGrotesk-latin-ext.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Chivo Mono"; src: url("../fonts/ChivoMono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chivo Mono"; src: url("../fonts/ChivoMono-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Night Desk · dark · Designed using Design Lounge ---------- */
:root {
  --primary: #e0a34b; --primary-ink: #141210; --primary-soft: #45361f;
  --secondary: #8fbf7a; --secondary-ink: #141210; --secondary-soft: #323c2a;
  --tertiary: #c48a8a; --tertiary-ink: #141210; --tertiary-soft: #3e302e;
  --bg: #141311; --surface: #1b1a17; --surface-2: #242320; --surface-3: #383733;
  --ink: #ece7dc; --ink-2: #a7a196; --ink-3: #928d83;
  --line: #2b2925; --line-strong: #74716b;
  --success: #8fbf7a; --success-ink: #141210; --success-soft: #323c2a; --success-on-soft: #8fbf7a;
  --warning: #e08a3a; --warning-ink: #141210; --warning-soft: #45301b; --warning-on-soft: #e08a3a;
  --danger: #e07060; --danger-ink: #141210; --danger-soft: #452924; --danger-on-soft: #e48173;
  --info: #8ab4c8; --info-ink: #141210; --info-soft: #303a3d; --info-on-soft: #8ab4c8;
  --focus: #e0a34b; --link: #e0a34b; --overlay: #070605; --inverse: #ece7dc; --inverse-ink: #141311;
  --shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 18px 36px -18px rgba(0, 0, 0, 0.75);
  --tile-light: rgba(255, 255, 255, 0.28);
  --head-accent: #a8661a;
  color-scheme: dark;
}

/* ---------- Paper & Ink · light · Designed using Design Lounge ---------- */
:root[data-theme="light"] {
  --primary: #a8661a; --primary-ink: #fffdf8; --primary-soft: #e9dcc9;
  --secondary: #3f6b4a; --secondary-ink: #fffdf8; --secondary-soft: #daddd0;
  --tertiary: #3d4f6b; --tertiary-ink: #fffdf8; --tertiary-soft: #dad9d5;
  --bg: #f3efe6; --surface: #fbf8f2; --surface-2: #eae5d9; --surface-3: #dcd5c6;
  --ink: #171512; --ink-2: #5b564e; --ink-3: #5e5b53;
  --line: #e0d9ca; --line-strong: #8d887e;
  --success: #3f6b4a; --success-ink: #fffdf8; --success-soft: #daddd0; --success-on-soft: #375e41;
  --warning: #b45309; --warning-ink: #fffdf8; --warning-soft: #ead9c7; --warning-on-soft: #8b4007;
  --danger: #9b2c2c; --danger-ink: #fffdf8; --danger-soft: #e7d4cc; --danger-on-soft: #9b2c2c;
  --info: #3d4f6b; --info-ink: #fffdf8; --info-soft: #dad9d5; --info-on-soft: #3d4f6b;
  --focus: #a8661a; --link: #975c17; --overlay: #141210; --inverse: #171512; --inverse-ink: #f3efe6;
  --shadow: 0 12px 28px -16px rgba(40, 30, 10, 0.22);
  --shadow-lift: 0 20px 36px -18px rgba(40, 30, 10, 0.32);
  --tile-light: rgba(255, 255, 255, 0.45);
  --head-accent: #e0a34b;
  color-scheme: light;
}

/* ---------- Mascot colours: a ginger tabby in Sanzo Wada swatches ---------- */
:root { --kit-fur: #f5a100; --kit-stripe: #c97838; --kit-ear: #ef805f; --kit-nose: #db4f58; --kit-muzzle: #fdf6e6; --kit-light: #ffe2a6; --kit-ink: #171512; }

/* ---------- Shelf colours (Sanzo Wada swatches) ---------- */
[data-shelf] { --shelf-soft: color-mix(in srgb, var(--shelf) 15%, var(--surface)); --shelf-line: color-mix(in srgb, var(--shelf) 45%, var(--line)); }
[data-shelf="text"] { --shelf: #ef805f; --shelf-ink: #141210; }
[data-shelf="dev"] { --shelf: #009087; --shelf-ink: #fffdf8; }
[data-shelf="data"] { --shelf: #008ea5; --shelf-ink: #fffdf8; }
[data-shelf="image"] { --shelf: #f5a100; --shelf-ink: #141210; }
[data-shelf="pdf"] { --shelf: #db4f58; --shelf-ink: #141210; }
[data-shelf="calc"] { --shelf: #68c3be; --shelf-ink: #141210; }
[data-shelf="convert"] { --shelf: #c97838; --shelf-ink: #141210; }
[data-shelf="security"] { --shelf: #614498; --shelf-ink: #fffdf8; }
[data-shelf="color"] { --shelf: #ec6e8d; --shelf-ink: #141210; }
[data-shelf="time"] { --shelf: #88c122; --shelf-ink: #141210; }
[data-shelf="media"] { --shelf: #a070a8; --shelf-ink: #141210; }
[data-shelf="files"] { --shelf: #d0b16c; --shelf-ink: #141210; }

/* ---------- Pairing (Neo Grotesk Mono) + family (Soft) + motion ---------- */
:root {
  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Chivo Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-pill: 8px;
  --shelf: var(--primary); --shelf-ink: var(--primary-ink);
  --shelf-soft: var(--primary-soft); --shelf-line: var(--line-strong);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-ui: 200ms; --t-layout: 320ms;
  --side-w: 256px; --rail-w: 72px; --top-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); font-size: 15.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; line-height: 1; margin: 0; }
h4, h5, h6, p { margin: 0; }
code, kbd, samp, .mono, .num { font-family: var(--font-mono); font-weight: 400; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg.i { width: 18px; height: 18px; flex: none; display: block; }
svg.i-sm { width: 16px; height: 16px; }
svg.i-lg { width: 24px; height: 24px; }
.lbl, .eyebrow { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink-2); line-height: 1.3; }

/* ---------- Tiles: the coloured app squares ---------- */
.tile {
  --ts: 40px; width: var(--ts); height: var(--ts); flex: none;
  display: grid; place-items: center; border-radius: calc(var(--ts) * 0.24);
  background: var(--shelf); color: var(--shelf-ink);
  box-shadow: inset 0 1px 0 var(--tile-light), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.tile svg { width: calc(var(--ts) * 0.5); height: calc(var(--ts) * 0.5); stroke-width: 2; }
.tile.sm { --ts: 26px; }
.tile.md { --ts: 34px; }
.tile.lg { --ts: 64px; }
.tile.xl { --ts: 84px; }

/* ================= Shell ================= */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; transition: grid-template-columns var(--t-layout) var(--ease); }
.app.rail { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.side { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 19px; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; flex: none; }
.brand-mark { width: 38px; height: 38px; flex: none; display: block; transition: transform var(--t-layout) var(--ease-out); }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name b { font-weight: 700; color: var(--primary); }
svg.kitty { display: block; overflow: visible; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.035em; display: block; line-height: 1.05; }
.brand-sub { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.brand-text { line-height: 1.2; transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
.side-toggle {
  position: absolute; top: 76px; right: -13px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); cursor: pointer; z-index: 3; box-shadow: var(--shadow);
}
.side-toggle::after { content: ""; position: absolute; inset: -8px; }
.side-toggle svg { width: 14px; height: 14px; transition: transform var(--t-layout) var(--ease); }
.side-toggle:hover { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.app.rail .side-toggle svg { transform: rotate(180deg); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 12px 12px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group h6 { padding: 0 10px 8px; height: 26px; white-space: nowrap; transition: opacity 160ms var(--ease); }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a, .nav button {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; width: 100%; padding: 0 8px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap; background: none; border: 0; border-radius: var(--r-sm);
  cursor: pointer; text-align: left; font-size: 14.5px;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav a:focus-visible, .nav button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.nav a[aria-current="page"] { background: var(--shelf-soft); color: var(--ink); font-weight: 600; }
.nav .tile { --ts: 26px; }
.nav .tile svg { width: 15px; height: 15px; }
.nav .ico { width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.nav .label { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
.nav .count { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); min-width: 28px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--surface-2); transition: opacity 160ms var(--ease); }
.nav a[aria-current="page"] .count { background: var(--surface); color: var(--ink); }
.nav .tip {
  position: absolute; left: calc(100% + 14px); top: 50%; transform: translate(-4px, -50%); padding: 5px 10px; border-radius: var(--r-sm);
  background: var(--inverse); color: var(--inverse-ink); font-size: 13px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease); display: none;
}
.app.rail .nav .tip { display: block; }
.app.rail .nav a:hover .tip, .app.rail .nav a:focus-visible .tip, .app.rail .nav button:hover .tip { opacity: 1; transform: translate(0, -50%); }
.app.rail .nav .label, .app.rail .brand-text { opacity: 0; transform: translateX(-6px); }
.app.rail .nav .count, .app.rail .nav-group h6 { opacity: 0; }
.app.rail .side-scroll { overflow: visible; }
.side-foot { padding: 10px 12px 12px; flex: none; border-top: 1px solid var(--line); }
.side-credit { padding: 8px 10px 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; transition: opacity 160ms var(--ease); }
.side-credit a { color: var(--ink-2); }
.app.rail .side-credit { opacity: 0; pointer-events: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 28px; background: var(--bg); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--line-strong); }
.crumbs .here { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top .spacer { flex: 1; }
.netbadge {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.netbadge:hover { border-color: var(--line-strong); color: var(--ink); }
.netbadge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; box-shadow: 0 0 0 3px var(--success-soft); }
.netbadge.alert .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.netbadge .num { color: var(--ink); font-weight: 500; }
.searchbtn {
  display: inline-flex; align-items: center; gap: 10px; width: 280px; height: 38px; padding: 0 8px 0 14px; border: 1px solid var(--line);
  border-radius: var(--r-pill); background: var(--surface); color: var(--ink-3); cursor: pointer; font-size: 14px;
}
.searchbtn:hover { border-color: var(--line-strong); color: var(--ink-2); }
.searchbtn span { flex: 1; text-align: left; }
kbd, .kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: var(--r-xs); color: var(--ink-2); font-family: var(--font-mono); font-size: 11px; line-height: 1; background: var(--surface);
}
.view { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 72px; }
.page.wide { max-width: 1440px; }
.status-live {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px); padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--inverse); color: var(--inverse-ink); font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; box-shadow: var(--shadow-lift);
  transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease-out); z-index: 90; max-width: calc(100vw - 32px);
}
.status-live.show { opacity: 1; transform: translate(-50%, 0); }
.status-live.err { background: var(--danger); color: var(--danger-ink); }

/* ================= Home: the bento ================= */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(196px, auto); grid-auto-flow: dense; gap: 14px; margin-bottom: 44px; }
.cell {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
.cell.w2 { grid-column: span 2; }
.cell.h2 { grid-row: span 2; }
.cell .lab { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.cell .lab .tile { --ts: 26px; }
.cell .lab .tile svg { width: 15px; height: 15px; }
.cell .lab .go { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--link); text-decoration: none; white-space: nowrap; }
.cell .lab .go:hover { text-decoration: underline; }
.cell .fill { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.cell.head { background: var(--inverse); color: var(--inverse-ink); border-color: transparent; padding: 32px; gap: 20px; justify-content: space-between; }
.cell.head .lab { color: color-mix(in srgb, var(--inverse-ink) 62%, var(--inverse)); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.cell.head h1 { font-size: clamp(38px, 4.3vw, 60px); line-height: 0.98; letter-spacing: -0.045em; }
.cell.head h1 em { font-style: normal; color: var(--head-accent); }
.cell.head p { color: color-mix(in srgb, var(--inverse-ink) 78%, var(--inverse)); font-size: 16.5px; max-width: 46ch; }
.finder { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 12px 0 20px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); border: 2px solid transparent; }
.finder:focus-within { border-color: var(--primary); }
.finder input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; font-size: 17px; color: var(--ink); }
.finder input::placeholder { color: var(--ink-3); }
.finder > svg { color: var(--ink-3); }
.finder kbd { flex: none; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick a {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--inverse-ink); background: color-mix(in srgb, var(--inverse-ink) 9%, var(--inverse)); border: 1px solid color-mix(in srgb, var(--inverse-ink) 16%, var(--inverse));
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.quick a:hover { background: color-mix(in srgb, var(--inverse-ink) 17%, var(--inverse)); transform: translateY(-1px); }
.quick .tile { --ts: 26px; border-radius: 6px; }
.quick .tile svg { width: 14px; height: 14px; }
.big-zero { font-family: var(--font-mono); font-size: 48px; line-height: 0.85; letter-spacing: -0.05em; color: var(--success-on-soft); }
.cell .small { font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.clock { font-family: var(--font-mono); font-size: 40px; white-space: nowrap; letter-spacing: -0.04em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.clock .sec { font-size: 18px; color: var(--ink-2); letter-spacing: 0; }
.clock-sub { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.pw-out { font-family: var(--font-mono); font-size: 18px; line-height: 1.35; word-break: break-all; color: var(--ink); padding: 12px 14px; border-radius: var(--r); background: var(--shelf-soft); border: 1px dashed var(--shelf-line); }
.swatch-big { flex: 1; min-height: 76px; border-radius: var(--r); box-shadow: inset 0 1px 0 var(--tile-light); display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 14px; font-family: var(--font-mono); font-size: 14px; cursor: pointer; border: 0; text-align: left; transition: transform 150ms var(--ease); }
.swatch-big:active { transform: scale(0.98); }
.qr-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; flex: 1; }
.qr-box .input { grid-column: 1 / -1; }
.qr-box .small { align-self: start; }
.qr-box canvas { width: 96px; height: 96px; border-radius: var(--r-sm); background: #fffdf8; image-rendering: pixelated; box-shadow: 0 0 0 1px var(--line); }
.drop-cell { cursor: pointer; border: 2px dashed var(--line-strong); box-shadow: none; transition: background-color 180ms var(--ease), border-color 180ms var(--ease); }
.drop-cell:hover { border-color: var(--primary); }
body.dragging-file .drop-cell { border-color: var(--primary); background: var(--primary-soft); }
.file-stack { display: flex; align-items: flex-end; height: 92px; padding-left: 12px; }
.file-card {
  position: relative; width: 64px; height: 80px; margin-left: -8px; border-radius: 5px 14px 5px 5px; background: var(--shelf); color: var(--shelf-ink);
  display: flex; align-items: flex-end; padding: 8px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 var(--tile-light), var(--shadow); transform: rotate(var(--rot, 0deg)); transition: transform 320ms var(--ease-out);
}
.drop-cell:hover .file-card { transform: rotate(0deg) translateY(-6px); }
.drop-cell:hover .file-card:nth-child(2n) { transform: rotate(0deg) translateY(-12px); }
.file-card:first-child { margin-left: 0; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mini-list a { display: flex; align-items: center; gap: 10px; padding: 6px; margin: 0 -6px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.mini-list a:hover { background: var(--surface-2); }
.mini-list .tile { --ts: 28px; }
.mini-list .tile svg { width: 15px; height: 15px; }
.home.searching .bento > .cell:not(.head) { display: none; }
.home.searching .bento { grid-auto-rows: auto; margin-bottom: 26px; }
.home.searching .cell.head { grid-column: 1 / -1; grid-row: auto; padding: 22px 26px; }
.home.searching .cell.head h1, .home.searching .cell.head p, .home.searching .quick { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 34px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}
.chip.has-tile { padding-left: 6px; }
.chip .tile { --ts: 26px; border-radius: 6px; }
.chip .tile svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--inverse); border-color: var(--inverse); color: var(--inverse-ink); }
.chip .num { font-size: 11.5px; color: var(--ink-3); }
.chip[aria-pressed="true"] .num { color: color-mix(in srgb, var(--inverse-ink) 65%, var(--inverse)); }
.shelf { margin-bottom: 48px; }
.shelf-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.shelf-head .tile { --ts: 40px; }
.shelf-head h2 { font-size: 26px; letter-spacing: -0.035em; }
.shelf-head .num { font-size: 13px; color: var(--ink-2); padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); }
.shelf-head .spacer { flex: 1; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-list li { min-width: 0; display: flex; }
.tool-link {
  position: relative; flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 3px; align-content: start;
  padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform var(--t-ui) var(--ease-out), border-color var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease);
}
.tool-link .tile { grid-row: span 2; --ts: 46px; transition: transform var(--t-layout) var(--ease-out); }
.tool-link .t-name { font-weight: 700; font-size: 16px; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 18px; align-self: end; }
.tool-link .t-desc { color: var(--ink-2); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-link:hover, .tool-link.sel { transform: translateY(-2px); border-color: var(--shelf-line); box-shadow: var(--shadow-lift); }
.tool-link:hover .tile, .tool-link.sel .tile { transform: rotate(-6deg) scale(1.06); }
.tool-link.sel { outline: 2px solid var(--shelf); outline-offset: 2px; }
.tool-link mark { background: color-mix(in srgb, var(--shelf) 30%, transparent); color: var(--ink); border-radius: 3px; }
.tool-link .fav { position: absolute; right: 12px; top: 12px; color: var(--primary); }
.tool-link .fav svg { width: 15px; height: 15px; fill: var(--primary); }
.dropnote { margin-top: 8px; padding: 18px 20px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--ink-2); display: flex; gap: 12px; align-items: center; font-size: 14px; }
.drop-overlay { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: color-mix(in srgb, var(--overlay) 60%, transparent); pointer-events: none; }
body.dragging-file .drop-overlay { display: grid; }
.drop-overlay div { border: 2px dashed var(--primary); border-radius: var(--r-lg); background: var(--surface); padding: 26px 34px; font-size: 17px; font-weight: 700; box-shadow: var(--shadow-lift); }

/* ================= Tool page ================= */
.tool-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 18px; align-items: center;
  margin-bottom: 22px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--shelf-soft); border: 1px solid var(--shelf-line);
}
.tool-head .tile { grid-row: span 2; }
.tool-head h1 { font-size: 32px; align-self: end; }
.tool-head .tile.lg { --ts: 58px; }
.tool-head .desc { grid-column: 2; color: var(--ink-2); max-width: 72ch; font-size: 15.5px; align-self: start; }
.tool-head .acts { grid-row: 1 / span 2; grid-column: 3; display: flex; gap: 8px; }
.tool-head .acts .btn { background: var(--surface); }
.tool-head.plain { background: none; border: 0; padding: 4px 0 20px; border-bottom: 1px solid var(--line); border-radius: 0; grid-template-columns: minmax(0, 1fr) auto; }
.tool-head.plain .desc { grid-column: 1; }
.tool-head.plain .acts { grid-column: 2; }
.tool-body { display: grid; gap: 20px; }
.tool-body > :empty, .stack > div:empty { display: none; }
.related { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.related .lbl { margin-right: 6px; }

/* ================= Controls ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { opacity: 1; background: var(--surface-2); border-color: var(--line); color: var(--ink-3); box-shadow: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: inset 0 1px 0 var(--tile-light); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, var(--ink)); border-color: transparent; color: var(--primary-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger-on-soft); }
.btn-danger:hover { background: var(--danger); color: var(--danger-ink); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field > .lbl { display: flex; justify-content: space-between; gap: 8px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .hint:empty { display: none; }
.input, .select, .textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font-size: 15px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.input, .select { height: 40px; padding: 0 12px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input[type="number"] { font-family: var(--font-mono); }
.input[type="color"] { padding: 4px; height: 40px; width: 56px; cursor: pointer; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.textarea { display: block; padding: 12px 14px; resize: vertical; line-height: 1.6; min-height: 120px; tab-size: 2; }
.textarea.mono, .input.mono { font-family: var(--font-mono); font-size: 13.5px; }
.textarea[readonly] { background: var(--surface-2); }
.input.big { height: 54px; font-size: 22px; font-family: var(--font-mono); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); max-width: 100%; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--line); }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14.5px; color: var(--ink); min-height: 30px; user-select: none; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.range { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.range input { width: 100%; accent-color: var(--primary); cursor: pointer; }
.range output { font-family: var(--font-mono); font-size: 13px; color: var(--ink); min-width: 54px; text-align: center; padding: 3px 8px; border-radius: var(--r-pill); background: var(--surface-2); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; z-index: 1; }
.switch i { pointer-events: none; }
.switch i { position: relative; width: 44px; height: 26px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface-3); flex: none; transition: background var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform var(--t-ui) var(--ease-out); }
.switch input:checked + i { background: var(--primary); border-color: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 3px; }

.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); min-width: 0; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); }
.panel-head .lbl { flex: 1; }
.panel-head .btn-row { gap: 2px; }
.panel-body { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.panel > .textarea { border: 0; border-radius: 0; background: transparent; min-height: 240px; padding: 16px 18px; }
.panel > .textarea:focus { box-shadow: none; outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent); outline-offset: -2px; }
.panel > .textarea[readonly] { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.panel-foot { border-top: 1px solid var(--line); padding: 10px 18px; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 16px; flex-wrap: wrap; }

.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.split.side-right { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
.split > *, .grid-2 > *, .grid-3 > *, .panel-body > *, .stack > * { min-width: 0; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.stat { padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; box-shadow: var(--shadow); }
.stat .v { font-family: var(--font-mono); font-size: 26px; line-height: 1.15; color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: -0.03em; }
.stat .s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.stat.hl { background: var(--shelf-soft); border-color: var(--shelf-line); box-shadow: inset 0 3px 0 var(--shelf), var(--shadow); }
.stat.hl .lbl { color: var(--ink-2); }
.big-out { font-family: var(--font-mono); font-size: 34px; line-height: 1.15; overflow-wrap: anywhere; color: var(--ink); letter-spacing: -0.03em; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); max-width: 100%; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; position: sticky; top: 0; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); }
.table .mono { font-size: 13px; }

.drop {
  position: relative; display: grid; place-items: center; gap: 12px; min-height: 200px; padding: 30px 22px; border: 2px dashed var(--shelf-line); border-radius: var(--r-lg);
  background: var(--shelf-soft); text-align: center; cursor: pointer;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}
.drop:hover { border-color: var(--shelf); }
.drop.over { background: var(--shelf); color: var(--shelf-ink); border-style: solid; border-color: var(--shelf); transform: scale(1.01); }
.drop.over .hint { color: var(--shelf-ink); }
.drop.compact { min-height: 0; padding: 16px; grid-auto-flow: column; justify-content: center; }
.drop > svg { width: 48px; height: 48px; padding: 11px; border-radius: var(--r); background: var(--shelf); color: var(--shelf-ink); stroke-width: 2; box-shadow: inset 0 1px 0 var(--tile-light), var(--shadow); }
.drop.over > svg { background: var(--shelf-ink); color: var(--shelf); }
.drop.compact > svg { width: 34px; height: 34px; padding: 8px; }
.drop .t { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.drop .hint { font-size: 13.5px; color: var(--ink-2); max-width: 46ch; }
.drop .btn { background: var(--surface); }
.drop input[type="file"] { display: none; }

.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.files li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.files .badge { height: 48px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--shelf-soft); color: var(--ink); font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; overflow: hidden; }
.files .thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); display: block; }
.files .name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .meta { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .meta .good { color: var(--success-on-soft); }
.files .meta .bad { color: var(--danger-on-soft); }
.files li.dragging { opacity: 0.5; }

.note { font-size: 13px; color: var(--ink-3); }
.note strong { color: var(--ink-2); font-weight: 600; }
.msg { padding: 12px 14px; font-size: 14px; border-radius: var(--r-sm); border: 1px solid currentColor; }
.msg.err { background: var(--danger-soft); color: var(--danger-on-soft); }
.msg.ok { background: var(--success-soft); color: var(--success-on-soft); }
.msg.warn { background: var(--warning-soft); color: var(--warning-on-soft); }
.msg.info { background: var(--info-soft); color: var(--info-on-soft); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.tag.ok { color: var(--success-on-soft); background: var(--success-soft); }
.tag.bad { color: var(--danger-on-soft); background: var(--danger-soft); }
.tag.warn { color: var(--warning-on-soft); background: var(--warning-soft); }
.meter { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); position: relative; overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: var(--r-pill); background: var(--shelf); transition: width var(--t-ui) var(--ease); }
.meter.ok > i { background: var(--success); }
.meter.warn > i { background: var(--warning); }
.meter.bad > i { background: var(--danger); }
.checker {
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, var(--surface-3) 25%, transparent 25%), linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--surface-3) 75%), linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.preview { border: 1px solid var(--line); border-radius: var(--r); display: grid; place-items: center; min-height: 240px; overflow: auto; padding: 14px; background: var(--surface); }
.preview img, .preview canvas, .preview svg { max-width: 100%; height: auto; display: block; }
.empty { display: grid; place-items: center; min-height: 180px; padding: 28px; text-align: center; }
.empty .in { max-width: 380px; display: grid; gap: 10px; justify-items: center; }
.empty h2 { font-size: 22px; letter-spacing: -0.03em; }
.empty p { color: var(--ink-2); font-size: 14.5px; }
.hl-match { background: color-mix(in srgb, var(--shelf) 32%, transparent); color: var(--ink); border-radius: 3px; text-decoration: underline 2px var(--shelf); text-underline-offset: 3px; }
.hl-alt { background: var(--info-soft); color: var(--ink); border-radius: 3px; text-decoration: underline 2px var(--info); text-underline-offset: 3px; }
.diff-add { background: var(--success-soft); color: var(--success-on-soft); border-radius: 3px; }
.diff-del { background: var(--danger-soft); color: var(--danger-on-soft); border-radius: 3px; text-decoration: line-through; text-decoration-thickness: 1px; }
.code-out { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 14px 16px; min-height: 120px; max-height: 560px; overflow: auto; background: var(--bg); color: var(--ink); border-radius: var(--r-sm); }
.swatch { width: 100%; aspect-ratio: 1; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }

/* ================= Menu ================= */
.menu { position: fixed; z-index: 70; min-width: 230px; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 6px; box-shadow: var(--shadow-lift); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); cursor: pointer; text-align: left; font-size: 14px; white-space: nowrap; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.menu .lbl { padding: 8px 10px 4px; }

/* ================= Command palette ================= */
.layer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding-top: 110px; visibility: hidden; transition: visibility 0s 200ms; }
.layer.open { visibility: visible; transition: visibility 0s; }
.scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--overlay) 55%, transparent); opacity: 0; transition: opacity 200ms var(--ease); }
.layer.open .scrim { opacity: 1; }
.pal {
  position: relative; width: min(660px, calc(100vw - 48px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: scale(0.96) translateY(-8px); transition: transform 200ms var(--ease-out), opacity 200ms var(--ease);
}
.layer.open .pal { opacity: 1; transform: none; }
.pal-head { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.pal-head svg { color: var(--ink-3); }
.pal-head input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 17px; color: var(--ink); caret-color: var(--primary); }
.pal-head input::placeholder { color: var(--ink-3); }
.pal-list { list-style: none; margin: 0; padding: 8px; max-height: 420px; overflow: auto; }
.pal-list .gh { padding: 10px 10px 6px; }
.pal-list li[role="option"] { position: relative; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); cursor: pointer; }
.pal-list li[role="option"] .tile { --ts: 30px; }
.pal-list li[role="option"] .tile svg { width: 16px; height: 16px; }
.pal-list li[role="option"] > svg { color: var(--ink-3); margin: 0 6px; }
.pal-list li[aria-selected="true"] { background: var(--surface-2); color: var(--ink); }
.pal-list li[aria-selected="true"] > svg { color: var(--primary); }
.pal-list .lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pal-list .sub { color: var(--ink-3); font-size: 12.5px; margin-left: 8px; font-weight: 400; }
.pal-list mark { background: none; color: var(--primary); font-weight: 700; }
.pal-list .keys { display: flex; gap: 4px; }
.pal-list .empty-row { padding: 36px 10px; text-align: center; color: var(--ink-3); }
.pal-foot { display: flex; align-items: center; gap: 16px; height: 42px; padding: 0 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; flex: none; background: var(--surface-2); }
.pal-foot span { display: inline-flex; align-items: center; gap: 6px; }
.pal-foot .count { margin-left: auto; font-family: var(--font-mono); }

/* ================= Dialog ================= */
.dlg { position: fixed; inset: 0; z-index: 110; display: none; place-items: center; padding: 20px; }
.dlg.open { display: grid; }
.dlg .scrim { opacity: 1; }
.dlg-box { position: relative; width: min(640px, 100%); max-height: calc(100dvh - 40px); overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.55); }
.dlg-box .panel-body { padding: 24px; }
.dlg-box h2 { font-size: 26px; overflow-wrap: anywhere; }
.dlg-box p { color: var(--ink-2); }
.dlg-box .tool-list { grid-template-columns: 1fr 1fr; }

/* ================= Settings ================= */
.set-wrap { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 48px; align-items: start; }
.set-nav { position: sticky; top: 0; list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.set-nav a { display: block; padding: 9px 14px; color: var(--ink-2); text-decoration: none; border-radius: var(--r-sm); font-weight: 500; }
.set-nav a:hover { color: var(--ink); background: var(--surface-2); }
.set-nav a[aria-current="true"] { color: var(--ink); background: var(--primary-soft); font-weight: 700; }
.set-sec { margin-bottom: 40px; scroll-margin-top: 24px; }
.set-sec h2 { font-size: 26px; letter-spacing: -0.035em; margin-bottom: 8px; }
.set-sec > p { color: var(--ink-2); margin-bottom: 14px; }
.set-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .txt { flex: 1; min-width: 0; }
.set-row .txt b { font-weight: 700; display: block; }
.set-row .txt span { font-size: 13px; color: var(--ink-3); }
.set-card.danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.set-card.danger .set-row { border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.set-row > .proof, .set-row > .table-wrap { flex: 1; }
.proof { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); background: var(--bg); padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.foot-credit { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-credit a { color: var(--ink-2); }
.static-intro { padding: 40px 32px; max-width: 760px; }
.static-intro h1 { font-size: 40px; margin-bottom: 14px; }
.static-intro p { color: var(--ink-2); margin-bottom: 8px; }


/* ================= Instant answers ================= */
.answers { display: grid; gap: 12px; margin-bottom: 28px; }
.answer { display: grid; gap: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--shelf-soft); border: 1px solid var(--shelf-line); box-shadow: var(--shadow); animation: rise 360ms var(--ease-out) backwards; }
.ans-main { display: flex; gap: 18px; align-items: center; min-width: 0; }
.ans-text { min-width: 0; display: grid; gap: 4px; }
.ans-kind { font-size: 13px; font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-kind span { font-weight: 500; color: var(--ink-3); }
.ans-value { font-family: var(--font-mono); font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; color: var(--ink); overflow-wrap: anywhere; }
.ans-sub { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.ans-swatch { width: 84px; height: 84px; flex: none; border-radius: var(--r); display: flex; align-items: flex-end; padding: 8px; font-family: var(--font-mono); font-size: 11px; box-shadow: inset 0 1px 0 var(--tile-light), inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.ans-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ans-acts .btn { background: var(--surface); padding-left: 6px; }
.ans-acts .btn-primary { background: var(--primary); }
.ans-acts .btn .tile, .tile.xs { --ts: 26px; border-radius: 6px; }
.tile.xs svg { width: 14px; height: 14px; }
.ans-acts .btn .tile svg { width: 14px; height: 14px; }

/* ================= Sidebar: the open shelf ================= */
.nav a.open { color: var(--ink); font-weight: 600; }
.subnav { list-style: none; margin: 2px 0 8px; padding: 0 0 0 46px; position: relative; display: grid; gap: 1px; }
.subnav::before { content: ""; position: absolute; left: 20px; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--shelf-line); }
.nav .subnav a { display: block; height: auto; padding: 5px 10px; border-radius: var(--r-xs); color: var(--ink-2); font-size: 13.5px; font-weight: 400; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .subnav a:hover { background: var(--surface-2); color: var(--ink); }
.nav .subnav a[aria-current="page"] { background: var(--shelf-soft); color: var(--ink); font-weight: 600; }
.finder input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.finder .clear { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.finder .clear:hover { background: var(--surface-3); color: var(--ink); }
.home.searching .chips, .home.searching .dropnote { display: none; }
.app.rail .subnav { display: none; }


/* ================= Mascot placements ================= */
.kit-stage { position: relative; padding-top: 66px; flex: none; }
.kit-stage .kit-head { position: absolute; left: 50%; top: 0; width: 104px; transform: translateX(-50%); z-index: 0; transition: transform var(--t-layout) var(--ease-out); }
.kit-stage .file-stack { position: relative; z-index: 1; }
.kit-stage .kit-paws { position: absolute; left: 50%; top: 60px; width: 104px; transform: translateX(-50%); z-index: 2; transition: transform var(--t-layout) var(--ease-out); }
.drop-cell:hover .kit-head, body.dragging-file .kit-head { transform: translate(-50%, -8px) rotate(-4deg); }
.drop-cell:hover .kit-paws, body.dragging-file .kit-paws { transform: translate(-50%, -14px); }
.empty .kitty { margin-bottom: 4px; }
.drop-overlay div { display: flex; align-items: center; gap: 16px; }


/* ================= Footer: where the kitty lives (cursor-eyes-follow, as a footer) ================= */
.kfoot { position: relative; margin-top: 190px; padding: 28px 30px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
/* the kitty lounges on the footer's top edge, paws over the rim */
.kfoot-cat { position: absolute; right: 30px; bottom: calc(100% - 14px); z-index: 2; display: flex; align-items: center; gap: 14px; pointer-events: none; }
.k-cat { position: relative; display: block; width: 236px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--r); pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.k-cat svg { width: 100%; height: auto; display: block; overflow: visible; }
.k-cat:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.k-bubble {
  position: absolute; right: calc(100% + 10px); top: 12px; width: max-content; max-width: 300px; pointer-events: auto;
  padding: 10px 14px; border-radius: var(--r); background: var(--inverse); color: var(--inverse-ink);
  font-size: 14px; line-height: 1.4; font-weight: 500; box-shadow: var(--shadow);
}
.k-bubble::after { content: ""; position: absolute; right: -6px; top: 14px; width: 13px; height: 13px; background: var(--inverse); transform: rotate(45deg); border-radius: 3px; }
.k-bubble.pop { animation: kpop 320ms var(--ease-out); }
@keyframes kpop { from { transform: translateX(6px) scale(0.96); opacity: 0.4; } to { transform: none; opacity: 1; } }
.kfoot-text { display: grid; gap: 12px; min-width: 0; }
.kfoot-name { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.kfoot-name b { color: var(--primary); }
.kfoot-line { color: var(--ink-2); max-width: 64ch; }
.kfoot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.kfoot-links a { color: var(--ink); font-weight: 600; text-decoration: none; padding: 4px 0; }
.kfoot-links a:hover { color: var(--link); text-decoration: underline; }
.kfoot-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.kfoot-bottom a { color: var(--ink-2); }
.kfoot-right { display: inline-flex; align-items: center; gap: 14px; }
.k-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }

/* the rig: parts that move */
.k-cat .k-eye { transform-box: fill-box; transform-origin: center; transition: transform 80ms var(--ease); }
.k-cat .k-shut, .k-cat .k-joy { opacity: 0; transition: opacity 120ms var(--ease); }
.kfoot.blink .k-eye { transform: scaleY(0.08); }
.kfoot.nap .k-eye, .kfoot.purr .k-eye { opacity: 0; }
.kfoot.nap .k-shut { opacity: 1; }
.kfoot.purr .k-joy { opacity: 1; }
.k-cat .k-tail { transform-box: view-box; transform-origin: 134px 88px; transition: transform 400ms var(--ease-out); }
.kfoot.attn .k-tail { animation: kswish 1.4s var(--ease) infinite alternate; }
@keyframes kswish { from { transform: rotate(-6deg); } to { transform: rotate(10deg); } }
.k-cat .k-body { transform-box: view-box; transform-origin: 90px 104px; }
.kfoot.nap .k-body { animation: kbreathe 3.2s ease-in-out infinite; }
@keyframes kbreathe { 50% { transform: scaleY(1.035); } }
.k-cat .k-head { transition: transform 320ms var(--ease-out); }
.kfoot.nap .k-head { transform: translate(4px, 14px) scale(1.14) rotate(-6deg); }
.kfoot.purr .k-tilt { animation: kpurr 600ms var(--ease-out); }
@keyframes kpurr { 20% { transform: rotate(-5deg); } 45% { transform: rotate(4deg); } 70% { transform: rotate(-2deg); } }
.k-zz { position: absolute; left: 70px; top: -14px; display: none; font-family: var(--font-display); font-weight: 700; color: var(--ink-3); pointer-events: none; }
.kfoot.nap .k-zz { display: block; }
.k-zz i { position: absolute; font-style: normal; opacity: 0; animation: kzz 3s var(--ease) infinite; }
.k-zz i:nth-child(1) { font-size: 14px; }
.k-zz i:nth-child(2) { font-size: 18px; animation-delay: 1s; }
.k-zz i:nth-child(3) { font-size: 23px; animation-delay: 2s; }
@keyframes kzz { 0% { opacity: 0; transform: translate(0, 0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(26px, -46px); } }
.k-heart { position: absolute; top: 4px; color: var(--kit-nose); pointer-events: none; animation: kheart 1s var(--ease-out) forwards; }
.k-heart svg { width: 22px; height: 22px; fill: var(--kit-nose); }
@keyframes kheart { from { opacity: 1; transform: translate(-50%, 0) scale(0.6); } to { opacity: 0; transform: translate(-50%, -54px) scale(1.15); } }


/* ================= Home: shelf cards and A to Z ================= */
.every-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; }
.every-head h2 { font-size: 28px; letter-spacing: -0.04em; }
.every-head .num { font-size: 13px; color: var(--ink-2); padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); }
.every-head .spacer { flex: 1; }
.shelf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.shelf-card { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; animation: rise 460ms var(--ease-out) backwards; transition: border-color var(--t-ui) var(--ease), transform var(--t-ui) var(--ease-out), box-shadow var(--t-ui) var(--ease); }
.shelf-card:hover { border-color: var(--shelf-line); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.shelf-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 16px 14px; background: var(--shelf-soft); color: var(--ink); text-decoration: none; }
.shelf-card-head .sc-name { display: grid; gap: 2px; min-width: 0; }
.shelf-card-head b { font-size: 17px; letter-spacing: -0.02em; }
.shelf-card-head .sc-name span { font-size: 13px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-card-head .num { align-self: start; font-size: 12px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); }
.shelf-card ul { list-style: none; margin: 0; padding: 8px; display: grid; gap: 1px; flex: 1; }
.shelf-card li a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.shelf-card li a:hover { background: var(--shelf-soft); }
.sc-more { display: flex; align-items: center; gap: 6px; margin: 0 8px 10px; padding: 8px; border-radius: var(--r-sm); color: var(--link); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.sc-more:hover { background: var(--surface-2); }
.tile.xs { --ts: 24px; border-radius: 6px; }
.tile.xs svg { width: 13px; height: 13px; }
.shelf-grid > :nth-child(3n+2) { animation-delay: 50ms; } .shelf-grid > :nth-child(3n) { animation-delay: 100ms; }
.az { columns: 4 220px; column-gap: 24px; }
.az-group { break-inside: avoid; margin-bottom: 18px; }
.az-group h3 { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; color: var(--ink-3); padding: 0 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 500; }
.az-group ul { list-style: none; margin: 0; padding: 0; }
.az-group a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: 14.5px; }
.az-group a:hover { background: var(--surface-2); }

/* ================= Results tray and chaining ================= */
.next { margin-top: 28px; padding: 22px; border-radius: var(--r-lg); background: var(--shelf-soft); border: 1px solid var(--shelf-line); display: grid; gap: 16px; scroll-margin-top: 20px; animation: rise 420ms var(--ease-out) backwards; }
.next-head { display: flex; align-items: center; gap: 14px; }
.next-head > div { flex: 1; min-width: 0; }
.next-head h2 { font-size: 24px; letter-spacing: -0.035em; }
.next .files li { background: var(--surface); }
.next-chain { display: grid; gap: 10px; }
.chain { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.chain-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; transition: border-color var(--t-ui) var(--ease), transform var(--t-ui) var(--ease-out), box-shadow var(--t-ui) var(--ease); }
.chain-btn:hover { border-color: var(--shelf-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.chain-btn:active { transform: scale(0.98); }
.chain-btn span { display: grid; min-width: 0; }
.chain-btn b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-btn small { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-btn .tile { --ts: 34px; }
.chain-btn .tile svg { width: 17px; height: 17px; }
.next-pill { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px 0 10px; border-radius: var(--r-pill); border: 0; background: var(--inverse); color: var(--inverse-ink); font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow-lift); animation: rise 360ms var(--ease-out); }
.next-pill:hover { transform: translateY(-2px); }
@media (max-width: 1180px) { .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .shelf-grid { grid-template-columns: minmax(0, 1fr); }
  .every-head { flex-wrap: wrap; }
  .every-head h2 { font-size: 24px; }
  .shelf-card li a, .az-group a, .sc-more { min-height: 44px; }
  .seg button { height: 44px; }
  .kfoot-bottom a, .k-count { display: inline-block; padding: 12px 0; }
  .next { padding: 16px; }
  .next .files li { grid-template-columns: 48px minmax(0, 1fr); }
  .next .files li > .btn-row { grid-column: 1 / -1; justify-content: flex-end; }
  .next-head { flex-wrap: wrap; }
  .chain { grid-template-columns: minmax(0, 1fr); }
  .next-pill { right: 14px; bottom: 14px; left: 14px; justify-content: center; }
}


/* ================= Collapsed rail ================= */
.app.rail .side-scroll { padding: 8px 12px 12px; }
.app.rail .nav { justify-items: center; }
.app.rail .nav li { width: 48px; }
.app.rail .nav a, .app.rail .nav button { width: 48px; height: 44px; padding: 0; justify-content: center; gap: 0; border-radius: var(--r); }
.app.rail .nav .label, .app.rail .nav .count { position: absolute; width: 0; overflow: hidden; pointer-events: none; }
.app.rail .nav a[aria-current="page"]::before, .app.rail .nav a.open::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--shelf); }
.app.rail .nav-group h6 { position: relative; height: 18px; padding: 0; }
.app.rail .nav-group h6::after { content: ""; position: absolute; left: 50%; top: 8px; width: 24px; height: 2px; border-radius: 2px; background: var(--line); transform: translateX(-50%); }
.app.rail .nav-group + .nav-group { margin-top: 10px; }
.app.rail .side-foot { padding: 10px 12px 12px; }
.app.rail .brand { padding: 0 17px; }
.nav .tip { display: none; align-items: center; gap: 8px; font-weight: 600; box-shadow: var(--shadow); }
.nav .tip .num { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; opacity: 0.7; }
.app.rail .nav .tip { display: flex; }
.nav .tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: var(--inverse); transform: translateY(-50%) rotate(45deg); border-radius: 2px; }


/* ================= Built page text (how-to, questions, related) ================= */
.page .seo-guide .rel { display: none; } /* the app shows the same links as chips */
.seo-guide { margin-top: 48px; display: grid; gap: 28px; max-width: 820px; }
.seo-guide h2 { font-size: 22px; letter-spacing: -0.03em; margin-bottom: 10px; }
.seo-guide h3 { font-size: 16px; letter-spacing: -0.01em; margin: 16px 0 4px; line-height: 1.3; }
.seo-guide p, .seo-guide li { color: var(--ink-2); }
.seo-guide ol { padding-left: 22px; display: grid; gap: 6px; margin: 0; }
.seo-guide ul.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seo-guide ul.links a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.seo-guide ul.links a:hover { border-color: var(--line-strong); }
.static-intro .lede { font-size: 17px; color: var(--ink); max-width: 64ch; }
.static-intro .crumbs-static { font-size: 14px; color: var(--ink-3); margin-bottom: 14px; }
.static-intro .directory { columns: 3 240px; column-gap: 28px; margin-top: 24px; }
.static-intro .directory section { break-inside: avoid; margin-bottom: 18px; }
.static-intro .directory h2 { font-size: 16px; margin-bottom: 6px; }
.static-intro .directory ul { list-style: none; padding: 0; margin: 0; }
.static-intro .directory a { color: var(--link); }
@media (max-width: 767px) { .seo-guide ul.links a { height: 44px; } }

/* ================= Entry motion ================= */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bento > .cell, .shelf, .tool-head, .tool-body > * { animation: rise 460ms var(--ease-out) backwards; }
.bento > .cell:nth-child(2) { animation-delay: 40ms; } .bento > .cell:nth-child(3) { animation-delay: 80ms; }
.bento > .cell:nth-child(4) { animation-delay: 120ms; } .bento > .cell:nth-child(5) { animation-delay: 160ms; }
.bento > .cell:nth-child(6) { animation-delay: 200ms; } .bento > .cell:nth-child(7) { animation-delay: 240ms; }
.bento > .cell:nth-child(8) { animation-delay: 280ms; }
.tool-body > *:nth-child(2) { animation-delay: 60ms; } .tool-body > *:nth-child(3) { animation-delay: 120ms; }

/* ================= Responsive ================= */
.top .menu-btn { display: none; }
@media (max-width: 1180px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split.side-right { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .set-wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .set-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .searchbtn { width: auto; }
  .searchbtn span, .searchbtn kbd { display: none; }
}
@media (max-width: 767px) {
  .app, .app.rail { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(var(--side-w), 86vw); transform: translateX(-100%); transition: transform 240ms var(--ease); }
  .app.drawer .side { transform: none; box-shadow: var(--shadow-lift); }
  .side-toggle { display: none; }
  .app.rail .nav .label, .app.rail .brand-text, .app.rail .nav-group h6, .app.rail .nav .count, .app.rail .side-credit { opacity: 1; transform: none; }
  .app.rail .nav .tip { display: none; }
  .drawer-scrim { position: fixed; inset: 0; z-index: 15; background: color-mix(in srgb, var(--overlay) 55%, transparent); display: none; }
  .app.drawer .drawer-scrim { display: block; }
  .top .menu-btn { display: inline-flex; margin-left: -8px; }
  .crumbs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .top { padding: 0 14px; gap: 8px; }
  .netbadge .wide { display: none; }
  .page { padding: 16px 14px 56px; }
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 12px; }
  .cell.w2 { grid-column: auto; }
  .cell.h2 { grid-row: auto; }
  .cell { min-height: 170px; padding: 18px; }
  .cell.head { padding: 24px 20px; min-height: 0; }
  .finder { height: 54px; padding-left: 16px; }
  .finder kbd { display: none; }
  .finder input { font-size: 16px; }
  .big-zero { font-size: 48px; }
  .btn-sm, .mini-list a { min-height: 44px; }
  .nav .subnav a { padding: 11px 10px; }
  .ans-value { font-size: 24px; }
  .ans-main { align-items: flex-start; }
  .quick a { height: 44px; }
  .cell .lab .go { padding: 10px 0; }
  .tool-head { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .tool-head .tile { --ts: 52px; grid-row: auto; }
  .tool-head h1 { font-size: 27px; align-self: center; }
  .tool-head .desc { grid-column: 1 / -1; }
  .tool-head .acts { grid-row: auto; grid-column: 1 / -1; }
  .tool-head.plain { grid-template-columns: minmax(0, 1fr); }
  .tool-head.plain .acts { grid-column: 1; }
  .tool-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .shelf-head h2 { font-size: 22px; }
  .dlg-box .tool-list { grid-template-columns: minmax(0, 1fr); }
  .set-row { flex-wrap: wrap; }
  .layer { padding-top: 12px; }
  .pal { width: calc(100vw - 24px); }
  .pal-list { max-height: calc(100dvh - 12px - 62px - 42px - 32px); }
  .pal-list .keys, .pal-foot span:not(.count) { display: none; }
  .btn, .input, .select { min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .btn-icon { width: 44px; }
  .btn-sm.btn-icon { width: 44px; }
  .seg button { height: 44px; }
  .top .btn-icon, .top .searchbtn, .netbadge { height: 44px; min-width: 44px; justify-content: center; }
  .home .chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -14px; padding-right: 14px; scrollbar-width: none; }
  .home .chip { flex: none; }
  .chip { height: 44px; }
  .nav a, .nav button { height: 44px; }
  .check { min-height: 44px; }
  .big-out { font-size: 26px; }
}
.kfoot-mobile-anchor {}
@media (max-width: 767px) {
  .kfoot { margin-top: 160px; padding: 22px 18px 18px; }
  .kfoot-cat { right: 12px; bottom: calc(100% - 12px); gap: 10px; }
  .k-cat { width: 176px; }
  .k-bubble { top: 4px; max-width: calc(100vw - 236px); font-size: 13px; padding: 8px 11px; }
  .kfoot-links a { padding: 10px 0; }
}
@media (min-width: 768px) { .drawer-scrim { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; scroll-behavior: auto !important; }
  .pal { transform: none; }
  .kfoot.nap .k-zz i { opacity: 1; transform: translate(calc(var(--i, 0) * 12px), calc(var(--i, 0) * -14px)); }
}
