/* Raleway 600 отдаём сами: с Google Fonts это два лишних соединения, на 4G
   ~0,5 с до первого текста. Нужен только вес 600 (заголовки, показатели);
   cyrillic-ext — казахские буквы в именах учителей. */
@font-face{font-family:"Raleway";font-style:normal;font-weight:600;font-display:swap;
  src:url(fonts/raleway-600-cyrillic-ext.woff2) format("woff2");
  unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;}
@font-face{font-family:"Raleway";font-style:normal;font-weight:600;font-display:swap;
  src:url(fonts/raleway-600-cyrillic.woff2) format("woff2");
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face{font-family:"Raleway";font-style:normal;font-weight:600;font-display:swap;
  src:url(fonts/raleway-600-latin.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

/* Токены и компоненты перенесены из demo.html — школа уже видела и одобрила
   этот вид. Цвет задаётся только переменной; при добавлении переменной
   обновляй все три блока тем. */
:root{
  --ground:#F7F8FC; --surface:#FFFFFF; --surface-2:#F7F8FC; --line:#E9EBF3; --line-2:#F1F3F9;
  --line-str:#DEE1EC;
  --ink:#27354B; --ink-2:#4A5570; --muted:#AAB0C7; --muted-2:#8F96B3;
  --navy:#19273D; --on-gold:#19273D;
  --gold:#F4B91C; --gold-dark:#B07C00; --gold-soft:#FDF3DA;
  --accent:#3A3F94; --accent-dark:#2E3378; --accent-soft:#ECEDF8; --accent-line:#C3C6E6;
  --ok:#137A5C; --ok-soft:#E4F2ED;
  --late:#B07C00; --late-soft:#FBF3DE;
  --absent:#C0303E; --absent-soft:#FBECEE;
  --rose:#F95D51;
  --data:#3A3F94; --data-soft:#ECEDF8; --grid:#EDEFF6;
  --sh-sm:0 1px 2px 0 rgb(25 39 61 / .06);
  --sh-md:0 6px 14px -4px rgb(25 39 61 / .13), 0 2px 5px -2px rgb(25 39 61 / .07);
  --shim:#EBEDF4; --shim-hi:rgba(255,255,255,.75);
  --r-card:16px; --r-item:12px; --r-sm:8px;
  --ease:cubic-bezier(.2,.7,.2,1);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ground:#0E1728; --surface:#19273D; --surface-2:#152034; --line:#26344E; --line-2:#1E2B43;
    --line-str:#324157;
    --ink:#EAEDF6; --ink-2:#B9C1D6; --muted:#7C86A3; --muted-2:#98A1BC;
    --navy:#101B2E; --on-gold:#19273D;
    --gold:#F4B91C; --gold-dark:#DDA033; --gold-soft:#2B2413;
    --accent:#9198E8; --accent-dark:#7E86DE; --accent-soft:#1E2545; --accent-line:#3A4278;
    --ok:#43BC8D; --ok-soft:#12291F;
    --late:#DDA033; --late-soft:#2A2213;
    --absent:#F2647E; --absent-soft:#2C1620;
    --rose:#FF8562;
    --data:#9198E8; --data-soft:#1E2545; --grid:#243146;
    --sh-sm:0 1px 2px 0 rgb(0 0 0 / .35);
    --sh-md:0 6px 14px -4px rgb(0 0 0 / .5), 0 2px 5px -2px rgb(0 0 0 / .4);
    --shim:#1E2A42; --shim-hi:rgba(255,255,255,.07);
  }
}
:root[data-theme="dark"]{
  --data:#9198E8; --data-soft:#1E2545; --grid:#243146;
  --ground:#0E1728; --surface:#19273D; --surface-2:#152034; --line:#26344E; --line-2:#1E2B43;
  --line-str:#324157;
  --ink:#EAEDF6; --ink-2:#B9C1D6; --muted:#7C86A3; --muted-2:#98A1BC;
  --navy:#101B2E; --on-gold:#19273D;
  --gold:#F4B91C; --gold-dark:#DDA033; --gold-soft:#2B2413;
  --accent:#9198E8; --accent-dark:#7E86DE; --accent-soft:#1E2545; --accent-line:#3A4278;
  --ok:#43BC8D; --ok-soft:#12291F;
  --late:#DDA033; --late-soft:#2A2213;
  --absent:#F2647E; --absent-soft:#2C1620;
  --rose:#FF8562;
  --sh-sm:0 1px 2px 0 rgb(0 0 0 / .35);
  --sh-md:0 6px 14px -4px rgb(0 0 0 / .5), 0 2px 5px -2px rgb(0 0 0 / .4);
  --shim:#1E2A42; --shim-hi:rgba(255,255,255,.07);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{margin:0;background:var(--ground);color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;}
h1,h2,h3,.kpi .v,.brandtxt .nm{font-family:"Raleway",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-variant-numeric:tabular-nums;}
a{color:var(--accent);text-decoration:none;}
a:hover{text-decoration:underline;}
.mono,.num{font-variant-numeric:tabular-nums;}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px;}

/* ===== шапка (только страница входа; в админке бренд живёт в боковом меню) ===== */
.topbar{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--surface) 90%,transparent);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid var(--line);}
.topbar .in{max-width:1280px;margin:0 auto;padding:11px 20px;display:flex;align-items:center;gap:12px;}
.logo{width:36px;height:36px;border-radius:var(--r-item);background:var(--gold);flex:0 0 auto;
  display:grid;place-items:center;color:var(--on-gold);font-weight:700;font-size:15px;}
.brandtxt{min-width:0;flex:1;}
.brandtxt .nm{font-weight:600;font-size:15px;line-height:1.25;letter-spacing:-.01em;}
.brandtxt .sub{font-size:11.5px;color:var(--muted);line-height:1.3;}

