/*
 * Quiver · base.css
 * ----------------------------------------------------------
 * Shared primitives used across every screen:
 *   reset · typography · layout · topbar · buttons ·
 *   forms · pills · cards · doc · focus card patterns
 * Screen-specific styles live in styles/<screen>.css.
 */

/* ── Reset & defaults ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--fz-body);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus { outline: 0; }
:focus-visible {
  outline: 2px solid var(--studio);
  outline-offset: 2px;
  border-radius: 4px;
}
[hidden] { display: none !important; }

/* Skip navigation: available to keyboard / SR users, not a visible top bar by default */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10002;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  overflow: visible;
  clip: auto;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-md);
}

/* Offline banner (shown only when [hidden] is removed by offline.js) */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--warning-soft);
  color: var(--text);
  border-bottom: 1px solid var(--warning-border);
}

/* ── Typography utility ─────────────────────────────────── */
.eyebrow {
  font-size: var(--fz-eyebrow);
  font-weight: var(--fw-strong);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.eyebrow--soft { color: var(--muted-soft); }
.eyebrow.eyebrow--success { color: var(--success); }

.section-label {
  font-size: 10.5px;
  font-weight: var(--fw-strong);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-size: var(--fz-display);
  font-weight: var(--fw-display);
  letter-spacing: var(--ls-display);
  line-height: 0.96;
}
.hero-h1 {
  font-size: var(--fz-hero);
  font-weight: var(--fw-bold);
  letter-spacing: -0.035em;
  line-height: var(--lh-tight);
  margin: 0 0 14px;
}
.hero-h1 em { font-style: normal; color: var(--muted-soft); font-weight: var(--fw-bold); }
.section-h2 {
  font-size: 22px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  margin: 0;
}
.title { font-size: var(--fz-title); font-weight: 720; letter-spacing: var(--ls-snug); margin: 0; }
.muted { color: var(--muted); }
.muted-soft { color: var(--muted-soft); }
.tabular { font-variant-numeric: tabular-nums; }

/* ── App shell ──────────────────────────────────────────── */
.app-shell {
  max-width: var(--max-app);
  margin: 24px auto 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rad-xl);
  overflow: hidden;
  box-shadow: 0 6px 20px oklch(0.19 0.018 72 / 0.06);
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  display: flex; align-items: center; gap: var(--sp-6);
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}
.topbar__brand {
  font-weight: var(--fw-strong);
  letter-spacing: var(--ls-tight);
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}
.topbar__nav { display: flex; gap: 22px; flex: 1; padding-left: var(--sp-6); }
.topbar__nav a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  transition: color var(--t-fast) var(--ease-out);
}
.topbar__nav a:hover { color: var(--text); }
.topbar__nav a.is-active { color: var(--text); font-weight: var(--fw-medium); }
.topbar__title { flex: 1; text-align: center; font-size: 13.5px; color: var(--muted); }
.topbar__title strong { color: var(--text); font-weight: var(--fw-medium); }
.topbar__spacer { flex: 1; }
.topbar__readiness {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-size: 13px; color: var(--muted);
}
.topbar__readiness strong { color: var(--text); font-weight: var(--fw-medium); }
.topbar__readiness--done {
  font-weight: var(--fw-medium);
  color: var(--success);
  padding: 5px var(--sp-3);
  background: var(--success-soft);
  border: 1px solid oklch(0.85 0.06 145);
  border-radius: var(--rad-pill);
}
.topbar__acct {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: 12.5px; color: var(--muted);
}
.topbar__acct .ring {
  width: 32px; height: 32px; border-radius: var(--rad-pill);
  background: var(--studio); color: var(--surface);
  display: grid; place-items: center;
  font-size: 11px; font-weight: var(--fw-strong);
}
/* ROADMAP §1.1 — quiet "Sign out" link adjacent to the account chip.
   Deliberately not a button: this is a navigation-shaped action, and
   styling it as a button would create visual contention with the
   primary CTAs on each screen. */
