/* =========================================================
   ЛОВИ — НОВЫЙ ИНТЕРФЕЙС
   ШАГ 1: ТОЛЬКО ДИЗАЙН
   ЛОГИКУ КАРТЫ НЕ ТРОГАЕМ
   ========================================================= */

:root {
    --bg: #f3f5fa;
    --surface: rgba(255,255,255,.94);
    --surface-solid: #ffffff;
    --surface-soft: #eef1f8;

    --text: #202638;
    --text-strong: #151a29;
    --muted: #7b8395;

    --line: rgba(28,39,65,.09);

    --primary: #5968d9;
    --primary-dark: #4655c5;
    --primary-soft: #e9ecff;

    --purple: #8b4de8;
    --pink: #d94ed4;
    --blue: #4d83f5;

    --success: #49a875;
    --success-soft: #e8f6ee;

    --warning: #e8a83d;
    --danger: #d85f69;

    --shadow-sm:
        0 5px 18px rgba(28,39,65,.10);

    --shadow:
        0 14px 38px rgba(28,39,65,.13);

    --shadow-lg:
        0 22px 60px rgba(28,39,65,.18);

    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;

    --nav-height: 76px;
}


/* =========================================================
   DARK MODE
   ========================================================= */

body.dark {
    --bg: #11141b;

    --surface: rgba(27,31,41,.95);
    --surface-solid: #1b1f29;
    --surface-soft: #252a36;

    --text: #dfe3eb;
    --text-strong: #f0f2f6;
    --muted: #9aa2b1;

    --line: rgba(255,255,255,.08);

    --primary: #8995df;
    --primary-dark: #7985d2;
    --primary-soft: #292e45;

    --purple: #a277e9;
    --pink: #d883dc;
    --blue: #78a2f4;

    --success: #72b994;
    --success-soft: #20372c;

    --warning: #d8aa62;
    --danger: #d9868d;

    --shadow-sm:
        0 5px 18px rgba(0,0,0,.28);

    --shadow:
        0 14px 38px rgba(0,0,0,.35);

    --shadow-lg:
        0 22px 60px rgba(0,0,0,.45);
}


/* =========================================================
   RESET
   ========================================================= */

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

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

body {
    overscroll-behavior: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(89,104,217,.22);
    outline-offset: 2px;
}


/* =========================================================
   КАРТА
   ВАЖНО: КАРТА ВСЕГДА НИЖНИЙ СЛОЙ
   ========================================================= */

#map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;

    z-index: 1;

    background: #e9edf3;
}


/* =========================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ========================================================= */

.topbar {
    position: fixed;

    top: 12px;
    left: 18px;
    right: 18px;

    z-index: 50;

    display: flex;
    align-items: center;

    gap: 10px;

    padding-top: env(safe-area-inset-top);

    animation: topbarIn .45s ease both;
}


/* =========================================================
   ЛОГОТИП
   ========================================================= */

.brand {
    height: 50px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 15px;

    border: 1px solid var(--line);
    border-radius: 17px;

    background: var(--surface);

    color: var(--text-strong);

    box-shadow: var(--shadow-sm);

    font-weight: 800;

    white-space: nowrap;

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.brand:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.brand:active {
    transform: scale(.97);
}

.brand-mark {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background:
        linear-gradient(
            145deg,
            #6879e5,
            #4e60ce
        );

    color: white;

    font-size: 16px;
    font-weight: 900;

    box-shadow:
        0 5px 14px rgba(78,96,206,.30);
}

.brand-name {
    font-size: 16px;
    letter-spacing: -.25px;
}


/* =========================================================
   ПОИСК
   ========================================================= */

.searchbox {
    height: 50px;

    min-width: 0;
    flex: 1;

    max-width: 700px;

    display: flex;
    align-items: center;

    background: var(--surface);

    border: 1px solid var(--line);
    border-radius: 17px;

    box-shadow: var(--shadow-sm);

    overflow: hidden;

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.search-icon {
    flex: 0 0 auto;

    margin-left: 15px;

    color: var(--muted);

    font-size: 21px;

    line-height: 1;
}

.searchbox input {
    min-width: 0;
    flex: 1;

    height: 100%;

    padding: 0 10px;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--text);

    font-size: 15px;
}

.searchbox input::placeholder {
    color: var(--muted);
}

.searchbox button {
    height: 40px;

    margin-right: 5px;
    padding: 0 17px;

    border: 0;
    border-radius: 13px;

    background: var(--primary-soft);

    color: var(--primary);

    font-weight: 800;

    transition:
        transform .18s ease,
        background .18s ease;
}

.searchbox button:hover {
    background: var(--primary);
    color: white;
}

.searchbox button:active {
    transform: scale(.95);
}


/* =========================================================
   КНОПКА ГЕОЛОКАЦИИ
   ========================================================= */

.round-btn {
    width: 50px;
    height: 50px;

    flex: 0 0 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--line);
    border-radius: 17px;

    background: var(--surface);

    color: var(--text);

    box-shadow: var(--shadow-sm);

    font-size: 21px;

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        transform .18s ease,
        background .18s ease;
}

