/* ---------- Шрифт лежит в проекте, поэтому сайт работает и без интернета ---------- */
/* Три файла одного шрифта: браузер скачивает только те, где есть нужные буквы */
/* cyrillic-ext содержит таджикские буквы: ғ, ӣ, қ, ӯ, ҳ, ҷ */
@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-cyrillic-ext.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-latin.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Цвета: стекло поверх размытой фотографии и бирюза куполов Самарканда ---------- */

/* Ночная тема: она основная */
:root {
    --bg: #14110e;
    /* полупрозрачные поверхности: сквозь них видно фон */
    --surface: rgba(255, 255, 255, 0.075);
    --surface-2: rgba(255, 255, 255, 0.1);
    /* непрозрачная поверхность для всплывающих окон */
    --solid: #24201c;
    --card-glass: rgba(28, 24, 20, 0.58);
    --text: #f8f4ed;
    --muted: #c6c0b6;
    --line: rgba(255, 255, 255, 0.16);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --ambient-tint: rgba(16, 12, 8, 0.58);
    --accent: #79e0d3;
    --accent-hover: #a2ece2;
    --fill: #79e0d3;
    --fill-hover: #a2ece2;
    --fill-text: #06211e;
    --danger: #ffb0a0;
    --danger-bg: rgba(255, 110, 85, 0.18);
    --ok-bg: rgba(110, 230, 170, 0.18);
    --ok-text: #a9f0cb;
    --wait-bg: rgba(255, 205, 110, 0.18);
    --wait-text: #ffdf9f;
    --off-bg: rgba(255, 255, 255, 0.12);
    --off-text: #c6c0b6;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
    --shadow-big: 0 40px 100px rgba(0, 0, 0, 0.55);
    --night: #14110e;
    color-scheme: dark;

    --header-height: 64px;
    --header-gap: 14px;
    /* сколько места занимает плавающая панель вместе с отступами */
    --header-space: calc(var(--header-height) + var(--header-gap) * 2);
    --rail-space: 84px;
    --radius: 14px;
    --radius-big: 26px;
    --radius-huge: 34px;
    --blur: blur(26px) saturate(1.4);
    --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Дневная тема */
:root[data-theme="light"] {
    --bg: #ece6dc;
    --surface: rgba(255, 255, 255, 0.6);
    --surface-2: rgba(30, 45, 42, 0.07);
    --solid: #fbf8f2;
    --card-glass: rgba(255, 255, 255, 0.76);
    --text: #15201e;
    --muted: #49534f;
    --line: rgba(30, 45, 42, 0.14);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --ambient-tint: rgba(246, 240, 230, 0.68);
    --accent: #0a6a63;
    --accent-hover: #064e49;
    --fill: #0d7a72;
    --fill-hover: #0a6a63;
    --fill-text: #ffffff;
    --danger: #a5301c;
    --danger-bg: rgba(200, 70, 40, 0.13);
    --ok-bg: rgba(30, 150, 95, 0.15);
    --ok-text: #0f5236;
    --wait-bg: rgba(210, 150, 30, 0.2);
    --wait-text: #5f430a;
    --off-bg: rgba(30, 45, 42, 0.09);
    --off-text: #49534f;
    --shadow: 0 18px 50px rgba(60, 50, 35, 0.14);
    --shadow-big: 0 40px 100px rgba(60, 50, 35, 0.26);
    color-scheme: light;
}

/* Размытая фотография на весь экран: два слоя, чтобы снимки плавно сменяли друг друга */
.ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg);
    overflow: hidden;
}

.ambient div {
    position: absolute;
    inset: -60px;
    background-size: cover;
    background-position: center;
    filter: blur(34px) saturate(1.25);
    opacity: 0;
    transition: opacity 1.1s ease;
}

.ambient div.active { opacity: 1; }

.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--ambient-tint);
    transition: background 0.4s;
}

/* Общий вид всех стеклянных блоков */
.site-header,
.side-rail,
.stats > div,
.search-panel,
.orbit-dock,
.explore-row,
.ai-band,
.quote,
.panel,
.filters-box,
.chip,
.tour-card,
.place-link-card,
.book-card,
.trip,
.review,
.fact-grid > div,
.empty,
.profile-link,
.ai-tab,
.chat,
.plan-card,
.credit,
.segments,
.auth-form,
.site-footer {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shine), var(--shadow);
    backdrop-filter: var(--blur);
}

/* ---------- Основа ---------- */

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* прокрутка к элементу не должна прятать его под шапкой */
    scroll-padding-top: calc(var(--header-space) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--fill); color: var(--fill-text); }

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.04;
    margin: 0 0 12px;
    text-wrap: balance;
    letter-spacing: -0.035em;
}

h1 { font-size: clamp(2.5rem, 1.6rem + 3.8vw, 4.8rem); }
h2 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.8rem); }
h3 { font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.02em; }

p { margin: 0 0 12px; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

img { display: block; max-width: 100%; }

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

svg.icon {
    width: 1.2em;
    height: 1.2em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 3px solid var(--fill);
    outline-offset: 2px;
    border-radius: 6px;
}

main:focus { outline: none; }

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 44px);
}

.page {
    flex: 1 0 auto;
    /* шапка плавает сверху, страница начинается ниже неё */
    padding-top: var(--header-space);
    animation: page-in 0.5s var(--ease);
}

@keyframes page-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -80px;
    z-index: 60;
    padding: 8px 14px;
    background: var(--fill);
    color: var(--fill-text);
    border-radius: 8px;
}

.skip-link:focus { top: 8px; }

/* ---------- Кнопки ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 26px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--fill);
    color: var(--fill-text);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s, color 0.25s;
}

.button:hover {
    background: var(--fill-hover);
    color: var(--fill-text);
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(121, 224, 211, 0.34);
}

.button:active { transform: translateY(0); }

.button:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.button.secondary {
    background: var(--surface-2);
    color: var(--text);
}

.button.secondary:hover {
    background: var(--line);
    color: var(--text);
    box-shadow: none;
}

.button.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.button.danger:hover {
    background: var(--danger);
    color: var(--bg);
    box-shadow: none;
}

/* кнопка на тёмной фотографии */
.button.glass {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
    backdrop-filter: blur(12px);
}

.button.glass:hover {
    background: #fff;
    color: #0e211f;
    box-shadow: none;
}

.button.small {
    min-height: 42px;
    padding: 6px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
}

.button.wide { width: 100%; }

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-button:hover { background: rgba(150, 170, 160, 0.2); }

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
}

.text-link svg { transition: transform 0.3s var(--ease); }
.text-link:hover svg { transform: translateX(5px); }

/* ---------- Плавающая панель сверху ---------- */

.site-header {
    position: fixed;
    top: var(--header-gap);
    left: 50%;
    z-index: 40;
    width: min(1240px, calc(100% - var(--header-gap) * 2));
    color: var(--text);
    border-radius: 24px;
    transform: translateX(-50%);
}

.site-header .header-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 14px;
    max-width: none;
    height: var(--header-height);
    padding: 0 12px 0 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-size: 1.14rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-decoration: none;
    white-space: nowrap;
}

