/* humalazer.com · главная
   Первый экран — редактор в режиме примера. Два мира: лайм — черновик («лень на входе»),
   ультрамарин — результат («человек на выходе»). Нарисованная от руки скобка — фирменный знак.
   Цвета, шрифты и детали те же, что в веб-редакторе (humanazer/web/static/app.css).
   Страница ничего не загружает с других адресов. */

/* ---------- Токены ---------- */
:root {
  color-scheme: light;

  /* Вход: лень */
  --lime: #d7f25a;
  --ink: #15120f;
  --fuchsia: #c2156f;        /* перо на светлом: кнопка, пометки */
  --fuchsia-line: #e0218a;   /* линия полей */
  --muted-in: #4f4a44;
  --rule: #d3dcea;           /* линейки тетрадного листа */

  /* Выход: человек */
  --ultra: #2b2fd9;
  --cream: #fff3dc;
  --lemon: #ffe24a;
  --vermilion: #ff6e40;      /* перо на ультрамарине */
  --vermilion-deep: #c93a12; /* перо на бумаге */
  --night: #1c1b33;          /* текст и контуры на бумаге результата */
  --muted-out: #4a4760;

  /* Общее */
  --paper: #fbf6ec;
  --white: #fff;
  --mark: #ffe9a8;           /* подсветка открытой фразы */
  --dash: #c9c2b3;

  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-lazy: "Dela Gothic One", "Onest", system-ui, sans-serif;
  --font-human: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-draft: "PT Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-read: "Literata", Georgia, "Times New Roman", serif;

  --line: 1.5px;
  --r-sheet: 6px;
  --r-card: 18px;
  --r-paper: 22px;
  --r-pill: 999px;
  --shadow-sheet: 6px 6px 0 var(--ink);
  --shadow-press: 0 3px 0 var(--ink);

  --pad: clamp(20px, 5vw, 72px);
  --header: 76px;
  --wide: min(1296px, 100% - 2 * var(--pad));
}

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0; min-width: 300px;
  background: var(--lime); color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { padding: 0; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--fuchsia); outline-offset: 3px; }
::selection { background: var(--mark); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hand { font-family: var(--font-hand); font-weight: 700; line-height: 1; }
.lazy { font-family: var(--font-lazy); font-weight: 400; }
.human { font-family: var(--font-human); font-style: italic; font-weight: 400; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 50; padding: 10px 14px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 10px; }
.skip:focus { top: 12px; }

/* ---------- Кнопки ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: var(--line) solid currentColor; border-radius: var(--r-pill);
  font: 500 15px/1 var(--font-ui); white-space: nowrap; text-decoration: none;
  transition: background-color .15s, color .15s, transform .08s, box-shadow .08s;
}
.pill.ghost:hover { background: rgb(0 0 0 / .07); }
.pill.primary, .pill.accent { border: 0; font-weight: 600; }
.pill.primary { min-height: 52px; padding: 0 28px; background: var(--fuchsia); color: var(--white); font-size: 18px; box-shadow: var(--shadow-press); }
.pill.primary:hover { background: #a50f5d; }
.pill.accent { background: var(--vermilion); color: var(--night); box-shadow: 0 3px 0 var(--night); }
.pill.accent:hover { background: #ff8259; }
.pill.primary:active, .pill.accent:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 15px; font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.link-btn:hover { text-decoration-thickness: 2.5px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.icon-btn .icon { width: 20px; height: 20px; stroke-width: 2; }
.icon-btn:hover:not(:disabled) { background: rgb(0 0 0 / .08); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.chips li { padding: 5px 12px; border: var(--line) solid currentColor; border-radius: var(--r-pill); }

/* ---------- Шапка ---------- */
.masthead {
  width: var(--wide); height: var(--header); margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
}
.brand { font: 700 38px/1 var(--font-hand); text-decoration: none; }
.badge {
  padding: 5px 11px; border: var(--line) solid currentColor; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap;
}
.masthead-nav { margin-left: auto; display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Сообщения ---------- */
.notice {
  position: fixed; top: 14px; left: 50%; z-index: 40; transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: 10px;
  width: max-content; max-width: min(620px, calc(100% - 24px)); padding: 11px 6px 11px 16px;
  background: var(--paper); color: var(--ink);
  border: var(--line) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-press);
  font-size: 15px; line-height: 1.45;
}
.notice > .icon { margin-top: 2px; }
.notice .icon-btn { width: 32px; height: 32px; margin: -5px 0; flex: none; }

/* ---------- Первый экран ---------- */
.hero {
  width: var(--wide); margin: 0 auto; padding: 28px 0 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: end;
}
.slogan .lazy { display: block; font-size: clamp(32px, 3.9vw, 56px); line-height: 1.1; letter-spacing: -.01em; }
.slogan .human { display: block; font-size: clamp(36px, 5.4vw, 78px); line-height: 1.04; letter-spacing: -.01em; color: var(--ultra); }
.lead { padding-bottom: 10px; font-size: 18px; line-height: 1.5; }

/* ---------- Сцена: вход и выход ---------- */
.stage {
  width: var(--wide); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  background: var(--paper);
  border: var(--line) solid var(--ink); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet);
  overflow: hidden; overflow: clip; /* clip не мешает кнопке «Переписать» прилипать к низу окна на телефоне */
}
.world { min-width: 0; }