.round-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.round-btn:active {
    transform: scale(.92);
}


/* =========================================================
   ГЛАВНАЯ КАРТОЧКА
   ========================================================= */

.hero-card {
    position: fixed;

    z-index: 20;

    top: 100px;
    left: 25px;

    width: 382px;
    max-width: calc(100vw - 50px);

    padding: 25px 25px 22px;

    border-radius: 25px;

    background: var(--surface);

    border: 1px solid var(--line);

    box-shadow: var(--shadow-lg);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    animation: cardIn .55s cubic-bezier(.2,.8,.2,1) both;
}


/* маленький заголовок */

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 10px;

    color: var(--primary);

    font-size: 11px;
    font-weight: 900;

    letter-spacing: 1.2px;
}

.hero-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 0 5px var(--success-soft);

    animation: pulse 2s infinite;
}


/* заголовок */

.hero-card h1 {
    margin: 0;

    color: var(--text-strong);

    font-size: 30px;

    line-height: 1.05;

    letter-spacing: -1.2px;
}

.hero-card h1 em {
    color: var(--primary);

    font-style: normal;
}


/* описание */

.hero-card p {
    margin: 10px 0 17px;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.45;
}


/* =========================================================
   КНОПКИ HERO
   ========================================================= */

.hero-actions {
    display: flex;
    gap: 8px;
}

.hero-primary,
.hero-secondary {
    min-height: 42px;

    border: 0;
    border-radius: 14px;

    padding: 0 15px;

    font-size: 13px;
    font-weight: 800;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.hero-primary {
    flex: 1;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    color: white;

    box-shadow:
        0 8px 20px rgba(75,91,205,.25);
}

.hero-primary:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 26px rgba(75,91,205,.32);
}

.hero-primary:active,
.hero-secondary:active {
    transform: scale(.96);
}

.hero-primary span {
    margin-left: 5px;
}

.hero-secondary {
    background: var(--primary-soft);

    color: var(--primary);

    white-space: nowrap;
}

.hero-secondary:hover {
    background: var(--primary);
    color: white;
}


/* =========================================================
   ПЛАВАЮЩИЕ КНОПКИ СПРАВА
   ========================================================= */

.floating-actions {
    position: fixed;

    z-index: 40;

    right: 22px;
    bottom: 125px;

    display: flex;
    flex-direction: column;

    gap: 8px;
}

.map-action {
    min-width: 82px;
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 13px;

    border: 1px solid var(--line);
    border-radius: 16px;

    background: var(--surface);

    color: var(--text);

    box-shadow: var(--shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    font-size: 12px;
    font-weight: 750;

    transition:
        transform .18s ease,
        background .18s ease,
        color .18s ease;
}

.map-action:hover {
    transform: translateY(-2px);

    background: var(--primary);

    color: white;
}

.map-action:active {
    transform: scale(.94);
}

.map-action b {
    font-size: 17px;
}


/* =========================================================
   НИЖНЯЯ НАВИГАЦИЯ
   ========================================================= */

.bottom-nav {
    position: fixed;

    z-index: 60;

    left: 50%;
    bottom: 13px;

    transform: translateX(-50%);

    width: min(620px, calc(100vw - 32px));

    min-height: var(--nav-height);

    display: flex;
    align-items: center;

    padding: 6px;

    border: 1px solid var(--line);
    border-radius: 25px;

    background: var(--surface);

    box-shadow: var(--shadow-lg);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    animation: navIn .5s .15s ease both;
}

.bottom-nav button {
    position: relative;

    flex: 1;

    min-width: 0;
    height: 62px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3px;

    border: 0;
    border-radius: 18px;

    background: transparent;

    color: var(--muted);

    transition:
        transform .18s ease,
        background .18s ease,
        color .18s ease;
}

.bottom-nav button:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.bottom-nav button:active {
    transform: scale(.92);
}

.bottom-nav button span {
    font-size: 20px;

    line-height: 1;
}

.bottom-nav button small {
    font-size: 10px;
    font-weight: 700;
}

.bottom-nav button.active {
    background: var(--primary-soft);

    color: var(--primary);
}

.bottom-nav .create-btn {
    position: relative;
}

.bottom-nav .create-btn span {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: -10px;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--purple)
        );

    color: white;

    font-size: 27px;

    box-shadow:
        0 8px 22px rgba(85,77,210,.35);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.bottom-nav .create-btn:hover span {
    transform: translateY(-3px) scale(1.04);

    box-shadow:
        0 12px 28px rgba(85,77,210,.42);
}


/* =========================================================
   SHEET — СПИСОК ЗАДАНИЙ
   ========================================================= */

.sheet {
    position: fixed;

    z-index: 45;

    left: 22px;
    bottom: 105px;

    width: 440px;
    max-width: calc(100vw - 44px);

    max-height: calc(100vh - 190px);

    overflow-y: auto;

    padding: 18px;

    border: 1px solid var(--line);
    border-radius: 24px;

    background: var(--surface);

    box-shadow: var(--shadow-lg);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    animation: sheetIn .3s ease both;
}

.sheet::-webkit-scrollbar {
    width: 5px;
}

.sheet::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background: var(--line);
}

