/* Общие стили платформы. Подключаются из base.html отдельным файлом с версией в адресе,
   браузер держит их в кэше. */
/* ===================================================================
   «Красная ручка»: платформа как тетрадь в клетку, которую проверяет учитель.

   Бумага с клеткой, листы-карточки с тонкой рамкой и короткой «бумажной» тенью,
   графит для текста и кнопок, красная ручка для отметок и того, что требует
   внимания. Зелёный остаётся только статусом «верно» и «идёт урок».

   Шрифты лежат на нашем сервере (static/fonts): внешние адреса у части
   пользователей заблокированы. Golos Text для текста, Dela Gothic One для чисел
   и крупных слов, JetBrains Mono для кода. Пока шрифт грузится, стоит системный.

   Контраст подписей не ниже 4,5 : 1 и днём, и ночью. Углы почти прямые: это лист,
   а не плашка. Движение короткое, без появления блоков снизу. Всё отключается при
   «уменьшить движение».
   =================================================================== */


:root {
  color-scheme: light;
  /* Тетрадь */
  --paper: #EEF0EA;
  --sheet: #F8F9F5;
  --ink: #1C1D1A;
  --grid: #8FB0DA;
  --pen: #E5341F;
  --grid-line: rgb(143 176 218 / .34);
  --ink-line: rgb(28 29 26 / .14);

  /* Поверхности и текст (имена прежние, чтобы страницы подхватили их без правок) */
  --bg: var(--paper);
  --surface: var(--sheet);
  --surface-2: #E3E6DD;
  --border: #D3D6CC;
  --border-strong: #B4B8AD;
  --text: var(--ink);
  --text-muted: #4C4F49;
  --text-faint: #5F625B;          /* не ниже 4,5 : 1 и на листе, и на втором фоне */

  /* Смыслы: кнопки графитом, отметки ручкой, зелёный только «верно» */
  --accent: var(--ink);
  --accent-hover: #34362F;
  --accent-soft: #DCE5EF;         /* выбранное: бледная клетка */
  --accent-2: var(--grid);
  --on-accent: var(--sheet);
  --ok: #257936;
  --ok-soft: #E1F0E3;
  --warn: #8A6100;
  --warn-soft: #F6ECD4;
  --danger: #B32D1C;
  --danger-soft: #F9E5E1;
  --amber: #C98A0B;

  /* Шрифты */
  --f-display: "Dela Gothic One", "Golos Text", system-ui, sans-serif;
  --f-text: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Размеры */
  --cell: 24px;
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;
  --r-xl: 6px;
  --shadow-sm: 0 0 0 1px var(--ink-line);
  --shadow: 0 0 0 1px var(--ink-line), 3px 4px 0 rgb(28 29 26 / .06);
  --shadow-lg: 0 0 0 1px var(--ink-line), 0 22px 40px -18px rgb(28 29 26 / .4);
  --nav-w: 248px;

  /* Движение: рука разгоняется и мягко встаёт */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-hand: cubic-bezier(.7, 0, .25, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: .15s;
  --t-med: .25s;
  --t-slow: .5s;
}

/* Тетрадь ночью: тёмная бумага, светлый графит, ручка светлее, чтобы читалась */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #151714;
    --sheet: #1D201C;
    --ink: #ECEEE8;
    --pen: #FF6A55;
    --grid-line: rgb(143 176 218 / .12);
    --ink-line: rgb(236 238 232 / .12);
    --surface-2: #262A24;
    --border: #33382F;
    --border-strong: #464C42;
    --text-muted: #BDC2B6;
    --text-faint: #A3A89D;
    --accent-hover: #FFFFFF;
    --accent-soft: #24303B;
    --on-accent: #151714;
    --ok: #71D18A;
    --ok-soft: #15291B;
    --warn: #E7B95A;
    --warn-soft: #2C2514;
    --danger: #FF7A68;
    --danger-soft: #331A16;
    --amber: #E7B95A;
    --shadow: 0 0 0 1px var(--ink-line), 3px 4px 0 rgb(0 0 0 / .35);
    --shadow-lg: 0 0 0 1px var(--ink-line), 0 22px 40px -18px rgb(0 0 0 / .7);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
::selection { background: rgb(229 52 31 / .22); }
:target { scroll-margin-top: 80px; }

/* Переход между страницами: содержимое мягко сменяется, меню стоит на месте.
   Браузеры без поддержки просто открывают страницу, как раньше */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .16s ease-in both; }
  ::view-transition-new(root) { animation: vt-in .32s var(--ease) both; }
  ::view-transition-group(side), ::view-transition-group(tabbar) { animation: none; }
  ::view-transition-old(side), ::view-transition-old(tabbar) { display: none; }
  ::view-transition-new(side), ::view-transition-new(tabbar) { animation: none; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  font: 400 16px/1.55 var(--f-text);
  -webkit-font-smoothing: antialiased;
}
/* Атрибут hidden должен прятать и то, чему класс задал display */
[hidden] { display: none !important; }
a { color: var(--text); text-decoration: none; }
/* Ссылка в тексте подчёркнута ручкой; у плиток, кнопок и пунктов меню свой класс, их не трогаем */
a:not([class]) { text-decoration: underline; text-decoration-color: rgb(229 52 31 / .55);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:not([class]):hover { text-decoration-color: var(--pen); }
a[class]:hover { text-decoration: none; }
svg { display: block; }

/* Клавиатура: заметное кольцо фокуса, мышь его не вызывает */
:focus-visible { outline: 2px dashed var(--pen); outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Иконки из _icons.html: <svg class="ic"><use href="#i-home"/></svg> */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 28px; height: 28px; }

/* ----------------------------------------------------- оболочка */

.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh; }
.side {
  view-transition-name: side;
  position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto;
  padding: 18px 14px 12px 12px; border-right: 2px solid rgb(229 52 31 / .5);
  background: var(--paper); display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px;
  font-weight: 600; letter-spacing: -0.01em; font-size: 16px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 26px; height: 26px; border-radius: var(--r-sm); flex: none; background: var(--ink);
  display: grid; place-items: center; color: var(--paper); font: 400 14px/1 var(--f-display); }