/* ===== каркас ===== */
.app{max-width:1280px;margin:0 auto;padding:20px 20px 60px;display:flex;gap:24px;align-items:flex-start;}
.rail{width:206px;flex:0 0 auto;position:sticky;top:20px;}
/* a.brand, а не .brand: у карточки показателя тоже есть класс brand (тёмная), и ей эти правила не нужны. */
a.brand{display:flex;align-items:center;gap:10px;padding:2px 8px 6px;margin-bottom:6px;color:var(--ink);text-decoration:none;}
a.brand:hover{text-decoration:none;}
.brand .logo{width:32px;height:32px;border-radius:10px;font-size:14px;}
.brand .brandtxt{display:flex;flex-direction:column;}
.brand .brandtxt .nm{font-family:"Raleway",system-ui,sans-serif;font-weight:600;font-size:14.5px;line-height:1.2;letter-spacing:-.01em;}
.brand .brandtxt .sub{font-size:11.5px;color:var(--muted);line-height:1.3;}
.nav{display:flex;flex-direction:column;gap:2px;}
.nav .lbl{font-size:11px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);
  padding:14px 12px 6px;}
.nav .lbl:first-child{padding-top:2px;}
.nav a{position:relative;isolation:isolate;display:flex;align-items:center;gap:10px;width:100%;padding:8px 12px;
  border-radius:var(--r-item);font-size:13.5px;color:var(--muted-2);text-align:left;text-decoration:none;
  transition:color .18s,background-color .18s;}
.nav a:hover{color:var(--ink);background:color-mix(in srgb,var(--surface) 55%,transparent);text-decoration:none;}
.nav a[aria-current="page"]{font-weight:500;color:var(--ink);background:none;}
.nav a.going{color:var(--ink);}
.nav .pill{position:absolute;inset:0;z-index:-1;border-radius:inherit;background:var(--surface);
  border:1px solid var(--line);box-shadow:var(--sh-sm);}
.nav a .bdg{margin-left:auto;min-width:18px;height:18px;padding:0 5px;border-radius:999px;
  background:var(--rose);color:#fff;font-size:11px;font-weight:600;line-height:18px;text-align:center;}
/* Иконки, короткие подписи и «Ещё» нужны только нижней панели телефона и листу «Ещё». */
.nav .ic,.nav a .ls,.nav .more,.nav .logout .ic{display:none;}
.nav .logout .btn{display:inline-flex;align-items:center;gap:7px;}
.main{flex:1;min-width:0;max-width:100%;}
.pagehead{display:flex;align-items:baseline;gap:11px;margin-bottom:16px;flex-wrap:wrap;}
.pagehead h1{font-size:19px;font-weight:600;margin:0;letter-spacing:-.015em;}
.pagehead .date{font-size:12.5px;color:var(--muted);}
.pagehead .spacer{flex:1;}
.pagehead.back{margin-bottom:12px;}
.pagehead.back a{font-size:13px;color:var(--muted-2);transition:color .16s;}
.pagehead.back a:hover{color:var(--accent);text-decoration:none;}
h1.nm{margin:0;}
.sec-h{display:flex;align-items:baseline;gap:11px;margin:0 0 12px;}
.sec-h h2{font-size:14px;font-weight:600;margin:0;}
.sec-h .note{font-size:12.5px;color:var(--muted);}
.sec-h.gap{margin-top:26px;}
/* Переключатель «показать/скрыть»: справа в заголовке секции */
.sec-h .sw-form{margin-left:auto;align-self:center;}
.switch{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:var(--ink-2);cursor:pointer;user-select:none;}
.switch input{position:absolute;opacity:0;pointer-events:none;}
.switch .sw{position:relative;width:30px;height:18px;border-radius:999px;background:var(--line-str);transition:background .18s var(--ease);flex:none;}
.switch .sw::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--surface);box-shadow:var(--sh-sm);transition:transform .18s var(--ease);}
.switch input:checked + .sw{background:var(--accent);}
.switch input:checked + .sw::after{transform:translateX(12px);}
.switch input:focus-visible + .sw{outline:2px solid var(--accent-line);outline-offset:2px;}
.switch .sw-n{font-size:11.5px;color:var(--muted-2);font-variant-numeric:tabular-nums;}

/* ===== карточки и показатели ===== */
.card{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--sh-sm);}
.card.pad{padding:16px 18px;}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px;}
.kpi{padding:15px 16px 16px;display:flex;flex-direction:column;gap:2px;}
.kpi .k{font-size:12px;font-weight:500;color:var(--muted-2);}
.kpi .v{font-size:29px;font-weight:600;letter-spacing:-.025em;line-height:1.1;margin-top:7px;}
.kpi .d{font-size:11.5px;color:var(--muted);margin-top:3px;}
.kpi.ok .v{color:var(--ok)} .kpi.late .v{color:var(--late)} .kpi.absent .v{color:var(--absent)}
.kpi.brand{background:var(--navy);border-color:transparent;}
.kpi.brand .k,.kpi.brand .d{color:rgba(255,255,255,.72)} .kpi.brand .v{color:var(--gold)}

.tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:500;padding:4px 10px;
  border-radius:999px;white-space:nowrap;}
.t-absent{color:var(--absent);background:var(--absent-soft);}
.t-late{color:var(--late);background:var(--late-soft);}
.t-ok{color:var(--ok);background:var(--ok-soft);}
.t-mute{color:var(--muted-2);background:var(--surface-2);}
.t-accent{color:var(--accent);background:var(--accent-soft);}

/* ===== таблицы ===== */
.twrap{overflow-x:auto;}
table.tbl{border-collapse:collapse;width:100%;font-size:13px;}
.tbl th{font-size:11px;font-weight:500;color:var(--muted);text-align:left;padding:10px 14px;
  border-bottom:1px solid var(--line);letter-spacing:.02em;text-transform:uppercase;white-space:nowrap;}