.sheet h2 {
    margin: 0 0 5px;

    color: var(--text-strong);

    font-size: 22px;

    letter-spacing: -.5px;
}

.sheet-note {
    margin-bottom: 13px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   КАРТОЧКА ЗАДАНИЯ
   ========================================================= */

.job-card,
.card {
    position: relative;

    padding: 15px;

    margin: 9px 0;

    border: 1px solid var(--line);
    border-radius: 18px;

    background: var(--surface-solid);

    box-shadow:
        0 4px 15px rgba(28,39,65,.06);

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.job-card:hover {
    transform: translateY(-2px);

    border-color:
        rgba(89,104,217,.22);

    box-shadow:
        0 10px 25px rgba(28,39,65,.11);
}

.job-card:active {
    transform: scale(.985);
}

.job-line {
    display: flex;
    align-items: flex-start;

    gap: 10px;
}

.job-title {
    flex: 1;

    color: var(--text-strong);

    font-size: 15px;
    font-weight: 800;

    line-height: 1.25;
}

.price {
    flex: 0 0 auto;

    padding: 6px 9px;

    border-radius: 10px;

    background: var(--success-soft);

    color: var(--success);

    font-size: 13px;
    font-weight: 900;

    white-space: nowrap;
}

.muted {
    color: var(--muted);
}

.chips {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;

    margin-top: 10px;
}

.chip {
    max-width: 100%;

    padding: 5px 8px;

    border-radius: 9px;

    background: var(--surface-soft);

    color: var(--muted);

    font-size: 10px;
    font-weight: 700;
}


/* =========================================================
   МОДАЛЬНЫЕ ОКНА
   ========================================================= */

.modal#userprof {
    z-index: 320;
}

.modal {
    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(12,16,26,.58);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    animation: fadeIn .2s ease both;
}

.modalbox {
    width: min(600px, 100%);

    max-height: 92vh;

    overflow-y: auto;

    padding: 23px;

    border: 1px solid var(--line);
    border-radius: 25px;

    background: var(--surface-solid);

    color: var(--text);

    box-shadow: var(--shadow-lg);

    animation: modalIn .3s cubic-bezier(.2,.8,.2,1) both;
}

.modalbox h2 {
    margin: 0 0 18px;

    color: var(--text-strong);

    font-size: 24px;

    letter-spacing: -.6px;
}

.modalhead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 17px;
}

.eyebrow {
    margin-bottom: 4px;

    color: var(--primary);

    font-size: 10px;
    font-weight: 900;

    letter-spacing: 1.1px;
}

.modalhead h2 {
    margin: 0;
}


/* =========================================================
   КНОПКА ЗАКРЫТИЯ
   ========================================================= */

.close {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 12px;

    background: var(--surface-soft);

    color: var(--muted);

    font-size: 23px;

    transition:
        transform .18s ease,
        background .18s ease,
        color .18s ease;
}

.close:hover {
    background: var(--danger);

    color: white;
}

.close:active {
    transform: scale(.9);
}


/* =========================================================
   ПОЛЯ
   ========================================================= */

label {
    display: block;

    margin-bottom: 13px;

    color: var(--text);

    font-size: 12px;
    font-weight: 700;
}

.field {
    width: 100%;

    min-height: 46px;

    margin-top: 6px;

    padding: 11px 13px;

    border: 1px solid var(--line);
    border-radius: 13px;

    outline: 0;

    background: var(--surface-solid);

    color: var(--text);

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.field:hover {
    border-color:
        rgba(89,104,217,.25);
}

.field:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(89,104,217,.10);
}

textarea.field {
    min-height: 105px;

    resize: vertical;
}

select.field {
    appearance: auto;
}


/* =========================================================
   ДВЕ КОЛОНКИ
   ========================================================= */

.two-col,
.row {
    display: flex;

    gap: 10px;
}

.two-col > *,
.row > * {
    min-width: 0;
    flex: 1;
}


/* =========================================================
   КНОПКИ
   ========================================================= */

.primary,
.secondary,
.ghost {
    width: 100%;

    min-height: 46px;

    border-radius: 14px;

    padding: 0 15px;

    font-weight: 800;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.primary {
    border: 0;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    color: white;

    box-shadow:
        0 7px 18px rgba(75,91,205,.23);
}

.primary:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 24px rgba(75,91,205,.30);
}

.secondary {
    border: 0;

    background: var(--primary-soft);

    color: var(--primary);
}

.secondary:hover {
    background: var(--primary);

    color: white;
}

.ghost {
    border: 1px solid var(--line);

    background: transparent;

    color: var(--muted);
}

.ghost:hover {
    background: var(--surface-soft);

    color: var(--text);
}

.primary:active,
.secondary:active,
.ghost:active {
    transform: scale(.97);
}


/* =========================================================
   ЛОКАЦИЯ
   ========================================================= */

.location-card {
    margin: 13px 0;

    padding: 14px;

    border: 1px solid var(--line);
    border-radius: 18px;

    background: var(--surface-soft);
}

.location-title {
    display: flex;
    align-items: center;

    gap: 11px;

    margin-bottom: 11px;
}

