/* Бэтпещера — общий штаб челленджа. Тёмный рыцарь, ночной Готэм, свет бэт-сигнала. */

/* ---------- шрифты: свои файлы, без внешних сервисов ---------- */

@font-face {
  font-family: 'Forum'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/forum-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Forum'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/forum-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/golos-text-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/golos-text-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/golos-text-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- токены ---------- */

:root {
  color-scheme: dark;
  --black: #000;
  --night: #080b0f;          /* фон: готэмская ночь */
  --cave: #0d1116;           /* поверхность графиков и листов */
  --cave-2: #131920;         /* приподнятая поверхность */
  --input: #0a0e13;
  --line: rgba(232, 226, 213, 0.085);
  --line-2: rgba(232, 226, 213, 0.16);
  --line-3: rgba(232, 226, 213, 0.28);
  --bone: #e8e2d5;           /* основной текст */
  --bone-2: #bdb7aa;         /* вторичный текст */
  --steel: #8c9aa4;          /* приглушённый: подписи, оси */
  --steel-2: #5f6b74;
  --p1: #c4861f;             /* Коля — янтарь бэт-сигнала (серия 1) */
  --p2: #4f8fd6;             /* Виталий — готэмский синий (серия 2) */
  --p1-glow: #f3b552;
  --p2-glow: #8fc0f2;
  --team: #a9a395;           /* общие цели — нейтральный */
  --danger: #d03b3b;         /* просрочено — всегда с иконкой и словом */
  --focus: #f2e9d8;
  --font-display: 'Forum', 'Cormorant Garamond', 'Times New Roman', serif;
  --font-ui: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 3px;
  --gutter: 16px;
  --maxw: 1120px;
  --bar: 28px;               /* чёрные полосы кадра */
  --top: 56px;               /* высота верхней панели */
  --bottom-nav: 0px;
}

@media (min-width: 760px) {
  :root { --gutter: 32px; --bar: clamp(36px, 6.5vh, 64px); }
}
@media (max-width: 759px) {
  :root { --bottom-nav: calc(60px + env(safe-area-inset-bottom)); }
}

/* ---------- основа ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); scroll-padding-top: calc(var(--top) + 48px); overflow-x: clip; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0; min-height: 100dvh; overflow-x: clip; background: var(--night); color: var(--bone);
  font: 400 16px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Плёночное зерно поверх всего — едва заметное, как на кадрах Нолана. */
body::after {
  content: ''; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-transparency: reduce) { body::after { display: none; } }

h1, h2, h3, h4, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--steel); }
.icon { display: block; flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- кнопки и поля ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
  border: 1px solid transparent; border-radius: var(--radius); background: var(--bone); color: var(--night);
  font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:hover { background: #f6f1e6; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--line-3); background: rgba(232, 226, 213, 0.04); }
.btn.quiet { background: transparent; color: var(--bone-2); padding-inline: 10px; }
.btn.quiet:hover { color: var(--bone); background: rgba(232, 226, 213, 0.05); }
.btn.danger { background: transparent; color: #f0b4b4; border-color: rgba(208, 59, 59, 0.45); }
.btn.danger:hover { background: rgba(208, 59, 59, 0.12); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.wide { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--steel);
  transition: color 0.15s, background-color 0.15s;
}
.icon-btn:hover { color: var(--bone); background: rgba(232, 226, 213, 0.06); }
.icon-btn.small { width: 32px; height: 32px; }

.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > span, .field-label { font-size: 13px; color: var(--steel); }
.field small { font-size: 12px; color: var(--steel-2); }
.input, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--input); color: var(--bone); font-size: 16px; line-height: 1.35;
  transition: border-color 0.15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .textarea:focus { outline: none; border-color: rgba(232, 226, 213, 0.55); box-shadow: 0 0 0 3px rgba(232, 226, 213, 0.08); }
.input::placeholder, .textarea::placeholder { color: var(--steel-2); }
input[type='date'].input { min-width: 0; }
input[type='date']::-webkit-calendar-picker-indicator { filter: invert(0.85); opacity: 0.7; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 359px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--input); }
.seg button {
  flex: 1 1 auto; min-height: 36px; padding: 6px 10px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--bone-2); font-size: 14px; font-weight: 500;
}
.seg button:hover { color: var(--bone); }
.seg button[aria-pressed='true'] { background: var(--bone); color: var(--night); font-weight: 600; }

