/* UBERAPP — «Гравитация»: пространственный интерфейс 2026/27.
   Слои облаков, парение, латунь/медь и антигравитационные переходы.
   Всё локально: градиенты и CSS-фильтры, ни одного внешнего URL (GR-005).
   Q-011 / R4: Sci-Fi + western comics + дизельпанк. */

:root,
html[data-theme="dark"] {
  --bg: #080d18;
  --bg-2: #0b1426;
  --txt: #f3f7ff;
  --ink: #f3f7ff;
  --mut: #b9c9e2;
  --a: #5ad1ff;
  --b: #ffb35a;
  --g: #8affc1;
  --brass: #e8bf78;
  --brass-deep: #c98b3d;
  --copper: #dc8c5c;
  --panel: rgba(17, 27, 47, .74);
  --panel-solid: #111c30;
  --panel-hi: rgba(232, 191, 120, .08);
  --line: rgba(168, 200, 255, .18);
  --line-hi: rgba(90, 209, 255, .62);
  --edge: rgba(232, 191, 120, .26);
  --danger: #ff7e88;
  --shadow: 0 24px 60px rgba(0, 0, 0, .38);
  --depth-1: 0 6px 14px rgba(0, 0, 0, .3);
  --depth-2: 0 18px 44px rgba(0, 0, 0, .38);
  --depth-3: 0 28px 60px rgba(0, 0, 0, .5);
  --rim: inset 0 1px 0 rgba(232, 191, 120, .18);
  --glow-sm: 0 0 8px rgba(90, 209, 255, .35);
  --glow-md: 0 0 18px rgba(255, 179, 90, .28);
  --veil: rgba(8, 13, 24, .58); /* T-0226: канон .58 (было .55), порог α≥0.55 */
  --radius: 20px;
  --space: 18px;
  /* T-0226 · Liquid Cloud — канонические токены материала (6 осей).
     --lc-veil/--lc-blur/--lc-specular не переопределяются светлыми темами:
     завеса — приём (тёмная), а не цвет темы. --lc-plate — своя у каждой темы. */
  --lc-veil: rgba(8, 13, 24, .58);                 /* L2 ≥0.55 */
  --lc-plate: rgba(18, 28, 47, .94);               /* L3 ≥0.92 */
  --lc-blur: 8px;                                  /* L2 blur 6–14px */
  --lc-specular: linear-gradient(90deg, transparent, var(--brass), var(--a), transparent); /* L4 край */
  --lc-edge-strong: rgba(232, 191, 120, .58);          /* L4 индикатор ≥3:1 (SC 1.4.11) */
  /* T-0227/T-0291 · Motion Grammar — единый словарь движения Liquid Cloud.
     Источник: motion-grammar.md §2.1/§2.2, liquid-cloud-spec.md §3.6/§5.2/§6,
     morph-transitions.md §4/§7. Каноническая кривая .2,.8,.2,1 — одна на всё
     семантическое движение: T1 подсказка/cursor, T2 шторка, T3 split/VT.
     --lc-ease-lift (.16,1,.3,1) остаётся только у декоративного подъёма плит,
     кнопок и каскада (не семантика). Тайминги — единственные разрешённые
     значения для своих ролей; фон (30–80 s) живёт отдельно и под reduce стопорится. */
  --lc-ease-lift: cubic-bezier(.16, 1, .3, 1);   /* декор: кнопки, плиты, каскад */
  --lc-ease-morph: cubic-bezier(.2, .8, .2, 1);  /* канон: T1 подсказка/cursor, T2 шторка, T3 split/VT/диагональ */
  --lc-dur-tap: 160ms;      /* 140–180 мс: кнопка/beam/подсказка/cursor-follow */
  --lc-dur-ui: 280ms;       /* 250–350 мс: обычный переход состояния */
  --lc-dur-shade: 220ms;    /* шторка (spec §3.6) */
  --lc-dur-morph: 280ms;    /* 220–380 мс: VT/split; диагональ не получает своей модности */
  --lc-dur-lift: 450ms;     /* 450–700 мс: парение плиты при наведении */
  --lc-dur-float: 600ms;    /* 450–700 мс: вход плиты/каскад */
  --lc-dur-progress: 700ms; /* кончик прогресса */
  --lc-delay-step: 60ms;    /* каскад .06/.12/.18 s */
  --lc-dur-cursor: 160ms;   /* отклик у курсора = tap; только декоративный слой */
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f6fc;
  --bg-2: #e8eef8;
  --txt: #162338;
  --ink: #162338;
  --mut: #4a5f7c;
  --a: #0f6fa8;
  /* T-0233: тёплый мезий был 4.36:1 на --bg-2 (ниже AA). */
  --b: #9b560c;
  --g: #127a52;
  --brass: #8a5a1e;
  --brass-deep: #a86a1b;
  --copper: #a3522b;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #ffffff;
  --panel-hi: rgba(138, 90, 30, .07);
  --line: rgba(28, 62, 106, .2);
  --line-hi: rgba(15, 111, 168, .6);
  --edge: rgba(138, 90, 30, .32);
  --danger: #bb2f3d;
  --shadow: 0 18px 44px rgba(30, 55, 95, .16);
  /* T-0233: светлая тема больше не наследует тёмные тени/свечения. */
  --depth-1: 0 6px 14px rgba(30, 55, 95, .12);
  --depth-2: 0 18px 44px rgba(30, 55, 95, .16);
  --depth-3: 0 28px 60px rgba(30, 55, 95, .2);
  --rim: inset 0 1px 0 rgba(138, 90, 30, .26);
  --glow-sm: 0 0 8px rgba(15, 111, 168, .22);
  --glow-md: 0 0 18px rgba(155, 86, 12, .2);
  --veil: rgba(243, 246, 252, .62); /* T-0233: сохранён без регресса */
  --lc-plate: #ffffff; /* T-0226 L3: сплошная плита, α=1 ≥0.92 */
  --lc-edge-strong: #a86a1b; /* L4 индикатор ≥3:1 на светлом фоне */
  color-scheme: light;
}

html[data-theme="sepia"] {
  --bg: #f0e7d5;
  --bg-2: #e5d8be;
  --txt: #3b2d1b;
  --ink: #3b2d1b;
  /* T-0233: мета/холод/новое знание подняты с 3.80–4.20:1 до ≥4.8:1. */
  --mut: #6b583f;
  --a: #854d16;
  --b: #8a4318;
  --g: #3d6335;
  --brass: #7d531f;
  --brass-deep: #9a6322;
  --copper: #9d522d;
  --panel: rgba(255, 250, 238, .88);
  --panel-solid: #fff9ec;
  --panel-hi: rgba(126, 84, 32, .08);
  --line: rgba(110, 78, 40, .25);
  --line-hi: rgba(150, 96, 38, .62);
  --edge: rgba(126, 84, 32, .35);
  --danger: #a23535;
  --shadow: 0 18px 40px rgba(86, 62, 27, .18);
  /* T-0233: сепия — тёплая, но не «грязная» глубина. */
  --depth-1: 0 6px 14px rgba(86, 62, 27, .12);
  --depth-2: 0 18px 40px rgba(86, 62, 27, .18);
  --depth-3: 0 28px 56px rgba(86, 62, 27, .22);
  --rim: inset 0 1px 0 rgba(126, 84, 32, .3);
  --glow-sm: 0 0 8px rgba(133, 77, 22, .2);
  --glow-md: 0 0 18px rgba(138, 67, 24, .18);
  --veil: rgba(240, 231, 213, .62); /* T-0233: сохранён без регресса */
  --lc-plate: #fff9ec; /* T-0226 L3: сплошная плита, α=1 ≥0.92 */
  --lc-edge-strong: #9a6322; /* L4 индикатор ≥3:1 на сепии */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--txt);
  background:
    radial-gradient(1100px 720px at 82% -14%, rgba(90, 209, 255, .12), transparent 64%),
    radial-gradient(760px 540px at 4% 12%, rgba(232, 191, 120, .1), transparent 62%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 52%);
  font: 15px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Атмосфера: чистый воздух L0 (T-0380) ──────────────────────────────── */
/* T-0380: наследие T-0226 (blur 46/16/18px, cloudDrift, meziumPulse,
   orbitTurn) снято по spec T-0358 §4.2/§4.3: L0 — только градиенты, 0 blur,
   0 бесконечных декоративных анимаций. hero-clouds.png остаётся локальным
   ассетом, но рисуется без фильтра; дымка живёт только в L4 внутри VT. */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky i { position: absolute; display: block; border-radius: 50%; }
/* T-0477: убрана высокочастотная 1px-штриховка `.30` из ГЛОБАЛЬНОГО плейсхолдера:
   она жила на всех 24 view (T-0463 убрал её только из ZC-копии в main.js) и
   пересекала текст до 93 407.6 px² (legal, 390×844). Остаются мягкие
   эллипсы-воспоминания без шума; альфы и цвет не изменены — контраст не падает. */
.sky::after {
  content: ""; position: absolute; pointer-events: none;
  right: 2%; bottom: 2%; width: min(620px, 56vw); height: min(460px, 58vh);
  border-radius: 36px;
  background:
    radial-gradient(ellipse at 26% 28%, rgba(90,209,255,.92), transparent 58%),
    radial-gradient(ellipse at 74% 70%, rgba(255,179,90,.88), transparent 58%),
    radial-gradient(ellipse at 52% 52%, rgba(138,255,193,.22), transparent 62%),
    linear-gradient(135deg, #123a5e 0%, #2a1b4d 55%, #0b1426 100%);
  box-shadow: inset 0 0 0 1px rgba(232,191,120,.10);
}
.sky__cloud {
  width: 78vw; height: 46vw; min-width: 620px; min-height: 360px;
  opacity: .34;
}
.sky__cloud--one {
  top: -18%; left: -12%;
  background: radial-gradient(ellipse at 40% 45%, rgba(232,191,120,.24), rgba(220,140,92,.09) 42%, transparent 72%);
}
.sky__cloud--two {
  top: 32%; right: -22%;
  background:
    linear-gradient(180deg, rgba(8,13,24,.35), rgba(8,13,24,.75)),
    url('../assets/images/hero-clouds.png') center / cover no-repeat;
  opacity: .18;
}
.sky__glow {
  width: 240px; height: 240px; top: 10%; left: 54%;
  background: radial-gradient(circle, rgba(138,255,193,.14), rgba(90,209,255,.06) 40%, transparent 70%);
}
.sky__orbit {
  width: 900px; height: 900px; top: -420px; left: 50%; margin-left: -450px;
  border: 1px solid rgba(232, 191, 120, .07);
  background: none; border-radius: 50%;
  box-shadow: 0 0 0 120px rgba(232,191,120,.018), 0 0 0 260px rgba(90,209,255,.012);
}

@keyframes cloudDrift { from { margin-left: -2%; margin-top: 0; } to { margin-left: 4%; margin-top: 3%; } }
@keyframes meziumPulse { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes orbitTurn { to { transform: rotate(360deg); } }
@keyframes floatUp { from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(.96); } 100% { transform: scale(1); } }
@keyframes shimmer { from { transform: translateX(-110%); } to { transform: translateX(220%); } }
@keyframes toastIn { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes stageOut { to { opacity: 0; transform: translate3d(0, 30px, 0) scale(.98); filter: blur(7px); } }
@keyframes stageIn { from { opacity: 0; transform: translate3d(0, -34px, 0) scale(1.015); filter: blur(8px); } }
@keyframes revealScroll { from { opacity: .45; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--a); }
button, input, select { font: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 8px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 60;
  padding: 10px 16px; background: var(--panel-solid); border: 1px solid var(--brass);
  border-radius: 10px; color: var(--txt); font-size: 14px;
}
.skip-link:focus { left: 8px; }

/* ── Шапка и HUD ───────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8,13,24,.5), rgba(8,13,24,.06));
}
html[data-theme="light"] .topbar,
html[data-theme="sepia"] .topbar { background: var(--panel); }

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand__mark {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--edge); border-radius: 14px;
  color: var(--brass); font-size: 24px;
  background: radial-gradient(circle at 34% 28%, rgba(232,191,120,.3), transparent 62%), var(--panel);
  box-shadow: 0 0 26px rgba(232,191,120,.16), inset 0 1px 0 rgba(255,255,255,.1);
  animation: floatMark 6s ease-in-out infinite;
}
@keyframes floatMark { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
.brand__text { min-width: 0; display: grid; gap: 3px; }
.brand__name {
  font-size: 16px; line-height: 1.25; font-weight: 750;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.brand__tagline { color: var(--mut); font-size: 12px; line-height: 1.35; }

.hud { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-size: 13px; color: var(--mut); background: var(--panel-solid);
  white-space: nowrap;
}
.chip b { color: var(--brass); font-variant-numeric: tabular-nums; font-weight: 700; }
.chip--path { border-color: var(--edge); }
.bar {
  position: relative; height: 9px; width: 186px; max-width: 100%; border-radius: 99px;
  background: rgba(140, 165, 205, .16); overflow: hidden; border: 1px solid var(--line);
}
.bar i {
  display: block; position: relative; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass) 48%, var(--a));
  box-shadow: 0 0 16px rgba(232, 191, 120, .5);
  transition: width var(--lc-dur-progress) var(--lc-ease-lift);
}
.bar i::after {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: shimmer 2.8s ease-in-out infinite;
}

/* ── Навигация-компас: орбита разделов вместо ряда вкладок (T-0085) ────── */
.nav[data-shell="compass"] {
  position: relative; display: block; width: auto; max-width: none; margin: 0 0 0 auto;
  padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none;
  transform: none; flex-wrap: wrap; overflow: visible;
}
.nav[data-shell="compass"]::before { display: none; }
.compass { position: relative; }
.compass > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--edge); border-radius: 12px;
  background: var(--panel-solid); color: var(--brass); font-size: 13px; font-weight: 650;
  box-shadow: var(--depth-1), var(--rim);
  transition: transform var(--lc-dur-ui) var(--lc-ease-lift),
              border-color var(--lc-dur-ui), box-shadow var(--lc-dur-ui);
}
.compass > summary::-webkit-details-marker { display: none; }
.compass > summary:hover {
  transform: translateY(-2px); border-color: var(--brass);
  box-shadow: var(--depth-2), var(--glow-sm);
}
.compass__glyph { font-size: 17px; line-height: 1; }
.compass__veil {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  width: min(560px, calc(100vw - 28px)); padding: 18px;
  border: 1px solid var(--edge); border-radius: 18px;
  background: var(--panel-solid); box-shadow: var(--depth-3), var(--rim);
  animation: riseIn var(--lc-dur-ui) var(--lc-ease-lift) both;
}
.compass__caption { margin: 0 0 12px; color: var(--mut); font-size: 13px; }
.compass__groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compass__group {
  display: grid; gap: 3px; align-content: start; padding: 12px;
  border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025);
}
.compass__group--wide { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compass__group-title {
  margin: 0 0 6px; grid-column: 1 / -1; color: var(--brass);
  font-size: 13px; line-height: 1.45; font-weight: 650;
}
.nav a {
  display: block; text-decoration: none; color: var(--mut); font-size: 14px;
  padding: 10px 10px; border-radius: 9px;
  transition: color var(--lc-dur-ui), background var(--lc-dur-ui),
              transform var(--lc-dur-ui) var(--lc-ease-lift);
}
.nav a:hover { color: var(--txt); background: var(--panel-hi); transform: translateY(-2px); }
.nav a.is-active, .nav a[aria-current="page"] {
  color: var(--brass); background: rgba(232, 191, 120, .12);
  box-shadow: inset 0 0 0 1px var(--edge);
}
.compass__home {
  width: 100%; margin-top: 12px; padding-top: 12px !important;
  border-top: 1px dashed var(--line); color: var(--brass) !important;
}
.is-pop { animation: pop .3s ease-out; }

/* ── Контент ───────────────────────────────────────────────────────────── */
.view {
  flex: 1; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 26px 24px 40px;
  view-transition-name: stage;
}
.view:focus { outline: none; }
.view-head { margin: 0 0 24px; animation: riseIn var(--lc-dur-float) var(--lc-ease-lift) both; }
.view-head .eyebrow { color: var(--brass); margin-bottom: 8px; }
.view-head h1 {
  font-size: clamp(27px, 3vw, 38px); line-height: 1.15; letter-spacing: -.025em;
  font-weight: 750; margin: 0 0 10px;
}
.view-head h1 em { color: var(--brass); font-style: normal; }
.lead { color: var(--mut); font-size: 16px; line-height: 1.7; max-width: 68ch; margin: 0; }
.view-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; }