.tbl td{padding:10px 14px;border-bottom:1px solid var(--line-2);vertical-align:middle;}
.tbl tr:last-child td{border-bottom:0;}
.tbl td.num,.tbl th.num{text-align:right;}
.tbl .dim{color:var(--muted);}
.tbl .nm{font-weight:600;}
.tbl tr.bad td{background:color-mix(in srgb,var(--absent-soft) 55%,transparent);}
.empty{padding:28px 18px;text-align:center;color:var(--muted);font-size:13px;line-height:1.55;}

/* ===== формы ===== */
.form{display:flex;flex-wrap:wrap;gap:10px;align-items:end;}
.form label{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--muted-2);font-weight:500;}
.form.stack{flex-direction:column;align-items:stretch;}
input[type=text],input[type=search],input[type=date],input[type=password],select,textarea{font:inherit;color:var(--ink);background:var(--surface);
  border:1px solid var(--line-str);border-radius:var(--r-sm);padding:7px 10px;min-width:0;
  transition:border-color .16s,box-shadow .16s;}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);}
/* Поля и списки одной высоты: иначе подписи в ряду фильтров пляшут. */
input[type=text],input[type=search],input[type=date],input[type=password],select{height:34px;padding-top:0;padding-bottom:0;}
input[type=file]{font:inherit;font-size:12.5px;color:var(--ink-2);}
textarea{width:100%;min-height:120px;font-family:ui-monospace,Menlo,monospace;font-size:12.5px;}
.btn{font:inherit;font-size:13px;font-weight:500;color:var(--ink);background:var(--surface);
  border:1px solid var(--line-str);border-radius:var(--r-sm);padding:7px 14px;cursor:pointer;
  touch-action:manipulation;white-space:nowrap;position:relative;
  transition:background-color .16s,border-color .16s,color .16s,transform .12s var(--ease),opacity .16s;}
.btn:active{transform:scale(.97);}
a.btn{display:inline-block;text-decoration:none;}
/* Пока сервер сохраняет: текст гаснет, по кнопке бежит блик — видно, что нажатие принято. */
.btn.busy{pointer-events:none;color:transparent !important;overflow:hidden;}
.btn.busy::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgb(255 255 255 / .35),transparent) 0 0/50% 100% no-repeat;
  animation:sweep 1s linear infinite;}
@keyframes sweep{from{background-position:-100% 0}to{background-position:200% 0}}
.btn:hover{border-color:var(--accent-line);color:var(--accent);}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;}
.btn.primary:hover{background:var(--accent-dark);color:#fff;}
.btn.danger{color:var(--absent);}
.btn.sm{font-size:12px;padding:4px 10px;}
.btn.ico{min-width:30px;padding-left:0;padding-right:0;text-align:center;font-size:15px;line-height:1.2;}
form.inline{display:inline;}
.nav .logout{margin-top:14px;padding:0 12px;}
.login{max-width:380px;margin:48px auto;padding:0 16px;}
.check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink-2);}
.form label.check{flex-direction:row;align-items:center;gap:6px;font-size:12.5px;color:var(--ink-2);}
input[type=checkbox]{accent-color:var(--accent);}

/* ===== сообщения ===== */
.flash{padding:11px 14px;border-radius:var(--r-item);margin-bottom:14px;font-size:13px;
  background:var(--accent-soft);color:var(--accent);border:1px solid var(--accent-line);}
.flash.ok{background:var(--ok-soft);color:var(--ok);border-color:transparent;}
.flash.bad{background:var(--absent-soft);color:var(--absent);border-color:transparent;}

/* ===== фото ===== */
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;}
.ph{display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid var(--line);
  border-radius:var(--r-item);background:var(--surface-2);}
.ph.bad{border-color:color-mix(in srgb,var(--absent) 35%,var(--line));}
.ph.review{border-color:color-mix(in srgb,var(--late) 50%,var(--line));}
.ph img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:var(--r-sm);background:var(--surface);}
.ph .why{font-size:11.5px;line-height:1.4;color:var(--ink-2);}
.ph .why.bad{color:var(--absent);}
.ph .why.review{color:var(--late);}
.ph .meta{font-size:11px;color:var(--muted);}
.ph .acts{display:flex;gap:6px;flex-wrap:wrap;}
.prof{display:grid;grid-template-columns:296px minmax(0,1fr);gap:16px;align-items:start;}
.pcard{padding:18px;display:flex;flex-direction:column;gap:14px;}
.pcard .nm{font-size:16.5px;font-weight:600;letter-spacing:-.01em;}
.pcard .cl{font-size:12.5px;color:var(--muted);margin-top:2px;}
.plist{display:flex;flex-direction:column;gap:6px;font-size:12.5px;}
.plist .li{display:flex;justify-content:space-between;gap:10px;color:var(--ink-2);}
.plist .li span:last-child{color:var(--muted);}
.hint{font-size:12px;color:var(--muted);line-height:1.55;}
.hint.warn{color:var(--late);}
.dup{display:grid;grid-template-columns:120px 1fr auto;gap:14px;align-items:center;padding:12px 16px;
  border-bottom:1px solid var(--line-2);}
.dup:last-child{border-bottom:0;}
.dup img{width:120px;aspect-ratio:1;object-fit:cover;border-radius:var(--r-sm);}
.dup .why{color:var(--late);font-size:13px;}
.dup .meta{font-size:12px;color:var(--muted);margin-top:4px;}

/* ===== посещаемость ===== */
.alerts{display:flex;flex-direction:column;gap:10px;margin-bottom:22px;}
.alert{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;padding:14px 16px;}
.face{width:44px;height:44px;border-radius:var(--r-item);background:var(--accent-soft);color:var(--accent);
  display:grid;place-items:center;font-size:13.5px;font-weight:600;flex:0 0 auto;overflow:hidden;}
