/* ==========================================================================
   Qgenx Tools — Common CSS (7 Structured Layers + CHRLS 70 Design Principles)
   Color Pattern: Warm Stone & Cobalt (#f6f4ef / #ffffff / #18181b / #1d4ed8)
   ========================================================================== */


/* 1. Design Tokens (Warm Stone & Cobalt + OKLCH + Dark Depth Ready) */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --border: rgba(24, 24, 27, 0.10);
  --border-strong: rgba(24, 24, 27, 0.22);

  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #71717a;

  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: rgba(29, 78, 216, 0.08);
  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, 0.10);
  --err: #b91c1c;
  --err-soft: rgba(185, 28, 28, 0.10);

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-12: 48px;
  /* Concentric Radii: outer(14) = inner(10) + padding(4) */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

@supports (color: oklch(0 0 0)) {
  :root {
    --bg: oklch(0.966 0.008 85);
    --surface: oklch(1 0 0);
    --surface-2: oklch(0.942 0.011 85);
    --accent: oklch(0.478 0.205 262);
    --accent-hover: oklch(0.415 0.185 262);
  }
}

[data-theme="dark"] {
  --bg: #111113;
  --surface: #18181b;
  --surface-2: #222226;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --ink: #f4f4f5;
  --ink-2: #a1a1aa;
  --ink-3: #71717a;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.14);
}
.theme-switching * { transition: none !important; }

/* 2. Base & Typography (Kerning, Leading, Widow Control, Fluid Type) */
*, *::before, *::after { box-sizing: border-box; }
html, body, *, *::before, *::after { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 2px solid var(--scroll-track); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
html {
  margin: 0; padding: 0;
  interpolate-size: allow-keywords;
  scroll-behavior: smooth;
}
body {
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  min-height: 100dvh;
  font-family: var(--font);
  font-kerning: normal;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit; text-decoration: none;
  text-underline-offset: 0.2em; text-decoration-thickness: 1px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 {
  margin: 0; font-weight: 500; letter-spacing: -0.02em; color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(24px, 3.6vw, 38px); line-height: 1.12; }
h2 { font-size: clamp(18px, 2.1vw, 20px); line-height: 1.25; }
h3 { font-size: 15.5px; line-height: 1.35; }
@supports (text-box: trim-both cap alphabetic) {
  .stat-val { text-box: trim-both cap alphabetic; }
}
p { margin: 0; color: var(--ink-2); text-wrap: pretty; max-width: 68ch; }
sup, sub { font-size: 0.75em; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.45em; }
sub { bottom: -0.25em; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.acronym { font-variant-caps: all-small-caps; letter-spacing: 0.04em; }
.trunc-mid { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ico {
  width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

/* 3. Layout Shell (Fluid Auto-Adjusting 1440px Container + Safe Area) */
.wrap {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left));
}
.sec { padding: var(--s-8) 0 0; }
.sec-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4);
}
.sec-head p { font-size: 14px; color: var(--ink-2); }

.site-head {
  position: sticky; top: 12px; z-index: 50;
  width: min(calc(100% - 32px), 1440px);
  margin: 12px auto 0;
  border: 1px solid var(--border); border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--pop, 0 18px 44px -18px rgba(0, 0, 0, 0.3));
}
.head-inner {
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; font-size: 15.5px; }
.brand-mark {
  width: 24px; height: 24px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--bg); display: grid; place-items: center;
}
.nav-links { display: flex; align-items: center; gap: var(--s-4); font-size: 14px; color: var(--ink-2); }
.nav-links a {
  display: inline-flex; flex-direction: column; align-items: center;
  transition: color 150ms var(--ease);
}
.nav-links a::after {
  content: attr(data-text); height: 0; visibility: hidden; overflow: hidden;
  user-select: none; pointer-events: none; font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }

.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: var(--s-4); grid-template-columns: repeat(4, 1fr); }
.grid-5 { display: grid; gap: var(--s-4); grid-template-columns: repeat(5, 1fr); }
@media (max-width: 980px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

.site-foot {
  margin-top: var(--s-12); padding: 0;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--ink-2);
}
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); }

