/* ============================================================
   Randori — дизайн-система тренерского приложения
   Белый, чёрный, красный. Один акцент — цвет клуба (по умолчанию красный).
   ============================================================ */

@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/onest-cyrillic.fe2bd26ae82a.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/onest-latin.3db826ed1c5d.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/unbounded-cyrillic.3a5ed4d11365.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/unbounded-latin.8616dc355070.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --red: #d41f2c;
  --accent: var(--red);
  --accent-text: var(--accent);
  --accent-ink: #fff;
  --paper: #f8f6f2;
  --surface: #ffffff;
  --surface-2: #f1eee9;
  --text: #141416;
  --muted: #66615b;
  --line: #e6e1da;
  --ok: #17803d;
  --warn: #a15c00;
  --bad: #c8102e;

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgb(20 20 22 / .04), 0 8px 24px -12px rgb(20 20 22 / .12);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-fast: 140ms;
  --t: 200ms;

  --tabbar-h: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e0e10;
    --surface: #17171a;
    --surface-2: #1f1f23;
    --text: #f3f1ee;
    --muted: #a39d96;
    --line: #2b2b30;
    --ok: #3ccf6e;
    --warn: #f0a83a;
    --bad: #ff5a64;
    /* Красный текст на тёмном: фирменный красный даёт только 3.4:1. */
    --accent-text: #ff6b74;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.12; }
h1 { font-size: clamp(1.6rem, 5.5vw, 2.2rem); font-weight: 700; margin: .25rem 0 .35rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 .65rem; }
h3 { font-size: 1rem; font-weight: 600; }
.muted { color: var(--muted); margin: .25rem 0 1rem; }
.hint { color: var(--muted); font-size: .88rem; margin: 6px 0 12px; }
.error { color: var(--bad); font-size: .9rem; margin: 4px 0; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Каркас ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 18px 16px calc(var(--tabbar-h) + 40px); }
body:has(.savebar) .page { padding-bottom: 150px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  view-transition-name: topbar;
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; flex-shrink: 0; color: var(--text); text-decoration: none; font-weight: 700; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--display); font-size: .92rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.link { background: none; border: 0; color: var(--muted); font: inherit; min-height: 44px; cursor: pointer; padding: 0 6px; }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover, .link:hover { background: var(--surface-2); color: var(--text); }
}

/* Вкладки: сверху на широком экране, снизу как в приложении — на телефоне. */
.tabs { display: flex; gap: 2px; }
.tabs a {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; border-radius: 12px;
  transition: color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.tabs a[aria-current="page"] .icon { color: var(--accent-text); }
@media (hover: hover) and (pointer: fine) { .tabs a:hover { color: var(--text); } }

@media (max-width: 900px) {
  /* backdrop-filter у шапки сделал бы её точкой отсчёта для fixed-меню внутри неё. */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .tabs {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line); gap: 0;
    view-transition-name: tabbar;
  }
  .tabs a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; padding: 0 2px; font-size: .7rem; border-radius: 14px; }
  .tabs a[aria-current="page"] { background: transparent; }
  .tabs a[aria-current="page"]::before {
    content: ''; position: absolute; top: 2px; width: 44px; height: 30px; border-radius: 99px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
  }
  .tabs a .icon { position: relative; }
  body:has(.savebar) .tabs { display: none; }
}
@media (min-width: 901px) {
  .topbar .tabs { margin-left: 18px; }
}
@media (min-width: 901px) and (max-width: 1100px) { .topbar .brand-name { display: none; } .topbar .tabs a .icon { display: none; } .topbar .tabs a { padding: 0 10px; } }

.tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; margin-left: 2px; }
@media (max-width: 900px) { .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; } }

/* Магазин и настройки на телефоне прячутся во вкладку «Ещё», на широком экране — наоборот. */
.tabs .tab-narrow { display: none; }
@media (max-width: 900px) { .tabs .tab-wide { display: none; } .tabs .tab-narrow { display: flex; } }

/* ---------- Ученики ---------- */
.search { position: relative; display: flex; align-items: center; margin: 4px 0 8px; }
.search .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 50px; padding: 0 44px 0 46px; font: inherit; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search-clear { position: absolute; right: 4px; display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); text-decoration: none; font-size: 1.4rem; }
.students li { border-bottom: 1px solid var(--line); }
.student { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 2px; color: var(--text); text-decoration: none;
  transition: background-color var(--t-fast) ease; border-radius: 12px; }
