/* Общая оболочка сайта В1 (W05): токены и вид шапки, подвала, S10, 404 — из принятого прототипа С2 (css/site.css). */
:root {
  color-scheme: light;
  --ui: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Armenian', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: ui-serif, 'New York', 'Iowan Old Style', Palatino, Georgia, serif;
  --gutter: clamp(16px, 4.5vw, 40px);
  --wrap: 1200px;
  /* витрина (meowgli.app, «День») */
  --bg: #faf3e1;
  --card: #fffaf0;
  --edge: #e5d2a4;
  --text: #24402f;
  --muted: #51675a;
  --link: #2c6944;
  --band: #203b2f;
  --on-band: #fbf3df;
  --on-band-soft: #c9d9c6;
  --frame: #fff4d6;
  --chip: #ffe27a;
  --on-chip: #4a3423;
  --soon-bg: #f3e6c6;
  --soon: #6b4f17;
  --off-bg: #ece6d8;
  --off: #5b5a52;
  --focus: #9a4700;
  --focus-on-band: #ffe27a;
  --scrim: rgba(18, 31, 24, 0.5);
  /* читалка («День», pilot.css) */
  --panel-1: #fff9ea;
  --panel-2: #fcf0d6;
  --panel-lip: #efdbb0;
  --panel-hi: rgba(255, 255, 255, 0.85);
  --ink: #24402f;
  --head: #2c6944;
  --ink-soft: #546a5b;
  --btn-1: #fffbf1;
  --btn-2: #f6e4c0;
  --btn-lip: #e4c790;
  --btn-hi: rgba(255, 255, 255, 0.92);
  --shadow: rgba(52, 34, 8, 0.5);
  --spec: rgba(255, 255, 255, 0.95);
  --go-1: #55a374; /* читалка #5aa878; на тон темнее — белый текст ≥ 3:1 у верхнего края */
  --go-2: #327d57;
  --go-3: #256546;
  --go-rim: #1b4a33;
  --go-lip: #1f553b;
  --go-edge: #163d2a;
  --go-glow: rgba(20, 60, 38, 0.5);
  --go-spec: rgba(235, 255, 240, 0.8);
  --rim: #efdfb6;
  --icon: #31563d;
  --word-on: #ffe27a;
  --apple-2: #e5503b;
  --apple-rim: #a82e1e;
  --leaf: #6aa83a;
  /* движение: N-FEEL — переход витрины 180 мс, листание 240 мс, reduce-motion 0 */
  --t-view: 180ms;
  --t-turn: 240ms;
  /* безопасные зоны: env() на устройстве, ?sa= в снимках */
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);
}
/* тёмная тема витрины — значения world.css; читалка остаётся в своей теме «День» */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #14241c; --card: #1c3227; --edge: #325240; --text: #f1e8d0; --muted: #b8c9b9; --link: #e6c07f;
    --band: #0f1f17; --on-band: #f6eed8; --on-band-soft: #bdd0be; --frame: #e9dcbc;
    --soon-bg: #3a3420; --soon: #f0d590; --off-bg: #2b332d; --off: #c9cdc4; --focus: #ffbf78;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14241c; --card: #1c3227; --edge: #325240; --text: #f1e8d0; --muted: #b8c9b9; --link: #e6c07f;
  --band: #0f1f17; --on-band: #f6eed8; --on-band-soft: #bdd0be; --frame: #e9dcbc;
  --soon-bg: #3a3420; --soon: #f0d590; --off-bg: #2b332d; --off: #c9cdc4; --focus: #ffbf78;
}
@media (prefers-reduced-motion: reduce) {
  :root { --t-view: 0ms; --t-turn: 0ms; }
}
:root.rm { --t-view: 0ms; --t-turn: 0ms; }