/* 4. Components (Concentric Radii, Alpha Borders, Scale 0.97, Micro-Animations) */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  hyphens: auto; overflow-wrap: anywhere;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
a.card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
a.card:active { transform: scale(0.97); }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 500;
  transform-origin: center;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease), opacity 120ms var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 4px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; font-weight: 500;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.err { background: var(--err-soft); color: var(--err); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-4) 0 var(--s-2); font-size: 13px; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* Compact KPI Strip (High-contrast labels on #efece4) */
.stat-strip {
  display: grid; gap: var(--s-2);
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}
.stat-box { background: var(--surface-2); border-radius: var(--r-sm); padding: 7px 10px; }
.stat-val { font-size: 16px; line-height: 1.2; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-box .stat-lbl { font-size: 12px; line-height: 1.25; color: var(--ink-2); margin-top: 4px; }
/* Tool-panel stat cells and percentage cards (shared across tool views) */
.stat-cell { background: var(--surface-2); border-radius: var(--r-sm); padding: 7px 10px; }
.stat-v { font-size: 16px; line-height: 1.2; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12px; line-height: 1.25; color: var(--ink-2); margin-top: 4px; }
.pct-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pct-card { min-width: 0; background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-4); }
.pct-card h3 { margin-bottom: var(--s-3); }
.pct-res { margin-top: var(--s-3); font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pct-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-width: 0; }
.pct-row > * { min-width: 0; }
.pct-row > input, .pct-row > select { flex: 1 1 90px; }
.pct-row > span { flex: 0 0 auto; color: var(--ink-2); font-size: 13px; white-space: nowrap; }

/* Custom Minus / Plus Stepper (Borderless Rounded Pill + Expanded Hit Target) */
.limit-group {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: nowrap; white-space: nowrap; max-width: 100%;
}
.limit-group .chip {
  border-radius: 999px; padding: 4px 10px; font-size: 11.5px; line-height: 1.2;
}
.stepper {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--surface-2); border: none; border-radius: 999px;
  padding: 2px 4px 2px 10px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-2);
}
.stepper label { margin-right: 2px; }
.stepper-btn {
  position: relative;
  width: 24px; height: 24px; border-radius: 999px;
  border: none; background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
  display: grid; place-items: center; font-size: 14px; line-height: 1; padding: 0;
  transition: background-color 150ms var(--ease), transform 120ms var(--ease);
}
.stepper-btn::after { content: ""; position: absolute; inset: -8px; }
.stepper-btn:hover { background: var(--bg); }
.stepper-btn:active { transform: scale(0.97); }
.stepper-input {
  width: 44px; height: 24px; text-align: center; font-family: var(--mono); font-size: 12px;
  border: none; border-radius: 999px;
  background: var(--surface); color: var(--ink); padding: 0 4px;
  outline: none;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper-input:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.stepper-input::-webkit-inner-spin-button,
.stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* 5. Forms, Controls, Sliders & Error Shake */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: var(--s-2) var(--s-3);
  font-size: 14px; min-height: 40px; color: var(--ink);
  overscroll-behavior: contain;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.textarea { min-height: 200px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.range { width: 100%; accent-color: var(--accent); cursor: pointer; }
.swatch-stage {
  border-radius: var(--r-md); border: 1px solid var(--border);
  background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.blend-multiply { mix-blend-mode: multiply; }

@keyframes qt-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}
.is-error-shake { animation: qt-shake 280ms var(--ease); }

/* 6. Tool Workspace Shell */
.workspace {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  margin-top: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.ws-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.ws-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.ws-actions-end { margin-left: auto; justify-content: flex-end; }
.ws-split { display: grid; gap: var(--s-4); grid-template-columns: 1fr 1fr; }
@media (max-width: 780px) { .ws-split { grid-template-columns: 1fr; } }

/* Mobile-First Compact Layout */
@media (max-width: 680px) {
  .crumbs { padding: 10px 0 4px; font-size: 12px; }
  .sec { padding: var(--s-6) 0 0; }
  .workspace { padding: var(--s-3); gap: 8px; margin-top: 10px; }
  .textarea { min-height: 136px; }
  .ws-split { display: contents; }
  .stat-strip {
    order: -2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .ws-primary-input { order: -1; }
  .stat-box, .stat-cell { padding: 4px 2px; border-radius: 6px; text-align: center; }
  .stat-val, .stat-v { font-size: 12.5px; line-height: 1.15; }
  .stat-box .stat-lbl, .stat-l { font-size: 11px; line-height: 1.15; margin-top: 3px; }
  .input, .select, .pill-btn, .exp-filter, .cat-search, .cat-filter, .cat-sort { min-height: 44px; }
  .stepper { padding: 2px 3px 2px 8px; }
  .stepper-btn { width: 22px; height: 22px; font-size: 13px; }
  .stepper-input { width: 42px; height: 22px; font-size: 11.5px; }
}

/* 7. Hero, Info Tables & Smooth Exclusive Toggleable FAQs */
.hero { padding: var(--s-8) 0 0; display: grid; gap: var(--s-6); grid-template-columns: 1.15fr 0.85fr; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-lede { margin-top: var(--s-3); font-size: 16px; color: var(--ink-2); max-width: 52ch; }
.search-box {
  margin-top: var(--s-5); display: flex; align-items: center; gap: var(--s-2);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: 4px 4px 4px var(--s-3); max-width: 460px;
}
.search-box input { border: none; background: transparent; width: 100%; outline: none; font-size: 14px; }

.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.scroll-fade { mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent); }
.info-table { width: 100%; border-collapse: collapse; font-size: 14.5px; text-align: left; }
.info-table th, .info-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.info-table th { background: var(--surface-2); font-weight: 500; color: var(--ink); }
.info-table tr:last-child td { border-bottom: none; }

.faq-acc { display: flex; flex-direction: column; gap: var(--s-2); }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
}
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 12px var(--s-4); background: transparent; border: none;
  text-align: left; font-size: 14.5px; font-weight: 500; color: var(--ink);
  transition: background-color 150ms var(--ease);
}
.faq-q:hover { background: var(--surface-2); }
.faq-q:active, .faq-q.is-pressed { transform: none !important; }
.faq-chev { transition: transform 160ms var(--ease); color: var(--ink-2); }
.faq-q[aria-expanded="true"] .faq-chev { transform: rotate(180deg); }
.faq-a {
  padding: 0 var(--s-4) 14px; font-size: 14.5px; color: var(--ink-2); line-height: 1.6;
}
.faq-a[hidden] { display: none; }
/* Category Q&A: native <details> rows styled like the FAQ accordion, marker kept */
.prose details { border-bottom: 1px solid var(--border); }
.prose details:last-child { border-bottom: 0; }
.prose details > summary {
  padding: 12px 0; cursor: pointer;
  color: var(--ink); font-size: 14.5px; font-weight: 500;
}
.prose details > summary::marker { color: var(--accent); }
.prose details > p { padding: 0 0 14px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Shared feel: buttons, theme switch, toasts (all pages)
   ========================================================================== */
button, .btn, .chip, a.card, .ts-opt {
  transition: transform 120ms var(--ease), background-color 150ms var(--ease),
    border-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}
button { cursor: pointer; font: inherit; }
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:hover:not(:disabled), .chip:hover { transform: translateY(-1px); }
.btn:active:not(:disabled), .chip:active, button:not(.faq-q):active:not(:disabled) { transform: scale(0.97); }
a.card:hover { transform: translateY(-1px); }
a.card:active { transform: scale(0.99); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Press feel: every control except FAQ triggers sinks to 0.97 while held */
:is(button:not(.faq-q), [role="button"], .btn, .pill-btn, .chip, .stepper-btn, .ts-opt, input[type="button"], input[type="submit"], input[type="reset"]) {
  transition: transform 220ms var(--ease), background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}
:is(button:not(.faq-q), [role="button"], .btn, .pill-btn, .chip, .stepper-btn, .ts-opt, input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):is(:active, .is-pressed) {
  transform: scale(0.97) !important;
  transition-duration: 70ms !important;
}

/* Tool pills and primary buttons used on the tool pages */
.pill-btn {
  min-height: 40px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2);
  font: 500 13px/1 var(--font); white-space: nowrap;
}
.pill-btn:hover { color: var(--ink); background: var(--surface-2); }
.pill-btn.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Theme switch: three icon buttons */
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; flex: none;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.ts-opt {
  display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border-radius: 999px;
  color: var(--ink-3); text-decoration: none;
}
.ts-opt .ico { width: 17px; height: 17px; stroke-width: 1.75; }
.ts-opt:hover { color: var(--ink); }
.ts-opt:active { transform: scale(0.94); }
.ts-opt.on { background: var(--surface); color: var(--accent); box-shadow: var(--elev, 0 0 0 1px var(--border)); }

/* Toasts */
.qt-toasts {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: grid; justify-items: end; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none;
}
.qt-toast {
  width: max-content; max-width: 100%;
  padding: 10px 14px; border-radius: var(--r-md); background: var(--ink); color: var(--bg);
  font: 500 13.5px/1.35 var(--font); box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(-8px); transition: opacity 180ms var(--ease), transform 220ms var(--ease);
}
.qt-toast.in { opacity: 1; transform: none; }
.qt-toast.out { opacity: 0; transform: translateY(-6px); }
.qt-toast.is-ok::before { content: "✓  "; color: var(--ok); }
@media (max-width: 640px) {
  .qt-toasts { top: 10px; left: 16px; right: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  button, .btn, .chip, a.card, .faq-q, .ts-opt, .qt-toast { transition: none !important; }
  .btn:hover, .chip:hover, a.card:hover, .btn:active, .chip:active, button:active { transform: none !important; }
}

[hidden] { display: none !important; }

/* ==========================================================================
   Site header and footer, admin pages (version 1.0.0.0038)
   ========================================================================== */
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 300; padding: 8px 12px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); text-decoration: none; }
.skip-link:focus { top: 12px; }
.head-inner { height: 60px; flex-wrap: nowrap; }
.head-inner > * { flex: none; }
.brand { white-space: nowrap; }
.nav-links { gap: 2px; margin-left: var(--s-4); }
.nav-links > a, .nav-links > details > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px;
  border-radius: var(--r-md); color: var(--ink-2); text-decoration: none; font-weight: 500; cursor: pointer; list-style: none;
}
.nav-links > a:hover, .nav-links > details > summary:hover { color: var(--ink); background: var(--surface-2); }
.nav-links > a[aria-current="page"], .nav-links > details > summary.on { color: var(--ink); background: var(--surface-2); }
.nav-links summary::-webkit-details-marker { display: none; }
.nav-links > a, .nav-links > details > summary { flex-direction: row; align-items: center; line-height: 1; }
.nav-links a::after { content: none; }
.nav-links .menu { position: relative; }
.menu-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; min-width: 240px; padding: 6px;
  display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.35);
}
.menu-panel a { display: block; padding: 9px 12px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.menu-panel a:hover { background: var(--surface-2); }
.menu-panel a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.menu-panel .menu-all { border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 var(--r-md) var(--r-md); color: var(--accent); font-weight: 600; }
.head-inner .theme-switch { margin-left: auto; }
@media (max-width: 680px) {
  .head-inner { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; height: auto; padding-block: 10px 8px; }
  .head-inner .brand { grid-column: 1; grid-row: 1; }
  .head-inner .theme-switch { grid-column: 2; grid-row: 1; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .nav-links > a, .nav-links > details > summary { justify-content: center; min-height: 38px; padding: 0 8px; background: var(--surface-2); }
  .nav-links .menu { position: static; }
  .nav-links .menu > summary { width: 100%; }
  .menu-panel { top: calc(100% + 6px); left: 12px; right: 12px; min-width: 0; grid-template-columns: 1fr 1fr; }
  .menu-panel .menu-all { grid-column: 1 / -1; }
}

.site-foot {
  width: min(calc(100% - 32px), 1440px);
  margin: 24px auto 16px; padding: 0;
  border: 1px solid var(--border); border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--pop, 0 18px 44px -18px rgba(0, 0, 0, 0.3));
  font-size: 13px; color: var(--ink-2);
  transition: padding-left 320ms var(--ease);
}
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-block: 40px 28px; }
.foot-brand .brand-logo { height: 72px; width: auto; }
.foot-brand p { margin: var(--s-3) 0 0; color: var(--ink-2); font-size: 14px; max-width: 34ch; }
.foot-brand .brand { color: var(--ink); }
.foot-col { display: grid; gap: 10px; align-content: start; justify-items: start; }
.foot-legal-links { display: contents; }
.foot-col h2 { font-size: 13px; margin: 0 0 4px; color: var(--ink); letter-spacing: 0; text-transform: none; }
.foot-col a { color: var(--ink-2); text-decoration: none; font-size: 14px; width: fit-content; }
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-block: 14px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: 13px; }
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; text-align: center; justify-items: center; gap: 24px 16px; padding-block: 32px 24px; }
  .foot-brand { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; }
  .foot-brand p { margin-inline: auto; }
  .foot-col { justify-items: center; }
  .foot-col--tools { grid-column: 1; }
  .foot-col--company { grid-column: 2; }
  .foot-col--legal { grid-column: 1 / -1; width: min(100%, 280px); }
  .foot-legal-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; width: 100%; justify-items: center; }
  .foot-bottom { justify-content: center; text-align: center; padding-block: 14px 66px; }
  .nav-links > a { padding: 0 8px; }
}
@media (max-width: 680px) {
  .site-head {
    width: calc(100% - 24px);
    top: calc(12px + env(safe-area-inset-top));
    margin-top: calc(12px + env(safe-area-inset-top));
  }
  .site-foot { width: calc(100% - 24px); }
}

