/* Пульт завода в цветах Buhari School (buhari-quran.kz, buhari-school.framer.ai):
   белая бумага на сетке, синий градиент главных кнопок, золотой акцент, Inter.
   Раскладка и классы — один в один из пульта фабрики 2.0. */
@font-face { font-family:"Inter"; font-style:normal; font-weight:100 900; font-display:swap;
  src:url("/fonts/inter-cyrillic.woff2") format("woff2"); unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family:"Inter"; font-style:normal; font-weight:100 900; font-display:swap;
  src:url("/fonts/inter-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; }

:root {
  --ink:#171717; --text:#171717; --muted:#5B6472; --faint:rgba(23,23,23,.06);
  --paper:#fff; --bg:#F4F7FC; --line:#E6E9EF; --grid:#EBEFF6;
  --blue:#0051A9; --blue-2:#2986E3; --blue-deep:#003E80; --blue-soft:#E8F1FC; --blue-line:#C9DDF5;
  --gold-1:#D6AF00; --gold-2:#FED309; --gold-ink:#3D3100; --gold-text:#7A6200; --gold-soft:#FFF7D1; --gold-line:#F2E19A;
  --grad-blue:linear-gradient(180deg,#2986E3 0%,#0051A9 100%);
  --grad-gold:linear-gradient(90deg,#D6AF00 0%,#FED309 100%);
  --glow-blue:0 10px 24px -12px rgba(0,81,169,.7), inset 0 1px 0 rgba(255,255,255,.25);
  --glow-gold:0 10px 24px -14px rgba(214,175,0,.9), inset 0 1px 0 rgba(255,255,255,.35);
  --amber-bg:#FFF4D6; --amber:#8A5A00; --red-bg:#FDECEA; --red:#B42318;
  --green-bg:#E3F4EA; --green:#1D7A46;
  --shadow:0 4px 20px rgba(0,40,90,.06); --shadow-lg:0 18px 44px rgba(0,40,90,.14);
  --r:22px;
  --soft:radial-gradient(60% 90% at 10% 0%, rgba(41,134,227,.16) 0%, rgba(41,134,227,0) 62%),
         radial-gradient(55% 90% at 92% 100%, rgba(254,211,9,.20) 0%, rgba(254,211,9,0) 62%),
         linear-gradient(#FBFCFF 0%, #F4F7FC 100%);
}
* { box-sizing:border-box; }
html, body { margin:0; background:var(--bg); color:var(--text); }
body { font-family:"Inter","Helvetica Neue",Arial,sans-serif; font-weight:450; font-size:15px; line-height:1.5;
       -webkit-font-smoothing:antialiased; font-feature-settings:"cv11","ss01";
       background-color:var(--bg);
       background-image:linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
       background-size:56px 56px; background-position:-1px -1px; }
a { color:inherit; }
button, input, select, textarea { font:inherit; color:inherit; }
h1 { font-size:28px; line-height:1.15; font-weight:700; letter-spacing:-.025em; margin:0; color:var(--ink); }
h2 { font-size:19px; line-height:1.25; font-weight:700; letter-spacing:-.02em; margin:0; color:var(--ink); }
h3 { font-size:15px; font-weight:700; margin:0; color:var(--ink); }
mark { background:var(--gold-soft); color:var(--gold-ink); border-radius:6px; padding:0 .15em; }
.muted { color:var(--muted); }
.small { font-size:13px; }
.mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px; }
[hidden] { display:none !important; }

/* ── каркас ── */
.app { display:grid; grid-template-columns:240px 1fr; min-height:100vh; }
.side { position:sticky; top:0; height:100vh; padding:22px 14px; display:flex; flex-direction:column; gap:4px;
        background:var(--paper); border-right:1px solid var(--line); }
.brand { display:flex; flex-direction:column; align-items:flex-start; gap:6px; padding:4px 10px 14px; font-weight:700; font-size:18px; color:var(--ink); text-decoration:none; }
.brand img { height:24px; width:auto; }
.brand small { display:block; font-size:11.5px; font-weight:600; color:var(--muted); letter-spacing:.02em; }
.bsel { margin:0 4px 14px; }
.bsel select { width:100%; border:1.5px solid var(--line); border-radius:12px; padding:9px 12px; font-weight:600; background:var(--bg); cursor:pointer; }
.bsel .one { padding:9px 12px; border-radius:12px; background:var(--bg); font-weight:600; font-size:14px; }
.nav a { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:12px; text-decoration:none;
         font-weight:600; color:var(--text); }
.nav a:hover { background:var(--bg); }
.nav a.on { background:var(--grad-blue); color:#fff; box-shadow:var(--glow-blue); }
.nav a .ico { width:20px; text-align:center; }
.nav a .badge { margin-left:auto; background:var(--grad-gold); color:var(--gold-ink); border-radius:999px; font-size:12px; padding:1px 8px; font-weight:700; }
.side .me { margin-top:auto; padding:12px; border-top:1px solid var(--line); font-size:13px; }
.side .me b { display:block; color:var(--ink); }
.main { padding:28px 32px 120px; min-width:0; max-width:1320px; }
.head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
.head p { margin:6px 0 0; color:var(--muted); }
.bottom { display:none; }
.mbrand { display:none; }

/* ── карточки и сетки ── */
.card { background:var(--paper); border:1px solid var(--line); border-radius:var(--r); padding:20px; box-shadow:var(--shadow); min-width:0; }
.card.soft { background:var(--soft); }
.card > h2, .card > .card-h { margin-bottom:14px; }
.card-h { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.grid { display:grid; gap:18px; }
.grid > * { min-width:0; }   /* иначе лента из 8–10 миниатюр распирает колонку */
.g2 { grid-template-columns:1fr 1fr; } .g3 { grid-template-columns:repeat(3,1fr); }
.g-main { grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); }
.stack { display:flex; flex-direction:column; gap:12px; }
.row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.row.between { justify-content:space-between; }
.sep { height:1px; background:var(--line); margin:14px 0; }

/* ── счётчики ── */
.stats { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:18px; }
.stat { background:var(--paper); border:1px solid var(--line); border-radius:18px; padding:14px 16px; box-shadow:var(--shadow); text-decoration:none; }
.stat b { display:block; font-size:30px; font-weight:700; letter-spacing:-.035em; color:var(--ink); line-height:1.1; }
.stat span { display:block; font-size:13px; color:var(--muted); font-weight:600; margin-top:2px; }
.stat.hot b { background:var(--grad-gold); color:var(--gold-ink); border-radius:10px; padding:0 8px; display:inline-block; }

/* ── кнопки ── */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:0; background:var(--grad-blue); color:#fff;
       border-radius:999px; padding:10px 19px; font-weight:600; font-size:14px; cursor:pointer; text-decoration:none; white-space:nowrap;
       box-shadow:var(--glow-blue); transition:filter .15s, transform .15s; }
.btn:hover { filter:brightness(1.08); }
.btn:active { transform:translateY(1px); }
.btn.lime { background:var(--grad-gold); color:var(--gold-ink); box-shadow:var(--glow-gold); }
.btn.ghost { background:#fff; color:var(--blue-deep); box-shadow:inset 0 0 0 1.5px var(--blue-line); }
.btn.ghost:hover { background:var(--blue-soft); filter:none; }
.btn.danger { background:#fff; color:var(--red); box-shadow:inset 0 0 0 1.5px #F3C9C4; }
.btn.danger:hover { background:var(--red-bg); filter:none; }
.btn.sm { padding:6px 13px; font-size:13px; }
.btn.lg { padding:13px 26px; font-size:16px; }
.btn:disabled { opacity:.45; cursor:not-allowed; filter:none; transform:none; }
.linkbtn { background:none; border:0; padding:0; color:var(--blue); font-weight:600; cursor:pointer; text-decoration:underline; text-decoration-color:var(--gold-2); text-decoration-thickness:3px; text-underline-offset:3px; }

/* ── формы ── */
label.f { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; color:var(--muted); }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=time], input[type=datetime-local], input[type=number], select, textarea {
  width:100%; border:1.5px solid var(--line); background:#fff; border-radius:12px; padding:10px 12px; color:var(--text); font-weight:500; }
textarea { resize:vertical; min-height:90px; line-height:1.45; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--blue-2); box-shadow:0 0 0 3px rgba(41,134,227,.22); }
.count { font-size:12px; color:var(--muted); text-align:right; }
.count.over { color:var(--red); font-weight:700; }
.seg { display:inline-flex; background:var(--bg); border-radius:999px; padding:4px; gap:2px; border:1px solid var(--line); }
.seg button { border:0; background:none; border-radius:999px; padding:7px 14px; font-weight:600; font-size:13px; cursor:pointer; color:var(--muted); }
.seg button.on { background:var(--grad-blue); color:#fff; box-shadow:var(--glow-blue); }
.chip { display:inline-flex; align-items:center; gap:6px; border:1.5px solid var(--line); border-radius:999px; padding:5px 12px; font-size:13px; font-weight:600; cursor:pointer; background:#fff; user-select:none; }
.chip.on { background:var(--gold-soft); border-color:var(--gold-line); color:var(--gold-ink); }
.chip input { display:none; }
.switch { display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-weight:600; }
.switch input { appearance:none; width:42px; height:24px; border-radius:999px; background:var(--line); position:relative; cursor:pointer; transition:.15s; flex:none; }
.switch input::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.2); transition:.15s; }
.switch input:checked { background:var(--grad-blue); }
.switch input:checked::after { left:21px; background:var(--gold-2); }

/* ── статусы ── */
.pill { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:3px 10px; font-size:12px; font-weight:600; white-space:nowrap; background:var(--bg); color:var(--muted); }
.pill.wait { background:var(--amber-bg); color:var(--amber); }
.pill.ok { background:var(--grad-gold); color:var(--gold-ink); }
.pill.no { background:var(--red-bg); color:var(--red); }
.pill.redo { background:var(--blue-soft); color:var(--blue); }
.pill.run { background:var(--green-bg); color:var(--green); }
.pill.done { background:var(--blue-deep); color:#fff; }
.pill.fail { background:var(--red-bg); color:var(--red); }
.pill.plat { background:#fff; border:1.5px solid var(--line); color:var(--text); }
.dot { width:8px; height:8px; border-radius:50%; background:currentColor; display:inline-block; }
.pulse { animation:pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity:.35; } }

/* ── генератор ── */
.gen textarea { min-height:110px; font-size:16px; }
.gen .note { font-size:13px; color:var(--muted); }

/* ── конвейер ── */
.pipe { display:grid; grid-template-columns:repeat(auto-fit,minmax(118px,1fr)); gap:10px; }
.stage { border-radius:16px; padding:12px; background:var(--bg); border:1.5px solid var(--line); min-height:96px; }
.stage .n { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; font-size:12.5px; font-weight:700; background:#fff; border:1.5px solid var(--line); margin-bottom:8px; }
.stage b { display:block; font-size:13.5px; color:var(--ink); font-weight:650; }
.stage span { font-size:12px; color:var(--muted); }
.stage.готово { background:var(--gold-soft); border-color:var(--gold-line); } .stage.готово .n { background:var(--grad-gold); border-color:var(--gold-2); color:var(--gold-ink); }
.stage.идёт { background:var(--blue-soft); border-color:var(--blue-line); } .stage.идёт .n { background:var(--blue); color:#fff; border-color:var(--blue); animation:pulse 1.4s infinite; }
.stage.ошибка { background:var(--red-bg); border-color:#F3C9C4; } .stage.ошибка .n { background:var(--red); color:#fff; border-color:var(--red); }

/* ── задачи ── */
.job { display:flex; gap:12px; align-items:flex-start; padding:12px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.job:last-child { border-bottom:0; }
.job .ic { width:34px; height:34px; border-radius:10px; background:var(--bg); display:grid; place-items:center; flex:none; font-size:16px; }
.job.running .ic { background:var(--gold-soft); box-shadow:inset 0 0 0 1.5px var(--gold-line); }
.job b { color:var(--ink); font-weight:650; }
.job .st { font-size:13px; color:var(--muted); }
.steps { list-style:none; margin:0; padding:0; }
.steps li { padding:6px 0 6px 22px; position:relative; font-size:13.5px; border-left:2px solid var(--line); margin-left:6px; }
.steps li::before { content:""; position:absolute; left:-6px; top:11px; width:10px; height:10px; border-radius:50%; background:var(--gold-2); }
.steps li:last-child::before { background:var(--blue); }
.log { background:#0B1A30; color:#CFE3FF; border-radius:12px; padding:12px; max-height:260px; overflow:auto; white-space:pre-wrap; font-size:12px; }

/* ── лента ── */
.feed { list-style:none; padding:0; margin:0; }
.feed li { display:flex; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); font-size:13.5px; }
.feed li:last-child { border-bottom:0; }
.feed .t { color:var(--muted); font-size:12px; white-space:nowrap; margin-left:auto; padding-left:8px; }
.health { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.hl { display:flex; gap:8px; align-items:flex-start; padding:10px; border-radius:12px; background:var(--bg); font-size:13px; }
.hl b { display:block; color:var(--ink); font-size:13.5px; font-weight:650; }
.hl .dot { margin-top:6px; flex:none; }
.hl.ok .dot { color:var(--green); } .hl.bad .dot { color:var(--red); } .hl.na .dot { color:#B5BCC8; }

/* ── черновики ── */
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.tabs button { border:1.5px solid var(--line); background:#fff; border-radius:999px; padding:7px 14px; font-weight:600; font-size:13.5px; cursor:pointer; }
.tabs button.on { background:var(--grad-blue); color:#fff; border-color:transparent; box-shadow:var(--glow-blue); }
.tabs button i { font-style:normal; opacity:.65; margin-left:4px; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px; }
.dcard { background:var(--paper); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; box-shadow:var(--shadow); text-decoration:none; display:flex; flex-direction:column; transition:.15s; }
.dcard:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.dcard .cover { aspect-ratio:4/5; background:var(--soft); display:flex; align-items:flex-end; padding:16px; position:relative; }
.dcard .cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.dcard .cover .ph { font-weight:700; font-size:17px; color:var(--ink); line-height:1.25; letter-spacing:-.01em; }
.dcard .cover .pill { position:absolute; top:10px; left:10px; }
.dcard .meta { padding:12px 14px 14px; display:flex; flex-direction:column; gap:6px; }
.dcard .meta b { font-size:14px; color:var(--ink); line-height:1.3; font-weight:650; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.empty { text-align:center; padding:48px 20px; color:var(--muted); background:var(--paper); border:1.5px dashed var(--line); border-radius:var(--r); }
.empty b { display:block; font-size:17px; color:var(--ink); margin-bottom:4px; }

.viewer { position:relative; background:var(--soft); border-radius:var(--r); overflow:hidden; aspect-ratio:4/5; display:grid; place-items:center; }
.viewer img { width:100%; height:100%; object-fit:contain; background:#fff; }
.viewer .nav-arrow { position:absolute; top:50%; transform:translateY(-50%); width:42px; height:42px; border-radius:50%; border:0; background:rgba(255,255,255,.94); box-shadow:var(--shadow); font-size:20px; font-weight:700; cursor:pointer; color:var(--blue-deep); }
.viewer .prev { left:10px; } .viewer .next { right:10px; }
.viewer .ctr { position:absolute; top:10px; right:10px; background:rgba(255,255,255,.92); border-radius:999px; padding:3px 10px; font-size:12px; font-weight:700; }
.thumbs { display:flex; gap:8px; margin-top:10px; overflow-x:auto; padding-bottom:4px; }
.thumbs img { width:62px; aspect-ratio:4/5; object-fit:cover; border-radius:8px; border:2px solid transparent; cursor:pointer; flex:none; background:#fff; }
.thumbs img.on { border-color:var(--blue-2); }
.ptext { white-space:pre-wrap; background:var(--bg); border-radius:12px; padding:14px; font-size:14.5px; max-height:380px; overflow:auto; }
.receipts { list-style:none; margin:0; padding:0; }
.receipts li { padding:9px 0; border-bottom:1px solid var(--line); font-size:13.5px; }
.receipts li:last-child { border-bottom:0; }
.receipts code { display:inline-block; margin-top:3px; background:var(--blue-soft); color:var(--blue-deep); border-radius:6px; padding:1px 6px; font-size:12px; font-family:inherit; }
.receipts li.bad code { background:var(--amber-bg); color:var(--amber); }
.actions { position:sticky; bottom:16px; z-index:5; display:flex; gap:10px; flex-wrap:wrap; background:rgba(255,255,255,.94); backdrop-filter:blur(10px);
           border:1px solid var(--line); border-radius:999px; padding:10px; box-shadow:var(--shadow-lg); margin-top:18px; width:max-content; max-width:100%; }
.noslides.drawing { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; aspect-ratio:4/5; text-align:center; }

/* ── редактор ── */
.slide-ed { border:1.5px solid var(--line); border-radius:16px; padding:14px; background:#fff; }
.slide-ed .hd { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:10px; }
.slide-ed .hd .num { width:28px; height:28px; border-radius:50%; background:var(--grad-gold); color:var(--gold-ink); display:grid; place-items:center; font-weight:700; font-size:13px; flex:none; }
.slide-ed .hd select { width:auto; min-width:0; max-width:100%; padding:6px 10px; }
.slide-ed .hd .sp { flex:1; }
.slide-ed .arabic textarea { direction:rtl; font-size:20px; font-family:"Amiri","Geeza Pro","Noto Naskh Arabic",serif; }
.iconbtn { border:1.5px solid var(--line); background:#fff; width:32px; height:32px; border-radius:10px; cursor:pointer; font-weight:700; color:var(--blue-deep); }
.iconbtn:hover { background:var(--blue-soft); }
.iconbtn:disabled { opacity:.35; cursor:not-allowed; background:#fff; }
.objbox { background:var(--bg); border-radius:12px; padding:12px; margin-top:10px; }
.warn { background:var(--amber-bg); color:var(--amber); border-radius:12px; padding:10px 14px; font-size:13.5px; font-weight:600; }
.err { background:var(--red-bg); color:var(--red); border-radius:12px; padding:10px 14px; font-size:13.5px; font-weight:600; }
.okbox { background:var(--green-bg); color:var(--green); border-radius:12px; padding:10px 14px; font-size:13.5px; font-weight:600; }
.prev-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.prev-grid img { width:100%; border-radius:8px; border:1px solid var(--line); background:#fff; }
.sticky { position:sticky; top:20px; }

/* ── календарь ── */
.week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:10px; }
.day { background:var(--paper); border:1.5px solid var(--line); border-radius:18px; min-height:220px; padding:10px; display:flex; flex-direction:column; gap:8px; }
.day.today { border-color:var(--blue-2); box-shadow:0 0 0 3px rgba(41,134,227,.12); }
.day.drop { background:var(--gold-soft); border-color:var(--gold-2); border-style:dashed; }
.day .dh { display:flex; justify-content:space-between; align-items:baseline; font-weight:700; font-size:13px; }
.day .dh span { color:var(--muted); font-weight:600; }
.ev { border-radius:12px; padding:8px; background:var(--bg); cursor:pointer; font-size:12.5px; border-left:4px solid var(--line); }
.ev.запланировано { border-left-color:var(--blue-2); } .ev.публикуется { border-left-color:var(--green); }
.ev.опубликовано { border-left-color:var(--gold-2); background:var(--gold-soft); } .ev.ошибка { border-left-color:var(--red); background:var(--red-bg); }
.ev { overflow:hidden; overflow-wrap:anywhere; }
.ev b { display:block; color:var(--ink); font-size:12.5px; line-height:1.25; font-weight:650; }
.ev .t { font-weight:700; }
.tray { display:flex; gap:10px; overflow-x:auto; padding-bottom:6px; }
.tcard { flex:none; width:170px; background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:8px; cursor:grab; }
.tcard img, .tcard .ph { width:100%; aspect-ratio:4/5; object-fit:cover; border-radius:10px; background:var(--soft); display:block; }
.tcard .ph { padding:10px; font-weight:700; font-size:12px; }
.tcard b { display:block; font-size:12.5px; margin:6px 2px 4px; line-height:1.25; color:var(--ink); font-weight:650; }

/* ── таблицы и текст ── */
.tbl { width:100%; border-collapse:collapse; font-size:13.5px; }
.tbl th { text-align:left; font-size:12px; color:var(--muted); font-weight:600; padding:8px 10px; border-bottom:1.5px solid var(--line); white-space:nowrap; }
.tbl td { padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
.tbl tr:hover td { background:var(--bg); }
.tbl a { color:var(--blue-deep); overflow-wrap:anywhere; }
.tbl td:last-child { min-width:240px; }
.scroll { overflow-x:auto; }
.md h1 { font-size:22px; margin:6px 0 10px; } .md h2 { font-size:17px; margin:18px 0 8px; } .md h3 { font-size:15px; margin:14px 0 6px; }
.md p { margin:6px 0; } .md ul { margin:6px 0; padding-left:20px; } .md blockquote { margin:8px 0; padding:8px 14px; background:var(--bg); border-left:4px solid var(--gold-2); border-radius:8px; color:var(--muted); }
.md pre { background:var(--bg); padding:10px; border-radius:10px; white-space:pre-wrap; font-size:12.5px; }
.md table { border-collapse:collapse; width:100%; font-size:13px; margin:8px 0; } .md td, .md th { border-bottom:1px solid var(--line); padding:6px 8px; text-align:left; vertical-align:top; }
.kf { padding:12px 0; border-bottom:1px solid var(--line); }
.kf:last-child { border-bottom:0; }
.kf b { display:block; font-size:13px; color:var(--muted); font-weight:600; margin-bottom:4px; }
.kf .v { white-space:pre-wrap; }
.kf ul { margin:0; padding-left:18px; }

/* ── окна, тосты, вход ── */
.modal-bg { position:fixed; inset:0; background:rgba(8,24,48,.42); display:grid; place-items:center; z-index:50; padding:16px; }
.modal { background:#fff; border-radius:22px; padding:22px; width:min(560px,100%); max-height:90vh; overflow:auto; box-shadow:var(--shadow-lg); }
.modal.wide { width:min(860px,100%); }
.modal .mh { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; gap:10px; }
#toasts { position:fixed; top:16px; right:16px; z-index:60; display:flex; flex-direction:column; gap:8px; }
.toast { background:var(--blue-deep); color:#fff; border-radius:14px; padding:12px 16px; font-weight:600; box-shadow:var(--shadow-lg); max-width:360px; font-size:14px; }
.toast.ok { background:var(--grad-gold); color:var(--gold-ink); } .toast.bad { background:var(--red); }
.login { min-height:100vh; display:grid; place-items:center; background:var(--soft); padding:20px; }
.login .card { width:min(400px,100%); padding:30px; }
.steps-help { margin:8px 0 0; padding-left:20px; font-size:13.5px; }
.steps-help li { margin:4px 0; }
.copyrow { display:flex; gap:8px; } .copyrow input { font-family:ui-monospace,Menlo,monospace; font-size:12.5px; }
.bchips { display:flex; gap:6px; flex-wrap:wrap; }

/* ── телефон ── */
@media (max-width: 980px) {
  .g2, .g3, .g-main { grid-template-columns:1fr; }
  .stats { grid-template-columns:repeat(3,1fr); }
  .week { grid-template-columns:1fr; }
  .day { min-height:auto; }
}
@media (max-width: 760px) {
  .app { grid-template-columns:1fr; }
  .side { display:none; }
  .main { padding:14px 14px 110px; }
  .mbrand { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
  .mbrand img { height:20px; }
  .mbrand select { width:auto; max-width:60%; padding:7px 10px; border-radius:10px; font-size:13px; }
  h1 { font-size:23px; }
  .stats { grid-template-columns:repeat(2,1fr); }
  .health { grid-template-columns:1fr; }
  .bottom { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:40; background:rgba(255,255,255,.96); backdrop-filter:blur(10px);
            border-top:1px solid var(--line); padding:6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content:space-around; }
  .bottom a { display:flex; flex-direction:column; align-items:center; gap:2px; font-size:11px; font-weight:600; text-decoration:none; color:var(--muted); padding:4px 8px; border-radius:10px; position:relative; }
  .bottom a .ico { font-size:19px; }
  .bottom a.on { color:var(--blue); background:var(--blue-soft); }
  .bottom a .badge { position:absolute; top:0; right:4px; background:var(--grad-gold); color:var(--gold-ink); border-radius:999px; font-size:10px; padding:0 5px; }
  .actions { border-radius:18px; width:100%; bottom:76px; }
  .actions .btn { flex:1; }
  .prev-grid { grid-template-columns:repeat(2,1fr); }
}

.noslides { background:var(--soft); border-radius:var(--r); padding:22px; color:var(--muted); font-weight:600; }
