/* =========================================================================
   Музей КВТ – стили интерфейса по дизайн-коду #au_team.
   Значения цветов, отступов, радиусов и теней – только из tokens.css.
   Классы – BEM, состояния – атрибутами (aria-current, aria-expanded, hidden).
   ========================================================================= */

/* --- Шрифты: свой сервер, latin + cyrillic ------------------------------ */
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/manrope-cyrillic-wght-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- То, что в тёмной теме меняется помимо палитры (п. 9.3) ------------- */
:root {
    --header-mix: 92%;
    --selection-ink: var(--on-brand);
    --raster-filter: none;
    --mark-plate: transparent;
}
:root[data-theme="dark"] {
    --header-mix: 85%;
    --selection-ink: #FFFFFF;
    --raster-filter: brightness(.95);
    --mark-plate: #FFFFFF;      /* белая подложка знака – литерал, в теме не меняется */
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --header-mix: 85%;
        --selection-ink: #FFFFFF;
        --raster-filter: brightness(.95);
        --mark-plate: #FFFFFF;
    }
}

/* --- База --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    font-size: 18px;
    scroll-padding-top: calc(var(--header-h) + var(--space-4));
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: var(--text-16);
    line-height: var(--leading-base);
    color: var(--ink);
    background: var(--surface);
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand); color: var(--selection-ink); }

img { max-width: 100%; height: auto; }
img:not([src*=".svg"]) { filter: var(--raster-filter); }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-4);
    font-weight: 700;
    color: var(--ink-strong);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}
h1 { font-size: var(--text-48); letter-spacing: -0.02em; }
h2 { font-size: var(--text-36); }
h3 { font-size: var(--text-24); }
h4 { font-size: var(--text-20); }
h5 { font-size: var(--text-18); text-transform: uppercase; letter-spacing: 0.04em; }
h6 { font-size: var(--text-14); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

p { margin: 0 0 var(--space-4); }

a {
    color: var(--brand);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
    transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover { color: var(--brand-hover); text-decoration-color: var(--brand-hover); }

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

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }
code { background: var(--surface-3); padding: 0.1em 0.35em; border-radius: var(--radius-sm); }

hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-6) 0; }

/* Фокус: кольцо вместо outline, только с клавиатуры. */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
a:focus-visible { border-radius: 2px; }

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

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.icon { flex: none; display: block; }

/* Ссылка «К содержимому» */
.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-4);
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--brand);
    color: var(--on-brand);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(calc(-100% - var(--space-4)));
    transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); color: var(--on-brand); }

/* --- Служебные стили текста (п. 4.5) ----------------------------------- */
.eyebrow {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-12);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
}
.section-label {
    margin: 0 0 var(--space-3);
    font-size: var(--text-14);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.lead {
    max-width: var(--measure);
    font-size: var(--text-20);
    line-height: var(--leading-snug);
    color: var(--muted);
}
.prose { max-width: var(--measure); font-size: var(--text-18); }
.prose p { text-align: justify; hyphens: auto; }
.prose ul, .prose ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.prose li + li { margin-top: var(--space-2); }
.prose h2, .h3-like { font-size: var(--text-24); }

/* --- Каркас ------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-5);
}
.container--narrow { max-width: var(--container-narrow); }

.site-main { flex: 1 0 auto; padding-block: var(--space-7); }
.site-main:focus { box-shadow: none; }

.section { margin-top: var(--space-8); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); }

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }

/* --- Шапка (п. 6.9) ----------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface) var(--header-mix), transparent);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--rule);
}
.site-header__inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: none;
    color: var(--ink-strong);
    text-decoration: none;
}
.brand:hover { color: var(--brand); }
.brand__marks {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 3px;
    background: var(--mark-plate);
    border-radius: var(--radius);
}
.brand__mark { display: block; height: 40px; width: auto; }
.brand__name { font-size: var(--text-16); font-weight: 700; line-height: var(--leading-tight); }

.site-nav { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.site-nav__list { display: flex; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.site-nav__link {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    font-size: var(--text-16);
    font-weight: 500;
    line-height: var(--leading-tight);
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}
.site-nav__link:hover { color: var(--brand); background: var(--surface-2); }
.site-nav__link[aria-current="page"] { color: var(--brand); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; margin-left: auto; }

/* Кнопка-значок в шапке (п. 6.2) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    flex: none;
    border: 1px solid var(--rule);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }
.icon-btn:active { transform: translateY(1px); transition-duration: .05s; }
.icon-btn .icon { width: 18px; height: 18px; }

/* Переключатель темы: значок того, на что переключит. */
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}