* { box-sizing: border-box; }
html { background: var(--band); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.55 var(--ui);
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a, input, select, summary, [tabindex] { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -90px; z-index: 50; padding: 12px 18px; border-radius: 12px; background: var(--card); color: var(--text); font-weight: 700; }
.skip:focus { top: 10px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.015em; }
p { margin: 0; }

/* вид страницы: смена ≈180 мс, без анимации при reduce-motion */
/* сдвиг только у витрины: transform на #app сделал бы его рамкой для fixed-читалки */
.view { animation: view-in var(--t-view) ease-out both; }
.view-fade { animation: fade-in var(--t-view) ease-out both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- шапка (S01-N) ---------- */
.top { background: var(--band); color: var(--on-band); padding-top: var(--sa-t); }
.top-in { display: flex; align-items: center; gap: 6px; min-height: 72px; }
.brand { margin-right: auto; display: inline-flex; align-items: center; min-height: 48px; color: var(--on-band); font-weight: 800; font-size: 1.32rem; letter-spacing: -0.01em; text-decoration: none; }
.top-link { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 999px; color: var(--on-band); font-weight: 700; font-size: 1rem; text-decoration: none; }
.top-link:hover { background: rgba(251, 243, 223, 0.12); }
.top-link[aria-current='page'] { background: rgba(251, 243, 223, 0.16); }
.top :focus-visible, .hero :focus-visible { outline-color: var(--focus-on-band); }
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px 0 18px; border: 0; border-radius: 999px; background: var(--on-band); color: var(--band); font-weight: 800; font-size: 1rem; }
.lang-btn svg { width: 16px; height: 16px; }
.lang-btn .long { display: none; }
.lang-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 270px; padding: 8px; border-radius: 20px; background: var(--card); color: var(--text); box-shadow: 0 0 0 1.5px var(--edge), 0 22px 44px -18px rgba(0, 0, 0, 0.55); }
.lang-pop[hidden] { display: none; }
.lang-pop a { text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 48px; padding: 6px 14px; border: 0; border-radius: 14px; background: none; text-align: left; font-weight: 700; }
.lang-pop a[aria-current='true'] { background: var(--band); color: var(--on-band); }
.lang-pop small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.lang-pop a:not([aria-disabled='true']):not([aria-current='true']):hover { background: rgba(44, 105, 68, 0.1); }
.btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--band); color: var(--on-band); font-weight: 800; font-size: 1.05rem; text-decoration: none; }
.btn-line svg { width: 20px; height: 20px; }
.btn-line:active { transform: translateY(1px); }
.btn-soft { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 20px; border-radius: 999px; border: 0; background: transparent; color: var(--link); font-weight: 800; font-size: 1.05rem; text-decoration: none; box-shadow: inset 0 0 0 2px var(--edge); }
.btn-soft svg { width: 20px; height: 20px; }
.btn-soft:active { transform: translateY(1px); }
.foot { margin-top: 44px; padding: 22px 0 calc(28px + var(--sa-b)); border-top: 1.5px solid var(--edge); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.foot a, .foot .muted-ico { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 10px; border-radius: 12px; color: var(--text); font-weight: 600; text-decoration: none; }
.foot a:hover { background: rgba(44, 105, 68, 0.08); }
.foot .world { margin-right: auto; padding-left: 0; }
.foot svg { width: 22px; height: 22px; }
.foot .muted-ico { color: var(--muted); opacity: 0.55; padding: 0 6px; cursor: default; }
[tabindex='-1']:focus, [tabindex='-1']:focus-visible { outline: none; }
html:not(.kbd) :focus-visible { outline: none; }

/* ---------- каркас страницы ---------- */
.s-main { min-height: 0; }
.page-ph { padding: 40px 0 8px; }
.page-ph h1 { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 800; }

/* ---------- S10 в контексте (вид — «notice» прототипа; цели 56 px, зазор 8+ — решение 9) ---------- */
.notice { display: grid; gap: 12px; justify-items: start; padding: 20px 22px; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1.5px var(--edge); }
.notice p { color: var(--muted); font-weight: 600; }
.notice .row { display: flex; flex-wrap: wrap; gap: 10px; }
.notice h2 { font-size: 1.2rem; }
.notice[data-mb-s10] { margin: 24px 0 0; }
.notice .row { gap: 10px; }
.notice [data-mb-s10-retry][aria-busy='true'] { opacity: 0.6; cursor: progress; }
.mb-loading { margin: 24px 0 0; color: var(--muted); font-weight: 600; }
.mb-probe { padding: 28px 0 0; }
.mb-probe-ok { margin: 0; color: var(--muted); font-weight: 600; }

/* ---------- 404 ---------- */
.page404 { padding: 48px 0 24px; display: grid; gap: 14px; justify-items: start; }
.page404 h1 { font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 800; }
.page404 p { color: var(--muted); font-weight: 600; font-size: 1.1rem; }
.page404 .row { display: flex; flex-wrap: wrap; gap: 10px; }

[hidden] { display: none !important; }
@media (max-width: 699px) {
  .top-in { min-height: 60px; }
  .brand { font-size: 1.15rem; }
  .top-link { padding: 0 10px; }
}
@media (min-width: 700px) {
  .lang-btn .short { display: none; }
  .lang-btn .long { display: inline; }
}
