/* ==========================================================================
   Toolqik — design system
   "Spec sheet" aesthetic: warm paper / warm black, acid-lime signal colour,
   mono labels, hairline rules, dotted grid.
   ========================================================================== */

@view-transition { navigation: auto; }

/* Self-hosted variable fonts (SIL OFL, licences in /fonts/). No third-party request. */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/bricolage-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/bricolage-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: .22s;

  --topbar-h: 64px;
  --maxw: 1240px;

  /* Light (default) */
  --bg: #f3f2ea;
  --bg-dot: rgba(23, 24, 15, .085);
  --surface: #fbfaf5;
  --surface-2: #efede3;
  --surface-3: #e4e1d4;
  --line: #dcd9ca;
  --line-strong: #c3bfac;
  --text: #17180f;
  --text-2: #45463a;
  --muted: #727366;
  --accent: #c8f031;
  --accent-hover: #bde21f;
  --accent-ink: #141508;
  --accent-text: #4a6200;
  --accent-soft: rgba(150, 190, 0, .16);
  --accent-glow: rgba(190, 235, 30, .35);
  --warn: #b5470b;
  --warn-soft: rgba(234, 108, 12, .12);
  --danger: #c0262d;
  --danger-soft: rgba(220, 38, 38, .1);
  --ok: #187a3a;
  --ok-soft: rgba(22, 163, 74, .13);
  --info: #2450c9;
  --info-soft: rgba(37, 99, 235, .1);
  --shadow-sm: 0 1px 2px rgba(30, 30, 10, .06);
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 12px 32px -16px rgba(30, 30, 10, .22);
  --shadow-lg: 0 30px 80px -30px rgba(30, 30, 10, .35);
  --code-key: #7036d6;
  --code-str: #187a3a;
  --code-num: #b5470b;
  --code-bool: #2450c9;
  --code-null: #8a8b7e;
  --code-punc: #8a8b7e;
  --tok-h: #d6336c;
  --tok-p: #7036d6;
  --tok-s: #0b7a8a;
  --mark-1: rgba(200, 240, 49, .55);
  --mark-2: rgba(120, 180, 255, .45);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d0a;
    --bg-dot: rgba(236, 237, 228, .06);
    --surface: #131410;
    --surface-2: #1a1b16;
    --surface-3: #24251e;
    --line: #2a2b23;
    --line-strong: #3d3e33;
    --text: #ecede4;
    --text-2: #c3c4b8;
    --muted: #8b8c7f;
    --accent: #d4ff3a;
    --accent-hover: #e2ff6e;
    --accent-ink: #10110a;
    --accent-text: #d4ff3a;
    --accent-soft: rgba(212, 255, 58, .1);
    --accent-glow: rgba(212, 255, 58, .22);
    --warn: #ffa066;
    --warn-soft: rgba(255, 140, 70, .1);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, .1);
    --ok: #7ee08f;
    --ok-soft: rgba(126, 224, 143, .1);
    --info: #8ab4ff;
    --info-soft: rgba(138, 180, 255, .1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 40px -18px rgba(0, 0, 0, .7);
    --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, .8);
    --code-key: #c4a7ff;
    --code-str: #b6f08a;
    --code-num: #ffb27a;
    --code-bool: #8ab4ff;
    --code-null: #8b8c7f;
    --code-punc: #75766a;
    --tok-h: #ff7aa2;
    --tok-p: #c4a7ff;
    --tok-s: #5fd4e0;
    --mark-1: rgba(212, 255, 58, .32);
    --mark-2: rgba(138, 180, 255, .32);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0d0a;
  --bg-dot: rgba(236, 237, 228, .06);
  --surface: #131410;
  --surface-2: #1a1b16;
  --surface-3: #24251e;
  --line: #2a2b23;
  --line-strong: #3d3e33;
  --text: #ecede4;
  --text-2: #c3c4b8;
  --muted: #8b8c7f;
  --accent: #d4ff3a;
  --accent-hover: #e2ff6e;
  --accent-ink: #10110a;
  --accent-text: #d4ff3a;
  --accent-soft: rgba(212, 255, 58, .1);
  --accent-glow: rgba(212, 255, 58, .22);
  --warn: #ffa066;
  --warn-soft: rgba(255, 140, 70, .1);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .1);
  --ok: #7ee08f;
  --ok-soft: rgba(126, 224, 143, .1);
  --info: #8ab4ff;
  --info-soft: rgba(138, 180, 255, .1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 40px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, .8);
  --code-key: #c4a7ff;
  --code-str: #b6f08a;
  --code-num: #ffb27a;
  --code-bool: #8ab4ff;
  --code-null: #8b8c7f;
  --code-punc: #75766a;
  --tok-h: #ff7aa2;
  --tok-p: #c4a7ff;
  --tok-s: #5fd4e0;
  --mark-1: rgba(212, 255, 58, .32);
  --mark-2: rgba(138, 180, 255, .32);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: -30vh -10vw auto auto;
  width: 70vw;
  height: 70vh;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  opacity: .5;
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
  animation: glow-drift 18s ease-in-out infinite alternate;
}

@keyframes glow-drift {
  to { transform: translate3d(-12vw, 8vh, 0) scale(1.15); }
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent-text); }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); padding: .08em .38em; border-radius: 6px; font-size: .85em; }
kbd {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .4em;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  font-size: .72rem; color: var(--muted); background: var(--surface); line-height: 1;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; font-weight: 600;
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  margin: 0 0 .6em;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { font-size: 1.12rem; color: var(--text-2); max-width: 60ch; }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 1.8s ease-out infinite;
  display: inline-block;
}
html:not([data-theme="dark"]) .live-dot { background: #7fa300; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .live-dot { background: var(--accent); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  view-transition-name: topbar;
}
.topbar-inner {
  max-width: var(--maxw); height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em; }
.brand-word b { color: var(--accent-text); font-weight: 800; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 22px; height: 22px; }
.brand-mark i { border-radius: 3px; background: var(--text); transition: transform .4s var(--ease-spring), background var(--dur); }
.brand-mark i:nth-child(2) { background: var(--accent); }
html:not([data-theme="dark"]) .brand-mark i:nth-child(2) { background: #a8d10f; }
.brand:hover .brand-mark i:nth-child(1) { transform: translate(2px, 2px) rotate(90deg); }
.brand:hover .brand-mark i:nth-child(4) { transform: translate(-2px, -2px) rotate(90deg); }
.brand-caret { width: 9px; height: 1.05em; background: var(--accent-text); margin-left: -6px; animation: blink 1.1s steps(1) infinite; border-radius: 1px; }
@keyframes blink { 50% { opacity: 0; } }

.search-trigger {
  flex: 1; max-width: 360px; margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: .92rem; cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur) var(--ease-out);
}
.search-trigger span { flex: 1; text-align: left; }
.search-trigger:hover { border-color: var(--line-strong); box-shadow: 0 0 0 4px var(--accent-soft); }

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--text-2); transition: background var(--dur), color var(--dur); }
.topnav a:hover { background: var(--surface-2); color: var(--text); }

.theme-toggle .icon { transition: transform .5s var(--ease-spring), opacity .3s; }
.theme-toggle { position: relative; }
.theme-toggle .i-moon { position: absolute; }
.theme-toggle .i-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-toggle .i-moon { opacity: 1; }
:root[data-theme="dark"] .theme-toggle .i-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
}

/* Circular reveal when switching themes */
.theme-switching * { view-transition-name: none !important; }
.theme-switching::view-transition-old(root) { animation: none; }
.theme-switching::view-transition-new(root) { animation: theme-reveal .6s var(--ease-out); mix-blend-mode: normal; }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--tx, 50%) var(--ty, 0)); }
  to { clip-path: circle(var(--tr, 150vmax) at var(--tx, 50%) var(--ty, 0)); }
}

/* Cross-document page transitions */
::view-transition-old(root) { animation: page-out .18s ease-in both; }
::view-transition-new(root) { animation: page-in .32s var(--ease-out) both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
::view-transition-group(*) { animation-duration: .38s; animation-timing-function: var(--ease-out); }

/* --------------------------------------------------------------------------
   Buttons, inputs, controls
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--btn-bg); color: var(--text);
  font: inherit; font-weight: 600; font-size: .94rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: transform .15s var(--ease-out), background var(--dur), border-color var(--dur), box-shadow var(--dur), color var(--dur);
  overflow: hidden;
}
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn kbd { margin-left: 2px; background: transparent; border-color: currentColor; color: inherit; opacity: .55; }

.btn-primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 6px 20px -8px var(--accent-glow), inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; box-shadow: 0 10px 28px -8px var(--accent-glow), inset 0 -2px 0 rgba(0, 0, 0, .12); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease-out);
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(120%); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger:hover { color: var(--danger); background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 10px; font-size: .84rem; border-radius: 9px; gap: 6px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 1.02rem; border-radius: 14px; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }

.spin-on-busy { transition: transform .5s var(--ease-out); }
.btn.is-busy .spin-on-busy, .btn-generate:active .spin-on-busy { transform: rotate(-200deg); }
.btn.is-busy { pointer-events: none; }

/* Copy button with icon morph */
.swap-icons { position: relative; display: inline-grid; width: 1.15em; height: 1.15em; }
.swap-icons .icon { position: absolute; inset: 0; transition: transform .35s var(--ease-spring), opacity .2s; }
.swap-icons .i-check { opacity: 0; transform: scale(.3) rotate(-45deg); }
.copy-btn.is-copied { color: var(--ok); }
.copy-btn.is-copied .i-copy { opacity: 0; transform: scale(.3) rotate(45deg); }
.copy-btn.is-copied .i-check { opacity: 1; transform: none; }
.copy-label:empty { display: none; }

.input {
  width: 100%; min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .95rem;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { resize: vertical; line-height: 1.55; min-height: 120px; }
.input.mono { font-family: var(--font-mono); font-size: .88rem; }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }

.select { position: relative; display: block; }
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.75px 1.75px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select { appearance: none; padding-right: 36px; cursor: pointer; }

.input-group { display: flex; gap: 8px; align-items: stretch; position: relative; }
.input-group .input { flex: 1; min-width: 0; }
.input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-group:has(.input-icon) .input { padding-left: 40px; }
.input-group-lg .input { min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.input-group-lg .btn { height: auto; min-height: 54px; border-radius: 14px; padding: 0 22px; }

.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--text-2); padding: 0; }
.range-value { font-family: var(--font-mono); font-weight: 600; color: var(--text); font-size: .9rem; }
.range-value output { display: inline-block; min-width: 2ch; text-align: right; transition: transform .15s var(--ease-spring); }
.range-value output.bump { transform: scale(1.25); color: var(--accent-text); }