/* Читатель прокручивает текст внутри .ub-reader__viewport, а не всей страницей. */
#app.is-reader { height: 100vh; min-height: 0; }
#app.is-reader #view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#app.is-reader #view > .ub-reader { flex: 1 1 auto; height: auto; min-height: 0; }

.grid-3 {
  display: grid; gap: 18px; align-items: start;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr) minmax(0, 1fr);
}
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card--wide { grid-column: 1 / -1; min-height: auto; }

/* Сцена + сателлиты: один главный акцент вместо «дашборда из квадратов». */
.hub-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr); align-items: start; }
.hub-scene { min-width: 0; }
.hub-scene .card { box-shadow: var(--depth-3), var(--rim); }
.hub-satellites { display: grid; gap: 18px; min-width: 0; }
.hub-satellites .card { animation-delay: calc(var(--lc-delay-step) * 1.5); }

.card {
  position: relative; min-width: 0; min-height: auto;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015) 44%), var(--panel-solid);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--depth-2), var(--rim);
  background-blend-mode: normal;
  transform-style: preserve-3d;
  transition: transform var(--lc-dur-lift) var(--lc-ease-lift),
              border-color var(--lc-dur-ui), box-shadow var(--lc-dur-lift);
  animation: floatUp var(--lc-dur-float) var(--lc-ease-lift) both;
}
/* T-0227: каскад — одна ступень --lc-delay-step, а не три «магических» числа. */
.card:nth-child(2) { animation-delay: var(--lc-delay-step); }
.card:nth-child(3) { animation-delay: calc(var(--lc-delay-step) * 2); }
.card:nth-child(4) { animation-delay: calc(var(--lc-delay-step) * 3); }
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, var(--brass), var(--a), transparent);
  opacity: .8;
}
.card:hover {
  transform: perspective(1000px) rotateX(1.4deg) translateY(-6px);
  border-color: var(--edge);
  box-shadow: var(--depth-3), var(--rim);
}
.card h2 { margin: 0 0 6px; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
.card h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.35; }
.eyebrow {
  display: block; margin-bottom: 10px; color: var(--brass);
  font-size: 13px; line-height: 1.5; font-weight: 600;
}
.sub { color: var(--mut); font-size: 14px; line-height: 1.65; }
.muted { color: var(--mut); }
.tiny { font-size: 12px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.hero { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hero h2 { font-size: 21px; }
.hero .sub { font-size: 14px; }

/* ── Кнопки ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--txt);
  border-radius: 12px; padding: 11px 17px; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform var(--lc-dur-ui) var(--lc-ease-lift),
              border-color var(--lc-dur-ui), background var(--lc-dur-ui),
              box-shadow var(--lc-dur-ui);
}
.btn:hover { border-color: var(--edge); background: var(--panel-hi); transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn--primary {
  border-color: var(--brass-deep); color: #1c1710;
  background: linear-gradient(135deg, #f3d497, var(--brass) 55%, var(--brass-deep));
  box-shadow: 0 10px 26px rgba(201,139,61,.24), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn--primary:hover { background: linear-gradient(135deg, #f8e0ad, var(--brass) 55%, #d29646); box-shadow: 0 16px 34px rgba(201,139,61,.32); }
html[data-theme="light"] .btn--primary,
html[data-theme="sepia"] .btn--primary { color: #241a0c; }
.btn--danger { border-color: rgba(255,126,136,.45); color: var(--danger, #ff7e88); }
.btn--danger:hover { background: rgba(255,126,136,.1); border-color: #ff7e88; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Пустые состояния ──────────────────────────────────────────────────── */
.empty-state {
  display: grid; justify-items: start; gap: 10px;
  border: 1px dashed var(--edge); border-radius: 16px; padding: 28px 24px;
  background: radial-gradient(circle at 92% 8%, rgba(232,191,120,.07), transparent 55%), var(--panel);
  animation: riseIn .5s ease both;
}
.empty-state__icon {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--edge); color: var(--brass); font-size: 20px;
  box-shadow: 0 0 24px rgba(232,191,120,.18);
}
.empty-state h3 { margin: 0; font-size: 17px; }
.empty-state p { margin: 0; max-width: 56ch; color: var(--mut); font-size: 14px; line-height: 1.65; }

/* ── Карта вселенной: две рельсы ───────────────────────────────────────── */
.rail { margin-bottom: 22px; }
.rail__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rail__head b { font-size: 15px; color: var(--brass); }
.rail--b .rail__head b { color: var(--copper); }
.rail__years { font-size: 13px; color: var(--mut); }
.rail__track {
  position: relative; padding: 6px 0 6px 18px;
  border-left: 2px solid var(--edge); display: grid; gap: 8px;
}
.rail__track::before {
  content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brass); box-shadow: 0 0 16px var(--brass);
}
.rail--b .rail__track::before { background: var(--copper); box-shadow: 0 0 16px var(--copper); }
.rail-item { display: grid; gap: 5px; min-width: 0; }
.lore-slot { min-width: 0; }
.rail-note {
  margin-top: 8px; font-size: 13px; color: var(--mut);
  border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px;
}
.rail-note b { color: var(--brass); font-variant-numeric: tabular-nums; }

.episode, .rail-node {
  display: flex; gap: 12px; align-items: center; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255,255,255,.025); cursor: pointer;
  transition: border-color .25s, transform .35s cubic-bezier(.16,1,.3,1), background .25s, box-shadow .3s;
}
.episode:hover, .rail-node:hover {
  border-color: var(--brass); transform: translateX(4px) translateY(-2px);
  background: var(--panel-hi); box-shadow: var(--depth-2);
}
/* T-0233: прочитанность — цветом точки и обводкой, а не приглушением текста. */
.episode.done, .rail-node.done { cursor: pointer; }
.episode__year, .rail-node__year {
  flex: none; min-width: 46px; padding: 3px 7px; border-radius: 7px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--brass); background: rgba(232,191,120,.1);
}
.rail--a .rail-node__year { color: var(--a); background: rgba(90,209,255,.09); }
.episode__title, .rail-node__title { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.episode__dot, .rail-node__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #46536c; }
.done .episode__dot, .done .rail-node__dot { background: var(--g); box-shadow: 0 0 12px var(--g); }
.entity-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 0; }
.entity-chip {
  border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--mut);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer;
  transition: transform .25s, border-color .25s, color .25s, background .25s;
}
.entity-chip:hover { color: var(--txt); border-color: var(--brass); transform: translateY(-2px); }
.entity-chip.is-found { color: var(--g); border-color: rgba(138,255,193,.4); background: rgba(138,255,193,.06); }
.entity-chip--more { border-style: dashed; }

.levels { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.level {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; color: var(--mut); background: rgba(255,255,255,.025);
}
.level b { color: var(--g); }

/* Профиль: один главный акцент — крупная находка */
.progress-hero { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 14px; }
.progress-hero b {
  font-size: clamp(46px, 6vw, 68px); line-height: 1; font-weight: 780; letter-spacing: -.05em;
  color: var(--brass); text-shadow: 0 0 34px rgba(232,191,120,.28);
}
.progress-hero span { font-size: 15px; color: var(--mut); }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; }
.stat {
  flex: 1 1 130px; display: grid; gap: 2px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025);
}
.stat b { font-size: 22px; color: var(--txt); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--mut); }
.era-row { display: grid; gap: 14px; }
.era-row .sub { display: block; margin-bottom: 6px; font-size: 13px; }

/* ── Подсказки ─────────────────────────────────────────────────────────── */
.rec {
  position: relative; padding: 16px; border-left: 3px solid var(--brass);
  background: linear-gradient(120deg, rgba(232,191,120,.07), rgba(255,255,255,.01));
  border-radius: 0 14px 14px 0; margin-bottom: 12px; font-size: 14px;
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.rec:hover { transform: translateX(4px); box-shadow: var(--depth-2); }
.rec__reason { color: var(--mut); font-size: 13px; line-height: 1.6; margin: 6px 0 0; }
.rec__score { float: right; font-size: 12px; color: var(--mut); }
.rec .btn { margin-top: 12px; }

/* ── Лор-карточка (компактная) ─────────────────────────────────────────── */
.tag {
  display: inline-block; font-size: 12px; border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 10px; color: var(--mut); margin: 0 6px 8px 0;
  background: rgba(255,255,255,.025);
}
.ver {
  border-left: 2px solid var(--brass); padding: 9px 12px; margin: 8px 0;
  background: rgba(255,255,255,.03); font-size: 14px; border-radius: 4px 10px 10px 4px;
}
.ver b { color: var(--brass); font-size: 12px; letter-spacing: .04em; }
.ver .q { color: var(--mut); font-style: italic; margin-top: 5px; }
.link { color: var(--a); font-size: 13px; cursor: pointer; display: block; margin: 5px 0; }

/* ── Достижения и серия дней ───────────────────────────────────────────── */
.achievements { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 6px; }
.ach {
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 14px;
  font-size: 12px; color: var(--mut); background: rgba(255,255,255,.025);
  transition: transform .3s, border-color .3s;
}
.ach:hover { transform: translateY(-3px); }
.ach b { display: block; color: var(--txt); font-size: 14px; margin-bottom: 2px; }
.ach.is-on { border-color: rgba(232,191,120,.55); color: var(--brass); background: rgba(232,191,120,.07); }
.ach.is-on b { color: var(--brass); }
.streak {
  margin-top: 12px; font-size: 13px; color: var(--mut);
  border-top: 1px dashed var(--line); padding-top: 12px;
}
.streak b { color: var(--brass); font-variant-numeric: tabular-nums; }

/* ── Настройки ─────────────────────────────────────────────────────────── */
.settings { max-width: 940px; margin: 0 auto; display: grid; gap: 18px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row__label { min-width: 0; }
.setting-row__label b { display: block; font-size: 15px; }
.setting-row__label .sub { margin: 4px 0 0; font-size: 13px; }
.segmented {
  display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line);
  border-radius: 12px; background: rgba(255,255,255,.03);
}
.segmented button {
  border: 0; background: transparent; color: var(--mut); border-radius: 9px;
  padding: 9px 14px; font-size: 13px; cursor: pointer; transition: color .2s, background .25s, transform .25s;
}
.segmented button:hover { color: var(--txt); transform: translateY(-1px); }
.segmented button.is-active {
  background: linear-gradient(180deg, rgba(232,191,120,.18), rgba(232,191,120,.06));
  color: var(--brass); box-shadow: 0 0 0 1px var(--edge);
}
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  width: 48px; height: 27px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(140,165,205,.18); position: relative; transition: background .25s, border-color .25s;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--mut); transition: transform .25s, background .25s;
}
.switch input:checked + .switch__track { background: rgba(232,191,120,.2); border-color: var(--brass); }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: var(--brass); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--brass); outline-offset: 3px; }
.status { font-size: 13px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--mut); }
.status--ok { color: var(--g); border-color: rgba(138,255,193,.45); background: rgba(138,255,193,.08); }
.status--bad { color: #ff9aa2; border-color: rgba(255,126,136,.5); background: rgba(255,126,136,.08); }
.check-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.check-list li { font-size: 13px; color: var(--mut); }
.confirm {
  margin-top: 12px; padding: 14px; border: 1px solid rgba(255,126,136,.4);
  border-radius: 12px; background: rgba(255,126,136,.07); display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.confirm p { margin: 0; font-size: 14px; flex: 1; }

/* ── Заглушки, уведомления, подвал ─────────────────────────────────────── */
.stub {
  min-height: 240px; display: grid; place-items: center; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--mut);
  background: var(--panel); padding: 24px;
}
.stub p { margin: 0; max-width: 62ch; }
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 60; max-width: min(420px, calc(100vw - 44px));
  padding: 14px 18px; border: 1px solid var(--edge); border-left: 3px solid var(--brass);
  border-radius: 14px; background: var(--panel-solid); box-shadow: var(--shadow);
  font-size: 14px; color: var(--txt); animation: toastIn .35s cubic-bezier(.16,1,.3,1) both;
}
.toast[hidden] { display: none; }
.footer {
  display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid var(--line); color: var(--mut); font-size: 12px;
}
.dev-details { font-size: 12px; color: var(--mut); }
.dev-details summary { cursor: pointer; color: var(--brass); padding: 4px 0; }
.dev-details > div, .dev-details > p { margin-top: 8px; max-width: 70ch; line-height: 1.6; }
.dev-details code { font-size: 12px; color: var(--a); }
.dev-panel { padding: 22px; }
.dev-panel > summary {
  list-style: none; font-size: 18px; font-weight: 700; color: var(--txt); cursor: pointer;
}
.dev-panel > summary::-webkit-details-marker { display: none; }
.dev-panel > summary::before { content: "▸ "; color: var(--brass); }
.dev-panel[open] > summary::before { content: "▾ "; }
.dev-panel[open] > summary { margin-bottom: 10px; }

