/* ============================================================
   Файл:    /public_html/assets/css/style.css
   Назначение: стили всего сайта Taxi-class.
   ============================================================ */

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    overflow-x: clip;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background-color 0.3s ease, color 0.3s ease;
}
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select {
    font: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
}

/* ВАЖНО: appearance:none убивает нативные checkbox/radio.
   Возвращаем им нативный вид, иначе они невидимы,
   и accent-color (жёлтый) не работает.
   Используются:
   - index.php: способ назначения (dispatcher/pick)
   - driver.php: причина отказа
   - admin/dashboard.php: «сразу назначить водителя»
   - driver_form.php: «активен» */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 1.15em;
    height: 1.15em;
    min-width: 1.15em;
    cursor: pointer;
    accent-color: var(--yellow-dark);
}

button { cursor: pointer; border: 0; background: transparent; }
ul, ol { list-style: none; }

/* ============ TOKENS ============ */
:root {
    --yellow: #FFC300;
    --yellow-dark: #E6B000;
    --ink: #0F0F10;
    --ink-soft: #1C1C1E;
    --muted: #6E6E73;
    --line: #E5E5EA;
    --bg: #F5F5F7;
    --white: #FFFFFF;

    --green: #34C759;
    --red: #FF3B30;
    --blue: #007AFF;

    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);

    --container: 1160px;
    --header-h: 68px;
    --chat-h: 340px;
    --touch: 44px;
    --pad-x: clamp(16px, 4vw, 24px);
    --gap-section: clamp(48px, 8vw, 96px);
}

