:root {
    --ink: #17211f;
    --muted: #62716d;
    --line: #d9e1de;
    --paper: #ffffff;
    --soft: #f4f7f5;
    --teal: #0f766e;
    --teal-dark: #115e59;
    --gold: #b7791f;
    --red: #a83f39;
    --shadow: 0 12px 30px rgba(23, 33, 31, 0.08);
}

/* Promotion Studio */
.promotion-empty-state {
    margin-top: 24px;
}

.promotion-builder-form,
.promotion-step {
    display: grid;
    gap: 18px;
}

.promotion-builder-form {
    margin-top: 28px;
}

.promotion-step {
    margin: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
}

.promotion-step legend {
    padding: 0 10px 0 0;
    color: var(--ink);
    font-size: 1.12rem;
    font-weight: 800;
}

.promotion-step legend span {
    display: inline-grid;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    place-items: center;
    border-radius: 999px;
    background: var(--teal);
    color: #fff;
}

.promotion-step-heading,
.promotion-create-bar,
.promotion-creative-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.promotion-step-heading p,
.promotion-create-bar small {
    margin: 0;
    color: var(--muted);
}

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

.promotion-product-option {
    position: relative;
    display: grid;
    grid-template-rows: 128px auto;
    min-width: 0;
    overflow: hidden;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.promotion-product-option:hover,
.promotion-product-option:focus-within {
    border-color: var(--teal);
    transform: translateY(-2px);
}

.promotion-product-option:has(input:checked) {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent);
}

.promotion-product-option input {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 24px;
    height: 24px;
    accent-color: var(--teal);
}

.promotion-product-option img {
    width: 100%;
    height: 128px;
    object-fit: cover;
}

.promotion-product-option > span {
    display: grid;
    gap: 4px;
    padding: 12px;
}

.promotion-product-option strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.promotion-product-option small,
.promotion-selection-count {
    color: var(--muted);
}

.promotion-selection-count {
    margin: 0;
    font-weight: 700;
}

.promotion-choice-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.promotion-duration-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.promotion-choice {
    display: grid;
    min-height: 62px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
    cursor: pointer;
    font-weight: 800;
    text-align: center;
}

.promotion-choice:hover,
.promotion-choice:focus-within,
.promotion-choice:has(input:checked) {
    border-color: var(--teal);
}

.promotion-choice:has(input:checked) {
    background: color-mix(in srgb, var(--teal) 10%, var(--paper));
    color: var(--teal-dark);
}

.promotion-choice > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.promotion-custom-choice {
    grid-template-columns: auto 72px;
    gap: 8px;
    padding: 8px 12px;
}

.promotion-custom-choice input[type="number"] {
    width: 72px;
    min-height: 42px;
}

.promotion-custom-date {
    display: grid;
    max-width: 320px;
    gap: 6px;
    font-weight: 700;
}

.promotion-custom-date[hidden] {
    display: none;
}

.promotion-create-bar {
    position: sticky;
    bottom: 14px;
    z-index: 3;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.promotion-create-bar > div {
    display: grid;
}

.promotion-status-active {
    background: #d8f5e9;
    color: #0f6b4d;
}

.promotion-status-cancelled,
.promotion-status-expired {
    background: #ebeceb;
    color: #5f6966;
}

.promotion-studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
    gap: 24px;
    margin: 28px 0;
}

.promotion-creative-panel,
.promotion-share-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
}

.promotion-canvas-wrap {
    display: grid;
    place-items: center;
    min-height: 320px;
    overflow: hidden;
    border-radius: 16px;
    background: #412011;
}

.promotion-canvas-wrap canvas {
    width: 100%;
    max-height: 660px;
    object-fit: contain;
}

.promotion-creative-controls {
    margin-top: 14px;
}

.promotion-share-actions {
    margin-top: 16px;
}

.promotion-share-panel {
    align-content: start;
    display: grid;
    gap: 14px;
}

.promotion-campaign-qr {
    width: min(100%, 260px);
    margin: 0 auto;
    border: 8px solid #fff;
    border-radius: 12px;
}

.promotion-caption-label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.promotion-caption-label textarea {
    resize: vertical;
    font: inherit;
}

.promotion-admin-items {
    display: grid;
    gap: 14px;
}

.promotion-admin-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 132px;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
}

.promotion-admin-product-image {
    width: 120px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
}

.promotion-admin-item-copy h3,
.promotion-admin-item-copy p {
    margin: 4px 0;
}

.promotion-admin-item-copy del,
.promotion-quick-sale-price del {
    color: var(--muted);
    font-weight: 500;
}

.promotion-admin-item-copy strong {
    margin-left: 8px;
    color: var(--teal-dark);
    font-size: 1.25rem;
}

.promotion-item-qr {
    width: 132px;
    border: 5px solid #fff;
    border-radius: 8px;
}

.promotion-danger-zone {
    margin-top: 32px;
    padding: 16px;
    border: 1px solid #e8b4b0;
    border-radius: 14px;
    background: #fff7f6;
}

.promotion-danger-zone summary {
    color: var(--red);
    cursor: pointer;
    font-weight: 800;
}

.button-danger {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.promotion-sale-tag {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff0ca;
    color: #7d4a00;
    font-size: 0.75rem;
    font-weight: 800;
}

.quick-sale-promotion-badge {
    display: inline-block;
    margin: 8px 0 2px;
}

.promotion-quick-sale-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.promotion-badge,
.promotion-percent-badge {
    width: fit-content;
    padding: 6px 11px;
    border-radius: 999px;
    background: #ffb21c;
    color: #421b0c;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.promotion-public-hero {
    background: linear-gradient(120deg, #ffbd2e, #f38b0b 58%, #7d3214);
    color: #3d1809;
}

.promotion-public-hero-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 42px;
    padding-bottom: 42px;
}

.promotion-public-hero h1 {
    margin: 8px 0 0;
    font-size: clamp(3.2rem, 10vw, 7rem);
    line-height: 0.9;
}

.promotion-public-hero p {
    margin-bottom: 0;
    font-weight: 700;
}

.promotion-public-expiry {
    display: grid;
    min-width: 220px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.promotion-public-expiry span {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.promotion-public-expiry strong {
    font-size: 1.2rem;
}

.promotion-public-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding-top: 36px;
    padding-bottom: 48px;
}

.promotion-public-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.promotion-public-card-photo,
.promotion-deal-photo {
    position: relative;
}

.promotion-public-card-photo img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.promotion-percent-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1;
    box-shadow: 0 5px 18px rgba(70, 25, 5, 0.24);
}

.promotion-public-card-copy {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.promotion-public-card-copy h2,
.promotion-card-prices {
    margin: 0;
}

.promotion-card-prices {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.promotion-card-prices del {
    color: var(--muted);
}

.promotion-card-prices strong {
    color: var(--teal);
    font-size: 1.6rem;
}

.promotion-deal-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 42px;
    padding-top: 40px;
    padding-bottom: 48px;
}

.promotion-deal-photo > img {
    width: 100%;
    max-height: 620px;
    border-radius: 20px;
    object-fit: contain;
    background: var(--paper);
}

.promotion-deal-copy {
    align-self: start;
}

.promotion-deal-copy h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
}

.promotion-public-prices {
    display: flex;
    align-items: end;
    gap: 22px;
    margin: 22px 0;
}

.promotion-public-prices span,
.promotion-public-prices strong {
    display: grid;
}

.promotion-public-prices small {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.promotion-public-prices del {
    color: var(--muted);
    font-size: 1.2rem;
}

.promotion-public-prices strong {
    color: var(--teal);
    font-size: 2.5rem;
}

.promotion-expiry,
.promotion-sku {
    color: var(--muted);
}

.promotion-customer-qr {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    align-items: center;
    margin: 24px 0 0;
    padding: 14px;
    border: 1px dashed var(--gold);
    border-radius: 16px;
    background: var(--paper);
}

.promotion-customer-qr img {
    width: 120px;
}

.promotion-customer-qr figcaption {
    display: grid;
    gap: 4px;
}

.promotion-ended {
    margin-top: 48px;
    margin-bottom: 48px;
    text-align: center;
}

.promotion-ended .promotion-badge {
    margin: 0 auto;
}

@media (max-width: 900px) {
    .promotion-product-picker,
    .promotion-public-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .promotion-studio-grid,
    .promotion-deal-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .promotion-step {
        padding: 18px 14px;
    }

    .promotion-step-heading,
    .promotion-create-bar,
    .promotion-public-hero-grid {
        align-items: stretch;
        flex-direction: column;
    }

    .promotion-product-picker,
    .promotion-public-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .promotion-product-option {
        grid-template-rows: 105px auto;
    }

    .promotion-product-option img {
        height: 105px;
    }

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

    .promotion-create-bar {
        bottom: 8px;
    }

    .promotion-create-bar .button {
        width: 100%;
    }

    .promotion-admin-item {
        grid-template-columns: 82px 1fr;
    }

    .promotion-admin-product-image {
        width: 82px;
        height: 82px;
    }

    .promotion-item-qr {
        grid-column: 1 / -1;
        width: 150px;
        margin: 0 auto;
    }

    .promotion-public-hero-grid {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .promotion-public-expiry {
        min-width: 0;
    }

    .promotion-public-card-copy {
        padding: 13px;
    }

    .promotion-public-card-copy h2 {
        font-size: 1rem;
    }

    .promotion-card-prices {
        align-items: start;
        flex-direction: column;
        gap: 0;
    }

    .promotion-card-prices strong {
        font-size: 1.3rem;
    }

    .promotion-public-prices {
        align-items: start;
        flex-direction: column;
        gap: 8px;
    }

    .promotion-customer-qr {
        grid-template-columns: 96px 1fr;
    }

    .promotion-customer-qr img {
        width: 96px;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--soft);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

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

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header,
.admin-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.public-brand-logo {
    display: block;
    width: clamp(235px, 26vw, 300px);
    height: 55px;
    overflow: hidden;
}

.public-brand-logo img {
    width: 100%;
    height: auto;
    max-width: none;
    transform: translateY(-20.5%);
}

.brand-mark {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
}

.brand-mark-logo {
    padding: 4px;
    overflow: hidden;
    background: #fff;
}

.brand-mark-logo img {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
}

.language-switch,
.admin-nav,
.category-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.language-switch a,
.admin-nav a,
.category-nav a {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    background: var(--paper);
}

.language-switch a[aria-current="true"],
.category-nav a[aria-current="true"] {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.catalog-toolbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 28px 0 20px;
}

.toolbar-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

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

h1 {
    margin-bottom: 8px;
    font-size: clamp(1.75rem, 4vw, 2.7rem);
    line-height: 1.1;
}

h2 {
    font-size: 1.1rem;
    line-height: 1.25;
}

.toolbar-heading p,
.site-footer p,
.admin-title-row p {
    color: var(--muted);
    margin-bottom: 0;
}

.search-form {
    margin-bottom: 18px;
}

.search-form label,
.stack-form label,
.product-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--teal);
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--teal-dark);
}

.button:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.45);
    outline-offset: 3px;
}

.contact-button {
    gap: 8px;
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
}

