/* ===== Шрифты (лежат в проекте, работают офлайн) ===== */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/manrope-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-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: 500 700;
  font-display: swap;
  src: url(fonts/unbounded-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: 500 700;
  font-display: swap;
  src: url(fonts/unbounded-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;
}

/* ===== Фирменные цвета — ВСЁ ЗДЕСЬ. Замените коды, когда будут точные. ===== */
:root {
  --green: #2B5435;        /* основной: шапка, кнопки. Белый текст на нём 8.7:1 */
  --green-press: #1F3F27;  /* зелёный при нажатии */
  --green-soft: #E7EFE8;   /* мягкий зелёный фон */
  --pink: #C8448A;         /* акцент. Исходный #C8458A давал 4.49:1 с белым, затемнён до 4.52:1 */
  --pink-ink: #9E2C68;     /* розовый для текста на светлом фоне */
  --pink-soft: #FBEAF2;    /* мягкая розовая плашка (предупреждения) */
  --bg: #FFFFFF;
  --bg-2: #F6F3EF;         /* тёплый вторичный фон */
  --text: #1F2421;
  --muted: #5B615D;        /* второстепенный текст, 6:1 на белом */
  --line: #E4DED6;
  --todo-bg: #FFE27A;      /* жёлтая плашка «нужно уточнить» */
  --todo-ink: #3D2F00;

  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --fs: 17px;              /* основной размер текста; меняется кнопкой «Аа» */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
html[data-fs="l"] { --fs: 20px; }
html[data-fs="xl"] { --fs: 24px; }

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: var(--fs);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg-2);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-2);
  color: var(--text);
  font-family: "Manrope", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3 {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
h1 { font-size: min(calc(0.82rem + 7px), 7.4vw); letter-spacing: -0.01em; }
h2 { font-size: min(calc(0.7rem + 5px), 6.2vw); }
h3 { font-size: 1rem; }
p { margin: 0 0 0.85em; }
a { color: var(--green); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
.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;
}
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.noscript { padding: 24px; }
[hidden] { display: none !important; }

/* Запрет выделения в основном тексте (поля ввода остаются выделяемыми) */
.no-select { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ===== Каркас ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--green); color: #fff;
  padding: var(--safe-top) 8px 0;
}
.topbar-inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; gap: 4px; min-height: 60px;
}
.topbar-title {
  flex: 1; min-width: 0;
  font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 17px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 6px;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; height: 48px; padding: 0 10px;
  border: 0; border-radius: 14px; background: transparent; color: inherit;
  text-decoration: none;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.16); }
.icon-btn:focus-visible { outline-color: #fff; }
.aa-btn { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 17px; gap: 1px; }
.aa-btn small { font-size: 13px; }

main {
  max-width: 680px; margin: 0 auto;
  padding: 20px var(--gutter) calc(40px + var(--safe-bottom));
}
main:focus { outline: none; }

/* ===== Карточки ===== */
.card {
  display: block;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; color: inherit; text-decoration: none;
}
a.card:active, button.card:active { background: var(--green-soft); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.row-card {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; width: 100%; text-align: left;
}
.row-card .grow { flex: 1; min-width: 0; }
.row-card .chev { color: var(--muted); width: 20px; height: 20px; }
.row-title { font-weight: 700; line-height: 1.35; display: block; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.row-sub { color: var(--muted); font-size: 0.88rem; line-height: 1.4; display: block; margin-top: 2px; }
.row-kicker { color: var(--pink-ink); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; display: block; }
.tile {
  flex: none; width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--green-soft); color: var(--green);
}
.tile .icon { width: 28px; height: 28px; }
.tile-num {
  flex: none; min-width: 44px; height: 44px; border-radius: 12px; padding: 0 6px;
  display: grid; place-items: center;
  background: var(--bg-2); color: var(--green);
  font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 15px;
}

.block-title {
  font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  margin: 28px 4px 12px;
}

/* ===== Главная ===== */
.hero { padding: 6px 4px 18px; }
.hero h1 { font-size: min(calc(0.9rem + 9px), 8.4vw); }
.hero p { color: var(--muted); margin: 8px 0 0; }
.search {
  position: relative; display: block;
}
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; min-height: 56px;
  padding: 12px 16px 12px 52px;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--bg);
  font-size: max(16px, 1rem);
}
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 88px; padding: 12px 6px; text-align: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.8rem; line-height: 1.25;
}
.quick a .icon { color: var(--green); width: 28px; height: 28px; }
.quick a:active { background: var(--green-soft); }
.rate-line {
  margin-top: 14px; padding: 12px 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.9rem; color: var(--muted); line-height: 1.5;
}
.rate-line strong { color: var(--text); }
a.rate-line { display: block; text-decoration: none; }
a.rate-line:active { background: var(--green-soft); }

