/*
  Цвета берутся из темы Telegram (переменные --tg-theme-*, их выставляет telegram-web-app.js).
  Запасные значения (--fb-*) нужны только если страницу открыли вне Telegram.
*/
:root {
  --fb-bg: #f0f0f5;
  --fb-card: #ffffff;
  --fb-text: #000000;
  --fb-hint: #8e8e93;
  --fb-accent: #2481cc;
  --fb-sep: rgba(60, 60, 67, .14);

  --bg: var(--tg-theme-secondary-bg-color, var(--fb-bg));
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--fb-card)));
  --text: var(--tg-theme-text-color, var(--fb-text));
  --hint: var(--tg-theme-hint-color, var(--fb-hint));
  --link: var(--tg-theme-link-color, var(--fb-accent));
  --accent: var(--tg-theme-button-color, var(--fb-accent));
  --on-accent: var(--tg-theme-button-text-color, #ffffff);
  --accent-text: var(--tg-theme-accent-text-color, var(--accent));
  --header: var(--tg-theme-section-header-text-color, var(--hint));
  --subtitle: var(--tg-theme-subtitle-text-color, var(--hint));
  --danger: var(--tg-theme-destructive-text-color, #e53935);
  --sep: var(--tg-theme-section-separator-color, var(--fb-sep));
  --bar: var(--tg-theme-bottom-bar-bg-color, var(--card));

  --tint: color-mix(in srgb, var(--accent) 13%, transparent);
  --tint-strong: color-mix(in srgb, var(--accent) 22%, transparent);
  --muted-bg: color-mix(in srgb, var(--hint) 14%, transparent);
  --ok: #2fb344;
  --warn: #e8930c;

  --radius: 12px;
  --gutter: 16px;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --tabbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fb-bg: #0f0f0f;
    --fb-card: #1c1c1d;
    --fb-text: #ffffff;
    --fb-hint: #8d8e93;
    --fb-accent: #3e88f7;
    --fb-sep: rgba(255, 255, 255, .08);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex-shrink: 0; }
.interval-editor.no-sep::before { display: none; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#app { padding: 12px var(--gutter) calc(24px + var(--safe-bottom)); min-height: 100vh; }
body.with-tabs #app { padding-bottom: calc(var(--tabbar-h) + 24px + var(--safe-bottom)); }

/* ---------- заголовки ---------- */
.page-title { font-size: 26px; font-weight: 700; margin: 6px 4px 2px; letter-spacing: -.01em; }
.page-sub { color: var(--hint); margin: 0 4px 14px; font-size: 15px; }
.section-title {
  color: var(--header); font-size: 13px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .02em; margin: 22px 16px 7px;
}
.section-title:first-child { margin-top: 6px; }
.section-note { color: var(--hint); font-size: 13px; margin: 7px 16px 0; }

/* ---------- списки (как в настройках Telegram) ---------- */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.list + .list { margin-top: 12px; }
.cell {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 10px 16px; background: none; border: 0; text-align: left;
  position: relative;
}
.cell + .cell::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep);
}
.cell.inset + .cell::before, .cell + .cell.inset::before { left: 64px; }
button.cell:active, .cell.tap:active { background: var(--muted-bg); }
.cell-main { flex: 1; min-width: 0; }
.cell-title { font-size: 16px; }
.cell-sub { color: var(--subtitle); font-size: 14px; margin-top: 1px; }
.cell-sub.wrap { white-space: pre-wrap; }
.cell-right { color: var(--hint); font-size: 15px; text-align: right; flex-shrink: 0; }
.cell .chev { color: var(--hint); opacity: .6; flex-shrink: 0; }
.cell.accent { color: var(--accent-text); }
.cell.danger { color: var(--danger); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-box {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); flex-shrink: 0;
}
.icon-box svg { width: 18px; height: 18px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 600; color: #fff; font-size: 16px;
}
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 12px 16px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 16px;
}
.btn:active { opacity: .85; }
.btn:disabled { opacity: .45; }
.btn.secondary { background: var(--tint); color: var(--accent-text); }
.btn.plain { background: var(--card); color: var(--accent-text); font-weight: 500; }
.btn.danger { background: var(--card); color: var(--danger); font-weight: 500; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 15px; width: auto; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--muted-bg); color: var(--hint); flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- поля ---------- */
.field { display: block; padding: 10px 16px; position: relative; }
.field + .field::before, .cell + .field::before, .field + .cell::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep);
}
.field-label { display: flex; justify-content: space-between; color: var(--hint); font-size: 13px; margin-bottom: 3px; }
.field input, .field textarea, .field select {
  width: 100%; border: 0; outline: 0; background: none; padding: 2px 0; font-size: 16px; color: var(--text);
}
.field textarea { resize: none; min-height: 66px; }
.field select { appearance: none; -webkit-appearance: none; }
.field .suffix { position: absolute; right: 16px; bottom: 12px; color: var(--hint); }
.counter { font-variant-numeric: tabular-nums; }
.counter.full { color: var(--danger); }
input::placeholder, textarea::placeholder { color: var(--hint); opacity: .8; }