.contact-button:hover {
    border-color: var(--teal-dark);
    background: var(--teal-dark);
}

.contact-button:focus-visible,
.contact-option:focus-visible,
.theme-toggle:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.45);
    outline-offset: 3px;
}

.button-icon {
    width: 1.2em;
    height: 1.2em;
    flex: 0 0 auto;
}

.button-secondary {
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
}

.button-secondary:hover {
    background: var(--soft);
}

.button-disabled {
    background: #d7dfdc;
    border-color: #d7dfdc;
    color: #64736e;
    cursor: not-allowed;
}

.contact-button.button-disabled {
    border-color: #d7dfdc;
    background: #d7dfdc;
    color: #64736e;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    display: inline-grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}

.theme-icon {
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle .theme-icon-sun,
.theme-toggle[data-current-theme="dark"] .theme-icon-moon {
    display: none;
}

.theme-toggle[data-current-theme="dark"] .theme-icon-sun {
    display: inline;
}

.contact-chooser {
    position: relative;
    flex: 1 1 100%;
    min-width: 0;
}

.contact-chooser summary {
    width: 100%;
    list-style: none;
}

.contact-chooser summary::-webkit-details-marker {
    display: none;
}

.contact-options {
    position: absolute;
    z-index: 12;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    width: max-content;
    min-width: 190px;
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--catalog-border, var(--line));
    border-radius: 10px;
    background: var(--catalog-surface, var(--paper));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.contact-option {
    display: flex;
    min-height: 44px;
    align-items: center;
    border-radius: 7px;
    padding: 9px 12px;
    color: var(--catalog-text, var(--ink));
    font-weight: 700;
    text-decoration: none;
}

.contact-option:hover {
    background: var(--catalog-hover, var(--soft));
}

.contact-option::before {
    width: 9px;
    height: 9px;
    margin-right: 9px;
    border-radius: 50%;
    background: var(--teal);
    content: "";
}

.contact-option.contact-whatsapp::before { background: #25d366; }
.contact-option.contact-messenger::before { background: #168aff; }
.contact-option.contact-telegram::before { background: #229ed9; }
.contact-option.contact-instagram::before { background: #c13584; }

.contact-chooser-large,
.modal-contact,
.modal-contact .contact-button {
    width: 100%;
}

.modal-contact {
    margin-top: 8px;
}

.button-large {
    width: 100%;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 28px 0 36px;
}

.product-card,
.admin-panel,
.single-panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.product-card {
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
}

.product-card-media {
    aspect-ratio: 4 / 3;
    background: #e7eeeb;
    overflow: hidden;
}

.product-card-media img,
.main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-body {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.product-card h2 {
    margin-bottom: 0;
}

.product-card h2 a {
    text-decoration: none;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.product-meta,
.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-meta span,
.status-pill {
    border-radius: 999px;
    background: #edf6f4;
    color: var(--teal-dark);
    padding: 5px 9px;
    font-size: 0.84rem;
    font-weight: 700;
}

.card-actions {
    align-items: stretch;
}

.card-actions .button {
    flex: 1;
    text-align: center;
}

.product-share-action {
    position: relative;
    display: inline-flex;
    min-width: 0;
    flex: 0 0 auto;
}

.product-share-action .product-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
}

.product-detail-actions {
    display: grid;
    width: 100%;
    gap: 8px;
}

.product-share-action-large {
    display: flex;
    width: auto;
    justify-self: end;
}

.product-share-action .product-share-button-large {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
}

.share-icon {
    width: 18px;
    height: 18px;
}

.product-share-feedback {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 8;
    width: max-content;
    max-width: min(220px, 80vw);
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.2;
}

.product-share-feedback:empty {
    display: none;
}

.product-share-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

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

.notes-band {
    background: var(--ink);
    color: #fff;
    padding: 28px 0;
}

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

.notes-grid p {
    margin-bottom: 0;
    color: #eef6f4;
}

.site-footer {
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 24px 0;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

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

.footer-brand-logo {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    object-fit: contain;
}

address {
    display: grid;
    gap: 4px;
    font-style: normal;
    color: var(--muted);
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 28px;
    padding: 30px 0 40px;
}

.product-gallery,
.detail-copy {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.product-gallery {
    overflow: hidden;
}

.product-media-stage {
    position: relative;
    display: grid;
    overflow: hidden;
    place-items: center;
    background: #0d1110;
    aspect-ratio: 4 / 3;
}

.product-media-stage [hidden] {
    display: none !important;
}

.main-photo,
.main-product-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.main-product-video {
    background: #000;
}

.thumb-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 10px;
}

.thumb-row img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}

.detail-media-thumbnail {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 2px;
    background: #151b19;
    cursor: pointer;
    opacity: 0.7;
}

.detail-media-thumbnail[aria-current="true"] {
    border-color: var(--teal);
    opacity: 1;
}

.detail-media-thumbnail:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}

.detail-copy {
    padding: 24px;
}

.detail-price {
    color: var(--red);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.detail-price-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.detail-price-row .detail-price {
    align-self: center;
    min-width: 0;
    margin-bottom: 0;
}

.staff-product-qr {
    display: grid;
    flex: 0 0 116px;
    gap: 5px;
    justify-items: center;
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.staff-product-qr img {
    display: block;
    width: 96px;
    height: 96px;
    background: #fff;
}

.staff-product-qr figcaption {
    color: #25312d;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.status-list {
    margin: 0 0 18px;
}

.status-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.status-list dt {
    color: var(--muted);
}

.status-list dd {
    margin: 0;
    font-weight: 700;
}

.description {
    white-space: normal;
    color: #33413d;
}

.text-link {
    color: var(--teal-dark);
    font-weight: 700;
}

/* Public catalog: compact Marketplace layout. Admin pages stay unchanged. */
body:not(.admin-body) {
    --catalog-bg: #18191a;
    --catalog-surface: #242526;
    --catalog-surface-alt: #3a3b3c;
    --catalog-border: #3e4042;
    --catalog-text: #e4e6eb;
    --catalog-strong: #f5f6f7;
    --catalog-muted: #b0b3b8;
    --catalog-hover: #4e4f50;
    --catalog-media: #3a3b3c;
    --catalog-disabled-bg: #303231;
    --catalog-disabled-text: #7d8582;
    --catalog-accent-soft: rgba(28, 173, 130, 0.16);
    --catalog-accent-text: #68d7b6;
    background: var(--catalog-bg);
    color: var(--catalog-text);
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    html:not([data-theme]) body:not(.admin-body) {
        --catalog-bg: #f5f7f6;
        --catalog-surface: #ffffff;
        --catalog-surface-alt: #eef1f0;
        --catalog-border: #d8dfdc;
        --catalog-text: #26312e;
        --catalog-strong: #17211f;
        --catalog-muted: #62716d;
        --catalog-hover: #e2e7e5;
        --catalog-media: #e7eeeb;
        --catalog-disabled-bg: #d7dfdc;
        --catalog-disabled-text: #64736e;
        --catalog-accent-soft: #e1f4ee;
        --catalog-accent-text: #0b6b58;
        color-scheme: light;
    }
}

html[data-theme="light"] body:not(.admin-body) {
    --catalog-bg: #f5f7f6;
    --catalog-surface: #ffffff;
    --catalog-surface-alt: #eef1f0;
    --catalog-border: #d8dfdc;
    --catalog-text: #26312e;
    --catalog-strong: #17211f;
    --catalog-muted: #62716d;
    --catalog-hover: #e2e7e5;
    --catalog-media: #e7eeeb;
    --catalog-disabled-bg: #d7dfdc;
    --catalog-disabled-text: #64736e;
    --catalog-accent-soft: #e1f4ee;
    --catalog-accent-text: #0b6b58;
    color-scheme: light;
}

html[data-theme="dark"] body:not(.admin-body) {
    color-scheme: dark;
}

body:not(.admin-body) .container {
    width: min(1600px, calc(100% - 32px));
}

body:not(.admin-body) .site-header {
    background: var(--catalog-surface);
    border-bottom-color: var(--catalog-border);
}

body:not(.admin-body) .header-grid {
    min-height: 58px;
    gap: 14px;
}

body:not(.admin-body) .brand {
    gap: 10px;
}

body:not(.admin-body) .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--teal);
}

body:not(.admin-body) .brand strong {
    color: var(--catalog-strong);
    font-size: 0.95rem;
}

body:not(.admin-body) .brand small {
    color: var(--catalog-muted);
    font-size: 0.78rem;
}

body:not(.admin-body) .language-switch a,
body:not(.admin-body) .category-nav a {
    background: var(--catalog-surface-alt);
    color: var(--catalog-text);
    border-color: transparent;
    border-radius: 999px;
}

body:not(.admin-body) .language-switch a {
    padding: 7px 12px;
    font-size: 0.88rem;
}

body:not(.admin-body) .category-nav a {
    padding: 4px 10px;
    font-size: 0.76rem;
}

body:not(.admin-body) .language-switch a:hover,
body:not(.admin-body) .category-nav a:hover {
    background: var(--catalog-hover);
    border-color: transparent;
}

body:not(.admin-body) .language-switch a[aria-current="true"],
body:not(.admin-body) .category-nav a[aria-current="true"] {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

body:not(.admin-body) .catalog-toolbar {
    background: var(--catalog-surface);
    border-bottom-color: var(--catalog-border);
    padding: 7px 0 8px;
}

body:not(.admin-body) .brand-hero {
    padding: 14px 0;
    background: var(--catalog-bg);
}

body:not(.admin-body) .brand-hero-frame {
    width: min(920px, calc(100% - 32px));
    overflow: hidden;
    padding: 0;
    background: #f39200;
    border: 1px solid var(--catalog-border);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.brand-hero-frame img {
    width: 100%;
    height: auto;
}

body:not(.admin-body) .catalog-toolbar-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 520px);
    align-items: end;
    gap: 18px;
}

body:not(.admin-body) .toolbar-heading {
    display: block;
    margin: 0;
}

body:not(.admin-body) h1 {
    margin-bottom: 0;
    color: var(--catalog-strong);
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    line-height: 1.15;
}

body:not(.admin-body) .toolbar-heading p {
    color: var(--catalog-muted);
    font-size: 0.72rem;
}

body:not(.admin-body) .search-form {
    width: 100%;
    margin: 0;
}

body:not(.admin-body) .search-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}

body:not(.admin-body) .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin-top: 0;
}

body:not(.admin-body) .search-row input {
    height: 36px;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 14px;
    background: var(--catalog-surface-alt);
    color: var(--catalog-text);
    font-size: 0.86rem;
}

body:not(.admin-body) .search-row input::placeholder {
    color: var(--catalog-muted);
}

body:not(.admin-body) .search-row input:focus {
    border-color: var(--teal);
    outline: 2px solid rgba(15, 118, 110, 0.3);
}

body:not(.admin-body) .search-row .button {
    min-height: 36px;
    height: 36px;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 0.8rem;
}

body:not(.admin-body) .category-nav {
    gap: 5px;
}

body:not(.admin-body) .catalog-layout {
    display: grid;
    grid-template-columns: minmax(155px, 190px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    padding-top: 16px;
    padding-bottom: 28px;
}

body:not(.admin-body) .catalog-sidebar {
    position: sticky;
    top: 12px;
    min-width: 0;
}

body:not(.admin-body) .catalog-sidebar h2 {
    margin: 0 0 8px;
    color: var(--catalog-strong);
    font-size: 0.86rem;
    font-weight: 750;
}

.category-menu-toggle {
    display: none;
}

body:not(.admin-body) .catalog-sidebar .category-nav {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    padding: 8px;
    border: 1px solid var(--catalog-border);
    border-radius: 10px;
    background: var(--catalog-surface);
}

body:not(.admin-body) .catalog-sidebar .category-nav a {
    width: 100%;
    border-radius: 7px;
    padding: 9px 10px;
    font-size: 0.82rem;
    text-align: left;
}

body:not(.admin-body) .catalog-results {
    min-width: 0;
}

body:not(.admin-body) .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px 12px;
    padding: 0 0 20px;
}

body:not(.admin-body) .catalog-category-groups {
    display: grid;
    gap: 28px;
    padding-top: 20px;
    padding-bottom: 36px;
}

body:not(.admin-body) .catalog-category-section {
    min-width: 0;
}

body:not(.admin-body) .catalog-category-section + .catalog-category-section {
    padding-top: 26px;
    border-top: 1px solid var(--catalog-border);
}

body:not(.admin-body) .catalog-category-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

body:not(.admin-body) .catalog-category-heading h2 {
    margin: 0;
    color: var(--catalog-strong);
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}

body:not(.admin-body) .catalog-category-heading a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    flex: 0 0 auto;
    padding: 6px 2px;
    color: var(--teal);
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

body:not(.admin-body) .catalog-category-heading a:hover {
    text-decoration: underline;
}

body:not(.admin-body) .catalog-category-heading a:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(15, 118, 110, 0.35);
    outline-offset: 4px;
}

body:not(.admin-body) .catalog-category-grid {
    padding: 12px 0 0;
}

body:not(.admin-body) .product-card {
    display: flex;
    min-width: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex-direction: column;
    transition: none;
}

body:not(.admin-body) .product-card:hover {
    transform: none;
    box-shadow: none;
}

body:not(.admin-body) .product-card-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--catalog-media);
    border-radius: 8px;
}

body:not(.admin-body) .product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none;
}