.logo:hover { color: inherit; }
.logo svg { width: 30px; height: 30px; flex: none; }

.history-buttons { display: flex; gap: 4px; }

.round-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}

.round-button:hover { background: var(--fill); color: var(--fill-text); transform: scale(1.06); }
.round-button.back svg { transform: rotate(180deg); }

/* Строка поиска в панели: как адресная строка браузера */
.header-search {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 10px;
    width: min(100%, 460px);
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--surface-2);
    transition: box-shadow 0.25s;
}

.header-search:focus-within { box-shadow: 0 0 0 2px var(--fill); }

.header-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 0.92rem;
    font-weight: 500;
}

.header-search input::placeholder { color: var(--muted); opacity: 1; }
.header-search svg { color: var(--muted); }

.header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.lang-select {
    height: 38px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

option { background: var(--solid); color: var(--text); }

.header-login {
    padding: 9px 10px;
    color: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.header-login:hover { color: inherit; text-decoration: underline; }

.header-tools .button.small { border-radius: 999px; }

/* Боковая панель со значками */
.side-rail {
    position: fixed;
    left: var(--header-gap);
    top: 50%;
    z-index: 35;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 7px;
    border-radius: 30px;
    transform: translateY(-50%);
}

.side-rail a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--text);
    text-decoration: none;
    transition: background 0.25s, color 0.25s;
}

.side-rail a:hover { background: var(--surface-2); color: var(--text); }
.side-rail a.active { background: var(--fill); color: var(--fill-text); }
.side-rail svg { width: 21px; height: 21px; }

/* подпись значка появляется при наведении */
.side-rail span {
    position: absolute;
    left: calc(100% + 14px);
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--solid);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateX(-6px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s var(--ease);
}

.side-rail a:hover span,
.side-rail a:focus-visible span { opacity: 1; transform: none; }

/* страницы и подвал не заходят под боковую панель */
.page, .site-footer { margin-left: var(--rail-space); }

/* Меню аккаунта */
.account-menu { position: relative; }

.account-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px 3px 3px;
    border-radius: 999px;
    list-style: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.2s;
}

.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { background: var(--surface-2); }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--fill);
    color: var(--fill-text);
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    flex: none;
}

.avatar.big {
    width: 88px;
    height: 88px;
    font-size: 2.4rem;
}

.account-popup {
    position: absolute;
    right: 0;
    top: calc(100% + 16px);
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--solid);
    color: var(--text);
    box-shadow: var(--shadow-big);
}

.account-popup a,
.account-popup button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: inherit;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.account-popup a:hover,
.account-popup button:hover { background: var(--surface-2); color: inherit; }

.menu-button { display: none; }

/* Мобильное меню */
.mobile-menu { display: none; }

@media (max-width: 1320px) {
    .account-menu summary { padding: 3px; }
    .account-menu summary .account-name { display: none; }
}

/* без боковой панели навигация уходит в меню */
@media (max-width: 1120px) {
    :root { --rail-space: 0px; }
    .side-rail { display: none; }
    .menu-button { display: inline-flex; }
    .header-login, .header-tools .button { display: none; }
    .site-header.menu-open { background: var(--solid); backdrop-filter: none; }

    .site-header.menu-open .mobile-menu {
        display: flex;
        flex-direction: column;
        gap: 4px;
        max-height: calc(100vh - var(--header-space));
        overflow-y: auto;
        padding: 8px 12px 14px;
        border-top: 1px solid var(--line);
    }

    .mobile-menu a {
        padding: 13px 12px;
        border-radius: 12px;
        color: var(--text);
        font-size: 1.12rem;
        font-weight: 600;
        letter-spacing: -0.02em;
        text-decoration: none;
    }

    .mobile-menu a.active { background: var(--surface-2); }
    .mobile-menu .button { margin-top: 8px; color: var(--fill-text); }
}

@media (max-width: 760px) {
    :root { --header-height: 58px; --header-gap: 8px; --radius-huge: 26px; --radius-big: 22px; }
    .site-header { border-radius: 20px; }
    .site-header .header-row { grid-template-columns: minmax(0, 1fr) auto; padding: 0 6px 0 14px; }
    .history-buttons, .header-search { display: none; }
    .header-tools { gap: 2px; }
}

@media (max-width: 400px) {
    .site-header .logo svg { display: none; }
    .header-tools .icon-button { width: 36px; }
}

/* ---------- Главная: места парят вокруг центральной карточки ---------- */

.spatial {
    padding: clamp(10px, 2vh, 22px) 0 10px;
    text-align: center;
    /* боковые карточки не должны давать прокрутку вбок */
    overflow-x: clip;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(20, 17, 14, 0.34);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    backdrop-filter: blur(12px);
}

.spatial .hero-kicker {
    border-color: var(--glass-border);
    background: var(--surface);
    color: var(--text);
}

.spatial h1 {
    margin-bottom: 6px;
    font-size: clamp(2.2rem, 1.3rem + 2.8vw, 3.8rem);
    letter-spacing: -0.045em;
}

.hero-text {
    max-width: 820px;
    margin: 0 auto clamp(12px, 2vh, 22px);
    color: var(--muted);
}

.orbit {
    --card-width: clamp(280px, 29vw, 420px);
    position: relative;
    height: clamp(420px, 57vh, 640px);
    perspective: 1500px;
}

.orbit-card {
    position: absolute;
    left: 50%;
    top: 0;
    width: var(--card-width);
    height: 100%;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-huge);
    background: var(--night);
    box-shadow: var(--glass-shine), var(--shadow-big);
    overflow: hidden;
    isolation: isolate;
    text-align: left;
    cursor: pointer;
    transform: translateX(-50%);
    transition: transform 0.8s var(--ease), opacity 0.5s ease;
}

.orbit-card.current { cursor: default; }

.orbit-expand {
    position: absolute;
    left: 50%;
    top: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(20, 17, 14, 0.42);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    backdrop-filter: blur(14px);
    transform: translateX(-50%);
    transition: background 0.25s;
}

.orbit-expand:hover { background: rgba(20, 17, 14, 0.7); color: #fff; }

.orbit-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: clamp(16px, 1.8vw, 24px) clamp(16px, 1.8vw, 24px) 46px;
    border-top: 1px solid var(--glass-border);
    background: var(--card-glass);
    color: var(--text);
    backdrop-filter: blur(24px) saturate(1.4);
}

.orbit-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.orbit-title h2 {
    margin: 0;
    font-size: clamp(1.45rem, 1.2rem + 0.8vw, 2rem);
    letter-spacing: -0.035em;
}

.orbit-title h2 a { color: inherit; text-decoration: none; }
.orbit-count { flex: none; color: var(--muted); font-size: 0.86rem; font-weight: 600; }

