body {
    margin: 0;
    background: #F8F4EE;
    font-family: Inter, sans-serif;
    color: #2B2828;
}


.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px;
}

.search {
    width: 420px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid #DDD4C8;
    background: white;
    padding: 0 18px;
    font-size: 16px;
    box-sizing: border-box;
}

.search:focus {
    outline: none;
    border-color: #9E7455;
}

.books-grid {
    display: grid;
    grid-template-columns:
            repeat(
                    auto-fill,
                    minmax(220px, 1fr)
            );

    gap: 28px;
}

.book-card {
    background: #FFFDF8;
    border-radius: 22px;
    overflow: hidden;

    border: 1px solid #ECE4D9;

    transition: .25s;
}

.book-card:hover {
    transform: translateY(-3px);

    box-shadow:
            0 10px 22px
            rgba(0,0,0,0.07);
}

.book-cover {
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.book-info {
    padding: 18px;
}

.book-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.book-author {
    color: #7A736A;
    margin-bottom: 12px;
}

.book-price {
    font-size: 22px;
    font-weight: bold;
    color: #9E7455;
}

.buy-btn {
    background: #A65A2E;
    color: white;
    border: none;
    border-radius: 14px;

    padding: 14px 22px;
    cursor: pointer;

    font-size: 15px;
    transition: .2s;
}

.buy-btn:hover {
    background: #8C4923;
}

.secondary-btn {
    background: white;
    color: #4F3D2C;

    border:
            1px solid
            #DDD4C8;
}

.secondary-btn:hover {
    background: #F7F1EA;
}

.card {
    background: #FFFDF8;
    border-radius: 24px;
    padding: 30px;
    border: 1px solid #ECE4D9;
}

input,
textarea,
select {
    width: 100%;
    box-sizing: border-box;
}

a {
    color: #4F3D2C;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td,
th {
    padding: 18px;
    border-bottom:
            1px solid
            #EEE5DA;
}

th {
    text-align: left;
}

.footer {
    margin-top: 80px;
    border-top: 1px solid #E8E0D5;
    background: #FFFDF8;
}

.footer-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 28px 40px;

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

.footer-text {
    color: #7A736A;
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-links a {
    text-decoration: none;
    color: #4F3D2C;
    font-weight: 500;
    transition: .2s;
}

.footer-links a:hover {
    color: #A65A2E;
}

.qa-tooltip {

    position: fixed;

    background: #FFFDF8;

    border: 1px solid #DDD4C8;

    border-radius: 18px;

    padding: 16px;

    width: 280px;

    box-shadow:
            0 12px 32px
            rgba(0,0,0,0.12);

    z-index: 9999;

    pointer-events: none;

    opacity: 0;

    transform: translateY(8px);

    transition: .2s;
}

.qa-tooltip.visible {

    opacity: 1;

    transform: translateY(0);
}

.qa-title {

    font-size: 18px;

    font-weight: bold;

    color: #4F3D2C;

    margin-bottom: 8px;
}

.qa-desc {

    color: #7A736A;

    font-size: 14px;

    line-height: 1.5;
}

.qa-mode-highlight {

    outline:
            2px dashed
            rgba(166,90,46,0.35);

    border-radius: 8px;

    transition: .2s;
}

.qa-term {

    background:#F5EEE2;

    border:
            1px solid #E4D7C5;

    border-radius:14px;

    padding:10px 14px;

    font-size:13px;

    cursor:pointer;

    color:#5B4A39;

    transition:.2s;

    display:flex;

    align-items:center;

    gap:6px;

    white-space:nowrap;
}

.qa-term:hover {

    transform:
            translateY(-1px);

    box-shadow:
            0 4px 14px
            rgba(
                    0,0,0,.08
            );
}

.qa-title {

    font-weight:700;

    margin-bottom:8px;
}

.qa-desc {

    line-height:1.5;
}

.qa-network-panel {

    position:fixed;

    right:20px;
    bottom:20px;

    width:340px;
    max-height:420px;

    overflow:auto;

    background:white;

    border-radius:20px;

    box-shadow:
            0 12px 40px
            rgba(0,0,0,.12);

    border:
            1px solid #E8DED1;

    z-index:99999;

    padding:18px;
}

.qa-network-title {

    font-weight:700;

    margin-bottom:16px;

    font-size:18px;
}

.qa-network-item {

    padding:12px;

    border-radius:14px;

    background:#F8F5F0;

    margin-bottom:10px;

    cursor:pointer;

    transition:.2s;
}

.qa-network-item:hover {

    transform:
            translateY(-1px);
}

.qa-method {

    font-weight:700;
}

.qa-status {

    margin-top:8px;

    font-size:13px;

    color:#6B635B;
}

.qa-request-body {

    margin-top:10px;

    background:#EFE8DE;

    padding:10px;

    border-radius:10px;

    font-size:12px;

    overflow:auto;

    display:none;

    white-space:pre-wrap;
}




.book-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

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

.icon-btn {
    min-width: 56px;
    height: 48px;
    padding: 0 18px;
}


/* ===================================
   MOBILE GLOBAL LAYOUT
=================================== */

@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
    }

    /* =====================
       PAGE
    ===================== */

    .container {
        padding: 16px;
    }

    h1 {
        font-size: clamp(32px, 9vw, 48px);
        line-height: 1.08;
        margin-top: 0;
    }

    h2 {
        line-height: 1.2;
    }

    p {
        line-height: 1.6;
    }

    /* =====================
       HERO (старый баннер; новые секции витрины исключены)
    ===================== */

    section:not(.shop-section):not(.promo) {

        padding: 26px !important;

        border-radius: 28px !important;

        flex-direction: column !important;
        align-items: flex-start !important;

        gap: 24px !important;
    }

    section:not(.shop-section):not(.promo) h1 {

        font-size: 38px !important;
        line-height: 1.08;
    }

    section:not(.shop-section):not(.promo) p {

        font-size: 17px !important;
        line-height: 1.65 !important;
    }

    section:not(.shop-section):not(.promo) img {

        width: 100% !important;
        height: 220px !important;

        object-fit: cover;
        border-radius: 20px;
    }

    /* =====================
       SEARCH
    ===================== */

    #search-form {

        width: 100%;

        display: flex;
        flex-direction: column;

        gap: 12px;
    }

    .search {

        width: 100%;
        min-width: unset;
    }

    #search-form button,
    .buy-btn {

        width: 100%;
        box-sizing: border-box;
    }

    /* =====================
       BOOK GRID
    ===================== */

    .books-grid {

        grid-template-columns: 1fr;
        gap: 16px;
    }

    .book-card {

        border-radius: 22px;
    }

    .book-cover {

        height: 250px;
    }

    .book-info {

        padding: 16px;
    }

    .book-title {

        font-size: 20px;
        line-height: 1.3;
    }

    .book-author {

        line-height: 1.4;
    }

    .book-bottom {

        flex-wrap: wrap;
        gap: 10px;
    }

    .book-actions {

        width: 100%;
    }

    .icon-btn {
        flex: 1;
    }

    /* =====================
       CARD
    ===================== */

    .card {

        padding: 22px !important;
        border-radius: 24px;
    }

    /* =====================
       TABLES
    ===================== */

    table {
        display: block;
        overflow-x: auto;
    }
}

/* very small phones */

@media (max-width: 390px) {

    .container {
        padding: 14px;
    }

    .book-cover {
        height: 220px;
    }
}

/* ===================================
   MOBILE BOOK / WISHLIST / CART
=================================== */