.topbar__signout {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--rad-sm);
  margin-left: 4px;
}
.topbar__signout:hover { color: var(--text); background: var(--surface-warm); }

/* ── Phase bar (Draft → Confirm → Send breadcrumb) ──────
   Wave-2 polish: mid-flow screens (confirm.js, send.js, and the
   post-generate state of draft.js) all render this thin strip
   under the topbar so users never lose track of where they are
   or how to back out. Active step is bold; reachable siblings
   are links; unreachable steps render dim. */
.phase-bar {
  display: flex;
  justify-content: center;
  padding: 8px var(--sp-6) 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.phase-bar__steps {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.phase-bar__step {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--rad-sm);
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
a.phase-bar__step:hover { color: var(--text); background: var(--surface-warm); }
.phase-bar__step.is-active { color: var(--text); }
.phase-bar__step.is-active strong { font-weight: var(--fw-medium); color: var(--text); }
.phase-bar__step.is-disabled { color: var(--muted-soft); cursor: default; }
.phase-bar__n {
  font-size: 10.5px;
  font-weight: var(--fw-strong);
  letter-spacing: 0.06em;
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}
.phase-bar__step.is-active .phase-bar__n { color: var(--studio); }
.phase-bar__sep { color: var(--muted-soft); font-size: 12px; }
/* Wave-2 polish: quiet back-link rendered at the trailing edge of the phase
   bar (Send uses it for "← Back to Confirm"). Matches Confirm's calm
   "See the job post" treatment so the back-out path is discoverable without
   competing with the active step. */
.phase-bar { position: relative; }
.phase-bar__back {
  position: absolute;
  right: var(--sp-6);
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-weight: var(--fw-medium);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.phase-bar__back:hover { color: var(--text); }

/* Wave-2 polish: subtle three-dot pulse for buttons in a 1–3s wait state
   (Dashboard "Drafting…", anywhere else a calmer-than-spinner cue fits).
   CSS-only animation; no JS deps. Inherits color from the parent so it
   reads quietly on primary buttons. */
.dot-pulse {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.dot-pulse > span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: dot-pulse-bounce 1.2s infinite ease-in-out both;
}
.dot-pulse > span:nth-child(1) { animation-delay: -0.32s; }
.dot-pulse > span:nth-child(2) { animation-delay: -0.16s; }
.dot-pulse > span:nth-child(3) { animation-delay: 0s; }
@keyframes dot-pulse-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dot-pulse > span { animation: none; opacity: 0.6; }
}

/* Readiness meter — used in topbar + standalone */
.meter {
  width: 110px; height: 5px;
  background: var(--surface-strong);
  border-radius: var(--rad-pill);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  background: var(--studio);
  border-radius: var(--rad-pill);
  transition: width var(--t-slow) var(--ease-out);
}

/* ── Pills & chips ──────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: 12px; font-weight: var(--fw-medium);
  padding: 4px var(--sp-3); border-radius: var(--rad-pill);
  background: var(--surface-warm);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill--success  { background: var(--success-soft); border-color: oklch(0.85 0.06 145); color: var(--success); }
.pill--warning  { background: var(--warning-soft); border-color: oklch(0.85 0.07 82); color: var(--warning); }
.pill--studio   { background: var(--studio); border-color: var(--studio); color: var(--surface); }
.pill--danger   { background: var(--danger-soft); border-color: oklch(0.85 0.08 28); color: var(--danger); }
.pill--idle     { background: var(--surface-strong); color: var(--muted); border-color: transparent; }
.pill--hot      { background: var(--success-soft); border-color: oklch(0.85 0.06 145); color: var(--success); }
.pill--stale    { background: var(--surface-strong); color: var(--muted); border-color: transparent; }
.pill--new      { background: var(--surface); color: var(--text); border-color: var(--border-soft); }

.pill .dot {
  width: 8px; height: 8px; border-radius: var(--rad-pill);
  background: currentColor; flex-shrink: 0;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: 10px 16px;
  border-radius: var(--rad-pill);
  font-weight: var(--fw-medium);
  font-size: 13.5px;
  letter-spacing: -0.005em;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all var(--t-fast) var(--ease-out);
  text-decoration: none;
}
.btn:hover { background: var(--surface-warm); border-color: var(--text); }

.btn--primary {
  background: var(--studio); color: var(--surface);
  border-color: var(--studio);
  font-weight: var(--fw-strong);
  box-shadow: var(--shadow-cta);
}
.btn--primary:hover { background: var(--studio-deep); border-color: var(--studio-deep); }

.btn--ghost {
  background: transparent; border-color: transparent; color: var(--muted);
}
.btn--ghost:hover { background: transparent; color: var(--text); }

.btn--lg { padding: 14px 24px; font-size: 15px; }
.btn--sm { padding: 8px 14px; font-size: 12.5px; }

.btn--destructive {
  background: transparent; border: 0; color: var(--danger);
  font-weight: var(--fw-medium); font-size: 12.5px;
  text-decoration: underline dotted; text-underline-offset: 3px;
  padding: 6px 4px;
}

/* Action button used inside focus cards: stacked label + sub */
.action-btn {
  display: flex; flex-direction: column; gap: 2px;
  text-align: left;
  padding: 13px 17px;
  border-radius: var(--rad-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: var(--fw-medium);
  font-size: 14.5px;
  color: var(--text);
  transition: all var(--t-fast) var(--ease-out);
}
.action-btn:hover { border-color: var(--text); background: var(--surface-warm); }
.action-btn .sub {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.action-btn--primary {
  background: var(--studio); color: var(--surface); border-color: var(--studio);
}
.action-btn--primary .sub { color: var(--studio-tone); }
.action-btn--primary:hover { background: var(--studio-deep); border-color: var(--studio-deep); }

/* ── Form inputs ────────────────────────────────────────── */
.field {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--rad-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast) var(--ease-out);
}
.field:focus-within {
  border-color: var(--studio);
  box-shadow: 0 0 0 4px oklch(0.235 0.045 72 / 0.08), var(--shadow-sm);
}
.field__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--sp-2);
}
.field__label {
  font-size: 13.5px; font-weight: var(--fw-medium); color: var(--text);
}
.field__helper {
  font-size: 12px; color: var(--muted);
}
.field__helper a {
  color: var(--muted);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.field__input {
  width: 100%; min-height: 96px; resize: vertical;
  border: 0; outline: 0; background: transparent;
  font: inherit; line-height: var(--lh-base); color: var(--text);
  padding: 0;
}
.field__input::placeholder { color: var(--muted-soft); }
.field--input { padding: 12px 14px; }
.field--input .field__input { min-height: auto; }

/* Search field — pill-shaped with leading icon */
.search-field {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--rad-pill);
  padding: var(--sp-2) var(--sp-4);
  font-size: 13.5px;
}
.search-field input {
  border: 0; outline: 0; background: transparent;
  flex: 1; color: var(--text);
  padding: 0; min-width: 0;
}
.search-field input::placeholder { color: var(--muted-soft); }
.search-field .ic { color: var(--muted-soft); font-size: 14px; }

/* Segmented view toggle */
.segmented {
  display: inline-flex; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--rad-pill);
  padding: 3px;
}
.segmented button {
  padding: 6px 12px; border-radius: var(--rad-pill);
  font-size: 12.5px; font-weight: var(--fw-medium);
  color: var(--muted);
}
.segmented button.is-active { background: var(--studio); color: var(--surface); }