input[type="range"] {
  --p: 50%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent-text) var(--p), var(--surface-3) var(--p));
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--accent-text); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent-text);
  transition: transform .2s var(--ease-spring);
}
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:focus-visible::-webkit-slider-thumb { transform: scale(1.18); box-shadow: 0 0 0 6px var(--accent-soft); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.3); }
input[type="range"]:focus-visible { outline: none; }

/* Chips (checkbox toggles) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--text-2);
  font-size: .86rem; font-weight: 500;
  transition: background var(--dur), border-color var(--dur), color var(--dur), transform .2s var(--ease-spring);
}
.chip span::before {
  content: ""; width: 14px; height: 14px; border-radius: 5px; border: 1.5px solid var(--line-strong);
  transition: background var(--dur), border-color var(--dur), transform .25s var(--ease-spring);
  background-position: center; background-repeat: no-repeat; background-size: 10px;
}
.chip:hover span { border-color: var(--line-strong); }
.chip input:checked + span { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-text) 45%, transparent); color: var(--text); }
.chip input:checked + span::before {
  background-color: var(--accent-text); border-color: var(--accent-text); transform: scale(1.08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .chip input:checked + span::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310110a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip input:checked + span::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310110a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  }
}
.chip input:active + span { transform: scale(.95); }
.chip input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
#dns-types .chip span::before, #rx-flags .chip span::before { display: none; }

/* Segmented control */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  width: fit-content; max-width: 100%;
}
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border-radius: 9px; font-size: .86rem; font-weight: 500; color: var(--muted); white-space: nowrap;
  transition: background var(--dur), color var(--dur), box-shadow var(--dur), transform .2s var(--ease-spring);
}
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg input:active + span { transform: scale(.95); }
.seg input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.seg-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.home { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 40px; }

.reveal { animation: reveal .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }

.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  padding: clamp(40px, 8vw, 96px) 0 40px;
}
.hero h1 { font-size: clamp(2.4rem, 1.4rem + 4.2vw, 4.4rem); letter-spacing: -0.045em; line-height: 1.02; font-weight: 800; }
.hero h1 em {
  font-style: normal; display: inline;
  background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 92%, transparent 92%);
  background-size: 0% 100%; background-repeat: no-repeat;
  animation: highlight 1s .5s var(--ease-out) forwards;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
:root[data-theme="dark"] .hero h1 em { color: var(--accent); background: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero h1 em { color: var(--accent); background: none; } }
@keyframes highlight { to { background-size: 100% 100%; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.hero-demo {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: rotate(1.2deg);
  transition: transform .6s var(--ease-spring);
}
.hero-demo:hover { transform: rotate(0) translateY(-4px); }
.demo-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.demo-dots { display: flex; gap: 6px; }
.demo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.demo-dots i:first-child { background: var(--accent); }
.demo-title { font-size: .76rem; color: var(--muted); }
.demo-body { padding: 22px 20px; min-height: 150px; font-size: .9rem; }
.demo-line { margin: 0 0 10px; color: var(--muted); }
.demo-prompt { color: var(--accent-text); font-weight: 600; }
.demo-cmd { color: var(--text); }
.demo-cmd::after { content: ""; display: inline-block; width: 8px; height: 1.05em; background: var(--accent-text); vertical-align: -3px; margin-left: 4px; animation: blink 1s steps(1) infinite; }
.demo-out { margin: 0; color: var(--text); word-break: break-all; font-size: 1.02rem; line-height: 1.6; font-weight: 500; min-height: 3.2em; }
.demo-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px dashed var(--line); font-size: .74rem; color: var(--muted); }
.demo-foot span { display: inline-flex; align-items: center; gap: 6px; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 72px; }
.pillar { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.pillar > .icon { width: 22px; height: 22px; color: var(--accent-text); margin-top: 2px; }
.pillar strong { display: block; margin-bottom: 4px; }
.pillar p { margin: 0; color: var(--muted); font-size: .92rem; }

.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); }
.filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter .input-group { width: 240px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid-tight { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.card {
  --mx: 50%; --my: 0%;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; min-height: 190px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: inherit;
  transition: transform .35s var(--ease-out), border-color var(--dur), box-shadow .35s var(--ease-out);
  animation: reveal .6s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--accent-soft), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-1px) scale(.99); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.card-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  transition: background var(--dur), color var(--dur), transform .45s var(--ease-spring);
}
.card-icon .icon { width: 22px; height: 22px; }
.card:hover .card-icon { background: var(--accent); color: var(--accent-ink); border-color: transparent; transform: rotate(-8deg) scale(1.06); }
.card-num { font-size: .72rem; color: var(--muted); }
.card-title { font-weight: 700; font-size: 1.08rem; letter-spacing: -0.015em; }
.card-text { color: var(--muted); font-size: .9rem; line-height: 1.45; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.card-go { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); transition: transform .35s var(--ease-spring), background var(--dur), color var(--dur); }
.card:hover .card-go { transform: translateX(3px); background: var(--text); color: var(--bg); }
.card.is-hidden { display: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 99px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500; letter-spacing: .02em; white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge-local { background: var(--ok-soft); color: var(--ok); }
.badge-server { background: var(--info-soft); color: var(--info); }

.how { margin: 80px 0 20px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.steps li { padding: 22px 22px 8px 0; border-right: 1px dashed var(--line); }
.steps li + li { padding-left: 22px; }
.steps li:last-child { border-right: 0; }
.step-num { display: block; font-size: 2.6rem; font-weight: 600; color: var(--accent-text); line-height: 1; margin-bottom: 14px; letter-spacing: -0.04em; }
.steps strong { font-size: 1.1rem; }
.steps p { color: var(--muted); margin-top: 4px; }

/* --------------------------------------------------------------------------
   Tool page
   -------------------------------------------------------------------------- */

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }

.sidebar { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 28px 4px 40px 0; scrollbar-width: thin; }
.side-group { margin-bottom: 22px; }
.side-group .eyebrow { margin-left: 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px; text-decoration: none;
  font-size: .9rem; color: var(--text-2);
  transition: background var(--dur), color var(--dur), padding .25s var(--ease-out);
}
.sidebar a .icon { width: 16px; height: 16px; color: var(--muted); transition: color var(--dur); }
.sidebar a:hover { background: var(--surface-2); color: var(--text); padding-left: 14px; }
.sidebar a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.sidebar a[aria-current="page"] .icon { color: var(--accent-text); }
.sidebar a[aria-current="page"]::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent-text); }

.tool-main { padding: 26px 0 40px; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .82rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.tool-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; margin-bottom: 26px; }
.tool-icon {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.tool-icon .icon { width: 28px; height: 28px; }
.tool-heading h1 { margin-bottom: .2em; }
.tool-heading .lede { margin: 0; }
.tool-hero .badge { margin-top: 6px; }

.workbench {
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(16px, 2.5vw, 26px);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation-delay: 80ms;
}

.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 22px; align-items: start; }
.controls-wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.controls-inline { margin: 10px 0; }
/* Groups of controls shown per mode; their children stay in the parent grid. */
.controls-group { display: contents; }
.controls-group[hidden] { display: none; }
.controls-group > * { animation: fade-up .3s var(--ease-out) both; }
.controls-group > .hint { grid-column: 1 / -1; margin: -4px 0 0; }
.hero-value.is-phrase { word-break: normal; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stat { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); padding: 3px 8px; border-radius: 7px; background: var(--surface-2); }
.stat:empty { display: none; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.error-text { color: var(--danger); min-height: 0; }
.error-text:empty { display: none; }

.panel { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel .eyebrow { margin: 0; }

/* Readouts (output panels) */
.readout { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; position: relative; min-width: 0; }
.readout-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.readout-head .eyebrow { margin: 0; }
.readout-actions { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
.readout-body {
  margin: 0; padding: 14px 16px; min-height: 52px; max-height: 520px; overflow: auto;
  font-size: .86rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; tab-size: 2;
  color: var(--text);
}
.readout-body:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; opacity: .8; }
.readout.is-fresh::after {
  content: ""; position: absolute; left: 0; right: 0; top: 44px; height: 40%;
  background: linear-gradient(to bottom, var(--accent-soft), transparent);
  animation: scan .7s var(--ease-out) forwards; pointer-events: none;
}
@keyframes scan { from { transform: translateY(-60%); opacity: 1; } to { transform: translateY(160%); opacity: 0; } }

.out-list { list-style: none; margin: 0; padding: 6px; max-height: 480px; overflow: auto; counter-reset: row; }
.out-list li {
  counter-increment: row;
  display: grid; grid-template-columns: 2.4em 1fr auto; align-items: center; gap: 8px;
  padding: 5px 6px 5px 4px; border-radius: 9px;
  animation: row-in .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms);
  transition: background var(--dur);
}
.out-list li::before { content: counter(row, decimal-leading-zero); font-family: var(--font-mono); font-size: .7rem; color: var(--muted); text-align: right; }
.out-list li:hover { background: var(--surface-2); }
.out-list code { font-size: .86rem; word-break: break-all; }
.out-list .copy-btn { opacity: 0; transition: opacity var(--dur); }
.out-list li:hover .copy-btn, .out-list .copy-btn:focus-visible, .out-list .copy-btn.is-copied { opacity: 1; }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } }

/* Big single-value output (password) */
.hero-out { padding-bottom: 16px; }
.hero-value {
  display: block; padding: 26px 20px 18px; min-height: 90px;
  font-size: clamp(1.15rem, .9rem + 1.3vw, 1.75rem); font-weight: 500; letter-spacing: .02em;
  word-break: break-all; line-height: 1.4;
}
.hero-value .c-d { color: var(--code-bool); }
.hero-value .c-s { color: var(--code-num); }
.hero-actions { padding: 0 20px; display: flex; gap: 10px; flex-wrap: wrap; }

.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 0 20px; }
.meter span { height: 6px; border-radius: 99px; background: var(--surface-3); transition: background .4s var(--ease-out), transform .4s var(--ease-spring); transform-origin: left; }
.meter[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] span:nth-child(-n+2) { background: var(--warn); }
.meter[data-level="3"] span:nth-child(-n+3) { background: #d4b106; }
.meter[data-level="4"] span:nth-child(-n+4) { background: var(--ok); }
.meter[data-level="5"] span:nth-child(-n+5) { background: var(--ok); }
.meter.bump span { animation: meter-bump .45s var(--ease-spring); }
.meter span:nth-child(2) { animation-delay: 40ms !important; }
.meter span:nth-child(3) { animation-delay: 80ms !important; }
.meter span:nth-child(4) { animation-delay: 120ms !important; }
.meter span:nth-child(5) { animation-delay: 160ms !important; }
@keyframes meter-bump { 50% { transform: scaleY(1.8); } }
.meter-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 20px 16px; font-size: .84rem; color: var(--muted); }
.meter-meta b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.meter-label { font-weight: 700; color: var(--text); }

