/* ==========================================================================
   «БьютиРитм» — базовая дизайн-система.
   Собирается вручную, без Node/Vite: файл отдаётся статикой из public/css.
   Палитра и токены повторяют главную страницу, чтобы кабинет не выглядел
   «другим продуктом».
   ========================================================================== */

:root {
    /* Светлая тема — единственная. Автопереключение по системной настройке
       давало «чёрный сайт» тем, у кого ОС в тёмном режиме: для сервиса записи
       в салон это выглядело как чужой продукт, поэтому палитра фиксирована.
       color-scheme: light нужен, чтобы браузер не перекрашивал поля ввода и
       выпадающие списки в тёмные. */
    color-scheme: light;

    --bg: #faf8fc;
    --surface: #ffffff;
    --surface-muted: #f3eff8;
    --text: #241a32;
    --muted: #61566f;
    --line: #e7deee;
    --accent: #5e3db5;
    --accent-hover: #4a2d96;
    --accent-soft: #eee7fb;
    --ok: #16794c;
    --ok-soft: #e6f7ee;
    --warn: #8a5a00;
    --warn-soft: #fdf3dc;
    --danger: #b3261e;
    --danger-soft: #fdeeed;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 2px 4px #29194708, 0 12px 32px -19px #29194739;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin: 0 0 .5em;
    line-height: 1.2;
    letter-spacing: -.02em;
}

h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }

p { margin: 0 0 1em; }

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

a:hover { border-bottom-color: currentColor; }

:where(a, button, summary, input, select, textarea):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

small, .text-muted { color: var(--muted); font-size: 14px; }

/* --- Каркас ------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(760px 380px at 15% -10%, var(--accent-soft), transparent 70%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
}

.auth-card--wide { max-width: 620px; }

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 650;
    font-size: 17px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 16px;
    background: linear-gradient(135deg, var(--accent), #f0799f);
}

/* --- Кабинет: шапка и навигация ----------------------------------------- */

.topbar {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    border: 0;
    color: var(--text);
}

.topbar nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.topbar nav a {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    border: 0;
}

.topbar nav a:hover,
.topbar nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.topbar form { margin: 0; }

.page {
    padding: 32px 0 64px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

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

/*
 * Отступ у поля задаёт контейнер, а не само поле.
 *
 * Пока margin-bottom висел на .field, он складывался с gap у .field-row
 * и ломал выравнивание в .inline-form: там align-items: flex-end, поэтому
 * кнопка вставала по низу отступа поля и уезжала вниз относительно контролов.
 */
.field {
    margin-bottom: 0;
}

/* Вертикальный стек (форма в один столбец) всё же должен дышать. */
form > .field,
.card > .field {
    margin-bottom: 18px;
}

form > .field:last-child,
.card > .field:last-child {
    margin-bottom: 0;
}

/* В строках и inline-формах отступ уже даёт gap — margin снизу только добавит пустоту. */
.field-row > .field,
.inline-form > .field {
    margin-bottom: 0;
}

.label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 11px 13px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s ease, box-shadow .15s ease;
}

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

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
    border-color: var(--danger);
}

.hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.error-text {
    margin-top: 6px;
    font-size: 13px;
    color: var(--danger);
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 18px;
}

.checkbox input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.checkbox a { color: var(--accent); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    font: inherit;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }

.btn-ghost:hover { background: var(--accent-soft); }

.btn-danger { color: var(--danger); border-color: var(--line); }

.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

.btn-block { width: 100%; }

.btn[disabled] { opacity: .6; cursor: not-allowed; }

.btn-sm { padding: 7px 12px; font-size: 14px; }

/* --- Карточки, списки, бейджи ------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}

/*
 * Вертикальный ритм задаёт страница, а не карточка.
 *
 * Раньше отступ жил в .card + .card, и он работал только для соседних карточек:
 * карточка после .grid или .tabs прилипала к предыдущему блоку, а первая после
 * заголовка получала двойной отступ. Теперь шаг между любыми блоками страницы
 * одинаковый, а собственный margin-bottom у .page-head его заменяет.
 */
.page > * + * {
    margin-top: 16px;
}

.page > .page-head + * {
    margin-top: 0;
}

.page > :last-child {
    margin-bottom: 0;
}

.card-title {
    margin: 0 0 4px;
    font-size: 17px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.stat {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.stat-value {
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-muted); color: var(--muted); }

/* Метка клиента: цвет приходит из БД (--tag-color), подложка — от него же. */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    margin: 0 4px 4px 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tag-color, var(--accent));
    background: color-mix(in srgb, var(--tag-color, var(--accent)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--tag-color, var(--accent)) 30%, transparent);
    white-space: nowrap;
}

/* Пагинация Laravel без Tailwind: разметка простая, стили — свои. */
.pagination,
nav[role="navigation"] > div:last-child {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

nav[role="navigation"] span[aria-current="page"] span,
nav[role="navigation"] a {
    display: inline-flex;
    min-width: 36px;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

nav[role="navigation"] span[aria-current="page"] span {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-muted);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 18px;
}

.alert-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.alert-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.alert-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* --- Шаги онбординга ---------------------------------------------------- */

.steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 0;
    list-style: none;
}

.steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
    background: var(--surface);
}