.student:active { background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .student:hover { background: var(--surface-2); } }
.student-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.student-name { font-weight: 600; overflow-wrap: anywhere; }
.student-sub { color: var(--muted); font-size: .84rem; }
.student-score { display: grid; justify-items: end; gap: 2px; text-align: right; }
.student-score strong { font: 700 1.05rem/1 var(--display); font-variant-numeric: tabular-nums; }
.student-score small { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.chev { color: var(--muted); font-size: 1.4rem; line-height: 1; padding-left: 2px; }

/* Цвет обводки аватарки — пояс ученика. */
.avatar[class*="belt-"] { box-shadow: 0 0 0 3px var(--belt, transparent), 0 0 0 4px var(--line); }
.belt-6kyu { --belt: #f4f2ec; } .belt-5kyu { --belt: #f2c230; } .belt-4kyu { --belt: #f08a24; }
.belt-3kyu { --belt: #2f9e44; } .belt-2kyu { --belt: #1c6dd0; } .belt-1kyu { --belt: #7a4a24; } .belt-dan { --belt: #141416; }
.students .avatar { margin: 4px; }
/* Фото и картинки-аватарки (club/photos.py). Размеры: sm — в рейтинге, lg/xl — в карточке. */
.avatar.sm { width: 30px; height: 30px; font-size: .68rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.1rem; }
.avatar.xl { width: 112px; height: 112px; font-size: 1.8rem; }
.avatar.has-photo { overflow: hidden; background: var(--surface-2); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.ava { color: #fff; }
.avatar.ava .icon { width: 56%; height: 56%; }
.avatar.ava-star { background: #c27c0e; } .avatar.ava-flame { background: #e8590c; } .avatar.ava-bolt { background: #1c6dd0; }
.avatar.ava-crown { background: #9c6f00; } .avatar.ava-shield { background: #2f9e44; } .avatar.ava-boss { background: #7048e8; }
.avatar.ava-mountain { background: #0c8599; } .avatar.ava-trophy { background: #d41f2c; } .avatar.ava-medal { background: #364fc7; }
.avatar.ava-heart { background: #c2255c; } .avatar.ava-sprout { background: #5c940d; } .avatar.ava-target { background: #495057; }
.photo-card .photo-now { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; }
.photo-card .photo-now p { margin: 0; }
.photo-pending { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 0 0 14px; border-radius: var(--r); background: var(--surface-2); }
.photo-pending img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.photo-pending .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-card form { margin: 0 0 12px; }
.photo-card .btn[hidden] { display: none; }
.photo-pick { position: relative; display: inline-flex; }
.photo-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r); }
.photo-preview { display: none; align-items: center; gap: 12px; margin: 10px 0; }
.photo-preview.on { display: flex; }
.photo-preview img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.ava-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; margin: 8px 0 0; }
.ava-grid button { display: grid; place-items: center; padding: 0; min-height: 56px; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.ava-grid .avatar { width: 52px; height: 52px; }
.ava-grid button[aria-pressed="true"] .avatar { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent); }
.ava-grid .none { font-size: .72rem; font-weight: 600; color: var(--muted); }
.review-list { display: grid; gap: 12px; }
.athlete-head { display: flex; align-items: center; gap: 14px; }
.athlete-head h1 { margin: 0; }

/* ---------- «Ещё» ---------- */
.menu-list li { border-bottom: 1px solid var(--line); }
.menu-list form { margin: 0; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 4px; color: var(--text); text-decoration: none;
  background: none; border: 0; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.menu-item > span:not(.chev) { flex: 1; display: grid; gap: 2px; }
.menu-item small { color: var(--muted); font-weight: 400; font-size: .84rem; }
.menu-item .icon { color: var(--accent-text); }

/* ---------- Заявки ---------- */
.lead.is-new { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.lead-meta { color: var(--muted); margin: 6px 0 12px; font-size: .9rem; }
.lead-form { margin-top: 12px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; min-width: 48px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font: 600 .98rem/1.2 var(--font); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.wide { width: 100%; }
.btn.ghost { visibility: hidden; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
  .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
}
.back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: .92rem;
}
.back { transition: color var(--t-fast) ease; }

/* Телефон: стрелка «назад» в шапке вместо ссылки над заголовком, а название экрана
   появляется в шапке, когда большой заголовок уехал вверх (club/nav.js). */
.appbar-back, .appbar-title { display: none; }
@media (max-width: 900px) {
  .has-appbar .topbar .brand, .has-appbar .page > .back { display: none; }
  .appbar-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; max-width: 42vw; margin-left: -8px; padding-right: 6px;
    color: var(--accent-text); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .appbar-back .icon { width: 24px; height: 24px; }
  .appbar-title { display: block; position: absolute; left: 50%; transform: translateX(-50%); max-width: 40vw; font-weight: 700; font-size: .95rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity var(--t) var(--ease-out); pointer-events: none; }
  .topbar.show-title .appbar-title { opacity: 1; }
}
.menu-item .tab-badge { position: static; margin-left: auto; }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--text); } }

.actions { display: grid; gap: 8px; margin: 12px 0; }
.actions.two { grid-template-columns: 1fr 1fr; }
.actions.three { grid-template-columns: repeat(3, 1fr); }
.actions.three .btn { padding: 0 8px; font-size: .9rem; }

/* ---------- Карточки, чипы ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin: 12px 0; box-shadow: var(--shadow);
}
.card h2 { margin: 0; }
.card h2 a { color: inherit; text-decoration: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-link { display: block; color: inherit; text-decoration: none; transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) ease; }
.card-link:active { transform: scale(0.985); }
@media (hover: hover) and (pointer: fine) { .card-link:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700;
  padding: 5px 10px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.chip.accent { background: var(--accent); color: var(--accent-ink); }
.chip.accent::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s var(--ease-in-out) infinite; }
.chip.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 99px; color: var(--text); text-decoration: none;
  background: var(--surface); font-weight: 600; font-size: .9rem;
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) ease;
}
.chip-btn:active { transform: scale(0.96); }
.eyebrow-dark { margin: 0; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head a { font-weight: 600; font-size: .9rem; }

/* ---------- Списки ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.row .name { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); font-weight: 500; }
a.name { text-decoration: none; display: flex; align-items: center; min-height: 44px; }
.section-head a, .card-head h2 a { display: inline-flex; align-items: center; min-height: 44px; }
/* Серые подписи внутри строк без внешних отступов — иначе они съезжают вверх относительно соседей. */
.row .muted, .card-head .muted, .datebar .muted { margin: 0; }
.row .points { font-family: var(--display); font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums; }
.points.neg { color: var(--bad); }
.row.me { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 12px; padding-left: 10px; padding-right: 10px; border-color: transparent; }
.place { min-width: 2ch; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.avatar {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--surface-2); color: var(--text); font: 700 .8rem/1 var(--display); letter-spacing: 0;
}

/* ---------- Сообщения: всплывают сверху и не двигают страницу ---------- */
.messages { position: fixed; z-index: 50; top: 68px; left: 0; right: 0; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.messages .msg {
  pointer-events: auto; max-width: 560px; width: 100%; margin: 0; padding: 12px 16px;
  background: var(--text); color: var(--paper); border-radius: var(--r); box-shadow: 0 12px 32px -12px rgb(0 0 0 / .45);
  font-weight: 500; transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out);
}
@starting-style { .messages .msg { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.messages .msg.out { opacity: 0; transform: translateY(-10px); }
.messages .msg.is-error { background: var(--bad); color: #fff; }
.messages .msg.is-error::after { content: ' · нажмите, чтобы закрыть'; opacity: .8; font-weight: 400; }

/* ---------- Формы ---------- */
.form .field, .field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.form label, .form legend { display: block; margin: 0 0 6px; font-weight: 600; font-size: .92rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .auth input, .copy {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.form input:focus, .form select:focus, .form textarea:focus, .auth input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.form input[type=color] { padding: 4px; height: 48px; }
.form textarea { min-height: 200px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.check, .form .check { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.checks { display: grid; gap: 2px; }
.slot { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 10px; background: var(--surface); }
.slot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.slot-grid .field, .two-cols .field, .three-cols .field, .grid-emoji .field { margin: 0 0 8px; }
.slot-grid label { font-size: .82rem; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-emoji { display: grid; grid-template-columns: 70px 1fr 100px; gap: 10px; }
@media (max-width: 480px) {
  .grid-emoji { grid-template-columns: 64px 1fr; }
  .grid-emoji .field:nth-child(2) { grid-column: 2; }
  .grid-emoji .field:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 400px) {
  .slot-grid { grid-template-columns: 1fr 1fr; }
  .slot-grid .field:first-child { grid-column: 1 / -1; }
  .three-cols { grid-template-columns: 1fr 1fr; }
}
.danger-zone { margin-top: 36px; padding-top: 16px; border-top: 1px dashed var(--line); }
.form .btn + .btn { margin-top: 8px; }
.sample { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin: 0 0 16px; font-size: 14px; white-space: pre-wrap; }
.preview .line { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2ch; }
.preview.is-bad { background: color-mix(in srgb, var(--bad) 7%, transparent); border-radius: 10px; }
details.card summary { cursor: pointer; min-height: 44px; list-style: none; display: flex; align-items: center; }
details.card summary::-webkit-details-marker { display: none; }
.steps { padding-left: 1.2em; } .steps li { margin: 8px 0; }

/* Нижняя панель сохранения */
.savebar {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.savebar > * { max-width: 688px; margin-left: auto; margin-right: auto; }
.savebar .muted { margin: 0 auto 8px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Главная тренера ---------- */
.today { font-family: var(--display); font-size: .82rem; color: var(--muted); margin: 0; }
.group-card { position: relative; overflow: hidden; }
.group-card.is-today { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.group-card.is-today::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: var(--accent); opacity: .08; pointer-events: none;
}
.group-card .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin: 6px 0 14px; }
.group-card .meta span { display: inline-flex; align-items: center; gap: 6px; }
.group-card .meta .icon { width: 16px; height: 16px; }

/* ---------- Перекличка ---------- */
.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; }
.datebar strong { font-family: var(--display); font-weight: 600; font-size: .95rem; text-align: center; }
.mark { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 12px 0; min-width: 0; }
.mark legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }
.seg {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; background: var(--surface-2); border-radius: 14px; clear: both;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 11px;
  color: var(--muted); font-weight: 600; font-size: .92rem; cursor: pointer; user-select: none;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.seg label:active { transform: scale(0.96); }
.seg input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; }
.seg input:checked + .seg-present { background: var(--surface); color: var(--ok); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.seg input:checked + .seg-late { background: var(--warn); color: #fff; }
.seg input:checked + .seg-absent { background: var(--bad); color: #fff; }

/* ---------- Замер ---------- */
.measure-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.measure-row label { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.measure-row label .muted { display: block; margin: 0; font-weight: 500; font-size: .82rem; }
.measure-row input { text-align: center; font: 600 1.15rem/1 var(--display) !important; font-variant-numeric: tabular-nums; }
.measure-row .error { grid-column: 1 / -1; margin: 0; }

/* ---------- Уровень, статы, награды ---------- */
.level-card {
  position: relative; overflow: hidden; isolation: isolate;
  background: #17171a; color: #f8f6f2; border-radius: var(--r-lg); padding: 20px; margin: 14px 0;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06);
}
.level-card::before {
  content: ''; position: absolute; z-index: -1; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%;
  background: var(--accent);
}
.level-card .eyebrow { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.level-card .level-name { font: 700 1.9rem/1.1 var(--display); letter-spacing: -.02em; margin: 6px 0 8px; }
.level-card .level-points { margin: 0 0 14px; opacity: .85; }
.level-card .level-points strong { font-family: var(--display); font-size: 1.1rem; }
.level-card .muted { color: inherit; opacity: .7; margin: 10px 0 0; font-size: .9rem; }
.progress { height: 10px; border-radius: 99px; background: rgb(255 255 255 / .18); overflow: hidden; }
.progress span { display: block; height: 100%; background: #fff; border-radius: inherit; transform-origin: left; }
.progress.dark { background: var(--surface-2); margin: 8px 0 14px; }
.progress.dark span { background: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 6px; text-align: center; }
.stats strong { display: block; font: 700 1.35rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .72rem; line-height: 1.2; display: block; margin-top: 4px; }

.badges, .collection { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.badges li, .collection li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px;
  font-weight: 600; font-size: .9rem; line-height: 1.3;
}
.badges small, .collection small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; margin-top: 4px; }
.badge-emoji { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 50%; background: var(--surface-2); font-size: 1.4rem; }
.badges li.locked, .collection li.locked { opacity: .5; border-style: dashed; box-shadow: none; }
.collection li.open { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.copy { font-size: .82rem; }

/* ---------- Таблицы, челленджи, босс ---------- */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 8px; }
.tbl th, .tbl td { padding: 10px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl tbody th, .tbl thead th:first-child { text-align: left; font-weight: 500; }
.tbl thead th { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tbl .gain, .gain { color: var(--ok); font-weight: 700; }
.links { font-size: .9rem; white-space: nowrap; font-weight: 600; }
/* Карточки уровня и босса всегда тёмные: в тёмной теме var(--text) светлый и карточка выбивалась. */
.boss-card { background: #17171a; color: #f8f6f2; border: 0; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.boss-card .eyebrow-dark { color: inherit; opacity: .65; }
.boss-card h2 { margin: 6px 0 12px; font-size: 1.5rem; }
.boss-card .muted { color: inherit; opacity: .75; }
.hp-bar { height: 14px; border-radius: 99px; background: rgb(255 255 255 / .14); overflow: hidden; margin-bottom: 10px; }
.hp-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff7a3d); transform-origin: left; }
.challenge-now h2 { margin: 6px 0; }

/* ---------- Приёмы ---------- */
.seg-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.seg-links a {
  flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem;
}
.seg-links a[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--paper); }
.tech-row { border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; margin: 0; }
.tech-row legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.tech-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tech {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; font-size: .88rem; cursor: pointer; background: var(--surface);
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-fast) var(--ease-out);
}
.tech:active { transform: scale(0.97); }
.tech:has(input:checked) { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.tech input { width: 20px; height: 20px; accent-color: var(--ok); flex: none; }

/* ---------- Прогресс у родителя ---------- */
.progress-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.progress-row .muted { margin: 2px 0 0; font-size: .88rem; }
.spark { width: 120px; height: 38px; color: var(--accent-text); overflow: visible; }

/* ---------- Вход ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: 100%; max-width: 380px; }
.auth .brand-mark { width: 56px; height: 56px; margin-bottom: 18px; }
.auth h1 { margin-bottom: 4px; }
.auth label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .92rem; }
.auth .btn { margin-top: 22px; }
.auth .back { margin-top: 18px; }

/* ============================================================
   Движение
   ============================================================ */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise-soft { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Экраны тренера открываются десятки раз в день — короткое появление, без долгих эффектов. */
.page > * { animation: rise 220ms var(--ease-out) both; }
.page > *:nth-child(2) { animation-delay: 30ms; }
.page > *:nth-child(3) { animation-delay: 60ms; }
.page > *:nth-child(4) { animation-delay: 90ms; }
.page > *:nth-child(n+5) { animation-delay: 120ms; }
/* Сдвиг у родителя ломает position: fixed у панели «Сохранить» — такие формы только проявляются. */
.page > :has(.savebar), .page > .savebar { animation-name: rise-soft; }

/* Страница ребёнка — редкий экран: прогресс заполняется, награды выскакивают по очереди. */
.parent .progress span, .parent .hp-bar span { animation: grow 1100ms var(--ease-out) 250ms both; }
.parent .badges li, .parent .collection li { animation: pop 380ms var(--ease-out) both; }
.parent .badges li:nth-child(1), .parent .collection li:nth-child(1) { animation-delay: 300ms; }
.parent .badges li:nth-child(2), .parent .collection li:nth-child(2) { animation-delay: 350ms; }
.parent .badges li:nth-child(3), .parent .collection li:nth-child(3) { animation-delay: 400ms; }
.parent .badges li:nth-child(4), .parent .collection li:nth-child(4) { animation-delay: 450ms; }
.parent .badges li:nth-child(5), .parent .collection li:nth-child(5) { animation-delay: 500ms; }
.parent .badges li:nth-child(6), .parent .collection li:nth-child(6) { animation-delay: 550ms; }
.parent .badges li:nth-child(n+7), .parent .collection li:nth-child(n+7) { animation-delay: 600ms; }
.parent .spark polyline { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 1200ms var(--ease-out) 400ms forwards; }

/* Native page navigation keeps menu taps responsive during rapid switches. */
@view-transition { navigation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; animation-timing-function: var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .page > *, .parent .badges li, .parent .collection li { animation: rise-soft 200ms ease both !important; animation-delay: 0ms !important; }
  .parent .progress span, .parent .hp-bar span { animation: none; }
  .parent .spark polyline { animation: none; stroke-dashoffset: 0; }
  .chip.accent::before { animation: none; }
  .btn:active, .seg label:active, .tech:active, .card-link:active, .chip-btn:active { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .messages .msg { transition: opacity var(--t) ease; }
}

/* ---------- PWA: установка и очередь ---------- */
.install-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "img text close" "go go go"; align-items: center; gap: 10px 12px; padding: 12px; margin: 0 0 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.install-card [data-install-go] { grid-area: go; }
.install-card [data-install-close] { grid-area: close; align-self: start; }
@media (min-width: 560px) {
  .install-card { grid-template-columns: auto 1fr auto auto; grid-template-areas: "img text go close"; }
  .install-card [data-install-close] { align-self: center; }
}
.install-card[hidden], .queue-banner[hidden], .ios-sheet[hidden] { display: none; }
.install-card img { grid-area: img; border-radius: 12px; }
.install-text { grid-area: text; min-width: 0; display: grid; gap: 2px; }
.install-text small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.install-card .btn { min-height: 44px; padding: 0 14px; }
.ios-sheet { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; background: rgb(0 0 0 / .45); }
.ios-sheet-box { background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-up 260ms var(--ease-out) both; }
.ios-sheet-box h2 { margin: 0 0 12px; }
.ios-sheet-box ol { margin: 0 0 18px; padding-left: 1.2em; line-height: 1.7; }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); color: #1a73e8; font-weight: 800; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.queue-banner { position: sticky; top: 64px; z-index: 19; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0; padding: 8px 16px; background: color-mix(in srgb, var(--warn) 18%, var(--paper)); border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  font-weight: 600; font-size: .9rem; }
.queue-banner > span { display: flex; align-items: center; gap: 8px; }
.queue-banner .btn { flex: none; min-height: 40px; padding: 0 12px; font-size: .88rem; white-space: nowrap; }
.offline-box .btn + .btn { margin-top: 10px; }
.offline-box .brand-mark { width: 56px; height: 56px; margin-bottom: 18px; }
@media (prefers-reduced-motion: reduce) { .ios-sheet-box { animation: none; } }

/* Экскурсия по экрану (tour.js) */
.tour-help { font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.tour-dim { position: fixed; z-index: 1000; inset: 0; background: rgb(10 10 12 / .6); }
.tour-ring { position: fixed; z-index: 1001; top: 0; left: 0; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent);
  transition: transform 240ms var(--ease-out); }
.tour-card { position: fixed; z-index: 1002; top: 0; left: 0; width: min(360px, calc(100vw - 32px)); padding: 18px;
  border-radius: var(--r); background: var(--surface); color: var(--text); box-shadow: 0 20px 48px -16px rgb(0 0 0 / .5);
  opacity: 0; transition: opacity 180ms var(--ease-out); }
.tour-card.in { opacity: 1; }
.tour-card h2 { margin: 2px 0 6px; font-size: 1.15rem; }
.tour-text { margin: 0 0 16px; color: var(--muted); line-height: 1.45; }
.tour-count { margin: 0; font-size: .8rem; font-weight: 700; color: var(--accent-text); }
.tour-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.tour-actions .btn { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }

/* Значки вместо эмодзи (club/icons.py) */
.medal-n { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; font-weight: 800; font-size: .85em;
  font-variant-numeric: tabular-nums; color: #3b2a00; vertical-align: middle; }
.medal-1 { background: linear-gradient(145deg, #ffe27a, #e7b416); }
.medal-2 { background: linear-gradient(145deg, #f1f1f1, #b9bcc2); color: #2b2d31; }
.medal-3 { background: linear-gradient(145deg, #f2b98a, #c27a43); color: #3a1d06; }
.badge-emoji .icon { width: 22px; height: 22px; color: var(--accent-text); }
.chip-btn .icon, .award-list .icon { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; color: var(--accent-text); }
h1 > .icon, h2 > .icon, h3 > .icon { width: .9em; height: .9em; margin-right: .3em; vertical-align: -.08em; color: var(--accent-text); }
.row .name > .icon, .student-row small .icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--accent-text); }
.btn > .icon { color: currentColor; }
.icon-pick { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; }
.icon-pick .icon { width: 28px; height: 28px; padding: 4px; border-radius: 8px; background: var(--accent); color: #fff; }
.icon-pick span { font-size: .9rem; color: var(--muted); }
.icon-dialog { width: min(420px, calc(100vw - 32px)); padding: 18px; border: 0; border-radius: var(--r); background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / .5); }
.icon-dialog::backdrop { background: rgb(10 10 12 / .55); }
.icon-dialog .icon-picker { margin-bottom: 14px; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-option { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.icon-option[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.grid-emoji { grid-template-columns: 1fr 100px; }
.grid-emoji .field:first-child { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-emoji .field:nth-child(2) { grid-column: 1; } .grid-emoji .field:nth-child(3) { grid-column: 2; } }
/* Приёмы: сдан — галочка на красном, не сдан — пустой круг (замок читался как «закрыто»). */
.collection li.open .badge-emoji { background: var(--accent); }
.collection li.open .badge-emoji .icon { color: #fff; }
.collection li.locked .badge-emoji { background: transparent; border: 2px dashed var(--line); }

/* Установленное приложение на iPhone (viewport-fit=cover): в альбомной ориентации вырез экрана сбоку,
   внизу полоса «домой». Отступы не меньше безопасной зоны. */
:root { --sab: env(safe-area-inset-bottom, 0px); }
.topbar, .page, .savebar, .messages {
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
.messages { top: calc(68px + env(safe-area-inset-top)); }
@media (max-width: 899px) {
  .tabs { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
}

/* ---------- План развития (/plan/) ---------- */
.plan-summary { margin: 0 0 18px; line-height: 1.6; }
.plan-stage { margin: 28px 0 0; }
.plan-stage h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.plan-stage-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff; font-size: .95rem; }
.plan-item { margin: 12px 0 0; }
/* legend у fieldset браузер кладёт на рамку; float возвращает его внутрь карточки. */
.plan-title { float: left; width: 100%; display: flex; gap: 10px; margin: 0 0 6px; font-weight: 700; line-height: 1.35; padding: 0; }
.plan-title + * { clear: both; }
.plan-no { flex: none; min-width: 2ch; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan-why { margin: 0 0 12px; color: var(--muted); font-size: .92rem; }
.plan-comment { margin-top: 10px; }
.plan-comment summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--accent-text); font-weight: 600; }
.plan textarea { width: 100%; min-height: 96px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.plan textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.plan fieldset { min-width: 0; }
.plan-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.plan-stage { scroll-margin-top: 80px; }
label.plan-title { float: none; }
.plan-open { margin: 0 0 12px; }
.plan-rules { margin: 8px 0 14px; padding-left: 1.2em; line-height: 1.55; }
.plan-answered, .plan-done { margin: 14px 0 0; }
.plan-answered > summary, .plan-done > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--muted); }
.plan-done > summary::before { content: '✓'; color: var(--ok); font-weight: 700; }
.plan-done ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.plan-done li { display: flex; gap: 10px; color: var(--muted); line-height: 1.4; }
.plan-partial { margin: -4px 0 12px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .9rem; }
.plan-ourselves { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); line-height: 1.6; }

/* ---------- Главная: блок «Сегодня» ---------- */
.today-box { margin: 10px 0 22px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.today-box h2 { margin: 0 0 6px; font-size: 1.15rem; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.today-task:first-child { border-top: 0; }
.today-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--accent-text); }
.today-task.is-accent .today-icon { background: var(--accent); color: #fff; }
.today-text { display: grid; gap: 2px; min-width: 0; }
.today-text strong { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.today-text small { color: var(--muted); font-size: .85rem; }
.today-task .btn { min-height: 44px; padding: 0 14px; white-space: nowrap; }
.today-done { display: flex; align-items: center; gap: 8px; margin: 10px 0 18px; color: var(--ok); font-weight: 600; }
.today-done .icon { width: 20px; height: 20px; }
@media (max-width: 380px) {
  .today-task { grid-template-columns: auto minmax(0, 1fr); }
  .today-task .btn { grid-column: 2; justify-self: start; }
}

/* ---------- Итог переклички (страница группы) ---------- */
.roll-summary { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); margin: 0 0 14px; }
.roll-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 700; color: var(--ok); }
.roll-title .icon { width: 20px; height: 20px; }
.roll-counts { margin: 0 0 6px; }
.roll-line { margin: 4px 0 0; }
.roll-news { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.roll-news li { display: flex; align-items: flex-start; gap: 10px; }
.roll-news .icon { width: 20px; height: 20px; flex: none; color: var(--accent-text); margin-top: 1px; }
.roll-summary .hint { margin: 10px 0 0; }

/* ---------- Челленджи: быстрый запуск ---------- */
.quick-challenge h2 { margin: 0 0 4px; }
.quick-label { margin: 6px 0 8px; font-weight: 600; font-size: .92rem; }
.quick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.quick-list .btn { min-height: 48px; justify-content: flex-start; gap: 8px; padding: 6px 12px; text-align: left; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.quick-list .icon { color: var(--accent-text); flex: none; }

/* ---------- «Герои тренировки» в итоге переклички ---------- */
.heroes { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.heroes-title { margin: 0 0 10px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.hero-chip { position: relative; }
.hero-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.hero-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.hero-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero-chip input:disabled + span { opacity: .45; cursor: default; }
.hero-chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }

/* ---------- Лента наград ---------- */
.awards-day h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.award-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.award-row .badge-emoji { margin: 0; }
.award-main { display: grid; gap: 2px; min-width: 0; }
.award-main small { color: var(--muted); font-size: .85rem; }
.award-row .btn { min-height: 44px; padding: 0 12px; }

/* ---------- Замер: «−»/«+» и режим «по одному» ---------- */
.measure-mode { margin: 0 0 12px; }
.measure-input { display: grid; grid-template-columns: 44px 96px 44px; gap: 6px; align-items: center; }
.step-btn { min-height: 44px; padding: 0; font-size: 1.4rem; font-weight: 700; }
.measure-row[hidden] { display: none; }
.step-progress { margin: 0 0 8px; }
.step-nav { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; margin: 0 0 8px; }
.step-nav[hidden] { display: none; }
.step-nav .btn { min-height: 48px; padding: 0 8px; }
.step-mode .measure-row { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 24px 0 18px; border-bottom: 0; }
.step-mode .measure-row label { font: 700 1.5rem/1.2 var(--display); }
.step-mode .measure-row label .muted { font: 500 1rem/1.4 var(--font); margin-top: 6px; }
.step-mode .measure-input { grid-template-columns: 80px minmax(120px, 160px) 80px; gap: 12px; margin-top: 18px; }
.step-mode .step-btn { min-height: 80px; border-radius: 22px; font-size: 2.2rem; }
.step-mode .measure-input input { min-height: 80px; font-size: 2.4rem !important; }
.step-mode [data-save][hidden] { display: none; }
.step-nav .btn[hidden] { display: none; }
.measure-mode input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* Перекличка: кнопка «к сегодняшней» при просмотре прошлых дат. */
.datebar-today { margin: 6px 0 0; text-align: center; }
.datebar-today .btn { min-height: 44px; }

/* Телефон в альбомной ориентации: шапка не закреплена, панель «Сохранить» — одной строкой,
   чтобы для списка детей оставалось место. */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { position: static; }
  .savebar { display: flex; align-items: center; gap: 14px; padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .savebar > * { margin: 0; max-width: none; }
  .savebar .muted { flex: 1; text-align: left; }
  .savebar .btn.wide { width: auto; min-width: 200px; }
  body:has(.savebar) .page { padding-bottom: 90px; }
}

.note-text { width: 100%; min-height: 64px; padding: 10px 14px; font: inherit; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); margin: 0 0 10px; }

.coach-family-form{max-width:720px}.coach-family-form input:not([type=checkbox]):not([type=hidden]),.coach-family-form select,.coach-family-form textarea{display:block;width:100%;max-width:100%;box-sizing:border-box;padding:12px;border:1px solid #cbd0d0;border-radius:10px;font:inherit;background:#fff;color:#20242a}.coach-family-form label{display:block;margin:14px 0 6px;font-weight:600}.coach-family-form input[type=checkbox]{width:20px;height:20px}

.schedule-filter button[hidden]{display:none!important}

@media(max-width:420px) { .club-settings-form .two-cols { grid-template-columns:minmax(0,1fr); } }

/* Short sign-in titles should not inherit the landing headline measure. */
.auth h1 { max-width: none; font-size: 28px; line-height: 1.2; }

/* Keep long student names and the edit action within narrow cards. */
.athlete-heading { flex-wrap: wrap; align-items: center; }
.athlete-heading .athlete-head { flex: 1 1 240px; min-width: 0; }
.athlete-heading .athlete-head > a { flex: none; }
.athlete-heading h1 { min-width: 0; overflow-wrap: anywhere; }
.athlete-heading > .screen-link { flex: none; }
