@font-face { font-family: "Playfair Display"; font-weight: 700 900; font-display: swap;
  src: url(/static/fonts/pf_cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Playfair Display"; font-weight: 700 900; font-display: swap;
  src: url(/static/fonts/pf_lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2212; }
@font-face { font-family: "Open Sans"; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/os_cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Open Sans"; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/os_lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2212; }

:root {
  --teal: #72C7C4; --teal-d: #2E8C88; --teal-l: #E7F5F4;
  --burg: #6E1934; --burg-l: #F6E8EC;
  --slate: #50575D; --ink: #24292E; --muted: #626A71;
  --bg: #F3F6F6; --card: #FFFFFF; --line: #DDE4E5;
  --ok: #1F7A4D; --ok-l: #E4F4EB; --warn: #9A5B00; --warn-l: #FFF3DC;
  --radius: 16px; --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1C2023; --card: #262B2F; --ink: #EEF2F3; --muted: #A9B3B8; --line: #3A4146;
    --teal-l: #1F3534; --burg-l: #3A2129; --ok-l: #1D3328; --warn-l: #3A2F1C; --teal-d: #8DD6D3; --ok: #6FD3A0; --warn: #F2B866; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: "Open Sans", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); min-height: 100vh; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; margin: 0; line-height: 1.15; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: var(--burg); color: #fff; }
.top-logo { width: 40px; height: 40px; background: #fff; border-radius: 10px; padding: 3px; }
.top-text { flex: 1; min-width: 0; }
.brand { font-family: "Playfair Display", Georgia, serif; font-weight: 900; font-size: 22px; line-height: 1; }
.sub { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.icon-btn.light { background: rgba(255,255,255,.18); }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.section-title { font-size: 26px; color: var(--burg); margin: 6px 0 12px; }
@media (prefers-color-scheme: dark) { .section-title { color: var(--teal); } }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid var(--line); }
.card.accent { border-left: 6px solid var(--teal); }
.pair-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pair-time { font-weight: 700; color: var(--burg); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pair-time { color: var(--teal); } }
.pair-num { font-size: 13px; color: var(--muted); }
.pair-subj { font-weight: 700; font-size: 17px; margin: 4px 0 2px; }
.meta { font-size: 14px; color: var(--muted); }
.meta span + span::before { content: " · "; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--teal-l); color: var(--teal-d); }
.badge.burg { background: var(--burg-l); color: var(--burg); }
@media (prefers-color-scheme: dark) { .badge.burg { color: #F0A9BC; } }
.badge.ok { background: var(--ok-l); color: var(--ok); }
.badge.warn { background: var(--warn-l); color: var(--warn); }
.badge.grey { background: var(--line); color: var(--muted); }

.row { display: flex; gap: 8px; margin-top: 12px; }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; font-size: 15px; flex: 1; min-height: 46px; }
.btn.primary { background: var(--burg); color: #fff; }
.btn.teal { background: var(--teal); color: #12302F; }
.btn.ghost { background: var(--teal-l); color: var(--teal-d); }
.btn.line { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn[disabled] { opacity: .5; }
.btn.wide { width: 100%; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; }
.chip.active { background: var(--burg); border-color: var(--burg); color: #fff; }

.daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.daynav .title { flex: 1; text-align: center; font-weight: 700; }
.navbtn { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: 18px; }

.list-btn { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; color: var(--ink); font-size: 15px; }
.list-btn:active { background: var(--teal-l); }
.input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink); font-size: 16px; }
.input:focus { outline: 2px solid var(--teal); border-color: transparent; }

.hero { text-align: center; padding: 18px 8px 8px; }
.hero img { width: 120px; height: 120px; }
.hero h1 { font-size: 38px; color: var(--burg); margin-top: 8px; }
@media (prefers-color-scheme: dark) { .hero h1 { color: var(--teal); } }
.hero p { color: var(--muted); }
.consent { font-size: 14px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.back { background: none; border: 0; color: var(--teal-d); font-weight: 700; padding: 6px 0; margin-bottom: 6px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.person { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person .name { flex: 1; font-weight: 600; }
.person video { width: 100%; border-radius: 12px; margin-top: 8px; background: #000; max-height: 360px; }
.group-h { font-weight: 700; margin: 14px 0 4px; }
.stat-row { display: flex; gap: 8px; margin-bottom: 12px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-family: "Playfair Display", Georgia, serif; font-size: 26px; color: var(--burg); }
@media (prefers-color-scheme: dark) { .stat b { color: var(--teal); } }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tab { flex: 1; height: var(--tabs-h); border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tab-ico { width: 24px; height: 24px; }
.tab.active { color: var(--burg); }
@media (prefers-color-scheme: dark) { .tab.active { color: var(--teal); } }

.sheet { position: fixed; inset: 0; z-index: 20; background: #0E1012; display: flex; align-items: stretch; justify-content: center; }
.rec-box { width: 100%; max-width: 560px; display: flex; flex-direction: column; padding: calc(12px + var(--safe-t)) 16px calc(16px + var(--safe-b)); color: #fff; }
.rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rec-label { font-size: 13px; opacity: .8; text-transform: uppercase; letter-spacing: .08em; }
.rec-code { font-family: "Playfair Display", Georgia, serif; font-weight: 900; font-size: 34px; color: var(--teal); line-height: 1.1; }
.rec-stage { position: relative; flex: 1; margin: 12px 0; border-radius: 18px; overflow: hidden; background: #000; min-height: 260px; }
.rec-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#rec-playback { object-fit: contain; }
.rec-timer { position: absolute; top: 12px; left: 12px; background: #C0263F; color: #fff; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.rec-hint { font-size: 14px; opacity: .85; margin: 0 0 10px; }
.rec-actions { display: flex; gap: 8px; }
.rec-actions .btn.ghost { background: rgba(255,255,255,.14); color: #fff; }
.rec-deadline { text-align: center; font-size: 13px; opacity: .75; margin-top: 8px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs-h) + var(--safe-b) + 12px); z-index: 30; max-width: 560px; margin: 0 auto;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--burg); border-radius: 50%; margin: 30px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.countdown { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--teal-d); }
.countdown:empty { display: none; }
.countdown.open { color: var(--burg); }
@media (prefers-color-scheme: dark) { .countdown.open { color: #F0A9BC; } }
