/* ===== Шрифты: Playfair Display + Inter (OFL, локально, вариативные начертания, сабсет кириллица+латиница) ===== */
@font-face {
    font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap;
    src: url('fonts/PlayfairDisplay-normal-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap;
    src: url('fonts/PlayfairDisplay-normal-latin.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: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
    src: url('fonts/PlayfairDisplay-italic-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
    src: url('fonts/PlayfairDisplay-italic-latin.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: 'Inter'; font-style: normal; font-weight: 400 900; font-display: swap;
    src: url('fonts/Inter-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400 900; font-display: swap;
    src: url('fonts/Inter-latin.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;
}

/* ============================================================
   Букинистика — дизайн-система «Читальный зал»
   Палитра: бумага, бутылочное стекло, сургуч, латунь.
   Шрифты: книжная антиква в заголовках, системный гротеск в UI.
   Темы: светлая «дневной зал», тёмная «вечерний зал».
   ============================================================ */

/* ============================================================
   789 ROOM — дизайн-система «Комната прослушивания»
   Тёмная тема по умолчанию: тёплый графит, янтарь, латунь; светлая — по кнопке.
   ============================================================ */

:root {
    --paper: #0f0e0c;
    --card: #17150f;
    --card-2: #1e1b15;
    --ink: #f3ece0;
    --muted: #a3988a;
    --line: #2b2721;
    --line-strong: #3b352d;

    --brand: #f0a93a;          /* янтарь */
    --brand-deep: #d8902a;
    --brand-ink: #ffd892;
    --tint-brand: #2a2113;
    --on-brand: #140f06;

    --accent: #e4583d;         /* сургуч */
    --accent-deep: #c84a32;
    --tint-accent: #311a15;
    --on-accent: #140f06;

    --gold: #d8bb6a;
    --tint-gold: #2e2814;

    --danger: #e4675d;
    --tint-danger: #341d1b;
    --on-danger: #140f06;

    --shadow: 0 18px 50px rgba(0, 0, 0, .55);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, .4);
    --radius: 14px;
    --radius-s: 8px;
    --tap: 46px;

    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --spring: linear(0, .25 6%, .69 15%, .93 22%, 1.04 29%, 1.06 35%, 1.03 44%, 1 55%, .995 70%, 1);
    --t-fast: 140ms;
    --t: 220ms;

    --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

html[data-theme="light"] {
    --paper: #f3eee5;
    --card: #fffdf9;
    --card-2: #f8f3ea;
    --ink: #1b1813;
    --muted: #6f6659;
    --line: #e2dacb;
    --line-strong: #cdc3b0;

    --brand: #b86f14;
    --brand-deep: #94580d;
    --brand-ink: #5a3505;
    --tint-brand: #f7e9d2;
    --on-brand: #fff;

    --accent: #c9452b;
    --accent-deep: #a33822;
    --tint-accent: #f9e5df;
    --on-accent: #fff;

    --gold: #8a6d1d;
    --tint-gold: #f6eed3;

    --danger: #b3261e;
    --tint-danger: #fbeae8;
    --on-danger: #fff;

    --shadow: 0 12px 30px rgba(46, 38, 24, .14);
    --shadow-soft: 0 6px 18px rgba(46, 38, 24, .09);
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    min-width: 320px;
    margin: 0;
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 85% -160px, color-mix(in srgb, var(--brand) 14%, transparent) 0%, transparent 65%),
        var(--paper);
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; text-underline-offset: .2em; }
p a:not(.btn), .record-desc a, .muted a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
p a:not(.btn):hover { text-decoration-color: currentColor; }
a:hover { color: var(--brand-deep); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; font-size: 16px; }
button, .btn, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--tint-accent); color: var(--ink); }
:root { accent-color: var(--brand); caret-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
table, .status, .count, .stat-card strong { font-variant-numeric: tabular-nums; }

h1, h2, h3, .brand, .price, .tag-price, .stat-card strong {
    font-family: var(--font-display);
    letter-spacing: -.025em;
}
h1 { margin: 0 0 12px; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.02; font-weight: 800; text-wrap: balance; }
h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
h2 { margin: 0 0 10px; font-size: 21px; line-height: 1.25; }
p { line-height: 1.6; }
.price, .tag-price, .stat-card strong { font-variant-numeric: tabular-nums; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 100;
    padding: 10px 16px; background: var(--brand); color: var(--on-brand); border-radius: var(--radius-s);
}
.skip-link:focus { left: 8px; color: var(--on-brand); }

/* ---------- Шапка ---------- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top);
}
.header-inner { min-height: 60px; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; overflow: visible; }
.brand { flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; font-weight: 700; font-size: 20px; white-space: nowrap; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; }
.top-nav {
    display: flex; gap: 2px; align-items: center;
    font-weight: 600; flex-wrap: nowrap;
    min-width: 0; flex: 1 1 0;
    overflow: visible;
    justify-content: flex-end;
}

/* Главные пункты: иконка + текст */
.nav-link {
    flex: 0 0 auto;
    min-height: 36px;
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: 999px; padding: 6px 11px;
    white-space: nowrap; font-size: 14px; font-weight: 600;
    transition: background .14s ease, color .14s ease;
}
.nav-link:hover { background: var(--tint-brand); color: var(--brand-deep); }
.nav-link[aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.nav-link .ui-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.cart-link { position: relative; padding-right: 8px; }
.cart-badge {
    display: inline-grid; place-items: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 999px; background: var(--card-2); color: var(--muted);
    border: 1px solid var(--line-strong); font-size: 12px; font-weight: 900;
}
.cart-link.has-items .cart-badge, .cart-badge.is-not-empty {
    background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.header-cart-button {
    position: relative; flex: 0 0 auto;
    width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    color: var(--brand-deep); background: var(--card);
    border: 1px solid var(--line-strong); box-shadow: var(--shadow-soft);
    transition: transform .15s ease, color .15s ease, background .15s ease, border-color .15s ease;
}
.header-cart-button svg {
    width: 23px; height: 23px; fill: none; stroke: currentColor;
    stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.header-cart-button:hover { color: var(--on-brand); background: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.header-cart-button[aria-current="page"] { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.header-cart-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px;
    display: none; place-items: center;
    color: var(--on-accent); background: var(--accent); border: 2px solid var(--paper);
    font-size: 11px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums;
}
.header-cart-badge.is-not-empty { display: grid; }

/* Разделитель */
.nav-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; flex: 0 0 auto; opacity: .5; }

/* Иконка-кнопка для второстепенных пунктов */
.nav-icon-btn {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 17px; line-height: 1;
    border: 0; background: transparent; cursor: pointer;
    color: var(--muted);
    transition: background .14s ease, color .14s ease, transform .14s ease;
    position: relative;
    text-decoration: none;
}
.nav-icon-btn:hover { background: var(--tint-brand); color: var(--brand-deep); transform: translateY(-1px); }
.nav-icon-btn[aria-current="page"] { background: var(--tint-brand); color: var(--brand-deep); }

/* Tooltip из title — только десктоп */
/* tooltip через title — работает при overflow:hidden шапки */
@media (hover: hover) {
    .nav-icon-btn { overflow: visible; }
    .nav-icon-btn::after {
        content: attr(title);
        position: fixed;
        top: 66px;
        left: auto;
        background: var(--ink); color: var(--paper);
        padding: 4px 10px; border-radius: 8px;
        font-size: 12px; font-weight: 600; white-space: nowrap;
        pointer-events: none; opacity: 0;
        transition: opacity .15s ease;
        z-index: 200;
        transform: none;
    }
    .nav-icon-btn:hover::after { opacity: 1; }
}
.nav-logout { display: contents; margin: 0; }
.nav-logout button.nav-icon-btn { font-family: inherit; }

/* Переключатель темы */
.theme-toggle {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
    display: inline-grid; place-items: center; line-height: 1;
    transition: background var(--t-fast) ease, color var(--t-fast) ease;
}
.theme-toggle:hover { background: var(--tint-brand); color: var(--brand-deep); }
.theme-toggle .ui-icon { animation: icon-in 360ms var(--spring); }
@keyframes icon-in { from { opacity: 0; transform: rotate(-60deg) scale(.6); } to { opacity: 1; transform: none; } }
.theme-toggle .ico-moon, html[data-theme="dark"] .theme-toggle .ico-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: block; }

/* Гарантия: скрытое скрыто при любом CSS */
[hidden] { display: none !important; }
/* nav-drop скрывается через JS: style.display=none при закрытии */

/* Бургер — мобильное меню */
.nav-burger { position: relative; display: none; }
.public-nav-burger { display: block; }
.burger-btn {
    cursor: pointer; width: 42px; height: 42px;
    display: grid; place-items: center; border: 1px solid var(--line);
    border-radius: var(--radius-s); background: var(--card); padding: 0;
}
.burger-ico, .burger-ico::before, .burger-ico::after {
    content: ''; display: block; width: 18px; height: 2px; background: var(--ink);
    border-radius: 2px; position: relative; transition: transform .2s ease, opacity .2s ease;
}
.burger-ico::before { position: absolute; top: -6px; }
.burger-ico::after { position: absolute; top: 6px; }
.burger-btn[aria-expanded="true"] .burger-ico { background: transparent; }
.burger-btn[aria-expanded="true"] .burger-ico::before { transform: translateY(6px) rotate(45deg); }
.burger-btn[aria-expanded="true"] .burger-ico::after { transform: translateY(-6px) rotate(-45deg); }
.nav-burger .nav-drop { right: 0; left: auto; }

/* Выпадающее меню */
.nav-more { position: relative; }
.menu-btn { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 7px 11px; border-radius: 999px; font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; font-size: 15px; white-space: nowrap; font-family: inherit; }
.nav-more .menu-btn .arr { width: 7px; height: 7px; margin: -3px 2px 0 7px; border: solid currentColor; border-width: 0 1.75px 1.75px 0; opacity: .6; display: inline-block; transform: rotate(45deg); transition: transform var(--t) var(--ease-out); }
.nav-more .menu-btn[aria-expanded="true"] .arr { transform: translateY(3px) rotate(225deg); }
.menu-btn:hover, .menu-btn[aria-expanded="true"], .menu-btn[aria-current="page"] { background: var(--tint-brand); color: var(--brand-deep); }
.nav-drop {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
    min-width: 220px; padding: 8px; display: grid; gap: 2px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
    animation: drop-in .16s ease;
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav-drop a, .nav-drop button { padding: 10px 12px; border-radius: var(--radius-s); font-weight: 600; white-space: nowrap; text-align: left; border: 0; background: transparent; cursor: pointer; width: 100%; }
.nav-drop a:hover, .nav-drop button:hover { background: var(--tint-brand); color: var(--brand-deep); }
.nav-drop .drop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.nav-drop-title {
    display: block;
    padding: 8px 12px 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ---------- Каркас ---------- */
.main { padding: 28px 0 84px; min-height: calc(100vh - 150px); }
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.hero, .admin-head {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    margin-bottom: 24px; padding: 26px 28px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
}
.admin-head { padding: 4px 0 18px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.admin-head h1 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 6px; }
.admin-head .muted { max-width: 68ch; }
.catalog-hero { margin-bottom: 16px; padding: 18px 22px; }
.catalog-hero .eyebrow { margin-bottom: 5px; }
.catalog-hero h1 { margin-bottom: 8px; }
.catalog-hero p:not(.eyebrow) { margin-bottom: 12px; }
body:not(.has-bottom-nav) .header-inner { min-height: 52px; gap: 8px; }
body:not(.has-bottom-nav) .brand { font-size: 18px; }
body:not(.has-bottom-nav) .brand-mark { width: 36px; height: 36px; border-radius: 10px 3px 3px 10px; }
body:not(.has-bottom-nav) .theme-toggle,
body:not(.has-bottom-nav) .burger-btn { width: 36px; height: 36px; }
body:not(.has-bottom-nav) .header-cart-button { width: 40px; height: 40px; }
body:not(.has-bottom-nav) .header-cart-button svg { width: 21px; height: 21px; }
body:not(.has-bottom-nav) .main { padding-top: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-weight: 500; font-size: 13.5px; font-family: var(--font-ui); }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title h1 { margin-bottom: 0; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 10px 18px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: var(--card); color: var(--ink);
    font-weight: 700; cursor: pointer; touch-action: manipulation;
    line-height: 1.2; text-align: center;
    transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t) var(--ease-out), background var(--t-fast) ease, border-color var(--t-fast) ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: none; transition-duration: 60ms; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[aria-busy="true"] { cursor: progress; opacity: .75; }
.btn.primary { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-deep); color: var(--on-brand); }
.btn.ghost { background: transparent; }
.btn.danger, .row-actions .danger, button.danger { border-color: var(--danger); background: var(--danger); color: var(--on-danger); }
.btn.danger:hover, .row-actions .danger:hover, button.danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); color: var(--on-danger); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }

/* ---------- Формы ---------- */
input, select, textarea {
    width: 100%; min-height: var(--tap);
    border: 1px solid var(--line-strong); border-radius: 12px;
    padding: 10px 13px; background: var(--card); color: var(--ink);
    transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint-brand); outline: none; }
textarea { resize: vertical; }
input[type="file"] { padding: 9px 12px; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
.form-stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; align-items: end; }
.grid-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
label { font-weight: 600; }

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) auto auto;
    gap: 12px; margin-bottom: 18px; padding: 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.filters.compact { grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto auto; }

/* Панель результатов: счётчик + вид */
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.results-count { color: var(--muted); font-weight: 600; }
.view-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.view-toggle button {
    border: 0; background: var(--card); color: var(--muted); cursor: pointer;
    min-height: 38px; padding: 6px 14px; font-weight: 700; font-size: 14px;
}
.view-toggle button.active { background: var(--brand); color: var(--on-brand); }

/* ---------- Чипы жанров ---------- */
.genre-chips {
    display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 0 16px;
    overflow-x: auto; padding: 0 1px 6px;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.genre-chips::-webkit-scrollbar { height: 5px; }
.genre-chips::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.chip {
    flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
    background: var(--card); border: 1px solid var(--line-strong); white-space: nowrap;
    transition: all .16s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand-deep); transform: translateY(-1px); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.active:hover { color: var(--on-brand); }

/* ---------- Каталог: карточка-корешок ---------- */
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.book-card {
    position: relative;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-soft);
    display: flex; flex-direction: column; min-width: 0;
    transition: transform 420ms var(--spring), box-shadow var(--t) var(--ease-out), border-color var(--t) ease;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.cover { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: linear-gradient(135deg, var(--card-2), var(--line)); }
.cover { perspective: 900px; }
.cover::after {                      /* шарнир переплёта: свет и тень у корешка */
    content: ''; position: absolute; inset: 0 auto 0 0; width: 14%; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.22), rgba(255,255,255,.12) 38%, rgba(0,0,0,.06) 60%, transparent);
}
.cover img, .detail-cover img, .cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card .cover img { transform-origin: left center; transition: transform 520ms var(--spring); }
.book-card:hover .cover img { transform: rotateY(-9deg) scale(1.02); }
.book-card-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.book-card h2 { font-size: 17px; margin: 0; }
.book-card h2 a:hover { color: var(--brand-deep); }
.genre-pill {
    align-self: flex-start; padding: 4px 10px; border-radius: 999px;
    background: var(--tint-brand); color: var(--brand-deep); font-size: 12px; font-weight: 700;
}
.muted, .meta { color: var(--muted); margin: 0; }
.meta { font-size: 14px; }
.card-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.price { display: inline-block; font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.count { color: var(--muted); white-space: nowrap; font-size: 14px; }


/* ---------- Появление ---------- */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .book-card:hover, .book-card:hover .cover img { transform: none; }
    .book-card, .chip, .btn, .cover::after, .theme-toggle,
    .header-cart-button, .nav-icon-btn, .nav-link, .stat-card, .report-period-card,
    .pagination .page-link, .view-toggle button, .view-toggle a { transition: none !important; }
    .nav-drop, .flash, .mini-form, .infinite-sentinel::before { animation: none !important; }
}

/* ---------- Пагинация ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.pagination .page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; min-height: 42px; padding: 4px 10px; border-radius: 12px;
    color: var(--ink); background: var(--card); border: 1px solid var(--line-strong);
    transition: background .14s ease;
}
.pagination .page-link.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); font-weight: 700; }
.pagination .page-link:hover:not(.active) { background: var(--tint-brand); }
.pagination .page-gap { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }
.infinite-sentinel {
    display: flex; justify-content: center; align-items: center; min-height: 54px;
    margin: 18px 0 6px; color: var(--muted); font-weight: 700;
}
.infinite-sentinel::before {
    content: ''; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%;
    background: var(--brand); opacity: .55;
}
.infinite-sentinel.is-loading::before { animation: pulse-dot .8s ease-in-out infinite alternate; }
@keyframes pulse-dot { from { transform: scale(.7); opacity: .35; } to { transform: scale(1.1); opacity: 1; } }

/* ---------- Панели ---------- */
.empty, .panel {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-soft);
}
.empty { text-align: center; color: var(--muted); padding: 48px 24px; }
.empty::before { content: ''; display: block; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: radial-gradient(circle, var(--brand) 0 14%, var(--paper) 14% 19%, transparent 19%), repeating-radial-gradient(circle, var(--line) 0 1.5px, var(--card-2) 1.5px 3.5px); }
.panel.narrow { max-width: 560px; margin: 0 auto; }
.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }
.danger-panel, .danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: linear-gradient(180deg, var(--card), var(--tint-danger)); }
.item-focus { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: linear-gradient(180deg, var(--card), var(--tint-brand)); }
code { background: var(--card-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; font-size: 14px; }

/* ---------- Карточка книги ---------- */
.book-detail {
    display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 34px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow-soft);
}
.detail-cover { position: relative; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, var(--card-2), var(--line)); align-self: start; box-shadow: var(--shadow-soft); }
.author { font-size: 22px; margin: 0 0 8px; color: var(--muted); font-family: var(--font-display); }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.copy-short-link { min-width: 40px; padding-left: 0; padding-right: 0; }
.copy-sheets { position: relative; display: inline-block; width: 18px; height: 18px; }
.copy-sheets::before,
.copy-sheets::after {
    content: ''; position: absolute; width: 12px; height: 14px;
    border: 2px solid currentColor; border-radius: 3px; background: var(--card);
}
.copy-sheets::before { left: 1px; top: 3px; opacity: .72; }
.copy-sheets::after { left: 5px; top: 0; box-shadow: -2px 2px 0 var(--card); }
.share-status { min-height: 20px; color: var(--brand-deep); font-size: 13px; font-weight: 700; }
html[data-theme="dark"] .share-status { color: var(--brand); }
.copies-list { display: grid; gap: 10px; }
.copy-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 10px 12px; background: var(--card-2); align-items: start; }
.copy-card small { grid-column: 2; color: var(--muted); }
.copy-card .copy-actions, .copy-card .reserved-badge { grid-column: 1 / -1; justify-self: start; }
.copy-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.copy-card.is-reserved { opacity: .85; background: var(--tint-gold); }
.reserved-badge { display: inline-flex; padding: 5px 11px; border-radius: 999px; background: var(--tint-gold); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); color: var(--gold); font-size: 13px; font-weight: 700; }

