/* ---------- Тема (в духе MyDeals: чисто, без рамок ради рамок, светлая и тёмная) ---------- */

:root {
    color-scheme: light;

    --bg: #f4f6f9;
    --bg-glow: radial-gradient(1200px 600px at 15% -10%, #e5e9ff 0%, transparent 60%),
               radial-gradient(900px 500px at 90% 0%, #e6f7f4 0%, transparent 55%);
    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --surface-3: #eef1f6;
    --border: #e3e7ee;
    --border-strong: #d3d9e4;
    --text: #131722;
    --text-dim: #667085;
    --text-faint: #98a2b3;
    --accent: #5b5ef4;
    --accent-soft: #ecedff;
    --ok: #12a678;
    --ok-soft: #e3f7f0;
    --warn: #e0850c;
    --warn-soft: #fdf1de;
    --danger: #e0435a;
    --danger-soft: #fdeaed;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);

    --radius: 14px;
    --radius-sm: 10px;
    --header-h: 56px;
    --tabbar-h: 62px;
    --column: 480px;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0d0f14;
    --bg-glow: radial-gradient(1200px 600px at 15% -10%, #1a1c3a 0%, transparent 60%),
               radial-gradient(900px 500px at 90% 0%, #102b2b 0%, transparent 55%);
    --surface: #161920;
    --surface-2: #1c2029;
    --surface-3: #232833;
    --border: #262b36;
    --border-strong: #333a48;
    --text: #e8ebf2;
    --text-dim: #99a2b3;
    --text-faint: #6c7688;
    --accent: #7b7ffb;
    --accent-soft: #21234a;
    --ok: #2ed3a3;
    --ok-soft: #10302a;
    --warn: #f0a93a;
    --warn-soft: #33260f;
    --danger: #ff6178;
    --danger-soft: #351720;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
}

/* ---------- База ---------- */

* { box-sizing: border-box; }

html, body { min-height: 100%; }

/* Без синей вспышки и выделения слов по обычному тапу (на телефоне); выделение текста — долгим нажатием. */
html { -webkit-tap-highlight-color: transparent; }
a, button, [role="button"], label, .card { touch-action: manipulation; }

body {
    margin: 0;
    background: var(--bg);
    background-image: var(--bg-glow);
    background-attachment: fixed;
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, ul { margin: 0; }
[hidden] { display: none !important; }
.inline-form { display: contents; }

/* ---------- Колонка приложения: портретная раскладка, на широком экране — поля по бокам ---------- */

.app {
    max-width: var(--column);
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

@media (min-width: 560px) {
    .app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        background: color-mix(in srgb, var(--surface) 35%, transparent);
    }
}

/* ---------- Шапка ---------- */

.header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 16px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.header__spacer { margin-right: auto; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 650;
    letter-spacing: -.01em;
    font-size: 16px;
}

.brand:hover { text-decoration: none; }

.brand__sub { color: var(--text-faint); font-weight: 450; font-size: 13px; }

/* Знак бренда в шапке и на входе — та же иконка «MW», что у приложения и в поиске (один знак везде, 09.10.2026). */
.brand__logo { width: 30px; height: 30px; border-radius: 50%; flex: none; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    border: 1px solid transparent;
    transition: background .15s, color .15s;
}

.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Нижние вкладки ---------- */

.tabbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-top: auto;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-faint);
    font-size: 11.5px;
    font-weight: 550;
    transition: color .15s;
}

.tab:hover { text-decoration: none; color: var(--text-dim); }
.tab.active { color: var(--accent); }

/* ---------- Страница ---------- */

.page {
    padding: 16px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page--center {
    flex: 1;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 28px;
    padding-bottom: 28px;
}

.page__title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.page__lead { color: var(--text-dim); font-size: 14px; }

.section-title {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 6px;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 13.5px;
}

/* ---------- Карточки ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card--tight { padding: 12px 14px; gap: 8px; }
.card--accent { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

.card__head { display: flex; align-items: center; gap: 10px; }
.card__title { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; }
.card__meta { font-size: 13px; color: var(--text-dim); }
.card__right { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13.5px; white-space: nowrap; }

a.card { color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); }

/* Пункт меню: иконка — текст — стрелка/кнопка в одну строку (у .card колонка — здесь строка). */
.entry {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

/* Пункт-кнопка (открывает окно) выглядит как пункт-ссылка. */
button.entry { width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; }
button.entry:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card__head .icon-btn { margin-right: -8px; }

.entry__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent);
    flex: none;
    font-size: 22px;
}

.entry__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.entry__title { font-weight: 650; font-size: 15.5px; }
.entry__hint { font-size: 13px; color: var(--text-dim); }
.entry__arrow { color: var(--text-faint); flex: none; }

/* Другие приложения MyWay (кабинет, после оплаты): строки-ссылки с иконкой продукта, разделены линией. */
.other-products__item { padding: 10px 0; border-top: 1px solid var(--border); color: inherit; }
.other-products__item:hover { text-decoration: none; }
.other-products__item:hover .entry__title { color: var(--accent); }
.other-products__icon { width: 40px; height: 40px; border-radius: 11px; flex: none; object-fit: cover; }
.other-products .field__hint { margin: 0 0 4px; }
.app-link { color: var(--text-dim); }

.row-list { display: flex; flex-direction: column; }

.row-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.row-item:first-child { border-top: none; padding-top: 0; }
.row-item--link { cursor: pointer; }
.row-item--toggle { cursor: pointer; }

/* Переключатель (checkbox) в строке настроек. */
.switch {
    appearance: none;
    flex: none;
    width: 42px;
    height: 24px;
    border-radius: 12px;
    background: var(--border-strong);
    position: relative;
    cursor: pointer;
    transition: background .15s;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    transition: transform .15s;
}

.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

/* Уведомления на этом устройстве: нейтрально, --ok — включены, --bad — запрещены браузером или приложением. */
.push-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; }
.push-box__state { font-weight: 650; font-size: 14.5px; }
.push-box__help { font-size: 13px; line-height: 1.45; color: var(--text-dim); }
.push-box__help p { margin-top: 6px; }
.push-box__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.push-box__actions:not(:has(button:not([hidden]))) { display: none; }
.push-box__ok { color: var(--ok); font-weight: 600; }
.push-box--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.push-box--ok .push-box__state { color: var(--ok); }
.push-box--bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.push-box--bad .push-box__state { color: var(--danger); }
.push-box--bad .push-box__help { color: var(--text); }

.entry__alert { font-size: 12.5px; font-weight: 650; color: var(--danger); }
.entry__alert::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--danger); vertical-align: 1px; }