.nav-section { padding: 16px 12px 6px; font-size: 11px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-faint); font-weight: 640; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; width: 100%;
  border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
  border-radius: var(--r-sm); color: var(--text-muted); font-size: 15px; font-weight: 500; text-decoration: none;
}
.nav-item { transition: background var(--t-fast) ease, color var(--t-fast) ease; }
.nav-item .ic { color: var(--text-faint); transition: color .15s ease, transform var(--t-med) var(--ease-spring); }
.nav-item:hover .ic { transform: scale(1.08); }
.nav-item:active { transform: scale(.98); }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item:hover .ic { color: var(--text); }
.nav-item.on { background: var(--sheet); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--pen), 0 0 0 1px var(--ink-line); }
.nav-item.on .ic { color: var(--pen); }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-sm);
  background: var(--pen); color: #fff; font-size: 12px; font-weight: 650;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-live { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { opacity: .45; } }
.side .spacer { flex: 1; min-height: 12px; }

.avatar-sm { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--sheet); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--ink); font: 400 13px/1 var(--f-display); }
.side .who { display: flex; align-items: center; gap: 10px; padding: 12px 6px 4px 8px;
  border-top: 1px solid var(--border); margin-top: 8px; }
.side .who .who-text { flex: 1; min-width: 0; }
.side .who .name { font-size: 14px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .who .role { font-size: 12px; color: var(--text-faint); }
.side .who form { margin: 0; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--ink-line); background: var(--paper);
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { flex: 1; min-width: 0; font-size: 16px; font-weight: 620; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .avatar-sm { border: 0; font: 400 13px/1 var(--f-display); cursor: pointer; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 28px 72px; }

/* Нижняя панель и лист «Ещё»: только на телефоне */
.tabbar { display: none; }
.sheet { position: fixed; inset: 0; z-index: 60; background: rgb(28 29 26 / .45);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease both; }
.sheet-card { width: 100%; max-width: 520px; background: var(--surface); box-shadow: var(--shadow-lg);
  border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  display: grid; gap: 2px; animation: rise .22s cubic-bezier(.2, .8, .3, 1) both; }
.sheet-card::before { content: ""; justify-self: center; width: 40px; height: 4px; border-radius: 2px;
  background: var(--border-strong); margin-bottom: 8px; }
.sheet-who { display: flex; align-items: center; gap: 10px; padding: 6px 12px 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sheet-who .name { font-weight: 600; }
.sheet-who .role { font-size: 13px; color: var(--text-faint); }
.sheet-card form { margin: 0; }
.sheet-card .nav-item { padding: 12px; font-size: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; }
  .wrap { padding: 18px 16px calc(88px + env(safe-area-inset-bottom)); }
  .tabbar {
    view-transition-name: tabbar;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-around; gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1.5px solid var(--ink-line);
  }
  .tabbar a, .tabbar button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 6px 2px 5px; border: 0; background: none; font: inherit; cursor: pointer;
    border-radius: var(--r-md); font-size: 11px; font-weight: 550; color: var(--text-muted); }
  .tabbar a.on, .tabbar button.on { color: var(--text); font-weight: 650; }
  .tabbar a.on .tab-ic, .tabbar button.on .tab-ic { background: var(--sheet); box-shadow: 0 0 0 1px var(--ink-line), inset 0 -2px 0 var(--pen); }
  .tabbar a { text-decoration: none; }
  .tabbar a:hover { text-decoration: none; }
  .tab-ic { position: relative; width: 52px; height: 30px; border-radius: var(--r-md); display: grid; place-items: center;
    transition: background .2s ease, transform var(--t-med) var(--ease-spring); }
  .tabbar a:active .tab-ic, .tabbar button:active .tab-ic { transform: scale(.9); }
  .tabbar a.on .tab-ic .ic { animation: tab-on .35s var(--ease-spring); }
  @keyframes tab-on { from { transform: scale(.7); } }
  .tab-ic .ic { width: 22px; height: 22px; }
  .tab-count { position: absolute; top: -3px; left: 30px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--r-sm); background: var(--pen); color: #fff; font-size: 11px; font-style: normal;
    font-weight: 650; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
  .tab-live { position: absolute; top: 2px; left: 33px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--ok); box-shadow: 0 0 0 2px var(--surface); }
}
@media (min-width: 961px) { .sheet { display: none !important; } }

