/* ===== Шрифты (локально, работают без сети) ===== */
@font-face { font-family: 'PT Serif'; font-weight: 400; font-display: swap; src: url(../fonts/pt-serif-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'PT Serif'; font-weight: 400; font-display: swap; src: url(../fonts/pt-serif-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'PT Serif'; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/pt-serif-cyrillic-400-italic.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'PT Serif'; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/pt-serif-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'PT Serif'; font-weight: 700; font-display: swap; src: url(../fonts/pt-serif-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'PT Serif'; font-weight: 700; font-display: swap; src: url(../fonts/pt-serif-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'PT Sans'; font-weight: 400; font-display: swap; src: url(../fonts/pt-sans-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'PT Sans'; font-weight: 400; font-display: swap; src: url(../fonts/pt-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'PT Sans'; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'PT Sans'; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #121315;
  --bg-2: #18191c;
  --bg-3: #212226;
  --line: rgba(239, 230, 210, .09);
  --line-2: rgba(239, 230, 210, .18);
  --ink-l: #ebe5d6;
  --muted: #8f897d;
  --paper: #efe6d2;
  --paper-2: #e5d9bf;
  --paper-3: #d8c9a8;
  --ink: #2a2620;
  --ink-2: #6b6253;
  --ink-3: #9a8f7b;
  --red: #b3261e;
  --red-l: #d4483d;
  --gold: #b8964a;
  --gold-l: #d2b46f;
  --ok: #4f7a4a;
  --ok-l: #7fa577;
  --serif: 'PT Serif', Georgia, 'Noto Serif', 'Times New Roman', serif;
  --sans: 'PT Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* зерно: маленькая плитка, рисуется один раз */
  --grain-d: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .13 0 0 0 0 .09 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  --grain-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .88 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  --paper-bg: var(--grain-d), radial-gradient(130% 90% at 20% 0%, #f4ecdb 0%, var(--paper) 45%, var(--paper-2) 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  color: var(--ink-l); font: 17px/1.45 var(--sans);
  background: var(--grain-l), radial-gradient(120% 60% at 50% -10%, #23242a 0%, #17181b 45%, var(--bg) 80%) fixed, var(--bg);
  -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
#app { max-width: 480px; margin: 0 auto; padding: 0 16px 140px; }
.screen { animation: enter .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

/* ===== Типографика ===== */
.kicker { font: 700 11px/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.kicker.red { color: var(--red-l); }
h1 { font: 700 52px/1 var(--serif); margin: 0; letter-spacing: -.01em; }
h2 { font: 700 34px/1.08 var(--serif); margin: 8px 0 12px; }
.lead { color: #cfc8b8; margin: 0 0 18px; font-size: 17px; }
.hint { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.rule { height: 1px; background: linear-gradient(90deg, var(--red) 0 36px, var(--line-2) 36px); margin: 14px 0; border: 0; }

/* ===== Кнопки ===== */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; margin: 18px 0 0; padding: 0 20px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, #c0332a, var(--red) 55%, #9e2119);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 -2px 0 rgba(0,0,0,.25) inset, 0 10px 24px -8px rgba(179,38,30,.7);
  color: #fff; font: 700 18px var(--sans); letter-spacing: .02em;
  transition: transform .08s, filter .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: translateY(1px) scale(.99); filter: brightness(.92); }
.btn:disabled { filter: grayscale(.7) brightness(.6); box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); box-shadow: none; color: var(--ink-l); font-weight: 400; min-height: 50px; }
.btn.ink { background: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 8px 18px -8px rgba(0,0,0,.6); color: var(--paper); }

/* ===== Варианты ответа ===== */
.q { margin: 22px 0 0; display: flex; align-items: baseline; gap: 10px; }
.q .qn { font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--red-l); white-space: nowrap; }
.q b { font: 700 19px/1.25 var(--serif); }
.q small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.opts { display: grid; gap: 9px; margin: 12px 0 0; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 14px 10px 10px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, #1f2024, #1a1b1e);
  border: 1px solid var(--line-2); border-radius: 12px;
  font-size: 17px; line-height: 1.25; transition: background .15s, border-color .15s, opacity .2s, transform .08s;
}
.opt .lt {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line-2); font: 700 15px var(--serif); color: var(--gold-l);
}
.opt .lt svg { width: 16px; height: 16px; }
.opt:active { transform: scale(.985); background: #26272c; }
.opts.two .opt { flex-direction: column; justify-content: center; gap: 6px; min-height: 88px; padding: 12px; text-align: center; font: 700 20px var(--serif); }
.opts.two .opt .lt { width: 34px; height: 34px; }
.opt.ok { background: linear-gradient(180deg, rgba(95,140,88,.32), rgba(79,122,74,.22)); border-color: var(--ok-l); }
.opt.ok .lt { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.bad { background: linear-gradient(180deg, rgba(200,50,40,.3), rgba(179,38,30,.2)); border-color: var(--red-l); }
.opt.bad .lt { background: var(--red); border-color: var(--red); color: #fff; }
.opt.dim { opacity: .38; }
.opt:disabled { opacity: .4; }
.opts.locked .opt { pointer-events: none; }
/* варианты на бумаге (в нижнем листе) */
.sheet .opt { background: rgba(255,255,255,.35); border-color: rgba(42,38,32,.22); color: var(--ink); }
.sheet .opt .lt { border-color: rgba(42,38,32,.3); color: var(--red); }
.sheet .opt:active { background: rgba(255,255,255,.6); }
.sheet .opt.bad { background: rgba(179,38,30,.14); border-color: var(--red); }
.sheet .opt.bad .lt { color: #fff; }

/* ===== Верхняя панель ===== */
.bar { position: sticky; top: 0; z-index: 6; margin: 0 -16px; background: rgba(18,19,21,.94); box-shadow: 0 1px 0 var(--line); }
.bar-in { display: flex; align-items: center; gap: 10px; padding: 10px 16px 9px; }
.chip { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(184,150,74,.45); color: var(--gold-l); font: 700 16px var(--serif); background: rgba(184,150,74,.07); }
.bar .lvl { flex: 1; min-width: 0; }
.bar .lvl small { display: block; font: 700 10px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bar .lvl b { display: block; font: 700 17px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 17px; background: var(--bg-3); border: 1px solid var(--line); font: 700 16px var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill svg { width: 16px; height: 16px; }
.pill.pts { color: var(--gold-l); }
.pill.pts.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.18); background: rgba(184,150,74,.25); } }
.pill.time.low { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.tline { height: 3px; background: var(--line); }
.tline i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--red-l)); transform-origin: left; transition: transform .25s linear; }
.steps { display: flex; gap: 5px; padding: 0 16px 9px; }
.steps i { flex: 1; height: 3px; border-radius: 2px; background: var(--line-2); }
.steps i.done { background: var(--gold); }
.steps i.on { background: var(--ink-l); }

/* ===== Старт: папка дела ===== */
.top { display: flex; justify-content: space-between; align-items: center; padding: 22px 2px 0; }
.top .yrs { font: 700 13px var(--serif); color: var(--red-l); letter-spacing: .08em; }
.folder { position: relative; margin: 18px 0 0; }
.folder .tab { position: absolute; top: -14px; left: 18px; height: 22px; padding: 0 14px; border-radius: 6px 6px 0 0; background: var(--paper-3); color: var(--ink-2); font: 700 10px/22px var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.paper {
  position: relative; color: var(--ink); background: var(--paper-bg);
  border-radius: 4px; box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 0 0 1px rgba(0,0,0,.25), 0 18px 40px -12px rgba(0,0,0,.7), 0 4px 10px rgba(0,0,0,.3);
}
.folder .paper { padding: 26px 20px 20px; }
.folder .no { align-items: center; display: flex; justify-content: space-between; font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.folder .no span:last-child { color: var(--red); }
.folder h1 { color: var(--ink); margin: 18px 0 2px; font-size: 56px; }
.folder .sub { font: italic 17px/1.35 var(--serif); color: var(--ink-2); margin: 0 0 16px; }
.f-row { display: grid; grid-template-columns: 82px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(42,38,32,.16); font-size: 15px; }
.f-row span { font: 700 10px/1.9 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.f-row b { font: 400 16px/1.35 var(--serif); }
.sign { margin-top: 14px; }
.sign label { display: block; font: 700 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
input.name {
  width: 100%; margin-top: 2px; padding: 8px 2px 8px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink); font: 700 24px var(--serif); outline: none;
}
input.name::placeholder { color: var(--ink-3); font-weight: 400; font-style: italic; }
input.name:focus { border-bottom-color: var(--red); }

/* маршрут */
.route { margin: 26px -4px 0; }
.route svg { width: 100%; height: auto; overflow: visible; }
.route .grid line { stroke: rgba(239,230,210,.06); stroke-width: 1; }
.route .path { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s .3s cubic-bezier(.5,0,.3,1) forwards; }
.route .glow { fill: none; stroke: rgba(179,38,30,.25); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s .3s cubic-bezier(.5,0,.3,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.route .city circle { fill: var(--bg); stroke: var(--red-l); stroke-width: 2; }
.route .city circle.core { fill: var(--red-l); stroke: none; }
.route .city { opacity: 0; animation: pop .4s forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; } }
.route text { font-family: var(--sans); fill: var(--ink-l); font-size: 12px; font-weight: 700; }
.route text.y { fill: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .05em; }

/* оглавление */
.toc { margin: 26px 0 0; padding: 0; list-style: none; }
.toc li { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.toc li:last-child { border-bottom: 1px solid var(--line); }
.toc .rn { width: 26px; font: 700 15px var(--serif); color: var(--gold-l); }
.toc .tt { font: 400 18px var(--serif); }
.toc .dots { flex: 1; border-bottom: 1px dotted var(--line-2); transform: translateY(-4px); }
.toc .tm { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note-s { font-size: 13px; color: var(--muted); text-align: center; margin: 14px 0 0; }

/* ===== Штампы ===== */
.stamp {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 3px; border: 3px solid currentColor; border-radius: 6px;
  font: 700 19px/1.15 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--ok);
  transform: rotate(-4deg); box-shadow: 0 0 0 1px currentColor inset;
  -webkit-mask-image: var(--grain-mask); mask-image: var(--grain-mask);
  animation: thunk .42s cubic-bezier(.2,1.6,.4,1) both;
}
.stamp.bad { color: var(--red); }
.stamp.neutral { color: var(--ink-2); }
@keyframes thunk { from { opacity: 0; transform: scale(1.9) rotate(-14deg); } 70% { opacity: 1; } to { transform: scale(1) rotate(-4deg); } }
:root { --grain-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.4 1.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.stamp-k { color: var(--red); font-size: 13px; padding: 3px 9px 2px; border-width: 2px; transform: rotate(7deg); animation: none; opacity: .85; }

/* ===== Главы (вступление к уровню) ===== */
.chapter { position: relative; padding-top: 18px; }
.ch-num { font: 700 150px/0.9 var(--serif); color: transparent; -webkit-text-stroke: 1.2px rgba(184,150,74,.55); margin: 6px 0 -6px -4px; letter-spacing: -.02em; user-select: none; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.facts div { padding: 12px 10px 12px 0; }
.facts div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.facts small { display: block; font: 700 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.facts b { display: block; font: 700 19px/1.2 var(--serif); margin-top: 3px; }
.done-score { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 6px; }
.done-score b { font: 700 88px/0.9 var(--serif); color: var(--gold-l); }
.done-score span { color: var(--muted); font-size: 16px; line-height: 1.3; }
.track { display: flex; gap: 6px; margin: 18px 0 0; }
.track div { flex: 1; padding: 8px 8px 7px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.track div b { display: block; font: 700 16px var(--serif); color: var(--ink-l); }
.track div.on { border-color: rgba(184,150,74,.5); }
.track div.next { border-style: dashed; }

/* ===== Каталожная карточка (уровень 1) ===== */
.card { margin: 18px 0 0; padding: 0 18px 30px; overflow: hidden; }
.card .head { display: flex; justify-content: space-between; align-items: center; margin: 0 -18px; padding: 13px 18px 10px; font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--red); box-shadow: 0 3px 0 -1px var(--paper), 0 4px 0 -1px rgba(179,38,30,.55); }
.card .head .tag { color: var(--red); }
.card .head .pips { display: flex; gap: 5px; }
.card .head .pips i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.card .head .pips i.ok { background: var(--ok); border-color: var(--ok); }
.card .head .pips i.bad { background: var(--red); border-color: var(--red); }
.fld { padding: 9px 0 8px; border-bottom: 1px solid rgba(42,38,32,.14); }
.fld:first-of-type { padding-top: 14px; }
.fld dt { font: 700 10px var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--ink-2); }
.fld dd { margin: 2px 0 0; font: 400 17px/1.35 var(--serif); }
.redact { display: inline-block; height: 18px; vertical-align: -3px; background: #1d1a15; border-radius: 1px; transform: rotate(-.6deg); box-shadow: 1px 1px 0 rgba(0,0,0,.25); }
.redact + em { margin-left: 8px; font: italic 13px var(--serif); color: var(--ink-3); }
.fld.revealed dd { color: var(--red); font-weight: 700; animation: enter .3s both; }
.keyline { margin: 14px 0 0; padding: 12px 14px; background: rgba(42,38,32,.06); border-left: 3px solid var(--red); }
.keyline small { display: block; font: 700 10px var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }
.keyline q { font: italic 17px/1.4 var(--serif); quotes: none; }
.card .foot { margin-top: 14px; font: italic 12.5px/1.35 var(--serif); color: var(--ink-3); }
.card .hole { position: absolute; left: 50%; bottom: 9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 2px 3px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.4); }
.scan { margin-top: 12px; }
.scan img { width: 100%; display: block; border: 1px solid var(--ink-3); }
.scan small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* ===== Нижний лист с обратной связью ===== */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 82vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  color: var(--ink); background: var(--paper-bg); border-radius: 16px 16px 0 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,.65);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2,.8,.2,1); visibility: hidden;
}
.sheet.show { transform: none; visibility: visible; }
.sheet::before { content: ''; display: block; height: 12px; background: radial-gradient(circle at 7px 7px, rgba(18,19,21,.85) 2.4px, transparent 3px) 4px 0 / 16px 12px repeat-x; opacity: .55; }
.sheet .in { max-width: 480px; margin: 0 auto; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet .top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; }
.badge { flex: none; display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 23px; background: var(--ink); color: var(--gold-l); font: 700 18px var(--serif); }
.badge.zero { background: rgba(42,38,32,.12); color: var(--ink-2); }
.badge.neg { background: var(--red); color: #fff; }
.sheet p { margin: 0 0 10px; font: 400 17px/1.45 var(--serif); }
.sheet p b { font-weight: 700; }
.sheet .src { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(42,38,32,.18); font: 14px/1.4 var(--sans); color: var(--ink-2); }
.sheet .src small { flex: none; font: 700 10px/1.9 var(--sans); letter-spacing: .15em; text-transform: uppercase; }
.sheet .src a { color: var(--red); text-decoration: none; border-bottom: 1px solid rgba(179,38,30,.35); }
.sheet ol.key, .sheet ul.key { margin: 4px 0 8px; padding: 0; list-style: none; counter-reset: k; }
.sheet .key li { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 4px; padding: 6px 0; border-bottom: 1px dotted rgba(42,38,32,.25); font: 15px/1.35 var(--serif); }
.sheet ol.key li::before { counter-increment: k; content: counter(k); font: 700 13px var(--sans); color: var(--ink-3); }
.sheet .key li b { display: block; font: 700 12px var(--sans); letter-spacing: .06em; color: var(--red); }
.sheet .q { margin-top: 0; }
.sheet .q b { color: var(--ink); }
.sheet .btn { margin-top: 14px; }
.sheet .btn.ghost { color: var(--ink-2); border-color: rgba(42,38,32,.25); }

/* ===== Хронология ===== */
.tl { list-style: none; padding: 0; margin: 16px 0 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--red), rgba(179,38,30,.35)); }
.ci { position: relative; display: flex; align-items: stretch; gap: 10px; margin: 0 0 8px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.ci .node { flex: none; position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; margin-top: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--red); font: 700 14px var(--serif); color: var(--ink-l); }
.ci .slip { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 9px 8px 9px 13px; border-radius: 6px; color: var(--ink); background: var(--paper-bg); box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 6px 14px -6px rgba(0,0,0,.6); transition: box-shadow .15s, transform .15s; }
.ci .tx { flex: 1; font: 400 15.5px/1.3 var(--serif); }
.ci .dt { display: none; font: 700 12px var(--sans); letter-spacing: .06em; color: var(--red); margin-bottom: 2px; }
.ci .grip { flex: none; width: 22px; color: var(--ink-3); }
.ci .grip svg { width: 22px; height: 22px; }
.ci.drag { z-index: 5; cursor: grabbing; }
.ci.drag .slip { transform: rotate(-1.2deg) scale(1.02); box-shadow: 0 0 0 2px var(--red), 0 22px 34px -10px rgba(0,0,0,.85); }
.ci.drag .node { background: var(--red); }
.tl.done .ci { cursor: default; }
.tl.done .dt { display: block; }
.tl.done .grip { display: none; }
.ci.ok .node { border-color: var(--ok-l); background: var(--ok); color: #fff; }
.ci.ok .slip { box-shadow: 0 0 0 1px rgba(0,0,0,.25), inset 4px 0 0 var(--ok); }
.ci.bad .node { border-color: var(--red-l); background: var(--red); color: #fff; }
.ci.bad .slip { box-shadow: 0 0 0 1px rgba(0,0,0,.25), inset 4px 0 0 var(--red); }
.ends { display: flex; justify-content: space-between; margin: 14px 0 0 44px; font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* ===== Мифы: газетная вырезка ===== */
.clip { position: relative; margin: 20px 0 0; padding: 26px 20px 28px; color: var(--ink); background: var(--paper-bg); }
.clip::before, .clip::after { content: ''; position: absolute; left: 0; right: 0; height: 7px; background-size: 12px 7px; background-repeat: repeat-x; }
.clip::before { top: 0; background-image: linear-gradient(135deg, var(--bg) 4.95px, transparent 0), linear-gradient(-135deg, var(--bg) 4.95px, transparent 0); }
.clip::after { bottom: 0; background-image: linear-gradient(45deg, var(--bg) 4.95px, transparent 0), linear-gradient(-45deg, var(--bg) 4.95px, transparent 0); }
.clip .head { display: flex; justify-content: space-between; font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 8px; border-bottom: 1px solid rgba(42,38,32,.25); }
.clip blockquote { position: relative; margin: 16px 0 0; padding-left: 30px; font: 700 22px/1.3 var(--serif); }
.clip blockquote::before { content: '«'; position: absolute; left: -4px; top: -14px; font: 700 64px/1 var(--serif); color: var(--red); }
.clip .tags { margin: 14px 0 0; font: italic 13px var(--serif); color: var(--ink-3); }

/* ===== Редактор: музейная этикетка ===== */
.exhibit { margin: 18px 0 0; padding: 8px; color: var(--ink); background: var(--paper-bg); border-radius: 3px; box-shadow: 0 18px 40px -14px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.3); }
.exhibit .frame { border: 1px solid rgba(42,38,32,.35); padding: 14px 14px 12px; outline: 1px solid rgba(42,38,32,.15); outline-offset: -5px; }
.exhibit .head { display: flex; justify-content: space-between; font: 700 10px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.exhibit .head .tag { color: var(--red); }
.ex-text { margin: 14px 0 10px; font: 400 20px/1.85 var(--serif); }
.ex-foot { font: italic 13px var(--serif); color: var(--ink-3); border-top: 1px solid rgba(42,38,32,.18); padding-top: 8px; }
.frag { padding: 1px 0; border-bottom: 2px dotted rgba(42,38,32,.45); cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 2px; transition: background .15s; }
.frag:active { background: rgba(179,38,30,.12); }
.frag.kept { border-bottom: 2px solid rgba(42,38,32,.5); cursor: default; }
.frag.fixed { border-bottom: 0; cursor: default; }
.frag.fixed s { color: var(--ink-3); text-decoration-color: var(--red); text-decoration-thickness: 2px; margin-right: 5px; }
.frag.fixed ins { text-decoration: none; font-style: italic; font-weight: 700; color: var(--red); background: linear-gradient(transparent 62%, rgba(184,150,74,.35) 0); }
.frag.missed { background: rgba(179,38,30,.16); border-bottom: 2px solid var(--red); }
.errs { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; }
.errs > span { font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.errs i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px dashed var(--line-2); font: 700 15px var(--serif); font-style: normal; color: var(--muted); }
.errs i.on { border: 1px solid var(--ok-l); background: var(--ok); color: #fff; animation: bump .4s; }
.after { margin-top: 6px; }

/* ===== Лист архивиста ===== */
.cert { position: relative; margin: 20px 0 0; padding: 0 20px 22px; overflow: hidden; }
.cert .head { display: flex; justify-content: space-between; margin: 0 -20px; padding: 14px 20px 10px; font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--ink); }
.cert .issued { margin: 18px 0 0; font: 700 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.cert .nm { font: 700 30px/1.1 var(--serif); padding: 2px 0 6px; border-bottom: 1px solid rgba(42,38,32,.4); margin-right: 104px; word-break: break-word; }
.cert .score { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 4px; }
.cert .score b { font: 700 74px/0.9 var(--serif); color: var(--ink); }
.cert .score span { font: 15px/1.25 var(--sans); color: var(--ink-2); }
.seal { position: absolute; right: 10px; top: 48px; width: 118px; height: 118px; color: var(--red); transform: rotate(-12deg); opacity: .9; animation: seal .6s .25s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes seal { from { opacity: 0; transform: scale(1.8) rotate(-30deg); } to { opacity: .9; transform: scale(1) rotate(-12deg); } }
.rows { margin: 12px 0 0; }
.row { padding: 9px 0 8px; border-top: 1px solid rgba(42,38,32,.14); }
.row .l { display: flex; align-items: baseline; gap: 8px; font: 400 16px var(--serif); }
.row .l .rn { width: 22px; font-weight: 700; color: var(--red); }
.row .l .dots { flex: 1; border-bottom: 1px dotted rgba(42,38,32,.4); transform: translateY(-4px); }
.row .l b { font: 700 16px var(--sans); font-variant-numeric: tabular-nums; }
.row .b { height: 4px; margin: 6px 0 0 30px; background: rgba(42,38,32,.12); border-radius: 2px; overflow: hidden; }
.row .b i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-l)); }
.margin-note { margin: 16px 0 0; padding: 12px 14px; background: rgba(179,38,30,.07); border-left: 3px solid var(--red); font: 15px/1.4 var(--serif); }
.margin-note small { display: block; font: 700 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }
.margin-note .r { display: block; margin-top: 4px; color: var(--ink-2); font-style: italic; }
.margin-note.good { background: rgba(79,122,74,.1); border-color: var(--ok); }
.margin-note.good small { color: var(--ok); }
.cert .route-l { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin: 18px 0 0; font: 700 10px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.cert .route-l i { flex: 1; height: 2px; background: var(--red); position: relative; }
.cert .route-l i::after { content: ''; position: absolute; right: -2px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.cert .route-l i:last-of-type::after { display: none; }
.show-t { text-align: center; margin: 16px 0 0; font: italic 15px var(--serif); color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; } }
@media (max-width: 370px) {
  body { font-size: 16px; }
  .folder h1 { font-size: 46px; }
  h2 { font-size: 30px; }
  .ch-num { font-size: 120px; }
  .ex-text { font-size: 18px; }
  .clip blockquote { font-size: 20px; }
  .cert .nm { font-size: 26px; margin-right: 92px; }
  .seal { width: 100px; height: 100px; }
  .pill { padding: 0 8px; font-size: 15px; }
}

/* =====================================================================
   v4: простые нажатия, богатая анимация
   ===================================================================== */
.screen { position: relative; z-index: 1; }
.stg { animation: up .5s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
.stage { padding-top: 12px; position: relative; z-index: 1; }
.ghost { box-shadow: 0 26px 44px -12px rgba(0,0,0,.85) !important; }
.shake { animation: shake .4s !important; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.plus { position: fixed; z-index: 90; width: 40px; text-align: center; font: 700 22px var(--serif); color: var(--gold-l); text-shadow: 0 2px 10px rgba(0,0,0,.7); pointer-events: none; }
.plus.neg { color: #f0948a; }
.toast { position: fixed; left: 50%; top: 74px; z-index: 70; width: max-content; max-width: calc(100% - 32px); transform: translate(-50%, -16px); opacity: 0; padding: 10px 16px; border-radius: 12px; background: #26272c; border: 1px solid var(--line-2); color: var(--ink-l); font: 15px/1.35 var(--sans); text-align: center; box-shadow: 0 14px 34px rgba(0,0,0,.55); transition: opacity .2s, transform .3s cubic-bezier(.2,1.4,.4,1); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: var(--ok-l); }
.toast.good b { color: var(--ok-l); }
.toast.bad { border-color: var(--red-l); }
.toast.bad b { color: #f0948a; }

/* пыль на старте */
.dust { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.dust i { position: absolute; bottom: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: rgba(239,230,210,.32); animation: rise linear infinite; }
@keyframes rise { to { transform: translate(var(--x), -112vh); } }
.title-in span { display: inline-block; animation: up .8s cubic-bezier(.2,.8,.2,1) backwards .25s; }
.title-in span:nth-child(2) { animation-delay: .38s; }

/* маршрут: и на старте, и в хронологии */
.route .base { fill: none; stroke: rgba(239,230,210,.13); stroke-width: 1.5; stroke-dasharray: 3 4; }
.route.intro .path, .route.intro .glow { animation-duration: .75s; }
.route .city .halo { fill: rgba(212,72,61,.4); stroke: none; opacity: 0; transform-box: fill-box; transform-origin: center; }
.route.intro .city .halo { animation: halo 1.4s ease-out backwards; animation-delay: inherit; }
@keyframes halo { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(2.6); } }
.route.progress { max-width: 300px; margin: 0 auto; }
.route.progress .path, .route.progress .glow { animation: none; transition: stroke-dashoffset 1.1s cubic-bezier(.5,0,.3,1); }
.route.progress .path.on, .route.progress .glow.on { stroke-dashoffset: 0; }
.route.progress .city { opacity: 1; animation: none; }
.route.progress .city .ring { stroke: rgba(239,230,210,.3); transition: fill .4s, stroke .4s; }
.route.progress .city .core { fill: rgba(239,230,210,.3); }
.route.progress .city text { fill: var(--muted); transition: fill .4s; }
.route.progress .city.on .ring { stroke: var(--red-l); fill: var(--red); }
.route.progress .city.on .core { fill: #fff; }
.route.progress .city.on text { fill: var(--ink-l); }
.route.progress .city.on .halo { animation: halo 1.3s ease-out; }

/* главы */
.ch-svg { display: block; width: 100%; max-width: 300px; height: auto; margin: 4px 0 -14px -6px; overflow: visible; }
.ch-svg text { font: 700 150px var(--serif); fill: rgba(184,150,74,0); stroke: rgba(210,180,111,.8); stroke-width: 1.4; stroke-dasharray: 900; stroke-dashoffset: 900; animation: drawT 1.8s .1s cubic-bezier(.5,0,.3,1) forwards, fillT 1s 1.2s forwards; }
@keyframes drawT { to { stroke-dashoffset: 0; } }
@keyframes fillT { to { fill: rgba(184,150,74,.16); } }
.meter { height: 6px; margin: 8px 0 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(90deg, var(--gold), var(--gold-l)); transform-origin: left; animation: grow 1s .45s cubic-bezier(.3,.8,.3,1) backwards; }
@keyframes grow { from { transform: scaleX(0); } }

/* --- I. карточка --- */
.doc { position: relative; margin: 4px 0 0; padding: 0 18px 30px; overflow: hidden; animation: docIn .7s cubic-bezier(.2,.9,.25,1) backwards; }
@keyframes docIn { from { opacity: 0; transform: translateY(50px) rotate(4deg) scale(.95); } 60% { opacity: 1; } }
.doc .head, .face.back .head { display: flex; justify-content: space-between; align-items: center; margin: 0 -18px; padding: 13px 18px 10px; font: 700 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--red); box-shadow: 0 3px 0 -1px var(--paper), 0 4px 0 -1px rgba(179,38,30,.55); }
.doc .head .tag { color: var(--red); }
.doc .pips { display: flex; gap: 6px; }
.doc .pips i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink-2); transition: background .3s, border-color .3s, transform .3s cubic-bezier(.2,1.6,.4,1); }
.doc .pips i.ok { background: var(--ok); border-color: var(--ok); transform: scale(1.25); }
.doc .pips i.bad { background: var(--red); border-color: var(--red); transform: scale(1.25); }
.doc dd.hid, .doc dd.shown { position: relative; display: inline-block; min-width: 70px; }
.doc dd.hid .val { opacity: 0; }
.doc .redact { position: absolute; left: -4px; right: -4px; top: 2px; bottom: 2px; display: block; width: auto; height: auto; background: #1d1a15; border-radius: 1px; transform-origin: right center; transform: rotate(-.5deg); box-shadow: 1px 1px 0 rgba(0,0,0,.25); }
.doc dd.shown .val { color: var(--red); font-weight: 700; animation: valIn .6s .12s backwards; }
@keyframes valIn { from { opacity: 0; letter-spacing: .16em; } }
.doc .keyline .hl { background: linear-gradient(rgba(184,150,74,.4), rgba(184,150,74,.4)) no-repeat 0 88% / 0 38%; -webkit-box-decoration-break: clone; box-decoration-break: clone; animation: hl 1.1s 1s cubic-bezier(.5,0,.3,1) forwards; }
@keyframes hl { to { background-size: 100% 38%; } }
.doc .foot { margin-top: 14px; font: italic 12.5px/1.35 var(--serif); color: var(--ink-3); }
.doc .hole { position: absolute; left: 50%; bottom: 9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 2px 3px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.4); }
.imprint { position: absolute; left: 50%; top: 50%; z-index: 5; padding: 7px 16px 5px; border: 4px solid currentColor; border-radius: 7px; color: var(--red); font: 700 24px/1.1 var(--serif); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 2px currentColor inset; -webkit-mask-image: var(--grain-mask); mask-image: var(--grain-mask); transform: translate(-50%, -50%) rotate(-12deg); }
.imprint.show { animation: slam .5s cubic-bezier(.2,1.6,.4,1) forwards; }
.imprint.bad { color: #5d5486; }
.imprint.bad::after { content: '✕'; position: absolute; right: -30px; top: -26px; font: 700 34px var(--sans); color: var(--red); -webkit-mask-image: none; }
@keyframes slam { from { opacity: 0; transform: translate(-50%, -50%) rotate(-24deg) scale(2.6); } to { opacity: .93; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }

.qbox { margin-top: 14px; min-height: 220px; }
.qset { animation: up .35s cubic-bezier(.2,.8,.2,1) backwards; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.ch { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px 10px 10px; text-align: left; cursor: pointer; border-radius: 12px; background: linear-gradient(180deg, #212226, #1a1b1e); border: 1px solid var(--line-2); color: var(--ink-l); font: 700 15.5px/1.2 var(--serif); transition: transform .12s, background .25s, border-color .25s, opacity .3s; }
.ch .lt { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); font: 700 13px var(--serif); color: var(--gold-l); transition: background .25s, border-color .25s; }
.ch .lt svg { width: 14px; height: 14px; }
.ch:active { transform: scale(.96); }
.ch.ok { background: linear-gradient(180deg, rgba(95,140,88,.4), rgba(79,122,74,.26)); border-color: var(--ok-l); animation: okPop .5s cubic-bezier(.2,1.6,.4,1); }
.ch.ok .lt { background: var(--ok); border-color: var(--ok); color: #fff; }
.ch.bad { background: rgba(179,38,30,.26); border-color: var(--red-l); }
.ch.bad .lt { background: var(--red); border-color: var(--red); color: #fff; }
.ch.dim { opacity: .28; transform: scale(.97); }
@keyframes okPop { 45% { transform: scale(1.06); } }
.stamps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.rstamp { display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; transition: transform .3s cubic-bezier(.2,1.4,.4,1), opacity .3s; }
.rstamp .knob { width: 48px; height: 32px; border-radius: 50% 50% 42% 42%; background: radial-gradient(circle at 35% 30%, #b08552, #6b4a26 58%, #3a2713); box-shadow: 0 3px 6px rgba(0,0,0,.5), inset 0 -2px 3px rgba(0,0,0,.3); }
.rstamp .neck { width: 16px; height: 14px; background: linear-gradient(90deg, #3a2713, #7a5630, #3a2713); }
.rstamp .face { display: block; width: 100%; padding: 13px 8px 11px; border-radius: 8px; background: linear-gradient(180deg, #3b2b19, #281b0f); border-bottom: 4px solid var(--red); box-shadow: 0 4px 0 #140d06, 0 10px 18px rgba(0,0,0,.5); color: #f2a79f; font: 700 15px/1.15 var(--serif); letter-spacing: .06em; text-transform: uppercase; text-align: center; }
.rstamp .face small { display: block; margin-top: 5px; font: 700 9.5px var(--sans); letter-spacing: .12em; color: rgba(242,167,159,.7); }
.rstamp:active, .rstamp.pressed { transform: translateY(6px) scale(.98); }
.rstamp.dim { opacity: .25; transform: scale(.94); }
.rstamp:hover .knob { filter: brightness(1.08); }

/* --- II. хронология --- */
.chron { display: grid; gap: 6px; margin-top: 8px; }
.chron-empty { padding: 14px; border: 1.5px dashed var(--line-2); border-radius: 8px; text-align: center; color: var(--muted); font: italic 14px var(--serif); }
.ce { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: 6px; color: var(--ink); background: var(--paper-bg); font: 14px/1.3 var(--serif); box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 6px 12px -8px rgba(0,0,0,.6); }
.ce .n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--red); color: #fff; font: 700 12px var(--sans); }
.ce b { display: block; font: 700 12px var(--sans); letter-spacing: .04em; color: var(--red); }
.ce.land { animation: land .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes land { 0% { transform: scale(1.05); box-shadow: 0 0 0 3px var(--gold-l), 0 0 24px rgba(210,180,111,.6); } }
.pool { display: grid; gap: 8px; margin-top: 12px; }
.pc { display: block; width: 100%; padding: 13px 14px; text-align: left; cursor: pointer; overflow: hidden; border-radius: 10px; background: linear-gradient(180deg, #222327, #1b1c1f); border: 1px solid var(--line-2); color: var(--ink-l); font: 15.5px/1.3 var(--serif); transition: transform .12s, border-color .25s; }
.pc:active { transform: scale(.98); }
.pc .dt { display: none; margin-bottom: 3px; font: 700 12px var(--sans); color: #f0948a; letter-spacing: .04em; }
.pc.peek { border-color: rgba(212,72,61,.55); }
.pc.peek .dt { display: block; animation: up .3s backwards; }

/* --- III. мифы: переворот --- */
.flipwrap { perspective: 1300px; margin-top: 4px; animation: docIn .65s cubic-bezier(.2,.9,.25,1) backwards; }
.flipper { display: grid; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.35,.9,.3,1); }
.flipper.flipped { transform: rotateY(180deg); }
.flipper .face { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flipper .face.front { margin: 0; }
.flipper .face.back { position: relative; overflow: hidden; padding: 0 18px 22px; transform: rotateY(180deg); }
.clip .verdict { margin-top: 12px; font: italic 14px var(--serif); color: var(--ink-2); }
.clip .verdict b { font-style: normal; color: var(--ink); }
.cmp { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 18px; font: 15px/1.3 var(--serif); }
.cmp small { display: block; margin-bottom: 3px; font: 700 9.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.cmp i { font: 700 36px var(--serif); font-style: normal; color: var(--red); }
.your { margin-top: 16px; padding-top: 10px; border-top: 1px dashed rgba(42,38,32,.3); font: 14px var(--sans); color: var(--ink-2); }
.your b { color: var(--ink); }
.your .g { color: var(--ok); font-weight: 700; }
.your .r { color: var(--red); font-weight: 700; }
.bigstamp { position: absolute; left: 50%; top: 50%; z-index: 5; padding: 6px 16px 4px; border: 5px solid currentColor; border-radius: 8px; font: 700 34px/1.1 var(--serif); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; pointer-events: none; opacity: 0; color: var(--red);
  box-shadow: 0 0 0 2px currentColor inset; -webkit-mask-image: var(--grain-mask); mask-image: var(--grain-mask); transform: translate(-50%, -50%) rotate(-10deg); }
.bigstamp.show { animation: slam2 .5s cubic-bezier(.2,1.6,.4,1) forwards; }
.bigstamp.true { color: var(--ok); font-size: 24px; }
@keyframes slam2 { from { opacity: 0; transform: translate(-50%, -50%) rotate(-24deg) scale(2.6); } to { opacity: .93; transform: translate(-50%, -50%) rotate(-10deg) scale(1); } }
.vbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.vb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; border-radius: 14px; border: 1px solid; cursor: pointer; font: 700 20px var(--serif); transition: transform .3s cubic-bezier(.2,1.4,.4,1), opacity .3s, box-shadow .3s; }
.vb svg { width: 30px; height: 30px; }
.vb.yes { color: var(--ok-l); border-color: rgba(127,165,119,.45); background: linear-gradient(180deg, rgba(79,122,74,.16), rgba(79,122,74,.04)); }
.vb.no { color: #ee8c82; border-color: rgba(212,72,61,.45); background: linear-gradient(180deg, rgba(179,38,30,.16), rgba(179,38,30,.04)); }
.vb:active { transform: scale(.95); }
.vb.chosen { transform: scale(1.04); box-shadow: 0 0 0 2px currentColor, 0 12px 26px -10px currentColor; }
.vb.dim { opacity: .25; transform: scale(.94); }
.folder-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin-top: 14px; }
.folder-docs.one { grid-template-columns: 1fr; }
.sdoc { position: relative; display: block; width: 100%; min-height: 96px; padding: 12px; border: 0; border-radius: 3px; text-align: left; cursor: pointer; color: var(--ink); background: var(--paper-bg); font: inherit; box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 8px 16px -8px rgba(0,0,0,.7); transition: box-shadow .25s, transform .15s; }
.folder-docs .sdoc:nth-child(odd) { rotate: -.8deg; }
.folder-docs .sdoc:nth-child(even) { rotate: .7deg; }
.sdoc:active { transform: scale(.97); }
.sdoc::before { content: ''; position: absolute; top: -6px; left: 14px; width: 34px; height: 12px; background: rgba(210,180,111,.6); transform: rotate(-5deg); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sdoc small { display: inline-block; padding: 2px 6px; border-radius: 2px; background: var(--ink-2); color: var(--paper); font: 700 9.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.sdoc b { display: block; margin-top: 7px; font: 700 14.5px/1.25 var(--serif); }
.sdoc span { display: block; margin-top: 4px; font: italic 12px/1.3 var(--serif); color: var(--ink-3); }
.sdoc.used { pointer-events: none; }
.sdoc.drop { animation: dropAway .55s cubic-bezier(.5,0,.7,.4) forwards; }
@keyframes dropAway { to { transform: translateY(26px) rotate(9deg); opacity: .2; } }
.sdoc.right { box-shadow: 0 0 0 2px var(--ok-l), 0 8px 16px -8px rgba(0,0,0,.7); }
.note-line { min-height: 22px; margin-top: 12px; font-size: 14.5px; line-height: 1.4; color: #e2b2ac; }
.note-line b { color: #f0948a; }

/* --- IV. редактор --- */
.exhibit { position: relative; animation: docIn .7s cubic-bezier(.2,.9,.25,1) backwards; }
.frag.striking { background-image: linear-gradient(var(--red), var(--red)); background-repeat: no-repeat; background-size: 100% 2.5px; background-position: 0 58%; animation: strikeIn .25s ease-out; }
@keyframes strikeIn { from { background-size: 0 2.5px; } }
.frag.done { border-bottom: 0; cursor: default; }
.frag.done s { margin-right: 5px; font-size: .85em; color: var(--ink-3); text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.frag.done ins.write { display: inline-block; text-decoration: none; font-style: italic; font-weight: 700; color: var(--red); background: linear-gradient(transparent 62%, rgba(184,150,74,.35) 0); clip-path: inset(0 100% 0 0); animation: write .75s .05s cubic-bezier(.5,0,.3,1) forwards; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
.pop { position: absolute; left: 8px; right: 8px; z-index: 6; opacity: 0; pointer-events: none; transform: translateY(-8px) scale(.95); transform-origin: var(--ax, 50%) 0; transition: opacity .18s, transform .3s cubic-bezier(.2,1.4,.4,1); }
.pop.show { opacity: 1; transform: none; pointer-events: auto; }
.pop-in { position: relative; padding: 10px; border-radius: 12px; background: #25262b; border: 1px solid var(--line-2); box-shadow: 0 20px 40px rgba(0,0,0,.6); }
.pop-in::before { content: ''; position: absolute; top: -7px; left: calc(var(--ax, 50%) - 15px); width: 12px; height: 12px; background: #25262b; border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
.pop small { display: block; margin: 0 2px 8px; font: 700 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.po-row { display: flex; flex-wrap: wrap; gap: 8px; }
.po { flex: 1 1 auto; min-height: 48px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-l); font: 700 16px var(--serif); cursor: pointer; transition: transform .12s, background .2s; }
.po:active { transform: scale(.95); }
.po.ok { background: var(--ok); border-color: var(--ok-l); color: #fff; }
.po.bad { background: rgba(179,38,30,.3); border-color: var(--red-l); opacity: .55; }
.sweep { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; background: linear-gradient(180deg, transparent 0, rgba(255,250,235,.9) 50%, transparent 100%) no-repeat 0 -80px / 100% 80px; }
.sweep.run { animation: sweep 1s cubic-bezier(.5,0,.5,1); }
@keyframes sweep { 0% { opacity: 1; background-position: 0 -80px; } 100% { opacity: 1; background-position: 0 calc(100% + 80px); } }
.exhibit.printed .ex-text { color: #1d1a15; }
.errs i svg { width: 16px; height: 16px; }

/* --- итог --- */
.result-s .cert { animation: docIn .8s cubic-bezier(.2,.9,.25,1) backwards; }
.seal-wrap { position: absolute; right: 10px; top: 48px; width: 118px; height: 118px; z-index: 2; }
.seal-wrap .seal { position: static; width: 100%; height: 100%; animation-delay: 1.45s; }
.ink-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--red); opacity: 0; animation: ring .9s 1.6s ease-out; }
@keyframes ring { from { opacity: .7; transform: scale(.7); } to { opacity: 0; transform: scale(1.6); } }
.cert .row .b i { width: 0; transition: width 1.1s cubic-bezier(.3,.8,.3,1); }
.cert.filled .row .b i { width: var(--w); }
.cert.filled .row:nth-child(2) .b i { transition-delay: .15s; }
.cert.filled .row:nth-child(3) .b i { transition-delay: .3s; }
.cert.filled .row:nth-child(4) .b i { transition-delay: .45s; }
@media (max-width: 370px) {
  .seal-wrap { width: 100px; height: 100px; }
  .ch { font-size: 14.5px; min-height: 60px; }
  .rstamp .face { font-size: 13.5px; }
}
