:root {
    /* Marble & stone palette — light, solemn, restrained */
    --bg: #f1f0ec;
    --surface: #fbfaf8;
    --surface-2: #ebe9e2;
    --text: #24272b;
    --muted: #5c6168;
    --faint: #94918a;
    --line: #ddd9cf;
    --accent: #3a434e;
    --accent-deep: #2c343d;
    --accent-soft: #e6e8ea;
    /* Muted engraving bronze — used sparingly, as a whisper */
    --gold: #9a8456;
    --gold-soft: #efe8d7;
    --danger: #8f3a33;
    --danger-soft: #f4e9e6;
    --success: #3c5d49;
    --success-soft: #e9efe9;
    --radius: 4px;
    --radius-sm: 3px;
    --shadow: 0 1px 2px rgba(31, 29, 24, .05), 0 10px 34px rgba(31, 29, 24, .06);
    /* Inscriptional display — high stroke contrast, vertical axis, like carved stone/bronze */
    --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --serif: 'Lora', Georgia, 'PT Serif', 'Times New Roman', serif;
    --sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* sticky footer — keep the footer pinned to the bottom on short pages */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* content area grows to push the footer down */
main { flex: 1 0 auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: .005em; }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }
.container-wide { max-width: 1040px; }

/* ===== Top navigation (app pages) ===== */
.topnav {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 60;
    transition: box-shadow .25s ease, background-color .25s ease;
}
/* при прокрутке шапка мягко «отрывается» от страницы */
.topnav.is-scrolled {
    background: rgba(251, 250, 248, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(31, 29, 24, .07);
    border-bottom-color: transparent;
}
.topnav-inner {
    display: flex; align-items: center; gap: 16px;
    height: 60px;
}
.brand {
    font-family: var(--display); font-size: 22px; font-weight: 600;
    color: var(--text); text-transform: uppercase; letter-spacing: .22em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 18px; font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: .03em; }
.nav-links .muted { color: var(--faint); }

/* ===== Flash messages ===== */
.flash { padding: 11px 15px; border-radius: var(--radius-sm); margin: 16px 0; font-size: 14.5px; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: #d4e0d6; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #e6cfca; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: var(--display); font-weight: 500; font-size: 14.5px; line-height: 1; letter-spacing: .03em;
    padding: 11px 18px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
    cursor: pointer; transition: background .18s, border-color .18s, color .18s, transform .18s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--surface-2); border-color: #cfcabd; text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31, 29, 24, .08); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fbfaf8; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-danger { color: var(--danger); border-color: #e3cdc9; background: var(--danger-soft); }
.btn-danger:hover { background: #f1ded9; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== Forms ===== */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 6px; }
.input, .textarea, .select {
    width: 100%; font-family: var(--sans); font-size: 15px; color: var(--text);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field-row { display: flex; gap: 14px; }
.field-row > .field { flex: 1; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; }
.checkbox-row input { margin-top: 4px; }
.checkbox-row label { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--muted); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 5px; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 5px; }

/* ===== Generic page ===== */
.page { padding: 32px 0 64px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.page-head h1 { font-size: 27px; margin: 0; }
.page-head .spacer { margin-left: auto; }
.section-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint);
    margin: 30px 0 14px;
}
.section-title::before { content: ""; width: 16px; height: 1px; background: var(--gold); flex: none; }

/* ===== Cards / list ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item { display: flex; align-items: center; gap: 14px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-family: var(--display); font-size: 19px; }
.list-item .sub { color: var(--muted); font-size: 13.5px; }
/* Тариф страницы — тихая бронзовая пометка с гравированным ромбом (как маркеры тарифов) */
.list-item .plan-tag {
    margin-top: 6px;
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
    color: var(--gold);
}
.list-item .plan-tag::before {
    content: ""; flex: none;
    width: 5px; height: 5px; transform: rotate(45deg);
    background: var(--surface); border: 1px solid var(--gold);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty { text-align: center; color: var(--faint); padding: 44px 16px; font-family: var(--serif); font-style: italic; font-size: 16px; }

.badge { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge-private { background: #f1ece2; color: #8a6d3b; border-color: #e6dcc6; }
.badge-public { background: var(--success-soft); color: var(--success); border-color: #d4e0d6; }
.badge-new { background: var(--danger-soft); color: var(--danger); border-color: #e6cfca; }

/* ===== Memorial page ===== */
.memorial {
    background:
        radial-gradient(150% 72% at 50% -12%, #ffffff 0%, rgba(255, 255, 255, 0) 56%),
        var(--bg);
    background-attachment: fixed;
}
.memorial-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 30px 0;
}
/* Calm marble field with a fine cornice line — the niche the portrait sets into */
.cover {
    height: 132px;
    background: linear-gradient(180deg, #eceadf 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--gold-soft);
}
.memorial-head { padding: 0 28px 28px; text-align: center; }

/* The arched portrait niche — the central architectural motif */
.avatar {
    width: 120px; height: 146px;
    border-radius: 60px 60px 5px 5px;
    margin: -84px auto 18px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    object-fit: cover; object-position: center top;
    box-shadow: 0 0 0 7px var(--surface), 0 12px 30px rgba(31, 29, 24, .13);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--display); font-size: 50px; font-weight: 500; color: var(--faint);
}
.memorial-name { font-family: var(--display); font-size: 41px; font-weight: 600; letter-spacing: .01em; line-height: 1.12; color: var(--text); }
.memorial-dates { font-family: var(--serif); color: var(--muted); font-size: 15px; margin-top: 9px; letter-spacing: .03em; }
.memorial-place { color: var(--faint); font-size: 13px; margin-top: 5px; }
.epitaph { font-family: var(--serif); font-style: italic; font-size: 17.5px; color: var(--muted); margin: 18px auto 0; max-width: 34ch; line-height: 1.6; }
/* Engraved divider ornament: a fine rule with a central diamond */
.memorial-head::after {
    content: "";
    display: block;
    width: 168px; height: 12px;
    margin: 24px auto 2px;
    opacity: .9;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='12' viewBox='0 0 168 12'%3E%3Cg fill='none' stroke='%239a8456' stroke-width='1'%3E%3Cline x1='12' y1='6' x2='71' y2='6'/%3E%3Cline x1='97' y1='6' x2='156' y2='6'/%3E%3C/g%3E%3Cpath d='M84 1.6 L88.4 6 L84 10.4 L79.6 6 Z' fill='%239a8456'/%3E%3Ccircle cx='6' cy='6' r='1.4' fill='%239a8456'/%3E%3Ccircle cx='162' cy='6' r='1.4' fill='%239a8456'/%3E%3C/svg%3E");
}

/* Reusable engraved divider ornament (landing, sections) */
.ornament {
    width: 168px; height: 12px; margin: 20px auto; opacity: .9;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='12' viewBox='0 0 168 12'%3E%3Cg fill='none' stroke='%239a8456' stroke-width='1'%3E%3Cline x1='12' y1='6' x2='71' y2='6'/%3E%3Cline x1='97' y1='6' x2='156' y2='6'/%3E%3C/g%3E%3Cpath d='M84 1.6 L88.4 6 L84 10.4 L79.6 6 Z' fill='%239a8456'/%3E%3Ccircle cx='6' cy='6' r='1.4' fill='%239a8456'/%3E%3Ccircle cx='162' cy='6' r='1.4' fill='%239a8456'/%3E%3C/svg%3E");
}

/* tabs */
.tabs { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs a {
    flex: 1; text-align: center; padding: 15px 6px;
    font-family: var(--display); font-weight: 600;
    font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint);
    border-bottom: 2px solid transparent; transition: color .15s, background .15s, border-color .15s;
}
.tabs a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--gold); }

.tab-body { padding: 26px 28px 30px; }

.bio { font-family: var(--serif); font-size: 16px; line-height: 1.8; white-space: pre-line; }
.facts { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 8px; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 14px; border-bottom: 1px solid var(--surface-2); }
.fact:last-child { border-bottom: none; }
.fact .k { color: var(--faint); text-transform: uppercase; letter-spacing: .05em; font-size: 12.5px; }
.fact .v { text-align: right; }

/* qr */
.qr-block { display: flex; align-items: center; gap: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-top: 24px; }
.qr-block img { width: 92px; height: 92px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.qr-block .grow { flex: 1; }
.qr-block .t { font-size: 14px; }
.qr-block .s { font-size: 12.5px; color: var(--faint); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; padding: 0 0 26px 28px; border-left: 1px solid var(--line); }
.timeline > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline > li::before { content: ''; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; transform: rotate(45deg); background: var(--surface); border: 1px solid var(--gold); }
.tl-date { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.tl-title { font-family: var(--display); font-size: 19px; font-weight: 600; margin: 2px 0 2px; }
.tl-place { font-size: 13px; color: var(--muted); }
.tl-desc { font-size: 14.5px; margin-top: 5px; }

/* media grid */
/* Storage quota indicator (media page) */
.quota {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.quota-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.quota-nums strong { color: var(--text); }
.quota-bar { margin-top: 10px; height: 8px; border-radius: 100px; background: var(--surface-2); overflow: hidden; }
.quota-bar > span { display: block; height: 100%; background: var(--success); border-radius: inherit; transition: width .3s ease; }
.quota-bar.is-full > span { background: var(--danger, #a8443a); }

/* Ready-made text templates (premium: bio / epitaph picker on the edit form) */
.tpl { margin: 0 0 10px; padding: 12px 14px; background: var(--gold-soft); border: 1px solid #e6dcc6; border-radius: var(--radius-sm); }
.tpl-head { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.tpl-plan { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); margin-left: 4px; }
.tpl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-btn { background: var(--surface); }

/* Загрузка медиа: поле-«площадка» на всю ширину. Отправляется само после выбора
   файлов (js/app.js), поэтому у формы с классом .uploader-js кнопки не видно —
   без JS она остаётся на месте и форма работает как обычная. */
.uploader { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.uploader-drop {
    flex: 1 1 260px;
    position: relative;             /* якорь для спрятанного поля ниже */
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    border: 1px dashed var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}
.uploader-drop:hover { border-color: var(--gold); background: var(--gold-soft); }
/* поле остаётся в потоке (клик по label открывает его), но не занимает места */
.uploader-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.uploader-drop:focus-within { border-color: var(--accent); border-style: solid; }
.uploader-ic {
    flex: none; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--line);
    font-size: 22px; line-height: 1; color: var(--gold);
}
.uploader-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.uploader-title { font-size: 15px; }
.uploader-hint { font-size: 13px; line-height: 1.45; }
.uploader-inline { margin-top: 10px; }
.uploader-js .uploader-go { display: none; }
.uploader.is-busy .uploader-drop { pointer-events: none; opacity: .65; border-style: solid; }

.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.media-grid .tile { aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
/* ячейка-обёртка: кнопка удаления не может лежать внутри <a class="tile">
   (форма внутри ссылки — недопустимая разметка), поэтому она её соседка */
.media-grid .tile-cell { position: relative; }
.media-grid .tile-del { position: absolute; top: 6px; right: 6px; z-index: 2; }
.media-grid .tile img, .media-grid .tile video { width: 100%; height: 100%; object-fit: cover; }
/* audio memory tile — music glyph above an inline player */
.tile-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; background: var(--surface-2); }
.tile-audio-ic { font-size: 40px; color: var(--gold); line-height: 1; }
.tile-audio audio { width: 100%; }
.media-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.media-thumbs img, .media-thumbs video { width: 76px; height: 76px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }

/* relations */
.rel { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--surface-2); }
.rel:last-child { border-bottom: none; }
.rel .circle { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 19px; color: var(--faint); flex: none; }
.rel .grow { flex: 1; }
.rel .type { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }

/* report */
.report { margin-top: 22px; }
.report summary { cursor: pointer; color: var(--faint); font-size: 13px; }
.report[open] summary { margin-bottom: 12px; }

/* ===== Tables (admin) ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--faint); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
table.data tr:last-child td { border-bottom: none; }

/* ===== Stats ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .n { font-size: 34px; font-weight: 600; font-family: var(--display); line-height: 1; }
.stat .l { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-top: 6px; }

/* ===== Pagination ===== */
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 26px; font-size: 14px; color: var(--muted); }
.pager .disabled { color: var(--line); pointer-events: none; }

/* ===== Auth ===== */
.auth-wrap { max-width: 400px; margin: 64px auto; padding: 0 16px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand { font-size: 26px; }
.auth-head p { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 20px; }
/* Пояснение над первым полем формы — например, зачем просят email при восстановлении пароля. */
.form-intro { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }

/* ===== Footer ===== */
.footer { text-align: center; color: var(--faint); font-family: var(--serif); font-size: 13px; letter-spacing: .03em; padding: 40px 16px 48px; flex-shrink: 0; }
.footer a { color: var(--faint); }

/* ===== Landing (home) ===== */
.landing-hero {
    text-align: center;
    padding: 82px 16px 66px;
    /* soft light from above — the same calm marble field as the memorial page */
    background:
        radial-gradient(150% 78% at 50% -16%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
        var(--bg);
    border-bottom: 1px solid var(--line);
}
.landing-hero .eyebrow {
    font-size: 12px; text-transform: uppercase; letter-spacing: .32em;
    color: var(--gold); margin-bottom: 16px;
}
.landing-hero h1 { font-size: 60px; line-height: 1.04; margin: 0; letter-spacing: .01em; }
.landing-hero .lead {
    font-family: var(--serif); color: var(--muted);
    font-size: 19px; line-height: 1.6; max-width: 46ch; margin: 4px auto 0;
}
.landing-hero .actions { justify-content: center; margin-top: 30px; }
.landing-hero .btn { padding: 13px 26px; font-size: 15px; }

.landing-section { padding: 66px 0; }
.landing-section--alt { background: var(--surface); border-bottom: 1px solid var(--line); }
.landing-section h2 { text-align: center; font-size: 33px; margin: 0; }
.landing-section .sub {
    text-align: center; color: var(--muted); font-family: var(--serif);
    font-size: 16px; margin: 10px auto 0; max-width: 52ch;
}

/* How it works — three steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.step {
    text-align: center; padding: 30px 24px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
/* Arched stone niche holding an engraved symbol — three little stelae in a row */
.step .glyph {
    width: 68px; height: 80px; margin: 0 auto 22px;
    border-radius: 34px 34px 5px 5px;
    border: 1px solid var(--line);
    /* quarried-stone face, lit softly from above */
    background: linear-gradient(180deg, #f7f5ef 0%, #e7e4db 100%);
    box-shadow: inset 0 1px 0 #fff, inset 0 0 0 4px var(--surface), 0 6px 16px rgba(31, 29, 24, .10);
    display: flex; align-items: center; justify-content: center;
}
.step .glyph svg { width: 40px; height: 46px; display: block; }
/* engraved structure (slate) and the noble bronze light (flame, QR halo) */
.glyph-stroke { stroke: var(--accent); }
.glyph-fill { fill: var(--accent); }
.glyph-bronze { stroke: var(--gold); }
.glyph-bronze-fill { fill: var(--gold); }
.glyph-glow { filter: drop-shadow(0 0 2px rgba(154, 132, 86, .55)); }
.step h3 { font-size: 21px; margin: 0 0 8px; }
.step p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* Why it matters — feature grid */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 38px; margin-top: 44px; }
.feature { display: flex; gap: 18px; align-items: flex-start; }
.feature .ic {
    flex: none; width: 46px; height: 46px;
    border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--bg);
    display: flex; align-items: center; justify-content: center;
}
.feature .ic svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; }
.feature h3 { font-size: 19px; margin: 2px 0 5px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.65; }

/* Example page — a miniature of a real memorial card; the whole card is the link */
.demo-card {
    display: block; position: relative;
    max-width: 460px; margin: 40px auto 0;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: 6px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.demo-card:hover, .demo-card:focus-visible {
    text-decoration: none; transform: translateY(-3px);
    box-shadow: 0 1px 2px rgba(31, 29, 24, .06), 0 18px 44px rgba(31, 29, 24, .13);
}
.demo-cover {
    display: block; height: 74px;
    background: linear-gradient(180deg, #eceadf 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--gold-soft);
}
.demo-head { display: block; text-align: center; padding: 0 22px 18px; }
/* the same arched niche as on the memorial page, scaled down */
.demo-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 68px; height: 84px; margin: -48px auto 12px;
    border-radius: 34px 34px 4px 4px;
    border: 1px solid var(--line); background: var(--surface-2);
    box-shadow: 0 0 0 5px var(--surface), 0 8px 20px rgba(31, 29, 24, .12);
    font-family: var(--display); font-size: 30px; color: var(--faint);
    /* портрет кадрируется как на самой странице памяти — лицо к верху ниши */
    object-fit: cover; object-position: center top;
}
.demo-name { display: block; font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.15; color: var(--text); }
.demo-dates { display: block; font-family: var(--serif); font-size: 13px; color: var(--muted); margin-top: 6px; letter-spacing: .03em; }
.demo-epitaph { display: block; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); margin-top: 12px; line-height: 1.55; }
.demo-tabs { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.demo-tabs span {
    flex: 1; text-align: center; padding: 10px 2px;
    font-family: var(--display); font-weight: 600; font-size: 10px;
    text-transform: uppercase; letter-spacing: .07em; color: var(--faint);
    border-bottom: 2px solid transparent;
}
.demo-tabs .active { color: var(--accent); border-bottom-color: var(--gold); }
/* three grey rules stand in for the biography — the text itself is on the real page */
.demo-lines { display: block; padding: 22px 22px 52px; }
.demo-lines span { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); margin-bottom: 11px; }
.demo-lines span:nth-child(2) { width: 92%; }
.demo-lines span:nth-child(3) { width: 62%; }
/* the card fades out at the bottom — there is more on the real page */
.demo-open {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 44px 0 16px; text-align: center;
    font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--accent);
    background: linear-gradient(180deg, rgba(251, 250, 248, 0) 0%, var(--surface) 58%);
}
.demo-card:hover .demo-open { color: var(--accent-deep); text-decoration: underline; }

/* ===== Responsive ===== */
@media (min-width: 640px) {
    .media-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet / large phone */
@media (max-width: 720px) {
    .landing-hero { padding: 60px 16px 50px; }
    .landing-hero h1 { font-size: 44px; }
    .landing-hero .lead { font-size: 17.5px; }
    .landing-section { padding: 52px 0; }
    .landing-section h2 { font-size: 28px; }
    .steps { grid-template-columns: 1fr; max-width: 380px; margin-left: auto; margin-right: auto; }
    .features { grid-template-columns: 1fr; gap: 26px; }
}

/* Phone */
@media (max-width: 560px) {
    /* Top navigation — wrap gracefully onto a second line instead of overflowing */
    .topnav-inner { height: auto; min-height: 56px; flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; padding-bottom: 10px; }
    .brand { font-size: 19px; letter-spacing: .16em; }
    .nav-links { flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
    .nav-links .muted { display: none; }   /* hide the long email/login to save room */

    /* Forms */
    .field-row { flex-direction: column; gap: 0; }
    .form-card { padding: 20px; }

    /* Page header — smaller title, action button drops below it */
    .page { padding: 24px 0 48px; }
    .page-head { flex-wrap: wrap; gap: 10px 14px; margin-bottom: 20px; }
    .page-head h1 { font-size: 22px; }

    /* List rows stack: name on top, action buttons in a full-width row below */
    .list-item { flex-direction: column; align-items: stretch; gap: 12px; }
    .list-item .actions { width: 100%; }

    /* Memorial page — tighter so the portrait and name sit higher on a phone */
    .memorial-card { margin: 18px 0; }
    .cover { height: 110px; }
    .memorial-head { padding: 0 18px 24px; }
    .avatar { margin-top: -76px; }
    .memorial-name { font-size: 32px; }
    .tabs a { font-size: 11px; letter-spacing: .05em; padding: 13px 2px; }
    .tab-body { padding: 22px 18px 26px; }
    .qr-block { flex-wrap: wrap; }

    /* Landing */
    .landing-hero { padding: 48px 16px 40px; }
    .landing-hero h1 { font-size: 38px; }
}

/* Small phone */
@media (max-width: 380px) {
    .brand { font-size: 17px; letter-spacing: .12em; }
    .nav-links { font-size: 13px; gap: 6px 12px; }
    .memorial-name { font-size: 28px; }
    .landing-hero h1 { font-size: 33px; }
}

/* ===== Pricing page (tariffs) ===== */

/* Plan cards */
.pricing {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 22px; margin-top: 46px; align-items: start;
}
.plan {
    position: relative;
    display: flex; flex-direction: column; height: 100%;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 32px 26px 28px;
}
/* The recommended plan — lifted, with a fine bronze edge */
.plan--featured {
    border-color: var(--gold);
    box-shadow: 0 1px 2px rgba(31, 29, 24, .06), 0 16px 44px rgba(31, 29, 24, .12);
}
.plan-badge {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    white-space: nowrap;
    font-family: var(--display); font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: .14em;
    color: #fbfaf8; background: var(--gold);
    padding: 6px 15px; border-radius: 100px;
}
.plan-name { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: .01em; }
.plan-tagline { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; margin-top: 2px; }
.plan-price { margin: 20px 0 3px; font-family: var(--display); line-height: 1; }
.plan-price .num { font-size: 46px; font-weight: 600; }
.plan-price .cur { font-size: 23px; color: var(--muted); margin-left: 4px; }
.plan-store { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.plan-for { font-size: 14px; color: var(--muted); margin: 18px 0 0; line-height: 1.6; }
.plan-for .lbl, .plan-why .lbl { color: var(--text); font-family: var(--display); font-weight: 600; }
/* engraved divider — same diamond rule as the page ornament */
.plan-sep {
    height: 12px; margin: 18px 0; opacity: .85;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='12' viewBox='0 0 168 12'%3E%3Cg fill='none' stroke='%239a8456' stroke-width='1'%3E%3Cline x1='12' y1='6' x2='71' y2='6'/%3E%3Cline x1='97' y1='6' x2='156' y2='6'/%3E%3C/g%3E%3Cpath d='M84 1.6 L88.4 6 L84 10.4 L79.6 6 Z' fill='%239a8456'/%3E%3Ccircle cx='6' cy='6' r='1.4' fill='%239a8456'/%3E%3Ccircle cx='162' cy='6' r='1.4' fill='%239a8456'/%3E%3C/svg%3E");
}
/* Reserve a uniform description height so the engraved divider lines up
   across all three cards — otherwise the longer "Кому подойдёт" / desc text
   (e.g. «Вечность») wraps to an extra line and pushes its divider lower.
   Scoped to the .pricing grid so the standalone checkout card isn't padded. */
.pricing .plan-for  { min-height: 6.4em; }  /* 4 text lines @ 14px / 1.6 */
.pricing .plan-desc { min-height: 5.1em; }  /* 3 text lines @ 16px / 1.7 */
.plan-list { list-style: none; margin: 0; padding: 0; flex: 1 0 auto; }
.plan-list li {
    position: relative; padding: 8px 0 8px 23px;
    font-size: 14px; line-height: 1.5; color: var(--text);
    border-bottom: 1px solid var(--surface-2);
}
.plan-list li:last-child { border-bottom: none; }
/* small engraved bronze diamond bullet */
.plan-list li::before {
    content: ""; position: absolute; left: 3px; top: 14px;
    width: 6px; height: 6px; transform: rotate(45deg);
    background: var(--surface); border: 1px solid var(--gold);
}
.plan-list li strong { font-weight: 600; }
.plan-why { font-size: 13.5px; color: var(--muted); margin: 16px 0 22px; line-height: 1.6; }
.plan .btn { margin-top: auto; }
.pricing-note {
    text-align: center; color: var(--faint); font-family: var(--serif);
    font-size: 14.5px; max-width: 56ch; margin: 30px auto 0;
}

/* Comparison table */
.compare-wrap {
    margin-top: 42px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow);
}
.compare { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 620px; }
.compare th, .compare td { padding: 13px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: none; }
.compare thead th { vertical-align: bottom; border-bottom: 2px solid var(--line); }
/* leading column: row labels, kept readable while scrolling */
.compare th[scope="row"], .compare thead th:first-child {
    text-align: left; font-weight: 400; color: var(--text); font-size: 14px;
    position: sticky; left: 0; background: var(--surface); z-index: 1;
}
.compare thead th:first-child { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.compare .col-name { display: block; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--text); }
.compare .col-price { display: block; font-size: 13px; color: var(--faint); margin-top: 3px; }
.compare .yes { color: var(--success); font-weight: 600; }
.compare .no { color: var(--faint); }
.compare .val { color: var(--text); }
/* highlight the recommended column */
.compare .col-feat { background: var(--gold-soft); }

/* Trust cards */
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 46px; }
.trust-card {
    display: flex; gap: 18px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 26px 24px;
}
.trust-card .ic {
    flex: none; width: 48px; height: 48px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--bg);
    display: flex; align-items: center; justify-content: center;
}
.trust-card .ic svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; }
.trust-card h3 { font-size: 19px; margin: 2px 0 6px; }
.trust-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.trust-note {
    max-width: 60ch; margin: 30px auto 0; text-align: center;
    font-family: var(--serif); font-style: italic; font-size: 16px;
    color: var(--muted); line-height: 1.7;
}

/* FAQ accordion */
.faq-title { text-align: center; }
.faq { max-width: 760px; margin: 38px auto 0; }
.faq details {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 12px;
}
.faq summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: 16px;
    padding: 17px 20px;
    font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; margin-left: auto; flex: none;
    font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1;
    color: var(--gold);
}
.faq details[open] summary { color: var(--accent); }
.faq details[open] summary::after { content: "\2013"; }
.faq .ans {
    margin: 0; padding: 0 20px 19px;
    font-family: var(--serif); font-size: 15px; line-height: 1.75; color: var(--muted);
}

/* Pricing page — responsive */
@media (max-width: 860px) {
    .pricing { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
    .plan { height: auto; }
    /* cards stack — no neighbour to align with, so drop the reserved height */
    .pricing .plan-for, .pricing .plan-desc { min-height: 0; }
    .trust-grid { grid-template-columns: 1fr; }
}

/* ===== Footer with contacts ===== */
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.footer-brand { color: var(--faint); }
.footer-contacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 22px; }
.footer-contacts a { color: var(--muted); }
.footer-contacts a:hover { color: var(--accent); }
.footer-link a { color: var(--faint); text-decoration: underline; }

/* ===== Checkout / payment ===== */
.checkout-lead {
    max-width: 540px; margin: 0 auto 22px; text-align: center;
    font-family: var(--serif); font-size: 16px; color: var(--muted); line-height: 1.65;
}
.checkout-lead span { color: var(--text); }
.pay-note {
    max-width: 540px; margin: 0 auto 28px; text-align: center;
    background: var(--gold-soft); border: 1px solid #e6dcc6; color: #8a6d3b;
    border-radius: var(--radius); padding: 14px 18px; font-size: 14px; line-height: 1.6;
}
.pay-note code { background: rgba(0, 0, 0, .05); padding: 1px 6px; border-radius: 3px; font-size: 13px; }
.checkout-card {
    max-width: 470px; margin: 0 auto; text-align: center;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 30px 30px;
}
.checkout-plan { font-family: var(--display); font-size: 24px; font-weight: 600; }
.checkout-tagline { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; margin-top: 4px; }
.checkout-sum { margin: 14px 0 4px; font-family: var(--display); line-height: 1; }
.checkout-sum .num { font-size: 48px; font-weight: 600; }
.checkout-sum .cur { font-size: 24px; color: var(--muted); margin-left: 4px; }
.checkout-store { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
/* description block inside the centered checkout card — text reads left-aligned */
.checkout-details { text-align: left; }
.checkout-details .plan-for { margin-top: 0; }
.checkout-details .plan-why { margin-bottom: 0; }
.checkout-hint { font-size: 13px; color: var(--faint); margin: 18px 0 0; line-height: 1.6; }
.checkout-back { margin: 18px 0 0; font-size: 14px; }

/* ============================================================
   Motion & dynamics — сдержанная, торжественная анимация.
   Всё отключается при prefers-reduced-motion (в конце блока).
   ============================================================ */

/* Плавная прокрутка к якорям */
html { scroll-behavior: smooth; }

/* Мягкий кросс-фейд между страницами (вкладки мемориала и т.п.).
   Работает в новых браузерах, остальными просто игнорируется. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* --- Появление при прокрутке (классы навешивает js/app.js) --- */
.reveal {
    animation: reveal-up .7s cubic-bezier(.22, .61, .36, 1) both paused;
    animation-delay: var(--reveal-delay, 0ms);
}
.reveal-in { animation-play-state: running; }
@keyframes reveal-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Портрет: тихое «оживание» при открытии страницы --- */
img.avatar { animation: portrait-in 1.6s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes portrait-in {
    from { opacity: 0; transform: scale(1.045); }
    to   { opacity: 1; transform: scale(1); }
}

/* --- Карточки: лёгкий подъём под курсором --- */
.step, .trust-card, .contact-row, .faq details, .card {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.plan { transition: transform .25s ease, box-shadow .25s ease; }
.step:hover, .trust-card:hover, .plan:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(31, 29, 24, .05), 0 18px 44px rgba(31, 29, 24, .11);
}
.contact-row:hover { transform: translateY(-2px); }

/* --- Фотографии: мягкое приближение под курсором --- */
.media-grid .tile { position: relative; }
.media-grid .tile img { transition: transform .45s cubic-bezier(.22, .61, .36, 1); }
.media-grid a.tile:hover img { transform: scale(1.045); }
.media-thumbs img { transition: transform .3s ease, box-shadow .3s ease; }
.media-thumbs img:hover { transform: scale(1.05); box-shadow: 0 6px 18px rgba(31, 29, 24, .16); }

/* --- FAQ: ответ мягко проявляется при раскрытии --- */
.faq details[open] .ans { animation: faq-in .3s ease both; }
@keyframes faq-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Флеш-сообщения: спокойный вход сверху --- */
.flash { animation: flash-in .4s ease both; }
@keyframes flash-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Лайтбокс фотографий --- */
html.lb-lock { overflow: hidden; }
.lb {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(26, 25, 22, .92);
    opacity: 0; visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}
.lb.open { opacity: 1; visibility: visible; }
.lb-img {
    max-width: calc(100vw - 32px); max-height: calc(100vh - 96px);
    border-radius: 4px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
    opacity: 0; transform: scale(.985);
}
.lb-img.lb-img-in { opacity: 1; transform: scale(1); transition: opacity .3s ease, transform .3s ease; }
.lb-close, .lb-prev, .lb-next {
    position: absolute; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; padding: 0;
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 100px;
    background: rgba(255, 255, 255, .07); color: #f1f0ec;
    font-family: var(--serif); font-size: 30px; line-height: 1;
    cursor: pointer; transition: background .2s, border-color .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.lb-close { top: 18px; right: 18px; font-size: 26px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: rgba(241, 240, 236, .75); font-size: 13px; letter-spacing: .08em;
    font-family: var(--serif);
}
.lb.lb-single .lb-prev, .lb.lb-single .lb-next, .lb.lb-single .lb-count { display: none; }
/* на телефоне стрелки не нужны — листается свайпом */
@media (max-width: 640px) {
    .lb-prev, .lb-next { display: none; }
    .lb-img { max-width: 100vw; max-height: calc(100vh - 72px); border-radius: 0; }
}

/* --- Уважение к настройке «уменьшить движение» --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ===== Contacts page ===== */
.contact-list { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.contact-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 17px 22px;
}
.contact-row:hover { text-decoration: none; border-color: #cfcabd; background: var(--surface-2); }
.contact-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.contact-value { font-family: var(--display); font-size: 18px; color: var(--text); }

/* ===== Footer: документы ===== */
.footer-docs {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px;
    margin-top: 4px;
}
.footer-docs a { color: var(--faint); font-size: 12.5px; }
.footer-docs a:hover { color: var(--accent); text-decoration: underline; }
.footer-legal {
    color: var(--faint); font-family: var(--sans); font-size: 11.5px;
    letter-spacing: .01em; margin-top: 8px; max-width: 560px; line-height: 1.6;
}
/* компактный вариант для мемориальной страницы и форм входа */
.footer-docs--compact { margin-top: 10px; gap: 3px 16px; }
.footer-docs--compact a { font-size: 11.5px; }

/* ===== Правовые документы (оферта, политика, согласие) ===== */
.legal-hero { padding-bottom: 44px; }
.legal-hero h1 { font-size: 42px; }
.legal-meta {
    margin: 20px 0 0; color: var(--faint); font-family: var(--sans);
    font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
}
.legal {
    max-width: 760px; margin: 0 auto;
    font-family: var(--serif); font-size: 15.5px; line-height: 1.8; color: var(--muted);
}
.legal h2 {
    font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--text);
    line-height: 1.3; margin: 42px 0 4px; padding-top: 22px; border-top: 1px solid var(--line);
}
.legal h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal h3 {
    font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--text);
    margin: 26px 0 0;
}
.legal p { margin: 14px 0 0; }
.legal ul { margin: 12px 0 0; padding-left: 22px; }
.legal li { margin-top: 7px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-requisites { font-family: var(--sans); font-size: 14.5px; line-height: 1.9; }

.legal-nav {
    max-width: 760px; margin: 46px auto 0; padding-top: 22px; border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
}
.legal-nav a { font-family: var(--display); font-size: 14px; color: var(--muted); }
.legal-nav a:hover { color: var(--accent); }

@media (max-width: 640px) {
    .legal-hero h1 { font-size: 30px; }
    .legal { font-size: 15px; line-height: 1.75; }
    .legal h2 { font-size: 19px; margin-top: 34px; }
}

/* ===== Правовая сноска в формах входа/регистрации ===== */
.auth-legal {
    max-width: 340px; margin: 14px auto 0; text-align: center;
    color: var(--faint); font-family: var(--sans); font-size: 12px; line-height: 1.6;
}
.auth-legal a { color: var(--muted); text-decoration: underline; }
.auth-legal a:hover { color: var(--accent); }
.field-consent {
    display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 16px;
    font-family: var(--sans); font-size: 12.5px; line-height: 1.55; color: var(--muted);
}
.field-consent input { margin: 3px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.field-consent a { color: var(--accent); text-decoration: underline; }