/* Галочка: настоящий checkbox, нарисованный поверх; цвет — того, чья дорожка. */
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; min-height: 30px; padding: 4px 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 0;
  border: 1.5px solid var(--line-3); border-radius: 3px; color: var(--night);
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.check .box .icon { opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.2s; }
.check:hover .box { border-color: var(--bone-2); }
.check input:checked + .box { background: var(--pc, var(--bone)); border-color: var(--pc, var(--bone)); }
.check input:checked + .box .icon { opacity: 1; transform: none; }
.check input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.check .label { padding-top: 1px; line-height: 1.4; }
.check input:checked ~ .label { color: var(--bone-2); }

.meter { position: relative; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--pc, var(--bone)) 16%, transparent); }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: 0 3px 3px 0; background: var(--pc, var(--bone)); transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.meter > span[data-full] { border-radius: 3px; }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter-row .meter { flex: 1; }
.meter-row .meter-val { font-size: 13px; color: var(--bone-2); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--team)); flex: none; }
.p1 { --pc: var(--p1); --pc-glow: var(--p1-glow); }
.p2 { --pc: var(--p2); --pc-glow: var(--p2-glow); }
.team { --pc: var(--team); --pc-glow: var(--bone); }

/* ---------- экраны входа и выбора ---------- */

.gate { position: relative; min-height: 100dvh; display: grid; align-items: end; overflow: hidden; background: var(--black); }
.gate-bg { position: absolute; inset: 0; }
.gate-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 59% 50%; filter: brightness(0.62) saturate(0.95); animation: slowzoom 40s ease-out both; }
.gate::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.2) 55%, rgba(0, 0, 0, 0.92) 100%);
}
.gate-inner { position: relative; z-index: 2; width: 100%; max-width: 540px; padding: 0 var(--gutter) calc(48px + env(safe-area-inset-bottom)); }
.gate .mark { width: 72px; color: var(--bone); margin-bottom: 18px; opacity: 0.9; }
.gate h1 { font: 400 clamp(52px, 13vw, 84px)/0.95 var(--font-display); letter-spacing: 0.02em; }
.gate .lead { margin-top: 10px; color: var(--bone-2); font-size: 16px; }
.gate form { margin-top: 28px; display: grid; gap: 12px; }
.gate .error { color: #f3c6c6; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.gate .error .icon { color: var(--danger); margin-top: 1px; }
.gate .quote { margin-top: 36px; font-size: 14px; color: var(--bone-2); max-width: 36em; text-shadow: 0 1px 2px #000; }
.gate .quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--steel); }
.who-list { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.who-btn {
  position: relative; display: grid; gap: 6px; justify-items: start; padding: 18px 16px 16px; min-height: 108px;
  border: 1px solid var(--line-2); border-radius: 4px; background: rgba(8, 11, 15, 0.72); backdrop-filter: blur(6px);
  text-align: left; transition: border-color 0.15s, background-color 0.15s;
}
.who-btn:hover { border-color: var(--pc); background: rgba(8, 11, 15, 0.85); }
.who-btn .who-name { font: 400 30px/1 var(--font-display); }
.who-btn .who-hint { font-size: 13px; color: var(--steel); }
.who-btn::before { content: ''; position: absolute; left: 16px; right: 16px; top: 0; height: 2px; background: var(--pc); }
@media (min-width: 760px) {
  .gate { align-items: center; }
  .gate-inner { margin-left: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); padding-bottom: 0; }
  .gate::before { background: linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 40%, rgba(0, 0, 0, 0) 70%), linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 40%); }
}
@keyframes slowzoom { from { transform: scale(1.08); } to { transform: scale(1); } }