.recent ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.recent button {
  width: 100%; text-align: left; background: transparent; border: 1px dashed var(--line); border-radius: 10px;
  padding: 8px 12px; font-family: var(--font-mono); font-size: .82rem; color: var(--muted); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
  animation: row-in .4s var(--ease-out) both;
}
.recent button:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }

/* Progress bar (bcrypt) */
.progress { flex: 1; min-width: 140px; max-width: 320px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--accent-text) 0 8px, color-mix(in srgb, var(--accent-text) 75%, transparent) 8px 16px); background-size: 22px 100%; border-radius: inherit; transition: width .12s linear; animation: stripes .6s linear infinite; }
@keyframes stripes { to { background-position: 22px 0; } }

.anatomy { display: flex; flex-wrap: wrap; gap: 8px; }
.anatomy span { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-mono); font-size: .8rem; word-break: break-all; animation: row-in .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
.anatomy small { font-family: var(--font-sans); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.anatomy .a-ver { color: var(--tok-h); } .anatomy .a-cost { color: var(--code-num); } .anatomy .a-salt { color: var(--tok-p); } .anatomy .a-hash { color: var(--tok-s); flex: 1; }

/* Verdict (match / no match) */
.verdict:empty { display: none; }
.verdict { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 600; width: fit-content; animation: pop .45s var(--ease-spring); }
.verdict .icon { width: 20px; height: 20px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.bad { background: var(--danger-soft); color: var(--danger); animation: shake .45s var(--ease-out); }
.verdict.neutral { background: var(--surface-2); color: var(--muted); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shake { animation: shake .45s var(--ease-out); }

/* Notices */
.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; line-height: 1.5; border: 1px solid; }
.notice > .icon { margin-top: 2px; width: 18px; height: 18px; }
.notice-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--text-2); }
.notice-info > .icon { color: var(--info); }
.notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text-2); }
.notice-warn > .icon, .notice-warn strong { color: var(--warn); }

.error-box { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); font-size: .88rem; animation: shake .45s var(--ease-out); }
.json-hint { margin: 6px 0 0; color: var(--text); font-weight: 500; }
.error-box pre { margin: 8px 0 0; font-size: .8rem; color: var(--text-2); white-space: pre; overflow-x: auto; }

/* Tabs */
.tabs { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tab-list { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab-list button {
  position: relative; background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; font-size: .92rem;
  color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center;
  transition: color var(--dur);
}
.tab-list button:hover { color: var(--text); }
.tab-list button[aria-selected="true"] { color: var(--text); }
.tab-list button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-text); transform: scaleX(0); transition: transform .35s var(--ease-spring); }
.tab-list button[aria-selected="true"]::after { transform: scaleX(1); }
.tab-panel { display: flex; flex-direction: column; gap: 16px; animation: fade-up .35s var(--ease-out); min-width: 0; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

/* Input ⇄ output */
.io { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
.io > .field textarea { height: 100%; min-height: 200px; }
.io .readout { display: flex; flex-direction: column; }
.io .readout-body { flex: 1; min-height: 200px; }
.io-stack { grid-template-columns: 1fr; }
.btn-swap { align-self: center; border: 1px solid var(--line); background: var(--surface); transition: transform .5s var(--ease-spring), background var(--dur); }
.btn-swap:hover { background: var(--surface-2); }
.btn-swap.spin { transform: rotate(180deg); }

/* Big input (file open, drag & drop, large-text chip) */
.big-input { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.big-input-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.big-input textarea { min-height: 220px; }
.io > .big-input textarea { flex: 1; min-height: 200px; }
.big-file {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  min-height: 120px; padding: 18px; border: 1px solid var(--accent-text); border-radius: 12px;
  background: var(--accent-soft); animation: pop .4s var(--ease-spring);
}
.big-file > .icon { width: 30px; height: 30px; color: var(--accent-text); }
.big-file strong { display: block; word-break: break-all; }
.big-file small { color: var(--muted); font-size: .82rem; }
.drop-overlay {
  position: absolute; inset: 32px 0 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--accent-text); border-radius: 12px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--accent-text); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity var(--dur);
}
.drop-overlay .icon { width: 30px; height: 30px; animation: float 1.6s ease-in-out infinite; }
.big-input.is-dragging .drop-overlay, .big-input.is-reading .drop-overlay { opacity: 1; }
.big-input.is-reading .drop-overlay span::after { content: "…"; }

.readout-note { padding: 8px 14px; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--warn); background: var(--warn-soft); }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.json-status.busy { color: var(--muted); }
.btn.is-working { pointer-events: none; }
.btn.is-working .icon { animation: spin 1s linear infinite; }

/* Dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 150px; padding: 20px; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: border-color var(--dur), background var(--dur), transform .3s var(--ease-spring);
}
.dropzone .icon { width: 28px; height: 28px; color: var(--muted); transition: transform .4s var(--ease-spring); }
.dropzone small { color: var(--muted); }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent-text); background: var(--accent-soft); }
.dropzone.is-over { transform: scale(1.01); }
.dropzone.is-over .icon, .dropzone:hover .icon { transform: translateY(-4px); color: var(--accent-text); }

/* Hash table */
.hash-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.hash-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-top: 1px solid var(--line); transition: background .3s; }
.hash-row:first-child { border-top: 0; }
.hash-row.is-primary { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.hash-alg { font-family: var(--font-mono); font-size: .78rem; font-weight: 600; }
.hash-alg em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .9em; }
.hash-val { font-size: .82rem; word-break: break-all; color: var(--text); background: none !important; border: 0 !important; padding: 0 !important; }
.hash-match { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: var(--bg); transform: scale(0); transition: transform .4s var(--ease-spring); }
.hash-match .icon { width: 14px; height: 14px; }
.hash-row.is-match { background: var(--ok-soft); }
.hash-row.is-match .hash-match { transform: scale(1); }

/* Key/value lists */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0; font-size: .88rem; }
.kv dt, .kv dd { padding: 8px 0; border-top: 1px dashed var(--line); margin: 0; }
.kv dt { color: var(--muted); padding-right: 16px; font-size: .8rem; font-family: var(--font-mono); }
.kv dd { font-family: var(--font-mono); word-break: break-word; animation: fade-up .35s var(--ease-out) both; }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }
.kv-copy dd { cursor: copy; border-radius: 4px; transition: background var(--dur), color var(--dur); }
.kv-copy dd:hover { color: var(--accent-text); }
.kv-copy dd.flash { animation: flash .6s var(--ease-out); }
@keyframes flash { from { background: var(--accent-soft); } }
.kv .tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-family: var(--font-sans); font-weight: 600; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-bad { background: var(--danger-soft); color: var(--danger); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }

.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.table th { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; border-top: 0; }
.table td { font-family: var(--font-mono); word-break: break-word; }
.table td:first-child { color: var(--accent-text); white-space: nowrap; width: 1%; padding-right: 20px; }
.table tbody tr { animation: fade-up .3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 20ms); }
.table tbody tr:hover { background: var(--surface-2); }

/* Syntax highlighting */
.t-key { color: var(--code-key); }
.t-str { color: var(--code-str); }
.t-num { color: var(--code-num); }
.t-bool { color: var(--code-bool); }
.t-null { color: var(--code-null); font-style: italic; }
.t-punc { color: var(--code-punc); }
.t-kw { color: var(--code-key); font-weight: 600; }
.t-com { color: var(--code-null); font-style: italic; }
.t-fn { color: var(--code-bool); }
.json-status { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; margin-left: auto; }
.json-status.ok { color: var(--ok); }
.json-status.bad { color: var(--danger); }

/* JWT */
.jwt-colored { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); word-break: break-all; font-size: .86rem; line-height: 1.7; }
.jwt-colored:empty { display: none; }
.tok-h { color: var(--tok-h); } .tok-p { color: var(--tok-p); } .tok-s { color: var(--tok-s); } .tok-dot { color: var(--muted); }
.jwt-colored span { animation: fade-up .4s var(--ease-out) both; }
.jwt-colored span:nth-child(3) { animation-delay: 80ms; }
.jwt-colored span:nth-child(5) { animation-delay: 160ms; }
.jwt-status { display: inline-flex; gap: 8px; margin-left: auto; }

/* Timestamp clock */
.clock-digits { display: flex; padding: 20px 18px 6px; font-size: clamp(2rem, 1.2rem + 3.5vw, 3.4rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; overflow: hidden; }
.clock-digits .d { display: inline-block; position: relative; width: .62em; text-align: center; }
.clock-digits .d.roll { animation: roll .45s var(--ease-out); }
@keyframes roll { from { transform: translateY(-60%); opacity: 0; filter: blur(2px); } }
.clock-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0 18px 16px; font-size: .82rem; color: var(--muted); }