.burger { display: none; }
.burger__close { display: none; }
.burger[aria-expanded="true"] .burger__open { display: none; }
.burger[aria-expanded="true"] .burger__close { display: block; }

/* Выпадающее меню (п. 6.10): наведение, фокус или aria-expanded. */
.menu { position: relative; }
.menu__panel {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    z-index: 60;
    min-width: 240px;
    margin: 0;
    padding: var(--space-2);
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.menu--left .menu__panel { left: 0; right: auto; }
/* Мостик над зазором, чтобы меню не закрывалось по пути курсора. */
.menu__panel::before { content: ""; position: absolute; left: 0; right: 0; top: calc(-1 * var(--space-2) - 1px); height: var(--space-2); }
.menu__toggle[aria-expanded="true"] + .menu__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
@media (hover: hover) {
    .menu--hover:hover .menu__panel { opacity: 1; visibility: visible; transform: translateY(0); }
}
.menu__toggle .icon:last-child { transition: transform .15s ease; }
.menu__toggle[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font: inherit;
    font-size: var(--text-14);
    line-height: var(--leading-snug);
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}
.menu__item:hover { background: var(--surface-2); color: var(--brand); }
.menu__item[aria-current] { color: var(--brand); font-weight: 600; }
.menu__item .icon { width: 16px; height: 16px; }
.menu__label { display: flex; align-items: center; gap: var(--space-2); min-width: 0; overflow-wrap: anywhere; }
.menu__sep { height: 1px; margin: var(--space-2) 0; background: var(--rule); }
.menu__panel--scroll { max-height: 400px; overflow-y: auto; overscroll-behavior: contain; width: min(320px, calc(100vw - 2 * var(--space-4))); }

/* Панель поиска под шапкой */
.search-panel { border-top: 1px solid var(--rule); padding-block: var(--space-4); }
.search-form { display: flex; gap: var(--space-2); }
.search-form .input { flex: 1 1 240px; width: auto; min-width: 0; }

/* Мобильное меню (≤ 1024px) */
.mobile-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-4) 0 var(--space-6);
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-3);
    transform: translateY(-110%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s;
}
.mobile-menu[data-open="true"] { transform: translateY(0); visibility: visible; }
.mobile-menu__list { margin: 0; padding: 0; list-style: none; }
.mobile-menu__link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    font-size: var(--text-18);
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
}
.mobile-menu__link:hover, .mobile-menu__link[aria-current="page"] { color: var(--brand); }
.mobile-menu__link[aria-current="page"] { font-weight: 600; }
.mobile-menu__sub { margin: var(--space-2) 0 0; padding: 0 0 0 var(--space-4); list-style: none; border-left: 2px solid var(--brand-soft); }
.mobile-menu__sub .mobile-menu__link { font-size: var(--text-16); padding: var(--space-2) 0; }

/* --- Кнопки (п. 6.1) ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: var(--text-16);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-3); color: var(--ink); }
.btn:active { transform: translateY(1px); transition-duration: .05s; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn--ghost { background: transparent; border-color: var(--rule); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: transparent; border-color: var(--rule); color: var(--danger); }
.btn--danger:hover {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    color: var(--danger);
}
.btn--lg { padding: var(--space-4) var(--space-6); font-size: var(--text-18); }
.btn--block { width: 100%; }
.btn--icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-pill); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }

/* Кнопка, похожая на ссылку (действие на месте) */
.link-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: color .15s ease;
}
.link-button:hover { color: var(--brand); }

/* --- Чипы и бейджи (п. 6.3–6.4) ---------------------------------------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) 10px;
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: var(--text-12);
    font-weight: 500;
    line-height: var(--leading-snug);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
a.chip:hover { background: var(--brand); color: var(--on-brand); }
.chip .icon { width: 12px; height: 12px; }
.chip--success {
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
    color: var(--success);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent);
}
.chip--danger {
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    color: var(--danger);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent);
}
.chip--neutral { background: var(--surface-3); color: var(--muted); }
.chip--id { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); overflow-wrap: anywhere; }
.chip--id .chip__label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.chip--id .chip__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.badge {
    display: inline-block;
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: var(--text-12);
    font-weight: 600;
    line-height: var(--leading-snug);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Карточки (п. 6.5) -------------------------------------------------- */
