/* Веб-версия «СМТ ИМПУЛЬС»: те же цвета и формы, что в Android-приложении (ui/theme/Theme.kt).
   Индиго «импульс» — основной, оранжевый — замены, красный — отмены, зелёный — «идёт сейчас». */
:root {
  color-scheme: light;
  --primary: #4F46E5; --on-primary: #fff; --primary-c: #E0E7FF; --on-primary-c: #1E1B4B;
  --secondary-c: #EDE9FE; --on-secondary-c: #2E1065;
  --tertiary: #C2410C; --tertiary-c: #FFEDD5; --on-tertiary-c: #7C2D12;
  --error: #DC2626; --error-c: #FEE2E2; --on-error-c: #7F1D1D;
  --success: #15803D; --success-c: #DCFCE7; --on-success-c: #14532D;
  --bg: #F7F8FC; --text: #111827; --muted: #4B5263;
  --card: #FFFFFF; --low: #F2F3F9; --mid: #ECEEF6; --high: #E6E8F2; --highest: #E0E3EE;
  --outline: #C3C7D6; --line: #E2E4EE;
  --scrim: rgba(17, 24, 39, .45);
  --r-s: 10px; --r-m: 16px; --r-l: 22px; --r-xl: 28px;
  --tabbar-h: 64px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --primary: #A5B4FC; --on-primary: #1E1B4B; --primary-c: #3730A3; --on-primary-c: #E0E7FF;
    --secondary-c: #4C1D95; --on-secondary-c: #EDE9FE;
    --tertiary: #FDBA74; --tertiary-c: #7C2D12; --on-tertiary-c: #FFEDD5;
    --error: #F87171; --error-c: #7F1D1D; --on-error-c: #FEE2E2;
    --success: #4ADE80; --success-c: #14532D; --on-success-c: #DCFCE7;
    --bg: #0F1117; --text: #E5E7EF; --muted: #A3A9BA;
    --card: #161924; --low: #151823; --mid: #1A1E2A; --high: #222634; --highest: #2A2F3F;
    --outline: #4B5265; --line: #2D3242;
    --scrim: rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--primary); }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* загрузка до запуска скриптов */
.boot { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.boot-logo { width: 96px; height: 96px; border-radius: 27px; }
html.ready .boot { display: none; }

/* ─────────────── каркас ─────────────── */
.app { min-height: 100vh; min-height: 100dvh; }
.app.with-tabs { padding-bottom: calc(var(--tabbar-h) + var(--bottom)); }
.screen { min-height: 100%; }
.content { padding: 12px 16px 28px; display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; }
.content.flush { padding: 0 0 28px; gap: 0; }
.content.centered { align-items: center; text-align: center; }
.pad { padding: 4px 16px; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  padding: calc(10px + var(--top)) 8px 8px 16px; background: var(--bg);
  border-bottom: 1px solid transparent;
}
.topbar .iconbtn:first-child { margin-left: -8px; }
.tb-titles { flex: 1; min-width: 0; }
.tb-titles h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.2px; }
.tb-sub {
  display: block; padding: 0; margin: 1px 0 0; border: 0; background: none; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-sub.muted, div.tb-sub { color: var(--muted); }
button.tb-sub { color: var(--primary); }
.tb-actions { display: flex; gap: 2px; }

.iconbtn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); flex: none;
}
.iconbtn:active { background: var(--high); }
.iconbtn:disabled { opacity: .35; }
.iconbtn.small { width: 32px; height: 32px; }
.ic { display: block; flex: none; }

/* нижняя панель разделов */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--bottom)); padding: 6px 4px var(--bottom);
  background: color-mix(in srgb, var(--low) 92%, transparent); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .tabbar { background: var(--low); } }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  color: var(--muted); font-size: 12px; font-weight: 600; max-width: 120px;
}
.tab-ic { width: 60px; height: 30px; display: grid; place-items: center; border-radius: 15px; transition: background .15s; }
.tab.on { color: var(--text); }
.tab.on .tab-ic { background: var(--primary-c); color: var(--on-primary-c); }
body.kb-open .tabbar { display: none; }
body.kb-open .app.with-tabs { padding-bottom: 0; }

