/* Ocean — стиль «Табло соревнований» в цветах формы, вариант «Белый»: белое меню, синее табло с голубыми цифрами, бледно-голубые дорожки. */
@font-face { font-family: "Golos Text"; src: url("/fonts/GolosText-var.woff") format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/fonts/Oswald-var.woff") format("woff"); font-weight: 200 700; font-display: swap; }

:root {
  /* Палитра сайта oceansport.uz — цвета формы: белая футболка, синие шорты, голубые гетры */
  /* Синие блоки: табло, верхняя панель, шапки окон — синий шорт */
  --board: #26328c;
  --board-2: #2c3895;
  --board-3: #3d49a3;
  --board-ink: #ffffff;
  --board-mute: #c3cbef;
  --amber: #92b4e3;        /* голубой гетр: акцент на тёмном — цифры табло, «сегодня», активный пункт */
  --amber-ink: #171d5d;
  /* Синий шорт: кнопки, ссылки, заголовки, дорожки */
  --deep: #26328c;
  --deep-2: #1d2774;
  --lane: #26328c;
  --lane-2: #2e3b9c;
  --lane-dark: #1a2368;
  --lane-enr: #92b4e3;
  --link: #26328c;
  --tile: #f5f5f8;         /* фон страниц — затенённый белый */
  --surface: #ffffff;
  --grout: #e1e2ec;        /* линии */
  --grout-2: #ededf3;      /* светлые плашки, шапки таблиц */
  --field: #b9bcd4;
  --ink: #1a1e40;
  --ink-2: #4f5378;
  --ink-3: #585d82;
  /* Статусы: всегда вместе с текстом */
  --ok: #11663a;  --ok-bg: #dcf3e6;  --ok-line: #a9dcbf;
  --warn: #8a5a00; --warn-bg: #fff1c4; --warn-line: #f0d68a;
  --bad: #b3261e; --bad-ink: #9a2f12; --bad-bg: #ffe2d8; --bad-line: #f5b9a6;
  --ice: #26328c; --ice-bg: #e8effa; --ice-line: #c4d5ef;
  --grey: #4f5378; --grey-bg: #eeeff4; --grey-line: #d8d9e5;
  --focus: 0 0 0 2px #ffffff, 0 0 0 4px var(--deep);
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Oswald", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--tile); color: var(--ink); line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
.board, .topbar, .modal-head, .coach-team-head, .dd-head, .days, .tcard.dark, .lanes, .auth-page { --focus: 0 0 0 2px var(--board), 0 0 0 4px #ffffff; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--deep); margin: 0; letter-spacing: 0; }
h1 { font-size: 2.1rem; line-height: 1.1; font-weight: 600; }
h1:focus, h1[tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
h2 { font-size: 1.35rem; line-height: 1.25; font-weight: 600; margin-bottom: var(--s3); }
h3 { font-size: 1.1rem; line-height: 1.3; font-weight: 600; margin-bottom: var(--s2); }
p { margin: 0 0 var(--s3); }
.ico { flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Каркас ---------- */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.layout > div { min-width: 0; }
.sidebar { background: var(--surface); color: var(--ink); padding: var(--s4) var(--s3); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s4); box-shadow: inset -1px 0 0 var(--grout); }
.brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s2); color: #fff; text-decoration: none; }
.brand-side { flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--s2) var(--s2) var(--s1); }
.brand-side img { width: 150px; height: auto; display: block; }
.brand-side span { font-family: var(--font-display); font-size: .9rem; color: var(--ink-2); padding-left: 2px; }
.brand-auth { flex-direction: column; gap: 8px; }
.brand-auth img { width: min(230px, 78%); height: auto; display: block; }
.brand-auth span { font-family: var(--font-display); font-size: 1rem; color: var(--ink-2); }
.brand-top img { height: 26px; width: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; min-height: 44px; font-weight: 500; font-size: .95rem; }
.nav a .lbl { flex: 1; }
.nav a:hover { background: var(--tile); color: var(--deep); }
.nav a.active { background: var(--ice-bg); color: var(--deep); }
.nav a.active .ico { color: var(--deep); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--deep); }
.nav .count { background: var(--grout-2); color: var(--ink); border-radius: 6px; padding: 0 7px; font-family: var(--font-display); font-size: .85rem; line-height: 22px; min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.nav .count.hot { background: var(--deep); color: #fff; }
.nav-sep { height: 1px; background: var(--grout); margin: var(--s2) var(--s2); }
.userbox { margin-top: auto; padding: var(--s3) var(--s2) 0; border-top: 1px solid var(--grout); }
.userbox .who { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.userbox .avatar, .userbox .avatar.coach { background: var(--ice-bg); color: var(--deep); }
.userbox .who b { color: var(--ink); font-weight: 600; display: block; font-size: .93rem; }
.userbox .role { color: var(--ink-2); font-size: .8rem; }
.userbox .btn-row { gap: 6px; }
.userbox button { flex: 1; }
.version { font-size: .72rem; color: var(--ink-3); margin-top: var(--s2); }
.topbar { display: none; }
.bottom-nav { display: none; }
main { padding: var(--s5) var(--s6) var(--s7); min-width: 0; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.page-head .lead { color: var(--ink-2); margin-top: 6px; font-size: .95rem; max-width: 70ch; }
.banner { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); margin-bottom: var(--s4); border: 1px solid; }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.banner.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.banner.info { background: var(--ice-bg); border-color: var(--ice-line); color: var(--deep); }
.banner.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
#update-banner, #warnings .banner { margin: var(--s3) var(--s6) 0; }

/* ---------- Язык интерфейса ---------- */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--grout-2); }
.lang-btn { min-height: 34px; padding: 4px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.lang-btn:hover { background: rgba(255, 255, 255, .7); color: var(--deep); }
.lang-btn.on { background: #fff; color: var(--deep); box-shadow: 0 1px 3px rgba(23, 29, 93, .15); }
.auth-card .lang-switch { display: flex; width: fit-content; margin: calc(-1 * var(--s3)) auto var(--s4); }
.sidebar .lang-switch { display: flex; width: 100%; margin-bottom: var(--s2); }
.sidebar .lang-btn { flex: 1; }

/* ---------- Кнопки и поля ---------- */
button, .btn {
  font: inherit; font-weight: 600; font-size: .95rem; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; min-height: 44px; cursor: pointer;
  background: var(--deep); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.2;
  transition: background-color .12s ease, border-color .12s ease, transform .08s ease;
}
button:hover, .btn:hover { background: var(--deep-2); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--surface); color: var(--deep); border-color: var(--field); }
button.secondary:hover, .btn.secondary:hover { background: var(--tile); border-color: #a9aecb; }
button.ghost, .btn.ghost { background: transparent; color: var(--deep); border-color: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--grout-2); }
button.danger { background: var(--bad); }
button.danger:hover { background: #8f1e17; }
button.small, .btn.small { min-height: 38px; padding: 6px 12px; font-size: .88rem; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
button.done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); opacity: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: var(--s4); min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.req { color: var(--bad); }
.hint { font-size: .84rem; color: var(--ink-3); line-height: 1.4; }
.hint.tight { margin: 10px 0 0; }
.error-text { font-size: .86rem; color: var(--bad); font-weight: 600; }
input, select, textarea { font: inherit; border: 1px solid var(--field); border-radius: 10px; padding: 9px 12px; min-height: 44px; background: #fff; color: var(--ink); width: 100%; }
input::placeholder, textarea::placeholder { color: #777c9d; }
input:hover, select:hover, textarea:hover { border-color: #9ca2c4; }
textarea { min-height: 80px; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); background: #fffafa; }
input[readonly] { background: var(--grout-2); color: var(--ink-2); }
.radio-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.radio-row label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--grout); border-radius: 10px; padding: 8px 14px; min-height: 44px; cursor: pointer; background: #fff; font-weight: 500; }
.radio-row input { width: auto; min-height: 0; accent-color: var(--deep); }
.radio-row label.on { border-color: var(--deep); background: var(--ice-bg); color: var(--deep); box-shadow: inset 0 0 0 1px var(--deep); }
.check { display: flex; align-items: center; gap: var(--s2); min-height: 44px; font-weight: 500; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--deep); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--s4); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s4); padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r-lg); }
.toolbar .field { margin-bottom: 0; min-width: 140px; flex: 1 1 150px; max-width: 280px; }
.toolbar .field.wide { flex: 2 1 220px; max-width: none; }
.toolbar .field label { font-size: .82rem; color: var(--ink-2); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.search-input { position: relative; }
.search-input .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-input input { padding-left: 40px; }
.pw-wrap { display: flex; gap: var(--s2); }
.pw-wrap input { flex: 1; }

/* ---------- Выпадающие списки ---------- */
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; pointer-events: none; }
.dd-trigger { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; background: #fff; color: var(--ink); border: 1px solid var(--field); border-radius: 10px; font-size: .95rem; font-weight: 500; text-align: left; line-height: 1.3; cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; }
.dd-trigger:hover { background: #fff; border-color: #959bbf; }
.dd-trigger:active { transform: none; }
.dd-trigger .dd-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-trigger .dd-chev { flex: none; width: 28px; height: 28px; padding: 5px; border-radius: 7px; background: var(--ice-bg); color: var(--deep); transition: transform .15s ease, background-color .12s ease; }
.dd-trigger:hover .dd-chev { background: #dbe6f7; }
.dd-trigger.open { border-color: var(--deep); box-shadow: inset 0 0 0 1px var(--deep); }
.dd-trigger.open .dd-chev { transform: rotate(180deg); background: var(--deep); color: var(--amber); }
.dd-trigger.placeholder .dd-value { color: #666b8e; }
.dd-trigger[aria-invalid="true"] { border-color: var(--bad); background: #fffafa; }
.dd-trigger:disabled { background: var(--grout-2); color: var(--ink-2); opacity: 1; cursor: not-allowed; }
.dd-trigger:disabled .dd-chev { background: transparent; color: #9095b0; }
.toolbar .dd-trigger { font-weight: 600; color: var(--deep); }
.dd-layer { position: fixed; left: 0; top: 0; z-index: 90; }
.dd-pop { position: fixed; background: #fff; border: 1px solid var(--grout); border-radius: 14px; box-shadow: 0 18px 48px rgba(23, 29, 93, .28); display: flex; flex-direction: column; overflow: hidden; animation: dd-in .14s ease-out; }
.dd-pop.up { animation-name: dd-in-up; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dd-search { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 14px; border-bottom: 1px solid var(--grout-2); color: var(--ink-3); flex: none; }
.dd-search input { border: 0; min-height: 40px; padding: 4px 2px; background: transparent; }
.dd-search input:focus-visible { box-shadow: none; }
.dd-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1 1 auto; min-height: 0; outline: none; overscroll-behavior: contain; }
.dd-list:focus-visible { box-shadow: inset 0 0 0 2px var(--deep); border-radius: 0; }
.dd-opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 8px; cursor: pointer; color: var(--ink); line-height: 1.35; }
.dd-opt .dd-text { flex: 1; min-width: 0; }
.dd-opt .dd-check { flex: none; color: var(--deep); visibility: hidden; }
.dd-opt.act { background: #f0f4fb; }
.dd-opt.sel { font-weight: 700; color: var(--deep); background: var(--ice-bg); }
.dd-opt.sel.act { background: #dbe6f7; }
.dd-opt.sel .dd-check { visibility: visible; }
.dd-opt.sel::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--deep); }
.dd-opt.off { color: #7e829e; cursor: not-allowed; }
.dd-opt.off.act { background: transparent; }
.dd-empty { padding: 14px 16px; color: var(--ink-2); }
.dd-layer.sheet { inset: 0; background: rgba(23, 29, 93, .55); display: flex; align-items: flex-end; animation: dd-fade .15s ease-out; }
.dd-layer.sheet .dd-pop { position: relative; width: 100%; max-height: 78vh; border: 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: dd-sheet .2s ease-out; }
@keyframes dd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dd-sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px 8px 18px; background: var(--board); color: #fff; flex: none; }
.dd-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-close { background: transparent; color: #e3e6f4; min-width: 44px; padding: 8px; }
.dd-close:hover { background: var(--board-2); }
.sheet .dd-list { padding: 6px 8px 10px; }
.sheet .dd-opt { min-height: 52px; font-size: 1rem; padding: 12px 14px 12px 18px; }
.sheet .dd-opt + .dd-opt { margin-top: 2px; }
.sheet .dd-search input { font-size: 16px; }

/* ---------- Панели и списки ---------- */
.panel { background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r-lg); padding: var(--s4) var(--s5); margin-bottom: var(--s4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.panel-head h2 { margin: 0; display: flex; align-items: center; gap: var(--s2); }
.panel-head h2 .ico { color: var(--lane); }
.panel-head a { font-weight: 600; font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r); padding: var(--s4); margin-bottom: var(--s3); }
.card.flat { border-color: var(--grout-2); }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r-lg); overflow: hidden; }
.cards > .card, .cards > .row-card { border: 0; border-radius: 0; margin: 0; border-bottom: 1px solid var(--grout-2); }
.cards > :last-child { border-bottom: 0; }
.row-card { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) var(--s4); background: var(--surface); }
.row-card.no-avatar { grid-template-columns: minmax(0, 1fr) auto; }
.card, .row-card, .row-card > *, .panel { min-width: 0; }
.row-card .title { font-weight: 700; font-size: 1rem; color: var(--ink); text-decoration: none; }
.row-card a.title:hover { color: var(--link); text-decoration: underline; }
.row-card .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: .88rem; margin-top: 2px; }
.row-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.row-card .meta .ico { color: var(--ink-3); }
.row-card .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.row-card .actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }
.avatar { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 1rem; background: var(--ice-bg); color: var(--deep); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.35rem; border-radius: 14px; }
.avatar.coach { background: var(--deep); color: var(--amber); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-family: var(--font-display); font-size: .84rem; font-weight: 500; border: 1px solid transparent; white-space: nowrap; line-height: 1.55; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-line); }
.badge.ice { background: var(--ice-bg); color: var(--ice); border-color: var(--ice-line); }
.badge.grey { background: var(--grey-bg); color: var(--grey); border-color: var(--grey-line); }
.badge.info { background: var(--ice-bg); color: var(--deep); border-color: var(--ice-line); }

/* Мини-табло (итоги в отчётах, оплатах, карточке) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px; margin-bottom: var(--s4); background: var(--board); border-radius: var(--r-lg); padding: 6px; box-shadow: inset 0 0 0 2px var(--board-3); }
.stat { background: var(--board-2); padding: var(--s3) var(--s4); border-radius: 10px; min-width: 0; }
.stat .k { font-size: .82rem; color: var(--board-mute); }
.stat .v { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.2; font-weight: 600; color: var(--board-ink); font-variant-numeric: tabular-nums; }
.stat .v.bad { color: #ffb19c; }
.stat .muted, .stat .hint { color: var(--board-mute); }
.table-wrap { overflow-x: auto; border: 1px solid var(--grout); border-radius: var(--r-lg); background: var(--surface); }
.table-wrap .scroll-hint { display: none; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--grout-2); text-align: left; vertical-align: top; }
th { background: var(--grout-2); color: var(--ink-2); font-family: var(--font-display); font-weight: 500; font-size: .9rem; position: sticky; top: 0; }
tbody tr:hover td { background: #f7f8fc; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.cancelled td { color: var(--ink-3); }
.strike { text-decoration: line-through; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s5); font-size: .94rem; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 500; }
details.section { background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r-lg); margin-bottom: var(--s3); overflow: hidden; }
details.section > summary { cursor: pointer; padding: var(--s3) var(--s5); font-weight: 600; font-size: 1.12rem; color: var(--deep); list-style: none; min-height: 54px; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s ease; margin: 0 4px 4px 0; }
details.section:not([open]) > summary::after { transform: rotate(-45deg); margin-bottom: 0; }
details.section[open] > summary { border-bottom: 1px solid var(--grout-2); margin-bottom: var(--s3); }
details.section > .body { padding: 0 var(--s5) var(--s4); }
.sub { border: 1px solid var(--grout); border-radius: var(--r); padding: var(--s3) var(--s4) var(--s3) calc(var(--s4) + 6px); margin-bottom: var(--s3); background: #fff; position: relative; overflow: hidden; }
.sub::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--lane); }
.sub.state-active::before { background: var(--deep); }
.sub.state-frozen::before { background: var(--lane-enr); }
.sub.state-expired::before, .sub.state-exhausted::before { background: #a9adc6; }
.sub.state-cancelled { background: #fafafc; }
.sub.state-cancelled::before { background: var(--grout); }
.sub-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); align-items: center; margin-bottom: var(--s2); }
.progress { height: 10px; background: var(--grout-2); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress > i { display: block; height: 100%; background: var(--lane); border-radius: 3px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--grout-2); display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.list-plain li:last-child { border-bottom: 0; }

/* ---------- Разделительный канат: места в группе ---------- */
.rope { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; padding: 6px 0; }
.rope .fl { flex: 1 1 0; max-width: 16px; min-width: 3px; height: 10px; border-radius: 2px; background: #fff; box-shadow: inset 0 0 0 1.5px #b9bdd6; }
.rope .fl.enr { background: #92b4e3; box-shadow: none; }
.rope .fl.att { background: var(--deep); box-shadow: none; }
.rope-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--ink-2); }
.rope-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rope-legend i { width: 14px; height: 9px; border-radius: 2px; display: inline-block; background: #fff; box-shadow: inset 0 0 0 1.5px #b9bdd6; }
.rope-legend i.att { background: var(--deep); box-shadow: none; }
.rope-legend i.enr { background: #92b4e3; box-shadow: none; }
.group-line { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--grout-2); text-decoration: none; color: var(--ink); min-height: 44px; }
.group-line:last-child { border-bottom: 0; }
.group-line:hover .gname { text-decoration: underline; }
.group-line .ratio { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.1rem; color: var(--deep); white-space: nowrap; }

/* ---------- Табло на главной ---------- */
.today-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s4); }
.today-head .date { font-family: var(--font-display); color: var(--lane-dark); font-size: 1.1rem; font-weight: 500; }
.today-head h1 { font-size: 2.4rem; }
.board { background: var(--board); color: var(--board-ink); border-radius: 22px; padding: var(--s4); box-shadow: inset 0 0 0 3px var(--board-3); display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s4) var(--s5); align-items: stretch; margin-bottom: var(--s5); }
.board a { color: inherit; text-decoration: none; }
.board-main { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s3); padding: 4px 4px 2px; min-width: 0; }
.board-main .bm-k { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); }
.board-main .bm-k b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.board-main .bm-k span { font-size: .85rem; color: var(--board-mute); }
.board-main .bm-row { display: flex; align-items: flex-end; gap: var(--s3); }
.digits { display: flex; gap: 6px; }
.digits span { min-width: 64px; height: 92px; padding: 0 6px; border-radius: 10px; background: linear-gradient(180deg, var(--board-2) 0 50%, #232e86 50% 100%); position: relative; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 76px; line-height: 1; color: var(--amber); font-variant-numeric: tabular-nums; }
.digits span::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--board); }
.digits.flip span:last-child { animation: flip .45s ease-out; }
@keyframes flip { 0% { transform: rotateX(90deg); } 100% { transform: none; } }
.board-main .of { display: flex; flex-direction: column; padding-bottom: 6px; }
.board-main .of b { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; line-height: 1; color: var(--board-mute); }
.board-main .of span { font-size: .8rem; color: var(--board-mute); }
.board-main .bm-note { font-size: .88rem; color: var(--board-mute); }
.board-main .bm-note b { color: var(--board-ink); font-weight: 600; }
.cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-content: stretch; }
.cell { background: var(--board-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; min-width: 0; transition: background-color .12s ease; }
a.cell:hover { background: var(--board-3); }
.cells.n3 .cell:first-child { grid-column: 1 / -1; }
.cell .ck { font-size: .84rem; color: var(--board-mute); display: flex; align-items: center; gap: 6px; }
.cell .cv { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell .cv small { font-size: .95rem; font-weight: 500; color: var(--board-mute); }
.cell .cn { font-size: .8rem; color: var(--board-mute); }
.cell.c-money .cv { color: var(--board-ink); }
.cell.c-debt .cv { color: #ffb19c; }
.cell.c-renew .cv { color: var(--amber); }
.cell.c-subs .cv { color: var(--board-ink); }
.wk { display: flex; flex-direction: column; gap: 6px; background: var(--board-2); border-radius: 12px; padding: 12px 14px 10px; min-width: 0; }
.wk-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.wk-head b { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.wk-head a { font-size: .8rem; color: var(--board-mute); text-decoration: underline !important; text-underline-offset: 3px; }
.wk-head a:hover { color: #fff; }
.wchart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 112px; border-bottom: 1px solid var(--board-3); }
.wcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.wcol .bar { width: min(22px, 80%); background: #6a7bc6; border-radius: 3px 3px 0 0; min-height: 2px; }
.wcol.today .bar { background: var(--amber); }
.wcol .val { font-family: var(--font-display); font-size: .85rem; color: var(--board-mute); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.wcol.today .val { color: var(--amber); }
.wcol.future .bar { background: transparent; }
.wlabels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-size: .75rem; color: var(--board-mute); }
.wlabels .today { color: var(--amber); font-weight: 600; }

.board.solo-week { display: none; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.home-grid > div { min-width: 0; }
/* Старт: быстрая отметка */
.checkin { background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r-lg); padding: var(--s4); margin-bottom: var(--s4); }
.checkin h2 { margin-bottom: var(--s3); }
.checkin .qc-results { margin-top: var(--s3); }
.qc-results { border: 1px solid var(--grout); border-radius: var(--r); overflow: hidden; margin-top: var(--s3); }
.qc-results:empty { display: none; }
.qc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px var(--s3); border-bottom: 1px solid var(--grout-2); }
.qc-row:last-child { border-bottom: 0; }
.qc-row .qc-name { color: var(--ink); font-weight: 700; display: block; text-decoration: none; }
.qc-row .qc-name:hover { color: var(--link); text-decoration: underline; }
.qc-row .qc-avatar { text-decoration: none; }
.qc-row span { font-size: .85rem; color: var(--ink-2); }
.qc-row.empty { grid-template-columns: 1fr; color: var(--ink-2); }
/* Дорожки: группы сегодня */
.lanes-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s2); flex-wrap: wrap; }
.lanes-head h2 { margin: 0; }
.lanes-head span { font-size: .85rem; color: var(--ink-2); }
.lanes { background: #e3ecf9; box-shadow: inset 0 0 0 1px #c9d9f1; border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s2); }
.lane { display: block; text-decoration: none; color: var(--ink); padding: 12px var(--s4) 10px; }
.lane:nth-child(even) { background: #d7e4f6; }
.lane + .lane { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); }
.lane:hover { background: #cbdcf3; }
.lane-top { display: flex; align-items: center; gap: var(--s3); }
.lane-no { color: var(--deep); font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; width: 28px; flex: none; text-align: center; }
.lane-main { flex: 1; min-width: 0; }
.lane-main b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-main span { font-size: .84rem; color: var(--ink-2); }
.lane-ratio { text-align: right; flex: none; }
.lane-ratio b { color: var(--deep); font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.lane-ratio b small { font-size: 1.05rem; color: var(--ink-3); font-weight: 500; }
.lane-ratio span { display: block; font-size: .78rem; color: var(--ink-2); }
.lane .rope { padding: 8px 0 0 calc(28px + var(--s3)); gap: 2px; }
.lane .rope .fl { max-width: none; height: 8px; background: #ffffff; box-shadow: inset 0 0 0 1px #b4c6e6; }
.lane .rope .fl.enr { background: var(--lane-enr); box-shadow: none; }
.lane .rope .fl.att { background: var(--deep); box-shadow: none; }
.lanes-legend { margin-bottom: var(--s4); }
.lanes-legend i { box-shadow: none; }
.lanes-legend i.free { background: #ffffff; box-shadow: inset 0 0 0 1.5px #b4c6e6; }
.lanes-legend i.enr2 { background: var(--lane-enr); box-shadow: none; }
.lanes-legend i.att { background: var(--deep); }
/* Протокол дня */
.protocol-item { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--grout-2); text-decoration: none; color: var(--ink); min-height: 48px; }
.protocol-item .badge { min-width: 78px; justify-content: center; }
.protocol-item .pi-main { flex: 1; min-width: 0; font-size: .94rem; }
.protocol-item .pi-main b { font-weight: 700; }
.protocol-item .pi-main span { color: var(--ink-2); }
a.protocol-item:hover b { color: var(--link); text-decoration: underline; }
.protocol-foot { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); padding-top: var(--s3); border-top: 1px solid var(--grout-2); font-size: .9rem; font-weight: 600; }
.protocol-calm { color: var(--ink-2); padding: var(--s2) 0 var(--s3); margin: 0; }
.money-row { display: grid; grid-template-columns: 90px 1fr auto; gap: var(--s3); align-items: center; padding: 6px 0; font-size: .92rem; }
.money-row .track { height: 12px; background: var(--grout-2); border-radius: 0 3px 3px 0; overflow: hidden; }
.money-row .track i { display: block; height: 100%; background: var(--lane); border-radius: 0 3px 3px 0; }
.money-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s3); gap: var(--s3); }
.money-total b { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; color: var(--deep); }
.setup { list-style: none; margin: 0; padding: 0; }
.setup li { display: grid; grid-template-columns: 36px 1fr auto; gap: var(--s3); align-items: center; padding: 12px 0; border-bottom: 1px solid var(--grout-2); }
.setup li:last-child { border-bottom: 0; }
.setup .step { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; background: var(--deep); color: #fff; }
.setup li.done .step { background: var(--ok-bg); color: var(--ok); }
.setup li.done .st-title { color: var(--ink-2); }
.setup .st-title { font-weight: 700; color: var(--ink); }
.setup .st-sub { font-size: .86rem; color: var(--ink-2); }
.empty-inline { padding: var(--s4) 0; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.lanes-empty { background: var(--surface); border: 1px dashed var(--field); border-radius: var(--r-lg); padding: var(--s2) var(--s4); margin-bottom: var(--s4); }

/* ---------- Команда: тренеры и их группы ---------- */
.coach-team { background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r-lg); margin-bottom: var(--s4); overflow: hidden; }
.coach-team-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); background: var(--board); color: var(--board-ink); flex-wrap: wrap; }
.coach-team-head .avatar.coach { background: var(--board-3); color: var(--amber); }
.coach-team-head .ct-main { flex: 1; min-width: 180px; }
.coach-team-head .ct-main b { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: #fff; display: block; line-height: 1.2; }
.coach-team-head .ct-main span { font-size: .86rem; color: var(--board-mute); }
.coach-team-head button.secondary { background: transparent; color: #e3e6f4; border-color: #5562b5; }
.coach-team-head button.secondary:hover { background: var(--board-2); }
.coach-team-head button:not(.secondary) { background: var(--amber); color: var(--amber-ink); }
.coach-team-head button:not(.secondary):hover { background: #ffffff; }
.coach-team-body { padding: var(--s1) var(--s5) var(--s3); }
.group-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 1.2fr) auto; gap: var(--s2) var(--s4); align-items: center; padding: 12px 0; border-bottom: 1px solid var(--grout-2); }
.group-item:last-child { border-bottom: 0; }
.group-item .gi-name { font-weight: 700; color: var(--ink); }
.group-item .gi-meta { font-size: .86rem; color: var(--ink-2); }
.coach-block h3 { color: var(--deep); }

/* ---------- Посещаемость: дни недели ---------- */
.week-nav { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: var(--s4); background: var(--board); padding: 6px; border-radius: var(--r-lg); }
.day { background: var(--board-2); border: 0; border-radius: 10px; padding: var(--s2); text-align: center; cursor: pointer; color: var(--board-ink); min-height: 72px; display: flex; flex-direction: column; justify-content: center; font-weight: 400; }
.day:hover { background: var(--board-3); }
.day.sel { background: var(--amber); color: var(--amber-ink); }
.day .dname { font-size: .8rem; color: var(--board-mute); }
.day .dnum { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }
.day .dv { font-size: .8rem; color: var(--board-mute); }
.day.today .dname { color: var(--amber); font-weight: 600; }
.day.sel .dname, .day.sel .dv, .day.sel.today .dname { color: var(--amber-ink); }

/* ---------- Отчёты: посещения по тарифам ---------- */
h2.section-h { margin-top: var(--s5); }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.tcard { background: var(--surface); border: 1px solid var(--grout); border-radius: var(--r-lg); padding: var(--s3) var(--s4) var(--s2); min-width: 0; }
.tcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; padding-bottom: var(--s2); }
.tcard-head h3 { margin: 0; font-size: 1.2rem; }
.tcard-head span { font-size: .88rem; color: var(--ink-2); }
.trow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(70px, 1fr) auto minmax(86px, auto); grid-template-areas: "name bar visits clients"; gap: 4px var(--s3); align-items: center; padding: 9px 0; border-top: 1px solid var(--grout-2); }
.trow .tname { grid-area: name; font-weight: 600; min-width: 0; }
.trow .tsub { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-2); }
.tcard.dark .trow .tsub { color: var(--board-mute); }
.trow.manual .tname { font-weight: 500; color: var(--ink-2); }
.trow .tbar { grid-area: bar; height: 10px; background: var(--grout-2); border-radius: 0 3px 3px 0; overflow: hidden; }
.trow .tbar i { display: block; height: 100%; background: var(--lane); border-radius: 0 3px 3px 0; }
.trow .tv { grid-area: visits; text-align: right; white-space: nowrap; font-size: .9rem; color: var(--ink-2); }
.trow .tv b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--deep); }
.trow .tc { grid-area: clients; text-align: right; white-space: nowrap; font-size: .88rem; color: var(--ink-2); }
.tcard-empty { color: var(--ink-2); margin: 0; padding: 10px 0; border-top: 1px solid var(--grout-2); }
.tcard.dark { background: var(--board); border-color: var(--board); color: var(--board-ink); box-shadow: inset 0 0 0 3px var(--board-3); }
.tcard.dark h3 { color: #fff; }
.tcard.dark .tcard-head span, .tcard.dark .tv, .tcard.dark .tc, .tcard.dark .trow.manual .tname { color: var(--board-mute); }
.tcard.dark .trow { border-top-color: var(--board-3); }
.tcard.dark .tbar { background: var(--board-2); }
.tcard.dark .tbar i { background: var(--amber); }
.tcard.dark .tv b { color: var(--amber); }
tr.grp-row td { background: var(--grout-2); }
td.indent { padding-left: 30px; }

/* ---------- Модальные окна ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(23, 29, 93, .62); display: flex; align-items: flex-start; justify-content: center; padding: 5vh var(--s3); z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 620px; box-shadow: 0 24px 64px rgba(23, 29, 93, .35); overflow: hidden; }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s3) var(--s4) var(--s3) var(--s5); background: var(--board); gap: var(--s3); }
.modal-head h2 { margin: 0; font-size: 1.3rem; color: #fff; }
.modal-head button { min-width: 44px; padding: 8px; background: transparent; color: #e3e6f4; border-color: transparent; }
.modal-head button:hover { background: var(--board-2); }
.modal-body { padding: var(--s5); }
.modal-foot { padding: var(--s3) var(--s5) var(--s4); display: flex; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; border-top: 1px solid var(--grout-2); }
.summary-box { background: var(--tile); border: 1px solid var(--grout); border-radius: var(--r); padding: var(--s3) var(--s4); margin: var(--s3) 0; }
.toast-wrap { position: fixed; bottom: var(--s5); right: var(--s5); z-index: 80; display: flex; flex-direction: column; gap: var(--s2); max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--board); color: #fff; padding: var(--s3) var(--s4) var(--s3) calc(var(--s4) + 6px); border-radius: var(--r); box-shadow: 0 10px 30px rgba(23, 29, 93, .35); font-weight: 500; position: relative; overflow: hidden; animation: drop .22s ease-out; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--lane); }
.toast.ok::before { background: #6fcf97; }
.toast.bad::before { background: #ff6b52; }
@keyframes drop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Состояния (UI-05) */
.state { text-align: center; padding: var(--s6) var(--s4); color: var(--ink-2); background: var(--surface); border: 1px dashed var(--field); border-radius: var(--r-lg); }
.state.error { color: var(--bad); border-color: var(--bad-line); background: #fffafa; }
.state .btn-row { justify-content: center; margin-top: var(--s3); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--grout); border-top-color: var(--deep); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto var(--s2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Вход ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s4); position: relative; overflow: hidden;
  background: repeating-linear-gradient(180deg, var(--lane) 0 120px, var(--lane-2) 120px 240px); }
.auth-page::before, .auth-page::after { content: ""; position: absolute; left: -5%; right: -5%; height: 12px; background: repeating-linear-gradient(90deg, #ffffff 0 20px, transparent 20px 24px, #92b4e3 24px 44px, transparent 44px 48px, #ffffff 48px 68px, transparent 68px 72px); border-radius: 6px; }
.auth-page::before { top: 114px; }
.auth-page::after { bottom: 114px; }
.auth-card { position: relative; z-index: 1; background: #fff; border-radius: 22px; padding: var(--s6) var(--s5); width: 100%; max-width: 420px; box-shadow: 0 24px 64px rgba(23, 29, 93, .4); }
.auth-card .brand { color: var(--deep); justify-content: center; margin-bottom: var(--s5); }
.auth-card h1 { margin-bottom: var(--s4); }
.auth-card button[type=submit] { width: 100%; margin-top: var(--s2); }
.auth-version { text-align: center; color: var(--ink-3); font-size: .8rem; margin-top: var(--s4); }

/* ---------- Средняя ширина ---------- */
@media (max-width: 1240px) {
  .board { grid-template-columns: auto minmax(0, 1fr); }
  .wk { grid-column: 1 / -1; }
  .wchart { height: 92px; }
}
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr; }
}

/* ---------- Телефон (от 360 px, UI-03) ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .2s ease; height: 100%; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(23, 29, 93, .5); z-index: 55; }
  .topbar { display: flex; align-items: center; gap: var(--s2); position: sticky; top: 0; z-index: 40; background: var(--board); color: #fff; padding: 6px var(--s3); min-height: 54px; }
  .topbar .brand { padding: 4px 6px 4px 2px; }
  .topbar .tb-title { flex: 1; font-weight: 600; font-size: 1.15rem; font-family: var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .ver { font-size: .72rem; color: var(--board-mute); }
  main { padding: var(--s4) var(--s3) calc(100px + env(safe-area-inset-bottom)); }
  #update-banner, #warnings .banner { margin: var(--s3) var(--s3) 0; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #fff; border-top: 1px solid var(--grout); padding: 0 4px env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { background: none; border: 0; border-radius: 0; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .7rem; font-weight: 600; text-decoration: none; min-height: 62px; padding: 6px 2px; position: relative; }
  .bottom-nav a::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
  .bottom-nav a.active { color: var(--deep); }
  .bottom-nav a.active::before { background: var(--deep); }
  .bottom-nav .tab-main { color: var(--deep); }
  .bottom-nav a.tab-main::before { display: none; }
  .bottom-nav a.tab-main.active .bubble { background: #171d5d; color: #ffffff; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--deep), 0 6px 14px rgba(23, 29, 93, .25); }
  .bottom-nav .tab-main .bubble { width: 50px; height: 50px; margin-top: -22px; border-radius: 14px; background: var(--deep); color: #ffffff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px #fff, 0 6px 14px rgba(23, 29, 93, .25); }
  .bottom-nav .dot { position: absolute; top: 4px; right: calc(50% - 22px); background: var(--deep); color: #ffffff; font-family: var(--font-display); font-size: .7rem; border-radius: 5px; padding: 0 5px; line-height: 17px; min-width: 17px; text-align: center; }
  h1 { font-size: 1.75rem; }
  .today-head { margin-bottom: var(--s3); }
  .today-head h1 { font-size: 1.9rem; }
  .page-head { margin-bottom: var(--s4); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .row-card { grid-template-columns: auto 1fr; padding: var(--s3); }
  .row-card.no-avatar { grid-template-columns: minmax(0, 1fr); }
  .row-card { grid-template-columns: auto minmax(0, 1fr); }
  .group-line .ratio { font-size: 1rem; white-space: normal; text-align: right; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name visits" "bar clients"; gap: 6px var(--s3); }
  .trow .tbar { align-self: center; }
  .row-card > .actions { grid-column: 1 / -1; justify-content: stretch; }
  .row-card > .actions > * { flex: 1; }
  .panel { padding: var(--s4); }
  .board { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 10px; border-radius: 18px; margin-bottom: var(--s4); }
  .wk { grid-column: auto; }
  .wk.in-board { display: none; }
  .board.solo-week { display: grid; padding: 6px; margin-top: var(--s2); }
  .cell .cn { font-size: .76rem; }
  .digits span { min-width: 58px; height: 82px; font-size: 68px; }
  .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { padding: 10px 12px; }
  .cell .cv { font-size: 1.4rem; }
  .group-item { grid-template-columns: 1fr auto; }
  .setup li { grid-template-columns: 36px 1fr; align-items: start; }
  .setup li > :last-child { grid-column: 2; justify-self: start; }
  .group-item .rope { grid-column: 1 / -1; order: 3; }
  .days { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; gap: 4px; padding: 4px; }
  .day { padding: 6px 2px; min-height: 62px; }
  .day .dnum { font-size: 1.02rem; }
  .day .dv-u { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap table.many { min-width: 860px; }
  .qc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .qc-row .qc-avatar { display: none; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; max-width: none; }
  .modal-head { position: sticky; top: 0; z-index: 2; }
  .modal-head, .modal-body, .modal-foot { padding-left: var(--s4); padding-right: var(--s4); }
  .modal-foot { position: sticky; bottom: 0; background: #fff; }
  .modal-foot button { flex: 1 1 140px; }
  .table-wrap .scroll-hint { display: block; font-size: .8rem; color: var(--ink-3); padding: 6px 12px; border-bottom: 1px solid var(--grout-2); }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); padding: var(--s3); }
  .toolbar .field { max-width: none; min-width: 0; }
  .toolbar .field.wide, .toolbar > .check { grid-column: 1 / -1; }
  .page-head .btn-row button, .page-head .btn-row .btn { min-height: 40px; padding: 7px 12px; font-size: .9rem; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .toast-wrap { bottom: calc(86px + env(safe-area-inset-bottom)); right: var(--s3); left: var(--s3); }
  details.section > summary, details.section > .body { padding-left: var(--s4); padding-right: var(--s4); }
  .coach-team-head, .coach-team-body { padding-left: var(--s4); padding-right: var(--s4); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: 1.2rem; }
  .auth-page::before { top: 54px; }
  .auth-page::after { bottom: 54px; }
  .auth-card { padding: var(--s5) var(--s4); }
}
@media (max-width: 380px) {
  .digits span { min-width: 50px; height: 72px; font-size: 58px; }
  .cell .cv { font-size: 1.25rem; }
  .lane-ratio b { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .dd-layer { display: none !important; }
  .sidebar, .topbar, .toolbar, .bottom-nav, button, .btn { display: none !important; }
  .layout { display: block; }
  .board, .stats, .days { background: #fff; box-shadow: none; border: 1px solid #999; }
}