.orbit-text {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.orbit-place {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 500;
}

/* у боковых карточек только название и город */
.orbit-card:not(.current) .orbit-text,
.orbit-card:not(.current) .orbit-count,
.orbit-card:not(.current) .orbit-expand { display: none; }

/* край карточки справа прячется за центральной, поэтому текст отодвигаем */
.orbit-card.on-right .orbit-body { padding-left: 26%; }
.orbit-card:not(.current) .orbit-body { padding-bottom: 22px; }
.orbit-card:not(.current) .orbit-title { margin-bottom: 2px; }
.orbit-card:not(.current) .orbit-title h2 { font-size: 1.2rem; letter-spacing: -0.02em; }

/* Круглая панель управления под каруселью */
.orbit-dock {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(440px, calc(100% - 32px));
    margin: -30px auto 0;
    padding: 8px;
    border-radius: 999px;
    text-align: left;
}

.orbit-thumb {
    position: relative;
    display: block;
    width: 54px;
    height: 54px;
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    overflow: hidden;
    isolation: isolate;
}

.orbit-dock strong { display: block; overflow: hidden; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.orbit-dock small { display: block; color: var(--muted); }

.orbit-dots {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 10px;
}

.orbit-dots button {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.orbit-dots button::before {
    content: "";
    display: block;
    width: 7px;
    height: 7px;
    margin: auto;
    border-radius: 999px;
    background: var(--muted);
    opacity: 0.5;
    transition: width 0.3s var(--ease), opacity 0.3s, background 0.3s;
}

.orbit-dots button.active::before { width: 18px; background: var(--fill); opacity: 1; }

.orbit-empty { height: clamp(420px, 57vh, 640px); }

/* Строка поиска */
.hero-search { margin-top: 26px; }

.search-panel {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    align-items: stretch;
    gap: 6px;
    padding: 9px;
    border-radius: 28px;
    color: var(--text);
}

.search-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 8px 18px;
    border-radius: 20px;
    transition: background 0.2s;
}

.search-cell:hover,
.search-cell:focus-within { background: var(--surface-2); }

.search-cell label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.search-cell input {
    width: 100%;
    min-width: 0;
    padding: 1px 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.search-cell input::placeholder { color: var(--text); opacity: 0.66; }

.search-panel .button { min-height: 64px; padding: 10px 34px; border-radius: 20px; }

@media (max-width: 760px) {
    .orbit { --card-width: 74vw; height: 480px; }
    .orbit-empty { height: 480px; }
    .search-panel { grid-template-columns: 1fr 1fr; padding: 8px; }
    .search-cell { padding: 7px 12px; }
    .search-cell input { font-size: 1rem; }
    .search-cell:first-child, .search-panel .button { grid-column: 1 / -1; }
    .search-panel .button { min-height: 54px; }
}

/* ---------- Главная: большой тур слева, список справа ---------- */

.explore {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.explore-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 620px;
    padding: clamp(22px, 3vw, 38px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-huge);
    background: var(--night);
    color: #fff;
    box-shadow: var(--glass-shine), var(--shadow-big);
    overflow: hidden;
    isolation: isolate;
}

.explore-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to bottom, rgba(16, 12, 8, 0.82), rgba(16, 12, 8, 0.5) 42%, rgba(16, 12, 8, 0) 68%),
        linear-gradient(to top, rgba(16, 12, 8, 0.6), rgba(16, 12, 8, 0) 30%);
}

.explore-hero h3 {
    max-width: 11em;
    margin-bottom: 8px;
    font-size: clamp(2.5rem, 1.5rem + 3.2vw, 4.6rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 0.98;
}

.explore-hero h3 a { color: inherit; text-decoration: none; }

/* заголовок работает как ссылка на всю карточку */
.explore-hero h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.explore-city { font-size: 1.2rem; font-weight: 500; }
.explore-note { max-width: 25em; margin: 10px 0 0; color: rgba(255, 255, 255, 0.88); }

/* панель лежит выше ссылки карточки, иначе её кнопки нельзя нажать */
.explore-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 22px;
    background: rgba(20, 17, 14, 0.42);
    backdrop-filter: blur(20px) saturate(1.4);
}

.explore-bar > svg { width: 24px; height: 24px; }
.explore-bar div { flex: 1; min-width: 0; }
.explore-bar strong { display: block; font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.explore-bar small { color: rgba(255, 255, 255, 0.82); }

.explore-bar .heart-button {
    position: relative;
    right: auto;
    top: auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.explore-go {
    position: relative;
    z-index: 2;
    background: var(--fill);
    color: var(--fill-text);
}

.explore-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.explore-row {
    position: relative;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    flex: 1;
    align-items: center;
    gap: 16px;
    padding: 8px 14px 8px 8px;
    border-radius: 22px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.25s, transform 0.3s var(--ease);
}

.explore-row:hover { background: var(--surface-2); color: var(--text); transform: translateX(-4px); }

.explore-thumb {
    position: relative;
    display: block;
    align-self: stretch;
    min-height: 84px;
    border-radius: 15px;
    background: var(--night);
    overflow: hidden;
    isolation: isolate;
}

.explore-row strong { display: block; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.22; }
.explore-row small { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--muted); font-size: 0.86rem; }
.explore-row small span { display: inline-flex; align-items: center; gap: 5px; }

.explore-row .round-button { color: var(--accent); }
.explore-row:hover .round-button { background: var(--fill); color: var(--fill-text); }

@media (max-width: 960px) {
    .explore { grid-template-columns: minmax(0, 1fr); }
    .explore-hero { min-height: 500px; }
}

/* ---------- Разделы главной страницы ---------- */

.section { padding: clamp(60px, 8vw, 116px) 0; }
.section.tight { padding-top: 0; }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 32px;
    margin-bottom: clamp(26px, 3vw, 44px);
}

.section-head h2 { margin: 0; }
.section-head p { margin: 10px 0 0; max-width: 560px; color: var(--muted); }

.kicker {
    display: block;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Появление при прокрутке */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible { opacity: 1; transform: none; }

/* Плитки с цифрами */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.stats > div {
    padding: clamp(16px, 2vw, 26px);
    border-radius: var(--radius-big);
    text-align: center;
}

.stat-number {
    display: block;
    margin-bottom: 4px;
    font-size: clamp(2.2rem, 1.6rem + 2vw, 3.6rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.05em;
}

.stat-label { color: var(--muted); font-weight: 500; }

@media (max-width: 640px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Все места: первая карточка крупнее, dense заполняет пустые ячейки */
.place-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    grid-auto-rows: 400px;
    grid-auto-flow: dense;
    gap: 14px;
}

@media (min-width: 700px) {
    .place-grid > :first-child { grid-column: span 2; }
}

/* Карточка места: фото во всю карточку, название на стекле, при наведении поворачивается */
.place-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 220px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-big);
    background: var(--night);
    box-shadow: var(--glass-shine), var(--shadow);
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.place-tile:hover {
    color: #fff;
    box-shadow: var(--glass-shine), var(--shadow-big);
    transform: perspective(1100px) rotateY(-5deg) translateY(-4px);
}

.tile-glass {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    background: rgba(20, 17, 14, 0.44);
    backdrop-filter: blur(20px) saturate(1.4);
}

.place-tile h3 {
    margin: 0;
    font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.65rem);
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.place-tile .tile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.88rem;
    font-weight: 500;
}

/* Фото внутри карточки: при наведении медленно приближается */
.cover-image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
}