/* Regex tester */
.regex-bar { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 14px; transition: border-color var(--dur), box-shadow var(--dur); }
.regex-bar:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.regex-bar.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.regex-slash { font-family: var(--font-mono); font-size: 1.2rem; color: var(--muted); }
.regex-pattern { border: 0 !important; box-shadow: none !important; background: transparent; font-size: 1rem !important; min-height: 52px; }
.regex-flags { color: var(--accent-text); font-weight: 600; min-width: 2ch; }
.highlighter { position: relative; border-radius: 12px; }
.highlighter-backdrop, .highlighter-input {
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.55; letter-spacing: normal;
  padding: 10px 13px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word;
  border: 1px solid transparent; border-radius: 12px;
}
.highlighter-backdrop { position: absolute; inset: 0; overflow: hidden; color: transparent; pointer-events: none; }
.highlighter-input { position: relative; background: transparent !important; border-color: var(--line); min-height: 200px; z-index: 1; caret-color: var(--text); }
.highlighter { background: var(--surface); }
.highlighter-backdrop mark { color: transparent; background: var(--mark-1); border-radius: 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-text) 40%, transparent); animation: mark-in .3s var(--ease-out); }
.highlighter-backdrop mark.alt { background: var(--mark-2); box-shadow: 0 0 0 1px color-mix(in srgb, var(--info) 40%, transparent); }
@keyframes mark-in { from { background: transparent; } }
.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; font-size: .84rem; }
.match-list li { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); animation: row-in .3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 25ms); }
.match-list .m-head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-mono); }
.match-list .m-text { color: var(--text); font-weight: 600; word-break: break-all; }
.match-list .m-idx { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.match-list .m-groups { margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-family: var(--font-mono); font-size: .78rem; }
.match-list .m-groups dt { color: var(--accent-text); }
.match-list .m-groups dd { margin: 0; word-break: break-all; color: var(--text-2); }
.match-list .muted { color: var(--muted); background: none; padding: 4px 0; }
.cheats { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cheats summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.cheat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; padding: 0 16px 16px; font-size: .78rem; }
.cheat-grid span { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.cheat-grid b { color: var(--text); font-weight: 600; }

/* Webhook tester */
.wh-idle { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.wh-idle h2 { margin-bottom: .3em; }
.wh-idle p { color: var(--text-2); max-width: 54ch; }
.wh-idle-art { display: grid; place-items: center; width: 110px; height: 110px; border-radius: 28px; background: var(--accent-soft); color: var(--accent-text); }
.wh-art-icon { width: 56px; height: 56px; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-4deg); } }
.wh-live { display: flex; flex-direction: column; gap: 18px; animation: fade-up .45s var(--ease-out); }
.wh-url { display: block; padding: 16px; font-size: clamp(.82rem, .7rem + .5vw, 1rem); word-break: break-all; color: var(--accent-text); font-weight: 500; }
.wh-curl { border-top: 1px dashed var(--line); }
.wh-curl summary { padding: 10px 16px; cursor: pointer; font-size: .86rem; color: var(--muted); }
.wh-curl .readout { margin: 0 12px 12px; }
.wh-grid { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.wh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow: auto; }
.wh-list button {
  width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center;
  padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; cursor: pointer;
  transition: border-color var(--dur), background var(--dur), transform .2s var(--ease-out);
}
.wh-list button:hover { border-color: var(--line-strong); transform: translateX(2px); }
.wh-list button[aria-current="true"] { border-color: var(--accent-text); background: var(--accent-soft); }
.wh-list .wh-path { font-family: var(--font-mono); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-list .wh-meta { grid-column: 2; font-size: .72rem; color: var(--muted); font-family: var(--font-mono); }
.wh-list li.is-new button { animation: arrive .7s var(--ease-spring) both; }
@keyframes arrive { 0% { opacity: 0; transform: translateY(-14px) scale(.96); background: var(--accent-soft); } 60% { opacity: 1; } 100% { background: var(--surface); } }
.method-badge { grid-row: span 2; display: inline-grid; place-items: center; min-width: 58px; height: 26px; padding: 0 8px; border-radius: 8px; font-family: var(--font-mono); font-size: .7rem; font-weight: 600; background: var(--surface-3); color: var(--text); }
.method-badge[data-m="POST"] { background: var(--ok-soft); color: var(--ok); }
.method-badge[data-m="GET"] { background: var(--info-soft); color: var(--info); }
.method-badge[data-m="PUT"], .method-badge[data-m="PATCH"] { background: var(--warn-soft); color: var(--warn); }
.method-badge[data-m="DELETE"] { background: var(--danger-soft); color: var(--danger); }
.wh-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 10px; color: var(--muted); font-size: .9rem; text-align: center; }
.radar { position: relative; width: 64px; height: 64px; }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent-text); opacity: 0; animation: radar 2.4s ease-out infinite; }
.radar span:nth-child(2) { animation-delay: .8s; }
.radar span:nth-child(3) { animation-delay: 1.6s; }
.radar::after { content: ""; position: absolute; inset: 26px; border-radius: 50%; background: var(--accent-text); }
@keyframes radar { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.2); opacity: 0; } }
.wh-detail { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; animation: fade-up .3s var(--ease-out); }
.wh-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wh-detail-head .method-badge { grid-row: auto; }
.wh-detail-head code { font-size: .88rem; word-break: break-all; }
.wh-ended { text-align: center; padding: 30px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--text-2); }

/* DNS */
.dns-form { display: flex; flex-direction: column; gap: 14px; }
.dns-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.dns-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; animation: fade-up .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.dns-card header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.dns-card header b { font-family: var(--font-mono); font-size: .86rem; }
.dns-card ul { list-style: none; margin: 0; padding: 8px 14px 12px; font-family: var(--font-mono); font-size: .82rem; }
.dns-card li { padding: 6px 0; border-top: 1px dashed var(--line); word-break: break-all; animation: row-in .35s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
.dns-card li:first-child { border-top: 0; }
.dns-card li small { color: var(--muted); margin-right: 8px; }
.dns-card .none { color: var(--muted); font-style: italic; font-family: var(--font-sans); }
.dns-card.is-error .none { color: var(--danger); }
.skeleton { height: 12px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.skeleton:nth-child(2) { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------------------------
   Content (SEO prose), FAQ, related
   -------------------------------------------------------------------------- */

.prose { max-width: 72ch; margin: 56px 0 0; color: var(--text-2); }
.prose h2 { color: var(--text); margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose strong { color: var(--text); }
.prose h3 { color: var(--text); font-size: 1.12rem; margin: 1.6em 0 .5em; letter-spacing: -0.01em; }
.prose ol { padding-left: 1.3em; }
.prose :not(pre) > code { padding: .12em .4em; border-radius: 6px; background: var(--surface-2); color: var(--text); font-size: .86em; word-break: break-word; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .9rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; border-top: 0; }
.prose-scroll { overflow-x: auto; }
.prose td small { color: var(--muted); font-size: .8rem; line-height: 1.45; display: inline-block; margin-top: 2px; }
.regex-library td:nth-child(2) code { word-break: break-all; font-size: .8rem; }
.regex-library td:last-child, .json-errors td:last-child, .rs-alphabets td:last-child { width: 1%; white-space: nowrap; vertical-align: middle; }
.rs-alphabets td:first-child code { word-break: break-all; }
.code-tabs { margin: 1em 0 1.6em; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.code-tabs .tab-list { padding: 4px 6px 0; align-items: center; }
.code-tabs-copy { margin-left: auto; padding-bottom: 4px; }
.code-block.code-plain { margin: 1em 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); white-space: pre-wrap; word-break: break-word; }
.code-block { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .82rem; line-height: 1.6; color: var(--text); tab-size: 2; }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color var(--dur); }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 600; color: var(--text); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.2rem; color: var(--muted); transition: transform .35s var(--ease-spring); }
.faq details[open] summary::after { transform: rotate(135deg); color: var(--accent-text); }
.faq details p { margin: 0; padding: 0 16px 16px; }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size .35s var(--ease-out), content-visibility .35s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }

.related { margin-top: 56px; }

.simple { max-width: 820px; margin: 0 auto; padding: 56px 20px 40px; }
.prose-page { margin: 0; max-width: none; }
.prose-page h1 { color: var(--text); }
.prose-page .btn { margin-top: 8px; }
.glitch { position: relative; font-size: clamp(3rem, 2rem + 6vw, 6rem); letter-spacing: -0.05em; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: .7; }
.glitch::before { color: var(--tok-h); animation: glitch 2.2s infinite steps(1); clip-path: inset(0 0 60% 0); }
.glitch::after { color: var(--tok-s); animation: glitch 2.2s .3s infinite steps(1) reverse; clip-path: inset(55% 0 0 0); }
@keyframes glitch { 0%, 88%, 100% { transform: none; } 90% { transform: translate(-3px, 1px); } 94% { transform: translate(3px, -1px); } }

.ad-slot { margin: 32px 0; min-height: 120px; padding: 8px; border-radius: var(--radius-sm); border: 1px dashed var(--line); }
.ad-label { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer { margin-top: 80px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px 20px 28px; display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 28px; }
.footer-brand p { color: var(--muted); font-size: .9rem; margin-top: 12px; max-width: 30ch; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.footer-col a { text-decoration: none; font-size: .88rem; color: var(--text-2); }
.footer-col a:hover { color: var(--accent-text); }
.footer-base { max-width: var(--maxw); margin: 0 auto; padding: 18px 20px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--muted); border-top: 1px dashed var(--line); }
.footer-base a { color: inherit; }

/* --------------------------------------------------------------------------
   Command palette, toasts
   -------------------------------------------------------------------------- */

.palette { padding: 0; border: 0; background: transparent; max-width: min(620px, calc(100vw - 32px)); width: 100%; margin: 12vh auto auto; overflow: visible; color: var(--text); }
.palette::backdrop { background: rgba(10, 10, 6, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.palette[open] .palette-box { animation: palette-in .32s var(--ease-spring); }
.palette[open]::backdrop { animation: fade .25s ease; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
.palette-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input .icon { color: var(--muted); }
.palette-input input { flex: 1; height: 58px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.08rem; outline: none; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 55vh); overflow: auto; }
.palette-list a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; transition: background .12s; }
.palette-list a .p-name { font-weight: 600; }
.palette-list a .p-tag { display: block; font-size: .82rem; color: var(--muted); }
.palette-list a .p-cat { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.palette-list a .p-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); transition: background .12s, transform .25s var(--ease-spring); }
.palette-list a[aria-selected="true"] { background: var(--surface-2); }
.palette-list a[aria-selected="true"] .p-dot { background: var(--accent-text); transform: scale(1.4); }
.palette-list mark { background: var(--accent-soft); color: inherit; border-radius: 3px; }
.palette-list .p-empty { padding: 20px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.palette-foot kbd { margin-right: 4px; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 99px;
  background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toast-in .4s var(--ease-spring);
}
.toast .icon { width: 18px; height: 18px; color: var(--accent); }
:root:not([data-theme="dark"]) .toast .icon { color: #b9e81c; }
.toast.is-error .icon { color: var(--danger); }
.toast.out { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.95); } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .footer-inner { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .sidebar { display: none; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-demo { transform: none; }
  .pillars { grid-template-columns: 1fr; }
  .wh-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 58px; }
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .home, .shell, .simple { padding-left: 16px; padding-right: 16px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { flex: none; width: 40px; padding: 0; justify-content: center; margin-left: auto; }
  .topnav a { display: none; }
  .tool-hero { grid-template-columns: auto 1fr; }
  .tool-hero .badge { grid-column: 1 / -1; justify-self: start; }
  .tool-icon { width: 48px; height: 48px; border-radius: 13px; }
  .io { grid-template-columns: 1fr; }
  .btn-swap { justify-self: center; transform: rotate(90deg); }
  .btn-swap.spin { transform: rotate(270deg); }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 18px 0; border-right: 0; border-bottom: 1px dashed var(--line); }
  .filter, .filter .input-group { width: 100%; }
  .hash-row { grid-template-columns: 1fr auto auto; }
  .hash-row .hash-alg { grid-column: 1 / -1; }
  .wh-idle { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 22px 16px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-top: 1px dashed var(--line); padding-bottom: 0; }
  .kv dd { border-top: 0; padding-top: 2px; }
  .readout-head { flex-wrap: wrap; }
  .input-group-lg { flex-wrap: wrap; }
  .input-group-lg .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   QR code generator
   -------------------------------------------------------------------------- */

.qr-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 28px; align-items: start; }
.qr-inputs { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.qr-fields { display: grid; gap: 14px; margin-top: 16px; animation: fade-up .3s var(--ease-out) both; }
.qr-fields[hidden] { display: none; }
.qr-style { padding-top: 18px; border-top: 1px dashed var(--line); }
.qr-color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.qr-color { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .86rem; }
.qr-color input { inline-size: 28px; block-size: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.qr-color input::-webkit-color-swatch-wrapper { padding: 0; }
.qr-color input::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 50%; }
.qr-color input::-moz-color-swatch { border: 1px solid var(--line); border-radius: 50%; }

.qr-output { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.qr-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 18px 18px; }
.qr-preview { width: 100%; max-width: 340px; line-height: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .35); transition: transform .25s var(--ease-spring); }
.qr-preview:empty { box-shadow: none; }
.qr-preview svg { width: 100%; height: auto; display: block; }
.qr-preview.is-fresh { animation: qr-reveal .7s var(--ease-out) both; }
@keyframes qr-reveal {
  from { clip-path: circle(0% at 50% 50%); transform: scale(.94); }
  to { clip-path: circle(75% at 50% 50%); transform: none; }
}
.qr-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--muted); font-size: .92rem; }
.qr-stats { margin: 0; font-size: .76rem; color: var(--muted); text-align: center; }
.qr-warn { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: .84rem; }
.qr-actions { justify-content: center; }
.qr-payload summary { cursor: pointer; font-size: .86rem; color: var(--muted); padding: 4px 0; }
.qr-payload .readout { margin-top: 8px; }
.qr-payload .readout-body { white-space: pre-wrap; word-break: break-all; }
@media (max-width: 820px) {
  .qr-layout { grid-template-columns: 1fr; }
  .qr-output { position: static; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
  .bg-glow { animation: none; }
}

/* ------------------------------------------------------------ Cron */
.cron-main { display: flex; flex-direction: column; gap: 10px; }
.cron-input { font-size: 1.35rem !important; letter-spacing: .04em; }
.cron-main .input-group .copy-btn { height: auto; }
.cron-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cron-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cron-field .input { text-align: center; padding-inline: 6px; }
.cron-field-name { font-size: .78rem; font-weight: 600; color: var(--text-2); text-align: center; }
.cron-field-range { font-size: .7rem; color: var(--muted); text-align: center; font-family: var(--font-mono); }
.cron-field.is-invalid .input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.cron-field.is-invalid .cron-field-name { color: var(--danger); }
.cron-text { margin: 4px 0 0; font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 600; line-height: 1.35; color: var(--text); text-wrap: balance; }
.cron-text:empty { display: none; }
.cron-text::before { content: '“'; color: var(--accent-text); }
.cron-text::after { content: '”'; color: var(--accent-text); }
.cron-text.is-fresh { animation: fade-up .35s var(--ease-out); }
.cron-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface);
  color: var(--text-2); font: inherit; font-size: .86rem; font-weight: 500; cursor: pointer;
  transition: background var(--dur), border-color var(--dur), color var(--dur), transform .2s var(--ease-spring);
}
.chip-btn:hover { border-color: var(--line-strong); color: var(--text); }
.chip-btn:active { transform: scale(.95); }
.chip-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.readout-head .controls-inline { margin: 0; }
.readout-head .controls-inline .seg label span { padding-block: 4px; }
.cron-next { list-style: none; margin: 0; padding: 6px; counter-reset: run; }
.cron-next li {
  counter-increment: run; display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  padding: 9px 10px; border-radius: 8px; font-family: var(--font-mono); font-size: .9rem;
  animation: fade-up .3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms);
}
.cron-next li::before { content: counter(run, decimal-leading-zero); color: var(--muted); font-size: .72rem; }
.cron-next li:first-child { background: var(--accent-soft); }
.cron-next li:hover { background: var(--surface-2); }
.cron-next small { color: var(--muted); font-family: var(--font-sans); font-size: .78rem; text-align: right; }
.cron-next .cron-never { display: block; font-family: var(--font-sans); color: var(--muted); background: none; }
.cron-next .cron-never::before { content: none; }
.cron-next.no-anim li { animation: none; }
@media (max-width: 620px) {
  .cron-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cron-next li { grid-template-columns: 2.2em minmax(0, 1fr); }
  .cron-next small { grid-column: 2; text-align: left; }
}

