:root {
    --bg: #f5efe2;
    --panel: rgba(255, 252, 246, 0.92);
    --ink: #1d1a17;
    --muted: #65594a;
    --accent: #9e5d2f;
    --accent-dark: #6c3a16;
    --line: rgba(36, 28, 20, 0.12);
    --success: #2f6c44;
    --shadow: 0 16px 45px rgba(42, 23, 8, 0.12);
    --radius: 22px;
    --radius-sm: 14px;
    --font-head: Georgia, "Times New Roman", serif;
    --font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(158, 93, 47, 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(108, 58, 22, 0.18), transparent 28%),
        linear-gradient(180deg, #f8f1e4 0%, var(--bg) 42%, #efe7d7 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.app-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 14px 42px;
}

.hero,
.panel {
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 14px 16px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 250, 240, 0.95), rgba(232, 214, 181, 0.92)),
        linear-gradient(90deg, rgba(158, 93, 47, 0.12), rgba(108, 58, 22, 0.18));
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -6% -30% 35%;
    height: 160px;
    background: linear-gradient(90deg, rgba(158, 93, 47, 0), rgba(158, 93, 47, 0.32));
    transform: rotate(-8deg);
    pointer-events: none;
}

.hero__top,
.hero__content,
.panel__header,
.search-row,
.filter-row,
.inline-actions,
.admin-actions,
.product-head,
.meta,
.badge-row,
.tasting-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

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

.brand__logo {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 16px;
}

.brand__eyebrow {
    display: block;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.brand h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-head);
}

.brand h1 {
    font-size: clamp(1.6rem, 4vw, 3rem);
}

.hero__content {
    margin-top: 10px;
}

.hero__content p {
    max-width: 700px;
    margin: 0;
    line-height: 1.35;
    color: var(--muted);
    font-size: 0.95rem;
}

.tabs,
.lang-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
}

.lang-switch__button,
.button,
.chip,
.tabs a,
.star-row button {
    border: 0;
    cursor: pointer;
    transition: 160ms ease;
}

.lang-switch__button,
.tabs a {
    padding: 8px 12px;
    border-radius: 999px;
    background: transparent;
    font-weight: 700;
    min-width: 0;
    font-size: 0.92rem;
}

.lang-switch__button--icon {
    min-width: 44px;
    padding-inline: 10px;
}

.lang-switch__icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.lang-switch__button.is-active,
.tabs a.is-active,
.button,
.chip.is-active,
.star-row button.is-selected {
    background: var(--accent);
    color: #fff;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.panel {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 14px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 18px;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 18, 13, 0.58);
    backdrop-filter: blur(6px);
}

.modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 252, 246, 0.96);
    box-shadow: var(--shadow);
}

.modal__header {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.scanner-frame {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 223, 203, 0.72)),
        repeating-linear-gradient(
            0deg,
            rgba(158, 93, 47, 0.04),
            rgba(158, 93, 47, 0.04) 10px,
            rgba(108, 58, 22, 0.02) 10px,
            rgba(108, 58, 22, 0.02) 20px
        );
}

.scanner-frame::after {
    content: "";
    position: absolute;
    inset: 16% 12%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(24, 18, 13, 0.12);
    pointer-events: none;
}

.scanner-video {
    width: 100%;
    min-height: 250px;
    object-fit: cover;
    background: #1b1713;
}

.panel--sticky {
    position: sticky;
    top: 10px;
    z-index: 10;
}

.grid-two,
.cards,
.stats-grid {
    display: grid;
    gap: 12px;
}

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

.cards--single {
    grid-template-columns: 1fr;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.field {
    display: grid;
    gap: 4px;
    min-width: 0;
    flex: 1 1 180px;
}

.field--compact {
    flex: 0 1 180px;
}

.field--honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.filter-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    flex: 1 1 260px;
    min-width: 0;
}

.field span,
.checkbox span,
.muted {
    color: var(--muted);
}

.muted {
    line-height: 1.3;
}

input,
select,
textarea,
.button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
}

textarea {
    min-height: 78px;
    resize: vertical;
}

.checkbox,
.pill,
.badge,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    font-weight: 600;
}

.checkbox {
    font-size: 0.84rem;
}

.badge,
.pill {
    padding: 7px 10px;
    font-size: 0.82rem;
}

.checkbox--filter {
    flex: 0 0 auto;
    align-self: end;
}

.badge--exclusive {
    background: rgba(47, 108, 68, 0.12);
    color: var(--success);
}

.button {
    padding: 8px 14px;
}