/* Шаги «как разрешить уведомления». */
.steps { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.row-item--link:hover .row-item__main > :first-child { color: var(--accent); }
.row-item__main { flex: 1; min-width: 0; }
.row-item__sub { color: var(--text-dim); font-size: 12.5px; }

.divider { height: 1px; background: var(--border); }

.empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13.5px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
}

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-weight: 550;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    transition: transform .1s, background .15s, border-color .15s, opacity .15s;
}

.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }

.btn--ok { background: var(--ok); border-color: transparent; color: #fff; }
.btn--ok:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }

.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-dim); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; box-shadow: none; }
.btn--danger:hover { background: var(--danger-soft); }

/* Кнопка <button busy>: после нажатия неактивна и крутит колесо, пока не ответит сервер. */
.btn__wheel { display: none; width: 18px; height: 18px; aspect-ratio: 1; object-fit: contain; flex: none; animation: wheel-spin .9s linear infinite; }
.btn--sm .btn__wheel { width: 15px; height: 15px; }
.btn.is-busy { cursor: progress; }
.btn.is-busy .btn__wheel { display: inline-block; }
.btn.is-busy:disabled { opacity: .85; }

@keyframes wheel-spin { to { transform: rotate(360deg); } }

/* Переход дольше 1,5 с — колесо поверх страницы (popover — поверх открытых окон тоже). */
.loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    backdrop-filter: blur(2px);
    color: var(--text);
    opacity: 0;
    transition: opacity .2s;
}