.steps li.is-current {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

.steps li.is-done {
    border-color: transparent;
    background: var(--ok-soft);
    color: var(--ok);
}

.steps .step-index {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    background: var(--surface-muted);
    color: inherit;
}

.steps li.is-current .step-index { background: var(--accent); color: #fff; }
.steps li.is-done .step-index { background: var(--ok); color: #fff; }

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.form-actions .spacer { flex: 1; }

/* --- Таблица расписания ------------------------------------------------- */

.schedule-row {
    display: grid;
    grid-template-columns: 150px 90px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.schedule-row:last-child { border-bottom: 0; }

.schedule-row .day {
    font-size: 14px;
    font-weight: 600;
}

.schedule-row .times {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.schedule-row .times span { color: var(--muted); font-size: 13px; }

.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

/* --- Таблицы и списки --------------------------------------------------- */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table thead th {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-muted); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.table .actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.table .actions form { margin: 0; }

.plain-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.plain-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}

.plain-list li:last-child { border-bottom: 0; }
.plain-list li form { margin: 0; }

.inline-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

.inline-form .field { flex: 1 1 140px; min-width: 120px; }
.inline-form .field .input,
.inline-form .field .select { width: 100%; }

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

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tabs a {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

.tabs a:hover { border-color: var(--accent); color: var(--accent); }

.tabs a[aria-current="page"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* --- Календарь ---------------------------------------------------------- */

.week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.week-day {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-day.is-today {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.week-day header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    font-weight: 600;
}

.week-day header a { color: inherit; text-decoration: none; }
.week-day header a:hover { color: var(--accent); }
.week-closed { color: var(--muted); font-size: 13px; margin: 0; }
.week-hours { margin: 0; }

.appointment {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    font-size: 13px;
}

.appointment-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.appointment-client { font-weight: 600; }

.slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.slot {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    font-variant-numeric: tabular-nums;
    font-size: 15px;
}

.slot:hover { border-color: var(--accent); color: var(--accent); }

.text-muted { color: var(--muted); }
.small { font-size: 13px; }

.check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 16px;
}

.days {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.day-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.day-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-transform: capitalize;
}

.slot-radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.slot-radio input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.slot-radio span {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    font-variant-numeric: tabular-nums;
    font-size: 15px;
}

.slot-radio input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.slot-radio input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Публичная часть: шапка, подвал, каталог ----------------------------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    flex-wrap: wrap;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    font-size: 17px;
    color: var(--text);
    border: 0;
}

.site-brand:hover { border-bottom-color: transparent; }

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

.site-nav a {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    border: 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.site-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 24px 0;
    margin-top: 40px;
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer p { margin: 0; }

/* Герой главной: один акцентный блок вместо карусели — грузится мгновенно. */
.hero {
    padding: 24px 0 8px;
}

.hero h1 {
    font-size: 34px;
    max-width: 20ch;
}

.hero-lead {
    max-width: 56ch;
    color: var(--muted);
    font-size: 17px;
}

.hero-search {
    display: flex;
    gap: 10px;
    margin: 20px 0 14px;
    max-width: 620px;
}

.hero-search .input { flex: 1; }

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

.catalog-section { margin-top: 32px; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.section-head h2 { margin: 0; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.category-chip {
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    text-align: center;
}

.category-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.master-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.master-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 18px;
}

.master-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    border: 0;
    font-weight: 650;
    font-size: 17px;
}

.master-card-head:hover { color: var(--accent); border-bottom-color: transparent; }

.master-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f0799f);
    color: #fff;
    font-size: 17px;
    font-weight: 650;
}

.master-avatar--lg {
    width: 72px;
    height: 72px;
    font-size: 28px;
}

.master-tagline {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.master-meta { margin: 0; }
.master-rating { color: var(--warn); font-weight: 600; }

.master-cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
}

.master-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.master-price { font-weight: 650; }
.master-count { margin: 0; }

.master-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
}

.master-head-main {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.master-head-main h1 { margin-bottom: 4px; }
.master-head-main p { margin: 0 0 6px; }

.master-head-aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 24px;
    border-left: 1px solid var(--line);
}

.master-price-lg {
    margin: 0;
    font-size: 22px;
    font-weight: 650;
}

.master-contacts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    color: var(--muted);
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    align-items: end;
}

.filters-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.result-count { margin: 18px 0 10px; }

.pagination-wrap { margin-top: 22px; }

.empty-state { text-align: center; }
.empty-state .btn { margin-top: 8px; }

.cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cta-card p { margin: 0; }

.pre-line { white-space: pre-line; }

.how-it-works .plain-list li { justify-content: flex-start; }

/* --- Служебное ---------------------------------------------------------- */

.footer-note {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .auth-card { padding: 24px; }

    .schedule-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .page { padding: 20px 0 48px; }

    .week { grid-template-columns: 1fr; }
    .week-day { min-height: 0; }
    .inline-form .field { flex: 1 1 100%; }

    .hero h1 { font-size: 26px; }
    .hero-search { flex-direction: column; }
    .master-head { grid-template-columns: 1fr; }
    .master-head-aside { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--line); }
    .site-nav { order: 3; width: 100%; }
    .site-actions { margin-left: auto; }
}
/* ---------------------------------------------------------------------------
 * Отзывы и рейтинг.
 *
 * Звёзды набираются текстом (★/☆), а не картинками: один символ весит байты
 * вместо килобайт, масштабируется с шрифтом и не требует спрайта. Цвет
 * «пустой» звезды — приглушённый, чтобы 5 из 5 читались как заливка, а не как
 * пять разных значков.
 * ------------------------------------------------------------------------- */

.rating-summary { display: flex; align-items: center; gap: 16px; }

.rating-value {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.rating-bars {
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 160px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rating-bars li {
    display: grid;
    grid-template-columns: 28px 1fr 32px;
    align-items: center;
    gap: 8px;
}

.rating-bar {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        var(--accent) 0,
        var(--accent) var(--fill, 0%),
        var(--line) var(--fill, 0%),
        var(--line) 100%
    );
}

.review-card { display: grid; gap: 12px; padding: 16px; }
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.review-rating { font-size: 16px; letter-spacing: 2px; color: var(--accent); white-space: nowrap; }

.review-reply {
    border-left: 3px solid var(--accent);
    padding: 8px 0 8px 12px;
    background: var(--surface-muted, #faf5f8);
    border-radius: 0 8px 8px 0;
}

.review-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
}

.rating-input { display: flex; gap: 8px; }

.rating-option { cursor: pointer; }

.rating-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.rating-option span {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-weight: 600;
    transition: border-color .15s, background .15s, color .15s;
}

.rating-option:hover span { border-color: var(--accent); }

.rating-option input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.rating-option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

/* --- Универсальные раскладки ------------------------------------------------
   Небольшой набор примитивов вместо утилитарного CSS-фреймворка: верстать
   «карточки списком» и «шапка слева, действие справа» приходится на каждом
   экране, а тянуть ради этого сборку фронтенда мы не стали. */

.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 10px; }

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* Пары «термин — значение»: сроки, призы, суммы. */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 20px;
    margin: 16px 0;
}

.facts dt {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 2px;
}

.facts dd { margin: 0; }

.prose {
    line-height: 1.6;
    max-width: 68ch;
}

.price {
    font-size: 22px;
    font-weight: 700;
    margin: 10px 0;
}

.page-head + .card,
.grid + .card,
.card + .card,
.stack + .card { margin-top: 20px; }


/* --- Мобильный опыт и PWA --------------------------------------------------
   Кабинетом пользуются в основном с телефона, одной рукой, между клиентами.
   Отсюда три правила: палец не должен промахиваться, экран не должен «прыгать»
   из-за адресной строки, а горизонтальная прокрутка не должна появляться
   никогда — на телефоне это выглядит как сломанная вёрстка. */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    /* 100dvh вместо 100vh: в мобильных браузерах высота меняется при
       появлении адресной строки, и фиксированные панели «ездят». */
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Тап-таргеты: 44×44 — минимальный размер, при котором в кнопку попадают
   пальцем, а не «примерно рядом». */