.face img{width:100%;height:100%;object-fit:cover;}
/* Важность тревоги видна по аватару и метке справа, а не по цветной полосе сбоку */
.alert.crit .face{background:var(--absent-soft);color:var(--absent);}
.alert.warn .face{background:var(--late-soft);color:var(--late);}
.alert .nm{font-size:14px;font-weight:600;overflow-wrap:anywhere;}
.alert .meta{font-size:12.5px;color:var(--muted-2);margin-top:3px;line-height:1.5;}
.alert .meta b{color:var(--ink);font-weight:600;}
.alert .right{display:flex;flex-direction:column;align-items:flex-end;gap:6px;}
.alert .when{font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums;}
.daynav{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.crop{width:48px;height:48px;border-radius:var(--r-sm);object-fit:cover;background:var(--surface-2);display:block;}
details.card>summary{padding:14px 18px;cursor:pointer;font-size:13px;font-weight:600;}
details.card[open]>summary{border-bottom:1px solid var(--line-2);}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--muted);margin-right:6px;}
.dot.ok{background:var(--ok)} .dot.bad{background:var(--absent)}

/* ===== проверка камерой ===== */
.checkgrid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start;}
.stage{position:relative;overflow:hidden;min-height:240px;background:var(--surface-2);}
.stage video,.stage img{display:block;width:100%;height:auto;}
/* display:block выше перебивает атрибут hidden: скрытое пустое <video> занимало
   место над кадром камеры школы, и рамки лиц уезжали вверх. */
.stage [hidden]{display:none;}
.stage canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;}
.stage .empty{position:absolute;inset:0;display:grid;place-items:center;}
.legend{display:flex;flex-direction:column;gap:6px;font-size:12.5px;color:var(--ink-2);}
.dot.late{background:var(--late)}

/* ===== памятка ===== */
.guide{max-width:920px;}
.guide .lead{margin:0;font-size:14px;line-height:1.6;color:var(--ink-2);}
.guide .list{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:8px;font-size:13px;line-height:1.55;color:var(--ink-2);}
.guide .tbl td{vertical-align:top;line-height:1.5;}

/* ===== список с фильтрами и модалки ===== */
.filters{display:flex;flex-wrap:wrap;gap:10px;align-items:end;padding:12px 14px;margin-bottom:12px;}
.filters label{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--muted-2);font-weight:500;}
.filters label.grow{flex:1 1 200px;}
.filters select{min-width:84px;}
.pagehead .btn{align-self:center;}

dialog.modal{width:min(520px,calc(100vw - 32px));padding:0;border:1px solid var(--line);border-radius:var(--r-card);
  background:var(--surface);color:var(--ink);box-shadow:var(--sh-md);}
dialog.modal::backdrop{background:rgb(14 23 40 / .45);}
dialog.modal.wide{width:min(760px,calc(100vw - 32px));}
.modal .mh{display:flex;align-items:center;gap:10px;padding:16px 18px;border-bottom:1px solid var(--line-2);}
.modal .mh h2{font-size:15px;font-weight:600;margin:0;flex:1;}
.modal .x{font:inherit;font-size:20px;line-height:1;color:var(--muted);background:none;border:0;cursor:pointer;padding:2px 6px;border-radius:var(--r-sm);}
.modal .x:hover{color:var(--ink);background:var(--surface-2);}
.modal .mb{padding:16px 18px;}
.modal .mb.form.stack{gap:12px;}
.modal .mb .form{gap:10px;}
.modal .mb .form label select{min-width:72px;}
.modal .mf{display:flex;align-items:center;gap:8px;justify-content:flex-end;padding:12px 18px;border-top:1px solid var(--line-2);}
.modal .mf .spacer{flex:1;}
.modal .mf .dl{font-size:13px;}

.drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  min-height:150px;padding:20px;border:1.5px dashed var(--line-str);border-radius:var(--r-item);
  background:var(--surface-2);text-align:center;cursor:pointer;transition:border-color .15s,background .15s;}
.drop input{position:absolute;inset:0;opacity:0;cursor:pointer;}
.drop .dt{font-size:14px;font-weight:600;color:var(--ink);}
.drop .ds{font-size:12.5px;color:var(--muted);}
.drop .df{margin-top:8px;font-size:12.5px;font-weight:500;color:var(--accent);background:var(--accent-soft);
  padding:4px 10px;border-radius:999px;}
.drop:hover,.drop.over{border-color:var(--accent);background:var(--accent-soft);}
.drop:focus-within{border-color:var(--accent-line);}
.drop.has{border-style:solid;border-color:var(--accent-line);}
/* Компактная зона в строке формы: рядом с кнопкой «Загрузить» */
.form .drop.sm{flex:1 1 280px;min-height:64px;padding:10px 14px;flex-direction:row;flex-wrap:wrap;gap:4px 10px;}
.drop.sm .dt{font-size:13px;}
.drop.sm .df{margin-top:0;}
.form .drop{font-size:inherit;color:inherit;font-weight:inherit;}
.form:has(.drop.sm){align-items:center;}

/* ===== карточка ученика (как в прототипе demo.html) ===== */
.scard{padding:18px;}
.scard .top{display:flex;gap:13px;align-items:center;}
.face.big{width:56px;height:56px;font-size:16px;}
.scard .nm{font-size:16.5px;font-weight:600;letter-spacing:-.01em;overflow-wrap:anywhere;}
.scard .cl{font-size:12.5px;color:var(--muted);margin-top:2px;}
.pstats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px;}
.pstats>div,.dgrid>div{background:var(--surface-2);border-radius:var(--r-item);padding:11px 13px;}
.pstats .k,.dgrid .k{font-size:11px;font-weight:500;color:var(--muted-2);}
.pstats .v,.dgrid .v{font-family:"Raleway",system-ui,sans-serif;font-size:18px;font-weight:600;margin-top:3px;
  letter-spacing:-.02em;white-space:nowrap;font-variant-numeric:tabular-nums;}