/* ── Галерея ───────────────────────────────────────────────────────────── */
.gallery { display: grid; gap: 18px; }
.gallery__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.gallery__head h2 { margin: 0 0 4px; font-size: 22px; }
.gallery__head .eyebrow { margin-bottom: 0; }
.gallery__head .chip { align-self: center; }
.gallery__hint {
  margin: 0; color: var(--mut); font-size: 14px; line-height: 1.6;
  border-left: 3px solid var(--brass); padding: 10px 14px;
  background: rgba(232,191,120,.06); border-radius: 0 10px 10px 0;
}
.gallery__grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gal-card {
  min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.05), transparent 50%), var(--panel-solid);
  box-shadow: var(--depth-2), var(--rim);
  transition: transform var(--lc-dur-lift) var(--lc-ease-lift),
              border-color var(--lc-dur-ui), box-shadow var(--lc-dur-lift);
  animation: floatUp var(--lc-dur-float) var(--lc-ease-lift) both;
}
/* Каскад галереи канонически плотнее (.05/.1s, spec §3.6) — оставляем шаг. */
.gal-card:nth-child(2) { animation-delay: .05s; }
.gal-card:nth-child(3) { animation-delay: .1s; }
.gal-card--linked { cursor: pointer; }
.gal-card--linked:hover,
.gal-card--linked:focus-visible {
  border-color: var(--brass);
  box-shadow: var(--depth-3), var(--rim);
  transform: perspective(900px) rotateY(-3deg) rotateX(2deg) translateY(-9px);
}
.gal-card--unlinked { border-style: dashed; }
.gal-card__media {
  display: grid; place-items: center; height: 182px; padding: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(232,191,120,.1), transparent 64%), rgba(255,255,255,.025);
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.gal-card__media img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.gal-card--icon .gal-card__media img { width: 78px; height: 78px; }
html[data-theme="dark"] .gal-card--icon .gal-card__media img { filter: invert(1) brightness(1.7); }
.gal-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px; flex: 1; }
.gal-card__title { margin: 0; font-size: 15px; line-height: 1.4; }
.gal-card__alt { margin: 0; color: var(--mut); font-size: 12px; }
.gal-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line);
}
.gal-card__entity { font-size: 12px; color: var(--brass); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-card__entity--none { color: var(--mut); font-style: italic; }
.gal-card__kind {
  flex: none; font-size: 12px; color: var(--brass); border: 1px solid var(--edge);
  border-radius: 7px; padding: 3px 7px; background: rgba(232,191,120,.06);
}
.gallery__foot { color: var(--mut); font-size: 12px; text-align: right; border-top: 1px solid var(--line); padding-top: 10px; }

/* ── Портал: единая сцена-пространство вместо плоского дашборда (T-0085) ── */
.portal {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .55fr);
  gap: 34px; align-items: center; max-width: 1240px; width: 100%;
  margin: 0 auto; padding: 34px 24px 46px;
  min-height: min(720px, calc(100vh - 118px));
  /* T-0138: кольца/луна — декор с aria-hidden. Без отсечения их прямоугольники
     расширяют scrollWidth документа (74 px портрет / 94 px ландшафт / 234 px телефон).
     clip не создаёт scroll-контейнер, поэтому программный scrollX тоже становится 0. */
  overflow-x: clip;
  view-transition-name: portal;
}
#app:not(.is-portal) .portal { display: none; }
.portal__body {
  position: relative; z-index: 2; min-width: 0;
  animation: floatUp var(--lc-dur-float) var(--lc-ease-lift) both;
}
.portal__eyebrow {
  margin: 0 0 12px; color: var(--brass);
  font-size: 13px; line-height: 1.5; font-weight: 600;
}
.portal h1 {
  margin: 0 0 14px; font-size: clamp(34px, 4.2vw, 54px); line-height: 1.1;
  font-weight: 760; letter-spacing: -.035em; max-width: 15ch;
}
.portal h1 em { color: var(--brass); font-style: normal; }
.portal__lead { margin: 0 0 18px; max-width: 52ch; color: var(--mut); font-size: 16px; line-height: 1.65; }
.portal__status {
  display: inline-flex; gap: 9px; align-items: center; margin: 0 0 26px;
  padding: 10px 15px; border: 1px solid var(--edge); border-radius: 999px;
  background: rgba(232, 191, 120, .07); color: var(--txt); font-size: 13px; line-height: 1.5;
}
.portal__status::before { content: "✦"; margin-right: 8px; flex: none; color: var(--brass); }
.portal__gates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; max-width: 640px; }
.portal-gate {
  position: relative; min-width: 0; display: grid; grid-template-columns: auto 1fr;
  gap: 2px 13px; align-items: center; padding: 17px 18px;
  border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: var(--txt);
  background: linear-gradient(158deg, rgba(255,255,255,.06), rgba(255,255,255,.012) 48%), var(--panel-solid);
  box-shadow: var(--depth-2), var(--rim); transform-style: preserve-3d;
  transition: transform var(--lc-dur-lift) var(--lc-ease-lift),
              border-color var(--lc-dur-ui), box-shadow var(--lc-dur-lift);
}
/* Входы лежат на пологой дуге: крайние «ниже», центральные «ближе». */
.portal-gate--story { transform: rotateY(5deg) translateY(6px); }
.portal-gate--world { transform: rotateY(3deg); }
.portal-gate--games { transform: rotateY(-3deg); }
.portal-gate--archive { transform: rotateY(-5deg) translateY(6px); }
.portal-gate__glyph {
  grid-row: span 2; width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--edge); border-radius: 13px; color: var(--brass); font-size: 21px;
  background: radial-gradient(circle at 32% 26%, rgba(232,191,120,.28), transparent 68%);
  box-shadow: var(--glow-sm);
}
.portal-gate__title { font-size: 19px; font-weight: 720; line-height: 1.2; }
.portal-gate__hint { color: var(--mut); font-size: 13px; line-height: 1.4; }
.portal-gate::after { content: "→"; position: absolute; right: 15px; top: 15px; color: var(--brass); opacity: .65; }
.portal-gate:hover, .portal-gate:focus-visible, .portal-gate[aria-current="page"] {
  border-color: var(--brass);
  box-shadow: var(--depth-3), var(--glow-sm), var(--rim);
  transform: perspective(900px) rotateY(0) translateY(-6px) translateZ(18px);
}
.portal__deep {
  margin-top: 22px; padding: 6px 0; border: 0; border-bottom: 1px dashed var(--edge);
  background: none; color: var(--brass); font-size: 14px; cursor: pointer;
}
.portal__deep:hover { color: var(--txt); }
.portal__rings {
  position: absolute; z-index: 0; top: -18%; right: -8%;
  width: min(72vw, 820px); aspect-ratio: 1; pointer-events: none;
  transform: translate3d(calc(var(--px, 0) * 16px), calc(var(--py, 0) * 12px), 0);
}
.portal__ring {
  position: absolute; inset: 0; border: 1px solid rgba(232, 191, 120, .1); border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(90, 209, 255, .025), 0 0 0 160px rgba(232, 191, 120, .018);
}
.portal__ring--inner { inset: 18%; border-color: rgba(90, 209, 255, .13); box-shadow: none; }
.portal__moon {
  position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px;
  border-radius: 50%; background: var(--brass);
  box-shadow: 0 0 22px 8px rgba(232, 191, 120, .28);
  transform-origin: 6px 6px; animation: moonOrbit 48s linear infinite;
}
@keyframes moonOrbit {
  from { transform: rotate(0deg) translateX(300px); }
  to { transform: rotate(360deg) translateX(300px); }
}
.portal__side { position: relative; z-index: 2; display: grid; gap: 12px; align-content: center; }
.portal__card {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.05), transparent 46%), var(--panel-solid);
  box-shadow: var(--depth-3), var(--rim); transform: translateZ(24px);
}
.portal__card-label {
  margin: 0 0 8px; color: var(--brass);
  font-size: 13px; line-height: 1.45; font-weight: 600;
}
.portal__card-num {
  margin: 0; font-size: clamp(44px, 5vw, 64px); line-height: 1;
  font-weight: 780; letter-spacing: -.05em; color: var(--brass);
}
.portal__card-sub { margin: 4px 0 14px; color: var(--mut); font-size: 14px; }
.portal__found { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.portal__found li { position: relative; padding-left: 16px; font-size: 13px; line-height: 1.45; }
.portal__found li::before { content: "✦"; position: absolute; left: 0; top: 0; color: var(--g); font-size: 12px; }
.portal__card-link {
  display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px;
  border: 1px solid var(--brass-deep); border-radius: 11px; color: #1c1710;
  background: linear-gradient(135deg, #f3d497, var(--brass) 55%, var(--brass-deep));
  text-decoration: none; font-size: 13px; font-weight: 650;
}
.portal__card-note { margin: 0; color: var(--mut); font-size: 12px; line-height: 1.5; }
html[data-theme="light"] .portal__card-link,
html[data-theme="sepia"] .portal__card-link { color: #241a0c; }

/* ── View Transitions: антигравитационная смена экранов ─────────────────── */
/* T-0227 · «связи»: stage/portal — тот же жест и тайминг, что у шторки и split.
   Раньше old/new имели 4 разных длительности и 2 кривые (.38/.58/.35/.5,
   .4,0,.7,.2 и .16,1,.3,1) — теперь один --lc-dur-morph и --lc-ease-morph.
   Полная замена (смена контекста) остаётся честной: shared-элемент не выдумываем. */
@supports (view-transition-name: stage) {
  ::view-transition-old(stage) { animation: stageOut var(--lc-dur-morph) var(--lc-ease-morph) both; }
  ::view-transition-new(stage) { animation: stageIn var(--lc-dur-morph) var(--lc-ease-morph) both; }
  ::view-transition-old(portal) { animation: portalOut var(--lc-dur-morph) var(--lc-ease-morph) both; }
  ::view-transition-new(portal) { animation: portalIn var(--lc-dur-morph) var(--lc-ease-morph) both; }
}
@keyframes portalOut { to { opacity: 0; transform: translate3d(0, -26px, 0) scale(.98); filter: blur(6px); } }
@keyframes portalIn { from { opacity: 0; transform: translate3d(0, 32px, 0) scale(.98); filter: blur(6px); } }

/* ── Scroll-driven проявление (с мягким фолбэком) ───────────────────────── */
@supports (animation-timeline: view()) {
  .view .card, .view .gal-card {
    animation: revealScroll linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }
}

/* ── Адаптивность: 3 → 2 → 1 колонка ───────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > .card--lore { grid-column: 1 / -1; min-height: auto; }
  .hub-layout { grid-template-columns: minmax(0, 1fr); }
  .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .portal__side { max-width: 520px; }
}

@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .card { min-height: auto; }
  .card--lore, .card--wide { grid-column: auto !important; }
  .hud { margin-left: 0; }
  .nav[data-shell="compass"] { margin-left: auto; }
}

@media (max-width: 720px) {
  .topbar { padding: 14px; gap: 12px; }
  .brand__mark { width: 38px; height: 38px; font-size: 19px; border-radius: 11px; }
  .brand__name { font-size: 14px; }
  .brand__tagline { font-size: 12px; }
  .nav a { padding: 8px 10px; font-size: 12px; }
  .compass > summary { padding: 9px 11px; }
  .compass__label { display: none; }
  .compass__veil { width: calc(100vw - 28px); right: -2px; padding: 14px; }
  .compass__groups { grid-template-columns: 1fr 1fr; gap: 9px; }
  .compass__group { padding: 9px; }
  .compass__group--wide { grid-template-columns: 1fr; }
  .portal { padding: 22px 14px 36px; min-height: 0; gap: 24px; }
  .portal h1 { font-size: clamp(30px, 8vw, 38px); max-width: none; }
  .portal__lead { font-size: 15px; }
  .portal__status { display: block; border-radius: 12px; font-size: 12px; }
  .portal__gates { gap: 10px; }
  .portal-gate {
    grid-template-columns: 1fr; gap: 4px; padding: 13px 12px;
    border-radius: 14px; transform: none !important;
  }
  .portal-gate:hover, .portal-gate:focus-visible { transform: translateY(-3px) !important; }
  .portal-gate__glyph { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
  .portal-gate__title { font-size: 16px; }
  .portal-gate__hint { font-size: 12px; }
  .portal-gate::after { display: none; }
  .portal__rings { width: 130vw; right: -60vw; top: -6%; opacity: .6; }
  .portal__card { padding: 18px; }
  .portal__side { max-width: none; }
  .hud .chip:has(#ub-level) { display: none; }
  .view { padding: 20px 14px 32px; }
  .view-head h1 { font-size: 25px; }
  .lead { font-size: 15px; }
  .hud { width: 100%; }
  .hud .chip { font-size: 12px; padding: 7px 11px; }
  .bar { flex: 1 1 100%; width: 100%; }
  .card { padding: 17px; border-radius: 16px; }
  .episode, .rail-node { padding: 10px; gap: 9px; }
  .episode__title, .rail-node__title { font-size: 13px; }
  .gallery__grid { grid-template-columns: minmax(0, 1fr); }
  .gal-card__media { height: 150px; }
  .setting-row { align-items: flex-start; }
  .toast { right: 12px; bottom: 12px; }
  .footer { padding: 12px 14px; }
  .sky__cloud { min-width: 420px; min-height: 260px; }
}

@media (max-width: 420px) {
  .nav a { padding: 8px 9px; font-size: 12px; }
  .hud .chip { white-space: normal; }
  .segmented button { padding: 8px 9px; }
  .portal__gates { grid-template-columns: 1fr 1fr; }
  body { font-size: 14px; }
}

/* ── T-0138: портал в высоту планшета ────────────────────────────────────
   Портрет 820×1180 живёт в полосе ≤1100: раньше была только одна колонка,
   из-за чего портал вырастал до 1246 px. Две узкие колонки + плотный ритм
   укладывают его в первый экран, сохраняя все четыре входа и карточку пути. */
@media (min-width: 721px) and (max-width: 1100px) {
  .portal {
    grid-template-columns: minmax(0, 1.35fr) minmax(210px, .65fr);
    gap: 18px; padding: 22px 20px 26px; min-height: 0;
  }
  .portal__side { max-width: none; }
  .portal h1 { font-size: clamp(30px, 3.8vw, 40px); }
  .portal__lead { font-size: 15px; line-height: 1.5; }
  .portal__status { margin-bottom: 16px; padding: 8px 12px; }
  .portal__gates { gap: 12px; }
  .portal-gate { padding: 14px 14px; }
  .portal__deep { margin-top: 14px; }
  .portal__card { padding: 18px; }
}

/* Ландшафт 1180×820 — «десктопная» полоса >1100, но высота невелика.
   Ограничиваем и шириной (<1280), чтобы не задеть desktop 1440×900. */
@media (min-width: 1101px) and (max-width: 1279px) and (max-height: 900px) {
  .portal { gap: 22px; padding: 20px 20px 24px; min-height: 0; }
  .portal h1 { font-size: clamp(34px, 3.2vw, 40px); }
  .portal__lead { font-size: 15px; line-height: 1.5; margin-bottom: 14px; }
  .portal__status { margin-bottom: 14px; padding: 8px 12px; }
  .portal__gates { gap: 12px; }
  .portal-gate { padding: 13px 14px; }
  .portal__deep { margin-top: 12px; }
  .portal__card { padding: 18px; }
}

/* ── Fallback 3D и пользовательские настройки доступности ─────────────── */
@supports (transform: translateZ(1px)) and (perspective: 1px) {
  .hub-scene { perspective: 1100px; transform-style: preserve-3d; }
  .hub-scene > .card { transform: translateZ(6px); }
  .hub-scene > .card:hover { transform: translateZ(14px) rotateX(1.2deg) translateY(-4px); }
}
@media (hover: none) {
  .card:hover, .gal-card:hover, .hub-scene > .card:hover, .portal-gate:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { backdrop-filter: none; background: var(--panel-solid); }
  .sky { display: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(168, 200, 255, .5); --glow-sm: none; --glow-md: none; }
  /* T-0233: светлые темы переопределяют glow — гасим их явно, иначе guard не работает. */
  html[data-theme="light"] { --line: rgba(28, 62, 106, .5); --glow-sm: none; --glow-md: none; }
  html[data-theme="sepia"] { --line: rgba(110, 78, 40, .5); --glow-sm: none; --glow-md: none; }
  .card, .gal-card { border-width: 2px; }
}

/* ── Уважение к движению ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .sky i, .portal__rings { display: none; }
  .card, .gal-card, .view-head, .empty-state, .hub-scene > .card, .nav a,
  .portal, .portal__body, .portal-gate, .portal__card, .compass__veil {
    opacity: 1 !important; transform: none !important; animation: none !important;
  }
  ::view-transition-old(stage), ::view-transition-new(stage),
  ::view-transition-old(portal), ::view-transition-new(portal) { animation: none !important; }
}

/* T-0066 A1 — мета читателя (.ub-reader__year/__loc/__meta/__pct):
   инлайн-<style> reader.js задаёт --ub-muted 3.67:1 в сепии и 4.02:1 в светлой
   теме. Переопределяем только этот токен; !important перебивает инлайн-стиль. */
html .ub-reader[data-theme="sepia"] { --ub-muted: #6b5334 !important; } /* 5.88:1 на #f3e7cd */
html .ub-reader[data-theme="light"] { --ub-muted: #6b6459 !important; } /* 5.46:1 на #faf7f0 */

/* T-0174 — zero-chrome в портале и читателе. Только аддитивно и только под
   body.ub-zero-on: глобальный хром убирается из кадра, но не из разметки.
   Остальные 22 view по-прежнему показывают обычную навигацию и 43 UB-ключа.
   Скип-ссылка остаётся доступной с клавиатуры (WCAG 2.4.11). */
body.ub-zero-on .hud,
body.ub-zero-on .nav,
body.ub-zero-on .compass,
body.ub-zero-on .topbar,
body.ub-zero-on .portal,
body.ub-zero-on .portal__gates,
body.ub-zero-on .portal__deep,
body.ub-zero-on .portal__side,
body.ub-zero-on .portal__status,
body.ub-zero-on .dev-details,
body.ub-zero-on .footer,
body.ub-zero-on #toast { display: none !important; }
body.ub-zero-on #view {
  max-width: none !important; width: 100% !important;
  margin: 0 !important; padding: 0 !important;
}
body.ub-zero-on .skip-link:focus {
  position: fixed !important; z-index: 999 !important; top: 8px !important;
  left: 8px !important; width: auto !important; height: auto !important;
  clip: auto !important; overflow: visible !important;
}
/* T-0518: point-reduce-переопределения и zc-breathe сняты вместе с точкой
   T-0505; живой reduce 0 мс оставлен в общем медиаблоке ниже. */

/* T-0188 — аддитивная копия стилей шторки для рабочего zero-chrome слоя.
   Канонические правила живут в app/ui/zerochrome.js и в адаптере main.js;
   здесь они дублированы без изменений, чтобы таблица стилей тоже знала слой.
   Внутри шторки нет кнопок и вкладок; после T-0505 нет и point-узла (T-0518). */
.zc-shade {
  position: absolute; z-index: 2; left: 50%; bottom: clamp(14px, 3vh, 34px);
  width: min(92vw, 680px); padding: clamp(18px, 2.6vh, 28px) clamp(20px, 3vw, 34px);
  border: 1px solid rgba(90, 209, 255, .24); border-radius: 18px;
  background: linear-gradient(160deg, rgba(18, 32, 54, .96), rgba(9, 16, 30, .96));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: var(--zc-ink, #eaf2ff); opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, 24px);
  transition: opacity var(--lc-dur-shade) var(--lc-ease-morph),
              transform var(--lc-dur-shade) var(--lc-ease-morph),
              visibility var(--lc-dur-shade);
}
.zc-shade__title { margin: 0 0 14px; color: var(--zc-cool, #5ad1ff); font-size: clamp(15px, 1.6vw, 18px); font-weight: 700; }
.zc-shade__row { margin: 0 0 10px; font-size: clamp(16px, 1.8vw, 19px); line-height: 1.5; }
.zc-shade__row:last-of-type { margin-bottom: 0; }
.zc-shade__hint { margin: 16px 0 0; color: var(--zc-muted, #b9c9e6); font-size: 14px; }
.zc-line, .zc-read, .zc-stage {
  transition: opacity var(--lc-dur-shade) var(--lc-ease-morph),
              filter var(--lc-dur-shade) var(--lc-ease-morph);
}
.zc-scene[data-shade="up"] .zc-shade { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.zc-scene[data-shade="up"] .zc-line,
.zc-scene[data-shade="up"] .zc-read,
.zc-scene[data-shade="up"] .zc-stage { opacity: .26; filter: blur(.3px); }
.zc-root.is-shade-preview .zc-shade {
  opacity: var(--zc-shade, 0); visibility: visible;
  transform: translate(-50%, calc((1 - var(--zc-shade, 0)) * 26px)); transition: none;
}
@media (max-width: 720px) {
  .zc-shade { width: calc(100vw - 32px); bottom: 14px; padding: 18px 20px; }
  .zc-shade__row { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .zc-shade, .zc-line, .zc-read, .zc-stage { transition: none !important; }
  .zc-shade, .zc-root.is-shade-preview .zc-shade { transform: translate(-50%, 0) !important; }
}
.zc-root.is-reduced .zc-shade, .zc-root.is-reduced .zc-line,
.zc-root.is-reduced .zc-read, .zc-root.is-reduced .zc-stage { transition: none !important; }
.zc-root.is-reduced .zc-shade,
.zc-root.is-reduced.is-shade-preview .zc-shade { transform: translate(-50%, 0) !important; }

/* ── T-0194: морфинг внутренних связей reader ───────────────────────────────
   Один вызов View Transition на связь, один тайминг на все направления.
   Меняется только вектор (dx,dy) из типа связи: ось — translate, диагональ —
   тот же translate плюс режущая кромка polygon. Новых кнопок, вкладок и
  второго интерфейса нет; базовые правила stage/portal остаются фолбэком. */
@supports (view-transition-name: root) {
  :root[data-ub-morph="sequence"]::view-transition-old(root),
  :root[data-ub-morph="facet"]::view-transition-old(root),
  :root[data-ub-morph="cross"]::view-transition-old(root) {
    animation: ub-morph-out var(--lc-dur-morph) var(--lc-ease-morph) both;
    mix-blend-mode: normal;
  }
  :root[data-ub-morph="sequence"]::view-transition-new(root),
  :root[data-ub-morph="facet"]::view-transition-new(root),
  :root[data-ub-morph="cross"]::view-transition-new(root) {
    animation: ub-morph-in var(--lc-dur-morph) var(--lc-ease-morph) both;
    mix-blend-mode: normal;
  }
  /* Кросс-связь — тот же жест по вектору (1,1), а не отдельный режим. */
  :root[data-ub-morph="cross"]::view-transition-old(root) {
    animation-name: ub-morph-diagonal-out;
  }
  :root[data-ub-morph="cross"]::view-transition-new(root) {
    animation-name: ub-morph-diagonal-in;
  }
}
@keyframes ub-morph-out {
  to {
    opacity: 0;
    transform: translate3d(calc(var(--ub-morph-dx, 0) * -22px), calc(var(--ub-morph-dy, 0) * -22px), 0) scale(.985);
  }
}
@keyframes ub-morph-in {
  from {
    opacity: 0;
    transform: translate3d(calc(var(--ub-morph-dx, 0) * 26px), calc(var(--ub-morph-dy, 0) * 26px), 0) scale(1.015);
  }
}
@keyframes ub-morph-diagonal-out {
  to {
    opacity: 0;
    transform: translate3d(calc(var(--ub-morph-dx, 0) * -22px), calc(var(--ub-morph-dy, 0) * -22px), 0);
    clip-path: polygon(-30% 0, 100% 0, 130% 100%, 0 100%);
  }
}
@keyframes ub-morph-diagonal-in {
  from {
    opacity: 0;
    transform: translate3d(calc(var(--ub-morph-dx, 0) * 26px), calc(var(--ub-morph-dy, 0) * 26px), 0);
    clip-path: polygon(0 0, 0 0, -30% 100%, 0 100%);
  }
  to { clip-path: polygon(-30% 0, 130% 0, 130% 100%, -30% 100%); }
}
/* Аннотация — не-модальный слой над тем же кадром; 0 кнопок внутри. */
.ub-morph-note {
  position: fixed; z-index: 90; margin: 0;
  width: min(360px, calc(100vw - 28px));
  padding: 14px 16px; border: 1px solid rgba(90, 209, 255, .42); border-radius: 14px;
  background: rgba(9, 16, 30, .97); color: #eaf2ff;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(8px);
  /* T-0291: T1 (подсказка) использует каноническую кривую .2,.8,.2,1 из
     motion-grammar.md §2.1 — ту же, что T2/T3. Длительность 160 мс не изменена. */
  transition: opacity var(--lc-dur-tap) var(--lc-ease-morph),
              transform var(--lc-dur-tap) var(--lc-ease-morph);
}
/* Нативный popover открывается как :popover-open (не [open]); is-open — фолбэк. */
.ub-morph-note:popover-open, .ub-morph-note[open], .ub-morph-note.is-open { opacity: 1; transform: none; }
.ub-morph-note:focus-visible { outline: 2px solid #8affc1; outline-offset: 3px; }
.ub-morph-note__word {
  display: block; margin-bottom: 6px; color: #8affc1;
  font-size: 13px; font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  :root::view-transition-old(root), :root::view-transition-new(root) { animation: none !important; }
  .ub-morph-note { transition: none !important; transform: none !important; }
}

/* ── T-0235: системный минимум 12px для видимого текста ────────────────────
 * T-0222 нашёл 10–11px в 22 из 24 view; после T-0233 в прогоне 390×844 осталось
 * 84 таких элемента в 8 view (минимум 10px — «Условие:…» в orbit).
 * Сборка грузит app/bundle.js, а UI-модули добавляют свои <style> ПОСЛЕ этого
 * файла, поэтому равной специфичности недостаточно: префикс `html body`
 * поднимает специфичность на два типа и перекрывает инъекции, не меняя цвета,
 * вес, трекинг и прочие свойства. Только размер шрифта — контраст light/sepia
 * из T-0233 остаётся прежним. Правила глобальные: это системный пол, а не
 * мобильный хак; 11→12px не создаёт скролла (проверено замером 24 view).
 */
html body .ub-audio__year,
html body .ub-audio__loc,
html body .ub-audio__badge,
html body .ub-orbit__eyebrow,
html body .ub-orbit__core-kicker,
html body .ub-team-badge,
html body .ub-team-channels-head,
html body .ub-co-h,
html body .ub-wm__eyebrow,
html body .ub-news-badge,
html body .ub-news-date,
html body .ub-news-topic,
html body .ub-articles-badge,
html body .ub-articles-date { font-size: 12px; }

/* Вложенные селекторы (специфичность исходника выше на один тип). */
html body .ub-orbit__secret span,
html body .ub-orbit__secret b,
html body .ub-orbit__twin h4,
html body .ub-wm__card .kicker,
html body .gc-shot figcaption { font-size: 12px; }

/* ═══════════════ T-0226 · LIQUID CLOUD — канонический материал ═══════════════
   Источник: kanban/research/liquid-cloud-spec.md §2–§4, §8 (метрики L1–L8).
   Ничего не перекрашиваем: кодифицируем уже живущий облачный язык. Слои
   перечислены от фона к зрителю; z-порядок = порядок важности.
   L1 уже определён выше (.sky__cloud --one/--two, .sky__glow, .sky__orbit):
   blur 46/16px только на фоне, радиус не растёт, reduce → статичный PNG.
   GR-005: 0 внешних URL · GR-009: 0 новых PNG · chrome-gate: 0 новых кнопок.
   ────────────────────────────────────────────────────────────────────────── */

/* ── L2 «завеса»: модальность, «поверх сцены, сцена видна» ───────────────────
   Ровно ОДНА поверхность с backdrop-filter на экран (шторка zero-chrome);
   тёмная α=.58, blur 8px из диапазона 6–14px. Слой висит на .zc-scene с
   isolation:isolate и не имеет opacity<1 / filter / mask / will-change
   у родителя — backdrop-root discipline (MDN 10.11.2026).
   Под светлым текстом — только тёмная завеса; белое стекло запрещено. */
.zc-scene[data-shade="up"]::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--lc-veil);
  -webkit-backdrop-filter: blur(var(--lc-blur)) saturate(140%);
  backdrop-filter: blur(var(--lc-blur)) saturate(140%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .zc-scene[data-shade="up"]::before { background: var(--panel-solid); }
}

/* ── L3 «плита»: содержание и читаемость ────────────────────────────────────
   α≥0.92, backdrop-filter на плите не несёт смысла и создал бы backdrop
   root для детей (LG-02). Meaning = рамка + подпись + иконка, не opacity. */
.card, .gal-card, .portal-gate, .portal__card, .compass__veil,
.toast, .empty-state, .stub, .zc-shade { background-color: var(--lc-plate); }

/* ── L4 «specular-край + мезий-glow»: новизна и важность ─────────────────────
   Реальная 1px-линия + латунный inset-rim; одно свечение границей не считается
   (SC 1.4.11). Новых PNG нет: край — градиент, «толщина» — псевдоэлемент. */
.card::before, .portal-gate::before {
  background: var(--lc-specular);
  opacity: .8;
}
.portal-gate::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  border-radius: 18px 18px 0 0; pointer-events: none;
}
/* Glow только у горячей точки / нового знания / кончика прогресса.
   Декоративное свечение бренда, пустой иконки, рельсы и статичных входов
   снято: Signal «новизна» больше не размыт по всему кадру (audit §5.7). */
.brand__mark, .empty-state__icon, .rail__track::before,
.rail--b .rail__track::before, .portal-gate__glyph { box-shadow: var(--rim); }
/* Реальная линия состояния ≥3:1: индикатор не живёт только в свечении. */
.portal-gate, .compass > summary, .chip--path, .brand__mark,
.card:hover, .gal-card--linked:hover { border-color: var(--lc-edge-strong); }

/* ── T-0220 / M-01 (P1): снимок View Transition перекрывал документ ─────────
   Во время перехода 5–13 анимированных ::view-transition-* слоёв хит-тест
   центра горячей точки возвращал HTML, клик поглощался первые ~600 мс.
   Переход остаётся чисто визуальным: указатель проходит сквозь все его слои.
   Если для буферизации раннего клика понадобится main.js — это отдельный
   тикет-кандидат T-A, в рамках T-0226 логика роутинга НЕ трогается. */
::view-transition,
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-old(*),
::view-transition-new(*) { pointer-events: none; }

/* ── T-0518: мышиная point-аффорданс снята вместе с узлом T-0505. Курсорный
   токен motion-grammar (T-0227/T-0291) сохранён живым зондом: гейт таймингов
   читает var(--lc-dur-cursor) здесь. 0 DOM-узлов, 0 пикселей, 0 кнопок. */
:root { --lc-cursor-timing-echo: var(--lc-dur-cursor); }

/* ── T-0518: point-подписи (десктоп/мобильный) и point-подсветка first-run
   сняты вместе с узлом T-0505. Живая подсказка .ub-onboarding__point-hint
   ниже не тронута (role=status, main.js). */
.ub-onboarding__point-hint {
  position: absolute; left: 50%; top: calc(50% + 185px); z-index: 4;
  max-width: min(90vw, 460px); margin: 0; padding: 10px 14px;
  border: 1px solid rgba(255, 179, 90, .34); border-radius: 12px;
  background: rgba(9, 16, 30, .92); color: #eaf2ff;
  font-size: 15px; line-height: 1.5; text-align: center;
  pointer-events: none; opacity: 0; transform: translateX(-50%);
  transition: opacity .16s ease-out;
}
.ub-onboarding__point-hint.is-visible { opacity: 1; }
.zc-root.is-compass-active .ub-onboarding__point-hint { top: calc(50% + 240px); }
.zc-root:not(.is-onboarding) .ub-onboarding__point-hint { opacity: 0; visibility: hidden; }
.zc-shade__row:empty { display: none; }
@media (max-width: 720px) {
  .ub-onboarding__point-hint {
    top: calc(50% + 120px); font-size: 14px; max-width: calc(100vw - 32px);
  }
  .zc-root.is-compass-active .ub-onboarding__point-hint { top: calc(50% + 175px); }
}
@media (prefers-reduced-motion: reduce) {
  .ub-onboarding__point-hint { transition: none !important; }
}

/* Reader — отдельный read-mode: серийную палитру и --ub-muted не трогаем,
   несём только материал L3 (сплошная плита) и L4 (латунная кромка + линия). */
html .ub-reader__bar { position: relative; box-shadow: var(--rim); }
html .ub-reader__bar::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: var(--lc-specular); opacity: .55; pointer-events: none;
}
/* .ub-reader__bar-fill сохраняет кончик прогресса — единственный glow reader. */

/* Alias дрейфующего namespace → корневые токены (audit §3.1): одно значение,
   одна запись. Завеса орбиты уже канонична .58 — приводим к общему --lc-veil. */
html .ub-orbit {
  --ob-dim: var(--mut);
  --ob-line: var(--line);
  --ob-veil: var(--lc-veil);
  --ob-glow: var(--glow-md);
}

/* ── Guard-стопка: одна на все состояния (spec §4.3, порядок обязателен) ────
   1) @supports-фолбэк L2 выше → сплошная панель;
   2) prefers-reduced-motion → 0 движения (базовый guard в файле выше);
   3) prefers-contrast / forced-colors → стекло убрать, glow none, рамка 2px;
   4) prefers-reduced-transparency → завеса сплошная (никогда не один guard);
   5) JS saveData/DPR/rAF — прерогатива оркестратора, CSS их не переопределяет. */
@media (prefers-reduced-transparency: reduce) {
  .zc-scene[data-shade="up"]::before {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: var(--panel-solid);
  }
}
@media (prefers-contrast: more) {
  /* dark: базовый :root-override проигрывал html[data-theme="dark"] (0,1,1) —
     чиним явно, иначе glow оставался включённым под повышенным контрастом. */
  html[data-theme="dark"] { --glow-sm: none; --glow-md: none; }
  .zc-scene[data-shade="up"]::before {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: var(--panel-solid);
  }
  .card, .gal-card, .portal-gate, .portal__card, .compass__veil,
  .toast, .zc-shade { border-width: 2px; }
  .bar i, .done .episode__dot, .done .rail-node__dot { box-shadow: none; }
}
@media (forced-colors: active) {
  .zc-scene[data-shade="up"]::before {
    -webkit-backdrop-filter: none; backdrop-filter: none; background: Canvas;
  }
  .card, .gal-card, .portal-gate, .portal__card, .compass__veil,
  .toast, .zc-shade { border: 2px solid CanvasText; }
  .bar i, .done .episode__dot, .done .rail-node__dot { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .zc-scene[data-shade="up"]::before { transition: none; }
  .portal-gate::before { opacity: .8; }
}
@media (hover: none) {
  .portal-gate::before { opacity: .6; }
}

/* ═══════════════ T-0227 · LIQUID CLOUD MOTION GRAMMAR ═══════════════════════
   Источник: kanban/research/liquid-cloud-spec.md §3.6/§5.2/§6,
   kanban/research/morph-transitions.md §4/§7, kanban/research/mouse-audit.md M-04.
   Один словарь на шторку / морфинг / связи / курсор. Ни одного нового элемента,
   вкладки, кнопки, PNG, звука и внешнего запроса (GR-005/GR-009, chrome-gate).

   РОЛЬ           ТОКЕН                  ПРИМЕНЕНИЕ
   tap/ui         --lc-dur-tap/ui        кнопки, компас, навигация, подсказка
   shade          --lc-dur-shade         шторка zero-chrome + затемнение сцены
   morph/link     --lc-dur-morph         5 типов связи, ::view-transition-* stage/portal
   lift/float     --lc-dur-lift/float    плиты, каскад, вход экрана
   progress       --lc-dur-progress      кончик прогресса
   cursor         --lc-dur-cursor        декоративный блик у курсора (hover/focus только)

   КРИВЫЕ: --lc-ease-morph — единственная каноническая кривая .2,.8,.2,1 для T1
   (подсказка/cursor), T2 (шторка) и T3 (все связи, включая диагональ); отдельного
   «диагонального режима» нет. --lc-ease-lift остаётся только у декоративного
   подъёма плит/кнопок/каскада и к семантике отношения не имеет (T-0291).
   REDUCE: --lc-dur-* = 0 мс; JS не вызывает VT (main.js не тронут), CSS обнуляет
   длительности и задержки всех носителей движения. Смысл не в движении.
   ══════════════════════════════════════════════════════════════════════════ */

/* Шторка: завеса идёт на той же кривой, что split и VT. */
.zc-scene[data-shade="up"]::before {
  transition: opacity var(--lc-dur-shade) var(--lc-ease-morph);
}
/* Инлайновый <style id="zc-styles"> из bundle.js идёт ПОСЛЕ этой таблицы и
   перебивает равную специфичность. Префикс html body поднимает её ровно так же,
   как в T-0226 для горячей точки: логику zerochrome.js не трогаем, но единая
   кривая шторки применяется в живом кадре, а не только в исходнике CSS. */
html body .zc-shade {
  transition: opacity var(--lc-dur-shade) var(--lc-ease-morph),
              transform var(--lc-dur-shade) var(--lc-ease-morph),
              visibility var(--lc-dur-shade);
}
html body .zc-line,
html body .zc-read,
html body .zc-stage {
  transition: opacity var(--lc-dur-shade) var(--lc-ease-morph),
              filter var(--lc-dur-shade) var(--lc-ease-morph);
}

/* Reduce: явный ноль у всех носителей системы движения. Глобальный guard выше
   остаётся страховкой (≤0.01 мс) для остального CSS, включая инъекции модулей. */
@media (prefers-reduced-motion: reduce) {
  /* Специфика выше, чем у `:root, html[data-theme="…"]` в шапке файла:
     иначе тема перебивает ноль и кадры остаются 160/220/280 мс. */
  html:root, html[data-theme] {
    --lc-dur-tap: 0ms; --lc-dur-ui: 0ms; --lc-dur-shade: 0ms;
    --lc-dur-morph: 0ms; --lc-dur-lift: 0ms; --lc-dur-float: 0ms;
    --lc-dur-progress: 0ms; --lc-delay-step: 0ms; --lc-dur-cursor: 0ms;
  }
  .zc-shade, .zc-line, .zc-read, .zc-stage,
  .ub-morph-note,
  ::view-transition-old(*), ::view-transition-new(*) {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-delay: 0ms !important;
    transition-delay: 0ms !important;
  }
}

/* ── T-0518: компас точки снят вместе с point-узлом T-0505. Живые
   диагностические контуры hotSpotState()/zeroChromeState() с point-полями
   остаются в main.js и не тронуты. */
/* ═══════════ T-0380 · LIQUID CLOUD 2026 (T-0358 + T-0382) ═══════════════
   Аддитивный визуальный слой поверх принятых T-0354/T-0370/T-0364/T-0362.
   L0 воздух · L1 свет/кромка · L2 линза · L3 плита · L4 дымка ТОЛЬКО в VT.
   --lc-clarity — три пресета в токенах, НЕ панель кнопок (spec §4.5).
   0 внешних URL · 0 фонового blur · 0 дымки в покое · 0 бесконечных орбит.
   ═══════════════════════════════════════════════════════════════════════ */

:root, html[data-theme="dark"] {
  --lc-clarity: tinted;
  --lc-glass-alpha: .58;
  --lc-glass-blur: 12px;
  --lc-haze-dur: 280ms;
  --lc-ease: cubic-bezier(.2, .8, .2, 1);
  /* T-0458 · L1 свет live: положение specular-пятна пишет JS на .zc-root.
     Сдвигается transform за 160 мс, в покое неподвижен, при reduce — 0 мс. */
  --lc-light-dur: 160ms;
  --lc-spec-x: 0px;
  --lc-spec-y: 0px;
  --lc-spec-a: .26;
  --lc-top-light: linear-gradient(180deg, rgba(255,255,255,.26), transparent 42%);
  --lc-edge-dark: 10%;
  --lc-depth-1: 0 4px 12px rgba(30,55,95,.14);
  --lc-depth-2: 0 14px 34px rgba(30,55,95,.20);
  --lc-depth-3: 0 24px 52px rgba(30,55,95,.26);
  --lc-rim: rgba(232,191,120,.50);
  --lc-focus-ring: 2px;
}
/* Три пресета читаются как настройка доступности. Плашки/кнопок нет. */
:root[data-clarity="clear"]   { --lc-glass-alpha: .78; --lc-glass-blur: 8px; }
:root[data-clarity="frosted"] { --lc-glass-alpha: .68; --lc-glass-blur: 10px; }
/* T-0458 · V3 «матовое стекло», а не пятно: blur(12px) сохранён, но слой
   тоньше и получил видимую кромку + эхо полос (правила .lc-lens ниже). */
:root[data-clarity="tinted"]  { --lc-glass-alpha: .50; --lc-glass-blur: 12px; }
html[data-theme="light"] {
  --lc-depth-1: 0 4px 12px rgba(30,55,95,.14);
  --lc-depth-2: 0 14px 34px rgba(30,55,95,.20);
  --lc-depth-3: 0 24px 52px rgba(30,55,95,.26);
  --lc-rim: rgba(138,90,30,.48);
}
html[data-theme="sepia"] {
  --lc-depth-1: 0 4px 12px rgba(86,62,27,.14);
  --lc-depth-2: 0 14px 34px rgba(86,62,27,.20);
  --lc-depth-3: 0 24px 52px rgba(86,62,27,.26);
  --lc-rim: rgba(126,84,32,.50);
}

/* ── L3: читаемая плита. На ней НЕТ backdrop-filter (backdrop root, MDN S1). */
.lc-plate {
  position: relative; width: 100%; max-width: 36ch;
  overflow: hidden; /* T-0458: держит сдвинутый specular внутри плиты */
  padding: 28px 30px 24px;
  border: 1px solid var(--lc-rim);
  border-radius: 26px;
  background: rgba(11,20,38,.94);
  box-shadow: var(--lc-depth-2), var(--lc-depth-3), inset 0 1px 0 rgba(255,255,255,.06);
}
/* T-0458 · L1: свет следует за подходом курсора/фокусом. Это не opacity-
   кроссфейд: радиальный градиент сдвигается transform на --lc-spec-x/y,
   яркость живёт в --lc-spec-a. Ни одного infinite, в покое неподвижно. */
.lc-plate::before {
  content: ""; position: absolute; inset: -30%; border-radius: inherit;
  background:
    radial-gradient(closest-side circle at 50% 50%,
      rgba(255,255,255,var(--lc-spec-a,.26)), rgba(255,255,255,.04) 52%, transparent 100%),
    linear-gradient(180deg, rgba(255,255,255,.14), transparent 42%);
  transform: translate3d(var(--lc-spec-x,0px), var(--lc-spec-y,0px), 0);
  transition: transform var(--lc-light-dur,160ms) var(--lc-ease-morph),
              opacity var(--lc-light-dur,160ms) linear;
  pointer-events: none;
}
.lc-plate::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow:
    inset 0 -16px 30px rgba(0,0,0,var(--lc-edge-dark)),
    inset 16px 0 26px -20px rgba(0,0,0,.28),
    inset -16px 0 26px -20px rgba(0,0,0,.28);
  pointer-events: none;
}
.lc-plate > * { position: relative; z-index: 1; }
html body .lc-plate .zc-line { max-width: 32ch; }
html[data-theme="light"] .lc-plate { background: #ffffff; }
html[data-theme="sepia"] .lc-plate { background: #fff9ec; }
/* 0 декоративных орбит в покое. Реальные 1px-кромки — видимые, ≥3:1:
   подсказка первого запуска остаётся на месте (T-0370, T-0518). */
.sky__orbit, html body .zc-orbit { display: none !important; }
html body .ub-onboarding__point-hint { border-color: rgba(255,179,90,.62); }
/* T-0370 остаётся на месте; инъективный стиль onboarding-модуля имеет
   приоритет по порядку (point-подпись снята в T-0518). */
html body .zc-root .ub-onboarding__point-hint { top: calc(50% + 185px) !important; }
html body .zc-root.is-compass-active .ub-onboarding__point-hint { top: calc(50% + 240px) !important; }

/* ── L2: одна стеклянная линза НАД неоднородной сценой L0. Родители без
   opacity<1/filter/mask/clip-path/blend/will-change — blur действительно
   преломляет градиент (доказательство clear↔tinted из T-0382 §10.1). */
.lc-lens {
  position: absolute; z-index: 2;
  width: min(420px, 34vw);
  padding: 16px 18px;
  /* T-0458: чёткая кромка вместо матового пятна — та же толщина на всех
     трёх пресетах; кромка и блик видимы и при blur(12px). */
  border: 1px solid rgba(138,230,255,.72);
  border-radius: 16px;
  background: rgba(11,20,38,var(--lc-glass-alpha));
  -webkit-backdrop-filter: blur(var(--lc-glass-blur)) saturate(138%) contrast(1.06);
  backdrop-filter: blur(var(--lc-glass-blur)) saturate(138%) contrast(1.06);
  box-shadow: var(--lc-depth-1),
    inset 0 0 0 1px rgba(232,191,120,.34),
    inset 0 1px 0 rgba(255,255,255,.30),
    inset 0 -1px 0 rgba(90,209,255,.22);
  overflow: hidden;
}
/* T-0458: эхо сценных полос под стеклом — V3 остаётся стеклом, а не
   однородным матом. Декоративно, pointer-events:none, под текстом. */
.lc-lens::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(122deg, rgba(255,255,255,.17) 0 1px, transparent 1px 13px);
  opacity: var(--lc-stripe-echo, .5);
}
/* T-0458 · L1: specular линзы повторяет движение пятна плиты. */
.lc-lens__sheen {
  position: absolute; inset: -24%; pointer-events: none;
  background: radial-gradient(closest-side circle at 50% 50%,
    rgba(255,255,255,var(--lc-spec-a,.26)), rgba(255,255,255,.05) 55%, transparent 100%);
  transform: translate3d(var(--lc-spec-x,0px), var(--lc-spec-y,0px), 0);
  transition: transform var(--lc-light-dur,160ms) var(--lc-ease-morph);
}
.lc-lens__kicker { position: relative; z-index: 1; margin: 0 0 2px; color: var(--a, #5ad1ff); font-size: 15px; }
.lc-lens__text { position: relative; z-index: 1; margin: 0; color: var(--txt, #f3f7ff); font-size: 16px; }
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .lc-lens { background: #0b1426; }
}

/* ── L4: морфинг-растворение (T-0458). filter/mask/transform висят ТОЛЬКО
   на VT-снимках и снимаются по finished. 280 мс, одна кривая, 1 VT на связь.
   Старый слой не «призрачит» ровным кроссфейдом: он рвётся неравномерной
   маской (ядро + режущие полосы) и смещается, новый — собирается из другой
   части кадра. На 110 мс видны обе структуры и их кромки. Дымки в DOM и
   в покое нет: .lc-air__haze не создаётся вообще. */
::view-transition,
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-old(*),
::view-transition-new(*) { pointer-events: none; }
/* T-0566: структурирующая полоса 112° (LC-штриховка) изолирована в ОТДЕЛЬНОМ
   VT-снимке декоративного фона. `.zc-mem` — aria-hidden, pointer-events:none,
   0 кнопок — получает имя lc-decor и выходит из снимка root. Маска остаётся
   на декоре (дымка сохранена), но больше не достаётся плите M1 и живому тексту. */
@supports (view-transition-name: lc-decor) {
  [data-zc-mem] { view-transition-name: lc-decor; }
  ::view-transition-old(lc-decor) {
    animation: lc-dissolve-out var(--lc-dur-morph) var(--lc-ease-morph) both;
    -webkit-mask-composite: source-in; mask-composite: intersect;
  }
  ::view-transition-new(lc-decor) {
    animation: lc-condense-in var(--lc-dur-morph) var(--lc-ease-morph) both;
    -webkit-mask-composite: source-in; mask-composite: intersect;
  }
}
@supports (view-transition-name: root) {
  /* Плита и живой текст — чистый opacity-кроссфейд, без mask-image.
     stage/portal/ub-morph(root) сохраняют свои собственные чистые анимации. */
  ::view-transition-old(root),
  ::view-transition-old(lc-anchor) {
    animation: lc-plain-out var(--lc-dur-morph) var(--lc-ease-morph) both;
  }
  ::view-transition-new(root),
  ::view-transition-new(lc-anchor) {
    animation: lc-plain-in var(--lc-dur-morph) var(--lc-ease-morph) both;
  }
}
@keyframes lc-plain-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes lc-plain-in { from { opacity: 0; } to { opacity: 1; } }
/* Два слоя маски: очаг растворения (radial) И структурирующая полоса
   (repeating-linear). В 0% полоса сплошная — картинка целая; к середине
   в ней появляются разрывы, и старый заголовок превращается в дымку. */
@keyframes lc-dissolve-out {
  0% {
    opacity: 1; filter: blur(0px) saturate(1);
    transform: translate3d(0,0,0) scale(1) skewX(0deg);
    -webkit-mask-image:
      radial-gradient(ellipse 96% 92% at 62% 46%, #000 0 66%, rgba(0,0,0,.86) 80%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 11px, #000 11px 23px);
            mask-image:
      radial-gradient(ellipse 96% 92% at 62% 46%, #000 0 66%, rgba(0,0,0,.86) 80%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 11px, #000 11px 23px);
  }
  34% {
    opacity: .84; filter: blur(3px) saturate(1.12);
    transform: translate3d(-11px,-7px,0) scale(1.018) skewX(-1.2deg);
    -webkit-mask-image:
      radial-gradient(ellipse 92% 84% at 60% 44%, #000 0 54%, rgba(0,0,0,.78) 76%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 7px, transparent 7px 17px);
            mask-image:
      radial-gradient(ellipse 92% 84% at 60% 44%, #000 0 54%, rgba(0,0,0,.78) 76%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 7px, transparent 7px 17px);
  }
  55% {
    opacity: .58; filter: blur(6px) saturate(1.24);
    transform: translate3d(-27px,-17px,0) scale(1.046) skewX(-2.6deg);
    -webkit-mask-image:
      radial-gradient(ellipse 70% 62% at 77% 31%, #000 0 24%, rgba(0,0,0,.62) 48%, transparent 74%),
      repeating-linear-gradient(112deg, #000 0 5px, transparent 5px 13px);
            mask-image:
      radial-gradient(ellipse 70% 62% at 77% 31%, #000 0 24%, rgba(0,0,0,.62) 48%, transparent 74%),
      repeating-linear-gradient(112deg, #000 0 5px, transparent 5px 13px);
  }
  78% {
    opacity: .25; filter: blur(8px) saturate(1.3);
    transform: translate3d(-49px,-31px,0) scale(1.08) skewX(-4deg);
    -webkit-mask-image:
      radial-gradient(ellipse 48% 42% at 85% 22%, #000 0 10%, rgba(0,0,0,.4) 30%, transparent 60%),
      repeating-linear-gradient(112deg, #000 0 4px, transparent 4px 11px);
            mask-image:
      radial-gradient(ellipse 48% 42% at 85% 22%, #000 0 10%, rgba(0,0,0,.4) 30%, transparent 60%),
      repeating-linear-gradient(112deg, #000 0 4px, transparent 4px 11px);
  }
  100% {
    opacity: 0; filter: blur(10px) saturate(1.3);
    transform: translate3d(-74px,-47px,0) scale(1.12) skewX(-6deg);
    -webkit-mask-image:
      radial-gradient(ellipse 22% 18% at 93% 13%, #000 0 0%, transparent 46%),
      repeating-linear-gradient(112deg, #000 0 3px, transparent 3px 9px);
            mask-image:
      radial-gradient(ellipse 22% 18% at 93% 13%, #000 0 0%, transparent 46%),
      repeating-linear-gradient(112deg, #000 0 3px, transparent 3px 9px);
  }
}
@keyframes lc-condense-in {
  0% {
    opacity: 0; filter: blur(10px) saturate(1.3);
    transform: translate3d(70px,45px,0) scale(1.1) skewX(5deg);
    -webkit-mask-image:
      radial-gradient(ellipse 22% 18% at 7% 87%, #000 0 0%, transparent 46%),
      repeating-linear-gradient(112deg, #000 0 3px, transparent 3px 9px);
            mask-image:
      radial-gradient(ellipse 22% 18% at 7% 87%, #000 0 0%, transparent 46%),
      repeating-linear-gradient(112deg, #000 0 3px, transparent 3px 9px);
  }
  34% {
    opacity: .3; filter: blur(7px) saturate(1.26);
    transform: translate3d(46px,29px,0) scale(1.06) skewX(3deg);
    -webkit-mask-image:
      radial-gradient(ellipse 48% 42% at 15% 78%, #000 0 10%, rgba(0,0,0,.4) 30%, transparent 60%),
      repeating-linear-gradient(112deg, #000 0 4px, transparent 4px 11px);
            mask-image:
      radial-gradient(ellipse 48% 42% at 15% 78%, #000 0 10%, rgba(0,0,0,.4) 30%, transparent 60%),
      repeating-linear-gradient(112deg, #000 0 4px, transparent 4px 11px);
  }
  55% {
    opacity: .6; filter: blur(5px) saturate(1.18);
    transform: translate3d(25px,16px,0) scale(1.04) skewX(2deg);
    -webkit-mask-image:
      radial-gradient(ellipse 70% 62% at 23% 69%, #000 0 24%, rgba(0,0,0,.62) 48%, transparent 74%),
      repeating-linear-gradient(112deg, #000 0 5px, transparent 5px 13px);
            mask-image:
      radial-gradient(ellipse 70% 62% at 23% 69%, #000 0 24%, rgba(0,0,0,.62) 48%, transparent 74%),
      repeating-linear-gradient(112deg, #000 0 5px, transparent 5px 13px);
  }
  78% {
    opacity: .86; filter: blur(2px) saturate(1.08);
    transform: translate3d(9px,6px,0) scale(1.015) skewX(.8deg);
    -webkit-mask-image:
      radial-gradient(ellipse 92% 84% at 40% 56%, #000 0 54%, rgba(0,0,0,.78) 76%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 7px, transparent 7px 17px);
            mask-image:
      radial-gradient(ellipse 92% 84% at 40% 56%, #000 0 54%, rgba(0,0,0,.78) 76%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 7px, transparent 7px 17px);
  }
  100% {
    opacity: 1; filter: blur(0px) saturate(1);
    transform: translate3d(0,0,0) scale(1) skewX(0deg);
    -webkit-mask-image:
      radial-gradient(ellipse 98% 94% at 32% 58%, #000 0 68%, rgba(0,0,0,.86) 82%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 11px, #000 11px 23px);
            mask-image:
      radial-gradient(ellipse 98% 94% at 32% 58%, #000 0 68%, rgba(0,0,0,.86) 82%, transparent 100%),
      repeating-linear-gradient(112deg, #000 0 11px, #000 11px 23px);
  }
}

/* Адаптив 390×844: та же сцена, линза по центру под плитой, без скролла. */
@media (max-width: 720px) {
  .sky::after { right: -8%; left: -8%; bottom: 0; width: auto; height: 42vh; border-radius: 28px; opacity: .55; }
  .lc-plate { max-width: none; padding: 24px 22px 22px; border-radius: 20px; }
  .lc-lens { width: calc(100% - 32px); left: 50%; right: auto; bottom: 12px;
    transform: translateX(-50%); padding: 12px 14px; }
}

/* ── guards: reduce/контраст убирают эффект, сохраняя смысл ───────────── */
@media (prefers-reduced-motion: reduce) {
  /* html[data-theme] в базовом блоке Specificity выше :root — повторяем его,
     иначе --lc-haze-dur остаётся 280 мс при системном reduce. */
  :root, html[data-theme="dark"], html[data-theme="light"], html[data-theme="sepia"] {
    --lc-haze-dur: 0ms; --lc-glass-blur: 0px;
    --lc-light-dur: 0ms; --lc-spec-x: 0px; --lc-spec-y: 0px; --lc-spec-a: 0;
  }
  .lc-plate, .lc-plate::before, .lc-lens, .lc-lens__sheen {
    animation: none !important; transition: none !important; transform: none !important;
  }
  .lc-lens::after { opacity: .35; }
  ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important; filter: none !important; transform: none !important;
    -webkit-mask-image: none !important; mask-image: none !important;
  }
}
@media (prefers-contrast: more), (forced-colors: active) {
  :root { --lc-glass-alpha: 1; --lc-rim: #e8bf78; --lc-glass-blur: 0px; }
  .lc-lens {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #0b1426; border: 2px solid #e8bf78;
  }
  .lc-plate { background: #0b1426; border-width: 2px; border-color: #e8bf78; }
  .lc-plate::before, .lc-plate::after, .lc-lens__sheen { display: none; }
  ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important; filter: none !important;
    -webkit-mask-image: none !important; mask-image: none !important;
  }
}

/* ═══════════ T-0420 · РЕАЛЬНЫЙ ПИКСЕЛЬНЫЙ КОНТРАСТ ═══════════════════════
   DOM-walk T-0380 читал только backgroundColor и не видел background-image
   сцены L0: ложный проход 10.77:1 при пикселе 2.45:1. Правила ниже идут
   ПОСЛЕ инъективного ZC_STYLES из bundle и имеют бо́льшую специфичность
   (html body ...), поэтому перекрывают его на реальном file:// без правки
   bundle.js. Подложка выходит за границы строки и закрывает зоны замера
   пиксельного контроля (строки ±3/±6 px). Токены/слои/жесты не меняются. */
html body .lc-lens__kicker {
  display: inline-block;
  color: var(--zc-kicker, #c8f2ff);
}
html body .lc-lens__kicker::before {
  content: ""; position: absolute; inset: -10px -12px;
  border-radius: 12px; background: rgba(8, 13, 24, .94);
  z-index: -1; pointer-events: none;
}
html body .ub-onboarding__point-hint {
  color: var(--zc-ink, #f3f7ff);
}
html body .ub-onboarding__point-hint::before {
  content: ""; position: absolute; inset: -8px;
  border-radius: 16px; background: rgba(9, 16, 30, .94);
  z-index: -1; pointer-events: none;
}
/* T-0518: подсказка point-узла снята вместе с точкой T-0505; живая
   подсказка .ub-onboarding__point-hint выше сохраняет свой контраст. */
/* Светлая/сепия: плита L3 белая (T-0380), а чернила ZC оставались светлыми —
   пиксельный контраст 1.13:1. Возвращаем тёмные чернила только на плите;
   подпись/кикер/подсказка лежат на тёмной подложке и остаются светлыми. */
html[data-theme="light"] .lc-plate .zc-line,
html[data-theme="light"] .lc-plate .zc-read { color: #162338; }
html[data-theme="sepia"] .lc-plate .zc-line,
html[data-theme="sepia"] .lc-plate .zc-read { color: #3b2d1b; }
/* Рамки ≥3:1 на реальном пикселе: сплошной цвет вместо полупрозрачного. */
html body .lc-lens { border-color: #7ee6ff; }
html body .ub-onboarding__point-hint { border-color: #ffb35a; }
html[data-theme="light"] .lc-plate { border-color: #8a5a1e; }
html[data-theme="sepia"] .lc-plate { border-color: #96662a; }
/* Контраст/forced-colors: сплошная подложка, системные цвета,
   glow и размытие линзы уже сняты правилом T-0380 выше. */
@media (prefers-contrast: more) {
  html body .lc-lens__kicker,
  html body .ub-onboarding__point-hint { background: #0b1426; color: #f3f7ff; }
  html body .lc-lens__kicker::before,
  html body .ub-onboarding__point-hint::before { background: #0b1426; }
}
@media (forced-colors: active) {
  html body .lc-lens__kicker,
  html body .ub-onboarding__point-hint { background: Canvas; color: CanvasText; }
  html body .lc-lens__kicker::before,
  html body .ub-onboarding__point-hint::before { background: Canvas; }
}

/* ══════════════════ T-0433 · view-level colors follow the theme ═══════════════
   T-0425 candidate A: seven views hard-code dark-theme text colors (#e7eefc,
   #9fb4d6, #ffb35a, #5ad1ff, ...) while in light/sepia the page background is
   light via body's background-image (and the fixed .sky decoration). DOM reads
   a transparent backgroundColor and composites it to #000000, giving a FALSE
   PASS of 8-18:1; the real PNG pixel is 1.00-1.83:1 (pixel-contrast-coverage
   §4.1/§6). Fix at the color/token level only: map view-level text to the
   theme's own T-0233-vetted tokens (--txt/--mut/--a/--brass). The application
   background is NOT darkened. Dark theme and forced-colors keep their original
   values. `html:is(...) body` outranks each module's injected <style> (the
   T-0235 pattern). Titles are targeted directly, NOT via view roots, so text
   inside the dark content panels of the same view keeps its light ink. */

/* Titles: theme ink, without touching dark panels that inherit root color. */
html:is([data-theme="light"], [data-theme="sepia"]) body :is(
  .ub-court-title, .ub-arch-title, .ub-lt-title,
  .ub-orbit__title, .ub-orbit__twin h3, .ub-vs-title, .ub-wm__title
) { color: var(--txt); }

/* Subtitles and leads: theme muted ink (T-0233 ≥4.5:1 on the page fills). */
html:is([data-theme="light"], [data-theme="sepia"]) body :is(
  .ub-court-sub, .ub-arch-sub, .ub-lt-sub, .ub-orbit__lead,
  .ub-vs-sub, .ub-wm__lead
) { color: var(--mut); }

/* Accent tokens re-mapped only on the light page head. The same tokens keep
   their bright dark-theme values inside dark cards/panels further down. */
html:is([data-theme="light"], [data-theme="sepia"]) body .ub-orbit__head {
  --ob-a: var(--a);
  --ob-b: var(--brass);
}
html:is([data-theme="light"], [data-theme="sepia"]) body .ub-wm__head {
  --wm-a: var(--a);
  --wm-b: var(--brass);
  --wm-dim: var(--mut);
}
html:is([data-theme="light"], [data-theme="sepia"]) body :is(
  .ub-orbit__satellite, .ub-orbit__twin li, .ub-orbit__secret
) { --ob-dim: #a9bcd9; } /* restore light ink on the dark orbit panels */

/* gamecards: .gc-head and .gc-quest sit on the light page; .gc-card/.gc-detail
   stay dark. Custom props are redefined on the scope so var() consumers
   resolve to theme ink; `color` is set because .gc resolved it earlier. */
html:is([data-theme="light"], [data-theme="sepia"]) body .gc-head {
  color: var(--txt);
  --gc-text: var(--txt);
  --gc-muted: var(--mut);
  --gc-accent: var(--brass);
}
html:is([data-theme="light"], [data-theme="sepia"]) body .gc-quest {
  color: var(--txt);
  --gc-text: var(--txt);
  --gc-muted: var(--txt); /* quest panel is a mid-tone wash on the page */
}
html:is([data-theme="light"], [data-theme="sepia"]) body .gc-quest .gc-kicker {
  color: var(--txt);
}
/* .gc-btn inside the quest keeps its bright accent and dark label. */

/* Remaining view-level labels that carried their own hard-coded light color.
   The version rail crosses the fixed dark .sky decoration, so its stops get
   an opaque theme panel behind them instead of relying on the page gradient. */
html:is([data-theme="light"], [data-theme="sepia"]) body :is(
  .ub-lt-level, .ub-lt-level[aria-pressed="true"]
) { color: var(--txt); }
/* The lexicon rule sits on a mid-tone panel (≈#91867d/#907e69), so the page
   ink is not dark enough: use a theme-specific near-black for that strip. */
html[data-theme="light"] body :is(.ub-lt-rule, .ub-lt-rule small) { color: #080d18; }
html[data-theme="sepia"] body :is(.ub-lt-rule, .ub-lt-rule small) { color: #120b05; }
html:is([data-theme="light"], [data-theme="sepia"]) body :is(
  .ub-vs-stop, .ub-vs-stop[aria-pressed="true"]
) { background: var(--panel-solid); color: var(--txt); }
html:is([data-theme="light"], [data-theme="sepia"]) body :is(
  .ub-vs-stop-meta, .ub-vs-rail-hint, .ub-wm__canon
) { color: var(--txt); }

/* ══════════════════════════════════════════════════════════════════════════
   T-0438 · C-1…C-5 — пиксельный контраст подписей ≥ 4.5:1.
   Инлайн-<style> модулей попадает в head позже этого файла, поэтому все
   переопределения несут html/body-префикс (и !important там, где модуль
   задаёт состояние атрибутом). versions/audio имеют opacity=1 — здесь
   меняется ТОЛЬко заливка/скрим/токен, но не прозрачность.
   ══════════════════════════════════════════════════════════════════════════ */

/* C-1 elio. Недоступность действия передаём рамкой и курсором, а не падением
   непрозрачности подписи 13 px: 0.5 давал 2.06–2.13:1. */
html body button.ub-elio-action:disabled {
  opacity: 1 !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: inset 0 0 0 2px rgba(7, 17, 31, .55);
}
html body button.ub-elio-action--quiet:disabled {
  box-shadow: inset 0 0 0 1px rgba(231, 238, 252, .42);
  border-style: dashed;
}

/* C-2 cases. Входная анимация .empty-state (riseIn: opacity 0→1) делала
   подпись главной кнопки 0.44–0.73 и давала 2.04–2.87:1. Движение остаётся
   у остальных плит; у блока пустого состояния подпись всегда непрозрачна. */
html body .ub-cases-root .empty-state {
  animation: none !important;
  opacity: 1 !important;
}
/* T-0433 сделал латунь светлых тем тёмной; тёмная подпись на ней давала
   3.03–3.38:1. Возвращаем светлую заливку кнопки с тёмной подписью (9.24:1). */
html[data-theme="light"] .btn.btn--primary,
html[data-theme="sepia"] .btn.btn--primary {
  background: #e0b469 !important;
  color: #1c1710 !important;
  border-color: #9a6322 !important;
  box-shadow: 0 10px 26px rgba(120, 72, 20, .24), inset 0 1px 0 rgba(255, 255, 255, .4);
}

/* C-3 settings. Scroll-driven revealScroll начинался с opacity .45 и ставил
   контраст в зависимость от позиции прокрутки (2.30–2.33:1 на mobile).
   Оставляем движение, убираем затухание текста. */
@keyframes revealScroll {
  from { transform: translate3d(0, 18px, 0); }
  to   { transform: none; }
}

/* C-4 versions. opacity=1; виновата полутоновая заливка бейджа под мета-текстом.
   T-0433 уже дал светлым темам --panel-solid; расширяем ту же заливку на dark. */
html[data-theme="dark"] body :is(.ub-vs-stop, .ub-vs-stop[aria-pressed="true"]) {
  background: var(--panel-solid) !important;
}

/* C-5 audio. opacity=1; подпись лежит на текстуре с локальными 1.12–1.76:1.
   Непрозрачный скрим из темового токена, без изменения прозрачности текста. */
html body .view p.ub-ai-provenance {
  background: var(--panel-solid);
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}

/* === T-0440: контраст рамок контролов ======================================
   T-0425 сообщил 1.00:1 для восьми view, но его сэмплер не находил линию и
   composited declaring-color по обеим сторонам. T-0440 (/border-contrast-method)
   локализует реальную линию в PNG и разделяет артефакты. Подтверждённые провалы
   (outer<3, inner<3, заливка<3) — только перечисленные ниже контролы.
   Рамки остаются 1px: меняется только цвет, геометрия и состояния не тронуты.
   Forced-colors не перекрашивается: системные CanvasText/Canvas дают 19–21:1
   и визуально подтверждены кадрами t0440-*-forced-colors.png. */
@media (forced-colors: none) {
  /* Панели этих модулей тёмные во всех четырёх темах: яркая линия --a даёт
     7–11:1 и к обеим кромкам, и сохраняет акцент режима. */
  html body :is(
    .ub-arch-root .ub-arch-badge,
    .ub-arch-root .ub-arch-btn,
    .ub-arch-root .ub-arch-more,
    .ub-arch-root .ub-arch-select,
    .ub-articles-chip,
    .ub-court-root .ub-court-btn,
    .ub-lt-root .ub-lt-btn
  ) { border-color: #5ad1ff !important; }

  /* loreterms/versions/world: в dark панель тёмная, в light/sepia светлая.
     Токены --txt дают 5–12:1 на светлых кромках без затемнения фона. */
  html body :is(.ub-lt-root .ub-lt-level, .ub-vs-stop, .ub-wm__search) {
    border-color: #5ad1ff !important;
  }
  html[data-theme="light"] body :is(.ub-lt-root .ub-lt-level, .ub-vs-stop, .ub-wm__search) {
    border-color: var(--txt) !important;
  }
  html[data-theme="sepia"] body :is(.ub-lt-root .ub-lt-level, .ub-vs-stop, .ub-wm__search) {
    border-color: var(--txt) !important;
  }
}
/* === /T-0440 ============================================================= */

/* === T-0454: фоновая прогрессия в нуль-хромном слое (L0) ==================
   Зеркало ZC_STYLES из app/main.js — источник правды тот же. Две статичные
   дуги в дальнем слое: внешняя «блок N из M», внутренняя «найдено историй».
   Декорация: aria-hidden, pointer-events:none, 0 кнопок/вкладок/фокуса.
   0 анимаций; при reduce дуги уже заполнены, смысл — в текстовом двойнике.
   Значения --zc-prog-block/--zc-prog-found (0..1) пишет paintProgress() из
   того же ctx.profile. L2/L3/L4 не затронуты: новых backdrop-filter/blur нет. */
html body .zc-progress {
  position: absolute; left: auto; right: 4%; top: 8px;
  width: min(38vh, 360px, calc(46vw - 320px));
  height: min(38vh, 360px, calc(46vw - 320px));
  transform: none; pointer-events: none; overflow: visible;
}
html body .zc-progress svg { display: block; width: 100%; height: 100%; overflow: visible; }
html body .zc-progress__track { fill: none; stroke: rgba(232, 191, 120, .16); stroke-width: .32; }
html body .zc-progress__track--found { stroke: rgba(138, 255, 193, .16); stroke-dasharray: 1.4 2.6; }
html body .zc-progress__arc {
  fill: none; stroke: var(--zc-prog-block-color, #5ad1ff); stroke-width: .9;
  stroke-linecap: round; stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - 100 * var(--zc-prog-block, 0));
}
html body .zc-progress__arc--found {
  stroke: var(--zc-prog-found-color, #8affc1); stroke-width: .52;
  stroke-dashoffset: calc(100 - 100 * var(--zc-prog-found, 0));
}
html body .zc-progress__tip {
  fill: var(--zc-prog-block-color, #5ad1ff); transform-box: view-box;
  transform-origin: 50% 50%;
  transform: rotate(calc(var(--zc-prog-block, 0) * 360deg));
  filter: drop-shadow(0 0 1.4px rgba(90, 209, 255, .6));
}
html body .zc-progress__found-dot {
  fill: var(--zc-prog-found-color, #8affc1); transform-box: view-box;
  transform-origin: 50% 50%;
  transform: rotate(calc(var(--zc-prog-found, 0) * 360deg));
}
@media (min-width: 721px) and (max-width: 1199px) {
  /* T-0780: на планшете круг стоит над плитой, а не поверх неё. */
  html body .zc-progress {
    left: auto; right: 3%; top: 8px;
    width: min(22vh, 260px); height: min(22vh, 260px); transform: none;
  }
}
@media (max-width: 720px) {
  /* T-0454/T-0777/T-0780: 192px в верхнем правом углу — круг целиком
     в кадре 390×844, цитата ниже; 8px зазор до плиты. */
  html body .zc-progress {
    left: auto; right: 8px; top: 6px;
    width: 192px; height: 192px; transform: none;
  }
}
@media (prefers-contrast: more), (forced-colors: active) {
  html body .zc-progress__arc { stroke-width: 1.3; }
  html body .zc-progress__tip { filter: none; }
  html body .zc-progress__track { stroke: rgba(232, 191, 120, .5); }
}
@media (prefers-reduced-motion: reduce) {
  html body .zc-progress, html body .zc-progress__arc,
  html body .zc-progress__tip { animation: none !important; transition: none !important; }
}
html body .zc-root.is-reduced .zc-progress,
html body .zc-root.is-reduced .zc-progress__arc,
html body .zc-root.is-reduced .zc-progress__tip { animation: none !important; transition: none !important; }
/* === /T-0454 ============================================================= */

/* ══════════════════════════════════════════════════════════════════════════
   T-0499 · Токены контраста T-0498 → 24 кадра / 40 текстовых узлов.
   Значения дословно из kanban/research/contrast-tokens-shots/contrast-tokens.css
   (валидированный прототип T-0498). Только чернила, непрозрачные нейтральные
   поверхности и низконасыщенные правила. #ffb35a / --brass / --zc-warm и плита
   T-0467 rgba(11,20,38,0.95) НЕ трогаются. html/body-префикс и !important — по
   рабочему прецеденту T-0438: инлайн-<style> модулей попадает в head позже.
   Forced-colors: нейтральная пара Canvas/CanvasText в эмуляции прототипа —
   #ffffff / #0b0f18, правило #5a6472 (forced-color-adjust:none на целях).
   ══════════════════════════════════════════════════════════════════════════ */

:root[data-theme="light"] {
  --tc-ink: #162338;
  --tc-surface: #162338;
  --tc-on-surface: #f3f7ff;
  --tc-rule: #9fb2d0;
  --tc-panel-surface: #0c1628;
  --tc-panel-ink: #f3f7ff;
  --tc-panel-rule: #7f94b8;
  --tc-paper: #f3f6fc;
  --tc-paper-ink: #162338;
  --tc-paper-rule: #6b7f9e;
}
:root[data-theme="sepia"] {
  --tc-ink: #3b2d1b;
  --tc-surface: #3b2d1b;
  --tc-on-surface: #fdf6e8;
  --tc-rule: #cbb083;
  --tc-panel-surface: #241f1a;
  --tc-panel-ink: #fdf6e8;
  --tc-panel-rule: #b39b72;
  --tc-paper: #f0e7d5;
  --tc-paper-ink: #3b2d1b;
  --tc-paper-rule: #7d6847;
}
:root[data-theme="dark"] {
  --tc-ink: #f3f7ff;
  --tc-surface: #0e1a2d;
  --tc-on-surface: #f3f7ff;
  --tc-rule: #9fb2d0;
  --tc-panel-surface: #0c1628;
  --tc-panel-ink: #f3f7ff;
  --tc-panel-rule: #7f94b8;
  --tc-paper: #0c1628;
  --tc-paper-ink: #f3f7ff;
  --tc-paper-rule: #7f94b8;
}
@media (forced-colors: active) {
  :root[data-theme] {
    --tc-ink: #0b0f18;
    --tc-surface: #ffffff;
    --tc-on-surface: #0b0f18;
    --tc-rule: #5a6472;
    --tc-panel-surface: #ffffff;
    --tc-panel-ink: #0b0f18;
    --tc-panel-rule: #5a6472;
    --tc-paper: #ffffff;
    --tc-paper-ink: #0b0f18;
    --tc-paper-rule: #5a6472;
  }
}

/* A · gallery hint: латунь остаётся акцентом eyebrow, здесь рамка прозрачна. */
html body .gallery__hint {
  forced-color-adjust: none !important;
  color: var(--tc-on-surface) !important;
  background: var(--tc-surface) !important;
  border-left: 3px solid transparent !important;
}

/* B · court principle: тёмный пилюль с радиусом 8px — оба измерителя видят surface. */
html body .ub-court-principle {
  forced-color-adjust: none !important;
  color: var(--tc-panel-ink) !important;
  background: var(--tc-panel-surface) !important;
  border-color: var(--tc-panel-rule) !important;
  border-radius: 8px !important;
}

/* C · paper-чип названий дел и терминов (4 обрезанных узла — legacy-fallback). */
html body :is(.ub-court-item-name, .ub-lt-item-ru, .ub-lt-item-en) {
  forced-color-adjust: none !important;
  color: var(--tc-paper-ink) !important;
  background: var(--tc-paper) !important;
  border-color: var(--tc-paper-rule) !important;
  border-radius: 4px !important;
}

/* D · footer-подпись: только чернила, живой градиент фона сохраняется. */
html body .footer > span {
  color: var(--tc-ink) !important;
}

/* E · нейтральный чип orbit / versions / dev-details summary. */
html body :is(.ub-orbit span.hint, .ub-vs-rail-hint, .footer .dev-details > summary) {
  forced-color-adjust: none !important;
  color: var(--tc-on-surface) !important;
  background: var(--tc-surface) !important;
  border: 1px solid var(--tc-rule) !important;
  border-radius: 6px !important;
  display: inline-block !important;
  padding: 2px 6px !important;
}
/* === /T-0499 ============================================================= */

/* ── T-0755: одна строка оболочки на 22 документных view ──────────────────
   Строка — sibling #view, а не его содержимое: перерисовка страницы её не
   стирает. Только существующие токены; sticky, не fixed-оверлей. На hub и
   reader JS ставит hidden, CSS ниже страхует zero-chrome до первого кадра. */
.pagebar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 auto;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
  color: var(--mut);
  font-size: 13px;
}
.pagebar[hidden] { display: none !important; }
body.ub-zero-on #pagebar { display: none !important; }

.pagebar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 1240px;
  min-height: 44px;
  margin: 0 auto;
  padding: 0 24px;
}
.pagebar__links {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pagebar__link {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--mut);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--lc-dur-ui), background var(--lc-dur-ui);
}
.pagebar__link:hover { color: var(--txt); background: var(--panel-hi); }
.pagebar__sep { color: var(--mut); opacity: .55; user-select: none; }

.pagebar .nav[data-shell="compass"] { margin-left: auto; }
.pagebar .compass > summary { min-height: 44px; }

/* Закрытая раскрывашка — честно 0×0, а не «24 прозрачные ссылки». */
.compass:not([open]) > .compass__veil { display: none; }
.compass[open] > .compass__veil {
  display: block;
  opacity: 1;
  visibility: visible;
  max-height: min(70vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.compass[open] > summary {
  border-color: var(--brass);
  background: var(--panel-hi);
}

/* Переход по якорю/фокусу не прячет цель под прилипшей строкой. */
html { scroll-padding-top: 56px; }

@media (max-width: 720px) {
  .pagebar__inner { min-height: 48px; padding: 0 14px; gap: 4px; }
  .pagebar__links { gap: 4px; }
  .pagebar__link { min-height: 48px; padding: 0 6px; }
  /* Перебивает .compass__label{display:none}: подпись «Разделы» остаётся. */
  .pagebar .compass__label { display: inline; }
  .pagebar .compass > summary { min-height: 48px; padding: 9px 10px; }
  .pagebar .compass__veil { max-height: min(70vh, 590px); }
  html { scroll-padding-top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .pagebar__link { transition: none; }
}

/* ── T-0775: «Мир» и «Связи» — состояния одного окна ───────────────────────
   Глобальная документная шапка/футер на этих двух экранах убираются: остаётся
   #pagebar (Назад · В хаб · Связи · Разделы) и единственная меняющаяся область
   #view. Это не zero-chrome хаба/читателя: body.ub-zero-on не выставляется,
   HUD/.zc-progress не трогаются. */
body.ub-map-on .topbar,
body.ub-map-on .footer { display: none !important; }

/* Одно окно: страница не растёт от содержимого, скроллят только панели. */
body.ub-map-on { overflow: hidden; }
body.ub-map-on #app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.ub-map-on #view { flex: 1 1 auto; height: auto; min-height: 0; }

#view.ub-atlas-root,
#view.ub-wm-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: 0;
}

/* T-0802: W0–W3 остаются одним окном. На 390 режем отступы поля, не текст;
   горизонтальная прокрутка документа запрещена, sticky-строка не пересоздаётся. */
@media (max-width: 480px) {
  body.ub-map-on #view.ub-wm-root { overflow-x: clip; }
  body.ub-map-on #view.ub-wm-root .ub-wm { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body.ub-map-on #view.ub-wm-root .ub-wm__card.is-morph > * { animation: none !important; }
}
/* ── T-0800: профиль как документное адаптивное состояние того же окна ────
   s3 — состояние внутри #profile, не новая сцена ZC: HUD = 0, pagebar
   остаётся единственной строкой оболочки, один primary и строки-продолжения.
   Ни одного нового токена, роли, оверлея или типа события. */
.profile-view { max-width: 72ch; margin: 0 auto; }
.profile-view:focus { outline: none; }
.profile-head { margin-bottom: 20px; }
.profile-lead { max-width: 62ch; }
.profile-lead-full {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.profile-status { margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.profile-actions { margin: 14px 0 0; }
.profile-actions .btn--primary { min-height: 44px; }
.profile-empty-hint { margin: 10px 0 0; }
.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-card { min-width: 0; }
.profile-progress-note { margin: 4px 0 0; }
.profile-data-row { margin: 8px 0 0; font-size: 13px; color: var(--mut); }
.profile-surfaces { display: grid; gap: 8px; margin-top: 10px; }
.profile-surface {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; color: var(--mut); background: rgba(255,255,255,.025);
}
.profile-surface b { color: var(--txt); font-weight: 600; }
.profile-surface__level { font-variant-numeric: tabular-nums; }
.profile-surface--more { border-style: dashed; justify-content: flex-start; }
.profile-rows { display: grid; }
.profile-row {
  display: grid; gap: 4px; width: 100%; min-height: 44px; padding: 12px 6px;
  text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--txt); font: inherit; font-size: 14px;
  cursor: pointer; transition: background var(--lc-dur-ui), color var(--lc-dur-ui);
}
.profile-row:last-child { border-bottom: 1px solid var(--line); }
.profile-row b { color: var(--txt); font-weight: 600; }
.profile-row__why { color: var(--mut); font-size: 13px; line-height: 1.5; }
.profile-row:hover, .profile-row:focus-visible { background: var(--panel-hi); }
.profile-row:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.profile-row--sections { color: var(--brass); border-top: 0; font-weight: 600; }
.profile-sections { margin-top: 8px; }
.profile-sections[hidden] { display: none !important; }
.profile-sections__list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px;
  max-height: min(70vh, 590px); overflow-y: auto;
}
.profile-section {
  display: block; min-height: 44px; padding: 9px 6px; font-size: 13px;
  color: var(--mut); text-decoration: none; border-bottom: 1px solid var(--line);
}
.profile-section:hover, .profile-section:focus-visible { color: var(--txt); }
@media (max-width: 720px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-sections__list { grid-template-columns: minmax(0, 1fr); }
  .profile-row, .profile-section, .profile-actions .btn--primary { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-view *, .profile-view *::before, .profile-view *::after {
    animation: none !important; transition: none !important;
  }
}

/* T-0800 / CONTRACT D1: на документном состоянии профиля HUD-чип верхней
   панели не дублирует снимок и не называет найденные сущности «историями».
   Единственный счётчик — строка снимка внутри #profile; круговой HUD
   (.zc-progress) на этом view не монтируется. Ни одного нового узла. */
#app:has(.profile-view) .hud .chip { display: none !important; }
/* ── T-0799: morph-ядро пары хаб↔чтение (M0–M7) ───────────────────────────
   Ни одного нового цвета, кривой или длительности: переиспользуем уже
   существующие --lc-dur-morph (280 мс) и --lc-ease-morph (.2,.8,.2,1).
   Оболочка инвариантна: pagebar/topbar/HUD/бренд не получают собственного
   view-transition-name и поэтому не становятся вторым shared-слоем. Единственный
   якорь ZC-пары ставится в main.js (lcMarkAnchor, не более одного на кадр). */
@supports (view-transition-name: stage) {
  #pagebar, .topbar, .hud, .brand, .footer { view-transition-name: none !important; }
  /* Содержимое (root / stage / lc-anchor) уже анимируется existing-правилами
     с --lc-dur-morph и --lc-ease-morph: один VT, одна кривая, 280 мс. */
  :root[data-t0799-pair="true"]::view-transition-old(lc-anchor),
  :root[data-t0799-pair="true"]::view-transition-new(lc-anchor) {
    animation-duration: var(--lc-dur-morph) !important;
    animation-timing-function: var(--lc-ease-morph) !important;
  }
}

/* M6 — фокус после восстановления видим и никогда не остаётся на body. */
#view :focus-visible { outline: 2px solid var(--brass, #c8a45c); outline-offset: 2px; }

/* Reduce: 0 мс, 0 анимаций, тот же смысловой кадр без движения (M7). */
@media (prefers-reduced-motion: reduce) {
  :root::view-transition-group(*),
  :root::view-transition-image-pair(*),
  :root::view-transition-old(*),
  :root::view-transition-new(*) {
    animation: none !important;
    animation-duration: 0ms !important;
  }
  #view *, #pagebar *, .zc-progress * { animation-duration: 0ms !important; }
}
