:root {
    color-scheme: dark;
    --bg: #111210;
    --surface: #1a1c19;
    --surface-raised: #232520;
    --surface-soft: #171914;
    --line: #363832;
    --line-soft: rgba(243, 243, 238, 0.09);
    --text: #f3f3ee;
    --muted: #a6a89f;
    --accent: #d9ff43;
    --danger: #ff5b58;
    --signal: #e1483f;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "SF Pro Text", "SF Pro Display", Inter, Roboto, "Segoe UI", Arial, Helvetica, sans-serif;
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
    letter-spacing: 0;
}

button {
    color: inherit;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.app-shell {
    width: min(100%, 980px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 22px 18px calc(92px + var(--safe-bottom));
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 10px 0;
    backdrop-filter: blur(14px);
    background: rgba(17, 18, 16, 0.9);
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(27px, 7vw, 34px);
    line-height: 1;
}

.cart-button {
    position: relative;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.cart-glyph {
    position: relative;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.cart-glyph::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 3px;
    width: 6px;
    height: 6px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #111210;
    font-size: 11px;
    font-weight: 800;
}

.account-strip {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #575a50;
    border-radius: 50%;
    background: var(--surface-raised);
    font-weight: 800;
}

.account-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.account-copy strong,
.account-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy span,
.connection-status {
    color: var(--muted);
    font-size: 12px;
}

.connection-status {
    color: var(--accent);
}

.view-tabs {
    display: flex;
    gap: 8px;
    margin: 18px -18px 18px;
    padding: 0 18px 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.view-tab {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.view-tab.is-active {
    background: var(--text);
    color: var(--bg);
    font-weight: 700;
}

.catalog-toolbar {
    margin-bottom: 16px;
}

.category-scroll {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.category-button {
    min-width: 0;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-button.is-active {
    border-color: var(--text);
    color: var(--text);
}

.catalog-meta {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

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

.product-card {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.product-card:hover {
    border-color: rgba(243, 243, 238, 0.34);
    background: var(--surface-raised);
    transform: translateY(-1px);
}

.product-card-media {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    place-items: center;
    overflow: hidden;
    background: #c9cac4;
}

.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 220ms ease;
}

.product-card:hover .product-card-media img {
    transform: scale(1.04);
}

.product-card.is-locked .product-card-media {
    background:
        radial-gradient(circle at 50% 42%, rgba(243, 243, 238, 0.08), transparent 46%),
        #080908;
}

.product-card-copy {
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    min-height: 128px;
    padding: 12px;
}

.product-card-category {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-title {
    display: block;
    min-height: 40px;
    margin-bottom: 9px;
    font-size: 15px;
    line-height: 1.3;
}

.product-card-footer {
    align-self: end;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.product-card-price {
    font-size: 13px;
    font-weight: 700;
}

.stock-label {
    display: inline-grid;
    width: max-content;
    max-width: 100%;
    min-height: 24px;
    padding: 0 8px;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
}

.stock-label.is-available {
    color: var(--accent);
}

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

.empty-mark {
    display: inline-grid;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    font-weight: 800;
}

.empty-state h2 {
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--muted);
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 980px);
    min-height: calc(66px + var(--safe-bottom));
    margin: 0 auto;
    padding: 7px 10px calc(7px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px);
    background: rgba(17, 18, 16, 0.92);
}

.bottom-nav-button {
    min-width: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav-button.is-active {
    background: var(--surface-raised);
    color: var(--text);
}

.sheet[hidden] {
    display: none;
}

.sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(0, 0, 0, 0.7);
}

.sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    background: var(--bg);
}

.sheet-handle {
    width: 42px;
    height: 4px;
    margin: 10px auto;
    border-radius: 2px;
    background: var(--line);
}

.sheet-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(26, 28, 25, 0.92);
    cursor: pointer;
}

.product-sheet-media {
    position: relative;
    display: grid;
    width: 100%;
    height: min(38vh, 380px);
    place-items: center;
    overflow: hidden;
    background: #c9cac4;
}

.product-sheet-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.locked-visual {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #080908;
    color: #73766d;
    font-size: 13px;
    font-weight: 800;
}

.product-sheet-copy,
.cart-sheet-panel {
    padding: 20px 18px calc(28px + var(--safe-bottom));
}

.product-sheet-copy h2,
.cart-header h2 {
    margin-bottom: 8px;
    font-size: 26px;
}

.product-sheet-price {
    margin-bottom: 14px;
    font-weight: 800;
}

.product-sheet-description,
.cart-header p {
    color: var(--muted);
    line-height: 1.5;
}

.size-heading {
    display: flex;
    justify-content: space-between;
    margin: 24px 0 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.size-heading span:last-child {
    color: var(--muted);
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.size-button {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
}

.size-button.is-selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
    font-weight: 800;
}

.size-button:disabled {
    color: #62645d;
    cursor: not-allowed;
}

.product-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.product-actions .primary-button {
    grid-column: 1 / -1;
}

.primary-button,
.secondary-button {
    min-height: 50px;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
    padding: 0 14px;
}

.primary-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--bg);
}

.primary-button:disabled {
    border-color: var(--line);
    background: var(--surface);
    color: #62645d;
    cursor: not-allowed;
}

.secondary-button {
    border: 1px solid var(--line);
    background: var(--surface);
}

.drop-actions {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--signal);
    border-radius: 8px;
}

.drop-actions p {
    color: #ffaaa4;
}

.cart-header {
    padding-right: 46px;
}

.cart-items {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.cart-item-open {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.cart-item-open img {
    width: 62px;
    height: 62px;
    border-radius: 6px;
    object-fit: contain;
    background: #c9cac4;
}

.cart-item-copy {
    min-width: 0;
}

.cart-item-copy strong,
.cart-item-copy span {
    display: block;
}

.cart-item-copy strong {
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-copy span {
    color: var(--muted);
    font-size: 12px;
}

.cart-item-tools {
    display: grid;
    grid-template-columns: auto 32px;
    gap: 6px;
    align-items: center;
    justify-content: end;
    justify-items: stretch;
}

.quantity-control {
    display: grid;
    grid-template-columns: 30px 26px 30px;
    gap: 4px;
    align-items: center;
    text-align: center;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-raised);
    cursor: pointer;
}

.cart-like-button {
    position: relative;
    display: grid;
    width: 32px;
    height: 32px;
    min-height: 32px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-raised);
    color: var(--muted);
    cursor: pointer;
}

.cart-like-button span {
    width: 10px;
    height: 10px;
    border: 1px solid currentColor;
    transform: rotate(45deg);
}

.cart-like-button b {
    display: none;
}

.cart-like-button.is-liked {
    border-color: rgba(217, 255, 67, 0.55);
    color: var(--accent);
}

.cart-like-button.is-liked span {
    background: currentColor;
}

.cart-summary {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
    align-items: center;
    padding-top: 16px;
    background: var(--bg);
    border-top: 1px solid var(--line);
}

.cart-summary span,
.cart-summary strong {
    display: block;
}

.cart-summary span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
}

.cart-summary strong {
    font-size: 22px;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: calc(78px + var(--safe-bottom));
    left: 18px;
    z-index: 80;
    max-width: 460px;
    margin: 0 auto;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--text);
    color: var(--bg);
    text-align: center;
    font-weight: 700;
}

@media (min-width: 720px) {
    .app-shell {
        padding-right: 28px;
        padding-left: 28px;
    }

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

    .sheet-panel {
        right: max(0px, calc((100vw - 680px) / 2));
        left: max(0px, calc((100vw - 680px) / 2));
        border-right: 1px solid var(--line);
        border-left: 1px solid var(--line);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

body[data-theme="winter"] {
    --bg: #0f1417;
    --surface: #172024;
    --surface-raised: #202c31;
    --line: #3b4a50;
    --text: #f5f7f7;
    --muted: #a8b4b7;
    --accent: #d8f6ff;
}

body[data-theme="spring"] {
    --bg: #11150f;
    --surface: #192018;
    --surface-raised: #222c20;
    --line: #394536;
    --text: #f4f6ef;
    --muted: #aab2a3;
    --accent: #c9ff6a;
}

body[data-theme="summer"] {
    --bg: #12130f;
    --surface: #1f2118;
    --surface-raised: #2a2d21;
    --line: #494c3b;
    --text: #fbf8ec;
    --muted: #b9b39f;
    --accent: #ffe66d;
}

body[data-theme="autumn"] {
    --bg: #15120f;
    --surface: #211b16;
    --surface-raised: #2c241d;
    --line: #4a4036;
    --text: #f6f1e8;
    --muted: #b8ac9c;
    --accent: #ffb35c;
}

.feature-panel,
.admin-block,
.dark-panel,
.gift-panel {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.feature-panel h2,
.admin-block h2,
.dark-panel h2,
.gift-panel h2 {
    margin-bottom: 4px;
    font-size: 20px;
}

.feature-panel p,
.admin-block p,
.dark-panel p,
.gift-panel p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.45;
}

.gift-result {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(217, 255, 67, 0.38);
    border-radius: 8px;
    background: rgba(217, 255, 67, 0.06);
}

.gift-result h3,
.gift-result p {
    margin: 0;
}

.gift-result p,
.gift-result small {
    color: var(--muted);
    line-height: 1.4;
}

.gift-result img {
    width: min(100%, 220px);
    border-radius: 8px;
    background: #fff;
}

.inline-actions,
.segmented,
.join-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.segmented label,
.segmented button,
.inline-actions button,
.secondary-button,
.primary-link,
.danger-button,
.stack-form button,
.join-form button {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-raised);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0d0e0c;
}

.segmented label {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 42px;
    place-items: center;
    padding: 0 10px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    text-align: center;
    overflow: hidden;
}

.segmented input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.segmented label:has(input:checked) {
    border-color: rgba(217, 255, 67, 0.42);
    background: var(--surface-raised);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(217, 255, 67, 0.24);
}

.segmented button,
.inline-actions button,
.secondary-button,
.primary-link,
.danger-button {
    padding: 0 14px;
}

.segmented button.is-active,
.primary-link,
.stack-form button,
.join-form button {
    background: var(--text);
    color: var(--bg);
}

.danger-button {
    border-color: rgba(255, 91, 88, 0.45);
    color: var(--danger);
}

.stack-form {
    display: grid;
    gap: 10px;
}

.stack-form label,
.join-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.join-form input,
.checkout-form input,
.checkout-form textarea,
.checkout-form select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0c;
    color: var(--text);
    font: inherit;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.join-form input:focus,
.checkout-form input:focus,
.checkout-form textarea:focus,
.checkout-form select:focus {
    border-color: rgba(217, 255, 67, 0.7);
    outline: none;
}

.stack-form input,
.stack-form select,
.join-form input,
.checkout-form input,
.checkout-form select {
    padding: 0 12px;
}

.stack-form textarea,
.checkout-form textarea {
    min-height: 86px;
    padding: 10px 12px;
    resize: vertical;
}

.payment-list,
.vote-grid,
.feature-grid,
.mini-grid,
.stats-grid {
    display: grid;
    gap: 10px;
}

.payment-option,
.vote-card,
.feature-card,
.small-product,
.admin-product {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
}

.feature-card,
.small-product,
.vote-card {
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.feature-card:hover,
.small-product:hover,
.vote-card:hover {
    border-color: rgba(243, 243, 238, 0.34);
    background: var(--surface);
}

.payment-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 72px;
    gap: 12px;
    align-items: center;
    min-height: 78px;
    padding: 10px;
    cursor: pointer;
}

.payment-option input {
    appearance: none;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1px solid #70736a;
    border-radius: 50%;
    background: transparent;
}

.payment-option input::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
}

.payment-option input:checked {
    border-color: var(--accent);
}

.payment-option input:checked::before {
    background: var(--accent);
}

.payment-option span,
.payment-option strong,
.payment-option small {
    display: block;
    min-width: 0;
}

.payment-option small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.payment-option img {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: contain;
    background: #fff;
}

.payment-option.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.payment-option.is-static {
    cursor: default;
}

.payment-option.is-no-image {
    grid-template-columns: auto minmax(0, 1fr);
}

.payment-dot {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1px solid var(--accent);
    border-radius: 50%;
}

.payment-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.order-payment-result {
    margin-top: 16px;
}

.payment-next-step {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(217, 255, 67, 0.34);
    border-radius: 8px;
    background: rgba(217, 255, 67, 0.055);
}

.payment-next-step h2,
.payment-next-step p {
    margin: 0;
}

.payment-next-step p {
    color: var(--muted);
    line-height: 1.45;
}

.product-card-media.is-missing-image,
.vote-card.is-missing-image,
.small-product.is-missing-image {
    background:
        radial-gradient(circle at 50% 42%, rgba(243, 243, 238, 0.08), transparent 48%),
        #0d0e0c;
}

.product-card-media.is-missing-image::before,
.cart-item-open.is-missing-image::before,
.vote-card.is-missing-image::before,
.small-product.is-missing-image::before,
.review-head.is-missing-image::before,
.mini-row.is-missing-image::before {
    content: "";
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background:
        linear-gradient(135deg, rgba(243, 243, 238, 0.08), rgba(243, 243, 238, 0.015)),
        #0d0e0c;
}

.product-card-media.is-missing-image::before {
    width: 58px;
    height: 58px;
    border-radius: 50%;
}

.cart-item-open.is-missing-image::before,
.review-head.is-missing-image::before,
.mini-row.is-missing-image::before {
    width: 62px;
    height: 62px;
}

.review-head.is-missing-image::before,
.mini-row.is-missing-image::before {
    width: 52px;
    height: 52px;
}

.vote-card.is-missing-image::before,
.small-product.is-missing-image::before {
    width: 100%;
    aspect-ratio: 16 / 10;
}

.payment-option.is-missing-image::after {
    content: "QR";
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f4f4ef;
    color: #161713;
    font-size: 13px;
    font-weight: 800;
}

.vote-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vote-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.vote-card img,
.small-product img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    object-fit: cover;
    background: #0d0e0c;
}

.vote-card strong,
.small-product strong {
    line-height: 1.2;
}

.vote-card span,
.small-product span {
    color: var(--muted);
    font-size: 12px;
}

.vote-card.is-selected {
    border-color: var(--accent);
}

.feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.small-product {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--muted);
}

.stats-grid b {
    color: var(--text);
    font-size: 22px;
}

.muted,
.rating-line {
    color: var(--muted);
    font-size: 12px;
}

.rating-line {
    display: block;
    margin-top: 3px;
}

.product-trust {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.trust-block,
.review-card,
.admin-moderation {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.trust-block h3 {
    margin: 0;
    font-size: 16px;
}

.trust-block .join-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.trust-status {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    line-height: 1.35;
}

.trust-status.is-valid {
    border-color: rgba(201, 255, 106, 0.45);
    color: var(--accent);
}

.trust-status.is-invalid {
    border-color: rgba(255, 91, 88, 0.45);
    color: var(--danger);
}

.scanner-video {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #050605;
    object-fit: cover;
}

.review-grid,
.review-list,
.mini-list {
    display: grid;
    gap: 10px;
}

.review-head,
.mini-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.mini-row {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
}

.review-head img,
.mini-row img {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    background: #0d0e0c;
}

.review-head strong,
.mini-row strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-head span,
.mini-row span,
.review-card small {
    color: var(--muted);
    font-size: 12px;
}

.review-card p,
.admin-moderation p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
}

.review-media {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.review-media img,
.review-media video {
    width: 84px;
    height: 84px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    object-fit: cover;
    background: #0d0e0c;
}

.review-summary {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
}

.review-summary span {
    color: var(--muted);
    font-size: 12px;
}

.code-chip {
    display: inline-grid;
    min-height: 34px;
    padding: 0 10px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0c;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-moderation textarea {
    min-height: 72px;
}

.spoiler {
    display: inline-grid;
    min-height: 40px;
    padding: 0 16px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0c;
    color: transparent;
    cursor: pointer;
    user-select: none;
}

.spoiler.is-revealed,
.spoiler.is-open {
    color: var(--accent);
    font-weight: 900;
}

.locked-card-mark {
    display: grid;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
    place-items: center;
    align-content: center;
    gap: 5px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent),
        #0d0e0c;
    color: var(--muted);
    text-align: center;
}

.locked-card-mark span,
.locked-card-mark small {
    color: #6e7168;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.locked-card-mark strong {
    color: #b9bbb2;
    font-size: clamp(22px, 8vw, 36px);
    font-weight: 900;
}

.model-viewer {
    display: grid;
    width: 100%;
    height: min(54vh, 520px);
    place-items: center;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background:
        radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.12), transparent 34%),
        #080908;
    overflow: hidden;
}

.model-object {
    display: grid;
    width: min(46%, 260px);
    max-height: 72%;
    aspect-ratio: 0.78;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 42% 42% 28% 28%;
    background:
        linear-gradient(90deg, transparent 12%, rgba(255, 255, 255, 0.12) 48%, transparent 88%),
        var(--surface-raised);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    animation: modelSpin 6s linear infinite;
    transform-style: preserve-3d;
}

.model-element {
    width: 100%;
    height: 100%;
    background: transparent;
}

.model-element:not([hidden]) + .model-object {
    display: none;
}

@keyframes modelSpin {
    from {
        transform: perspective(520px) rotateY(0deg);
    }
    to {
        transform: perspective(520px) rotateY(360deg);
    }
}

.admin-product {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
}

.admin-product label:nth-child(2) {
    grid-column: span 2;
}

.admin-product label:last-of-type {
    grid-column: span 2;
}

.admin-product button {
    min-height: 42px;
}

@media (min-width: 720px) {
    .bottom-nav {
        display: none;
    }

    .app-shell {
        padding-bottom: 48px;
    }

    .view-tabs {
        display: grid;
        grid-template-columns: repeat(9, minmax(0, 1fr));
        gap: 0;
        margin: 20px 0;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        overflow: hidden;
    }

    .view-tab {
        min-width: 0;
        border: 0;
        border-right: 1px solid var(--line);
        border-radius: 0;
        padding: 0 8px;
    }

    .view-tab:last-child {
        border-right: 0;
    }

    .category-scroll {
        display: flex;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .category-scroll::-webkit-scrollbar {
        display: none;
    }

    .category-button {
        flex: 0 0 auto;
        min-width: auto;
        padding: 0 14px;
    }

    .product-card-copy {
        min-height: 118px;
    }

    .product-card-footer {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .feature-grid,
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .feature-panel h2,
    .admin-block h2,
    .dark-panel h2,
    .gift-panel h2 {
        font-size: 19px;
    }

    .inline-actions,
    .segmented,
    .join-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .join-form input,
    .stack-form textarea,
    .checkout-form textarea {
        grid-column: 1 / -1;
    }

    .trust-block .join-form {
        grid-template-columns: 1fr;
    }

    .vote-grid,
    .feature-grid,
    .mini-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-option {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    .cart-item-open {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 12px;
    }

    .cart-item-open img,
    .cart-item-open.is-missing-image::before {
        width: 62px;
        height: 62px;
    }

    .cart-item-tools {
        grid-template-columns: minmax(138px, 1fr) 36px;
        align-items: center;
        justify-content: stretch;
        padding-left: 74px;
    }

    .quantity-control {
        grid-template-columns: 38px minmax(34px, 1fr) 38px;
        max-width: 230px;
        min-width: 0;
    }

    .quantity-control button {
        width: 38px;
        height: 36px;
    }

    .cart-like-button {
        width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .payment-option img {
        grid-column: 2;
        width: 96px;
        height: 96px;
    }

    .payment-option.is-missing-image::after {
        grid-column: 2;
        width: 96px;
        height: 96px;
    }

    .admin-product {
        grid-template-columns: 1fr;
    }

    .admin-product label,
    .admin-product label:nth-child(2),
    .admin-product label:last-of-type {
        grid-column: auto;
    }

    .vote-card.is-missing-image::before,
    .small-product.is-missing-image::before {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 380px) {
    .cart-item-tools {
        padding-left: 0;
    }
}