a:hover > .cover-image,
.tour-card:hover .cover-image { transform: scale(1.07); }

.cover-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: none;
}

/* Рисунок гор, если у записи нет своей картинки */
.cover-art {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    background: linear-gradient(170deg, #1b5a52, #081413);
}

.cover-art.tone-1 { background: linear-gradient(170deg, #8a4a26, #170d08); }
.cover-art.tone-2 { background: linear-gradient(170deg, #1f5f73, #081820); }
.cover-art.tone-3 { background: linear-gradient(170deg, #5a4674, #120e20); }
.cover-art.tone-4 { background: linear-gradient(170deg, #77662c, #15130a); }

.cover-art svg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 72%;
}

.cover-art .far { fill: rgba(255, 255, 255, 0.08); }
.cover-art .near { fill: rgba(255, 255, 255, 0.14); }

/* Карточка тура: стеклянная, фото сверху в своей рамке */
.tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

.tour-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-radius: var(--radius-huge);
    color: var(--text);
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.tour-card:hover {
    box-shadow: var(--glass-shine), var(--shadow-big);
    transform: perspective(1100px) rotateX(2deg) translateY(-6px);
}

.tour-photo {
    position: relative;
    aspect-ratio: 5 / 4;
    border-radius: 26px;
    background: var(--night);
    overflow: hidden;
    isolation: isolate;
}

.tour-badges {
    position: absolute;
    left: 18px;
    top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(20, 17, 14, 0.56);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    backdrop-filter: blur(12px);
}

.badge.hot { border-color: transparent; background: var(--fill); color: var(--fill-text); }

.tour-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 12px 8px;
}

.tour-place {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}

.tour-card h3 {
    margin-bottom: 8px;
    font-size: clamp(1.3rem, 1.2rem + 0.4vw, 1.55rem);
    letter-spacing: -0.03em;
    line-height: 1.14;
}

/* вся карточка работает как одна ссылка */
.tour-card h3 a { color: inherit; text-decoration: none; }
.tour-card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tour-card h3 a:focus-visible { outline: none; }
.tour-card:focus-within { outline: 3px solid var(--fill); outline-offset: 3px; }
.tour-card:has(.heart-button:focus-visible) { outline: none; }

.tour-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.tour-facts span { display: inline-flex; align-items: center; gap: 6px; }

.tour-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.price-note { color: var(--muted); font-size: 0.82rem; }

.rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    font-weight: 700;
}

.rating svg { fill: #f0b252; stroke: #f0b252; }

.heart-button {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    color: #fff;
    background: rgba(20, 17, 14, 0.42);
    backdrop-filter: blur(12px);
}

.heart-button:hover { background: rgba(20, 17, 14, 0.75); }
.heart-button svg { transition: transform 0.25s var(--ease); }
.heart-button:hover svg { transform: scale(1.14); }
.heart-button[aria-pressed="true"] svg { fill: #79e0d3; stroke: #79e0d3; }

/* Заглушки, пока данные загружаются */
.skeleton {
    border-radius: var(--radius-big);
    background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%);
    background-size: 300% 100%;
    animation: shimmer 1.5s linear infinite;
}

.skeleton.card { height: 470px; }
.skeleton.line { height: 90px; }

@keyframes shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* Панель про AI-помощника: фото слева, возможности справа */
.ai-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-huge);
    background: var(--surface);
}

.ai-band-photo {
    position: relative;
    min-height: 460px;
    border-radius: calc(var(--radius-huge) - 10px);
    background: var(--night);
    overflow: hidden;
}

.ai-band-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-band-text-side { padding: clamp(20px, 4vw, 56px); }
.ai-band h2 { max-width: 12em; }
.ai-band-text { max-width: 520px; color: var(--muted); font-size: 1.06rem; }

.feature-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: clamp(22px, 3vw, 36px);
}

.feature {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    transition: background 0.25s, color 0.25s, transform 0.3s var(--ease);
}

.feature:hover { background: var(--fill); color: var(--fill-text); transform: translateX(4px); }
.feature > svg:first-child { grid-row: span 2; width: 26px; height: 26px; color: var(--accent); }
.feature:hover > svg:first-child { color: inherit; }
.feature > svg:last-child { grid-column: 3; grid-row: 1 / span 2; }
.feature strong { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.feature span { color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.feature:hover span { color: inherit; }

@media (max-width: 860px) {
    .ai-band { grid-template-columns: 1fr; }
    .ai-band-photo { min-height: 240px; }
}

/* Как это работает: шаги на одной линии */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    counter-reset: step;
}

.step { position: relative; counter-increment: step; }

.step::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border-radius: 18px;
    background: var(--fill);
    color: var(--fill-text);
    font-size: 1.3rem;
    font-weight: 800;
}

/* линия от шага к следующему шагу */
.step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 70px;
    right: -14px;
    top: 28px;
    height: 1px;
    background: var(--line);
}

.step p { margin: 0; max-width: 34ch; color: var(--muted); }

@media (max-width: 760px) {
    .steps { grid-template-columns: 1fr; }
    .step:not(:last-child)::after { display: none; }
}

/* Отзывы на главной: первый большой, два рядом с ним */
.quote-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 14px;
}

.quote {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: clamp(22px, 2.6vw, 34px);
    border-radius: var(--radius-big);
    background: var(--surface);
}

.quote:first-child {
    grid-row: span 2;
    background: var(--fill);
    color: var(--fill-text);
}

.quote blockquote {
    flex: 1;
    margin: 0 0 18px;
    font-size: 1.12rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.015em;
}

.quote:first-child blockquote {
    font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.7rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.quote figcaption { color: var(--muted); font-size: 0.9rem; }
.quote:first-child figcaption { color: inherit; opacity: 0.8; }
.quote figcaption strong { display: block; color: var(--text); font-weight: 700; }
.quote:first-child figcaption strong { color: inherit; }

.stars { display: inline-flex; gap: 2px; margin-bottom: 14px; color: var(--fill); }
.quote:first-child .stars { color: var(--fill-text); }
.stars svg { width: 17px; height: 17px; }
.stars svg.filled { fill: currentColor; }
.stars svg:not(.filled) { color: var(--line); }

@media (max-width: 760px) {
    .quote-grid { grid-template-columns: 1fr; }
}

/* Призыв зарегистрироваться */
.cta {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: min(70vh, 560px);
    padding: clamp(26px, 5vw, 64px);
    border-radius: var(--radius-huge);
    background: var(--night);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.cta > img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(16, 12, 8, 0.9), rgba(16, 12, 8, 0.1) 72%);
}

.cta h2 { max-width: 13em; color: #fff; }
.cta p { max-width: 480px; margin-bottom: 22px; color: rgba(255, 255, 255, 0.86); }

/* ---------- Заголовки внутренних страниц ---------- */

.page-head {
    padding: clamp(30px, 5vw, 64px) 0 clamp(20px, 3vw, 32px);
}

.page-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 24px;
}

.page-head h1 { margin: 0; }
.page-head p { margin: 12px 0 0; max-width: 620px; color: var(--muted); font-size: 1.08rem; }
.page-body { padding-bottom: clamp(56px, 7vw, 100px); }

/* ---------- Каталог туров ---------- */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.chip:hover { background: var(--surface-2); color: var(--text); }

.chip[aria-pressed="true"],
.chip.active {
    background: var(--fill);
    color: var(--fill-text);
}

.chip.removable { background: var(--surface-2); }
.chip .count { color: inherit; opacity: 0.65; font-size: 0.85em; }

/* фильтры идут строкой над турами, а не колонкой сбоку */
.catalog {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.filters-box {
    border-radius: var(--radius-big);
    background: var(--surface);
}

.filters-box summary {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 15px 18px;
    font-weight: 700;
    cursor: pointer;
}

.filters-form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.7fr) auto;
    align-items: end;
    gap: 12px;
    padding: 16px;
}

.filters-form .button { min-height: 50px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    margin-bottom: 18px;
}

.result-count { color: var(--muted); font-weight: 600; }

.sort-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.sort-field select {
    min-height: 42px;
    padding: 4px 12px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}

.active-filters { margin-bottom: 16px; }

@media (max-width: 1040px) {
    .filters-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .filters-box summary { display: flex; }
    .filters-box summary::-webkit-details-marker { display: none; }
    .filters-form { padding-top: 4px; }
}

@media (max-width: 560px) {
    .filters-form { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field > label,
.field-title {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 50px;
    padding: 11px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea { min-height: 130px; resize: vertical; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--muted); }

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--fill);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fill) 28%, transparent);
}