/* ----------------------------------------------------- типографика */

h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.12; letter-spacing: -0.025em;
  margin: 0 0 8px; font-weight: 700; text-wrap: balance; }
h2 { font-size: 19px; line-height: 1.3; letter-spacing: -0.015em; margin: 0 0 14px;
  font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.lead { color: var(--text-muted); font-size: 15px; max-width: 68ch; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }

.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px; }
.page-head .grow { flex: 1 1 320px; min-width: 0; }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------- поверхности */

.card { background: var(--surface); border: 0;
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
/* В сетке расстояние задаёт gap, а не отступ соседней карточки — иначе вторая съезжает вниз */
.grid > .card + .card { margin-top: 0; }
.grid + .card, .grid + .grid, .card + .grid { margin-top: 16px; }
a.card, .card.link { display: block; color: inherit; text-decoration: none;
  transition: border-color var(--t-fast) ease, transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
a.card:hover, .card.link:hover { text-decoration: none; transform: translate(-1px, -2px);
  box-shadow: 0 0 0 1px var(--ink-line), 5px 7px 0 rgb(28 29 26 / .08); }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.stack { display: grid; gap: 12px; }

/* Показатели */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--surface); border: 0; box-shadow: var(--shadow);
  border-radius: var(--r-lg); padding: 16px 18px; }
.kpi b { display: block; font: 400 30px/1.1 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--text-muted); }

/* Строки-списки: на телефоне превращаются в карточки */
.list { display: grid; }
.list .item { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px;
  align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list .item:last-child { border-bottom: 0; }
.list .item .title { font-weight: 570; }
.list .item .sub { font-size: 13px; color: var(--text-muted); }
.list .item .side-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 640; padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .cards-on-phone thead { display: none; }
  .cards-on-phone, .cards-on-phone tbody, .cards-on-phone tr, .cards-on-phone td {
    display: block; width: 100%; }
  .cards-on-phone tr { background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r-md);
    padding: 12px 14px; margin-bottom: 10px; }
  .cards-on-phone td { border: 0; padding: 3px 0; display: flex;
    justify-content: space-between; gap: 14px; align-items: baseline; }
  .cards-on-phone td::before { content: attr(data-label); color: var(--text-muted);
    font-size: 13px; }
  .cards-on-phone td.lead-cell { display: block; margin-bottom: 6px; font-size: 16px; }
  .cards-on-phone td.lead-cell::before { content: none; }
}

/* ----------------------------------------------------- элементы */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-sm); border: 1.5px solid transparent;
  background: var(--accent); color: var(--on-accent); font: inherit; font-size: 15px;
  font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s ease, transform .1s ease; }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.quiet { background: transparent; color: var(--text-muted); }
.btn.quiet:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.small .ic { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn:active { transform: scale(.97); }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy .ic { opacity: 0; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--on-accent) var(--on-accent) transparent transparent;
  animation: spin .7s linear infinite; }
.btn.ghost.busy::after, .btn.quiet.busy::after { border-color: var(--accent) var(--accent) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

input, select, textarea { width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm); outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgb(143 176 218 / .4); }
input[type=range] { padding: 0; border: 0; box-shadow: none; background: transparent; }
/* Галочки и переключатели тетради: одинаковые на телефоне и компьютере, днём и ночью */
input[type=checkbox], input[type=radio] {
  -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 0; padding: 0;
  display: inline-grid; place-content: center; vertical-align: -4px; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 2px; background: var(--surface); box-shadow: none;
  transition: background-color var(--t-fast) ease; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]::after { content: ""; width: 10px; height: 5px; margin-top: -3px;
  border-left: 2px solid var(--paper); border-bottom: 2px solid var(--paper); transform: rotate(-45deg) scale(0);
  transition: transform .18s var(--ease-spring); }