/* Brand logo, "Powered by", and the phone bottom menu */
.brand-logo { height: 36px; width: auto; display: block; border-radius: 6px; background: #fff; }
/* Night: invert the white-background JPG and restore its hue so the mark reads on dark surfaces */
.powered { color: var(--ink-3); text-decoration: none; }
.powered:hover { color: var(--ink); text-decoration: underline; }
.powered .accent { color: var(--accent); font-weight: 600; }
.bottom-nav { display: none; }
@media (max-width: 1099px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 48px; color: var(--ink-2); text-decoration: none; font: inherit; font-size: 13px;
    background: none; border: 0; cursor: pointer; transition: transform 120ms ease-out;
  }
  .bottom-nav a:active, .bottom-nav button:active { transform: scale(0.97); }
  .bottom-nav a:hover, .bottom-nav button:hover { color: var(--ink); }
  .bottom-nav button[aria-expanded="true"] { color: var(--accent); }
  .bottom-nav .ico { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) { .bottom-nav a, .bottom-nav button { transition: none; } }


/* Header: toggle + brand flush-left, search centered, theme on the right. */
.site-head .head-inner {
  display: grid; grid-template-columns: 44px auto minmax(0, 1fr) auto; align-items: center;
  justify-content: stretch;
  gap: 12px; height: auto; min-height: 64px; padding-block: 10px;
}
.header-brand { display: flex; align-items: center; min-width: 0; }
.header-brand .brand-logo { height: 40px; width: auto; }
.site-head .head-inner > .hsearch { width: 100%; max-width: 560px; justify-self: center; }
.site-head--home .head-right { grid-column: -2 / -1; }
.head-right { display: flex; align-items: center; gap: 8px; justify-self: end; }
.compact-head-search {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: 0 0 40px; padding: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.compact-head-search .ico { width: 17px; height: 17px; stroke-width: 1.85; }
.compact-head-search:hover { background: var(--accent-soft); color: var(--accent); }
.site-head .theme-switch { justify-self: end; margin-left: 0; }
.menu-btn {
  display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.menu-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.menu-btn .ico { width: 20px; height: 20px; }
.hsearch { position: relative; flex: 1 1 auto; min-width: 0; max-width: 560px; margin-inline: auto; }
.hsearch input {
  width: 100%; min-height: 42px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px;
}
.hsearch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hs-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  max-height: 320px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}
.hs-list a {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 8px;
  min-width: 0; max-width: 100%; overflow: hidden;
  color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.hs-list a:hover, .hs-list a[aria-selected="true"] { background: var(--accent-soft); }
.hs-list small {
  color: var(--ink-3); font-size: 12.5px; font-weight: 400; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hs-none { padding: 10px; color: var(--ink-3); font-size: 13px; }

@media (max-width: 1099px) {
  .site-head .head-inner {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "menu brand theme";
    gap: 8px 10px; min-height: 0; padding-block: 10px;
  }
  .menu-btn { display: grid; grid-area: menu; }
  .header-brand { grid-area: brand; }
  .header-brand .brand-logo { height: 42px; }
  .site-head .head-inner > .hsearch { display: none; }
  .head-right { grid-area: theme; }
}

/* App shell: uniform 1440px max-width; sidebar opens inside the page like SillyClicks (10% smaller) */
.app-shell {
  flex: 1 0 auto;
  min-width: 0; width: min(100%, 1440px); margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left));
  transition: padding-left 320ms var(--ease);
}
.app-shell > main.wrap { width: auto; margin: 0; padding-inline: 0; }
.rail-backdrop {
  position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, 0.42);
  opacity: 0; visibility: hidden; transition: opacity 220ms var(--ease), visibility 220ms;
}
.rail-backdrop.is-on { opacity: 1; visibility: visible; }
@media (min-width: 1100px) {
  .rail-backdrop { display: none; }
  body.side-open .app-shell,
  body.side-open .site-foot { padding-left: calc(230px + 32px); }
}
.side-rail {
  display: flex; flex-direction: column;
  position: fixed; top: 100px; bottom: auto; left: 16px; z-index: 70;
  width: 230px; max-height: calc(100dvh - 96px);
  padding: 12px 10px 14px;
  overflow-y: auto; overscroll-behavior: contain;
  border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.14);
  transform: translateX(calc(-100% - 32px)); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform 320ms var(--ease), opacity 220ms ease-out, visibility 260ms;
}
.side-rail.is-open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
.rail-top { display: flex; align-items: center; gap: 8px; padding: 2px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.rail-title { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; padding-left: 6px; }
.rail-close {
  display: grid; width: 40px; height: 40px; flex: 0 0 40px; margin-left: auto; place-items: center;
  border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--ink); cursor: pointer;
}
.rail-close .ico { width: 16px; height: 16px; }
.rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail-row { display: flex; align-items: center; gap: 4px; }
.rail-link {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 6px 9px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 13.5px;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.rail-link:hover, .rail-link[aria-expanded="true"] { background: var(--accent-soft); color: var(--ink); }
.rail-link[aria-current="page"] { color: var(--accent); font-weight: 600; }
.rail-ico { width: 18px; height: 18px; flex: 0 0 18px; color: var(--accent); }
.rail-name { flex: 1 1 auto; min-width: 0; }
.side-count {
  flex: 0 0 auto; min-width: 26px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 999px;
  text-align: center; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.rail-plus {
  display: none; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1.5px solid var(--ink-2);
  border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer;
}
.rail-plus .ico { width: 16px; height: 16px; }
.rail-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.rail-surprise {
  min-height: 40px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.rail-surprise:hover { background: var(--accent-hover); }
.rail-suggest {
  display: flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 6px; text-align: center; color: var(--accent); font-size: 12.5px; text-decoration: none;
}
.rail-suggest:hover { text-decoration: underline; }

/* Word Counter ad placements: right 160x600 + centered 728x90 inline banners from DB */
.ad-slot { width: min(100%, 728px); min-width: 0; margin: var(--s-6) auto; text-align: center; }
.ad-label { margin: 0 0 5px; font-size: 12px; color: var(--ink-2); }
.ad-choice-hint { margin: 0; font-size: 14px; }
.ad-label, .ad-choice-hint { max-width: none; }
.ad-choice-hint a { color: var(--accent); text-underline-offset: 3px; }
.ad-box { display: grid; justify-content: center; overflow: hidden; }
.ad-slot[hidden], .ad-box[hidden], .ad-choice-hint[hidden] { display: none; }
.ad-frame { display: block; max-width: 100%; border: 0; }
.ad-choice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.ad-choice-actions [aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ad-dimensions { color: var(--ink-3) !important; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Ad placements: 728x90 banners in the main column, 160px units in the right rail. */
.ad-slot--banner-top, .ad-slot--banner-mid, .ad-slot--banner-bottom { width: min(100%, 728px); margin: 16px auto; }
.ad-slot--rail-tall, .ad-slot--rail-short { width: 160px; margin: 0; }

.tool-with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 20px; align-items: start; }
.tool-main-col { min-width: 0; }
.tool-ad-rail { position: sticky; top: 100px; display: grid; gap: 16px; }
@media (max-width: 1199px) {
  .tool-with-rail { grid-template-columns: minmax(0, 1fr); }
  .tool-ad-rail { display: none; }
}

/* Empty slots read as a themed surface, never a white box. */
.ad-box {
  min-width: 0;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink-3);
}
.ad-slot--banner-top .ad-box, .ad-slot--banner-mid .ad-box, .ad-slot--banner-bottom .ad-box {
  height: calc(90px * var(--ad-scale, 1)); min-height: 44px; overflow: hidden;
}
.ad-frame { display: block; max-width: none; transform: scale(var(--ad-scale, 1)); transform-origin: center center; }
.ad-slot--banner-top .ad-frame, .ad-slot--banner-mid .ad-frame, .ad-slot--banner-bottom .ad-frame { width: 728px; height: 90px; }
@media (max-width: 760px) {
  .ad-slot--banner-top, .ad-slot--banner-mid, .ad-slot--banner-bottom { --ad-scale: clamp(0.42, calc(100vw / 760px), 1); }
}

/* Category modal: 15% smaller (255px), opens instantly beside the open drawer on desktop */
.cat-panel {
  position: fixed; z-index: 75; width: 255px; max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain;
  top: var(--panel-top, 100px); left: 258px;
  padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  opacity: 0; visibility: hidden; transform: translateX(-3px);
  transition: opacity 55ms ease-out, transform 55ms ease-out, visibility 55ms;
}
.cat-panel.is-open { opacity: 1; visibility: visible; transform: none; }
.cat-panel-head { display: flex; align-items: center; gap: 8px; }
.cat-panel-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 17px; }
.cat-panel-head h2 a { color: inherit; text-decoration: none; }
.cat-panel-head h2 a:hover { text-decoration: underline; }
.cat-live { flex: 0 0 auto; align-self: flex-start; margin-top: 4px; color: var(--ink-3); font-size: 11px; font-style: italic; letter-spacing: 0.02em; }
.cat-seeall { flex: 0 0 auto; color: var(--accent); font-size: 14px; text-decoration: none; }
.cat-seeall:hover { text-decoration: underline; }
.cat-close {
  width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--ink); cursor: pointer;
}
.cat-close .ico { width: 16px; height: 16px; }
.cat-search {
  width: 100%; min-height: 42px; margin: 12px 0 6px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.cat-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cat-list li {
  display: flex; align-items: center;
  padding: 0; border-bottom: 1px dashed var(--border); border-radius: 8px;
}
.cat-list li:last-child { border-bottom: 0; }
.cat-list li:hover { background: var(--accent-soft); }
.cat-list a {
  display: block; width: 100%; padding: 10px 8px;
  min-width: 0; color: var(--ink); font-weight: 500; text-decoration: none;
}
.cat-list a:hover { text-decoration: underline; }
.cat-none { padding: 12px 8px; color: var(--ink-3); font-size: 14px; }

/* Category page filter/sort toolbar and its empty state */
.cat-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.cat-filter, .cat-sort {
  min-height: 40px; max-width: 100%;
  padding: var(--s-2) var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-size: 14px;
}
.cat-filter { flex: 1 1 240px; min-width: 0; }
.cat-sort { flex: 0 1 auto; }
.cat-filter:focus-visible, .cat-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-empty { padding: var(--s-6) 0; color: var(--ink-3); font-size: 14px; text-align: center; }

.category-intro { display: grid; gap: 12px; padding-block: clamp(24px, 5vw, 52px) 26px; }
.category-title { display: flex; align-items: center; gap: 14px; }
.category-title h1 { margin: 0; max-width: 24ch; font-size: clamp(1.9rem, 4vw, 3.25rem); }
.category-title .tile { width: 44px; height: 44px; flex: none; }
.category-intro > p { max-width: 60ch; color: var(--ink-2); margin: 0; }
.category-tasks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.category-tasks a, .category-neighbours li a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.category-tasks a:hover, .category-neighbours a:hover { border-color: var(--accent); color: var(--accent); }
.category-tasks .ico, .category-tools .ico { width: 16px; height: 16px; flex: none; color: var(--accent); }
.category-directory { padding: clamp(14px, 3vw, 26px); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.category-directory-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.category-directory-head h2 { margin: 0; }
.category-count { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.category-directory .cat-toolbar { gap: 8px; }
.category-directory .cat-filter, .category-directory .cat-sort { min-height: 44px; font-size: 15px; }
.category-tools, .category-neighbours ul { list-style: none; padding: 0; margin: 0; }
.category-tools li { border-top: 1px solid var(--border); }
.category-tools li[hidden], .cat-toolbar [hidden] { display: none; }
.category-tools a {
  display: grid; grid-template-columns: minmax(135px, .65fr) minmax(0, 1.35fr) 16px;
  align-items: center; gap: 14px; min-height: 56px; padding: 10px 5px;
  color: var(--ink); text-decoration: none;
}
.category-tools a:hover { color: var(--accent); }
.category-tool-name { font-weight: 650; }
.category-tool-desc { color: var(--ink-2); font-size: 14px; }
.category-guide .prose { max-width: 70ch; }
.category-neighbours ul { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.pilot-workspace {
  padding: clamp(14px, 2.8vw, 28px); border: 1px solid var(--border);
  border-radius: 16px; background: var(--surface);
}
.pilot-split { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); align-items: start; gap: clamp(16px, 3vw, 32px); }
.pilot-split > *, .pilot-field-pair > * { min-width: 0; }
.pilot-fields { display: grid; gap: 13px; }
.pilot-fields h2, .pilot-result h2 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.pilot-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pilot-field-pair .input { width: 100%; min-width: 0; }
.pilot-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pilot-toolbar .btn, .pilot-workspace .input { min-height: 44px; }
.pilot-toolbar label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.pilot-toolbar [hidden], .pilot-disclosure[hidden] { display: none; }
.pilot-toolbar .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.pilot-toolbar .btn:disabled { cursor: not-allowed; opacity: .57; }
.pilot-workspace .pilot-limit { width: min(100%, 110px); }
.pilot-workspace .textarea { min-height: clamp(190px, 30vw, 320px); min-width: 0; font-size: 16px; }
.pilot-result { display: grid; gap: 12px; padding: clamp(12px, 2.4vw, 22px); border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.pilot-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.pilot-metrics dt { color: var(--ink-2); font-size: 13px; }
.pilot-metrics dd { margin: 2px 0 0; font-size: clamp(1.15rem, 3vw, 1.8rem); font-weight: 650; overflow-wrap: anywhere; }
.pilot-breakdown { margin: 0; }
.pilot-breakdown div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.pilot-breakdown dd { margin: 0; font-weight: 630; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pilot-total { font-size: 1.08rem; }
.pilot-disclosure summary { min-height: 44px; padding-block: 10px; cursor: pointer; font-weight: 600; }
.pilot-disclosure h3 { margin: 10px 0 4px; font-size: 1rem; }
.pilot-note, .pilot-status p { margin: 0; color: var(--ink-2); font-size: 14px; }
.pilot-note:empty { display: none; }
.pilot-answer { margin: 0; color: var(--ink); font-size: clamp(1.05rem, 2.1vw, 1.3rem); font-weight: 620; }
.pilot-workspace .pilot-error, .pilot-status [data-state="error"] { color: var(--err); }
.pilot-status [data-state="ok"] { color: var(--ok); }
.pilot-status [data-state="warning"] { color: var(--ink); font-weight: 600; }
.pilot-json-controls { margin-bottom: 16px; }
.pilot-json-editors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pilot-json-editors .json-result { background: var(--surface-2); }
.pilot-status { margin-top: 14px; min-height: 44px; }
.pilot-metrics--compact { display: flex; flex-wrap: wrap; gap: 5px 14px; color: var(--ink-2); font-size: 13px; }
.pilot-metrics--compact strong { font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .pilot-split, .pilot-json-editors { grid-template-columns: minmax(0, 1fr); }
  .pilot-workspace .textarea { min-height: 185px; }
}

@media (max-width: 560px) {
  .category-tools a { grid-template-columns: minmax(0, 1fr) 16px; gap: 4px 10px; padding: 12px 4px; }
  .category-tool-desc { grid-row: 2; }
  .category-tools .ico { grid-column: 2; grid-row: 1 / span 2; }
  .category-directory .cat-filter { flex-basis: 100%; }
  .category-tasks a { flex: 1 1 100%; justify-content: space-between; }
}

@media (max-width: 1099px) {
  .side-rail {
    top: 0; bottom: 0; left: 0; z-index: 70;
    width: min(300px, 84vw); height: 100dvh; max-height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
    border-radius: 0 16px 16px 0; border: 0; border-right: 1px solid var(--border);
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.22);
    transform: translateX(-104%);
  }
  .rail-plus { display: grid; }
  .rail-link { min-height: 44px; font-size: 14.5px; }
  .cat-panel {
    top: 72px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 96px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rail-backdrop, .side-rail, .cat-panel, .rail-link { transition: none; }
}

/* Link lists under tool and category pages */
.link-cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 24px; }
.link-cols a { color: var(--accent); text-decoration: none; }
.link-cols a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Admin */
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; margin-top: var(--s-8); }
.admin-head h1 { margin: 0; }
.admin-stat .stat-lbl { margin: 0; color: var(--ink-3); font-size: 13px; }
.stat-big { margin: 6px 0 0; font-size: 28px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.table { width: 100%; border-collapse: collapse; margin-top: var(--s-3); font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.num-col { text-align: right !important; font-variant-numeric: tabular-nums; }
.msg { margin-top: 12px; display: grid; gap: 10px; }
.msg.is-new { border-left: 3px solid var(--accent); }
.msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; }
.msg-head a { margin-left: 8px; font-size: 14px; }
.msg-body { color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-danger { color: var(--err); border-color: var(--err-soft, var(--border)); }
.btn-danger:hover { background: var(--err-soft, var(--surface-2)); }
.notice.err { border-color: var(--err); }
.notice.err p { color: var(--err); margin: 0; }
.legal-summary p { margin: 0; }
.legal .card { margin-top: var(--s-3); }
.legal-sec h2 { font-size: 16px; margin: 0 0 var(--s-2); }
.contact-form select.input { appearance: auto; }

/* Tool content sections */
.tool-sec ul, .tool-sec ol { margin: var(--s-3) 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); max-width: 72ch; }
.tool-sec p + p { margin-top: var(--s-3); }

/* Changelog */
.cl-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-8); margin-top: var(--s-8); align-items: start; }
.cl-side { position: sticky; top: 84px; }
.cl-side-h { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 var(--s-3); }
.cl-side ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cl-side li { display: flex; flex-direction: column; }
.cl-side li a { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-decoration: none; }
.cl-side li a:hover { color: var(--accent); }
.cl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); min-width: 0; }
.cl-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-6); scroll-margin-top: 84px; }
.cl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--ink-3); }
.cl-ver { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.cl-title { font-size: 20px; margin: var(--s-3) 0 var(--s-3); }
.cl-bullets { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); max-width: 72ch; }
.cl-p { margin: 0 0 var(--s-3); }
@media (max-width: 860px) {
  .cl-layout { grid-template-columns: 1fr; gap: var(--s-4); }
  .cl-side { position: static; }
  .cl-side ol { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cl-item { padding: var(--s-4); }
}

/* Legal pages: sidebar table of contents + article */
.legal-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--s-8); margin-top: var(--s-8); align-items: start; }
.legal-side { position: sticky; top: 84px; display: grid; gap: var(--s-4); }
.legal-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); }
.legal-toc summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); list-style: none; }
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc ol { margin: var(--s-3) 0 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: toc; }
.legal-toc li a { display: block; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13.5px; text-decoration: none; line-height: 1.35; }
.legal-toc li a:hover { background: var(--surface-2); color: var(--ink); }
.legal-toc li a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.legal-side-other { font-size: 13px; color: var(--ink-3); margin: 0; max-width: none; }
.legal-side-other a { color: var(--accent); }
.legal-body { display: grid; gap: var(--s-4); min-width: 0; }
.legal-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-6); scroll-margin-top: 84px; }
.legal-sec h2 { font-size: 18px; margin: 0 0 var(--s-3); }
.legal-sec p + p { margin-top: var(--s-3); }
.legal-sec p { max-width: 72ch; }
.legal-list { margin: var(--s-3) 0 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 6px; max-width: 72ch; }
.legal-table { margin-top: var(--s-4); }
.legal-table .info-table td, .legal-table .info-table th { vertical-align: top; }
@media (min-width: 861px) {
  .legal-toc summary { display: none; }
}
@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; gap: var(--s-4); }
  .legal-side { position: static; }
  .legal-toc ol { max-height: 46vh; overflow-y: auto; }
  .legal-sec { padding: var(--s-4); }
}