/* ── Document (resume / artifact body) ──────────────────── */
.doc {
  background: var(--surface);
  width: min(var(--max-doc), 100%);
  border-radius: var(--rad-xs);
  padding: 56px 64px 72px;
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  line-height: var(--lh-relaxed);
  position: relative;
}
.doc h1 {
  font-size: 28px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  margin: 0 0 4px;
}
.doc__sub {
  color: var(--muted);
  margin-bottom: var(--sp-6);
  font-size: 13.5px;
}
.doc h3 {
  font-size: 11px;
  font-weight: var(--fw-strong);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: var(--sp-2);
  margin: var(--sp-6) 0 var(--sp-3);
}
.doc__role { font-weight: var(--fw-medium); margin-bottom: 2px; }
.doc__role-meta { color: var(--muted); font-size: 13px; margin-bottom: var(--sp-3); }
.doc ul { padding-left: var(--sp-5); margin: 0 0 var(--sp-4); }
.doc li { margin-bottom: var(--sp-2); position: relative; }
.doc li.is-flagged {
  background: linear-gradient(90deg, var(--highlight) 0%, transparent 100%);
  margin-left: -10px; padding-left: 10px; border-radius: 4px;
}
.doc li.is-flagged.is-active {
  background: var(--highlight);
  outline: 1px solid oklch(0.85 0.07 82);
}
.doc li.is-verified::before {
  content: "✓"; position: absolute; left: -22px; top: 0;
  color: var(--success); font-weight: var(--fw-strong); font-size: 13px;
}
.doc__pin {
  position: absolute; right: -14px; top: 4px;
  width: 18px; height: 18px; border-radius: var(--rad-pill);
  background: var(--warning); color: var(--surface);
  font-size: 10px; font-weight: var(--fw-strong);
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.doc li.is-flagged.is-active .doc__pin {
  background: var(--studio);
  transform: scale(1.15);
}

/* ── Focus card (used by Confirm) ───────────────────────── */
.focus-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--rad-xl);
  width: min(var(--max-card), 100%);
  padding: 32px 36px 28px;
  box-shadow: var(--shadow-lg);
}
.focus-card__where {
  font-size: 11.5px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 14px;
}
.focus-card__where .sep { color: var(--border); margin: 0 6px; }
.focus-card__quote {
  font-size: 21px;
  line-height: var(--lh-snug);
  font-weight: var(--fw-medium);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 20px;
}
.focus-card__why {
  background: var(--surface-warm);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text);
  line-height: var(--lh-base);
  margin-bottom: var(--sp-5);
  border: 1px solid var(--border-soft);
}
.focus-card__why-label {
  font-size: 10.5px;
  font-weight: var(--fw-strong);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}