/* ============ DARK THEME ============ */
@media (prefers-color-scheme: dark) {
    :root {
        --yellow: #FFD60A;
        --yellow-dark: #E6B800;
        --ink: #F5F5F7;
        --ink-soft: #1C1C1E;
        --muted: #98989D;
        --line: #2C2C2E;
        --bg: #000000;
        --white: #1C1C1E;

        --green: #30D158;
        --red: #FF453A;
        --blue: #0A84FF;

        --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
    }

    .header { background: rgba(15, 15, 16, 0.72); border-bottom: 1px solid rgba(255,255,255,0.08); }
    .mobile-nav { background: rgba(15, 15, 16, 0.96); }

    .order-card { background: rgba(28, 28, 30, 0.96); border: 1px solid rgba(255,255,255,0.1); }
    .route {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .route__input { color: #fff; }
    .route__clear { background: rgba(255, 255, 255, 0.1); color: rgba(255,255,255,0.7); }
    .route__clear:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
    .route__divider { background: rgba(255, 255, 255, 0.1); }

    .field {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .field__input { color: #fff; }
    .field__input[readonly] { color: rgba(255,255,255,0.5); }
    .field select.field__input {
        background-image:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2398989D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }

    .form__input,
    .form__select,
    .form__textarea {
        background: rgba(255, 255, 255, 0.06);
        color: #fff;
    }
    .form__input:focus,
    .form__select:focus,
    .form__textarea:focus {
        background: rgba(255, 255, 255, 0.1);
    }

    .admin-header { background: rgba(15, 15, 16, 0.8); }
    .table th { background: rgba(255, 255, 255, 0.03); }
    .table tr:hover td { background: rgba(255, 255, 255, 0.02); }
    .admin-filters a {
        background: rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.7);
    }
    .admin-filters a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
    .admin-filters a.is-active { background: var(--yellow); color: #000; }
    .admin-header__link {
        background: rgba(255, 255, 255, 0.06);
        color: var(--ink);
    }
    .admin-header__link:hover { background: rgba(255, 255, 255, 0.12); }

    .modal__dialog {
        background: rgba(28, 28, 30, 0.96);
        border: 1px solid rgba(255,255,255,0.1);
    }
    .modal__head { background: transparent; }

    .chat__list { background: rgba(255, 255, 255, 0.02); }
    .chat__msg { background: #2C2C2E; border-color: #3A3A3C; color: var(--ink); }
    .chat__msg--own { background: var(--yellow); border-color: var(--yellow); color: #000; }

    .pick { background: rgba(255, 255, 255, 0.02); }
    .pick__option { background: #2C2C2E; }
    .pick__option:has(input:checked) { background: rgba(255, 195, 0, 0.1); }
    .pick__driver { background: #2C2C2E; }
    .pick__driver:hover { background: rgba(255, 195, 0, 0.06); }
    .pick__driver[aria-pressed="true"] { background: rgba(255, 195, 0, 0.12); }
    .pick__empty { background: #2C2C2E; }

    .empty-state { background: rgba(255, 255, 255, 0.02); }

    .login-card {
        background: rgba(28, 28, 30, 0.96);
        border: 1px solid rgba(255,255,255,0.1);
    }
    .login-card__title { color: #fff; }
    .login-card .logo__text { color: #fff; }
    .login-card .form__input { background: rgba(255, 255, 255, 0.06); }
    .login-card .form__input:focus { background: rgba(255, 255, 255, 0.1); }

    .footer { background: #0A0A0B; }

    .refusal-form__actions {
        background: rgba(28, 28, 30, 0.96);
        border-top-color: rgba(255,255,255,0.1);
    }

    .order-toast {
        background: #2C2C2E;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    }
    .order-toast__title,
    .order-toast__sub { color: var(--ink); }
    .order-toast__extra { color: var(--muted); }
    .order-toast__close:hover { background: rgba(255, 255, 255, 0.08); }

    /* Dark theme: цветные заголовки toast — читаемые на тёмном */
    .order-toast--assigned .order-toast__title { color: #FFD60A; }
    .order-toast--canceled .order-toast__title { color: #FF8A80; }
    .order-toast--completed .order-toast__title { color: #69DB7C; }
    .order-toast--accepted .order-toast__title,
    .order-toast--en_route .order-toast__title { color: #74B9FF; }

    .order-tile__addr { border-bottom-color: rgba(255, 255, 255, 0.2); }

    .order-map-wrap { background: #1C1C1E; }
    .icon-btn { background: rgba(255, 255, 255, 0.06); }
    .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
    .icon-btn__badge { border-color: #1C1C1E; }

    .addr-block { background: rgba(255, 255, 255, 0.02); }
    .addr-block__item { background: #2C2C2E; }
    .addr-block__item:hover { background: rgba(255, 195, 0, 0.08); }
    .addr-block__arrow { background: rgba(255, 195, 0, 0.18); color: var(--yellow); }

    .client-card { background: rgba(255, 255, 255, 0.04); }
    .client-card__phone { color: var(--muted); }
    .client-card__phone:hover { color: var(--ink); }

    .order-comment { background: rgba(255, 195, 0, 0.12); }

    .mini-btn { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
    .mini-btn:hover { background: rgba(255, 195, 0, 0.10); border-color: var(--yellow); }
    .mini-btn--yandex { color: #FF7A72; border-color: rgba(255, 122, 114, 0.3); }
    .mini-btn--yandex:hover { border-color: #FF7A72; background: rgba(255, 122, 114, 0.08); }
    .mini-btn--2gis { color: #4CD488; border-color: rgba(76, 212, 136, 0.3); }
    .mini-btn--2gis:hover { border-color: #4CD488; background: rgba(76, 212, 136, 0.08); }

    /* City pill: dropdown / recent */
    .city-dropdown-fixed,
    .recent-dropdown-fixed {
        background: #2C2C2E;
        border-color: #3A3A3C;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    }
    .city-dropdown-option { color: var(--ink); }
    .city-dropdown-option:hover { background: rgba(255, 195, 0, 0.15); }
    .city-dropdown-option--custom { color: #4DA3FF; border-top-color: #3A3A3C; }
    .recent-dropdown-item { color: var(--ink); }
    .recent-dropdown-item:hover { background: rgba(255, 195, 0, 0.12); }

    .route__city-btn--custom {
        background: rgba(77, 163, 255, 0.15);
        color: #4DA3FF;
        border-color: rgba(77, 163, 255, 0.4);
    }
    .route__preview { background: rgba(255, 255, 255, 0.04); }

    /* ============================================================
       DARK THEME: статусы, доступность, алерты (ФИКС).
       Раньше эти классы использовали фиксированные тёмные цвета
       (#B08A00, #248A3D, #D70015, #0066CC) — на тёмной теме
       контраст не проходил WCAG AA. Даём светлые варианты.
       ============================================================ */
    .status--new        { background: rgba(255, 214, 10, 0.18); color: #FFD60A; }
    .status--assigned   { background: rgba(90, 200, 250, 0.15); color: #5AC8FA; }
    .status--accepted   { background: rgba(90, 200, 250, 0.15); color: #5AC8FA; }
    .status--en_route   { background: rgba(90, 200, 250, 0.15); color: #5AC8FA; }
    .status--arrived    { background: rgba(105, 219, 124, 0.18); color: #69DB7C; }
    .status--in_progress{ background: rgba(105, 219, 124, 0.18); color: #69DB7C; }
    .status--completed  { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
    .status--canceled   { background: rgba(255, 69, 58, 0.18); color: #FF8A80; }

    .avail--free    { background: rgba(105, 219, 124, 0.18); color: #69DB7C; }
    .avail--busy    { background: rgba(255, 214, 10, 0.18); color: #FFD60A; }
    .avail--offline { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

    .alert--error   { background: rgba(255, 69, 58, 0.15); color: #FF8A80; border-color: rgba(255, 69, 58, 0.3); }
    .alert--success { background: rgba(105, 219, 124, 0.15); color: #69DB7C; border-color: rgba(105, 219, 124, 0.3); }
    .alert--info    { background: rgba(90, 200, 250, 0.12); color: #5AC8FA; border-color: rgba(90, 200, 250, 0.25); }

    /* Toast-icon: цвета под тёмную тему */
    .order-toast--assigned .order-toast__icon { background: rgba(255, 214, 10, 0.2); color: #FFD60A; }
    .order-toast--canceled .order-toast__icon { background: rgba(255, 69, 58, 0.18); color: #FF8A80; }
    .order-toast--accepted .order-toast__icon,
    .order-toast--en_route .order-toast__icon { background: rgba(90, 200, 250, 0.18); color: #5AC8FA; }
    .order-toast--arrived .order-toast__icon,
    .order-toast--in_progress .order-toast__icon,
    .order-toast--completed .order-toast__icon { background: rgba(105, 219, 124, 0.18); color: #69DB7C; }
}

/* ============ UTILITIES ============ */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ============ Анимации ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 195, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 195, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 195, 0, 0); }
}
@keyframes orderTileRing {
    0%, 100% {
        border-color: var(--yellow);
        box-shadow: 0 0 0 0 rgba(255, 195, 0, 0.45);
    }
    50% {
        border-color: var(--yellow-dark);
        box-shadow: 0 0 0 6px rgba(255, 195, 0, 0);
    }
}
@keyframes orderToastIn {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes orderToastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes cityDropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch);
    padding: 8px 24px;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.25;
    text-align: center;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, opacity 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    max-width: 100%;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--yellow-dark); outline-offset: 3px; }
.btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
    pointer-events: none;
}

.btn--primary {
    background: var(--yellow);
    color: #000;
    box-shadow: 0 4px 14px rgba(255, 195, 0, 0.3);
}
.btn--primary:hover {
    background: var(--yellow-dark);
    box-shadow: 0 6px 20px rgba(255, 195, 0, 0.4);
    transform: translateY(-1px);
}
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--dark:hover { background: var(--ink-soft); transform: translateY(-1px); }
.btn--ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--line);
}
.btn--ghost:hover { border-color: var(--ink); background: rgba(0,0,0,0.03); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #E03028; transform: translateY(-1px); }
.btn--danger:disabled { opacity: 0.75; }

.btn--danger-ghost {
    background: rgba(255, 59, 48, 0.04);
    color: var(--red);
    border: 1.5px solid rgba(255, 59, 48, 0.5);
    box-shadow: none;
}
.btn--danger-ghost:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: var(--red);
}
.btn--danger-ghost:active {
    background: rgba(255, 59, 48, 0.16);
    transform: scale(0.97);
}
.btn--danger-ghost:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.btn--danger-ghost:disabled { opacity: 0.5; }

.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 6px 16px; font-size: 13.5px; border-radius: var(--radius-xs); }

/* ============ HEADER ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(15, 15, 16, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease;
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.4px;
    color: #fff;
    user-select: none;
    min-width: 0;
}
.logo__mark {
    width: 36px; height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-xs);
    background: var(--yellow);
    display: grid; place-items: center;
    font-weight: 900;
    color: #000;
    font-size: 18px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo:active .logo__mark { transform: scale(0.9); }
.logo__text { color: #fff; white-space: nowrap; }
.logo__text span { color: var(--yellow); }

.nav { display: none; }
.nav__list { display: flex; gap: 28px; }
.nav__link {
    font-size: 14.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    transition: color 0.2s ease;
    padding: 6px 0;
    position: relative;
    white-space: nowrap;
}
.nav__link:hover { color: #fff; }
.nav__link.is-active { color: #fff; font-weight: 700; }
.nav__link.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 2px;
    background: var(--yellow);
    border-radius: 2px;
}

.header__cta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header__phone {
    display: none;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
}
.header__phone:hover { color: var(--yellow); }

.burger {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border-radius: var(--radius-xs);
    color: #fff;
    flex-shrink: 0;
}
.burger:hover { background: rgba(255,255,255,0.08); }
.burger svg { width: 24px; height: 24px; }

/* ============ MOBILE NAV ============ */
.mobile-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(15, 15, 16, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #fff;
    padding: 24px var(--pad-x);
    z-index: 90;
    display: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.2s ease-out;
}
.mobile-nav.is-open { display: block; }
.mobile-nav__list { display: grid; gap: 4px; margin-bottom: 24px; }
.mobile-nav__link {
    display: block;
    padding: 16px 12px;
    border-radius: var(--radius-xs);
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    overflow-wrap: break-word;
}
.mobile-nav__link:hover,
.mobile-nav__link.is-active { background: rgba(255,255,255,0.08); color: var(--yellow); }

/* ============ HERO ============ */
.hero {
    background-image:
        linear-gradient(180deg, rgba(15, 15, 16, 0.55) 0%, rgba(15, 15, 16, 0.75) 60%, rgba(15, 15, 16, 0.92) 100%),
        radial-gradient(900px 400px at 85% -10%, rgba(255, 195, 0, 0.18), transparent 60%),
        url('/assets/img/hero.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    background-color: #1C1C1E;
    color: #fff;
    padding: clamp(32px, 6vw, 72px) 0 clamp(48px, 8vw, 96px);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 195, 0, 0.06), transparent 50%);
    pointer-events: none;
    z-index: 0;
}
.hero__grid {
    display: grid;
    gap: clamp(28px, 5vw, 56px);
    position: relative;
    z-index: 1;
    min-width: 0;
}
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 195, 0, 0.12);
    color: var(--yellow);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 195, 0, 0.25);
    max-width: 100%;
    flex-wrap: wrap;
}
.hero__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 0 0 4px rgba(255, 195, 0, 0.2);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}
.hero h1 {
    font-size: clamp(28px, 7vw, 56px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.hero h1 .accent { color: var(--yellow); }
.hero__lead {
    font-size: clamp(15px, 2.5vw, 19px);
    color: rgba(255,255,255,0.78);
    max-width: 540px;
    margin-bottom: 32px;
    line-height: 1.6;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__actions .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.hero__actions .btn--ghost:hover { border-color: var(--yellow); color: var(--yellow); background: rgba(255,255,255,0.05); }

/* ============ ORDER CARD ============ */
.order-card {
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    border-radius: var(--radius);
    padding: clamp(18px, 4vw, 28px);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.7);
    min-width: 0;
}
.order-card__title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 18px;
    letter-spacing: -0.3px;
}
.order-form { display: grid; gap: 14px; min-width: 0; }

/* ============================================================
   ФОРМА ЗАКАЗА (капсула с чипами городов)
   ============================================================ */

.route {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    /* overflow УБРАН — иначе city-dropdown-fixed и recent-dropdown-fixed обрезаются */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.route:focus-within {
    border-color: var(--yellow);
    box-shadow: 0 0 0 4px rgba(255, 195, 0, 0.15);
}

.route__row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    min-height: 62px;
    position: relative;
}
.route__row:first-child {
    border-top-left-radius: calc(var(--radius-sm) - 1.5px);
    border-top-right-radius: calc(var(--radius-sm) - 1.5px);
}
.route__row:last-child {
    border-bottom-left-radius: calc(var(--radius-sm) - 1.5px);
    border-bottom-right-radius: calc(var(--radius-sm) - 1.5px);
}

.route__marker {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    position: relative;
}
.route__marker--start {
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18);
}
.route__marker--end {
    background: var(--red);
    border-radius: 2px;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15);
}

.route__label {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
    cursor: text;
}
.route__caption {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
    letter-spacing: 0.2px;
    transition: color 0.15s ease;
}
.route__row:focus-within .route__caption {
    color: var(--yellow-dark);
}
.route__input {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 2px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.3;
    min-width: 0;
}
.route__input:focus { outline: none; }
.route__input::placeholder {
    color: var(--muted);
    font-weight: 400;
    opacity: 0.7;
}

.route__divider {
    height: 1px;
    background: var(--line);
    margin-left: 42px;
    margin-right: 14px;
}

.route__clear {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: var(--muted);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.route__clear svg { width: 14px; height: 14px; }
.route__clear:hover { background: rgba(0, 0, 0, 0.12); color: var(--ink); }
.route__row.has-value .route__clear {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- Чип города ---------- */
.route__city-pill {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.route__city-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(255, 195, 0, 0.15);
    color: #8B6F00;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid rgba(255, 195, 0, 0.35);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    max-width: 112px;
    white-space: nowrap;
    font-family: inherit;
}
.route__city-btn:hover {
    background: rgba(255, 195, 0, 0.25);
    border-color: var(--yellow);
}
.route__city-btn:focus-visible {
    outline: 2px solid var(--yellow-dark);
    outline-offset: 2px;
}
.route__city-btn--custom {
    background: rgba(0, 122, 255, 0.10);
    color: #0066CC;
    border-color: rgba(0, 122, 255, 0.35);
}
.route__city-btn--custom:hover {
    background: rgba(0, 122, 255, 0.18);
    border-color: #007AFF;
}
.route__city-btn svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    opacity: 0.7;
}
.route__city-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 78px;
}

/* ---------- Превью итогового маршрута ---------- */
.route__preview {
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    background: rgba(0, 0, 0, 0.03);
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    display: none;
    overflow-wrap: break-word;
}
.route__preview.is-visible { display: block; }
.route__preview b {
    color: var(--ink);
    font-weight: 600;
}
.route__preview .route__preview-arrow {
    color: var(--yellow-dark);
    font-weight: 700;
    margin: 0 4px;
}

/* ============================================================
   City dropdown и recent — рендерятся в <body>,
   position: fixed. Не зависят от .route { overflow }
   ============================================================ */

.city-dropdown-fixed,
.recent-dropdown-fixed {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 6px;
    display: grid;
    gap: 2px;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    animation: cityDropdownIn 0.15s ease-out;
}
.city-dropdown-fixed[hidden],
.recent-dropdown-fixed[hidden] {
    display: none;
}

.city-dropdown-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background: transparent;
    border: 0;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}
.city-dropdown-option:hover,
.city-dropdown-option:focus-visible {
    background: rgba(255, 195, 0, 0.15);
    outline: none;
}
.city-dropdown-option.is-active {
    background: rgba(255, 195, 0, 0.20);
    font-weight: 700;
}
.city-dropdown-option--custom {
    color: #007AFF;
    font-weight: 600;
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 12px;
}

.recent-dropdown-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 6px 10px 4px;
}
.recent-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 6px;
    background: transparent;
    border: 0;
    text-align: left;
    font-size: 13.5px;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    overflow-wrap: break-word;
    min-width: 0;
    transition: background 0.1s;
}
.recent-dropdown-item:hover,
.recent-dropdown-item:focus-visible {
    background: rgba(255, 195, 0, 0.10);
    outline: none;
}
.recent-dropdown-item svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--muted);
    opacity: 0.6;
}
.recent-dropdown-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Обычные поля ---------- */
.field {
    display: grid;
    gap: 2px;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
    cursor: text;
}
.field:focus-within {
    border-color: var(--yellow);
    box-shadow: 0 0 0 4px rgba(255, 195, 0, 0.15);
}
.field__caption {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
    letter-spacing: 0.2px;
    transition: color 0.15s ease;
}
.field:focus-within .field__caption { color: var(--yellow-dark); }
.field__input {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 2px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.3;
    min-width: 0;
}
.field__input:focus { outline: none; }
.field__input::placeholder {
    color: var(--muted);
    font-weight: 400;
    opacity: 0.7;
}
.field__input[readonly] { color: var(--muted); cursor: default; }
.field select.field__input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E6E73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 24px;
}

.order-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
}
.order-form__submit {
    min-height: 54px;
    font-size: 16px;
    margin-top: 4px;
}
.order-form__hint {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    margin-top: 2px;
}

/* ============ SECTIONS ============ */
.section { padding: var(--gap-section) 0; min-width: 0; }
.section--tight { padding: clamp(32px, 5vw, 48px) 0; }
.section--dark { background: var(--ink-soft); color: #fff; }
.section--gray { background: rgba(0,0,0,0.02); }

.section-head { margin-bottom: clamp(24px, 5vw, 40px); }
.section-head--center { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }
.section-head__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--yellow-dark);
    margin-bottom: 10px;
}
.section-head h2 {
    font-size: clamp(24px, 5vw, 40px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.8px;
    overflow-wrap: break-word;
}
.section-head p {
    margin-top: 12px;
    color: var(--muted);
    max-width: 640px;
    font-size: 16px;
    overflow-wrap: break-word;
}
.section-head--center p { margin-left: auto; margin-right: auto; }
.section--dark .section-head p { color: rgba(255,255,255,0.6); }
.section--dark .section-head__eyebrow { color: var(--yellow); }

/* ============ FEATURES ============ */
.features { display: grid; grid-template-columns: 1fr; gap: 16px; min-width: 0; }
.feature {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: clamp(18px, 3vw, 28px);
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border: 1px solid var(--line);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
    overflow-wrap: break-word;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature__icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: var(--radius-xs);
    background: rgba(255, 195, 0, 0.15);
    color: var(--ink);
    display: grid; place-items: center;
}
.feature__icon svg { width: 24px; height: 24px; }
.feature__title { font-size: 17px; font-weight: 700; margin-bottom: 6px; overflow-wrap: break-word; }
.feature__text { font-size: 14px; color: var(--muted); line-height: 1.5; overflow-wrap: break-word; }

/* ============ PRICING ============ */
.pricing { display: grid; gap: 20px; grid-template-columns: 1fr; min-width: 0; }
.price-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    transition: transform 0.2s ease;
    min-width: 0;
}
.price-card:hover { transform: translateY(-4px); }
.price-card--featured {
    background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    border: none;
}
.price-card--featured::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--yellow);
}
.price-card__name {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    margin-bottom: 12px;
}
.price-card--featured .price-card__name { color: var(--yellow); }
.price-card__price {
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 8px;
    overflow-wrap: break-word;
}
.price-card__price small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.price-card--featured .price-card__price small { color: rgba(255,255,255,0.5); }
.price-card__desc { font-size: 14px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; overflow-wrap: break-word; }
.price-card--featured .price-card__desc { color: rgba(255,255,255,0.6); }
.price-card__list { display: grid; gap: 12px; margin-bottom: 24px; flex: 1; }
.price-card__list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; overflow-wrap: break-word; }
.price-card__list svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--green); margin-top: 2px; }
.price-card--featured .price-card__list svg { color: var(--yellow); }

/* ============ DIRECTIONS ============ */
.directions { display: grid; grid-template-columns: 1fr; gap: 12px; min-width: 0; }
.direction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    transition: transform 0.15s ease, border-color 0.15s ease;
    min-width: 0;
}
.direction:hover { transform: translateY(-2px); border-color: var(--yellow); }
.direction__left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.direction__icon {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: var(--radius-xs);
    background: rgba(255, 195, 0, 0.15);
    color: var(--ink);
    display: grid; place-items: center;
}
.direction__icon svg { width: 22px; height: 22px; }
.direction__name {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.direction__price {
    font-weight: 800;
    font-size: 17px;
    color: var(--ink);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============ DRIVERS ============ */
.drivers { display: grid; grid-template-columns: 1fr; gap: 16px; min-width: 0; }
.driver {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    min-width: 0;
}
.driver__avatar {
    flex-shrink: 0;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 22px;
    color: #000;
}
.driver__body { flex: 1; min-width: 0; }
.driver__name { font-weight: 700; font-size: 16px; margin-bottom: 2px; overflow-wrap: break-word; }
.driver__meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; overflow-wrap: break-word; }
.driver__phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    color: #000;
    background: var(--yellow);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    transition: background 0.15s ease;
    max-width: 100%;
    overflow-wrap: break-word;
}
.driver__phone:hover { background: var(--yellow-dark); }
.driver__phone svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============ FAQ ============ */
.faq { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; min-width: 0; }
.faq details {
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    overflow: hidden;
}
.faq summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 24px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    overflow-wrap: break-word;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    font-size: 24px;
    font-weight: 400;
    color: var(--muted);
    transition: transform 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 24px 24px; color: var(--muted); font-size: 15px; line-height: 1.6; overflow-wrap: break-word; }

/* ============ CTA ============ */
.cta {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    border-radius: var(--radius);
    padding: clamp(24px, 5vw, 56px);
    text-align: center;
    color: #000;
    overflow-wrap: break-word;
}
.cta h2 { font-size: clamp(22px, 5vw, 36px); font-weight: 800; margin-bottom: 12px; letter-spacing: -0.6px; overflow-wrap: break-word; }
.cta p { color: rgba(0,0,0,0.7); margin-bottom: 28px; font-size: 16px; overflow-wrap: break-word; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ============ FOOTER ============ */
.footer {
    background: var(--ink-soft);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 28px;
    font-size: 14px;
}
.footer__grid { display: grid; gap: 32px; grid-template-columns: 1fr; margin-bottom: 32px; min-width: 0; }
.footer__brand { min-width: 0; }
.footer__brand .logo { margin-bottom: 16px; }
.footer__brand p { line-height: 1.6; max-width: 320px; overflow-wrap: break-word; }
.footer h4 {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.footer__list { display: grid; gap: 10px; min-width: 0; }
.footer__list a { color: rgba(255,255,255,0.6); transition: color 0.15s ease; overflow-wrap: break-word; }
.footer__list a:hover { color: var(--yellow); }
.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    overflow-wrap: break-word;
}

/* ============ MODAL ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.modal.is-open { display: block; }
.modal__dialog {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: var(--radius);
    width: 100%;
    margin: 24px auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: min(960px, calc(100vw - 32px));
    position: relative;
}
.modal__dialog--narrow {
    max-width: min(520px, calc(100vw - 32px));
}
.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: transparent;
    flex-shrink: 0;
    min-width: 0;
}
.modal__head > div:first-child {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.modal__title {
    font-weight: 800;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.modal__subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.modal__close {
    width: 40px; height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--ink);
    background: rgba(0,0,0,0.05);
    transition: background 0.15s ease;
}
.modal__close:hover { background: rgba(0,0,0,0.1); }
.modal__close svg { width: 20px; height: 20px; }
.modal__body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-width: 0;
    min-height: 0;
}
.modal__map {
    min-height: 260px;
    height: 260px;
    background: #E9E9E9;
    position: relative;
    overflow: hidden;
}
.modal__map .map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}
.modal__side {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
    max-height: 60vh;
    min-width: 0;
    min-height: 0;
}
.modal__status {
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    overflow-wrap: break-word;
}

/* ---------- Модалка отказа ---------- */
.refusal-form.modal__body {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
    grid-template-columns: none;
}
.refusal-form__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px;
}
.refusal-form__actions {
    flex-shrink: 0;
    padding: 16px 24px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--white);
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: stretch;
    z-index: 1;
}
.refusal-form__actions .btn {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    font-size: 14.5px;
    padding: 8px 12px;
}
.refusal-form__actions .btn[type="button"] {
    flex: 0 0 auto;
    min-width: 92px;
    font-size: 14px;
}

/* ---------- Toast-плашки статуса ---------- */
.order-toast-container {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 16px 0;
    pointer-events: none;
}
.order-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 44px 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    animation: orderToastIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    min-width: 0;
    overflow-wrap: break-word;
}
.order-toast--hide { animation: orderToastOut 0.3s ease forwards; }
.order-toast__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 195, 0, 0.15);
    color: var(--ink);
    margin-top: 1px;
}
.order-toast__icon svg { width: 22px; height: 22px; display: block; }
.order-toast__body { flex: 1; min-width: 0; line-height: 1.35; }
.order-toast__title {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}
.order-toast__sub {
    font-size: 13.5px;
    color: var(--ink);
    opacity: 0.85;
    overflow-wrap: break-word;
}
.order-toast__extra {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
    overflow-wrap: break-word;
}
.order-toast__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    line-height: 1;
    color: var(--muted);
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}
.order-toast__close:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }

.order-toast--assigned { border-color: rgba(255, 195, 0, 0.55); }
.order-toast--assigned .order-toast__icon {
    background: rgba(255, 195, 0, 0.22);
    color: #B08A00;
}
.order-toast--canceled { border-color: rgba(255, 59, 48, 0.4); }
.order-toast--canceled .order-toast__icon {
    background: rgba(255, 59, 48, 0.12);
    color: var(--red);
}
.order-toast--canceled .order-toast__title { color: #D70015; }
.order-toast--accepted,
.order-toast--en_route { border-color: rgba(0, 122, 255, 0.35); }
.order-toast--accepted .order-toast__icon,
.order-toast--en_route .order-toast__icon {
    background: rgba(0, 122, 255, 0.12);
    color: #0066CC;
}
.order-toast--arrived,
.order-toast--in_progress,
.order-toast--completed { border-color: rgba(52, 199, 89, 0.45); }
.order-toast--arrived .order-toast__icon,
.order-toast--in_progress .order-toast__icon,
.order-toast--completed .order-toast__icon {
    background: rgba(52, 199, 89, 0.15);
    color: #248A3D;
}
.order-toast--completed .order-toast__title { color: #248A3D; }

/* ============ MAP ============ */
.map { width: 100%; height: 100%; min-height: 260px; }
.map__placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    min-height: 260px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 20px;
    overflow-wrap: break-word;
}

/* ============ CHAT ============ */
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.chat__list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: min(var(--chat-h), 40vh);
    max-height: 400px;
    background: rgba(0,0,0,0.02);
    min-width: 0;
}
.chat__empty { color: var(--muted); font-size: 14px; text-align: center; margin: auto; }
.chat__msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    background: var(--white);
    border: 1px solid var(--line);
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    min-width: 0;
}
.chat__msg--own {
    align-self: flex-end;
    background: var(--yellow);
    border-color: var(--yellow);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 195, 0, 0.2);
}
.chat__meta {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
    opacity: 0.8;
    overflow-wrap: break-word;
}
.chat__msg--own .chat__meta { color: rgba(0,0,0,0.6); }
.chat__form {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: transparent;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    flex-shrink: 0;
    min-width: 0;
}
.chat__input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    max-height: 120px;
    resize: none;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xs);
    font-size: 16px;
    line-height: 1.4;
    background: var(--white);
}
.chat__input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 195, 0, 0.15); }
.chat__send {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: var(--radius-xs);
    background: var(--yellow);
    color: #000;
    display: grid; place-items: center;
    transition: background 0.15s ease;
}
.chat__send:hover { background: var(--yellow-dark); }
.chat__send svg { width: 20px; height: 20px; }

/* ============ STATUS BADGES ============ */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.05);
    color: var(--ink);
    white-space: nowrap;
    max-width: 100%;
}
.status::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.status--new        { background: rgba(255, 195, 0, 0.15); color: #B08A00; }
.status--assigned   { background: rgba(0, 122, 255, 0.1); color: #0066CC; }
.status--accepted   { background: rgba(0, 122, 255, 0.1); color: #0066CC; }
.status--en_route   { background: rgba(0, 122, 255, 0.1); color: #0066CC; }
.status--arrived    { background: rgba(52, 199, 89, 0.15);  color: #248A3D; }
.status--in_progress{ background: rgba(52, 199, 89, 0.15);  color: #248A3D; }
.status--completed  { background: rgba(0,0,0,0.05); color: var(--muted); }
.status--canceled   { background: rgba(255, 59, 48, 0.1);  color: #D70015; }

.avail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    max-width: 100%;
}
.avail::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.avail--free    { background: rgba(52, 199, 89, 0.15); color: #248A3D; }
.avail--busy    { background: rgba(255, 195, 0, 0.15); color: #B08A00; }
.avail--offline { background: rgba(0,0,0,0.05); color: var(--muted); }

/* ============ DRIVER PICKER ============ */
.pick {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: rgba(0,0,0,0.02);
    min-width: 0;
}
.pick__title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.pick__options { display: grid; gap: 10px; min-width: 0; }
.pick__option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1.5px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    min-width: 0;
}
.pick__option:hover { border-color: var(--line); }
.pick__option input { margin-top: 3px; accent-color: var(--yellow-dark); flex-shrink: 0; }
.pick__option:has(input:checked) { border-color: var(--yellow); background: rgba(255, 195, 0, 0.05); }
.pick__option-body { flex: 1; min-width: 0; overflow-wrap: break-word; }
.pick__option-name { font-weight: 700; font-size: 15px; }
.pick__option-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

.pick__list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
    min-width: 0;
}
.pick__driver {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xs);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease;
    min-width: 0;
}
.pick__driver:hover { border-color: var(--yellow); background: rgba(255, 195, 0, 0.05); }
.pick__driver[aria-pressed="true"] { border-color: var(--yellow); background: rgba(255, 195, 0, 0.1); }
.pick__avatar {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    display: grid; place-items: center;
    font-weight: 800; font-size: 17px; color: #000;
}
.pick__info { flex: 1; min-width: 0; overflow: hidden; }
.pick__name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__car { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__empty {
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    background: var(--white);
    border: 1.5px dashed var(--line);
    border-radius: var(--radius-xs);
    overflow-wrap: break-word;
}
.pick__hint { font-size: 12px; color: var(--muted); margin-top: 10px; overflow-wrap: break-word; }

/* ============ GENERIC FORM ============ */
.form { display: grid; gap: 16px; min-width: 0; }
.form__row { display: grid; grid-template-columns: 1fr; gap: 12px; min-width: 0; }
.form__label {
    display: grid;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    min-width: 0;
    overflow-wrap: break-word;
}
.form__input,
.form__select,
.form__textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xs);
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form__textarea { min-height: 120px; resize: vertical; }
.form__input:focus,
.form__select:focus,
.form__textarea:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 4px rgba(255, 195, 0, 0.15);
}
.form__hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; overflow-wrap: break-word; }
.form__error { font-size: 13px; color: var(--red); font-weight: 600; overflow-wrap: break-word; }
.form__success { font-size: 13px; color: var(--green); font-weight: 600; overflow-wrap: break-word; }

/* ============ PAGE / CONTENT ============ */
.page-hero {
    background: var(--ink-soft);
    color: #fff;
    padding: clamp(32px, 6vw, 56px) 0;
}
.page-hero h1 {
    font-size: clamp(26px, 6vw, 44px);
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 12px;
    overflow-wrap: break-word;
}
.page-hero p { color: rgba(255,255,255,0.65); max-width: 640px; font-size: 16px; line-height: 1.6; overflow-wrap: break-word; }
.page-hero a { color: var(--yellow); }

.content { padding: clamp(28px, 6vw, 48px) 0 clamp(48px, 8vw, 80px); }
.content h2 { font-size: clamp(22px, 5vw, 32px); font-weight: 800; margin: 0 0 16px; letter-spacing: -0.6px; overflow-wrap: break-word; }
.content h3 { font-size: 19px; font-weight: 700; margin: 28px 0 12px; overflow-wrap: break-word; }
.content p { margin-bottom: 16px; color: var(--muted); line-height: 1.7; overflow-wrap: break-word; }
.content ul { margin: 0 0 16px 20px; list-style: disc; color: var(--muted); line-height: 1.7; }
.content ul li { margin-bottom: 8px; overflow-wrap: break-word; }
.content ol { margin: 0 0 16px 20px; list-style: decimal; color: var(--muted); line-height: 1.7; }
.content ol li { margin-bottom: 8px; overflow-wrap: break-word; }
.content a { color: var(--yellow-dark); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: break-word; }
.content a:hover { color: var(--ink); }

/* ============ ADMIN ============ */
.admin-body { background: var(--bg); min-height: 100vh; min-height: 100dvh; }
.admin-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--pad-x);
    min-width: 0;
}
.admin-header__title {
    font-weight: 800;
    font-size: 16px;
    color: var(--ink);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-header__title span { color: var(--yellow-dark); }
.admin-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}
.admin-header__user { font-size: 13px; color: var(--muted); white-space: nowrap; }
.admin-header__link {
    font-size: 13.5px;
    color: var(--ink);
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    background: rgba(0,0,0,0.05);
    font-weight: 500;
    transition: background 0.15s ease;
    white-space: nowrap;
}
.admin-header__link:hover { background: rgba(0,0,0,0.1); }

.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 32px) var(--pad-x) clamp(48px, 8vw, 80px);
    min-width: 0;
}
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: 24px;
    border: 1px solid var(--line);
    min-width: 0;
}
.admin-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.4px; overflow-wrap: break-word; }
.admin-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; overflow-wrap: break-word; }