/* Page heading block for the simple pages: text stacks cleanly under the title */
.page-hero { display: block; }
.page-hero > p { margin-top: 10px; }
.page-hero .lead { max-width: 62ch; margin-top: var(--s-3); }

/* Centered prose column for tool pages, legal pages & changelog */
.tool-prose-col { width: min(100%, 680px); margin-inline: auto; padding-bottom: 88px; }
@media (max-width: 1099px) { .tool-prose-col { padding-bottom: 128px; } }
.doc-col { width: min(100%, 880px); margin-inline: auto; padding-bottom: 56px; }
.policy-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s-4); }

/* Changelog Timeline UI */
.cl-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: var(--s-5);
}
.cl-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cl-stat-l { font-size: 12px; color: var(--ink-3); }
.cl-stat-v { font-size: 18px; font-weight: 600; color: var(--ink); }
.cl-timeline {
  list-style: none;
  margin: var(--s-6) 0 0;
  padding: 0 0 0 26px;
  position: relative;
  display: grid;
  gap: 18px;
}
.cl-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border);
}
.cl-node { position: relative; scroll-margin-top: 84px; }
.cl-dot {
  position: absolute;
  left: -24px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border-strong);
}
.cl-dot.is-latest {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.cl-date { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 600px) {
  .cl-stats { grid-template-columns: 1fr; }
}


/* ==========================================================================
   v1.0.0.0048 — Floating Mobile Search FAB, Modals, Discovery Hub, Guide Pill,
   Contact Hub, Spotlight Cards & Custom Cursor
   ========================================================================== */

/* Site-wide blue spotlight hover on every card surface */
.card, .spot-card, .exp-chip, .ct-card, .perk, .legal-sec, .cl-stat {
  position: relative;
  overflow: hidden;
}
.card::before, .spot-card::before, .exp-chip::before, .ct-card::before, .perk::before, .legal-sec::before, .cl-stat::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--hover-glow), transparent 65%);
  transition: opacity 180ms var(--ease);
}
.card:hover::before, .spot-card:hover::before, .exp-chip:hover::before, .ct-card:hover::before, .perk:hover::before, .legal-sec:hover::before, .cl-stat:hover::before { opacity: 1; }
/* background-image instead of ::before so controls need no overflow:hidden that would clip them. */
.btn:hover:not([hidden]):not(.primary):not(.btn-primary), .chip:hover, .nav-links > a:hover, .rail-link:hover, .cat-list a:hover, .cat-seeall:hover, .crumbs a:hover, .foot-col a:hover, .faq-q:hover, .ts-opt:hover {
  background-image: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--hover-glow), transparent 70%);
}
.spot-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spot-arrow { width: 16px; height: 16px; color: var(--ink-3); transition: transform 180ms var(--ease), color 180ms var(--ease); }
.spot-card:hover .spot-arrow { transform: translateX(3px); color: var(--accent); }