.copy-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; width: 100%; }
.reserve-details { margin-top: 10px; }
.copy-actions .reserve-details { margin-top: 0; }
.reserve-details > summary { list-style: none; }
.reserve-details > summary::-webkit-details-marker { display: none; }
.reserve-details[open] > summary { background: var(--tint-accent); border-color: var(--accent); color: var(--accent-deep); }
.order-details > summary { background: var(--brand); color: var(--on-brand); }
.order-details > summary:hover { background: var(--brand-deep); }
.reserve-form { display: grid; gap: 10px; width: 100%; max-width: 420px; margin-top: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; box-sizing: border-box; }
.reserve-form label { display: grid; gap: 6px; min-width: 0; }
.reserve-form input, .reserve-form select, .reserve-form textarea { width: 100%; box-sizing: border-box; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.related { margin-top: 36px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 12px; }
.related-grid .book-card h2, .related-grid h3 { font-size: 15px; margin: 6px 0 2px; }

/* ---------- Флэш-сообщения ---------- */
.flash {
    padding: 13px 16px; border-radius: 14px; margin-bottom: 14px;
    border: 1px solid var(--line); background: var(--card);
    display: flex; align-items: center; gap: 10px;
    animation: drop-in .25s ease;
    box-shadow: var(--shadow-soft);
}
.flash::before { font-size: 17px; }
.flash.success { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--tint-brand); }
.flash.success::before { content: '✓'; color: var(--brand-deep); font-weight: 900; }
.flash.error { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--tint-danger); }
.flash.error::before { content: '!'; color: var(--danger); font-weight: 900; }

.cookie-consent {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80;
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
    max-width: 980px; margin: 0 auto; padding: 14px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cookie-consent div { display: grid; gap: 2px; }
.cookie-consent span { color: var(--muted); font-size: 14px; line-height: 1.35; }
.cookie-consent a { color: var(--brand-deep); font-weight: 800; white-space: nowrap; }

/* ---------- Таблицы ---------- */
.table-wrap {
    overflow-x: auto; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-soft);
    -webkit-overflow-scrolling: touch;
}
.admin-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.admin-table th, .admin-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th {
    position: sticky; top: 0; z-index: 1;
    background: var(--card-2); color: var(--muted);
    font-size: 13px; font-weight: 600;
}
.admin-table tbody tr { transition: background .12s ease; }
.admin-table tbody tr:hover { background: var(--card-2); }
.admin-table .status { margin: 2px 4px 2px 0; }
.admin-table input, .admin-table select { min-width: 120px; }
.row-error { background: var(--tint-danger) !important; }
.ok-line { color: var(--brand-deep); font-weight: 700; }

.row-actions { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions form { display: inline; }
.row-actions a, .row-actions button {
    display: inline-flex; align-items: center; min-height: 34px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--card-2); padding: 6px 11px; color: var(--ink);
    cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; touch-action: manipulation;
    transition: background .13s ease, border-color .13s ease;
}
.row-actions a:hover, .row-actions button:hover { background: var(--tint-brand); border-color: var(--brand); color: var(--brand-deep); }
.row-actions .quick-sell, .quick-actions .quick-sell { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.row-actions .quick-sell:hover, .quick-actions .quick-sell:hover { background: var(--accent-deep); color: var(--on-accent); }
.quick-actions form { flex: 1 1 120px; }

/* ---------- Статусы ---------- */
.status { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); border: 1px solid var(--line); }
.status.available { background: var(--tint-brand); color: var(--brand-deep); border-color: transparent; }
.status.sold { background: var(--tint-accent); color: var(--accent-deep); border-color: transparent; }
.status.archived { color: var(--muted); }
.status.reserved { background: var(--tint-gold); color: var(--gold); border-color: transparent; }
.status.lost { background: var(--tint-danger); color: var(--danger); border-color: transparent; }
.status.damaged { background: var(--tint-danger); color: var(--danger); border-color: transparent; }
.status.order-new { background: var(--tint-gold); color: var(--gold); border-color: transparent; }
.status.order-confirmed { background: var(--tint-brand); color: var(--brand-deep); border-color: transparent; }
.status.order-shipped { background: var(--tint-accent); color: var(--accent-deep); border-color: transparent; }
.status.order-completed { background: var(--tint-brand); color: var(--brand-deep); border-color: transparent; }
.status.order-cancelled { color: var(--muted); }
.status.payment-pending { background: var(--tint-gold); color: var(--gold); border-color: transparent; }
.status.payment-paid, .status.payment-refunded { background: var(--tint-brand); color: var(--brand-deep); border-color: transparent; }
.status.payment-cancelled { color: var(--muted); }
.status.payment-refund_required { background: var(--tint-danger); color: var(--danger); border-color: transparent; }
.row-actions .payment-action { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.row-actions .payment-action:hover { background: var(--brand-deep); color: var(--on-brand); }
html[data-theme="dark"] .status.damaged { background: #2e2138; color: #c9a8ef; }

/* ---------- Дашборд ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 0 0 18px; }
.stat-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow-soft);
    transition: transform .16s ease, box-shadow .16s ease;
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.stat-card span { display: block; color: var(--muted); font-weight: 600; font-size: 13px; line-height: 1.25; margin-bottom: 8px; }
.stat-card strong { display: block; font-size: 26px; line-height: 1; color: var(--brand-deep); }
.dashboard-cards .accent { background: var(--tint-accent); border-color: transparent; }
.dashboard-cards .accent strong { color: var(--accent-deep); }
#salesChart, .report-chart { width: 100%; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.report-head .actions { align-items: center; }
.report-filters { align-items: end; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto minmax(320px, 1.4fr); }
.report-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-presets .btn { min-height: 42px; }
.report-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: -4px 0 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.report-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.report-chart-legend i { width: 11px; height: 11px; border-radius: 999px; display: inline-block; box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 10%, transparent); }
.report-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.report-columns .panel { margin: 0; }
.report-main-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-summary-panel, .report-details, .report-danger, .report-activity-section { margin-bottom: 18px; }
.report-period-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.report-period-card {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card-2);
    color: inherit;
}
.report-period-card:hover { color: inherit; border-color: var(--brand); background: var(--tint-brand); }
.report-period-card span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.report-period-card strong { color: var(--brand-deep); font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.report-period-card small { color: var(--muted); line-height: 1.35; }
.report-period-card.muted-card { background: transparent; }
.report-details { padding: 0; overflow: hidden; }
.report-details > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 20px;
    font-weight: 800;
}
.report-details > summary::-webkit-details-marker { display: none; }
.report-details > summary::after {
    content: '+';
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--tint-brand);
    color: var(--brand-deep);
}
.report-details[open] > summary::after { content: '−'; }
.report-details > summary span { display: grid; gap: 3px; min-width: 0; }
.report-details > summary small { color: var(--muted); font-weight: 600; line-height: 1.35; }
.report-details > .table-wrap, .report-details > .report-columns { margin: 0 20px 20px; }
.report-details h3 { margin: 0 0 10px; font-size: 18px; }
.report-inline-details { margin-top: 14px; }
.report-inline-details > summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--tint-brand);
    color: var(--brand-deep);
    font-weight: 800;
}
.report-inline-details > summary::-webkit-details-marker { display: none; }
.report-inline-details .table-wrap { margin-top: 12px; }
.report-compact-table th, .report-compact-table td { padding-top: 9px; padding-bottom: 9px; }

.dashboard-books-table { min-width: 780px; }
.dashboard-books-table th, .dashboard-books-table td { padding: 9px 10px; vertical-align: middle; }
.dashboard-book-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dashboard-book-thumb {
    flex: 0 0 42px;
    width: 42px;
    height: 58px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--card-2);
    object-fit: cover;
    box-shadow: 0 3px 8px rgba(46, 38, 24, .10);
}
.dashboard-book-info { display: grid; gap: 2px; min-width: 0; }
.dashboard-book-title {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1.18;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-book-author {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-book-mobile-meta { display: none; }
.dashboard-books-table .status { padding: 3px 8px; font-size: 11.5px; }
.dashboard-books-table .row-actions a,
.dashboard-books-table .row-actions button {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 12.5px;
}

/* ---------- Массовые действия ---------- */
.check-col { width: 34px; text-align: center; }
.row-check, #checkAll { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.bulk-bar {
    position: sticky; bottom: 10px; z-index: 30;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-top: 14px; padding: 12px 14px;
    background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow);
}
.bulk-bar select, .bulk-bar input[type="text"], .bulk-bar input[type="number"] { width: auto; min-height: 40px; padding: 8px 10px; }
.bulk-bar .count-pill { min-width: 34px; text-align: center; padding: 6px 10px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.checkline { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 600; font-size: 14px; color: var(--muted); }
.checkline input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; }
.order-toggle-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.order-toggle-form .checkline { color: var(--text); }
.order-toggle-form .small { flex: 1 1 260px; }
.hidden-form { display: none; }