input[type=checkbox]:checked { background: var(--ink); }
input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1); }
input[type=radio]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink);
  transform: scale(0); transition: transform .18s var(--ease-spring); }
input[type=radio]:checked::after { transform: scale(1); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px dashed var(--pen); outline-offset: 3px; }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .45; cursor: default; }
/* Дата и время: на iPhone поле иначе шире колонки и пустое — сжимаем и держим высоту */
input[type=date], input[type=datetime-local], input[type=time], input[type=month] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; min-height: 46px; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
select { -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
select[multiple] { background-image: none; padding-right: 13px; }
/* Подпись с галочкой: вся строка нажимается */
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { cursor: pointer; }
/* Участник группы: бумажная бирка, убрать — отдельным крестиком */
.member { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 12px; border-radius: var(--r-sm);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border-strong); font-size: 14px; color: var(--text); }
.member .x { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--text-faint); cursor: pointer; padding: 0; }
.member .x .ic { width: 14px; height: 14px; }
.member .x:hover, .member .x:focus-visible { color: var(--pen); background: rgb(229 52 31 / .1); }
.member form { margin: 0; display: contents; }
/* Двойное касание кнопки — это два нажатия, а не увеличение страницы */
button, .btn, a, input, select, textarea, label, summary { touch-action: manipulation; }
textarea { min-height: 110px; resize: vertical; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field .help { font-size: 12px; color: var(--text-faint); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: var(--r-sm); border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text-muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.chip:hover { text-decoration: none; background: var(--surface-2); color: var(--text); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .ic { width: 14px; height: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: var(--r-sm); font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--text); }
.badge.pen { background: rgb(229 52 31 / .12); color: var(--danger); }

.note { border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px;
  background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--grid); }
.note.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.note.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 3px 0 0 var(--amber); }
.note.bad { background: var(--danger-soft); color: var(--danger); box-shadow: inset 3px 0 0 var(--pen); }

/* Пустое состояние: что здесь будет и что сделать, чтобы появилось */
.empty { text-align: center; padding: 36px 20px; color: var(--text-muted); }
.empty .ico { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: var(--r-md);
  display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--text-faint); }
@keyframes float { 50% { transform: translateY(-4px); } }
.empty .ico .ic { width: 28px; height: 28px; stroke-width: 1.8; }
.empty .what { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* Раскрывающийся блок: редкое действие не занимает место постоянно */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary .chev { margin-left: auto; transition: transform .2s ease; color: var(--text-faint); }
details.fold[open] > summary .chev { transform: rotate(180deg); }
details.fold[open] > summary { margin-bottom: 16px; }
details.fold > summary { transition: margin-bottom var(--t-med) var(--ease); }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  details.fold::details-content { height: 0; overflow: clip; opacity: 0;
    transition: height var(--t-med) var(--ease), opacity var(--t-med) ease, content-visibility var(--t-med) allow-discrete; }
  details.fold[open]::details-content { height: auto; opacity: 1; }
}

/* Шкала и точки уровня */
.meter { height: 6px; border-radius: 1px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--ink-line); }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: inherit;
  transform-origin: left center; animation: meter .9s var(--ease) both; }
@keyframes meter { from { transform: scaleX(0); } }
.meter i.ok { background: var(--ok); }
.meter i.warn { background: var(--amber); }
.meter i.bad { background: var(--danger); }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.dots i.on { background: var(--ink); }

footer.page-foot { margin-top: 32px; font-size: 12px; color: var(--text-faint); }

/* ----------------------------------------------------- красная ручка (static/marks.js) */
.pen-host { position: relative; }
.pen-mark { position: absolute; left: -16px; top: -16px; width: calc(100% + 32px); height: calc(100% + 32px);
  pointer-events: none; z-index: 3; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .pen-mark { mix-blend-mode: normal; } }
/* у сообщения проверки значок заменяет пометка ручкой */
.verdict .mark.pen-host { display: inline-block; min-width: 24px; color: transparent; }
/* ссылки-заголовки в карточках не подчёркиваем, подчёркивание — при наведении */
:where(h1, h2, h3, b, strong, .title) > a:not([class]) { text-decoration-color: transparent; }
:where(h1, h2, h3, b, strong, .title) > a:not([class]):hover { text-decoration-color: var(--pen); }

/* Напоминание об оплате: пробный период, скорое окончание, закрыто */
.pay-banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; margin-bottom: 18px;
  border-radius: var(--r-sm); background: var(--accent-soft); color: var(--text); font-size: 14px; box-shadow: inset 3px 0 0 var(--grid); }
.pay-banner span { flex: 1; min-width: 0; }
.pay-banner.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 3px 0 0 var(--amber); }
.pay-banner.bad { background: var(--danger-soft); color: var(--danger); box-shadow: inset 3px 0 0 var(--pen); }
.pay-banner .btn { flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
}