.author-card { display: flex; align-items: center; gap: 14px; }
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: var(--pink-soft); color: var(--pink-ink);
  display: grid; place-items: center; text-align: center;
  font-size: 11px; font-weight: 700; line-height: 1.2; padding: 6px;
  border: 2px dashed var(--pink);
}
.avatar-todo { background: var(--todo-bg); color: var(--todo-ink); border-color: var(--todo-ink); }
.avatar-lg { width: 132px; height: 132px; font-size: 14px; margin: 4px auto 14px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.has-photo { padding: 0; border: 0; background: var(--bg-2); overflow: hidden; }

.copyright { color: var(--muted); font-size: 0.78rem; line-height: 1.5; text-align: center; margin: 28px 8px 0; }

/* ===== Результаты поиска ===== */
.results { margin-top: 14px; }
.results .row-sub mark, .prose mark { background: var(--todo-bg); color: inherit; border-radius: 4px; padding: 0 2px; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; }

/* ===== Экран раздела ===== */
.cover {
  position: relative; overflow: hidden;
  background: var(--green); color: #fff;
  border-radius: 22px; padding: 22px 20px 20px; margin-bottom: 18px;
  min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end;
}
.cover::before {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 170px; height: 170px; border-radius: 50%; background: var(--pink);
}
.cover::after {
  content: ""; position: absolute; right: 70px; top: 86px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-2); opacity: 0.9;
}
.cover .cover-icon { position: absolute; right: 22px; top: 22px; width: 64px; height: 64px; color: #fff; stroke-width: 1.4; }
.cover .cover-num {
  font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9;
}
.cover h1 { margin-top: 6px; max-width: 78%; }
.cover p { margin: 8px 0 0; opacity: 0.92; font-size: 0.95rem; }

/* ===== Экран текста ===== */
.crumb {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--pink-ink); font-weight: 700; font-size: 0.85rem; text-decoration: none;
}
.screen-head { margin-bottom: 16px; }
.screen-head h1 { margin-top: 2px; }
.prose {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px 6px;
}
.part + .part { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.part > h2 { margin-bottom: 14px; color: var(--green); }
.prose ul, .prose ol { margin: 0 0 1em; padding: 0; list-style: none; }
.prose ul > li { position: relative; padding-left: 22px; margin-bottom: 0.6em; }
.prose ul > li::before {
  content: ""; position: absolute; left: 4px; top: 0.62em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--pink);
}
.prose li strong.lead { color: var(--green); }

/* Шаги в кружках */
.prose ol.steps { counter-reset: step; }
.prose ol.steps > li {
  counter-increment: step; position: relative;
  padding-left: calc(2.1rem + 12px); margin-bottom: 0.9em; min-height: 2.1rem;
}
.prose ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.05em;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center;
  font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 0.9rem;
}

/* Цены-чипы */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1em; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 14px;
  border-radius: 999px; background: var(--green-soft); color: var(--green);
  font-weight: 700; line-height: 1.3;
}
.chip .chip-label { font-weight: 600; color: var(--muted); }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 8px; margin: 0 0 1em; }
.chip-grid .chip { border-radius: var(--radius-sm); justify-content: center; text-align: center; }