/* ---------- Мини-формы в строках ---------- */
.inline-details { display: inline-block; }
.inline-details > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 34px;
    padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--card-2); font-size: 13px; font-weight: 700;
}
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > summary { background: var(--tint-brand); border-color: var(--brand); color: var(--brand-deep); }
.mini-form {
    position: absolute; z-index: 35; margin-top: 6px;
    display: grid; gap: 8px; min-width: 240px; padding: 12px;
    background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow);
    animation: drop-in .16s ease;
}
.mini-form input, .mini-form select { min-height: 40px; padding: 8px 10px; }

/* ---------- QR и ценники ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.qr-label {
    break-inside: avoid; background: var(--card); border: 1px dashed var(--line-strong); border-radius: 14px;
    padding: 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; min-height: 250px;
}
.qr-label img { width: 140px; height: 140px; object-fit: contain; background: #fff; border-radius: 6px; }
.qr-label strong { color: var(--brand-deep); }
.qr-label small { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; word-break: break-all; }

.tags-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.price-tag {
    display: grid; grid-template-columns: 1fr 76px; gap: 8px; align-items: center;
    padding: 12px; background: var(--card); border: 1.5px dashed var(--line-strong); border-radius: 10px;
    break-inside: avoid; page-break-inside: avoid;
}
.tag-text { min-width: 0; }
.tag-title { font-weight: 700; font-size: 15px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tag-author { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tag-cond { font-size: 12px; margin-top: 4px; }
.tag-price { font-size: 21px; font-weight: 700; color: var(--accent-deep); margin-top: 6px; }
.tag-qr img { width: 76px; height: 76px; display: block; background: #fff; border-radius: 4px; }
.tag-qr small { display: block; text-align: center; font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ---------- Сканер ---------- */
.scanner-box { display: grid; gap: 14px; }
#qrVideo { width: 100%; max-width: 520px; min-height: 240px; background: #0d1c16; border-radius: var(--radius); justify-self: start; }

/* ---------- Отчёт ---------- */
.report table { font-size: 14px; }
.import-result { padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--tint-brand); margin-bottom: 16px; }
.cover-preview { width: 160px; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }

/* ---------- Кнопка «наверх» ---------- */
.to-top {
    position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 45;
    width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--line-strong);
    background: var(--card); color: var(--ink); cursor: pointer;
    box-shadow: var(--shadow); display: grid; place-items: center;
    opacity: 0; pointer-events: none; transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Нижняя навигация админа (мобильная) ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: none;
    background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(0,0,0,.08);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.bottom-nav::-webkit-scrollbar { height: 4px; }
.bottom-nav::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.bottom-nav a {
    flex: 0 0 72px;
    display: grid; justify-items: center; gap: 2px;
    padding: 6px 2px; border-radius: var(--radius-s);
    font-size: 11px; font-weight: 700; color: var(--muted);
}
.bottom-nav a .bn-ico { display: grid; place-items: center; height: 22px; }
.bottom-nav a:hover, .bottom-nav a[aria-current="page"] { color: var(--brand-deep); background: var(--tint-brand); }