.location-title b {
    display: block;

    color: var(--text-strong);

    font-size: 13px;
}

.location-title small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}

.location-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 38px;

    border-radius: 12px;

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 18px;
}


/* =========================================================
   ДЕТАЛИ ЗАДАНИЯ
   ========================================================= */

.profile-hero {
    display: flex;
    align-items: center;

    gap: 11px;

    margin-bottom: 13px;

    padding: 12px;

    border-radius: 17px;

    background: var(--surface-soft);
}

.avatar {
    width: 45px;
    height: 45px;

    flex: 0 0 45px;

    border-radius: 14px;

    object-fit: cover;
}


/* =========================================================
   ВЫБОР ТОЧКИ
   ========================================================= */

.picker {
    position: fixed;

    inset: 0;

    z-index: 200;

    background: var(--bg);
}

#pm {
    position: absolute;

    inset: 0;

    z-index: 1;
}

.picker-top {
    position: absolute;

    z-index: 5;

    top: 12px;
    left: 14px;
    right: 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-top: env(safe-area-inset-top);
}

.picker-title {
    padding: 11px 17px;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: var(--surface);

    color: var(--text-strong);

    box-shadow: var(--shadow-sm);

    font-weight: 800;

    backdrop-filter: blur(18px);
}

.picker-hint {
    position: absolute;

    z-index: 5;

    top: 82px;
    left: 50%;

    transform: translateX(-50%);

    max-width: calc(100vw - 30px);

    padding: 10px 15px;

    border-radius: 14px;

    background: var(--surface);

    color: var(--text);

    border: 1px solid var(--line);

    box-shadow: var(--shadow-sm);

    font-size: 12px;
    font-weight: 700;

    text-align: center;

    backdrop-filter: blur(18px);
}

.picker-actions {
    position: absolute;

    z-index: 5;

    left: 50%;
    bottom: calc(13px + env(safe-area-inset-bottom));

    transform: translateX(-50%);

    width: min(520px, calc(100vw - 28px));

    padding: 13px;

    border: 1px solid var(--line);
    border-radius: 21px;

    background: var(--surface);

    box-shadow: var(--shadow-lg);

    backdrop-filter: blur(20px);
}

#pa {
    margin-bottom: 10px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 700;

    text-align: center;
}


/* =========================================================
   TOAST
   ========================================================= */

.toast {
    position: fixed;

    z-index: 500;

    left: 50%;
    bottom: 105px;

    transform:
        translate(-50%, 15px);

    max-width: calc(100vw - 30px);

    padding: 12px 17px;

    border-radius: 14px;

    background: var(--text-strong);

    color: white;

    box-shadow: var(--shadow);

    opacity: 0;
    pointer-events: none;

    font-size: 12px;
    font-weight: 700;

    transition:
        opacity .25s ease,
        transform .25s ease;
}

.toast.show {
    opacity: 1;

    transform:
        translate(-50%, 0);
}


/* =========================================================
   СКРЫТЫЕ ЭЛЕМЕНТЫ
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   SAFE AREA
   ========================================================= */

.safe-top {
    padding-top:
        max(12px, env(safe-area-inset-top));
}

.safe-bottom {
    padding-bottom:
        max(6px, env(safe-area-inset-bottom));
}


/* =========================================================
   АНИМАЦИИ
   ========================================================= */

@keyframes topbarIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform:
            translateY(18px)
            scale(.98);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes navIn {
    from {
        opacity: 0;
        transform:
            translate(-50%, 18px);
    }

    to {
        opacity: 1;
        transform:
            translate(-50%, 0);
    }
}

@keyframes sheetIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform:
            translateY(22px)
            scale(.98);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%,
    100% {
        box-shadow:
            0 0 0 4px var(--success-soft);
    }

    50% {
        box-shadow:
            0 0 0 8px rgba(73,168,117,.03);
    }
}



/* =========================================================
   MOBILE FIX v2 — ЛОВИ
   Цель: карта, zoom и плавающие кнопки никогда не перекрывают
   нижнюю навигацию и верхнюю панель.
   ========================================================= */