.select-cell { position: relative; }
.select-cell select {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}

.search {
  display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 12px; color: var(--hint);
}
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; color: var(--text); }
.search svg { width: 18px; height: 18px; }

/* переключатель */
.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 31px; background: var(--muted-bg); transition: .2s;
}
.switch span::after {
  content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: .2s;
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

/* сегменты */
.seg {
  display: flex; background: var(--muted-bg); border-radius: 10px; padding: 2px; margin-bottom: 14px;
}
.seg button {
  flex: 1; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text);
}
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- статусы ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.pill.muted { background: var(--muted-bg); color: var(--hint); }
.pill.accent { background: var(--tint); color: var(--accent-text); }

/* ---------- календарь ---------- */
.cal { background: var(--card); border-radius: var(--radius); padding: 10px 10px 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.cal-title {
  font-weight: 600; font-size: 17px; border: 0; background: none; padding: 4px 6px; border-radius: 8px;
  display: flex; align-items: center; gap: 4px;
}
.cal-title svg { width: 14px; height: 14px; color: var(--accent-text); }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--tint); color: var(--accent-text);
  display: grid; place-items: center;
}
.cal-nav button:disabled { opacity: .3; }
.cal-nav svg { width: 18px; height: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; }
.cal-wd { text-align: center; font-size: 12px; color: var(--hint); padding: 2px 0 6px; font-weight: 500; }
.cal-wd.we { color: color-mix(in srgb, var(--danger) 70%, var(--hint)); }
.cal-day {
  position: relative; aspect-ratio: 1 / 1; max-height: 42px; margin: 0 auto; width: 100%; max-width: 42px;
  border: 0; background: none; border-radius: 50%; font-size: 16px; font-variant-numeric: tabular-nums;
  display: grid; place-items: center; color: var(--text);
}
.cal-day.empty { visibility: hidden; }
.cal-day.work { background: var(--tint); }
.cal-day.today { color: var(--accent-text); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.selected { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: none; }
.cal-day:disabled { opacity: .32; background: none; }
.cal-day .badge {
  position: absolute; top: -1px; right: -1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px;
  border: 1.5px solid var(--card);
}
.cal-day .dot {
  position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--accent);
}
.cal-day.selected .dot { background: var(--on-accent); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--hint); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px; }
.month-grid button {
  border: 0; background: var(--muted-bg); padding: 12px 4px; border-radius: 10px; font-size: 15px;
}
.month-grid button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---------- слоты ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot {
  border: 0; padding: 10px 0; border-radius: 10px; background: var(--card); font-size: 15px; font-weight: 500;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--sep);
}
.slot.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.slot-group { color: var(--hint); font-size: 13px; margin: 12px 4px 6px; }
.slot-group:first-child { margin-top: 0; }

/* ---------- интервалы ---------- */
.intervals { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.interval {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 20px;
  background: var(--tint); color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums;
}
.interval button {
  border: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text);
}
.interval button svg { width: 12px; height: 12px; }
.interval-editor { display: flex; align-items: center; gap: 8px; padding: 10px 16px; position: relative; }
.interval-editor::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.picker-btn {
  flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; border: 0; background: var(--muted-bg);
  color: var(--text); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: center;
}
.picker-btn:active { background: var(--tint); }

