/* ==========================================================================
   Сосед МП — дизайн-система, платформа. Направление 2 (consumer-уровень Airbnb).
   Утверждено 11.09.2026 по канвасу «Сосед МП — карта». Токены и решения —
   docs/design-system.md. Классы-контракт с map.html (65 имён) не переименовываются.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap');

:root {
    /* поверхности */
    --canvas: #f7f7f7;        /* фон панели и страницы — «бумага под всем» */
    --surface: #ffffff;       /* карточки, шапка, модалка */
    --line: #ebebeb;          /* разделители */
    --line-2: #dddddd;        /* обводки контролов и нейтральных бейджей */
    --placeholder: #dddddd;   /* скелетоны */
    --loader: #b0b0b0;

    /* текст */
    --text: #222222;
    --text-2: #6a6a6a;
    --text-3: #b0b0b0;

    /* акцент — один, редкий: знак, кнопка поиска, активная метка, выбранная карточка, одна кнопка */
    --accent: #0f7b4f;
    --accent-hover: #0b613e;
    --accent-soft: #e9f3ee;

    /* цвета площадок — единственная хрома в карточках; акцент с ними не спорит */
    --wb: #cb11ab;
    --ozon: #005bff;
    --ym: #ffcc00;

    /* семантика */
    --danger: #c22b10;
    --danger-soft: #fdeeea;

    /* тени: только у плавающих поверхностей */
    --shadow-float: rgba(0,0,0,0.02) 0 0 0 1px, rgba(0,0,0,0.04) 0 2px 6px 0, rgba(0,0,0,0.10) 0 4px 8px 0;
    --shadow-control: rgba(0,0,0,0.02) 0 0 0 1px, rgba(0,0,0,0.16) 0 2px 4px 0;

    /* радиусы: 6 бейджи · 10 инпуты · 16 карточки · 20 плавающие · 9999 pill */
    --r-badge: 6px;
    --r-input: 10px;
    --r-card: 16px;
    --r-float: 20px;
    --r-pill: 9999px;

    --font: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --panel-w: 440px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    color: var(--text);
    letter-spacing: -0.009em;
    -webkit-font-smoothing: antialiased;
    background: var(--canvas);
}

button, input, textarea { font-family: inherit; letter-spacing: inherit; color: inherit; }
a { color: var(--text); }

.app-layout { position: relative; width: 100%; height: 100%; }

#map { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Управление картой: круглые белые кнопки, как у плавающих поверхностей */
.maplibregl-ctrl-group {
    border-radius: var(--r-pill) !important;
    box-shadow: none !important;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.maplibregl-ctrl-group button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-control) !important;
    border: none !important;
}
.maplibregl-ctrl-group button + button { border-top: none !important; }
.maplibregl-ctrl-bottom-right { right: 12px; bottom: 16px; }

/* ===== Левая колонка ===== */
#panel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--panel-w);
    z-index: 5;
    display: flex;
    flex-direction: column;
    background: var(--canvas);
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px 14px 24px;
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

/* Шапка панели. Ширина фиксирована (440px), а имя пользователя и город —
   переменной длины, поэтому порядок уступок задан явно:
   1) блок «имя + Выйти» либо целиком помещается в первую строку, либо
      целиком переносится на вторую (flex-wrap) — имя не обрезается до
      огрызка; многоточие только у имён длиннее 180px;
   2) город обрезается многоточием при превышении своей max-width;
   3) wordmark и кнопки «Войти»/«Выйти» не сжимаются никогда. */
.panel-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.panel-header-row > div:first-child { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; min-width: 0; max-width: 100%; }

/* Wordmark. Разметка пока держит текст «СОСЕД» — замена на lockup «Сосед МП»
   со знаком и descriptor — правка map.html (handoff Руслану). */