body:not(.admin-body) .product-card:hover .product-card-media img {
    transform: none;
}

body:not(.admin-body) .product-card-body {
    display: flex;
    min-width: 0;
    gap: 3px;
    padding: 7px 0 2px;
    flex-direction: column;
}

body:not(.admin-body) .product-card .product-meta {
    order: 1;
}

body:not(.admin-body) .product-card h2 {
    order: 2;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    color: var(--catalog-strong);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

body:not(.admin-body) .product-card h2 a:hover {
    text-decoration: underline;
}

body:not(.admin-body) .product-card .eyebrow {
    order: 3;
    margin: 1px 0 0;
    color: var(--catalog-muted);
    font-size: 0.74rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

body:not(.admin-body) .product-card .product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

body:not(.admin-body) .product-card .product-meta > strong {
    color: var(--catalog-strong);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.2;
}

body:not(.admin-body) .product-card .product-meta span,
body:not(.admin-body) .status-pill {
    flex: 0 0 auto;
    padding: 3px 7px;
    background: var(--catalog-accent-soft);
    color: var(--catalog-accent-text);
    font-size: 0.68rem;
}

body:not(.admin-body) .product-card .product-quantity {
    order: 3;
    margin: 0;
    color: var(--catalog-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
}

body:not(.admin-body) .product-card .card-actions {
    order: 4;
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-top: 5px;
    flex-direction: row;
    flex-wrap: wrap;
}

body:not(.admin-body) .product-card .card-actions .button {
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 0.72rem;
    line-height: 1.1;
    transform: none;
}

body:not(.admin-body) .product-card .card-actions .product-share-action {
    flex: 0 0 34px;
}

body:not(.admin-body) .product-card .card-actions .product-share-button {
    width: 34px;
    min-width: 34px;
    height: 32px;
    min-height: 32px;
    padding: 0;
}

body:not(.admin-body) .product-card .card-actions .button-secondary {
    background: var(--catalog-surface-alt);
    color: var(--catalog-text);
    border-color: var(--catalog-surface-alt);
}

body:not(.admin-body) .product-card .card-actions .button-secondary:hover {
    background: var(--catalog-hover);
}

body:not(.admin-body) .product-card .card-actions .button-disabled {
    background: var(--catalog-disabled-bg);
    color: var(--catalog-disabled-text);
    border-color: var(--catalog-disabled-bg);
}

body:not(.admin-body) .product-card .card-actions .contact-button,
body:not(.admin-body) .product-card .card-actions .contact-chooser {
    min-height: 44px;
    flex-basis: 100%;
    font-size: 0.78rem;
}

body:not(.admin-body) .product-card .card-actions .contact-chooser .contact-button {
    min-height: 44px;
    width: 100%;
}

body:not(.admin-body) .product-card .card-actions .contact-button.button-disabled {
    border-color: var(--catalog-disabled-bg);
    background: var(--catalog-disabled-bg);
    color: var(--catalog-disabled-text);
}

body:not(.admin-body) .empty-state {
    background: var(--catalog-surface);
    color: var(--catalog-text);
    border-color: var(--catalog-border);
}

body:not(.admin-body) .notes-band {
    background: var(--catalog-surface);
    border-top: 1px solid var(--catalog-border);
    border-bottom: 1px solid var(--catalog-border);
    padding: 20px 0;
}

body:not(.admin-body) .notes-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px 22px;
}

body:not(.admin-body) .notes-grid p {
    color: var(--catalog-muted);
    font-size: 0.82rem;
}

body:not(.admin-body) .site-footer {
    background: var(--catalog-bg);
    border-top-color: var(--catalog-border);
}

body:not(.admin-body) .site-footer p,
body:not(.admin-body) address {
    color: var(--catalog-muted);
}

body:not(.admin-body) .product-gallery,
body:not(.admin-body) .detail-copy {
    background: var(--catalog-surface);
    border-color: var(--catalog-border);
    box-shadow: none;
}

body:not(.admin-body) .detail-copy h1,
body:not(.admin-body) .description,
body:not(.admin-body) .status-list dd {
    color: var(--catalog-text);
}

body:not(.admin-body) .status-list div {
    border-color: var(--catalog-border);
}

body:not(.admin-body) .staff-product-qr {
    border-color: var(--catalog-border);
}

body:not(.admin-body) .status-list dt {
    color: var(--catalog-muted);
}

body:not(.admin-body) .text-link {
    color: var(--catalog-accent-text);
}

body:not(.admin-body) .theme-toggle {
    width: 34px;
    height: 34px;
    border-color: transparent;
    background: var(--catalog-surface-alt);
    color: var(--catalog-text);
}

body:not(.admin-body) .theme-toggle:hover {
    background: var(--catalog-hover);
}

/* Product quick-view modal and image carousel */
body:has(.product-modal[open]) {
    overflow: hidden;
}

.product-modal {
    width: min(1180px, calc(100% - 32px));
    max-width: none;
    height: min(760px, calc(100% - 32px));
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ink);
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.product-modal::backdrop {
    background: rgba(9, 13, 12, 0.78);
    backdrop-filter: blur(3px);
}

.product-modal[open] {
    animation: modal-in 160ms ease-out;
}

.product-modal [hidden] {
    display: none !important;
}

.product-modal-shell {
    position: relative;
    height: 100%;
    min-height: 320px;
    background: var(--paper);
    overflow: hidden;
}

.product-modal-close {
    position: absolute;
    z-index: 6;
    top: 14px;
    right: 14px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0 0 3px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(23, 33, 31, 0.88);
    color: #fff;
    font: 400 2rem/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
}

.product-modal-close:hover {
    background: #000;
}

.product-modal-close:focus-visible,
.carousel-arrow:focus-visible,
.carousel-thumbnail:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.product-modal-loading,
.product-modal-error {
    display: flex;
    height: 100%;
    min-height: 320px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 70px 24px 24px;
    text-align: center;
}

.product-modal-error {
    flex-direction: column;
}

.product-modal-error p {
    max-width: 500px;
    margin-bottom: 4px;
    color: var(--muted);
}

.modal-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--line);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: modal-spin 700ms linear infinite;
}

.product-modal-content {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
    height: 100%;
    min-height: 0;
}

.modal-gallery {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    background: #0d1110;
}

.carousel-stage {
    position: relative;
    display: grid;
    min-height: 0;
    place-items: center;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
}

.carousel-main-image {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

.carousel-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0 0 5px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: #111;
    font: 400 2.2rem/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.carousel-arrow:hover {
    background: #fff;
}

.carousel-arrow-prev {
    left: 16px;
}

.carousel-arrow-next {
    right: 16px;
}

.carousel-counter {
    position: absolute;
    right: 14px;
    bottom: 12px;
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.68);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}

.carousel-thumbnails {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    background: #151b19;
    scrollbar-width: thin;
}

.carousel-thumbnail {
    flex: 0 0 66px;
    width: 66px;
    height: 66px;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    opacity: 0.68;
}

.carousel-thumbnail[aria-current="true"] {
    border-color: #fff;
    opacity: 1;
}

.carousel-thumbnail img {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    object-fit: cover;
}

.modal-detail-copy {
    min-width: 0;
    overflow-y: auto;
    padding: 68px 28px 28px;
    background: var(--paper);
}

body:not(.admin-body) .product-modal-shell,
body:not(.admin-body) .product-modal-loading,
body:not(.admin-body) .product-modal-error,
body:not(.admin-body) .modal-detail-copy {
    background: var(--catalog-surface);
    color: var(--catalog-text);
}

body:not(.admin-body) .product-modal-error p,
body:not(.admin-body) .modal-detail-copy .status-list dt {
    color: var(--catalog-muted);
}

body:not(.admin-body) .modal-detail-copy h2,
body:not(.admin-body) .modal-detail-copy .description,
body:not(.admin-body) .modal-detail-copy .status-list dd {
    color: var(--catalog-text);
}

body:not(.admin-body) .modal-detail-copy .status-list div {
    border-color: var(--catalog-border);
}

body:not(.admin-body) .product-modal-error .button-secondary {
    background: var(--catalog-surface-alt);
    color: var(--catalog-text);
    border-color: var(--catalog-surface-alt);
}