.loader[popover] { margin: 0; padding: 0; border: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; }
.loader.is-visible { opacity: 1; }
.loader__box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* Тень — только симметричная: она вращается вместе с колесом, смещённая тень «гуляет» и колесо кажется овальным. */
.loader__wheel { width: 72px; height: 72px; aspect-ratio: 1; object-fit: contain; animation: wheel-spin 1.1s linear infinite; filter: drop-shadow(0 0 12px rgba(0, 0, 0, .22)); will-change: transform; }
.loader__text { font-size: 14px; font-weight: 550; color: var(--text-dim); }

.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* Окно поездки без единого канала уведомлений: крупно — последствие, мельче — что сделать, кнопка. */
.notify-warn {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
    background: var(--warn-soft);
}

.notify-warn__title { font-size: 18px; font-weight: 750; line-height: 1.3; letter-spacing: -.01em; color: var(--text); }
.notify-warn__text { font-size: 13.5px; color: var(--text-dim); }
.notify-warn__result { font-size: 13px; line-height: 1.45; color: var(--text); }
.notify-warn--done { border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: var(--ok-soft); }
/* Запрещено на устройстве: красная рамка, кнопка «Проверить ещё раз» / «Открыть настройки». */
.notify-warn--blocked { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: var(--danger-soft); }
.notify-warn--blocked .notify-warn__text { color: var(--danger); font-weight: 650; }
.notify-warn__result p { margin-top: 6px; }
.notify-warn__still { color: var(--danger); font-weight: 650; }

/* Вход: «или» между способами и шаг «позвоните на номер». */
.or { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.call-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.call-box__number { font-size: 26px; font-weight: 750; letter-spacing: .01em; color: var(--text); }
.call-box__number:hover { text-decoration: none; color: var(--accent); }
.call-box__status { font-size: 14px; font-weight: 600; color: var(--text-dim); }
.btn--lg { height: 48px; font-size: 15.5px; border-radius: 12px; }
.btn--block { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row .spacer { margin-left: auto; }

/* ---------- Формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field--inline { flex-direction: row; align-items: center; gap: 10px; }

.field__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: .01em;
}

.field__hint { font-size: 12px; color: var(--text-faint); line-height: 1.4; }

.input, .select, .textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    outline: none;
    min-height: 42px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.input:read-only { color: var(--text-dim); }

.input--code {
    font-size: 24px;
    letter-spacing: .4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.input--phone { font-size: 17px; letter-spacing: .02em; }
.input--narrow { width: 82px; text-align: center; }

.select {
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form { display: flex; flex-direction: column; gap: 12px; }

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
    font-size: 13.5px;
    color: var(--text-dim);
    cursor: pointer;
}

.check input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }

/* ---------- Чипы, переключатели ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 550;
    white-space: nowrap;
}

.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--accent { background: var(--accent-soft); color: var(--accent); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 11px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
    user-select: none;
    transition: all .15s;
}

.toggle:hover { border-color: var(--border-strong); color: var(--text); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.segments { display: flex; gap: 6px; }

.segment {
    flex: 1;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 550;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all .15s;
}

.segment input { position: absolute; opacity: 0; width: 0; height: 0; }
.segment:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }

/* ---------- Сообщения ---------- */

.alert {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 13.5px;
    line-height: 1.45;
}

.alert--ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.alert--warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.alert--danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }

/* ---------- Лендинг ---------- */

.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero__logo { width: 150px; height: auto; margin: 8px 0 14px; }
.hero__title { font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
.hero__lead { font-size: 15.5px; color: var(--text-dim); max-width: 320px; }

.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; }

/* ---------- Документы ---------- */

.doc { font-size: 14.5px; line-height: 1.6; }
.doc h1 { font-size: 20px; margin-bottom: 12px; }
.doc h2 { font-size: 15px; margin: 18px 0 6px; }
.doc p { margin: 0 0 8px; }
.doc ul { padding-left: 20px; margin: 0 0 8px; }
.doc .muted { color: var(--text-faint); font-size: 13px; margin-top: 16px; }

/* ---------- Карта и адреса ---------- */

.map {
    height: 260px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface-3);
    z-index: 0;
}