.panel-brand {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
    text-transform: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.panel-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

/* Кнопка входа / имя пользователя */
.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--text);
    border-radius: var(--r-pill);
    background: var(--text);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease;
}
.header-btn:hover { background: #000; border-color: #000; }
.header-btn--logout {
    background: transparent;
    color: var(--text);
    border-color: var(--line-2);
}
.header-btn--logout:hover { background: var(--canvas); border-color: var(--line-2); }
.header-user-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 180px;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Город */
.city-selector { position: relative; display: flex; min-width: 0; max-width: 100%; }
.city-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    min-width: 0;
    max-width: 210px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease;
}
.city-selector-btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.city-selector-btn:hover:not(:disabled) { background: var(--canvas); }
.city-selector-btn:disabled { color: var(--text-2); cursor: default; }
.city-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 20;
    width: 280px;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    background: var(--surface);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-float);
}
.city-dropdown[hidden] { display: none; }
.city-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-input);
    font-size: 14px;
    cursor: pointer;
}
.city-dropdown-item:hover { background: var(--canvas); }
.city-dropdown-item.active { font-weight: 600; background: var(--accent-soft); }
.city-dropdown-item-count { font-size: 12px; color: var(--text-2); }

/* Поиск — плавающая pill с трёхслойной тенью */
.search-wrap { position: relative; }
.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-2);
    pointer-events: none;
}
.search-input {
    width: 100%;
    height: 52px;
    padding: 0 18px 0 46px;
    border: none;
    border-radius: var(--r-pill);
    background: var(--surface);
    box-shadow: var(--shadow-float);
    font-size: 15px;
    outline: none;
    transition: box-shadow .15s ease;
}
.search-input::placeholder { color: var(--text-2); }
.search-input:focus { box-shadow: var(--shadow-float), 0 0 0 2px var(--text); }
.search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
    background: var(--surface);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-float);
}
.search-dropdown[hidden] { display: none; }
.search-section-title {
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
}
.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--r-input);
    cursor: pointer;
}
.search-result-item:hover, .search-result-item.active { background: var(--canvas); }
.search-result-name { font-size: 14px; font-weight: 600; }
.search-result-sub { font-size: 12px; color: var(--text-2); }
.search-no-results { padding: 16px 12px; font-size: 14px; color: var(--text-2); }

/* Фильтры — pill с hairline, активный чёрный */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.filter-chip:hover { background: var(--canvas); }
.filter-chip.active { background: var(--text); border-color: var(--text); color: #fff; }

/* Площадь */
.area-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--text-2);
}
.area-filter-label { font-weight: 500; color: var(--text); }
.area-filter-input {
    width: 84px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-input);
    background: var(--surface);
    font-size: 14px;
    outline: none;
    -moz-appearance: textfield;
}
.area-filter-input::-webkit-outer-spin-button, .area-filter-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.area-filter-input:focus { border-color: var(--text); }
.area-filter-input.invalid { border-color: var(--danger); background: var(--danger-soft); }
.area-filter-dash, .area-filter-unit { color: var(--text-2); }
.area-filter-warning {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--danger);
}
.area-filter-warning[hidden] { display: none; }

/* Сброс — ghost-текст, живёт только когда есть что сбрасывать */
.filters-reset-wrap { display: flex; }
.filters-reset {
    height: 32px;
    padding: 0 4px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.filters-reset:hover:not(:disabled) { color: var(--text); }
.filters-reset:disabled { color: var(--text-3); text-decoration: none; cursor: default; }

/* Счётчик */
.panel-counter-wrap { flex-shrink: 0; }
.panel-counter {
    padding: 16px 4px 6px 8px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ===== Список ===== */
.panel-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 20px 24px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}
.panel-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--r-card);
    background: var(--surface);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.panel-item:hover, .panel-item.hovered { box-shadow: 0 0 0 1px var(--line-2); }
