/* Кольори школи — як у діагностичній карті: спокійний зелений і теплий кремовий. Фон і текст — з теми Telegram, щоб не було шва з шапкою. */
:root {
  color-scheme: light;
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #1c2b2a);
  --surface: #f7f4ee;
  --line: #e8e2d6;
  --muted: #5c6966;
  --accent: #3f6b54;
  --accent-text: #ffffff;
  --accent-soft: #e6eee8;
  --accent-ink: #3f6b54;
}
:root.dark {
  color-scheme: dark;
  --text: var(--tg-theme-text-color, #f3f1ec);
  --surface: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .11);
  --muted: #abb5b1;
  --accent-soft: rgba(143, 195, 165, .18);
  --accent-ink: #9fd0b4;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; }
main { max-width: 600px; margin: 0 auto; padding: 20px 20px calc(40px + env(safe-area-inset-bottom)); }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; margin: 0 0 8px; text-wrap: balance; overflow-wrap: anywhere; }
h2 { font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--muted); margin: 32px 0 8px; }
p { margin: 0 0 16px; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { touch-action: manipulation; transition: opacity .15s ease-out, transform .15s ease-out; }
button:active, a:active { opacity: .75; transform: scale(.985); }
button:focus-visible, a:focus-visible, video:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
svg { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); font-size: 15px; }

/* Завантаження: сірі смужки замість порожнього екрана */
.wait { display: grid; gap: 12px; padding-top: 8px; }
.wait span { height: 60px; border-radius: 16px; background: var(--surface); animation: pulse 1.2s ease-in-out infinite alternate; }
.wait span:first-child { height: 32px; width: 70%; }
@keyframes pulse { to { opacity: .45; } }

.back { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; margin: -12px 0 4px -6px; padding: 0 12px 0 0; border: 0; background: none;
  color: var(--accent-ink); font-weight: 500; }

progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden;
  background: var(--accent-soft); margin: 16px 0 8px; }
progress::-webkit-progress-bar { background: var(--accent-soft); }
progress::-webkit-progress-value { background: var(--accent-ink); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent-ink); }

.main-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; margin: 12px 0 0; padding: 14px 20px;
  border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-text); font-weight: 600; text-align: center; text-decoration: none; }
.second-button { background: none; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--line); }

/* Картка «Продовжити» — єдина яскрава дія на екрані */
.continue { display: flex; align-items: center; gap: 16px; width: 100%; margin: 24px 0 0; padding: 18px 20px; border: 0; border-radius: 20px;
  background: var(--accent); color: var(--accent-text); text-align: left; }
.continue span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; line-height: 1.35; }
.continue small { display: block; font-size: 15px; font-weight: 400; margin-bottom: 2px; }
.continue svg { width: 40px; height: 40px; stroke-width: 1.25; }

.list { border-radius: 20px; background: var(--surface); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 14px 16px; border: 0; background: none; color: inherit;
  text-align: left; text-decoration: none; line-height: 1.35; }
.row + .row { border-top: 1px solid var(--line); }
.row .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .time { color: var(--muted); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row > svg { color: var(--accent-ink); }
.mark { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center; }
.mark.done { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.mark svg { width: 16px; height: 16px; stroke-width: 2.5; }
.note { margin: 16px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); font-size: 16px; }

video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 75vh; background: #000; border-radius: 20px; margin: 16px 0 20px; }
.text { white-space: pre-line; overflow-wrap: anywhere; }
.files { margin: 0 0 20px; }
.page { display: block; width: 100%; min-height: 200px; height: auto; margin: 12px 0 0; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); }

.closed { padding-top: 14vh; text-align: center; }
.closed p { color: var(--muted); max-width: 34ch; margin: 0 auto 24px; }
.badge { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.badge svg { width: 32px; height: 32px; stroke-width: 2; }

@media (max-width: 350px) { main { padding-left: 16px; padding-right: 16px; } h1 { font-size: 25px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } button:active, a:active { transform: none; } }