/* Тетрадный лист */
.sheet { display: grid; grid-template-columns: 92px minmax(0, 1fr); min-height: 100%; background: var(--paper); }
.sheet-margin { padding: 24px 6px 0 14px; border-right: 2px solid var(--fuchsia-line); }
.sheet-margin .hand { display: block; font-size: 22px; color: var(--fuchsia); white-space: nowrap; }
.sheet-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; min-width: 0;
  grid-template-areas: "head head" "draft draft" "hint controls";
}
.sheet-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 20px 26px 8px; }
.sheet-head h2 { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.sheet-tag { font-size: 23px; color: var(--fuchsia); transform: rotate(-3deg); }
.draft {
  grid-area: draft; min-height: 152px; padding: 8px 26px 10px;
  background: repeating-linear-gradient(var(--paper) 0 27px, var(--rule) 27px 28px) local 0 9px;
  font: 400 16px/28px var(--font-draft); overflow-wrap: anywhere;
}
.sheet-hint { grid-area: hint; display: flex; align-items: center; padding: 14px 16px 16px 26px; border-top: var(--line) solid var(--ink); font-size: 14px; line-height: 1.45; color: var(--muted-in); }
.sheet-controls { grid-area: controls; display: flex; align-items: center; justify-content: flex-end; padding: 14px 26px 16px 0; border-top: var(--line) solid var(--ink); background: var(--paper); }
/* Без скрипта кнопок нет: подсказка занимает всю строку. */
.sheet-controls:not(:has(button:not([hidden]))) { padding: 0; }

/* Фразы черновика, которые изменились: пунктир появляется при сверке, подсветка — вместе со скобкой справа. */
.was { border-radius: 2px; }
.was.hot, .edit.hot { background-color: var(--mark); }
html[data-compare="on"] .draft .was { border-bottom: 2px dashed var(--fuchsia-line); }
html[data-state="done"] .draft .was { cursor: pointer; }
/* Рамка вокруг того, что должно остаться слово в слово: числа, цитаты, условия. */
html[data-compare="on"] :is(.draft, .edited) .keep,
.edit-card .keep, .edits .keep { padding: 0 3px; border-radius: 5px; outline: 1.5px solid currentColor; outline-offset: -1.5px; }

/* Мир результата */
.world-out { position: relative; background: var(--ultra); color: var(--cream); border-left: var(--line) solid var(--ink); }
.world-out :focus-visible { outline-color: var(--lemon); }
.seam, .example-seam {
  position: absolute; left: 12px; top: 20px; width: 64px; height: calc(100% - 40px); overflow: visible;
  fill: none; stroke: var(--vermilion); stroke-width: 9px; stroke-linecap: round; stroke-linejoin: round;
}
.out-body { display: flex; flex-direction: column; gap: 16px; height: 100%; min-width: 0; padding: 24px 28px 24px 90px; }
.out-label { font-size: 26px; color: var(--lemon); }

/* До нажатия: что здесь появится */
.preview { display: none; flex: 1; flex-direction: column; gap: 16px; }
.preview > p { font-size: 16px; line-height: 1.5; }
.demo { display: flex; flex-direction: column; }
.demo-was { text-align: center; font: 400 15px/1.55 var(--font-draft); }
.demo-brace, .pair-brace {
  display: block; width: 100%; overflow: visible;
  fill: none; stroke: var(--vermilion); stroke-width: 6px; stroke-linecap: round; stroke-linejoin: round;
}
.demo-brace { height: 38px; margin-top: 4px; }
.demo-now { margin-top: 2px; text-align: center; font: italic 400 clamp(38px, 3.9vw, 56px)/1.05 var(--font-human); color: var(--lemon); }
.preview-checks { margin-top: auto; }
.preview-checks h3 { margin-bottom: 8px; font-size: 14px; font-weight: 600; }

/* ---------- Результат ---------- */
.completed { display: flex; flex: 1; flex-direction: column; gap: 18px; min-width: 0; }
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 4px; align-items: start; }
.verdict:focus { outline: none; }
.verdict > .icon { width: 26px; height: 26px; margin-top: 2px; stroke-width: 2; color: var(--lemon); }
.status-flag { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.status-note { grid-column: 2; max-width: 56ch; font-size: 15px; line-height: 1.45; }
/* «Всё на месте» — и сразу под этим кнопка, чтобы проверить самому. */
.verdict #compare-toggle { grid-column: 2; justify-self: start; margin-top: 10px; }
.world-out .pill.ghost:hover { background: rgb(255 255 255 / .16); }
.world-out .pill.ghost[aria-pressed="true"],
.world-out .pill.ghost[aria-pressed="true"]:hover { background: var(--cream); border-color: var(--cream); color: var(--ultra); }

.paper {
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--night);
  border: var(--line) solid var(--night); border-radius: var(--r-paper); box-shadow: 0 4px 0 var(--night);
}
.paper :focus-visible { outline-color: var(--ultra); }
.paper-body { position: relative; padding: 26px 32px 18px; }
.edited { max-width: 64ch; font: 400 19px/1.75 var(--font-read); overflow-wrap: anywhere; }