/* ---------- верхняя панель и вкладки ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  background: rgba(8, 11, 15, 0.82); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { height: 100%; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px 6px 0; border: 0; background: none; color: var(--bone); }
.brand .mark { width: 34px; flex: none; color: var(--bone); }
.brand-title { font: 400 21px/1 var(--font-display); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .icon { color: var(--steel); }
.brand:hover .icon { color: var(--bone); }
.top-tabs { display: none; margin: 0 auto; gap: 4px; height: 100%; }
.top-tabs button {
  position: relative; height: 100%; padding: 0 16px; border: 0; background: none; color: var(--bone-2); font-size: 15px; font-weight: 500;
}
.top-tabs button:hover { color: var(--bone); }
.top-tabs button[aria-current='page'] { color: var(--bone); }
.top-tabs button[aria-current='page']::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--bone); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.me-btn { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border: 1px solid var(--line-2); border-radius: 20px; background: none; font-size: 14px; color: var(--bone); }
.me-btn:hover { border-color: var(--line-3); }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--steel-2); }
.sync[data-on='true'] { background: #7fbf8a; box-shadow: 0 0 0 3px rgba(127, 191, 138, 0.15); }
@media (min-width: 760px) {
  .top-tabs { display: flex; }
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom); background: rgba(8, 11, 15, 0.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.bottom-nav button {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 4px 8px; border: 0; background: none;
  color: var(--steel); font-size: 11px; font-weight: 500;
}
.bottom-nav button[aria-current='page'] { color: var(--bone); }
.bottom-nav button[aria-current='page']::before { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--bone); }
@media (min-width: 760px) { .bottom-nav { display: none; } }

main { padding-bottom: var(--bottom-nav); }

/* ---------- кинокадр ---------- */

.hero { position: relative; height: min(58vh, 470px); min-height: 360px; overflow: hidden; background: var(--black); isolation: isolate; }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: var(--px, 50%) var(--py, 40%); filter: brightness(var(--dim, 0.8)) saturate(0.92) contrast(1.04); }
@media (max-aspect-ratio: 4/5) { .hero img { object-position: 50% var(--pym, 30%); } }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 30%, rgba(0, 0, 0, 0) 62%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 55%);
}
/* Чёрные полосы широкого экрана; при загрузке кадр «раскрывается». */
.hero .letterbox { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hero .letterbox::before, .hero .letterbox::after { content: ''; position: absolute; left: 0; right: 0; height: var(--bar); background: var(--black); animation: bars 1.5s cubic-bezier(0.65, 0, 0.25, 1) both; }
.hero .letterbox::before { top: 0; }
.hero .letterbox::after { bottom: 0; }
@keyframes bars { from { height: 50%; } to { height: var(--bar); } }
.hero-body { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(var(--bar) + 18px); }
.hero-kicker { color: var(--bone-2); font-size: 15px; letter-spacing: 0.02em; }
.hero-title { margin-top: 2px; font: 400 clamp(68px, 17vw, 150px)/0.86 var(--font-display); letter-spacing: 0.02em; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5); }
.hero-dates { margin-top: 10px; font-size: 15px; color: var(--bone); }
.hero-edit { position: absolute; z-index: 4; right: var(--gutter); top: calc(var(--bar) + 10px); color: var(--bone-2); background: rgba(0, 0, 0, 0.35); }
.hero-strip {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: var(--bar);
  display: flex; align-items: center; color: var(--steel); font-size: 12px;
}
.hero-strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.clock { display: flex; align-items: center; gap: 12px; color: var(--bone-2); font-size: 13px; white-space: nowrap; }
.clock .meter { width: 120px; height: 3px; --pc: var(--bone); }
.subtitle { display: none; }
.credit { display: none; }
@media (min-width: 760px) {
  .hero { height: min(74vh, 720px); min-height: 480px; }
  .hero::before {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.25) 28%, rgba(0, 0, 0, 0) 50%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 34%, rgba(0, 0, 0, 0) 62%);
  }
  .hero-body { bottom: calc(var(--bar) + 40px); }
  .hero-kicker { font-size: 17px; }
  .hero-dates { font-size: 17px; }
  /* Цитата — как субтитр в кинотеатре: по центру, над нижней полосой. */
  .subtitle {
    display: block; position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar) + 16px);
    width: min(44em, 70%); text-align: center; font-size: 19px; font-weight: 500; line-height: 1.35; color: #f4efe3;
    text-shadow: 0 0 2px #000, 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, 0.9);
  }
  .hero.has-subtitle .hero-body { bottom: calc(var(--bar) + 96px); }
  .credit { display: block; color: var(--steel); font-size: 12px; text-align: right; }
  .clock { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .letterbox::before, .hero .letterbox::after, .gate-bg img { animation: none; }
}

