/* ============================================================
   Навигатор репетитора — UI kit
   Нативный iOS/Telegram-стиль, светлая и тёмная темы.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light;
  --bg: #F4F5F9;
  --surface: #FFFFFF;
  --surface-2: #EDF0F6;
  --text: #111421;
  --text-2: #343A4A;
  --muted: #6B7280;
  --border: #E3E7F0;
  --border-strong: #C9CFDD;
  --accent: #4C5FD5;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #FFFFFF);
  --accent-ink: #FFFFFF;
  --ok-bg: #E7F7EF;
  --ok-fg: #0B7A4B;
  --warn-bg: #FFF3E0;
  --warn-fg: #9A5B00;
  --bad-bg: #FDECEC;
  --bad-fg: #B42318;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-md: 0 12px 32px -18px rgba(16, 24, 40, .35);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D0F14;
  --surface: #161A22;
  --surface-2: #1E2430;
  --text: #F2F4F8;
  --text-2: #D5DAE4;
  --muted: #939DAC;
  --border: #262C38;
  --border-strong: #3A4351;
  --accent-soft: color-mix(in srgb, var(--accent) 26%, #161A22);
  --ok-bg: rgba(30, 160, 110, .16);
  --ok-fg: #5AD3A4;
  --warn-bg: rgba(220, 150, 40, .16);
  --warn-fg: #F0B860;
  --bad-bg: rgba(220, 80, 70, .18);
  --bad-fg: #FF8D84;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 16px 40px -20px rgba(0, 0, 0, .65);
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -180px, color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); }

::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

/* ---------- Каркас ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(8px + var(--safe-top)) 16px 8px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.7) blur(18px);
  backdrop-filter: saturate(1.7) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.brand svg { color: var(--accent); }

.seg {
  display: flex;
  flex: 1 1 auto;
  gap: 3px;
  min-width: 0;
  padding: 3px;
  border-radius: 13px;
  background: var(--surface-2);
}

.seg-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.seg-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  transition: transform .07s ease, background .18s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }

.spacer { flex: 1 1 auto; }

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px calc(112px + var(--safe-bottom));
}

/* ---------- Шапка доверия ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.hero::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -60px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 68%);
  pointer-events: none;
}
.hero > * { position: relative; }

.hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 86%, #FFFFFF), color-mix(in srgb, var(--accent) 62%, #111421));
  color: #fff;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: .01em;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-id { min-width: 0; }
.hero-name {
  font-size: 21px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
}
.hero-spec {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A46B;
  box-shadow: 0 0 0 3px color-mix(in srgb, #16A46B 18%, transparent);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
  font-size: 11.8px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
}
.fact::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 5px;
}

.about-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 14px;
  padding: 11px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: filter .15s ease;
}
.about-btn:active { filter: brightness(.97); }
.about-btn > svg:first-child { color: var(--accent); flex: 0 0 18px; }
.about-btn > svg:last-child { margin-left: auto; color: var(--muted); flex: 0 0 16px; }

/* ---------- Плашка «Админ-панель» ---------- */

.admin-strip {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 16px;
  background: var(--accent-soft);
  text-align: left;
  transition: filter .15s ease, transform .07s ease;
}
.admin-strip:active { transform: scale(.995); filter: brightness(.98); }
.admin-strip .gear {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.admin-strip .strip-title {
  display: block;
  font-size: 12.8px;
  font-weight: 650;
  color: var(--text);
}
.admin-strip .strip-sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
}
.admin-strip .chev { margin-left: auto; color: var(--muted); flex: 0 0 16px; }

/* ---------- Секции ---------- */

.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.015em;
}
.section-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.section-count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .02em;
}

/* ---------- Вкладки ---------- */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  scroll-snap-align: start;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.tab-btn .tab-label { font-size: 13.2px; font-weight: 600; white-space: nowrap; }
.tab-btn .tab-sub { font-size: 10.8px; color: var(--muted); white-space: nowrap; }
.tab-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--accent) 85%, transparent);
}
.tab-btn.is-active .tab-sub { color: color-mix(in srgb, var(--accent-ink) 72%, transparent); }

/* ---------- Тарифы ---------- */

.plans { display: grid; }