@media (max-width: 650px) {
    :root {
        --mobile-nav-h: 70px;
        --mobile-side: 10px;
        --mobile-bottom-gap: 10px;
    }

    html, body {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        touch-action: manipulation;
    }

    #map {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 1;
    }

    /* ---------- TOP ---------- */
    .topbar {
        top: max(6px, env(safe-area-inset-top));
        left: var(--mobile-side);
        right: var(--mobile-side);
        width: auto;
        gap: 6px;
        padding-top: 0;
        z-index: 80;
    }

    .brand {
        width: 46px;
        height: 46px;
        min-width: 46px;
        padding: 0;
        justify-content: center;
        border-radius: 14px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .brand-name {
        display: none;
    }

    .searchbox {
        height: 46px;
        min-width: 0;
        width: auto;
        max-width: none;
        border-radius: 14px;
    }

    .search-icon {
        margin-left: 10px;
        font-size: 18px;
    }

    .searchbox input {
        min-width: 0;
        width: 100%;
        font-size: 14px;
        padding: 0 7px;
    }

    .searchbox button {
        height: 36px;
        margin-right: 4px;
        padding: 0 10px;
        border-radius: 11px;
        font-size: 12px;
    }

    .round-btn {
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
        border-radius: 14px;
        font-size: 19px;
    }

    /* ---------- HERO ---------- */
    .hero-card {
        top: calc(62px + env(safe-area-inset-top));
        left: var(--mobile-side);
        right: var(--mobile-side);
        width: auto;
        max-width: none;
        padding: 16px;
        border-radius: 19px;
        z-index: 30;
    }

    .hero-card h1 {
        font-size: clamp(23px, 7vw, 27px);
        line-height: 1.08;
    }

    .hero-card p {
        font-size: 12px;
        line-height: 1.4;
        margin: 7px 0 11px;
    }

    .hero-actions {
        width: 100%;
        gap: 7px;
    }

    .hero-primary,
    .hero-secondary {
        min-width: 0;
        min-height: 42px;
        padding: 0 10px;
        font-size: 12px;
    }

    /* ---------- MAP FLOATING ACTIONS ----------
       Слева/справа от zoom ничего не должно пересекаться.
       На телефоне кнопки становятся компактными.
    */
    .floating-actions {
        right: max(10px, env(safe-area-inset-right));
        bottom: calc(
            var(--mobile-nav-h) +
            var(--mobile-bottom-gap) +
            env(safe-area-inset-bottom) +
            12px
        );
        z-index: 70;
        gap: 7px;
    }

    .map-action {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 13px;
    }

    .map-action span {
        display: none;
    }

    .map-action b {
        font-size: 16px;
    }

    /* ---------- BOTTOM NAV ----------
       Фиксированная высота + safe-area, без переполнения.
    */
    .bottom-nav {
        position: fixed;
        left: var(--mobile-side);
        right: var(--mobile-side);
        bottom: max(7px, env(safe-area-inset-bottom));
        transform: none;
        width: auto;
        max-width: none;
        min-height: var(--mobile-nav-h);
        height: var(--mobile-nav-h);
        padding: 5px;
        border-radius: 20px;
        z-index: 100;
    }

    .bottom-nav button {
        min-width: 0;
        width: 20%;
        height: 58px;
        padding: 2px 1px;
        border-radius: 15px;
        gap: 2px;
    }

    .bottom-nav button span {
        font-size: 18px;
        line-height: 20px;
    }

    .bottom-nav button small {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 8px;
    }

    .bottom-nav .create-btn span {
        width: 42px;
        height: 42px;
        margin-top: -7px;
        font-size: 24px;
        border-radius: 14px;
    }

    /* ---------- SHEET ----------
       Всегда выше nav, но ниже modal.
    */
    .sheet {
        left: var(--mobile-side);
        right: var(--mobile-side);
        bottom: calc(
            var(--mobile-nav-h) +
            12px +
            env(safe-area-inset-bottom)
        );
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 150px);
        padding: 13px;
        border-radius: 20px;
        z-index: 90;
    }

    /* ---------- MODALS ----------
       Полноценная ширина, никаких горизонтальных overflow.
    */
    .modal {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
        z-index: 200;
    }

    .modalbox {
        width: 100%;
        max-width: 100%;
        max-height: 94dvh;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 18px 15px calc(18px + env(safe-area-inset-bottom));
        border-radius: 23px 23px 0 0;
    }

    .modalhead {
        gap: 10px;
    }

    .modalbox h2 {
        font-size: 21px;
    }

    .two-col,
    .row {
        flex-direction: column;
        gap: 0;
    }

    .field {
        max-width: 100%;
        font-size: 16px; /* iOS не будет увеличивать страницу */
    }

    textarea.field {
        min-height: 95px;
    }

    /* ---------- PICKER ---------- */
    .picker {
        width: 100vw;
        height: 100dvh;
        z-index: 300;
    }

    .picker-top {
        top: max(7px, env(safe-area-inset-top));
        left: 10px;
        right: 10px;
        padding-top: 0;
    }

    .picker-title {
        max-width: calc(100vw - 70px);
        padding: 9px 13px;
        font-size: 13px;
    }

    .picker-hint {
        top: calc(67px + env(safe-area-inset-top));
        max-width: calc(100vw - 24px);
        padding: 9px 12px;
        font-size: 11px;
    }

    .picker-actions {
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        transform: none;
        width: auto;
        max-width: none;
        padding: 11px;
        border-radius: 18px;
        z-index: 310;
    }

    /* ---------- TOAST ---------- */
    .toast {
        left: 10px;
        right: 10px;
        bottom: calc(
            var(--mobile-nav-h) +
            14px +
            env(safe-area-inset-bottom)
        );
        max-width: none;
        text-align: center;
        transform: translateY(15px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Очень узкие Android/iPhone */
@media (max-width: 380px) {
    .topbar {
        gap: 4px;
    }

    .brand,
    .round-btn {
        width: 43px;
        min-width: 43px;
        flex-basis: 43px;
        height: 43px;
    }

    .searchbox {
        height: 43px;
    }

    .searchbox button {
        padding: 0 7px;
        font-size: 11px;
    }

    .hero-card {
        top: calc(58px + env(safe-area-inset-top));
        padding: 14px;
    }

    .hero-card h1 {
        font-size: 22px;
    }

    .hero-primary,
    .hero-secondary {
        min-height: 40px;
        font-size: 11px;
    }

    .bottom-nav {
        left: 6px;
        right: 6px;
        min-height: 67px;
        height: 67px;
    }

    .bottom-nav button {
        height: 57px;
    }

    .bottom-nav button span {
        font-size: 17px;
    }

    .bottom-nav button small {
        font-size: 7px;
    }

    .bottom-nav .create-btn span {
        width: 39px;
        height: 39px;
        font-size: 22px;
    }

    .floating-actions {
        right: 8px;
    }

    .map-action {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        height: 40px;
        min-height: 40px;
    }
}

/* Ландшафт телефона */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-card {
        top: calc(54px + env(safe-area-inset-top));
        width: 330px;
        max-height: calc(100dvh - 70px);
        overflow-y: auto;
        padding: 13px;
    }

    .hero-card h1 {
        font-size: 21px;
    }

    .hero-card p {
        margin: 4px 0 7px;
    }

    .bottom-nav {
        min-height: 56px;
        height: 56px;
    }

    .bottom-nav button {
        height: 46px;
    }

    .bottom-nav .create-btn span {
        width: 36px;
        height: 36px;
    }

    .floating-actions {
        bottom: calc(68px + env(safe-area-inset-bottom));
    }

}

/* =========================================================
   ПРЕДПОЧТЕНИЕ: МЕНЬШЕ АНИМАЦИИ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

.job-offer-banner{position:fixed;z-index:9999;left:50%;top:calc(12px + env(safe-area-inset-top));transform:translateX(-50%);width:min(460px,calc(100vw - 24px));padding:14px 16px;border-radius:18px;background:#fff;box-shadow:0 12px 40px rgba(0,0,0,.22);border:1px solid rgba(82,100,199,.18)}
.job-offer-banner-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.job-offer-banner-title{font-size:18px;font-weight:800;margin:8px 0 4px}.job-offer-banner.hidden{display:none}
.order-tabs{display:flex;gap:7px;margin:12px 0 16px;overflow-x:auto}.order-tabs button{border:1px solid rgba(82,100,199,.18);background:#fff;border-radius:12px;padding:9px 12px;white-space:nowrap;cursor:pointer}.order-tabs button.active{background:#5264C7;color:#fff;border-color:#5264C7}.order-tabs+ #myOrderList{padding-bottom:20px}


/* =========================================================
   ВНУТРЕННИЕ РАЗДЕЛЫ ПРИЛОЖЕНИЯ — БЕЗ СМЕНЫ URL
   ========================================================= */
.app-section-sheet{
  width:min(720px,calc(100vw - 44px));
  max-height:calc(100vh - 150px);
}
.app-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px}
.app-section-head h2{font-size:28px;margin:2px 0 4px}
.orders-section-nav{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0 18px}
.orders-section-tab{display:flex;align-items:center;gap:9px;text-align:left;padding:12px 10px;border:1px solid var(--line);border-radius:16px;background:var(--surface-solid);color:var(--text);cursor:pointer;transition:.18s ease}
.orders-section-tab:hover{transform:translateY(-1px);border-color:rgba(82,100,199,.35)}
.orders-section-tab.active{background:var(--primary-soft);border-color:var(--primary);color:var(--primary)}
.orders-section-tab b{display:block;font-size:13px}.orders-section-tab small{display:block;margin-top:3px;color:var(--muted);font-size:10px}.orders-section-tab.active small{color:inherit;opacity:.75}
.orders-section-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:var(--bg);font-weight:900;flex:0 0 30px}.orders-section-tab.active .orders-section-icon{background:var(--primary);color:#fff}
.orders-empty{padding:42px 18px;text-align:center;border:1px dashed var(--line);border-radius:20px;margin-top:8px}.orders-empty-icon{width:48px;height:48px;margin:0 auto 10px;display:grid;place-items:center;border-radius:16px;background:var(--primary-soft);color:var(--primary);font-size:22px}.orders-empty h3{margin:0 0 6px}.orders-empty p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}
@media (max-width:700px){.app-section-sheet{left:10px;bottom:78px;width:calc(100vw - 20px);max-width:none;max-height:calc(100vh - 100px);border-radius:22px}.orders-section-nav{grid-template-columns:1fr}.orders-section-tab{min-height:58px}}