/* Скобка под изменённой фразой. Фон режется по строкам, поэтому одна скобка тянется через перенос. */
.edit {
  padding-bottom: 7px; border-radius: 3px;
  background: url("./assets/brace.svg") 0 100% / 100% 9px no-repeat;
  -webkit-box-decoration-break: slice; box-decoration-break: slice;
}
.edit[role="button"] { cursor: pointer; }
.edit[role="button"]:hover, .edit[role="button"]:focus-visible, .edit.hot { background-image: url("./assets/brace-on.svg"); background-size: 100% 11px; }
.edit[aria-expanded="true"] { background: url("./assets/brace-on.svg") 0 100% / 100% 11px no-repeat, var(--mark); }
.edit:focus-visible { outline-offset: 2px; }

/* Карточка «было | стало» встаёт в разрыв текста сразу под фразой. */
.edit-gap { display: block; }
.edit-card {
  position: absolute; left: 32px; right: 32px; z-index: 3;
  display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 14px;
  background: var(--white); border: var(--line) solid var(--night); border-radius: var(--r-card); box-shadow: 0 3px 0 var(--night);
  font-family: var(--font-ui); scroll-margin: 16px 0 24px;
}
.edit-card:focus { outline: none; }
.edit-notch {
  position: absolute; top: -9px; left: var(--notch, 34px); width: 15px; height: 15px;
  background: var(--white); border-top: var(--line) solid var(--night); border-left: var(--line) solid var(--night);
  transform: rotate(45deg);
}
.edit-head { display: flex; align-items: center; justify-content: space-between; }
.edit-head h3 { font-size: 14px; font-weight: 600; }
.edit-nav { display: flex; margin-right: -10px; }
.edit-pair { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.edit-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.edit-col .hand, .edits .hand { font-size: 21px; color: var(--vermilion-deep); }
.edit-was, .edit-now { font-family: var(--font-read); overflow-wrap: anywhere; }
.edit-was { font-size: 15px; line-height: 1.6; color: #3e3b52; }
.edit-now { font-size: 17px; line-height: 1.55; }
.edit-was s { text-decoration-thickness: 1.5px; }
.edit-now u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.edit-card .ctx, .edits .ctx { color: #5b5870; }
.edit-brace { position: relative; }
.edit-brace svg {
  position: absolute; inset: 4px 0; width: 100%; height: calc(100% - 8px); overflow: visible;
  fill: none; stroke: #d9461c; stroke-width: 2.6px; stroke-linecap: round; stroke-linejoin: round;
}
.edit-facts { display: flex; gap: 8px; padding-top: 10px; border-top: var(--line) dashed var(--dash); font: 400 14px/1.4 var(--font-ui); }
.edit-facts .icon { margin-top: 1px; stroke-width: 2.2; }

.compare { display: flex; flex-direction: column; gap: 8px; margin: 22px 32px 0; padding: 14px 16px; background: var(--white); border: var(--line) solid var(--night); border-radius: 14px; }
.compare h3 { font-size: 15px; font-weight: 600; }
.compare ul { display: flex; flex-direction: column; gap: 6px; }
.compare li { display: flex; gap: 8px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.compare li .icon { margin-top: 1px; stroke-width: 2.2; }
.compare li b { font-weight: 600; }
.paper-hint { display: none; padding: 0 32px 20px; font-size: 22px; line-height: 1.05; text-wrap: balance; color: var(--vermilion-deep); }

/* Список правок для тех, у кого скрипт не загрузился: те же пары, что в карточке. */
.edits { display: flex; flex-direction: column; gap: 10px; }
.edits li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 12px 16px; background: var(--paper); color: var(--night); border: var(--line) solid var(--night); border-radius: 14px; }
.edits .edit-facts { grid-column: 1 / -1; margin-top: 6px; }

.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: auto; padding-top: 2px; font-size: 16px; font-weight: 500; }
.result-actions .pill { margin-left: auto; }

/* ---------- Состояния примера ----------
   Без JavaScript результат и список правок видны сразу. Скрипт первой же строкой ставит
   data-state="idle" на <html>: тогда справа ждёт заготовка, а результат появляется по кнопке. */
html[data-state="idle"] .preview { display: flex; }
html[data-state="idle"] .completed,
html[data-state="idle"] .out-mode,
html[data-state] .edits { display: none; }
html[data-state] .paper-hint { display: block; }

/* ---------- Спокойная часть страницы ---------- */
.calm { margin-top: 72px; background: var(--paper); border-block: var(--line) solid var(--ink); }
.band { width: var(--wide); margin: 0 auto; padding: 88px 0; }
.band + .band { border-top: var(--line) solid var(--ink); }
.band h2, .closing h2 { font: 400 clamp(30px, 3.4vw, 48px)/1.1 var(--font-lazy); letter-spacing: -.01em; }
.band h2 .human, .closing h2 .human { font-size: 1.28em; line-height: 1; letter-spacing: -.02em; color: var(--ultra); }

/* Как это работает */
.how { display: flex; flex-direction: column; gap: 44px; }
.how-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
.how-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; row-gap: 6px; align-content: start; }
.how-num { grid-row: span 2; font-size: 68px; line-height: .8; color: var(--fuchsia); }
.how-steps h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.how-steps p { font-size: 16px; line-height: 1.5; }
.poster { padding: 36px 44px 44px; background: var(--ultra); color: var(--cream); border: var(--line) solid var(--ink); border-radius: 28px; box-shadow: var(--shadow-sheet); }
.poster-label { margin-bottom: 14px; font-size: 30px; color: var(--lemon); }
.pairs { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; align-items: end; }
.pairs li { display: flex; flex-direction: column; }
.pair-was { text-align: center; font: 400 15px/1.5 var(--font-draft); }
.pair-brace { height: 34px; margin: 6px 0 2px; }
.pair-now { text-align: center; font: italic 400 clamp(34px, 4.2vw, 60px)/1.05 var(--font-human); color: var(--lemon); }
.keeps { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.keeps h3 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.keeps p { font-size: 16px; line-height: 1.5; }

/* Четыре стиля */
.styles { display: flex; flex-direction: column; gap: 40px; }
.style-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.style-list li { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 2px solid var(--ink); }
.style-list h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.style-list p { font-size: 15px; line-height: 1.5; color: var(--muted-in); }
.example { display: flex; flex-direction: column; gap: 12px; }
.example-label { font-size: 26px; color: var(--fuchsia); }
.example-pair {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: var(--line) solid var(--ink); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet);
  overflow: hidden;
}
.example-was { padding: 20px 28px 26px; background: var(--paper); border-right: var(--line) solid var(--ink); }
.example-was h3 { margin-bottom: 6px; font-size: 24px; color: var(--fuchsia); }
.example-was p {
  background: repeating-linear-gradient(transparent 0 27px, var(--rule) 27px 28px) 0 1px;
  font: 400 16px/28px var(--font-draft); overflow-wrap: anywhere;
}
.example-was .was { border-bottom: 2px dashed var(--fuchsia-line); }
.example-now { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px 28px 24px 86px; background: var(--ultra); color: var(--cream); }
.example-now h3 { font-size: 24px; color: var(--lemon); }
.example-now > p:not(.example-note) {
  padding: 18px 24px 20px; background: var(--paper); color: var(--night);
  border: var(--line) solid var(--night); border-radius: var(--r-card); box-shadow: 0 4px 0 var(--night);
  font: 400 19px/1.75 var(--font-read); overflow-wrap: anywhere;
}
.example-note { font-size: 24px; line-height: 1.05; color: var(--lemon); text-wrap: balance; }
.example-seam { left: calc(50% + 12px); z-index: 1; stroke-width: 8px; }

/* Вопросы */
.faq { display: grid; grid-template-columns: .62fr 1.38fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 12px; line-height: 1.4; font-weight: 650; letter-spacing: .095em; text-transform: uppercase; }
.kicker::before { content: ""; width: 27px; height: 2px; background: currentColor; flex: none; }
.answers { border-top: var(--line) solid var(--ink); }
details { border-bottom: var(--line) solid var(--ink); }
summary { position: relative; min-height: 56px; padding: 16px 44px 16px 0; list-style: none; font-size: 18px; font-weight: 600; line-height: 1.4; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 6px; top: 10px; font: 400 28px/1.2 var(--font-ui); color: var(--ultra); }
details[open] summary::after { content: "−"; }
details p { max-width: 64ch; padding: 0 28px 22px 0; font-size: 16px; line-height: 1.6; color: var(--muted-in); }
details a { color: var(--ink); font-weight: 500; text-underline-offset: 3px; }

/* ---------- Финал и подвал ---------- */
.closing { width: var(--wide); margin: 0 auto; padding: 88px 0 80px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.print { position: relative; width: clamp(180px, 22vw, 300px); padding: 10px; background: var(--paper); transform: rotate(-4deg); box-shadow: 2px 5px 0 rgb(23 19 14 / .2), 8px 16px 24px rgb(53 65 0 / .15); }
.print::before { content: ""; position: absolute; z-index: 1; top: -11px; left: 36%; width: 28%; height: 24px; background: rgb(244 230 183 / .82); border-inline: 2px dotted rgb(119 100 65 / .18); transform: rotate(6deg); }
.closing-copy { display: flex; flex-direction: column; gap: 18px; }
.closing h2 .lazy, .closing h2 .human { display: block; }
.closing p { max-width: 46ch; font-size: 18px; line-height: 1.5; }
.closing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 4px; }
.address { display: inline-flex; align-items: center; gap: 2px; font: 400 16px/1 var(--font-draft); }
.footer { width: var(--wide); margin: 0 auto; display: flex; align-items: center; gap: 12px 24px; padding: 20px 0 28px; border-top: var(--line) solid var(--ink); font-size: 14px; }
.footer .brand { font-size: 30px; }
.footer-note { color: var(--muted-in); }
.back { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; text-decoration: none; }
.back:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Первый экран ноутбука ----------
   Слоган, лист и кнопка «Переписать» помещаются без прокрутки: сцена дотягивается до низа окна. */
@media (min-width: 1180px) {
  .fold { display: flex; flex-direction: column; min-height: calc(min(100vh, 980px) - var(--header)); min-height: calc(min(100svh, 980px) - var(--header)); padding-bottom: 30px; }
  .stage { flex: 1 0 auto; }
  /* Готовый текст забирает больше места: строке нужна удобная длина. */
  html:not([data-state="idle"]) .stage { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  html:not([data-state="idle"]) .sheet { grid-template-columns: 40px minmax(0, 1fr); }
  html:not([data-state="idle"]) .sheet-margin .hand { display: none; }
}
@media (min-width: 1180px) and (max-width: 1359px) {
  /* Листу нужна ширина, чтобы черновик не вытягивался в столбик. */
  html[data-state="idle"] .stage { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  .sheet { grid-template-columns: 74px minmax(0, 1fr); }
  .sheet-margin { padding: 24px 4px 0 10px; }
  .sheet-margin .hand { font-size: 20px; }
  .seam { left: 8px; width: 52px; }
  .out-body { padding-left: 74px; padding-right: 24px; }
}
@media (min-width: 1180px) and (max-height: 840px) {
  .hero { padding: 16px 0 26px; }
}
@media (min-width: 1180px) and (max-height: 760px) {
  .fold { padding-bottom: 22px; }
  .hero { padding: 10px 0 20px; }
  .slogan .lazy { font-size: clamp(32px, 2.8vw, 40px); }
  .slogan .human { font-size: clamp(42px, 3.9vw, 56px); }
  .lead { padding-bottom: 6px; font-size: 16px; line-height: 1.45; }
}
@media (min-width: 1180px) and (max-height: 700px) {
  :root { --header: 62px; }
  .draft { min-height: 124px; }
}

/* ---------- Планшет и телефон ---------- */
@media (max-width: 1179px) {
  html { scroll-padding-top: 8px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 0 28px; }
  .lead { max-width: 60ch; }
  .stage { grid-template-columns: minmax(0, 1fr); }
  .sheet { grid-template-columns: 36px minmax(0, 1fr); }
  .sheet-margin { padding: 0; }
  .sheet-margin .hand, .seam { display: none; }
  .draft { min-height: 0; }
  .world-out { border-left: 0; border-top: var(--line) solid var(--ink); scroll-margin-top: 0; }
  .out-body { padding: 26px 24px 30px; }
  .calm { margin-top: 56px; }
  .band { padding: 64px 0; }
  .how { gap: 36px; }
  .how-steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .poster { padding: 28px 24px 32px; border-radius: 22px; }
  .pairs { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .style-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .closing { padding: 64px 0 56px; }
}
@media (max-width: 860px) {
  .masthead-nav { gap: 18px; }
  .nav-link { display: none; }
  .example-pair { grid-template-columns: minmax(0, 1fr); }
  .example-was { border-right: 0; border-bottom: var(--line) solid var(--ink); }
  .example-now { padding-left: 28px; }
  .example-seam { display: none; }
}
@media (max-width: 680px) {
  /* Кнопка «Переписать» держится у нижнего края окна, пока лист на экране. */
  .sheet-body { display: flex; flex-direction: column; }
  .draft { flex: 1 1 auto; }
  .sheet-controls { padding: 10px 16px 12px; }
  html[data-state="idle"] .sheet-controls { position: sticky; bottom: 0; z-index: 2; }
  .sheet-controls .primary { width: 100%; }
  .sheet-hint { padding: 0 16px 14px; border-top: 0; }
  .sheet-controls:not(:has(button:not([hidden]))) + .sheet-hint { padding-top: 12px; border-top: var(--line) solid var(--ink); }
  .closing { grid-template-columns: minmax(0, 1fr); }
  .print { width: min(56%, 200px); margin-left: 8px; }
}
@media (max-width: 560px) {
  :root { --header: 64px; --pad: 16px; }
  .brand { font-size: 32px; }
  .badge { display: none; }
  .pill { padding: 0 14px; }
  .hero { gap: 10px; padding: 12px 0 20px; }
  /* Каждая половина слогана держится в одну строку на любом телефоне. */
  .slogan .lazy { font-size: min(8.2vw, 36px); }
  .slogan .human { font-size: min(8.9vw, 40px); }
  .lead { font-size: 16px; line-height: 1.45; }
  .sheet-head { padding: 14px 16px 6px; }
  .sheet-head h2 { font-size: 21px; }
  .sheet-tag { font-size: 21px; }
  .draft { padding: 6px 16px 10px; font-size: 15px; line-height: 26px; background-image: repeating-linear-gradient(var(--paper) 0 25px, var(--rule) 25px 26px); background-position: 0 7px; }
  .out-body { padding: 24px 16px 28px; }
  .status-flag { font-size: 21px; }
  .paper { border-radius: 18px; }
  .paper-body { padding: 20px 18px 14px; }
  .edited, .example-now > p:not(.example-note) { font-size: 17px; line-height: 1.7; }
  .edit-card { left: 10px; right: 10px; padding: 2px 12px 12px; }
  .edit-was { font-size: 14.5px; }
  .edit-now { font-size: 16px; }
  /* В узкой карточке остаётся сама фраза: хвост предложения и так виден в тексте над ней. */
  .edit-card .ctx { display: none; }
  .compare { margin: 18px 18px 0; }
  .paper-hint { padding: 0 18px 18px; }
  .result-actions .pill { margin-left: 0; }
  .band h2, .closing h2 { font-size: 28px; }
  .style-list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .example-was { padding: 16px 16px 22px; }
  .example-now { padding: 16px 16px 22px; }
  .example-now > p:not(.example-note) { padding: 14px 18px 16px; }
  summary { font-size: 17px; }
  .footer-note { display: none; }
}

/* ---------- Движение ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Скобки раскрываются по очереди, когда появляется результат. */
  html[data-state="done"] .edited .edit { animation: brace-in .5s cubic-bezier(.2, .8, .2, 1) backwards; }
  html[data-state="done"] .edited .edit[data-edit="0"] { animation-delay: .12s; }
  html[data-state="done"] .edited .edit[data-edit="1"] { animation-delay: .24s; }
  html[data-state="done"] .edited .edit[data-edit="2"] { animation-delay: .36s; }
  .sheet { view-transition-name: hz-sheet; }
  .world-out { view-transition-name: hz-out; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; }
  ::view-transition-group(hz-sheet), ::view-transition-group(hz-out) { animation-duration: .42s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
}
@keyframes brace-in { from { background-size: 0 9px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .masthead-nav, .notice, .sheet-controls, .preview, .result-actions, .closing-actions .pill, .back, .seam, .example-seam { display: none !important; }
  .calm { margin-top: 24px; }
  .band, .closing { padding: 32px 0; }
}