.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-filters a {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(0,0,0,0.04);
    color: var(--muted);
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.admin-filters a:hover { background: rgba(0,0,0,0.08); color: var(--ink); }
.admin-filters a.is-active { background: var(--ink); color: var(--bg); }

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xs);
    background: rgba(0,0,0,0.01);
    min-width: 0;
    padding-bottom: 4px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 680px;
}
.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    overflow-wrap: break-word;
}
.table th {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    background: rgba(0,0,0,0.02);
    white-space: nowrap;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(0,0,0,0.01); }
.table td.nowrap { white-space: nowrap; }
.table__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ LOGIN ============ */
.login-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(160deg, #0F0F10 0%, #1C1C1E 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.4);
}
.login-card__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 22px;
    margin-bottom: 8px;
}
.login-card__title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.login-card__hint { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.login-card .form__input { background: rgba(0,0,0,0.03); }
.login-card .form__input:focus { background: var(--white); }

/* ============ DRIVER PAGE (список заказов) ============ */
.driver-top {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    min-width: 0;
}
.driver-top__info { display: grid; gap: 4px; min-width: 0; overflow-wrap: break-word; }
.driver-top__name { font-weight: 800; font-size: 20px; overflow-wrap: break-word; }
.driver-top__car { font-size: 14px; color: var(--muted); overflow-wrap: break-word; }
.driver-controls { display: flex; gap: 10px; flex-wrap: wrap; }

.order-tile {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px;
    background: var(--white);
    margin-bottom: 16px;
    transition: border-color 0.15s ease;
    min-width: 0;
}
.order-tile:hover { border-color: var(--yellow); }

/* Мигание плитки, когда по ней «звонит» новый заказ.
   Используется в /driver.php (addRinging / removeRinging). */
.order-tile--ringing {
    animation: orderTileRing 1.4s ease-in-out infinite;
    border-color: var(--yellow);
}

.order-tile__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.admin-order__id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    flex-shrink: 0;
    margin-left: auto;
}
.order-tile__route {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: break-word;
}
.order-tile__route-arrow {
    color: var(--muted);
    font-size: 14px;
    padding: 0 2px;
    flex-shrink: 0;
}
.order-tile__addr {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease, border-color 0.15s ease;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
}
.order-tile__addr:hover {
    background: rgba(255, 195, 0, 0.10);
    border-bottom-color: var(--yellow);
}
.order-tile__addr:active {
    background: rgba(255, 195, 0, 0.18);
}
.order-tile__addr-marker {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.order-tile__addr-marker--from {
    background: var(--green);
    box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2);
}
.order-tile__addr-marker--to {
    background: var(--red);
    border-radius: 2px;
    box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.18);
}
.order-tile__addr-text {
    font-weight: 600;
    min-width: 0;
    overflow-wrap: break-word;
}
.order-tile__addr-nav {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--muted);
    opacity: 0.65;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.order-tile__addr:hover .order-tile__addr-nav {
    opacity: 1;
    color: var(--yellow-dark);
}