/* =========================================================
   PROFILE / AVAILABILITY
   ========================================================= */
.profile-hero-modern { padding: 16px; }
.avatar-placeholder { display:flex; align-items:center; justify-content:center; background:var(--primary-soft); color:var(--primary); font-weight:900; }
.profile-main-info { min-width:0; }
.profile-main-info > b { display:block; font-size:18px; margin-bottom:3px; }
.profile-status { display:inline-flex; align-items:center; gap:6px; margin-top:7px; font-size:12px; font-weight:800; color:var(--muted); }
.profile-status i { width:7px; height:7px; border-radius:50%; background:var(--muted); display:block; }
.profile-status.online { color:var(--success); }
.profile-status.online i { background:var(--success); box-shadow:0 0 0 4px var(--success-soft); }
.profile-online-card { margin:12px 0; padding:15px; border:1px solid var(--line); border-radius:20px; background:var(--surface); display:flex; align-items:center; justify-content:space-between; gap:12px; box-shadow:var(--shadow-sm); }
.profile-online-card.is-online { border-color:rgba(73,168,117,.25); }
.online-copy { min-width:0; }
.online-title { font-weight:900; margin-bottom:4px; }
.online-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--muted); margin-right:7px; }
.is-online .online-dot { background:var(--success); box-shadow:0 0 0 5px var(--success-soft); }
.online-switch { width:58px; height:34px; flex:0 0 58px; padding:3px; border:0; border-radius:99px; background:var(--line); position:relative; transition:.2s; }
.online-switch span { display:block; width:28px; height:28px; border-radius:50%; background:var(--surface-solid); box-shadow:0 2px 7px rgba(0,0,0,.18); transition:.2s; }
.online-switch.on { background:var(--success); }
.online-switch.on span { transform:translateX(24px); }
.profile-section-title { margin:18px 3px 8px; font-size:11px; font-weight:900; letter-spacing:.8px; text-transform:uppercase; color:var(--muted); }
.profile-settings-card { overflow:hidden; border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:var(--shadow-sm); }
.profile-setting-row { width:100%; min-height:64px; display:flex; align-items:center; gap:11px; padding:11px 13px; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--text); text-align:left; }
.profile-setting-row:last-child { border-bottom:0; }
.profile-setting-row:not(.static-row):active { background:var(--surface-soft); }
.setting-icon { width:34px; height:34px; display:flex; align-items:center; justify-content:center; flex:0 0 34px; border-radius:11px; background:var(--surface-soft); }
.setting-copy { min-width:0; flex:1; }
.setting-copy b { display:block; font-size:14px; }
.setting-copy small { display:block; margin-top:3px; color:var(--muted); font-size:11px; line-height:1.3; }
.setting-arrow { color:var(--muted); font-size:24px; line-height:1; }
.setting-badge { padding:5px 8px; border-radius:9px; background:var(--surface-soft); color:var(--muted); font-size:9px; font-weight:900; }
.setting-badge.ok { background:var(--success-soft); color:var(--success); }
.logout-button { width:100%; min-height:48px; border:1px solid rgba(216,95,105,.22); border-radius:15px; background:var(--surface); color:var(--danger); font-weight:800; margin-bottom:12px; }