.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.86rem; }
.field-note { color: var(--muted); font-size: 0.84rem; }

.field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    gap: 14px;
}

.form-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.94rem;
    white-space: pre-line;
}

.form-error:empty { display: none; }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stack { display: flex; flex-direction: column; gap: 16px; }

.panel {
    padding: clamp(20px, 3.2vw, 36px);
    border-radius: var(--radius-big);
    background: var(--surface);
}

.narrow-page { max-width: 760px; margin: 0 auto; }

/* Счётчик с кнопками минус и плюс */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius);
    background: var(--surface-2);
}

.stepper button {
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stepper button:hover:not(:disabled) { background: var(--line); }
.stepper button:disabled { opacity: 0.3; cursor: default; }

.stepper input {
    width: 60px;
    min-height: 0;
    border: 0 !important;
    box-shadow: none !important;
    background: none;
    text-align: center;
    font-weight: 700;
    -moz-appearance: textfield;
    appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Поле загрузки картинки */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 170px;
    padding: 22px;
    border: 1.5px dashed var(--muted);
    border-radius: var(--radius-big);
    background: var(--surface-2);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.drag { border-color: var(--fill); }
.dropzone:focus-within { outline: 3px solid var(--fill); outline-offset: 2px; }
.dropzone svg { width: 30px; height: 30px; }
.dropzone strong { color: var(--text); font-weight: 700; }

/* поле файла занимает всю зону: клик по зоне открывает выбор файла */
.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Выбор роли при регистрации */
.choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.choice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.2s;
}

.choice input { position: absolute; opacity: 0; }
.choice strong { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.choice small { color: var(--muted); line-height: 1.35; }
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { border-color: var(--fill); }
.choice:has(input:focus-visible) { outline: 3px solid var(--fill); outline-offset: 2px; }

/* Поле пароля с кнопкой показа */
.password-field { position: relative; }
.password-field input { padding-right: 50px; }
.password-field button {
    position: absolute;
    right: 4px;
    top: 4px;
    color: var(--muted);
}

/* Выбор оценки звёздами */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; border: 0; margin: 0; padding: 0; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { color: var(--line); cursor: pointer; }
.star-input label svg { width: 30px; height: 30px; fill: currentColor; stroke: none; transition: transform 0.15s; }
.star-input label:hover svg { transform: scale(1.12); }
/* выбранная звезда и все идущие перед ней: порядок в разметке обратный */
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: var(--fill); }
.star-input input:focus-visible + label { outline: 3px solid var(--fill); border-radius: 4px; }

/* ---------- Большая обложка тура и места ---------- */

.cover {
    position: relative;
    display: flex;
    align-items: flex-end;
    margin: 0 clamp(16px, 3vw, 44px);
    min-height: min(68vh, 620px);
    padding: 40px 0 clamp(22px, 3vw, 36px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-huge);
    background: var(--night);
    box-shadow: var(--glass-shine), var(--shadow-big);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.cover > .cover-image { z-index: -2; animation: slow-zoom 16s linear forwards; }

@keyframes slow-zoom {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.cover::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(16, 12, 8, 0.82), rgba(16, 12, 8, 0.22) 56%, rgba(16, 12, 8, 0.1));
}

.cover h1 {
    max-width: 15em;
    margin-bottom: 16px;
    font-size: clamp(2.5rem, 1.3rem + 4.4vw, 5.4rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 0.98;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
    font-weight: 500;
}

.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: #fff; text-decoration: underline; }

/* подробности на полоске из стекла */
.cover-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(20, 17, 14, 0.42);
    color: #fff;
    font-weight: 500;
    backdrop-filter: blur(18px) saturate(1.4);
}

.cover-meta span { display: inline-flex; align-items: center; gap: 6px; }
.cover-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Страница тура */
.tour-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: clamp(28px, 4vw, 60px);
    align-items: start;
    padding-top: clamp(28px, 4vw, 48px);
    padding-bottom: clamp(56px, 7vw, 100px);
}

/* факты о туре стоят плитками */
.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 10px;
    margin: 0 0 32px;
}

.fact-grid > div {
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface);
}

.fact-grid svg { width: 18px; height: 18px; color: var(--accent); }
.fact-grid dt { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.84rem; }
.fact-grid dd { margin: 5px 0 0; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; }

.lead {
    font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.75rem);
    font-weight: 500;
    line-height: 1.32;
    letter-spacing: -0.025em;
}

.content-section { margin-top: clamp(32px, 4vw, 56px); }
.content-section > h2 { font-size: clamp(1.7rem, 1.4rem + 1.1vw, 2.5rem); margin-bottom: 18px; }

.place-link-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    padding: 10px;
    border-radius: var(--radius-big);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: background 0.25s;
}

.place-link-card:hover { background: var(--surface-2); color: inherit; }

.place-link-photo {
    position: relative;
    min-height: 150px;
    border-radius: 16px;
    background: var(--night);
    isolation: isolate;
    overflow: hidden;
}

.place-link-body { padding: 10px 12px 10px 0; }
.place-link-body p { color: var(--muted); margin-bottom: 8px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
    padding: 3px 11px;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.place-link-card:hover .tag { background: var(--line); }

@media (max-width: 520px) {
    .place-link-card { grid-template-columns: 1fr; }
    .place-link-body { padding: 0 8px 8px; }
}

/* Блок бронирования: заходит на обложку снизу */
.book-card {
    position: sticky;
    top: calc(var(--header-space) + 14px);
    z-index: 2;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-huge);
    background: var(--surface);
    box-shadow: var(--shadow-big);
}

.big-price {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.045em;
}

.seats { margin: 16px 0; }

