/* src-3e1ac42f66/css/fonts.css */
/* Self-hosted fonts (OFL): Unbounded, Manrope, JetBrains Mono — variable weights, latin + cyrillic subsets (₴ is in latin-ext).
   Files in /fonts/ are immutable (the version is in the name); this stylesheet lives under /src/ and is re-checked like the rest. */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/jetbrains-mono-v1-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/jetbrains-mono-v1-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/jetbrains-mono-v1-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/jetbrains-mono-v1-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/manrope-v1-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/manrope-v1-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/manrope-v1-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/manrope-v1-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('/fonts/unbounded-v1-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('/fonts/unbounded-v1-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('/fonts/unbounded-v1-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('/fonts/unbounded-v1-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* lab/_shared/lab.css */
/* Lab — shared UI for Slava's in-browser AI tools.
   All colours / fonts live in tokens below: recolour the whole lab by editing :root. */

:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f1f0ec;
  --muted: #8e8d89;
  --accent: #f1f0ec;          /* primary button fill */
  --accent-ink: #0b0b0c;      /* text on primary button */
  --rec: #ff453a;
  --ok: #8fd19e;
  --warn: #f0c36a;

  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.lab-header { padding: clamp(18px, 3vw, 32px) 0 clamp(14px, 2vw, 22px); }
.crumbs { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.lab-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.lead { color: var(--muted); max-width: 64ch; margin: 0; }
.privacy { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.privacy::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  min-height: 220px;
}
.stage canvas { display: block; width: 100%; height: auto; max-height: 74vh; max-height: 74dvh; object-fit: contain; }
.stage-msg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 24px; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.stage-msg[hidden] { display: none; }
.stage-msg .box { max-width: 420px; }
.stage-msg .title { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.stage-msg .sub { color: var(--muted); font-size: 13px; }
.source-note { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding-top: 10px; }
.source-note[hidden] { display: none; }
.stats[hidden] { display: none; }
.stats {
  position: absolute; right: 12px; bottom: 10px; font-family: var(--font-mono); font-size: 11px;
  color: rgba(255, 255, 255, 0.55); pointer-events: none; text-shadow: 0 1px 2px #000;
}

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; padding: 16px 0; }
.group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 4px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg button {
  border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; cursor: pointer;
  color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(0.92); }
.btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); }
.btn.recording { border-color: var(--rec); color: var(--rec); }
.btn.recording .dot { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }

.field { display: inline-flex; align-items: center; gap: 8px; }
.input {
  min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; width: min(420px, 100%);
}
.input:focus, .btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 140px; height: 4px; border-radius: 4px; background: var(--line-strong); outline-offset: 6px; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 0; cursor: pointer; }
input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 0; cursor: pointer; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input[type='checkbox'] { accent-color: var(--text); width: 16px; height: 16px; }