.modal-detail-copy h2 {
    margin-bottom: 10px;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.modal-detail-copy .description {
    white-space: pre-line;
}

.modal-detail-copy .button-large {
    margin-top: 8px;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.975) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modal-spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    grid-column: 1 / -1;
    padding: 24px;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.admin-body {
    background: #eef2f1;
}

.admin-main {
    padding: 28px 0;
}

.admin-panel,
.single-panel {
    width: min(1060px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px;
}

.auth-panel {
    width: min(440px, calc(100% - 32px));
}

.admin-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.stack-form,
.product-form {
    display: grid;
    gap: 16px;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.alert,
.success {
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

.public-notice {
    margin-top: 18px;
    border: 1px solid #e4c777;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff8df;
    color: #684f0d;
    font-weight: 700;
}

.alert {
    background: #fff0ef;
    color: #8b2f29;
    border: 1px solid #f0c3bf;
}

.success {
    background: #edf8f2;
    color: #17643a;
    border: 1px solid #b9e2ca;
}

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

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

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.table-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.image-manager {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

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

.image-manager-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 10px;
}

.image-manager-card img {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
    border-radius: 6px;
}

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

.photo-source-card {
    display: grid;
    align-content: start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    background: #fff;
}

.photo-source-card h3,
.photo-source-card p {
    margin: 0;
}

.photo-source-card p {
    color: var(--muted);
    font-size: 0.86rem;
}

.product-form .photo-file-button {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    cursor: pointer;
}

.visually-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.photo-file-button:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.45);
    outline-offset: 3px;
}

.photo-clear-button {
    width: 100%;
}

.photo-clear-button[hidden],
.quick-sale-actions [hidden] {
    display: none !important;
}

.photo-selection-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.photo-selection-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px;
    background: #fff;
}

.photo-selection-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 7px;
    object-fit: cover;
}

.photo-selection-details {
    display: grid;
    gap: 7px;
    padding-top: 7px;
}

.photo-selection-name {
    display: block;
    overflow: hidden;
    font-size: 0.74rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-main-choice {
    margin: 0;
    font-size: 0.78rem;
}

.photo-remove-button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--soft);
    color: var(--red);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.photo-remove-button:hover {
    border-color: var(--red);
}

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

.pending-photo-manager[hidden] {
    display: none;
}

.pending-photo-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pending-photo-heading h3,
.pending-photo-heading p {
    margin: 0;
}

.pending-photo-heading p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.84rem;
}

.photo-upload-error {
    color: var(--red) !important;
    font-weight: 700;
}

.product-video-panel {
    display: grid;
    gap: 16px;
}