.seats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    font-size: 0.9rem;
    font-weight: 500;
}

.seats-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--surface-2);
    overflow: hidden;
}

.seats-bar span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--ok-text);
}

.seats-bar.low span { background: var(--fill); }

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-weight: 600;
}

.total-row strong { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.book-note {
    display: flex;
    gap: 8px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.book-note svg { margin-top: 1px; }
.notice { margin: 0; padding: 13px 16px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); }

/* Нижняя полоса с ценой на телефоне */
.mobile-book { display: none; }

@media (max-width: 960px) {
    .tour-layout { grid-template-columns: 1fr; }
    .book-card { position: static; order: 0; margin-top: 0; border-radius: var(--radius-big); }

    .mobile-book {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px 10px 16px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--solid);
        box-shadow: var(--shadow-big);
    }

    .has-mobile-book .site-footer { padding-bottom: 100px; }
}

/* Отзывы на странице тура */
.review-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 26px;
    align-items: center;
    margin-bottom: 24px;
}

.review-average {
    font-size: 4.6rem;
    font-weight: 600;
    line-height: 0.9;
    letter-spacing: -0.05em;
}

.review-bars { display: flex; flex-direction: column; gap: 4px; max-width: 320px; }

.review-bar {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.review-bar .bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.review-bar .bar span { display: block; height: 100%; background: var(--fill); }

.review {
    margin-bottom: 10px;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--surface);
}

.review-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 8px;
}

.review-head .stars { margin: 0; }
.review-date { color: var(--muted); font-size: 0.84rem; }
.review p { margin: 0; }

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

/* ---------- Брони ---------- */

.segments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    padding: 5px;
    border-radius: 16px;
    background: var(--surface);
}

.segment {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 6px 16px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.segment:hover { color: var(--text); }
.segment[aria-pressed="true"], .segment[aria-selected="true"] {
    background: var(--fill);
    color: var(--fill-text);
}

.segment .count { font-size: 0.85em; opacity: 0.7; }

.trip-list { display: flex; flex-direction: column; gap: 12px; }

.trip {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius-big);
    background: var(--surface);
}

.trip-photo {
    position: relative;
    align-self: stretch;
    min-height: 150px;
    border-radius: 16px;
    background: var(--night);
    isolation: isolate;
    overflow: hidden;
}

.trip-body { padding: 8px 0; min-width: 0; }
.trip-body h3 { margin: 8px 0 8px; }
.trip-body h3 a { color: inherit; text-decoration: none; }
.trip-body h3 a:hover { text-decoration: underline; }

.trip-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px 8px 0;
}

@media (max-width: 760px) {
    .trip { grid-template-columns: 1fr; gap: 0; }
    .trip-photo { min-height: 170px; }
    .trip-body { padding: 12px 8px 0; }
    .trip-actions { flex-direction: row; flex-wrap: wrap; padding: 12px 8px 8px; }
    .trip-actions:empty { display: none; }
}

.status {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-pending { background: var(--wait-bg); color: var(--wait-text); }
.status-confirmed { background: var(--ok-bg); color: var(--ok-text); }
.status-cancelled { background: var(--off-bg); color: var(--off-text); }

/* Пустое состояние */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: clamp(40px, 7vw, 80px) 20px;
    border-radius: var(--radius-big);
    background: var(--surface);
    text-align: center;
}

.empty svg { width: 36px; height: 36px; margin-bottom: 8px; color: var(--accent); }
.empty h3 { margin: 0 0 8px; }
.empty p { margin: 0 0 8px; max-width: 460px; color: var(--muted); }

.loading { padding: 40px 0; color: var(--muted); text-align: center; }

/* ---------- Вход и регистрация: фото и форма парят рядом ---------- */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
    margin: 0 clamp(16px, 3vw, 44px) clamp(24px, 4vw, 48px);
    min-height: calc(100vh - var(--header-space) - 40px);
}

.auth-photo {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(28px, 4vw, 56px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-huge);
    background: var(--night);
    box-shadow: var(--glass-shine), var(--shadow-big);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.auth-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(16, 12, 8, 0.78), rgba(16, 12, 8, 0) 58%);
}

.auth-photo blockquote {
    max-width: 10em;
    margin: 0;
    font-size: clamp(2.1rem, 1.3rem + 2.6vw, 4rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.045em;
}

.auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px);
    border-radius: var(--radius-huge);
}

.auth-form > div { width: 100%; max-width: 430px; }
.auth-form h1 { font-size: clamp(2.3rem, 2rem + 1.4vw, 3.3rem); margin-bottom: 6px; }
.auth-sub { margin-bottom: 24px; color: var(--muted); }
.auth-switch { margin: 0; color: var(--muted); text-align: center; }

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-photo { display: none; }
}

/* ---------- Профиль ---------- */

.profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.profile-head h1 { margin: 0; font-size: clamp(2.2rem, 2rem + 1.5vw, 3.3rem); }
.profile-head .hint { margin: 4px 0 0; }

.profile-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    background: var(--surface);
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}

.profile-link:hover { background: var(--surface-2); color: inherit; }
.profile-link svg { color: var(--accent); }

/* ---------- AI-помощник ---------- */

.ai-hero {
    position: relative;
    margin: 0 clamp(16px, 3vw, 44px);
    padding: clamp(32px, 5vw, 64px) 0 clamp(80px, 9vw, 120px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-huge);
    background: var(--night);
    box-shadow: var(--glass-shine), var(--shadow-big);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.ai-hero > img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to right, rgba(16, 12, 8, 0.8), rgba(16, 12, 8, 0.28));
}

.ai-hero .hero-kicker { margin-bottom: 14px; }
.ai-hero h1 { max-width: 12em; margin-bottom: 12px; letter-spacing: -0.045em; }
.ai-hero p { max-width: 560px; margin: 0; color: rgba(255, 255, 255, 0.9); font-size: 1.08rem; }

.ai-body {
    position: relative;
    z-index: 1;
    margin-top: clamp(-70px, -5vw, -36px);
    padding-bottom: clamp(56px, 7vw, 100px);
}

.ai-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.ai-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 16px 18px;
    border: 0;
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ai-tab:hover { background: var(--surface-2); }
.ai-tab svg { width: 24px; height: 24px; color: var(--accent); }
.ai-tab strong { display: block; font-weight: 700; line-height: 1.25; }
.ai-tab small { display: block; color: var(--muted); line-height: 1.3; }

.ai-tab[aria-selected="true"] { background: var(--fill); color: var(--fill-text); }
.ai-tab[aria-selected="true"] svg,
.ai-tab[aria-selected="true"] small { color: inherit; }

@media (max-width: 720px) {
    .ai-tab { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; }
    .ai-tab small { display: none; }
}