.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    color: inherit;
}
.card--soft { background: var(--surface-2); border-color: transparent; }
.card--hover { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.card--hover { text-decoration: none; }
.card--hover:hover { border-color: var(--brand); box-shadow: var(--shadow-2); }
.card--lift:hover { transform: translateY(-2px); }
.card__eyebrow {
    margin-bottom: var(--space-2);
    font-size: var(--text-12);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
}
.card__title {
    margin: 0;
    font-size: var(--text-20);
    font-weight: 700;
    line-height: var(--leading-snug);
    color: var(--ink-strong);
    transition: color .15s ease;
}
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover, a.card--hover:hover .card__title { color: var(--brand); }
.card__meta { font-size: var(--text-14); line-height: var(--leading-snug); color: var(--muted); }
.card__excerpt { margin-top: var(--space-3); font-size: var(--text-16); line-height: var(--leading-snug); }

/* Плитка-показатель */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3); margin: 0; }
.stats--hero { margin-top: var(--space-7); }
.stat { padding: var(--space-4) var(--space-5); background: var(--surface-2); border-radius: var(--radius-lg); }
.stat__value {
    display: block;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-30);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--ink-strong);
}
.stat__label { display: block; margin-top: var(--space-1); font-size: var(--text-14); line-height: var(--leading-snug); color: var(--muted); }

/* --- Плашки-сообщения (п. 6.7) ----------------------------------------- */
.notice {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
    border-radius: var(--radius);
    background: var(--brand-soft);
    color: var(--ink);
    font-size: var(--text-14);
    line-height: var(--leading-snug);
}
.notice > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--brand); }
.notice__body { min-width: 0; overflow-wrap: anywhere; }
.notice__body > :last-child { margin-bottom: 0; }
.notice--danger {
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 35%, transparent);
    color: var(--danger);
}
.notice--danger > .icon { color: var(--danger); }
.notice--success {
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--success) 35%, transparent);
    color: var(--success);
}
.notice--success > .icon { color: var(--success); }
.notice--spaced { margin-top: var(--space-6); }
.notice--message {
    padding: var(--space-5);
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--accent-soft);
    font-size: var(--text-16);
}
.notice--message > .icon { color: var(--ink); }

.toast {
    position: fixed;
    left: 50%;
    bottom: var(--space-5);
    z-index: 90;
    max-width: calc(100% - 2 * var(--space-4));
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--surface);
    font-size: var(--text-14);
    font-weight: 500;
    box-shadow: var(--shadow-3);
    transform: translateX(-50%);
}

/* --- Формы (п. 6.8) ----------------------------------------------------- */
.field { display: flex; flex-direction: column; min-width: 0; }
.field + .field { margin-top: var(--space-4); }
.label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-14);
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--ink-strong);
}
.label__required { color: var(--danger); }
.input, .select, .textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: var(--text-16);
    line-height: var(--leading-snug);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-soft); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--focus-ring); }
.input[type="file"] { padding: 7px var(--space-2); }
.input[type="file"]::file-selector-button {
    margin-right: var(--space-3);
    padding: var(--space-1) var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.select {
    appearance: none;
    padding-right: var(--space-7);
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 22px center, right 16px center;
    background-size: 6px 6px;
    background-repeat: no-repeat;
}
.hint { margin-top: var(--space-2); font-size: var(--text-12); line-height: var(--leading-snug); color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-14); line-height: var(--leading-snug); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
.form-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, auto); gap: var(--space-4); align-items: end; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .check { min-height: 50px; align-items: center; }
.form-grid .check input { margin-top: 0; }

/* Карточка формы входа */
.auth { max-width: 460px; margin-inline: auto; }
.auth__title { text-align: center; font-size: var(--text-36); }
.auth__intro { margin-bottom: var(--space-5); text-align: center; font-size: var(--text-14); color: var(--muted); }
.auth__card { padding: var(--space-6); box-shadow: var(--shadow-1); }
.auth__links { margin-top: var(--space-5); text-align: center; font-size: var(--text-14); color: var(--muted); }