/* ---------- эмблемы: свет заливает летучую мышь снизу на долю выполненного ---------- */

.score { border-bottom: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 0%, rgba(232, 226, 213, 0.035), rgba(0, 0, 0, 0) 60%); }
.score .wrap { display: grid; grid-template-columns: 1fr 1fr; }
.score-side { display: grid; justify-items: center; text-align: center; padding: 26px 6px 24px; }
.score-side + .score-side { border-left: 1px solid var(--line); }
.emblem { width: min(260px, 92%); height: auto; overflow: visible; filter: drop-shadow(0 0 calc(2px + var(--v, 0) * 22px) color-mix(in srgb, var(--pc-glow) calc(var(--v, 0) * 70%), transparent)); }
.emblem .base { fill: #161c23; }
.emblem .rim { fill: none; stroke: rgba(232, 226, 213, 0.18); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.emblem .light { transition: transform 1.6s cubic-bezier(0.2, 0.75, 0.15, 1); }
.emblem .level { fill: #fff8e8; opacity: 0.85; }
@media (prefers-reduced-motion: reduce) { .emblem .light { transition: none; } }
.score-pct { margin-top: 14px; font-size: clamp(34px, 7vw, 48px); font-weight: 600; line-height: 1; letter-spacing: -0.01em; }
.score-name { margin-top: 8px; display: flex; align-items: center; gap: 8px; justify-content: center; font: 400 26px/1.1 var(--font-display); }
.score-sub { margin-top: 6px; font-size: 13px; color: var(--steel); }
.you { font: 500 11px/1 var(--font-ui); color: var(--night); background: var(--bone-2); padding: 3px 6px; border-radius: 10px; letter-spacing: 0.02em; }

/* ---------- разделы ---------- */

.section { padding: 34px 0 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-title { font: 400 clamp(28px, 4.5vw, 36px)/1.05 var(--font-display); letter-spacing: 0.01em; }
.section-sub { margin-top: 6px; font-size: 14px; color: var(--steel); }

/* Две дорожки: слева всегда Коля, справа всегда Виталий. Имена держатся сверху при прокрутке. */
.lane-head {
  position: sticky; top: var(--top); z-index: 20; display: grid; grid-template-columns: 1fr 1fr;
  background: rgba(8, 11, 15, 0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--bone-2);
}
.lane-head > div { display: flex; align-items: center; gap: 8px; padding: 9px 12px; }
.lane-head > div + div { border-left: 1px solid var(--line); }
.lanes { display: grid; grid-template-columns: 1fr 1fr; }
.lane { min-width: 0; padding: 12px 12px 16px; }
.lane + .lane { border-left: 1px solid var(--line); }
.lane.team { grid-column: 1 / -1; }
.lane-tag { display: none; }

.goal { border-bottom: 1px solid var(--line); }
.goal-head { display: flex; gap: 8px; align-items: flex-start; padding: 22px 0 4px; }
.goal-head .grow { flex: 1; min-width: 0; }
.goal-title { font-size: 18px; font-weight: 600; line-height: 1.3; }
.goal-meta { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--steel); }
.goal-meta .tag { display: inline-flex; align-items: center; gap: 6px; }
.goal-meta .late { color: #f0b4b4; }
.goal-meta .late .icon { color: var(--danger); }
.goal-desc { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--bone-2); max-width: 62em; white-space: pre-line; }
.goal-body { padding: 8px 0 6px; }
.goal.is-done .goal-title { color: var(--bone-2); }

.done-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--bone-2); }
.done-line .icon { color: var(--pc); }
.plan { margin-top: 8px; display: block; width: 100%; text-align: left; padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: none; color: var(--bone-2); font-size: 14px; line-height: 1.4; }
.plan:hover { border-color: var(--line-3); color: var(--bone); }
.plan.filled { border-style: solid; border-color: var(--line); color: var(--bone); }
.plan .muted { display: block; font-size: 12px; margin-bottom: 2px; }

.steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: flex; align-items: flex-start; gap: 4px; }
.steps li .check { flex: 1; min-width: 0; }
.steps .step-who { display: block; font-size: 12px; color: var(--steel-2); margin-top: 1px; }
.steps li .icon-btn { margin-top: -2px; opacity: 0.6; }
.steps li:hover .icon-btn, .steps li .icon-btn:focus-visible { opacity: 1; }
.step-edit { display: grid; gap: 8px; width: 100%; padding: 6px 0 10px; }
.step-edit .row { flex-wrap: wrap; gap: 8px; }
.lane .btn { white-space: normal; text-align: left; }
.add-line { margin-top: 6px; }
.add-line .btn { color: var(--steel); }

