/* Спокойный светлый фон без клеток; синяя ручка — действия, красная — только «сейчас» и ошибки. */
:root {
  --paper: #f3f5f9;
  --glow: #e4ebfb;
  --ink: #1f2a44;
  --ink-2: #5d6782;
  --ink-3: #98a0b5;
  --pen: #2850d8;           /* синяя ручка — главный акцент */
  --pen-soft: #e9eefc;
  --red: #e0383e;           /* красная ручка — «сейчас», ошибки */
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --line: #e3e7ef;
  --shadow: 0 1px 2px rgba(31, 42, 68, .06), 0 8px 24px rgba(31, 42, 68, .08);
  --sheet-shadow: 0 -12px 40px rgba(31, 42, 68, .18);
  --cell: 22px;
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 22px;
  /* Telegram задаёт эти переменные сам; в полноэкранном режиме сверху его кнопки «Закрыть» и «⋯» */
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121419; --glow: #1a2138; --ink: #e8ebf2; --ink-2: #a3abbf; --ink-3: #6b7387;
    --pen: #7f9cff; --pen-soft: #1e2640; --red: #ff5a5f; --surface: #1b1f27; --surface-2: #222733;
    --line: #2a303c; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --sheet-shadow: 0 -12px 40px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121419; --glow: #1a2138; --ink: #e8ebf2; --ink-2: #a3abbf; --ink-3: #6b7387;
  --pen: #7f9cff; --pen-soft: #1e2640; --red: #ff5a5f; --surface: #1b1f27; --surface-2: #222733;
  --line: #2a303c; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --sheet-shadow: 0 -12px 40px rgba(0,0,0,.5); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font: 100%/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(120% 60% at 50% -10%, var(--glow) 0%, transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; border-radius: 6px; }

#app { padding: calc(12px + var(--safe-t)) 16px calc(96px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.sheet { max-height: calc(100vh - var(--safe-t) - 24px) !important; }
.toast { top: calc(12px + var(--safe-t)) !important; }

/* ---------- type ---------- */
.h1 { font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; font-weight: 750; margin: 8px 0 4px; }
.h2 { font-size: 1.125rem; line-height: 1.25; letter-spacing: -.01em; font-weight: 650; margin: 0; }
.sub { color: var(--ink-2); font-size: .9375rem; margin: 0; }
.small { font-size: .8125rem; color: var(--ink-2); letter-spacing: .005em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: var(--r-m);
  background: var(--pen); color: #fff; font-weight: 600; width: 100%;
  transition: transform 100ms ease-out, opacity 100ms;
}
.btn:active, .press:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.ghost { background: var(--pen-soft); color: var(--pen); }
.btn.danger { background: transparent; color: var(--red); }
.btn.small { min-height: 38px; width: auto; padding: 0 14px; font-size: .9375rem; border-radius: 11px; }
.press { transition: transform 100ms ease-out; }

/* ---------- onboarding ---------- */
.hello { padding-top: 6vh; }
.hello .mark {
  width: 56px; height: 56px; border-radius: 16px; background: var(--pen); color: #fff;
  display: grid; place-items: center; font-size: 28px; margin-bottom: 18px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--pen) 35%, transparent);
}
.roles { display: grid; gap: 12px; margin: 24px 0; }
.role {
  display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; text-align: left;
  padding: 16px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow);
  border: 2px solid transparent;
}
.role .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--pen-soft); display: grid; place-items: center; font-size: 24px; }
.role b { display: block; font-size: 1.0625rem; font-weight: 650; }
.role span { color: var(--ink-2); font-size: .875rem; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: .875rem; color: var(--ink-2); margin: 0 0 6px 4px; }
.input {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--r-m);
  border: 1.5px solid var(--line); background: var(--surface); outline: none;
  font-size: 1.0625rem; transition: border-color 120ms;
}
.input:focus { border-color: var(--pen); }
textarea.input { padding: 12px 14px; min-height: 76px; resize: none; }
.err { color: var(--red); font-size: .875rem; min-height: 1.2em; margin: 4px 4px 10px; }

.grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface);
  border: 1.5px solid var(--line); font-weight: 550; white-space: nowrap;
  transition: transform 100ms ease-out, background 120ms, border-color 120ms, color 120ms;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--pen); border-color: var(--pen); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 3px; border-radius: 12px; gap: 3px; }
.seg button { min-height: 38px; border-radius: 9px; font-size: .875rem; font-weight: 550; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- header / week strip ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.week {
  display: grid; grid-auto-flow: column; grid-auto-columns: 50px; gap: 6px;
  overflow-x: auto; margin: 0 -16px 18px; padding: 4px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.week::-webkit-scrollbar { display: none; }
.day {
  scroll-snap-align: start; display: grid; justify-items: center; gap: 2px;
  padding: 8px 0 9px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(31,42,68,.06);
  transition: transform 100ms ease-out, background 140ms;
}
.day:active { transform: scale(.94); }
.day .dw { font-size: .6875rem; color: var(--ink-3); letter-spacing: .02em; }
.day .dn { font-size: 1.125rem; font-weight: 650; letter-spacing: -.01em; }
.day .dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.day.has .dot { background: var(--pen); }
.day.today .dn { color: var(--red); }
.day[aria-pressed="true"] { background: var(--pen); }
.day[aria-pressed="true"] .dw, .day[aria-pressed="true"] .dn { color: #fff; }
.day[aria-pressed="true"].has .dot { background: #fff; }

/* ---------- неделя: 7 дней целиком, листается стрелками и свайпом ---------- */
.weeknav { display: flex; align-items: center; justify-content: space-between; margin: 0 -6px 6px; }
.wlabel { font-weight: 650; font-size: .9375rem; letter-spacing: -.005em; }
.navbtn { width: 40px; height: 36px; border-radius: 10px; font-size: 1.5rem; line-height: 1; color: var(--pen); display: grid; place-items: center; transition: transform 100ms ease-out, background 120ms; }
.navbtn:active { transform: scale(.9); background: var(--pen-soft); }
.week7wrap { overflow: hidden; margin: 0 -4px 18px; padding: 2px 4px 6px; user-select: none; -webkit-user-select: none; }
.week7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; will-change: transform; }
.week7 .day { min-width: 0; }
.day.pastday:not([aria-pressed="true"]) .dn { color: var(--ink-3); }

/* ---------- день: свайп влево/вправо ---------- */
.daywrap { overflow: hidden; margin: 0 -16px; padding: 0 16px; min-height: 45vh; }
.daypane { will-change: transform; }
.swipehint { text-align: center; margin: 22px 0 0; opacity: .7; }

/* «На сегодня занятий нет» — крупно и тихо, как надпись на фоне */
.bgnote { text-align: center; padding: 11vh 20px 8vh; }
.bgnote-t { font-size: 1.625rem; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; color: var(--ink-3); opacity: .75; }
.bgnote .small { max-width: 30ch; margin: 14px auto 0; }

/* ---------- timeline ---------- */
.timeline { position: relative; display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: start; }
.slot .time { padding-top: 12px; text-align: right; }
.slot .time b { display: block; font-size: 1.1875rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.slot .time span { font-size: .75rem; color: var(--ink-3); }
.slot.past { opacity: .5; }
.card {
  position: relative; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow);
  padding: 12px 14px 12px 18px; overflow: hidden; text-align: left; width: 100%;
  transition: transform 100ms ease-out;
}
.card:active { transform: scale(.985); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--hue, var(--pen)); }
.card .subj { font-weight: 650; font-size: 1rem; letter-spacing: -.005em; }
.card .meta { font-size: .8125rem; color: var(--ink-2); margin-top: 1px; }
.card .who { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .8125rem; padding: 3px 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink); }
.tag.track { background: color-mix(in srgb, var(--hue, var(--pen)) 14%, transparent); color: var(--hue, var(--pen)); font-weight: 600; }
.card .note { margin-top: 8px; font-size: .875rem; color: var(--ink-2); }
.card.live { outline: 2px solid var(--red); outline-offset: -2px; }
.card.cancelled .subj { text-decoration: line-through; text-decoration-color: var(--red); }
.card.cancelled::before { background: var(--ink-3); }
.time.struck b { text-decoration: line-through; text-decoration-color: var(--red); }
.tag.warn { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); font-weight: 600; }
.tag.moved { background: var(--pen-soft); color: var(--pen); font-weight: 600; }