.product-category-panel {
    margin: 18px 0 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.product-category-panel legend {
    padding: 0 8px;
    font-weight: 800;
}

.product-category-panel > p {
    margin: 0 0 14px;
}

.product-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.product-category-option {
    display: flex;
    align-items: center;
    min-height: 54px;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    cursor: pointer;
}

.product-category-option input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.product-category-option span {
    display: grid;
    gap: 2px;
}

.product-category-option small {
    color: var(--muted);
}

.product-category-option.is-primary {
    border-color: var(--teal);
    box-shadow: 0 0 0 1px var(--teal);
}

.product-category-option.is-primary small::after {
    content: " · Primary";
    color: var(--teal);
    font-weight: 700;
}

.product-category-option.is-inactive {
    opacity: 0.72;
}

.product-video-picker {
    display: grid;
    width: min(560px, 100%);
    gap: 8px;
    font-weight: 800;
}

.product-video-manager {
    display: grid;
    grid-template-columns: minmax(220px, 420px) minmax(180px, 1fr);
    align-items: center;
    gap: 18px;
}

.product-video-manager video,
.product-video-preview video {
    display: block;
    width: 100%;
    max-height: 320px;
    border-radius: 10px;
    background: #0d1110;
}

.product-video-manager p {
    color: var(--muted);
}

.product-video-preview {
    width: min(560px, 100%);
}

.quick-sale-panel {
    width: min(780px, calc(100% - 32px));
}

.quick-sale-scanner {
    display: grid;
    justify-items: center;
    gap: 16px;
}

.quick-sale-camera-frame {
    position: relative;
    width: min(520px, 100%);
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: #101716;
    aspect-ratio: 4 / 3;
}

.quick-sale-camera-frame video,
.quick-sale-camera-placeholder {
    width: 100%;
    height: 100%;
}

.quick-sale-camera-frame video {
    object-fit: cover;
}

.quick-sale-camera-placeholder {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 8px;
    background: linear-gradient(145deg, #17211f, #293734);
    color: #fff;
}

.quick-sale-camera-placeholder[hidden],
.quick-sale-camera-frame video[hidden] {
    display: none;
}

.quick-sale-camera-icon {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    font-size: 2.5rem;
}

.quick-sale-target {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(52%, 230px);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.16);
    aspect-ratio: 1;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.quick-sale-camera-message {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.quick-sale-camera-error {
    color: var(--red);
}

.quick-sale-actions {
    justify-content: center;
}

.quick-sale-main-action {
    min-height: 54px;
    padding-inline: 24px;
    font-size: 1.05rem;
}

.quick-sale-alternatives {
    margin-top: 24px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.quick-sale-alternatives summary {
    color: var(--teal-dark);
    font-weight: 800;
    cursor: pointer;
}

.quick-sale-alternatives > p {
    margin: 12px 0;
    color: var(--muted);
}

.quick-sale-manual-form {
    margin-top: 14px;
}

.sale-product-picker {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.sale-product-picker > label {
    font-weight: 800;
}

.sale-product-search-wrap {
    position: relative;
}

.sale-product-search-wrap input {
    width: 100%;
}

.sale-product-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: min(390px, 50vh);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px;
    background: var(--paper);
    box-shadow: 0 18px 44px rgba(23, 33, 31, 0.2);
}

.sale-product-results[hidden],
.sale-product-selected[hidden],
.status-workflow-panel[hidden],
.status-only-fields[hidden] {
    display: none !important;
}

.sale-product-result {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    border-radius: 9px;
    padding: 9px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.sale-product-result + .sale-product-result {
    border-top: 1px solid var(--line);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.sale-product-result:hover,
.sale-product-result:focus-visible,
.sale-product-result.is-active {
    outline: none;
    background: #e8f5f2;
}

.sale-product-result img,
.sale-product-selected img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--soft);
}

.sale-product-result-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

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

.sale-product-result-copy span,
.sale-product-selected span {
    color: var(--muted);
    font-size: 0.86rem;
}

.sale-product-result-price {
    color: var(--teal-dark);
    white-space: nowrap;
}

.sale-product-selected {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: var(--soft);
}

.sale-product-selected > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.sale-product-selected strong,
.sale-product-selected span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-product-change {
    border: 0;
    padding: 8px;
    background: transparent;
    cursor: pointer;
}

.sale-product-picker-status {
    margin: 0;
}

.sale-product-picker-error {
    color: var(--red);
}

.status-workflow-panel {
    display: grid;
    gap: 14px;
    border: 1px solid #e3bf73;
    border-radius: 14px;
    padding: 18px;
    background: #fff8e8;
}

.status-workflow-panel h2 {
    margin-bottom: 6px;
    font-size: 1.2rem;
}

.status-workflow-panel p {
    margin-bottom: 12px;
}

.status-only-confirmation {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 9px !important;
    margin-top: 14px;
    font-weight: 700;
}

.status-only-confirmation input {
    flex: 0 0 auto;
    width: auto;
    margin-top: 3px;
}

.status-only-fields {
    margin-top: 12px;
}

.quick-sale-product {
    display: grid;
    grid-template-columns: minmax(140px, 210px) minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    background: #fff;
}

.quick-sale-product img {
    width: 100%;
    border-radius: 10px;
    aspect-ratio: 1;
    object-fit: cover;
}

.quick-sale-product h2 {
    margin-bottom: 6px;
    font-size: clamp(1.2rem, 4vw, 1.7rem);
}

.quick-sale-product p {
    margin-bottom: 5px;
}

.quick-sale-price {
    font-size: 1.9rem;
    font-weight: 800;
}

.quick-sale-confirm-form,
.quick-sale-success {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.quick-sale-success {
    padding: 36px 12px;
}

.quick-sale-success h1,
.quick-sale-success p {
    margin-bottom: 0;
}

.quick-sale-success-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    border-radius: 50%;
    background: #dff4e8;
    color: #17643a;
    font-size: 2.5rem;
    font-weight: 800;
}

.catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 0 0 28px;
}

body:not(.admin-body) .catalog-pagination .button-secondary {
    background: var(--catalog-surface-alt);
    color: var(--catalog-text);
    border-color: var(--catalog-surface-alt);
}

body:not(.admin-body) .catalog-pagination span {
    color: var(--catalog-muted);
    font-weight: 700;
}

.settings-panel {
    width: min(1280px, calc(100% - 32px));
}

.settings-tabs {
    position: sticky;
    z-index: 5;
    top: 0;
    display: flex;
    gap: 8px;
    margin: 0 -22px 22px;
    padding: 12px 22px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.settings-tabs a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 13px;
    color: var(--ink);
    background: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.settings-tabs a:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.settings-form {
    display: grid;
    gap: 22px;
}

.settings-section {
    scroll-margin-top: 76px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    background: #fbfcfb;
}

.settings-section + .settings-section {
    margin-top: 22px;
}

.settings-form .settings-section + .settings-section {
    margin-top: 0;
}

.settings-section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.settings-section-heading h2,
.settings-section-heading p,
.settings-subsection h3,
.add-category-form h3 {
    margin-bottom: 0;
}

.settings-section-heading > p,
.settings-subsection > p,
.token-help {
    color: var(--muted);
}

.settings-section-heading > p {
    max-width: 460px;
    text-align: right;
}

.settings-kicker {
    margin-bottom: 3px !important;
    color: var(--teal-dark) !important;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-subsection {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.bilingual-row,
.branding-grid,
.category-add-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.bilingual-row + .bilingual-row {
    margin-top: 16px;
}

.settings-form label,
.category-editor label,
.add-category-form label,
.upload-card label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.settings-form label > small,
.add-category-form label > small,
.token-help,
.check-card small {
    font-weight: 400;
}

.branding-grid {
    margin-bottom: 18px;
}

.upload-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
}

.branding-preview {
    display: grid;
    width: 132px;
    height: 110px;
    place-items: center;
    overflow: hidden;
    border: 1px dashed #b8c4c0;
    border-radius: 9px;
    background: var(--soft);
}

.branding-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-preview span {
    color: var(--teal-dark);
    font-size: 2rem;
    font-weight: 800;
}

.placeholder-preview img {
    object-fit: cover;
}

.check-line,
.check-card {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
}

.check-line {
    grid-column: 2;
    color: var(--muted);
    font-size: 0.88rem;
}

.check-line input,
.check-card input,
.category-table input[type="checkbox"] {
    width: auto;
}

.check-card {
    align-self: end;
    min-height: 68px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.check-card span,
.check-card strong,
.check-card small {
    display: block;
}

.check-card small {
    margin-top: 2px;
    color: var(--muted);
}

.color-input {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
}

.color-input input[type="color"] {
    height: 46px;
    padding: 4px;
}

.token-help code {
    border-radius: 5px;
    padding: 3px 6px;
    background: #e8efec;
    color: var(--teal-dark);
}

.settings-save-bar {
    position: sticky;
    z-index: 4;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #bdd4ce;
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(244, 249, 247, 0.96);
    box-shadow: 0 10px 24px rgba(23, 33, 31, 0.14);
    backdrop-filter: blur(8px);
}

.settings-save-bar span {
    color: var(--muted);
    font-size: 0.9rem;
}

#categories {
    margin-top: 22px;
}

.category-table input {
    min-width: 130px;
}

.category-table input[type="number"] {
    min-width: 86px;
}

.category-table input[type="checkbox"] {
    min-width: 18px;
}

.category-editor .form-actions {
    margin-top: 14px;
}

.add-category-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.category-add-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
    margin-top: 14px;
}

.radio-line {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.radio-line input {
    width: auto;
}

.admin-header .container {
    width: min(1380px, calc(100% - 32px));
}

.admin-nav {
    justify-content: flex-end;
}

.admin-nav a {
    padding: 7px 10px;
    font-size: 0.86rem;
}

.admin-nav .admin-nav-primary {
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
}

.admin-nav .admin-nav-primary:hover {
    border-color: var(--teal-dark);
    background: var(--teal-dark);
}

.admin-user-link small,
.muted-line {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 400;
}

.admin-user-link small {
    margin-left: 5px;
}

.narrow-panel {
    width: min(780px, calc(100% - 32px));
}

.action-row,
.filter-bar,
.product-cell,
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-row {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-bar {
    align-items: end;
    margin: 20px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
}

.filter-bar label {
    display: grid;
    min-width: 160px;
    gap: 5px;
    font-size: 0.86rem;
    font-weight: 700;
}

.filter-bar .grow-field {
    min-width: 220px;
    flex: 1;
}

.product-filter-bar {
    flex-wrap: wrap;
}

.product-filter-bar .price-filter-field {
    min-width: 135px;
}

.filter-actions {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
}

.listed-price {
    white-space: nowrap;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.metric-card {
    display: grid;
    gap: 5px;
    min-height: 100px;
    align-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    background: #f8fbfa;
    color: inherit;
    text-decoration: none;
}

a.metric-card:hover {
    border-color: var(--teal);
}

.metric-card span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.metric-card strong {
    font-size: 1.65rem;
    line-height: 1.1;
}

.product-cell strong {
    min-width: 150px;
}

.product-cell .table-thumb {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
}

.stock-warning {
    display: inline-block;
    margin-left: 5px;
    border-radius: 999px;
    padding: 2px 7px;
    background: #fff3cd;
    color: #775b00;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-muted {
    background: #ecefed;
    color: var(--muted);
}

.subpanel,
.form-section {
    margin-top: 24px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.product-form .form-section {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    background: #fbfcfb;
}

.section-title {
    justify-content: space-between;
    margin: 24px 0 12px;
}

.section-title h2,
.section-title p {
    margin-bottom: 0;
}

.section-title p,
.form-help {
    color: var(--muted);
    font-size: 0.88rem;
}

.field-summary {
    display: grid;
    align-content: center;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.field-summary span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.field-summary strong {
    font-size: 1.35rem;
}

.sku-warning {
    color: #8b4f11;
    font-weight: 700;
}

.qr-product-panel {
    display: grid;
    grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    background: #f8fbfa;
}

.qr-preview {
    display: grid;
    min-height: 220px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.qr-preview img {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1;
}

.qr-product-details h2 {
    margin-bottom: 14px;
}

.qr-details-list {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.qr-details-list div {
    display: grid;
    gap: 3px;
}

.qr-details-list dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.qr-details-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.qr-details-list code {
    border-radius: 6px;
    padding: 5px 7px;
    background: #e8efec;
}

.qr-actions {
    justify-content: flex-start;
}

.table-actions {
    display: grid;
    gap: 5px;
    min-width: 76px;
}

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

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

.quantity-positive {
    color: #17643a;
    font-weight: 700;
}

.quantity-negative {
    color: var(--red);
    font-weight: 700;
}

.inline-details {
    min-width: 90px;
}

.inline-details summary,
.audit-details summary {
    color: var(--teal-dark);
    font-weight: 700;
    cursor: pointer;
}

.inline-form {
    display: grid;
    min-width: 230px;
    gap: 8px;
    margin-top: 8px;
}

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

.role-card {
    display: grid;
    align-content: start;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    background: #fbfcfb;
}

.role-card h2,
.role-card p {
    margin-bottom: 4px;
}

.role-card fieldset {
    display: grid;
    gap: 7px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.role-card legend {
    padding: 0 5px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.permission-line {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
}

.permission-line input {
    width: auto;
}

.activity-table code {
    white-space: nowrap;
}

.audit-details {
    min-width: 80px;
}

.audit-details pre {
    width: min(480px, 70vw);
    max-height: 260px;
    overflow: auto;
    border-radius: 7px;
    padding: 10px;
    background: #18221f;
    color: #eaf2ef;
    font-size: 0.72rem;
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .catalog-grid,
    .product-detail,
    .notes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .product-modal-content {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    }

    .branding-grid,
    .category-add-grid,
    .role-grid,
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-add-grid .button {
        align-self: end;
    }

    body:not(.admin-body) .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    }
}

@media (max-width: 720px) {
    .product-modal {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .product-modal-content {
        display: block;
        overflow-y: auto;
    }

    .modal-gallery {
        display: grid;
        min-height: min(62vh, 520px);
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .modal-detail-copy {
        overflow: visible;
        padding: 24px 18px 32px;
    }

    .product-modal-close {
        position: fixed;
        top: max(10px, env(safe-area-inset-top));
        right: 10px;
    }

    .carousel-arrow {
        width: 40px;
        height: 40px;
    }

    .carousel-arrow-prev {
        left: 10px;
    }

    .carousel-arrow-next {
        right: 10px;
    }
}

@media (max-width: 640px) {
    .header-grid,
    .toolbar-heading,
    .footer-grid,
    .admin-title-row,
    .product-meta,
    .card-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .catalog-grid,
    .notes-grid,
    .form-grid,
    .image-manager-grid,
    .bilingual-row,
    .branding-grid,
    .category-add-grid,
    .role-grid,
    .metric-grid,
    .metric-grid-three,
    .qr-product-panel,
    .photo-source-grid,
    .quick-sale-product {
        grid-template-columns: 1fr;
    }

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

    .pending-photo-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-sale-product img {
        width: min(230px, 100%);
        justify-self: center;
    }

    .quick-sale-main-action {
        width: 100%;
    }

    .sale-product-results {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        max-height: min(58vh, 520px);
        border-radius: 16px;
        padding: 8px;
    }

    .sale-product-result {
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 68px;
    }

    .sale-product-result-price {
        grid-column: 2;
    }

    .sale-product-selected {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .sale-product-change {
        grid-column: 1 / -1;
        justify-self: stretch;
        min-height: 42px;
    }

    .filter-bar,
    .action-row,
    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar label,
    .filter-bar .grow-field {
        width: 100%;
        min-width: 0;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .admin-nav,
    .language-switch,
    .category-nav {
        width: 100%;
    }

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

    .admin-nav a,
    .language-switch a,
    .category-nav a {
        flex: 1;
        text-align: center;
    }

    .admin-nav a {
        min-width: 0;
        padding-inline: 5px;
        overflow-wrap: anywhere;
    }

    .admin-user-link small {
        margin-left: 0;
    }

    .settings-panel {
        width: calc(100% - 20px);
        padding: 14px;
    }

    .settings-tabs {
        margin-inline: -14px;
        padding-inline: 14px;
    }

    .settings-section {
        padding: 16px;
    }

    .settings-section-heading,
    .settings-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-section-heading > p {
        text-align: left;
    }

    .upload-card {
        grid-template-columns: 94px minmax(0, 1fr);
    }

    .branding-preview {
        width: 94px;
        height: 94px;
    }

    .check-line {
        grid-column: 1 / -1;
    }

    .settings-save-bar {
        bottom: 6px;
    }

    body:not(.admin-body) .container {
        width: calc(100% - 20px);
    }

    body:not(.admin-body) .header-grid {
        min-height: 54px;
        align-items: center;
        flex-direction: row;
    }

    body:not(.admin-body) .public-brand-logo {
        width: 185px;
        height: 36px;
    }

    body:not(.admin-body) .brand-hero {
        padding: 10px 0;
    }

    body:not(.admin-body) .campaign-hero {
        padding: 10px 0;
    }

    body:not(.admin-body) .brand-hero-frame {
        width: calc(100% - 20px);
        border-radius: 8px;
    }

    body:not(.admin-body) .brand small {
        display: none;
    }

    body:not(.admin-body) .language-switch {
        width: auto;
    }

    body:not(.admin-body) .language-switch a {
        flex: 0 0 auto;
        padding: 6px 10px;
    }

    body:not(.admin-body) .catalog-toolbar {
        padding: 6px 0 7px;
    }

    body:not(.admin-body) .catalog-toolbar-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    body:not(.admin-body) .toolbar-heading {
        margin: 0;
    }

    body:not(.admin-body) .toolbar-heading p {
        display: none;
    }

    body:not(.admin-body) h1 {
        font-size: 1.15rem;
    }

    body:not(.admin-body) .search-form {
        width: 100%;
    }

    body:not(.admin-body) .search-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body:not(.admin-body) .search-row .button {
        padding-inline: 13px;
    }

    body:not(.admin-body) .category-nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    body:not(.admin-body) .category-nav::-webkit-scrollbar {
        display: none;
    }

    body:not(.admin-body) .category-nav a,
    body:not(.admin-body) .catalog-sidebar .category-nav a {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }

    body:not(.admin-body) .catalog-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding-top: 10px;
    }

    body:not(.admin-body) .catalog-sidebar {
        position: sticky;
        z-index: 20;
        top: 6px;
        min-width: 0;
        margin-inline: -4px;
        border-radius: 11px;
        padding: 4px;
        background: var(--catalog-bg);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    }

    body:not(.admin-body) .catalog-sidebar h2 {
        display: none;
    }

    body:not(.admin-body) .category-menu-toggle {
        display: grid;
        width: 100%;
        min-height: 44px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        border: 1px solid var(--catalog-border);
        border-radius: 9px;
        padding: 9px 11px;
        background: var(--catalog-surface);
        color: var(--catalog-text);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }

    body:not(.admin-body) .category-menu-toggle > span:first-child {
        color: var(--catalog-muted);
        font-size: 0.76rem;
        font-weight: 700;
    }

    body:not(.admin-body) .category-menu-toggle strong {
        min-width: 0;
        overflow: hidden;
        font-size: 0.84rem;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body:not(.admin-body) .category-menu-chevron {
        width: 9px;
        height: 9px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 160ms ease;
    }

    body:not(.admin-body) .category-menu-toggle[aria-expanded="true"] .category-menu-chevron {
        transform: translateY(2px) rotate(225deg);
    }

    body:not(.admin-body) .category-menu-toggle:focus-visible {
        outline: 3px solid rgba(15, 118, 110, 0.35);
        outline-offset: 2px;
    }

    body:not(.admin-body) .catalog-sidebar .category-nav {
        align-items: stretch;
        flex-direction: column;
        max-height: min(55vh, 360px);
        margin-top: 6px;
        padding: 6px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body:not(.admin-body) .catalog-sidebar .category-nav[hidden] {
        display: none;
    }

    body:not(.admin-body) .catalog-sidebar .category-nav a {
        flex: 0 0 auto;
        width: 100%;
        text-align: left;
        white-space: normal;
    }

    body:not(.admin-body) .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 8px;
    }

    body:not(.admin-body) .product-meta,
    body:not(.admin-body) .card-actions {
        align-items: center;
        flex-direction: row;
    }

    body:not(.admin-body) .product-card .product-meta > strong {
        font-size: 0.94rem;
    }

    body:not(.admin-body) .product-card h2 {
        font-size: 0.84rem;
    }

    body:not(.admin-body) .product-card .product-meta span {
        max-width: 58%;
        padding: 3px 5px;
        font-size: 0.61rem;
        line-height: 1.15;
        text-align: right;
        white-space: normal;
    }

    body:not(.admin-body) .product-card .product-quantity {
        font-size: 0.7rem;
    }

    body:not(.admin-body) .product-card .card-actions .button {
        min-height: 30px;
        padding: 5px 6px;
        font-size: 0.68rem;
    }

    body:not(.admin-body) .product-card .card-actions .contact-button,
    body:not(.admin-body) .product-card .card-actions .contact-chooser .contact-button {
        min-height: 44px;
        font-size: 0.74rem;
    }

    body:not(.admin-body) .notes-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-brand-logo {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-modal[open],
    .modal-spinner {
        animation: none;
    }
}

/* Homepage Campaign and Promotion Engine */
.campaign-price {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.16rem;
    flex-direction: column;
}

.price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.38rem;
    line-height: 1.15;
}

.price-label {
    color: var(--muted, #64748b);
    font-size: 0.58em;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.price-row-current strong {
    font-size: 1em;
}

.price-savings {
    color: #087443;
    font-size: 0.58em;
    font-weight: 800;
}

[data-theme="dark"] .price-savings {
    color: #6ce9a6;
}

body:not(.admin-body) .product-card .product-meta .campaign-price {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0;
    background: transparent;
    color: var(--catalog-strong);
}

body:not(.admin-body) .product-card .campaign-price-card {
    font-size: 0.92rem;
}

body:not(.admin-body) .product-card .price-label,
body:not(.admin-body) .product-card .price-savings {
    font-size: 0.62rem;
}

.campaign-price del {
    color: var(--muted, #64748b);
    font-size: 0.78em;
    font-weight: 600;
    text-decoration-thickness: 2px;
}

.campaign-price strong {
    color: #b42318;
    font: inherit;
    font-weight: 900;
}

[data-theme="dark"] .campaign-price strong {
    color: #fda29b;
}

.campaign-product-badge {
    position: absolute;
    z-index: 2;
    top: 0.75rem;
    left: 0.75rem;
    max-width: calc(100% - 1.5rem);
    padding: 0.42rem 0.62rem;
    border-radius: 999px;
    background: #b42318;
    box-shadow: 0 8px 24px rgb(15 23 42 / 22%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1;
    text-transform: uppercase;
}

.product-card-media {
    position: relative;
}

.campaign-detail-badge {
    display: block;
    width: fit-content;
    margin-top: 0.55rem;
    padding: 0.38rem 0.58rem;
    border-radius: 999px;
    background: #b42318;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.campaign-hero {
    padding: clamp(0.85rem, 2vw, 1.5rem) 0;
}

.campaign-carousel {
    position: relative;
    height: 400px;
    min-height: 400px;
    border-radius: clamp(1.1rem, 2vw, 1.8rem);
    outline: none;
}

body:not(.admin-body) .campaign-hero {
    padding: 14px 0;
    background: var(--catalog-bg);
}

body:not(.admin-body) .campaign-carousel {
    width: min(920px, 100%);
    height: auto;
    min-height: 0;
    margin-inline: auto;
    aspect-ratio: 2.34;
}

.campaign-carousel:focus-visible {
    box-shadow: 0 0 0 4px rgb(15 118 110 / 28%);
}

.campaign-slides {
    height: 100%;
}

.campaign-slide {
    --campaign-bg: linear-gradient(135deg, #083c3b 0%, #0f766e 58%, #15a89c 100%);
    --campaign-ink: #fff;
    --campaign-muted: #d7fffb;
    --campaign-accent: #ffd98c;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: inherit;
    background: var(--campaign-bg);
    box-shadow: 0 22px 60px rgb(15 23 42 / 20%);
    color: var(--campaign-ink);
}

.campaign-slide[hidden] {
    display: none;
}

.campaign-theme-gold,
.campaign-preview-card.campaign-theme-gold {
    --campaign-bg: linear-gradient(135deg, #3c2710 0%, #9a5b13 55%, #d5962b 100%);
    --campaign-ink: #fffdf5;
    --campaign-muted: #ffedc4;
    --campaign-accent: #fff0a6;
}

.campaign-theme-midnight,
.campaign-preview-card.campaign-theme-midnight {
    --campaign-bg: linear-gradient(135deg, #111827 0%, #312e81 56%, #4338ca 100%);
    --campaign-ink: #fff;
    --campaign-muted: #e0e7ff;
    --campaign-accent: #c4b5fd;
}

.campaign-theme-berry,
.campaign-preview-card.campaign-theme-berry {
    --campaign-bg: linear-gradient(135deg, #4a1230 0%, #9d174d 56%, #db2777 100%);
    --campaign-ink: #fff;
    --campaign-muted: #fce7f3;
    --campaign-accent: #fbcfe8;
}

.campaign-slide-copy {
    align-self: center;
    max-height: 100%;
    padding: 1.25rem clamp(1.35rem, 3vw, 2.5rem);
    overflow: hidden;
}

.campaign-hero-badge,
.campaign-section-badge,
.campaign-preview-badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.5rem 0.72rem;
    border-radius: 999px;
    background: var(--campaign-accent, #ffd98c);
    color: #34220b;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.campaign-kicker {
    margin: 0.7rem 0 0.25rem;
    color: var(--campaign-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.campaign-slide h2 {
    max-width: 13ch;
    margin: 0;
    color: inherit;
    font-size: clamp(1.8rem, 3.5vw, 3.15rem);
    letter-spacing: -0.045em;
    line-height: 1;
}

.campaign-slide-copy > p:not(.campaign-kicker) {
    max-width: 44rem;
    display: -webkit-box;
    margin: 0.65rem 0;
    overflow: hidden;
    color: var(--campaign-muted);
    font-size: clamp(0.9rem, 1.35vw, 1.04rem);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.campaign-slide h3 {
    display: -webkit-box;
    margin: 0.65rem 0 0.2rem;
    overflow: hidden;
    font-size: clamp(0.98rem, 1.65vw, 1.2rem);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.campaign-slide h3 a {
    color: inherit;
    text-decoration: none;
}

.campaign-slide .campaign-category-focus {
    width: fit-content;
    margin: 0.65rem 0;
    padding: 0.42rem 0.65rem;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 0.7rem;
    background: rgb(255 255 255 / 10%);
    color: var(--campaign-accent);
    font-size: clamp(1rem, 2vw, 1.35rem);
}

.campaign-hero-price {
    margin-bottom: 0.65rem;
    font-size: clamp(1.05rem, 2vw, 1.4rem);
}

.campaign-hero-price .campaign-price del {
    color: var(--campaign-muted);
}

.campaign-hero-price .campaign-price strong {
    color: var(--campaign-accent);
}

.campaign-cta {
    border-color: #fff;
    background: #fff;
    color: #18342f;
}

.campaign-cta:hover {
    border-color: var(--campaign-accent);
    background: var(--campaign-accent);
    color: #241807;
}

.campaign-slide-visual {
    position: relative;
    display: grid;
    min-height: 100%;
    place-items: center;
    overflow: hidden;
}

.campaign-slide-visual > a {
    display: grid;
    width: 100%;
    height: 100%;
    padding: clamp(0.8rem, 2vw, 1.5rem);
    background: rgb(255 255 255 / 94%);
    place-items: center;
}

.campaign-slide-visual > a > img {
    width: min(82%, 300px);
    height: min(82%, 300px);
    min-height: 0;
    border-radius: 1rem;
    object-fit: contain;
}

.campaign-slide-visual::after {
    position: absolute;
    inset: 0 auto 0 0;
    width: 30%;
    background: linear-gradient(90deg, rgb(8 60 59 / 65%), transparent);
    content: "";
    pointer-events: none;
}

.campaign-logo-slide .campaign-slide-visual {
    height: 100%;
    min-height: 0;
    padding: 0;
    background: #f39200 url("branding/dees-home-banner.png") center / contain no-repeat;
}

.campaign-logo-slide .campaign-slide-visual::after {
    display: none;
}

.campaign-slide-brand-mark {
    position: absolute;
    z-index: 2;
    top: 0.8rem;
    right: 0.8rem;
    width: 62px;
    height: 62px;
    border: 4px solid rgb(255 255 255 / 90%);
    border-radius: 22%;
    background: #fff;
    box-shadow: 0 8px 24px rgb(15 23 42 / 22%);
    object-fit: cover;
}

.campaign-logo-slide {
    grid-template-columns: 1fr;
}

.campaign-logo-slide .campaign-slide-copy,
.campaign-logo-slide .campaign-logo-image,
.campaign-logo-slide .campaign-slide-visual span {
    display: none;
}

.campaign-layout-image_focus .campaign-slide-copy {
    position: relative;
    z-index: 1;
    align-self: end;
    background: linear-gradient(0deg, rgb(0 0 0 / 55%), transparent);
}

.campaign-layout-compact {
    min-height: 0;
}

.campaign-layout-compact .campaign-slide-copy {
    padding: clamp(1.5rem, 3vw, 2.75rem);
}

.campaign-layout-compact h2 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
}

body:not(.admin-body) .campaign-slide-copy,
body:not(.admin-body) .campaign-layout-compact .campaign-slide-copy {
    padding: 0.85rem clamp(0.9rem, 2.2vw, 1.75rem);
}

body:not(.admin-body) .campaign-slide h2,
body:not(.admin-body) .campaign-layout-compact h2 {
    display: -webkit-box;
    max-width: 14ch;
    overflow: hidden;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    line-height: 1.02;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body:not(.admin-body) .campaign-hero-badge {
    padding: 0.42rem 0.6rem;
    font-size: 0.66rem;
}

body:not(.admin-body) .campaign-kicker {
    margin: 0.42rem 0 0.18rem;
    font-size: 0.68rem;
}

body:not(.admin-body) .campaign-slide-copy > p:not(.campaign-kicker) {
    margin: 0.42rem 0;
    font-size: clamp(0.78rem, 1.15vw, 0.92rem);
    line-height: 1.35;
}

body:not(.admin-body) .campaign-slide h3 {
    margin: 0.42rem 0 0.15rem;
    font-size: clamp(0.82rem, 1.25vw, 1rem);
    line-height: 1.25;
}

body:not(.admin-body) .campaign-slide .campaign-category-focus {
    margin: 0.42rem 0;
    font-size: clamp(0.82rem, 1.35vw, 1rem);
}

body:not(.admin-body) .campaign-hero-price {
    margin-bottom: 0.4rem;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.2;
}

body:not(.admin-body) .campaign-cta {
    min-height: 36px;
    padding: 0.48rem 0.75rem;
    font-size: 0.82rem;
}

.campaign-carousel-controls {
    position: absolute;
    z-index: 3;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 999px;
    background: rgb(15 23 42 / 60%);
    backdrop-filter: blur(12px);
}

.campaign-carousel-controls[hidden] {
    display: none;
}

.campaign-carousel-controls > button {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 30%);
    border-radius: 50%;
    background: rgb(255 255 255 / 10%);
    color: #fff;
    cursor: pointer;
    font-size: 1.7rem;
    place-items: center;
}

.campaign-carousel-controls button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.campaign-indicators {
    display: flex;
    gap: 0.38rem;
}

.campaign-indicators button {
    width: 0.7rem;
    height: 0.7rem;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.campaign-indicators button[aria-current="true"] {
    background: #fff;
}

.campaign-product-section {
    padding: clamp(1.5rem, 4vw, 3rem) 0;
    background: linear-gradient(180deg, rgb(15 118 110 / 7%), transparent);
}

.campaign-section-theme-gold {
    background: linear-gradient(180deg, rgb(183 121 31 / 10%), transparent);
}

.campaign-section-theme-midnight {
    background: linear-gradient(180deg, rgb(67 56 202 / 9%), transparent);
}

.campaign-section-theme-berry {
    background: linear-gradient(180deg, rgb(219 39 119 / 8%), transparent);
}

.campaign-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.campaign-section-heading h2 {
    margin: 0.65rem 0 0.2rem;
    font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.campaign-section-heading p {
    max-width: 52rem;
    margin: 0;
    color: var(--muted, #64748b);
}

.campaign-section-badge {
    background: var(--teal);
    color: #fff;
}

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

.campaign-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.campaign-status-active {
    border-color: #86d7a8;
    background: #eafbf1;
    color: #176b3a;
}

.campaign-status-scheduled {
    border-color: #9dc7ed;
    background: #eef7ff;
    color: #175a8c;
}

.campaign-status-expired,
.campaign-status-disabled {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #475569;
}

.campaign-status-draft {
    border-color: #f1d18b;
    background: #fff8e6;
    color: #875b0b;
}

.campaign-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.2rem 0;
}

.campaign-filter-tabs a {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border, #d8e0e7);
    border-radius: 999px;
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}

.campaign-filter-tabs a[aria-current="page"] {
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
}

.campaign-table-actions {
    align-items: center;
}

.campaign-table-actions form {
    margin: 0;
}

.text-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--teal);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.text-button-danger {
    color: #b42318;
}

.campaign-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: clamp(1.25rem, 3vw, 2.25rem);
    align-items: start;
}

.campaign-builder-fields {
    min-width: 0;
}

.campaign-builder-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.campaign-builder-message {
    color: var(--muted, #64748b);
    font-weight: 700;
}

.campaign-form-step {
    margin: 0 0 1.15rem;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--border, #d8e0e7);
    border-radius: 1rem;
}

.campaign-form-step legend {
    padding: 0 0.45rem;
    font-size: 1.03rem;
    font-weight: 900;
}

.campaign-form-step legend span {
    display: inline-grid;
    width: 1.8rem;
    height: 1.8rem;
    margin-right: 0.35rem;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    place-items: center;
}

.campaign-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

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

.campaign-choice {
    position: relative;
    display: block;
    cursor: pointer;
}

.campaign-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.campaign-choice span {
    display: grid;
    min-height: 3.2rem;
    padding: 0.7rem;
    border: 1px solid var(--border, #d8e0e7);
    border-radius: 0.75rem;
    background: var(--surface, #fff);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    place-items: center;
    text-align: center;
}

.campaign-choice input:checked + span {
    border-color: var(--teal);
    box-shadow: inset 0 0 0 2px var(--teal);
    color: var(--teal-dark);
}

.campaign-choice input:focus-visible + span {
    outline: 3px solid rgb(15 118 110 / 28%);
    outline-offset: 2px;
}

.campaign-mode-panel,
.campaign-pricing-panel {
    margin: 0.8rem 0;
    padding: 1rem;
    border-radius: 0.8rem;
    background: rgb(15 118 110 / 6%);
}

.campaign-mode-panel[hidden],
.campaign-pricing-panel[hidden],
.campaign-label-help[hidden] {
    display: none;
}

.campaign-limit-field {
    max-width: 280px;
}

.campaign-input-suffix {
    display: flex;
    align-items: stretch;
}

.campaign-input-suffix input {
    border-radius: 0.55rem 0 0 0.55rem;
}

.campaign-input-suffix span {
    display: grid;
    padding: 0 0.85rem;
    border: 1px solid var(--border, #d8e0e7);
    border-left: 0;
    border-radius: 0 0.55rem 0.55rem 0;
    background: rgb(15 118 110 / 8%);
    font-weight: 800;
    place-items: center;
}

.campaign-search-results,
.campaign-selected-products {
    display: grid;
    gap: 0.55rem;
    max-height: 360px;
    margin: 0.75rem 0 1rem;
    overflow: auto;
}

.campaign-selector-product {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid var(--border, #d8e0e7);
    border-radius: 0.75rem;
    background: var(--surface, #fff);
}

.campaign-selector-product img {
    width: 58px;
    height: 58px;
    border-radius: 0.55rem;
    object-fit: cover;
}

.campaign-selector-product span {
    min-width: 0;
}

.campaign-selector-product strong,
.campaign-selector-product small {
    display: block;
}

.campaign-selector-product small {
    margin-top: 0.2rem;
    color: var(--muted, #64748b);
    font-size: 0.77rem;
}

.campaign-selector-product em {
    color: #b42318;
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 800;
}

.campaign-selector-product [data-remove-product] {
    display: grid;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid #f0b4ae;
    border-radius: 50%;
    background: #fff1f0;
    color: #b42318;
    cursor: pointer;
    font-size: 1.2rem;
    place-items: center;
}

.campaign-search-product {
    grid-template-columns: 58px minmax(0, 1fr) auto;
}

.campaign-search-product .button {
    min-width: 6.4rem;
}

.campaign-advanced {
    margin-bottom: 1rem;
    border: 1px solid var(--border, #d8e0e7);
    border-radius: 1rem;
}

.campaign-advanced summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 900;
}

.campaign-advanced-content {
    padding: 0 1.25rem 1.25rem;
}

.campaign-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.campaign-checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem;
    border: 1px solid var(--border, #d8e0e7);
    border-radius: 0.65rem;
}

.campaign-checkbox-grid input {
    width: 1.15rem;
    height: 1.15rem;
}

.campaign-save-bar {
    position: sticky;
    z-index: 5;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.9rem;
    border: 1px solid var(--border, #d8e0e7);
    border-radius: 0.85rem;
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 -10px 30px rgb(15 23 42 / 8%);
    backdrop-filter: blur(10px);
}

.campaign-live-preview {
    position: sticky;
    top: 1rem;
    min-width: 0;
}

.campaign-preview-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.campaign-preview-heading h2 {
    margin: 0;
}

.campaign-preview-heading > span {
    max-width: 15rem;
    color: var(--muted, #64748b);
    font-size: 0.74rem;
    text-align: right;
}

.campaign-preview-card {
    --campaign-bg: linear-gradient(135deg, #083c3b, #0f766e);
    --campaign-ink: #fff;
    --campaign-muted: #d7fffb;
    --campaign-accent: #ffd98c;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 410px;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--campaign-bg);
    box-shadow: 0 20px 45px rgb(15 23 42 / 18%);
    color: var(--campaign-ink);
}

.campaign-preview-copy {
    align-self: center;
    padding: clamp(1.1rem, 3vw, 2rem);
}

.campaign-preview-copy h3 {
    margin: 0.8rem 0 0.5rem;
    color: inherit;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1;
}

.campaign-preview-copy p {
    color: var(--campaign-muted);
}

.campaign-preview-copy > strong {
    display: block;
    margin-top: 1.2rem;
}

.campaign-preview-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.45rem 0 1rem;
}

.campaign-preview-price del {
    color: var(--campaign-muted);
}

.campaign-preview-price strong {
    color: var(--campaign-accent);
    font-size: 1.35rem;
}

.campaign-preview-visual {
    position: relative;
    min-height: 100%;
}

.campaign-preview-visual > img {
    width: 100%;
    height: 100%;
    min-height: 410px;
    object-fit: cover;
}

.campaign-preview-logo {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem;
    border-radius: 0.75rem;
    background: rgb(15 23 42 / 75%);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.campaign-preview-logo[hidden] {
    display: none;
}

.campaign-preview-logo img {
    width: 38px;
    height: 38px;
    border-radius: 0.55rem;
    object-fit: cover;
}

.campaign-preview-products {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.65rem;
    overflow: auto;
}

.campaign-preview-products img {
    width: 62px;
    height: 62px;
    border: 2px solid #fff;
    border-radius: 0.6rem;
    box-shadow: 0 4px 12px rgb(15 23 42 / 14%);
    object-fit: cover;
}

.campaign-preview-card.campaign-layout-image_focus {
    grid-template-columns: 0.82fr 1.18fr;
}

.campaign-preview-card.campaign-layout-compact {
    min-height: 330px;
}

.campaign-preview-card.campaign-layout-compact .campaign-preview-visual > img {
    min-height: 330px;
}

.campaign-server-preview + .campaign-hero,
.admin-body .campaign-preview-surface {
    margin-bottom: 1.5rem;
}

.admin-body .campaign-hero .container,
.admin-body .campaign-product-section .container {
    width: min(1180px, calc(100% - 2rem));
}

@media (max-width: 1050px) {
    .campaign-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .campaign-builder-layout {
        grid-template-columns: 1fr;
    }

    .campaign-live-preview {
        position: static;
    }

    .campaign-preview-card {
        min-height: 360px;
    }

    .campaign-preview-visual > img {
        min-height: 360px;
    }
}

@media (max-width: 720px) {
    .campaign-carousel {
        height: auto;
        min-height: 0;
    }

    .campaign-slide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 1fr;
        min-height: 0;
    }

    .campaign-logo-slide {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .campaign-logo-slide .campaign-slide-visual {
        grid-column: 1 / -1;
        background-position: center;
        background-size: contain;
    }

    body:not(.admin-body) .campaign-slide-copy {
        position: relative;
        z-index: 2;
        align-self: center;
        padding: 0.5rem 0.6rem;
    }

    body:not(.admin-body) .campaign-layout-compact .campaign-slide-copy {
        padding: 0.5rem 0.6rem;
    }

    .campaign-slide:not(.campaign-logo-slide) .campaign-slide-copy > p:not(.campaign-kicker) {
        display: none;
    }

    .campaign-slide:not(.campaign-logo-slide) .campaign-kicker {
        display: none;
    }

    body:not(.admin-body) .campaign-slide h2 {
        display: -webkit-box;
        max-width: none;
        overflow: hidden;
        font-size: clamp(0.88rem, 4vw, 1.12rem);
        line-height: 1.05;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    body:not(.admin-body) .campaign-layout-compact h2 {
        font-size: clamp(0.88rem, 4vw, 1.12rem);
    }

    body:not(.admin-body) .campaign-hero-badge {
        padding: 0.26rem 0.38rem;
        font-size: 0.52rem;
        letter-spacing: 0.045em;
    }

    body:not(.admin-body) .campaign-slide h3 {
        margin: 0.26rem 0 0.12rem;
        font-size: 0.67rem;
        line-height: 1.1;
        -webkit-line-clamp: 1;
    }

    body:not(.admin-body) .campaign-slide .campaign-category-focus {
        margin: 0.28rem 0;
        padding: 0.22rem 0.34rem;
        border-radius: 0.42rem;
        font-size: 0.67rem;
        line-height: 1.1;
    }

    body:not(.admin-body) .campaign-hero-price {
        margin-bottom: 0.28rem;
        font-size: 0.78rem;
        line-height: 1.05;
    }

    body:not(.admin-body) .campaign-cta {
        min-height: 28px;
        padding: 0.3rem 0.48rem;
        font-size: 0.67rem;
        line-height: 1;
    }

    .campaign-slide-visual {
        z-index: 1;
        min-height: 0;
    }

    .campaign-slide-visual > a > img {
        width: min(86%, 170px);
        height: min(86%, 150px);
        min-height: 0;
        max-height: 150px;
        border-radius: 0.55rem;
    }

    .campaign-slide-visual::after {
        inset: 0 auto 0 0;
        width: 18%;
        height: auto;
        background: linear-gradient(90deg, rgb(8 60 59 / 45%), transparent);
    }

    .campaign-carousel-controls {
        right: 0.4rem;
        bottom: 0.4rem;
        gap: 0.25rem;
        padding: 0.25rem;
        transform: none;
    }

    .campaign-carousel-controls > button {
        width: 1.65rem;
        height: 1.65rem;
        font-size: 1.08rem;
    }

    .campaign-indicators {
        gap: 0.22rem;
    }

    .campaign-indicators button {
        width: 0.45rem;
        height: 0.45rem;
    }

    .campaign-slide-brand-mark {
        top: 0.4rem;
        right: 0.4rem;
        width: 34px;
        height: 34px;
        border-width: 2px;
    }

    .campaign-section-heading {
        align-items: start;
        flex-direction: column;
    }

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

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

@media (max-width: 520px) {
    .campaign-product-grid {
        grid-template-columns: 1fr;
    }

    .campaign-carousel {
        height: auto;
        min-height: 0;
    }

    .campaign-slide {
        min-height: 0;
    }

    .campaign-carousel-controls > button {
        width: 1.65rem;
        height: 1.65rem;
    }

    .campaign-choice-grid,
    .campaign-type-grid,
    .campaign-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .campaign-preview-card {
        grid-template-columns: 1fr;
    }

    .campaign-preview-visual,
    .campaign-preview-visual > img {
        min-height: 230px;
    }

    .campaign-selector-product,
    .campaign-search-product {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .campaign-selector-product img {
        width: 52px;
        height: 52px;
    }

    .campaign-selector-product button,
    .campaign-selector-product em {
        grid-column: 2;
        justify-self: start;
    }

    .campaign-save-bar {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .campaign-slide,
    .campaign-slide *,
    .campaign-preview-card,
    .campaign-preview-card * {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
/* Guest access and permission-based email marketing */
.email-test-mode-banner {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #f0b429;
    border-radius: 10px;
    color: #664d03;
    background: #fff3cd;
}

.email-marketing-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1.5rem;
    padding: 0.55rem;
    border: 1px solid #dbe3eb;
    border-radius: 12px;
    background: #f8fafc;
}

.email-marketing-nav a {
    padding: 0.6rem 0.78rem;
    border-radius: 8px;
    color: #344054;
    font-weight: 750;
    text-decoration: none;
}

.email-marketing-nav a:hover,
.email-marketing-nav a:focus-visible,
.email-marketing-nav a[aria-current="page"] {
    color: #fff;
    background: var(--teal);
}

.email-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 2rem;
}

.email-stat-card {
    padding: 1rem;
    border: 1px solid #dbe3eb;
    border-radius: 12px;
    background: #fff;
}

.email-stat-card span,
.email-stat-card small {
    display: block;
    color: #667085;
}

.email-stat-card strong {
    display: block;
    margin: 0.2rem 0;
    color: var(--teal-dark);
    font-size: 1.8rem;
}

.email-admin-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 0.75rem;
    align-items: end;
    margin: 1rem 0;
}

.email-admin-filters label {
    display: grid;
    gap: 0.35rem;
    font-weight: 750;
}

.email-admin-filters input,
.email-admin-filters select,
.settings-form input,
.settings-form select,
.settings-form textarea,
.action-row input,
.action-row select {
    min-width: 0;
    max-width: 100%;
}

.campaign-product-choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.campaign-product-choice {
    display: grid !important;
    grid-template-columns: auto 56px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem !important;
    min-width: 0;
    padding: 0.7rem;
    border: 1px solid #dbe3eb;
    border-radius: 10px;
    background: #fff;
}

.campaign-product-choice input {
    width: 20px;
    height: 20px;
}

.campaign-product-choice img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
}

.campaign-product-choice span,
.campaign-product-choice strong,
.campaign-product-choice small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.campaign-product-choice strong,
.campaign-product-choice small {
    display: block;
}

.campaign-product-choice small {
    margin-top: 0.2rem;
    color: #667085;
}

.email-builder-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 1.25rem;
}

.email-preview-frame {
    width: 100%;
    min-height: 680px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
}

.email-mobile-preview {
    width: min(390px, 100%);
}

.email-code-preview {
    max-height: 520px;
    padding: 1rem;
    overflow: auto;
    white-space: pre-wrap;
    border-radius: 10px;
    color: #e2e8f0;
    background: #17212b;
}

@media (max-width: 900px) {
    .email-stat-grid,
    .email-admin-filters,
    .email-builder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .email-builder-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .email-stat-grid,
    .email-admin-filters {
        grid-template-columns: 1fr;
    }
}

.header-offers-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    border: 1px solid color-mix(in srgb, var(--gold) 75%, transparent);
    border-radius: 999px;
    color: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.header-offers-link:hover,
.header-offers-link:focus-visible {
    background: var(--gold);
    color: #17212b;
}

.subscription-welcome {
    width: min(760px, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 18px;
    color: #17212b;
    background: #fff;
    box-shadow: 0 24px 80px rgb(15 23 42 / 0.32);
}

.subscription-welcome::backdrop {
    background: rgb(15 23 42 / 0.58);
    backdrop-filter: blur(3px);
}

.subscription-welcome-shell {
    position: relative;
    padding: clamp(1.4rem, 4vw, 2.5rem);
}

.subscription-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #eef2f6;
    color: #17212b;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.subscription-welcome h2,
.email-public-panel h1 {
    margin: 0.25rem 0 0.75rem;
    color: var(--teal-dark);
}

.subscription-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.subscription-options article {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    border: 1px solid #dbe3eb;
    border-radius: 14px;
    background: #f8fafc;
}

.subscription-options h3 {
    margin: 0;
}

.subscription-options p {
    flex: 1;
    color: #475467;
}

.email-offer-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.email-offer-form > label:not(.choice-row),
.email-reason-form label {
    display: grid;
    gap: 0.4rem;
    font-weight: 800;
}

.email-offer-form input[type="email"],
.email-offer-form input[type="text"],
.email-offer-form input:not([type]),
.email-reason-form textarea {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    font-size: 16px;
}

.email-offer-form fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem 1rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid #dbe3eb;
    border-radius: 12px;
}

.email-offer-form legend {
    padding: 0 0.4rem;
    font-weight: 800;
}

.choice-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    font-weight: 650;
}

.choice-row input {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    accent-color: var(--teal);
}

.consent-row {
    align-items: flex-start;
    padding: 0.9rem;
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    background: #fffbeb;
}

.optional-label,
.email-privacy-note,
.email-form-status {
    color: #667085;
    font-size: 0.88rem;
    font-weight: 500;
}

.email-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.email-form-errors {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    color: #991b1b;
    background: #fef2f2;
}

.email-form-errors p {
    margin: 0;
}

.email-public-page {
    padding-top: clamp(2rem, 7vw, 5rem);
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

.email-public-panel {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: clamp(1.35rem, 5vw, 2.5rem);
    border: 1px solid #dbe3eb;
    border-radius: 18px;
    background: var(--surface, #fff);
    box-shadow: 0 18px 50px rgb(15 23 42 / 0.1);
}

.email-reason-form {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.subscription-success {
    padding: 1rem 0;
    text-align: center;
}

@media (max-width: 680px) {
    .header-offers-link {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .subscription-options,
    .email-offer-form fieldset {
        grid-template-columns: 1fr;
    }

    .subscription-welcome {
        width: calc(100% - 0.5rem);
        max-width: none;
        max-height: calc(100dvh - 0.5rem);
        border-radius: 14px;
        overscroll-behavior: contain;
    }

    .subscription-welcome-shell {
        padding:
            max(3.8rem, calc(env(safe-area-inset-top) + 3rem))
            max(1rem, env(safe-area-inset-right))
            max(1.25rem, env(safe-area-inset-bottom))
            max(1rem, env(safe-area-inset-left));
    }

    .subscription-close {
        position: fixed;
        top: max(0.65rem, env(safe-area-inset-top));
        right: max(0.65rem, env(safe-area-inset-right));
    }

    .subscription-welcome h2,
    .email-public-panel h1 {
        font-size: clamp(1.45rem, 7vw, 1.9rem);
        overflow-wrap: anywhere;
    }

    .subscription-options {
        gap: 0.75rem;
        margin: 1rem 0;
    }

    .subscription-options article {
        padding: 1rem;
    }

    .subscription-options .button,
    .email-form-actions .button,
    .email-reason-form .button {
        width: 100%;
        min-height: 48px;
    }

    .email-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .email-offer-form {
        gap: 0.85rem;
        margin-top: 1rem;
    }

    .email-offer-form fieldset {
        max-width: 100%;
        padding: 0.85rem;
    }

    .email-public-page {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    .email-public-panel {
        width: 100%;
        padding: 1rem;
        border-radius: 12px;
        overflow-wrap: anywhere;
    }

    .email-marketing-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .email-marketing-nav a {
        flex: 0 0 auto;
        min-height: 44px;
        white-space: nowrap;
    }

    .email-admin-filters .button,
    .email-admin-filters + .button,
    .action-row .button {
        width: 100%;
    }

    .settings-section {
        padding: 1rem;
    }

    .settings-section-heading {
        display: block;
    }

    .settings-section-heading > p {
        max-width: none;
        margin-top: 0.5rem;
        text-align: left;
    }

    .settings-form input,
    .settings-form select,
    .settings-form textarea,
    .email-admin-filters input,
    .email-admin-filters select,
    .action-row input,
    .action-row select {
        font-size: 16px;
    }

    .campaign-product-choice-list {
        grid-template-columns: 1fr;
    }

    .email-preview-frame {
        min-height: 520px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .subscription-welcome {
        scroll-behavior: auto;
    }
}