.focus-card__trigger {
  margin-top: var(--sp-2);
  padding: 6px 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--rad-xs);
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.focus-card__trigger strong {
  font-style: normal; color: var(--text); font-weight: var(--fw-medium);
  background: var(--warning-soft); padding: 1px 4px; border-radius: 3px;
}
.focus-card__actions {
  display: flex; flex-direction: column; gap: var(--sp-2);
}

/* ── Mini-doc / queue (Confirm sidebar) ─────────────────── */
.mini-doc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px 18px;
  font-size: 12px;
  line-height: var(--lh-base);
  position: sticky;
  top: 12px;
  box-shadow: var(--shadow-sm);
}
.mini-doc__head {
  font-size: 9.5px;
  font-weight: var(--fw-strong);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--sp-3);
  display: flex;
  justify-content: space-between;
}
.mini-doc__head a { color: var(--muted); text-decoration: none; font-weight: var(--fw-medium); }
.mini-doc__name {
  font-weight: var(--fw-strong);
  font-size: 13.5px;
  margin-bottom: 1px;
  color: var(--text);
  letter-spacing: var(--ls-snug);
}
.mini-doc__sub { color: var(--muted); font-size: 11px; margin-bottom: 14px; }
.mini-doc__sec {
  font-size: 9px;
  font-weight: var(--fw-strong);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
  margin: var(--sp-3) 0 6px;
}
.mini-doc__role-meta { color: var(--muted-soft); margin-bottom: 6px; font-size: 10.5px; }