.now { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: center; margin: -2px 0; }
.now b { color: var(--red); font-size: .8125rem; font-weight: 700; text-align: right; }
.now i { height: 2px; background: var(--red); border-radius: 2px; position: relative; }
.now i::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

.empty { text-align: center; padding: 40px 24px; color: var(--ink-2); }
.empty .big { font-size: 40px; margin-bottom: 6px; }
.empty p { margin: 6px 0 18px; }

/* ---------- lists ---------- */
.list { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left;
  min-height: 56px; transition: background 120ms;
}
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: .8125rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-weight: 650; font-size: .875rem; color: #fff; background: var(--hue, var(--pen));
}
.ava.round { border-radius: 50%; background: var(--surface-2); color: var(--ink-2); }
.chev { color: var(--ink-3); font-size: 1.25rem; }
.x { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); font-size: 1.25rem; }
.x:active { background: var(--surface-2); }
.add { color: var(--pen); font-weight: 650; font-size: 1.5rem; width: 34px; height: 34px; border-radius: 10px; background: var(--pen-soft); display: grid; place-items: center; }
.add.on { background: var(--pen); color: #fff; }
.add.wide { width: auto; padding: 0 12px; font-size: .875rem; }
.row[disabled] { opacity: .65; }
details.more { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
details.more > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: .9375rem; list-style: none; padding: 6px 4px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "›"; display: inline-block; margin-right: 8px; transition: transform 160ms; }
details.more[open] > summary::before { transform: rotate(90deg); }

.section-t { font-size: .8125rem; color: var(--ink-2); font-weight: 600; margin: 22px 4px 8px; }
.stack > * + * { margin-top: 12px; }

/* ---------- floating action ---------- */
.fab {
  /* на широком экране (браузер на компьютере) кнопка — у края колонки приложения, а не у края монитора */
  position: fixed; right: max(16px, calc((100vw - 560px) / 2 + 16px)); bottom: calc(76px + var(--safe-b)); z-index: 20;
  height: 52px; padding: 0 20px 0 16px; border-radius: 26px; background: var(--pen); color: #fff;
  font-weight: 650; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--pen) 40%, transparent);
  transition: transform 100ms ease-out;
}
.fab:active { transform: scale(.95); }
.fab span { font-size: 1.5rem; line-height: 1; }

/* ---------- tab bar: translucent layer, content scrolls underneath ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px max(8px, calc((100vw - 576px) / 2)) calc(6px + var(--safe-b));   /* вкладки — по ширине колонки */
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.tabs[hidden] { display: none; }   /* иначе display:grid выше перебивает hidden — панель оставалась после выхода */
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 0; color: var(--ink-3); font-size: .6875rem; font-weight: 600; letter-spacing: .01em; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--pen); }
.tab:active svg { transform: scale(.9); }