/* --- Страница каталога: сайдбар + контент ------------------------------ */
.catalog {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: var(--space-7);
    align-items: start;
}
.catalog__sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--space-5));
    max-height: calc(100vh - var(--header-h) - 2 * var(--space-5));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px var(--space-2) 2px 2px;
}
.catalog__content { min-width: 0; }

.side-group + .side-group { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--rule); }
.side-group__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: var(--text-14);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    border-radius: var(--radius-sm);
}
.side-group__summary::-webkit-details-marker { display: none; }
.side-group__summary .icon { transition: transform .15s ease; }
.side-group:not([open]) > .side-group__summary { margin-bottom: 0; }
.side-group:not([open]) > .side-group__summary .icon { transform: rotate(-90deg); }
.side-group__current {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-16);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-strong);
}
.side-group__filter { margin-bottom: var(--space-3); padding-block: var(--space-2); font-size: var(--text-14); }

.side-nav { margin: 0; padding: 0; list-style: none; }
.side-nav__link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 6px var(--space-3);
    border-left: 2px solid var(--rule);
    font-size: var(--text-14);
    line-height: var(--leading-snug);
    color: var(--ink);
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color .15s ease, border-color .15s ease;
}
.side-nav__link:hover { color: var(--brand); border-left-color: var(--brand-soft); }
.side-nav__link[aria-current] { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.side-nav__count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--text-12); color: var(--muted); }

.side-sub { margin-top: var(--space-1); }
.side-sub__summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px var(--space-3) 6px 0;
    font-size: var(--text-14);
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--ink-strong);
    cursor: pointer;
    list-style: none;
    border-radius: var(--radius-sm);
    transition: color .15s ease;
}
.side-sub__summary::-webkit-details-marker { display: none; }
.side-sub__summary:hover { color: var(--brand); }
.side-sub__summary .icon { transition: transform .15s ease; color: var(--muted); }
.side-sub:not([open]) > .side-sub__summary .icon { transform: rotate(-90deg); }
.side-sub > .side-nav { margin: var(--space-1) 0 var(--space-2) 7px; }

/* Заголовок страницы каталога */
.page-head { margin-bottom: var(--space-6); }
.page-head h1 { font-size: var(--text-36); }
.page-head__desc { margin-top: var(--space-3); }
.page-head__desc p { text-align: justify; hyphens: auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-5); }

/* --- Строки списка экспонатов (п. 6.6) --------------------------------- */
.item-list { margin: var(--space-6) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.item-row { padding-block: var(--space-5); border-bottom: 1px solid var(--rule); }
.item-row:last-child { border-bottom: 0; }
.item-row__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.item-row__title {
    margin: 0;
    font-size: var(--text-20);
    font-weight: 700;
    line-height: var(--leading-snug);
    color: var(--ink-strong);
    overflow-wrap: anywhere;
}
.item-row__meta { margin-top: var(--space-1); font-size: var(--text-14); line-height: var(--leading-snug); color: var(--muted); overflow-wrap: anywhere; }
.item-row__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.item-row__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: var(--space-5);
    margin-top: var(--space-4);
}
.item-row__photos > * + * { margin-top: var(--space-3); }
.item-row__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }

.thumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.thumb {
    display: block;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: zoom-in;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.thumb:hover { border-color: var(--brand); box-shadow: var(--shadow-1); }
.thumb:disabled { cursor: default; border-color: var(--rule); box-shadow: none; }
.photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 120px;
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface-3);
    font-size: var(--text-14);
    color: var(--muted);
}
.thumb img { display: block; height: 176px; width: auto; max-width: 100%; object-fit: contain; border-radius: calc(var(--radius) - 1px); }
.thumbs--small .thumb img { height: 64px; }