.btn,
button,
input[type="submit"] {
    min-height: 44px;
    touch-action: manipulation;
}

.btn-sm { min-height: 38px; }

@media (pointer: coarse) {
    .btn-sm { min-height: 44px; }
    .input,
    .select,
    .textarea { font-size: 16px; } /* 16px — иначе iOS зумит страницу при фокусе */
}

/* Отступ под домашний индикатор iPhone и жестовую полосу Android. */
.site-header,
.topbar-inner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

.site-footer-inner,
.container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* Панель «нет связи» и предложение установки. */
.pwa-offline {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--warn-soft);
    color: var(--warn);
    padding: 8px 16px;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.pwa-install {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 auto 16px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.pwa-install[hidden],
.pwa-offline[hidden] { display: none; }

.pwa-install-text { display: flex; flex-direction: column; gap: 2px; }
.pwa-install-actions { display: flex; gap: 8px; }

@media (max-width: 720px) {
    /* Навигация кабинета на телефоне: одна строка с горизонтальной прокруткой.
       Переносить пятнадцать ссылок в «бургер» без JS мы не станем, а сжимать
       до нечитаемого — тем более. */
    .topbar-inner nav {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
    }

    .topbar-inner nav::-webkit-scrollbar { display: none; }

    .topbar-inner nav a {
        white-space: nowrap;
        padding: 10px 12px;
    }

    .topbar-inner {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Таблицы на телефоне превращаются в карточки: горизонтальный скролл
       таблицы с суммами — это способ гарантированно ничего не увидеть. */
    .table thead { display: none; }

    .table,
    .table tbody,
    .table tr,
    .table td { display: block; width: 100%; }

    .table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 12px;
        margin-bottom: 10px;
        background: var(--surface);
    }

    .table td {
        border: 0;
        padding: 4px 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
    }

    .table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 13px;
        text-align: left;
        flex: 0 0 auto;
    }

    /* Ячейка без подписи — это действия под карточкой, слева и без «ярлыка». */
    .table td.actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; }
    .table td.actions::before { content: none; }

    .page-head h1 { font-size: 22px; }
    .facts { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Каркас кабинета: боковое меню на компьютере, вкладки на телефоне.
   ==========================================================================

   Мастер работает с телефона в салоне: руки заняты, экран один. Поэтому на
   телефоне кабинет выглядит приложением — нижняя панель вкладок, а не шапка с
   четырнадцатью ссылками в несколько строк. На компьютере наоборот: вертикальный
   список групп читается лучше горизонтальной простыни.                                      */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.app-body {
    background: var(--bg);
    min-height: 100dvh;
}

.app-shell {
    display: flex;
    align-items: flex-start;
    min-height: 100dvh;
}

/* --- Боковое меню (компьютер) ------------------------------------------- */

.sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 248px;
    width: 248px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 14px;
    border-right: 1px solid var(--line);
    background: var(--surface);
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    font-weight: 650;
    color: var(--text);
    border: 0;
}

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

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Заголовок группы — не ссылка и не кнопка: он ничего не делает, поэтому и не
   должен выглядеть кликабельным. */
.nav-group-title {
    margin: 0 0 4px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.sidebar-nav a,
.nav-sheet-grid a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 0;
    color: var(--text);
    font-size: 14px;
}

.sidebar-nav a:hover,
.nav-sheet-grid a:hover {
    background: var(--surface-muted);
}

.sidebar-nav a[aria-current="page"],
.nav-sheet-grid a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav a svg,
.nav-sheet-grid a svg { flex: 0 0 auto; }

.sidebar-foot {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.sidebar-foot form { margin: 0; }

.sidebar-foot .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --- Рабочая область ---------------------------------------------------- */

.app-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* Верхняя полоса существует только на телефоне: на компьютере роль заголовка
   играет боковое меню, и дублировать его незачем. */
.appbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    gap: 10px;
    padding: 12px max(14px, env(safe-area-inset-left)) 12px max(14px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.appbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    color: var(--text);
    font-weight: 650;
}

.appbar-title {
    margin-left: auto;
    font-size: 13px;
    color: var(--muted);
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appbar-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 4px;
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-muted);
    cursor: pointer;
}

/* --- Нижние вкладки (телефон) ------------------------------------------- */

.tabbar {
    display: none;
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom))
        max(8px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
}

.tabbar a,
.tabbar-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 2px;
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
    cursor: pointer;
}

.tabbar a[aria-current="page"] {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

/* --- Лист «Ещё» (телефон) ----------------------------------------------- */

.nav-more-toggle { display: none; }

.nav-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
}

.nav-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 17, .45);
    cursor: pointer;
}

.nav-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px -12px rgba(31, 23, 32, .35);
    padding-bottom: env(safe-area-inset-bottom);
    animation: nav-sheet-up .18s ease-out;
}

@keyframes nav-sheet-up {
    from { transform: translateY(16px); opacity: .6; }
    to { transform: translateY(0); opacity: 1; }
}

.nav-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 8px;
}

.nav-sheet-close {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}

.nav-sheet-body {
    overflow-y: auto;
    padding: 4px 14px 18px;
}

.nav-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 14px;
}