/* ------------------------------------------------------------ Colour */
.color-layout { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.color-stage {
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1;
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 18px 18px;
}
.color-swatch {
  --swatch: #ff5733;
  height: 100%; display: grid; grid-template-rows: 1fr 1fr; background: var(--swatch);
  transition: background-color .35s var(--ease-out);
}
.color-sample { display: grid; place-items: center; font-size: 2.4rem; font-weight: 700; letter-spacing: -.02em; }
.color-sample[data-on="light"] { color: #fff; }
.color-sample[data-on="dark"] { color: #000; }
.color-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.color-pick {
  position: relative; flex: none; width: 54px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--surface);
}
.color-pick input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); border: 0; padding: 0; cursor: pointer; background: none; }
.color-formats dd { font-size: .92rem; }
.color-formats .color-note { color: var(--warn); font-family: var(--font-sans); cursor: default; }
.contrast-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; }
.contrast-chip {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--chip-bg); color: var(--chip-fg); font-weight: 700; font-size: 1.05rem;
}
.contrast-ratio { font-size: .9rem; color: var(--text-2); }
.contrast-ratio strong { font-family: var(--font-mono); color: var(--text); font-size: 1rem; }
.contrast-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.contrast-tags .tag { padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.color-scale { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.color-step {
  position: relative; aspect-ratio: 1 / 1.6; border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); border-radius: 8px;
  background: var(--c); cursor: pointer; padding: 0; transition: transform .2s var(--ease-spring), box-shadow var(--dur);
}
.color-step span {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 2px 6px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-family: var(--font-mono); font-size: .7rem; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--dur);
}
.color-step:hover, .color-step:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .5); }
.color-step:hover span, .color-step:focus-visible span { opacity: 1; }
.color-step.is-base { outline: 2px solid var(--accent-text); outline-offset: 2px; }
@media (max-width: 720px) {
  .color-layout { grid-template-columns: minmax(0, 1fr); }
  .color-stage { aspect-ratio: 2.2; }
  .color-swatch { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------ CSV preview */
.data-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.data-preview summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.data-preview[open] summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.data-preview-scroll { max-height: 420px; overflow: auto; }
.grid-table { border-collapse: collapse; font-family: var(--font-mono); font-size: .8rem; min-width: 100%; }
.grid-table th, .grid-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.grid-table th { position: sticky; top: 0; background: var(--surface-2); color: var(--text); font-weight: 600; z-index: 1; }
.grid-table .rownum { color: var(--muted); text-align: right; width: 1%; }
.grid-table tbody tr:hover { background: var(--surface-2); }
.cron-examples td:first-child code { white-space: nowrap; }
.color-side .input-group, .cron-main .input-group { flex-wrap: nowrap; }

/* ------------------------------------------------------------ Markdown documents */
.md-styles { display: flex; flex-direction: column; gap: 14px; }
.md-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 18px; align-items: start; }
.md-accent { align-self: flex-start; height: 40px; }
.md-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.md-split .big-input textarea { min-height: 640px; font-size: .86rem; line-height: 1.6; }
.md-stage {
  position: sticky; top: 84px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  max-height: calc(100vh - 100px); overflow: auto; overscroll-behavior: contain; padding: 0 2px 24px;
}
.md-stage > .field-label { position: sticky; top: 0; z-index: 1; background: var(--bg); padding-bottom: 4px; }
.md-paper {
  --page-w: 210mm; --page-pad: 20mm;
  flex: none; width: var(--page-w); min-height: calc(var(--page-w) * 1.414); padding: var(--page-pad); box-sizing: border-box;
  background: #fff; color: #1f2328; border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 18px 40px -22px rgba(0, 0, 0, .45);
}
.md-paper .md-empty { color: #8c959f; font-style: italic; }
.md-paper .page-break { height: 0; margin: 2.2em calc(var(--page-pad) * -1); border-top: 1px dashed #c3c9d0; position: relative; overflow: visible; }
.md-paper .page-break::after {
  content: 'Page break'; position: absolute; left: 50%; top: -.75em; transform: translateX(-50%); padding: 0 .6em;
  background: #fff; color: #8c959f; font: 600 9px/1.5 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase;
}
@media (max-width: 960px) {
  .md-split { grid-template-columns: minmax(0, 1fr); }
  .md-split .big-input textarea { min-height: 320px; }
  .md-stage { position: static; max-height: none; overflow: visible; }
}

/* ------------------------------------------------------------ Random colours: swatch per row */
.out-list.swatch-list li { grid-template-columns: 2.4em 44px 1fr auto; }
.out-list .swatch {
  grid-column: 2; grid-row: 1; display: grid; place-items: center; width: 44px; height: 30px; border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); font-weight: 700; font-size: .8rem;
}
.out-list.swatch-list li > code { grid-column: 3; }
.out-list.swatch-list li > .copy-btn { grid-column: 4; }

/* ------------------------------------------------------------ Hashing, keys and auth tools */
.controls-group[hidden], [data-mode][hidden] { display: none !important; }
.kdf-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.dg-input { display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius); transition: box-shadow var(--dur); }
.dg-input.is-dragging, .pem-input.is-dragging { box-shadow: 0 0 0 3px var(--accent-soft); }
.dg-out dd { font-size: .86rem; word-break: break-all; }
.kv-copy dd.is-match { background: var(--ok-soft); color: var(--ok); border-radius: 6px; padding-inline: 6px; }
.dg-verdict { margin: 0; font-weight: 600; font-size: .92rem; min-height: 1.4em; }
.dg-verdict.ok { color: var(--ok); }
.dg-verdict.bad { color: var(--danger); }

.ps-box { display: flex; flex-direction: column; gap: 10px; }
.ps-details { gap: 12px; }
.ps-warning { margin: 0; font-weight: 600; color: var(--warn); }
.ps-tips { margin: 0; padding-left: 1.2em; color: var(--text-2); font-size: .92rem; }
.ps-h { margin: 6px 0 0; font-size: .95rem; }
.ps-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ps-parts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: .9rem; }
.ps-parts code { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-weight: 600; }
.ps-parts span { color: var(--text-2); }