/* Calm queue lines (the core Confirm-page idea) */
.lines { list-style: none; padding: 0; margin: 0; }
.lines li {
  position: relative;
  padding: 4px 0 4px 18px;
  color: var(--muted-soft);
  cursor: default;
  border-radius: 4px;
  line-height: 1.45;
}
.lines li::before {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 4px; height: 4px;
  border-radius: var(--rad-pill);
  background: var(--border);
}
.lines li.is-verified { color: oklch(0.5 0.06 145); }
.lines li.is-verified::before { background: var(--success); }
.lines li.is-pending { color: var(--text); cursor: pointer; }
.lines li.is-pending::before { background: var(--muted-soft); }
.lines li.is-pending:hover {
  background: var(--surface-warm);
  margin-left: -8px; padding-left: 26px;
}
.lines li.is-pending:hover::before { left: 12px; }
.lines li.is-active {
  color: var(--text); font-weight: var(--fw-medium); padding-left: 18px;
  cursor: default;
}
.lines li.is-active::before {
  content: "";
  width: 2px;
  height: calc(100% - 12px);
  border-radius: 2px;
  background: var(--studio);
  top: 6px;
  left: 5px;
}

.queue-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}
.queue-foot strong { color: var(--text); font-weight: var(--fw-medium); }

/* ── Section helpers ────────────────────────────────────── */
.section {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 44px 32px 0;
}
.section + .section { padding-top: var(--sp-6); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--sp-4);
}
.section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: var(--ls-snug); margin: 0; }
.section-head .meta { font-size: 12.5px; color: var(--muted); }
.section-head .meta a {
  color: var(--text); font-weight: var(--fw-medium); text-decoration: none; margin-left: var(--sp-3);
}
.section-head .meta a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Era / role group header ────────────────────────────── */
.era { margin-bottom: 44px; }
.era__head {
  margin-bottom: var(--sp-4);
  display: flex; align-items: baseline; justify-content: space-between;
}
.era__role {
  font-size: 18px; font-weight: var(--fw-strong); letter-spacing: var(--ls-snug); margin: 0;
}
.era__meta { font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 0.02em; }
.era__count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.era__count strong { color: var(--text); font-weight: var(--fw-strong); }
.era__add {
  color: var(--muted); text-decoration: none; font-weight: var(--fw-medium);
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px;
}
.era__add:hover { color: var(--text); }

/* ── Visually-hidden helper ─────────────────────────────── */
.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;
}

/* ── Status banner ──────────────────────────────────────── */
.banner {
  width: min(var(--max-doc), 100%);
  margin: var(--sp-4) 0 var(--sp-5);
  padding: var(--sp-3) var(--sp-5);
  background: oklch(0.95 0.05 82);
  border: 1px solid oklch(0.85 0.06 82);
  border-radius: var(--rad-sm);
  font-size: 13px;
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--text);
}
.banner .dot { width: 8px; height: 8px; border-radius: var(--rad-pill); background: var(--warning); flex-shrink: 0; }
.banner strong { color: var(--text); font-weight: var(--fw-strong); }

/* ── Loading + empty + error helpers ────────────────────── */
.is-loading {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  color: var(--muted); font-size: 13px;
}
.is-loading::before {
  content: "";
  width: 14px; height: 14px;
  border-radius: var(--rad-pill);
  border: 2px solid var(--border-soft);
  border-top-color: var(--studio);
  animation: spin 720ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .is-loading::before { animation: none; }
}