/* Mobile Floating Animated Search Button (FAB) */
.mob-search-fab-wrap { display: none; }
@media (max-width: 1099px) {
  .mob-search-fab-wrap {
    position: fixed;
    top: calc(96px + env(safe-area-inset-top));
    left: 0; right: 0;
    display: flex; justify-content: center;
    z-index: 60; pointer-events: none;
  }
  .mob-search-fab {
    pointer-events: auto;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: 44px; padding: 0 var(--s-4);
    border: 0; border-radius: var(--r-md);
    background: var(--accent); color: var(--accent-ink);
    font: 600 14px/1 var(--font);
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background-color 150ms var(--ease);
    animation: qt-fab-bob 2.8s ease-in-out infinite;
    will-change: transform;
  }
  .mob-search-fab .ico { width: 17px; height: 17px; stroke-width: 1.5; }
  .mob-search-fab:hover { background: var(--accent-hover); }
  body:has(.home-page, .category-intro, .pilot-workspace) .mob-search-fab-wrap { display: none; }
}
@keyframes qt-fab-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-1.5deg); }
  50% { transform: translateY(2px) rotate(0deg); }
  75% { transform: translateY(-4px) rotate(1.5deg); }
}
.mob-search-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Native <dialog> Modals (15% smaller: 476px) */
.qt-modal {
  width: min(476px, calc(100vw - 24px));
  max-height: min(82dvh, 580px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px -20px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 180ms var(--ease), transform 200ms var(--ease);
}
.qt-modal[open] {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: none;
}
.qt-modal::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.qt-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.qt-modal-head h2 { font-size: 17px; font-weight: 600; margin: 0; }
.qt-modal-close {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: var(--surface-2); color: var(--ink);
}
.qt-modal-close:hover { background: var(--accent-soft); color: var(--accent); }
.qt-modal-body {
  padding: 18px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  font-size: 14px;
  color: var(--ink-2);
}
.qt-modal-body a { color: var(--accent); text-decoration: underline; }
.cm-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--ink-2);
}
.cm-list strong { color: var(--ink); font-weight: 600; }
.cm-list code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
}