.num-now { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.num-big { font-size: 26px; font-weight: 600; line-height: 1.1; }
.num-unit { color: var(--bone-2); font-size: 15px; }
.num-sub { margin-top: 2px; font-size: 13px; color: var(--steel); }
.num-empty { font-size: 14px; color: var(--bone-2); margin: 2px 0 2px; }
.lane .meter-row { margin-top: 10px; }
.lane-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.spark { display: block; width: 100%; height: 36px; margin-top: 8px; }

.empty { padding: 32px 0; color: var(--bone-2); }
.empty p + p { margin-top: 8px; }

/* ---------- хроника ---------- */

.narrow { max-width: 760px; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 26px; }
.composer .textarea { min-height: 46px; height: 46px; resize: none; }
.day-group + .day-group { margin-top: 22px; }
.day-label { position: sticky; top: var(--top); z-index: 5; padding: 8px 0; font-size: 13px; color: var(--steel); background: linear-gradient(var(--night) 70%, rgba(8, 11, 15, 0)); }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.entry-time { font-size: 13px; color: var(--steel); font-variant-numeric: tabular-nums; padding-top: 1px; }
.entry-who { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--bone-2); }
.entry-text { margin-top: 2px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.entry-text .goal-ref { color: var(--steel); }
.entry.note .entry-text { white-space: pre-line; }
.entry-note { display: block; margin-top: 2px; font-size: 13px; color: var(--steel); }
.entry.complete { background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 12%, transparent), rgba(0, 0, 0, 0) 60%); border-top-color: color-mix(in srgb, var(--pc) 40%, transparent); }
.entry.complete .entry-text { font-weight: 600; }
.more { margin-top: 18px; }

/* ---------- аналитика ---------- */