/* колесо выбора */
.wheel {
  position: relative; height: 200px; margin: 6px 0 2px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel-band {
  position: absolute; left: 0; right: 0; top: 80px; height: 40px; border-radius: 10px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--sep); pointer-events: none;
}
.wheel-list {
  position: relative; height: 100%; overflow-y: auto; padding: 80px 0; scroll-snap-type: y mandatory;
  scrollbar-width: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-item {
  height: 40px; line-height: 40px; text-align: center; scroll-snap-align: center; cursor: pointer;
  font-size: 19px; color: var(--hint); font-variant-numeric: tabular-nums; user-select: none;
  transition: color .12s, font-size .12s;
}
.wheel-item.on { color: var(--text); font-size: 21px; font-weight: 600; }
.wheel-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.wheel-label { text-align: center; color: var(--hint); font-size: 13px; margin-top: 6px; }
.wheel-dash { color: var(--hint); font-size: 20px; padding-top: 22px; }

/* темы оформления */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-card {
  border: 0; padding: 8px; border-radius: 16px; background: var(--card); text-align: left;
  box-shadow: inset 0 0 0 1px var(--sep);
}
.theme-card.on { box-shadow: inset 0 0 0 2px var(--accent); }
.theme-name { display: flex; align-items: center; gap: 4px; padding: 8px 4px 2px; font-weight: 600; font-size: 15px; color: var(--text); }
.theme-name svg { width: 16px; height: 16px; color: var(--accent-text); }
.tp { display: flex; height: 92px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(127,127,127,.18); }
.tp-half { flex: 1; padding: 9px 8px; display: flex; flex-direction: column; gap: 7px; }
.tp-card { border-radius: 7px; padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.tp-line { height: 5px; border-radius: 3px; width: 80%; opacity: .85; }
.tp-line.short { width: 50%; opacity: .6; }
.tp-btn { height: 16px; border-radius: 6px; margin-top: auto; }

/* чипы (дни недели, быстрые периоды) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0; padding: 8px 14px; border-radius: 18px; background: var(--card); color: var(--text);
  font-size: 15px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--sep);
}
.chip.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.consent { color: var(--hint); font-size: 13px; line-height: 1.45; margin: 12px 4px 0; }
.consent a { color: var(--link); }
.range-summary { text-align: center; color: var(--hint); font-size: 14px; margin: 18px 0 6px; }
.interval-time { cursor: pointer; }

/* окно выбора (старое) */
.picker-body { max-height: 58vh; overflow-y: auto; margin: 4px -2px 0; padding: 2px; -webkit-overflow-scrolling: touch; }
.picker-body .slots { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.picker-body .cell.on .cell-title { color: var(--accent-text); font-weight: 600; }
.pick-check { color: var(--accent-text); display: flex; }
.pick-check svg { width: 22px; height: 22px; }
.weekday-row { padding: 10px 16px; position: relative; }
.weekday-row + .weekday-row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.weekday-row .head { display: flex; align-items: center; justify-content: space-between; }
.weekday-row .name { font-weight: 600; }
.weekday-row .intervals { padding: 8px 0 0; }
.weekday-row .off { color: var(--hint); font-size: 14px; }

/* ---------- карточки услуг ---------- */
.svc { background: var(--card); border-radius: var(--radius); overflow: hidden; display: block; width: 100%; border: 0; text-align: left; padding: 0; }
.svc + .svc { margin-top: 12px; }
.svc:active { opacity: .9; }
.svc-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--muted-bg); }
.svc-body { padding: 12px 16px 14px; }
.svc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.svc-title { font-weight: 600; font-size: 17px; }
.svc-price { font-weight: 700; font-size: 17px; white-space: nowrap; }
.svc-meta { color: var(--hint); font-size: 14px; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.svc-meta svg { width: 14px; height: 14px; }
.svc-desc {
  color: var(--subtitle); font-size: 14px; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.svc-compact { display: flex; gap: 12px; align-items: center; }
.svc-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--muted-bg); flex-shrink: 0; display: grid; place-items: center; color: var(--hint); }
.svc-thumb svg { width: 24px; height: 24px; }

/* картинка услуги в форме */
.img-preview { position: relative; }
.img-preview img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.img-preview button {
  position: absolute; right: 10px; top: 10px; border: 0; border-radius: 20px; padding: 7px 12px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 14px; font-weight: 500; display: flex; gap: 6px; align-items: center;
}
.img-preview button svg { width: 14px; height: 14px; }
.upload {
  margin: 12px 16px; border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-radius: var(--radius);
  padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--accent-text);
  text-align: center; position: relative;
}
.upload svg { width: 30px; height: 30px; }
.upload small { color: var(--hint); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- записи ---------- */
.bk-time { width: 48px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bk-time b { display: block; font-size: 16px; }
.bk-time span { color: var(--hint); font-size: 13px; }
.bk.dim { opacity: .5; }
.bk-head { display: flex; align-items: center; gap: 8px; }
.bk-head .cell-title { flex: 1; min-width: 0; }
.date-head { color: var(--header); font-size: 13px; font-weight: 600; text-transform: uppercase; margin: 20px 16px 7px; }
.date-head:first-child { margin-top: 4px; }

.ticket { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.ticket + .ticket { margin-top: 12px; }
.ticket-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ticket-title { font-weight: 600; font-size: 17px; }
.ticket-when { font-size: 15px; margin-top: 4px; }
.ticket-meta { color: var(--hint); font-size: 14px; margin-top: 2px; }
.ticket .btn { margin-top: 12px; }

/* ---------- статистика ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--hint); font-size: 13px; }
.stat.wide { grid-column: span 2; }
.mini-stats { display: flex; background: var(--card); border-radius: var(--radius); }
.mini-stats div { flex: 1; text-align: center; padding: 12px 6px; position: relative; }
.mini-stats div + div::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; border-left: .5px solid var(--sep); }
.mini-stats b { display: block; font-size: 18px; }
.mini-stats span { color: var(--hint); font-size: 12px; }

/* ---------- профиль / шапки ---------- */
.hero { text-align: center; padding: 8px 0 4px; }
.hero .avatar { margin: 0 auto 10px; }
.hero h2 { margin: 0; font-size: 22px; }
.hero p { margin: 4px 0 0; color: var(--hint); }

/* ---------- онбординг ---------- */
.onboard { background: var(--card); border-radius: var(--radius); padding: 14px 0 4px; margin-bottom: 14px; }
.onboard h3 { margin: 0 16px 2px; font-size: 17px; }
.onboard p { margin: 0 16px 6px; color: var(--hint); font-size: 14px; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--hint); flex-shrink: 0; display: grid; place-items: center; }
.check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.check svg { width: 14px; height: 14px; }

/* ---------- пустые состояния ---------- */
.empty { text-align: center; padding: 36px 24px; color: var(--hint); }
.empty svg { width: 54px; height: 54px; opacity: .55; margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.empty.inline { padding: 18px 16px; font-size: 15px; }

/* ---------- нижняя панель вкладок ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: color-mix(in srgb, var(--bar) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: .5px solid var(--sep); padding: 0 4px var(--safe-bottom);
}
.tabbar button {
  flex: 1; min-width: 0; height: var(--tabbar-h); border: 0; background: none; color: var(--hint);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 500; letter-spacing: -.01em;
}
.tabbar button svg { width: 26px; height: 26px; }
.tabbar button.on { color: var(--accent-text); }
.tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- плашка «режим клиента» ---------- */
#banner:empty { display: none; }
.banner {
  display: flex; align-items: center; gap: 10px; margin: 10px var(--gutter) 0; padding: 10px 12px 10px 14px;
  border-radius: var(--radius); background: var(--tint); color: var(--accent-text); font-size: 14px; font-weight: 500;
}
.banner span { flex: 1; }

/* ---------- нижний лист (модальное окно) ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.4); display: flex; align-items: flex-end;
  animation: fade .2s ease;
}
.sheet {
  width: 100%; background: var(--bg); border-radius: 16px 16px 0 0; padding: 8px var(--gutter) calc(20px + var(--safe-bottom));
  max-height: 90vh; overflow-y: auto; animation: up .25s ease;
}
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--muted-bg); margin: 0 auto 10px; }
.sheet h3 { margin: 4px 4px 4px; font-size: 20px; }
.sheet p { margin: 0 4px 12px; color: var(--hint); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- прочее ---------- */
.loader {
  width: 28px; height: 28px; margin: 80px auto; border-radius: 50%;
  border: 3px solid var(--muted-bg); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
.loader.small { width: 20px; height: 20px; margin: 24px auto; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 60; background: rgba(30,30,30,.92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  max-width: calc(100% - 32px); text-align: center; animation: fade .2s ease;
}
.muted { color: var(--hint); }
.mt { margin-top: 12px; }
.center { text-align: center; }
a { color: var(--link); text-decoration: none; }