.pe-bits { padding: 16px 16px 4px; font-size: 1rem; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pe-bits strong { font-family: var(--font-mono); font-size: 2.4rem; color: var(--text); letter-spacing: -.02em; }
.pe-out { padding: 6px 16px 14px; }

.pem-input { display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius); transition: box-shadow var(--dur); }
.pem-input textarea { font-size: .8rem; }
.cert-out { display: flex; flex-direction: column; gap: 16px; }
.cert-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; animation: fade-up .35s var(--ease-out) both; }
.cert-card p { margin: 0; color: var(--text-2); font-size: .92rem; }
.cert-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cert-head h3 { margin: 2px 0 0; font-size: 1.15rem; word-break: break-word; }
.cert-head .tag { padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.cert-link.ok { color: var(--ok) !important; font-weight: 600; }
.cert-link.bad { color: var(--danger) !important; font-weight: 600; }
.cert-card .kv dd { word-break: break-word; }
.cert-card .kv code { font-size: .8rem; word-break: break-all; }
.kv .kv-sec { grid-column: 1 / -1; padding-top: 14px; color: var(--accent-text); font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; border-top: 0; }
.kv .kv-sec + dd { display: none; }
.cert-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-family: var(--font-mono); font-size: .8rem; }
.cert-chip small { color: var(--muted); margin-right: 4px; }
.muted { color: var(--muted); }
.pem-summary { font-family: var(--font-mono); font-size: .8rem !important; word-break: break-word; }

.asn-tree, .asn-tree ul { list-style: none; margin: 0; padding-left: 18px; font-family: var(--font-mono); font-size: .78rem; }
.asn-tree { padding-left: 0; overflow-x: auto; }
.asn-tree ul { border-left: 1px dashed var(--line); margin-left: 6px; }
.asn-node { padding: 2px 0; cursor: default; white-space: nowrap; }
summary.asn-node { cursor: pointer; }
.asn-tag { color: var(--code-key); font-weight: 600; }
.asn-len { color: var(--muted); }
.asn-node code { color: var(--text-2); white-space: pre-wrap; word-break: break-all; }

.otp-account { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.otp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: stretch; }
.otp-live { display: flex; flex-direction: column; }
.otp-live .hint { padding: 0 16px 14px; }
.otp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 16px 8px; }
.otp-code { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 700; letter-spacing: .08em; color: var(--text); }
.otp-ring {
  --p: 1; position: relative; width: 64px; height: 64px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--accent-text) calc(var(--p) * 360deg), var(--surface-2) 0);
  transition: background .25s linear;
}
.otp-ring::after {
  content: attr(data-left); position: absolute; inset: 7px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; color: var(--text);
}
.otp-ring.is-ending { background: conic-gradient(var(--danger) calc(var(--p) * 360deg), var(--surface-2) 0); }
.otp-qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.otp-qr { width: 100%; max-width: 200px; aspect-ratio: 1; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.otp-qr svg { width: 100%; height: 100%; display: block; }
.hotp-list { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.hotp-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 9px; background: var(--surface-2); animation: fade-up .3s var(--ease-out) both; }
.hotp-list li.is-current { background: var(--accent-soft); outline: 1px solid color-mix(in srgb, var(--accent-text) 40%, transparent); }
.hotp-list code { font-size: 1.3rem; font-weight: 700; letter-spacing: .06em; }
.hotp-c { font-size: .72rem; color: var(--muted); font-family: var(--font-mono); }
@media (max-width: 720px) {
  .otp-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ API & webhook tools */
.rq-form { display: flex; flex-direction: column; gap: 12px; }
.rq-line { display: flex; gap: 8px; }
.rq-line .input[name="url"] { flex: 1; min-width: 0; }
.rq-method { flex: none; width: 120px; }
.rq-auth[hidden], [data-body][hidden] { display: none !important; }
.hp-warn { color: var(--warn); font-size: .86rem; }
.hp-warn:empty { display: none; }
.hp-status { margin: 0 0 10px; }
.hp-table td { vertical-align: top; white-space: normal !important; }
.hp-table .hp-val { font-family: var(--font-mono); font-size: .8rem; word-break: break-all; max-width: 280px; }
.hp-list { margin: 6px 0 0; padding-left: 1.1em; font-size: .82rem; color: var(--text-2); }
.hp-list code { font-size: .78rem; }
.hp-audit-box:empty { display: none; }
.hp-audit { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.hp-audit .ok { color: var(--ok); }
.hp-audit .bad { color: var(--danger); }
.sc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sc-tools .input { flex: 1 1 240px; }
.sc-table td { white-space: normal !important; vertical-align: top; font-family: var(--font-sans); font-size: .86rem; }
.sc-table td:first-child { white-space: nowrap !important; }
.sc-table tr.is-target td { background: var(--accent-soft); }
.sc-code { font-family: var(--font-mono); font-weight: 700; text-decoration: none; padding: 2px 8px; border-radius: 6px; }
.sc-1 { color: var(--info); } .sc-2 { color: var(--ok); } .sc-3 { color: var(--accent-text); } .sc-4 { color: var(--warn); } .sc-5 { color: var(--danger); }
.mm-drop { flex-direction: row; padding: 14px; }
.mm-drop.is-dragging { border-color: var(--accent-text); background: var(--accent-soft); }
.jg-claims { margin-top: 6px; gap: 6px; }
.wt-out { padding: 6px 16px 12px; }
.ab-response { display: flex; flex-direction: column; gap: 12px; }
.ua-out { padding: 8px 16px 14px; }
.ov-out { display: flex; flex-direction: column; gap: 18px; }
.ov-head h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.ov-group h3 { margin: 0 0 8px; font-size: 1.05rem; }
.ov-op { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.ov-op > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; flex-wrap: wrap; }
.ov-op > summary code { font-weight: 600; }
.ov-op.is-deprecated > summary code { text-decoration: line-through; opacity: .7; }
.ov-sum { color: var(--text-2); font-size: .88rem; }
.ov-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); font-size: .9rem; }
.ov-body h4 { margin: 14px 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ov-get .method-badge { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.ov-post .method-badge { background: var(--ok-soft); color: var(--ok); }
.ov-put .method-badge, .ov-patch .method-badge { background: var(--warn-soft); color: var(--warn); }
.ov-delete .method-badge { background: var(--danger-soft); color: var(--danger); }
.ov-fields { list-style: none; margin: 4px 0; padding-left: 14px; border-left: 1px dashed var(--line); }
.ov-fields li { padding: 3px 0; }
.ov-type { font-family: var(--font-mono); font-size: .8rem; color: var(--code-key); }
.ov-req { margin-left: 6px; font-size: .7rem; font-weight: 700; color: var(--danger); text-transform: uppercase; }
.ov-desc { color: var(--text-2); font-size: .84rem; }
.ov-res { margin: 8px 0; }
.ov-recursive { color: var(--muted); font-size: .82rem; margin: 2px 0; }
.ge-src { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ge-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.ge-side { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 84px; max-height: calc(100vh - 110px); }
.ge-types { list-style: none; margin: 0; padding: 0; overflow: auto; }
.ge-types a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .9rem; }
.ge-types a:hover { background: var(--surface-2); }
.ge-types a.is-current { background: var(--accent-soft); font-weight: 600; }
.ge-kind { flex: none; width: 64px; font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; color: var(--muted); }
.ge-detail h3 { margin: 0; }
.ge-detail h3 small { font-weight: 400; color: var(--text-2); font-size: .85rem; }
.ge-fields { list-style: none; margin: 0; padding: 0; }
.ge-fields li { padding: 8px 0; border-top: 1px dashed var(--line); font-family: var(--font-mono); font-size: .86rem; }
.ge-field { font-weight: 700; color: var(--text); }
.ge-args { color: var(--text-2); }
.ge-type a, .ge-args a, .ge-detail a { color: var(--code-key); }
.ge-desc { margin: 4px 0 0; font-family: var(--font-sans); color: var(--text-2); font-size: .86rem; }
@media (max-width: 860px) {
  .ge-layout { grid-template-columns: minmax(0, 1fr); }
  .ge-side { position: static; max-height: 280px; }
  .rq-method { width: 104px; }
}

/* ---------------------------------------------------------------- JSON tools */
.jt { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); max-height: 560px; overflow: auto; padding: 8px 6px; font-family: var(--font-mono); font-size: .82rem; }
.jt:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; font-family: var(--font-sans); padding: 6px 8px; display: block; }
.jt ul { list-style: none; margin: 0; padding: 0; }
.jt ul ul { margin-left: 11px; padding-left: 10px; border-left: 1px dashed var(--line); }
.jt-row { display: flex; align-items: baseline; gap: 4px; padding: 2px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; outline: none; }
.jt-row:hover { background: var(--surface-2); }
.jt-row.is-selected { background: var(--accent-soft); }
.jt-row:focus-visible { box-shadow: 0 0 0 2px var(--accent-text); }
.jt-row.is-match { box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-soft); }
.jt-row .t-str { white-space: pre; overflow: hidden; text-overflow: ellipsis; max-width: 60ch; display: inline-block; vertical-align: bottom; }
.jt-toggle { flex: none; width: 14px; height: 14px; border: 0; padding: 0; background: none; cursor: pointer; position: relative; top: 2px; color: var(--muted); }
.jt-toggle::before { content: ""; position: absolute; inset: 3px 4px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(-45deg); transition: transform .15s var(--ease-out); }
[aria-expanded="true"] > .jt-row .jt-toggle::before { transform: rotate(45deg); }
.jt-leaf { flex: none; width: 14px; }
.jt-idx { color: var(--muted); }
.jt-root { color: var(--accent-text); font-weight: 700; }
.jt-type { color: var(--muted); font-size: .72rem; }
.jt-count { color: var(--muted); }
.jt-more { padding: 4px 0 4px 20px; }
.jt-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jt-toolbar .input { flex: 1 1 200px; min-width: 0; }
.jt-pathbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: .84rem; }
.jt-pathbar code { flex: 1 1 200px; min-width: 0; word-break: break-all; font-family: var(--font-mono); }
.jt-pathbar:has(code:empty) { display: none; }

.je-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.je-panel { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); position: sticky; top: 84px; }
.je-panel textarea { min-height: 120px; }
.je-panel .bar { gap: 6px; }
.je-empty { color: var(--muted); font-size: .88rem; margin: 0; }
@media (max-width: 860px) { .je-layout { grid-template-columns: minmax(0, 1fr); } .je-panel { position: static; } }