/* Чат: небольшое окно по центру, вкладки над ним той же ширины */
.ai-body:has(.chat) .ai-tabs,
.chat {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.chat {
    display: flex;
    flex-direction: column;
    height: min(480px, 62vh);
    border-radius: var(--radius-big);
    background: var(--surface);
    overflow: hidden;
}

/* вкладки рядом с небольшим чатом тоже компактнее */
.ai-body:has(.chat) .ai-tab {
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
}

.ai-body:has(.chat) .ai-tab svg { width: 20px; height: 20px; }
.ai-body:has(.chat) .ai-tab strong { font-size: 0.92rem; }
.ai-body:has(.chat) .ai-tab small { font-size: 0.76rem; }
.ai-body:has(.chat) > .field-note { text-align: center; }

.chat-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    overflow-y: auto;
}

.bubble {
    max-width: min(78%, 520px);
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    animation: bubble-in 0.3s var(--ease);
}

/* сообщение человека лёгкое: цвет только оттенком, без сплошной заливки */
.bubble.user {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: color-mix(in srgb, var(--fill) 24%, transparent);
    color: var(--text);
}

.bubble.bot {
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    background: var(--surface-2);
}

.bubble.error { background: var(--danger-bg); color: var(--danger); }

@keyframes bubble-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
    .bubble { max-width: 90%; }
}

.bubble-tours {
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -4px;
}

.bubble-tours .chip {
    min-height: 30px;
    padding: 3px 12px;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 0.82rem;
    font-weight: 500;
    backdrop-filter: none;
}

.bubble-tours .chip:hover { background: var(--surface-2); }

/* три точки, пока AI думает */
.typing { display: inline-flex; gap: 5px; padding: 5px 2px; }

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: typing 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: none; }
    30% { opacity: 1; transform: translateY(-4px); }
}

.chat-empty {
    margin: auto;
    max-width: 480px;
    font-size: 0.92rem;
    text-align: center;
}

.chat-empty svg { width: 26px; height: 26px; margin-bottom: 6px; color: var(--accent); }
.chat-empty h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.chat-empty .chips { justify-content: center; margin-top: 12px; }

.chat-empty .chip {
    min-height: 32px;
    padding: 4px 13px;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 0.84rem;
    font-weight: 500;
    backdrop-filter: none;
}

.chat-empty .chip:hover { background: var(--surface-2); }

.composer {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 10px 10px;
}

.composer textarea {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    max-height: 110px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 20px;
    background: var(--surface-2);
    font-size: 0.92rem;
    line-height: 1.5;
    resize: none;
}

.composer textarea:focus { outline: none; border-color: var(--fill); }
.composer .button { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; flex: none; }
.composer .button:hover { box-shadow: none; transform: none; }

/* Поиск по фото */
.photo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.photo-layout .dropzone { min-height: 340px; }
.photo-result { min-width: 0; }

@media (max-width: 800px) {
    .photo-layout { grid-template-columns: 1fr; }
    .photo-layout .dropzone { min-height: 240px; }
}

/* линия сканирования бежит по фото, пока AI его рассматривает */
.dropzone.scanning::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(to bottom, transparent, rgba(121, 224, 211, 0.5), transparent);
    border-bottom: 2px solid var(--fill);
    animation: scan 2s ease-in-out infinite alternate;
}

@keyframes scan {
    from { top: -90px; }
    to { top: 100%; }
}

.recognized-name {
    font-size: clamp(1.8rem, 1.5rem + 1vw, 2.5rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin: 0 0 6px;
}

/* План поездки */
.plan-layout {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

@media (max-width: 900px) {
    .plan-layout { grid-template-columns: 1fr; }
}

.plan-card {
    border-radius: var(--radius-big);
    background: var(--surface);
    overflow: hidden;
}

.plan-card summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    padding: 18px 22px;
    cursor: pointer;
    list-style: none;
}

.plan-card summary::-webkit-details-marker { display: none; }
.plan-card summary strong { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.plan-card summary span { color: var(--muted); font-size: 0.9rem; }
.plan-card summary > svg { margin-left: auto; color: var(--muted); transition: transform 0.25s; }
.plan-card[open] summary > svg { transform: rotate(180deg); }
.plan-content { padding: 0 22px 22px; }
.plan-list { display: flex; flex-direction: column; gap: 12px; }

/* Маршрут: каждый день на линии с точкой */
.timeline { margin: 0; padding: 0; list-style: none; }

.timeline li {
    position: relative;
    padding: 0 0 18px 24px;
    border-left: 2px solid var(--line);
    margin-left: 5px;
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--fill);
}

.timeline h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.timeline p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Страница для гостя */
.guest-card { text-align: center; }
.guest-card h2 { font-size: 2.1rem; margin-bottom: 8px; }
.guest-card p { max-width: 520px; margin: 0 auto 18px; color: var(--muted); }
.guest-card .form-actions { justify-content: center; }

/* ---------- Сообщения между туристом и гидом ---------- */

/* переписка занимает весь экран, поэтому подвал здесь не нужен */
.chat-open .site-footer { display: none; }

.messenger {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    height: calc(100vh - var(--header-space) - var(--header-gap));
    height: calc(100dvh - var(--header-space) - var(--header-gap));
    margin: 0 clamp(16px, 3vw, 44px) 0 0;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-huge);
    background: var(--surface);
    box-shadow: var(--glass-shine), var(--shadow);
    overflow: hidden;
    backdrop-filter: var(--blur);
}

.chat-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
}

.chat-side-head { padding: 18px 16px 10px; }
.chat-side-head h1 { margin-bottom: 12px; font-size: 1.5rem; letter-spacing: -0.03em; }

.chat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.9rem;
}

.chat-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.chat-search input::placeholder { color: var(--muted); opacity: 1; }

.chat-list {
    flex: 1;
    min-height: 0;
    padding: 4px 8px 8px;
    overflow-y: auto;
}

.chat-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px 16px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.chat-list-empty svg { width: 28px; height: 28px; color: var(--accent); }
.chat-list-empty p { margin: 0; }

.chat-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.chat-item:hover { background: var(--surface-2); color: var(--text); }
.chat-item.active { background: color-mix(in srgb, var(--fill) 22%, transparent); }

.chat-avatar { position: relative; display: inline-flex; flex: none; }
.chat-avatar .avatar { width: 44px; height: 44px; font-size: 1.05rem; }

/* зелёная точка: человек сейчас на сайте */
.chat-avatar.online::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border: 2px solid var(--solid);
    border-radius: 50%;
    background: #3ecf8e;
}

.chat-item-body { flex: 1; min-width: 0; }
.chat-item-top, .chat-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-item-top strong { overflow: hidden; font-size: 0.95rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-top time { flex: none; color: var(--muted); font-size: 0.74rem; }
.chat-item-text { overflow: hidden; color: var(--muted); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--fill);
    color: var(--fill-text);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
}

.nav-badge[hidden] { display: none; }
.mobile-menu .nav-badge { margin-left: 8px; }

.side-rail .nav-badge {
    position: absolute;
    right: -4px;
    top: -3px;
    box-shadow: 0 0 0 2px var(--solid);
}

.chat-room {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.chat-room > .empty { margin: auto; border: 0; background: none; box-shadow: none; backdrop-filter: none; }

.chat-pick {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--muted);
    font-size: 0.92rem;
}

.chat-pick svg { width: 30px; height: 30px; color: var(--accent); }
.chat-pick p { margin: 0; }

.chat-room-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
}