.button--compact {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.button--secondary {
    background: #efe3cc;
    color: var(--accent-dark);
}

.button--ghost {
    background: rgba(255, 255, 255, 0.66);
    color: var(--accent-dark);
    border: 1px solid var(--line);
}

.chips,
.stack {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card,
.stat-card,
.top-item {
    display: grid;
    gap: 7px;
    padding: 11px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
}

.top-item--link {
    text-decoration: none;
    color: inherit;
}

.profile-sections {
    display: grid;
    gap: 18px;
}

.profile-section {
    display: grid;
    gap: 10px;
}

.mini-cards {
    display: grid;
    gap: 8px;
}

.mini-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 11px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    color: inherit;
}

.mini-card--tasted {
    background: linear-gradient(180deg, rgba(255, 249, 237, 0.96), rgba(252, 241, 220, 0.92));
    border-color: rgba(158, 93, 47, 0.24);
}

.mini-card__main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.mini-card__eyebrow,
.mini-card__meta,
.mini-card__link {
    font-size: 0.82rem;
    color: var(--muted);
}

.mini-card__title {
    line-height: 1.12;
}

.mini-card__side {
    display: grid;
    justify-items: end;
    gap: 5px;
    text-align: right;
}

.badge--tiny {
    padding: 3px 7px;
    font-size: 0.74rem;
}

@media (max-width: 560px) {
    .mini-card {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .mini-card__side {
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        text-align: left;
    }
}

.card--link {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.card--focus {
    border-color: rgba(158, 93, 47, 0.7);
    box-shadow: 0 0 0 2px rgba(158, 93, 47, 0.18), var(--shadow);
}

.card--wishlist {
    background: linear-gradient(180deg, rgba(255, 249, 237, 0.96), rgba(252, 241, 220, 0.92));
    border-color: rgba(158, 93, 47, 0.24);
}

.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 9px;
    align-items: start;
}

.product-layout--no-image {
    grid-template-columns: 1fr;
}

.product-media {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.product-image {
    width: 84px;
    height: 148px;
    object-fit: contain;
    object-position: center;
    justify-self: end;
    align-self: start;
    padding: 8px 6px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #f7f0e1);
}

.wb-link {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wb-link img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.auth-panel {
    padding-top: 12px;
}

.auth-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 10px;
}

.auth-switcher__link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-dark);
    font: inherit;
    font-size: 0.88rem;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.82;
}

.auth-switcher__link.is-active {
    text-decoration: none;
    font-weight: 700;
    opacity: 1;
}

.auth-form {
    display: grid;
    gap: 8px;
}

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.password-toggle {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.88);
    color: var(--accent-dark);
    font: inherit;
    cursor: pointer;
}

.panel__header--tight {
    margin-bottom: 8px;
}

.admin-manage {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 14px;
}

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

.admin-editor-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.admin-catalog-tabs {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-editor {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

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

.admin-list__item {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
}

.star-row {
    display: inline-flex;
    gap: 2px;
}

.product-flags {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.product-flags .checkbox {
    padding: 6px 8px;
    gap: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.tasting-panel {
    display: grid;
    gap: 8px;
}

.tasting-actions .button.button--secondary {
    padding: 3px 7px;
    font-size: 0.68rem;
    line-height: 1;
    min-height: 0;
}

.star-row button {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: #c7b8a1;
    font-size: 1rem;
    line-height: 1;
}

.star-row button:hover {
    color: var(--accent);
}

.status-banner {
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(47, 108, 68, 0.13);
    color: var(--success);
}

.toast {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    min-width: min(320px, calc(100vw - 32px));
    max-width: min(520px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(47, 108, 68, 0.96);
    color: #fff;
    box-shadow: 0 14px 34px rgba(26, 31, 22, 0.24);
    z-index: 55;
    text-align: center;
}

.toast--error {
    background: rgba(140, 32, 32, 0.96);
}

.filter-panel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.filter-panel__actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.session-banner {
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    color: var(--accent-dark);
    font-weight: 600;
}

.site-footer {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 0 4px 16px;
}

.report-actions {
    display: inline-flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.footer-copy {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--muted);
}

.footer-copy a {
    text-decoration: underline;
}

.scroll-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(119, 74, 36, 0.9);
    color: #fff;
    box-shadow: 0 10px 24px rgba(44, 23, 8, 0.22);
    z-index: 40;
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.auth-panel {
    display: grid;
    gap: 8px;
}

.auth-form + .auth-form {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.auth-form .button {
    width: 100%;
    justify-content: center;
}

.account-actions {
    display: grid;
    gap: 10px;
}

#delete-account-form .inline-actions {
    gap: 8px;
}

.panel__header p {
    margin: 0;
}

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

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

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

.card h3 {
    line-height: 1.16;
}

.product-head h3,
.product-head .muted,
.meta,
.badge-row,
.card p,
.card .muted {
    line-height: 1.1;
}

.product-head .muted {
    margin: 0 0 2px;
}

.meta,
.badge-row {
    gap: 6px;
}

@media (max-width: 680px) {
    .app-shell {
        padding: 12px 12px 28px;
    }

    .hero,
    .panel {
        padding: 14px;
        border-radius: 18px;
    }

    .tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 6px;
        border-radius: 18px;
    }

    .tabs a {
        min-width: 0;
        padding: 8px 6px;
        font-size: 0.86rem;
        text-align: center;
        white-space: normal;
        line-height: 1.15;
    }

    .product-image {
        width: 76px;
        height: 138px;
        padding: 8px 5px;
    }

    .filter-panel__top {
        align-items: start;
        flex-direction: column;
    }

    .search-row,
    .filter-row,
    .panel__header,
    .inline-actions,
    .admin-actions {
        align-items: stretch;
    }

    .report-actions {
        width: 100%;
    }

    .report-actions .button {
        flex: 1 1 0;
        justify-content: center;
    }

    .field--compact {
        flex: 1 1 calc(50% - 8px);
    }

    .filter-pair {
        flex: 1 1 100%;
    }

    .scroll-top {
        right: 12px;
        bottom: 12px;
        width: 36px;
        height: 36px;
    }

    .toast {
        top: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        min-width: calc(100vw - 24px);
    }

    .hero {
        padding: 12px;
    }

    .panel {
        padding: 12px;
    }
}