.nav-sheet-logout {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* --- Переключение раскладки --------------------------------------------- */

@media (min-width: 1024px) {
    /* На большом экране телефонные элементы не нужны вовсе. */
    .appbar,
    .tabbar,
    .nav-sheet { display: none; }
}

@media (max-width: 1023px) {
    /* Меню в боковой панели заменяется вкладками и листом «Ещё». */
    .sidebar { display: none; }

    .appbar { display: flex; }

    .tabbar {
        display: grid;
    }

    /* Место под фиксированную панель: иначе последняя кнопка страницы прячется
       за вкладками, и мастер считает, что она не нажимается. */
    .app-content {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .nav-more-toggle:checked ~ .nav-sheet { display: block; }

    /* Открытый лист не должен прокручивать страницу под собой. */
    .nav-more-toggle:checked ~ .app-shell { overflow: hidden; }
}

@media print {
    .topbar,
    .site-header,
    .site-footer,
    .sidebar,
    .appbar,
    .tabbar,
    .nav-sheet,
    .pwa-install,
    .pwa-offline,
    .btn { display: none !important; }
}

/* ==========================================================================
   Главная: первый экран
   Две аудитории в одном экране: мастеру — главный CTA, клиенту — поиск и
   вторичная кнопка. Двухколоночная сетка вместо центрированного текста:
   справа видно, что продаём (карточка мастера), а не абстрактную картинку.
   ========================================================================== */

.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 36px;
    align-items: start;
    padding: 32px 0 8px;
}

.hero-main { min-width: 0; }

.hero-eyebrow {
    display: inline-block;
    margin: 0 0 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

/* Специфичность выше, чем у `.hero h1`: иначе размер из общего правила
   перебивал бы адаптивный clamp. */
.hero-split .hero-title {
    margin: 0 0 16px;
    max-width: 24ch;
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.14;
    letter-spacing: -.03em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 10px;
}

.btn-lg { padding: 13px 22px; font-size: 16px; }

.hero-actions-note { margin: 0 0 16px; }

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 14px;
}

.hero-proof strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* Поиск клиента: «услуга + город». Поля с подписями, а не плейсхолдеры:
   подпись видна и после того, как человек начал печатать. */
.hero-search { margin: 0 0 8px; }

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

.hero-search-field .label { margin: 0; white-space: nowrap; }
.hero-search-city { flex: 0 1 190px; }
.hero-search-hint { margin: 0; }

.hero-visual { min-width: 0; }

.hero-visual-card {
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.hero-visual-card .master-card { box-shadow: none; }

.hero-visual-caption { margin: 10px 0 0; text-align: center; }

/* Пример карточки для пустого каталога: та же анатомия, что у настоящей,
   только без вымышленных цифр в разметке Schema.org. */
.hero-demo { display: grid; gap: 10px; }

.hero-demo-head { display: flex; align-items: center; gap: 12px; }
.hero-demo-head .master-name { margin: 0; font-weight: 650; }
.hero-demo-head .master-meta { margin: 2px 0 0; }

.hero-demo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
}

.hero-demo-price strong { font-size: 17px; }

@media (max-width: 900px) {
    .hero-split { grid-template-columns: 1fr; gap: 24px; }
    .hero-split .hero-title { max-width: none; }
    .hero-search { flex-wrap: wrap; }
    .hero-search .input { flex: 1 1 100%; }
    .hero-search-city { flex: 1 1 100%; }
}

/* --- Город в шапке и окно выбора города --------------------------------- */

/* Кнопка: только название города. Полный список живёт в окне — держать в
   шапке select из сотни пунктов значит отдать навигации чужое место. */
.city-picker-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.city-picker-trigger:hover { border-color: #d9c2d3; }

.city-picker-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.city-picker-pin,
.city-picker-caret { flex: 0 0 auto; color: var(--accent); }

.city-picker-caret { color: var(--muted); }

.city-picker-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.city-picker {
    width: min(520px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 64px));
    padding: 0;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(28, 20, 32, .28);
    color: var(--text);
}

.city-picker::backdrop {
    background: rgba(24, 18, 28, .48);
    backdrop-filter: blur(2px);
}

.city-picker-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 18px 16px;
}

.city-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.city-picker-title {
    margin: 0;
    font-size: 18px;
}

.city-picker-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
}

.city-picker-search {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
}

.city-picker-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(194, 39, 107, .12);
}

.city-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
    max-height: min(420px, 50vh);
}

.city-picker-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #faf7f9;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.city-picker-option:hover { background: #f3e9f0; }

.city-picker-option.is-current {
    border-color: var(--accent);
    background: #fdf1f6;
}

.city-picker-name { font-size: 15px; font-weight: 600; }

.city-picker-region {
    font-size: 12px;
    color: var(--muted);
}

.city-picker-empty {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.city-picker-hint { margin: 0; }

@media (max-width: 720px) {
    .city-picker-trigger { max-width: 46vw; padding: 6px 9px; font-size: 13px; }

    .city-picker-list {
        grid-template-columns: 1fr;
        max-height: min(52vh, 420px);
    }
}

/* Старый переключатель: остаётся, пока где-то используется select. */
.city-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.select-sm { padding: 7px 10px; font-size: 14px; }

.city-switcher-submit {
    padding: 7px 8px;
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 720px) {
    /* Шапка на телефоне: меню уходит в свою строку и прокручивается, чтобы
       не расти в три ряда и не сдвигать первый экран вниз. */
    .site-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .site-nav::-webkit-scrollbar { display: none; }
    .site-nav a { white-space: nowrap; }

    /* Кнопка «Показать» не нужна: select отправляет форму сам. */
    .city-switcher-submit { display: none; }
}

/* ==========================================================================
   Главная: блоки «кому», каталог, тарифы, вопросы, финальный призыв, подвал
   ========================================================================== */

.section-sub { margin: 4px 0 0; }

/* --- Две аудитории ------------------------------------------------------ */

.audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.audience-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.audience-card h3 { margin: 0; font-size: 19px; }
.audience-lead { margin: 0; }

.audience-points {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
}

.audience-points li {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface-muted);
}

/* Три строки внутри одной боли: проблема, что делает продукт, что получает
   человек. Разные размеры и цвета — чтобы блок читался как аргумент, а не
   как список равнозначных пунктов. */
.audience-pain { margin: 0; font-size: 14px; color: var(--muted); }
.audience-fix { margin: 4px 0 0; font-weight: 600; }
.audience-result { margin: 2px 0 0; color: var(--ok); }

/* --- Чипсы услуг в превью каталога -------------------------------------- */

.category-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}

.category-chips .category-chip {
    padding: 8px 14px;
    font-size: 14px;
}

.category-chip--active {
    border-color: var(--accent);
    color: var(--accent);
}

.catalog-section-footer { margin: 18px 0 0; }

/* --- Как это работает --------------------------------------------------- */

.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.how-title {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.steps-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps-list li {
    display: grid;
    gap: 2px;
    position: relative;
    padding-left: 34px;
    counter-increment: step;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 650;
}

/* --- Тарифы ------------------------------------------------------------- */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.price-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

/* Средний тариф выделен рамкой, а не «популярнее» без объяснения: рядом
   написано, что именно даёт пробный период. */
.price-card--featured {
    border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(194, 39, 107, .12), 0 14px 30px -18px rgba(194, 39, 107, .45);
}

.price-badge { align-self: flex-start; }
.price-name { margin: 0; font-size: 18px; }

.price-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
}

.price-value { font-size: 30px; letter-spacing: -.02em; }
.price-note { margin: 0; }
.price-features { flex: 1; margin: 0; }
.price-missing { margin: 0; color: var(--muted); }
.pricing-note { margin: 14px 0 0; }

/* --- Частые вопросы ----------------------------------------------------- */

.faq-list {
    display: grid;
    gap: 8px;
}