/* Search Modal internals */
.ms-input-wrap {
  position: relative;
  padding: 12px 18px 8px;
}
.ms-ico {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-42%);
  width: 17px; height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}
#ms-q {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
#ms-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ms-list {
  padding: 4px 10px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}
.ms-list a {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.ms-list a:hover, .ms-list a[aria-selected="true"] { background: var(--accent-soft); }
.ms-list small {
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Interactive Discovery Hub */
.explore-hub { padding-bottom: var(--s-6); }
.explore-head { align-items: flex-end; gap: 16px; }
.exp-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.exp-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.exp-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 680px) {
  .exp-filter-wrap { width: 100%; }
  .exp-filter { width: 100%; }
}
.exp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 13px/1 var(--font);
  white-space: nowrap;
}
.exp-tab:hover { color: var(--ink); }
.exp-tab.is-on {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.exp-cnt {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.exp-tab.is-on .exp-cnt { background: var(--accent-soft); color: var(--accent); }
.exp-filter {
  min-height: 40px;
  width: 190px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
}
.exp-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.exp-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.exp-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.exp-chip:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.exp-chip-name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.exp-chip-sub { font-size: 13px; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.exp-empty { margin-top: var(--s-4); }

/* Floating Start-to-End Guide Pill + Jump Map (talks.s-anand.net inspired) */
.guide-dock {
  position: fixed;
  left: auto;
  right: 18px;
  bottom: 18px;
  transform: none;
  z-index: 58;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.guide-pill, .guide-pop { pointer-events: auto; }
.guide-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.28);
}
.guide-step {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2);
}
.guide-step:hover { background: var(--surface-2); color: var(--ink); }
.guide-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 13.5px/1 var(--font);
  max-width: 240px;
}
.guide-toggle:hover { background: var(--surface-2); }
.guide-cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-chev { width: 14px; height: 14px; color: var(--ink-3); transition: transform 180ms var(--ease); }
.guide-toggle[aria-expanded="true"] .guide-chev { transform: rotate(180deg); }
.guide-pop {
  width: min(680px, calc(100vw - 24px));
  max-height: min(64dvh, 480px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.36);
  display: grid;
  gap: 14px;
}
.guide-group-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 8px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
}
.guide-card:hover { border-color: var(--accent); background: var(--surface-2); }
.guide-card.is-cur { border-color: var(--accent); background: var(--accent-soft); }
.guide-card-t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.guide-card-s { font-size: 12px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1099px) {
  .guide-dock {
    left: auto;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    transform: none;
    align-items: flex-end;
  }
  .guide-toggle { max-width: 140px; padding: 0 10px; font-size: 12.5px; }
  body:has(.pilot-workspace) .guide-dock[data-workspace="true"] { display: none; }
  .guide-step { width: 30px; height: 30px; }
  .guide-pop { width: min(680px, calc(100vw - 24px)); }
}