/* ── UX polish: skeleton loaders ────────────────────────── */
/* Subtle pulsing blocks; preferred over "Loading…" text. */
.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    var(--surface-strong) 0%,
    var(--surface-warm) 50%,
    var(--surface-strong) 100%
  );
  background-size: 200% 100%;
  border-radius: var(--rad-sm);
  animation: skeleton-shimmer 1400ms ease-in-out infinite;
  color: transparent;
  user-select: none;
}
.skeleton-stack { display: flex; flex-direction: column; gap: 10px; }
.skeleton--line { height: 14px; width: 100%; }
.skeleton--line.short { width: 60%; }
.skeleton--line.tiny { width: 30%; height: 12px; }
.skeleton--row { height: 56px; }
.skeleton--card { height: 110px; border-radius: var(--rad-md); }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── UX polish: keyboard-shortcut overlay ───────────────── */
.v2-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  animation: overlay-in 160ms ease-out;
}
.v2-overlay__scrim {
  position: absolute; inset: 0;
  background: oklch(0.19 0.018 72 / 0.45);
  backdrop-filter: blur(2px);
}
.v2-overlay__panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--rad-lg);
  box-shadow: var(--shadow-lg, 0 24px 64px oklch(0.19 0.018 72 / 0.18));
  padding: 28px 32px 24px;
  width: min(440px, 92vw);
  max-height: 80vh; overflow: auto;
}
.v2-overlay__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.v2-overlay__head h2 { margin: 0; font-size: 18px; font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
.v2-overlay__close {
  font-size: 22px; line-height: 1; color: var(--muted);
  width: 28px; height: 28px; border-radius: 999px;
}
.v2-overlay__close:hover { background: var(--surface-strong); color: var(--text); }
.v2-shortcuts {
  display: grid; grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 10px 18px; margin: 0; align-items: baseline;
}
.v2-shortcuts dt { display: flex; gap: 4px; flex-wrap: wrap; }
.v2-shortcuts dd { margin: 0; color: var(--muted); font-size: 13.5px; }
.v2-shortcuts kbd {
  display: inline-block;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px; font-weight: 600;
  color: var(--text);
}
.v2-shortcuts__group {
  grid-column: 1 / -1;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-soft);
  margin-top: 12px;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

/* ── UX polish: topbar scroll elevation + active route ── */
.topbar { transition: box-shadow 200ms ease, border-color 200ms ease; }
.topbar.is-scrolled {
  box-shadow: 0 6px 20px oklch(0.19 0.018 72 / 0.06);
  border-bottom-color: var(--border);
}
.topbar__nav a { position: relative; transition: color 160ms ease; }
.topbar__nav a.is-active { color: var(--text); font-weight: 600; }
.topbar__nav a.is-active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -10px;
  height: 2px; border-radius: 2px;
  background: var(--studio);
}

/* ── UX polish: form validation inline hint ─────────────── */
.field--invalid .field__input,
.field--invalid textarea,
.field--invalid input {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-soft, oklch(0.92 0.04 28));
}
.field__error {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 500;
}

/* ── UX polish: empty-state illustration primitives ─────── */
.empty-illust {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: var(--surface-strong);
  display: grid; place-items: center;
  position: relative;
}
.empty-illust::before {
  content: "";
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--surface-warm);
  border: 2px solid var(--border-soft);
}
.empty-illust::after {
  content: "";
  position: absolute; right: 12px; bottom: 10px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary-soft, var(--success-soft));
  border: 2px solid var(--surface);
}

/* ── UX polish: View Transitions (cross-fade) ───────────── */
@supports (view-transition-name: foo) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 180ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* ── UX polish: global reduced-motion ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .skeleton { animation: none; background: var(--surface-strong); }
}

/* ── Responsive defaults ────────────────────────────────── */
@media (max-width: 720px) {
  .app-shell { margin: 12px; border-radius: var(--rad-lg); }
  .topbar { padding: 0 var(--sp-4); height: 52px; }
  .topbar__nav { gap: var(--sp-3); padding-left: var(--sp-4); }
  .topbar__nav a { font-size: 12.5px; }
  .doc { padding: 32px 24px 48px; }
  .focus-card { padding: 24px 22px 22px; }
  .focus-card__quote { font-size: 19px; }
  .section { padding: var(--sp-7) var(--sp-5) 0; }
}