.faq-item {
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.faq-item[open] { border-color: var(--accent); }

.faq-question {
    padding: 14px 0;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

/* Нативный маркер убираем, но оставляем свой: без него <summary> выглядит
   как обычный текст, и человек не догадывается, что блок раскрывается. */
.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
    content: '+';
    float: right;
    color: var(--accent);
    font-weight: 600;
}

.faq-item[open] .faq-question::after { content: '−'; }

.faq-answer {
    margin: 0 0 16px;
    color: var(--muted);
}

/* --- Финальный призыв --------------------------------------------------- */

.cta-final {
    margin: 40px 0 8px;
    padding: 32px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(600px 240px at 15% 0%, var(--accent-soft), transparent 70%),
        var(--surface);
    text-align: center;
}

.cta-final-title {
    margin: 0 auto 12px;
    max-width: 28ch;
    font-size: clamp(22px, 2.6vw, 30px);
}

.cta-final-lead {
    margin: 0 auto 20px;
    max-width: 56ch;
    color: var(--muted);
}

.cta-final-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.cta-final-note { margin: 14px 0 0; }

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

.site-footer-grid {
    align-items: start;
    gap: 24px 32px;
    padding-top: 32px;
    padding-bottom: 24px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.footer-col--brand {
    flex: 1 1 240px;
    max-width: 320px;
    gap: 8px;
}

.footer-title {
    margin: 0 0 4px;
    font-weight: 650;
    color: var(--text);
}

.footer-col a { color: var(--muted); font-size: 14px; }
.footer-col a:hover { color: var(--accent); }

.footer-services {
    padding: 16px 20px 8px;
    border-top: 1px solid var(--line);
}

.footer-services-title { margin: 0 0 8px; }

.footer-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.footer-services-list a { color: var(--muted); }
.footer-services-list a:hover { color: var(--accent); }

.footer-legal {
    padding-top: 12px;
    padding-bottom: 24px;
    border-top: 1px solid var(--line);
}

.footer-legal p { margin: 0; }

@media (max-width: 720px) {
    .cta-final { padding: 26px 18px; }
    .price-value { font-size: 26px; }
}

/* --- Карта -------------------------------------------------------------- */

.yandex-map {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
    overflow: hidden;
}

.yandex-map-canvas {
    width: 100%;
    /* position:relative нужен карте: без него Яндекс.Карты выходят за границы
       блока и ломают вёрстку соседних секций. */
    position: relative;
    z-index: 0;
}

.map-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

/* Кнопки-чипсы внутри формы фильтра — это <button>, а не <a>: смена фильтра
   не меняет адрес страницы, и делать её ссылкой значило бы обещать навигацию. */
.map-filters .category-chip {
    cursor: pointer;
    background: none;
    font: inherit;
    font-size: 14px;
}

.yandex-map-message {
    margin: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

/* Балун внутри карты: Яндекс вставляет его в свой DOM, поэтому стили
   приходится писать от класса, который мы сами и создаём. */
.map-balloon { max-width: 240px; font-size: 14px; }
.map-balloon-meta { margin-top: 4px; color: var(--muted); }
.map-balloon-link { display: inline-block; margin-top: 8px; color: var(--accent); }

.map-hint { margin-top: 16px; }

/* --- Демонстрация продукта ---------------------------------------------- */

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.demo-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.demo-card h3 { margin: 4px 0 0; font-size: 17px; }
.demo-card p { margin: 0; }

/* Схема экрана: приглушённый фон и мелкая сетка, чтобы мокап читался как
   схема, а не как настоящий скриншот. */
.demo-screen {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface-muted);
    font-size: 12px;
    color: var(--muted);
    min-height: 150px;
}

.demo-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.demo-row--head { font-weight: 650; color: var(--text); }

.demo-slot {
    display: grid;
    place-content: center;
    padding: 6px;
    border-radius: 6px;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    text-align: center;
    color: var(--text);
}

.demo-slot small { color: var(--muted); }
.demo-slot--free { border-left-color: var(--line); color: var(--muted); }
.demo-slot--paid { border-left-color: var(--ok); }

.demo-metric-label { margin: 0; font-size: 12px; }
.demo-metric { margin: 0; font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.1; }
.demo-metric-sub { margin: 0; font-size: 11px; line-height: 1.4; }

.demo-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 56px;
    margin-top: 6px;
}

.demo-bars span {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: var(--accent-soft);
    border-top: 2px solid var(--accent);
}

.demo-client-name { margin: 0; font-weight: 650; color: var(--text); }

.demo-client-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.demo-client-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--line);
}

.demo-client-list strong { color: var(--text); font-weight: 600; }

/* --- Сравнение ---------------------------------------------------------- */

.compare-wrap { overflow-x: auto; }

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}