/* Custom Contact Hub */
.contact-hub {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: var(--s-5);
}
.contact-aside { display: flex; flex-direction: column; gap: 14px; }
.contact-aside .chip { align-self: flex-start; }
.contact-aside h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; }
.contact-aside .lead { font-size: 15.5px; color: var(--ink-2); max-width: 48ch; }
.contact-topics { display: grid; gap: 10px; margin-top: 6px; }
.ct-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
.ct-card:hover { border-color: var(--border-strong); }
.ct-card.is-on { border-color: var(--accent); background: var(--accent-soft); }
.ct-ico {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
}
.ct-card.is-on .ct-ico { background: var(--accent); color: #fff; }
.ct-ico .ico { width: 18px; height: 18px; }
.ct-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct-copy strong { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ct-copy span { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.contact-meta {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.cm-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.cm-row .ico { width: 17px; height: 17px; color: var(--accent); margin-top: 2px; }
.contact-card { padding: clamp(20px, 3vw, 32px); }
.contact-card-head { margin-bottom: 18px; }
.contact-card-head h2 { font-size: 20px; margin-bottom: 4px; }
.contact-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.char-count { font-variant-numeric: tabular-nums; }
.contact-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.contact-foot a { color: var(--accent); text-decoration: underline; }
.contact-sent { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px 4px; }
.sent-badge {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--ok-soft);
  color: var(--ok);
}
.sent-badge .ico { width: 24px; height: 24px; stroke-width: 2; }
.sent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 920px) {
  .contact-hub { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .contact-row-2 { grid-template-columns: 1fr; }
}

/* Custom Cursor (fine pointers only, 60fps transform-only, reduced-motion safe) */
.qt-cur-dot, .qt-cur-ring { display: none; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .qt-cur-dot, .qt-cur-ring {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 160ms ease-out;
  }
  .qt-cur-dot {
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 999px;
    background: var(--accent);
  }
  .qt-cur-ring {
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
    transition: opacity 160ms ease-out, width 160ms var(--ease), height 160ms var(--ease), margin 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
  }
  .qt-cur-ring.is-hover {
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }
  .qt-cur-ring.is-down {
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
  }
  .qt-cur-dot.is-vis, .qt-cur-ring.is-vis { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .mob-search-fab { animation: none !important; }
  .qt-cur-dot, .qt-cur-ring { display: none !important; }
  .to-top { transition: none !important; }
}

/* Phase 4: mobile touch targets >=44px. Kept last so the base 40px rules cannot win the cascade. */
@media (max-width: 680px) {
  .btn, .pill-btn, .ts-opt, .exp-tab, .cat-filter, .cat-sort { min-height: 44px; }
  .ts-opt { min-width: 44px; }
  .rail-close, .rail-plus { width: 44px; height: 44px; flex: 0 0 44px; }
  .rail-surprise, .rail-suggest { min-height: 44px; }
  .stepper-btn::after { inset: -11px; }
}

/* Back-to-top arrow (button markup + .is-visible toggled in common.js) */
.to-top {
  position: fixed; right: 20px; bottom: 100px; z-index: 59;
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--pop, 0 18px 44px -18px rgba(0, 0, 0, 0.3));
  color: var(--ink-2);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease), visibility 160ms var(--ease), background-color 150ms var(--ease), color 150ms var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent-soft); color: var(--accent); }
.to-top .ico { width: 20px; height: 20px; }
@media (max-width: 1099px) {
  .to-top { right: 12px; bottom: calc(160px + env(safe-area-inset-bottom)); }
}