@media (max-width: 768px) {

    /* =====================
       BOOK PAGE
    ===================== */

    .card[style*="gap:60px"] {

        flex-direction: column !important;
        gap: 28px !important;
    }

    #book-image {

        width: 100% !important;
        height: 320px !important;

        object-fit: cover;
        border-radius: 20px;
    }

    #book-title {

        font-size: 34px !important;
        line-height: 1.08;
    }

    #book-author {

        font-size: 18px !important;
        margin-bottom: 20px !important;
    }

    #book-price {

        font-size: 30px !important;
        margin-bottom: 24px !important;
    }

    #book-description {

        font-size: 16px !important;
        line-height: 1.7 !important;
    }

    #book-actions {

        display: flex;
        flex-direction: column;

        gap: 12px;
    }

    #book-actions .buy-btn {
        width: 100%;
    }

    /* bug modal */

    #bug-modal {
        padding: 12px !important;
    }

    #bug-modal .card {

        height: 92vh !important;
        border-radius: 22px !important;
    }

    /* =====================
       WISHLIST
    ===================== */

    #wishlist-container {
        gap: 16px;
    }

    #wishlist-container .buy-btn {
        width: 100%;
    }

    /* =====================
       ORDERS
    ===================== */

    #orders-container {

        gap: 16px !important;
    }

    #orders-container .card {

        padding: 20px !important;
    }

    /* =====================
       CART
    ===================== */

    #cart-content table,
    #cart-content thead,
    #cart-content tbody,
    #cart-content tr,
    #cart-content td {

        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    #cart-content thead {
        display: none;
    }

    /* cart card */

    #cart-content tr {

        background: #FFFDF8;

        border:
                1px solid #ECE4D9;

        border-radius: 22px;

        padding: 16px;
        margin-bottom: 18px;

        overflow: hidden;
    }

    #cart-content td {

        border: none;
        padding: 8px 0;
    }

    /* image + text */

    [data-qa-name="Cart Item"] {

        display: flex;

        gap: 14px !important;

        align-items:
                flex-start !important;
    }

    [data-qa-name="Cart Item"] img {

        width: 68px !important;
        height: 96px !important;

        border-radius: 12px;

        object-fit: cover;

        flex-shrink: 0;
    }

    /* title */

    [data-qa-name="Title"] {

        font-size: 18px;
        line-height: 1.35;

        word-break: break-word;
    }

    /* counter */

    [data-qa-name="Counter"] {

        display: flex;
        align-items: center;

        gap: 10px !important;

        margin-top: 10px;
    }

    [data-qa-name="Counter"]
    .buy-btn,

    [data-qa-name="Counter"]
    .secondary-btn {

        width: 52px !important;
        min-width: 52px !important;

        height: 42px !important;

        padding: 0 !important;
    }

    [data-qa-name="Counter Value"] {

        min-width: 26px;

        text-align: center;

        font-weight: 600;
    }

    /* delete */

    [data-qa-name="Delete Button"] {

        width: 100%;
        margin-top: 10px;
    }

    /* summary */

    .card[style*="width:320px"] {

        width: 100% !important;
        box-sizing: border-box;
    }

    div[style*="justify-content:flex-end"] {

        justify-content:
                stretch !important;
    }

    a[href="/checkout"] {

        width: 100%;
        box-sizing: border-box;
    }
}

/* ===================================
   MOBILE BUGS + QA BINGO
=================================== */

@media (max-width: 768px) {

    /* =====================
       BUGS PAGE
    ===================== */

    #bugs-content table,
    #bugs-content thead,
    #bugs-content tbody,
    #bugs-content tr,
    #bugs-content td {

        display: block;
        width: 100%;

        box-sizing: border-box;
    }

    #bugs-content thead {
        display: none;
    }

    /* bug card */

    #bugs-content tr {

        background: #FFFDF8;

        border:
                1px solid #ECE4D9;

        border-radius: 22px;

        padding: 18px;
        margin-bottom: 18px;

        overflow: hidden;
    }

    #bugs-content td {

        border: none;
        padding: 6px 0;
    }

    /* id */

    #bugs-content td:first-child {

        font-size: 13px;
        color: #8B8074;

        margin-bottom: 6px;
    }

    /* title */

    #bugs-content td:nth-child(2) a {

        font-size: 18px;
        line-height: 1.35;

        font-weight: 600;
    }

    /* severity + priority */

    #bugs-content td:nth-child(3),
    #bugs-content td:nth-child(4) {

        display: inline-block;

        width: auto;

        margin-right: 8px;
        margin-top: 10px;
    }

    /* status */

    #bugs-content td:nth-child(5) {

        margin-top: 10px;
        color: #7A736A;
    }

    /* author */

    #bugs-content td:nth-child(6) {

        font-size: 14px;
        color: #8B8074;
    }

    /* actions */

    #bugs-content td:last-child {

        margin-top: 14px;
    }

    #bugs-content td:last-child > div {

        display: flex;
        gap: 10px;

        justify-content:
                stretch !important;

        width: 100%;
    }

    #bugs-content td:last-child a {

        flex: 1;
        text-align: center;
    }

    /* top section */

    div[style*="justify-content:space-between"] {

        flex-direction:
                column !important;

        align-items:
                stretch !important;

        gap: 18px !important;
    }

    div[style*="justify-content:space-between"]
    .buy-btn {

        width: 100%;
    }

    /* modal */

    #bug-modal {

        padding: 12px !important;
    }

    #bug-modal > div {

        height: 92vh !important;

        border-radius:
                22px !important;
    }

    /* =====================
       QA BINGO
    ===================== */

    #bingo-grid {

        grid-template-columns:
            repeat(2, 1fr)
        !important;

        gap: 12px !important;
    }

    /* hero */

    h1[style*="font-size:42px"] {

        font-size: 34px !important;
        line-height: 1.08;
    }

    div[style*="font-size:18px"] {

        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    /* progress */

    #progress {

        font-size: 28px !important;
    }

    .card[style*="min-width:180px"] {

        min-width:
                auto !important;

        width: 100%;

        box-sizing:
                border-box;
    }

    /* bingo card */

    #bingo-grid > div {

        min-height:
                120px !important;

        padding:
                18px !important;

        border-radius:
                20px !important;

        font-size:
                15px !important;

        line-height: 1.4;
    }
}

/* small phones */

@media (max-width: 420px) {

    #bingo-grid {

        grid-template-columns:
            1fr !important;
    }
}

/* ===================================
   MOBILE QA TEST DESIGN
=================================== */