/* ---------- Прямое управление БД ---------- */
.db-toolbar { align-items: end; }
.db-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}
.db-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.db-table th, .db-table td {
    padding: 11px 12px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.db-table .col-id { width: 68px; }
.db-table .col-year { width: 92px; }
.db-table .col-date { width: 132px; }
.db-table .col-status { width: 110px; }
.db-table .col-actions { width: 128px; }
.db-table td.db-actions {
    position: sticky;
    right: 0;
    background: var(--card);
    box-shadow: -10px 0 14px color-mix(in srgb, var(--paper) 70%, transparent);
    z-index: 2;
}
.db-table th.col-actions {
    position: sticky;
    right: 0;
    z-index: 3;
    background: var(--card-2);
}
.db-cell-muted { color: var(--muted); }
.db-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.db-raw-row { margin-top: 14px; }
.db-raw-row summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.db-raw-row pre {
    margin: 10px 0 0;
    padding: 12px;
    border-radius: var(--radius-s);
    background: var(--card-2);
    border: 1px solid var(--line);
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.diagnostics-box {
    margin-top: 14px;
}
.diagnostics-box h3 {
    margin: 0 0 8px;
}
.diagnostics-box pre {
    margin: 0;
    padding: 12px;
    border-radius: var(--radius-s);
    background: var(--card-2);
    border: 1px solid var(--line);
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ============================================================
   Адаптив
   ============================================================ */
/* Средний экран: текст в nav-link скрывается, только иконки */
@media (max-width: 1040px) {
    .nav-link .nl { display: none; }
    .nav-link { padding: 6px 8px; gap: 0; }
    .nav-link .ni { font-size: 18px; }
    .brand { font-size: 18px; }
    .brand span:last-child { display: none; }
}
@media (max-width: 960px) {
    .nav-link { padding: 5px 6px; }
    .nav-icon-btn { width: 32px; height: 32px; font-size: 15px; }
    .nav-sep { margin: 0 2px; }
}

@media (max-width: 1100px) {
    .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .filters, .filters.compact { grid-template-columns: 1fr 1fr; }
    .filters input[type="search"] { grid-column: 1 / -1; }
    .book-detail { grid-template-columns: 260px 1fr; gap: 24px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filters { grid-template-columns: 1fr 1fr; }
    .report-filters > button, .report-filters .report-presets { grid-column: 1 / -1; }
    .report-period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-columns { grid-template-columns: 1fr; }
    .section-title { flex-direction: column; }
    .grid-form { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .container { width: min(100% - 24px, 1180px); }
    .header-inner { min-height: 54px; gap: 8px; }
    .brand { font-size: 19px; }
    .brand-mark { width: 38px; height: 38px; }
    .nav-link, .nav-icon-btn, .nav-sep, .nav-more { display: none; }
    .nav-logout { display: none; }
    .nav-burger { display: block; }
    .main { padding: 20px 0 96px; }
    body.has-bottom-nav .main { padding-bottom: 120px; }
    .bottom-nav { display: flex; }
    body.has-bottom-nav .to-top { bottom: calc(78px + env(safe-area-inset-bottom)); }

    .hero, .admin-head { align-items: flex-start; flex-direction: column; padding: 20px; gap: 14px; }
    .hero .btn, .admin-head .btn { width: 100%; }
    .catalog-hero { padding: 16px; gap: 10px; }
    .catalog-hero .btn { width: auto; }
    .actions { width: 100%; }
    .actions .btn { flex: 1 1 160px; }
    .filters, .filters.compact { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
    .filters .btn { width: 100%; }
    .report-filters { grid-template-columns: 1fr 1fr; }
    .report-filters label { min-width: 0; }
    .report-filters > button, .report-filters .report-presets { grid-column: 1 / -1; }
    .report-presets {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .report-presets .btn { width: auto; min-height: 38px; padding: 8px 10px; font-size: 13px; }
    .report-head { padding: 16px; gap: 10px; }
    .report-head h1 { margin-bottom: 4px; }
    .report-head .muted { font-size: 13px; }
    .report-main-stats { gap: 8px; }
    .report-main-stats .stat-card { padding: 12px; }
    .report-main-stats .stat-card span { font-size: 10.5px; margin-bottom: 6px; }
    .report-main-stats .stat-card strong { font-size: 22px; }
    .report-summary-panel, .report-activity-section { padding: 16px; }
    .report-period-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .report-period-card { padding: 11px; gap: 4px; }
    .report-period-card span { font-size: 10.5px; }
    .report-period-card strong { font-size: 18px; }
    .report-period-card small { font-size: 12px; }
    .report-details > summary { padding: 14px 15px; }
    .report-details > summary small { font-size: 12px; }
    .report-details > .table-wrap, .report-details > .report-columns { margin: 0 12px 14px; }
    .report-compact-table td { grid-template-columns: 92px minmax(0, 1fr); min-height: 36px; padding: 8px 10px; gap: 6px; }
    .report-compact-table td::before { font-size: 10.5px; }
    .report-inline-details > summary { width: 100%; justify-content: center; }
    .report-chart-legend { gap: 8px 10px; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .book-card-body { padding: 13px 13px 14px 17px; }
    .book-detail { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
    .detail-cover { max-width: 280px; width: 100%; justify-self: center; }
    .copy-card { grid-template-columns: 1fr; gap: 6px; }
    .copy-card small { grid-column: auto; }
    .copy-actions { flex-direction: column; align-items: stretch; }
    .copy-actions .reserve-details > summary, .copy-actions .reserve-form { width: 100%; max-width: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions .btn, .form-actions button, .form-actions a { width: 100%; }
    .cover-preview { width: 130px; }
    .quick-actions form { flex: 1 1 100%; }
    .admin-head .actions, .admin-head .actions .btn, .admin-head .actions form, .admin-head .actions button { width: 100%; }
    .report-head .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .report-head .actions .btn, .report-head .actions form, .report-head .actions button { width: 100%; min-width: 0; padding-left: 8px; padding-right: 8px; }
    .order-toggle-form { align-items: stretch; }
    .order-toggle-form .checkline, .order-toggle-form .btn, .order-toggle-form .small { width: 100%; }
    .mini-form { position: static; min-width: 0; width: 100%; }
    .bulk-bar { bottom: calc(70px + env(safe-area-inset-bottom)); }
    .tags-grid { grid-template-columns: 1fr 1fr; }
    .nav-drop { position: fixed; left: 12px; right: 12px; top: 58px; min-width: 0; max-height: calc(100dvh - 142px - env(safe-area-inset-bottom)); overflow: auto; z-index: 80; }

    /* Таблицы → карточки */
    .table-wrap { overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
    .admin-table { display: block; min-width: 0; border-collapse: separate; }
    .admin-table thead { display: none; }
    .admin-table tbody { display: grid; gap: 12px; }
    .admin-table tr { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; }
    .admin-table td {
        display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px;
        padding: 12px 14px; border-bottom: 1px solid var(--line);
        min-height: 44px; align-items: start; overflow-wrap: anywhere;
    }
    .admin-table td:last-child { border-bottom: 0; }
    .admin-table td::before {
        content: attr(data-label); color: var(--muted); font-weight: 600;
        font-size: 13px;
    }
    .admin-table td.row-actions, .admin-table td.check-col { display: block; }
    .admin-table td.row-actions::before { display: block; margin-bottom: 8px; }
    .admin-table td.check-col { width: auto; }
    .admin-table td.check-col::before { content: none; }
    .dashboard-books-table tbody { gap: 8px; }
    .dashboard-books-table tr { position: relative; }
    .dashboard-books-table td { padding: 8px 12px; min-height: 0; }
    .dashboard-books-table td.check-col {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 2;
        padding: 0;
        border: 0;
        background: transparent;
    }
    .dashboard-books-table .dashboard-book-td {
        display: block;
        padding: 10px 46px 9px 10px;
        border-bottom: 1px solid var(--line);
    }
    .dashboard-books-table .dashboard-book-td::before { display: none; }
    .dashboard-books-table .dashboard-book-cell { gap: 10px; }
    .dashboard-books-table .dashboard-book-thumb {
        flex-basis: 46px;
        width: 46px;
        height: 64px;
        border-radius: 9px;
    }
    .dashboard-books-table .dashboard-book-title {
        display: -webkit-box;
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .dashboard-books-table .dashboard-book-author { font-size: 13px; }
    .dashboard-books-table .dashboard-book-mobile-meta {
        display: block;
        color: var(--muted);
        font-size: 12.5px;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dashboard-books-table .dashboard-genre-td { display: none; }
    .dashboard-books-table td[data-label="Наличие"] { display: block; }
    .dashboard-books-table td[data-label="Наличие"]::before,
    .dashboard-books-table td.row-actions::before {
        flex: 0 0 100%;
        margin-bottom: 6px;
    }
    .dashboard-books-table .status { margin: 2px 3px 2px 0; }
    .dashboard-books-table td.row-actions { display: flex; }
    .dashboard-books-table .row-actions a,
    .dashboard-books-table .row-actions button,
    .dashboard-books-table .inline-details {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }
    .dashboard-books-table .inline-details > summary {
        width: 100%;
        justify-content: center;
        min-height: 36px;
    }
    .row-actions { gap: 8px; }
    .row-actions a, .row-actions button { min-height: 40px; padding: 8px 12px; }
    .db-table { table-layout: auto; }
    .db-table td.db-actions, .db-table th.col-actions { position: static; box-shadow: none; }
    .db-edit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .container { width: min(100% - 20px, 1180px); }
    h1 { font-size: clamp(25px, 8vw, 34px); }
    h2 { font-size: 18px; }
    .catalog-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .book-card h2 { font-size: 15px; }
    .price { font-size: 16px; padding: 2px 9px; }
    .card-bottom { align-items: flex-start; flex-direction: column; gap: 6px; }
    .catalog-grid.as-list .cover { flex-basis: 80px; }
    .panel, .empty { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card strong { font-size: 25px; }
    .admin-table td { grid-template-columns: 1fr; gap: 4px; }
    .report-compact-table td { grid-template-columns: 82px minmax(0, 1fr); }
    .admin-table td::before { margin-bottom: 2px; }
    .row-actions a, .row-actions button { flex: 1 1 calc(50% - 8px); justify-content: center; }
    .site-footer { font-size: 14px; }
    .tags-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
    .brand { font-size: 17px; }
    .catalog-grid { grid-template-columns: 1fr; }
    .row-actions a, .row-actions button { flex-basis: 100%; }
}

/* ============================================================
   Печать
   ============================================================ */
@media print {
    .site-header, .filters, .admin-head, .no-print, .bulk-bar, .top-nav, .btn,
    form.filters, .flash, .nav-logout, .to-top, .bottom-nav, .genre-chips, .results-bar { display: none !important; }
    body { background: #fff; color: #000; }
    .container { width: 100%; max-width: none; }
    .main { padding: 0; }
    .tags-grid { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
    .price-tag { border: 1px dashed #777; box-shadow: none; background: #fff; }
    .qr-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .qr-label { border: 1px solid #222; border-radius: 0; page-break-inside: avoid; background: #fff; }
    .qr-label img { width: 120px; height: 120px; }
}

.inventory-sheet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.inventory-sign { min-width: 260px; text-align: right; }
.inventory-check { display: inline-block; width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 3px; }
.inventory-note-line { display: block; min-width: 110px; height: 22px; border-bottom: 1px solid var(--line-strong); }
.inventory-print-table th:first-child, .inventory-print-table td:first-child { width: 34px; text-align: center; }

@media print {
    .inventory-sheet { padding: 0; border: 0; box-shadow: none; }
    .inventory-sheet-head { color: #000; margin-bottom: 8mm; }
    .inventory-print-wrap { overflow: visible; }
    .inventory-print-table { display: table; font-size: 10.5px; color: #000; }
    .inventory-print-table thead { display: table-header-group; }
    .inventory-print-table tbody { display: table-row-group; }
    .inventory-print-table tr { display: table-row; break-inside: avoid; page-break-inside: avoid; }
    .inventory-print-table th, .inventory-print-table td { display: table-cell; padding: 5px; border: 1px solid #777; vertical-align: top; }
    .inventory-print-table td::before { display: none; }
    .inventory-check { border-color: #000; }
    .inventory-note-line { border-color: #777; }
}

/* Утилитарные отступы (CSP запрещает инлайн-стили) */
.mt-18 { margin-top: 18px; }
.my-16 { margin: 16px 0; }
.w-130 { max-width: 130px; }
.notify-matrix { min-width: 0 !important; }

/* ===== Лист QR-наклеек под вырезание ===== */
.cut-sheet { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--card); }
.cut-cell {
    border: 1.5px dashed var(--line-strong);
    padding: 10px 8px; text-align: center; vertical-align: top;
    break-inside: avoid; page-break-inside: avoid;
}
.cut-qr { display: block; margin: 0 auto 6px; background: #fff; border-radius: 4px; }
.cut-s .cut-qr { width: 96px; height: 96px; }
.cut-m .cut-qr { width: 120px; height: 120px; }
.cut-l .cut-qr { width: 150px; height: 150px; }
.cut-title { display: block; font-size: 12.5px; line-height: 1.25; font-weight: 700; }
.cut-author { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cut-meta { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
@media (max-width: 760px) {
    .cut-sheet, .cut-sheet tbody, .cut-sheet tr { display: block; }
    .cut-sheet td { display: inline-block; width: calc(50% - 4px); }
}
@media print {
    .cut-sheet { background: #fff; }
    .cut-cell { border-color: #555; }
    .cut-title, .cut-author, .cut-meta { color: #000; }
    .cut-author, .cut-meta { color: #444; }
}

/* ===== Каталог-список без обложек ===== */
.catalog-list { display: grid; gap: 8px; }
.list-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px;
    padding: 13px 16px; background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.list-row:hover { transform: translateX(3px); box-shadow: var(--shadow-soft); border-color: var(--line-strong); color: inherit; }
.list-main { display: grid; gap: 2px; min-width: 0; }
.list-main strong { font-family: var(--font-display); font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 0 0 auto; flex-wrap: wrap; }
.list-meta .price { font-size: 16px; padding: 2px 10px; }
.view-toggle a {
    display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px;
    color: var(--muted); font-weight: 700; font-size: 14px;
}
.view-toggle a.active { background: var(--brand); color: var(--on-brand); }
.view-toggle a:hover:not(.active) { background: var(--tint-brand); color: var(--brand-deep); }
@media (max-width: 600px) {
    .list-row { grid-template-columns: 1fr; align-items: stretch; gap: 8px; }
    .list-meta { justify-content: flex-start; }
}

/* ===== Сканер QR ===== */
.scanner-preview { max-width: 100%; }
#qrVideo { width: 100%; max-width: 520px; max-height: 360px; border-radius: var(--radius); background: #0d1c16; display: block; object-fit: cover; }
#qrCanvas { display: none; }
#uploadQrLabel { cursor: pointer; position: relative; }
#uploadQrFile { position: absolute; left: -9999px; width: 1px; height: 1px; }

/* ===== Виджет обложки ===== */
.form-fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0; }
.form-fieldset legend { font-weight: 700; padding: 0 6px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.cover-upload-widget { display: grid; gap: 10px; }
.cover-upload-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.cover-preview-wrap { position: relative; display: inline-block; }
.cover-preview-wrap img { width: 200px; aspect-ratio: 1 / 1; height: auto; border-radius: 12px; border: 1px solid var(--line); display: block; object-fit: cover; }
.cover-clear-btn {
    position: absolute; top: -8px; right: -8px;
    width: 26px; height: 26px; border-radius: 999px;
    background: var(--danger); color: var(--on-danger); border: 2px solid var(--card);
    font-size: 13px; cursor: pointer; display: grid; place-items: center;
    line-height: 1;
}
.camera-box { display: grid; gap: 8px; }
.cover-camera-stage {
    position: relative;
    width: min(100%, 520px);
    border-radius: 12px;
    overflow: hidden;
    background: #0d1c16;
}
.camera-box video { width: 100%; height: min(74vh, 420px); border-radius: 12px; background: #0d1c16; max-height: 420px; object-fit: cover; display: block; }
.cover-camera-guide {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(80%, 340px);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, .95);
    border-radius: 10px;
    box-shadow: 0 0 0 999px rgba(0,0,0,.34), 0 0 0 1px rgba(0,0,0,.7) inset;
    pointer-events: none;
}
.cover-camera-guide::before,
.cover-camera-guide::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(255,255,255,.55);
    border-radius: 7px;
}
.cover-camera-guide::after {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 34%;
    height: 1px;
    border: 0;
    border-top: 1px dashed rgba(255,255,255,.5);
    transform: translateX(-50%);
}
.cover-camera-guide span {
    position: absolute;
    left: 50%;
    bottom: -34px;
    transform: translateX(-50%);
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(0,0,0,.58);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
}
.cover-crop-box {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card-2);
}
.cover-crop-box canvas {
    width: 100%;
    max-width: 760px;
    max-height: 72vh;
    border-radius: 12px;
    background: #0d1c16;
    border: 1px solid var(--line-strong);
    display: block;
    touch-action: none;
    cursor: ew-resize;
}
.cover-crop-box .row-actions { align-items: stretch; }
.cover-upload-widget .muted.small { font-size: 13px; }

/* Попап быстрой загрузки обложки из каталога */
.quick-cover-popup {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: drop-in .18s ease;
}
.quick-cover-inner {
    background: var(--card); border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow); max-width: 420px; width: 100%;
    display: grid; gap: 8px;
}
.quick-cover-inner strong { font-size: 16px; }
.dictionary-thumb {
    width: 46px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--card-2);
    object-fit: cover;
    display: block;
}
.dictionary-jump-panel {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}
.dictionary-jump-panel label {
    display: grid;
    gap: 6px;
}
.dictionary-section {
    padding: 0;
    overflow: hidden;
}
.dictionary-section + .dictionary-section { margin-top: 14px; }
.dictionary-section > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    font-size: 20px;
    font-family: var(--font-display);
    font-weight: 700;
}
.dictionary-section > summary::-webkit-details-marker { display: none; }
.dictionary-section > summary::after {
    content: '▾';
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--muted);
    transition: transform .16s ease;
}
.dictionary-section[open] > summary::after { transform: rotate(180deg); }
.dictionary-section > summary small {
    margin-left: auto;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
}
.dictionary-section-body {
    display: grid;
    gap: 16px;
    padding: 0 20px 20px;
}
.dictionary-subpanel {
    display: grid;
    gap: 10px;
}
.dictionary-subpanel h2 { margin-top: 0; }
.dictionary-cover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}
.dictionary-cover-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-2);
}
.dictionary-cover-card div {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.dictionary-cover-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 760px) {
    .dictionary-section > summary { padding: 15px 16px; font-size: 18px; }
    .dictionary-section-body { padding: 0 14px 16px; }
    .dictionary-cover-grid { grid-template-columns: 1fr; }
}

/* ===== Проверка и ремонт обложек ===== */
.small { font-size: 13px; }
.cover-audit-form { display: grid; gap: 14px; }
.cover-audit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.cover-audit-card {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.cover-audit-card.bad { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.cover-audit-card.warn { border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.cover-audit-check {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
    box-shadow: var(--shadow-soft);
}
.cover-audit-preview {
    overflow: hidden;
    width: 96px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card-2);
}
.cover-audit-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cover-audit-body {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 6px;
    padding-right: 84px;
}
.cover-audit-body h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}
.cover-audit-body p { margin: 0; }
.cover-repair-log { display: grid; gap: 6px; }
.cover-repair-line {
    margin: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--card-2);
    border: 1px solid var(--line);
}
.cover-repair-line.ok { background: var(--tint-brand); color: var(--brand-deep); border-color: transparent; }
.cover-repair-line.error { background: var(--tint-danger); color: var(--danger); border-color: transparent; }
.cover-repair-line.skip { color: var(--muted); }
@media (max-width: 900px) {
    .cover-audit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .cover-audit-card {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }
    .cover-audit-preview { width: 72px; border-radius: 10px; }
    .cover-audit-body { padding-right: 0; }
    .cover-audit-check {
        position: static;
        grid-column: 1 / -1;
        justify-self: start;
        order: 3;
    }
    .cover-audit-body h2 { font-size: 16px; }
}


/* ============================================================
   Финальная вычитка интерфейса: защита от «уплывания» блоков
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 78px; }
body { min-width: 320px; }
input, select, textarea, button { max-width: 100%; }
textarea { resize: vertical; }
pre { max-width: 100%; }
.card, .panel, .empty, .hero, .admin-head, .table-wrap, .flash, .notice { overflow-wrap: anywhere; }
.actions, .row-actions, .quick-actions, .form-actions, .bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions form, .row-actions form, .quick-actions form, .form-actions form { margin: 0; }
.row-actions a, .row-actions button, .quick-actions button, .quick-actions a { white-space: nowrap; }

.site-header { box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 65%, transparent); }
.header-inner { position: relative; }
.top-nav { isolation: isolate; }
.menu-btn, .nav-link, .theme-toggle, .burger-btn { touch-action: manipulation; }
.nav-drop { max-height: min(70vh, 560px); overflow: auto; overscroll-behavior: contain; }
.nav-drop form { margin: 0; }
.nav-drop button { color: inherit; font-family: inherit; }

/* Публичный каталог */
.catalog-grid { align-items: stretch; }
.book-card { min-width: 0; }
.book-card h2, .book-title, .tag-title { overflow-wrap: anywhere; hyphens: auto; }
.cover img, .detail-cover img, .cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.no-cover img, .detail-cover.no-cover img { object-fit: contain; padding: 10%; }

/* Админские формы */
.form-grid label, .grid-form label, .form-stack label, .db-edit-grid label { min-width: 0; }
.form-grid input, .form-grid select, .form-grid textarea,
.grid-form input, .grid-form select, .grid-form textarea,
.form-stack input, .form-stack select, .form-stack textarea,
.db-edit-grid input, .db-edit-grid select, .db-edit-grid textarea {
    width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: auto; }

/* Таблицы: десктоп — читаемо, телефон — карточки */
.table-wrap { max-width: 100%; }
.admin-table { max-width: 100%; }
.admin-table td, .admin-table th { overflow-wrap: anywhere; }
.admin-table td form { margin: 0; }
.admin-table input, .admin-table select, .admin-table textarea { width: 100%; min-width: 0; }
.admin-table .row-actions input { flex: 1 1 140px; }

/* Прямое управление БД: компактный безопасный режим */
.db-table-wrap { border-radius: var(--radius); }
.db-table { min-width: 760px; }
.db-table td, .db-table th { line-height: 1.35; }
.db-table td:not(.db-actions) { max-height: 96px; }
.db-actions a { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; padding: 7px 12px; border-radius: 999px; background: var(--tint-brand); color: var(--brand-deep); font-weight: 700; }
.db-raw-row pre { max-height: 420px; }

/* Печать: скрыть управление и не ломать лист */
@media print {
    body { background: #fff !important; color: #111 !important; }
    .site-header, .site-footer, .bottom-nav, .to-top, .no-print, .filters, .actions, .row-actions, .quick-actions, .form-actions { display: none !important; }
    .container { width: 100% !important; }
    .panel, .card, .table-wrap { box-shadow: none !important; border-color: #ddd !important; }
}

@media (max-width: 1180px) {
    .top-nav { gap: 1px; }
    .menu-btn { padding-inline: 9px; }
}

@media (max-width: 760px) {
    html { scroll-padding-top: 64px; }
    .site-header { position: sticky; }
    .brand span:last-child { display: inline; max-width: 42vw; }
    .theme-toggle { width: 38px; height: 38px; }
    .nav-burger { margin-left: 2px; }
    .nav-drop { top: calc(58px + env(safe-area-inset-top)); }
    .hero, .admin-head { margin-bottom: 16px; }
    .admin-head .actions, .hero .actions { display: grid; grid-template-columns: 1fr; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .book-card h2 { min-height: 0; }
    .table-wrap { overflow: visible; }
    .admin-table tr { margin: 0; }
    .admin-table td { word-break: break-word; }
    .admin-table input, .admin-table select, .admin-table textarea { min-width: 0; }
    .db-table-wrap { overflow: visible; }
    .db-table { min-width: 0; }
    .db-table td:not(.db-actions) { max-height: none; }
    .db-toolbar { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .container { width: min(100% - 16px, 1180px); }
    .brand span:last-child { max-width: 34vw; }
    .catalog-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .row-actions a, .row-actions button { flex-basis: 100%; }
}

.input-action { display: flex; gap: 8px; align-items: stretch; }
.input-action input { flex: 1 1 auto; min-width: 0; }
.input-action .btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 560px) { .input-action { flex-direction: column; } .input-action .btn { width: 100%; } }


.isbn-inline-scanner{grid-column:1/-1;margin-top:8px;border:1px solid var(--border);border-radius:18px;padding:12px;background:rgba(255,255,255,.04)}
.isbn-camera-frame{position:relative;overflow:hidden;border-radius:14px;background:#0b0f0d}
.isbn-inline-scanner video{display:block;width:100%;max-height:360px;object-fit:contain;background:#0b0f0d}
.isbn-scan-guide{position:absolute;left:8%;right:8%;top:36%;height:28%;border:2px solid rgba(255,255,255,.9);border-radius:12px;box-shadow:0 0 0 999px rgba(0,0,0,.2);pointer-events:none}
.isbn-inline-scanner .scanner-line{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:8px}
.isbn-inline-scanner canvas{display:none}
@media (max-width:720px){.input-action{display:grid;grid-template-columns:1fr auto auto;gap:8px}.isbn-inline-scanner video{max-height:300px}}
@media (max-width:560px){.input-action{grid-template-columns:1fr 1fr}.input-action input{grid-column:1/-1}.input-action .btn{width:100%}}

/* ISBN lookup status: appears only during search/result, then disappears without keeping layout space. */

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 24px; align-items: start; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.cart-head h1 { margin-bottom: 5px; }
.cart-head .muted { margin: 0; }
.cart-items h2, .checkout-form h2 { margin-top: 0; }
.cart-item {
    display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center;
}
.cart-item:last-of-type { border-bottom: 0; }
.cart-cover { display: block; width: 74px; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--card-2); }
.cart-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-info { display: grid; gap: 3px; min-width: 0; }
.cart-item-side { display: grid; justify-items: end; gap: 8px; }
.cart-total {
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-strong);
}
.checkout-form { display: grid; gap: 16px; padding: 22px; }
.checkout-heading { display: grid; gap: 4px; padding-bottom: 4px; }
.checkout-heading .eyebrow { margin: 0; }
.checkout-heading h2 { margin: 0; font-size: 25px; }
.checkout-heading > p:last-child, .checkout-section-title p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.checkout-section { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); }
.checkout-section h3 { margin: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.3; }
.checkout-section label, .checkout-form > label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.checkout-customer .form-grid { gap: 12px; }
.checkout-customer .payment-summary { grid-column: 1 / -1; }
.checkout-total { margin: 0; padding-top: 14px; }
.payment-summary {
    display: grid; gap: 4px; align-content: center;
    padding: 12px 13px; border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
    background: var(--tint-brand); color: var(--brand-deep);
}
.payment-summary span { font-size: 13px; line-height: 1.4; }
.delivery-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.delivery-option { display: flex !important; align-items: flex-start; gap: 9px !important; min-height: 76px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); cursor: pointer; color: var(--ink); }
.delivery-option:has(input:checked) { border-color: var(--brand); background: var(--tint-brand); }
.delivery-option input { margin-top: 3px; }
.delivery-option span { display: grid; gap: 3px; }
.delivery-option small { color: var(--muted); font-weight: 500; line-height: 1.3; }
.checkout-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cdek-checkout-box, .manual-delivery-box {
    gap: 12px; background: color-mix(in srgb, var(--card) 80%, var(--tint-brand));
}
.manual-delivery-box[hidden], .cdek-checkout-box[hidden] { display: none; }
.cdek-results { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.cdek-point-filter { margin: 0; }
.cdek-point-filter input:disabled { opacity: .65; cursor: not-allowed; }
.cdek-point-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; }
.cdek-point-picker > label { min-width: 0; }
.cdek-point-picker select { width: 100%; }
.cdek-map-open { min-height: 46px; white-space: nowrap; justify-content: center; color: var(--brand-deep); }
.cdek-point-picker [data-cdek-map-status] { grid-column: 1 / -1; }
.cdek-calc, .cdek-points-status, .cdek-test-step {
    padding: 0; border-radius: 0; border: 0; background: transparent;
    color: var(--muted); font-size: 13px; line-height: 1.35;
}
.cdek-calc.is-working, .cdek-points-status.is-working,
.cdek-calc.is-ok, .cdek-points-status.is-ok,
.cdek-calc.is-error, .cdek-points-status.is-error,
.cdek-calc.is-warning, .cdek-points-status.is-warning {
    padding: 9px 11px; border-width: 1px; border-style: solid; border-radius: 9px;
}
.cdek-calc.is-working, .cdek-points-status.is-working, .cdek-results.is-working { color: var(--brand-deep); }
.cdek-calc.is-ok, .cdek-points-status.is-ok, .cdek-results.is-ok, .cdek-test-step.ok { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--tint-brand); color: var(--brand-deep); }
.cdek-calc.is-error, .cdek-points-status.is-error, .cdek-results.is-error, .cdek-test-step.bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--tint-danger); color: var(--danger); }
.cdek-calc.is-warning, .cdek-points-status.is-warning, .cdek-results.is-warning { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: var(--tint-gold); color: var(--gold); }
.checkout-final { gap: 14px; background: var(--card); border-color: var(--line-strong); }
.personal-consent { align-items: flex-start; color: var(--muted); font-size: 13px !important; font-weight: 500 !important; line-height: 1.35; }
.personal-consent input { margin-top: 1px; }
.personal-consent a { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 2px; }
.checkout-submit { width: 100%; justify-content: center; min-height: 50px; }
.cart-add-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.catalog-cart-form { margin-top: 6px; }
.catalog-cart-form .btn { width: 100%; justify-content: center; }
.catalog-cart-form.is-in-cart .btn, .cart-add-form.is-in-cart .btn {
    background: var(--tint-brand); border-color: var(--line-strong); color: var(--brand-deep);
    box-shadow: none;
}
.cart-in-cart-link { cursor: pointer; }
.catalog-cart-form.is-in-cart .cart-in-cart-link:hover, .cart-add-form.is-in-cart .cart-in-cart-link:hover {
    background: var(--brand); border-color: var(--brand); color: var(--on-brand); transform: translateY(-1px);
}
.cdek-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cdek-map-settings { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.cdek-map-settings h2 { margin-top: 0; }
.cdek-account-card { display: grid; gap: 14px; }
.cdek-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cdek-card-head h2 { margin: 0; }
.cdek-defaults-note {
    display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px;
    background: var(--tint-brand); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
    color: var(--brand-deep); font-size: 14px;
}
.cdek-form .checkline { align-items: center; }
.cdek-test-form {
    display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 10px; align-items: end; padding-top: 4px;
}
.cdek-test-form label { display: grid; gap: 5px; }
.cdek-test-meta { display: grid; gap: 4px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.cdek-test-results { display: grid; gap: 8px; }
.cdek-test-step { display: grid; gap: 2px; }
.order-items-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; }
.order-items-list li { padding-left: 2px; }
.order-items-list .muted { display: block; font-size: 12px; }

@media (max-width: 900px) {
    .cart-layout, .cdek-account-grid { grid-template-columns: 1fr; }
    .cdek-map-settings { grid-template-columns: 1fr; }
    .cdek-test-form { grid-template-columns: 1fr; align-items: stretch; }
}

@media (max-width: 560px) {
    .header-cart-button { width: 42px; height: 42px; }
    .header-cart-button svg { width: 21px; height: 21px; }
    .cart-item { grid-template-columns: 58px minmax(0, 1fr); align-items: start; }
    .cart-cover { width: 58px; }
    .cart-item-side { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
    .cart-item-side form { margin: 0; }
    .cdek-test-form { display: grid; grid-template-columns: 1fr; }
    .checkout-form { padding: 14px; gap: 12px; }
    .checkout-heading h2 { font-size: 22px; }
    .checkout-section { padding: 13px; gap: 10px; border-radius: 12px; }
    .checkout-customer .form-grid { grid-template-columns: 1fr; gap: 10px; }
    .delivery-options { grid-template-columns: 1fr; }
    .delivery-option { min-height: 0; }
    .input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .input-action .btn { width: auto; padding-inline: 13px; }
    .cdek-point-picker { grid-template-columns: 1fr; }
    .cdek-map-open { width: 100%; }
    .cart-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
    .cart-head .btn { width: 100%; }
    .cdek-card-head { flex-direction: column; }
    .cookie-consent { grid-template-columns: 1fr; left: 10px; right: 10px; bottom: 10px; }
    .cookie-consent .btn { width: 100%; }
}

@media (min-width: 561px) and (max-width: 720px) {
    .checkout-form .input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
}
#isbnLookupStatus[hidden] { display: none !important; }
#isbnLookupStatus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
#isbnLookupStatus.is-working::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: isbnSpin .75s linear infinite;
}
#isbnLookupStatus.is-ok { border-color: rgba(57, 197, 125, .5); color: #bdf7d7; }
#isbnLookupStatus.is-error { border-color: rgba(255, 115, 72, .55); color: #ffd2c4; }
@keyframes isbnSpin { to { transform: rotate(360deg); } }
.cdek-admin { min-width: 0; display: grid; gap: 18px; }
.cdek-admin .admin-head, .cdek-admin .notice, .cdek-admin .card { margin-bottom: 0; }
.cdek-admin .cdek-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.cdek-admin .cdek-account-card { align-content: start; padding: 20px; }
.cdek-admin .cdek-form { gap: 10px 14px; }
.cdek-admin .cdek-form .small { margin: 0; }
.cdek-admin .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cdek-admin .cdek-profile-picker, .cdek-admin .cdek-run-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 12px; }
.cdek-admin .cdek-run-form { grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.cdek-admin label { min-width: 0; }
.cdek-admin .cdek-profile-picker label, .cdek-admin .cdek-run-form label { display: grid; gap: 6px; }
.cdek-admin .cdek-diagnostics-grid { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.6fr); gap: 18px; align-items: start; }
.cdek-admin .cdek-diagnostics-grid > *, .cdek-admin .cdek-account-grid > * { min-width: 0; }
.cdek-admin .cdek-history-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; max-height: 540px; overflow: auto; }
.cdek-admin .cdek-history-list li { display: grid; gap: 3px; padding: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.cdek-admin .cdek-history-list [aria-current] { font-weight: 800; text-decoration: underline; }
.cdek-admin .cdek-clear-form { display: grid; gap: 8px; }
.cdek-admin .cdek-test-results { margin-top: 16px; }
.cdek-admin .cdek-test-step, .cdek-admin .cdek-request { overflow-wrap: anywhere; }
.cdek-admin .cdek-request { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.cdek-admin .cdek-request summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.cdek-admin .cdek-request dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.cdek-admin .cdek-request dd { margin: 0; }
.cdek-admin .cdek-request pre { max-height: 400px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; padding: 10px; background: var(--tint-brand); border-radius: 6px; }
.alphabet-nav {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 5px;
    margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: var(--radius-s); background: var(--card); font-size: 14px;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.alphabet-nav::-webkit-scrollbar { height: 4px; }
.alphabet-nav::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.alphabet-nav > span { flex: 0 0 auto; color: var(--muted); margin-right: 3px; white-space: nowrap; }
.alphabet-nav a { flex: 0 0 auto; min-width: 36px; min-height: 40px; display: inline-grid; place-items: center; padding: 2px 5px; border-radius: 7px; font-weight: 700; }
.alphabet-nav a:hover, .alphabet-nav a.active { color: var(--on-brand); background: var(--brand); }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.contact-card { display: grid; gap: 5px; min-height: 88px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card-2); }
.contact-card strong { color: var(--brand-deep); }
.contact-card span { overflow-wrap: anywhere; }
.request-admin-list { display: grid; gap: 14px; }
.request-admin-card { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: start; }
.request-admin-card.no-photo { grid-template-columns: minmax(0, 1fr); }
.request-admin-photo { display: block; width: 110px; height: 145px; border-radius: 10px; overflow: hidden; background: var(--tint-brand); }
.request-admin-photo img { width: 100%; height: 100%; object-fit: cover; }
.request-admin-main { min-width: 0; }
.request-admin-main h2 { margin: 0; overflow-wrap: anywhere; }
.request-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.request-admin-actions form { margin: 0; }
.request-admin-actions select { min-height: 38px; max-width: 180px; }
.status.order-in_progress { background: var(--tint-accent); color: var(--accent-deep); border-color: transparent; }
.status.order-found, .status.order-closed { background: var(--tint-brand); color: var(--brand-deep); border-color: transparent; }
.status.order-declined { background: var(--tint-danger); color: var(--danger); border-color: transparent; }
@media (max-width: 620px) {
    .alphabet-nav { gap: 4px; padding: 8px; }
    .alphabet-nav a { min-width: 28px; }
    .contact-grid { grid-template-columns: 1fr; }
    .request-admin-card { grid-template-columns: 74px minmax(0, 1fr); gap: 11px; padding: 13px; }
    .request-admin-photo { width: 74px; height: 98px; }
    .request-admin-actions, .request-admin-actions .actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .request-admin-actions select, .request-admin-actions button { width: 100%; max-width: none; }
}
@media (max-width: 760px) {
    .cdek-admin .cdek-diagnostics-grid, .cdek-admin .cdek-run-form, .cdek-admin .cdek-profile-picker { grid-template-columns: minmax(0, 1fr); }
    .cdek-admin .cdek-run-result { grid-row: 1; }
    .cdek-admin .cdek-history-list { max-height: 260px; }
    .cdek-admin .cdek-account-card { padding: 16px; }
    .cdek-admin .cdek-nav .btn, .cdek-admin .form-actions .btn { flex: 1 1 160px; justify-content: center; }
    .cdek-admin .cdek-request dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .cdek-admin .cdek-request dd { margin-bottom: 8px; }
}

/* ===== Система «Читальный зал»: строки действий, вкладки, попапы ===== */
.ui-icon { display: block; flex: 0 0 auto; }

/* Дашборд: одна колонка действий — главное на виду, остальное в «Ещё» */
.dashboard-genre-td { min-width: 120px; overflow-wrap: normal; word-break: normal; hyphens: manual; }
a.dashboard-book-title:hover { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; }
.dashboard-books-table td.book-actions { width: 290px; }
.book-actions { flex-wrap: wrap; align-items: flex-start; }
.book-actions .no-stock { display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; }
.row-more { position: relative; }
.row-more > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
    padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2);
    font-size: 12.5px; font-weight: 700; user-select: none;
    transition: background var(--t-fast) ease, border-color var(--t-fast) ease;
}
.row-more > summary::-webkit-details-marker { display: none; }
.row-more > summary::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); opacity: .6; transition: transform var(--t) var(--ease-out); }
.row-more[open] > summary { background: var(--tint-brand); border-color: var(--brand); color: var(--brand-deep); }
.row-more[open] > summary::after { transform: translateY(3px) rotate(225deg); }
.row-more-list {
    display: grid; gap: 2px; margin-top: 6px; padding: 6px; min-width: 210px;
    background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-soft);
    animation: drop-in var(--t) var(--ease-out);
}
.row-actions .row-more-list a, .row-actions .row-more-list button, .row-more-list .inline-details > summary {
    display: flex; width: 100%; justify-content: flex-start; min-height: 36px; padding: 7px 10px;
    border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; font-weight: 600; text-align: left;
}
.row-actions .row-more-list a:hover, .row-actions .row-more-list button:hover { background: var(--tint-brand); color: var(--brand-deep); }
.row-more-list .danger-text { color: var(--danger); }
.row-more-list .inline-details { display: block; }
.row-more-list .inline-details.danger-zone { background: none; border: 0; }
.row-more-list .inline-details > summary { color: var(--danger); }
.row-more-list .mini-form { position: static; margin: 4px; min-width: 0; box-shadow: none; }

/* Вкладки разделов (СДЭК): сегментированный переключатель */
.cdek-admin .cdek-nav { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-2); justify-self: start; width: max-content; max-width: 100%; }
.cdek-admin .cdek-nav .btn { min-height: 38px; border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; transform: none; }
.cdek-admin .cdek-nav .btn:hover { color: var(--ink); }
.cdek-admin .cdek-nav .btn[aria-current="page"] { background: var(--card); color: var(--brand-deep); border-color: var(--line); box-shadow: 0 1px 2px rgba(46, 38, 24, .08); }

/* Попап быстрой обложки (классы вместо inline-стилей: их блокирует CSP) */
.qc-preview { max-width: 160px; border-radius: 8px; margin: 8px 0; }
.qc-row { flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qc-cam { margin-top: 8px; }
.qc-video { width: 100%; max-height: 200px; border-radius: 8px; background: #0d1c16; }
.qc-status { margin: 6px 0 0; }
.qc-actions { margin-top: 10px; }

/* Ссылки подвала и сканер с иконкой */
.site-footer a { display: inline-block; padding: 10px 2px; text-underline-offset: 3px; }
.site-footer a:hover { text-decoration: underline; }
#startScanner .ui-icon { width: 18px; height: 18px; }
.genre-pill { transition: background var(--t-fast) ease; }
a.genre-pill:hover { background: color-mix(in srgb, var(--tint-brand) 70%, var(--brand) 30%); color: var(--brand-ink); }

@media (max-width: 760px) {
    .dashboard-books-table td.book-actions { width: auto; display: flex; gap: 8px; }
    .dashboard-books-table .book-actions > .quick-sell,
    .dashboard-books-table .book-actions > a,
    .dashboard-books-table .book-actions > .no-stock { flex: 1 1 0; justify-content: center; min-height: 40px; }
    .dashboard-books-table .book-actions > .row-more { flex: 0 0 auto; }
    .dashboard-books-table .row-more > summary { min-height: 40px; }
    .dashboard-books-table .row-more[open] { flex: 1 1 100%; }
    .dashboard-books-table .row-more-list .inline-details { flex: none; }
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-card strong { font-size: 21px; }
    .stat-card span { font-size: 12px; }
    .admin-head { padding-bottom: 14px; }
    .cdek-admin .cdek-nav { width: 100%; }
    .cdek-admin .cdek-nav .btn { flex: 1 1 0; }
}

/* Шапка экрана: заголовок слева, действия одной строкой справа */
@media (min-width: 901px) {
    .admin-head > div:first-child { flex: 1 1 auto; min-width: 0; }
    .admin-head > .actions { flex: 0 0 auto; flex-wrap: nowrap; }
}
.copy-main strong:first-child, .copy-main .copy-price { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }

/* Каталог на телефоне: книги видны уже на первом экране */
@media (max-width: 560px) {
    .filters:not(.compact) { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
    .filters:not(.compact) input[type="search"] { grid-column: 1 / -1; }
    .filters:not(.compact) select, .filters:not(.compact) .btn { min-height: 44px; }
    .catalog-hero { padding: 14px 16px; }
    .catalog-hero h1 { font-size: 26px; margin-bottom: 6px; }
    .catalog-hero p { font-size: 14.5px; line-height: 1.5; margin-bottom: 10px; }
}

/* Выбор тарифа СДЭК в корзине */
.cdek-tariffs { margin: 10px 0 0; padding: 0; border: 0; min-width: 0; }
.cdek-tariffs legend { font-weight: 600; margin-bottom: 6px; }
.cdek-tariffs [data-cdek-tariff-list] { display: grid; gap: 6px; }
.cdek-tariff { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); cursor: pointer; transition: border-color var(--t-fast) ease, background var(--t-fast) ease; }
.cdek-tariff:hover { border-color: var(--line-strong); }
.cdek-tariff:has(input:checked) { border-color: var(--brand); background: var(--tint-brand); }
.cdek-tariff span { font-weight: 500; overflow-wrap: anywhere; }
.cdek-tariff strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Состояние заказа в СДЭК */
.cdek-order-state { display: grid; gap: 2px; margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line); font-size: 13.5px; }
.cdek-order-state.is-registered { background: var(--tint-brand); border-color: transparent; }
.cdek-order-state.is-error { background: var(--tint-danger); border-color: transparent; }
.cdek-order-state.is-accepted, .cdek-order-state.is-creating { background: var(--tint-gold); border-color: transparent; }
.cdek-order-error { color: var(--danger); overflow-wrap: anywhere; }
.mono-num { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cdek-order-panel .row-more-list { min-width: 260px; }
.cdek-order-panel .mini-form label { display: grid; gap: 4px; font-size: 13px; }
.cdek-order-log { list-style: none; margin: 6px 0 0; padding: 6px 4px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 12px; color: var(--muted); max-height: 220px; overflow: auto; }
.cdek-order-log li { overflow-wrap: anywhere; }
.cdek-order-log li.bad { color: var(--danger); }
.cdek-order-log time { font-variant-numeric: tabular-nums; color: var(--ink); }

/* Таблицы: перенос длинных строк без схлопывания колонок (anywhere сжимает min-content до символа) */
@media (min-width: 761px) {
    .admin-table td { overflow-wrap: break-word; }
    .admin-table td.row-actions { min-width: 260px; }
    .admin-table td[data-label="Заказ"], .admin-table td[data-label="Статус"] { white-space: nowrap; }
}
@media (min-width: 761px) {
    /* td остаётся ячейкой таблицы (иначе рвётся граница строки); кнопки раскладываются сами */
    .admin-table td.row-actions { display: table-cell; }
    .admin-table td.row-actions > * { display: inline-flex; vertical-align: top; margin: 0 6px 6px 0; }
    .admin-table td.row-actions > details { display: inline-block; }
    .admin-table td.row-actions > details[open] { display: block; }
}
@media (min-width: 761px) {
    .dashboard-books-table td.book-actions { white-space: nowrap; width: 300px; }
    .dashboard-books-table td.book-actions .row-more-list { white-space: normal; }
}

/* ============================================================
   789 ROOM — компоненты винилового магазина
   ============================================================ */
.brand { gap: 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; background: transparent; display: grid; place-items: center; padding: 0; }
.brand-mark svg { width: 36px; height: 36px; }
.brand-mark circle { fill: #141210; stroke: none; }
.brand-mark .groove { fill: none; stroke: #2e2a24; stroke-width: 1.2; }
.brand-mark .label { fill: var(--brand); }
.brand-mark .hole { fill: var(--paper); }
.brand-text { font-weight: 500; letter-spacing: .14em; font-size: 15px; }
.brand-text b { font-weight: 800; letter-spacing: -.02em; font-size: 20px; margin-right: 6px; }
.nav-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-link .fav-count { margin-left: 2px; background: var(--brand); color: var(--on-brand); border-radius: 999px; font-size: 11px; padding: 1px 6px; font-weight: 700; }
.h-sub { margin-top: 28px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }

/* --- Главная --- */
.hero-789 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; padding: 36px 0 24px; min-height: 420px; }
.hero-copy h1 { font-size: clamp(38px, 6vw, 76px); max-width: 12ch; }
.hero-copy h1 em { font-style: normal; color: var(--brand); }
.hero-copy .lead { font-size: 18px; max-width: 52ch; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn.big { padding: 14px 22px; font-size: 17px; }
.hero-player { display: grid; gap: 16px; justify-items: center; }
.hero-now { display: grid; text-align: center; gap: 2px; }
.hero-now strong { font-size: 18px; }

/* Вертушка: общая для hero (mini) и проигрывателя */
.turntable-mini, .turntable { position: relative; }
.turntable-mini { width: min(360px, 90%); aspect-ratio: 1; }
.turntable-mini .platter, .turntable .platter {
    position: absolute; inset: 0; border-radius: 50%;
    background: radial-gradient(circle, #2a2520 0 8%, #1a1714 8% 100%);
    box-shadow: inset 0 0 0 1px #3a342c, 0 24px 60px rgba(0,0,0,.6);
}
.record {
    position: absolute; inset: 6%; border-radius: 50%;
    background:
        radial-gradient(circle, transparent 0 17%, var(--art-ring, #0b0a09) 17% 18.5%, transparent 18.5%),
        repeating-radial-gradient(circle, #0e0d0c 0 1.5px, #171513 1.5px 3px),
        #0f0e0d;
    box-shadow: 0 0 0 1px #2a2622, inset 0 0 40px rgba(0,0,0,.6);
    animation: spin 1.8s linear infinite paused;
    will-change: transform;
}
.record::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 20%, rgba(255,255,255,.07) 24%, transparent 30%, transparent 55%, rgba(255,255,255,.06) 60%, transparent 66%); }
.record .label {
    position: absolute; inset: 32%; border-radius: 50%; background: var(--brand) center/cover no-repeat; overflow: hidden;
    box-shadow: 0 0 0 2px #0b0a09;
}
.record .label img { width: 100%; height: 100%; object-fit: cover; display: block; }
.record .label::after { content: ""; position: absolute; inset: calc(50% - 5px); border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.record.spin { animation-play-state: running; }
.turntable-mini .record { animation-play-state: running; animation-duration: 4s; }
@keyframes spin { to { transform: rotate(360deg); } }
.tonearm {
    position: absolute; right: 2%; top: -4%; width: 10px; height: 64%;
    transform-origin: 50% 5%; transform: rotate(-30deg); transition: transform 700ms var(--ease-out);
}
.tonearm::before, .tonearm .arm { content: ""; position: absolute; left: 2px; top: 0; width: 6px; height: 100%; background: linear-gradient(90deg, #d9cfbf, #8b8171); border-radius: 3px; }
.tonearm::after { content: ""; position: absolute; left: -9px; top: -6px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle, #3b352d 0 40%, #221e19 42%); box-shadow: 0 2px 6px rgba(0,0,0,.6); }
.tonearm .head { position: absolute; left: -5px; bottom: 0; width: 20px; height: 26px; background: #d9cfbf; border-radius: 3px; transform: rotate(18deg); }
.turntable-mini .tonearm { transform: rotate(-8deg); }
.turntable-mini .tonearm .head { content: ""; }
.tonearm.on { transform: rotate(calc(-10deg - var(--progress, 0) * 12deg)); }
.plinth { position: relative; width: 100%; aspect-ratio: 1; }
.plinth .switch { position: absolute; left: 4%; bottom: 4%; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); opacity: .35; }
.is-playing .plinth .switch { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .record, .turntable-mini .record { animation: none !important; } .tonearm { transition: none; } }

.shelf { margin: 36px 0; }
.shelf-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.shelf-head h2 { font-size: 26px; margin: 0 0 2px; }
.shelf-head p { margin: 0; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 12px; scrollbar-width: thin; }
.shelf-row > * { scroll-snap-align: start; }
.genres-band { margin: 36px 0; }
.genre-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.genre-tile { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); font-weight: 600; transition: border-color var(--t), transform var(--t) var(--ease-out), background var(--t); }
.genre-tile:hover { border-color: var(--brand); transform: translateY(-2px); background: var(--card-2); color: var(--ink); }
.genre-tile small { color: var(--muted); }
.promo-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 40px 0 24px; }
.promo-strip div { padding: 18px; border-top: 2px solid var(--brand); background: var(--card); border-radius: 0 0 var(--radius-s) var(--radius-s); display: grid; gap: 6px; }
.promo-strip span { color: var(--muted); font-size: 14px; }

/* --- Карточка в сетке --- */
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.vinyl-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.vinyl-card .sleeve { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--card-2); box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 10px 30px rgba(0,0,0,.35); isolation: isolate; }
.vinyl-card .sleeve img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 2; transition: transform 420ms var(--ease-out); }
.vinyl-card .sleeve .disc { position: absolute; top: 4%; right: 4%; width: 92%; height: 92%; border-radius: 50%; z-index: 1;
    background: radial-gradient(circle, var(--brand) 0 14%, #0b0a09 14% 17%, transparent 17%), repeating-radial-gradient(circle, #0e0d0c 0 1.5px, #1a1816 1.5px 3px); transition: transform 520ms var(--spring); }
@media (hover: hover) {
    .vinyl-card:hover .sleeve img { transform: translateX(-14%); }
    .vinyl-card:hover .sleeve .disc { transform: translateX(16%) rotate(30deg); }
}
.play-badge { position: absolute; z-index: 3; left: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.4); opacity: .95; transition: transform var(--t) var(--ease-out); }
.play-badge svg, .track-play svg, .listen-btn svg { width: 20px; height: 20px; fill: currentColor; }
.play-badge:hover { transform: scale(1.06); }
.play-badge.is-playing svg path { d: path("M7 5h4v14H7zM13 5h4v14h-4z"); }
.card-tags { position: absolute; z-index: 3; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-tags.static { position: static; margin: 6px 0 12px; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); }
.tag-rare, .tag-collectible { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.tag-special { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.fav-btn { position: absolute; z-index: 3; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(15,14,12,.65); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); }
.fav-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform var(--t) var(--spring); }
.fav-btn.is-on svg { fill: var(--accent); stroke: var(--accent); transform: scale(1.15); }
.fav-btn-text.is-on { background: var(--tint-accent); color: var(--accent); border-color: var(--accent); }
.vinyl-card-body { padding: 12px 2px 4px; display: grid; gap: 3px; }
.vinyl-card-body .artist { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.vinyl-card-body h3 { margin: 0; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.vinyl-card-body .meta { margin: 0; font-size: 13px; color: var(--muted); }
.vinyl-card .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.vinyl-card .price { font-size: 17px; }
.vinyl-card .catalog-cart-form { margin: 0; }

/* --- Каталог --- */
.catalog-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 24px 0 14px; flex-wrap: wrap; }
.catalog-head h1 { margin-bottom: 4px; }
.catalog-head p { margin: 0; }
.catalog-search { display: flex; gap: 8px; flex: 1 1 360px; max-width: 560px; }
.catalog-search input { flex: 1; min-width: 0; height: var(--tap); border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); padding: 0 14px; }
.section-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.section-chips .chip { white-space: nowrap; }
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.catalog-filters { position: sticky; top: 76px; display: grid; gap: 6px; }
.catalog-filters details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.catalog-filters summary { cursor: pointer; font-weight: 700; padding: 8px 0; list-style: none; display: flex; justify-content: space-between; }
.catalog-filters summary::after { content: "+"; color: var(--muted); }
.catalog-filters details[open] summary::after { content: "–"; }
.filter-list { display: grid; gap: 2px; padding-bottom: 8px; max-height: 280px; overflow: auto; }
.filter-list a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 6px; font-size: 14px; }
.filter-list a:hover, .filter-list a.active { background: var(--card-2); color: var(--brand); }
.filter-list small { color: var(--muted); }
.range-form { display: grid; gap: 8px; padding-bottom: 8px; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.range-row input { min-width: 0; height: 40px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); padding: 0 10px; }
.reset-filters { margin-top: 8px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-form select { height: 40px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); padding: 0 10px; }

/* --- Карточка пластинки --- */
.record-page { display: grid; grid-template-columns: minmax(300px, 520px) 1fr; gap: 40px; padding: 24px 0; align-items: start; }
.record-visual { position: sticky; top: 76px; display: grid; gap: 14px; }
.record-cover { position: relative; aspect-ratio: 1; border-radius: 6px; isolation: isolate; }
.record-cover img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 30px 60px rgba(0,0,0,.5); display: block; }
.record-cover .disc { position: absolute; top: 3%; right: -7%; width: 94%; height: 94%; border-radius: 50%; z-index: 1; animation: spin 12s linear infinite;
    background: radial-gradient(circle, var(--brand) 0 14%, #0b0a09 14% 17%, transparent 17%), repeating-radial-gradient(circle, #0e0d0c 0 1.5px, #1a1816 1.5px 3px); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.gallery-thumbs .thumb { width: 64px; height: 64px; flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--card); cursor: pointer; }
.gallery-thumbs .thumb.active { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listen-btn { display: inline-flex; align-items: center; gap: 10px; justify-content: center; }
.listen-btn small { opacity: .7; font-weight: 500; }
.record-info { position: relative; z-index: 2; }
.record-info h1 { font-size: clamp(30px, 4vw, 48px); }
.record-info .eyebrow a { color: var(--brand); }
.record-sub { color: var(--muted); margin: 0 0 10px; font-size: 16px; }
.record-info h2 { margin-top: 26px; font-size: 20px; }
.copy-card .grades { display: flex; gap: 10px; flex-wrap: wrap; }
.grade { font-size: 13px; color: var(--muted); }
.grade b { color: var(--ink); background: var(--card-2); border: 1px solid var(--line-strong); padding: 2px 7px; border-radius: 4px; margin-left: 4px; }
.copy-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.copy-photos img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.copy-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: start; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 20px; margin: 0; }
.specs div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; overflow-wrap: anywhere; }
.record-desc { margin-top: 14px; line-height: 1.65; color: color-mix(in srgb, var(--ink) 85%, var(--muted)); }
.alert-form { display: grid; gap: 8px; max-width: 420px; margin-bottom: 12px; }
.alert-form input[type="email"] { width: 100%; height: 42px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); padding: 0 12px; }

.tracklist-section { margin: 40px 0; padding-top: 24px; border-top: 1px solid var(--line); }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.side h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 6px; border-bottom: 1px solid var(--line); }
.track.is-current { background: var(--tint-brand); }
.track-pos { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.track-play { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.track-play:hover, .track-play.is-playing { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.track-play.is-playing svg path { d: path("M7 5h4v14H7zM13 5h4v14h-4z"); }
.track-dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.editions { margin: 30px 0; }
.editions-list { display: grid; gap: 8px; }
.edition-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); }
.edition-row:hover { border-color: var(--brand); color: var(--ink); }
.edition-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.edition-row span { display: grid; gap: 2px; min-width: 0; }
.edition-row small { color: var(--muted); }
.edition-row em { font-style: normal; font-weight: 700; white-space: nowrap; }
.order-card { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }

/* --- Проигрыватель --- */
body.player-open { overflow: hidden; }
.player-root { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.player-root[hidden] { display: none; }
.player-backdrop { position: absolute; inset: 0; background: rgba(8,7,6,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.player-modal { position: relative; width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow); display: grid; grid-template-rows: auto 1fr auto; animation: player-in 360ms var(--ease-out); outline: none; }
@keyframes player-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.player-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.player-album { display: flex; gap: 12px; align-items: center; min-width: 0; }
.player-album div { display: grid; min-width: 0; }
.player-album strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-art { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--card-2); }
.player-head-actions { display: flex; gap: 6px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; transition: background var(--t), border-color var(--t), transform var(--t) var(--ease-out); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--card-2); border-color: var(--brand); }
.icon-btn[aria-pressed="true"] { color: var(--brand); border-color: var(--brand); }
.icon-btn.big { width: 64px; height: 64px; background: var(--brand); color: var(--on-brand); border-color: transparent; }
.icon-btn.big svg { fill: currentColor; stroke: none; width: 26px; height: 26px; }
.icon-btn.big:hover { transform: scale(1.05); background: var(--brand-deep); }
.ico-pause { display: none; }
.is-playing .ico-pause { display: block; }
.is-playing .ico-play { display: none; }
.player-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 22px; }
.turntable { width: min(100%, 380px); margin: 0 auto; }
.turntable .plinth { background: linear-gradient(160deg, #2a241d, #171310); border-radius: 18px; padding: 8%; box-shadow: 0 30px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06); }
.turntable .platter { position: relative; inset: auto; width: 100%; aspect-ratio: 1; }
.turntable .record { animation-duration: 1.8s; }
.turntable .record .label { background: var(--brand) center/cover no-repeat; }
.turntable .tonearm { right: 2%; top: 0; }
.player-tracks { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.player-tracks .side-head { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.pt-btn { width: 100%; display: grid; grid-template-columns: 34px 1fr auto auto; gap: 8px; align-items: center; padding: 9px 12px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font-size: 14px; }
.pt-btn:hover { background: var(--card-2); }
.pt-btn:disabled { opacity: .45; cursor: default; }
.pt.is-current .pt-btn { background: var(--tint-brand); color: var(--brand-ink); }
.pt-pos, .pt-dur, .pt-src { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.player-controls { padding: 16px 22px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.now { display: grid; }
.seek { display: grid; grid-template-columns: 44px 1fr 44px; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.seek input, .volume input { width: 100%; accent-color: var(--brand); }
.buttons { display: flex; align-items: center; justify-content: center; gap: 12px; }
.volume { display: flex; align-items: center; gap: 8px; margin-left: 12px; width: 140px; }
.volume svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; }
.player-note { margin: 0; min-height: 1em; }
/* компактный режим */
.player-root.is-mini { inset: auto 16px 16px auto; padding: 0; place-items: end; pointer-events: none; }
.player-root.is-mini .player-backdrop { display: none; }
.player-root.is-mini .player-modal { pointer-events: auto; width: min(380px, calc(100vw - 32px)); max-height: none; border-radius: 14px; animation: none; }
.player-root.is-mini .player-body, .player-root.is-mini .seek, .player-root.is-mini .volume, .player-root.is-mini [data-shuffle], .player-root.is-mini [data-repeat], .player-root.is-mini .player-note { display: none; }
.player-root.is-mini .player-head { cursor: pointer; }
.player-root.is-mini .player-controls { padding: 10px 14px 12px; }
.player-root.is-mini .icon-btn.big { width: 48px; height: 48px; }
.player-root.is-mini [data-player-mini] svg path { d: path("M5 15l7-7 7 7"); }

/* --- Приёмка --- */
.receiving-stats { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.receiving-stats b { color: var(--ink); font-size: 18px; margin-right: 4px; }
.scan-bar { padding: 16px; border: 1px solid var(--brand); border-radius: var(--radius); background: var(--tint-brand); margin-bottom: 18px; display: grid; gap: 10px; }
.scan-bar #isbnInput { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.manual-search summary { cursor: pointer; color: var(--brand); font-size: 14px; }
.manual-search .form-grid { margin-top: 10px; align-items: end; }
.lookup-results { display: grid; gap: 8px; }
.lookup-results h3 { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.cand { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; }
.cand:hover { border-color: var(--brand); }
.cand.is-local { border-color: var(--gold); }
.cand img, .cand-noimg { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; background: var(--card-2); display: block; }
.cand span { display: grid; gap: 2px; min-width: 0; }
.cand small { color: var(--muted); }
.cand em { font-style: normal; font-size: 12px; color: var(--brand); }
.receiving-columns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.tag-checks { display: flex; gap: 14px; flex-wrap: wrap; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.image-item { margin: 0; }
.image-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.image-item figcaption { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.track-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.track-status li { display: flex; justify-content: space-between; gap: 8px; }
.src-row { display: grid; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.src-row audio { width: 100%; max-width: 320px; height: 32px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.receiving .form-actions .btn.big { flex: 1; }

/* --- Адаптив --- */
@media (max-width: 1040px) {
    .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hero-789 { grid-template-columns: 1fr; text-align: center; }
    .hero-copy h1 { margin-inline: auto; }
    .hero-copy .lead { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .record-page { grid-template-columns: 1fr; }
    .record-visual { position: static; max-width: 520px; }
    .receiving-columns { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-filters { position: static; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
    .catalog-filters .reset-filters { grid-column: 1 / -1; }
    .player-body { grid-template-columns: 1fr; }
    .turntable { width: min(100%, 300px); }
    .specs { grid-template-columns: 1fr; }
    .promo-strip { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .shelf-row { grid-auto-columns: minmax(160px, 1fr); }
    .hero-789 { padding-top: 16px; min-height: 0; }
    .turntable-mini { width: min(260px, 80%); }
    .vinyl-card-body h3 { font-size: 15px; }
    .specs div { grid-template-columns: 1fr; gap: 0; }
    .track { grid-template-columns: 36px 1fr auto; }
    .track-src { display: none; }
    .player-root { padding: 0; place-items: end; }
    .player-modal { width: 100%; max-height: 100vh; border-radius: 18px 18px 0 0; }
    .player-tracks { max-height: 200px; }
    .icon-btn { width: 48px; height: 48px; }
    .icon-btn.big { width: 72px; height: 72px; }
    .volume { display: none; }
    .player-root.is-mini { inset: auto 0 0 0; }
    .player-root.is-mini .player-modal { width: 100%; border-radius: 14px 14px 0 0; }
    .catalog-filters { grid-template-columns: 1fr; }
    .edition-row { grid-template-columns: 48px 1fr; }
    .edition-row em { grid-column: 2; }
}
#isbnLookupStatus[hidden] { display: none; }
@media (max-width: 1040px) { .record-cover .disc { right: 0; } .record-page { overflow-x: clip; } }
@media (max-width: 820px) { .catalog-filters { order: 2; margin-top: 24px; } }

/* Полировка: исполнитель на карточке вместо надзаголовка; вертушка в hero не гонит CPU, пока вкладка не видна. */
.record-artist { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.record-artist a, p.record-artist a:not(.btn) { color: var(--brand); text-decoration: none; }
.record-artist a:hover { text-decoration: underline; }
.catalog-head p.muted { margin: 6px 0 0; }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible { outline-offset: 3px; }
@media (hover: hover) { .nav-drop a, .nav-drop button { transition: background var(--t-fast) ease, transform var(--t-fast) var(--ease-out); } .nav-drop a:hover, .nav-drop button:hover { transform: translateX(2px); } }
.catalog-grid > .empty { grid-column: 1 / -1; }

/* ============================================================
   Палитры (выбор администратора): html[data-palette]. Каждая задаёт тёмный и светлый набор.
   Класс .palette-<код> повторяет токены для образцов в админке.
   ============================================================ */
html[data-palette="midnight"], .palette-midnight {
    --paper: #0b0f17; --card: #121828; --card-2: #182033; --ink: #edf0f7; --muted: #98a3b8; --line: #222b3f; --line-strong: #33405a;
    --brand: #e2b85c; --brand-deep: #c9a04a; --brand-ink: #f6dfa3; --tint-brand: #2a2614; --on-brand: #0b0f17;
    --accent: #e0624e; --accent-deep: #c4503e; --tint-accent: #351b1b; --on-accent: #0b0f17;
    --gold: #e2b85c; --tint-gold: #2a2614; --shadow: 0 18px 50px rgba(2, 6, 16, .6);
}
html[data-palette="midnight"][data-theme="light"] {
    --paper: #eef1f6; --card: #ffffff; --card-2: #f4f6fa; --ink: #141a28; --muted: #5d687e; --line: #d9dfea; --line-strong: #bcc5d6;
    --brand: #9a7520; --brand-deep: #7c5d16; --brand-ink: #4e3a0c; --tint-brand: #f4ebd2; --on-brand: #fff;
    --accent: #c2492f; --accent-deep: #9e3a25; --tint-accent: #f8e3de; --on-accent: #fff; --gold: #8a6a1c; --tint-gold: #f4ebd2; --shadow: 0 12px 30px rgba(20, 26, 40, .14);
}
html[data-palette="label"], .palette-label {
    --paper: #100e0e; --card: #191414; --card-2: #211a1a; --ink: #f4ece6; --muted: #a79a93; --line: #2d2424; --line-strong: #3e3232;
    --brand: #e04b3a; --brand-deep: #c63f30; --brand-ink: #ffb3aa; --tint-brand: #331a17; --on-brand: #fff3f0;
    --accent: #f0b64a; --accent-deep: #d69c33; --tint-accent: #332913; --on-accent: #140f06;
    --gold: #f0b64a; --tint-gold: #332913; --shadow: 0 18px 50px rgba(10, 2, 2, .6);
}
html[data-palette="label"][data-theme="light"] {
    --paper: #f6f0ea; --card: #fffaf6; --card-2: #f8efe8; --ink: #1d1413; --muted: #776862; --line: #e6d9d1; --line-strong: #cfbdb3;
    --brand: #c43a2b; --brand-deep: #a12f22; --brand-ink: #5e1c14; --tint-brand: #fae2de; --on-brand: #fff;
    --accent: #b8821f; --accent-deep: #94681a; --tint-accent: #f8ecd2; --on-accent: #fff; --gold: #8a6a1c; --tint-gold: #f8ecd2; --shadow: 0 12px 30px rgba(50, 20, 15, .14);
}
html[data-palette="paper"], .palette-paper {
    --paper: #15130f; --card: #1c1915; --card-2: #24201a; --ink: #f0e9dc; --muted: #a79d8d; --line: #2e2922; --line-strong: #403931;
    --brand: #e9dcc3; --brand-deep: #d6c7aa; --brand-ink: #f7efe0; --tint-brand: #2a2620; --on-brand: #15130f;
    --accent: #d36a3b; --accent-deep: #b8582e; --tint-accent: #35211a; --on-accent: #15130f;
    --gold: #d8bb6a; --tint-gold: #2e2814; --shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
html[data-palette="paper"][data-theme="light"] {
    --paper: #f5efe3; --card: #fffbf2; --card-2: #f3ebdc; --ink: #15130f; --muted: #6c6254; --line: #e2d8c5; --line-strong: #c9bda6;
    --brand: #15130f; --brand-deep: #2d2922; --brand-ink: #15130f; --tint-brand: #e9e1d2; --on-brand: #f5efe3;
    --accent: #c25a2d; --accent-deep: #9f4822; --tint-accent: #f7e2d6; --on-accent: #fff; --gold: #8a6d1d; --tint-gold: #f6eed3; --shadow: 0 12px 30px rgba(46, 38, 24, .14);
}
html[data-palette="mono"], .palette-mono {
    --paper: #0c0c0c; --card: #141414; --card-2: #1c1c1c; --ink: #f2f2f2; --muted: #9a9a9a; --line: #262626; --line-strong: #363636;
    --brand: #f2f2f2; --brand-deep: #d9d9d9; --brand-ink: #ffffff; --tint-brand: #222222; --on-brand: #0c0c0c;
    --accent: #ff5c35; --accent-deep: #e04d29; --tint-accent: #331a12; --on-accent: #0c0c0c;
    --gold: #cfcfcf; --tint-gold: #222222; --shadow: 0 18px 50px rgba(0, 0, 0, .65);
}
html[data-palette="mono"][data-theme="light"] {
    --paper: #f4f4f4; --card: #ffffff; --card-2: #ededed; --ink: #111111; --muted: #666666; --line: #e0e0e0; --line-strong: #c4c4c4;
    --brand: #111111; --brand-deep: #333333; --brand-ink: #111111; --tint-brand: #e6e6e6; --on-brand: #ffffff;
    --accent: #e04d29; --accent-deep: #b83d1f; --tint-accent: #fbe3dc; --on-accent: #fff; --gold: #6b6b6b; --tint-gold: #ececec; --shadow: 0 12px 30px rgba(0, 0, 0, .12);
}
.palette-amber { --paper: #0f0e0c; --card: #17150f; --brand: #f0a93a; --accent: #e4583d; --ink: #f3ece0; }
.palette-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.palette-option { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card); }
.palette-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint-brand); }
.palette-option input { position: absolute; opacity: 0; pointer-events: none; }
.palette-swatch { display: flex; height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.3); }
.palette-swatch i { flex: 1; }
.palette-swatch .sw-paper { background: var(--paper); flex: 2; }
.palette-swatch .sw-card { background: var(--card); }
.palette-swatch .sw-brand { background: var(--brand); }
.palette-swatch .sw-accent { background: var(--accent); }
.palette-swatch .sw-ink { background: var(--ink); }
.palette-name { font-weight: 600; font-size: 14px; }
html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: background-color .4s ease, color .4s ease, border-color .4s ease, box-shadow .4s ease !important; }

/* ---------- Движение и эффекты ---------- */
.catalog-grid > .reveal:nth-child(4n+2), .shelf-row > .reveal:nth-child(4n+2) { transition-delay: 60ms; }
.catalog-grid > .reveal:nth-child(4n+3), .shelf-row > .reveal:nth-child(4n+3) { transition-delay: 120ms; }
.catalog-grid > .reveal:nth-child(4n+4), .shelf-row > .reveal:nth-child(4n+4) { transition-delay: 180ms; }
.shelf-row { mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); padding-right: 48px; }
@media (hover: hover) {
    .vinyl-card .sleeve::after, .record-cover::after {
        content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity var(--t) ease;
        background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.16), transparent 60%);
    }
    .vinyl-card:hover .sleeve::after, .record-cover:hover::after { opacity: 1; }
    .track.can-play:hover { background: var(--card-2); }
    .track.can-play:hover .track-play { transform: scale(1.08); }
    .genre-tile:hover small { color: var(--brand); }
}
.track-play { transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) ease, color var(--t-fast) ease; }
.vinyl-card .sleeve img { animation: img-in 500ms var(--ease-out) both; }
@keyframes img-in { from { opacity: 0; transform: scale(1.02); } }
/* Эквалайзер у играющего трека */
.track.is-current .track-title::after, .pt.is-current .pt-title::after {
    content: ""; display: inline-block; vertical-align: -2px; margin-left: 8px; width: 14px; height: 12px;
    background: repeating-linear-gradient(90deg, var(--brand) 0 3px, transparent 3px 5px);
    -webkit-mask: linear-gradient(#000, #000) 0 100% / 100% var(--eq, 60%) no-repeat; mask: linear-gradient(#000, #000) 0 100% / 100% var(--eq, 60%) no-repeat;
    animation: eq 700ms ease-in-out infinite alternate;
}
@keyframes eq { from { --eq: 35%; } to { --eq: 100%; } }
@property --eq { syntax: '<percentage>'; inherits: false; initial-value: 60%; }
.is-playing ~ * .track.is-current .track-title::after { animation-play-state: running; }
.player-credit { margin: 0; }
.store-badge { display: inline-block; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; }
.store-badge:hover { border-color: var(--brand); color: var(--brand); }
.chip { transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease; }
.chip:active, .nav-link:active, .icon-btn:active { transform: scale(.96); }
.player-modal { transform-origin: 50% 60%; }
@keyframes player-in { from { opacity: 0; transform: translateY(24px) scale(.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) {
    .vinyl-card .sleeve img { animation: none; }
    .track.is-current .track-title::after, .pt.is-current .pt-title::after { animation: none; }
    .catalog-grid > .reveal, .shelf-row > .reveal { transition-delay: 0ms; }
    html.theme-switching * { transition: none !important; }
}