/* Характеристики: подпись-определение + значение */
.specs {
    display: grid;
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
    gap: var(--space-2) var(--space-4);
    margin: 0;
    align-content: start;
}
.specs dt {
    padding-top: 3px;
    font-size: var(--text-12);
    font-weight: 600;
    line-height: var(--leading-snug);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.specs dd { margin: 0; font-size: var(--text-16); line-height: var(--leading-snug); overflow-wrap: anywhere; }
.specs a { display: inline-flex; align-items: center; gap: var(--space-1); }
.specs a .icon { width: 14px; height: 14px; }

/* --- Пагинация (п. 6.15) ----------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin: var(--space-7) 0 0; padding: 0; list-style: none; }
.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-3);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    font-size: var(--text-14);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
a.pagination__item:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-2); }
.pagination__item[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pagination__gap { border-color: transparent; color: var(--muted-soft); }
.pagination__item .icon { width: 16px; height: 16px; }

/* --- Главная ------------------------------------------------------------ */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: var(--space-7);
    align-items: center;
}
.hero__title { max-width: 18ch; font-size: var(--text-48); line-height: 1.1; letter-spacing: -0.02em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
.hero__cover {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-lg);
    background: var(--surface-3);
    box-shadow: var(--shadow-2);
}

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.photo-tile {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    background: var(--surface-3);
    cursor: zoom-in;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.photo-tile:hover { border-color: var(--brand); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.photo-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius-lg) - 1px); }
.photo-tile--contain img { object-fit: contain; }
.photo-wide { max-width: 100%; }
.photo-wide img { display: block; width: 100%; height: auto; border-radius: calc(var(--radius-lg) - 1px); }

.maker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); }
.maker {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--ink-strong);
}
.maker__name { min-width: 0; overflow-wrap: anywhere; }
.maker__count { flex: none; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--text-14); font-weight: 400; color: var(--muted); }
.maker:hover .maker__name { color: var(--brand); }

.exhibit { display: flex; flex-direction: column; padding: var(--space-4); text-decoration: none; }
.exhibit__photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin-bottom: var(--space-3);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.exhibit .card__title { font-size: var(--text-16); overflow-wrap: anywhere; }
.exhibit .card__meta { margin-top: var(--space-1); }

/* --- Галерея (модальное окно) ------------------------------------------ */
.gallery {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.gallery[hidden] { display: none; }
.gallery__panel {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    width: min(1000px, 100%);
    height: min(88vh, 900px);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3);
}
.gallery__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: var(--space-5) var(--space-9);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--surface-2);
}
.gallery__image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.gallery__close { position: absolute; top: var(--space-3); right: var(--space-3); z-index: 1; background: var(--surface); }
.gallery__nav { position: absolute; top: 50%; margin-top: -20px; background: var(--surface); }
.gallery__nav--prev { left: var(--space-4); }
.gallery__nav--next { right: var(--space-4); }
.gallery__footer {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--rule);
}
.gallery__counter { flex: none; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--text-14); color: var(--muted); }
.gallery__thumbs { display: flex; gap: var(--space-2); overflow-x: auto; padding: 3px; }
.gallery__thumb {
    flex: none;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease;
}
.gallery__thumb:hover { border-color: var(--brand); }
.gallery__thumb[aria-current="true"] { border: 2px solid var(--brand); }
.gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: calc(var(--radius) - 2px); }

/* Диалог (подтверждение импорта) */
.dialog {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.dialog__panel { width: min(640px, 100%); max-height: calc(100vh - 2 * var(--space-4)); overflow-y: auto; padding: var(--space-6); box-shadow: var(--shadow-3); }
.dialog__title { font-size: var(--text-24); }

/* --- Служебные страницы ------------------------------------------------- */
.progress { height: 8px; margin-top: var(--space-4); border-radius: var(--radius-pill); background: var(--surface-3); }
.progress__bar { height: 100%; width: 0; border-radius: inherit; background: var(--brand); transition: width .15s ease; }
.progress__bar[data-state="success"] { background: var(--success); }
.progress__bar[data-state="error"] { background: var(--danger); }

.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.panel-head h2 { margin: 0; font-size: var(--text-24); }

.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.q-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); transition: border-color .15s ease, background-color .15s ease; }
.q-card[data-selected="true"] { border-color: var(--brand); background: var(--brand-soft); }
.q-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.q-card__name { margin: 0; font-family: var(--font-mono); font-size: var(--text-14); font-weight: 700; line-height: var(--leading-snug); color: var(--ink-strong); overflow-wrap: anywhere; }
.q-card__actions { display: flex; gap: var(--space-1); flex: none; }
.q-card__images { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.q-card__images img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); }
.q-card__empty { padding: var(--space-4); border-radius: var(--radius); background: var(--surface-3); font-size: var(--text-14); color: var(--muted); text-align: center; }
.q-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.q-card__suggest { margin: 0; font-family: var(--font-mono); font-size: var(--text-12); line-height: var(--leading-snug); color: var(--muted); white-space: pre-wrap; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); color: var(--muted); text-align: center; }
.empty-state .icon { width: 32px; height: 32px; }