@media (max-width: 768px) {

    .qa-layout {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* =====================
       HEADER
    ===================== */

    .page-title {

        font-size: 34px;
        line-height: 1.08;
    }

    .page-subtitle {

        font-size: 15px;
        line-height: 1.55;
    }

    /* =====================
       TABS
    ===================== */

    .technique-tabs {

        display: flex;

        overflow-x: auto;

        flex-wrap: nowrap;

        gap: 12px;

        padding-bottom: 8px;

        scrollbar-width: none;
    }

    .technique-tabs::-webkit-scrollbar {
        display: none;
    }

    .technique-tab {

        min-width: 220px;

        flex-shrink: 0;

        height: 64px;

        padding: 14px 18px;

        border-radius: 20px;
    }

    .technique-name {

        font-size: 16px;
    }

    .technique-sub {

        font-size: 12px;
    }

    /* =====================
       MAIN GRID
    ===================== */

    .exercise-card,
    .equivalence-layout,
    .boundary-layout {

        display: grid;

        grid-template-columns:
            1fr !important;

        gap: 22px !important;

        padding: 20px;

        border-radius: 28px;
    }

    /* =====================
       TEXT
    ===================== */

    .exercise-title {

        font-size: 26px;
        line-height: 1.2;
    }

    .interaction-title,
    .selection-title,
    .qa-task-title {

        font-size: 22px;
        line-height: 1.2;
    }

    /* =====================
       RIGHT PANEL
    ===================== */

    .side-panel {

        order: -1;
    }

    .box {

        padding: 18px;
        border-radius: 20px;
    }

    .recommendation-title {

        font-size: 24px;
    }

    /* =====================
       SELECTED VALUE
    ===================== */

    .selected-age {

        font-size: 28px;
    }

    /* =====================
       CARS
    ===================== */

    .cars-grid {

        grid-template-columns:
            repeat(2, 1fr);

        gap: 10px;
    }

    .car-card {

        min-height: 110px;

        border-radius: 18px;
    }

    .car-image {

        font-size: 34px;
    }

    .car-name {

        font-size: 14px;
        line-height: 1.3;
    }

    /* =====================
       HEADER BLOCK
    ===================== */

    .selection-header {

        display: flex;

        flex-direction: column;

        align-items: flex-start;

        gap: 14px;
    }

    .selection-counter {

        font-size: 18px;

        padding: 10px 16px;
    }

    /* =====================
       BUTTONS
    ===================== */

    .check-button {

        font-size: 20px;

        padding: 18px;

        border-radius: 20px;
    }
}

/* very small phones */

@media (max-width: 420px) {

    .cars-grid {

        grid-template-columns:
            1fr;
    }

    .technique-tab {

        min-width: 200px;
    }
}

/* =====================================================
   HEADER v2: полоса тренажёра + шапка магазина
   ===================================================== */

#header-container {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ---------- полоса тренажёра ---------- */

.qa-bar {
    background: #2F2620;
    color: #E9DCCB;
    font-size: 13px;
}

.qa-bar-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 22px;
    box-sizing: border-box;
}

/* «Тренажёр»: кнопка + окно «как устроен тренажёр» */

.qa-bar-about {
    position: relative;
    flex-shrink: 0;
}

.qa-bar-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: none;
    border-radius: 999px;
    background: #E8B04B;
    color: #2F2620;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .15s;
}

.qa-bar-badge:hover,
.qa-bar-badge[aria-expanded="true"] {
    background: #F4C978;
}

.qa-bar-badge-caret {
    font-size: 10px;
    opacity: .7;
    transition: transform .15s;
}

.qa-bar-badge[aria-expanded="true"] .qa-bar-badge-caret {
    transform: rotate(180deg);
}

/* точка «загляни сюда», пока окно ни разу не открывали */
.qa-bar-badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #D6452B;
    box-shadow: 0 0 0 2px #2F2620;
    animation: trainer-dot 1.8s ease-in-out infinite;
}

.qa-bar-badge-dot[hidden] {
    display: none;
}

@keyframes trainer-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
    .qa-bar-badge-dot { animation: none; }
}

.trainer-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 300;
    width: min(360px, calc(100vw - 32px));
    padding: 18px;
    border-radius: 18px;
    background: #FFFDF8;
    color: #2B2828;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
    box-sizing: border-box;
    font-size: 14px;
}

.trainer-popover[hidden] {
    display: none;
}

.trainer-popover-title {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: bold;
    color: #3E2F22;
}

.trainer-popover-lead {
    margin: 6px 0 12px;
    line-height: 1.5;
    color: #5E5247;
}