.order-tile__client {
    font-size: 14px;
    color: var(--muted);
    margin: 10px 0;
    overflow-wrap: break-word;
}

.order-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
    min-width: 0;
}
.order-actions-grid .btn {
    width: 100%;
    min-height: 48px;
    font-size: 14.5px;
    padding: 8px 12px;
    line-height: 1.2;
}
.order-actions-grid .btn:only-child {
    grid-column: 1 / -1;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
    font-size: 15px;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.01);
    overflow-wrap: break-word;
}

/* ============================================================
   DRIVER ORDER MODAL (redesign v2)
   ============================================================ */

.modal__dialog--driver {
    max-width: min(520px, calc(100vw - 32px));
}
.modal__head--driver {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    min-width: 0;
}
.order-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.order-head__id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.order-head__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.05);
    color: var(--ink);
    flex-shrink: 0;
    border: 0;
    cursor: pointer;
    transition: background 0.15s;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.1); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 20px; height: 20px; display: block; }

.icon-btn__badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--white);
    line-height: 1;
}
.icon-btn__badge[hidden] { display: none; }

.modal__dialog--driver .modal__body {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    min-height: 0;
    flex: 1;
}

.order-map-wrap {
    height: 35vh;
    min-height: 200px;
    max-height: 320px;
    position: relative;
    background: #E9E9E9;
    flex-shrink: 0;
}
.order-map-wrap .map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.order-info {
    padding: 14px 16px max(14px, env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

.addr-block {
    display: grid;
    gap: 6px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    padding: 8px;
}
.addr-block__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--white);
    border-radius: var(--radius-xs);
    border: 0;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s;
    min-width: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}