.dgrid .v.dim{color:var(--muted);}
.pblock{margin-top:16px;padding-top:14px;border-top:1px solid var(--line);}
.pblock .k{font-size:11px;font-weight:500;color:var(--muted-2);margin-bottom:8px;}
.pblock .li{display:flex;justify-content:space-between;gap:10px;font-size:12.5px;padding:5px 0;color:var(--ink-2);}
.pblock .li span:last-child{color:var(--muted);font-variant-numeric:tabular-nums;text-align:right;}
.pblock .bad{color:var(--absent);font-weight:600;}

.cal{padding:15px 16px 16px;}
.cal .ch{display:flex;align-items:center;gap:10px;margin-bottom:12px;}
.cal .cm{font-size:13.5px;font-weight:600;flex:1;}
.cal .cn{font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums;}
.cal .grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;}
.cal .wd{font-size:10.5px;font-weight:500;color:var(--muted);text-align:center;padding-bottom:6px;}
.cal .day{height:44px;border-radius:var(--r-sm);display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:3px;font-size:13px;color:var(--ink-2);font-variant-numeric:tabular-nums;
  text-decoration:none;transition:background .13s,color .13s;}
.cal a.day:hover{background:var(--surface-2);text-decoration:none;}
.cal .day.empty{pointer-events:none;}
.cal .day.wknd{color:var(--muted);opacity:.55;}
.cal .day.today{box-shadow:inset 0 0 0 1.5px var(--accent-line);}
.cal .day.sel,.cal a.day.sel:hover{background:var(--gold);color:var(--on-gold);font-weight:600;box-shadow:none;opacity:1;}
.cal .pips{display:flex;gap:2px;height:4px;}
.cal .pip{width:4px;height:4px;border-radius:50%;}
.cal .pip.ok,.cal .lg i.ok{background:var(--ok);} .cal .pip.late,.cal .lg i.late{background:var(--late);}
.cal .pip.absent,.cal .lg i.absent{background:var(--absent);}
.cal .day.sel .pip{background:var(--on-gold);opacity:.55;}
.cal .lg{display:flex;flex-wrap:wrap;gap:10px;margin-top:13px;padding-top:12px;border-top:1px solid var(--line);}
.cal .lg span{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted);}
.cal .lg i{width:6px;height:6px;border-radius:50%;display:block;}

.dayinfo{margin-top:12px;padding:16px 18px 17px;}
.dayinfo .dh{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px;}
.dayinfo .dd{font-size:14.5px;font-weight:600;letter-spacing:-.005em;}
.dgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
.dnote{font-size:12.5px;color:var(--ink-2);margin-top:13px;line-height:1.6;}

.dlist{display:flex;flex-direction:column;margin-top:13px;}
.dlist .lr{display:grid;grid-template-columns:64px 72px 1fr auto;gap:12px;align-items:center;
  padding:10px 0;border-bottom:1px solid var(--line-2);font-size:13px;}
.dlist .lr:last-child{border-bottom:0;}
.dlist .lr .ln{font-weight:600;}
.dlist .lr .lm{color:var(--muted-2);font-variant-numeric:tabular-nums;}
.dlist .lr .lm b{color:var(--ink);font-weight:600;}

details.danger-zone>summary{font-size:12.5px;color:var(--muted-2);cursor:pointer;}
details.danger-zone[open]>summary{margin-bottom:6px;}
details.danger-zone .hint{margin:0 0 8px;}

/* ===== аналитика ===== */
.charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.chart{padding:17px 18px 15px;}
.chart h3{font-size:13.5px;font-weight:600;margin:0;letter-spacing:-.005em;}
.chart .cap{font-size:12px;color:var(--muted);margin-top:3px;}
.chart svg{display:block;width:100%;height:auto;margin-top:14px;overflow:visible;}
.chart .axl{font-size:10.5px;fill:var(--muted);font-variant-numeric:tabular-nums;}
.chart .gl{stroke:var(--grid);stroke-width:1;}
.chart .vl{font-size:11px;fill:var(--ink-2);font-weight:600;font-variant-numeric:tabular-nums;}
.chart .f-data{fill:var(--data);} .chart .f-late{fill:var(--late);} .chart .f-absent{fill:var(--absent);}
.chart .s-data{stroke:var(--data);} .chart .s-late{stroke:var(--late);}
.chart .f-area{fill:var(--data-soft);}
.chart .hit{fill:transparent;}
.chart .hit:hover{fill:var(--ink);fill-opacity:.04;}
.chart .leg{display:flex;gap:14px;flex-wrap:wrap;margin-top:12px;padding-top:11px;border-top:1px solid var(--line);}
.chart .leg span{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted);}
.chart .leg i{width:9px;height:9px;border-radius:3px;display:block;}
.chart .none{padding:40px 0;text-align:center;color:var(--muted);font-size:13px;}
.exports{display:flex;flex-wrap:wrap;gap:10px;}

/* ===== приёмка ===== */
.accgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.acc{padding:15px 16px 16px;display:flex;flex-direction:column;gap:4px;}
.acc .ah{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.acc .at{font-size:12.5px;font-weight:500;color:var(--ink-2);line-height:1.4;}
.acc .av{font-family:"Raleway",system-ui,sans-serif;font-size:27px;font-weight:600;letter-spacing:-.02em;margin-top:6px;font-variant-numeric:tabular-nums;}
.acc.ok .av{color:var(--ok);} .acc.fail .av{color:var(--absent);} .acc.nodata .av{color:var(--muted);}
.acc .ag{font-size:12px;color:var(--muted-2);}
.acc .ab{font-size:12px;color:var(--ink-2);margin-top:6px;line-height:1.5;}
.acc .an{font-size:12px;color:var(--muted-2);line-height:1.5;margin-top:4px;}
details.rollcls{margin-bottom:8px;}
details.rollcls>summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.rollcls .rc-n{font-weight:600;min-width:44px;}
.rollcls .rc-m{font-size:12px;font-weight:400;color:var(--muted);}
.rc-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 16px;padding:10px 18px 14px;}
.rc-row{display:flex;align-items:center;gap:9px;padding:6px 0;font-size:13px;border-bottom:1px solid var(--line-2);cursor:pointer;}
.rc-row .rc-name{flex:1;min-width:0;overflow-wrap:anywhere;}
.rc-row input:checked + .rc-name{color:var(--absent);font-weight:600;}
.rc-row .rc-name{transition:color .16s;}
.savebar{position:sticky;bottom:14px;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-top:12px;padding:10px 12px 10px 16px;border:1px solid var(--line);border-radius:var(--r-item);
  background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);box-shadow:var(--sh-md);}
