*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --success-text: #86efac;
    --shipping-text: #7dd3fc;
    --warning-text: #fbbf24;
    --radius: 12px;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    --link: #93c5fd;
    --page-bg: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    --inset-bg: #0b1220;
    --control-bg: #111827;
    --control-hover: #475569;
    --control-border-hover: #64748b;
}

html.theme-day {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-hover: #e2e8f0;
    --border: #cbd5e1;
    --text: #0f172a;
    --text-muted: #475569;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #15803d;
    --success-text: #047857;
    --shipping-text: #0369a1;
    --warning-text: #a16207;
    --shadow: 0 20px 40px -16px rgba(15, 23, 42, 0.18);
    --link: #1d4ed8;
    --page-bg: linear-gradient(135deg, #e2e8f0 0%, #dbeafe 45%, #e2e8f0 100%);
    --inset-bg: #f8fafc;
    --control-bg: #f1f5f9;
    --control-hover: #cbd5e1;
    --control-border-hover: #94a3b8;
}

body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem;
}

body > main {
    flex: 1 0 auto;
    width: 100%;
}

body:not(.body-store) > main {
    display: flex;
    align-items: center;
    justify-content: center;
}

body:not(.body-store) > main > .card {
    width: 100%;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
}

.page {
    width: 100%;
    max-width: min(420px, 100%);
    min-width: 0;
}

.page-wide {
    width: 100%;
    max-width: min(720px, 100%);
    min-width: 0;
}

.page-register {
    width: 100%;
    max-width: min(480px, 100%);
    min-width: 0;
}

.page-store {
    width: 100%;
    max-width: min(1100px, 100%);
    min-width: 0;
}

/* Keep store/admin pages full intended width even when .page is also present */
.page.page-store {
    max-width: min(1100px, 100%);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.subtitle {
    margin: 0 0 1.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 520px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    max-width: 100%;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.shipping-country-hint {
    display: none;
    margin: 0.45rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.form-group:hover .shipping-country-hint,
.form-group:focus-within .shipping-country-hint {
    display: block;
}

.shipping-states-notice {
    margin: 0.45rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: var(--control-hover);
    cursor: not-allowed;
    opacity: 0.75;
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text);
    width: auto;
}

.btn-secondary:hover {
    background: var(--control-hover);
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: var(--success-text);
}

.alert-success p {
    margin: 0;
}

.alert-success p + p,
.alert-success-note {
    margin-top: 0.55rem;
}

.btn.is-receipt-locked,
span.btn.is-receipt-locked {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    filter: grayscale(0.15);
}

.return-request-form fieldset.is-return-locked {
    opacity: 0.55;
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.home-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.home-header > div:first-child {
    flex: 1;
    min-width: 0;
}

.home-header h1 {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
}

.home-header .store-nav,
.home-header .header-actions,
.home-header .shop-guest-auth {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.home-header .store-nav {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    order: -1;
    margin-left: 0;
    justify-content: space-between;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
}

.header-actions-centered {
    justify-content: center;
    margin-top: 1rem;
}

.header-actions .btn {
    width: auto;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--link);
}

.home-signed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.home-signed-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.home-signed-row .welcome-badge {
    margin-bottom: 0;
}

.btn-screen-mode--header {
    display: none;
}

.btn-screen-mode--footer {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

.header-logout-form.btn-screen-mode--header {
    display: none;
}

.header-logout-form.btn-screen-mode--footer {
    display: inline-flex;
}

.page-store .home-header .subtitle,
.page-wide .home-header .subtitle {
    margin-bottom: 0.35rem;
}

.shop-brand-title {
    color: var(--primary);
    font-size: clamp(1.15rem, 0.7rem + 4.2vw, 2.15rem);
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
    word-wrap: normal;
    hyphens: manual;
    -webkit-hyphens: manual;
}

.shop-page .card .shop-brand-title {
    overflow-wrap: normal;
    word-break: keep-all;
}

/* Shop page only */
.shop-page .shop-home-header {
    flex-wrap: wrap;
}

.shop-page .shop-home-header > div:first-child {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
}

.shop-page .shop-home-header .store-nav,
.shop-page .shop-home-header .shop-guest-auth {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
}

.shop-page .shop-home-header .store-nav {
    justify-content: space-between;
}

.shop-page .shop-home-header .shop-guest-auth {
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    align-items: center;
}

.shop-page .shop-home-header .shop-guest-auth .store-nav {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    order: 0;
    margin-left: 0;
    justify-content: flex-end;
}

@media (min-width: 720px) {
    .shop-page .shop-home-header > div:first-child {
        flex: 1 1 auto;
        min-width: 16rem;
        max-width: none;
    }
}

.page-store .home-header .welcome-badge,
.page-wide .home-header .welcome-badge {
    margin-bottom: 0;
}

.page-wide .home-signed-row {
    margin-top: 0.25rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-card .value {
    font-size: 1.25rem;
    font-weight: 600;
}

.footer-note {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.site-footer {
    flex-shrink: 0;
    width: 100%;
    max-width: min(1100px, 100%);
    margin-top: auto;
    margin-inline: auto;
    padding: 1.5rem 1rem 0.25rem;
    text-align: center;
}

.site-footer-copy {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer-contact {
    margin: 0 0 0.55rem;
    font-size: 0.9rem;
    text-align: center;
}

.site-footer-legal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legal-page {
    padding-block: 2rem;
}

.legal-document {
    max-width: 900px;
    margin-inline: auto;
    line-height: 1.7;
}

.legal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.legal-header-actions,
.legal-cta-bar,
.return-request-success-actions,
.return-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.return-request-success-actions .btn,
.return-request-actions .btn,
.return-request-actions button.btn {
    width: auto;
    flex: 0 0 auto;
    display: inline-flex;
}


.legal-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}

.legal-header-actions .btn {
    width: 100%;
    text-align: center;
}


.legal-cta-bar {
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: 100%;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.legal-cta-bar .btn {
    width: 100%;
    text-align: center;
    flex: 0 0 auto;
}

.return-request-card .return-request-note {
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.return-request-form label {
    color: var(--text);
    font-weight: 600;
}

.return-request-form select,
.return-request-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.return-request-form select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) calc(50% - 0.15rem),
        calc(100% - 0.75rem) calc(50% - 0.15rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
    cursor: pointer;
}

.return-request-form textarea {
    min-height: 9rem;
    resize: vertical;
}

.return-request-form select:hover,
.return-request-form textarea:hover {
    border-color: var(--surface-hover);
}

.return-request-form select:focus,
.return-request-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background-color: var(--control-bg);
}

.return-request-form select:invalid:focus,
.return-request-form textarea:invalid:focus {
    border-color: var(--primary);
}


.return-order-snapshot {
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.03);
}

.return-snapshot-title {
    margin: 0 0 0.55rem;
    font-size: 1rem;
}

.return-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.return-item-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.return-item-list li:last-child {
    border-bottom: none;
}

.return-admin-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.return-admin-meta div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.return-admin-meta span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.return-admin-details {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.25);
}

.return-admin-details h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.return-admin-details p {
    margin: 0;
    white-space: pre-wrap;
}

.return-admin-footer {
    display: grid;
    gap: 1.25rem;
}

.return-reply-form textarea,
.admin-return-card .status-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
}

.return-reply-form textarea:focus,
.admin-return-card .status-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.status-badge.status-requested,
.status-badge.status-under_review {
    background: rgba(59, 130, 246, 0.2);
    color: var(--link);
}

.status-badge.status-approved,
.status-badge.status-instructions_sent,
.status-badge.status-received {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
}

.status-badge.status-refunded {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-text);
}

.status-badge.status-denied,
.status-badge.status-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}



.legal-document h2 {
    margin: 1.75rem 0 0.4rem;
    font-size: 1.15rem;
}

.legal-document p,
.legal-document ul {
    color: var(--text-muted);
}

.legal-document li + li {
    margin-top: 0.4rem;
}

@media (max-width: 600px) {
    .legal-header {
        flex-direction: column;
    }
}

.messages-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    align-items: start;
}

.messages-toolbar {
    margin: 0 0 1rem;
}

.messages-toolbar .btn {
    width: auto;
}

.communications-monitoring-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.communications-monitoring-notice--inline {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.messages-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.messages-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg);
}

.messages-tab:hover,
.messages-tab.is-active {
    color: var(--text);
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: min(70vh, 720px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    scrollbar-gutter: stable;
}

.message-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
    align-items: start;
}

.message-list-item {
    display: block;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-hover);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    min-width: 0;
}

.message-list-item:hover,
.message-list-item.is-active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
}

.message-list-item.is-open {
    border-left: 3px solid #fbbf24;
}

.message-list-item.is-unread {
    border-left: 3px solid #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

.message-list-item.is-unread .message-status {
    color: #fca5a5;
    font-weight: 700;
}

.message-list-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.message-relation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.45rem;
}

.message-relation-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    max-width: 100%;
}

.message-list-item .message-relation-badge,
.message-detail-header .message-relation-badge {
    pointer-events: auto;
}

a.message-relation-badge:hover {
    filter: brightness(1.08);
    text-decoration: underline;
}