.hint { font-size: 13px; color: var(--muted); }
.notes { border-top: 1px solid var(--line); margin-top: 8px; padding: 18px 0 40px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.notes b { color: var(--text); font-weight: 600; }

/* ---------- progress ---------- */
.progress { width: min(320px, 80vw); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin: 14px auto 8px; }
.progress > i { display: block; height: 100%; width: 0%; background: var(--text); transition: width .2s; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--text); animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--line-strong); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- result modal ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.72); }
.modal[hidden] { display: none; }
.modal-card { width: min(860px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.modal-media { background: #000; display: grid; place-items: center; }
.modal-media img, .modal-media video { display: block; max-width: 100%; max-height: 64vh; max-height: 64dvh; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; align-items: center; }
.modal-actions .meta { margin-right: auto; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .controls { gap: 12px; }
  .controls > .group { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 auto; padding: 8px 8px; font-size: 13px; }
  .group .btn { flex: 1 1 auto; }
  .stage { border-radius: 12px; }
  .input { width: 100%; }
}

/* brief/brief.css */
/* Brief page — v3 (2026-10-25, quieter 2026-10-29): the brief is an edit sequence. The steps are a monochrome
   track, the red playhead marks where you are (red is the playhead only); the result is a sheet of paper that
   previews the PDF. Builds on ../lab/_shared/lab.css (reset, .btn, .toast); tokens = src/css/site.css :root. */

:root {
  /* the site's tokens (src-3e1ac42f66/css/site.css :root); the card sits on --bg-2, its controls on --surface-2 */
  --bg: #0b0b0c;
  --bg-2: #121214;
  --surface: var(--bg-2);
  --surface-2: #1e1e21;
  --surface-3: color-mix(in oklab, #1e1e21, #f1efea 6%);
  --line: rgba(241, 239, 234, 0.1);
  --line-strong: rgba(241, 239, 234, 0.22);
  --text: #f1efea;
  --muted: #a3a097;
  --faint: #75726b;
  --accent: #f1efea;          /* lab.css: primary button fill (= the site's --btn-bg) */
  --accent-ink: #0b0b0c;
  --rec: #ff453a;
  --ok: #8fd19e;
  /* the PDF is dark like the site (Slava, 2026-10-25): the preview sheet too */
  --paper: #0b0b0c;
  --paper-ink: #f1efea;
  --paper-muted: #a3a097;
  --paper-panel: #161618;
  /* no per-step colours in the form any more: steps, parts and the preview's section tags are monochrome */
  --c: var(--muted);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --radius: 14px;
  --pad: clamp(20px, 4.4vw, 44px);
  /* the site's type scale (src-3e1ac42f66/css/site.css :root): the brief page links lab.css, not site.css */
  --fs-big: 28px; --fs-lead: 19px; --fs-body: 16px; --fs-btn: 15px; --fs-ui: 13px; --fs-mono: 11px;
}
@media (max-width: 767px) { :root { --fs-big: 22px; --fs-lead: 17px; } }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
.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;
}

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; font-size: var(--fs-body); }
.brief-wrap { max-width: 800px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* ---------- header ---------- */
.brief-header { padding: clamp(20px, 3vw, 32px) 0 clamp(28px, 4vw, 44px); }
.brief-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: clamp(36px, 6vw, 64px); }
.crumbs {
  display: flex; gap: 10px; align-items: center; margin: 0;
  font: 500 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.brief-header h1 {
  font-family: var(--font-display); font-weight: 340;   /* = the site's page titles at rest (.pg-hero h1, data-rest 340) */
  font-size: clamp(34px, 6.2vw, 64px); line-height: 1.02; letter-spacing: -0.025em;
  margin: 0 0 18px; text-wrap: balance;
}
.brief-header .lead { color: var(--muted); font-size: var(--fs-lead); line-height: 1.55; max-width: 48ch; text-wrap: pretty; }
.privacy {
  display: flex; gap: 10px; align-items: baseline; margin-top: 18px; max-width: 60ch;
  font-size: var(--fs-ui); line-height: 1.5; color: var(--muted);
}
.privacy::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; transform: translateY(-1px); }

.lang-switch { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 3px; }
.lang-switch button {
  background: none; border: 0; cursor: pointer; color: var(--muted); padding: 7px 11px; border-radius: 999px;
  font: 500 11px/1 var(--font-mono); letter-spacing: .08em;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.lang-switch button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.brief { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

/* ---------- draft note ---------- */
.draft-note {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between;
  font-size: var(--fs-ui); color: var(--muted); border-radius: 10px; padding: 10px 14px; background: var(--surface);
}
.draft-note[hidden] { display: none; }
.link-btn {
  background: none; border: 0; padding: 6px 2px; cursor: pointer; color: var(--text);
  font-size: var(--fs-ui); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
.link-btn:hover { text-decoration-color: var(--text); }

/* ---------- timeline (progress) ---------- */
.tl { margin-bottom: 8px; }
.tl[hidden] { display: none; }
.tl-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px;
  font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.tl-head b { color: var(--text); font-weight: 500; text-align: right; }
.tl-track { position: relative; display: flex; gap: 3px; height: 8px; padding-top: 0; container-type: inline-size; }
/* the ruler above the clips */
.tl-track::before {
  content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 5px;
  background: repeating-linear-gradient(to right, var(--line-strong) 0 1px, transparent 1px 100%) 0 0 / calc(100% / 36) 100% repeat-x;
  opacity: .9;
}
.tl-clip {
  position: relative; flex: 1 1 0; min-width: 0; border-radius: 2px; overflow: hidden;
  background: var(--surface-2);
  transition: background .4s var(--ease);
}
.tl-clip.done { background: color-mix(in oklab, var(--text) 40%, var(--bg)); }
.tl-clip.now { background: var(--text); }
/* the per-clip names were cut off at every width: the row above names the current step */
.tl-clip span { display: none; }
.tl-playhead {
  position: absolute; top: -12px; bottom: -6px; left: 0; width: 2px; margin-left: -1px; transform: translateX(calc(var(--at, 0) * 100cqw));
  background: var(--rec); pointer-events: none; transition: transform .55s var(--ease);
}
.tl-playhead::before {
  content: ''; position: absolute; top: 0; left: -4px;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--rec);
}

/* ---------- card ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: var(--pad); }
.card[hidden] { display: none; }

.step h2, .result h2 {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em;
  font-size: var(--fs-big); line-height: 1.1; margin: 0 0 12px; text-wrap: balance;
}
.step h2:focus, .result h2:focus { outline: none; }
.step h2:focus-visible, .result h2:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 4px; }
.sub { color: var(--muted); margin: 0 0 8px; font-size: var(--fs-body); line-height: 1.55; max-width: 56ch; text-wrap: pretty; }
.step .sub:empty { display: none; }
.hint { color: var(--muted); font-size: var(--fs-ui); line-height: 1.5; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 16px 10px 13px; border-radius: 10px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 0;
  font-size: var(--fs-btn); font-weight: 500; line-height: 1.3; text-align: left;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.chip:hover { background: var(--surface-3); }
.chip[aria-pressed='true'] { background: var(--text); color: var(--bg); }
.chip .tick {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor; opacity: .45; display: grid; place-items: center;
}
.chip.multi .tick { border-radius: 4px; }
.chip[aria-pressed='true'] .tick { opacity: 1; background: var(--bg); box-shadow: none; }
.chip[aria-pressed='true'] .tick::after {
  content: ''; width: 7px; height: 4px; border-left: 1.6px solid var(--text); border-bottom: 1.6px solid var(--text);
  transform: translateY(-1px) rotate(-45deg);
}
.chip.has-desc { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; max-width: 100%; }
.chip.has-desc .tick { margin-top: 2px; }
.chip-body { display: grid; gap: 3px; }
.chip-body small { font-size: var(--fs-ui); font-weight: 400; line-height: 1.35; color: var(--muted); }
.chip[aria-pressed='true'] .chip-body small { color: rgba(11, 11, 12, .68); }
/* «who does what»: label left, Us / You / To discuss right */
.role-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; margin-top: 14px; }
.role-row .chips { flex-wrap: nowrap; gap: 6px; }
.role-row .chip { min-height: 40px; padding: 8px 13px 8px 11px; font-size: var(--fs-ui); }
.step > .sub + .role-row { margin-top: 26px; }
.role-row + .field-block:not(.role-row) { margin-top: 34px; }
.chip:focus-visible, .brief .btn:focus-visible, .link-btn:focus-visible, .channel:focus-visible, .text-box summary:focus-visible {
  outline: 2px solid var(--text); outline-offset: 3px;
}

/* ---------- fields ---------- */
.field-block { display: grid; gap: 10px; margin-top: 30px; }
.step > .sub + .field-block { margin-top: 26px; }
.field-block[hidden] { display: none; }
.field-block label, .chips-label { font-size: var(--fs-btn); font-weight: 600; line-height: 1.35; margin: 0; }
.chips-label { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chips-label .tag { font: 500 11px/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.field-block .hint { margin: 0; }
.tf {
  width: 100%; min-height: 50px; padding: 13px 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: var(--fs-body); /* 16px stops iOS zoom on focus */ line-height: 1.5;
  transition: border-color .15s;
}
.tf:hover { border-color: var(--line-strong); }
textarea.tf { resize: vertical; min-height: 128px; }
.tf::placeholder { color: var(--faint); opacity: 1; }
.tf:focus { outline: 2px solid var(--text); outline-offset: 1px; border-color: transparent; }
.tf[aria-invalid='true'] { border-color: var(--text); }

.error { display: flex; align-items: baseline; gap: 10px; color: var(--text); font-size: var(--fs-ui); margin: 18px 0 0; }
.error::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text); flex: none; transform: translateY(-1px); }
.error:empty { display: none; }

/* a direction inside «A few details»: a track with its own colour */
.part { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.step > .sub + .part, .step > h2 + .part { margin-top: 28px; }
.part-head { display: flex; align-items: center; gap: 12px; }
.part-head::before { content: ''; width: 3px; align-self: stretch; min-height: 22px; border-radius: 2px; background: var(--line-strong); flex: none; }
.part-head h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-lead); letter-spacing: -0.015em; line-height: 1.2; }
.part-head .code { margin-left: auto; font: 500 10.5px/1 var(--font-mono); letter-spacing: .08em; color: var(--faint); }
.part-sub { margin: 10px 0 0; }
.part .field-block:first-of-type { margin-top: 22px; }
.part-hint { margin: 26px 0 0; }
.warn-hint { color: var(--muted); }
.warn-hint:empty { display: none; }

/* ---------- step nav ---------- */
.nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 40px; }
.nav .btn { min-height: 50px; padding: 0 24px; font-size: var(--fs-btn); border-radius: 999px; }
.nav #nextBtn { margin-left: auto; background: var(--text); color: var(--bg); border: 0; }
.nav #nextBtn::after { content: '→'; font-family: var(--font-ui); margin-left: 2px; transition: transform .2s var(--ease); }
.nav #nextBtn:hover { filter: brightness(.92); }
.nav #nextBtn:hover::after { transform: translateX(3px); }
.btn.ghost { background: transparent; border: 0; color: var(--muted); padding-left: 4px; }
.btn.ghost:hover { background: transparent; color: var(--text); }
#backBtn::before { content: '←'; margin-right: 2px; }
.btn[hidden] { display: none; }

/* ---------- result ---------- */
.result .sub { margin-bottom: 28px; }
/* the sheet: a preview of the PDF on paper */
.paper {
  background: var(--paper); color: var(--paper-ink); border-radius: 6px;
  padding: clamp(20px, 4vw, 34px); box-shadow: 0 0 0 1px var(--line-strong), 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.paper-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: clamp(22px, 4vw, 34px); }
.mark { display: inline-flex; align-items: center; font-family: var(--font-display); font-size: var(--fs-ui); letter-spacing: -0.01em; line-height: 1; }
.mark b { font-weight: 700; }
.mark i { font-style: normal; font-weight: 300; }
.mark .ph { position: relative; width: 2px; height: 1.3em; background: var(--rec); margin: 0 .38em; }
.mark .ph::before { content: ''; position: absolute; top: -.32em; left: -3.5px; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-top: 5px solid var(--rec); }
.paper-date { font: 500 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); }
.paper h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-big); letter-spacing: -0.03em; margin: 0; line-height: 1; }
.paper-person { margin: 12px 0 0; font-weight: 700; font-size: var(--fs-btn); }
.paper-who { margin: 2px 0 0; color: var(--paper-muted); font-size: var(--fs-ui); }
.paper-short {
  position: relative; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px;
  margin-top: 22px; padding: 16px 16px 16px 20px; background: var(--paper-panel); border-radius: 2px;
}
.paper-short::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--rec); }
.paper-short dt { font: 500 9px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); margin-bottom: 8px; }
.paper-short dd { margin: 0; font-weight: 700; font-size: var(--fs-ui); line-height: 1.4; }
.paper-short dd.none { color: var(--faint); }
.paper-secs { display: flex; flex-wrap: wrap; gap: 5px; margin: 18px 0 0; padding: 0; list-style: none; }
.paper-secs li { font: 500 9px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-ink); background: var(--surface-2); padding: 5px 7px; border-radius: 2px; }
.paper-est { position: relative; margin: 18px 0 0; padding: 12px 16px 12px 20px; background: var(--paper-panel); font-weight: 700; font-size: var(--fs-ui); }
.paper-est::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--rec); }
.paper-est small { display: block; margin-top: 4px; font-weight: 400; font-size: var(--fs-mono); color: var(--paper-muted); }
.paper-next { margin: 16px 0 0; font-size: var(--fs-ui); color: var(--paper-muted); }
.paper-next b { font: 500 9px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; margin-right: 10px; }