.card { border: 1px solid var(--line); border-radius: 4px; background: var(--cave); padding: 18px 16px 16px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-title { font-size: 17px; font-weight: 600; }
.card-sub { margin-top: 3px; font-size: 13px; color: var(--steel); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 6px; font-size: 13px; color: var(--bone-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.key-line { width: 16px; height: 2px; border-radius: 1px; background: var(--pc); }
.key-line.dash { background: repeating-linear-gradient(90deg, var(--steel) 0 4px, transparent 4px 7px); height: 2px; }
.key-rect { width: 12px; height: 8px; border-radius: 2px; background: var(--pc); }
.key-tick { width: 2px; height: 12px; background: var(--bone-2); }
.chart { position: relative; margin-top: 4px; min-width: 0; max-width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: rgba(232, 226, 213, 0.07); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { stroke: rgba(232, 226, 213, 0.2); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--steel); font-size: 11px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--bone); font-size: 12px; font-weight: 600; font-family: var(--font-ui); }
.chart .end-label tspan.light { fill: var(--steel); font-weight: 400; }
.chart .series { fill: none; stroke: var(--pc, var(--bone)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .plan-line { fill: none; stroke: var(--steel); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .ref { stroke: rgba(232, 226, 213, 0.22); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ref.target { stroke: rgba(232, 226, 213, 0.45); stroke-dasharray: 3 4; }
.chart .ref-label { fill: var(--steel); font-size: 11px; font-family: var(--font-ui); }
.chart .today { stroke: rgba(232, 226, 213, 0.28); stroke-width: 1; }
.chart .cross { stroke: rgba(232, 226, 213, 0.55); stroke-width: 1; }
.chart .end-dot { fill: var(--pc, var(--bone)); stroke: var(--cave); stroke-width: 2; }
.chart-hit { cursor: crosshair; touch-action: pan-y; }
.chart-empty { position: absolute; inset: 0 0 26px 34px; display: grid; place-items: center; text-align: center; padding: 0 16px; font-size: 14px; color: var(--bone-2); pointer-events: none; }
.chart-empty span { max-width: 30em; padding: 8px 12px; border-radius: 4px; background: rgba(13, 17, 22, 0.92); border: 1px solid var(--line); }
.tip {
  position: absolute; z-index: 10; pointer-events: none; min-width: 150px; padding: 9px 11px; border-radius: 4px;
  background: #1a2129; border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); font-size: 12px; color: var(--bone-2);
}
.tip-title { font-size: 12px; color: var(--steel); margin-bottom: 6px; }
.tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.tip-row b { color: var(--bone); font-size: 13px; font-weight: 600; min-width: 3em; font-variant-numeric: tabular-nums; }
.tip-row .key-line { width: 12px; }
.table-toggle { font-size: 13px; }
.data-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--steel); font-weight: 500; }
.table-scroll { max-height: 320px; overflow: auto; }

.stats-lanes { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 4px; background: var(--cave); margin-bottom: 16px; }
.stats-lane { padding: 16px; min-width: 0; }
.stats-lane + .stats-lane { border-left: 1px solid var(--line); }
.stats-lane-name { display: flex; align-items: center; gap: 8px; font: 400 22px/1.1 var(--font-display); }
.tiles { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.tile-label { font-size: 12px; color: var(--steel); line-height: 1.3; }
.tile-value { margin-top: 3px; font-size: 22px; font-weight: 600; line-height: 1.15; }
.tile-delta { margin-top: 2px; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--bone-2); }

.bars { margin-top: 8px; display: grid; gap: 14px; }
.bar-row-title { font-size: 14px; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.bar-line { position: relative; display: flex; align-items: center; gap: 10px; height: 14px; margin-top: 4px; }
.bar-track { position: relative; flex: 1; height: 8px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--pc); min-width: 2px; }
.bar-base { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(232, 226, 213, 0.08); }
.bar-plan { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--bone-2); border-radius: 1px; }
.bar-val { width: 3em; text-align: right; font-size: 12px; color: var(--bone-2); font-variant-numeric: tabular-nums; }
.bar-hit { position: absolute; inset: -6px 0; border-radius: 3px; }
.bar-hit:hover, .bar-hit:focus-visible { background: rgba(232, 226, 213, 0.04); }

.cal { display: grid; grid-template-columns: auto 1fr; gap: 6px; }
.cal-days { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: 3px; font-size: 10px; color: var(--steel-2); line-height: var(--cell); }
.cal-grid { display: grid; grid-template-rows: repeat(7, var(--cell)); grid-auto-flow: column; grid-auto-columns: var(--cell); gap: 3px; }
.cal-cell { width: var(--cell); height: var(--cell); border-radius: 2px; background: rgba(232, 226, 213, 0.05); }
.cal-cell.out { background: transparent; }
.cal-cell.future { background: rgba(232, 226, 213, 0.025); }
.cal-cell.l1 { background: color-mix(in srgb, var(--pc) 38%, var(--cave)); }
.cal-cell.l2 { background: color-mix(in srgb, var(--pc) 68%, var(--cave)); }
.cal-cell.l3 { background: var(--pc); }
.cal-cell.today { box-shadow: 0 0 0 1.5px var(--bone); }
.cal-months { display: flex; gap: 3px; font-size: 10px; color: var(--steel-2); margin: 0 0 4px 22px; height: 12px; position: relative; }
.cal-scale { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--steel); }
.cal-scale .cal-cell { --cell: 10px; }

.multiples { display: grid; gap: 22px; margin-top: 10px; }
.mult-title { font-size: 14px; color: var(--bone); margin-bottom: 6px; }
.mult-lanes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.mult-lanes > div { min-width: 0; padding-right: 12px; }
.mult-lanes > div + div { padding: 0 0 0 12px; border-left: 1px solid var(--line); }
.mult-cap { font-size: 12px; color: var(--steel); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }

@media (min-width: 760px) {
  .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .stats-grid .card + .card { margin-top: 0; }
  .stats-grid .span-2 { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- манифест и подвал ---------- */

.manifesto { position: relative; isolation: isolate; overflow: hidden; padding: 72px 0 80px; background: var(--black); text-align: center; }
.manifesto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.38; z-index: -1; }
.manifesto::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 60% at 50% 45%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.8)); }
.manifesto blockquote { margin: 0 auto; max-width: 34em; font: 400 clamp(21px, 3vw, 28px)/1.42 var(--font-display); color: #f2ecdf; white-space: pre-line; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7); }
.manifesto cite { display: block; margin-top: 20px; font-style: normal; font-size: 14px; color: var(--bone-2); }
.manifesto .icon-btn { margin: 14px auto 0; }

.footer { padding: 28px 0 calc(28px + var(--bottom-nav)); border-top: 1px solid var(--line); color: var(--steel); font-size: 13px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.footer .row { gap: 8px; }

/* ---------- листы (диалоги) ---------- */

dialog.sheet {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0; border-top: 1px solid var(--line-2);
  border-radius: 12px 12px 0 0; background: var(--cave); color: var(--bone); overflow: hidden;
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.68); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: sheet-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-inner { display: flex; flex-direction: column; max-height: 92dvh; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; min-width: 0; font: 400 24px/1.15 var(--font-display); }
.sheet-head .sheet-sub { display: block; font: 400 13px/1.3 var(--font-ui); color: var(--steel); margin-top: 3px; }
.sheet-body { overflow: auto; padding: 18px 18px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; overscroll-behavior: contain; }
.sheet-body > * { min-width: 0; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--cave); }
.sheet-foot .spacer { flex: 1; }
.sheet-section-title { font-size: 13px; color: var(--steel); margin-bottom: -8px; }
.form-error { display: flex; gap: 8px; align-items: flex-start; color: #f3c6c6; font-size: 14px; }
.form-error .icon { color: var(--danger); margin-top: 1px; }
@media (min-width: 760px) {
  dialog.sheet { width: min(600px, calc(100vw - 48px)); margin: auto; border: 1px solid var(--line-2); border-radius: 8px; max-height: 88vh; }
  dialog.sheet.wide { width: min(760px, calc(100vw - 48px)); }
  .sheet-inner { max-height: 88vh; }
}
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } }

.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px; border: 1px solid var(--line); border-radius: 4px; background: none; text-align: left; }
.list-btn:hover { border-color: var(--line-3); }
.list-btn[aria-current='true'] { border-color: var(--bone-2); }
.list-btn .grow { flex: 1; min-width: 0; }
.list-btn .t { font-weight: 600; }
.list-btn .s { font-size: 13px; color: var(--steel); }
.stack { display: grid; gap: 8px; }

.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cover-opt { position: relative; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.cover-opt img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.cover-opt span { position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }
.cover-opt[aria-pressed='true'] { border-color: var(--bone); }
.cover-opt[aria-pressed='true'] img { opacity: 1; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.history .h-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.history .h-meta { font-size: 12px; color: var(--steel); }

/* ---------- всплывающие сообщения ---------- */

.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-nav) + 16px); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 14px; border-radius: 6px; background: #1d252e; border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 14px; animation: sheet-in 0.2s ease-out; }
.toast .grow { flex: 1; }

/* ---------- загрузка ---------- */

.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash .mark { width: 96px; color: var(--steel-2); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { color: var(--bone-2); } }

@media (max-width: 759px) {
  .lane { padding: 12px 10px 16px; }
  .lane-head > div { padding: 8px 10px; }
  .goal-title { font-size: 17px; }
  .num-big { font-size: 22px; }
  .stats-lane { padding: 14px 12px; }
  .tile-value { font-size: 19px; }
  .card { padding: 16px 12px 14px; }
  .composer .btn span { display: none; }
}
@media (max-width: 380px) {
  .score-name { font-size: 22px; }
  .lane .btn.small { padding: 6px 10px; }
}