.panel-item.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.panel-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.panel-item-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.panel-item-rating {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.panel-item-address { font-size: 14px; line-height: 1.4; color: var(--text-2); }
.panel-item-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* Бейджи: площадки цветные, схемы работы нейтральные — чтобы акцент оставался один */
.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--r-badge);
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: none;
}
.badge-wb   { background: var(--wb);   border-color: var(--wb);   color: #fff; font-weight: 700; }
.badge-ozon { background: var(--ozon); border-color: var(--ozon); color: #fff; font-weight: 700; }
.badge-ym   { background: var(--ym);   border-color: var(--ym);   color: var(--text); font-weight: 700; }
.badge-fbo, .badge-fbs, .badge-realfbs { background: var(--surface); border-color: var(--line-2); color: var(--text); }

/* Пустые и ошибочные состояния */
.panel-empty {
    padding: 40px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.5;
}
.panel-empty-hint { margin-top: 6px; font-size: 13px; color: var(--text-3); }
.panel-retry-btn {
    margin-top: 14px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.panel-retry-btn:hover { background: var(--canvas); }

/* Скелетон */
.skeleton-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--r-card);
    background: var(--surface);
}
.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--placeholder) 0%, var(--line) 50%, var(--placeholder) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-line--title { width: 60%; height: 16px; }
.skeleton-line--address { width: 85%; }
.skeleton-line--badges { width: 40%; height: 22px; border-radius: var(--r-badge); }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Детальная карточка (заменяет список внутри колонки) ===== */
#detail-card { display: none; flex-direction: column; height: 100%; overflow: hidden; background: var(--canvas); }
#detail-card.visible { display: flex; }
#panel.show-detail .panel-header,
#panel.show-detail .panel-list,
#panel.show-detail .panel-counter-wrap { display: none; }

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 18px 0 8px 24px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    align-self: flex-start;
    flex-shrink: 0;
}
.detail-back:hover { background: var(--canvas); }
.detail-content {
    flex: 1;
    overflow-y: auto;
    margin: 0 20px 20px 24px;
    padding: 20px;
    border-radius: var(--r-float);
    background: var(--surface);
    scrollbar-width: thin;
}
.detail-name { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 6px; }
.detail-address { font-size: 14px; color: var(--text-2); line-height: 1.4; margin-bottom: 12px; }
.detail-external-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
}
.detail-external-rating a { font-weight: 400; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.detail-external-rating a:hover { color: var(--text); }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.detail-section { margin-bottom: 20px; }
.detail-section-title {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
}
.detail-services { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-service-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--canvas);
    font-size: 13px;
    color: var(--text);
}
.detail-service-tag::before { content: none; }
.detail-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-label { color: var(--text-2); }
.detail-contacts { display: flex; flex-direction: column; gap: 8px; }
.detail-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: background .15s ease;
}
.detail-contact-link:hover { background: var(--canvas); text-decoration: none; }
.detail-contacts .detail-contact-link:first-child { background: var(--accent); border-color: var(--accent); color: #fff; }
.detail-contacts .detail-contact-link:first-child:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.detail-meta {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}
.detail-loading { padding: 40px 16px; text-align: center; font-size: 14px; color: var(--text-2); }

/* ===== Отзывы ===== */
.reviews-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.reviews-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.reviews-avg { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.reviews-stars { font-size: 14px; color: var(--text); letter-spacing: 0.05em; }
.reviews-count { font-size: 13px; color: var(--text-2); }
.reviews-empty { font-size: 14px; color: var(--text-2); padding: 8px 0 12px; }
.review-item { padding: 14px 0; border-top: 1px solid var(--line); }
.review-item:first-of-type { border-top: none; }
.review-item-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.review-item-stars { font-size: 13px; letter-spacing: 0.05em; }
.review-item-date { font-size: 12px; color: var(--text-2); }
.review-item-body { font-size: 14px; line-height: 1.5; }
.review-login-prompt { margin-top: 12px; padding: 14px 16px; border-radius: var(--r-card); background: var(--canvas); font-size: 14px; color: var(--text-2); line-height: 1.5; }
.review-login-prompt a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.review-form { margin-top: 16px; padding: 16px; border-radius: var(--r-card); background: var(--canvas); }
.review-form-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.star-selector { display: flex; gap: 4px; margin-bottom: 10px; }
.star-selector .star {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--line-2);
    cursor: pointer;
    transition: color .1s ease, transform .1s ease;
}
.star-selector .star.active { color: var(--text); }
.star-selector .star:hover, .star-selector .star.hover { color: var(--text); transform: scale(1.08); }
.review-textarea {
    width: 100%;
    min-height: 96px;
    padding: 12px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-input);
    background: var(--surface);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}