.addr-block__item:hover { background: rgba(255, 195, 0, 0.08); }
.addr-block__item:active { background: rgba(255, 195, 0, 0.15); }

.addr-block__marker {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
}
.addr-block__marker--from {
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2);
}
.addr-block__marker--to {
    background: var(--red);
    border-radius: 2px;
    box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.18);
}
.addr-block__body {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}
.addr-block__label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--muted);
    text-transform: uppercase;
}
.addr-block__text {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    overflow-wrap: break-word;
    line-height: 1.3;
}
.addr-block__arrow {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 195, 0, 0.15);
    color: #B08A00;
    display: grid;
    place-items: center;
}
.addr-block__arrow svg { width: 16px; height: 16px; display: block; }

.client-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-xs);
}
.client-card__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
    color: #000;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
}
.client-card__body {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 1px;
}
.client-card__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.client-card__phone {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
}
.client-card__phone:hover { color: var(--ink); }

.client-card__call {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--yellow);
    color: #000;
    display: grid;
    place-items: center;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(255, 195, 0, 0.3);
}
.client-card__call:hover { background: var(--yellow-dark); }
.client-card__call:active { transform: scale(0.95); }
.client-card__call svg { width: 18px; height: 18px; }

.order-comment {
    padding: 10px 12px;
    background: rgba(255, 195, 0, 0.10);
    border-left: 3px solid var(--yellow);
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.4;
    overflow-wrap: break-word;
}
.order-comment--empty { display: none; }