.savebar .hint b{color:var(--ink);font-variant-numeric:tabular-nums;}

/* ===== сетка уроков ===== */
.lwrap{overflow-x:auto;}
/* Колонки фиксированной ширины, плитки одной высоты: при 14 уроках таблица
   листается вбок, а не сжимает плитки — иначе каждая ужималась по-своему,
   под длину имени. */
.lg-tbl{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content;}
.lg-tbl th:not(:first-child),.lg-tbl td:not(:first-child){width:118px;}
.lg-tbl th{font-size:11px;font-weight:500;color:var(--muted);padding:0 0 10px;text-align:center;}
.lg-tbl th:first-child{text-align:left;}
.lg-tbl th .tt{font-variant-numeric:tabular-nums;}
.lg-tbl td{padding:0 4px 7px 0;}
.lg-tbl td:first-child,.lg-tbl th:first-child{width:88px;}
.lg-tbl td:first-child{font-size:12.5px;font-weight:500;color:var(--ink-2);padding-right:12px;line-height:1.3;}
.cell{border-radius:var(--r-item);padding:9px 10px;height:80px;overflow:hidden;box-sizing:border-box;border:1px solid var(--line);
  background:var(--surface);display:flex;flex-direction:column;gap:3px;width:100%;text-align:left;color:var(--ink);
  text-decoration:none;transition:transform .13s,box-shadow .13s;}
a.cell:hover{text-decoration:none;box-shadow:var(--sh-md);}
.cell .cn,.cell .cs{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;}
.cell .cn{font-size:12px;font-weight:600;line-height:1.25;}
.cell .cs{font-size:11px;line-height:1.3;font-variant-numeric:tabular-nums;}
.cell.s-ok{background:var(--ok-soft);border-color:transparent;} .cell.s-ok .cs{color:var(--ok);font-weight:500;}
.cell.s-late{background:var(--late-soft);border-color:transparent;} .cell.s-late .cs{color:var(--late);font-weight:500;}
.cell.s-none{background:var(--absent-soft);border-color:transparent;} .cell.s-none .cs{color:var(--absent);font-weight:500;}
.cell.s-idle{background:var(--surface-2);border-style:dashed;border-color:var(--line-str);}
.cell.s-idle .cn,.cell.s-idle .cs{color:var(--muted);font-weight:400;}
.cell.s-free{background:transparent;border-color:transparent;}
.lglegend{display:flex;flex-wrap:wrap;gap:14px;margin-top:15px;padding-top:14px;border-top:1px solid var(--line);}
.lglegend span{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);}
.lglegend i{width:11px;height:11px;border-radius:4px;display:block;border:1px solid;}

/* ===== движение (как в прототипе demo.html) ===== */
/* Заглушка — ровный фон и бегущий по нему блик, а не переливающийся градиент. */
@keyframes shimmer{100%{transform:translateX(100%)}}
.shimmer{position:relative;overflow:hidden;background:var(--shim);border-radius:6px;max-width:100%;flex:0 0 auto;}
.shimmer::after{content:"";position:absolute;inset:0;transform:translateX(-100%);
  background:linear-gradient(90deg,transparent,var(--shim-hi),transparent);animation:shimmer 1.4s infinite;}
.sk-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card);
  box-shadow:var(--sh-sm);padding:15px 16px;display:flex;flex-direction:column;gap:9px;min-width:0;}
.sk-col{display:flex;flex-direction:column;gap:12px;min-width:0;}
.sk-line{flex-direction:row;align-items:center;gap:14px;}
.sk-tr{display:grid;grid-template-columns:70px 1.4fr 1fr 80px;gap:22px;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line-2);}
.sk-tr:last-child{border-bottom:0;}

@keyframes fade-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.fade-in{animation:fade-in .28s ease-out both;}
/* Экран «всплывает»: сначала заголовок, следом карточки показателей и списки по очереди. */
@keyframes rise{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.main.rise>*{animation:rise .34s cubic-bezier(.22,.8,.3,1) both;}
.main.rise>:nth-child(2){animation-delay:.04s} .main.rise>:nth-child(3){animation-delay:.08s}
.main.rise>:nth-child(4){animation-delay:.12s} .main.rise>:nth-child(5){animation-delay:.16s}
.main.rise>:nth-child(n+6){animation-delay:.2s}
.main.rise :is(.kpis,.accgrid,.charts,.alerts,.pgrid)>*{animation:rise .42s cubic-bezier(.22,.8,.3,1) both;}
.main.rise :is(.kpis,.accgrid,.charts,.alerts,.pgrid)>:nth-child(1){animation-delay:.03s}
.main.rise :is(.kpis,.accgrid,.charts,.alerts,.pgrid)>:nth-child(2){animation-delay:.07s}
.main.rise :is(.kpis,.accgrid,.charts,.alerts,.pgrid)>:nth-child(3){animation-delay:.11s}
.main.rise :is(.kpis,.accgrid,.charts,.alerts,.pgrid)>:nth-child(4){animation-delay:.15s}
.main.rise :is(.kpis,.accgrid,.charts,.alerts,.pgrid)>:nth-child(5){animation-delay:.19s}
.main.rise :is(.kpis,.accgrid,.charts,.alerts,.pgrid)>:nth-child(n+6){animation-delay:.23s}
/* Модальное окно лежит в содержимом: его не анимируем вместе с экраном. */
.main.rise>dialog{animation:none;}

/* Полоска загрузки по верхнему краю */
#progress{position:fixed;left:0;top:0;height:2px;width:0;z-index:60;background:var(--accent);pointer-events:none;
  opacity:0;transition:width .3s ease,opacity .25s;}