/* ─────────────── мелкие элементы ─────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px;
  border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 600;
  text-decoration: none; font-size: 15px;
}
.btn:active { filter: brightness(.92); }
.btn:disabled { background: var(--highest); color: var(--muted); }
.btn.outline { background: transparent; color: var(--primary); border: 1px solid var(--outline); }
.btn.outline:disabled { color: var(--muted); }
.btn.wide { width: 100%; }
.btn.big { min-height: 52px; font-size: 16px; }
.textbtn {
  border: 0; background: none; color: var(--primary); font-weight: 600; padding: 10px 12px; border-radius: 999px;
  font-size: 15px; text-decoration: none;
}
.textbtn:active { background: var(--high); }
.textbtn.danger { color: var(--error); }
.textbtn.wide { width: 100%; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; font-size: 13px;
  font-weight: 600; line-height: 1.25; white-space: nowrap;
}
.tag.tone-primary { background: var(--primary-c); color: var(--on-primary-c); }
.tag.tone-secondary { background: var(--secondary-c); color: var(--on-secondary-c); }
.tag.tone-tertiary { background: var(--tertiary-c); color: var(--on-tertiary-c); }
.tag.tone-error { background: var(--error-c); color: var(--on-error-c); }
.tag.tone-success { background: var(--success-c); color: var(--on-success-c); }
.tag.tone-neutral { background: var(--high); color: var(--text); }
.tag.tone-success-soft { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.tag.tone-primary-soft { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.tag.tone-tertiary-soft { background: color-mix(in srgb, var(--tertiary) 14%, transparent); color: var(--tertiary); }
.tag.tone-error-soft { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); font-size: 15px;
}
.banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.banner-ic { flex: none; }
.banner .textbtn { color: inherit; flex: none; padding: 8px 10px; }
.banner.tone-primary { background: var(--primary-c); color: var(--on-primary-c); }
.banner.tone-error { background: var(--error-c); color: var(--on-error-c); }
.banner.tone-neutral { background: var(--high); color: var(--text); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-c); color: var(--on-primary-c); }
.empty h2 { font-size: 20px; font-weight: 700; }
.empty p { color: var(--muted); max-width: 420px; }
.empty .btn { margin-top: 8px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 64px 16px; color: var(--muted); }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--high); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; flex: none;
}
.spinner.small { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.footnote { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 12px 0; }
.hint { text-align: center; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.strike { text-decoration: line-through; }
.error-text { color: var(--error); font-size: 14px; }
.section-title {
  padding: 22px 20px 6px; font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--primary);
}
.content:not(.flush) > .section-title { padding: 10px 2px 0; }

/* потянуть вниз — обновить */
.ptr { display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; color: var(--muted); font-size: 13px; }
.ptr-ic { display: grid; place-items: center; color: var(--primary); }
.ptr-ic.spin { animation: spin .8s linear infinite; }