.trainer-popover-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trainer-popover-list a,
.trainer-popover-list button {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 10px;
    background: none;
    color: #2B2828;
    font: inherit;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.trainer-popover-list a:hover,
.trainer-popover-list button:hover {
    background: #F6ECE2;
}

.trainer-popover-list b {
    color: #3E2F22;
}

.trainer-popover-list em {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: #A65A2E;
}

.trainer-icon {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.trainer-popover-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #F1E9DF;
    font-size: 13px;
    color: #7A736A;
}

.trainer-popover-foot a {
    color: #2A8BC9;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 768px) {

    /* на телефоне окно — во всю ширину под полосой */
    .qa-bar-about {
        position: static;
    }

    .trainer-popover {
        position: fixed;
        top: 44px;
        left: 16px;
        width: calc(100vw - 32px);
    }
}

.qa-bar-links {
    display: flex;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.qa-bar-links::-webkit-scrollbar {
    display: none;
}

.qa-bar-links a {
    color: #E9DCCB;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.qa-bar-links a:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.qa-bar-links a.active {
    background: rgba(232, 176, 75, .18);
    color: #F4C978;
}

/* сюда qa-learning.js кладёт «QA Term» и «Backend» в QA-режиме */

.qa-bar-slot {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.qa-bar-slot:empty {
    display: none;
}

.qa-bar-slot .qa-term {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .14);
    color: #E9DCCB;
}

.qa-bar-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.qa-bar-hint {
    color: #A8998A;
    white-space: nowrap;
}

.qa-bar-report {
    color: #F4C978;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid rgba(232, 176, 75, .45);
    border-radius: 8px;
    white-space: nowrap;
    transition: background .15s;
}

.qa-bar-report:hover {
    background: rgba(232, 176, 75, .15);
}

/* ссылка на Telegram-канал автора */

.qa-bar-tg {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 5px;
    border-radius: 999px;
    background: rgba(42, 171, 238, .14);
    border: 1px solid rgba(42, 171, 238, .35);
    color: #DDF1FC;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s;
}

.qa-bar-tg:hover {
    background: rgba(42, 171, 238, .26);
    color: #fff;
}

.qa-bar-tg svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.qa-bar-tg-by {
    font-weight: 400;
    color: #9FC9E0;
    margin-right: 2px;
}

/* ---------- Шапка магазина ---------- */

.header {
    background: #FFFDF8;
    border-bottom: 1px solid #E8E0D5;
    box-shadow: 0 2px 10px rgba(79, 61, 44, .04);
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
    color: #4F3D2C;
}

.logo-mark {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    font-family: Georgia, serif;
    font-size: 23px;
    font-weight: bold;
    line-height: 1.05;
}

.logo-text small {
    font-family: Inter, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #9B8D7E;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* поиск */

.header-search {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 520px;
}

.header-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: #9B8D7E;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.header-search input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    border: 1px solid #DDD4C8;
    border-radius: 12px;
    background: #F8F4EE;
    font: inherit;
    font-size: 15px;
    color: inherit;
    box-sizing: border-box;
    transition: border-color .15s, background .15s;
}

.header-search input:focus {
    outline: none;
    border-color: #9E7455;
    background: #fff;
}

/* навигация */

.header-nav {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.header-nav a {
    color: #4F3D2C;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 10px;
    white-space: nowrap;
    transition: background .15s;
}

.header-nav a:hover {
    background: #F3EBE1;
}

.header-nav a.active {
    color: #A65A2E;
    background: #F6ECE2;
}

/* иконки */

.header-icons {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.hdr-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #4F3D2C;
    text-decoration: none;
    transition: background .15s;
}

.hdr-icon:hover,
.hdr-icon.active {
    background: #F3EBE1;
}

.hdr-icon svg,
.hdr-user svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hdr-icon-label {
    display: none;
}

.hdr-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #A65A2E;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-sizing: border-box;
    border: 2px solid #FFFDF8;
}

/* пользователь */

.header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

body.guest-user .header-auth {
    margin-left: auto;
}

.hdr-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4F3D2C;
    font-weight: 500;
    max-width: 160px;
}

.hdr-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hdr-logout {
    background: none;
    border: 1px solid #DDD4C8;
    border-radius: 10px;
    padding: 8px 12px;
    color: #72685D;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s;
}

.hdr-logout:hover {
    background: #F3EBE1;
}

.guest-login-btn {
    text-decoration: none;
    padding: 11px 22px;
}

/* бургер */

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #E7DED3;
    border-radius: 12px;
    background: #FFFDF8;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #4F3D2C;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ---------- Планшет ---------- */

@media (max-width: 1100px) {

    .logo-text small {
        display: none;
    }

    .hdr-user-name {
        display: none;
    }
}

/* ---------- Мобильная версия ---------- */

@media (max-width: 768px) {

    .qa-bar-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .qa-bar-hint,
    .qa-bar-report {
        display: none;
    }

    /* на телефоне от ссылки на канал остаётся только иконка */

    .qa-bar-tg {
        padding: 4px;
    }

    .qa-bar-tg-text {
        display: none;
    }

    .header-inner {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 10px;
    }

    .logo-mark {
        width: 34px;
        height: 34px;
    }

    .logo-text {
        font-size: 21px;
    }

    .header-search {
        order: 10;
        flex-basis: 100%;
        max-width: none;
    }

    .header-icons {
        gap: 2px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* меню и кнопку выхода прячем в выпадающую панель */

    .header-nav,
    .header-auth {
        display: none;
    }

    /* гостю кнопку «Войти» показываем сразу */

    body.guest-user .header-auth {
        display: flex;
        margin-left: auto;
    }

    body.guest-user .header-auth .guest-login-btn {
        padding: 10px 16px;
    }

    body.mobile-menu-open .header-nav,
    body.mobile-menu-open:not(.guest-user) .header-auth {
        display: flex;
        flex-direction: column;
        flex-basis: 100%;
        box-sizing: border-box;
        order: 20;
        gap: 0;
        background: #FFFDF8;
        border: 1px solid #ECE4D9;
        border-radius: 16px;
        overflow: hidden;
    }

    body.mobile-menu-open .header-nav a {
        padding: 14px 16px;
        border-radius: 0;
        border-bottom: 1px solid #F1E9DF;
    }

    body.mobile-menu-open .header-nav a:last-child {
        border-bottom: none;
    }

    body.mobile-menu-open:not(.guest-user) .header-auth {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 16px;
    }

    body.mobile-menu-open .hdr-user-name {
        display: inline;
    }
}

@media (max-width: 390px) {

    .logo-text {
        font-size: 19px;
    }
}

/* =====================================================
   ВИТРИНА: промо, жанры, подборки, каталог, карточки,
   страница книги, футер
   ===================================================== */

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

.shop-page {
    padding-top: 28px;
}

.shop-section {
    margin-top: 56px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-head h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 30px;
    color: #4F3D2C;
}

.section-link {
    color: #A65A2E;
    font-weight: 600;
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

/* ---------- Промо-баннер ---------- */

.promo {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
}

.promo-slide {
    display: none;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
    min-height: 340px;
    padding: 48px 56px;
    box-sizing: border-box;
    animation: promo-in .5s ease;
}

.promo-slide.active {
    display: grid;
}

@keyframes promo-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
}

.promo-tone-welcome { background: #EFE5D7; }
.promo-tone-sale { background: #F6DCCB; }
.promo-tone-new { background: #DCE7DD; }

.promo-eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: #A65A2E;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.promo-text h1 {
    margin: 0 0 14px;
    font-family: Georgia, serif;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
    color: #3E2F22;
}

.promo-text p {
    margin: 0 0 26px;
    max-width: 460px;
    font-size: 18px;
    line-height: 1.6;
    color: #5E5247;
}

.promo-cta {
    display: inline-block;
    text-decoration: none;
}

.promo-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.promo-photo {
    width: 100%;
    max-width: 440px;
    height: 280px;
    object-fit: cover;
    border-radius: 22px;
}

.promo-covers {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.promo-cover {
    display: block;
    width: 150px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(62, 47, 34, .25);
    transition: transform .2s;
    background: #fff;
}

.promo-cover:nth-child(1) { transform: rotate(-6deg) translateY(10px); margin-right: -24px; }
.promo-cover:nth-child(2) { z-index: 2; width: 170px; }
.promo-cover:nth-child(3) { transform: rotate(6deg) translateY(10px); margin-left: -24px; }

.promo-cover:hover {
    transform: translateY(-6px);
    z-index: 3;
}

.promo-cover img,
.promo-cover .cover-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-dots {
    position: absolute;
    left: 56px;
    bottom: 22px;
    display: flex;
    gap: 8px;
}

.promo-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(62, 47, 34, .25);
    cursor: pointer;
    transition: width .2s, background .2s;
}

.promo-dot.active {
    width: 26px;
    background: #A65A2E;
}

/* ---------- Плитки жанров ---------- */

.genre-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.genre-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    padding: 18px;
    border-radius: 18px;
    overflow: hidden;
    color: #3E2F22;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

.genre-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(62, 47, 34, .1);
}

.genre-tile-name {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 17px;
}

.genre-tile-count {
    position: relative;
    z-index: 1;
    font-size: 13px;
    color: rgba(62, 47, 34, .7);
}

.genre-tile-letter {
    position: absolute;
    right: 10px;
    bottom: -22px;
    font-family: Georgia, serif;
    font-size: 96px;
    font-weight: bold;
    line-height: 1;
    color: rgba(255, 255, 255, .55);
}

.genre-tone-0 { background: #F2D9C4; }
.genre-tone-1 { background: #DCE7DD; }
.genre-tone-2 { background: #E3DDF0; }
.genre-tone-3 { background: #F5E6B8; }
.genre-tone-4 { background: #D6E6EF; }
.genre-tone-5 { background: #EED5D8; }

/* ---------- Карточка товара ---------- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 22px;
    transition: opacity .2s;
}

.product-grid.is-loading {
    opacity: .45;
    pointer-events: none;
}

.product-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 210px;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 4px 14px;
    margin: 0 -4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.product-rail > .product-card {
    scroll-snap-align: start;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #FFFDF8;
    border: 1px solid #ECE4D9;
    border-radius: 18px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.product-card:hover {
    box-shadow: 0 12px 28px rgba(62, 47, 34, .1);
    transform: translateY(-2px);
}

.product-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    background: #F1EAE0;
    overflow: hidden;
}

.product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.product-card:hover .product-cover img {
    transform: scale(1.03);
}

/* заглушка обложки */

.cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 16px;
    box-sizing: border-box;
    background:
            linear-gradient(90deg, rgba(0, 0, 0, .12) 0 6px, transparent 6px),
            linear-gradient(160deg, #8C4923, #5A3420);
    color: #FFF3E6;
}

/* место под бейджи в левом верхнем углу */
.product-cover .cover-fallback,
.book-detail-cover .cover-fallback {
    padding-top: 72px;
}

.cover-fallback-title {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.cover-fallback-author {
    font-size: 12px;
    opacity: .8;
}

/* бейджи */

.product-badges {
    position: absolute;
    left: 10px;
    top: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.pbadge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.pbadge-sale { background: #D6452B; color: #fff; }
.pbadge-new { background: #2F7A4F; color: #fff; }
.pbadge-out { background: rgba(43, 40, 40, .78); color: #fff; }

/* избранное поверх обложки */

.product-wish {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 253, 248, .92);
    color: #4F3D2C;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: transform .15s, color .15s;
}

.product-wish:hover {
    transform: scale(1.08);
}

.product-wish svg,
.wish-btn-lg svg,
.product-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.product-wish.active,
.wish-btn-lg.active {
    color: #D6452B;
}

.product-wish.active svg,
.wish-btn-lg.active svg {
    fill: currentColor;
}

/* тело карточки */

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 14px 16px;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: #2B2828;
}

.product-price.is-sale {
    color: #D6452B;
}

.product-old-price {
    font-size: 14px;
    color: #9B8D7E;
    text-decoration: line-through;
}

.product-title {
    color: #2B2828;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title:hover {
    color: #A65A2E;
}

.product-author {
    margin-top: 4px;
    font-size: 14px;
    color: #7A736A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-stock {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
}

.product-stock.low { color: #B4651B; }
.product-stock.out { color: #8B8074; }

.product-actions {
    margin-top: auto;
    padding-top: 14px;
}

.product-btn {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    background: #A65A2E;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.product-btn:hover {
    background: #8C4923;
}

.product-btn:disabled {
    background: #E8E0D5;
    color: #8B8074;
    cursor: not-allowed;
}

/* степпер количества */

.qty-stepper {
    display: flex;
    align-items: center;
    height: 42px;
    border-radius: 12px;
    background: #F6ECE2;
    overflow: hidden;
}

.qty-stepper button {
    width: 42px;
    height: 100%;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #A65A2E;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
}

.qty-stepper button:hover {
    background: #EEDDCC;
}

.qty-stepper button:disabled {
    opacity: .5;
    cursor: wait;
}

.qty-value {
    flex: 1;
    text-align: center;
    color: #4F3D2C;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.qty-value:hover {
    text-decoration: underline;
}

/* ---------- Каталог ---------- */

.catalog-head {
    align-items: center;
}

.catalog-count {
    margin-top: 6px;
    color: #7A736A;
    font-size: 15px;
}

.catalog-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7A736A;
    font-size: 14px;
}

.catalog-select,
.filter-input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid #DDD4C8;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: #2B2828;
    box-sizing: border-box;
}

.catalog-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #9E7455;
}

.filters-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #DDD4C8;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: #4F3D2C;
    cursor: pointer;
}

.filters-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.filters-toggle-count:not(:empty) {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #A65A2E;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    box-sizing: border-box;
}

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

.active-filters:not(:empty) {
    margin-bottom: 18px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: none;
    border-radius: 999px;
    background: #F6ECE2;
    color: #4F3D2C;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.filter-chip:hover {
    background: #EEDDCC;
}

.filter-chip-clear {
    border: none;
    background: none;
    color: #A65A2E;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.catalog-filters {
    position: sticky;
    top: 150px;
    padding: 20px;
    border: 1px solid #ECE4D9;
    border-radius: 18px;
    background: #FFFDF8;
}

.filter-group {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #F1E9DF;
}

.filter-title {
    margin-bottom: 10px;
    font-weight: 700;
    color: #4F3D2C;
}

.filter-group .filter-input {
    width: 100%;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 280px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    color: #2B2828;
}

.filter-option input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #A65A2E;
    flex-shrink: 0;
}

.filter-option span {
    flex: 1;
}

.filter-option small {
    color: #9B8D7E;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-range .filter-input {
    min-width: 0;
}

.filters-reset {
    width: 100%;
    height: 40px;
    border: 1px solid #DDD4C8;
    border-radius: 12px;
    background: transparent;
    color: #72685D;
    font: inherit;
    cursor: pointer;
}

.filters-reset:hover {
    background: #F3EBE1;
}

.catalog-empty {
    padding: 56px 24px;
    border: 1px dashed #DDD4C8;
    border-radius: 18px;
    text-align: center;
    color: #72685D;
}

.catalog-empty-title {
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: bold;
    color: #4F3D2C;
}

.catalog-empty .buy-btn {
    display: inline-block;
    text-decoration: none;
}

.catalog-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.catalog-shown {
    color: #9B8D7E;
    font-size: 14px;
}

/* ---------- Страница книги ---------- */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #9B8D7E;
}

.breadcrumbs a {
    color: #72685D;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #A65A2E;
    text-decoration: underline;
}

.breadcrumbs-current {
    color: #2B2828;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-detail {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.book-detail-cover {
    position: sticky;
    top: 150px;
    aspect-ratio: 2 / 3;
    border-radius: 20px;
    overflow: hidden;
    background: #F1EAE0;
    box-shadow: 0 18px 40px rgba(62, 47, 34, .14);
}

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

.book-detail-cover .product-badges {
    left: 14px;
    top: 14px;
}

.book-detail-cover .pbadge {
    font-size: 14px;
    padding: 6px 11px;
}

.book-detail-genre {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #F6ECE2;
    color: #A65A2E;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.book-detail-title {
    margin: 0 0 8px;
    font-family: Georgia, serif;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.15;
    color: #3E2F22;
}

.book-detail-author {
    font-size: 19px;
    color: #72685D;
}

.buy-box {
    margin: 26px 0 32px;
    padding: 22px 24px;
    border: 1px solid #ECE4D9;
    border-radius: 20px;
    background: #FFFDF8;
}

.buy-box-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
}

.buy-box-price .product-price {
    font-size: 36px;
}

.buy-box-price .product-old-price {
    font-size: 20px;
}

.buy-box-savings {
    margin-top: 4px;
    color: #D6452B;
    font-size: 14px;
    font-weight: 600;
}

.stock-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
}

.stock-line::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.stock-line.in { color: #2F7A4F; }
.stock-line.low { color: #B4651B; }
.stock-line.out { color: #8B8074; }

.buy-box-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.buy-box-cart {
    flex: 1;
    min-width: 220px;
    max-width: 340px;
}

.buy-box-cart .product-btn,
.buy-box-cart .qty-stepper {
    height: 52px;
    font-size: 16px;
}

.wish-btn-lg {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 20px;
    border: 1px solid #DDD4C8;
    border-radius: 12px;
    background: #fff;
    color: #4F3D2C;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.wish-btn-lg:hover {
    background: #F7F1EA;
}

.buy-box-hint {
    margin: 14px 0 0;
    font-size: 14px;
    color: #7A736A;
}

.buy-box-hint a {
    color: #A65A2E;
    font-weight: 600;
}

.book-detail-subtitle {
    margin: 32px 0 12px;
    font-family: Georgia, serif;
    font-size: 24px;
    color: #4F3D2C;
}

.book-detail-description {
    margin: 0;
    font-size: 17px;
    line-height: 1.8;
    color: #5E554B;
    white-space: pre-line;
}

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

.specs-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed #E4D7C5;
}

.specs dt {
    flex: 0 0 160px;
    color: #7A736A;
}

.specs dd {
    margin: 0;
    color: #2B2828;
}

.specs dd a {
    color: #A65A2E;
}

.report-link {
    margin-top: 32px;
    padding: 0;
    border: none;
    background: none;
    color: #8B8074;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.report-link:hover {
    color: #A65A2E;
    text-decoration: underline;
}

/* скелетон */

.skeleton-block,
.skeleton-line {
    border-radius: 12px;
    background: linear-gradient(90deg, #EFE7DC 25%, #F7F1E9 50%, #EFE7DC 75%);
    background-size: 200% 100%;
    animation: skeleton 1.2s infinite linear;
}

.skeleton-line {
    height: 18px;
    margin-bottom: 14px;
}

.skeleton-title {
    height: 42px;
    width: 80%;
}

.is-skeleton .book-detail-cover {
    box-shadow: none;
}

@keyframes skeleton {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* модалка баг-репорта */

.bug-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: rgba(0, 0, 0, .55);
}

.bug-modal.open {
    display: flex;
}

.bug-modal-card {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
}

.bug-modal-card iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.bug-modal-close {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 10;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #F3EBE1;
    cursor: pointer;
}

/* ---------- Тосты ---------- */

.toast-box {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 14px;
    background: #2F2620;
    color: #FFF3E6;
    font-size: 15px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s;
    pointer-events: auto;
    box-sizing: border-box;
}

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

.toast a {
    color: #F4C978;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

/* ---------- Футер ---------- */

.site-footer {
    margin-top: 80px;
    background: #2F2620;
    color: #CBBBA8;
}

.site-footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 48px 40px 36px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    box-sizing: border-box;
}

.footer-logo {
    color: #FFF3E6;
}

.footer-brand p {
    max-width: 380px;
    margin: 16px 0 20px;
    line-height: 1.6;
    font-size: 15px;
}

.footer-tg {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 10px 10px;
    border-radius: 14px;
    background: rgba(42, 171, 238, .14);
    border: 1px solid rgba(42, 171, 238, .35);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}

.footer-tg:hover {
    background: rgba(42, 171, 238, .26);
}

.footer-tg svg {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.footer-tg span {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.footer-tg small {
    font-weight: 400;
    font-size: 12px;
    color: #9FC9E0;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col h4 {
    margin: 0 0 6px;
    color: #FFF3E6;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.footer-col a {
    color: #CBBBA8;
    text-decoration: none;
    font-size: 15px;
}

.footer-col a:hover {
    color: #F4C978;
}

.site-footer-bottom {
    max-width: 1300px;
    margin: 0 auto;
    padding: 18px 40px 28px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 13px;
    color: #9C8C7B;
    box-sizing: border-box;
}

.footer-version:not(:empty) {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    font-family: ui-monospace, monospace;
}

/* ---------- Адаптив витрины ---------- */

@media (max-width: 1000px) {

    .catalog-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .filters-toggle {
        display: inline-flex;
    }

    .catalog-filters {
        display: none;
        position: static;
    }

    .catalog-filters.open {
        display: block;
        margin-bottom: 8px;
    }

    .book-detail {
        grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
        gap: 32px;
    }

    .site-footer-inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {

    .shop-page {
        padding-top: 16px;
    }

    .shop-section {
        margin-top: 40px;
    }

    .section-head h2 {
        font-size: 24px;
    }

    .promo-slide {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
        padding: 28px 22px 48px;
        gap: 22px;
    }

    .promo-text p {
        font-size: 16px;
    }

    .promo-photo {
        height: 180px;
    }

    .promo-cover { width: 96px; }
    .promo-cover:nth-child(2) { width: 112px; }

    .promo-dots {
        left: 22px;
        bottom: 18px;
    }

    .genre-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .genre-tile {
        min-height: 88px;
        padding: 14px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-rail {
        grid-auto-columns: 164px;
        gap: 12px;
    }

    .product-body {
        padding: 10px 10px 12px;
    }

    .product-price {
        font-size: 17px;
    }

    .product-title {
        font-size: 14px;
    }

    .product-btn,
    .qty-stepper {
        height: 38px;
        font-size: 14px;
    }

    .qty-stepper button {
        width: 36px;
    }

    .qty-value {
        font-size: 13px;
    }

    .catalog-toolbar {
        width: 100%;
    }

    .sort-label {
        flex: 1;
    }

    .sort-label span {
        display: none;
    }

    .sort-label .catalog-select {
        width: 100%;
    }

    .book-detail {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .book-detail-cover {
        position: relative;
        top: 0;
        width: min(260px, 70%);
        margin: 0 auto;
    }

    .buy-box {
        padding: 18px;
    }

    .buy-box-cart {
        min-width: 0;
        max-width: none;
    }

    .specs dt {
        flex-basis: 120px;
    }

    .site-footer-inner {
        grid-template-columns: minmax(0, 1fr);
        padding: 36px 16px 24px;
        gap: 28px;
    }

    .site-footer-bottom {
        padding: 16px 16px 90px;
    }

    .bug-modal {
        padding: 10px;
    }
}





/* =====================================================
   Пустые состояния, скелетоны страниц, мелочи
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 56px 24px;
}

.empty-state-art,
.success-art {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.empty-state h2 {
    margin: 0 0 10px;
    font-family: Georgia, serif;
    color: #4F3D2C;
}

.empty-state p {
    margin: 0 auto 24px;
    max-width: 380px;
    color: #7A736A;
}

.empty-state .buy-btn {
    display: inline-block;
    text-decoration: none;
}

.page-skeleton {
    display: grid;
    gap: 16px;
}

.page-skeleton .skeleton-block {
    height: 110px;
}

.auth-logo {
    justify-content: center;
    margin-bottom: 25px;
}

.promo-illustration {
    width: 100%;
    max-width: 320px;
}

/* =====================================================
   Вход и регистрация
   ===================================================== */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 55vh;
    padding: 64px 16px 24px;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 40px;
    box-sizing: border-box;
}

.auth-title {
    margin: 0 0 8px;
    font-family: Georgia, serif;
    font-size: 32px;
    text-align: center;
    color: #3E2F22;
}

.auth-subtitle {
    margin: 0 0 28px;
    text-align: center;
    color: #7A736A;
    line-height: 1.5;
}

.auth-alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #FFC9C2;
    border-radius: 14px;
    background: #FFF2F0;
    color: #B84E39;
}

/* на регистрации ошибка выводится под формой */
.auth-form + .auth-alert {
    margin: 16px 0 0;
}

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

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field > span {
    font-size: 14px;
    font-weight: 600;
    color: #4F3D2C;
}

.auth-field .search {
    width: 100%;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #675B50;
    cursor: pointer;
}

.auth-remember input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #A65A2E;
}

.auth-submit {
    width: 100%;
    height: 48px;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 600;
}

.auth-switch {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #F1E9DF;
    text-align: center;
    color: #7A736A;
}

.auth-switch a {
    color: #A65A2E;
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {

    .auth-page {
        padding-top: 28px;
    }

    .auth-card {
        padding: 28px 20px;
    }
}

/* =====================================================
   Гостевой режим: подсказки
   ===================================================== */

.guest-note {
    margin-bottom: 24px;
    padding: 16px 20px;
    border: 1px solid #F0D9B5;
    background: #FFF8EA;
    color: #5E5247;
    line-height: 1.6;
}

.guest-note a {
    color: #A65A2E;
    font-weight: 600;
}

.qa-tip {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 20px;
    padding: 16px 20px;
    border: 1px solid #E4D7C5;
    border-radius: 18px;
    background: #FFFDF8;
}

.qa-tip[hidden] {
    display: none;
}

.qa-tip-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #F5E6B8;
    font-size: 22px;
}

.qa-tip-text {
    flex: 1;
    color: #5E5247;
    line-height: 1.55;
}

.qa-tip-text b {
    color: #3E2F22;
}

.qa-tip-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.qa-tip-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #8B8074;
    font-size: 16px;
    cursor: pointer;
}

.qa-tip-close:hover {
    background: #F3EBE1;
}

@media (max-width: 768px) {

    .qa-tip {
        flex-wrap: wrap;
        gap: 12px;
    }

    .qa-tip-text {
        flex-basis: calc(100% - 62px);
    }

    .qa-tip-actions {
        width: 100%;
    }

    .qa-tip-actions .buy-btn {
        flex: 1;
    }
}

/* =====================================================
   Баг-трекер: список и страница бага
   ===================================================== */

.tracker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.tracker-title {
    margin: 0 0 6px;
    font-family: Georgia, serif;
    color: #3E2F22;
}

.tracker-subtitle {
    color: #7A736A;
}

.bug-page {
    max-width: 960px;
}

.bug-id {
    margin-bottom: 6px;
    color: #9B8D7E;
    font-family: ui-monospace, monospace;
    font-weight: 600;
}

.bug-title {
    margin: 0 0 20px;
    font-family: Georgia, serif;
    font-size: clamp(26px, 3.4vw, 38px);
    line-height: 1.2;
    color: #3E2F22;
}

.bug-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-bottom: 24px;
    padding: 16px 20px;
    border: 1px solid #ECE4D9;
    border-radius: 16px;
    background: #FFFDF8;
}

.bug-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bug-meta-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #9B8D7E;
}

.bug-meta-item a {
    color: #A65A2E;
    font-weight: 600;
}

.bug-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    background: #F1EAE0;
    color: #4F3D2C;
}

.sev-trivial { background: #E3ECF7; color: #2F5E8C; }
.sev-minor { background: #FBF0CF; color: #8A6A0F; }
.sev-major { background: #FBE3D2; color: #B4581B; }
.sev-critical { background: #F8D7D2; color: #B0301C; }
.pri-low { background: #DCEFE2; color: #2F7A4F; }
.pri-medium { background: #FBF0CF; color: #8A6A0F; }
.pri-high { background: #F8D7D2; color: #B0301C; }

.bug-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.bug-actions .buy-btn {
    text-decoration: none;
}

.bug-section {
    margin-bottom: 24px;
}

.bug-section h2 {
    margin: 0 0 12px;
    font-family: Georgia, serif;
    font-size: 22px;
    color: #4F3D2C;
}

.bug-description {
    margin: 0;
    white-space: pre-line;
    line-height: 1.7;
}

.bug-screenshot {
    width: 100%;
    max-width: 900px;
    border-radius: 14px;
    border: 1px solid #E4D7C5;
}

.bug-logs {
    margin: 0;
    padding: 18px;
    border-radius: 14px;
    background: #1F1F1F;
    color: #EAEAEA;
    font-size: 14px;
    overflow: auto;
    white-space: pre-wrap;
}

.bug-comments-title {
    margin: 36px 0 16px;
    font-family: Georgia, serif;
    color: #4F3D2C;
}

.bug-comments-title span {
    font-family: Inter, sans-serif;
    font-size: 16px;
    color: #9B8D7E;
}

.bug-comment {
    margin-bottom: 12px;
    padding: 16px 18px;
    border: 1px solid #ECE4D9;
    border-radius: 14px;
    background: #FFFDF8;
}

.bug-comment-author {
    margin-bottom: 6px;
    font-weight: 700;
    color: #4F3D2C;
}

.bug-comment-text {
    white-space: pre-line;
    line-height: 1.6;
}

.bug-comment-delete {
    display: inline-block;
    margin-top: 10px;
    color: #B0301C;
    font-size: 14px;
}

.bug-comments-empty {
    color: #9B8D7E;
}

.bug-comment-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
}

.bug-comment-form textarea {
    width: 100%;
    height: 120px;
    padding: 14px 16px;
    resize: vertical;
    font: inherit;
}

/* гостевая корзина: пояснение под кнопкой оформления */
.cart-guest-note {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: #7A736A;
}

/* =====================================================
   Баг-репорт: боковая панель (bug-report.js)
   ===================================================== */

body.bug-drawer-open {
    overflow: hidden;
}

.bug-drawer {
    position: fixed;
    inset: 0;
    z-index: 100001;
}

.bug-drawer[hidden] {
    display: none;
}

.bug-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 24, 19, .35);
    opacity: 0;
    transition: opacity .25s;
}

.bug-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(520px, 100%);
    display: flex;
    flex-direction: column;
    background: #FFFDF8;
    box-shadow: -18px 0 40px rgba(31, 24, 19, .18);
    transform: translateX(100%);
    transition: transform .25s ease;
}

.bug-drawer.open .bug-drawer-backdrop {
    opacity: 1;
}

.bug-drawer.open .bug-drawer-panel {
    transform: none;
}

.bug-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #F1E9DF;
}

.bug-drawer-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #A65A2E;
}

.bug-drawer-head h2 {
    margin: 2px 0 0;
    font-family: Georgia, serif;
    font-size: 24px;
    color: #3E2F22;
}

.bug-drawer-close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #F3EBE1;
    color: #4F3D2C;
    font-size: 16px;
    cursor: pointer;
}

.bug-drawer-close:hover {
    background: #EEDDCC;
}

.bug-drawer-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 24px 24px;
}

.bug-drawer-body[hidden],
.bug-drawer-foot[hidden],
.bug-drawer-done[hidden] {
    display: none;
}

.bug-drawer-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #FFF8EA;
    border: 1px solid #F0D9B5;
    font-size: 14px;
    color: #5E5247;
}

.bug-drawer-note[hidden] {
    display: none;
}

.bug-drawer-note button,
.bug-link-btn {
    padding: 0;
    border: none;
    background: none;
    color: #A65A2E;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

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

.bug-field > span {
    font-size: 14px;
    font-weight: 600;
    color: #4F3D2C;
}

.bug-field > span b {
    color: #D6452B;
}

.bug-field small,
.bug-field-hint {
    font-size: 13px;
    color: #9B8D7E;
}

.bug-field .search {
    width: 100%;
    box-sizing: border-box;
}

.bug-field textarea.search {
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
}

.bug-field-description {
    height: 240px;
}

.bug-field-logs {
    height: 110px;
    font-family: ui-monospace, monospace !important;
    font-size: 13px !important;
}

.bug-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.bug-screenshot-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.bug-screenshot-preview img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 12px;
    border: 1px solid #E4D7C5;
}

.bug-drawer-error {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #FFC9C2;
    background: #FFF2F0;
    color: #B84E39;
    font-size: 14px;
}

.bug-drawer-error[hidden] {
    display: none;
}

.bug-drawer-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-top: 1px solid #F1E9DF;
    background: #FFFDF8;
}

.bug-drawer-status {
    font-size: 13px;
    color: #9B8D7E;
}

.bug-drawer-done {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 24px;
    text-align: center;
}

.bug-drawer-done-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 50%;
    background: #DCE7DD;
    color: #2F7A4F;
    font-size: 34px;
    font-weight: 700;
}

.bug-drawer-done h3 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 24px;
    color: #3E2F22;
}

.bug-drawer-done p {
    margin: 0 0 18px;
    color: #7A736A;
}

.bug-drawer-done-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.bug-drawer-done-actions .buy-btn {
    text-decoration: none;
    text-align: center;
}

/* кнопка «Сообщить о баге» — это ссылка с data-bug-report, курсор как у кнопки */
[data-bug-report] {
    cursor: pointer;
}

@media (max-width: 768px) {

    .bug-drawer-head,
    .bug-drawer-body,
    .bug-drawer-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bug-field-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* пока открыта панель баг-репорта, плавающая кнопка QA Mode не перекрывает «Отправить» */
body.bug-drawer-open #qa-mode-toggle {
    display: none;
}

/* =====================================================
   Охота за багами: счётчик в QA-полосе, проверка в панели, конфетти
   ===================================================== */

.qa-hunt-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    margin-right: 6px;
    border-radius: 8px;
    background: rgba(232, 176, 75, .16);
    color: #F4C978;
    white-space: nowrap;
}

.qa-hunt-counter b {
    color: #fff;
}

.qa-bar-clean {
    margin-right: 8px;
    padding: 5px 10px;
    border: 1px dashed rgba(255, 255, 255, .3);
    border-radius: 8px;
    background: transparent;
    color: #E9DCCB;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.qa-bar-clean.active {
    border-style: solid;
    border-color: #8FD19E;
    color: #8FD19E;
}

.hunt-check {
    width: 100%;
    max-width: 420px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #F0D9B5;
    border-radius: 16px;
    background: #FFF8EA;
    text-align: left;
}

.hunt-check[hidden] {
    display: none;
}

.hunt-check-title {
    margin-bottom: 6px;
    font-weight: 800;
    font-size: 17px;
    color: #3E2F22;
}

.hunt-note {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #5E5247;
}

.hunt-question {
    margin-bottom: 10px;
    font-weight: 600;
    color: #2B2828;
}

.hunt-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.hunt-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid #E4D7C5;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.hunt-option:has(input:checked) {
    border-color: #A65A2E;
    background: #FFF4EC;
}