.review-textarea:focus { border-color: var(--text); }
.review-char-count { margin-top: 6px; font-size: 12px; color: var(--text-3); text-align: right; }
.review-char-count.invalid { color: var(--danger); }
.review-submit-btn {
    margin-top: 10px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.review-submit-btn:hover:not(:disabled) { background: var(--accent-hover); }
.review-submit-btn:disabled { background: var(--line-2); color: var(--text-2); cursor: default; }
.review-success { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-input); background: var(--accent-soft); color: var(--accent-hover); font-size: 14px; }

/* ===== Окно входа ===== */
.auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(34, 34, 34, 0.42);
}
.auth-overlay.visible { display: flex; }
.auth-modal {
    width: 100%;
    max-width: 440px;
    border-radius: var(--r-float);
    background: var(--surface);
    box-shadow: var(--shadow-float);
}
.auth-modal-inner { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.auth-modal h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; padding-right: 40px; }
.auth-modal p { font-size: 14px; line-height: 1.45; color: var(--text-2); margin-top: -8px; }
.auth-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--canvas);
    font-size: 20px;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
}
.auth-close:hover { background: var(--line); }
.auth-form-group { display: flex; flex-direction: column; gap: 6px; }
.auth-form-group label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.auth-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: var(--surface);
    font-size: 15px;
    outline: none;
    transition: border-color .15s ease;
}
.auth-input::placeholder { color: var(--text-3); }
.auth-input:focus { border-color: var(--text); }
.auth-btn {
    width: 100%;
    height: 52px;
    margin-top: 10px;
    border: none;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.auth-btn:hover:not(:disabled) { background: var(--accent-hover); }
.auth-btn:disabled { background: var(--line-2); color: var(--text-2); cursor: default; }
.auth-btn--telegram {
    margin-top: 0;
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--text);
}
.auth-btn--telegram:hover:not(:disabled) { background: var(--canvas); }
.auth-telegram-wrap { display: flex; justify-content: center; }
.auth-telegram-wrap[hidden] { display: none; }
.auth-resend {
    display: inline-block;
    margin-top: 10px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    align-self: center;
}
.auth-resend:hover:not(:disabled) { color: var(--text); }
.auth-resend:disabled { color: var(--text-3); text-decoration: none; cursor: default; }
.auth-error {
    display: none;
    padding: 10px 14px;
    border-radius: var(--r-input);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}
.auth-error.visible { display: block; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-3);
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ===== Карта недоступна ===== */
.map-unavailable {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    max-width: 340px;
    padding: 18px 22px;
    border-radius: var(--r-float);
    background: var(--surface);
    box-shadow: var(--shadow-float);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-2);
    text-align: center;
}
.map-unavailable[hidden] { display: none; }

/* ===== Переключатель «карта ↔ список» — только мобильный ===== */
.view-toggle {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 10;
    height: 48px;
    padding: 0 22px;
    border: none;
    border-radius: var(--r-pill);
    background: var(--text);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-float);
    cursor: pointer;
}

@media (max-width: 767px) {
    :root { --panel-w: 100%; }
    #panel { left: 0; top: 0; bottom: 0; width: 100%; border-right: none; }
    #map { z-index: 0; }
    .view-toggle { display: block; }
    body.view-map #panel { display: none; }
    .panel-header { padding: 14px 16px 12px; }
    .panel-list { padding: 4px 16px 96px; }
    .detail-back { margin-left: 16px; }
    .detail-content { margin: 0 16px 16px; }
    .auth-modal-inner { padding: 22px; }
    .city-selector-btn { min-height: 44px; }
    .city-dropdown { width: 80vw; max-width: 280px; z-index: 30; }
    .search-dropdown { max-height: 60vh; }
    .area-filter-input { width: 72px; }
}

/* Узкий телефон: кнопкам уменьшаем поля, городу — потолок ширины. */
@media (max-width: 480px) {
    .header-btn { padding: 0 12px; }
    .city-selector-btn { padding: 0 10px; max-width: 180px; }
}