/* ─────────────── расписание ─────────────── */
.weekstrip { position: sticky; top: var(--topbar-h, 70px); z-index: 15; background: var(--bg); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.ws-head { display: flex; align-items: center; padding: 0 4px; }
.ws-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.ws-title b { font-size: 15px; }
.ws-title span { font-size: 13px; color: var(--muted); font-weight: 600; }
.ws-days { display: flex; padding: 0 8px; }
.ws-day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border: 0;
  background: none; min-width: 0;
}
.ws-wd { font-size: 13px; font-weight: 600; color: var(--muted); }
.ws-num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 600;
  border: 1.5px solid transparent;
}
.ws-day.today .ws-num { border-color: var(--primary); }
.ws-day.sel .ws-wd { color: var(--primary); }
.ws-day.sel .ws-num { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.ws-dot { width: 6px; height: 6px; border-radius: 50%; }
.ws-dot.on { background: var(--tertiary); }

.dayhead { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 2px; }
.dayhead h2 { font-size: 24px; font-weight: 700; line-height: 1.2; }

.lesson {
  display: flex; gap: 14px; padding: 14px; border-radius: var(--r-m); background: var(--card); border: 1px solid var(--line);
}
.lesson.is-changed.tone-error { border-color: color-mix(in srgb, var(--error) 45%, transparent); }
.lesson.is-changed.tone-tertiary { border-color: color-mix(in srgb, var(--tertiary) 45%, transparent); }
.lesson.is-now { border: 2px solid var(--success); padding: 13px; }
.lesson.is-past { opacity: .55; }
.lesson-side { width: 52px; flex: none; display: flex; flex-direction: column; align-items: center; }
.lesson-n {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px;
  background: var(--primary-c); color: var(--on-primary-c); margin-bottom: 6px;
}
.lesson.tone-error .lesson-n { background: var(--error-c); color: var(--on-error-c); }
.lesson.tone-tertiary .lesson-n { background: var(--tertiary-c); color: var(--on-tertiary-c); }
.lesson.tone-success .lesson-n { background: var(--success-c); color: var(--on-success-c); }
.lesson-start { font-size: 14px; font-weight: 600; }
.lesson-end { font-size: 13px; color: var(--muted); }
.lesson-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lesson-title { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.lesson-title.muted { color: var(--muted); }
.detail { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
.was { color: var(--muted); font-size: 13px; }
.note { font-size: 13px; color: var(--primary); }
.lesson.tone-error .note { color: var(--error); }
.lesson.tone-tertiary .note { color: var(--tertiary); }
.progress { height: 6px; border-radius: 3px; background: var(--success-c); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--success); border-radius: 3px; transition: width .4s; }
.left { font-size: 13px; font-weight: 600; color: var(--success); }

.week { display: flex; flex-direction: column; gap: 12px; }
.week + .week { margin-top: 10px; }
.week-head h2 { font-size: 22px; font-weight: 600; }
.week-head span { color: var(--muted); font-size: 15px; }
.daycard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.daycard.today { border: 2px solid var(--primary); padding: 11px 13px; }
.daycard-title { font-size: 17px; font-weight: 600; }
.lrow { display: grid; grid-template-columns: 22px 96px 1fr; gap: 0; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: 15px; }
.daycard .tags + .lrow, .daycard-title + .lrow { border-top: 0; }
.lrow-n { color: var(--primary); font-weight: 700; }
.lrow-time { color: var(--muted); }
.lrow-main { display: flex; flex-direction: column; min-width: 0; }
.lrow-title { font-weight: 600; overflow-wrap: anywhere; }
.lrow-sub { color: var(--muted); font-size: 13px; }
.lrow.is-cancelled .lrow-n, .lrow.is-cancelled .lrow-title { color: var(--error); }
.lrow.is-replaced .lrow-n, .lrow.is-replaced .lrow-title { color: var(--tertiary); }

/* ─────────────── изменения ─────────────── */
.chday { display: flex; flex-direction: column; gap: 10px; }
.chday + .chday { margin-top: 8px; }
.chday-head { display: flex; align-items: center; gap: 10px; }
.chday-ic { color: var(--primary); }
.chday-ic.today { color: var(--tertiary); }
.chday-titles { flex: 1; min-width: 0; }
.chday-titles h2 { font-size: 21px; font-weight: 600; line-height: 1.25; }
.chday-titles span { color: var(--muted); font-size: 15px; }
.statecard { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-m); }
.statecard div { display: flex; flex-direction: column; gap: 2px; }
.statecard b { font-size: 17px; }
.statecard.tone-success { background: var(--success-c); color: var(--on-success-c); }
.statecard.tone-neutral { background: var(--high); color: var(--text); }

/* ─────────────── помощник ─────────────── */
.screen.chat .content { padding-bottom: 96px; }
.intro { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.intro-ic { width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--primary-c); color: var(--on-primary-c); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 10px;
  border: 1px solid var(--outline); background: var(--card); font-size: 15px; font-weight: 500; color: var(--text);
}
.chip:disabled { opacity: .55; }
.chip.selected { background: var(--secondary-c); color: var(--on-secondary-c); border-color: transparent; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.bubble.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.error { background: var(--error-c); color: var(--on-error-c); border-color: transparent; }
.typing { display: flex; align-items: center; gap: 10px; color: var(--muted); padding-left: 4px; }
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--bottom)); z-index: 25; display: flex; gap: 8px;
  padding: 10px 12px; background: var(--bg); border-top: 1px solid var(--line);
}
body.kb-open .composer { bottom: 0; padding-bottom: calc(10px + var(--bottom)); }
.composer input {
  flex: 1; min-width: 0; height: 48px; padding: 0 18px; border-radius: 24px; border: 1px solid var(--outline);
  background: var(--card); font-size: 16px; outline: none;
}
.composer input:focus { border-color: var(--primary); }
.sendbtn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; flex: none;
}
.sendbtn:disabled { background: var(--highest); color: var(--muted); }