.message-relation-order {
    color: #bfdbfe !important;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.message-relation-return {
    color: #fde68a !important;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.message-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.message-list-meta,
.message-list-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.message-list-preview {
    margin: 0.35rem 0;
    font-size: 0.9rem;
    color: var(--text);
}

.message-detail {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    background: var(--surface);
    min-width: 0;
}

.message-detail-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.message-detail-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.message-status-line {
    margin: 0.5rem 0 1rem;
    font-size: 0.9rem;
}

.message-bubble {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.message-bubble-customer {
    background: rgba(148, 163, 184, 0.12);
}

.message-bubble-admin {
    background: rgba(59, 130, 246, 0.12);
}

.message-bubble-label {
    margin-bottom: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.message-bubble-body {
    line-height: 1.45;
}

.message-reply-form .btn,
.message-detail .btn {
    width: auto;
}

.message-trash-form {
    margin: 0;
}

.btn-message-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.btn-message-x:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

@media (max-width: 800px) {
    .messages-layout {
        grid-template-columns: 1fr;
    }

    .messages-list {
        max-height: min(36vh, 14.5rem);
        padding: 0.45rem;
    }
}

.text-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
}

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

.recovery-links {
    margin-top: 0.75rem;
}

.link-separator {
    color: var(--text-muted);
    margin: 0 0.4rem;
}

.recovered-username-card {
    margin: 1.25rem 0;
}

.lock-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.body-store {
    align-items: stretch;
}

.body-store > main {
    width: 100%;
    max-width: min(1100px, 100%);
    margin-inline: auto;
}

/* Keep the footer at the bottom of the viewport and scroll long lists inside. */
body.has-list-scroll {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

body.has-list-scroll > main {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.has-list-scroll > main > .card {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.has-list-scroll > main > .card > :not(.list-scroll-pane) {
    flex-shrink: 0;
}

.list-scroll-pane {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

body.has-list-scroll .list-scroll-pane {
    flex: 1 1 0;
    min-height: 8.5rem;
}

/* Soft mode: cap list height (~2 rows) without locking the whole page. */
.list-scroll-pane--soft {
    max-height: min(40vh, 18.5rem);
}

.list-scroll-pane--soft.cart-list {
    max-height: min(42vh, 20rem);
    padding-right: 0.15rem;
    margin-bottom: 0.25rem;
}

.list-scroll-pane--soft.data-table-wrap,
.list-scroll-pane--soft.return-item-list {
    max-height: min(36vh, 14rem);
}

.list-scroll-pane--soft.inventory-grid {
    max-height: min(55vh, 34rem);
    padding-right: 0.2rem;
}

.list-scroll-pane--soft.product-grid {
    max-height: min(55vh, 34rem);
    align-content: start;
    padding-right: 0.2rem;
}

.list-scroll-pane--soft.orders-list,
.list-scroll-pane--soft.order-history-list {
    max-height: none;
    padding: 0;
}

/* Match inventory ZIP list: bordered pane that scrolls compressed order rows. */
.orders-scroll-pane {
    max-height: min(32vh, 13.5rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    scrollbar-gutter: stable;
}

.orders-scroll-pane > .orders-list,
.orders-scroll-pane > .order-history-list {
    margin: 0;
}

/* Give opened order details room while keeping scroll inside the pane. */
.orders-scroll-pane:has(.order-card[open]),
.orders-scroll-pane:has(.order-history-card[open]) {
    max-height: min(62vh, 38rem);
}

/*
 * Admin Orders: contain the list on every viewport so open orders scroll
 * inside the pane and never push the page past the site footer.
 */
.orders-scroll-pane.orders-page-scroll {
    max-height: min(36vh, 16rem);
    overscroll-behavior: contain;
    contain: layout paint;
    isolation: isolate;
}

.orders-scroll-pane.orders-page-scroll:has(.order-card[open]) {
    max-height: min(70vh, calc(100dvh - 22rem));
    overscroll-behavior: contain;
    contain: layout paint;
    isolation: isolate;
}

.orders-scroll-pane.orders-page-scroll .admin-order-card[open] {
    overflow: hidden;
}

@media (max-width: 640px) {
    .orders-scroll-pane {
        max-height: min(36vh, 14.5rem);
    }

    .orders-scroll-pane:has(.order-card[open]),
    .orders-scroll-pane:has(.order-history-card[open]) {
        max-height: min(70vh, 42rem);
    }

    /* User Order History: give compressed order list more scroll room on phones. */
    .orders-scroll-pane:has(> .order-history-list) {
        max-height: min(52vh, 24rem);
    }

    .orders-scroll-pane:has(> .order-history-list):has(.order-history-card[open]) {
        max-height: min(72vh, 44rem);
    }

    .orders-scroll-pane.orders-page-scroll {
        max-height: min(36vh, 14.5rem);
    }

    .orders-scroll-pane.orders-page-scroll:has(.order-card[open]) {
        max-height: min(70vh, calc(100dvh - 18rem));
    }

    /*
     * Customer Order History (phones): same containment approach as admin
     * Orders — no page-shell lock (that froze the page on open/refresh).
     */
    .orders-scroll-pane.order-history-scroll {
        overscroll-behavior: contain;
        contain: layout paint;
        isolation: isolate;
    }

    .orders-scroll-pane.order-history-scroll .order-history-card[open] {
        overflow: hidden;
    }
}

@media (max-width: 640px) {
    body.has-list-scroll {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .list-scroll-pane--soft {
        max-height: min(38vh, 17rem);
    }

    .list-scroll-pane--soft.cart-list {
        max-height: min(40vh, 19rem);
    }
}

@media print {
    body.has-list-scroll {
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    body.has-list-scroll > main,
    body.has-list-scroll > main > .card {
        display: block;
        overflow: visible;
        max-height: none;
    }

    .list-scroll-pane,
    .list-scroll-pane--soft {
        max-height: none !important;
        overflow: visible !important;
        flex: none !important;
    }
}

.store-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.store-nav-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    margin-right: auto;
}

.store-nav-cart-icon {
    display: block;
    flex-shrink: 0;
}

.store-nav-cart:hover,
.store-nav-cart.is-active {
    color: var(--link);
}

.store-nav-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    margin-left: auto;
}

.store-nav-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}

.store-nav-attention-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.32rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    vertical-align: middle;
}

.store-nav-link .store-nav-attention-badge {
    margin-left: 0.35rem;
}

.store-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.store-nav-toggle:hover {
    background: var(--control-hover);
    border-color: var(--control-border-hover);
}

.store-nav-toggle-bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
    width: 1.15rem;
}

.store-nav-toggle-bars span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
}

.store-nav.is-open .store-nav-toggle-bars span:nth-child(1) {
    transform: translateY(0.34rem) rotate(45deg);
}

.store-nav.is-open .store-nav-toggle-bars span:nth-child(2) {
    opacity: 0;
}

.store-nav.is-open .store-nav-toggle-bars span:nth-child(3) {
    transform: translateY(-0.34rem) rotate(-45deg);
}

.store-nav-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 12.5rem;
    padding: 0.45rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.store-nav-menu[hidden] {
    display: none;
}

.store-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.store-nav-link:hover,
.store-nav-link.is-active {
    color: var(--text);
    background: var(--surface-hover);
}

.store-nav-logout-form,
.header-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.store-nav-logout-btn {
    display: inline-block;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.store-nav-logout-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.header-logout-form .btn {
    width: auto;
}


.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 1.25rem;
}

.shop-search-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px -18px rgba(15, 23, 42, 0.55);
}

html.theme-day .shop-search-bar {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border-color: #bfdbfe;
    box-shadow: inset 0 1px 0 #fff, 0 10px 22px -18px rgba(37, 99, 235, 0.28);
}

@media (min-width: 641px) {
    .shop-search-bar {
        grid-template-columns: minmax(170px, 0.85fr) minmax(240px, 1.35fr);
        align-items: end;
        gap: 1.1rem;
    }
}

.shop-search-bar .shop-search-group {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.shop-search-group {
    margin: 0;
    min-width: 0;
}

.shop-search-bar .shop-search-group label {
    margin-bottom: 0.45rem;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shop-search-select,
.shop-search-input {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.75rem 1rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text);
    background: var(--control-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.shop-search-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 2.6rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.2rem) calc(50% - 0.12rem),
        calc(100% - 0.8rem) calc(50% - 0.12rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
}

.shop-search-input {
    padding-left: 2.55rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='M12.5 12.5 16 16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.9rem 50%;
    background-size: 1.05rem 1.05rem;
}

html.theme-day .shop-search-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='M12.5 12.5 16 16'/%3E%3C/svg%3E");
}

.shop-search-select:hover,
.shop-search-input:hover {
    border-color: var(--control-border-hover);
}

.shop-search-select:focus,
.shop-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background-color: var(--inset-bg);
}

.shop-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.9;
}

.shop-search-empty {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.product-taxonomy-fields {
    margin-bottom: 0.25rem;
    padding: 1rem 1.05rem 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
}

html.theme-day .product-taxonomy-fields {
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
    border-color: #bfdbfe;
}

.product-taxonomy-fields > .form-group {
    margin-bottom: 1rem;
}

.product-taxonomy-fields label {
    color: var(--text);
    font-weight: 650;
    letter-spacing: 0.02em;
}

.product-taxonomy-fields input[type="text"] {
    background: var(--control-bg);
    border-radius: 10px;
}

.product-taxonomy-fields input[type="text"]:focus {
    background: var(--inset-bg);
}

.product-taxonomy-hint {
    margin: 0.4rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.amazon-buy-block {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    width: 100%;
}

.amazon-associate-disclosure {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.product-detail-actions .amazon-buy-block {
    width: 100%;
}

.product-category {
    margin: 0 0 0.35rem;
    color: var(--link);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.product-card-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.product-card-link:hover .product-name {
    color: var(--link);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    display: block;
    background: var(--inset-bg);
}

.product-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.product-description {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    white-space: pre-wrap;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.product-footer--card {
    padding: 0 1rem 1rem;
    margin-top: auto;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1.25rem;
    align-items: start;
}

.product-detail-name {
    margin: 0 0 0.65rem;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.product-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.15rem;
}

.product-detail-actions .btn,
.product-detail-actions .product-form {
    width: auto;
}

.product-gallery {
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.product-gallery-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.product-gallery-slide {
    margin: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    min-width: 100%;
}

.product-gallery-image {
    display: block;
    width: 100%;
    height: min(52vh, 420px);
    object-fit: contain;
    background: var(--inset-bg);
}

.product-gallery-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-top: 1px solid var(--border);
}

.product-gallery-controls .btn {
    width: auto;
    min-width: 2.5rem;
    padding: 0.45rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
}

.product-gallery-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.product-gallery-hint {
    margin: 0;
    padding: 0 0.9rem 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 800px) {
    .product-detail {
        grid-template-columns: 1fr;
    }

    .product-gallery-image {
        height: min(48vh, 320px);
    }
}

.product-price-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 0;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-text);
}

.product-stock {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.product-stock.stock-in {
    color: var(--success-text);
}

.product-stock.stock-limited {
    color: var(--warning-text);
}

.product-stock.stock-out {
    color: #fca5a5;
}

.product-form {
    margin: 0;
}

.btn-buy {
    width: auto;
    min-width: 110px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

.cart-empty {
    text-align: center;
    padding: 2rem 1rem;
}

.cart-empty p {
    color: var(--text-muted);
    margin: 0 0 1.25rem;
}

.cart-empty .btn {
    width: auto;
    display: inline-flex;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: minmax(0, 100px) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 0;
}

.cart-item-image {
    width: 100%;
    max-width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--inset-bg);
}

.cart-item-name {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.cart-item-description {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.cart-item-meta {
    margin: 0;
    font-size: 0.9rem;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.15rem 0;
}

.cart-qty-controls {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.25rem 0.15rem 0.45rem;
}

.cart-qty-value {
    min-width: 1.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-qty {
    width: 2.1rem;
    min-width: 2.1rem;
    padding: 0.35rem 0;
    font-size: 1.1rem;
    line-height: 1;
}

.cart-remove-form {
    margin: 0;
}

.btn-remove {
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    width: 100%;
}

.cart-summary {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 0;
}

.cart-total {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.cart-total strong {
    font-size: 1.5rem;
    color: var(--success-text);
}

.cart-summary-actions {
    display: flex;
    align-items: center;
    column-gap: 1.25rem;
    row-gap: 1.5rem;
    flex-wrap: wrap;
}

.cart-summary-actions .btn {
    width: auto;
}

@media (max-width: 520px) {
    .cart-summary-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .cart-summary-actions .btn {
        width: 100%;
    }
}

.checkout-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    min-width: 0;
    max-width: 100%;
}

.checkout-actions-primary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.checkout-form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.checkout-actions .btn,
.checkout-form .btn {
    width: auto;
}

.btn-proceed {
    min-width: 12.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    white-space: nowrap;
    font-size: 0.9rem;
}

.review-summary {
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 540px);
    margin-left: auto;
}

.review-summary .cart-total {
    justify-content: space-between;
    width: 100%;
    font-size: 1rem;
}

.review-summary .cart-total strong {
    font-size: 1.1rem;
}

.review-summary .cart-total:last-child {
    margin-top: 0.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-weight: 700;
}

.review-summary .cart-total:last-child strong {
    font-size: 1.35rem;
}

.shipping-speed-summary span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    max-width: min(100%, 22rem);
}

.shipping-speed-edit-btn {
    margin-top: 0.15rem;
    width: auto;
}

.shipping-speed-dialog .shipping-speed-options {
    margin-top: 0.35rem;
}

.shipping-speed-dialog .shipping-speed-actions {
    margin-top: 0.25rem;
}

.shipping-speed-dialog .shipping-speed-actions .btn {
    width: auto;
}

.shipping-speed-card {
    max-width: 640px;
    margin-inline: auto;
}

.shipping-speed-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0;
    border: none;
}

.shipping-speed-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.shipping-speed-option:hover,
.shipping-speed-option.is-selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.shipping-speed-option input {
    flex-shrink: 0;
    accent-color: var(--primary);
}

.shipping-speed-option-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.shipping-speed-option-copy strong {
    color: var(--text);
}

.shipping-speed-option-copy span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.shipping-speed-option-price {
    margin-left: auto;
    white-space: nowrap;
}

.shipping-speed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.shipping-speed-actions .btn {
    width: auto;
}

.order-estimate-note {
    width: min(100%, 540px);
    margin: 0.65rem 0 0 auto;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.free-shipping-memo {
    width: min(100%, 540px);
    margin: 0.85rem 0 0 auto;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.order-estimate-note + .free-shipping-memo {
    margin-top: 1.35rem;
}

.order-estimate-note + .alert-success {
    margin-top: 1.35rem;
}

.delivery-tip-section {
    margin: 1.5rem 0 0;
    padding: 1.15rem 1.2rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(148, 163, 184, 0.04));
}

.delivery-tip-header .profile-section-title {
    margin: 0 0 0.35rem;
}

.delivery-tip-desc {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.delivery-tip-presets {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.delivery-tip-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.delivery-tip-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.delivery-tip-chip:hover {
    border-color: var(--primary);
}

.delivery-tip-chip.is-selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.16);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.delivery-tip-custom {
    display: none;
    margin-top: 0.9rem;
}

.delivery-tip-custom.is-open {
    display: block;
}

.delivery-tip-custom label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.delivery-tip-custom-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.delivery-tip-currency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 700;
}

.delivery-tip-custom-row input[type="number"] {
    width: 100%;
    min-width: 0;
    height: 2.6rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.delivery-tip-custom-row .btn {
    width: auto;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .delivery-tip-section {
        padding: 1rem 0.9rem 1.1rem;
    }

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

    .delivery-tip-chip:last-child {
        grid-column: 1 / -1;
    }

    .delivery-tip-custom-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .delivery-tip-custom-row .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

.order-cost-pending {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-item-review {
    grid-template-columns: 1fr;
}

.inventory-search-bar {
    margin: 0 0 1.15rem;
}

.inventory-results {
    scroll-margin-top: 1rem;
}

.inventory-results:focus,
.inventory-product-name:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.inventory-grid {
    display: grid;
    gap: 1.25rem;
}

.inventory-location-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.inventory-location-name {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.inventory-location-desc {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.data-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.qty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-text);
    font-weight: 600;
}

.qty-badge.qty-low {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.inventory-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.inventory-table {
    table-layout: fixed;
}

.inventory-table th,
.inventory-table td {
    vertical-align: middle;
}

.inventory-col-photo,
.inventory-col-product,
.inventory-col-quantity {
    width: 28%;
}

.inventory-col-actions {
    width: 16%;
    text-align: right;
}

.inventory-section {
    padding: 1rem 1.1rem;
    background: rgba(15, 23, 42, 0.35);
}

.inventory-table tbody td.inventory-section {
    border-right: 1px solid var(--border);
}

.inventory-table tbody td.inventory-actions-cell {
    padding: 1rem 1.1rem;
}

.inventory-photo-section {
    text-align: center;
}

.inventory-photo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.inventory-product-section,
.inventory-quantity-section {
    text-align: left;
}

.inventory-cell-quantity {
    justify-content: flex-end;
}

.inventory-product-name {
    display: block;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
    flex: 1 1 auto;
    min-width: 0;
}

.inventory-inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
    max-width: 100%;
}

.inventory-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.inventory-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.inventory-input-qty {
    max-width: 120px;
}

.inventory-inline-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inventory-inline-actions .btn {
    width: auto;
}

.inventory-edit-photo {
    display: block;
    width: 160px;
    max-width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--inset-bg);
}

.product-gallery-admin-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.product-gallery-admin-item {
    display: grid;
    gap: 0.4rem;
    width: 160px;
}

.inventory-quantity-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.inventory-quantity-row:last-child {
    margin-bottom: 0;
}

.inventory-quantity-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.inventory-footer-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.inventory-footer-actions .btn {
    width: auto;
}

.costs-dialog {
    width: min(440px, calc(100vw - 2rem));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.costs-dialog::backdrop {
    background: rgba(2, 6, 23, 0.72);
}

.costs-form .btn {
    width: auto;
}

.costs-form label {
    color: var(--text);
    font-weight: 600;
}

.costs-form select,
.costs-form input[type="number"],
.costs-form input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.costs-form select {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) calc(50% - 0.15rem),
        calc(100% - 0.75rem) calc(50% - 0.15rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
    cursor: pointer;
}

.costs-form select:hover,
.costs-form input[type="number"]:hover,
.costs-form input[type="password"]:hover {
    border-color: var(--surface-hover);
}

.costs-form select:focus,
.costs-form input[type="number"]:focus,
.costs-form input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background-color: var(--control-bg);
}

.costs-form #shipping-cost-help {
    margin: 0.45rem 0 0;
    font-size: 0.85rem;
}

.costs-form .costs-section {
    margin: 0 0 1.15rem;
    padding: 0.9rem 1rem 0.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.06);
}

.costs-form .costs-section-title {
    padding: 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.costs-form .costs-section-desc {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.shop-zip-check {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
}

.shop-zip-prompt {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

.shop-zip-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.shop-zip-input,
.delivery-zip-input {
    width: 3.125rem;
    max-width: 100%;
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.register-zip-group {
    max-width: 5rem;
}

.shop-zip-input:focus,
.delivery-zip-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.shop-zip-form .btn {
    width: auto;
}

.shop-guest-auth {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
}

.shop-member-login {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.shop-member-login .btn {
    width: auto;
}

.coverage-dialog {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 24rem;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.coverage-dialog::backdrop {
    background: rgba(2, 6, 23, 0.7);
}

.coverage-dialog p {
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.coverage-dialog form {
    margin: 0;
    display: flex;
    justify-content: flex-end;
}

.coverage-dialog .btn {
    width: auto;
}

.delivery-zip-section {
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.delivery-zip-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.delivery-zip-section-header .btn {
    width: auto;
    flex: 0 0 auto;
}

.delivery-zip-heading {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.delivery-zip-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 42rem;
}

.delivery-zip-summary {
    margin: 0.85rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.delivery-zip-dialog {
    width: min(440px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.delivery-zip-dialog::backdrop {
    background: rgba(2, 6, 23, 0.72);
}

.delivery-zip-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.delivery-zip-dialog-header h2 {
    margin: 0 0 0.3rem;
    font-size: 1.2rem;
}

.delivery-zip-dialog-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.delivery-zip-dialog-header .btn {
    width: auto;
}

.delivery-zip-dialog-close {
    min-width: 2.25rem;
    padding: 0.35rem 0.55rem;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 600;
}

.delivery-zip-add-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    flex-wrap: wrap;
}

.delivery-zip-add-form .btn {
    width: auto;
}

.delivery-zip-search {
    margin: 0 0 0.75rem;
}

.delivery-zip-search-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.delivery-zip-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.delivery-zip-list-scroll {
    max-height: min(var(--visible-rows-height, 16rem), 45vh);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}

.delivery-zip-empty {
    margin: 0;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.delivery-zip-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.delivery-zip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.delivery-zip-item[hidden] {
    display: none !important;
}

.delivery-zip-code {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.delivery-zip-delete-form {
    margin: 0;
}

.delivery-zip-delete-form .btn {
    width: auto;
}

.inventory-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    resize: vertical;
    font-family: inherit;
}

.inventory-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.inventory-file-input {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.inventory-thumb {
    width: 88px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--inset-bg);
}

.inventory-delete-form {
    margin: 0;
}

.inventory-table thead th {
    text-align: left;
}

.inventory-table thead th.inventory-col-actions {
    text-align: right;
}

.inventory-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.inventory-table tbody tr:last-child {
    border-bottom: none;
}

/*
 * Cells carry their own backgrounds, so tint them with an overlay image
 * instead of a background colour that would wipe out the section shading.
 */
@media (hover: hover) {
    .inventory-location-card .inventory-table tbody tr:hover > td {
        background-image: linear-gradient(rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.14));
    }

    html.theme-day .inventory-location-card .inventory-table tbody tr:hover > td {
        background-image: linear-gradient(rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.12));
    }
}

.inventory-actions-cell {
    min-width: 0;
    vertical-align: middle;
    text-align: right;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.admin-order-card {
    padding: 0;
    transition: border-color 0.15s ease;
}

.admin-order-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.95rem 1.15rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}

.admin-order-summary::-webkit-details-marker {
    display: none;
}

.admin-order-summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.admin-order-summary .order-card-title {
    margin: 0;
    font-size: 1.05rem;
}

.admin-order-summary .order-card-meta {
    margin: 0;
}

.admin-order-summary-side {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.admin-order-card[open] .admin-order-summary {
    border-bottom: 1px solid var(--border);
    background: rgba(59, 130, 246, 0.08);
}

/* Pointer-only: a tapped <details> would otherwise keep the highlight stuck. */
@media (hover: hover) {
    .admin-order-card:hover {
        border-color: rgba(59, 130, 246, 0.35);
    }

    .admin-order-summary:hover {
        background: rgba(59, 130, 246, 0.1);
    }

    .admin-order-card[open] .admin-order-summary:hover {
        background: rgba(59, 130, 246, 0.14);
    }
}

.admin-order-summary:focus-visible {
    background: rgba(59, 130, 246, 0.12);
}

.admin-order-card[open] .order-history-chevron {
    transform: rotate(225deg);
    margin-top: 0.25rem;
}

.admin-order-body {
    padding: 1rem 1.15rem 1.15rem;
}

.admin-order-body .data-table {
    table-layout: auto;
}

.order-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.order-card-title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.order-card-meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.order-shipping-address {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 8px;
}

html.theme-day .order-shipping-address {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.order-shipping-title {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.order-shipping-line {
    margin: 0;
    line-height: 1.45;
    font-size: 0.9rem;
}

.order-shipping-line + .order-shipping-line {
    margin-top: 0.15rem;
}

.order-filter-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.order-filter-group {
    margin: 0;
    min-width: min(100%, 220px);
    flex: 1 1 220px;
}

.order-filter-select {
    width: 100%;
    max-width: 280px;
}

.order-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.order-filter-actions .btn {
    width: auto;
}

.order-export-bar {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin: -0.65rem 0 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.order-export-group {
    flex: 1 1 280px;
    min-width: min(100%, 240px);
}

.order-export-password-group {
    flex: 0 1 220px;
    min-width: min(100%, 180px);
}

.order-export-password-group .order-export-password {
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
}

.order-export-bar .order-filter-actions {
    margin-left: 0;
}

.order-export-btn {
    border: 1px solid #000;
}

.order-filter-search {
    position: relative;
    flex: 1 1 200px;
    min-width: min(100%, 200px);
    padding: 0.65rem 0.75rem 0.75rem;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html.theme-day .order-filter-search {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: none;
}

.order-filter-search label {
    color: var(--link);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.order-filter-search-input {
    width: 100%;
    max-width: none;
    min-height: 2.55rem;
    padding: 0.55rem 0.85rem 0.55rem 2.45rem;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--text);
    background-color: var(--control-bg, var(--bg));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2393c5fd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='M12.5 12.5 16 16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.8rem 50%;
    background-size: 1.05rem 1.05rem;
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 9px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

html.theme-day .order-filter-search-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%231d4ed8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='M12.5 12.5 16 16'/%3E%3C/svg%3E");
    border-color: rgba(37, 99, 235, 0.4);
}

.order-filter-search-input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
}

.order-filter-search-input:hover {
    border-color: var(--primary);
}

.order-filter-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
    background-color: var(--inset-bg, var(--control-bg, var(--bg)));
}

@media (max-width: 640px) {
    .order-filter-search {
        order: 10;
        margin-top: 0.15rem;
    }

    .order-filter-actions {
        order: 20;
    }

    .order-filter-search-input {
        max-width: none;
        min-height: 2.7rem;
        font-size: 1.1rem;
    }
}

.status-badge {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-pending {
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
}

.status-processing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--link);
}

.status-shipping {
    background: rgba(14, 165, 233, 0.15);
    color: var(--shipping-text);
}

.status-out_for_delivery {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
}

.status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-text);
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.payment-badge.payment-paid {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-text);
}

.payment-badge.payment-unpaid {
    background: rgba(234, 179, 8, 0.18);
    color: #fde047;
}

.order-payment-line {
    display: block;
    margin-top: 0.35rem;
}

.payment-text-paid {
    color: var(--success-text);
}

.payment-text-unpaid {
    color: #fde047;
}

.order-paid-at {
    opacity: 0.75;
    font-weight: 400;
    margin-left: 0.25rem;
}

.order-card-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.return-admin-footer.order-card-footer {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    max-width: 100%;
}

.return-admin-footer .order-status-form,
.return-admin-footer .return-reply-form {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
}

.return-admin-footer .return-reply-form .form-group,
.return-admin-footer .return-reply-form textarea,
.return-admin-footer .return-reply-form .status-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.return-admin-footer .return-reply-status-group,
.return-admin-footer .return-reply-status-group .status-select,
.return-admin-footer .return-reply-submit {
    width: 50%;
    max-width: 50%;
    box-sizing: border-box;
}

.order-total {
    flex: 0 0 auto;
    padding-top: 0.35rem;
}

.order-total strong {
    color: var(--success-text);
}

.order-cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.order-cost-breakdown strong {
    color: var(--text);
}

.order-cost-breakdown .order-total {
    margin-top: 0.2rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 1rem;
}

.order-cost-breakdown .order-total strong {
    color: var(--success-text);
}

.order-status-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}

.order-status-form .btn-secondary {
    border: 1px solid #000;
}

.order-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-left: auto;
    flex: 1 1 280px;
    max-width: 100%;
    min-width: 0;
}

.order-footer-actions > .btn,
.order-footer-actions .btn,
.order-delete-form .btn,
.order-status-form .btn,
.order-cash-form .btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

.order-delete-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}

.order-delete-password {
    width: 11rem;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.order-delete-password:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.order-tracking-input {
    width: 11rem;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.order-tracking-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.order-driver-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
}

.order-driver-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: start;
}

.order-driver-copy {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.order-driver-input,
.order-driver-file {
    width: 100%;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
}

.order-driver-photo-block {
    display: grid;
    gap: 0.4rem;
    justify-items: center;
    min-width: 8.25rem;
}

.order-driver-photo-preview {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    object-fit: cover;
    border-radius: 999px;
    border: 2px solid var(--primary);
    background: var(--surface);
}

.order-driver-file-picker {
    position: relative;
    display: grid;
    gap: 0.35rem;
    justify-items: stretch;
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.order-driver-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 16px -10px rgba(37, 99, 235, 0.85);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.order-driver-file-btn::before {
    content: '';
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 16V4m0 0l-4 4m4-4l4 4M4 16.5V18a2 2 0 002 2h12a2 2 0 002-2v-1.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 16V4m0 0l-4 4m4-4l4 4M4 16.5V18a2 2 0 002 2h12a2 2 0 002-2v-1.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.order-driver-file-picker:hover .order-driver-file-btn {
    filter: brightness(1.06);
    box-shadow: 0 10px 18px -10px rgba(37, 99, 235, 0.95);
    transform: translateY(-1px);
}

.order-driver-file-picker:focus-within .order-driver-file-btn {
    outline: 2px solid rgba(147, 197, 253, 0.9);
    outline-offset: 2px;
}

.order-driver-file-name {
    display: block;
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.3;
}

.order-driver-file-picker.has-file .order-driver-file-name {
    color: var(--text);
}

.order-driver-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html.theme-day .order-driver-file-btn {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 8px 16px -12px rgba(29, 78, 216, 0.65);
}

.order-driver-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.order-driver-actions .btn {
    width: auto;
}

.order-driver-actions .btn-secondary {
    border: 1px solid #000;
}

.order-cash-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}

.order-cash-form .btn-secondary {
    border: 1px solid #000;
}

.order-receipt-email-input {
    width: 14rem;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.order-receipt-email-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.order-cash-form .btn {
    width: auto;
}

.receipt-dialog {
    width: min(720px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    color: var(--text);
    background: var(--surface);
    overflow: auto;
}

.receipt-dialog::backdrop {
    background: rgba(2, 6, 23, 0.72);
}

.receipt-dialog-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.receipt-dialog-subtitle {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.receipt-dialog-preview {
    background: #ffffff;
    color: #111827;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.receipt-dialog-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.receipt-dialog-email-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.receipt-dialog-email-form .btn,
.receipt-dialog-actions .btn {
    width: auto;
}

.receipt-dialog-actions form {
    margin: 0;
}

@media print {
    body[data-printing-receipt] > *:not(dialog[open]) {
        display: none !important;
    }

    body[data-printing-receipt] dialog[open] {
        display: block !important;
        position: static;
        width: 100%;
        max-height: none;
        border: 0;
        padding: 0;
        background: #ffffff;
        color: #111827;
        box-shadow: none;
        overflow: visible;
    }

    body[data-printing-receipt] dialog[open]::backdrop {
        display: none;
    }

    body[data-printing-receipt] .no-print {
        display: none !important;
    }

    body[data-printing-receipt] .receipt-dialog-preview {
        padding: 0;
        margin: 0;
    }

    body[data-printing-receipt] .order-receipt-document {
        max-width: none;
        margin: 0;
        padding: 1.75rem 1.5rem 2.25rem;
        border-radius: 0;
        font-size: 1rem;
        line-height: 1.55;
    }

    body[data-printing-receipt] .receipt-heading {
        margin: 0 0 0.65rem;
        font-size: 1.75rem;
        line-height: 1.3;
        letter-spacing: 0.01em;
    }

    body[data-printing-receipt] .receipt-subheading {
        margin: 0 0 1.75rem;
        font-size: 1.05rem;
        line-height: 1.5;
    }

    body[data-printing-receipt] .receipt-meta,
    body[data-printing-receipt] .receipt-payment-summary {
        gap: 0.75rem;
        margin: 0 0 1.75rem;
        font-size: 1rem;
        line-height: 1.5;
    }

    body[data-printing-receipt] .receipt-meta-row {
        gap: 1.5rem;
        padding: 0.15rem 0;
    }

    body[data-printing-receipt] .receipt-shipping,
    body[data-printing-receipt] .receipt-tracking-block,
    body[data-printing-receipt] .receipt-driver-block {
        margin: 0 0 1.75rem;
        padding: 1.15rem 1.25rem;
    }

    body[data-printing-receipt] .receipt-shipping-title,
    body[data-printing-receipt] .receipt-tracking-label,
    body[data-printing-receipt] .receipt-driver-label {
        margin-bottom: 0.55rem;
    }

    body[data-printing-receipt] .receipt-shipping p,
    body[data-printing-receipt] .receipt-driver-car {
        line-height: 1.6;
    }

    body[data-printing-receipt] .receipt-items {
        margin: 0 0 1.5rem;
        font-size: 1rem;
    }

    body[data-printing-receipt] .receipt-item-row {
        padding: 0.28rem 0;
        line-height: 1.45;
    }

    body[data-printing-receipt] .receipt-total {
        margin-top: 0.35rem;
        padding-top: 1.1rem;
        font-size: 1.2rem;
        letter-spacing: 0.01em;
    }

    body[data-printing-receipt] .receipt-payment-summary {
        margin-top: 1.15rem;
    }

    body[data-printing-receipt] .receipt-footer-note {
        margin: 1.75rem 0 0;
        font-size: 0.92rem;
        line-height: 1.55;
    }

    body[data-printing-receipt] .receipt-driver-content {
        gap: 1.15rem;
    }

    body[data-printing-receipt] .receipt-driver-name {
        margin-bottom: 0.35rem;
    }
}

.order-delete-form .btn,
.order-status-form .btn {
    width: auto;
}

.status-select {
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    max-width: 100%;
    min-width: 8rem;
}

.btn-small {
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
}

.btn-receipt {
    width: auto;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    line-height: inherit;
    border-radius: 8px;
}

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

.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.profile-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.profile-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.profile-section-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.profile-section-desc {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.account-status-panel {
    margin-bottom: 0.5rem;
}

.account-status-badge {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.account-status-badge--active {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.55);
    color: var(--success-text);
}

.account-status-badge--needs {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.55);
    color: #f87171;
}

.account-status-resend {
    margin-top: 0.25rem;
}

.account-status-resend .btn {
    width: auto;
}

.profile-section-header {
    margin-bottom: 0;
}

.profile-section-header .profile-section-title {
    margin-bottom: 0.35rem;
}

.profile-section-header .profile-section-desc {
    margin-bottom: 0;
}

.profile-edit-address-btn {
    display: inline-flex;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
}

.profile-shipping-form {
    max-width: 36rem;
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .profile-section-header + .profile-shipping-form {
        margin-top: 1.4rem;
    }

    .profile-shipping-form > .form-group:first-of-type {
        margin-top: 0.15rem;
    }
}

.shipment-address-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.shipment-address-section .profile-section-title {
    margin-bottom: 1rem;
}

.shipping-address-summary {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    background: var(--bg);
    border-radius: 10px;
}

html.theme-day .shipping-address-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

html.theme-day .shipment-address-form input[type="text"] {
    background: #ffffff;
    border-color: #cbd5e1;
}

.shipping-address-summary p {
    margin: 0;
    line-height: 1.5;
}

.shipping-address-summary p + p {
    margin-top: 0.2rem;
}

.shipment-address-note {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.shipment-address-editor-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.75rem;
    padding-bottom: 0.5rem;
}

.shipment-address-confirm-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.shipment-address-confirm-actions .btn {
    width: auto;
}

#edit-shipping-address-btn,
#confirm-shipping-address-btn {
    margin-bottom: 0.25rem;
}

.btn-success {
    background: #16a34a;
    color: #fff;
    width: auto;
}

.btn-success:hover {
    background: #15803d;
}

.shipment-checkout-actions.is-highlighted {
    outline: 2px solid #22c55e;
    outline-offset: 6px;
    border-radius: 10px;
}

.shipment-address-editor {
    transition: opacity 0.2s ease;
}

.shipment-address-editor.is-dimmed {
    opacity: 0.45;
}

.shipment-address-editor fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.shipment-address-editor fieldset:disabled input,
.shipment-address-editor fieldset input:read-only,
.shipment-address-editor fieldset:disabled select,
.shipment-address-editor fieldset select:disabled {
    cursor: not-allowed;
}

.shipping-state-field {
    position: relative;
}

.shipping-state-select-wrap {
    position: relative;
}

.shipping-state-select-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.95rem;
    width: 0.7rem;
    height: 0.7rem;
    pointer-events: none;
    transform: translateY(-55%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

html.theme-day .shipping-state-select-wrap::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
}

.shipping-state-select-wrap:focus-within::after {
    transform: translateY(-45%) rotate(180deg);
    opacity: 0.95;
}

.shipping-state-select {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.75rem 2.65rem 0.75rem 1rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    color: var(--text);
    background: var(--control-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

html.theme-day .shipping-state-select {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.shipping-state-select:hover:not(:disabled) {
    border-color: var(--control-border-hover);
    background-color: var(--inset-bg);
}

html.theme-day .shipping-state-select:hover:not(:disabled) {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.shipping-state-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background-color: var(--inset-bg);
}

html.theme-day .shipping-state-select:focus {
    background-color: #ffffff;
}

.shipping-state-select:invalid {
    color: var(--text-muted);
    font-weight: 400;
}

.shipping-state-select:valid {
    color: var(--text);
}

.shipping-state-select:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.shipping-state-select option {
    color: var(--text);
    background: var(--surface);
    font-weight: 500;
}

.shipping-state-select option[value=''] {
    color: var(--text-muted);
    font-weight: 400;
}

.shipment-address-form input[type="text"] {
    border-width: 0.5px;
    border-color: rgba(148, 163, 184, 0.55);
}

.shipment-address-form .shipping-state-select {
    border-width: 0.5px;
    border-color: rgba(148, 163, 184, 0.55);
}

.shipment-checkout-actions {
    justify-content: flex-start;
    margin-top: 0.5rem;
}

.shipment-address-form {
    max-width: 100%;
}

.profile-row-value.is-empty {
    color: var(--text-muted);
    font-style: italic;
}

.field-optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.profile-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.profile-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.profile-row-main {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.profile-row-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.profile-row-value {
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
}

.profile-edit-form {
    width: 100%;
    margin-top: 0.75rem;
}

.profile-edit-form .form-group {
    margin-bottom: 0.85rem;
}

.profile-edit-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-edit-actions .btn {
    width: auto;
}

.profile-password-form {
    max-width: 420px;
}

.profile-password-form .btn {
    width: auto;
}

.profile-danger-zone {
    border-top-color: rgba(239, 68, 68, 0.35);
}

.profile-danger-zone .profile-section-title {
    color: #fca5a5;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    width: auto;
}

.btn-danger:hover {
    background: #dc2626;
}

.profile-delete-form {
    max-width: 420px;
}

.form-check {
    margin-bottom: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--danger);
}

.legal-agreement-check {
    margin-bottom: 0.85rem;
}

.legal-agreement-label {
    gap: 0.45rem;
    font-size: 0.75rem;
    line-height: 1.35;
}

.legal-agreement-label input[type="checkbox"] {
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0.12rem;
}

.shop-visibility-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.shop-visibility-options .checkbox-label {
    color: var(--text);
}

.shop-visibility-options .checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .card h1 {
        font-size: 1.45rem;
    }

    .home-header {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .home-header > div:first-child {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .home-header .header-actions,
    .home-header .shop-guest-auth {
        margin-left: auto;
    }

    .btn-screen-mode--footer {
        display: none;
    }

    .btn-screen-mode--header {
        display: inline-flex;
        width: 100%;
        order: 2;
    }

    .header-logout-form.btn-screen-mode--footer {
        display: none;
    }

    .header-logout-form.btn-screen-mode--header {
        display: block;
        width: 100%;
        order: 4;
    }

    .header-logout-form.btn-screen-mode--header .btn {
        width: 100%;
    }

    .home-header .header-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-left: 0;
    }

    .home-header .header-actions .btn[href="shop.php"] {
        order: 0;
    }

    .home-header .header-actions .btn[href="profile.php"] {
        order: 1;
    }

    .home-header .header-actions .btn[href="settings.php"],
    .home-header .header-actions .btn[href="admin/user-settings.php"] {
        order: 2;
    }

    .home-signed-row {
        justify-content: flex-start;
    }

    .home-header .store-nav {
        margin-left: 0;
        width: 100%;
    }

    /* Cell phone only: center the shop page top header */
    .shop-page .shop-home-header {
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .shop-page .shop-home-header > div:first-child {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .shop-page .shop-home-header .shop-guest-auth {
        margin-left: 0;
        margin-right: 0;
        justify-content: center;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
        max-width: 100%;
    }

    .shop-page .shop-home-header .shop-guest-auth .store-nav {
        width: auto;
        flex: 0 0 auto;
        order: 2;
        justify-content: flex-end;
    }

    .shop-page .shop-home-header .shop-member-login--register {
        order: 1;
    }

    .shop-page .shop-home-header .shop-member-login--existing {
        order: 3;
        flex: 1 0 100%;
        justify-content: center;
    }

    .shop-page .shop-home-header .shop-member-login {
        justify-content: center;
    }

    .shop-page .shop-home-header .store-nav {
        justify-content: space-between;
        gap: 0.75rem;
    }

    .shop-page .shop-home-header .store-nav-controls {
        margin-left: auto;
    }

    .shop-page .shop-home-header .welcome-badge {
        justify-content: center;
    }

    .shop-brand-title {
        font-size: clamp(1.05rem, 5.8vw, 1.75rem);
    }

    .header-actions,
    .shop-zip-check,
    .shop-zip-form,
    .shop-guest-auth,
    .delivery-zip-add-form,
    .checkout-actions,
    .checkout-form,
    .profile-edit-actions,
    .inventory-inline-actions,
    .order-status-form {
        width: 100%;
    }

    .store-nav {
        width: 100%;
        margin-left: 0;
    }

    .shop-zip-check,
    .shop-guest-auth {
        align-items: stretch;
    }

    .shop-guest-auth {
        flex-direction: column;
        justify-content: stretch;
    }

    .shop-zip-prompt {
        text-align: left;
    }

    .shop-zip-form {
        justify-content: stretch;
    }

    .shop-zip-input,
    .delivery-zip-input,
    .shop-zip-form .btn,
    .delivery-zip-add-form .btn {
        width: 100%;
    }

    .shop-member-login {
        justify-content: flex-start;
        flex-direction: row;
        align-items: center;
    }

    .shop-member-login .btn {
        width: auto;
    }

    .header-actions .btn,
    .checkout-actions .btn,
    .checkout-form .btn,
    .profile-edit-actions .btn,
    .inventory-inline-actions .btn {
        width: 100%;
    }

    .checkout-actions,
    .checkout-form {
        flex-direction: column;
        align-items: stretch;
    }

    .checkout-actions-primary {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .checkout-actions > .btn,
    .checkout-actions > .checkout-form {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .btn-proceed {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .cart-item {
        grid-template-columns: minmax(0, 80px) minmax(0, 1fr);
    }

    .cart-item-image {
        max-width: 80px;
    }

    .cart-item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-top: 0.35rem;
    }

    .cart-qty-controls {
        padding: 0.15rem 0.35rem 0.15rem 0;
    }

    .cart-remove-form {
        margin-left: auto;
    }

    .btn-remove {
        width: auto;
    }

    .cart-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-total {
        justify-content: space-between;
    }

    .inventory-table,
    .inventory-table thead,
    .inventory-table tbody,
    .inventory-table tr,
    .inventory-table th,
    .inventory-table td {
        display: block;
        width: 100%;
    }

    .inventory-table thead {
        display: none;
    }

    .inventory-table tbody tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        overflow: hidden;
    }

    .inventory-table tbody td {
        border-bottom: 1px solid var(--border);
        border-right: none;
    }

    .inventory-table tbody td:last-child {
        border-bottom: none;
    }

    .inventory-section::before {
        display: block;
        margin-bottom: 0.5rem;
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .inventory-photo-section::before {
        content: 'Photo';
    }

    .inventory-product-section::before {
        content: 'Product';
    }

    .inventory-quantity-section::before {
        content: 'Quantity';
    }

    .inventory-actions-cell::before {
        content: 'Actions';
        display: block;
        margin-bottom: 0.5rem;
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-align: left;
    }

    .inventory-footer-actions {
        justify-content: stretch;
    }

    .inventory-footer-actions .btn {
        width: 100%;
    }

    .order-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .order-footer-actions {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        flex: 1 1 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.65rem;
    }

    .order-footer-actions > * {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .order-driver-fields {
        grid-template-columns: 1fr;
    }

    .order-driver-photo-block {
        justify-items: stretch;
        min-width: 0;
    }

    .order-driver-actions .btn {
        flex: 1 1 auto;
    }

    .order-footer-actions .btn-receipt {
        width: 100%;
    }

    .order-status-form,
    .order-cash-form,
    .order-delete-form,
    .order-driver-form {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 0.65rem;
        margin-left: 0;
        margin-right: 0;
    }

    .order-status-form .btn,
    .order-cash-form .btn,
    .order-delete-form .btn,
    .status-select,
    .order-delete-password,
    .order-tracking-input,
    .order-receipt-email-input {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto;
        box-sizing: border-box;
    }

    .order-delete-form .order-delete-password,
    .order-delete-form .btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .order-status-form .btn,
    .status-select {
        width: 100%;
    }

    .admin-order-body .data-table-wrap {
        overflow-x: visible;
    }

    .admin-order-body .data-table,
    .admin-order-body .data-table tbody,
    .admin-order-body .data-table tr,
    .admin-order-body .data-table th,
    .admin-order-body .data-table td {
        display: block;
        width: 100%;
    }

    .admin-order-body .data-table {
        table-layout: auto;
        min-width: 0;
    }

    .admin-order-body .data-table thead {
        display: none;
    }

    .admin-order-body .data-table tbody tr {
        margin: 0 0 0.85rem;
        padding: 0.75rem 0.85rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: rgba(148, 163, 184, 0.08);
    }

    .admin-order-body .data-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .admin-order-body .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.3rem 0;
        border-bottom: 0;
        text-align: right;
    }

    .admin-order-body .data-table td:first-child {
        display: block;
        text-align: left;
        font-weight: 700;
        padding-bottom: 0.45rem;
    }

    .admin-order-body .data-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        text-align: left;
        flex: 0 0 auto;
    }

    .admin-order-body .data-table td:first-child::before {
        display: none;
    }

    .admin-order-summary-side {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .order-filter-bar {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.55rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .order-export-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        padding: 0.75rem;
        margin: -0.35rem 0 1rem;
    }

    .order-export-bar .order-filter-actions,
    .order-export-bar .order-export-btn,
    .order-export-password-group .order-export-password {
        width: 100%;
        max-width: none;
    }

    .order-filter-group {
        margin: 0;
        min-width: 0;
        flex: 0 0 auto;
    }

    .order-filter-group label {
        margin-bottom: 0.25rem;
        font-size: 0.8rem;
    }

    .order-filter-select,
    .order-filter-group .status-select,
    .order-filter-search-input {
        max-width: none;
        width: 100%;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .order-filter-search-input {
        padding-left: 2.45rem;
    }

    .order-filter-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-top: 0.15rem;
    }

    .order-filter-actions .btn {
        width: 100%;
        min-height: 2.4rem;
    }

    .shop-search-bar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .shop-search-bar .shop-search-group {
        width: 100%;
        min-width: 0;
    }

    .profile-password-form,
    .profile-delete-form {
        max-width: 100%;
    }
}

.order-receipt-section {
    margin: 1.5rem 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.confirmation-receipt-preview {
    margin-bottom: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.order-receipt-section .order-receipt-document {
    box-sizing: border-box;
    max-width: 720px;
    margin: 0 auto;
    border-radius: 12px;
    padding: 1.5rem;
    background: #ffffff;
    color: #111827;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-wrap: break-word;
    word-break: normal;
}

.order-receipt-section .receipt-heading {
    display: block;
    width: 100%;
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    color: #111827;
    overflow-wrap: normal;
    word-break: normal;
    word-wrap: normal;
    white-space: normal;
    hyphens: none;
    -webkit-hyphens: none;
}

.order-receipt-section .receipt-subheading,
.order-receipt-section .receipt-meta-label,
.order-receipt-section .receipt-shipping-title,
.order-receipt-section .receipt-footer-note {
    color: #6b7280;
}

.order-receipt-section .receipt-subheading {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.order-receipt-section .receipt-meta {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.order-receipt-section .receipt-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #111827;
}

.order-receipt-section .receipt-shipping {
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #111827;
}

.order-receipt-section .receipt-shipping-title {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.order-receipt-section .receipt-shipping p {
    margin: 0;
    line-height: 1.45;
    color: #111827;
}

.order-receipt-section .receipt-items {
    display: grid;
    gap: 0.85rem;
    margin: 0 0 1rem;
}

.order-receipt-section .receipt-item {
    padding: 0.85rem 0 0.95rem;
    border-bottom: 1px solid #e5e7eb;
}

.order-receipt-section .receipt-item:last-child {
    border-bottom: 0;
    padding-bottom: 0.2rem;
}

.order-receipt-section .receipt-item-row {
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    column-gap: 0.75rem;
    align-items: start;
    padding: 0.22rem 0;
}

.order-receipt-section .receipt-item-label {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.order-receipt-section .receipt-item-value {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.order-receipt-section .receipt-item-row.is-item .receipt-item-value {
    font-size: 1rem;
    font-weight: 800;
}

.order-receipt-section .receipt-item-row.is-total {
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px dashed #cbd5e1;
}

.order-receipt-section .receipt-total {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 2px solid #111827;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.order-receipt-section .receipt-payment-summary {
    display: grid;
    gap: 0.45rem;
    margin: 0.85rem 0 0;
    font-size: 0.95rem;
    color: #111827;
}

.order-receipt-section .receipt-status-row strong,
.order-receipt-section .receipt-tracking-value {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #111827;
}

.order-receipt-section .receipt-driver-photo {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    object-fit: cover;
}

.order-receipt-section .receipt-tracking-block {
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    background: #f3f4f6;
    border: 2px solid #111827;
    border-radius: 10px;
}

.order-receipt-section .receipt-tracking-label {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-receipt-section .receipt-tracking-value {
    display: block;
    word-break: break-word;
}

.order-receipt-section .receipt-footer-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
}

@media screen and (max-width: 640px) {
    .order-receipt-section {
        margin-top: 1rem;
        overflow-x: visible;
    }

    .order-receipt-section .order-receipt-document {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 1rem 0.9rem 1.1rem;
        border-radius: 10px;
        overflow: visible;
        font-size: 0.9rem;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .order-receipt-section .receipt-heading {
        font-size: 1.2rem;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        word-wrap: break-word;
        hyphens: none;
        -webkit-hyphens: none;
    }

    .order-receipt-section .receipt-subheading,
    .order-receipt-section .receipt-meta,
    .order-receipt-section .receipt-payment-summary {
        font-size: 0.88rem;
    }

    .order-receipt-section .receipt-subheading,
    .order-receipt-section .receipt-meta,
    .order-receipt-section .receipt-shipping,
    .order-receipt-section .receipt-tracking-block {
        margin-bottom: 0.9rem;
    }

    .order-receipt-section .receipt-meta-row {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .order-receipt-section .receipt-meta-label {
        flex: 0 1 auto;
        max-width: 42%;
    }

    .order-receipt-section .receipt-meta-row strong {
        min-width: 0;
        max-width: 58%;
        width: auto;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .order-receipt-section .receipt-status-row strong,
    .order-receipt-section .receipt-tracking-value {
        font-size: 0.95rem;
    }

    .order-receipt-section .receipt-shipping,
    .order-receipt-section .receipt-tracking-block {
        padding: 0.75rem;
    }

    .order-receipt-section .receipt-item-row {
        grid-template-columns: 3.5rem minmax(0, 1fr);
    }

    .order-receipt-section .receipt-total {
        font-size: 1.05rem;
        flex-wrap: nowrap;
    }

    .order-receipt-section .receipt-footer-note {
        font-size: 0.78rem;
    }

    .receipt-dialog {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        padding: 0.85rem;
    }

    .receipt-dialog-preview {
        padding: 0.35rem;
        overflow-x: visible;
    }
}

.order-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-history-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    overflow: hidden;
}

.order-history-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.order-history-summary::-webkit-details-marker {
    display: none;
}

.order-history-summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.order-history-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.order-history-meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.order-history-summary-side {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.order-history-total {
    color: var(--success-text);
    font-size: 1rem;
}

.order-history-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: 0.15rem;
}

.order-history-card[open] .order-history-chevron {
    transform: rotate(225deg);
    margin-top: 0.25rem;
}

.order-history-card[open] .order-history-summary {
    border-bottom: 1px solid var(--border);
    background: rgba(59, 130, 246, 0.08);
}

.order-history-body {
    padding: 1rem 1.1rem 1.15rem;
}

.order-history-tracking,
.order-history-emailed {
    margin: 0 0 0.85rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.order-history-body .order-receipt-section {
    margin-top: 0.35rem;
}

.order-history-body .receipt-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.order-history-body .receipt-actions-primary {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.order-history-body .receipt-actions .btn {
    width: auto;
}

@media print {
    body[data-printing-order] .order-history-card {
        display: none !important;
    }

    body[data-printing-order] .order-history-card.is-print-target {
        display: block !important;
        border: none;
        background: #fff;
    }

    body[data-printing-order] .order-history-card.is-print-target .order-history-summary {
        display: none !important;
    }

    body[data-printing-order] .order-history-card.is-print-target .confirmation-receipt-preview {
        padding: 0;
        margin: 0;
        background: #ffffff;
    }

    body[data-printing-order] .order-history-card.is-print-target .order-receipt-document {
        max-width: none;
        margin: 0;
        padding: 0;
        border-radius: 0;
    }
}

.receipt-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.receipt-actions-primary {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.store-nav-lock-icon {
    margin-left: 0.35rem;
    font-size: 0.95rem;
    line-height: 1;
    vertical-align: middle;
}

.console-menu-lock-dialog {
    width: min(100%, 26rem);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.console-menu-lock-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.console-menu-lock-form {
    padding: 1.15rem 1.2rem 1.25rem;
}

.console-menu-lock-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.console-menu-lock-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.console-menu-lock-subtitle {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.console-menu-lock-error {
    margin: 0 0 0.85rem;
    color: #fca5a5;
    font-size: 0.9rem;
}

.console-menu-lock-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.kiosk-idle-dialog {
    width: min(100%, 28rem);
}

.kiosk-idle-count-wrap {
    margin: 0.85rem 0 1rem;
    text-align: center;
}

.kiosk-idle-count {
    display: inline-block;
    min-width: 8rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.kiosk-idle-actions {
    flex-direction: column;
}

.console-menu-lock-actions .btn {
    width: auto;
    flex: 1 1 8rem;
}

.console-receipt-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.console-receipt-actions .btn,
.console-cancel-order-form .btn {
    width: 100%;
}

.console-receipt-actions .receipt-actions-primary {
    width: 100%;
}

.console-receipt-actions .receipt-actions-primary .btn {
    flex: 1 1 8rem;
    width: auto;
}

.receipt-qr-dialog {
    width: min(100%, 22rem);
}

.receipt-qr-dialog-panel {
    margin: 0;
}

.console-cancel-order-form {
    margin: 0;
    width: 100%;
}

.shop-console-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.15rem;
    padding: 1rem 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.shop-console-qr-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.shop-console-qr {
    padding: 0.65rem;
    background: #ffffff;
    border-radius: 10px;
}

.shop-console-qr img,
.shop-console-qr canvas {
    display: block;
}

.shop-console-qr-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    text-align: center;
}

body.console-confirmation .checkout-actions {
    display: none;
}

@media print {
    @page {
        margin: 0.5in;
        size: auto;
    }

    html {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body,
    body.has-list-scroll {
        background: #ffffff !important;
        color: #111827 !important;
        display: block !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .no-print {
        display: none !important;
    }

    .page,
    .page-store,
    .card,
    main,
    body.has-list-scroll > main,
    body.has-list-scroll > main > .card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: #ffffff !important;
        color: #111827 !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
        flex: none !important;
    }

    .order-receipt-section,
    .confirmation-receipt-preview,
    .order-receipt-document,
    .list-scroll-pane,
    .list-scroll-pane--soft {
        margin: 0 !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    .order-receipt-section .order-receipt-document {
        max-width: none !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #111827 !important;
    }

    body[data-printing-confirmation-receipt] > *:not(main),
    body[data-printing-order] > *:not(main) {
        display: none !important;
    }

    body[data-printing-confirmation-receipt] main .card > *:not(.order-receipt-section) {
        display: none !important;
    }

    body[data-printing-confirmation-receipt] .order-receipt-section > *:not(.confirmation-receipt-preview),
    body[data-printing-order] .order-history-card.is-print-target .order-history-body > *:not(.confirmation-receipt-preview):not(.order-receipt-section) {
        display: none !important;
    }

    body[data-printing-confirmation-receipt] .confirmation-receipt-preview,
    body[data-printing-order] .order-history-card.is-print-target .confirmation-receipt-preview {
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    body[data-printing-confirmation-receipt] .order-receipt-section .order-receipt-document,
    body[data-printing-order] .order-history-card.is-print-target .order-receipt-document {
        padding: 0 !important;
    }

    body[data-printing-confirmation-receipt] .receipt-meta-row,
    body[data-printing-order] .receipt-meta-row {
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
    }

    body[data-printing-confirmation-receipt] .receipt-meta-row strong,
    body[data-printing-order] .receipt-meta-row strong {
        width: auto !important;
        text-align: right !important;
    }
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
    max-width: 34rem;
    margin-inline: auto;
}

.settings-fieldset {
    margin: 0;
    padding: 1rem 1.05rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
}

.settings-fieldset legend {
    padding: 0 0.35rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.settings-help {
    margin: 0 0 0.85rem;
}

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-option:hover,
.theme-option.is-selected {
    border-color: var(--primary);
}

.theme-option input {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.theme-option-swatch {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.theme-option-swatch--day {
    background: linear-gradient(135deg, #e2e8f0 0%, #bfdbfe 100%);
}

.theme-option-swatch--night {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.theme-option-swatch--english,
.theme-option-swatch--spanish {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.theme-option-swatch--english {
    background:
        linear-gradient(180deg, #1d4ed8 0 33%, #ffffff 33% 66%, #dc2626 66% 100%);
}

.theme-option-swatch--spanish {
    background:
        linear-gradient(180deg, #c1121f 0 25%, #f4a261 25% 75%, #c1121f 75% 100%);
}

.theme-option-swatch-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    padding: 0.12rem 0.28rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #f8fafc;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
}

html.theme-day .theme-option-swatch-code {
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
}

.theme-option-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.theme-option-copy strong {
    color: var(--text);
    font-size: 0.95rem;
}

.theme-option-copy span {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

html.theme-day .card {
    box-shadow: var(--shadow);
}

html.theme-day .store-nav-menu {
    border-color: var(--border);
    box-shadow: var(--shadow);
}

html.theme-day .alert-error {
    color: #991b1b;
}

html.theme-day .alert-success {
    color: var(--success-text);
    background: rgba(4, 120, 87, 0.1);
    border-color: rgba(4, 120, 87, 0.35);
}

html.theme-day .status-badge.status-refunded,
html.theme-day .status-completed,
html.theme-day .payment-badge.payment-paid,
html.theme-day .account-status-badge--active {
    color: var(--success-text);
    background: rgba(4, 120, 87, 0.12);
    border-color: rgba(4, 120, 87, 0.35);
}

html.theme-day .qty-badge:not(.qty-low) {
    color: #065f46;
    background: rgba(6, 95, 70, 0.14);
    border: 1px solid rgba(6, 95, 70, 0.4);
    font-weight: 700;
}

html.theme-day .qty-badge.qty-low {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.12);
    border: 1px solid rgba(185, 28, 28, 0.4);
    font-weight: 700;
}

html.theme-day .status-shipping {
    color: var(--shipping-text);
    background: rgba(3, 105, 161, 0.12);
    border-color: rgba(3, 105, 161, 0.35);
}

html.theme-day .status-out_for_delivery {
    color: #6b21a8;
    background: rgba(126, 34, 206, 0.12);
    border: 1px solid rgba(126, 34, 206, 0.4);
    font-weight: 700;
}

html.theme-day .status-processing {
    color: var(--link);
    background: rgba(29, 78, 216, 0.1);
    border-color: rgba(29, 78, 216, 0.3);
}

html.theme-day .product-stock.stock-limited {
    color: #92400e;
    font-weight: 700;
}

html.theme-day .status-pending,
html.theme-day .payment-badge.payment-unpaid,
html.theme-day .payment-text-unpaid,
html.theme-day .status-badge.status-approved,
html.theme-day .status-badge.status-instructions_sent,
html.theme-day .status-badge.status-received {
    color: #92400e;
    background: rgba(146, 64, 14, 0.12);
    border: 1px solid rgba(146, 64, 14, 0.35);
    font-weight: 700;
}

html.theme-day .payment-text-unpaid {
    background: transparent;
    border: none;
}

html.theme-day .message-list-item.is-unread .message-status {
    color: #b91c1c;
}

html.theme-day .message-relation-order {
    color: #1d4ed8 !important;
}

html.theme-day .message-relation-return {
    color: #b45309 !important;
}

.user-accounts-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.user-accounts-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.user-accounts-section .profile-section-title {
    margin-bottom: 0.35rem;
}

.user-accounts-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    margin-bottom: 0.35rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.user-accounts-filter {
    margin-top: 1rem;
}

/* Card-style pane so the list reads as one grouped block. */
.user-accounts-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.list-scroll-pane--soft.user-accounts-scroll {
    max-height: min(var(--visible-rows-height, 24rem), 60vh, 24rem);
}

.user-accounts-table {
    margin: 0;
}

.user-accounts-table td {
    vertical-align: top;
    padding: 0.85rem 1rem;
}

.user-accounts-scroll .user-accounts-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-accounts-table tbody tr {
    transition: background 0.15s ease;
}

.user-accounts-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.06);
}

.user-accounts-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.user-accounts-table tbody tr:target {
    background: rgba(59, 130, 246, 0.16);
    box-shadow: inset 3px 0 0 var(--primary);
}

.user-account-name {
    font-weight: 700;
    word-break: break-word;
}

.user-account-tag {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.user-account-tag--admin {
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: var(--primary);
}

.user-account-tag--console {
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.user-account-address {
    display: block;
    max-width: 26rem;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.user-account-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.user-accounts-table .account-status-badge {
    margin-bottom: 0;
    padding: 0.28rem 0.6rem;
    font-size: 0.78rem;
    white-space: nowrap;
}

.user-account-action-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.user-account-action-form .btn {
    width: auto;
    padding: 0.5rem 0.95rem;
    font-size: 0.88rem;
}

.user-account-action-form .order-delete-password {
    min-width: 9rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
}

@media (max-width: 640px) {
    /*
     * Phones: stacked cards are far taller than table rows, so cap against the
     * viewport instead of a rem height that would clip mid-account.
     */
    .list-scroll-pane--soft.user-accounts-scroll {
        max-height: min(var(--visible-rows-height, 55vh), 55vh);
        overscroll-behavior: contain;
    }

    .user-accounts-scroll {
        padding: 0.4rem;
        background: transparent;
    }

    .user-accounts-table tbody tr,
    .user-accounts-table tbody tr:nth-child(even) {
        margin-bottom: 0.6rem;
        background: var(--surface);
    }

    .user-accounts-table tbody tr:last-child {
        margin-bottom: 0;
    }

    /* Compact label/value rows keep about three accounts in view. */
    .user-accounts-table tbody td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 0.6rem;
        padding: 0.45rem 0.65rem;
    }

    .user-accounts-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .user-accounts-table tbody td.inventory-actions-cell::before {
        content: none;
    }

    .user-accounts-table tbody td > * {
        text-align: right;
    }

    .user-account-address {
        max-width: none;
        font-size: 0.82rem;
    }

    .user-account-tag {
        margin-top: 0;
        margin-left: 0.35rem;
    }

    .user-account-action-form {
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 0.4rem;
        width: 100%;
    }

    .user-account-action-form .order-delete-password {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
    }

    .user-account-action-form .btn {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }
}

html.theme-day .user-accounts-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.03);
}

html.theme-day .user-accounts-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.08);
}

/* These panels are tinted with slate, which reads as muddy grey on white. */
html.theme-day .inventory-section {
    background: rgba(15, 23, 42, 0.045);
}

html.theme-day .return-admin-details {
    background: rgba(15, 23, 42, 0.035);
}

@media (hover: hover) {
    html.theme-day .admin-order-summary:hover {
        background: rgba(37, 99, 235, 0.08);
    }

    html.theme-day .admin-order-card[open] .admin-order-summary:hover {
        background: rgba(37, 99, 235, 0.12);
    }
}