.pdf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px; }
.pdf-row .btn { min-height: 54px; padding: 0 28px; font-size: var(--fs-btn); border-radius: 999px; }
.pdf-row .btn[hidden] { display: none; }
.pdf-btn { background: var(--text) !important; color: var(--bg) !important; border: 0 !important; }
.pdf-btn:hover { filter: brightness(.92); }
.pdf-btn::before {
  content: ''; width: 15px; height: 15px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v8.5M4.5 7 8 10.5 11.5 7M3 14h10'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v8.5M4.5 7 8 10.5 11.5 7M3 14h10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pdf-btn[aria-busy='true'] { opacity: .7; cursor: progress; }
#shareBtn { background: var(--surface-2); border: 0; color: var(--text); padding: 0 22px; }
.file-name { font: 500 11px/1.4 var(--font-mono); letter-spacing: .04em; color: var(--muted); overflow-wrap: anywhere; }
.pdf-note { margin: 12px 0 0; }
.pdf-note[hidden] { display: none; }

.send-title { font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 44px 0 14px; }
.channels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.channel {
  display: flex; align-items: center; gap: 11px; min-height: 56px; padding: 0 16px;
  border-radius: 12px; background: var(--surface-2);
  text-decoration: none; font-weight: 600; font-size: var(--fs-btn); color: var(--text);
  transition: background .15s var(--ease);
}
.channel:hover { background: var(--surface-3); }
.channel svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.channel:hover svg { color: var(--text); }
.channel .note { margin-left: auto; font: 500 10px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.send-hint { margin: 14px 0 0; max-width: 62ch; }

/* «or as text»: folded away — the PDF is the main way */
.text-box { margin-top: 36px; border-top: 1px solid var(--line); }
.text-box summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none;
  padding: 20px 0 4px; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.text-box summary::-webkit-details-marker { display: none; }
.text-box summary::after { content: '+'; font: 400 18px/1 var(--font-ui); color: var(--muted); transition: transform .2s var(--ease); }
.text-box[open] summary::after { transform: rotate(45deg); }
.text-box summary:hover, .text-box summary:hover::after { color: var(--text); }
.text-sub { margin: 10px 0 14px; }
.brief-text {
  width: 100%; min-height: 240px; resize: none; overflow: hidden;
  padding: 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: var(--fs-body); line-height: 1.6;
}
.brief-text:focus { outline: 2px solid var(--text); outline-offset: 1px; border-color: transparent; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.copy-row .btn { min-height: 46px; padding: 0 20px; font-size: var(--fs-btn); background: var(--surface-2); border: 0; border-radius: 999px; }
.copy-row .btn:hover { background: var(--surface-3); }
.copy-row .hint { color: var(--ok); }

.result-nav { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.result-nav .btn { min-height: 46px; border-radius: 999px; }
#editBtn::before { content: '←'; margin-right: 2px; }

.toast { text-align: center; width: max-content; background: var(--surface-3); border: 0; }

@media (max-width: 640px) {
  .brief-top { margin-bottom: 32px; }
  .card { border-radius: 12px; }
  .tl-track { height: 6px; gap: 2px; }
  .chip { font-size: var(--fs-btn); padding: 10px 14px 10px 12px; }
  /* the step buttons stay under the thumb on a long screen */
  .nav {
    position: sticky; bottom: 0; z-index: 5;
    margin: 32px calc(-1 * var(--pad)) calc(-1 * var(--pad));
    padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
    /* a solid bar, not a fade: options pass cleanly under it instead of showing half-covered */
    background: var(--surface); box-shadow: 0 -1px 0 var(--line);
    border-radius: 0 0 12px 12px;
  }
  /* keep the bar's height free when scrolling to a focused option: it stops above «Далі», not under it */
  html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .nav #nextBtn { flex: 1 1 auto; max-width: 70%; justify-content: center; }
  .nav #backBtn[hidden] + #nextBtn { max-width: none; }
  .pdf-row .btn { flex: 1 1 100%; justify-content: center; }
  .paper-short { grid-template-columns: 1fr; gap: 14px; }
  .channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-row { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 20px; }
  .role-row .chips { flex-wrap: wrap; }
  .channels li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .copy-row .btn { flex: 1 1 100%; }
}

@media (max-width: 380px) {
  .channel { padding: 0 12px; gap: 9px; font-size: var(--fs-ui); }
}

@media (prefers-reduced-motion: reduce) {
  .tl-clip, .tl-playhead, .chip, .channel, .toast, .nav #nextBtn::after { transition: none; }
}