.htext { display: flex; flex-direction: column; gap: 10px; white-space: pre-wrap; text-align: left; width: 100%; }
.htext blockquote {
  margin: 0; padding: 8px 12px; border-left: 3px solid var(--primary); border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.htext strong { font-weight: 600; }
.htext code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; }

/* ─────────────── ещё ─────────────── */
.account {
  margin: 8px 16px 4px; padding: 18px; border-radius: var(--r-l); background: var(--primary-c); color: var(--on-primary-c);
  display: flex; flex-direction: column; gap: 12px;
}
.account-head { display: flex; align-items: center; gap: 14px; }
.account-head div { display: flex; flex-direction: column; }
.account-head b { font-size: 17px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary); color: var(--on-primary); font-size: 22px; font-weight: 700;
}
.account .btn { align-self: flex-start; }
.account .btn.outline { color: var(--on-primary-c); border-color: color-mix(in srgb, var(--on-primary-c) 25%, transparent); }
.account-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row {
  width: 100%; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 0; background: none;
  text-align: left; text-decoration: none; color: var(--text); position: relative;
}
.row::after { content: ""; position: absolute; left: 56px; right: 0; bottom: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
button.row:active, a.row:active { background: var(--high); }
.row-ic { color: var(--muted); }
.row-text { flex: 1; min-width: 0; }
.row-title { font-size: 17px; }
.row-sub { font-size: 14px; color: var(--muted); }
.row.danger .row-ic, .row.danger .row-title { color: var(--error); }
.row.accent .row-ic, .row.accent .row-title { color: var(--primary); }
.switch {
  width: 52px; height: 32px; border-radius: 16px; background: var(--highest); border: 2px solid var(--outline);
  position: relative; flex: none; transition: background .15s;
}
.switch .knob { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--outline); transition: all .15s; }
.switch.on { background: var(--primary); border-color: var(--primary); }
.switch.on .knob { left: 22px; top: 2px; width: 24px; height: 24px; background: var(--on-primary); }
.switch.disabled { opacity: .45; }

/* ─────────────── группа ─────────────── */
.search {
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; height: 52px; border-radius: var(--r-l);
  background: var(--card); border: 1px solid var(--outline); color: var(--muted);
}
.search:focus-within { border-color: var(--primary); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 16px; color: var(--text); height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }
.years { display: flex; flex-direction: column; gap: 8px; }
.years .label { color: var(--muted); font-size: 14px; font-weight: 600; padding-left: 4px; }
.groupgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grouptile {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 14px; border-radius: var(--r-m);
  border: 1px solid var(--line); background: var(--card); font-size: 17px; font-weight: 600; text-align: left;
}
.grouptile:active { background: var(--high); }
.grouptile.sel { border: 2px solid var(--success); padding: 15px 13px; background: var(--success-c); color: var(--on-success-c); }
.grouptile.sel .ic { color: var(--success); }