/* Плашки */
.callout {
  border-radius: var(--radius-sm); padding: 14px 16px 4px; margin: 0 0 1em;
  display: grid; grid-template-columns: auto 1fr; gap: 0 12px;
}
.callout > .icon { margin-top: 0.15em; }
.callout-body { min-width: 0; }
.callout-warn { background: var(--pink-soft); }
.callout-warn > .icon { color: var(--pink-ink); }
.callout-plus { background: var(--green-soft); }
.callout-plus > .icon { color: var(--green); }
.callout-info { background: var(--bg-2); }
.callout-info > .icon { color: var(--green); }
.callout .lead-word { font-weight: 700; }
.callout-warn .lead-word { color: var(--pink-ink); }
.callout ul > li::before { background: var(--pink-ink); }
.minus {
  display: block; margin-top: 6px; padding: 8px 12px; border-radius: 10px;
  background: var(--pink-soft); font-size: 0.94em;
}
.minus b { color: var(--pink-ink); }

/* Метка «нужно уточнить» */
.todo {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  background: var(--todo-bg); color: var(--todo-ink);
  border-radius: 8px; padding: 2px 10px 2px 8px; margin: 2px 0;
  font-size: 0.82em; font-weight: 700; line-height: 1.5;
}
.todo::before {
  content: "!"; display: inline-grid; place-items: center;
  width: 1.2em; height: 1.2em; border-radius: 50%;
  background: var(--todo-ink); color: var(--todo-bg); font-size: 0.85em;
}
.todo-block { display: flex; width: fit-content; max-width: 100%; margin: 0 0 1em; }

/* Ссылки и кнопки в тексте */
.link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; vertical-align: middle;
  color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.link .icon { width: 16px; height: 16px; }