.jr-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 520px; overflow: auto; background: var(--surface); }
.jr-list:empty { display: none; }
.jr-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: .84rem; animation: fade-up .3s var(--ease-out) both; }
.jr-list li:first-child { border-top: 0; }
.jr-list code { font-family: var(--font-mono); font-size: .8rem; word-break: break-all; }
.jr-list .jr-msg { grid-column: 2; color: var(--text-2); }
.jr-list .jr-vals { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-mono); font-size: .78rem; }
.jr-op { font-family: var(--font-mono); font-size: .68rem; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; align-self: start; letter-spacing: .04em; }
.jr-add { background: var(--ok-soft); color: var(--ok); }
.jr-remove { background: var(--danger-soft); color: var(--danger); }
.jr-replace { background: var(--warn-soft); color: var(--warn); }
.jr-info { background: var(--surface-2); color: var(--text-2); }
.jr-from { color: var(--danger); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.jr-to { color: var(--ok); }
.jr-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .88rem; }
.jr-summary .tag { padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; }

.jd-lines { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 560px; overflow: auto; font-family: var(--font-mono); font-size: .8rem; background: var(--surface); }
.jd-lines table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.jd-lines td { padding: 1px 8px; white-space: pre-wrap; word-break: break-all; vertical-align: top; }
.jd-lines td.n { width: 3.2em; color: var(--muted); text-align: right; user-select: none; padding-right: 6px; }
.jd-lines tr.del td.c:first-of-type, .jd-lines td.del { background: var(--danger-soft); }
.jd-lines td.add { background: var(--ok-soft); }
.jd-lines tr.skip td { color: var(--muted); background: var(--surface-2); text-align: center; font-style: italic; }
.jd-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