.map--preview { height: 180px; pointer-events: none; }
.map--pick { cursor: crosshair; }

.map-target { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.map-target__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 6px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 550;
    transition: all .15s;
}

.map-target__btn .point-label { opacity: .45; transition: opacity .15s; }
.map-target__btn.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
.map-target__btn.is-active .point-label { opacity: 1; }

html[data-theme="dark"] .map .leaflet-tile-pane { filter: brightness(.85) contrast(1.05) saturate(.85); }
html[data-theme="dark"] .leaflet-control-zoom a { background: var(--surface); color: var(--text); border-color: var(--border); }

.pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 750;
    font-size: 13px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
    border: 2px solid #fff;
}

.pin > * { transform: rotate(45deg); }
.pin--a { background: var(--accent); }
.pin--b { background: var(--ok); }

.field--suggest { position: relative; }

.suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 4px;
    max-height: 260px;
    overflow-y: auto;
}

.suggest__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    text-align: left;
    font-size: 14px;
    color: var(--text);
}

.suggest__item:hover { background: var(--surface-3); }
.suggest__kind { flex: none; width: 20px; text-align: center; }

.route-summary { font-size: 13px; color: var(--text-dim); min-height: 18px; }

.point-label {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex: none;
}

.point-label--a { background: var(--accent); }
.point-label--b { background: var(--ok); }

.route-line { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.route-line + .route-line { margin-top: 6px; }

/* ---------- Дни недели (как в будильнике) ---------- */

.weekdays { display: flex; gap: 5px; }

.weekday {
    flex: 1;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    display: grid;
    place-items: center;
    cursor: pointer;
    user-select: none;
    transition: all .15s;
}

.weekday input { position: absolute; opacity: 0; width: 0; height: 0; }
.weekday:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.weekday--off:has(input:checked) { background: var(--warn); border-color: var(--warn); }

.match-group { display: flex; flex-direction: column; gap: 10px; }
.match-group + .match-group { margin-top: 10px; }
.match-group__head { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }

.match-group__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.01em;
    color: var(--text);
}

.match-group__count {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.match-group__hint { font-size: 13px; color: var(--text-faint); }

.matches { display: flex; flex-direction: column; gap: 12px; transition: opacity .15s; }
.matches.is-loading { opacity: .45; pointer-events: none; }

/* ---------- Карточка поездки пассажира и госномер ---------- */

.trip-card { cursor: pointer; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.trip-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.trip-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.trip-card .card__head { justify-content: space-between; }

.trip-card__phone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-weight: 650;
    font-size: 15px;
    color: var(--ok);
}

.trip-card__phone--locked { color: var(--text-dim); font-weight: 550; font-size: 13.5px; }

/* Как настоящий номер: белая табличка с чёрной рамкой — одинаково в обеих темах. */
.plate {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 7px;
    border: 1.5px solid #1b1f29;
    border-radius: 5px;
    background: #fff;
    color: #111;
    font: 650 13px/1 ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
    letter-spacing: .04em;
    white-space: nowrap;
    flex: none;
}

.card__head .plate { margin-left: auto; }

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.title-row .chip:hover { text-decoration: none; }

.badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .25);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Окна поверх страницы (dialog.sheet): на всю высоту, по ширине колонки ---------- */

body:has(dialog[open]) { overflow: hidden; }

.sheet {
    padding: 0;
    border: none;
    width: 100%;
    max-width: var(--column);
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 auto;
    background: var(--bg);
    background-image: var(--bg-glow);
    color: var(--text);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .18s ease-out; }
.sheet::backdrop { background: rgba(8, 10, 16, .5); }

@keyframes sheet-in {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.sheet__head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--header-h);
    padding: 0 16px 0 8px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.sheet__title { flex: 1; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }

.sheet__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

/* ---------- Небольшое окно-подсказка по центру (dialog.modal) ---------- */

.modal {
    padding: 0;
    border: none;
    background: transparent;
    width: calc(100% - 32px);
    max-width: 360px;
    color: var(--text);
    overflow: visible;
}

.modal[open] { animation: sheet-in .16s ease-out; }
.modal::backdrop { background: rgba(8, 10, 16, .55); }

.modal__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 18px 16px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}

.modal__icon { font-size: 34px; line-height: 1; }
.modal__title { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.modal__actions { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 6px; }

/* ---------- Пополнение ---------- */

/* Пакеты пополнения — сетка 2×2; скидка — зелёной строкой. */
.topup__packages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.topup__package {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 6px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}

.topup__package input { position: absolute; opacity: 0; width: 0; height: 0; }
.topup__package:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.topup__mw { font-weight: 750; font-size: 18px; letter-spacing: -.01em; }
.topup__price { font-weight: 600; color: var(--accent); }
.topup__package .faint { font-size: 11.5px; line-height: 1.3; }
.topup__bonus { font-size: 12px; font-weight: 650; color: var(--ok); line-height: 1.3; }

.result-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-3);
    font-size: 30px;
    margin-bottom: 6px;
}

.result-icon--ok { background: var(--ok-soft); color: var(--ok); font-weight: 800; }
.result-icon--fail { background: var(--danger-soft); color: var(--danger); font-weight: 800; }

/* ---------- Подвал: продавец и документы ---------- */

.footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
}

.footer a { color: var(--text-dim); }

.prices { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; text-align: left; }

/* ---------- Метрики (/Admin/Metrics) ---------- */