.compare-table th,
.compare-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.compare-table thead th {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.compare-table tbody th {
    font-weight: 600;
    width: 22%;
}

/* Колонка «про нас» подсвечена: таблица читается слева направо, и последний
   столбец — тот, ради которого её открыли. */
.compare-own {
    background: var(--accent-soft);
    font-weight: 500;
}

.compare-table thead .compare-own { color: var(--accent); }

.comparison-note { margin: 14px 0 0; }

/* --- Отзывы ------------------------------------------------------------- */

.reviews-aggregate {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.reviews-aggregate strong { font-size: 24px; }

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.review-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.review-stars {
    margin: 0;
    color: #e0a300;
    letter-spacing: .08em;
}

.review-text {
    margin: 0;
    flex: 1;
    /* Длинный отзыв не должен растягивать сетку: четыре карточки разной
       высоты выглядят как ошибка вёрстки. */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-author { margin: 0; }

/* Скрыто визуально, но доступно скринридеру: <caption> у таблицы сравнения
   нужен для озвучки, а рисовать его над таблицей незачем. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Блог --------------------------------------------------------------- */

.blog-chips { margin-bottom: 20px; }

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.article-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

/* Заголовок карточки — ссылка, но не подчёркнутая: подчёркивание на всю
   ширину карточки читается как гиперссылка из 2006-го. Ховер меняет цвет. */
.article-card-title {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
}

.article-card-title a { color: inherit; text-decoration: none; }
.article-card-title a:hover { color: var(--accent); }

.article-meta { margin: 0; }
.article-card p:last-child { margin-bottom: 0; }

.article-header { margin-bottom: 20px; }

.article-cover {
    display: block;
    width: 100%;
    height: auto;
    margin: 16px 0 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

/* Текст статьи: типографика здесь, а не в инлайн-стилях редактора.
   Markdown приходит как «сырые» теги p/h2/ul, и стилизовать их можно только
   от контейнера. */
.article-body {
    max-width: 72ch;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
}

.article-body h2 {
    margin: 32px 0 12px;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.article-body h3 {
    margin: 24px 0 10px;
    font-size: 19px;
}

.article-body p { margin: 0 0 14px; }

.article-body ul,
.article-body ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.article-body li { margin-bottom: 6px; }

.article-body blockquote {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-left: 3px solid var(--accent);
    background: var(--surface-muted);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--muted);
}

.article-body code {
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--surface-muted);
    font-size: 15px;
}

.article-body pre {
    padding: 14px 16px;
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.article-body pre code { padding: 0; background: none; }

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.article-body a { color: var(--accent); }

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 15px;
}

.article-body th,
.article-body td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.article-footer {
    max-width: 72ch;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
    .article-body { font-size: 16px; }
}

/* --- Реклама ------------------------------------------------------------ */

/* Маркировка стоит над блоком и в рамке, отдельной от тела: её не должно
   быть возможности «проморгать» — этого требует закон, а не вкус. */
.ad-slot {
    margin: 24px 0 0;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
}

.ad-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--muted);
}

.ad-label-mark {
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.ad-label-partner { font-weight: 600; }
.ad-label-erid { font-variant-numeric: tabular-nums; }

.ad-body {
    display: flex;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.ad-body:hover .ad-title { color: var(--accent); }

.ad-image {
    flex: 0 0 auto;
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--radius);
}

.ad-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ad-title { font-size: 15px; }
.ad-description { font-size: 13px; color: var(--muted); }

.ad-cta {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

@media (max-width: 560px) {
    .ad-image { width: 84px; height: 48px; }
}

/* --- Админка: мелкие формы и чек-листы ---------------------------------- */

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.form-inline .field { flex: 1 1 180px; }

.masters-fieldset {
    max-height: 420px;
    overflow-y: auto;
    padding: 0 12px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.masters-checklist {
    display: grid;
    gap: 6px;
}

.checkbox-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.collections-note { margin: 16px 0 0; }






/* --- Страница мастера: первый экран ------------------------------------- */

/* Медиа слева, карточка справа: клиент сразу видит «кто» и «когда», а не
   прокручивает абзац о философии мастера. */
.master-hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    margin: 16px 0 20px;
}

.master-hero-media {
    position: relative;
    overflow: hidden;
    min-height: 240px;
    border-radius: var(--radius-lg);
    background-image: var(--cover);
    background-size: cover;
    background-position: center;
}

.master-hero-media--empty {
    background-image:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .35), transparent 55%),
        linear-gradient(135deg, var(--accent), #f0799f);
}

.master-hero-avatar {
    position: absolute;
    inset: auto auto 16px 16px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--surface);
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(31, 23, 32, .18);
}

.master-hero-initial {
    position: absolute;
    inset: auto auto 12px 20px;
    font-size: 96px;
    font-weight: 700;
    line-height: 1;
    /* Обложки светлые, поэтому инициал тёмный. Белая буква исчезала на них —
       ровно тот случай, когда «красиво» и «видно» расходятся. */
    color: rgba(34, 26, 34, .28);
}

/* Заглушка без обложки залита акцентом — на ней белая буква читается лучше. */
.master-hero-media--empty .master-hero-initial {
    color: rgba(255, 255, 255, .9);
}

.master-hero-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.master-hero-name {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.15;
}

.master-hero-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.master-hero-stars { color: var(--accent); }

.master-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.master-slot-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.master-slot-value { font-size: 17px; }

.master-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.master-hero-actions .btn { padding-inline: 26px; }

.master-hero-price {
    font-size: 20px;
    font-weight: 700;
}

.master-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.master-trust li {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    color: var(--muted);
}

.master-trust li::before {
    content: "✓";
    margin-right: 6px;
    color: var(--accent);
    font-weight: 700;
}

/* --- Услуги списком карточек -------------------------------------------- */

.service-cards {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.service-card {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.service-card-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.service-card-name { font-size: 15px; }

.service-card-aside {
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-card-price {
    font-weight: 700;
    white-space: nowrap;
}

.reviews-more { margin-top: 14px; }

.reviews-more > summary {
    cursor: pointer;
    padding: 10px 0;
    font-weight: 600;
    color: var(--accent);
}

/* --- Липкая кнопка записи на телефоне ----------------------------------- */

.sticky-book { display: none; }

@media (max-width: 860px) {
    .master-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .master-hero-media { min-height: 180px; }
}

@media (max-width: 720px) {
    .sticky-book {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 40;
        display: block;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: var(--surface);
    }

    /* Чтобы липкая кнопка не закрывала подвал. */
    .master-hero ~ .cta-card,
    body:has(.sticky-book) .site-footer { padding-bottom: 72px; }
}

/* --- Заглушка рекламы и блок сети --------------------------------------- */

/* Заглушка занимает настоящий размер блока: рекламодатель видит, что
   покупает, а вёрстка не «дышит» при включении рекламы. */
.ad-slot--empty {
    border-style: dashed;
    border-color: var(--line);
    background: transparent;
    padding: 10px;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    max-width: var(--ad-width, 970px);
    min-height: calc(var(--ad-height, 250px) / 2);
    margin: 0 auto;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface-muted);
    text-align: center;
}

.ad-placeholder-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.ad-placeholder-size {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.ad-placeholder-link {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.ad-network {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(var(--ad-height, 250px) / 2);
    overflow: hidden;
}

.ad-slot--network { border-style: solid; }

@media (max-width: 720px) {
    .ad-placeholder { min-height: 90px; }
    .ad-network { min-height: 90px; }
}

/* --- Словарь ------------------------------------------------------------ */

.glossary-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 24px;
}

.glossary-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.glossary-letter[aria-current="page"] {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.glossary-group { margin-bottom: 28px; }

.glossary-group-letter {
    margin: 0 0 10px;
    font-size: 22px;
    color: var(--accent);
}

.glossary-list { margin: 0; }

.glossary-item {
    display: grid;
    gap: 2px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

/* Карточка термина: иллюстрация темы слева, текст справа. Без картинки
   (тема не задана) остаётся прежний вид в одну колонку. */
.glossary-item:has(.glossary-item-cover) {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.glossary-item-cover {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    object-fit: cover;
}

.glossary-item-body { min-width: 0; }

.glossary-item:last-child { border-bottom: 0; }
.glossary-item dt { margin: 0; font-weight: 600; }
.glossary-item dd { margin: 0; }

.glossary-term { text-decoration: none; }
.glossary-term:hover { text-decoration: underline; }

.glossary-hero-cover {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 0 12px;
    border-radius: 18px;
    border: 1px solid var(--line);
    object-fit: cover;
}

.glossary-letter-mark {
    margin: 0;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-soft-strong, var(--accent));
    opacity: .35;
}

.glossary-related { margin: 0; padding-left: 18px; }
.glossary-related li { margin-bottom: 6px; }

/* Автолинковка: ссылка в тексте не должна кричать — она часть текста,
   а не отдельный элемент интерфейса. */
.glossary-link {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    color: inherit;
}

.glossary-link:hover { color: var(--accent); }

/* Чипы терминов в статье: обратная ссылка статья → словарь. */
.article-glossary { margin-bottom: 16px; }

.article-glossary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.glossary-chip {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
}

.glossary-chip:hover { border-color: var(--accent); color: var(--accent); }

/* --- Подсказка города по IP -------------------------------------------- */

.geo-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--accent-soft);
    font-size: 14px;
}

.geo-offer-text { margin: 0; }

.geo-offer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.geo-offer-actions form { margin: 0; }

.geo-offer-link { color: var(--accent); }

/* ------------------------------------------------------------------
   Окно подтверждения города.

   Модальное окно вместо полосы в шапке: полосу пролистывают не читая,
   а город — это выбор, который влияет на весь каталог.
   ------------------------------------------------------------------ */
.city-confirm {
    width: min(420px, calc(100vw - 32px));
    padding: 22px 22px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 24px 60px -24px rgba(34, 26, 34, .35);
    color: var(--text);
}

.city-confirm::backdrop {
    background: rgba(34, 26, 34, .38);
    backdrop-filter: blur(2px);
}

.city-confirm-form { margin: 0; }

.city-confirm-title {
    margin: 0 0 6px;
    font-size: 19px;
    line-height: 1.3;
}

.city-confirm-title strong { color: var(--accent); }

.city-confirm-hint { margin: 0 0 16px; }

.city-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-confirm-actions .btn { flex: 1 1 auto; }

.city-confirm-decline {
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.city-confirm-decline:hover { color: var(--accent); }

@media (max-width: 720px) {
    .geo-offer { font-size: 13px; }
    .geo-offer-actions { width: 100%; }
    .city-confirm { padding: 18px 16px 12px; }
}

/* Кнопка «все города» в подвале: выглядит ссылкой, но открывает окно выбора. */
.footer-more {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.footer-more:hover { text-decoration: underline; }

/* --- «Всё занято»: демо-карточки и страница записи ---------------------- */

.master-slot--busy {
    border-color: #e8c8a0;
    background: #fdf6ec;
}

.master-slot--busy .master-slot-value { color: #9a5b12; }

.booking-full { max-width: 720px; margin: 0 auto; }

.booking-full-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* --- Обложки статей ----------------------------------------------------- */

.article-card-cover {
    display: block;
    margin: -4px -4px 12px;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1200 / 630;
    background: #f0ecef;
}

.article-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-cover {
    display: block;
    width: 100%;
    height: auto;
    margin: 16px 0 8px;
    border-radius: 14px;
}

.portal-master-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 28px;
    padding: clamp(18px, 4vw, 36px);
    background: #f3edfc;
    border-color: #e6daf7;
}
.portal-master-cta p { margin: 0; color: var(--muted); }

.dashboard-workspace {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    align-items: start;
    gap: 16px;
}
.dashboard-workspace > .card { margin: 0; }
.dashboard-visit, .booking-link-card {
    padding: clamp(18px, 3vw, 28px);
    border-color: #e6daf7;
    background: linear-gradient(140deg, #f8f2fe, #fff 80%);
}
.dashboard-visit-time { margin: 10px 0 4px; font-size: clamp(1.2rem, 3vw, 1.65rem); font-weight: 720; }
.dashboard-progress { max-width: 430px; margin: 14px 0 18px; padding: 0; list-style: none; }
.dashboard-progress li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; padding: 6px 0; }
.dashboard-stats, .dashboard-verification { margin-top: 16px; }
.booking-link-feedback { margin: 8px 0 0; color: var(--ok); }
.booking-link-feedback:empty { margin: 0; }
.booking-link-card [hidden] { display: none; }

.booking-page { max-width: 930px; }
.booking-identity {
    padding: clamp(20px, 5vw, 36px);
    background: linear-gradient(125deg, #f8f2fd, #efe8fc);
    border-color: #e7dcf3;
    border-radius: 22px;
}
.booking-identity h1 { margin-bottom: 6px; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.booking-identity p:last-child { margin-bottom: 0; }
.booking-kicker { margin-bottom: 8px; color: #5436a4; font-size: .875rem; font-weight: 700; }
.booking-service-form { align-items: flex-end; gap: 12px; }
.booking-service-form .field { flex: 1 1 300px; margin: 0; }
.booking-service-form button { min-height: 44px; }
.booking-service-meta { flex: 1 0 100%; margin: 0; color: var(--muted); }
.booking-request { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .7fr); gap: 22px; }
.booking-slot-picker, .booking-request .day-block { min-width: 0; margin: 0; padding: 0; border: 0; }
.booking-slot-picker > legend { padding: 0; font-weight: 700; }
.booking-request .days { max-height: 435px; overflow-y: auto; padding: 2px 6px 6px 2px; }
.booking-request .day-label { padding: 0; margin-bottom: 5px; }
.booking-request .slot-radio span { min-height: 44px; }
.booking-contact { align-self: start; padding: 16px; background: var(--surface-muted); border-radius: 14px; }
.booking-contact .field-row { grid-template-columns: 1fr; }
.booking-contact .checkbox a { text-decoration: underline; }
.booking-contact .form-actions .btn { width: 100%; }
@media (max-width: 650px) {
    .booking-request { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .booking-service-form button { width: 100%; }
}

.dashboard-trial {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 18px;
}
.dashboard-trial p { margin: 0; }

.site-header {
    background: var(--surface);
    box-shadow: 0 2px 10px #24163806;
}

.site-header-inner { gap: 12px 22px; }
.site-nav a, .topbar nav a { font-weight: 550; }
.site-footer {
    --text: #fff;
    --muted: #d3cae4;
    --line: #ffffff25;
    --accent: #e9ddff;
    color: var(--text);
    background: #281c40;
}
.site-footer .site-brand, .site-footer .footer-title { color: #fff; }

.portal-hero {
    align-items: center;
    gap: clamp(20px, 4vw, 58px);
    padding: clamp(20px, 4vw, 46px);
    border: 1px solid #e6dcf3;
    border-radius: 30px;
    background: linear-gradient(135deg, #f8f2fd, #ede6fa);
}
.portal-hero .hero-title {
    max-width: 13ch;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 1;
    letter-spacing: -.055em;
    text-wrap: balance;
}
.portal-hero .hero-lead { max-width: 36ch; color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); }
.portal-hero .hero-search { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: end; gap: 10px; }
.portal-hero .hero-search .btn { grid-column: 1 / -1; justify-self: start; }
.portal-hero-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1.12;
    object-fit: cover;
    border-radius: 22px;
    background: var(--accent-soft);
}

.page-title, .page-head h1 {
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    letter-spacing: -.042em;
}
.section-head h2, .section-title { font-size: clamp(1.35rem, 2.5vw, 1.95rem); letter-spacing: -.035em; }
.category-chip, .glossary-letter { background: var(--surface); }
.master-card, .article-card, .glossary-item { transition: border-color .16s ease, box-shadow .16s ease; }
.master-card:focus-within, .master-card:hover,
.article-card:focus-within, .article-card:hover,
.glossary-item:focus-within, .glossary-item:hover {
    border-color: #bda9e5;
    box-shadow: var(--shadow);
}
.master-hero { border-color: #e6dcf3; }
.master-hero-media--empty { background: linear-gradient(140deg, #e8dcfa, #f6edf9); }

.auth-shell {
    grid-template-columns: minmax(0, 460px) minmax(0, 620px);
    justify-content: center;
    align-content: center;
    align-items: stretch;
    gap: 18px;
    padding: clamp(20px, 5vw, 56px);
}
.auth-visual {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    border-radius: var(--radius-lg);
    background: #2b2042;
}
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 64% center; }
.auth-card {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    justify-content: center;
    max-width: none;
    padding: clamp(20px, 4vw, 42px);
}
.auth-card h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.auth-brand { color: var(--text); }

.app-body .sidebar { background: #f0ebf9; border-right-color: #e6dcef; }
.app-body .sidebar-brand { min-height: 48px; }
.app-body .nav-group-title { color: #66577d; }
.app-body .sidebar-nav a[aria-current="page"] {
    background: #e0d4f7;
    color: #47268e;
    box-shadow: inset 3px 0 #7150c2;
}
.app-body .appbar, .app-body .tabbar { background: #fff; }
.app-body .tabbar a[aria-current="page"] { color: #572da4; }
.app-content .stat { border-color: var(--line); background: #fff; }
.table thead th { background: #f1ecf8; color: #473b58; }

.admin-body .topbar {
    --line: #ffffff26;
    --text: #fff;
    --muted: #ded3ee;
    --accent-soft: #473464;
    --accent: #f1e7ff;
    background: #281c40;
}
.admin-body .topbar-inner { align-items: flex-start; gap: 10px 24px; }
.admin-body .topbar nav { margin-left: 0; align-items: center; }
.admin-body .topbar .btn-ghost { color: #f1e7ff; }
.admin-body .topbar .btn-ghost:hover { background: #473464; border-color: #756195; }

.editorial-heading {
    padding: clamp(22px, 5vw, 52px);
    margin-bottom: 20px;
    border: 1px solid #e6dcf3;
    border-radius: var(--radius-lg);
    background: linear-gradient(125deg, #f6eefb, #eee8fa);
}
.editorial-heading .page-title { max-width: 23ch; margin-bottom: 10px; }
.editorial-heading .lead { max-width: 58ch; margin-bottom: 0; color: var(--muted); }
.article-card { overflow: hidden; gap: 10px; padding: 18px; box-shadow: none; }
.article-card-title { font-size: clamp(1.05rem, 2vw, 1.28rem); overflow-wrap: anywhere; }
.article-card-cover { margin: -18px -18px 4px; border-radius: 0; }
.article-card-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-header .lead { max-width: 60ch; color: var(--muted); }
.article-cover { aspect-ratio: 2 / 1; object-fit: cover; }
.article-body { font-size: 1.08rem; line-height: 1.72; }
.article-footer { max-width: 72ch; }
.glossary-search { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; max-width: 680px; margin-top: 20px; }
.glossary-search .field { flex: 1 1 210px; margin: 0; }
.glossary-letters { gap: 7px; }
.glossary-letter { min-width: 42px; min-height: 42px; }
.glossary-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.glossary-item, .glossary-item:last-child { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.glossary-term { color: #332452; font-size: 1rem; }
.glossary-term:hover { color: var(--accent); }

@media (max-width: 780px) {
    .auth-shell { grid-template-columns: minmax(0, 620px); }
    .auth-visual { display: none; }
    .portal-hero { grid-template-columns: 1fr; }
    .portal-hero-photo { aspect-ratio: 16 / 10; }
}
@media (max-width: 480px) {
    .portal-hero { border-radius: 22px; }
    .portal-hero .hero-search { grid-template-columns: minmax(0, 1fr); }
    .portal-hero .hero-search .btn { width: 100%; }
        .glossary-search .btn { flex: 1 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .master-card, .article-card, .glossary-item { transition: none; }
}

@media (max-width: 720px) {
    .site-header:not(.studio-header) .site-header-inner {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 6px 0;
        padding-block: 8px;
    }
    .site-header:not(.studio-header) .site-brand {
        grid-area: 1 / 1 / 2 / 6;
        gap: 6px;
        font-size: .92rem;
    }
    .site-header:not(.studio-header) .brand-mark { flex: 0 0 30px; width: 30px; height: 30px; }
    .site-header:not(.studio-header) .site-actions { display: contents; }
    .site-header:not(.studio-header) .city-picker-trigger {
        grid-area: 1 / 6 / 2 / 10;
        justify-self: end;
        max-width: 100%;
        min-height: 44px;
        padding-inline: 5px;
    }
    .site-header:not(.studio-header) .site-actions > a:not(.btn-primary) {
        grid-area: 1 / 10 / 2 / 13;
        justify-self: end;
        min-height: 44px;
        padding-inline: 8px;
    }
    .site-header:not(.studio-header) .site-actions > .btn-primary {
        grid-area: 2 / 9 / 3 / 13;
        justify-self: end;
        min-height: 44px;
        padding-inline: 7px;
        white-space: nowrap;
    }
    .site-header:not(.studio-header) .site-nav {
        grid-area: 2 / 1 / 3 / 9;
        width: auto;
        min-width: 0;
        align-items: center;
        gap: 0;
    }
    .site-header:not(.studio-header) .site-header-inner:not(:has(.site-actions > .btn-primary)) .site-nav {
        grid-column: 1 / -1;
    }
    .site-header:not(.studio-header) .site-nav a { padding-inline: 8px; }
}

@media (max-width: 375px) {
    .site-header:not(.studio-header) .site-brand { grid-column-end: 7; }
    .site-header:not(.studio-header) .city-picker-trigger { grid-column-start: 7; }
    .site-header:not(.studio-header) .site-actions > .btn-primary { grid-column-start: 8; }
    .site-header:not(.studio-header) .site-header-inner:has(.site-actions > .btn-primary) .site-nav {
        grid-column-end: 8;
    }
}