/* ─────────────── техподдержка ─────────────── */
.segmented { display: flex; border: 1px solid var(--outline); border-radius: 999px; overflow: hidden; }
.segmented button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 0;
  background: none; font-weight: 600; font-size: 15px;
}
.segmented button + button { border-left: 1px solid var(--outline); }
.segmented button.on { background: var(--secondary-c); color: var(--on-secondary-c); }
.lead { font-size: 16px; }
.example { padding: 12px; border-radius: var(--r-s); background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--muted); font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field textarea {
  width: 100%; min-height: 140px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--outline);
  background: var(--card); font-size: 16px; resize: vertical; outline: none;
}
.field textarea:focus { border-color: var(--primary); border-width: 2px; padding: 11px 13px; }
.counter { align-self: flex-end; font-size: 12px; color: var(--muted); padding-right: 4px; }
.attachment { display: flex; align-items: center; gap: 12px; padding: 6px 4px 6px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--primary); }
.attachment > div { flex: 1; min-width: 0; color: var(--text); }
.att-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sending { display: flex; flex-direction: column; gap: 6px; }
.sending .progress { background: var(--high); }
.sending .progress span { background: var(--primary); }
.result { padding: 14px; border-radius: var(--r-m); font-size: 15px; }
.result.ok { background: var(--success-c); color: var(--on-success-c); }
.result.fail { background: var(--error-c); color: var(--on-error-c); }
.ticket { padding: 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.ticket-head { display: flex; align-items: center; gap: 8px; color: var(--primary); }
.ticket-head b { flex: 1; color: var(--text); font-size: 15px; }
.ticket-text { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ─────────────── знакомство и установка ─────────────── */
.onboarding { min-height: 100vh; min-height: 100dvh; display: flex; }
.ob-body {
  width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: calc(36px + var(--top)) 24px calc(24px + var(--bottom));
}
.ob-body.centered { justify-content: center; text-align: center; }
.ob-body h1 { font-size: 28px; font-weight: 600; text-align: center; }
.ob-lead { color: var(--muted); text-align: center; font-size: 17px; }
.content .ob-lead { text-align: left; color: var(--text); }
.logo { border-radius: 27%; box-shadow: 0 10px 30px rgba(79, 70, 229, .25); margin-bottom: 6px; }
.features { width: 100%; display: flex; flex-direction: column; gap: 16px; margin: 14px 0 22px; }
.feature { display: flex; align-items: center; gap: 14px; }
.feature-ic { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--primary-c); color: var(--on-primary-c); }
.feature div { display: flex; flex-direction: column; }
.feature b { font-size: 17px; font-weight: 600; }
.feature span { color: var(--muted); font-size: 15px; }
.big-ic { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-c); color: var(--on-primary-c); margin-bottom: 8px; }
.big-ic.tone-tertiary { background: var(--tertiary-c); color: var(--on-tertiary-c); }
.steps { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-n { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 15px; }
.step div { padding-top: 3px; }
.kbd { display: inline-grid; place-items: center; vertical-align: -5px; width: 28px; height: 26px; border-radius: 7px; background: var(--high); color: var(--primary); }
.ob-body .muted.small { text-align: center; }

/* ─────────────── окна и сообщения ─────────────── */
body.modal-open { overflow: hidden; }
.scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 24px;
  animation: fade .15s ease-out;
}
.dialog {
  width: 100%; max-width: 400px; background: var(--card); border-radius: var(--r-xl); padding: 24px 22px 14px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  max-height: calc(100vh - 48px); overflow: auto;
}
.dialog-ic { align-self: center; color: var(--primary); }
.dialog h2 { font-size: 22px; font-weight: 600; text-align: center; }
.dialog-body { color: var(--muted); font-size: 15px; display: flex; flex-direction: column; gap: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px; }
.login-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.waiting { display: flex; align-items: center; gap: 10px; }
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 60; bottom: calc(var(--tabbar-h) + var(--bottom) + 12px);
  max-width: 520px; margin: 0 auto; padding: 14px 18px; border-radius: 12px; background: #1F2330; color: #F1F2F8;
  font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: rise .2s ease-out;
}
@media (prefers-color-scheme: dark) { .toast { background: #E5E7EF; color: #1F2330; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* широкий экран (компьютер, планшет): колонка по центру */
@media (min-width: 760px) {
  .topbar, .weekstrip > * { max-width: 720px; margin-left: auto; margin-right: auto; }
  .topbar { padding-left: 24px; padding-right: 16px; }
  .weekstrip { margin: 0; }
  .content.flush { max-width: 720px; margin: 0 auto; }
  .composer { max-width: 720px; margin: 0 auto; border: 1px solid var(--line); border-radius: 20px 20px 0 0; }
}