/* --- Подвал (п. 6.12) --------------------------------------------------- */
.site-footer {
    flex: none;
    margin-top: var(--space-8);
    padding: var(--space-7) 0 var(--space-5);
    background: var(--surface-2);
    border-top: 1px solid var(--rule);
    font-size: var(--text-14);
    line-height: var(--leading-snug);
    color: var(--muted);
}
.site-main + .site-footer { margin-top: 0; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7); }
.site-footer__brand .brand__mark { height: 56px; }
.site-footer__brand .brand__marks { display: inline-flex; margin-bottom: var(--space-4); }
.site-footer__name { margin: 0 0 var(--space-2); font-size: var(--text-16); font-weight: 700; color: var(--ink-strong); }
.site-footer__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-14);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-strong);
}
.site-footer__list { margin: 0; padding: 0; list-style: none; }
.site-footer__list li + li { margin-top: var(--space-2); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.site-footer address { font-style: normal; overflow-wrap: anywhere; }
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--rule);
}
.signature { font-size: var(--text-12); font-weight: 700; color: var(--ink-strong); }

/* --- Баннер cookie (п. 11.2) ------------------------------------------- */
.cookie-banner {
    position: fixed;
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: 70;
    display: flex;
    align-items: center;
    gap: var(--space-5);
    max-width: 720px;
    margin-inline: auto;
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3);
    font-size: var(--text-14);
    line-height: var(--leading-snug);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__text { margin: 0; flex: 1 1 auto; }
.cookie-banner__actions { display: flex; gap: var(--space-2); flex: none; }
.cookie-banner__actions .btn { min-width: 132px; }

/* --- Адаптив ------------------------------------------------------------ */
@media (max-width: 1024px) {
    .site-nav, .header-actions .menu--admin { display: none; }
    .burger { display: inline-flex; }
    .brand__mark { height: 32px; }
    .brand__marks { border-radius: var(--radius-sm); }
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .catalog { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
    .catalog__sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        padding: var(--space-4) var(--space-5);
        background: var(--surface-2);
        border-radius: var(--radius-lg);
    }
    .catalog__sidebar .side-nav { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
    .catalog__sidebar .side-sub .side-nav { max-height: none; }
}
@media (min-width: 1025px) {
    .mobile-menu { display: none; }
}

@media (max-width: 900px) {
    .hero { grid-template-columns: minmax(0, 1fr); }
    .hero__cover { max-width: 320px; }
    .item-row__body { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
    html { font-size: 17px; }
    h1 { font-size: var(--text-36); }
    h2 { font-size: var(--text-30); }
    h3 { font-size: var(--text-20); }
    .hero__title { font-size: var(--text-48); }
    .site-main { padding-block: var(--space-5); }
    .thumb img { height: 140px; }
    .gallery { padding: 0; }
    .gallery__panel { height: 100%; border-radius: 0; border: 0; }
    .gallery__stage { padding: var(--space-6) var(--space-4); border-radius: 0; }
    .gallery__thumb { width: 56px; height: 56px; }
}

@media (max-width: 640px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
    .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
    .site-footer__bottom { flex-direction: column; align-items: flex-start; }
    .cookie-banner { flex-direction: column; align-items: stretch; gap: var(--space-4); }
    .cookie-banner__actions { justify-content: flex-end; }
    .cookie-banner__actions .btn { flex: 1 1 auto; min-width: 0; }
    .item-row__actions .btn, .toolbar .btn, .toolbar .menu { flex: 1 1 auto; }
    .toolbar .menu .btn { width: 100%; }
    .brand__name { display: none; }
}

@media (max-width: 480px) {
    .container { padding-inline: var(--space-4); }
    .card { padding: var(--space-4); }
    .auth__card { padding: var(--space-5); }
    .form-actions .btn, .hero__actions .btn { flex: 1 1 auto; }
    .search-form { flex-direction: column; }
    .thumb img { height: 112px; }
    .maker-grid, .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