#progress.on{opacity:1;}

/* Фото: пока грузится — тот же бегущий блик, что у заглушек. */
@keyframes img-sweep{from{background-position:-60% 0,0 0}to{background-position:160% 0,0 0}}
img.img-wait{background:linear-gradient(90deg,transparent,var(--shim-hi),transparent) no-repeat,var(--shim);
  background-size:50% 100%,100% 100%;animation:img-sweep 1.4s linear infinite;color:transparent;}

/* Нажатие чувствуется: карточки-ссылки и строки чуть «проседают». */
.alert:active,a.cell:active,.cal a.day:active{transform:scale(.985);}
.alert,.kpi{transition:transform .15s,box-shadow .15s;}

/* Живой фильтр и обновление: старый список чуть гаснет, пока приходит новый. */
.main.refreshing>:not(:has(form[data-live]),form[data-live],.pagehead){opacity:.55;transition:opacity .2s ease;}

/* Сообщение после действия выезжает, а не появляется рывком. */
.flash[data-msg]{animation:flash-in .35s var(--ease) both;}
@keyframes flash-in{from{opacity:0;transform:translateY(-6px);}}

/* Раскрывающиеся списки открываются по высоте, а не скачком. */
:root{interpolate-size:allow-keywords;}
details::details-content{block-size:0;overflow-y:clip;
  transition:block-size .28s var(--ease),content-visibility .28s allow-discrete;}
details[open]::details-content{block-size:auto;}
details>summary{transition:color .16s;}
details.card>summary{list-style:none;display:flex;align-items:center;gap:10px;}
details.card>summary::-webkit-details-marker{display:none;}
details.card>summary::after{content:"";width:7px;height:7px;margin-left:auto;flex:0 0 auto;
  border-right:1.5px solid var(--muted-2);border-bottom:1.5px solid var(--muted-2);
  transform:translateY(-2px) rotate(45deg);transition:transform .25s var(--ease);}
details.card[open]>summary::after{transform:translateY(1px) rotate(-135deg);}

/* Модальные окна: проявление и лёгкий подъём; закрытие — так же обратно. */
dialog.modal{opacity:0;transform:translateY(8px) scale(.985);
  transition:opacity .2s ease,transform .24s var(--ease),overlay .24s allow-discrete,display .24s allow-discrete;}
dialog.modal[open]{opacity:1;transform:none;}
@starting-style{dialog.modal[open]{opacity:0;transform:translateY(8px) scale(.985);}}
dialog.modal::backdrop{opacity:0;transition:opacity .24s ease,overlay .24s allow-discrete,display .24s allow-discrete;}
dialog.modal[open]::backdrop{opacity:1;}
@starting-style{dialog.modal[open]::backdrop{opacity:0;}}

/* Строки и карточки-ссылки откликаются на наведение. */
.tbl tbody tr{transition:background-color .14s;}
.tbl tbody tr:hover td{background:color-mix(in srgb,var(--surface-2) 70%,transparent);}
.tbl tbody tr.bad:hover td{background:color-mix(in srgb,var(--absent-soft) 75%,transparent);}
a.cell:hover{transform:translateY(-1px);}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none !important;transition:none !important;}
}

@media print{
  .topbar,.rail,.noprint{display:none !important;}
  .app{padding:0;display:block;} body{background:var(--surface);}
  .card{box-shadow:none;break-inside:avoid;}
}

@media (max-width:1080px){
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr));} .prof{grid-template-columns:minmax(0,1fr);}
  .checkgrid{grid-template-columns:minmax(0,1fr);} .charts{grid-template-columns:minmax(0,1fr);}
  .accgrid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