.chat-room-head .avatar { width: 40px; height: 40px; }
.chat-room-head strong { display: block; font-size: 0.98rem; font-weight: 700; line-height: 1.25; }
.chat-room-head small { display: block; color: var(--muted); font-size: 0.8rem; }
.chat-room-head small.online, .chat-room-head small.typing { color: var(--accent); }
.chat-back { display: none; flex: none; }

.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    padding: 14px clamp(12px, 3vw, 28px);
    overflow-y: auto;
}

.chat-older {
    align-self: center;
    margin-bottom: 8px;
    padding: 5px 13px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.chat-day { align-self: center; margin: 10px 0 7px; }

.chat-day span {
    display: block;
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.msg {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: min(72%, 560px);
}

/* появляется плавно только новое сообщение */
.msg.new { animation: bubble-in 0.25s var(--ease); }

.msg.mine { align-self: flex-end; }
.msg.theirs { align-self: flex-start; }

.msg-bubble {
    min-width: 0;
    padding: 7px 12px;
    border-radius: 16px;
    font-size: 0.93rem;
    line-height: 1.42;
}

.msg.theirs .msg-bubble { border-bottom-left-radius: 5px; background: var(--surface-2); }
.msg.mine .msg-bubble { border-bottom-right-radius: 5px; background: color-mix(in srgb, var(--fill) 26%, transparent); }

.msg-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.68rem;
}

.msg-ticks { display: inline-flex; }
.msg-ticks svg { width: 14px; height: 14px; }
.msg-ticks.read { color: var(--accent); }

/* удалить можно при наведении: кнопка не мешает читать */
.msg-delete {
    display: inline-flex;
    flex: none;
    padding: 5px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.2s, color 0.2s;
}

.msg:hover .msg-delete, .msg-delete:focus-visible { opacity: 1; }
.msg-delete:hover { color: var(--danger); }
.msg-delete svg { width: 15px; height: 15px; }

@media (hover: none) {
    .msg-delete { opacity: 0.6; }
}

.msg-photo {
    display: block;
    margin: -3px -8px 5px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--surface-2);
    cursor: zoom-in;
    overflow: hidden;
}

/* пузырь с фото ровно по ширине снимка */
.msg.kind-image .msg-bubble { width: min(320px, 62vw); }
.msg-photo img { width: 100%; min-height: 120px; max-height: 340px; object-fit: cover; }

/* Голосовое: кнопка, полоса и время */
.voice {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(260px, 56vw);
    padding: 2px 0;
}

.voice-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--fill);
    color: var(--fill-text);
    cursor: pointer;
}

.voice-play svg { width: 16px; height: 16px; fill: currentColor; }
.voice-seek { flex: 1; min-width: 0; height: 18px; margin: 0; accent-color: var(--fill); cursor: pointer; }
.voice-time { flex: none; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.chat-composer,
.chat-recording {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    padding: 9px 12px 11px;
    border-top: 1px solid var(--line);
}

.chat-composer[hidden], .chat-recording[hidden], .chat-composer [hidden] { display: none; }

.chat-attach { position: relative; overflow: hidden; }
.chat-attach:focus-within { outline: 3px solid var(--fill); outline-offset: 2px; }

.chat-attach input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.chat-composer textarea {
    flex: 1;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    max-height: 130px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 20px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.93rem;
    line-height: 1.5;
    resize: none;
}

.chat-composer textarea::placeholder { color: var(--muted); opacity: 1; }
.chat-composer textarea:focus { outline: none; border-color: var(--fill); }
/* уведомление не должно закрывать поле ввода */
.chat-open .toast { bottom: 84px; }
.chat-send, .chat-send:hover { background: var(--fill); color: var(--fill-text); }

.chat-recording { align-items: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-hint { flex: 1; color: var(--muted); font-size: 0.86rem; font-weight: 500; }

.rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef5350;
    animation: rec-pulse 1.1s ease-in-out infinite;
}

@keyframes rec-pulse {
    50% { opacity: 0.3; }
}

/* Просмотр и отправка фото */
.dialog.chat-viewer { padding: 8px; background: var(--solid); }
.chat-viewer img { width: 100%; max-height: 78vh; border-radius: 22px; object-fit: contain; }
.chat-viewer form { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.chat-photo-send img { width: 100%; max-height: 50vh; margin-bottom: 14px; border-radius: 16px; object-fit: contain; }

/* на телефоне видна одна часть: либо список, либо диалог */
@media (max-width: 760px) {
    .messenger {
        grid-template-columns: minmax(0, 1fr);
        margin: 0 var(--header-gap);
        border-radius: var(--radius-big);
    }

    .chat-side { border-right: 0; }
    .messenger.room-open .chat-side { display: none; }
    .messenger:not(.room-open) .chat-room { display: none; }
    .chat-back { display: inline-flex; }
    .msg { max-width: 88%; }
}

/* ---------- Авторы фотографий ---------- */

.credit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 14px;
}

.credit {
    border-radius: 20px;
    background: var(--surface);
    overflow: hidden;
}

.credit img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.credit div { padding: 14px 16px; font-size: 0.88rem; }
.credit strong { display: block; overflow-wrap: anywhere; }
.credit span { display: block; color: var(--muted); }

/* ---------- Подвал ---------- */

.site-footer {
    flex: none;
    margin-top: clamp(24px, 4vw, 48px);
    margin-right: clamp(16px, 3vw, 44px);
    margin-bottom: var(--header-gap);
    padding: clamp(28px, 4vw, 48px) 0 24px;
    border-radius: var(--radius-huge);
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.footer-row .logo { color: var(--text); margin-bottom: 12px; }
.footer-row p { max-width: 360px; margin: 0; }
.footer-title { display: block; margin-bottom: 10px; color: var(--text); font-weight: 700; }
.footer-links { display: flex; flex-direction: column; gap: 5px; }
.site-footer a:not(.logo) { color: inherit; text-decoration: none; }
.site-footer a:not(.logo):hover { color: var(--accent); }

.footer-bottom {
    margin-top: 28px;
    font-size: 0.86rem;
}

@media (max-width: 1120px) {
    .site-footer { margin-left: var(--header-gap); margin-right: var(--header-gap); }
}

@media (max-width: 680px) {
    .footer-row { grid-template-columns: 1fr 1fr; }
    .footer-row > :first-child { grid-column: 1 / -1; }
}

/* ---------- Всплывающее сообщение и диалог ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 70;
    max-width: calc(100vw - 32px);
    padding: 12px 22px;
    border-radius: 14px;
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    box-shadow: var(--shadow-big);
    opacity: 0;
    transform: translate(-50%, 16px);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.3s var(--ease);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.dialog {
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-huge);
    background: var(--solid);
    color: var(--text);
    box-shadow: var(--shadow-big);
}

.dialog.large { width: min(640px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(16, 12, 8, 0.6); backdrop-filter: blur(5px); }
.dialog h2 { font-size: 1.7rem; letter-spacing: -0.03em; margin-bottom: 8px; }
.dialog p { color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Если человек отключил анимацию в системе ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

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

    .reveal { opacity: 1; transform: none; }
}