/* Theme switch: sun / moon */
.theme-setting-row { cursor: default; }
.theme-switch {
  position: relative;
  width: 78px;
  height: 38px;
  flex: 0 0 78px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
  cursor: pointer;
  outline: none;
  transition: background .2s ease, border-color .2s ease;
}
.theme-switch:focus-visible { box-shadow: 0 0 0 3px var(--primarySoft); }
.theme-switch .theme-icon {
  position: absolute;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  width: 24px;
  text-align: center;
  font-size: 17px;
  line-height: 1;
  pointer-events: none;
  transition: opacity .2s ease;
}
.theme-sun { left: 7px; opacity: 1; }
.theme-moon { right: 7px; opacity: .42; }
.theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-solid);
  box-shadow: 0 2px 7px rgba(0,0,0,.22);
  transition: transform .22s ease;
}
.theme-switch.on .theme-thumb { transform: translateX(40px); }
.theme-switch.on .theme-sun { opacity: .42; }
.theme-switch.on .theme-moon { opacity: 1; }


.profile-link-row{width:100%;display:flex;justify-content:space-between;align-items:center;padding:7px 9px;border:0;border-radius:10px;background:var(--surface-soft);color:var(--text);text-align:left;cursor:pointer}
.profile-inline-link{display:inline-flex;align-items:center;gap:7px;padding:0;border:0;background:transparent;color:var(--text);cursor:pointer;font:inherit;text-align:left}
.profile-inline-link span{color:var(--muted)}
.review-card{padding:12px 0;border-bottom:1px solid var(--line)}
.review-card:last-child{border-bottom:0}


/* =========================================================
   ОТДЕЛЬНЫЕ СТРАНИЦЫ РАЗДЕЛОВ
   ========================================================= */