.hunt-option input {
    accent-color: #A65A2E;
    margin: 0;
}

.hunt-found p {
    margin: 0 0 8px;
}

.hunt-progress b {
    color: #A65A2E;
}

.confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 100002;
    pointer-events: none;
}

/* варианты ответа: радиокнопка слева, текст сразу за ней (перебиваем общие стили input) */
.hunt-option input[type="radio"] {
    width: auto;
    height: auto;
    flex: 0 0 auto;
}

.hunt-option span {
    flex: 1;
    text-align: left;
}

/* экран «создан» может не помещаться по высоте — прокручиваем, а не обрезаем сверху */
.bug-drawer-done {
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 40px;
}

/* кружок с галочкой не сжимается, когда под ним много содержимого */
.bug-drawer-done-icon {
    flex-shrink: 0;
}

/* =====================================================
   Страница «Охота за багами»
   ===================================================== */

.hunt-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
    margin-bottom: 28px;
}

.hunt-eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #A65A2E;
}

.hunt-hero h1 {
    margin: 4px 0 10px;
    font-family: Georgia, serif;
    font-size: clamp(32px, 4vw, 46px);
    color: #3E2F22;
}

.hunt-hero p {
    margin: 0 0 16px;
    max-width: 620px;
    font-size: 17px;
    line-height: 1.6;
    color: #5E5247;
}