.plan {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .07s ease;
}
.plan:active { transform: scale(.995); }
.plan.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
}

.plan-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.plan-radio {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.plan.is-selected .plan-radio {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.plan-headline { display: block; flex: 1 1 auto; min-width: 0; }
.plan-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 15.2px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.plan-badge {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.plan-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.plan-price {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 8px;
  text-align: right;
}
.plan-price b {
  display: block;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.plan-price span {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted);
}

.seats {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.6px;
  font-weight: 650;
  letter-spacing: .01em;
}
.seats::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.seats--ok { background: var(--ok-bg); color: var(--ok-fg); }
.seats--low { background: var(--warn-bg); color: var(--warn-fg); }
.seats--empty { background: var(--bad-bg); color: var(--bad-fg); }

.plan-features {
  display: grid;
  gap: 5px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.plan-feature {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.1px;
  line-height: 1.35;
  color: var(--muted);
}
.plan-feature svg { flex: 0 0 13px; margin-top: 2px; color: var(--accent); }

.plan-note {
  display: block;
  margin-top: 9px;
  font-size: 11px;
  color: var(--muted);
}

.plan-empty {
  margin-top: 9px;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* ---------- Кейсы ---------- */

.cases {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.cases::-webkit-scrollbar { display: none; }

.case {
  flex: 0 0 79%;
  max-width: 300px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  scroll-snap-align: start;
  box-shadow: var(--shadow-sm);
}
.case-name { font-size: 13.6px; font-weight: 650; }
.case-meta { margin-top: 1px; font-size: 10.8px; color: var(--muted); }
.case-flow {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 11px;
}
.case-val {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  background: var(--surface-2);
}
.case-val small {
  display: block;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-val b {
  display: block;
  margin-top: 2px;
  font-size: 12.2px;
  line-height: 1.25;
  font-weight: 650;
  overflow-wrap: break-word;
}
.case-val.is-after { background: var(--accent-soft); }
.case-val.is-after b { color: var(--accent); }
.case-arrow {
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.case-note { margin-top: 8px; font-size: 10.8px; color: var(--muted); }

/* ---------- FAQ ---------- */

.faq {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}
.faq-item + .faq-item { border-top: 1px solid var(--border); }

.faq-q {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.faq-q:active { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

.faq-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  transition: transform .22s ease, background .22s ease, color .22s ease;
}
.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
  background: var(--accent-soft);
  color: var(--accent);
}

.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .26s ease;
}
.faq-a > div { overflow: hidden; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-a p {
  padding: 0 14px 14px;
  font-size: 12.3px;
  line-height: 1.52;
  color: var(--muted);
}

/* ---------- Подвал ---------- */

.footer {
  margin-top: 26px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}
.footer a { color: var(--muted); }

/* ---------- Нижняя кнопка ---------- */

.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 8px 16px calc(10px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 58%, transparent);
  pointer-events: none;
}
.cta-inner { width: 100%; max-width: 640px; margin: 0 auto; pointer-events: auto; }

.cta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  text-align: left;
  box-shadow: 0 16px 32px -16px color-mix(in srgb, var(--accent) 85%, transparent);
  transition: transform .07s ease, filter .16s ease;
}
.cta:active { transform: scale(.99); filter: brightness(.96); }
.cta-label { font-size: 14.2px; font-weight: 650; line-height: 1.25; }
.cta-arrow { margin-left: auto; flex: 0 0 auto; opacity: .92; }

/* ---------- Шторки ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 11, 18, .46);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .22s ease;
}
.backdrop.is-visible { opacity: 1; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: 0 -24px 70px rgba(9, 11, 18, .3);
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.22, .9, .3, 1);
  overflow: hidden;
}
.sheet.is-open { transform: translateY(0); }

.sheet-grab {
  flex: 0 0 auto;
  width: 38px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--border-strong);
}

.sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px 6px;
}
.sheet-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sheet-sub { margin-top: 2px; font-size: 11.8px; color: var(--muted); }
.sheet-close {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 18px 18px;
}
.sheet-foot {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 10px 18px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- Общие кнопки в шторках ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 650;
  transition: transform .07s ease, filter .15s ease;
}
.btn:active { transform: scale(.99); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}
.btn:disabled { opacity: .55; }

/* ---------- О репетиторе ---------- */

.about-lead {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 12.8px;
  line-height: 1.5;
  color: var(--text-2);
}

.subhead {
  margin: 18px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.diploma {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}
.diploma + .diploma { border-top: 1px solid var(--border); }
.diploma-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
}
.diploma b { display: block; font-size: 13px; font-weight: 650; }
.diploma span { display: block; margin-top: 2px; font-size: 11.2px; color: var(--muted); }

.approach { display: grid; gap: 9px; }
.approach-item {
  display: flex;
  gap: 9px;
  font-size: 12.6px;
  line-height: 1.45;
  color: var(--text-2);
}
.approach-item .num {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
}

.quote {
  margin-top: 16px;
  padding: 13px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  font-size: 12.4px;
  line-height: 1.5;
  font-style: italic;
  color: var(--text-2);
}

/* ---------- Запись ---------- */

.booking-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}
.booking-summary b { display: block; font-size: 13px; font-weight: 650; }
.booking-summary span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.booking-summary .price { margin-left: auto; text-align: right; font-size: 13px; font-weight: 700; white-space: nowrap; }

.field-label {
  display: block;
  margin: 16px 0 7px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.2px;
  font-weight: 550;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.msg-preview {
  margin-top: 16px;
  padding: 12px 13px;
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 12.1px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
}

.booking-hint {
  margin-top: 12px;
  font-size: 10.8px;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Админка ---------- */

.admin-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--accent-soft);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.admin-banner svg { flex: 0 0 16px; margin-top: 1px; color: var(--accent); }

.admin-note {
  margin-top: 10px;
  font-size: 11.2px;
  line-height: 1.45;
  color: var(--muted);
}

.admin-tutor-switch {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tutor-switch::-webkit-scrollbar { display: none; }
.admin-tutor-switch button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.admin-tutor-switch button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.admin-tabhead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 2px;
}
.admin-tabhead b { font-size: 12.5px; font-weight: 700; }
.admin-tabhead span { font-size: 10.8px; color: var(--muted); }

.admin-plan {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.admin-plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.admin-plan-head b { font-size: 12.8px; font-weight: 650; }
.admin-plan-head span { font-size: 10.6px; color: var(--muted); }

.admin-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.admin-field > span { font-size: 11.5px; color: var(--muted); }

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-2);
}
.stepper button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}
.stepper button:active { background: var(--accent-soft); }
.stepper input {
  width: 62px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .suffix { padding-right: 5px; font-size: 10.5px; color: var(--muted); }

.admin-foot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.admin-status { flex: 1 1 auto; font-size: 10.8px; line-height: 1.4; color: var(--muted); }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
}

.plan.flash { animation: plan-flash 1.4s ease; }
@keyframes plan-flash {
  0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
  100% { box-shadow: var(--shadow-sm); }
}

/* ---------- Тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 90;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 12px;
  background: #12151F;
  color: #F5F7FB;
  font-size: 12.5px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .toast { background: #F5F7FB; color: #12151F; }

/* ---------- Загрузка / ошибки ---------- */

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100dvh;
  padding: 32px;
}
.boot-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #5B6CFF, #8B5CF6);
  box-shadow: 0 14px 30px -14px rgba(91, 108, 255, .8);
  animation: boot-pulse 1.4s ease-in-out infinite;
}
.boot-text { font-size: 12.5px; color: var(--muted); }
@keyframes boot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.9); opacity: .7; }
}

.error-card {
  margin-top: 40px;
  padding: 22px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}
.error-card b { display: block; font-size: 16px; }
.error-card p { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.error-card .btn { margin-top: 16px; }

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  font-size: 14px;
  text-align: center;
}

/* ---------- Адаптив ---------- */

@media (min-width: 560px) {
  .case { flex-basis: 48%; }
  .hero { padding: 20px; }
  .avatar { width: 72px; height: 72px; flex-basis: 72px; font-size: 25px; }
}

@media (min-width: 760px) {
  .wrap { padding-top: 20px; }
  .sheet {
    left: 50%;
    right: auto;
    width: 560px;
    transform: translate(-50%, 102%);
    border-radius: 26px 26px 0 0;
  }
  .sheet.is-open { transform: translate(-50%, 0); }
}

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