.jm-inputs { display: flex; flex-direction: column; gap: 14px; }
.jm-doc .big-input-head .btn-danger { margin-left: auto; }
.js-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.js-files:empty { display: none; }
.js-file { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .82rem; animation: fade-up .3s var(--ease-out) both; }
.js-file span { font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.js-file small { color: var(--muted); display: block; font-family: var(--font-sans); }
.jp-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.jp-examples button { font-family: var(--font-mono); font-size: .76rem; }
.controls [hidden], .jt-toolbar [hidden] { display: none !important; }

/* ---------------------------------------------------------------- Text tools */
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ts-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.ts-card:first-child { border-color: var(--accent-text); background: var(--accent-soft); }
.ts-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.ts-label { font-size: .8rem; color: var(--text-2); }
.ts-card small { font-size: .72rem; color: var(--muted); }
.ts-h { margin: 18px 0 8px; font-size: 1rem; }
.ts-scroll { max-height: 420px; overflow: auto; }
.ts-extra .table td:first-child { color: var(--text); white-space: normal; width: auto; }
.tcc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tcc-list li { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 8px 12px 10px; min-width: 0; }
.tcc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tcc-val { margin: 4px 0 0; font-family: var(--font-mono); font-size: .86rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; }
.rxe-list { list-style: none; margin: 0; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.rxe-list:empty { display: none; }
.rxe-list li { display: grid; grid-template-columns: minmax(80px, max-content) minmax(0, 1fr); gap: 4px 14px; padding: 6px 12px 6px calc(12px + var(--d, 0) * 18px); border-top: 1px dashed var(--line); font-size: .86rem; animation: fade-up .3s var(--ease-out) both; }
.rxe-list li:first-child { border-top: 0; }
.rxe-list code { font-family: var(--font-mono); color: var(--code-key); overflow-wrap: anywhere; }
.rxe-flags { margin: 0; padding-left: 20px; font-size: .86rem; color: var(--text-2); }
.rxe-flags:empty { display: none; }
.rx-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
.jd-lines del { background: color-mix(in srgb, var(--danger) 28%, transparent); text-decoration: none; border-radius: 3px; }
.jd-lines ins { background: color-mix(in srgb, var(--ok) 28%, transparent); text-decoration: none; border-radius: 3px; }
.jd-lines table.unified td.c { width: auto; }
.td-inputs textarea { min-height: 220px; }

/* ---------------------------------------------------------------- Date & time */
.tz-card { position: relative; }
.tz-card .ts-value { font-size: 1.8rem; }
.tz-remove { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.tz-remove:hover { color: var(--danger); background: var(--danger-soft); }
.tz-table td, .tz-table th { text-align: center; white-space: nowrap; font-family: var(--font-mono); }
.tz-table td:first-child { color: var(--text); width: auto; }
.tz-table td.tz-work { background: var(--ok-soft); }
.tz-table td.tz-night { color: var(--muted); }
.table tr.is-now td { box-shadow: inset 0 2px 0 var(--accent-text), inset 0 -2px 0 var(--accent-text); font-weight: 700; }
.dt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.dt-summary { font-size: 1rem; margin: 0; }
.dt-summary:empty { display: none; }
.cd-display { text-align: center; padding: 28px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cd-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 12px; }
.cd-units { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 24px; }
.cd-units div { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.cd-units span { font-family: var(--font-mono); font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-units small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.cd-done { font-size: 1.5rem; font-weight: 700; margin: 0; }
.ly-big { font-size: 1.6rem; font-weight: 700; margin: 0; }
.ly-big.ok { color: var(--ok); }
.ly-big.bad { color: var(--danger); }

/* ==========================================================================
   HTML, CSS and JavaScript tools
   ========================================================================== */
.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; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.section-title { font-size: 1.15rem; margin: 18px 0 0; }
.error-box.is-warning { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); animation: none; }
.req { color: var(--danger); }

/* Validators */
.lint-summary { display: flex; flex-direction: column; gap: 6px; }
.lint-summary:empty { display: none; }
.lint-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lint-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius-sm); background: var(--surface); font-size: .88rem; min-width: 0; }
.lint-list li > div { min-width: 0; }
.lint-list pre { margin: 6px 0 0; font-size: .78rem; color: var(--text-2); overflow-x: auto; white-space: pre; }
.lint-list .lint-error { border-left-color: var(--danger); }
.lint-list .lint-warning { border-left-color: var(--warn); }
.lint-list .lint-info { border-left-color: var(--info); }
.lint-loc { font: 600 .76rem var(--font-mono); padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.lint-loc:hover { border-color: var(--line-strong); color: var(--text); }
.lint-badge { font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.lint-error .lint-badge { color: var(--danger); }
.lint-warning .lint-badge { color: var(--warn); }
.lint-info .lint-badge { color: var(--info); }

/* Checks list (SEO tools) */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.check-list:empty { display: none; }
.check-list li { padding: 6px 10px 6px 28px; border-radius: 8px; position: relative; }
.check-list li::before { position: absolute; left: 10px; font-weight: 700; }
.check-ok { color: var(--ok); background: var(--ok-soft); }
.check-ok::before { content: "✓"; }
.check-warn { color: var(--warn); background: var(--warn-soft); }
.check-warn::before { content: "!"; }
.check-bad { color: var(--danger); background: var(--danger-soft); }
.check-bad::before { content: "×"; }
.field-count { font: 500 .74rem var(--font-mono); color: var(--muted); }
.field-count.is-ok { color: var(--ok); }
.field-count.is-warn { color: var(--warn); }
.tg-import { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface); }
.tg-import summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.tg-import[open] summary { margin-bottom: 10px; }
.tg-import .bar { margin-top: 8px; }

/* HTML preview */
.hp-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.hp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.hp-editor, .hp-stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hp-frame-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: auto; height: 560px; display: flex; justify-content: center; }
.hp-frame-wrap.is-device { background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); padding: 12px; }
.hp-frame-wrap iframe { border: 0; height: 100%; background: #fff; max-width: none; flex: none; }
.hp-frame-wrap.is-device iframe { box-shadow: var(--shadow); border-radius: 10px; }
.hp-console { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.hp-console-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 4px 12px; border-bottom: 1px solid var(--line); }
.hp-console ol { list-style: none; margin: 0; padding: 4px 0; max-height: 180px; overflow: auto; font: .8rem/1.5 var(--font-mono); }
.hp-console li { padding: 2px 12px; white-space: pre-wrap; word-break: break-word; border-bottom: 1px dashed var(--line); }
.log-warn { color: var(--warn); background: var(--warn-soft); }
.log-error { color: var(--danger); background: var(--danger-soft); }
.log-info { color: var(--info); }
@media (max-width: 860px) { .hp-split { grid-template-columns: 1fr; } .hp-frame-wrap { height: 440px; } }

/* Table generator */
.tg-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.tg-grid { border-collapse: collapse; min-width: 100%; }
.tg-grid td { padding: 0; border: 1px solid var(--line); }
.tg-grid td.is-head { background: var(--surface-2); }
.tg-grid td.is-head .tg-cell { font-weight: 700; }
.tg-cell { width: 100%; min-width: 110px; border: 0; padding: 8px 10px; background: transparent; color: var(--text); font: inherit; font-size: .9rem; }
.tg-cell:focus { outline: 2px solid var(--accent-text); outline-offset: -2px; background: var(--accent-soft); }
.tg-preview { min-width: 0; }

/* SERP preview */
.serp-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.serp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px 6px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.serp { padding: 18px 20px; background: #fff; color: #202124; font-family: Arial, sans-serif; max-width: 652px; }
.serp.is-mobile { max-width: 360px; }
.serp-site { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.serp-site > span:last-child { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.serp-fav { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; display: grid; place-items: center; font-size: 12px; color: #5f6368; flex: none; }
.serp-name { font-size: 14px; color: #202124; }
.serp-url { font-size: 12px; color: #4d5156; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin-bottom: 4px; overflow-wrap: anywhere; }
.serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; overflow-wrap: anywhere; }

/* Open Graph previews */
.og-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.og-card { margin: 0; display: flex; flex-direction: column; min-width: 0; font-family: system-ui, sans-serif; }
.og-card figcaption { font: 600 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 6px; }
.og-img { display: block; width: 100%; aspect-ratio: 1.91; object-fit: cover; background: #e4e6eb; }
.og-noimg { display: grid; place-items: center; color: #65676b; font-size: .8rem; }
.og-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-width: 0; }
.og-body strong, .og-desc { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.og-fb .og-img, .og-fb .og-body { border: 1px solid #dadde1; }
.og-fb .og-body { border-top: 0; background: #f0f2f5; color: #050505; }
.og-fb .og-host { font-size: 12px; color: #65676b; }
.og-fb .og-desc { font-size: 13px; color: #65676b; -webkit-line-clamp: 1; }
.og-x { color: var(--text); position: relative; }
.og-x .og-img { border-radius: 16px; border: 1px solid #cfd9de; }
.og-x .og-overlay { position: absolute; left: 12px; bottom: 34px; background: rgb(0 0 0 / .77); color: #fff; font-size: 13px; padding: 2px 6px; border-radius: 4px; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.og-x .og-body { padding: 0; }
.og-under { font-size: 13px; color: var(--muted); margin-top: 4px; }
.og-x.is-small { flex-direction: row; flex-wrap: wrap; }
.og-x.is-small figcaption { flex-basis: 100%; }
.og-x.is-small .og-img { width: 120px; aspect-ratio: 1; border-radius: 16px 0 0 16px; }
.og-x.is-small .og-body { flex: 1; padding: 10px 12px; font-size: 14px; border: 1px solid #cfd9de; border-left: 0; border-radius: 0 16px 16px 0; }
.og-x.is-small .og-host, .og-x.is-small .og-desc { color: var(--muted); font-size: 13px; }
.og-li .og-img, .og-li .og-body { border: 1px solid #e0e0e0; }
.og-li .og-body { border-top: 0; background: #fff; color: rgb(0 0 0 / .9); }
.og-li .og-host { font-size: 12px; color: rgb(0 0 0 / .6); }
.og-slack .og-body { border-left: 4px solid #dddddd; padding: 0 0 0 12px; gap: 4px; color: var(--text); }
.og-slack .og-site { font-weight: 700; font-size: 13px; }
.og-slack .og-link { color: #1264a3; }
.og-slack .og-desc { font-size: 14px; -webkit-line-clamp: 3; }
.og-slack .og-img { max-width: 360px; border-radius: 8px; margin-top: 6px; }

/* Favicons */
.fv-bg { display: flex; gap: 10px; align-items: center; }
.fv-bg .input[type="color"] { flex: 1; }
.fv-file { justify-content: flex-start; overflow: hidden; }
.fv-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-stage { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.fv-sizes { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.fv-sizes figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fv-sizes figcaption { font: .72rem var(--font-mono); color: var(--muted); }
.fv-tabs { display: flex; flex-direction: column; gap: 6px; }
.fv-tab { display: flex; align-items: center; gap: 8px; width: 220px; max-width: 100%; padding: 7px 10px; border-radius: 8px 8px 0 0; font: 12px system-ui, sans-serif; }
.fv-tab span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-light { background: #fff; color: #202124; box-shadow: 0 1px 0 #dadce0; }
.fv-dark { background: #35363a; color: #e8eaed; }
.fv-x { opacity: .6; }

/* Structured data */
.sd-fields .sd-wide { grid-column: 1 / -1; }
.sd-repeat { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sd-item { display: grid; grid-template-columns: auto repeat(auto-fit, minmax(200px, 1fr)) auto; gap: 10px; align-items: end; }
.sd-num { font: 600 .8rem var(--font-mono); color: var(--muted); padding-bottom: 10px; }
.sd-item .btn { margin-bottom: 4px; }
.sd-repeat > .btn { align-self: flex-start; }
@media (max-width: 600px) { .sd-item { grid-template-columns: 1fr; } }

/* Visual CSS generators */
.gen-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .gen-layout { grid-template-columns: 1fr; } }
.gen-preview { min-height: 280px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; position: relative; overflow: hidden; }
.gen-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.gen-presets-inline { display: inline-flex; }
.gen-preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font: 500 .82rem var(--font-sans); cursor: pointer; }
.gen-preset:hover { border-color: var(--line-strong); color: var(--text); }
.gen-swatch { width: 28px; height: 28px; border-radius: 7px; flex: none; background: var(--surface-2); }
.gr-preview { min-height: 300px; }
.gr-editor { display: flex; flex-direction: column; gap: 10px; }
.gr-bar { position: relative; height: 34px; border-radius: 10px; border: 1px solid var(--line); cursor: copy; margin: 0 10px; touch-action: none; }
.gr-handle { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px rgb(0 0 0 / .35), 0 2px 6px rgb(0 0 0 / .25); cursor: grab; padding: 0; }
.gr-handle:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.gr-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gr-stops li { display: flex; align-items: center; gap: 8px; }
.gr-stops .input[type="color"] { width: 48px; padding: 2px; height: 36px; }
.gr-stops .input[type="number"] { width: 84px; }
.gr-stops code { font-size: .8rem; color: var(--muted); flex: 1; }
.bs-stage { background: #eef0f5; }
.bs-box { width: 180px; height: 130px; background: #fff; }
.bs-layers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bs-layer { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: var(--surface); min-width: 0; }
.bs-layer legend { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.bs-row { display: flex; gap: 12px; align-items: flex-end; }
.bs-row .field { flex: 1; }
.br-stage { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; }
.br-box { width: 260px; max-width: 80%; height: 170px; background: linear-gradient(135deg, #6366f1, #ec4899); transition: border-radius .15s var(--ease-out), width .2s, height .2s; }
.br-box.is-square { width: 200px; height: 200px; }
.fx-stage { display: flex; min-height: 240px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); overflow: auto; }
.fx-it { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 2px solid transparent; border-radius: 10px; background: var(--accent-soft); color: var(--text); font: 700 1.1rem var(--font-mono); cursor: pointer; text-align: left; min-width: 0; }
.fx-it small { font: 500 .72rem var(--font-sans); color: var(--muted); white-space: nowrap; }
.fx-it.is-custom { background: color-mix(in srgb, var(--info) 16%, transparent); }
.fx-it.is-selected { border-color: var(--accent-text); }
.fx-item { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.fx-item-title { grid-column: 1 / -1; margin: 0; }
.gd-tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gd-track-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gd-track-list .input { width: 110px; height: 36px; font-size: .82rem; }
@media (max-width: 600px) { .gd-tracks { grid-template-columns: 1fr; } }
.gd-canvas { display: grid; min-height: 260px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); user-select: none; touch-action: none; overflow-x: auto; }
.gd-cell { border: 1px dashed var(--line-strong); border-radius: 8px; min-height: 48px; cursor: crosshair; }
.gd-cell.is-selecting { background: var(--accent-soft); border-color: var(--accent-text); }
.gd-area { pointer-events: none; display: grid; place-items: center; border-radius: 8px; font: 600 .82rem var(--font-mono); background: hsl(var(--h) 75% 60% / .28); border: 2px solid hsl(var(--h) 60% 45% / .7); color: var(--text); overflow: hidden; padding: 4px; text-align: center; }
.gd-items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gd-items li { display: flex; align-items: center; gap: 4px; padding: 3px 3px 3px 10px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid hsl(var(--h) 60% 50%); background: var(--surface); }
.gd-items .input { width: 130px; height: 32px; font-size: .82rem; }
.an-stage { background: var(--surface-2); min-height: 260px; }
.an-box { width: 110px; height: 110px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #ec4899); color: #fff; font: 800 1.8rem var(--font-sans); }
.tf-stage { background: var(--surface-2); min-height: 320px; }
.tf-ghost, .tf-box { grid-area: 1 / 1; width: 140px; height: 100px; border-radius: 12px; }
.tf-ghost { border: 2px dashed var(--line-strong); }
.tf-box { display: grid; place-items: center; background: linear-gradient(135deg, #10b981, #3b82f6); color: #fff; font: 800 1.4rem var(--font-mono); opacity: .92; }
.tf-origin { display: grid; grid-template-columns: repeat(3, 28px); gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; width: fit-content; background: var(--surface); }
.tf-origin label { position: relative; width: 28px; height: 28px; cursor: pointer; }
.tf-origin input { position: absolute; opacity: 0; }
.tf-origin span { position: absolute; inset: 8px; border-radius: 50%; background: var(--line-strong); }
.tf-origin input:checked + span { background: var(--accent-text); inset: 5px; }
.tf-origin input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 3px; }

/* Unit converter and clamp */
.uc-input { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.uc-value { font-size: 1.3rem !important; height: 54px; }
.uc-grid .ts-card { cursor: copy; font: inherit; text-align: left; border: 1px solid var(--line); color: inherit; }
.uc-grid .ts-card.is-source { border-color: var(--accent-text); background: var(--accent-soft); }
.uc-grid .ts-value small { font-size: .7em; margin-left: 2px; color: var(--muted); }
.cl-demo { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cl-text { margin: 0; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.cl-chart { width: 100%; height: auto; max-height: 220px; }
.cl-chart text { font: 11px var(--font-mono); fill: var(--muted); }
.cl-axis { stroke: var(--line-strong); }
.cl-guide { stroke: var(--line); stroke-dasharray: 4 4; }
.cl-line { fill: none; stroke: var(--accent-text); stroke-width: 3; }
.cl-dot { fill: var(--accent); stroke: var(--accent-ink); stroke-width: 2; }

/* Selector tester */
.st-tree { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 8px 10px; max-height: 520px; overflow: auto; font: .82rem/1.7 var(--font-mono); }
.st-tree:empty::before { content: attr(data-placeholder); color: var(--muted); font-family: var(--font-sans); font-style: italic; }
.st-tree ul { list-style: none; margin: 0; padding: 0; }
.st-tree ul ul { margin-left: 10px; padding-left: 12px; border-left: 1px dashed var(--line); }
.st-node { padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.st-node.is-match { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-text); font-weight: 600; }
.st-text { color: var(--muted); font-family: var(--font-sans); }
.st-spec td:first-child { white-space: normal; word-break: break-all; }

/* JavaScript playground */
.pg-head .pg-examples { width: auto; }
.pg-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.pg-code { min-height: 440px; tab-size: 2; resize: vertical; line-height: 1.55; }
.pg-console { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: auto; max-height: 560px; min-height: 200px; font: .8rem/1.55 var(--font-mono); }
.pg-empty { padding: 14px; color: var(--muted); font-family: var(--font-sans); font-style: italic; }
.pg-line { padding: 4px 12px; border-bottom: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.pg-warn { color: var(--warn); background: var(--warn-soft); }
.pg-error { color: var(--danger); background: var(--danger-soft); }
.pg-info { color: var(--info); }
.pg-debug { color: var(--muted); }
.pg-return { color: var(--accent-text); font-weight: 600; }
@media (max-width: 860px) { .pg-split { grid-template-columns: 1fr; } .pg-code { min-height: 280px; } }

/* Array methods and object inspector */
.am-layout { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.am-layout .controls { flex: 0 1 280px; }
.am-doc { flex: 1 1 280px; margin: 0 0 10px; }
.am-mutates { color: var(--warn); }
.am-es { font: 600 .72rem var(--font-mono); padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
.am-trace caption { text-align: left; font-weight: 600; padding: 6px 0; color: var(--text-2); }
.am-trace td { white-space: pre-wrap; }
.am-trace td:first-child { color: var(--muted); }
.oi-hidden { color: var(--muted); font-style: italic; }
.oi-kind { margin-left: auto; padding-left: 12px; }

/* Programming language converters */
.m2h-preview-wrap { display: flex; flex-direction: column; gap: 6px; }
.m2h-preview { width: 100%; height: 380px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
#y2j-error, #s2j-error { white-space: pre-wrap; }