.hunt-steps {
    margin: 0 0 22px;
    padding-left: 22px;
    line-height: 1.9;
    color: #4F3D2C;
}

.hunt-score {
    text-align: center;
}

.hunt-score-label {
    color: #7A736A;
}

.hunt-score-value {
    margin: 4px 0 14px;
    font-family: Georgia, serif;
    font-size: 40px;
    font-weight: bold;
    color: #3E2F22;
}

.hunt-bar {
    height: 10px;
    border-radius: 999px;
    background: #F1EAE0;
    overflow: hidden;
}

.hunt-bar-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #E8B04B, #A65A2E);
    transition: width .4s ease;
}

.hunt-score-points {
    margin-top: 12px;
    font-weight: 700;
    color: #A65A2E;
}

.hunt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 8px;
}

.hunt-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px solid #ECE4D9;
    border-radius: 18px;
    background: #FFFDF8;
}

.hunt-card.found {
    border-color: #BFDCC7;
    background: #F4FAF5;
}

.hunt-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hunt-section {
    font-weight: 700;
    color: #4F3D2C;
}

.hunt-difficulty {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #F1EAE0;
    color: #72685D;
}

.hunt-difficulty.easy { background: #DCEFE2; color: #2F7A4F; }
.hunt-difficulty.medium { background: #FBF0CF; color: #8A6A0F; }
.hunt-difficulty.hard { background: #F8D7D2; color: #B0301C; }
.hunt-difficulty.legend { background: #3E2F22; color: #F4C978; }

.hunt-points {
    margin-left: auto;
    font-weight: 800;
    color: #A65A2E;
}

.hunt-card-status {
    font-size: 14px;
    font-weight: 700;
    color: #8B8074;
}

.hunt-card.found .hunt-card-status {
    color: #2F7A4F;
}

.hunt-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    color: #2B2828;
}

.hunt-explanation {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #5E5247;
}

.hunt-hints {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #4F3D2C;
}

.hunt-hints:empty {
    display: none;
}

.hunt-hint-btn {
    align-self: flex-start;
    padding: 7px 12px;
    border: 1px dashed #D9C3A5;
    border-radius: 10px;
    background: #FFF8EA;
    color: #8A5A2B;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.hunt-hint-btn:hover {
    background: #FFF1D6;
}

.hunt-hints-done {
    font-size: 13px;
    color: #9B8D7E;
}

.hunt-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #F1E9DF;
    font-size: 13px;
    color: #9B8D7E;
}

.hunt-card-foot a {
    color: #2F7A4F;
    font-weight: 600;
}

.hunt-card.finale {
    border: none;
    background: linear-gradient(150deg, #2F2620, #4A3626);
    color: #E9DCCB;
}

.hunt-card.finale .hunt-section,
.hunt-card.finale h3 {
    color: #FFF3E6;
}

.hunt-card.finale .hunt-explanation,
.hunt-card.finale .hunt-card-status {
    color: #CBBBA8;
}

.hunt-card.finale.ready {
    box-shadow: 0 0 0 2px #E8B04B, 0 18px 40px rgba(232, 176, 75, .25);
}

/* счётчик охоты в QA-полосе — ссылка на страницу охоты */
a.qa-hunt-counter {
    text-decoration: none;
}

a.qa-hunt-counter:hover {
    background: rgba(232, 176, 75, .28);
}

@media (max-width: 768px) {

    .hunt-hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* «Охота» №14: на экране уже 400 px карточка с итогом и кнопкой «Оформить заказ» шире экрана
   (класс ставит cart.html, только когда баги включены) */
@media (max-width: 399px) {

    body.hunt-narrow-bug [data-qa-name="Summary Card"] {
        width: 420px !important;
        min-width: 420px;
    }
}

/* =====================================================
   Охота: Зал славы и салют
   ===================================================== */

.hunt-hall {
    margin-top: 48px;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(150deg, #2F2620, #4A3626);
    color: #E9DCCB;
}

.hunt-hall-head h2 {
    margin: 0 0 6px;
    font-family: Georgia, serif;
    font-size: 30px;
    color: #FFF3E6;
}

.hunt-hall-head p {
    margin: 0 0 20px;
    color: #CBBBA8;
    font-size: 16px;
}

.hunt-hall-me {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(232, 176, 75, .14);
    box-shadow: inset 0 0 0 1px rgba(232, 176, 75, .5);
}

.hunt-hall-me[hidden] {
    display: none;
}

.hunt-hall-me-number {
    font-family: Georgia, serif;
    font-size: 44px;
    font-weight: bold;
    color: #F4C978;
    line-height: 1;
}

.hunt-hall-me-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 200px;
}

.hunt-hall-me-text b {
    color: #FFF3E6;
    font-size: 18px;
}

.hunt-hall-me-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hunt-hall-me-actions .buy-btn {
    text-decoration: none;
}

.hunt-hall-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hunt-hall-item {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    font-size: 14px;
    color: #CBBBA8;
}

.hunt-hall-item-number {
    font-weight: 800;
    color: #FFF3E6;
}

.hunt-hall-item.mine {
    background: rgba(232, 176, 75, .22);
}

/* поздравление в панели баг-репорта за последний баг */
.hunt-complete {
    margin-top: 14px;
    padding: 16px;
    border-radius: 14px;
    background: #2F2620;
    color: #E9DCCB;
    text-align: center;
}

.hunt-complete-title {
    margin-bottom: 4px;
    font-weight: 800;
    font-size: 18px;
    color: #F4C978;
}

.hunt-complete p {
    margin: 0 0 12px;
}

.hunt-complete b {
    color: #FFF3E6;
}

.hunt-complete .buy-btn {
    display: inline-block;
    text-decoration: none;
}

.salute-canvas {
    z-index: 100003;
}

/* Зал славы не прячется под липкую шапку при переходе на /hunt#hall */
.hunt-hall {
    scroll-margin-top: 150px;
}

/* админка: даты регистрации и последнего входа */
.user-date {
    white-space: nowrap;
    font-size: 14px;
}

.user-date small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #9B8D7E;
}

.user-date-empty {
    color: #9B8D7E;
}