.segment.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
a.segment:hover { text-decoration: none; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.kpi--wide { grid-column: 1 / -1; }
.kpi__value { font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi__label { font-size: 13px; color: var(--text-dim); line-height: 1.3; }
.kpi__hint { font-size: 12px; color: var(--text-faint); line-height: 1.3; }

.funnel { gap: 10px; }
.funnel__head { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.funnel__num { color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel__track { height: 10px; border-radius: 5px; background: var(--surface-3); margin-top: 4px; }
.funnel__bar { height: 100%; border-radius: 5px; background: var(--accent); min-width: 4px; }

.spark__title { font-weight: 650; font-size: 14px; }
.spark__bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; }
.spark__col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.spark__bar { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; }
.spark__col:hover .spark__bar { opacity: 1; }
.spark__axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-faint); }

.cohorts { overflow-x: auto; }
.cohorts table { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cohorts th { color: var(--text-faint); font-weight: 600; text-align: center; padding: 2px; }
.cohorts td { text-align: center; padding: 6px 2px; border-radius: 4px; color: var(--text); }
.cohorts td:nth-child(-n+2) { color: var(--text-dim); }
.cohorts td[style] { background: color-mix(in srgb, var(--accent) calc(var(--level) * 85%), var(--surface-2)); }
.cohorts__empty { background: transparent; }
.cohorts td.cohorts__high { color: #fff; } /* на насыщенной ячейке тёмный текст не читается */

/* ---------- Мелочи ---------- */

.muted { color: var(--text-dim); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.wallet__balance { font-size: 17px; color: var(--accent); }
.faint { color: var(--text-faint); font-size: 12.5px; }
.strong { font-weight: 650; }
.phone { font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Карта поездки: точки пассажиров (капли в цвете пассажира), места встречи/высадки (кружки), легенда. */
.pin--c0, .dot--c0 { background: #e0850c; }
.pin--c1, .dot--c1 { background: #d6336c; }
.pin--c2, .dot--c2 { background: #0ca678; }
.pin--c3, .dot--c3 { background: #7048e8; }
.dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
.dot--big { width: 36px; height: 36px; font-size: 19px; }

.legend { font-size: 13px; color: var(--text-dim); }
.legend > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.legend > summary::-webkit-details-marker { display: none; }
.legend > summary::after { content: "▾"; font-size: 11px; }
.legend[open] > summary::after { content: "▴"; }
.legend__list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.legend__item { display: flex; align-items: center; gap: 8px; }
.legend__mark {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 20px;
    padding: 0 5px;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex: none;
}
.legend__mark--dot { background: transparent; font-size: 14px; }

/* Блок «Встреча» в окне поездки: посадка и высадка, ссылки на карты, кнопки. */
.meet { display: flex; flex-direction: column; gap: 10px; }
.meet__row { display: flex; flex-direction: column; gap: 6px; }
.meet__row + .meet__row { padding-top: 10px; border-top: 1px solid var(--border); }
.meet__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; font-weight: 650; font-size: 14.5px; }
.meet__head > span:first-child { flex: none; }
.meet__place { font-size: 14px; }
.meet__links { display: flex; flex-wrap: wrap; gap: 6px; }
.meet__links .chip { cursor: pointer; }
.meet__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.map--pick { height: 300px; }

/* Ссылка-кнопка в подвале (открывает окно, не ведёт по адресу — site.js пропускает <a href> мимо data-dialog). */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.footer .link-btn { color: var(--text-dim); text-decoration: none; }
.footer .link-btn:hover { color: var(--text); }

/* ---------- Дорога на работу, попутчики и чат (03.10.2026) ---------- */
.wizard-step { display: flex; flex-direction: column; gap: 12px; }
.wizard-step[hidden] { display: none; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px 14px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer;
    text-align: center; position: relative; transition: border-color .15s, background .15s;
}
.role-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.role-card__icon { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.role-card__title { font-weight: 700; font-size: 15px; }
.role-card__hint { font-size: 12.5px; color: var(--text-dim); }
.mate-card { cursor: pointer; }
.mate-card:hover { text-decoration: none; border-color: var(--accent); }
.score { font-variant-numeric: tabular-nums; }
/* Непрочитанное — просто точка, без цифры (просьба Алекса 04.10.2026): в списке чатов, у попутчика, на вкладке «Чат». */
.unread { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip .unread, .btn .unread { width: 8px; height: 8px; box-shadow: none; }
.btn .unread { background: currentColor; }
.tab { position: relative; }
.tab__dot { position: absolute; top: 6px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.pin-sample { display: inline-block; width: 12px; height: 12px; border-radius: 99px; margin-right: 4px; vertical-align: -1px; }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.msg {
    max-width: 84%; padding: 8px 12px; border-radius: 14px; background: var(--surface-3); align-self: flex-start;
    font-size: 15px; line-height: 1.35; overflow-wrap: anywhere;
}
/* Переносы строк сохраняем только у текста: pre-wrap на всём блоке превращал отступы серверной разметки в пустые
   строки — пузыри, отрисованные сервером (после возврата в чат), раздувались, а пришедшие опросом были аккуратными. */
.msg__text { white-space: pre-wrap; }
.msg--mine { align-self: flex-end; background: var(--accent-soft); }
.msg--system { align-self: center; background: transparent; color: var(--text-dim); font-size: 13px; text-align: center; max-width: 100%; }
.msg__time { display: block; font-size: 11px; color: var(--text-faint); margin-top: 2px; text-align: right; }
.chat-form { position: sticky; bottom: calc(var(--tabbar-h, 62px) + 8px); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0; }
.chat-form .textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; }

/* ---------- Шапка чата: действия, меню «⋯», блок «Встреча»; попап «Не хватает MW» (04.10.2026) ---------- */
.chat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chat-actions .inline-form { display: inline-flex; }
.chat-actions .btn.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chat-actions .menu { margin-left: auto; }
.chat-meet { margin-top: 2px; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18));
    display: flex; flex-direction: column;
}
.menu__list form { display: contents; }
.menu__item {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
    background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; text-decoration: none;
}
.menu__item:hover { background: var(--surface-3); text-decoration: none; }
.menu__item--danger { color: var(--danger); }
.nomw { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.nomw__icon { font-size: 28px; line-height: 1; }
.nomw .muted { margin: 0; }