.order-primary-action {
    display: grid;
    gap: 4px;
    margin-top: 4px;
}
.order-primary-action .order-action-btn {
    min-height: 56px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(255, 195, 0, 0.35);
}
.order-primary-action .order-refuse-link {
    background: transparent;
    color: var(--red);
    border: 0;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 59, 48, 0.35);
    font-family: inherit;
}
.order-primary-action .order-refuse-link:hover {
    text-decoration-color: var(--red);
}

.order-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.order-extras__nav {
    display: flex;
    gap: 6px;
}
.mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.mini-btn:hover { background: rgba(255, 195, 0, 0.10); border-color: var(--yellow); }
.mini-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.mini-btn--yandex { color: #C41A11; border-color: rgba(252, 62, 50, 0.3); }
.mini-btn--yandex:hover { border-color: #FC3E32; background: rgba(252, 62, 50, 0.06); }
.mini-btn--2gis { color: #007435; border-color: rgba(0, 132, 60, 0.3); }
.mini-btn--2gis:hover { border-color: #00843C; background: rgba(0, 132, 60, 0.06); }

.order-extras__geo {
    font-size: 11.5px;
    color: var(--muted);
    margin-left: auto;
}

.modal__dialog--chat {
    max-width: min(480px, calc(100vw - 32px));
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}
.modal__dialog--chat .chat {
    flex: 1;
    min-height: 0;
}
.modal__dialog--chat .chat__list {
    flex: 1;
    max-height: none;
    min-height: 240px;
}

/* ============ ALERTS ============ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    overflow-wrap: break-word;
}
.alert--error { background: rgba(255, 59, 48, 0.1); color: #D70015; border-color: rgba(255, 59, 48, 0.2); }
.alert--success { background: rgba(52, 199, 89, 0.1); color: #248A3D; border-color: rgba(52, 199, 89, 0.2); }
.alert--info { background: rgba(0, 122, 255, 0.08); color: #0066CC; border-color: rgba(0, 122, 255, 0.15); }

/* ============================================================
   МЕДИА-ЗАПРОСЫ
   ============================================================ */

@media (min-width: 600px) {
    .modal__dialog { margin: 40px auto; }
    .features { grid-template-columns: repeat(2, 1fr); }
    .directions { grid-template-columns: 1fr 1fr; }
    .drivers { grid-template-columns: 1fr 1fr; }
    .form__row { grid-template-columns: 1fr 1fr; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
    .section { padding: 72px 0; }
    .modal__map { min-height: 320px; }
    .admin-main { padding: 32px var(--pad-x) 80px; }
}

@media (min-width: 900px) {
    .header__phone { display: inline; }
    .nav { display: block; }
    .burger { display: none; }
    .hero__grid {
        grid-template-columns: 1.1fr 1fr;
        align-items: center;
        gap: 64px;
    }
    .modal__dialog { max-height: calc(100vh - 80px); }
    .modal__body {
        grid-template-columns: 1.2fr 1fr;
        min-height: min(540px, calc(100vh - 200px));
    }
    .modal__dialog--narrow .modal__body {
        grid-template-columns: 1fr;
    }
    .modal__map { min-height: 540px; height: 540px; }
    .modal__side { max-height: none; border-top: 0; border-left: 1px solid var(--line); }
    .chat__list { max-height: none; }
    .features { grid-template-columns: repeat(3, 1fr); }
    .pricing { grid-template-columns: repeat(3, 1fr); }
    .drivers { grid-template-columns: repeat(3, 1fr); }
    .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }

    .modal__dialog--driver .modal__body,
    .modal__dialog--chat .modal__body {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
}

@media (min-width: 1024px) {
    :root { --container: 1200px; }
}

@media (min-width: 1440px) {
    :root { --container: 1280px; }
}

@media (max-width: 899px) {
    .header {
        background: rgba(15, 15, 16, 0.94);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .mobile-nav {
        background: rgba(15, 15, 16, 0.98);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .hero { background-position: 25% center; }
    .hero::before { display: none; }

    .order-card {
        background: rgba(248, 248, 250, 0.75);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.55);
        color: #0F0F10;
    }
    .order-card__title { color: #0F0F10; }

    .route, .field { background: #fff; border-color: #E5E5EA; }
    .route__input, .field__input { color: #0F0F10; }
    .route__input::placeholder, .field__input::placeholder { color: #6E6E73; opacity: 0.6; }
    .route__caption, .field__caption { color: #6E6E73; }
    .route:focus-within .route__caption, .field:focus-within .field__caption { color: var(--yellow-dark); }
    .route__divider { background: #E5E5EA; }
    .route__clear { background: rgba(0, 0, 0, 0.06); color: #6E6E73; }
    .route__clear:hover { background: rgba(0, 0, 0, 0.12); color: #0F0F10; }
    .field__input[readonly] { color: #6E6E73; }
    .field select.field__input {
        background-image:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E6E73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }

    .pick { background: rgba(0, 0, 0, 0.03); border-color: #E5E5EA; }
    .pick__title { color: #0F0F10; }
    .pick__option { background: #fff; border-color: transparent; }
    .pick__option:hover { border-color: #E5E5EA; }
    .pick__option:has(input:checked) { background: rgba(255, 195, 0, 0.08); border-color: var(--yellow); }
    .pick__option-name { color: #0F0F10; }
    .pick__option-meta { color: #6E6E73; }

    .pick__driver { background: #fff; border-color: #E5E5EA; }
    .pick__driver:hover { background: rgba(255, 195, 0, 0.05); border-color: var(--yellow); }
    .pick__driver[aria-pressed="true"] { background: rgba(255, 195, 0, 0.1); border-color: var(--yellow); }
    .pick__name { color: #0F0F10; }
    .pick__car { color: #6E6E73; }
    .pick__empty { background: #fff; border-color: #E5E5EA; color: #6E6E73; }
    .pick__hint { color: #6E6E73; }
    .pick__avatar { color: #000; }

    .order-form__hint { color: #6E6E73; }
    .form__error { color: var(--red); }

    .admin-header {
        background: var(--white);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .modal__dialog {
        background: var(--white);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .modal__head {
        background: var(--white);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .login-card {
        background: var(--white);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .modal { padding: 0; }
    .modal__dialog {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        max-width: 100vw;
        width: 100vw;
    }
    .modal__dialog--narrow {
        min-height: 100vh;
        min-height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        max-width: 100vw;
        width: 100vw;
    }
    .modal__head {
        position: sticky;
        top: 0;
        z-index: 2;
        padding-top: max(16px, env(safe-area-inset-top));
    }
    .modal__body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }

    .refusal-form.modal__body {
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
        flex: 1;
        min-height: 0;
        padding: 0;
    }
    .refusal-form__scroll {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 16px 20px;
    }
    .refusal-form__actions {
        background: var(--white);
        padding: 16px 20px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .order-toast-container {
        top: calc(72px + env(safe-area-inset-top, 0px));
        padding: 8px 12px 0;
    }
    .order-toast {
        padding: 12px 42px 12px 14px;
        border-radius: var(--radius-xs);
    }
    .order-toast__icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .order-toast__icon svg { width: 20px; height: 20px; }
    .order-toast__title { font-size: 14.5px; }
    .order-toast__sub { font-size: 13px; }

    .modal__map {
        flex: 0 0 40vh;
        min-height: 220px;
        max-height: 40vh;
    }
    .modal__map .map {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .modal__side {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        max-height: none;
        border-top: 1px solid var(--line);
        border-left: 0;
        min-height: 0;
    }
    .chat__list { min-height: 200px; max-height: none; }
    .chat__form { position: sticky; bottom: 0; }

    .modal__dialog--driver {
        max-width: 100vw;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }
    .modal__dialog--driver .modal__head--driver {
        padding-top: max(14px, env(safe-area-inset-top));
    }
    .order-map-wrap {
        height: 32vh;
        min-height: 180px;
        max-height: 280px;
    }

    .modal__dialog--chat {
        max-width: 100vw;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }
    .modal__dialog--chat .modal__head {
        padding-top: max(14px, env(safe-area-inset-top));
    }
    .modal__dialog--chat .chat__form {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 639px) {
    .admin-header { height: 56px; }
    .admin-header__title { font-size: 14px; }
    .admin-header__user { display: none; }
    .admin-header__link { font-size: 12.5px; padding: 6px 10px; }

    .hero h1 { letter-spacing: -0.8px; }
    .order-form__row { grid-template-columns: 1fr; }
    .cta__actions .btn { width: 100%; }

    .table { min-width: 560px; }
    .table th, .table td { padding: 10px 12px; font-size: 13px; }

    .login-card { padding: 24px 20px; }
    .login-card__logo { font-size: 19px; }
    .login-card__title { font-size: 18px; }

    .order-card__title { font-size: 17px; }
    .btn--sm { font-size: 13px; padding: 6px 12px; }

    /* капсула — компактнее */
    .route__row {
        gap: 6px;
        padding: 8px 10px;
        min-height: 58px;
    }
    .route__city-btn {
        font-size: 12px;
        padding: 5px 8px;
        max-width: 96px;
    }
    .route__city-name { max-width: 62px; }
    .route__marker { width: 10px; height: 10px; }
    .route__clear { width: 24px; height: 24px; }
    .route__input { font-size: 15px; }

    /* dropdown / recent на мобиле */
    .city-dropdown-fixed,
    .recent-dropdown-fixed {
        max-height: 55vh;
        border-radius: var(--radius-sm);
    }
    .city-dropdown-option { padding: 11px 14px; font-size: 15px; }
    .recent-dropdown-item { padding: 10px 12px; font-size: 14px; }

    .route__preview {
        font-size: 11.5px;
        padding: 6px 10px;
    }
}

@media (max-width: 479px) {
    :root {
        --pad-x: 14px;
        --header-h: 60px;
        --chat-h: 260px;
    }

    .logo { font-size: 17px; }
    .logo__mark { width: 32px; height: 32px; font-size: 16px; }
    .logo__text { font-size: 17px; }

    .hero h1 { font-size: 26px; letter-spacing: -0.5px; }
    .hero__lead { font-size: 14px; }
    .hero__badge { font-size: 12px; padding: 6px 12px; }

    .order-card { padding: 16px; }
    .order-card__title { font-size: 16px; }

    .route__row { padding: 8px 10px; min-height: 56px; gap: 6px; }
    .route__caption { font-size: 10.5px; }
    .route__input { font-size: 15px; }
    .field { padding: 8px 12px; }
    .field__caption { font-size: 10.5px; }
    .field__input { font-size: 16px; }
    .order-form__submit { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn { min-height: var(--touch); }
    .btn--sm { min-height: 42px; }
    .admin-filters a { padding: 10px 18px; }
    .chat__send { width: 52px; height: 52px; }
    .route__clear { width: 30px; height: 30px; }
    .order-actions-grid .btn { min-height: 52px; }
    .mini-btn { min-height: 34px; padding: 8px 12px; }
    .city-dropdown-option { padding: 12px 14px; }
}

/* ВАЖНО: padding-top: env(safe-area-inset-top) для .header и
   .admin-header здесь НЕ применяется. Причина: у них фиксированная
   height (68px / 64px) и box-sizing: border-box — padding съел бы
   высоту контента, ломая sticky-шапку на iPhone с «вырезом».
   Safe-area для шапки решается отдельной задачей (increase height
   + padding-top), а не здесь. */
@supports (padding: max(0px)) {
    .modal__head { padding-top: max(16px, env(safe-area-inset-top)); }
    .chat__form { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .footer { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}

.btn:focus-visible,
.pick__driver:focus-visible,
.pick__option:focus-visible,
.admin-filters a:focus-visible {
    outline: 2px solid var(--yellow-dark);
    outline-offset: 3px;
}

/* ============================================================
   АТРИБУЦИЯ LEAFLET / OPENSTREETMAP / OPENFREEMAP
   ------------------------------------------------------------
   ОСТАВЛЕНО КАК В ИСХОДНИКЕ — скрыта.
   Это потенциальное нарушение tile usage policy (OSM/OpenFreeMap
   требуют видимой атрибуции). Правка не применена — по прямому
   указанию пользователя.
   ============================================================ */
.leaflet-control-attribution {
    font-size: 1px !important;
    line-height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0.00001 !important;
    pointer-events: none !important;
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
}
.leaflet-control-attribution a {
    font-size: 1px !important;
    color: transparent !important;
    text-decoration: none !important;
    pointer-events: none !important;
}
.leaflet-control-attribution svg,
.leaflet-control-attribution .leaflet-attribution-flag,
.leaflet-control-attribution .leaflet-control-attribution-flag {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}