/* ---------- bottom sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 14, 24, .38); z-index: 40; opacity: 0; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh;
  background: var(--paper); border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--sheet-shadow);
  display: flex; flex-direction: column; transform: translateY(100%); will-change: transform;
  max-width: 640px; margin: 0 auto;
}
.sheet .grab { padding: 8px 16px 4px; touch-action: none; cursor: grab; flex: none; }
.sheet .grab::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet .body { overflow-y: auto; padding: 8px 16px calc(20px + var(--safe-b)); overscroll-behavior: contain; }
.sheet .foot { padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; background: var(--paper); }

/* ---------- блокировка после конца Pro ---------- */
.lockbar { display: grid; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; margin: 0 0 14px; border-radius: var(--r-m);
  background: color-mix(in srgb, #c76a00 12%, var(--surface)); border: 1.5px solid color-mix(in srgb, #c76a00 35%, transparent); }
.lockbar b { font-weight: 650; }
.lockbar span { font-size: .875rem; color: var(--ink-2); }
.lockedRow .t, .lockedCard .subj { color: var(--ink-3); }
.lockedCard { opacity: .7; }

/* ---------- согласие, оплаты, домашка ---------- */
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 2px 12px; font-size: .875rem; color: var(--ink-2); line-height: 1.4; }
.consent input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--pen); }
.consent a { color: var(--pen); }
.s.bad, .badge.bad, .balance.bad b { color: var(--red); }
.s.warnc, .badge.warnc { color: #c76a00; }
.badge { min-width: 34px; text-align: center; font-size: 1.0625rem; }
.num.big { font-size: 1.125rem; }
.balance { display: flex; align-items: baseline; gap: 10px; margin: 2px 4px 0; }
.balance b { font-size: 2.5rem; line-height: 1; letter-spacing: -.03em; font-weight: 750; }
.balance span { color: var(--ink-2); }
.hw-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.linkbtn { color: var(--pen); font-weight: 600; font-size: .875rem; padding: 6px 0 0; text-align: left; }
.slots { display: grid; gap: 8px; }
.winday { padding: 10px 14px; }
.winday b { display: block; margin-bottom: 4px; }
.check { width: 28px; height: 28px; flex: none; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center;
  color: #fff; font-weight: 800; transition: transform 100ms ease-out, background 120ms, border-color 120ms; }
.check:active { transform: scale(.9); }
.check.on { background: var(--pen); border-color: var(--pen); }
.doneRow .hw-t { text-decoration: line-through; color: var(--ink-3); }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--r-m); border: 1.5px solid var(--line); width: 100%; text-align: left; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background 160ms; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 220ms cubic-bezier(.3,1.3,.5,1); }
[aria-checked="true"] .switch { background: var(--pen); }
[aria-checked="true"] .switch::after { transform: translateX(20px); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toast {
  position: fixed; left: 50%; top: 12px; z-index: 60; transform: translate(-50%, -140%);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: .9375rem; font-weight: 550;
  transition: transform 260ms cubic-bezier(.2,.9,.3,1.15); max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}
/* спрятанное уведомление уезжает за край целиком и становится невидимым — с любым отступом сверху */
.toast:not(.on) { transform: translate(-50%, calc(-100% - 40px - var(--safe-t))); opacity: 0; visibility: hidden;
  transition: transform 260ms ease-in, opacity 200ms, visibility 0s 260ms; }
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.bad { background: var(--red); color: #fff; }

.devbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .75rem; color: var(--ink-3); margin-bottom: 8px; }
.devbar button { padding: 3px 8px; border-radius: 6px; background: var(--surface-2); }
.devbar button[aria-pressed="true"] { background: var(--pen); color: #fff; }

.skeleton { height: 72px; border-radius: var(--r-m); background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
  .btn:active, .press:active, .card:active, .chip:active, .day:active, .fab:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabs { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 14px; border-radius: var(--r-m);
  background: var(--pen-soft); color: var(--ink); font-size: .9375rem; line-height: 1.4; }
.tip-i { font-size: 1.1rem; line-height: 1.3; }
.tip-ok { margin-top: 6px; color: var(--pen); font-weight: 650; font-size: .875rem; }
.guide-q { width: 100%; text-align: left; }
.guide-q .chev { color: var(--ink-3); font-size: 1.3rem; transition: transform 160ms; }
.guide-q[aria-expanded="true"] .chev { transform: rotate(90deg); }
.guide-a { padding: 0 16px 14px; color: var(--ink-2); font-size: .9375rem; white-space: pre-wrap; }
.invite-box { display: grid; gap: 10px; padding: 14px; margin: 0 0 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow); border: 1.5px solid var(--pen); }
.invite { padding-top: 10px; border-top: 1px solid var(--line); }
.invite .t { font-weight: 650; }
.invite .s { color: var(--ink-2); font-size: .875rem; }
.psecs { display: grid; gap: 10px; margin-top: 16px; }
.psec { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); }
.psec > summary { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; list-style: none; min-height: 56px; }
.psec > summary::-webkit-details-marker { display: none; }
.psec > summary b { display: block; font-weight: 650; }
.psec > summary .s { display: block; color: var(--ink-2); font-size: .8125rem; margin-top: 1px; }
.psec-i { width: 36px; height: 36px; border-radius: 10px; background: var(--pen-soft); display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.psec .chev { color: var(--ink-3); font-size: 1.3rem; transition: transform 160ms; }
.psec[open] .chev { transform: rotate(90deg); }
.psec-b { padding: 0 14px 16px; }
.psec-b > :first-child { margin-top: 0; }
.psec-b .section-t:first-child { margin-top: 0; }
/* кабинет администратора */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.tile-l { color: var(--ink-2); font-size: .8125rem; }
.tile-v { font-size: 1.375rem; font-weight: 750; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tile-s { color: var(--ink-3); font-size: .75rem; }
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.qbtn { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--r-m); background: var(--pen-soft); color: var(--pen); font-weight: 650; text-align: left; min-height: 56px; }
.qbtn span { font-size: 1.2rem; }
.qbtn:active { transform: scale(.98); }
.att-box { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-m); background: color-mix(in srgb, #c76a00 10%, var(--surface)); border: 1.5px solid color-mix(in srgb, #c76a00 35%, transparent); }
.att { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid color-mix(in srgb, #c76a00 20%, transparent); }
.att:first-of-type { border-top: 0; padding-top: 0; }
.att .s { color: var(--ink-2); font-size: .8125rem; margin-top: 2px; }
.att-ok { padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); font-size: .9375rem; }
/* в разделах кабинета заголовок раздела уже в шапке — первый внутренний заголовок не дублируем */
.admin-sec .psec-b > div:first-child > .section-t:first-child { display: none; }
/* выбор предмета по разделам */
.subj-list { display: grid; gap: 10px; margin-top: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.subj-h { font-size: .75rem; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 0 2px 6px; }
/* бледная подсказка внутри поля, сразу после введённого текста */
.tgh-wrap { position: relative; }
.tgh { position: absolute; inset: 0; padding: 0 15.5px; display: flex; align-items: center; white-space: pre;
  overflow: hidden; pointer-events: none; font-size: 1.0625rem; }
.tgh-mirror { color: transparent; }
.tgh-hint { color: var(--ink-3); opacity: .75; }

/* ---------- старые iOS (до 16.2) и Android-браузеры без color-mix(): запасные цвета ----------
   Без этого блока там пропали бы фон панели вкладок (содержимое просвечивало бы под ней), плашки и рамки. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .tabs { background: var(--paper); border-top: 1px solid var(--line); }
  .hello .mark { box-shadow: 0 6px 20px rgba(40, 80, 216, .3); }
  .fab { box-shadow: 0 8px 24px rgba(40, 80, 216, .35); }
  .tag.track { background: var(--surface-2); }
  .tag.warn { background: rgba(224, 56, 62, .14); }
  .lockbar, .att-box { background: rgba(199, 106, 0, .10); border: 1.5px solid rgba(199, 106, 0, .35); }
  .att { border-top: 1px solid rgba(199, 106, 0, .2); }
}