body[class*="route-"] #map { display:none; }
body.route-map #map { display:block; }
body[class*="route-"] .hero-card,
body[class*="route-"] .floating-actions,
body[class*="route-"] #map-hint { display:none; }
body[class*="route-"] .topbar .searchbox,
body[class*="route-"] .topbar .round-btn { display:none; }
body.route-map .topbar .searchbox,
body.route-map .topbar .round-btn { display:flex; }
body[class*="route-"] #sheet:not(.hidden) {
    left:0; right:0; top:0; bottom:0;
    width:auto; max-width:none; max-height:none;
    box-sizing:border-box;
    padding:86px 22px 105px;
    border:0; border-radius:0;
    box-shadow:none;
    backdrop-filter:none; -webkit-backdrop-filter:none;
    overflow-y:auto;
    z-index:45;
}
body.route-create #createM {
    display:flex;
    z-index:45;
    background:var(--bg);
    padding:82px 22px 105px;
    align-items:flex-start;
    justify-content:center;
    overflow-y:auto;
}
body.route-create #createM .modalbox {
    width:min(760px,100%); max-height:none; margin:0 auto;
    box-shadow:none; border-radius:24px;
}
body.route-create #createM .close { display:none; }
body.route-profile #prof {
    display:flex; z-index:45; background:var(--bg);
    padding:82px 22px 105px; align-items:flex-start;
    overflow-y:auto;
}
body.route-profile #prof .modalbox {
    width:min(760px,100%); max-height:none; margin:0 auto; box-shadow:none;
}
body.route-profile #prof .close { display:none; }
body.route-orders .app-section-head,
body.route-favorites .sheet > *:first-child { max-width:760px; margin-left:auto; margin-right:auto; }
@media (max-width:700px) {
  body[class*="route-"] #sheet:not(.hidden),
  body.route-create #createM, body.route-profile #prof { padding-left:14px; padding-right:14px; }
}

/* =========================================================
   NATIVE DIALOG REPLACEMENT — ЛОВИ UI
   ========================================================= */
body.dialog-open { overflow: hidden; }
.app-dialog { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:20px; }
.app-dialog.hidden { display:none; }
.app-dialog-backdrop { position:absolute; inset:0; background:rgba(8,12,22,.66); backdrop-filter:blur(9px); -webkit-backdrop-filter:blur(9px); animation:fadeIn .18s ease both; }
.app-dialog-card { position:relative; z-index:1; width:min(520px,100%); max-height:min(88vh,760px); overflow:auto; padding:26px; border:1px solid var(--line); border-radius:26px; background:var(--surface-solid); color:var(--text); box-shadow:0 24px 70px rgba(0,0,0,.38); animation:modalIn .24s cubic-bezier(.2,.8,.2,1) both; }
.app-dialog-close { position:absolute; top:15px; right:15px; width:38px; height:38px; min-height:38px; padding:0; border-radius:12px; font-size:24px; line-height:1; }
.app-dialog-icon { width:54px; height:54px; display:flex; align-items:center; justify-content:center; margin:0 auto 12px; border-radius:17px; background:linear-gradient(135deg,var(--primary),var(--purple)); color:#fff; font-size:25px; font-weight:900; box-shadow:0 10px 28px rgba(85,77,210,.3); }
.app-dialog-eyebrow { text-align:center; margin-bottom:5px; color:var(--primary); font-size:10px; font-weight:900; letter-spacing:1px; text-transform:uppercase; }
.app-dialog-card h2 { margin:0 45px 8px; text-align:center; color:var(--text-strong); font-size:24px; letter-spacing:-.5px; }
.app-dialog-message { margin:0 auto 18px; max-width:440px; text-align:center; color:var(--muted); font-size:13px; line-height:1.5; }
.app-dialog-label { display:block; margin:0 0 7px; color:var(--text-strong); font-size:12px; font-weight:800; }
.app-dialog-label span { color:var(--muted); font-weight:600; }
.app-dialog-input { width:100%; min-height:48px; box-sizing:border-box; padding:12px 14px; border:1px solid var(--line); border-radius:14px; outline:none; background:var(--surface); color:var(--text); font:inherit; font-size:14px; transition:border-color .18s ease, box-shadow .18s ease; }
.app-dialog-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primarySoft); }
.app-dialog-textarea { min-height:118px; resize:vertical; }
.app-dialog-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:20px; }
.app-dialog-actions button { min-height:50px; }
.app-dialog-actions .danger { background:var(--danger); border-color:var(--danger); color:#fff; }
.app-rating { display:flex; justify-content:center; gap:8px; margin:5px 0 3px; }
.app-star { width:48px; height:48px; padding:0; border:0; border-radius:14px; background:var(--surface-soft); color:var(--muted); font-size:29px; line-height:1; cursor:pointer; transition:transform .16s ease,color .16s ease,background .16s ease; }
.app-star:hover { transform:translateY(-2px); }
.app-star.active { color:#ffbd2e; background:rgba(255,189,46,.11); }
.app-rating-caption { min-height:20px; margin-bottom:16px; text-align:center; color:var(--muted); font-size:11px; font-weight:700; }
@media (max-width:700px) {
  .app-dialog { padding:14px; align-items:flex-end; }
  .app-dialog-card { width:100%; max-height:88vh; padding:22px 17px 17px; border-radius:24px; }
  .app-dialog-card h2 { font-size:21px; margin-left:35px; margin-right:35px; }
  .app-rating { gap:5px; }
  .app-star { width:44px; height:44px; font-size:27px; }
}


/* LOVI v5 — high-visibility error notifications */
.toast.error {
  background: #ff3b30 !important;
  color: #080808 !important;
  border: 2px solid #080808;
  box-shadow: 0 12px 34px rgba(0,0,0,.34), 0 0 0 2px rgba(255,59,48,.25);
  font-weight: 900;
}
.toast.success {
  background: var(--text-strong, #17181c);
  color: #fff;
}