/* ===== планшет и телефон: разделы в нижней панели, как в прототипе ===== */
@media (max-width:820px){
  .dgrid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .accgrid,.rc-list{grid-template-columns:minmax(0,1fr);}
  .dlist .lr{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:11px 0;}
  /* В колонке align-items управляет горизонталью: со stretch содержимое не сжимается под текст. */
  .app{flex-direction:column;gap:0;align-items:stretch;padding:14px 14px calc(76px + env(safe-area-inset-bottom,0px));}
  .main{width:100%;}
  /* Разделы уезжают в нижнюю панель: до неё дотягивается большой палец,
     и она не отнимает высоту у содержимого. Бренд не нужен: название раздела есть в заголовке. */
  .rail{position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;z-index:40;margin:0;
    background:color-mix(in srgb,var(--surface) 93%,transparent);
    backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
    border-top:1px solid var(--line);
    padding:5px 4px calc(5px + env(safe-area-inset-bottom,0px));}
  .rail .brand{display:none;}
  .nav{display:grid;grid-template-columns:repeat(5,1fr);gap:2px;}
  .nav .lbl,.nav .logout,.nav a:not(.pri),.nav .pill,.nav a .lt{display:none;}
  .nav a,.nav .more{display:flex;flex-direction:column;align-items:center;gap:3px;width:auto;padding:7px 2px 5px;
    border-radius:10px;font:inherit;font-size:10.5px;line-height:1.2;text-align:center;position:relative;
    background:none;border:0;color:var(--muted-2);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
  .nav .ic,.nav a .ls{display:block;}
  .nav .ic{width:22px;height:22px;}
  .nav a:hover{background:none;color:var(--muted-2);}
  .nav a:active,.nav .more:active{background:var(--accent-soft);}
  .nav a[aria-current="page"]{color:var(--accent);font-weight:500;}
  /* Открыт раздел из листа «Ещё» — подсвечена кнопка «Ещё». */
  .rail:has(.nav a[aria-current="page"]:not(.pri)) .more{color:var(--accent);}
  .nav a .bdg,.nav .more .bdg{position:absolute;top:2px;left:calc(50% + 4px);margin:0;min-width:16px;height:16px;
    padding:0 4px;line-height:16px;font-size:10px;}

  /* Лист «Ещё»: все разделы списком, снизу, под большой палец. */
  dialog.sheet{width:100%;max-width:none;margin:auto 0 0;border-radius:18px 18px 0 0;border-bottom:0;
    max-height:min(86dvh,620px);overflow:auto;padding:8px 10px calc(10px + env(safe-area-inset-bottom,0px));}
  .sheetnav{display:flex;flex-direction:column;gap:2px;}
  .sheetnav .lbl{display:block;padding:12px 12px 6px;}
  .sheetnav .lbl:first-child{padding-top:6px;}
  .sheetnav a,.sheetnav a:not(.pri),.sheetnav a .lt{display:flex;}
  .sheetnav a{flex-direction:row;align-items:center;gap:12px;width:100%;padding:11px 12px;font-size:14.5px;
    text-align:left;color:var(--ink-2);}
  .sheetnav a .ls{display:none;}
  .sheetnav .ic{width:20px;height:20px;flex:0 0 auto;}
  .sheetnav a[aria-current="page"]{color:var(--accent);background:var(--accent-soft);}
  .sheetnav a .bdg{position:static;margin-left:auto;min-width:18px;height:18px;line-height:18px;font-size:11px;padding:0 5px;}
  .sheetnav .logout{display:block;margin:10px 12px 4px;padding:0;}
  .sheetnav .logout .btn{display:inline-flex;align-items:center;gap:8px;}
  .sheetnav .logout .ic{display:block;width:18px;height:18px;}

  /* Заголовок: навигация по дням и кнопки — своей строкой на всю ширину. */
  .pagehead{gap:4px 10px;margin-bottom:13px;}
  .pagehead h1{font-size:18px;}
  .pagehead .daynav{flex:1 1 100%;}
  .pagehead .daynav form{flex:1;} .pagehead .daynav input[type=date]{width:100%;}
  .sec-h{flex-wrap:wrap;gap:2px 10px;}
  .sec-h .sw-form{flex:1 1 100%;margin:6px 0 0;}
  /* Поля крупнее: iPhone приближает страницу, если шрифт в поле меньше 16 px. */
  input[type=text],input[type=search],input[type=date],input[type=password],select,textarea{font-size:16px;}
  input[type=text],input[type=search],input[type=date],input[type=password],select{height:40px;}
  .btn{padding:9px 14px;} .btn.sm{padding:6px 11px;font-size:12.5px;} .btn.ico{min-width:34px;}
  .filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:stretch;}
  .filters label.grow,.filters .btn{grid-column:1 / -1;}
  .filters select,.filters input{width:100%;}
  .form:not(.inline) > label{flex:1 1 100%;}
  .form > label > input:not([type=checkbox]),.form > label > select{width:100%;}
  .form > label.check{flex-basis:100%;}
  .form .drop.sm{flex-basis:100%;}
  .exports .btn{flex:1 1 auto;text-align:center;}
  /* Окна — листом снизу, во всю ширину. */
  dialog.modal,dialog.modal.wide{width:100%;max-width:none;margin:auto 0 0;border-radius:18px 18px 0 0;border-bottom:0;
    max-height:92dvh;overflow:auto;}
  .modal .mb .form > label{flex:1 1 100%;}
  .modal .mf{flex-wrap:wrap;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px));}
  .savebar{bottom:calc(72px + env(safe-area-inset-bottom,0px));}

  .dup{grid-template-columns:80px 1fr;} .dup img{width:80px;}
  .dup > div:last-child{grid-column:1 / -1;flex-direction:row !important;}
  .alert{grid-template-columns:auto minmax(0,1fr);row-gap:10px;padding:13px 14px;}
  .alert .right{grid-column:1 / -1;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:6px 10px;}
  .alert .when{white-space:normal;}
  /* Сетка уроков: первая колонка прилипает, остальное листается вбок. */
  .lg-tbl th:first-child,.lg-tbl td:first-child{position:sticky;left:0;z-index:2;background:var(--surface);}
  .lg-tbl td:first-child{width:66px;padding-right:9px;font-size:12px;}
  .scrollhint{display:block;}
  /* Второстепенные колонки таблиц на телефоне не показываем: остальное читается без прокрутки. */
  .hide-m{display:none !important;}
  .tbl th,.tbl td{padding:9px 10px;}
}
/* Подсказка «листайте вбок» нужна только на узком экране. */
.scrollhint{display:none;margin:8px 0 0;font-size:12px;color:var(--muted);}

/* ===== телефон ===== */
@media (max-width:560px){
  .app{padding:12px 12px calc(74px + env(safe-area-inset-bottom,0px));}
  .pagehead h1{font-size:17px;}
  .kpis{gap:10px;} .kpi{padding:13px 14px 14px;} .kpi .v{font-size:26px;}
  .face{width:40px;height:40px;font-size:12.5px;}
  .cal{padding:13px 13px 14px;} .cal .grid{gap:2px;} .cal .day{height:40px;font-size:12.5px;}
  .dayinfo{padding:14px 15px 15px;} .dayinfo .dh{flex-wrap:wrap;gap:8px;}
  .dgrid{gap:8px;} .dgrid .v{font-size:16.5px;}
  .pcard,.scard{padding:15px;} .face.big{width:48px;height:48px;font-size:14px;}
  .pstats{gap:8px;}
  .pgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .chart{padding:15px 15px 13px;} .charts{gap:12px;}
  .card.pad{padding:14px 14px;}
  /* Кнопки заголовка («Загрузить список», «+ Добавить») — своей строкой под названием. */
  .pagehead .spacer{flex-basis:100%;}
  .pagehead .btn{flex:1 1 auto;text-align:center;}
  .empty{padding:22px 14px;}
}