.call {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  min-height: 44px; padding: 4px 14px; margin: 2px 0;
  border-radius: 999px; background: var(--green-soft); color: var(--green);
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.call .icon { width: 18px; height: 18px; }
.call:active { background: #d6e4d8; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 18px; border-radius: 14px;
  border: 1.5px solid transparent; text-decoration: none; font-weight: 700; line-height: 1.25;
  text-align: center;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:active { background: var(--green-press); }
.btn-pink { background: var(--pink); color: #fff; }
.btn-outline { background: var(--bg); color: var(--green); border-color: var(--green); }
.btn-outline:active { background: var(--green-soft); }
.btn-block { width: 100%; }
.btn-map {
  justify-content: flex-start; text-align: left;
  background: var(--bg-2); color: var(--text); border-color: var(--line);
  max-width: 100%;
}
.btn-map .icon { color: var(--pink); }
.btn-map span { display: flex; flex-direction: column; min-width: 0; }
.btn-map small { font-weight: 600; color: var(--muted); font-size: 0.85em; overflow-wrap: anywhere; }
.btn-map:active { background: var(--green-soft); }
.btn-call { justify-content: flex-start; text-align: left; background: var(--green-soft); color: var(--green); }
.btn-call span { display: flex; flex-direction: column; }
.btn-call small { font-weight: 700; font-size: 0.85em; white-space: nowrap; }
.btn-call:active { background: #d6e4d8; }

/* Важные номера — крупные кнопки */
.call-list { display: grid; gap: 12px; margin: 0 0 1em; }
.call-item { background: var(--bg-2); border-radius: var(--radius-sm); padding: 14px; }
.call-item .call-label { font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.call-item .call-label small { display: block; font-weight: 500; color: var(--muted); }
.call-item .btn { width: 100%; min-height: 60px; font-size: 1.05rem; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }

/* Промокод */
.promo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  border: 2px dashed var(--pink); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 0 0 1em; background: var(--bg);
}
.promo-info { flex: 1 1 10rem; min-width: 0; }
.promo-label { display: block; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.promo-code { font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 1.3rem; color: var(--pink-ink); letter-spacing: 0.04em; }
.promo-note { display: block; font-size: 0.9rem; }

/* Чек-лист */
.checklist { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.checklist label {
  display: flex; align-items: flex-start; gap: 14px; cursor: pointer;
  min-height: 56px; padding: 14px; border-radius: var(--radius-sm); background: var(--bg-2);
}
.checklist input {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 28px; height: 28px; margin: 0; border-radius: 8px;
  border: 2px solid var(--green); background: var(--bg);
  display: grid; place-items: center;
}
.checklist input:checked { background: var(--green); }
.checklist input:checked::after {
  content: ""; width: 8px; height: 14px; margin-top: -3px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.checklist label > span { min-width: 0; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--green); }
.checklist .count { font-weight: 700; color: var(--green); }

/* Калькулятор */
.calc { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.calc-field { display: block; margin-bottom: 12px; }
.calc-field span { display: block; font-weight: 700; margin-bottom: 6px; }
.calc-field input {
  width: 100%; min-height: 58px; padding: 10px 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg-2);
  font-family: "Unbounded", sans-serif; font-weight: 600; font-size: max(16px, 1.15rem);
}
.calc-field input:focus { outline: none; border-color: var(--green); background: var(--bg); }
.calc-swap { display: flex; justify-content: center; color: var(--muted); margin: -4px 0 6px; }
.calc-meta { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; line-height: 1.5; }
.prose .calc { margin: 0 0 1em; background: var(--bg-2); border: 0; }
.calc-meta strong { color: var(--text); }
.calc-custom { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.calc-custom .calc-field input { font-size: max(16px, 1rem); min-height: 52px; }
.calc-custom .calc-field input::placeholder { font-family: "Manrope", sans-serif; font-weight: 500; color: var(--muted); }
.calc-note { color: var(--muted); font-size: 0.8rem; line-height: 1.5; margin: 14px 0 0; }
.calc-source { font-size: 0.8rem; }

/* Заметки */
.note-box { margin-top: 16px; }
.note-text {
  width: 100%; min-height: 9rem; padding: 14px 16px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg);
  line-height: 1.55; font-size: max(16px, 1rem);
}
.note-text:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.notes-big { min-height: 55vh; }
.note-saved { color: var(--muted); font-size: 0.8rem; min-height: 1.4em; margin: 6px 4px 0; }
/* Подзаголовки внутри экрана и кнопки в тексте */
.prose h3.sub { font-size: 1rem; color: var(--green); margin: 1.4em 0 0.6em; }
.prose h3.sub:first-child { margin-top: 0; }
.btn-stack { display: grid; gap: 10px; margin: 0 0 1em; }
.btn-wa { background: #1F7A45; color: #fff; justify-content: center; }
.btn-wa:active { background: #17603A; }
.btn-wa .icon { width: 22px; height: 22px; }
.btn-link-out .icon { width: 18px; height: 18px; }
.callout-body > p:last-child { margin-bottom: 0.85em; }

/* Копия заметок */
.linkish {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px;
  border: 0; background: none; color: var(--green); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; font-size: inherit;
}
.note-saved .linkish { font-size: 0.8rem; }
.backup-reminder {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 14px; margin: 0 0 12px; font-size: 0.9rem; line-height: 1.4;
}
.backup-reminder .icon { color: var(--green); width: 20px; height: 20px; }
.note-box .backup-reminder { margin: 10px 0 0; }
[data-backup-box] + .restore-msg, [data-backup-box] { margin-bottom: 14px; }
.note-box [data-backup-box] { margin-bottom: 0; }
.copy-panel { margin-top: 12px; padding: 14px; background: var(--bg-2); border-radius: var(--radius-sm); }
.copy-panel p { margin: 0 0 10px; font-size: 0.92rem; }
.copy-text { min-height: 8rem; margin-top: 10px; font-size: 14px; }
.copy-panel-more { margin-top: 10px; }
.copy-panel-more summary, .restore summary { list-style: none; cursor: pointer; }
.copy-panel-more summary::-webkit-details-marker, .restore summary::-webkit-details-marker { display: none; }
.copy-panel-more summary {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; font-size: 0.9rem;
}
.restore { margin-top: 28px; }
.btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 600; }
.restore[open] .btn-quiet { color: var(--text); }
.restore-body { padding: 14px 2px 0; display: grid; gap: 10px; }
.restore-body p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.restore-label { font-weight: 700; font-size: 0.92rem; }
.file-btn { position: relative; cursor: pointer; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.restore-msg { border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px; font-weight: 600; }
.restore-ok { background: var(--green-soft); color: var(--green); }
.restore-err { background: var(--pink-soft); color: var(--pink-ink); }
.note-box .callout, [data-note-edit] .callout { margin: 0 0 10px; }
.note-show {
  background: #FFF8E0; border: 1px solid #F1DF9E; border-radius: var(--radius-sm);
  padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 10px;
}
.note-show b { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }

/* Перекрёстные ссылки, навигация, подпись */
.see-also { display: flex; align-items: center; gap: 12px; margin-top: 14px; background: var(--bg); }
.see-also .icon { color: var(--pink); }
.disclaimer { color: var(--muted); font-size: 0.8rem; margin: 14px 4px 0; line-height: 1.5; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.pager a {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 72px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); text-decoration: none; color: var(--text);
}
.pager a:active { background: var(--green-soft); }
.pager .dir { font-weight: 700; color: var(--green); }
.pager .ttl { font-size: 0.8rem; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.pager .next { text-align: right; grid-column: 2; }
.access-line { color: #6B706C; font-size: 0.75rem; text-align: center; margin: 22px 0 0; }

@media (max-width: 440px) {
  html[data-fs="l"] .pager, html[data-fs="xl"] .pager { grid-template-columns: 1fr; }
  html[data-fs="l"] .pager .next, html[data-fs="xl"] .pager .next { grid-column: 1; }
}

/* Об авторе */
.about { text-align: center; }
.about h1 { margin-bottom: 12px; }
.about .bio { margin: 0 auto 18px; }
.about .links { display: grid; gap: 10px; text-align: left; }
.about .links .btn { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
.about .links .todo { margin-left: auto; font-size: 0.75em; white-space: nowrap; }
.about .plea { color: var(--muted); font-size: 0.85rem; margin: 22px 8px 0; line-height: 1.5; }

/* ===== Вход ===== */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 460px; margin: 0 auto;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  background: var(--bg-2);
}
.login-mark {
  width: 72px; height: 72px; border-radius: 20px; background: var(--green); color: #fff;
  display: grid; place-items: center; margin-bottom: 22px;
  font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 34px;
}
.login h1 { font-size: min(calc(0.9rem + 10px), 8.6vw); }
.login .lead { color: var(--muted); margin: 10px 0 24px; }
.login label { display: block; font-weight: 700; margin-bottom: 8px; }
.login input {
  width: 100%; min-height: 58px; padding: 12px 16px; margin-bottom: 12px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg);
  font-size: max(16px, 1rem);
}
.login input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.login .error { color: var(--pink-ink); font-weight: 700; min-height: 1.6em; margin: 0 0 8px; }
.login .fine { color: var(--muted); font-size: 0.75rem; line-height: 1.5; margin-top: 28px; }

/* ===== Нижняя панель «Аа», подсказки, плашки ===== */
.backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(31, 36, 33, 0.45);
  opacity: 0; transition: opacity 0.2s;
}
.backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 680px; margin: 0 auto;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(18px + var(--safe-bottom));
  transform: translateY(100%); transition: transform 0.25s ease;
}
.sheet.open { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2 { font-size: 18px; }
.sheet-head .icon-btn { color: var(--text); }
.fs-options { display: grid; gap: 10px; }
.fs-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 64px; padding: 10px 16px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg);
  font-weight: 700; font-size: 17px;
}
.fs-option .sample { font-family: "Unbounded", sans-serif; color: var(--green); }
.fs-option[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 700; font-size: 16px; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.bottom-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); z-index: 30;
  max-width: 656px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  background: var(--green); color: #fff; border-radius: var(--radius);
  padding: 10px 10px 10px 18px; font-weight: 700; font-size: 17px;
}
.bottom-bar .grow { flex: 1; }
.bottom-bar .btn { min-height: 48px; background: #fff; color: var(--green); }

.install {
  position: relative; margin-top: 14px;
  background: var(--bg); border: 1.5px solid var(--green); border-radius: var(--radius);
  padding: 16px 52px 16px 16px;
}
.install b { display: block; margin-bottom: 4px; }
.install p { margin: 0; font-size: 0.92rem; }
.install .icon-btn { position: absolute; right: 2px; top: 2px; color: var(--muted); }
.install .inline-icon { width: 20px; height: 20px; vertical-align: -4px; color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  .sheet, .backdrop, .toast { transition: none; }
}
