@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Poppins:wght@500;600;700&display=swap');

:root {
    --brand-primary: #00a651;
    --brand-primary-dark: #008744;
    --brand-primary-light: #e8f8ef;
    --brand-promo: #ffc107;
    --brand-footer: #080b15;
    --brand-navy: #1a365d;
    --brand-text: #3b4251;
    --brand-text-muted: #707070;
    --brand-surface: #f8f9fa;
    --brand-border: #e5e7eb;
    --brand-white: #ffffff;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.1);
    --container: 1200px;
    --font-sans: 'Open Sans', system-ui, sans-serif;
    --font-heading: 'Poppins', 'Open Sans', sans-serif;
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

html, body {
    width: 100%;
    max-width: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--brand-text);
    background: var(--brand-white);
    /* clip keeps horizontal bleed off-screen without computing overflow-y to auto */
    overflow-x: clip;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.75rem;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-dark); }

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Top bar */
.top-bar {
    background: var(--brand-surface);
    border-bottom: 1px solid var(--brand-border);
    font-size: 0.875rem;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-bar-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-bar-links a {
    color: var(--brand-text);
    font-weight: 600;
}

/* Header */
.site-header {
    background: var(--brand-white);
    border-bottom: 1px solid var(--brand-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.875rem 0;
}

.header-nav-wrap {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.header-end {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--brand-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    min-width: 0;
}

.logo:hover { color: var(--brand-text); }

.logo-text strong { font-weight: 700; color: var(--brand-primary); }

.logo-mark {
    width: 40px;
    height: 40px;
    background: var(--brand-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--brand-text);
    font-weight: 600;
    font-size: 0.9375rem;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--brand-primary);
}

.header-search {
    display: flex;
    align-items: center;
    flex: 1 1 200px;
    max-width: 340px;
    min-width: 0;
    position: relative;
    overflow: visible;
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
}

.header-search .search-suggest {
    flex: 1 1 auto;
    min-width: 0;
}

.header-search .search-suggest__list {
    left: 0;
    right: 0;
    min-width: 16rem;
}

.header-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.header-search-input:focus { outline: none; }

.header-search-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--brand-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.header-search-btn:hover { background: var(--brand-primary-dark); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon-link {
    position: relative;
    color: var(--brand-text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background var(--transition);
}

.header-icon-link:hover {
    background: var(--brand-surface);
    color: var(--brand-primary);
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--brand-primary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge[hidden] {
    display: none !important;
}

.cart-link {
    position: relative;
    color: var(--brand-text);
    font-weight: 600;
}

.search-section {
    position: relative;
    z-index: 3;
    background: var(--brand-surface);
    padding: 1rem 0;
    border-bottom: 1px solid var(--brand-border);
}

.search-section--compact {
    padding: 0.5rem 0;
    background: var(--brand-white);
}

.search-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    max-width: 720px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-form--compact {
    max-width: 100%;
}

.search-suggest {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-width: 0;
}

.search-input {
    width: 100%;
    min-width: 0;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    text-overflow: ellipsis;
}

.search-form--compact .search-input {
    padding: 0.5rem 0.75rem;
    /* Keep >=16px on small screens to avoid iOS focus zoom. */
    font-size: 1rem;
}

@media (min-width: 768px) {
    .search-form--compact .search-input {
        font-size: 0.875rem;
    }
}

.search-form .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.search-form--compact .btn {
    min-height: 40px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.15);
}

.search-suggest__list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--brand-white);
    color: var(--brand-text);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.12);
    max-height: min(70vh, 22rem);
    max-height: min(22rem, 70dvh, calc(100dvh - 6rem));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.search-suggest__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    color: var(--brand-text);
    text-decoration: none;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.search-suggest__option:hover,
.search-suggest__option:focus-visible,
.search-suggest__list [role="option"].is-active .search-suggest__option {
    background: rgba(0, 166, 81, 0.08);
    color: var(--brand-text);
    outline: none;
}

.search-suggest__cover {
    flex: 0 0 40px;
    width: 40px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.search-suggest__cover--empty {
    background: linear-gradient(160deg, #eef2f6, #dbe3ea);
}

.search-suggest__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.search-suggest__title {
    color: var(--brand-text);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggest__meta {
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalogue-sort-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.catalogue-sort-label {
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

.catalogue-sort-select {
    width: auto;
    min-width: 10rem;
    min-height: 40px;
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
}

/* Promo banner */
.promo-banner {
    background: linear-gradient(90deg, #e8940f 0%, var(--brand-promo) 50%, #e8940f 100%);
    color: white;
    text-align: center;
    padding: 0.625rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.promo-banner-icon {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}
.btn[hidden] {
    display: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.btn-primary:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-outline:hover {
    background: var(--brand-primary);
    color: white;
}

/* Secondary navigation CTA — stronger than outline/secondary so it never reads as disabled. */
.btn-continue {
    background: var(--brand-white);
    color: var(--brand-navy);
    border: 2px solid var(--brand-navy);
    font-weight: 600;
}

.btn-continue:hover {
    background: var(--brand-navy);
    color: white;
    border-color: var(--brand-navy);
}

.btn.btn-outline.is-danger {
    color: #b91c1c;
    border-color: #b91c1c;
}

.btn.btn-outline.is-danger:hover {
    background: #b91c1c;
    color: white;
}

.btn-secondary {
    background: var(--brand-surface);
    color: var(--brand-text);
    border-color: var(--brand-border);
}

.btn-block { width: 100%; }

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-sm {
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-white:hover {
    background: white;
    color: var(--brand-primary);
}

.btn-dark {
    background: var(--brand-footer);
    color: white;
    border-color: var(--brand-footer);
}

.btn-dark:hover {
    background: #111827;
    color: white;
}

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

/* Cards */
.card {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

.stat-card {
    text-align: center;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-primary);
    font-family: var(--font-heading);
}

.stat-card .label {
    color: var(--brand-text-muted);
    font-size: 0.875rem;
}

/* Homepage v2 */
.page-home {
    overflow-x: clip;
}

.page-home .site-header {
    box-shadow: none;
    border-bottom: 1px solid var(--brand-border);
}

.page-home .header-search {
    display: none;
}

/* overflow-x:clip (not hidden) so a visible overflow-y dropdown is not forced to auto */
.page-home main {
    overflow-x: clip;
}

.hero-v2 {
    position: relative;
    z-index: 2;
    min-height: clamp(320px, 42vh, 520px);
    display: flex;
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(1.75rem, 5vw, 3.5rem);
    overflow: visible;
}

.hero-v2--compact {
    min-height: auto;
}

.hero-v2-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.75) 45%, rgba(255,255,255,0.2) 100%),
        url('https://images.unsplash.com/photo-1497633762265-9d179a990aa6?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
}

.hero-v2-overlay { display: none; }

.hero-v2-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 620px;
}

.hero-v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-promo);
    color: #1a1a1a;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.hero-v2-title {
    font-size: clamp(1.625rem, 4.5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--brand-navy);
    margin-bottom: 0.75rem;
}

.hero-v2-lead {
    font-size: clamp(0.9375rem, 2.2vw, 1.125rem);
    color: var(--brand-text-muted);
    margin: 0 0 1.25rem;
    line-height: 1.55;
}

.hero-v2-search {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.375rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.25rem;
}

.hero-v2-search .search-suggest {
    flex: 1;
    min-width: 0;
}

.hero-v2-search input {
    width: 100%;
    min-width: 0;
    border: none;
    padding: 0.875rem 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    border-radius: var(--radius);
}

.hero-v2-search input:focus { outline: none; }

.hero-v2-search .search-suggest__list {
    left: 0.375rem;
    right: 0.375rem;
}

.hero-v2-search-dual {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.875rem;
    margin-bottom: 0;
    max-width: 560px;
}

.hero-v2-search-dual .hero-v2-search {
    margin-bottom: 0;
    width: 100%;
}

/* Hero sits on a light image wash — white outline lacks contrast at desktop.
   Use primary outline on white fill at every width; leave green CTA Sell alone. */
.page-home .hero-v2-search-dual .btn-hero-sell,
.page-home .hero-v2-search-dual .home-search-actions .btn-outline {
    background: var(--brand-white);
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
}

.page-home .hero-v2-search-dual .btn-hero-sell:hover,
.page-home .hero-v2-search-dual .home-search-actions .btn-outline:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
}

.page-home .hero-v2-search-dual .btn-hero-sell:disabled,
.page-home .hero-v2-search-dual .btn-hero-sell[aria-disabled="true"],
.page-home .hero-v2-search-dual .home-search-actions .btn-outline:disabled,
.page-home .hero-v2-search-dual .home-search-actions .btn-outline[aria-disabled="true"] {
    background: var(--brand-white);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    opacity: 0.45;
}

.hero-v2-actions,
.home-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.home-search-hint {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--brand-text-muted);
}

.hero-v2-search-dual .home-search-hint,
.home-cta-search--dual .home-search-hint {
    color: rgba(59, 66, 81, 0.85);
}

.home-cta-search--dual .home-search-hint {
    color: rgba(255, 255, 255, 0.92);
}

.home-search-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--brand-border);
    color: var(--brand-text);
    font-size: 0.875rem;
}

.home-search-selected[hidden] {
    display: none !important;
}

.home-search-selected__label {
    min-width: 0;
}

.home-search-selected__label strong {
    font-weight: 600;
}

.home-search-selected__clear {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--brand-text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.home-search-selected__clear:hover,
.home-search-selected__clear:focus-visible {
    background: rgba(59, 66, 81, 0.08);
    outline: none;
}

.home-search-actions .btn:disabled,
.home-search-actions .btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.search-form--dual {
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Compact catalogue search keeps a single-row strip; homepage dual Buy/Sell
   must wrap even when both --compact and --dual are present (sticky home). */
.search-form--compact.search-form--dual {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.search-form--dual .search-suggest {
    flex: 1 1 100%;
    width: 100%;
}

.search-form--dual .home-search-actions {
    display: flex;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.15rem;
    gap: 0.5rem;
}

.search-form--dual .home-search-actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
    width: auto;
}

.search-form--dual .home-search-hint {
    flex: 1 1 100%;
    width: 100%;
    margin-top: -0.15rem;
}

.search-form--dual .home-search-selected {
    flex: 1 1 100%;
    width: 100%;
}

.trust-bar {
    background: white;
    border-bottom: 1px solid var(--brand-border);
    padding: 0.875rem 0;
}

.trust-bar--compact {
    padding: 0.75rem 0;
}

.trust-bar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.25rem;
}

.trust-bar--compact .trust-bar-grid {
    gap: 0.875rem;
}

.trust-bar-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8125rem;
}

.trust-bar-item strong {
    display: block;
    color: var(--brand-text);
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.trust-bar-item span { color: var(--brand-text-muted); }

.trust-bar-icon {
    color: var(--brand-primary);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.why-section,
.popular-section,
.testimonials-section,
.how-section {
    padding: clamp(1.75rem, 5vw, 4rem) 0;
}

.why-section { background: var(--brand-surface); }
.popular-section { border-top: 1px solid var(--brand-border); }
.how-section { border-top: 1px solid var(--brand-border); }
.testimonials-section { border-top: 1px solid var(--brand-border); }

.section-heading {
    text-align: center;
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: var(--brand-navy);
    margin-bottom: 1.5rem;
}

.section-heading--left { text-align: left; margin-bottom: 0; }

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.link-arrow {
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.link-arrow:hover { color: var(--brand-primary-dark); }

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

.why-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.why-grid--compact .why-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    padding: 0.875rem 1rem;
}

.why-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-radius: 50%;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.why-grid--compact .why-icon {
    margin-bottom: 0;
    width: 36px;
    height: 36px;
}

.why-card h3 {
    font-size: 0.9375rem;
    color: var(--brand-navy);
    margin-bottom: 0.25rem;
}

.why-card p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    line-height: 1.45;
}

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

.product-card {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: none;
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.product-card-cover {
    display: block;
    aspect-ratio: 2 / 3;
    max-height: 180px;
    background: var(--brand-surface);
    overflow: hidden;
}

.product-card-cover img,
.product-card-cover .book-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.product-card-title {
    font-size: 0.875rem;
    line-height: 1.35;
    min-height: 0;
    margin-bottom: 0.375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-title a { color: var(--brand-text); }

.product-card-price {
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 0.125rem;
    font-size: 0.9375rem;
}

.product-card-meta {
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    margin: 0 0 0.625rem;
}

.product-card-btn {
    width: 100%;
    margin-top: auto;
}

.how-section {
    background: var(--brand-white);
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    align-items: start;
}

.how-grid--compact {
    gap: 1.25rem;
}

.how-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.how-grid--compact .how-column {
    background: var(--brand-surface);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem 1.125rem;
}

.how-column-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0 0 0.75rem;
    text-align: left;
}

.how-list {
    margin: 0 0 0.875rem;
    padding-left: 1.15rem;
    color: var(--brand-text);
    font-size: 0.875rem;
    line-height: 1.55;
}

.how-list li + li {
    margin-top: 0.4rem;
}

.how-panel {
    width: 100%;
    background: var(--brand-surface);
    border-radius: var(--radius-xl);
    padding: 2rem 1.25rem 1.75rem;
    text-align: center;
}

.how-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.how-step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.how-step-icon {
    width: 52px;
    height: 52px;
    background: var(--brand-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    margin-bottom: 0.625rem;
    flex-shrink: 0;
}

.how-step-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.how-step-desc {
    font-size: 0.6875rem;
    color: var(--brand-text-muted);
    line-height: 1.45;
    margin: 0;
    max-width: 118px;
}

.how-step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    flex-shrink: 0;
    align-self: flex-start;
    padding-top: 1.125rem;
}

.how-panel-link {
    display: inline-block;
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.how-panel-link:hover {
    color: var(--brand-primary-dark);
}

/* Homepage / how-it-works journey infographic */
.journey-infographic {
    background: var(--brand-surface);
    border-top: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
    padding: 2rem 0 2.25rem;
}

.journey-infographic__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.journey-infographic__intro .section-heading {
    margin-bottom: 0.35rem;
}

.journey-infographic__lead {
    margin: 0;
    max-width: 40rem;
    color: var(--brand-text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.journey-infographic__play {
    flex: 0 0 auto;
    min-height: 40px;
}

.journey-infographic__pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.journey-lane {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    scroll-margin-top: calc(var(--site-header-height, 4.5rem) + 1rem);
}

.journey-lane--buy {
    border-top: 3px solid var(--brand-primary);
}

.journey-lane--sell {
    border-top: 3px solid var(--brand-navy);
}

.journey-lane__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.journey-lane__badge {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.journey-lane--buy .journey-lane__badge {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}

.journey-lane--sell .journey-lane__badge {
    background: rgba(26, 54, 93, 0.1);
    color: var(--brand-navy);
}

.journey-lane__title {
    margin: 0;
    font-size: 1.125rem;
    color: var(--brand-navy);
}

.journey-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    position: relative;
}

.journey-step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.35rem 0.15rem 0.15rem;
    border-radius: var(--radius);
}

.journey-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1.15rem;
    left: calc(50% + 1.15rem);
    width: calc(100% - 1.05rem);
    height: 2px;
    background: linear-gradient(90deg, var(--brand-primary), rgba(0, 166, 81, 0.25));
    pointer-events: none;
}

.journey-lane--sell .journey-step:not(:last-child)::after {
    background: linear-gradient(90deg, var(--brand-navy), rgba(26, 54, 93, 0.2));
}

.journey-step__marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    z-index: 1;
}

.journey-step__number {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    background: var(--brand-primary);
    color: var(--brand-white);
}

.journey-lane--sell .journey-step__number {
    background: var(--brand-navy);
}

.journey-step__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}

.journey-lane--sell .journey-step__icon {
    background: rgba(26, 54, 93, 0.08);
    color: var(--brand-navy);
}

.journey-step__copy {
    text-align: center;
}

.journey-step__title {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--brand-navy);
    line-height: 1.3;
}

.journey-step__body {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--brand-text-muted);
}

.journey-lane__link {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--brand-primary);
}

.journey-lane__link:hover {
    color: var(--brand-primary-dark);
}

.journey-infographic.is-playing .journey-step {
    animation: journey-step-pulse 0.85s ease both;
}

.journey-infographic.is-playing .journey-step[data-journey-step="1"] { animation-delay: 0.05s; }
.journey-infographic.is-playing .journey-step[data-journey-step="2"] { animation-delay: 0.85s; }
.journey-infographic.is-playing .journey-step[data-journey-step="3"] { animation-delay: 1.65s; }
.journey-infographic.is-playing .journey-step[data-journey-step="4"] { animation-delay: 2.45s; }

@keyframes journey-step-pulse {
    0% {
        background: transparent;
        transform: translateY(0);
    }
    35% {
        background: rgba(0, 166, 81, 0.1);
        transform: translateY(-2px);
    }
    100% {
        background: transparent;
        transform: translateY(0);
    }
}

.journey-infographic.is-playing .journey-lane--sell .journey-step {
    animation-name: journey-step-pulse-navy;
}

@keyframes journey-step-pulse-navy {
    0% {
        background: transparent;
        transform: translateY(0);
    }
    35% {
        background: rgba(26, 54, 93, 0.1);
        transform: translateY(-2px);
    }
    100% {
        background: transparent;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .journey-infographic__play {
        display: none !important;
    }

    .journey-infographic.is-playing .journey-step,
    .journey-infographic.is-playing .journey-lane--sell .journey-step {
        animation: none !important;
        background: transparent !important;
        transform: none !important;
    }
}

.how-it-works-hero {
    padding: 2rem 0 0.5rem;
    background: var(--brand-white);
}

.how-it-works-hero__inner {
    max-width: 720px;
}

.how-it-works-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.how-it-works-notes {
    padding: 0 0 2.5rem;
    background: var(--brand-white);
}

.how-it-works-notes__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.how-it-works-note {
    background: var(--brand-surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
}

.how-it-works-note h2 {
    margin: 0 0 0.75rem;
    font-size: 1.0625rem;
    color: var(--brand-navy);
}

.how-it-works-note ul {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--brand-text);
    font-size: 0.875rem;
    line-height: 1.55;
}

.how-it-works-note li + li {
    margin-top: 0.45rem;
}

.page-home .popular-section {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}

.page-home .hero-v2--compact {
    min-height: auto;
}

@media (max-width: 991px) {
    .journey-infographic__pair,
    .how-it-works-notes__grid {
        grid-template-columns: 1fr;
    }

    .journey-steps {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .journey-step {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.875rem;
        padding: 0.75rem 0;
    }

    .journey-step:not(:last-child) {
        border-bottom: 1px solid var(--brand-border);
    }

    .journey-step:not(:last-child)::after {
        display: none;
    }

    .journey-step__marker {
        flex-direction: column;
        width: 2.5rem;
        flex-shrink: 0;
    }

    .journey-step__icon {
        display: none;
    }

    .journey-step__copy {
        text-align: left;
        flex: 1 1 auto;
        min-width: 0;
    }

    .journey-step__title {
        font-size: 0.9375rem;
    }

    .journey-step__body {
        font-size: 0.8125rem;
    }
}

@media (max-width: 767px) {
    .journey-infographic {
        padding: 1.5rem 0 1.75rem;
    }

    .journey-infographic__header {
        align-items: stretch;
    }

    .journey-infographic__play {
        width: 100%;
    }

    .how-it-works-jump .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
}

.testimonials-section { background: white; }

.testimonials-rating {
    text-align: center;
    color: var(--brand-text-muted);
    margin: -0.75rem 0 1.25rem;
    font-size: 0.9375rem;
}

.stars { color: var(--brand-primary); letter-spacing: 0.1em; }

.testimonials-stack {
    max-width: 640px;
    margin: 0 auto;
    display: grid;
    gap: 0.875rem;
}

.testimonials-more {
    justify-self: center;
    margin-top: 0.25rem;
}

.testimonials-carousel {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.35s ease;
}

.testimonial-card {
    background: var(--brand-surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem 1.125rem;
    margin: 0;
    text-align: left;
}

.testimonial-stars {
    color: var(--brand-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.15em;
}

.testimonial-card p {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--brand-text);
    margin: 0 0 0.875rem;
    font-style: italic;
}

.testimonial-card footer {
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 1px solid var(--brand-border);
    border-radius: 50%;
    background: white;
    color: var(--brand-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 2;
}

.carousel-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.carousel-btn--prev { left: -20px; }
.carousel-btn--next { right: -20px; }

.home-cta {
    position: relative;
    z-index: 2;
    background: var(--brand-primary);
    color: white;
    padding: 2rem 0;
}

.home-cta-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: center;
}

.home-cta-icon { opacity: 0.9; }

.home-cta-text h2 {
    color: white;
    font-size: 1.375rem;
    margin-bottom: 0.25rem;
}

.home-cta-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9375rem;
}

.home-cta-search {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.375rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 100%;
}

.home-cta-search--dual {
    flex-direction: column;
    align-items: stretch;
    background: transparent;
    padding: 0;
    gap: 0.75rem;
    max-width: 420px;
}

.home-cta-search--dual .search-suggest {
    position: relative;
    z-index: 6;
    background: white;
    border-radius: var(--radius-lg);
    padding: 0.375rem;
}

.home-cta,
.home-cta-inner,
.home-cta-search--dual {
    overflow: visible;
}

.home-cta-search .search-suggest {
    flex: 1;
    min-width: 0;
}

.home-cta-search input {
    width: 100%;
    min-width: 0;
    border: none;
    padding: 0.625rem 0.875rem;
    font-family: inherit;
    font-size: 0.875rem;
    border-radius: var(--radius);
}

.home-cta-search input:focus { outline: none; }

.home-cta-search .search-suggest__list {
    left: 0.375rem;
    right: 0.375rem;
}

.home-cta-search--dual .home-search-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
}

.home-cta-search--dual .home-search-selected {
    background: rgba(255, 255, 255, 0.96);
}

.features-bar {
    padding: 2rem 0;
    border-top: 1px solid var(--brand-border);
    background: white;
}

.features-bar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 1.25rem;
}

.features-bar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-text);
}

.features-bar-item svg { color: var(--brand-primary); }

/* Homepage — large screens */
@media (min-width: 1201px) {
    .product-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .home-cta-inner {
        grid-template-columns: auto 1fr auto;
        gap: 1.5rem;
    }

    .home-cta-search {
        min-width: 280px;
        max-width: 360px;
    }

    .hero-v2-actions .btn,
    .home-search-actions .btn {
        min-width: 160px;
    }

    .hero-v2-search,
    .hero-v2-search-dual {
        max-width: 560px;
    }

    .home-cta-search--dual {
        min-width: 320px;
        max-width: 420px;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .hero-v2 {
        min-height: 460px;
        padding: 2.5rem 0 3rem;
    }

    .hero-v2-inner {
        max-width: 540px;
    }

    .hero-v2-actions,
    .home-search-actions {
        flex-direction: row;
    }

    .hero-v2-actions .btn,
    .home-search-actions .btn {
        flex: 1;
        width: auto;
    }

    .hero-v2-search {
        flex-direction: row;
    }

    .hero-v2-search .btn {
        width: auto;
        white-space: nowrap;
    }

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

    .testimonials-carousel {
        padding: 0 2.75rem;
    }

    .carousel-btn--prev { left: 0; }
    .carousel-btn--next { right: 0; }
}

@media (max-width: 1200px) {
    .header-search {
        display: none;
    }

    .main-nav {
        gap: 1rem;
    }

    .main-nav a {
        font-size: 0.875rem;
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--brand-white);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--brand-border);
}

.empty-state p {
    margin: 0 0 0.25rem;
    font-weight: 600;
}

/* Shared section utilities */
.steps-section {
    padding: 4.5rem 0;
    background: var(--brand-white);
}

.section-header { margin-bottom: 2.5rem; }

.section-header--row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.5rem;
    color: var(--brand-footer);
}

.section-title--left { text-align: left; }

.section-subtitle {
    text-align: center;
    color: var(--brand-text-muted);
    margin: 0;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.section-subtitle--left {
    text-align: left;
    margin-left: 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.step-card {
    padding: 1.75rem 1.5rem;
    background: var(--brand-surface);
    border-radius: var(--radius-xl);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 1rem;
}

.card-grid--books { gap: 1.25rem; }

/* Auth */
.auth-page {
    padding: 3rem 0;
    background: var(--brand-surface);
    min-height: calc(100vh - 200px);
}

.auth-page--focused {
    padding: 1.25rem 0 2rem;
    min-height: auto;
}

.auth-page-inner {
    max-width: 420px;
    margin: 0 auto;
}

.auth-panel {
    padding: 1.25rem 1.25rem 1.35rem;
}

.auth-panel h1 {
    margin-bottom: 0.35rem;
    font-size: 1.5rem;
}

.auth-lead {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
}

.auth-form .form-group {
    margin-bottom: 0.875rem;
}

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

.auth-remember {
    font-size: 0.875rem;
}

.auth-forgot-link {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.auth-error-actions {
    margin-top: 0.5rem;
}

.auth-error-actions a {
    font-weight: 700;
}

.auth-register-prompt {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--brand-text-muted);
}

.auth-register-prompt a {
    font-weight: 700;
}

.page-auth .site-footer--compact {
    margin-top: 0;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.15);
}

.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--brand-text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--brand-border);
}

.auth-divider span {
    flex: 0 0 auto;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 1rem;
    background: #fff;
    color: #3c4043;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    color: #202124;
}

.btn-google:focus-visible {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.25);
}

.btn-google__icon {
    display: inline-flex;
    flex-shrink: 0;
}

.btn-google__label {
    line-height: 1.2;
}

.auth-form {
    margin-top: 0.25rem;
}

.alert-info {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

.alert-info p {
    margin: 0.35rem 0 0;
}

.alert-info p:last-child,
.reservation-banner p:last-child {
    margin-bottom: 0;
}

.reservation-banner {
    font-size: 0.9375rem;
}

.reservation-hold-list {
    margin: 0.5rem 0 0;
    padding-left: 1.15rem;
}

.reservation-hold-list li + li {
    margin-top: 0.35rem;
}

.reservation-note {
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    line-height: 1.4;
    max-width: 28rem;
}

.reservation-note strong {
    display: block;
    color: var(--brand-text, #111827);
    font-weight: 600;
}

.offer-in-cart {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    text-align: right;
}

.offer-in-cart span {
    font-size: 0.875rem;
    font-weight: 600;
}

.book-card-in-cart {
    font-size: 0.8125rem;
    margin: 0 0 0.65rem;
    color: var(--brand-text-muted);
}

.reservation-cta-hint {
    margin: 0.45rem 0 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    max-width: 22rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .offer-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .offer-in-cart {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .reservation-cta-hint {
        max-width: none;
        margin-bottom: 0.75rem;
    }
}

/* Portal layout */
.portal-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 120px);
}

.portal-layout > * {
    min-width: 0;
}

body.is-backend {
    background: var(--brand-surface);
    --admin-sidebar-expanded: 240px;
    --admin-sidebar-collapsed: 68px;
    --admin-sidebar-transition: 220ms ease;
}

html.is-backend,
html.is-backend body {
    height: 100%;
    overflow: hidden;
}

body.is-backend .portal-layout {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: var(--admin-sidebar-expanded) 1fr;
}

.portal-sidebar {
    background: var(--brand-footer);
    color: white;
    padding: 1.5rem 0;
}

body.is-backend .portal-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.15rem 1.5rem;
    color: white;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-sidebar a.portal-brand {
    padding: 1.15rem 1.5rem;
    color: white;
}

.portal-brand:hover,
.portal-sidebar a.portal-brand:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.portal-brand .logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    background: var(--brand-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

body.is-backend .portal-sidebar-nav {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.is-backend .portal-sidebar-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body.is-backend .portal-brand,
body.is-backend .portal-user {
    flex-shrink: 0;
}

.portal-sidebar a {
    display: block;
    padding: 0.625rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.9375rem;
}

.portal-sidebar a:hover,
.portal-sidebar a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.portal-user {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-user-name {
    font-weight: 700;
    font-size: 0.875rem;
}

.portal-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.75rem;
}

.portal-sign-out {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    padding: 0.35rem 0.7rem;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.portal-sign-out:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.portal-content {
    padding: 2rem;
    background: var(--brand-surface);
    min-width: 0;
    max-width: 100%;
}

body.is-backend .portal-content {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 2rem;
}

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

.page-header h1 {
    font-size: 1.75rem;
}

.page-header p {
    color: var(--brand-text-muted);
    margin: 0;
}

/* Footer */
.site-footer {
    background: var(--brand-footer);
    color: rgba(255, 255, 255, 0.85);
    padding: 2.5rem 0 1rem;
    margin-top: auto;
}

.site-footer--compact {
    padding: 1.25rem 0 0.875rem;
}

.footer-brand {
    margin-bottom: 1.25rem;
}

.footer-brand-copy {
    margin: 0;
    max-width: 36rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.footer-group {
    border: 0;
    margin: 0;
    padding: 0;
}

.footer-group-summary {
    list-style: none;
    color: white;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.footer-group-summary::-webkit-details-marker {
    display: none;
}

.footer-group-links a {
    color: rgba(255, 255, 255, 0.75);
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
}

.footer-group-links a:hover { color: white; }

.site-footer h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.75);
    display: block;
    margin-bottom: 0.5rem;
}

.site-footer a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.875rem;
    text-align: center;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    font-size: 1.375rem;
    cursor: pointer;
    color: var(--brand-text);
    flex-shrink: 0;
}

/* Utilities */
.text-muted { color: var(--brand-text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

.admin-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem;
}
.admin-search .form-input {
    flex: 1 1 16rem;
    min-width: 0;
    width: auto;
}
@media (max-width: 768px) {
    .admin-search .form-input {
        flex: 1 1 100%;
        width: 100%;
    }
}

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
    max-width: 100%;
}
.pagination-bar-summary {
    margin: 0;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}
.pagination-bar-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 100%;
}
.pagination-bar-link,
.pagination-bar-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.7rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: white;
    color: var(--brand-text);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-sizing: border-box;
}
.pagination-bar-link:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.pagination-bar-link.is-current {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}
.pagination-bar-link.is-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}
.pagination-bar-ellipsis {
    border: 0;
    background: transparent;
    min-width: 1.5rem;
    color: var(--brand-text-muted);
}
.pagination-bar svg {
    width: 14px;
    height: 14px;
    display: block;
}

@media (max-width: 992px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .logo {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-end {
        margin-left: auto;
    }

    .header-nav-wrap {
        display: none;
        flex: 1 1 100%;
        order: 10;
        justify-content: stretch;
    }

    .header-nav-wrap.is-open {
        display: flex;
        padding-top: 0.75rem;
        border-top: 1px solid var(--brand-border);
        margin-top: 0.25rem;
    }

    .header-nav-wrap.is-open .main-nav {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .header-nav-wrap.is-open .main-nav a {
        display: block;
        padding: 0.875rem 0;
        border-bottom: 1px solid var(--brand-border);
    }

    .header-nav-wrap.is-open .main-nav li:last-child a {
        border-bottom: none;
    }

    .mobile-toggle { display: flex; }

    .home-cta-inner {
        text-align: center;
    }

    .home-cta-search {
        margin: 0 auto;
        max-width: 480px;
    }

    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-grid { grid-template-columns: 1fr; }
    .portal-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }

    /* Legacy non-account portal strip (kept for safety if portal is reused) */
    body:not(.is-backend):not(.is-account) .portal-sidebar {
        display: block;
        padding: 0;
        background: var(--brand-footer);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    body:not(.is-backend):not(.is-account) .portal-sidebar-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    body:not(.is-backend):not(.is-account) .portal-sidebar-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.875rem 1rem;
        border-bottom: 3px solid transparent;
    }

    body:not(.is-backend):not(.is-account) .portal-sidebar-nav a.active {
        background: rgba(255, 255, 255, 0.08);
        border-bottom-color: var(--brand-primary);
    }

    body:not(.is-backend):not(.is-account) .portal-content {
        padding: 1.25rem 1rem;
    }

    /* Admin: compact header + expandable drawer nav */
    html.is-backend .portal-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    body.is-backend .portal-sidebar {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    body.is-backend .portal-sidebar-nav,
    body.is-backend .portal-user {
        display: none;
    }

    body.is-backend.admin-nav-open .portal-sidebar-nav {
        display: block;
        max-height: min(70vh, 28rem);
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.is-backend.admin-nav-open .portal-user {
        display: block;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .search-form {
        flex-direction: column;
    }

    .search-form--compact {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .search-form--compact.search-form--dual {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .search-form .btn {
        width: 100%;
        min-height: 44px;
    }

    .search-form--compact .btn {
        width: auto;
        min-height: 40px;
    }

    .search-form--compact.search-form--dual .home-search-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        width: auto;
        min-height: 44px;
    }

    .page-header--split {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header--split .btn {
        width: 100%;
    }

    .logo-text {
        font-size: 0.8125rem;
    }

    .hero-v2 {
        min-height: auto;
        padding: 2rem 0 2.5rem;
        align-items: flex-end;
    }

    .hero-v2-bg {
        background:
            linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.88) 55%, rgba(255,255,255,0.75) 100%),
            url('https://images.unsplash.com/photo-1497633762265-9d179a990aa6?auto=format&fit=crop&w=1200&q=80') center top/cover no-repeat;
    }

    .hero-v2-inner {
        max-width: none;
        width: 100%;
    }

    .hero-v2-badge {
        font-size: 0.6875rem;
        padding: 0.4375rem 0.75rem;
        max-width: 100%;
        text-align: left;
    }

    .hero-v2-title {
        font-size: clamp(1.625rem, 7vw, 2.25rem);
    }

    .hero-v2-lead {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .hero-v2-search {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .hero-v2-search .btn {
        width: 100%;
        min-height: 44px;
    }

    .hero-v2-actions,
    .home-search-actions {
        flex-direction: column;
    }

    .hero-v2-actions .btn,
    .home-search-actions .btn {
        width: 100%;
        min-height: 48px;
    }

    .page-home .home-cta-search--dual .home-search-actions .btn-outline-white {
        background: rgba(255, 255, 255, 0.14);
        border: 2px solid white;
        color: white;
    }

    .page-home .home-cta-search--dual .home-search-actions .btn-outline-white:hover {
        background: white;
        color: var(--brand-primary);
    }

    .trust-bar-grid {
        gap: 0.875rem;
    }

    .trust-bar-item {
        padding: 0.75rem;
        background: var(--brand-surface);
        border-radius: var(--radius-lg);
    }

    .section-heading {
        font-size: 1.375rem;
        margin-bottom: 1.75rem;
        padding: 0 0.25rem;
    }

    .section-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .link-arrow {
        align-self: flex-start;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
    .product-card-body { padding: 0.75rem; }

    .product-card-title {
        font-size: 0.8125rem;
        min-height: auto;
    }

    .how-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .how-column-title {
        font-size: 1.0625rem;
        margin-bottom: 0.875rem;
    }

    .how-steps {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        gap: 0.5rem;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }

    .how-steps::-webkit-scrollbar {
        display: none;
    }

    .how-step {
        flex: 0 0 132px;
    }

    .how-step-desc {
        max-width: none;
    }

    .how-step-arrow {
        flex: 0 0 auto;
        padding-top: 1rem;
    }

    .how-panel {
        padding: 1.5rem 1.25rem;
    }

    .steps-grid { grid-template-columns: 1fr; }

    .testimonials-carousel {
        overflow: visible;
        padding: 0;
    }

    .testimonials-track {
        flex-direction: column;
        gap: 1rem;
        transform: none !important;
    }

    .testimonial-card {
        flex: none;
        padding: 1.5rem 1.25rem;
    }

    .carousel-btn {
        display: none;
    }

    .testimonials-rating {
        margin: -1rem 0 1.5rem;
        font-size: 0.875rem;
    }

    .home-cta {
        padding: 2rem 0;
    }

    .home-cta-inner {
        gap: 1.25rem;
    }

    .home-cta-icon {
        display: none;
    }

    .home-cta-text h2 {
        font-size: 1.25rem;
    }

    .home-cta-search {
        flex-direction: column;
        gap: 0.5rem;
    }

    .home-cta-search .btn {
        width: 100%;
        min-height: 44px;
    }

    .features-bar {
        padding: 1.5rem 0;
    }

    .features-bar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .features-bar-item {
        font-size: 0.8125rem;
        justify-content: flex-start;
    }

    .steps-grid { grid-template-columns: 1fr; }
    .top-bar-inner { justify-content: center; text-align: center; }
    .book-detail-grid { grid-template-columns: 1fr; }

    .offer-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .offer-row form {
        width: 100%;
    }

    .offer-row form[style*="display:flex"],
    .cart-qty-form {
        display: flex !important;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }

    .mode-toggle {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .checkout-address-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .auth-page {
        padding: 2rem 0;
    }

    .auth-page .card {
        padding: 1.25rem;
    }

    .table-scroll .data-table {
        min-width: 32rem;
    }
}

@media (max-width: 480px) {
    .logo-text strong {
        display: block;
        line-height: 1.1;
    }

    .features-bar-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-v2-badge span {
        line-height: 1.35;
    }
}

/* Books */
.book-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 1.25rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.book-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.book-card-header {
    display: flex;
    flex-direction: column;
    min-height: 9.35rem;
}

.book-card .book-card-cta {
    margin-top: auto;
}

.book-cover-placeholder {
    height: 140px;
    background: var(--brand-surface);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-text-muted);
    font-size: 0.875rem;
}

.book-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    background: var(--brand-surface);
}

.book-cover--fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    background:
        linear-gradient(160deg, #e8f8ef 0%, #f3f6f8 55%, #e7edf3 100%);
    color: var(--brand-navy);
    border: 1px solid var(--brand-border);
}

.book-cover-fallback-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(0, 166, 81, 0.12);
    color: var(--brand-primary);
}

.book-cover-fallback-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--brand-navy);
    max-width: 11rem;
}

.book-card-cover {
    aspect-ratio: 2 / 3;
    width: 100%;
    max-height: 180px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: var(--brand-surface);
}

.book-card-meta {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.15rem;
    min-height: 2.9rem;
    margin-bottom: 0.35rem;
}

.book-card-author,
.book-card-year {
    font-size: 0.875rem;
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-card-status {
    display: flex;
    align-items: flex-start;
    min-height: 1.5rem;
    margin-bottom: 0.35rem;
}

.book-card-price,
.book-card-oos,
.book-card-sell-hint {
    margin: 0;
}

.book-card-title {
    font-size: 1rem;
    line-height: 1.35;
    min-height: calc(1.35em * 3);
    margin: 0 0 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-title a {
    color: var(--brand-text);
}

.book-price {
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0.5rem 0 1rem;
    font-variant-numeric: tabular-nums;
}

.book-card .book-card-price {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.book-card-oos {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--brand-text-muted);
}

.book-card-sell-hint {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.book-card-conditions {
    /* Shared tracks for every condition row (subgrid): name | price | availability.
       Price absorbs leftover width so availability stays on the card’s right edge. */
    --book-card-condition-action: 6.5rem;
    --book-card-condition-cols: max-content minmax(max-content, 1fr) var(--book-card-condition-action);
    --book-card-condition-gap: 0.65rem;
    display: grid;
    grid-template-columns: var(--book-card-condition-cols);
    column-gap: var(--book-card-condition-gap);
    width: 100%;
    margin: 0.25rem 0 0.95rem;
    font-size: 0.875rem; /* ~14px condition/price */
}

.book-card-condition {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    align-items: center;
    column-gap: var(--book-card-condition-gap);
    /* Room for touch action + reserved stock line under both Select and Unavailable. */
    min-height: calc(2.5rem + 0.2rem + (0.75rem * 1.25) + 0.9rem);
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--brand-border);
}

.book-card-condition:last-child {
    border-bottom: none;
}

.book-card-condition-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--brand-text);
    min-width: 0;
    line-height: 1.3;
    overflow: visible;
    white-space: nowrap;
}

.book-card-condition-price {
    display: block;
    margin: 0;
    justify-self: end;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    line-height: 1.3;
    overflow: visible;
    text-overflow: clip;
}

.book-card-condition-price--muted {
    color: var(--brand-text-muted);
    font-weight: 500;
    /* "Price unavailable" may wrap; monetary amounts never use this modifier. */
    white-space: normal;
    max-width: 7rem;
}

.book-card-condition-avail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    justify-self: stretch;
    gap: 0.2rem;
    width: 100%;
    min-width: 0;
    /* Action + gap + stock line — keeps unavailable rows as tall as Select + stock. */
    min-height: calc(2.5rem + 0.2rem + (0.75rem * 1.25));
}

.book-card-condition-stock {
    order: 2;
    color: var(--brand-text-muted);
    font-size: 0.75rem; /* 12px */
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    min-height: calc(0.75rem * 1.25);
}

.book-card-condition-stock--empty {
    visibility: hidden;
}

.book-card-condition-action {
    order: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.5rem; /* touch-friendly */
}

.book-card-condition-action .btn {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
    justify-content: center;
    margin: 0;
    white-space: nowrap;
}

.book-card-condition-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.35rem 0.4rem;
    text-align: center;
    font-size: 0.75rem; /* 12px */
    line-height: 1.25;
    font-weight: 500;
    border-radius: var(--radius);
    background: var(--brand-surface);
}

.book-card-condition-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

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

.book-detail-image {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.offer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--brand-border);
}

.checkout-line {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--brand-border);
    min-width: 0;
}

.checkout-line-cover.book-cover,
.checkout-line-cover.book-cover--fallback,
.checkout-line-cover.book-cover--missing {
    width: 3rem;
    height: 4.25rem;
    flex: 0 0 3rem;
    object-fit: cover;
    overflow: hidden;
    border-radius: 0.35rem;
}

.checkout-line-cover.book-cover--fallback,
.checkout-line-cover.book-cover--missing {
    padding: 0.2rem;
    gap: 0.15rem;
}

.checkout-line-cover .book-cover-fallback-mark {
    display: none;
}

.checkout-line-cover .book-cover-fallback-title {
    font-size: 0.55rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.checkout-line-main {
    flex: 1 1 auto;
    min-width: 0;
}

.checkout-line-title {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.checkout-line-price {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: right;
}

.checkout-line--total {
    border-bottom: none;
    font-size: 1.125rem;
}

.checkout-balance {
    display: grid;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
}

.checkout-balance div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.checkout-balance dt {
    margin: 0;
    color: var(--brand-text-muted, #64748b);
}

.checkout-balance dd {
    margin: 0;
    white-space: nowrap;
    font-weight: 600;
}

.checkout-address-editor {
    margin-top: 0.75rem;
}

.checkout-address-editor-warning {
    margin: 0 0 1rem;
}

.checkout-saved-address {
    display: grid;
    justify-items: start;
    gap: 0.75rem;
}

.checkout-saved-address[hidden],
#saved-address-panel[hidden],
#saved-address-editor-panel[hidden],
#saved-address-mode-actions[hidden] {
    display: none;
}

#edit-saved-address,
#use-different-address,
#use-saved-address,
.checkout-address-editor-actions .btn,
#place-order {
    min-height: 44px;
}

.checkout-address-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

#saved-address-mode-actions {
    margin-top: 0.75rem;
}

.checkout-address-editor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.checkout-address-editor-form {
    margin: 0;
    padding: 0;
    border: 0;
}

#place-order:disabled,
#place-order:disabled:hover,
#save-saved-address:disabled,
#save-saved-address:disabled:hover,
#cancel-saved-address-edit:disabled,
#cancel-saved-address-edit:disabled:hover,
#edit-saved-address:disabled,
#edit-saved-address:disabled:hover,
#use-different-address:disabled,
#use-different-address:disabled:hover,
#use-saved-address:disabled,
#use-saved-address:disabled:hover {
    opacity: 0.55;
    cursor: not-allowed;
}

#place-order:disabled,
#place-order:disabled:hover,
#save-saved-address:disabled,
#save-saved-address:disabled:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

#cancel-saved-address-edit:disabled,
#cancel-saved-address-edit:disabled:hover,
#edit-saved-address:disabled,
#edit-saved-address:disabled:hover,
#use-different-address:disabled,
#use-different-address:disabled:hover,
#use-saved-address:disabled,
#use-saved-address:disabled:hover {
    background: transparent;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

#address-edit-required {
    margin: 1rem 0 0;
}

@media (max-width: 480px) {
    #edit-saved-address,
    #use-different-address,
    #use-saved-address,
    .checkout-address-editor-actions .btn {
        width: 100%;
    }

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

@media (max-width: 768px) {
    .checkout-line,
    .checkout-balance div {
        gap: 0.5rem;
    }
}

.cart-page {
    max-width: 900px;
}

.cart-page h1 {
    margin-bottom: 0.35rem;
}

.cart-empty {
    margin: 0 0 1rem;
}

.cart-reservation-notice {
    margin-bottom: 1rem;
}

.cart-reservation-notice p {
    margin: 0;
}

.cart-lines .cart-line:first-child {
    padding-top: 0;
}

.cart-line {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--brand-border);
    min-width: 0;
}

.cart-lines .cart-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-line-media {
    display: block;
    width: 3rem;
    color: inherit;
}

.cart-line-cover.book-cover,
.cart-line-cover.book-cover--fallback,
.cart-line-cover.book-cover--missing {
    width: 3rem;
    height: 4.25rem;
    flex: 0 0 3rem;
    object-fit: cover;
    overflow: hidden;
    border-radius: 0.35rem;
}

.cart-line-cover.book-cover--fallback,
.cart-line-cover.book-cover--missing {
    padding: 0.2rem;
    gap: 0.15rem;
}

.cart-line-cover .book-cover-fallback-mark {
    display: none;
}

.cart-line-cover .book-cover-fallback-title {
    font-size: 0.55rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-line-main {
    min-width: 0;
}

.cart-line-title {
    display: block;
    color: inherit;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}

a.cart-line-title:hover {
    color: var(--brand-primary);
}

.cart-line-note {
    margin: 0.35rem 0 0;
    color: var(--brand-text-muted);
    font-size: 0.875rem;
}

.cart-line-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.cart-line-actions .btn,
.cart-summary-actions .btn {
    min-height: 44px;
}

.cart-line-price {
    white-space: nowrap;
    text-align: right;
}

.cart-line--total {
    grid-template-columns: minmax(0, 1fr) auto;
    border-bottom: none;
    padding-top: 0;
    font-size: 1.125rem;
}

.cart-delivery-note {
    margin: 0.35rem 0 0;
    color: var(--brand-text-muted);
    font-size: 0.875rem;
}

.cart-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 480px) {
    .cart-line {
        grid-template-columns: 3rem minmax(0, 1fr);
        gap: 0.5rem;
    }

    .cart-line-price {
        grid-column: 2;
        justify-self: end;
    }

    .cart-line--total {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .cart-line--total .cart-line-price {
        grid-column: auto;
    }

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

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

    .cart-summary-actions {
        flex-direction: column;
    }

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

.offer-row:last-child {
    border-bottom: none;
}

/* Public / account table scrollport — keeps wide tables usable on small screens */
.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll .data-table {
    min-width: 36rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--brand-border);
}

.data-table th {
    background: var(--brand-surface);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    background: var(--brand-surface);
    color: var(--brand-text);
}

.status-pill--pending,
.status-pill--awaiting_seller_confirmation,
.status-pill--awaiting_verification {
    background: #fef3c7;
    color: #92400e;
}

.status-pill--paid,
.status-pill--seller_accepted,
.status-pill--succeeded,
.status-pill--completed {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}

.status-pill--processing,
.status-pill--partially_delivered {
    background: #dbeafe;
    color: #1e40af;
}

.status-pill--cancelled,
.status-pill--expired,
.status-pill--failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-pill--historical {
    background: #e2e8f0;
    color: #334155;
}

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

.form-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
}

.reassign-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    min-width: 220px;
}

.reassign-form .form-input {
    width: auto;
    min-width: 180px;
    max-width: 280px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8125rem;
}

.reassign-form .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.status-pill--success { background: #dcfce7; color: #166534; }
.status-pill--info { background: #dbeafe; color: #1e40af; }
.status-pill--warning { background: #fef3c7; color: #92400e; }
.status-pill--danger { background: #fee2e2; color: #991b1b; }
.status-pill--muted { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.status-pill--neutral { background: #eef2ff; color: #3730a3; }
.status-pill--staging {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #c2410c;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.admin-summary-section {
    margin-bottom: 1.25rem;
}

.admin-summary-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.admin-summary-heading .item-meta {
    margin: 0.15rem 0 0.75rem;
}

.seller-listings-stats {
    margin-bottom: 0.5rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.seller-listings-stats .cp-stat {
    min-width: 0;
}

@media (max-width: 1100px) {
    .seller-listings-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .seller-listings-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.seller-listings-status-card {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    cursor: pointer;
}

.seller-listings-status-card:hover {
    border-color: #93c5fd;
}

.seller-listings-status-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.seller-listings-activity-section {
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
}

.seller-listings-activity-toolbar {
    margin-bottom: 0.75rem;
}

.seller-listings-filter-form {
    margin-bottom: 0.75rem;
}

.seller-listings-toolbar {
    flex-wrap: wrap;
    align-items: flex-end;
}

.seller-listings-toolbar--primary {
    gap: 0.65rem;
}

.seller-listings-toolbar--primary .admin-toolbar-search {
    flex: 1 1 16rem;
    min-width: min(100%, 14rem);
}

.seller-listings-toolbar--primary .admin-toolbar-field:not(.admin-toolbar-search) {
    flex: 0 1 10.5rem;
    min-width: 8.5rem;
}

.seller-listings-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
}

.seller-listings-advanced-filters {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
}

.seller-listings-advanced-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem 0.85rem;
}

.seller-listings-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    background: #eff6ff;
}

.seller-listings-bulk-bar[hidden] {
    display: none !important;
}

.seller-listings-selected-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-right: 0.25rem;
}

.seller-listings-stack {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.seller-listings-stack .cell-meta {
    display: block;
    line-height: 1.25;
}

.seller-listings-stock {
    white-space: nowrap;
    font-size: 0.875rem;
}

.seller-listings-table .col-book {
    min-width: 14rem;
}

.seller-listings-table .col-seller {
    min-width: 12rem;
}

.seller-listings-table .col-condition,
.seller-listings-table .col-status {
    white-space: nowrap;
}

.seller-listings-table .col-stock {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .seller-listings-advanced-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .seller-listings-toolbar--primary .admin-toolbar-field,
    .seller-listings-toolbar--primary .admin-toolbar-search {
        flex: 1 1 100%;
        min-width: 0;
    }

    .seller-listings-advanced-grid {
        grid-template-columns: 1fr;
    }

    .seller-listings-toolbar-actions {
        width: 100%;
    }
}

.seller-listings-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.seller-listings-history-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.seller-listings-history-item:last-child {
    border-bottom: 0;
}

.staging-redirect-banner {
    border-color: #c2410c;
    background: #fff7ed;
}
.staging-redirect-banner p { margin: 0; }
.staging-redirect-banner strong { color: #9a3412; }

.order-detail { max-width: 1280px; }

.order-back { margin: 0 0 0.75rem; font-size: 0.875rem; }

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

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

.order-title-row h1 { margin: 0; font-size: 1.75rem; }

.order-quick-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

.order-quick-stats li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.order-stat-icon { display: inline-flex; color: inherit; }
.order-quick-stats .is-success { color: #166534; }
.order-quick-stats .is-info { color: #1d4ed8; }
.order-quick-stats .is-danger { color: #b91c1c; }

.order-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.order-more { position: relative; }
.order-more summary { list-style: none; cursor: pointer; }
.order-more summary::-webkit-details-marker { display: none; }
.order-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 5;
    padding: 0.35rem 0;
}
.order-more-menu a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--brand-text);
    font-size: 0.875rem;
}
.order-more-menu a:hover { background: var(--brand-surface); }

.order-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
}

.order-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--brand-border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}
.order-tabs a {
    padding: 0.75rem 1rem;
    color: var(--brand-text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.order-tabs a:hover { color: var(--brand-navy); }
.order-tabs a.is-active {
    color: var(--brand-navy);
    border-bottom-color: var(--brand-primary);
}

.order-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
}

.item-card {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 0.9rem 1rem;
    margin-bottom: 0.85rem;
    position: relative;
}
.item-card:has(.item-more[open]) { z-index: 6; }

.item-card--issue { border-color: #fca5a5; }
.item-card--cancelled { border-color: #fca5a5; background: #fff8f8; }

.item-card-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.item-card-book { display: flex; align-items: flex-start; gap: 0.85rem; min-width: 0; flex: 1; }
.item-book-details { min-width: 0; flex: 1; }
.item-book-heading {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}
.item-book-title-block { min-width: 0; flex: 1; }
.item-card-book h3 { font-size: 1.0625rem; margin: 0 0 0.1rem; line-height: 1.3; }

.item-isbn {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    line-height: 1.3;
}

.item-thumb {
    width: 72px;
    height: 96px;
    border-radius: 0.35rem;
    background: var(--brand-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-text-muted);
    overflow: hidden;
    flex-shrink: 0;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.item-meta {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    line-height: 1.4;
}

.item-book-stack {
    margin: 0.25rem 0 0;
    display: grid;
    gap: 0.05rem;
}
.item-book-stack .item-book-field {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
}
.item-book-line {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--brand-text);
}
.item-inventory { margin-top: 0.15rem; }
.item-book-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.05rem 1rem;
    margin: 0.2rem 0 0;
    max-width: 32rem;
}
.item-book-field {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.3;
    min-width: 0;
}
.item-book-field dt {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--brand-text-muted);
}
.item-book-field dt::after { content: ':'; }
.item-book-field dd {
    margin: 0;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}
.item-condition { margin: 0.2rem 0 0; }
.item-condition-badge {
    letter-spacing: 0.04em;
    font-weight: 700;
    text-transform: uppercase;
}

.item-card-status { text-align: right; flex-shrink: 0; }
.item-index {
    margin: 0 0 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    letter-spacing: 0.01em;
}
.item-price {
    margin: 0 0 0.35rem;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.item-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}
.item-more-toggle {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: white;
    color: var(--brand-text);
    cursor: pointer;
    padding: 0;
}
.item-more-toggle:hover { background: var(--brand-surface); }
.item-more .order-more-menu { min-width: 240px; }
.item-more-action > summary {
    list-style: none;
    cursor: pointer;
    display: block;
    width: 100%;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    color: #b91c1c;
}
.item-more-action > summary::-webkit-details-marker { display: none; }
.item-more-action > summary:hover { background: var(--brand-surface); }
.item-more-cancel-form {
    padding: 0 0.85rem 0.75rem;
    display: grid;
    gap: 0.45rem;
}
.item-reinstate-confirm {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #334155;
}
.item-reinstate-confirm input {
    margin-top: 0.15rem;
    flex: 0 0 auto;
}
.item-status-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #c2410c;
}
.item-card:not(.item-card--inactive) .item-status-note {
    color: #0f766e;
}

.item-card-lower {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
    gap: 0.85rem 1.1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--brand-border);
    align-items: start;
}
.item-card-lower--divided .item-seller {
    padding-right: 1.15rem;
    border-right: 1px solid var(--brand-border);
}
.item-seller { position: relative; }
.item-seller-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.item-seller-head .fulfilment-label { margin: 0; }
.item-seller-head .manage-replacement { flex-shrink: 0; }
.item-seller-head .manage-replacement-panel {
    position: absolute;
    right: 0;
    top: 1.9rem;
    z-index: 4;
    min-width: min(100%, 18rem);
    box-shadow: var(--shadow-md);
}
.item-card:has(.manage-replacement[open]) { z-index: 6; }
.item-seller-name {
    margin: 0 0 0.2rem;
    font-size: 0.9375rem;
    font-weight: 700;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.item-seller-phones,
.item-seller-payout,
.item-seller-listed,
.item-seller-payment {
    margin: 0 0 0.15rem;
    font-size: 0.8125rem;
    line-height: 1.35;
}
.item-seller-address { overflow-wrap: anywhere; }
.item-seller-payment { margin-bottom: 0; }
.item-seller-meta {
    margin: 0 0 0.65rem;
    display: grid;
    gap: 0.2rem;
}
.item-seller-meta div { margin: 0; }
.item-seller-meta dt {
    display: inline;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
}
.item-seller-meta dt::after { content: ': '; }
.item-seller-meta dd {
    display: inline;
    margin: 0;
    font-size: 0.8125rem;
}

.courier-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.35rem;
}
.courier-company-name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}
.courier-route {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.5rem 0.65rem;
    align-items: start;
    margin-bottom: 0.55rem;
}
.courier-company {
    margin: 0 0 0.55rem;
}
.courier-company dt {
    display: inline;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}
.courier-company dt::after { content: ': '; }
.courier-company dd {
    display: inline;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}
.courier-addresses {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.5rem 0.65rem;
    align-items: start;
    margin-bottom: 0.6rem;
}
.courier-address p { margin: 0; font-size: 0.8125rem; line-height: 1.35; overflow-wrap: anywhere; }
.courier-address-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
    margin-bottom: 0.2rem !important;
}
.courier-address-arrow {
    color: var(--brand-text-muted);
    font-size: 1rem;
    line-height: 1.8rem;
}
.courier-empty {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
}

.fulfilment-box {
    margin-top: 1rem;
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}
.fulfilment-box--current {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}
.fulfilment-box--previous {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
}
.seller-history {
    list-style: none;
    margin: 0;
    padding: 0;
}

.seller-history li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--brand-border);
}

.seller-history li:last-child { border-bottom: 0; }

.seller-history-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.seller-history .is-superseded strong {
    color: var(--brand-text-muted);
}
.seller-history-courier {
    margin-top: 0.7rem;
    padding: 0.7rem 0.75rem;
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
}
.seller-history-courier .courier-booking + .courier-booking {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--brand-border);
}
.fulfilment-box summary { cursor: pointer; font-weight: 600; font-size: 0.875rem; }
.fulfilment-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6d28d9;
    margin: 0 0 0.5rem;
}
.fulfilment-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.item-card-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--brand-border);
    font-size: 0.875rem;
}
.footer-label {
    display: block;
    font-size: 0.75rem;
    color: var(--brand-text-muted);
    margin-bottom: 0.15rem;
}

.item-card-actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.manage-replacement { display: inline-block; }
.manage-replacement summary { list-style: none; cursor: pointer; display: inline-block; }
.manage-replacement summary::-webkit-details-marker { display: none; }
.manage-replacement-panel {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--brand-surface);
    border-radius: var(--radius);
}

.latest-notes { margin-top: 1.5rem; }
.latest-notes h3 { font-size: 1.0625rem; }
.note-item {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: 1rem;
}
.note-meta { font-size: 0.75rem; color: var(--brand-text-muted); margin: 0 0 0.35rem; }

.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--brand-border);
}
.timeline-list li:last-child { border-bottom: 0; }
.timeline-list strong { display: block; }

.side-card {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.15rem 1.2rem;
    margin-bottom: 1rem;
}
.side-card h3 { font-size: 0.9375rem; margin-bottom: 0.85rem; }

.side-dl { margin: 0; }
.side-dl > div { margin-bottom: 0.85rem; }
.side-dl dt {
    font-size: 0.75rem;
    color: var(--brand-text-muted);
    margin-bottom: 0.2rem;
}
.side-dl dd { margin: 0; font-size: 0.875rem; }

.side-totals { border-top: 1px solid var(--brand-border); padding-top: 0.75rem; }
.side-total-paid { color: var(--brand-primary-dark); font-size: 1rem; }

.progress-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-fill {
    height: 100%;
    background: var(--brand-primary);
    border-radius: 999px;
}

.quick-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.quick-actions .btn { width: 100%; text-align: center; }
.quick-actions-secondary {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.quick-actions-secondary a {
    font-size: 0.8125rem;
    font-weight: 600;
}
.side-card--assigned {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.side-assigned-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0;
}
.side-assigned-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

.add-product-panel summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    color: var(--brand-navy);
    list-style: none;
}
.add-product-panel summary::-webkit-details-marker { display: none; }
.add-product-search {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.add-product-search .form-input { flex: 1 1 220px; }
.add-product-results { margin-top: 0.5rem; }
.add-product-row-form {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.add-product-row-form .form-input {
    width: 70px;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
}

.courier-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    min-width: 0;
}
.courier-booking + .courier-booking { margin-top: 0.75rem; }
.courier-booking--compact {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--brand-border);
}
.courier-previous-body > .courier-booking--compact:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.courier-previous {
    margin-top: 0.55rem;
}
.courier-previous > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-text-muted);
}
.courier-previous > summary::-webkit-details-marker { display: none; }
.courier-previous > summary::before {
    content: '▸ ';
    color: var(--brand-text-muted);
}
.courier-previous[open] > summary::before { content: '▾ '; }
.courier-previous-body {
    margin-top: 0.45rem;
    padding: 0.55rem 0.65rem;
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
}
.seller-history-panel {
    margin-top: 0.65rem;
}
.seller-history-panel > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-text-muted);
}
.seller-history-panel > summary::-webkit-details-marker { display: none; }
.seller-history-panel > summary::before {
    content: '▸ ';
    color: var(--brand-text-muted);
}
.seller-history-panel[open] > summary::before { content: '▾ '; }
.seller-history-panel-body {
    margin-top: 0.45rem;
    padding: 0.55rem 0.7rem;
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
}
.seller-history-panel .seller-history li:first-child {
    padding-top: 0;
}
.seller-history-panel .seller-history li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
.courier-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.courier-form { margin-top: 0.75rem; }
.courier-form-compact { margin-top: 0.4rem; }
.courier-form-compact .form-grid { gap: 0.4rem 0.65rem; }
.courier-form-compact .form-label {
    margin-bottom: 0.12rem;
    font-size: 0.75rem;
}
.courier-form-compact .form-input,
.courier-form-compact select.form-input {
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.25;
    min-height: 0;
}
.courier-form-note { margin: 0.35rem 0 0.4rem; }
.courier-form-compact .courier-rates { gap: 0.35rem; margin: 0.45rem 0 0.55rem; }
.courier-form-compact .courier-rate { padding: 0.4rem 0.55rem; }
.courier-scheduler-panel {
    margin-top: 0.45rem;
    padding: 0.55rem 0.65rem;
}
.courier-booking-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}
.courier-booking-heading {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.courier-latest {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.35;
}
.shipment-addresses {
    margin: 0.55rem 0 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
}
.shipment-addresses-heading {
    margin: 0 0 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}
.shipment-addresses-route {
    margin: 0;
}
.courier-history {
    margin-top: 0.2rem;
}
.courier-history > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-navy);
}
.courier-history > summary::-webkit-details-marker { display: none; }
.courier-history > summary::before {
    content: '▸ ';
    color: var(--brand-text-muted);
}
.courier-history[open] > summary::before { content: '▾ '; }
.courier-more .order-more-menu { min-width: 210px; }
.historical-courier {
    margin-top: 0.55rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: white;
}
.historical-courier > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    display: grid;
    gap: 0.1rem;
}
.historical-courier > summary::-webkit-details-marker { display: none; }
.historical-courier > summary::before {
    content: '▸ ';
    color: var(--brand-text-muted);
}
.historical-courier[open] > summary::before { content: '▾ '; }
.historical-courier-title { font-weight: 700; font-size: 0.8125rem; }
.historical-courier-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--brand-text-muted);
}
.historical-courier-body { padding: 0 0.65rem 0.65rem; }
.courier-rates { display: grid; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.courier-rate,
.replacement-candidate {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
}
.courier-rate:has(input:checked),
.replacement-candidate:has(input:checked) {
    border-color: var(--brand-primary);
}
.courier-rate strong,
.replacement-candidate strong { display: block; }
.replacement-candidate-body { display: grid; gap: 0.15rem; min-width: 0; flex: 1; }
.replacement-candidate-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}
.replacement-candidate-condition {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--brand-text-muted);
    white-space: nowrap;
}
.replacement-match {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-navy);
}
.replacement-candidates { display: grid; gap: 0.5rem; margin: 0.65rem 0 0; }
.replacement-current { margin: 0 0 0.35rem; font-weight: 600; color: var(--brand-text); }
.replacement-section { margin: 0 0 0.85rem; }
.replacement-section-title {
    margin: 0 0 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}
.replacement-current-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.85rem;
    margin: 0 0 0.55rem;
}
.replacement-current-grid dt {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.replacement-current-grid dd {
    margin: 0.1rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-text);
}
.item-seller-condition-note {
    margin: 0.35rem 0 0;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: #f8fafc;
    font-size: 0.8125rem;
    color: var(--brand-text);
}
.item-seller-condition-note .item-meta {
    display: block;
    margin-top: 0.2rem;
}
.replacement-condition-warning {
    flex-shrink: 0;
    margin: 0;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--brand-border);
    background: #fffbeb;
}
.replacement-condition-warning[hidden] {
    display: none !important;
}
.replacement-condition-warning-title {
    margin: 0 0 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #92400e;
}
.replacement-dialog-footer {
    justify-content: space-between;
    gap: 0.75rem;
}
.replacement-form {
    display: block;
    min-width: 0;
    width: 100%;
}
.replacement-form .form-input {
    width: 100%;
    max-width: none;
    min-width: 0;
}
.replacement-tabs {
    display: flex;
    gap: 0.15rem;
    border-bottom: 1px solid var(--brand-border);
    margin: 0.75rem 0 0.65rem;
    overflow-x: auto;
}
.replacement-tab {
    padding: 0.5rem 0.7rem;
    color: var(--brand-text-muted);
    font-weight: 600;
    font-size: 0.8125rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    white-space: nowrap;
    cursor: pointer;
}
.replacement-tab:hover { color: var(--brand-navy); }
.replacement-tab.is-active {
    color: var(--brand-navy);
    border-bottom-color: var(--brand-primary);
}
.replacement-search { display: block; margin: 0 0 0.5rem; }
.replacement-empty { margin: 0.75rem 0 0; }
.replacement-pagination { margin-top: 0.75rem; }
.replacement-pagination .pagination-bar-link {
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.courier-schedule-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.4rem;
    margin: 0 0 0.75rem;
}
.courier-schedule-progress [data-step] { color: var(--brand-text-muted); }
.courier-schedule-progress [data-step].is-active {
    color: var(--brand-navy);
    font-weight: 600;
}
.courier-events {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}
.courier-events li { margin: 0.15rem 0; }
.fulfilment-label .status-pill { margin-left: 0.4rem; vertical-align: middle; }

@media (max-width: 992px) {
    .order-detail-grid { grid-template-columns: 1fr; }
    .item-book-heading { flex-direction: column; }
    .item-card-status { text-align: left; }
    .item-status-row { justify-content: flex-start; }
    .item-card-footer { grid-template-columns: 1fr; }
    .item-card-lower { grid-template-columns: 1fr; }
    .item-card-lower--divided .item-seller {
        padding-right: 0;
        border-right: none;
    }
    .item-book-grid { grid-template-columns: 1fr; max-width: none; }
    .courier-addresses,
    .courier-route { grid-template-columns: 1fr; }
    .courier-address-arrow { display: none; }
}

/* Admin customer profile */
.status-pill--role {
    background: #f3e8ff;
    color: #6b21a8;
}

.status-pill--registered {
    background: #e5e7eb;
    color: #4b5563;
}

.order-processing-enable {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.75rem;
    min-width: min(18rem, calc(100vw - 2rem));
}
.order-processing-enable .form-input,
.order-processing-enable textarea {
    width: 100%;
    min-height: 44px;
}
.order-processing-enable button.btn {
    min-height: 44px;
    width: 100%;
    text-align: center;
    border: 0;
}
.order-processing-choice {
    margin: 0;
    padding: 0.35rem 0 0;
    border: 0;
}
.order-processing-choice legend {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0;
}
.order-processing-choice label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font-size: 0.875rem;
}
@media (max-width: 640px) {
    .order-header-actions,
    .order-header-actions .order-more { width: 100%; }
    .order-header-actions .order-more > summary { width: 100%; min-height: 44px; }
    .order-header-actions .order-more-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 0.35rem;
    }
}

.order-more-menu form { margin: 0; }
.order-more-menu button,
.order-more-menu-note {
    display: block;
    width: 100%;
    padding: 0.5rem 0.85rem;
    background: none;
    border: 0;
    text-align: left;
    color: var(--brand-text);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}
.order-more-menu button:hover { background: var(--brand-surface); }
.order-more-menu button.is-danger { color: #b91c1c; }
.order-more-menu-note { color: var(--brand-text-muted); cursor: default; }

.customer-profile { max-width: 1280px; }

.cp-meta a { font-weight: 600; }

.cp-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.cp-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    padding: 1rem 0.9rem;
    box-shadow: var(--shadow);
}

.cp-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-stat-icon--blue { background: #dbeafe; color: #1d4ed8; }
.cp-stat-icon--green { background: var(--brand-primary-light); color: var(--brand-primary-dark); }
.cp-stat-icon--purple { background: #f3e8ff; color: #7e22ce; }
.cp-stat-icon--orange { background: #ffedd5; color: #c2410c; }
.cp-stat-icon--teal { background: #ccfbf1; color: #0f766e; }
.cp-stat-icon--pink { background: #fce7f3; color: #be185d; }

.cp-stat-value {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--brand-navy);
}
.cp-stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-text);
}
.cp-stat-hint {
    font-size: 0.75rem;
    color: var(--brand-text-muted);
}

.cp-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}
.cp-overview--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-col { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.cp-listings { grid-column: 1 / -1; }

.cp-card {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.15rem 1.25rem;
}
.cp-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.cp-card-head h3 { margin: 0; font-size: 1rem; }
.cp-card-head a { font-size: 0.8125rem; font-weight: 600; }

.cp-dl { margin: 0; }
.cp-dl > div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--brand-border);
    font-size: 0.875rem;
}
.cp-dl > div:last-child { border-bottom: 0; }
.cp-dl dt { color: var(--brand-text-muted); font-weight: 600; }
.cp-dl dd { margin: 0; }
.cp-dl .is-phone { color: var(--brand-primary-dark); font-weight: 600; }
.cp-dl--compact > div { grid-template-columns: 130px 1fr; padding: 0.3rem 0; }

.cp-empty {
    text-align: center;
    padding: 1.25rem 0.5rem 0.5rem;
    color: var(--brand-text-muted);
}
.cp-empty-icon { display: inline-flex; color: #cbd5e1; margin-bottom: 0.5rem; }
.cp-empty p { margin: 0 0 1rem; font-size: 0.875rem; }

.cp-address { margin: 0.75rem 0 0; font-size: 0.875rem; line-height: 1.5; }
.cp-address-block { margin-top: 0.85rem; }
.cp-address-block:first-of-type { margin-top: 0.35rem; }
.cp-address-label {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

.address-type-options {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.address-type-options label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    font-weight: 500;
}

.cp-snapshot > div {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--brand-border);
    font-size: 0.875rem;
}
.cp-snapshot > div:last-child { border-bottom: 0; }
.cp-snapshot span { color: var(--brand-text-muted); }
.cp-snapshot a { font-size: 0.8125rem; font-weight: 600; }

.cp-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cp-timeline li {
    display: flex;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--brand-border);
}
.cp-timeline li:last-child { border-bottom: 0; }
.cp-timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: var(--brand-primary);
    flex-shrink: 0;
}
.cp-timeline strong { display: block; font-size: 0.875rem; }
.cp-timeline span { font-size: 0.75rem; color: var(--brand-text-muted); }

.cp-prefs { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.875rem; }
.cp-prefs-heading {
    margin: 0.75rem 0 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}
.cp-prefs-heading:first-child { margin-top: 0; }
.cp-prefs label { display: flex; align-items: center; gap: 0.5rem; }
.cp-prefs input[type="checkbox"] { accent-color: var(--brand-primary); }

.cp-product { display: flex; gap: 0.75rem; align-items: center; }
.cp-table-wrap { overflow-x: auto; }
.cp-listings-table th,
.cp-listings-table td {
    vertical-align: top;
    white-space: normal;
}
.cp-listings-table .cp-money {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.cp-history-dialog {
    width: min(720px, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    padding: 0;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.cp-history-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.cp-history-dialog-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1rem 0;
}
.cp-history-dialog-body {
    padding: 0.75rem 1.25rem 1.25rem;
    overflow: auto;
    max-height: calc(100vh - 7rem);
}
.cp-history-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--brand-border);
}
.cp-history-entry {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}
.cp-history-entry:last-child { margin-bottom: 0; }
.cp-history-entry-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.cp-history-flags {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}
.cp-history-dl > div {
    grid-template-columns: 140px 1fr;
}

@media (max-width: 1200px) {
    .cp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cp-overview { grid-template-columns: 1fr 1fr; }
    .cp-listings { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .cp-stats,
    .cp-overview,
    .cp-overview--two { grid-template-columns: 1fr; }
    .cp-dl > div { grid-template-columns: 1fr; gap: 0.15rem; }
    .cp-snapshot > div { grid-template-columns: 1fr auto; }
}

@media print {
    .top-bar, .site-header, .portal-sidebar, .no-print, .order-tabs, .order-back { display: none !important; }
    .portal-layout { display: block; }
    .portal-content { padding: 0; background: white; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .item-card, .side-card { box-shadow: none; }
}

.payment-option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 0;
    cursor: pointer;
}
.payment-option + .payment-option {
    border-top: 1px solid var(--brand-border, #e5e7eb);
}
.payment-option input {
    margin-top: 0.25rem;
}
.payment-option span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.payment-ledger {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}
.payment-ledger-item {
    border-top: 1px solid var(--brand-border, #e5e7eb);
    padding-top: 1rem;
}
.payment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-top: 0.75rem;
}
.payment-actions .form-group {
    margin: 0;
}

.mode-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    max-width: 100%;
    min-width: 0;
    background: var(--brand-surface);
    border-radius: 999px;
}
.mode-toggle a {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--brand-text);
}
.mode-toggle a.is-active {
    background: var(--brand-primary);
    color: #fff;
}

/* ============================================================
   Admin density system — backend only (does not affect storefront)
   ============================================================ */
body.is-backend {
    --admin-page-gap: 16px;
    --admin-section-gap: 16px;
    --admin-card-padding: 14px;
    --admin-grid-gap: 16px;
    --admin-row-height: 46px;
    --admin-page-padding: 20px;
    --admin-content-max: 1760px;
    --admin-font: 0.875rem;
    --admin-font-meta: 0.75rem;
    --admin-title: 1.375rem;
    --admin-heading: 0.9375rem;
    --admin-control-height: 38px;
    --admin-tab-height: 38px;
    --admin-cell-pad-y: 8px;
    --admin-cell-pad-x: 11px;
    font-size: var(--admin-font);
    line-height: 1.45;
}

body.is-backend .portal-content {
    padding: var(--admin-page-padding) 24px;
}

body.is-backend .admin-page {
    width: 100%;
    max-width: var(--admin-content-max);
    margin: 0 auto;
    min-width: 0;
}

body.is-backend .portal-brand {
    padding: 0.85rem 1.15rem;
    font-size: 0.875rem;
}

body.is-backend .portal-sidebar a.portal-brand {
    padding: 0.85rem 1.15rem;
}

body.is-backend .portal-brand .logo-mark {
    width: 28px;
    height: 28px;
}

body.is-backend .portal-sidebar-nav {
    padding: 0.45rem 0;
}

body.is-backend .portal-sidebar a {
    padding: 0.45rem 1.15rem;
    font-size: 0.8125rem;
}

body.is-backend .portal-user {
    padding: 0.75rem 1.15rem 1rem;
}

/* ============================================================
   Admin sidebar collapse (desktop only — click toggle, no hover)
   ============================================================ */
body.is-backend .admin-sidebar-header {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.is-backend .admin-sidebar-header .portal-brand {
    flex: 1;
    min-width: 0;
    border-bottom: 0;
}

body.is-backend .admin-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
}

body.is-backend .admin-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

body.is-backend .admin-sidebar-toggle:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
}

body.is-backend .admin-sidebar-toggle-icon--expand {
    display: none;
}

html.is-backend.sidebar-collapsed .admin-sidebar-toggle-icon--collapse {
    display: none;
}

html.is-backend.sidebar-collapsed .admin-sidebar-toggle-icon--expand {
    display: block;
}

body.is-backend .admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    position: relative;
    min-height: 40px;
    padding: 0.45rem 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.8125rem;
    text-decoration: none;
}

body.is-backend .admin-nav-link:hover,
body.is-backend .admin-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

body.is-backend .admin-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: inherit;
}

body.is-backend .admin-nav-glyph {
    display: block;
}

body.is-backend .admin-nav-label,
body.is-backend .portal-brand-text {
    white-space: nowrap;
    overflow: hidden;
}

body.is-backend .admin-nav-group {
    display: flex;
    flex-direction: column;
}

body.is-backend .admin-nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

body.is-backend .admin-nav-chevron {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.55);
    transition: transform var(--admin-sidebar-transition);
    flex-shrink: 0;
}

body.is-backend .admin-nav-group.is-open .admin-nav-chevron {
    transform: rotate(180deg);
}

body.is-backend .admin-nav-submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--admin-sidebar-transition);
}

body.is-backend .admin-nav-group.is-open .admin-nav-submenu {
    grid-template-rows: 1fr;
}

body.is-backend .admin-nav-submenu-inner {
    min-height: 0;
    overflow: hidden;
}

body.is-backend .admin-nav-sublink {
    min-height: 34px;
    padding-left: 2.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
}

body.is-backend .admin-nav-sublink:hover,
body.is-backend .admin-nav-sublink.active {
    color: white;
}

body.is-backend .portal-sign-out {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

body.is-backend .portal-sign-out-icon {
    display: none;
}

.admin-sidebar-tooltip {
    position: fixed;
    z-index: 1000;
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius);
    background: #111827;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

@media (min-width: 993px) {
    body.is-backend .portal-layout {
        transition: grid-template-columns var(--admin-sidebar-transition);
    }

    body.is-backend .admin-sidebar-toggle {
        display: inline-flex;
    }

    html.is-backend.sidebar-collapsed .portal-layout {
        grid-template-columns: var(--admin-sidebar-collapsed) 1fr;
    }

    html.is-backend.sidebar-collapsed .portal-sidebar {
        overflow-x: hidden;
        overflow-y: hidden;
    }

    html.is-backend.sidebar-collapsed .admin-sidebar-header {
        flex-direction: column;
        align-items: stretch;
    }

    html.is-backend.sidebar-collapsed .admin-sidebar-header .portal-brand {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Take labels out of layout flow so they cannot widen scrollWidth */
    html.is-backend.sidebar-collapsed .portal-brand-text,
    html.is-backend.sidebar-collapsed .admin-nav-label,
    html.is-backend.sidebar-collapsed .admin-nav-chevron {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
        opacity: 0;
        pointer-events: none;
        max-width: none;
        transform: none;
    }

    body.is-backend .portal-brand-text,
    body.is-backend .admin-nav-label {
        max-width: 14rem;
        opacity: 1;
        transform: translateX(0);
        transition:
            opacity var(--admin-sidebar-transition),
            transform var(--admin-sidebar-transition),
            max-width var(--admin-sidebar-transition);
    }

    html.is-backend.sidebar-collapsed .admin-sidebar-toggle {
        width: 100%;
        height: 40px;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        position: relative;
    }

    html.is-backend.sidebar-collapsed .admin-nav-link {
        justify-content: center;
        gap: 0;
        min-height: 44px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        overflow: hidden;
    }

    html.is-backend.sidebar-collapsed .admin-nav-link.active,
    html.is-backend.sidebar-collapsed .admin-nav-group-toggle.active {
        box-shadow: inset 3px 0 0 var(--brand-primary);
    }

    html.is-backend.sidebar-collapsed .admin-nav-submenu {
        display: none;
    }

    html.is-backend.sidebar-collapsed .portal-user {
        display: none;
    }

    @media (prefers-reduced-motion: reduce) {
        body.is-backend .portal-layout,
        body.is-backend .portal-brand-text,
        body.is-backend .admin-nav-label,
        body.is-backend .admin-nav-chevron,
        body.is-backend .admin-nav-submenu {
            transition: none !important;
        }
    }
}

@media (max-width: 992px) {
    body.is-backend .admin-sidebar-toggle {
        display: inline-flex !important;
    }

    body.is-backend .admin-sidebar-toggle-icon--collapse,
    body.is-backend .admin-sidebar-toggle-icon--expand {
        display: none !important;
    }

    body.is-backend .admin-sidebar-toggle::before {
        content: '☰';
        font-size: 1.25rem;
        line-height: 1;
    }

    body.is-backend.admin-nav-open .admin-sidebar-toggle::before {
        content: '✕';
        font-size: 1.1rem;
    }

    html.is-backend.sidebar-collapsed .portal-layout {
        grid-template-columns: 1fr;
    }

    html.is-backend.sidebar-collapsed .portal-brand-text,
    html.is-backend.sidebar-collapsed .admin-nav-label,
    html.is-backend.sidebar-collapsed .admin-nav-chevron {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        clip: auto;
        overflow: visible;
        opacity: 1;
        pointer-events: auto;
        max-width: none;
        transform: none;
    }

    html.is-backend.sidebar-collapsed .admin-nav-link {
        justify-content: flex-start;
        gap: 0.7rem;
        padding-left: 1.15rem;
        padding-right: 1.15rem;
        box-shadow: none;
        overflow: visible;
    }

    html.is-backend.sidebar-collapsed .admin-nav-submenu {
        display: grid;
    }

    html.is-backend.sidebar-collapsed .portal-user {
        display: block;
    }

    html.is-backend.sidebar-collapsed .portal-sign-out-icon {
        display: none;
    }

    /* Desktop collapse state must not hide labels on mobile drawer */
    body.is-backend.admin-nav-open.sidebar-collapsed .portal-user {
        display: block;
    }
}

/* Page headers */
body.is-backend .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1rem;
    margin-bottom: var(--admin-page-gap);
    flex-wrap: wrap;
}

body.is-backend .page-header h1,
body.is-backend .order-title-row h1 {
    font-size: var(--admin-title);
    margin: 0 0 0.15rem;
    line-height: 1.25;
}

body.is-backend .page-header p {
    margin: 0;
    font-size: 0.8125rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

body.is-backend .order-back {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
}

body.is-backend .order-detail-header {
    margin-bottom: 0.85rem;
    gap: 0.75rem;
}

body.is-backend .order-quick-stats {
    margin: 0.4rem 0 0;
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Cards, KPIs, panels */
body.is-backend .card {
    padding: var(--admin-card-padding);
    border-radius: var(--radius);
}

body.is-backend .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
}

body.is-backend .stat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 12px 14px;
    gap: 2px;
}

body.is-backend .stat-card .label {
    order: -1;
    font-size: var(--admin-font-meta);
    font-weight: 600;
    letter-spacing: 0.01em;
}

body.is-backend .stat-card .value {
    font-size: 1.375rem;
    line-height: 1.2;
}

body.is-backend .side-card,
body.is-backend .cp-card,
body.is-backend .item-card,
body.is-backend .note-item {
    padding: var(--admin-card-padding);
    margin-bottom: 12px;
    box-shadow: none;
}

body.is-backend .side-card h3,
body.is-backend .cp-card-head h3,
body.is-backend .card h3,
body.is-backend .latest-notes h3 {
    font-size: var(--admin-heading);
    margin: 0 0 0.5rem;
}

body.is-backend .cp-card-head {
    margin-bottom: 0.55rem;
}

body.is-backend .side-dl > div {
    margin-bottom: 0.5rem;
}

body.is-backend .side-dl dt {
    margin-bottom: 0.1rem;
}

body.is-backend .side-totals {
    padding-top: 0.5rem;
}

body.is-backend .offer-row {
    padding: 0.4rem 0;
}

.admin-form-card {
    max-width: 52rem;
}

.admin-detail-stack {
    max-width: 72rem;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* 12-column grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--admin-grid-gap);
    align-items: start;
}

.admin-col-8 { grid-column: span 8; min-width: 0; }
.admin-col-9 { grid-column: span 9; min-width: 0; }
.admin-col-6 { grid-column: span 6; min-width: 0; }
.admin-col-4 { grid-column: span 4; min-width: 0; }
.admin-col-3 { grid-column: span 3; min-width: 0; }
.admin-col-12 { grid-column: 1 / -1; min-width: 0; }

body.is-backend .order-detail,
body.is-backend .customer-profile {
    max-width: none;
}

body.is-backend .order-detail-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--admin-grid-gap);
}

body.is-backend .order-detail-main { grid-column: span 8; min-width: 0; }
body.is-backend .order-detail-side { grid-column: span 4; min-width: 0; }

/* Filter toolbars */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    align-items: flex-end;
    padding: 0.65rem 0.75rem;
    margin-bottom: 12px;
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
}

.admin-toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.admin-toolbar-field .form-label {
    margin-bottom: 0;
}

.admin-toolbar-search {
    flex: 1 1 16rem;
    position: relative;
    overflow: visible;
}

.admin-toolbar-search .search-suggest {
    /* Keep suggestions above the adjacent table's sticky headers (z-index: 2). */
    z-index: 3;
}

.admin-toolbar-field .form-input,
.admin-toolbar select.form-input {
    min-width: 9.5rem;
}

.admin-toolbar-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

/*
 * Admin list-table standard
 * -------------------------
 * Future Admin list screens should use:
 *   .admin-table-panel (optional: toolbar + table + pagination card)
 *     .admin-toolbar   (filters — not sticky)
 *     .admin-table-wrap (horizontal pan; page rows scroll with the portal)
 *       table.data-table (or .admin-table alias)
 *     .pagination-bar / <x-admin.pagination>
 *
 * Sticky column headers use shared CSS and admin-table-scroll.js.
 * Do not redeclare position:sticky per page. Do not put overflow:hidden
 * on the <table> or wrappers between thead and the scrollport.
 */
.admin-table-panel {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    /* Avoid overflow:hidden — it breaks sticky thead when the page scrolls. */
    margin-bottom: 12px;
}
.admin-table-panel .admin-toolbar {
    margin-bottom: 0;
    border: 0;
    border-bottom: 1px solid var(--brand-border);
    border-radius: var(--radius) var(--radius) 0 0;
    background: #f8fafc;
}
.admin-table-panel .admin-table-wrap {
    border: 0;
    border-radius: 0;
}
.admin-table-panel .pagination-bar {
    margin: 0;
    padding: 0.55rem 0.75rem;
    border-top: 1px solid var(--brand-border);
    border-radius: 0 0 var(--radius) var(--radius);
    background: #f8fafc;
}

body.is-backend .admin-search {
    padding: 0.65rem 0.75rem;
}

/* Dialogs retain bounded table scrollports; page tables use the portal below. */
.admin-table-wrap,
body.is-backend .cp-table-wrap {
    overflow: auto;
    max-width: 100%;
    max-height: min(72vh, calc(100vh - 12.5rem));
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

body.is-backend .admin-table-wrap .data-table,
body.is-backend .admin-table-wrap .admin-table,
body.is-backend .cp-table-wrap .data-table,
body.is-backend .cp-table-wrap .admin-table {
    border-radius: 0;
    box-shadow: none;
    font-size: var(--admin-font);
    /* overflow:hidden on <table> defeats position:sticky on th */
    overflow: visible;
}

body.is-backend .data-table,
body.is-backend .admin-table {
    border-radius: 0;
    box-shadow: none;
    font-size: var(--admin-font);
}

body.is-backend .data-table th,
body.is-backend .data-table td,
body.is-backend .admin-table th,
body.is-backend .admin-table td {
    padding: var(--admin-cell-pad-y) var(--admin-cell-pad-x);
    vertical-align: middle;
}

body.is-backend .data-table tbody td,
body.is-backend .admin-table tbody td {
    min-height: var(--admin-row-height);
}

body.is-backend .admin-table-wrap .data-table > thead > tr > th,
body.is-backend .admin-table-wrap .admin-table > thead > tr > th,
body.is-backend .cp-table-wrap .data-table > thead > tr > th,
body.is-backend .cp-table-wrap .admin-table > thead > tr > th {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--brand-surface);
    background-clip: padding-box;
    box-shadow: 0 1px 0 var(--brand-border);
}

/* Page tables grow with their rows. Horizontal overflow still establishes a
   scroll container, so admin-table-scroll.js positions the original headings
   against .portal-content rather than relying on native sticky positioning.
   Dialogs keep their bounded scrollports and native sticky headings.
   Orders overview and Compact Order Items own responsive, overflow-visible
   tables; preserve their native headings and unclipped attention popovers. */
body.is-backend .admin-page :is(.admin-table-wrap, .cp-table-wrap):not(dialog *, [role="dialog"] *, .orders-list-page .admin-table-wrap, .compact-table-wrap, .order-items-panel > .admin-table-wrap) {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
}

body.is-backend .admin-page :is(.admin-table-wrap, .cp-table-wrap):not(dialog *, [role="dialog"] *, .orders-list-page .admin-table-wrap, .compact-table-wrap, .order-items-panel > .admin-table-wrap) > :is(.data-table, .admin-table) > thead > tr > th {
    position: relative;
    top: auto;
    transform: translateY(var(--admin-table-heading-offset, 0px));
}

.cell-primary {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
}

.cell-meta {
    display: block;
    font-size: var(--admin-font-meta);
    color: var(--brand-text-muted);
    line-height: 1.35;
    margin-top: 2px;
}

body.is-backend .item-meta {
    font-size: var(--admin-font-meta);
}

.col-money,
body.is-backend .cp-money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Created dates stay one line and vertically match Status / Edit cells.
   Keep cell-meta styling on an inner span — never on the <td> (display:block breaks row borders). */
.col-created {
    width: 9.5rem;
    min-width: 9.5rem;
    white-space: nowrap;
    vertical-align: middle;
}

.col-created .cell-meta {
    display: inline;
    margin-top: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.col-has-image {
    width: 5.5rem;
    min-width: 5.5rem;
    white-space: nowrap;
    vertical-align: middle;
}

.books-metric-tiles {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
}

.books-metric-tiles--sales {
    margin-top: 0.75rem;
}

a.books-metric-tile {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.books-metric-tile:hover,
a.books-metric-tile:focus-visible {
    border-color: var(--brand-primary, #1f6b4a);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary, #1f6b4a) 35%, transparent);
}

a.books-metric-tile.is-active {
    border-color: var(--brand-primary, #1f6b4a);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary, #1f6b4a) 55%, transparent);
}

.books-metric-coverage,
.books-metric-overlap {
    max-width: 56rem;
}

.books-active-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.books-active-filter__label {
    font-size: var(--admin-font-meta);
    color: var(--brand-text-muted);
}

.books-active-filter__chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
    font-size: var(--admin-font-meta);
}

@media (max-width: 575px) {
    .books-metric-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    a.books-metric-tile {
        min-height: 44px;
    }
}

.col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.table-action-link {
    font-size: 0.8125rem;
    font-weight: 600;
}

body.is-backend .cp-listings-table th,
body.is-backend .cp-listings-table td {
    vertical-align: middle;
}

body.is-backend .cp-product {
    gap: 0.5rem;
}

body.is-backend .cp-product .item-thumb {
    width: 36px;
    height: 48px;
}

/* Buttons, badges, forms, tabs */
body.is-backend .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 36px;
}

body.is-backend .btn-sm {
    min-height: 32px;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
}

body.is-backend .status-pill {
    padding: 0.08rem 0.42rem;
    font-size: 0.6875rem;
    line-height: 1.35;
}

body.is-backend .form-group {
    margin-bottom: 0.65rem;
}

body.is-backend .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
}

body.is-backend .form-input {
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
    min-height: var(--admin-control-height);
    line-height: 1.3;
}

body.is-backend .form-grid {
    gap: 0.65rem 0.85rem;
}

body.is-backend .form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.is-backend .order-tabs {
    margin-bottom: 12px;
    gap: 0;
}

body.is-backend .order-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--admin-tab-height);
    padding: 0.4rem 0.7rem;
    font-size: 0.8125rem;
}

body.is-backend .alert {
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

body.is-backend .order-alert {
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

body.is-backend .pagination-bar {
    margin-top: 0.75rem;
}

body.is-backend .pagination-bar-link,
body.is-backend .pagination-bar-ellipsis {
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
}

/* Order item cards */
body.is-backend .item-card-book h3 {
    font-size: 0.9375rem;
}

body.is-backend .item-thumb {
    width: 52px;
    height: 70px;
}

body.is-backend .item-thumb.item-thumb--lg {
    width: 104px;
    height: 140px;
}

body.is-backend .item-price {
    font-size: 0.9375rem;
    margin-bottom: 0.2rem;
}

body.is-backend .item-card-lower {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    gap: 0.65rem 1.35rem;
}

body.is-backend .item-seller-name {
    font-size: 0.875rem;
    margin-bottom: 0.15rem;
}

body.is-backend .item-seller-meta {
    margin-bottom: 0.4rem;
    gap: 0.1rem;
}

body.is-backend .item-seller-phones,
body.is-backend .item-seller-payout,
body.is-backend .item-seller-listed,
body.is-backend .item-seller-payment {
    font-size: var(--admin-font-meta);
}

body.is-backend .item-card-footer {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

body.is-backend .item-card-actions {
    margin-top: 0.65rem;
}

body.is-backend .quick-actions {
    gap: 0.35rem;
}

body.is-backend .cp-stats {
    gap: 0.65rem;
    margin-bottom: var(--admin-section-gap);
}

body.is-backend .cp-stat {
    padding: 0.65rem 0.75rem;
    gap: 0.55rem;
    box-shadow: none;
}

body.is-backend .cp-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 0.4rem;
}

body.is-backend .cp-stat-value {
    font-size: 1.125rem;
}

body.is-backend .cp-stat-label {
    font-size: 0.75rem;
}

body.is-backend .cp-stat-hint {
    font-size: 0.6875rem;
}

body.is-backend .cp-overview {
    gap: var(--admin-grid-gap);
}

body.is-backend .cp-col {
    gap: 12px;
}

body.is-backend .cp-dl > div {
    padding: 0.28rem 0;
    font-size: 0.8125rem;
}

body.is-backend .cp-empty {
    padding: 0.65rem 0.25rem 0.35rem;
}

body.is-backend .cp-empty-icon {
    margin-bottom: 0.25rem;
}

body.is-backend .cp-empty-icon svg {
    width: 22px;
    height: 22px;
}

body.is-backend .cp-empty p {
    margin: 0 0 0.5rem;
}

body.is-backend .timeline-list li,
body.is-backend .seller-history li {
    padding: 0.45rem 0;
}

body.is-backend .fulfilment-box {
    margin-top: 0.65rem;
    padding: 0.65rem 0.75rem;
}

/* Dialogs */
.admin-dialog,
.cp-history-dialog {
    max-height: calc(100vh - 2.5rem);
    overflow: hidden;
}

.admin-dialog[open],
.cp-history-dialog[open] {
    display: flex;
    flex-direction: column;
    margin: auto;
}

.admin-dialog--sm { width: min(420px, calc(100vw - 1.5rem)); }
.admin-dialog--md { width: min(640px, calc(100vw - 1.5rem)); }
.admin-dialog--lg,
body.is-backend .cp-history-dialog {
    width: min(1080px, calc(100vw - 1.5rem));
}

.admin-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.courier-schedule-dialog {
    width: min(52rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.courier-schedule-dialog-header,
.courier-schedule-dialog-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
}

.courier-schedule-dialog-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--brand-border);
}

.courier-schedule-dialog-header h2 {
    margin: 0;
    font-size: 1.0625rem;
}

.courier-schedule-dialog-body {
    overflow: auto;
    flex: 1;
    min-height: 0;
    padding: 0.85rem 1rem;
}

.courier-schedule-dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--brand-border);
}

.courier-schedule-window {
    margin-top: 0.85rem;
}

.replacement-dialog {
    width: min(40rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 0;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (max-width: 480px) {
    .replacement-dialog {
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
        margin: 0.75rem auto;
        max-height: calc(100vh - 1.5rem);
    }

    .replacement-current-grid {
        grid-template-columns: 1fr;
    }

    .replacement-dialog-footer {
        flex-wrap: wrap;
    }

    .replacement-dialog-footer .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 640px) {
    body.is-backend .item-thumb.item-thumb--lg {
        width: 72px;
        height: 96px;
    }
}

.order-detail-side .side-card {
    margin-bottom: 0.5rem;
}

.order-detail-side .side-card h3 {
    margin-bottom: 0.35rem;
}

.order-detail-side .side-dl > div {
    margin-bottom: 0.35rem;
}

.order-detail-side .side-totals {
    padding-top: 0.4rem;
}

.order-detail-side .side-refund-breakdown {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--brand-border);
}

.order-detail-side .side-refund-breakdown .offer-row {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-customer-refund {
    margin-top: 0.15rem;
}

.item-customer-refund-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

@media (max-width: 768px) {
    .order-detail-side .side-refund-breakdown .offer-row {
        align-items: flex-start;
    }

    .item-customer-refund-status .status-pill {
        max-width: 100%;
        white-space: normal;
        line-height: 1.25;
    }
}

.order-detail-side .side-card--assigned {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.order-detail-side .quick-actions {
    gap: 0.3rem;
}

@media (max-width: 768px) {
    .courier-schedule-dialog .form-grid {
        grid-template-columns: 1fr;
    }
}

body.is-backend .cp-history-dialog-bar {
    padding: 0.5rem 0.75rem 0;
    flex-shrink: 0;
}

body.is-backend .cp-history-dialog-body {
    padding: 0.5rem 0.9rem 0.9rem;
    max-height: none;
    flex: 1;
    min-height: 0;
}

body.is-backend .cp-history-header {
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
}

body.is-backend .cp-history-entry {
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.55rem;
}

body.is-backend .card .admin-table-wrap,
.cp-history-dialog .admin-table-wrap,
.cp-history-dialog .cp-table-wrap {
    max-height: none;
}

body.is-backend .btn:focus-visible,
body.is-backend .form-input:focus-visible,
body.is-backend .order-tabs a:focus-visible,
body.is-backend .table-action-link:focus-visible,
body.is-backend .portal-sidebar a:focus-visible,
body.is-backend .admin-nav-group-toggle:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

@media (max-width: 1200px) {
    .admin-col-8,
    .admin-col-9 { grid-column: span 8; }
    .admin-col-6 { grid-column: span 6; }
    .admin-col-4,
    .admin-col-3 { grid-column: span 4; }
}

@media (max-width: 992px) {
    body.is-backend .portal-content {
        padding: 16px;
    }

    .admin-col-8,
    .admin-col-9,
    .admin-col-6,
    .admin-col-4,
    .admin-col-3,
    body.is-backend .order-detail-main,
    body.is-backend .order-detail-side {
        grid-column: 1 / -1;
    }

    body.is-backend .form-grid--3 {
        grid-template-columns: 1fr 1fr;
    }

    body.is-backend .admin-table-wrap,
    body.is-backend .cp-table-wrap {
        /* Keep an internal scrollport so sticky thead remains reliable;
           overflow-x:auto + overflow-y:visible is not portable (visible→auto). */
        max-height: min(70vh, calc(100vh - 10rem));
    }
}

@media (max-width: 768px) {
    body.is-backend .portal-content {
        padding: 12px 14px;
    }

    body.is-backend .btn {
        min-height: 40px;
    }

    body.is-backend .form-grid--3 {
        grid-template-columns: 1fr;
    }

    .admin-toolbar-search,
    .admin-toolbar-field,
    .admin-toolbar-field .form-input {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
}

.icon-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 0.35rem);
    background: transparent;
    color: var(--brand-text-muted);
    cursor: pointer;
}

.icon-edit-btn:hover,
.icon-edit-btn:focus-visible {
    color: var(--brand-primary);
    border-color: var(--brand-border);
    background: #fff;
    outline: none;
}

.courier-address-label,
.side-dt-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
}

.courier-schedule-dialog {
    width: min(36rem, calc(100vw - 1.5rem));
}

.courier-quote-loading {
    margin: 0.5rem 0;
    font-weight: 600;
}

.courier-rates-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.courier-provider-group {
    margin-bottom: 0.85rem;
}

.courier-provider-label {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

.courier-rate {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md, 0.5rem);
    margin-bottom: 0.4rem;
}

.courier-rate span {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.courier-rate-price {
    font-weight: 600;
}

.courier-provider-warning {
    color: #92400e;
}

.courier-provider-error {
    padding: 0.55rem 0.65rem;
    border: 1px solid #f3d2a5;
    background: #fffbeb;
    border-radius: var(--radius-md, 0.5rem);
    margin-bottom: 0.4rem;
}

.courier-provider-error-title,
.courier-provider-error-body {
    margin: 0 0 0.35rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.courier-provider-error-title {
    font-weight: 600;
}

.courier-provider-error-body {
    color: #92400e;
}

.courier-provider-error-edit {
    margin-top: 0.15rem;
}

.courier-window-grid {
    grid-template-columns: 1fr 1fr;
}

.courier-window-grid .full-width {
    grid-column: 1 / -1;
}

.clock-picker-trigger {
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.clock-picker-dialog {
    width: min(22rem, calc(100vw - 1.5rem));
    padding: 0;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.clock-picker {
    padding: 0.85rem 1rem 1rem;
}

.clock-picker-title {
    margin: 0;
    font-size: 0.8rem;
    color: var(--brand-text-muted);
}

.clock-picker-display {
    margin: 0.35rem 0 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.clock-picker-meridiem {
    display: inline-flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.clock-meridiem-btn {
    min-width: 3rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm, 0.35rem);
    background: #fff;
    cursor: pointer;
}

.clock-meridiem-btn.is-active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.clock-picker-face {
    position: relative;
    width: min(16rem, 70vw);
    height: min(16rem, 70vw);
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid var(--brand-border);
}

.clock-face-num {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2.1rem;
    height: 2.1rem;
    margin: -1.05rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    transform: rotate(calc(var(--i) * 30deg)) translateY(-6.2rem) rotate(calc(var(--i) * -30deg));
    cursor: pointer;
    font-weight: 600;
}

.clock-face-num.is-selected {
    background: var(--brand-primary);
    color: #fff;
}

.clock-face-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.55rem;
    height: 0.55rem;
    margin: -0.275rem;
    border-radius: 50%;
    background: var(--brand-primary);
}

.clock-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.clock-picker-fallback {
    margin-top: 0.65rem;
}

.snapshot-edit-dialog > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.snapshot-form-grid {
    grid-template-columns: 1fr 1fr;
}

.snapshot-profile-opt-in {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.85rem;
    font-size: 0.9rem;
}

.courier-snapshot-note {
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .snapshot-form-grid,
    .courier-window-grid {
        grid-template-columns: 1fr;
    }

    .clock-picker-face {
        width: min(14rem, 78vw);
        height: min(14rem, 78vw);
    }

    .clock-face-num {
        transform: rotate(calc(var(--i) * 30deg)) translateY(-5.4rem) rotate(calc(var(--i) * -30deg));
    }
}


/* Order Items monitor */
.order-items-toolbar .order-items-search-hint {
    margin-top: 0.15rem;
}
/* Use the shared page scrolling contract, including horizontal table pan. */
.order-items-table {
    min-width: 72rem;
}
.order-items-table td,
.order-items-table th {
    white-space: nowrap;
}
.order-items-sellers {
    white-space: nowrap;
    max-width: 11rem;
}
.order-items-comments {
    white-space: nowrap;
    max-width: 13.5rem;
    width: 13.5rem;
}
.order-items-ellipsis,
.order-items-comment-preview {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.order-items-sellers .order-items-seller-name {
    display: inline-block;
    max-width: 10.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.order-items-row--group-0 {
    background: #f8fafc;
}
.order-items-row--group-1 {
    background: #fff;
}
.order-items-row--group-start td:first-child {
    box-shadow: inset 3px 0 0 #64748b;
}
.order-items-row--group-0 td:first-child {
    box-shadow: inset 3px 0 0 #94a3b8;
}
.order-items-row--group-1 td:first-child {
    box-shadow: inset 3px 0 0 #cbd5e1;
}
.order-items-row--group-start.order-items-row--group-0 td:first-child,
.order-items-row--group-start.order-items-row--group-1 td:first-child {
    box-shadow: inset 3px 0 0 #475569;
}
.order-items-row--current td {
    padding-top: var(--admin-cell-pad-y);
    padding-bottom: var(--admin-cell-pad-y);
}
.order-items-row--superseded {
    background: #f1f5f9;
    color: #64748b;
}
.order-items-row--superseded td {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.8125rem;
    line-height: 1.25;
    min-height: 0;
}
.order-items-row--superseded td:first-child {
    box-shadow: inset 3px 0 0 #94a3b8;
}
.order-items-row--group-0.order-items-row--superseded {
    background: #eef2f7;
}
.order-items-row--group-1.order-items-row--superseded {
    background: #f1f5f9;
}
.order-items-seller-name {
    font-weight: 600;
    color: var(--brand-text, #0f172a);
}
.order-items-row--superseded .order-items-seller-name {
    font-weight: 500;
    color: #64748b;
}
.order-items-tracking {
    line-height: 1.25;
    max-width: 9.5rem;
}
.order-items-tracking-ref.order-items-tracking-ref--cancelled {
    color: #b91c1c;
    text-decoration: line-through;
    font-weight: 500;
}
.order-items-date--attention {
    color: #b91c1c;
    font-weight: 600;
}
.order-items-order-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
    align-items: center;
    margin-top: 0.15rem;
}
.order-items-flag {
    font-size: 0.6875rem;
    color: var(--brand-text-muted, #64748b);
    letter-spacing: 0.02em;
}
.order-items-flag--completed {
    color: #64748b;
}
.order-items-flag--processing {
    color: #166534;
    font-weight: 600;
    white-space: normal;
}
.order-items-flag--pinned {
    color: #92400e;
}
.order-items-pin-form {
    display: inline;
    margin: 0;
}
.order-items-pin-btn {
    border: 0;
    background: transparent;
    color: #92400e;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}
.order-items-comment-trigger {
    border: 0;
    background: transparent;
    padding: 0;
    max-width: 100%;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
}
.order-items-comment-muted {
    color: var(--brand-text-muted, #94a3b8);
}

/* Current keeps one vertical portal scrollport; native sticky headings do not chase JS scroll frames. */
body.is-backend .admin-page:has(> .order-items-panel[data-current-enhanced]) { min-height: 100%; padding-bottom: var(--current-footer-space, 90px); }
.order-items-panel { margin-bottom: 0; }
body.is-backend .order-items-panel[data-current-enhanced] > .admin-table-wrap { max-height: none; overflow-x: clip; overflow-y: visible; touch-action: pan-y; }
.order-items-table { table-layout: fixed; width: 106.5rem; min-width: 106.5rem; border-collapse: separate; border-spacing: 0; transform: translateX(var(--current-pan, 0px)); }
body.is-backend .order-items-table > thead > tr > th { position: sticky; top: var(--current-sticky-top, 0px); transform: none; box-shadow: inset 0 -2px #475569; }
.order-items-table td, .order-items-table th { white-space: normal; overflow-wrap: anywhere; }
.order-items-table td > :not(dialog),
.order-items-table .order-items-sellers .order-items-seller-name { max-width: 100%; }
.order-items-table .order-items-nowrap { white-space: normal; }
.order-items-table .order-items-row--group-start:not(:first-child) > td { border-top: 2px solid #64748b; }
.order-items-tracking-trigger { border: 0; background: transparent; padding: 0; text-align: left; font: inherit; color: var(--brand-primary); cursor: pointer; overflow-wrap: anywhere; }
.order-items-panel[data-current-enhanced] .order-items-current-footer { position: fixed; left: var(--current-footer-left, 0); bottom: var(--current-footer-bottom, 0); width: var(--current-footer-width, 100%); z-index: 6; background: #f8fafc; border-top: 1px solid #64748b; box-sizing: border-box; }
/* Shorten pointer travel to 20% of the track, keeping 96px for precision where space allows. */
.order-items-horizontal { --thumb-width: clamp(50%, calc(100% - 96px), 80%); display: block; appearance: none; width: calc(100% - 16px); height: 24px; margin: 0 8px; background: transparent; cursor: ew-resize; }
.order-items-horizontal::-webkit-slider-runnable-track { height: 10px; border-radius: 4px; background: #cbd5e1; }
.order-items-horizontal::-webkit-slider-thumb { appearance: none; width: var(--thumb-width); height: 14px; margin-top: -2px; border-radius: 4px; background: #475569; }
.order-items-horizontal::-moz-range-track { height: 10px; background: #cbd5e1; }
.order-items-horizontal::-moz-range-thumb { width: var(--thumb-width); height: 14px; border: 0; border-radius: 4px; background: #475569; }
.order-items-horizontal:disabled { opacity: .45; cursor: default; }
.order-items-horizontal:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.order-items-panel .order-items-current-footer .pagination-bar { flex-wrap: nowrap; gap: 8px; padding: 3px 8px; min-height: 44px; margin: 0; }
.order-items-current-footer .pagination-bar-summary { margin: 0; white-space: nowrap; }
.order-items-current-footer .pagination-bar-list { flex-wrap: nowrap; overflow-x: auto; }
.order-items-tracking-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.order-items-tracking-dialog .admin-dialog-body { overflow-wrap: anywhere; white-space: normal; }
dialog.order-items-comment-dialog {
    width: min(800px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
}
.order-items-comment-dialog textarea {
    min-height: clamp(180px, 40dvh, 420px);
    resize: vertical;
}
@media (max-width: 767px) {
    .order-items-current-footer .pagination-bar-summary { font-size: 11px; }
    .order-items-panel .order-items-current-footer .pagination-bar { gap: 6px; padding-inline: 6px; }
}
.order-items-empty {
    text-align: center;
    color: var(--brand-text-muted, #64748b);
    padding: 1.25rem !important;
}
.side-assigned-form {
    margin-top: 0.65rem;
}
.side-assigned-form .form-label {
    margin-bottom: 0.2rem;
}


/* Other Settings */
.settings-tabs {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.settings-section-form {
    max-width: 720px;
}
.settings-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.settings-fieldset legend {
    padding: 0 0.5rem;
    font-weight: 600;
}
.settings-checkbox {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}
.settings-copy-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.settings-copy-row .form-input {
    flex: 1 1 auto;
    min-width: 0;
}
.settings-copy-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .settings-tabs {
        -webkit-overflow-scrolling: touch;
    }
    .settings-copy-row {
        flex-direction: column;
    }
}

.fulfilment-group-list {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1rem;
}
.fulfilment-group-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
}
.fulfilment-group-panel__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.fulfilment-group-panel h3 {
    margin: 0;
    font-size: 0.95rem;
}
.fulfilment-group-panel__counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}
.fulfilment-group-panel__items {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
}
.fulfilment-group-panel__items li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}
.fulfilment-group-panel__notice,
.fulfilment-group-panel__plan,
.fulfilment-group-panel__actions {
    margin: 0.65rem 0 0;
}
.fulfilment-group-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
}
.fulfilment-group-panel__plan {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.fulfilment-group-panel__address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0;
}
.fulfilment-group-panel__address-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
}
.fulfilment-group-panel__address-card h4 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #475569;
}
.fulfilment-group-panel__address-card-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.45rem;
}
.fulfilment-group-panel__address-card p {
    margin: 0.15rem 0;
}
.fulfilment-group-panel__address-name {
    font-weight: 600;
}
.fulfilment-group-panel--pending {
    border-style: dashed;
}
@media (max-width: 640px) {
    .seller-fulfilment-contact-grid {
        grid-template-columns: 1fr !important;
    }
    .fulfilment-group-panel__items li {
        flex-direction: column;
        align-items: flex-start;
    }
    .fulfilment-group-panel__address-grid {
        grid-template-columns: 1fr;
    }
    .fulfilment-group-panel__address-card-header {
        flex-direction: column;
        align-items: stretch;
    }
}


.fulfilment-group-panel__bulk {
    margin: 0.75rem 0 0;
    display: grid;
    gap: 0.5rem;
}
.fulfilment-group-panel__bulk-details {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    background: #fff;
}
.fulfilment-group-panel__bulk-details > summary {
    list-style: none;
}
.fulfilment-group-panel__bulk-details > summary::-webkit-details-marker {
    display: none;
}
.fulfilment-group-panel__bulk-form {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}
.fulfilment-group-panel__bulk-form .form-input {
    width: 100%;
    max-width: 28rem;
}
.seller-fulfilment-request-actions {
    display: block;
}
@media (max-width: 640px) {
    .fulfilment-group-panel__bulk-form {
        gap: 0.55rem;
    }
}

/* Seller fulfilment email-link response layout */
.seller-fulfilment-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f3f4f6;
    color: #111827;
}
.seller-fulfilment-layout__header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}
.seller-fulfilment-layout__header-inner,
.seller-fulfilment-layout__footer-inner,
.seller-fulfilment-page {
    width: min(720px, calc(100% - 2rem));
    margin-left: auto;
    margin-right: auto;
}
.seller-fulfilment-layout__header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}
.seller-fulfilment-layout__tagline {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}
.seller-fulfilment-layout__main {
    flex: 1;
    padding: 1.5rem 0 2.5rem;
}
.seller-fulfilment-layout__footer {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}
.seller-fulfilment-layout__footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    color: #6b7280;
    font-size: 0.85rem;
}
.seller-fulfilment-layout__footer-inner p {
    margin: 0;
}
.seller-fulfilment-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.35rem 1.25rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.seller-fulfilment-panel > h1 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
}
.seller-fulfilment-lede {
    color: #6b7280;
    margin: 0 0 1.25rem;
}
.seller-fulfilment-alert {
    padding: 0.9rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}
.seller-fulfilment-alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.seller-fulfilment-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.seller-fulfilment-collection {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.35rem;
}
.seller-fulfilment-collection h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}
.seller-fulfilment-collection > p {
    margin: 0 0 0.85rem;
    color: #374151;
}
.seller-fulfilment-collection__summary {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #dbeafe;
}
.seller-fulfilment-collection__why {
    margin: -0.35rem 0 0.85rem;
    color: #1e3a8a;
    font-weight: 600;
}
.seller-fulfilment-field-errors {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.75rem;
    list-style: disc inside;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.9rem;
}
.seller-fulfilment-field-error {
    margin: 0.3rem 0 0;
    color: #b91c1c;
    font-size: 0.85rem;
}
.seller-fulfilment-shared-fields .form-input.is-invalid,
.seller-fulfilment-actions .form-input.is-invalid {
    border-color: #f87171;
}
.seller-fulfilment-collection__address {
    margin: 0 0 0.5rem;
    color: #111827;
    line-height: 1.45;
}
.seller-fulfilment-collection__address--empty {
    color: #4b5563;
}
.seller-fulfilment-collection__progress {
    margin: 0;
    color: #1d4ed8;
    font-size: 0.92rem;
    font-weight: 600;
}
.seller-fulfilment-shared-fields__title,
.seller-fulfilment-address-heading {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.seller-fulfilment-shared-fields label,
.seller-fulfilment-field label,
.seller-fulfilment-actions label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.seller-fulfilment-shared-fields .form-input,
.seller-fulfilment-actions .form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}
.seller-fulfilment-shared-fields__address {
    margin: 0.75rem 0;
}
.seller-fulfilment-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.seller-fulfilment-book {
    margin-top: 0.25rem;
}
.seller-fulfilment-book--grouped {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.1rem;
}
.seller-fulfilment-book__meta {
    margin: 0 0 0.75rem;
    color: #6b7280;
    font-size: 0.9rem;
}
.seller-fulfilment-book__summary {
    background: #f9fafb;
    border-radius: 6px;
    padding: 1rem;
}
.seller-fulfilment-book__summary-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.seller-fulfilment-book__cover {
    flex: 0 0 96px;
}
.seller-fulfilment-book__cover img,
.seller-fulfilment-book__cover-fallback {
    width: 96px;
    height: 128px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}
.seller-fulfilment-book__cover img {
    object-fit: cover;
    display: block;
}
.seller-fulfilment-book__cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.75rem;
    text-align: center;
    padding: 0.5rem;
}
.seller-fulfilment-book__details {
    flex: 1;
}
.seller-fulfilment-book__details h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.45rem;
}
.seller-fulfilment-book__details p {
    margin: 0.25rem 0;
    color: #4b5563;
}
.seller-fulfilment-book__condition span {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}
.seller-fulfilment-book__status {
    margin: 0.75rem 0 0.25rem;
    color: #4b5563;
}
.seller-fulfilment-book__deadline {
    margin: 0.25rem 0 0;
    color: #ef4444;
    font-size: 0.9rem;
}
.seller-fulfilment-status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
}
.seller-fulfilment-status-pill--warning {
    background: #fef3c7;
    color: #92400e;
}
.seller-fulfilment-status-pill--info,
.seller-fulfilment-status-pill--success {
    background: #dcfce7;
    color: #166534;
}
.seller-fulfilment-status-pill--danger {
    background: #fee2e2;
    color: #991b1b;
}
.seller-fulfilment-state {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
}
.seller-fulfilment-state--declined {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.seller-fulfilment-state h3 {
    margin: 0 0 0.35rem;
}
.seller-fulfilment-state p {
    margin: 0;
}
.seller-fulfilment-actions {
    margin-top: 1.15rem;
    display: grid;
    gap: 0.85rem;
}
.seller-fulfilment-action {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.9rem 1rem;
}
.seller-fulfilment-action > summary {
    font-weight: 600;
    cursor: pointer;
    color: #1e40af;
    font-size: 1.05rem;
}
.seller-fulfilment-action--decline > summary {
    color: #dc2626;
}
.seller-fulfilment-action form {
    margin-top: 0.9rem;
}
.seller-fulfilment-required {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
}
.seller-fulfilment-required p {
    margin: 0 0 0.75rem;
    font-weight: 600;
    color: #92400e;
}
.seller-fulfilment-required label {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.65rem;
    font-weight: 400;
}
.seller-fulfilment-required label:last-child {
    margin-bottom: 0;
}
.seller-fulfilment-book__hint {
    margin: 0.35rem 0 0.85rem;
    color: #6b7280;
    font-size: 0.85rem;
}
.seller-fulfilment-address-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.seller-fulfilment-submit {
    width: 100%;
    padding: 0.75rem;
}
.seller-fulfilment-field {
    margin-bottom: 1rem;
}
.seller-fulfilment-consequence {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 0.9rem;
}
.seller-fulfilment-corrected {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e3a8a;
    font-size: 0.9rem;
}
.seller-fulfilment-review-notice {
    margin: 0 0 1rem;
    color: #7f1d1d;
    font-size: 0.85rem;
}
.seller-fulfilment-decline-btn {
    width: 100%;
    padding: 0.75rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
@media (max-width: 640px) {
    .seller-fulfilment-layout__header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .seller-fulfilment-layout__footer-inner {
        flex-direction: column;
    }
    .seller-fulfilment-book__summary-row {
        flex-direction: column;
    }
    .seller-fulfilment-contact-grid {
        grid-template-columns: 1fr;
    }
}

/*
 * Responsive safety net
 * ---------------------
 * Some component blocks are declared after earlier @media overrides.
 * Re-assert critical small-screen rules here so cascade order cannot
 * undo mobile layouts (notably book PDP and shared toggles).
 */
@media (max-width: 992px) {
    body:not(.is-backend) .portal-layout {
        grid-template-columns: 1fr;
    }

    body:not(.is-backend):not(.is-account) .portal-sidebar {
        display: block;
        padding: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    body:not(.is-backend):not(.is-account) .portal-sidebar-nav {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body:not(.is-backend):not(.is-account) .portal-sidebar-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    body.is-backend .portal-content,
    body.is-backend .admin-page,
    body.is-backend .admin-table-panel {
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .book-detail-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .book-summary {
        grid-template-columns: 7.5rem minmax(0, 1fr);
    }

    .mode-toggle {
        width: 100%;
        max-width: 100%;
    }

    .page-header--split {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form--compact {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .search-form--compact.search-form--dual {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .search-form .btn {
        width: 100%;
        min-height: 44px;
    }

    .search-form--compact .btn {
        width: auto;
        min-height: 40px;
    }

    .search-form--compact.search-form--dual .home-search-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        width: auto;
        min-height: 44px;
    }

    .auth-grid,
    .steps-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .form-grid,
    .form-grid--3,
    .snapshot-form-grid {
        grid-template-columns: 1fr;
    }

    .offer-row {
        flex-wrap: wrap;
    }

    .btn,
    .header-icon-link,
    .mobile-toggle,
    .admin-sidebar-toggle {
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .product-grid,
    .features-bar-grid,
    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .btn {
        min-height: 44px;
    }

    .portal-content,
    body:not(.is-backend) .portal-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Book Demand admin + storefront availability notify */
.book-demand-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.book-demand-toolbar {
    align-items: end;
}

.book-demand-toolbar .admin-toolbar-search {
    flex: 1 1 220px;
    min-width: 180px;
}

.col-num {
    font-variant-numeric: tabular-nums;
}

.book-demand-empty {
    padding: 1.5rem 0.25rem;
    text-align: left;
}

.book-demand-card-list {
    display: none;
}

.book-demand-card {
    background: white;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0 0.75rem 0.75rem;
}

.book-demand-card-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.book-demand-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 1rem;
    margin: 0 0 0.85rem;
}

.book-demand-card-meta dt {
    font-size: 0.75rem;
    color: var(--brand-text-muted);
    font-weight: 600;
}

.book-demand-card-meta dd {
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.book-status-badge {
    display: inline-flex;
    align-items: center;
    margin: 0.5rem 0 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.book-status-badge--oos {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.availability-notify {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1.15rem 1.25rem;
    max-width: 36rem;
}

.availability-notify--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.availability-notify-title {
    font-size: 1.125rem;
    margin: 0 0 0.35rem;
    color: var(--brand-navy, #0f172a);
}

.availability-notify-copy {
    margin: 0 0 1rem;
    color: var(--brand-text-muted);
    font-size: 0.9375rem;
}

.availability-notify-fields {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.availability-notify-email {
    flex: 1 1 auto;
    margin-bottom: 0;
    min-width: 0;
}

.availability-notify-actions {
    flex: 0 0 auto;
    padding-top: 1.7rem; /* align with input under label */
}

.availability-notify-actions .btn,
.availability-notify-signed-in .btn {
    white-space: nowrap;
}

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

.availability-notify-destination {
    margin: 0;
    font-size: 0.9375rem;
}

.availability-notify-reassurance {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
}

.form-input.is-invalid {
    border-color: #dc2626;
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.book-secondary-cta .btn {
    font-weight: 600;
}

.book-conditions-heading {
    font-size: 1.25rem;
    margin: 0 0 0.85rem;
}

.offer-group--unavailable {
    padding: 0.65rem 0.9rem !important;
    background: #fafafa;
    box-shadow: none;
    margin-bottom: 0.5rem !important;
}

.offer-group--unavailable .offer-row {
    align-items: center;
    gap: 0.75rem;
    padding: 0.15rem 0;
    border-bottom: none;
}

.offer-group--unavailable .book-price,
.offer-group--unavailable .book-price--muted {
    margin: 0 0 0.15rem !important;
    font-size: 0.9375rem;
}

.offer-group--unavailable .text-muted {
    font-size: 0.8125rem;
}

.offer-condition-name {
    font-size: 1.125rem;
    color: var(--brand-primary);
    margin: 0 0 0.35rem;
}

.offer-condition-name--muted {
    color: var(--brand-text-muted);
    font-size: 0.9375rem;
    margin-bottom: 0.15rem;
}

.book-price--muted {
    color: var(--brand-text-muted) !important;
    font-weight: 600;
}

@media (max-width: 992px) {
    .book-demand-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .book-demand-stats {
        grid-template-columns: 1fr;
    }

    .admin-table-panel > .admin-table-wrap:has(.book-demand-table) {
        display: none;
    }

    .book-demand-card-list {
        display: block;
        padding-bottom: 0.75rem;
    }

    .availability-notify {
        max-width: none;
    }

    .availability-notify-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .availability-notify-actions {
        padding-top: 0;
    }

    .availability-notify-actions .btn,
    .availability-notify-signed-in .btn {
        width: 100%;
    }

    .availability-notify-signed-in {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =====================================================

Visual refinement — storefront density & product/auth layouts
   ============================================================ */

.book-page {
    padding: 1.25rem 0 2rem;
}

.book-summary {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 0.875rem 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.book-summary-toolbar {
    grid-column: 1 / -1;
}

.book-summary-cover {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: 220px;
    align-self: start;
}

.book-summary-essentials {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
}

.book-summary-status,
.book-summary-alert,
.book-summary-description,
.book-summary-secondary {
    grid-column: 2;
    min-width: 0;
}

.book-summary-status:empty {
    display: none;
}

.book-detail-cover,
.book-summary-cover .book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.book-summary-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--brand-navy);
    margin: 0 0 0.75rem;
}

.book-summary-meta {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.book-summary-meta > div {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.5rem;
    font-size: 0.875rem;
}

.book-summary-meta dt {
    margin: 0;
    color: var(--brand-text-muted);
    font-weight: 600;
}

.book-summary-meta dd {
    margin: 0;
    color: var(--brand-text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.book-summary-price {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 0.25rem;
}

.book-summary-stock,
.book-summary-oos {
    margin: 0;
    font-size: 0.875rem;
}

.book-summary-description h2 {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.book-summary-description p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--brand-text);
}

.book-summary-secondary p {
    margin: 0;
}

.book-summary-alert .availability-notify {
    max-width: none;
}

.book-conditions-heading {
    font-size: 1.125rem;
    margin: 0 0 0.75rem;
    color: var(--brand-navy);
}

.book-conditions-lead {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
}

.book-conditions-guidelines {
    margin: 0 0 0.875rem;
    font-size: 0.875rem;
}

.book-alert-card {
    padding: 1rem;
    margin-bottom: 0.875rem;
}

.book-alert-card h3 {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.condition-list {
    display: grid;
    gap: 0.625rem;
}

.condition-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-white);
}

.condition-row-info {
    min-width: 0;
}

.condition-row-name {
    margin: 0 0 0.2rem;
    font-size: 0.9375rem;
    color: var(--brand-primary);
}

.condition-row-price {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.condition-row-price--muted,
.condition-row-stock,
.condition-row-status {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
    font-weight: 500;
}

.condition-row-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.condition-row-action .btn {
    white-space: nowrap;
}

.condition-row-cart {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.5rem;
}

.condition-row--unavailable {
    background: var(--brand-surface);
    opacity: 0.78;
}

.condition-row--unavailable .condition-row-name,
.condition-row--unavailable .condition-row-price {
    color: var(--brand-text-muted);
}

.condition-row--unavailable .btn {
    pointer-events: none;
}

.condition-row--in-cart {
    border-color: rgba(0, 166, 81, 0.35);
    background: var(--brand-primary-light);
}

.condition-row--selected {
    border-color: rgba(15, 76, 129, 0.45);
    box-shadow: inset 3px 0 0 var(--brand-secondary, #0f4c81);
}

.condition-row--cart-blocked .condition-row-status {
    color: var(--brand-text);
    font-weight: 600;
}

@media (max-width: 768px) {
    .search-form--compact {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .search-form--compact.search-form--dual {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .search-form--compact .btn {
        width: auto;
        min-height: 40px;
    }

    .search-form--compact.search-form--dual .home-search-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        width: auto;
        min-height: 44px;
    }

    .why-grid--compact {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .product-rail {
        display: flex;
        gap: 0.75rem;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .product-rail > * {
        flex: 0 0 44%;
        max-width: 10.5rem;
        scroll-snap-align: start;
    }

    .product-card-cover {
        max-height: 120px;
        aspect-ratio: 2 / 3;
    }

    .product-card-body {
        padding: 0.625rem;
    }

    .product-card-btn {
        min-height: 36px;
        font-size: 0.8125rem;
    }

    .how-grid,
    .how-grid--compact {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .book-summary {
        grid-template-columns: 7.5rem minmax(0, 1fr);
        gap: 0.75rem 0.875rem;
        margin-bottom: 1.125rem;
    }

    .book-summary-cover {
        grid-column: 1;
        grid-row: 2;
        max-width: 7.5rem;
    }

    .book-summary-essentials {
        grid-column: 2;
        grid-row: 2;
    }

    .book-summary-status,
    .book-summary-alert,
    .book-summary-description,
    .book-summary-secondary {
        grid-column: 1 / -1;
    }

    .trust-bar-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .trust-bar-item {
        font-size: 0.75rem;
    }

    .trust-bar-item strong {
        font-size: 0.8125rem;
    }

    .book-summary-cover,
    .book-detail-cover,
    .book-summary-cover .book-cover {
        max-width: 7.5rem;
        max-height: 10rem;
        border-radius: var(--radius);
        box-shadow: none;
    }

    .book-summary-meta > div {
        grid-template-columns: 4.5rem minmax(0, 1fr);
        font-size: 0.8125rem;
    }

    .book-summary-price {
        font-size: 1.125rem;
    }

    .condition-row {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .condition-row-action {
        justify-content: stretch;
    }

    .condition-row-action .btn,
    .condition-row-action form {
        width: 100%;
    }

    .condition-row-action .btn {
        min-height: 44px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        margin-bottom: 1rem;
    }

    .footer-brand {
        margin-bottom: 0.75rem;
    }

    .footer-brand-copy {
        font-size: 0.8125rem;
    }

    .footer-group {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-group-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0;
        padding: 0.75rem 0;
        font-size: 0.9375rem;
    }

    .footer-group-summary::after {
        content: '+';
        font-size: 1.125rem;
        line-height: 1;
        color: rgba(255, 255, 255, 0.7);
    }

    .footer-group[open] > .footer-group-summary::after {
        content: '\2212';
    }

    .footer-group-links {
        padding: 0 0 0.75rem;
    }

    .site-footer--compact .footer-brand-copy,
    .page-auth .footer-brand-copy {
        display: none;
    }

    .site-footer--compact .footer-grid {
        margin-bottom: 0.5rem;
    }

    .auth-page--focused {
        padding: 0.75rem 0 1.25rem;
    }

    .auth-panel {
        padding: 1rem;
    }

    .page-home .hero-v2 {
        min-height: auto;
        padding: 1rem 0 1.15rem;
    }

    .page-home .hero-v2-badge {
        margin-bottom: 0.75rem;
    }

    .page-home .hero-v2-title {
        margin-bottom: 0.5rem;
    }

    .page-home .hero-v2-lead {
        margin-bottom: 0.875rem;
    }

    .page-home .hero-v2-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .page-home .hero-v2-actions .btn {
        width: 100%;
        min-height: 44px;
        font-size: 0.875rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .page-home .hero-v2-search {
        flex-direction: column;
        margin-bottom: 0.875rem;
    }

    .page-home .hero-v2-search .btn {
        width: 100%;
        min-height: 44px;
    }
}

@media (min-width: 769px) {
    .footer-group-summary {
        pointer-events: none;
    }

    .footer-group-summary::after {
        display: none;
    }

    .product-rail {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
    }
}

@media (min-width: 1201px) {
    .product-rail {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .product-rail > * {
        flex-basis: 46%;
        max-width: 9.75rem;
    }

    .page-home .product-grid,
    .product-rail + .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .book-summary {
        grid-template-columns: 6.5rem minmax(0, 1fr);
    }

    .book-summary-cover,
    .book-detail-cover,
    .book-summary-cover .book-cover {
        max-width: 6.5rem;
        max-height: 8.75rem;
    }

    .page-home .hero-v2-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .header-inner {
        gap: 0.5rem;
    }

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

    .header-icon-link,
    .mobile-toggle {
        width: 40px;
        height: 40px;
    }

    .search-form--compact .btn {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Book addition request — buy/sell intent cards */
.book-request-intent {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.book-request-intent > legend.form-label {
    padding: 0;
    margin-bottom: 0.65rem;
}

.book-request-intent-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.book-request-intent-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding: 0.95rem 1rem;
    border: 2px solid var(--brand-border);
    border-radius: var(--radius-lg);
    background: var(--brand-white);
    color: var(--brand-text);
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
    min-width: 0;
}

/* Hover must stay distinct from the selected state */
.book-request-intent-option:hover {
    border-color: #c5cad3;
    background: var(--brand-surface);
}

.book-request-intent-option:has(.book-request-intent-input:checked) {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    box-shadow: 0 0 0 1px var(--brand-primary);
}

.book-request-intent-option:has(.book-request-intent-input:checked):hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
}

.book-request-intent-option.is-invalid {
    border-color: #f87171;
}

.book-request-intent-option:has(.book-request-intent-input:focus-visible) {
    outline: 3px solid rgba(26, 54, 93, 0.35);
    outline-offset: 2px;
}

.book-request-intent-option:has(.book-request-intent-input:checked):has(.book-request-intent-input:focus-visible) {
    outline-color: rgba(0, 166, 81, 0.45);
}

.book-request-intent-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.book-request-intent-indicator {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    border: 2px solid var(--brand-border);
    border-radius: 999px;
    background: var(--brand-white);
    box-shadow: inset 0 0 0 0 var(--brand-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.book-request-intent-option:has(.book-request-intent-input:checked) .book-request-intent-indicator {
    border-color: var(--brand-primary);
    box-shadow: inset 0 0 0 0.28rem var(--brand-primary);
}

.book-request-intent-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.book-request-intent-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-navy);
    line-height: 1.3;
}

.book-request-intent-desc {
    font-size: 0.875rem;
    color: var(--brand-text-muted);
    line-height: 1.45;
}

@media (max-width: 640px) {
    .book-request-intent-options {
        grid-template-columns: 1fr;
    }
}

/* Catalogue / seller search — book request CTA panels */
.section-subtitle--centered {
    text-align: center;
}

.book-request-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 36rem;
    margin: 1.75rem auto 0;
    padding: 1.75rem 1.25rem 2rem;
    text-align: center;
}

.book-request-cta--results {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--brand-border);
}

.book-request-cta__title {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-navy);
    line-height: 1.35;
    text-align: center;
}

.book-request-cta__body {
    margin: 0 0 1.15rem;
    max-width: 32rem;
    color: var(--brand-text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: center;
}

.book-request-cta__button {
    display: inline-flex;
}

@media (max-width: 640px) {
    .book-request-cta {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Storefront catalogue / cart / sell refinements */

.book-card-cover-link {
    display: block;
    flex: 0 0 auto;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
}

.book-card-cover-link:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
}

.card-grid--catalogue {
    align-items: stretch;
    /* ≥320px so Acceptable + R 9 999.99 + touch availability track fit without overflow. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.card-grid--catalogue > * {
    min-width: 0;
    max-width: 100%;
}

.catalogue-browse {
    padding-top: 2.75rem;
    padding-bottom: 3.25rem;
}

.catalogue-page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    margin: 0 auto 1.5rem;
    max-width: 40rem;
    text-align: center;
}

.catalogue-page-header .section-title {
    margin-bottom: 0;
}

.catalogue-page-header .section-subtitle {
    margin: 0;
}

.catalogue-page-header .catalogue-mode-toggle {
    margin: 0.2rem 0 0;
}

.catalogue-result-count,
.catalogue-page-hint {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--brand-text-muted);
}

.catalogue-result-count strong {
    color: var(--brand-text);
    font-weight: 600;
}

@media (max-width: 700px) {
    .card-grid--catalogue {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 420px) {
    .book-card {
        padding: 1rem;
    }

    .book-card-conditions {
        --book-card-condition-action: 5.75rem;
        --book-card-condition-gap: 0.45rem;
    }

    .book-card-condition-price--muted {
        max-width: 6.25rem;
    }
}

@media (max-width: 340px) {
    .book-card {
        padding: 0.85rem;
    }

    .book-card-conditions {
        --book-card-condition-action: 5.25rem;
        --book-card-condition-gap: 0.4rem;
    }

    .book-card-condition-price--muted {
        max-width: 5.75rem;
    }
}

.nav-condition-guide-short {
    display: none;
}

.nav-condition-guide-full {
    display: inline;
}

@media (max-width: 1400px) {
    .nav-condition-guide-full {
        display: none;
    }

    .nav-condition-guide-short {
        display: inline;
    }
}

@media (min-width: 1201px) {
    .search-section--mobile-primary {
        display: none;
    }
}

@media (max-width: 1200px) {
    .header-search {
        display: none;
    }

    /*
     * Mobile sticky search (storefront only):
     * - Persist on book + search-results: stick the existing strip under the header.
     * - Reveal on homepage: fixed overlay under the header; no layout space when hidden.
     * Desktop (≥1201px) keeps header-search; these rules do not apply there.
     */
    .search-section--sticky-mobile {
        position: sticky;
        top: var(--site-header-height, 4.25rem);
        z-index: 90;
        background: var(--brand-white);
        box-shadow: 0 1px 0 var(--brand-border);
    }

    .search-section--reveal-on-scroll {
        position: fixed;
        top: var(--site-header-height, 4.25rem);
        left: 0;
        right: 0;
        z-index: 90;
        margin: 0;
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        background: var(--brand-white);
        box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
        transition:
            transform 180ms ease,
            opacity 180ms ease,
            visibility 0s linear 180ms;
    }

    .search-section--reveal-on-scroll.is-revealed {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition:
            transform 180ms ease,
            opacity 180ms ease,
            visibility 0s linear 0s;
    }

    .search-section--sticky-mobile .search-suggest__list,
    .search-section--reveal-on-scroll .search-suggest__list {
        /* Stay below sticky header; keep list scrollable in the remaining viewport.
           Dual Buy/Sell homepage sticky is taller than the single Search strip. */
        max-height: min(22rem, calc(100dvh - var(--site-header-height, 4.25rem) - 11rem));
        z-index: 95;
    }

    .search-section--reveal-on-scroll .search-form--compact.search-form--dual {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 0.45rem;
    }

    .search-section--reveal-on-scroll .search-form--dual .search-suggest,
    .search-section--reveal-on-scroll .search-form--dual .home-search-hint,
    .search-section--reveal-on-scroll .search-form--dual .home-search-selected,
    .search-section--reveal-on-scroll .search-form--dual .home-search-actions {
        flex: 1 1 100%;
        width: 100%;
    }

    .search-section--reveal-on-scroll .home-search-hint {
        font-size: 0.75rem;
    }

    .search-section--reveal-on-scroll .home-search-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        width: auto;
        min-height: 44px;
    }
}

@media (max-width: 1200px) and (prefers-reduced-motion: reduce) {
    .search-section--reveal-on-scroll,
    .search-section--reveal-on-scroll.is-revealed {
        transition: none;
    }
}

/*
 * PayFast Onsite engine.css mounts .payfast_compact_payment_modal at z-index: 1.
 * Our sticky header (100) and mobile sticky search (90) would otherwise cover the
 * payment iframe. !important is required because PayFast injects engine.css after
 * app.css when the modal opens. Sticky-search behaviour outside the overlay is unchanged.
 */
#payfast_div_container.payfast_compact_payment_modal,
.payfast_compact_payment_modal {
    z-index: 2000 !important;
}

body.payfast-onsite-open .site-header,
body.payfast-onsite-open .search-section--sticky-mobile,
body.payfast-onsite-open .search-section--reveal-on-scroll {
    z-index: 1;
}

@media (max-width: 360px) {
    .main-nav {
        gap: 0.75rem;
    }

    .main-nav a {
        font-size: 0.8125rem;
    }
}

.book-cover-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: var(--radius-lg);
}

.book-cover-trigger:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
}

.cover-preview {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cover-preview[hidden] {
    display: none !important;
}

.cover-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.cover-preview-panel {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 560px);
    max-height: 92vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-white);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
}

.cover-preview-image {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 2rem);
    width: auto;
    height: auto;
    object-fit: contain;
}

.cover-preview-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.cover-preview-close:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}

/* —— Cart preview (add popup + header popover) —— */
.header-cart-wrap {
    position: relative;
}

.header-cart-preview {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1100;
    width: min(22.5rem, calc(100vw - 1.5rem));
    max-height: min(70vh, 32rem);
    padding-top: 0.5rem;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.header-cart-preview[hidden] {
    display: none !important;
}

.header-cart-preview__inner {
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 32rem);
    min-height: 0;
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.header-cart-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.5rem;
    border-bottom: 1px solid var(--brand-border);
}

.header-cart-preview__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-navy);
}

.header-cart-preview__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--brand-text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.header-cart-preview__close:hover,
.header-cart-preview__close:focus-visible {
    background: var(--brand-surface);
    color: var(--brand-text);
}

.header-cart-preview__close:focus-visible,
.cart-added-dialog__close:focus-visible,
.cart-preview-item__remove:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}

.header-cart-preview__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--brand-border);
}

.header-cart-preview__actions[hidden],
.cart-preview-summary[hidden],
.cart-preview-items[hidden],
.cart-preview-empty[hidden],
.cart-preview-checkout[hidden] {
    display: none !important;
}

.header-cart-preview__actions .cart-preview-checkout {
    grid-column: 1 / -1;
}

.cart-preview-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--brand-text-muted);
}

.cart-preview-empty p {
    margin: 0 0 0.75rem;
}

.cart-preview-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    max-height: min(40vh, 18rem);
}

.cart-preview-items--compact {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(36vh, 14rem);
}

.cart-preview-item {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
}

.cart-preview-item__cover {
    width: 3.25rem;
}

.cart-preview-cover {
    width: 3.25rem !important;
    height: 4.35rem !important;
    object-fit: contain;
    border-radius: 0.25rem;
    background: var(--brand-surface);
}

.cart-preview-cover.book-cover--fallback,
.cart-preview-cover.book-cover--missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.2rem;
    overflow: hidden;
}

.cart-preview-cover .book-cover-fallback-title {
    display: none;
}

.cart-preview-cover .book-cover-fallback-mark svg {
    width: 1.25rem;
    height: 1.25rem;
}

.cart-preview-item__body {
    min-width: 0;
}

.cart-preview-item__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
}

.cart-preview-item__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--brand-navy);
    overflow-wrap: anywhere;
}

.cart-preview-item__just-added {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--brand-primary-dark);
    background: var(--brand-primary-light);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.cart-preview-item__meta,
.cart-preview-item__details,
.cart-preview-item__warn {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--brand-text-muted);
}

.cart-preview-item__warn {
    color: #b45309;
}

.cart-preview-item__remove {
    border: 0;
    background: transparent;
    color: var(--brand-text-muted);
    font-size: 0.8125rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.25rem 0;
    min-height: 2.5rem;
}

.cart-preview-item__remove:hover {
    color: var(--brand-navy);
}

.cart-preview-item__remove[disabled] {
    opacity: 0.55;
    cursor: wait;
}

.cart-preview-summary {
    padding: 0 1rem 0.85rem;
}

.cart-preview-summary--compact {
    padding-bottom: 0.5rem;
}

.cart-preview-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.cart-preview-summary__delivery {
    margin: 0.35rem 0 0;
    color: var(--brand-primary-dark);
    font-size: 0.875rem;
    font-weight: 600;
}

.cart-preview-summary__note {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--brand-text-muted);
}

.cart-added-dialog {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cart-added-dialog[hidden] {
    display: none !important;
}

.cart-added-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 11, 21, 0.55);
}

.cart-added-dialog__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 36rem);
    max-height: min(92vh, 40rem);
    display: flex;
    flex-direction: column;
    background: var(--brand-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.cart-added-dialog.is-open .cart-added-dialog__panel {
    animation: cart-preview-in 180ms ease-out;
}

.cart-added-dialog.is-open .cart-added-dialog__backdrop {
    animation: cart-preview-fade 180ms ease-out;
}

@keyframes cart-preview-in {
    from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes cart-preview-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cart-added-dialog.is-open .cart-added-dialog__panel,
    .cart-added-dialog.is-open .cart-added-dialog__backdrop {
        animation: none;
    }
}

.cart-added-dialog__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--brand-surface);
    color: var(--brand-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.cart-added-dialog__header {
    padding: 1.25rem 3rem 0.5rem 1.25rem;
}

.cart-added-dialog__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-navy);
}

.cart-added-dialog__count {
    margin: 0.35rem 0 0;
    color: var(--brand-text-muted);
    font-size: 0.95rem;
}

.cart-added-dialog .cart-preview-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.cart-added-dialog .cart-preview-items {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(42vh, 16rem);
    overflow-y: auto;
}

.cart-added-dialog .cart-preview-summary,
.cart-added-dialog__header,
.cart-added-dialog__footer,
.header-cart-preview__header,
.header-cart-preview .cart-preview-summary,
.header-cart-preview__actions {
    flex-shrink: 0;
}

.cart-added-dialog__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem 1.15rem;
    border-top: 1px solid var(--brand-border);
    background: var(--brand-white);
}

.cart-added-dialog__footer-left,
.cart-added-dialog__footer-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.cart-added-dialog__footer-right .cart-preview-checkout {
    min-width: 8.5rem;
}

@media (max-width: 640px) {
    .cart-added-dialog {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .cart-added-dialog__panel {
        width: 100%;
        max-height: min(94vh, 100%);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

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

    .cart-added-dialog__footer-left,
    .cart-added-dialog__footer-right {
        width: 100%;
    }

    .cart-added-dialog__footer-left .btn,
    .cart-added-dialog__footer-right .btn {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    .cart-added-dialog__footer-right .cart-preview-checkout {
        width: 100%;
        min-width: 0;
    }

    .header-cart-preview {
        position: fixed;
        top: auto;
        right: 0.75rem;
        left: 0.75rem;
        bottom: 0.75rem;
        width: auto;
        max-height: min(75vh, 28rem);
        padding-top: 0;
    }

    .header-cart-preview__inner {
        max-height: min(75vh, 28rem);
    }

    .cart-preview-item {
        grid-template-columns: 3rem minmax(0, 1fr);
    }

    .cart-preview-item__remove {
        grid-column: 2;
        justify-self: start;
    }
}

.catalogue-mode-toggle {
    margin: 0 0 1.25rem;
}

.catalogue-page-header .catalogue-mode-toggle {
    margin: 0.2rem 0 0;
}

/* Book Addition Request show — full-width review cards */
body.is-backend .bar-request-show .bar-summary-grid,
body.is-backend .bar-request-show .bar-review-grid {
    width: 100%;
    margin-bottom: 0;
}

body.is-backend .bar-request-show .bar-review-card {
    height: 100%;
}

body.is-backend .bar-request-show .bar-meta-list {
    display: grid;
    gap: 0.55rem 1.25rem;
    margin: 0;
}

body.is-backend .bar-request-show .bar-meta-list > div {
    display: grid;
    grid-template-columns: minmax(7.5rem, 10.5rem) minmax(0, 1fr);
    gap: 0.35rem 1rem;
    align-items: start;
}

body.is-backend .bar-request-show .bar-meta-list dt {
    margin: 0;
    color: var(--brand-text-muted);
    font-weight: 600;
    font-size: var(--admin-font-meta);
}

body.is-backend .bar-request-show .bar-meta-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

body.is-backend .bar-request-show .bar-review-block + .bar-review-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--brand-border);
}

body.is-backend .bar-request-show .bar-review-block h3 {
    margin: 0 0 0.5rem;
    font-size: var(--admin-heading);
}

body.is-backend .bar-request-show .bar-review-list {
    margin: 0;
    padding-left: 1.15rem;
}

body.is-backend .bar-request-show .bar-review-note {
    margin-top: 0.85rem;
}

body.is-backend .bar-request-show .bar-actions-card {
    border-color: color-mix(in srgb, var(--brand-primary) 18%, var(--brand-border));
}

body.is-backend .bar-request-show .bar-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    body.is-backend .bar-request-show .bar-meta-list > div {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    body.is-backend .bar-request-show .bar-action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* SAPnet file inventory monitor */
body.is-backend .sapnet-files-card .sapnet-files-table .btn-sm {
    white-space: nowrap;
}

body.is-backend .sapnet-files-table tr.is-active-import td {
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}

body.is-backend .sapnet-run-error details summary {
    cursor: pointer;
    max-width: 18rem;
}

@media (max-width: 768px) {
    body.is-backend .sapnet-files-card .page-header,
    body.is-backend .sapnet-files-card h2 {
        overflow-wrap: anywhere;
    }
}

/* Book Addition Request queue — responsive stacked cards */
body.is-backend .bar-queue-table th,
body.is-backend .bar-queue-table td {
    vertical-align: top;
}

body.is-backend .bar-queue-table .status-pill {
    white-space: nowrap;
}

body.is-backend .bar-queue-mobile {
    display: none;
}

body.is-backend .bar-queue-card-item {
    border-top: 1px solid var(--brand-border);
    padding: 0.9rem 0;
}

body.is-backend .bar-queue-card-item:first-child {
    border-top: 0;
    padding-top: 0;
}

body.is-backend .bar-queue-card-item__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

body.is-backend .bar-queue-card-item__isbn {
    font-weight: 700;
    overflow-wrap: anywhere;
}

body.is-backend .bar-queue-card-item__title {
    margin: 0 0 0.55rem;
    overflow-wrap: anywhere;
}

body.is-backend .bar-queue-card-item__meta {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

body.is-backend .bar-queue-card-item__meta > div {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.25rem 0.75rem;
}

body.is-backend .bar-queue-card-item__meta dt {
    margin: 0;
    color: var(--brand-text-muted);
    font-size: var(--admin-font-meta);
    font-weight: 600;
}

body.is-backend .bar-queue-card-item__meta dd {
    margin: 0;
    overflow-wrap: anywhere;
}

body.is-backend .bar-next-action {
    padding: 0.75rem 1rem;
}

body.is-backend .bar-match-banner {
    display: inline-block;
    margin: 0 0 0.85rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.35rem;
    font-weight: 700;
    font-size: 0.92rem;
}

body.is-backend .bar-match-banner--exact {
    background: #dcfce7;
    color: #166534;
}

body.is-backend .bar-match-banner--possible {
    background: #fef3c7;
    color: #92400e;
}

body.is-backend .bar-match-banner--none,
body.is-backend .bar-match-banner--muted {
    background: #f3f4f6;
    color: #4b5563;
}

body.is-backend .bar-sapnet-cover-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

body.is-backend .bar-sapnet-cover {
    width: 96px;
    min-height: 128px;
    border: 1px solid var(--brand-border);
    border-radius: 0.35rem;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
    color: var(--brand-text-muted);
    padding: 0.35rem;
}

body.is-backend .bar-sapnet-cover img,
body.is-backend .bar-sapnet-cover__img {
    width: 100%;
    height: 128px;
    object-fit: contain;
    display: block;
}

body.is-backend .bar-sapnet-cover[data-sapnet-cover-preview="unavailable"] .bar-sapnet-cover__img {
    display: none;
}

body.is-backend .bar-sapnet-cover--empty,
body.is-backend .bar-sapnet-cover__placeholder,
body.is-backend .bar-sapnet-cover__fallback {
    min-height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    line-height: 1.25;
}

body.is-backend .bar-sapnet-cover__fallback[hidden],
body.is-backend .bar-sapnet-cover__caption[hidden],
body.is-backend .bar-sapnet-cover__img[hidden] {
    display: none !important;
}

body.is-backend .bar-sapnet-cover__caption {
    margin: 0.35rem 0 0;
    padding: 0 0.15rem;
    font-size: 0.68rem;
    line-height: 1.25;
    color: var(--brand-text-muted);
    width: 100%;
}

body.is-backend .bar-actions-card__top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

body.is-backend .bar-accordion {
    display: grid;
    gap: 0.65rem;
}

body.is-backend .bar-accordion__item {
    border: 1px solid var(--brand-border);
    border-radius: 0.45rem;
    background: #fff;
}

body.is-backend .bar-accordion__item--danger {
    border-color: color-mix(in srgb, #991b1b 28%, var(--brand-border));
}

body.is-backend .bar-accordion__item > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.85rem 1rem;
    font-weight: 700;
}

body.is-backend .bar-accordion__item > summary::-webkit-details-marker {
    display: none;
}

body.is-backend .bar-accordion__body {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--brand-border);
    padding-top: 0.85rem;
}

body.is-backend .bar-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

body.is-backend .bar-exact-book-callout {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border: 1px solid var(--brand-border);
    border-radius: 0.4rem;
    background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
}

body.is-backend .bar-notes-pre {
    white-space: pre-wrap;
    margin: 0 0 1rem;
}

body.is-backend .bar-history-item {
    margin-bottom: 0.75rem;
}

body.is-backend .bar-request-show .bar-isbndb-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body.is-backend .bar-provider-stack {
    display: grid;
    gap: 0;
}

body.is-backend .bar-provider-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.65rem;
}

body.is-backend .bar-provider-heading h2,
body.is-backend .bar-provider-heading__title {
    margin: 0;
    font-size: var(--admin-heading, 1.15rem);
    font-weight: 700;
}

body.is-backend .bar-provider-heading--summary {
    cursor: pointer;
    list-style: none;
}

body.is-backend .bar-provider-heading--summary::-webkit-details-marker {
    display: none;
}

body.is-backend .bar-provider-badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

body.is-backend .bar-provider-badge--primary {
    background: #dbeafe;
    color: #1e40af;
}

body.is-backend .bar-provider-badge--secondary,
body.is-backend .bar-provider-badge--alt {
    background: #f3f4f6;
    color: #4b5563;
}

body.is-backend .bar-provider-badge--fallback {
    background: #fef3c7;
    color: #92400e;
}

body.is-backend .bar-review-card--isbndb-primary {
    border-color: color-mix(in srgb, #2563eb 28%, var(--brand-border));
    box-shadow: 0 0 0 1px color-mix(in srgb, #2563eb 12%, transparent);
}

body.is-backend .bar-review-card--sapnet-alt {
    border-style: dashed;
    padding: 0.85rem 1rem;
}

body.is-backend .bar-review-card--sapnet-alt > summary {
    margin: 0;
}

body.is-backend .bar-review-card--sapnet-alt .bar-review-card__body {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--brand-border);
}

body.is-backend .bar-review-card--sapnet-fallback {
    border-color: color-mix(in srgb, #d97706 22%, var(--brand-border));
}

@media (max-width: 768px) {
    body.is-backend .bar-provider-heading {
        align-items: flex-start;
    }

    body.is-backend .bar-request-show .bar-isbndb-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

body.is-backend .bar-request-show__status-line {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    body.is-backend .bar-queue-desktop {
        display: none;
    }

    body.is-backend .bar-queue-mobile {
        display: block;
        padding: 0.25rem 0.15rem 0.5rem;
    }

    body.is-backend .bar-sapnet-cover-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body.is-backend .bar-queue-card-item__meta > div {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    body.is-backend .bar-actions-card__top {
        align-items: stretch;
    }

    body.is-backend .bar-actions-card__top .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Book Additions breadcrumbs & definition lists */
.admin-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.85rem;
    font-size: 0.875rem;
    color: var(--text-muted, #5b6573);
}

.admin-breadcrumbs a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.admin-breadcrumbs a:focus-visible {
    outline: 2px solid var(--brand, #1f7a4c);
    outline-offset: 2px;
}

.admin-dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1.25rem;
    margin: 0;
}

.admin-dl > div {
    margin: 0;
}

.admin-dl dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #5b6573);
    margin: 0 0 0.2rem;
}

.admin-dl dd {
    margin: 0;
    font-weight: 600;
}

.admin-pre {
    background: #0f172a0d;
    border: 1px solid #d7dde5;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
}

/* -------------------------------------------------------------------------- */
/* Admin book condition prices — stable geometry across validation states     */
/* -------------------------------------------------------------------------- */
.book-condition-prices {
    --book-price-status-width: 12.5rem;
    --book-price-row-min-height: 4.75rem;
    --book-price-status-msg-height: 2.5rem;
    --book-price-field-error-height: 1.15rem;
    margin-top: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.book-condition-prices__head,
.book-condition-prices__row {
    display: grid;
    grid-template-columns: minmax(7rem, 1.1fr) minmax(9rem, 1fr) minmax(9rem, 1fr) var(--book-price-status-width);
    column-gap: 0.75rem;
    align-items: start;
    padding: 0.65rem 0.85rem;
}

.book-condition-prices__head {
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    color: #475569;
    border-bottom: 1px solid #e5e7eb;
}

.book-condition-prices__row {
    min-height: var(--book-price-row-min-height);
    border-bottom: 1px solid #eef2f7;
}

.book-condition-prices__row:last-child {
    border-bottom: 0;
}

.book-condition-prices__condition {
    font-weight: 600;
    padding-top: 0.55rem;
    min-width: 0;
}

.book-condition-prices__price {
    min-width: 0;
}

.book-condition-prices__input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.book-condition-prices__field-error {
    min-height: var(--book-price-field-error-height);
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--admin-danger, #b42318);
    overflow: hidden;
}

.book-condition-prices__status {
    min-width: 0;
    width: 100%;
}

.book-condition-prices__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.75rem;
    min-height: 1.55rem;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}

.book-condition-prices__status-msg {
    min-height: var(--book-price-status-msg-height);
    margin-top: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.25;
    overflow: hidden;
}

.book-condition-prices__status-msg[data-empty="1"] {
    visibility: hidden;
}

.book-cover--missing {
    background: #fef2f2;
    color: #991b1b;
    border: 1px dashed #fca5a5;
}

@media (max-width: 768px) {
    .book-condition-prices__head {
        display: none;
    }

    .book-condition-prices__row {
        grid-template-columns: 1fr;
        row-gap: 0.65rem;
        min-height: 0;
        padding: 0.9rem 0.85rem;
    }

    .book-condition-prices__condition,
    .book-condition-prices__price,
    .book-condition-prices__status {
        display: grid;
        grid-template-columns: minmax(7.5rem, 9.5rem) minmax(0, 1fr);
        column-gap: 0.65rem;
        align-items: start;
    }

    .book-condition-prices__condition::before,
    .book-condition-prices__price::before,
    .book-condition-prices__status::before {
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 650;
        color: #64748b;
        padding-top: 0.55rem;
    }

    .book-condition-prices__condition {
        font-weight: 700;
        padding-top: 0;
    }

    .book-condition-prices__field-error {
        grid-column: 2;
    }

    .book-condition-prices__status-msg {
        grid-column: 2;
    }
}

@media (max-width: 320px) {
    .book-condition-prices__condition,
    .book-condition-prices__price,
    .book-condition-prices__status {
        grid-template-columns: 1fr;
        row-gap: 0.25rem;
    }

    .book-condition-prices__field-error,
    .book-condition-prices__status-msg {
        grid-column: 1;
    }
}

/* Customer enquiry detail layout (scoped; does not change shared card-grid) */
.enquiry-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1.25rem;
    align-items: start;
}

.enquiry-detail-main,
.enquiry-detail-side {
    min-width: 0;
}

.enquiry-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.enquiry-title-row h1 {
    margin: 0;
}

.enquiry-status-pill {
    white-space: nowrap;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
    vertical-align: middle;
}

.enquiry-message {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.enquiry-message:last-child {
    border-bottom: none;
}

.enquiry-composer--public {
    border-left: 4px solid #2563eb;
}

.enquiry-composer--private {
    border-left: 4px solid #6b7280;
}

.enquiry-context-line {
    margin: 0 0 1rem;
}

.enquiry-detail-side .side-card {
    margin-bottom: 0.85rem;
}

.enquiry-detail-side .side-card h3 {
    margin-top: 0;
}

.enquiry-side-dl {
    margin: 0;
}

.enquiry-side-dl > div {
    display: grid;
    grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr);
    gap: 0.35rem 0.75rem;
    margin: 0 0 0.45rem;
}

.enquiry-side-dl dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-text-muted, #6b7280);
}

.enquiry-side-dl dd {
    margin: 0;
    font-size: 0.875rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

body.is-backend .enquiry-detail-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--admin-grid-gap, 1.25rem);
}

body.is-backend .enquiry-detail-main {
    grid-column: span 8;
}

body.is-backend .enquiry-detail-side {
    grid-column: span 4;
}

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

    body.is-backend .enquiry-detail-main,
    body.is-backend .enquiry-detail-side {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .enquiry-side-dl > div {
        grid-template-columns: 1fr;
        gap: 0.1rem;
        margin-bottom: 0.65rem;
    }

    .enquiry-status-pill {
        font-size: 0.75rem;
        padding: 0.2rem 0.55rem;
    }
}

/* Keep long enquiry status labels readable in dense admin tables */
body.is-backend .enquiry-status-pill {
    white-space: nowrap;
    font-size: 0.6875rem;
    padding: 0.12rem 0.5rem;
}


/* Payment batch details — simplified layout */
.payment-batch-header {
    margin-bottom: 1.25rem;
}

.payment-batch-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    line-height: 1.2;
    word-break: break-word;
}

.payment-batch-header__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    margin: 0;
}

.payment-batch-header__metric {
    color: var(--brand-text-muted);
    font-size: 0.95rem;
}

.payment-batch-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
}

.payment-batch-header__meta {
    margin-top: 0.4rem;
}

.refund-settlement-progress {
    margin: 0.35rem 0 0.65rem;
}

.refund-settlement-progress__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
}

.refund-settlement-progress__count {
    font-weight: 700;
}

.refund-settlement-progress__amounts {
    color: var(--brand-text-muted);
}

.refund-settlement-progress__track {
    margin-top: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.refund-settlement-progress__fill {
    height: 100%;
    background: #166534;
    border-radius: inherit;
}

.refund-settlement-attention {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    margin-top: 0.7rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    background: #fffbeb;
    color: #92400e;
    font-weight: 600;
}

.refund-batch-table {
    width: 100%;
}

.refund-batch-table td,
.refund-batch-table th {
    overflow-wrap: anywhere;
    vertical-align: top;
}

.payment-batch-notice {
    margin-bottom: 1rem;
}

.payment-batch-notice__title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.payment-batch-notice__list {
    margin: 0;
    padding-left: 1.15rem;
}

.payment-batch-notice__list li {
    margin-bottom: 0.65rem;
}

.payment-batch-notice--warning {
    border-color: color-mix(in srgb, #b45309 35%, var(--brand-border));
}

.payment-batch-notice--info {
    border-color: color-mix(in srgb, #0369a1 28%, var(--brand-border));
}

.payment-batch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
    gap: 1.25rem;
    align-items: start;
}

.payment-batch-next {
    order: 2;
    min-width: 0;
}

.refund-batch-layout .payment-batch-next__card {
    position: static;
}

.payment-batch-main {
    order: 1;
    min-width: 0;
}

.payment-batch-next__card {
    position: sticky;
    top: 0.75rem;
}

.payment-batch-next__heading {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-text-muted);
}

.payment-batch-next__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.payment-batch-next__description {
    margin: 0.35rem 0 0;
}

.payment-batch-next__facts {
    display: grid;
    gap: 0.35rem;
    margin: 0.75rem 0 0;
}

.payment-batch-next__facts > div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.payment-batch-next__facts dt {
    color: var(--brand-text-muted);
    margin: 0;
}

.payment-batch-next__facts dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.payment-batch-next__actions {
    margin-top: 0.85rem;
}

.payment-batch-next__form {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.85rem;
}

.payment-batch-next__form label {
    font-size: 0.875rem;
    font-weight: 600;
}

.payment-batch-next__subheading {
    margin: 0;
    font-size: 1rem;
}

.payment-batch-next__check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.payment-batch-secondary {
    margin-top: 1rem;
    border-top: 1px solid var(--brand-border);
    padding-top: 0.65rem;
}

.payment-batch-secondary > summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-text-muted);
}

.payment-batch-secondary > summary::-webkit-details-marker {
    display: none;
}

.payment-batch-secondary__body {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.65rem;
}

.payment-seller-list {
    display: grid;
    gap: 0.65rem;
}

.payment-seller-group {
    border: 1px solid var(--brand-border);
    border-radius: 0.45rem;
    background: #fff;
}

.payment-seller-group__summary {
    cursor: pointer;
    list-style: none;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto auto auto auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.75rem 0.9rem;
    font-size: 0.925rem;
}

.payment-seller-group__summary::-webkit-details-marker {
    display: none;
}

.payment-seller-group__seller {
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.payment-seller-group__amount {
    font-weight: 700;
    white-space: nowrap;
}

.payment-seller-group__meta {
    color: var(--brand-text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.payment-seller-group__body {
    border-top: 1px solid var(--brand-border);
    padding: 0.75rem 0.9rem 0.9rem;
}

.payment-batch-tech-note {
    margin-top: 0.65rem;
    min-width: 0;
    max-width: 100%;
}

.payment-batch-tech-note .item-meta,
.payment-batch-tech-note .item-meta li {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.payment-batch-tech-note > summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.85rem;
    color: var(--brand-text-muted);
    font-weight: 600;
}

.payment-batch-tech-note > summary::-webkit-details-marker {
    display: none;
}

.payment-batch-tech-stack {
    display: grid;
    gap: 0.75rem;
}

.payment-batch-tech-stack > .payment-batch-accordion {
    min-width: 0;
    max-width: 100%;
}

.payment-batch-accordion > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.15rem 0;
}

.payment-batch-accordion > summary::-webkit-details-marker {
    display: none;
}

.payment-batch-accordion__title {
    margin: 0;
    font-size: 1.05rem;
    display: inline;
}

.payment-batch-accordion > summary .item-meta {
    display: block;
    margin-top: 0.25rem;
}

.payment-batch-accordion__body {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--brand-border);
    min-width: 0;
    max-width: 100%;
}

.payment-batch-report-form {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

@media (max-width: 1023px) {
    .payment-batch-layout {
        grid-template-columns: 1fr;
    }

    .payment-batch-next {
        order: 0;
    }

    .payment-batch-main {
        order: 1;
    }

    .payment-batch-next__card {
        position: static;
    }
}

@media (max-width: 767px) {
    body.is-backend .admin-table-wrap:has(.refund-batch-table) {
        max-height: none;
        overflow: visible;
    }

    .refund-batch-table,
    .refund-batch-table thead,
    .refund-batch-table tbody,
    .refund-batch-table tr,
    .refund-batch-table th,
    .refund-batch-table td {
        display: block;
        width: auto;
    }

    .refund-batch-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .refund-batch-table tr {
        padding: 0.65rem 0.75rem;
        border-bottom: 1px solid var(--brand-border);
    }

    .refund-batch-table td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.2rem 0;
        text-align: right;
    }

    .refund-batch-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        color: var(--brand-text-muted);
    }

    .refund-batch-table td:not([data-label])::before {
        content: none;
    }

    .payment-seller-group__summary {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "seller amount"
            "items items"
            "bank bank"
            "account account";
    }

    .payment-seller-group__seller { grid-area: seller; }
    .payment-seller-group__amount { grid-area: amount; }
    .payment-seller-group__meta:nth-of-type(3) { grid-area: items; }
    .payment-seller-group__meta:nth-of-type(4) { grid-area: bank; }
    .payment-seller-group__meta:nth-of-type(5) { grid-area: account; }

    .payment-seller-group__meta {
        white-space: normal;
    }

    .payment-batch-header__summary {
        gap: 0.4rem 0.65rem;
    }
}

@media (max-width: 374px) {
    .payment-batch-header h1 {
        font-size: 1.35rem;
    }

    .payment-batch-next__actions .btn,
    .payment-batch-next__form .btn {
        width: 100%;
    }
}

/* Admin refund case workflow */
.refund-case-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    margin-bottom: 1rem;
}

.refund-case-header h1 {
    margin: 0.15rem 0 0.35rem;
    font-size: 1.55rem;
    line-height: 1.2;
}

.refund-case-header__eyebrow {
    margin: 0;
}

.refund-case-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: baseline;
    margin: 0;
    font-size: 0.95rem;
}

.refund-case-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.55rem 0 0;
}

.refund-case-header__badges a.status-pill {
    text-decoration: none;
}

.refund-case-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.refund-case-balances {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0 0 0.75rem;
}

.refund-case-balance {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: #fff;
    padding: 0.65rem 0.75rem;
    min-width: 0;
}

.refund-case-balance--emphasis {
    border-color: color-mix(in srgb, var(--brand-primary, #1f6b4a) 28%, var(--brand-border));
    background: color-mix(in srgb, var(--brand-primary, #1f6b4a) 6%, #fff);
}

.refund-case-balance--emphasis strong {
    font-size: 1.2rem;
}

.refund-case-balance--secondary {
    background: #fafafa;
}

.refund-case-balance--secondary strong {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--brand-text-muted);
}

.refund-case-balance__label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--brand-text-muted);
    margin-bottom: 0.2rem;
}

.refund-case-balance strong {
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.refund-case-reserved-note {
    margin: 0 0 0.85rem;
}

.refund-case-next {
    margin: 0 0 1.15rem;
}

.refund-case-next__card {
    max-width: 40rem;
    padding: 0.9rem 1rem;
}

.refund-case-next__heading {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

.refund-case-next__title {
    margin: 0.3rem 0 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
}

.refund-case-next__summary {
    margin: 0.35rem 0 0;
    color: var(--brand-text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.refund-case-bank-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    margin-top: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, #b7791f 35%, var(--brand-border));
    background: color-mix(in srgb, #b7791f 8%, #fff);
}

.refund-case-bank-notice__text {
    margin: 0;
    flex: 1 1 16rem;
    font-size: 0.92rem;
    line-height: 1.35;
}

.refund-case-bank-notice__link {
    font-weight: 600;
    white-space: nowrap;
}

.refund-case-next__blockers {
    margin-top: 0.65rem;
}

.refund-case-next__blockers p {
    margin: 0.2rem 0;
    font-size: 0.92rem;
}

.refund-case-next__actions {
    margin-top: 0.85rem;
}

.refund-case-next__actions .btn {
    min-height: 44px;
}

.refund-case-next__secondary {
    margin-top: 0.75rem;
}

.refund-case-next__secondary-label {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--brand-text-muted);
}

.refund-case-next__draft-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.refund-case-next__draft-list .btn {
    min-height: 40px;
}

.refund-case-next__permission {
    margin: 0.75rem 0 0;
}

.refund-case-help {
    margin-top: 0.85rem;
    border-top: 1px solid var(--brand-border);
    padding-top: 0.55rem;
}

.refund-case-help > summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    list-style-position: outside;
}

.refund-case-help__body {
    margin-top: 0.5rem;
}

.refund-case-help__body p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--brand-text-muted);
    line-height: 1.4;
}

.refund-case-help__links {
    margin-bottom: 0 !important;
}

.refund-case-body {
    display: grid;
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    gap: 1rem 1.5rem;
    align-items: start;
}

.refund-case-section-heading {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
}

.refund-case-customer__line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.55rem;
    align-items: baseline;
    margin: 0;
}

.refund-case-customer__bank {
    margin: 0.35rem 0 0;
}

.refund-case-activity__list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.refund-case-activity__row {
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--brand-border);
}

.refund-case-activity__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.refund-case-activity__main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
}

.refund-case-activity__type {
    font-weight: 650;
}

.refund-case-activity__amount {
    margin-left: auto;
}

.refund-case-activity__meta {
    margin: 0.2rem 0 0;
}

.refund-case-manual-reserve {
    margin-top: 1rem;
}

.refund-case-more .order-more-menu {
    min-width: 220px;
}

@media (max-width: 1024px) {
    .refund-case-balances {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .refund-case-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .refund-case-header h1 {
        font-size: 1.35rem;
    }

    .refund-case-header__actions {
        width: 100%;
    }

    .refund-case-header__actions .btn,
    .refund-case-header__actions .order-more {
        flex: 1 1 auto;
    }

    .refund-case-header__actions .order-more > summary {
        width: 100%;
        min-height: 44px;
    }

    .refund-case-header__actions .order-more-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 0.35rem;
    }

    .refund-case-next__card {
        max-width: none;
    }

    .refund-case-next__actions .btn,
    .refund-case-next__draft-list .btn {
        width: 100%;
    }

    .refund-case-activity__amount {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 374px) {
    .refund-case-balances {
        grid-template-columns: 1fr;
    }
}

/* Refund worklists — consistent navigation and page-local selection */
.refund-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.3rem;
    margin: 0 0 1.25rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: #fff;
}

.refund-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    border-radius: calc(var(--radius) - 2px);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    color: var(--brand-text-muted);
    text-decoration: none;
}

.refund-nav a:hover,
.refund-nav a[aria-current="page"] {
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
}

.refund-nav a[aria-current="page"] {
    box-shadow: inset 0 -2px var(--brand-primary);
}

.refund-nav a:focus-visible,
.refund-next-link:focus-visible,
.refund-case-history > summary:focus-visible,
.refund-case-draft-options > summary:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.refund-page-note {
    margin: -0.35rem 0 1rem;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

.refund-selection-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.85rem 1rem;
}

.refund-selection-toolbar > :first-child {
    flex: 1 1 13rem;
}

.refund-selection-toolbar p {
    margin: 0.2rem 0 0;
}

body.is-backend .refund-selection-toolbar .btn,
body.is-backend .refund-batch-shortcuts .btn {
    min-height: 44px;
}

body.is-backend .refund-selection-toolbar .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.refund-select-all:not([hidden]),
.refund-case-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    font-size: 0.85rem;
}

.refund-select-all input,
.refund-case-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
}

.refund-worklist-table {
    width: 100%;
}

body.is-backend .refund-worklist-table td {
    vertical-align: top;
    overflow-wrap: anywhere;
}

.refund-worklist-table .refund-select-cell {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

body.is-backend .refund-worklist-table td[data-label="Age"] {
    white-space: nowrap;
}

.refund-worklist-table .refund-row-title {
    font-weight: 650;
}

.refund-worklist-table .item-meta {
    margin-top: 0.25rem;
}

.refund-worklist-table .refund-row-selected > td {
    background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
}

.refund-next-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    font-weight: 600;
    line-height: 1.4;
}

.refund-worklist-table .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.refund-case-draft-options > summary,
.refund-case-history > summary {
    cursor: pointer;
    min-height: 44px;
    padding: 0.6rem 0;
    font-weight: 600;
}

.refund-case-draft-options .refund-case-next__draft-list {
    padding-top: 0.35rem;
}

.refund-case-history {
    border-top: 1px solid var(--brand-border);
    min-width: 0;
}

.refund-case-history .refund-case-activity__list {
    padding-top: 0.65rem;
}

.refund-batch-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.refund-batch-shortcuts .btn {
    white-space: normal;
}

@media (max-width: 767px) {
    .refund-nav {
        gap: 0.2rem;
    }

    .refund-nav a {
        flex: 1 1 calc(33.333% - 0.2rem);
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }

    .refund-selection-toolbar {
        align-items: stretch;
    }

    .refund-selection-toolbar > :first-child,
    .refund-selection-toolbar .btn {
        flex-basis: 100%;
    }

    .refund-select-all:not([hidden]) {
        justify-content: flex-start;
    }

    body.is-backend .admin-table-wrap:has(.refund-worklist-table) {
        max-height: none;
        overflow: visible;
    }

    .refund-worklist-table,
    .refund-worklist-table tbody {
        display: block;
        min-width: 0;
    }

    .refund-worklist-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .refund-worklist-table tr {
        display: block;
        padding: 0.7rem 0;
        border-bottom: 1px solid var(--brand-border);
    }

    body.is-backend .refund-worklist-table td {
        display: grid;
        grid-template-columns: minmax(6rem, 32%) minmax(0, 1fr);
        gap: 0.7rem;
        padding: 0.35rem 0;
        white-space: normal;
        text-align: left;
        border: 0;
    }

    .refund-worklist-table td::before {
        content: attr(data-label);
        color: var(--brand-text-muted);
        font-size: 0.75rem;
        font-weight: 600;
    }

    .refund-worklist-table td[colspan] {
        display: block;
        padding: 1rem 0;
    }

    .refund-worklist-table td[colspan]::before {
        content: none;
    }

    .refund-worklist-table .refund-case-checkbox {
        justify-self: start;
    }

    .refund-worklist-table .status-pill {
        max-width: 100%;
        white-space: normal;
    }

    .refund-next-link {
        align-items: start;
        padding-top: 0.25rem;
    }
}

/* Compact customer history panels on admin enquiry detail (scoped) */
.enquiry-detail-side .enquiry-history-card {
    margin-bottom: 0.85rem;
}

.enquiry-detail-side .enquiry-history-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.55rem;
}

.enquiry-detail-side .enquiry-history-card__head h3 {
    margin: 0;
}

.enquiry-detail-side .enquiry-history-card__view-all {
    font-size: 0.75rem;
    white-space: nowrap;
}

.enquiry-detail-side .enquiry-history-empty {
    margin: 0;
    font-size: 0.875rem;
}

.enquiry-detail-side .enquiry-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.enquiry-detail-side .enquiry-history-item {
    padding: 0.55rem 0;
    border-top: 1px solid var(--border-color, #e5e7eb);
    min-width: 0;
}

.enquiry-detail-side .enquiry-history-item:first-child {
    border-top: none;
    padding-top: 0;
}

.enquiry-detail-side .enquiry-history-item__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem 0.5rem;
}

.enquiry-detail-side .enquiry-history-item__title {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
}

.enquiry-detail-side .enquiry-history-item__subject {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.enquiry-detail-side .enquiry-history-item__meta {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.enquiry-detail-side .enquiry-history-item[data-order-cancelled="1"] .status-pill--cancelled {
    font-weight: 600;
}

@media (max-width: 768px) {
    .enquiry-detail-side .enquiry-history-card__head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Enquiry attachments (composer + message lists) */
.enquiry-attachments {
    margin-bottom: 1rem;
}

.enquiry-attachments__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

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

.enquiry-attachments__help {
    margin: 0.4rem 0 0.55rem;
}

.enquiry-attachments__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.enquiry-attachments__list:empty {
    display: none;
}

.enquiry-attachments__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.65rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.4rem;
    background: #fafafa;
}

.enquiry-attachments__item--existing {
    background: #fff;
}

.enquiry-attachments__item--saved-reply {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.enquiry-attachments__meta {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.55rem;
    align-items: baseline;
}

.enquiry-attachments__name {
    font-weight: 600;
    word-break: break-word;
}

.enquiry-attachments__size,
.enquiry-attachments__badge {
    color: var(--text-muted, #6b7280);
    font-size: 0.875rem;
}

.enquiry-attachments__badge {
    font-weight: 500;
}

.enquiry-attachments__download {
    font-size: 0.875rem;
}

.enquiry-attachments__remove,
.enquiry-attachments__remove-label {
    justify-self: end;
    white-space: nowrap;
}

.enquiry-attachments__remove-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    min-height: 44px;
}

.enquiry-attachments__progress {
    grid-column: 1 / -1;
    height: 0.35rem;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.enquiry-attachments__progress-bar {
    height: 100%;
    width: 0;
    background: #2563eb;
    transition: width 0.15s ease-out;
}

.enquiry-attachments__item-error {
    grid-column: 1 / -1;
    margin: 0;
}

.enquiry-attachments__existing {
    margin-bottom: 0.75rem;
}

.enquiry-message-attachments {
    list-style: none;
    margin: 0.55rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.3rem;
}

.enquiry-message-attachments__item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    font-size: 0.925rem;
}

.enquiry-message-attachments__name {
    word-break: break-word;
}

@media (max-width: 575px) {
    .enquiry-attachments__item {
        grid-template-columns: 1fr;
    }

    .enquiry-attachments__remove,
    .enquiry-attachments__remove-label {
        justify-self: start;
    }

    .enquiry-attachments__remove,
    .enquiry-attachments__controls .btn {
        min-height: 44px;
    }
}

/* Enquiry inbox — Needs Attention */
.enquiry-attention-meta {
    max-width: 52rem;
}

.enquiry-attention-stats {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
}

a.enquiry-attention-stat {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.enquiry-attention-stat:hover,
a.enquiry-attention-stat:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

a.enquiry-attention-stat.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb55;
}

a.enquiry-attention-stat--overdue {
    border-color: #fecaca;
    border-left: 3px solid #b91c1c;
}

a.enquiry-attention-stat--overdue .value {
    color: #991b1b;
}

a.enquiry-attention-stat--overdue.is-active,
a.enquiry-attention-stat--overdue:hover,
a.enquiry-attention-stat--overdue:focus-visible {
    border-color: #b91c1c;
    box-shadow: 0 0 0 2px #b91c1c33;
}

.enquiry-ref-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.enquiry-unread-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #2563eb;
    flex: 0 0 auto;
}

.enquiry-row--unread td:first-child {
    font-weight: 600;
}

.enquiry-unread-label {
    margin-top: 0.2rem;
    color: #1d4ed8;
}

@media (max-width: 575px) {
    .enquiry-attention-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    a.enquiry-attention-stat {
        min-height: 44px;
    }
}

.enquiry-attention-stat__note {
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* ==========================================================================
   Account shell (customer + seller) — Phase 1 shared layout & nav
   Scoped to body.is-account so admin, storefront, checkout, and tokenised
   seller fulfilment pages keep their existing appearance.
   ========================================================================== */

body.is-account {
    --account-sidebar-width: 260px;
    --account-content-max: 56rem;
    --account-form-max: 36rem;
    --account-mobile-bar-height: 4.25rem;
    --account-touch: 2.75rem; /* 44px */
    background: var(--brand-surface);
}

body.is-account .portal-layout--account {
    grid-template-columns: var(--account-sidebar-width) 1fr;
    min-height: calc(100vh - 7.5rem);
    background: var(--brand-surface);
}

body.is-account .portal-sidebar {
    background: var(--brand-white);
    color: var(--brand-text);
    border-right: 1px solid var(--brand-border);
    padding: 1.25rem 0 1.5rem;
    box-shadow: none;
}

body.is-account .portal-sidebar-nav--account {
    padding: 0;
}

body.is-account .portal-sidebar a {
    color: inherit;
}

body.is-account .portal-sidebar a:hover,
body.is-account .portal-sidebar a.active {
    background: transparent;
    color: inherit;
}

body.is-account .portal-content--account {
    padding: 1.5rem 1.5rem 2rem;
    background: var(--brand-surface);
}

body.is-account .account-page {
    max-width: var(--account-content-max);
    margin: 0 auto;
    width: 100%;
}

/* Overview-only: sit beside the sidebar instead of centering in the content column. */
body.is-account .account-page.account-page--overview {
    margin-left: 0;
    margin-right: auto;
}

body.is-account .account-page .page-header {
    margin-bottom: 1.25rem;
}

body.is-account .account-page .page-header h1 {
    font-size: clamp(1.375rem, 2vw, 1.625rem);
    color: var(--brand-footer);
    margin-bottom: 0.35rem;
}

body.is-account .account-page .page-header p {
    font-size: 0.9375rem;
    max-width: 40rem;
}

body.is-account .account-page .page-header--split {
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

body.is-account .account-page .card {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

body.is-account .account-page .card-grid {
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}

body.is-account .account-page .card-grid > * {
    min-width: 0;
}

body.is-account .account-page {
    overflow-wrap: anywhere;
}

body.is-account .account-page .card.table-scroll,
body.is-account .account-page .table-scroll.card {
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.is-account .account-page form .form-grid,
body.is-account .account-page form.account-form-narrow,
body.is-account .account-page .card > form {
    max-width: var(--account-form-max);
}

body.is-account .account-page .form-label {
    font-size: 0.9375rem;
    color: var(--brand-footer);
}

body.is-account .account-page .form-input,
body.is-account .account-page select.form-input,
body.is-account .account-page textarea.form-input {
    font-size: 1rem;
    min-height: var(--account-touch);
    padding: 0.625rem 0.875rem;
    color: var(--brand-text);
    background: var(--brand-white);
}

body.is-account .account-page .form-help,
body.is-account .account-page .form-group .text-muted {
    font-size: 0.875rem;
    color: var(--brand-text-muted);
    margin-top: 0.35rem;
}

body.is-account .account-page .form-error {
    font-size: 0.875rem;
    color: #b91c1c;
    margin-top: 0.35rem;
}

body.is-account .account-page .btn {
    min-height: var(--account-touch);
    font-size: 1rem;
    padding: 0.625rem 1.15rem;
}

body.is-account .account-page .btn-sm {
    min-height: 2.5rem;
    font-size: 0.875rem;
    padding: 0.45rem 0.85rem;
}

body.is-account .account-page .btn-secondary {
    background: var(--brand-white);
    color: var(--brand-text);
    border-color: var(--brand-border);
}

body.is-account .account-page .btn-secondary:hover {
    background: var(--brand-surface);
    color: var(--brand-footer);
}

body.is-account .account-page .btn-danger,
body.is-account .account-page .btn.btn-outline.is-danger {
    color: #b91c1c;
    border-color: #b91c1c;
    background: var(--brand-white);
}

body.is-account .account-page .btn-danger:hover,
body.is-account .account-page .btn.btn-outline.is-danger:hover {
    background: #b91c1c;
    color: #fff;
}

body.is-account .account-page .alert {
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
}

body.is-account .account-page .alert-success {
    border-left: 4px solid #059669;
}

body.is-account .account-page .alert-error,
body.is-account .account-page .alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
}

body.is-account .account-page .empty-state {
    padding: 2rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--brand-border);
    background: var(--brand-white);
    text-align: center;
}

body.is-account .account-page .empty-state p {
    color: var(--brand-text-muted);
    font-weight: 500;
}

body.is-account .account-page .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    border-radius: 999px;
    min-height: 1.5rem;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
}

body.is-account .account-page .status-pill--pending,
body.is-account .account-page .status-pill--awaiting_seller_confirmation,
body.is-account .account-page .status-pill--awaiting_verification {
    border-color: #f59e0b;
}

body.is-account .account-page .status-pill--paid,
body.is-account .account-page .status-pill--seller_accepted,
body.is-account .account-page .status-pill--succeeded,
body.is-account .account-page .status-pill--completed {
    border-color: var(--brand-primary);
}

body.is-account .account-page .status-pill--processing,
body.is-account .account-page .status-pill--partially_delivered {
    border-color: #3b82f6;
}

body.is-account .account-page .status-pill--cancelled,
body.is-account .account-page .status-pill--expired,
body.is-account .account-page .status-pill--failed {
    border-color: #ef4444;
}

body.is-account .account-page .pagination-bar {
    margin-top: 1rem;
    gap: 0.75rem;
}

body.is-account .account-page .pagination-bar-link {
    min-width: 2.5rem;
    min-height: 2.5rem;
}

body.is-account .account-page .back-link,
body.is-account .account-page a.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 0.75rem;
}

body.is-account .account-page .back-link:hover {
    color: var(--brand-primary-dark);
}

body.is-account .account-nav__desktop {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.75rem;
}

body.is-account .account-nav__group {
    margin-top: 0.85rem;
}

body.is-account .account-nav__group-label {
    margin: 0 0 0.35rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

body.is-account .account-nav__link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: var(--account-touch);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--brand-text);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

body.is-account .account-nav__link:hover {
    background: var(--brand-surface);
    color: var(--brand-footer);
}

body.is-account .account-nav__link.is-active {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
    border-color: rgba(0, 166, 81, 0.25);
}

body.is-account .account-nav__icon {
    display: inline-flex;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.9;
}

body.is-account .account-nav__label {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.is-account .account-mobile-bar,
body.is-account .account-sheet,
body.is-account .account-sheet-backdrop {
    display: none;
}

body.is-account .account-page .btn:focus-visible,
body.is-account .account-page .form-input:focus-visible,
body.is-account .account-page a:focus-visible,
body.is-account .account-nav__link:focus-visible,
body.is-account .account-mobile-bar__item:focus-visible,
body.is-account .account-sheet__link:focus-visible,
body.is-account .account-sheet__close:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

@media (max-width: 992px) {
    body.is-account .portal-layout--account {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    /* Keep the account-nav node mounted (fixed mobile bar/sheets live here),
       but collapse the sidebar so it does not consume layout space. */
    body.is-account .portal-sidebar {
        display: block;
        width: 0;
        height: 0;
        padding: 0;
        margin: 0;
        border: 0;
        overflow: visible;
        background: transparent;
    }

    body.is-account .portal-sidebar-nav--account {
        padding: 0;
        overflow: visible;
    }

    body.is-account .account-nav__desktop {
        display: none;
    }

    body.is-account .portal-content--account {
        padding: 1rem 1rem calc(var(--account-mobile-bar-height) + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px)) + 1.75rem);
    }

    body.is-account .account-mobile-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        gap: 0.15rem;
        min-height: calc(var(--account-mobile-bar-height) + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px)));
        padding: 0.35rem 0.35rem calc(0.35rem + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px)));
        background: var(--brand-white);
        border-top: 1px solid var(--brand-border);
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
    }

    body.is-account.account-keyboard-open .account-mobile-bar {
        display: none;
    }

    body.is-account.account-keyboard-open .portal-content--account {
        padding-bottom: 1rem;
    }

    body.is-account .account-mobile-bar__item {
        flex: 1 1 0;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        min-width: 0;
        min-height: var(--account-touch);
        padding: 0.25rem 0.2rem;
        border: 0;
        border-radius: var(--radius);
        background: transparent;
        color: var(--brand-text-muted);
        font: inherit;
        font-size: 0.6875rem;
        font-weight: 700;
        line-height: 1.2;
        text-decoration: none;
        cursor: pointer;
    }

    body.is-account .account-mobile-bar__item.is-active {
        color: var(--brand-primary-dark);
        background: var(--brand-primary-light);
    }

    body.is-account .account-mobile-bar__icon {
        display: inline-flex;
    }

    body.is-account .account-mobile-bar__label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.is-account .account-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: block;
        background: rgba(15, 23, 42, 0.4);
    }

    body.is-account .account-sheet-backdrop[hidden] {
        display: none;
    }

    body.is-account .account-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: flex;
        flex-direction: column;
        max-height: min(80vh, 32rem);
        background: var(--brand-white);
        border-radius: 1rem 1rem 0 0;
        box-shadow: var(--shadow-lg);
        padding: 0.75rem 1rem calc(1rem + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px)));
    }

    body.is-account .account-sheet[hidden] {
        display: none;
    }

    body.is-account .account-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--brand-border);
        margin-bottom: 0.5rem;
    }

    body.is-account .account-sheet__title {
        margin: 0;
        font-size: 1.0625rem;
        color: var(--brand-footer);
    }

    body.is-account .account-sheet__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--account-touch);
        height: var(--account-touch);
        border: 1px solid var(--brand-border);
        border-radius: var(--radius);
        background: var(--brand-white);
        color: var(--brand-text);
        cursor: pointer;
    }

    body.is-account .account-sheet__body {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    body.is-account .account-sheet__link {
        display: flex;
        align-items: center;
        min-height: var(--account-touch);
        padding: 0.65rem 0.75rem;
        border-radius: var(--radius);
        border: 1px solid transparent;
        color: var(--brand-text);
        font-size: 1rem;
        font-weight: 600;
        text-decoration: none;
        background: transparent;
        width: 100%;
        text-align: left;
        cursor: pointer;
        font-family: inherit;
    }

    body.is-account .account-sheet__link:hover {
        background: var(--brand-surface);
    }

    body.is-account .account-sheet__link.is-active {
        background: var(--brand-primary-light);
        color: var(--brand-primary-dark);
        border-color: rgba(0, 166, 81, 0.25);
    }

    body.is-account .account-sheet__sign-out {
        margin: 0.35rem 0 0;
        padding-top: 0.35rem;
        border-top: 1px solid var(--brand-border);
    }

    body.is-account .account-sheet__link--action {
        color: #b91c1c;
    }

    body.is-account.account-sheet-open {
        overflow: hidden;
    }
}

.assisted-order {
    max-width: 880px;
}

.assisted-order-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.assisted-order-steps li {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.assisted-order-steps li.is-current {
    background: var(--brand-primary-light);
    border-color: rgba(0, 166, 81, 0.35);
    color: var(--brand-primary-dark);
}

.assisted-order-steps li.is-done {
    color: var(--brand-text);
}

.assisted-order-panel {
    margin-bottom: 1rem;
}

.assisted-order-search {
    display: grid;
    gap: 0.5rem;
}

.assisted-order-results {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.assisted-order-result,
.assisted-order-lines li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--brand-border);
}

.assisted-order-result-actions,
.assisted-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.assisted-order-actions {
    margin-top: 1rem;
}

.assisted-order-lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.assisted-order-totals,
.assisted-order-totals-stack {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
}

.assisted-order-totals-stack {
    flex-direction: column;
}

.assisted-order-totals.is-total {
    font-size: 1.0625rem;
}

.assisted-order-address-summary h4 {
    margin: 1rem 0 0.35rem;
    font-size: 0.9375rem;
}

.assisted-order-saved-address {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
}

.assisted-order [data-assisted-custom-address][hidden],
.assisted-order [data-assisted-saved-address][hidden] {
    display: none !important;
}

.assisted-order-add-form {
    margin-top: 0.85rem;
}

@media (max-width: 768px) {
    .assisted-order-result,
    .assisted-order-lines li,
    .assisted-order-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .assisted-order-actions .btn,
    .assisted-order-result-actions .btn,
    .assisted-order-lines .btn {
        width: 100%;
        min-height: 44px;
    }

    .order-header-actions {
        flex-wrap: wrap;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.is-account .account-nav__link,
    body.is-account .account-mobile-bar__item,
    body.is-account .account-sheet,
    body.is-account .account-page .btn,
    body.is-account .account-page .card {
        transition: none !important;
    }
}

/* Phase 3: seller listings, sales, collection cards and progress */
body.is-account .account-page .account-card-list {
    display: grid;
    gap: 0.85rem;
}

body.is-account .account-page .account-entity-card {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
    min-width: 0;
}

body.is-account .account-page .account-entity-card.is-attention {
    border-color: #f59e0b;
}

body.is-account .account-page .account-entity-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

body.is-account .account-page .account-entity-card__title {
    margin: 0 0 0.25rem;
    font-size: 1.0625rem;
    color: var(--brand-footer);
}

body.is-account .account-page .account-entity-card__meta,
body.is-account .account-page .account-entity-card__note {
    margin: 0 0 0.4rem;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .account-entity-card__attention {
    margin: 0 0 0.65rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
}

body.is-account .account-page .account-entity-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

body.is-account .account-page .account-entity-card__text-link {
    min-height: var(--account-touch);
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

body.is-account .account-page .account-section-title {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
    color: var(--brand-footer);
}

body.is-account .account-page .account-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

body.is-account .account-page .account-filter-tabs__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--account-touch);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--brand-border);
    background: var(--brand-white);
    color: var(--brand-text);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

body.is-account .account-page .account-filter-tabs__link.is-active {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
    border-color: rgba(0, 166, 81, 0.25);
}

body.is-account .account-page .seller-progress {
    margin: 0.5rem 0 0.75rem;
}

body.is-account .account-page .seller-progress__steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.is-account .account-page .seller-progress--desktop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
}

body.is-account .account-page .seller-progress--mobile {
    display: none;
}

body.is-account .account-page .seller-progress--desktop .seller-progress__step {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    gap: 0.35rem;
}

body.is-account .account-page .seller-progress--desktop .seller-progress__step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0.55rem;
    left: calc(50% + 0.7rem);
    right: calc(-50% + 0.7rem);
    height: 2px;
    background: #d1d5db;
}

body.is-account .account-page .seller-progress--desktop .seller-progress__step.is-completed:not(:last-child)::after,
body.is-account .account-page .seller-progress--desktop .seller-progress__step.is-current:not(:last-child)::after {
    background: var(--brand-primary);
}

body.is-account .account-page .seller-progress__marker {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    background: var(--brand-white);
    flex-shrink: 0;
    z-index: 1;
}

body.is-account .account-page .seller-progress__step.is-completed .seller-progress__marker,
body.is-account .account-page .seller-progress__step.is-current .seller-progress__marker {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
}

body.is-account .account-page .seller-progress__step.is-cancelled .seller-progress__marker {
    border-color: #ef4444;
    background: #ef4444;
}

body.is-account .account-page .seller-progress__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    line-height: 1.3;
}

body.is-account .account-page .seller-progress__step.is-current .seller-progress__label,
body.is-account .account-page .seller-progress__step.is-completed .seller-progress__label {
    color: var(--brand-footer);
}

body.is-account .account-page .seller-progress__toggle {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-height: var(--account-touch);
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

body.is-account .account-page .seller-progress__toggle-kicker,
body.is-account .account-page .seller-progress__toggle-hint {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

body.is-account .account-page .seller-progress__toggle-label {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--brand-footer);
}

body.is-account .account-page .seller-progress__steps--stacked {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

body.is-account .account-page .seller-progress__steps--stacked[hidden] {
    display: none !important;
}

body.is-account .account-page .seller-progress__steps--stacked .seller-progress__step {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

@media (max-width: 991px) {
    body.is-account .account-page .seller-progress--desktop {
        display: none;
    }

    body.is-account .account-page .seller-progress--mobile {
        display: block;
    }

    body.is-account .account-page .account-entity-card__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.is-account .account-page .seller-progress__toggle,
    body.is-account .account-page .account-entity-card,
    body.is-account .account-page .account-filter-tabs__link {
        transition: none !important;
    }
}

/* Admin ops dashboard */
.admin-dashboard-section {
    margin-top: 0.25rem;
}

.admin-dashboard-section__header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.admin-dashboard-section__header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.admin-dashboard-period-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-end;
}

.admin-dashboard-custom-dates.is-hidden {
    display: none;
}

.admin-dashboard-stat--refunds .label {
    color: #9a3412;
}

.admin-dashboard-trend__header h3 {
    margin: 0 0 0.2rem;
}

.admin-dashboard-trend__empty-note {
    margin: 0.35rem 0 0.75rem;
}

.admin-dashboard-trend__no-sales {
    margin: 0.5rem 0 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.4rem;
    background: #f9fafb;
}

.admin-dashboard-trend__no-sales-title {
    margin: 0;
    color: #374151;
    font-weight: 600;
}

.admin-dashboard-trend__no-sales-meta {
    margin: 0.35rem 0 0;
    color: #4b5563;
}

.admin-dashboard-stat-value--unavailable {
    color: #6b7280;
    font-weight: 600;
}

body.is-backend .stat-card .value.admin-dashboard-stat-value--unavailable {
    color: #6b7280;
}

.admin-dashboard-trend-chart {
    position: relative;
    width: 100%;
    height: 300px;
    max-width: 100%;
    overflow: hidden;
}

.admin-dashboard-trend-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.admin-dashboard-trend-plot {
    fill: #f8fafc;
    cursor: crosshair;
    touch-action: manipulation;
}

.admin-dashboard-trend-grid {
    stroke: #e5e7eb;
    stroke-width: 1;
    pointer-events: none;
}

.admin-dashboard-trend-area {
    fill: rgba(37, 99, 235, 0.12);
    pointer-events: none;
}

.admin-dashboard-trend-line {
    stroke: #2563eb;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.admin-dashboard-trend-axis-label,
.admin-dashboard-trend-axis-title {
    pointer-events: none;
}

.admin-dashboard-trend-point {
    fill: #ffffff;
    stroke: #2563eb;
    stroke-width: 2;
    cursor: pointer;
    outline: none;
    pointer-events: auto;
}

.admin-dashboard-trend-point:focus-visible,
.admin-dashboard-trend-point.is-active {
    fill: #2563eb;
    stroke: #1e3a8a;
    stroke-width: 2.5;
}

.admin-dashboard-trend-axis-label,
.admin-dashboard-trend-axis-title {
    fill: #6b7280;
    font-size: 11px;
}

.admin-dashboard-trend-axis-title {
    font-size: 12px;
}

.admin-dashboard-trend-tooltip {
    position: absolute;
    left: 0;
    top: 0;
    transform: none;
    background: #111827;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 0.4rem 0.55rem;
    border-radius: 0.35rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
    max-width: min(90%, 22rem);
    box-sizing: border-box;
}

.admin-dashboard-trend-tooltip[data-placement="below"] {
    /* Placement is fully controlled in JS; class retained for tests/hooks. */
}

.admin-dashboard-trend-breakdown {
    margin-top: 0.85rem;
}

.admin-dashboard-trend-breakdown summary {
    cursor: pointer;
    font-weight: 600;
}

.admin-dashboard-trend-breakdown__table-wrap {
    margin-top: 0.65rem;
    max-height: 16rem;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.4rem;
}

.admin-dashboard-trend-breakdown__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-dashboard-trend-breakdown__table th,
.admin-dashboard-trend-breakdown__table td {
    padding: 0.45rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-dashboard-trend-breakdown__table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
}

@media (max-width: 767px) {
    .admin-dashboard-trend-chart {
        height: 240px;
    }

    .admin-dashboard-trend-tooltip {
        white-space: normal;
    }
}

.admin-dashboard-source-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.admin-dashboard-source-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.admin-dashboard-empty {
    padding: 1rem 1.1rem;
}

.admin-dashboard-clear-queues summary {
    cursor: pointer;
    font-weight: 600;
}

.admin-dashboard-clear-list {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.admin-dashboard-clear-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Action required — severity (do not use brand-green for exception counts) */
.admin-dashboard-action-required--compact {
    margin-top: 1rem;
    padding: 0.85rem 0 0.15rem;
    border-top: 1px solid #e5e7eb;
}

ul.admin-dashboard-queues {
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.75rem;
}

.admin-dashboard-queue-item {
    display: flex;
    min-width: 0;
}

.admin-dashboard-queue-item > a.admin-dashboard-queue {
    flex: 1 1 auto;
    width: 100%;
}

a.admin-dashboard-queue {
    border: 1px solid #e5e7eb;
    border-radius: 0.4rem;
    min-height: 2.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

a.admin-dashboard-queue:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

a.admin-dashboard-queue .label {
    color: #374151;
    font-weight: 600;
}

a.admin-dashboard-queue .item-meta,
a.admin-dashboard-queue .enquiry-attention-stat__note {
    color: #4b5563;
}

a.admin-dashboard-queue--urgent {
    border-color: #fecaca;
    border-left: 3px solid #b91c1c;
    background: #fffafa;
}

a.admin-dashboard-queue--urgent .value {
    color: #991b1b;
}

a.admin-dashboard-queue--urgent:hover,
a.admin-dashboard-queue--urgent:focus-visible {
    border-color: #b91c1c;
    box-shadow: 0 0 0 2px #b91c1c33;
}

a.admin-dashboard-queue--attention {
    border-color: #fde68a;
    border-left: 3px solid #d97706;
    background: #fffbeb;
}

a.admin-dashboard-queue--attention .value {
    color: #92400e;
}

a.admin-dashboard-queue--attention:hover,
a.admin-dashboard-queue--attention:focus-visible {
    border-color: #d97706;
    box-shadow: 0 0 0 2px #d9770633;
}

a.admin-dashboard-queue--ordinary {
    border-left: 3px solid #9ca3af;
    background: #fff;
}

a.admin-dashboard-queue--ordinary .value {
    color: #111827;
}

a.admin-dashboard-queue--ordinary:hover,
a.admin-dashboard-queue--ordinary:focus-visible {
    border-color: #6b7280;
    box-shadow: 0 0 0 2px #6b728033;
}

.admin-dashboard-queue__oldest-when {
    display: inline;
    white-space: nowrap;
}

.admin-dashboard-analytics-diagnostics {
    margin-top: 0.75rem;
}

.admin-dashboard-analytics-diagnostics summary {
    cursor: pointer;
    font-weight: 600;
    color: #374151;
}

.admin-dashboard-analytics-diagnostics summary:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

.admin-dashboard-diagnostics-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

/* Sales / visitor metric cards — consistent denser grid on dashboard */
.admin-dashboard-stats .stat-card .label {
    color: #4b5563;
}

.admin-dashboard-stats .stat-card .item-meta {
    color: #6b7280;
}

@media (max-width: 1024px) {
    .admin-dashboard-queues {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
    }
}

@media (max-width: 767px) {
    .admin-dashboard-action-required--compact {
        padding-top: 0.75rem;
    }

    a.admin-dashboard-queue .admin-dashboard-queue__oldest-when {
        display: block;
        white-space: normal;
        margin-top: 0.1rem;
    }
}

@media (max-width: 575px) {
    .admin-dashboard-period-form {
        width: 100%;
    }

    .admin-dashboard-period-form .admin-toolbar-field,
    .admin-dashboard-period-form .admin-toolbar-actions {
        width: 100%;
    }

    .admin-dashboard-period-form .form-input,
    .admin-dashboard-period-form .btn {
        width: 100%;
    }

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

    a.admin-dashboard-queue {
        min-height: 44px;
    }
}

@media (max-width: 374px) {
    .admin-dashboard-queues {
        grid-template-columns: 1fr;
    }
}


/* Account buyer orders — Phase 2 (scoped) */
body.is-account .account-page .buyer-order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.is-account .account-page .buyer-order-card {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: #fff;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

body.is-account .account-page .buyer-order-card__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.55rem 1rem;
}

body.is-account .account-page .buyer-order-card__identity {
    flex: 1 1 12rem;
    min-width: 0;
}

body.is-account .account-page .buyer-order-card__title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

body.is-account .account-page .buyer-order-card__title a {
    color: inherit;
    text-decoration: none;
}

body.is-account .account-page .buyer-order-card__title a:hover,
body.is-account .account-page .buyer-order-card__title a:focus-visible {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

body.is-account .account-page .buyer-order-card__meta,
body.is-account .account-page .buyer-order-card__fulfilment,
body.is-account .account-page .buyer-order-card__book-title,
body.is-account .account-page .buyer-order-card__book-more,
body.is-account .account-page .buyer-order-detail__summary {
    margin: 0.2rem 0 0;
    color: var(--brand-muted, #5b6470);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

body.is-account .account-page .buyer-order-card__financial {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 0 1 auto;
}

body.is-account .account-page .buyer-order-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

body.is-account .account-page .buyer-order-card__total-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

body.is-account .account-page .buyer-order-card__books {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

body.is-account .account-page .buyer-order-card__previews {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

body.is-account .account-page .buyer-order-card__preview {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

body.is-account .account-page .buyer-order-card__cover,
body.is-account .account-page .buyer-book-card__cover {
    width: 40px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--brand-surface, #f4f6f8);
    border: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-muted, #5b6470);
    flex: 0 0 auto;
}

body.is-account .account-page .buyer-book-card__cover {
    width: 72px;
    height: 96px;
}

body.is-account .account-page .buyer-order-card__cover img,
body.is-account .account-page .buyer-book-card__cover img,
body.is-account .account-page .buyer-order-card__cover-fallback,
body.is-account .account-page .buyer-book-card__cover-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.is-account .account-page .buyer-order-card__cover-fallback,
body.is-account .account-page .buyer-book-card__cover-fallback {
    background: linear-gradient(145deg, #e8eef2, #f7fafc);
}

body.is-account .account-page .buyer-order-card__book-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: var(--brand-text);
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.is-account .account-page .buyer-order-card__book-more {
    margin: 0;
}

body.is-account .account-page .buyer-order-card__fulfilment {
    margin: 0;
}

body.is-account .account-page .buyer-order-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body.is-account .account-page .buyer-order-card__actions .btn,
body.is-account .account-page .buyer-order-next-action .btn,
body.is-account .account-page .buyer-book-card__tracking .btn {
    min-height: var(--account-touch, 44px);
}

/* Keep final order actions clear of the fixed mobile account bar. */
@media (max-width: 991.98px) {
    body.is-account .account-page .buyer-order-list,
    body.is-account .account-page .buyer-order-detail {
        padding-bottom: calc(
            0.75rem
            + var(--account-mobile-bar-height, 4.25rem)
            + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px))
        );
    }

    body.is-account .account-page .buyer-order-card__actions .btn,
    body.is-account .account-page .buyer-order-next-action .btn,
    body.is-account .account-page .buyer-order-progress__summary,
    body.is-account .account-page a.btn {
        scroll-margin-bottom: calc(
            0.75rem
            + var(--account-mobile-bar-height, 4.25rem)
            + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px))
        );
    }
}

body.is-account .account-page .buyer-orders-empty {
    text-align: left;
    padding: 1.5rem 0;
}

body.is-account .account-page .buyer-order-next-action {
    margin-bottom: 1rem;
    border-color: rgba(0, 166, 81, 0.35);
    background: var(--brand-primary-light, #eefbf3);
}

body.is-account .account-page .buyer-order-next-action__title,
body.is-account .account-page .buyer-order-section-title,
body.is-account .account-page .buyer-book-card__title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

body.is-account .account-page .buyer-order-books {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

body.is-account .account-page .buyer-book-card__top {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

body.is-account .account-page .buyer-book-card__info {
    min-width: 0;
    flex: 1;
}

body.is-account .account-page .buyer-book-card__title a {
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}

body.is-account .account-page .buyer-book-card__title a:hover,
body.is-account .account-page .buyer-book-card__title a:focus-visible {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

body.is-account .account-page .buyer-book-card__meta,
body.is-account .account-page .buyer-book-card__cancelled-note {
    margin: 0.25rem 0 0.5rem;
    color: var(--brand-muted, #5b6470);
}

body.is-account .account-page .buyer-order-progress {
    margin: 0.35rem 0 0.5rem;
}

body.is-account .account-page .buyer-order-progress__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

body.is-account .account-page .buyer-order-progress__step {
    display: grid;
    grid-template-columns: 1.25rem 1fr;
    gap: 0.55rem;
    align-items: start;
    color: var(--brand-muted, #5b6470);
}

body.is-account .account-page .buyer-order-progress__step--completed {
    color: var(--brand-primary-dark, #0f7a3f);
}

body.is-account .account-page .buyer-order-progress__step--current {
    color: var(--brand-text);
    font-weight: 700;
}

body.is-account .account-page .buyer-order-progress__step--cancelled {
    color: #b91c1c;
    font-weight: 700;
}

body.is-account .account-page .buyer-order-progress__marker {
    width: 1.25rem;
    text-align: center;
    line-height: 1.4;
}

body.is-account .account-page .buyer-order-progress__label {
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body.is-account .account-page .buyer-order-progress__summary {
    width: 100%;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface, #f7fafc);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

body.is-account .account-page .buyer-order-progress__summary:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

body.is-account .account-page .buyer-order-progress__summary-label,
body.is-account .account-page .buyer-order-progress__summary-hint {
    font-size: 0.8rem;
    color: var(--brand-muted, #5b6470);
}

body.is-account .account-page .buyer-order-progress__summary-value {
    font-weight: 700;
}

body.is-account .account-page .buyer-order-progress--mobile {
    display: none;
}

body.is-account .account-page .buyer-book-card__tracking {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--brand-border);
}

body.is-account .account-page .status-pill--paid,
body.is-account .account-page .status-pill--success {
    border-color: rgba(0, 166, 81, 0.35);
}

body.is-account .account-page .status-pill--pending,
body.is-account .account-page .status-pill--processing,
body.is-account .account-page .status-pill--warning {
    border-color: rgba(180, 120, 20, 0.35);
}

body.is-account .account-page .status-pill--cancelled,
body.is-account .account-page .status-pill--danger,
body.is-account .account-page .status-pill--failed {
    border-color: rgba(185, 28, 28, 0.35);
}

@media (max-width: 991.98px) {
    body.is-account .account-page .buyer-order-progress--desktop {
        display: none;
    }

    body.is-account .account-page .buyer-order-progress--mobile {
        display: block;
    }

    body.is-account .account-page .buyer-order-card__financial {
        width: 100%;
    }

    body.is-account .account-page .buyer-order-card {
        padding: 0.85rem 0.9rem;
        gap: 0.65rem;
    }
}

@media (min-width: 768px) {
    body.is-account .account-page .buyer-order-progress--desktop .buyer-order-progress__steps {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.5rem;
    }

    body.is-account .account-page .buyer-order-progress--desktop .buyer-order-progress__step {
        grid-template-columns: 1fr;
        justify-items: start;
        position: relative;
    }
}

/* Phase 4: customer Overview dashboard */
body.is-account .account-page .account-overview {
    display: grid;
    gap: 1.25rem;
}

body.is-account .account-page .account-overview__welcome {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem 1.25rem;
}

body.is-account .account-page .account-overview__welcome-lead {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--brand-footer);
}

body.is-account .account-page .account-overview__primary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
    margin-bottom: 1rem;
}

body.is-account .account-page .account-overview__primary-actions .btn {
    min-width: 9.5rem;
    justify-content: center;
}

body.is-account .account-page .account-overview__welcome-note {
    margin: 0 0 0.85rem;
    font-size: 0.9375rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .account-overview__secondary-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

body.is-account .account-page .account-overview__text-link {
    min-height: var(--account-touch);
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--brand-primary-dark);
    text-decoration: none;
}

body.is-account .account-page .account-overview__text-link:hover,
body.is-account .account-page .account-overview__text-link:focus-visible {
    text-decoration: underline;
}

body.is-account .account-page .account-overview__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.65rem;
}

body.is-account .account-page .account-overview__heading .account-section-title {
    margin: 0;
}

body.is-account .account-page .account-overview__view-all,
body.is-account .account-page .account-overview__link {
    min-height: var(--account-touch);
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

body.is-account .account-page .account-overview__overflow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin: 0.65rem 0 0;
}

body.is-account .account-page .account-overview__empty {
    background: var(--brand-white);
    border: 1px dashed var(--brand-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
}

body.is-account .account-page .account-overview__empty p {
    margin: 0 0 0.65rem;
}

body.is-account .account-page .account-overview__empty p:last-child {
    margin-bottom: 0;
}

body.is-account .account-page .account-overview__activity,
body.is-account .account-page .account-overview__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

body.is-account .account-page .account-overview__activity-link,
body.is-account .account-page .account-overview__link {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-white);
    text-decoration: none;
    color: inherit;
}

body.is-account .account-page .account-overview__activity-link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

body.is-account .account-page .account-overview__activity-title {
    font-weight: 700;
    color: var(--brand-footer);
}

body.is-account .account-page .account-overview__activity-detail {
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .account-overview .account-entity-card--sale-overview .seller-progress--desktop {
    display: flex;
}

body.is-account .account-page .account-overview .account-entity-card--sale-overview .seller-progress--mobile {
    display: none;
}

body.is-account .account-page .account-entity-card__alert {
    margin: 0.35rem 0 0.15rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius);
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.4;
}

body.is-account .account-page .account-sale-overview__details {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.55rem;
}

body.is-account .account-page .account-sale-overview__group {
    min-width: 0;
}

body.is-account .account-page .account-sale-overview__group-label {
    margin: 0 0 0.2rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

body.is-account .account-page .account-entity-card--sale-overview .seller-progress__label {
    font-size: 0.6875rem;
}

body.is-account .account-page .account-entity-card--sale-overview .seller-progress--expanded .seller-progress__steps--stacked {
    margin-top: 0;
}

body.is-account .account-page .account-card-list--compact {
    gap: 0.7rem;
}

@media (min-width: 768px) {
    body.is-account .account-page .account-sale-overview__details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem 1.25rem;
        align-items: start;
    }
}

@media (max-width: 991px) {
    body.is-account .account-page .account-overview .account-entity-card--sale-overview .seller-progress--desktop {
        display: none;
    }

    body.is-account .account-page .account-overview .account-entity-card--sale-overview .seller-progress--mobile {
        display: block;
    }

    body.is-account .account-page .account-entity-card--sale-overview .seller-progress__steps--stacked .seller-progress__label {
        font-size: 0.8125rem;
    }
}

body.is-account .account-page .buyer-order-progress {
    margin: 0.35rem 0 0.5rem;
}

body.is-account .account-page .buyer-order-progress__steps {
    list-style: none;
    margin: 0.55rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

body.is-account .account-page .buyer-order-progress__step {
    display: grid;
    grid-template-columns: 1.25rem 1fr;
    gap: 0.55rem;
    align-items: start;
    color: var(--brand-text-muted);
}

body.is-account .account-page .buyer-order-progress__step--completed {
    color: var(--brand-primary-dark);
}

body.is-account .account-page .buyer-order-progress__step--current {
    color: var(--brand-text);
    font-weight: 700;
}

body.is-account .account-page .buyer-order-progress__step--cancelled {
    color: #b91c1c;
    font-weight: 700;
}

body.is-account .account-page .buyer-order-progress__marker {
    width: 1.25rem;
    text-align: center;
    line-height: 1.4;
}

body.is-account .account-page .buyer-order-progress__label {
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body.is-account .account-page .buyer-order-progress__summary {
    width: 100%;
    min-height: var(--account-touch);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

body.is-account .account-page .buyer-order-progress__summary:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

body.is-account .account-page .buyer-order-progress__summary-label,
body.is-account .account-page .buyer-order-progress__summary-hint {
    font-size: 0.8rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .buyer-order-progress__summary-value {
    font-weight: 700;
}

@media (max-width: 991px) {
    body.is-account .account-page .account-overview__section--priority {
        order: 0;
    }

    body.is-account .account-page .account-overview {
        gap: 1rem;
    }

    body.is-account .account-page .account-overview__primary-actions {
        flex-direction: column;
    }

    body.is-account .account-page .account-overview__primary-actions .btn {
        width: 100%;
        min-width: 0;
    }

    body.is-account .account-page .account-overview__secondary-links {
        flex-direction: column;
        gap: 0.15rem;
    }
}

@media (min-width: 768px) {
    body.is-account .account-page .account-overview__links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    body.is-account .account-page .account-overview__links {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    body.is-account .account-page .account-overview__link,
    body.is-account .account-page .account-overview__activity-link,
    body.is-account .account-page .buyer-order-progress__summary {
        transition: none !important;
    }
}

/* Account UI Phase 5 — enquiries & book requests */
@media (max-width: 991px) {
    body.is-account .account-page .account-card-list {
        padding-bottom: 1rem;
    }

    body.is-account .account-page .page-header--split .btn {
        width: 100%;
    }
}

body.is-account .account-page .enquiry-detail--account {
    display: grid;
    gap: 1rem;
    padding-bottom: calc(var(--account-bottom-clearance, 5.5rem) + 1rem);
}

body.is-account .account-page .enquiry-detail__meta,
body.is-account .account-page .book-request-detail__meta {
    margin: 0.25rem 0 0;
    color: var(--brand-text-muted);
}

body.is-account .account-page .enquiry-detail__context {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9375rem;
}

body.is-account .account-page .enquiry-detail__context p {
    margin: 0;
}

body.is-account .account-page .enquiry-thread {
    display: grid;
    gap: 0.85rem;
}

body.is-account .account-page .enquiry-message {
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid #e5e7eb;
    background: var(--brand-white);
    overflow-wrap: anywhere;
}

body.is-account .account-page .enquiry-message--you {
    border-color: #c7d7f0;
    background: #f5f8fc;
}

body.is-account .account-page .enquiry-message--staff {
    border-color: #e5e7eb;
    background: #fafafa;
}

body.is-account .account-page .enquiry-message__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin: 0 0 0.45rem;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .enquiry-message__author {
    font-weight: 700;
    color: var(--brand-footer);
}

body.is-account .account-page .enquiry-message__body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

body.is-account .account-page .enquiry-message-attachments__name {
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.is-account .account-page .enquiry-reply-composer {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: var(--brand-white);
}

body.is-account .account-page .enquiry-reply-composer__hint,
body.is-account .account-page .enquiry-reply-composer__notice {
    margin: 0;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .enquiry-reply-composer .btn-primary {
    min-height: var(--account-touch);
    width: 100%;
}

body.is-account .account-page .enquiry-confirmation__reference,
body.is-account .account-page .enquiry-confirmation__note {
    margin: 0 0 0.75rem;
}

body.is-account .account-page .enquiry-create-form {
    max-width: 40rem;
    display: grid;
    gap: 0.75rem;
}

body.is-account .account-page .book-request-detail {
    display: grid;
    gap: 1rem;
    padding-bottom: calc(var(--account-bottom-clearance, 5.5rem) + 1rem);
}

@media (max-width: 991px) {
    body.is-account .account-page .book-request-detail {
        /* Extra clearance so stacked actions can scroll above the mobile bar. */
        padding-bottom: calc(var(--account-mobile-bar-height, 4.25rem) + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px)) + 6rem);
    }

    body.is-account .account-page .book-request-detail .account-entity-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    body.is-account .account-page .book-request-detail .account-entity-card__actions .btn {
        width: 100%;
        justify-content: center;
    }

    body.is-account .account-page .enquiry-detail--account {
        padding-bottom: calc(var(--account-mobile-bar-height, 4.25rem) + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px)) + 6rem);
    }
}

body.is-account .account-page .book-request-detail__resolution,
body.is-account .account-page .book-request-detail__outcome-note {
    margin: 0.65rem 0 0;
    overflow-wrap: anywhere;
}

/* My book requests — self-contained tiles (scoped) */
body.is-account .account-page .book-requests-page__list,
body.is-account .account-page .book-requests-page__empty,
body.is-account .account-page .book-requests-page__pagination {
    padding-bottom: 0.5rem;
}

body.is-account .account-page .book-request-tile {
    display: grid;
    gap: 0.85rem;
}

body.is-account .account-page .book-request-tile__header {
    align-items: flex-start;
    gap: 0.75rem;
}

body.is-account .account-page .book-request-tile__heading {
    min-width: 0;
    flex: 1 1 auto;
}

body.is-account .account-page .book-request-tile__title {
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

body.is-account .account-page .book-request-tile__meta {
    margin: 0.35rem 0 0;
    overflow-wrap: anywhere;
}

body.is-account .account-page .book-request-tile__progress {
    margin: 0;
}

body.is-account .account-page .book-request-tile__details {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
}

body.is-account .account-page .book-request-tile__details p {
    margin: 0;
}

body.is-account .account-page .book-request-tile__resolution,
body.is-account .account-page .book-request-tile__outcome-note {
    margin-top: 0.25rem;
}

body.is-account .account-page .book-request-tile__actions {
    flex-wrap: wrap;
}

body.is-account .account-page .request-progress--always-expanded .request-progress--mobile {
    display: none;
}

@media (max-width: 991px) {
    body.is-account .account-page .book-requests-page__list,
    body.is-account .account-page .book-requests-page__empty,
    body.is-account .account-page .book-requests-page__pagination,
    body.is-account .account-page .book-request-detail {
        padding-bottom: calc(
            var(--account-mobile-bar-height, 4.25rem)
            + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px))
            + 6rem
        );
    }

    body.is-account .account-page .book-request-tile__actions {
        flex-direction: column;
        align-items: stretch;
    }

    body.is-account .account-page .book-request-tile__actions .btn {
        width: 100%;
        justify-content: center;
    }

    body.is-account .account-page .request-progress--always-expanded .request-progress--desktop {
        display: none;
    }

    body.is-account .account-page .request-progress--always-expanded .request-progress--mobile {
        display: grid;
        gap: 0.55rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }
}

body.is-account .account-page .request-progress {
    margin: 0.25rem 0 0.5rem;
}

body.is-account .account-page .request-progress--desktop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

body.is-account .account-page .request-progress--mobile {
    display: none;
}

body.is-account .account-page .request-progress--desktop .request-progress__step {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    gap: 0.35rem;
}

body.is-account .account-page .request-progress--desktop .request-progress__step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0.55rem;
    left: calc(50% + 0.7rem);
    right: calc(-50% + 0.7rem);
    height: 2px;
    background: #d1d5db;
}

body.is-account .account-page .request-progress--desktop .request-progress__step.is-completed:not(:last-child)::after,
body.is-account .account-page .request-progress--desktop .request-progress__step.is-current:not(:last-child)::after {
    background: var(--brand-primary);
}

body.is-account .account-page .request-progress__marker {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    background: var(--brand-white);
    flex-shrink: 0;
    z-index: 1;
}

body.is-account .account-page .request-progress__step.is-completed .request-progress__marker,
body.is-account .account-page .request-progress__step.is-current .request-progress__marker {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
}

body.is-account .account-page .request-progress__step.is-failed .request-progress__marker {
    border-color: #b91c1c;
    background: #b91c1c;
}

body.is-account .account-page .request-progress__step.is-failed .request-progress__label {
    color: #991b1b;
    font-weight: 600;
}

body.is-account .account-page .request-progress__label {
    font-size: 0.8125rem;
    line-height: 1.3;
    color: var(--brand-text-muted);
    overflow-wrap: anywhere;
}

body.is-account .account-page .request-progress__step.is-current .request-progress__label,
body.is-account .account-page .request-progress__step.is-completed .request-progress__label {
    color: var(--brand-footer);
    font-weight: 600;
}

body.is-account .account-page .request-progress__toggle {
    width: 100%;
    min-height: var(--account-touch);
    display: grid;
    gap: 0.15rem;
    text-align: left;
    padding: 0.7rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    background: var(--brand-white);
    cursor: pointer;
}

body.is-account .account-page .request-progress__toggle-kicker,
body.is-account .account-page .request-progress__toggle-hint {
    font-size: 0.75rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .request-progress__toggle-label {
    font-weight: 700;
    color: var(--brand-footer);
}

body.is-account .account-page .request-progress__steps--stacked {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

body.is-account .account-page .request-progress__steps--stacked[hidden] {
    display: none !important;
}

body.is-account .account-page .request-progress__steps--stacked .request-progress__step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
    align-items: start;
}

@media (max-width: 991px) {
    body.is-account .account-page .request-progress--desktop {
        display: none;
    }

    body.is-account .account-page .request-progress--mobile {
        display: block;
    }

    /* Keep the composer in normal flow so conversation attachments remain clickable.
       Bottom padding on .enquiry-detail--account clears the mobile account bar. */
    body.is-account .account-page .enquiry-reply-composer {
        position: relative;
        z-index: 1;
    }
}

/* ==========================================================================
   Account settings — Phase 6 (profile, address, cards, bank)
   ========================================================================== */

body.is-account .account-page .account-settings-stack {
    display: grid;
    gap: 1rem;
    max-width: var(--account-form-max);
}

body.is-account .account-page .account-settings-panel {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.15rem 1.25rem;
}

body.is-account .account-page .account-settings-panel__title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    color: var(--brand-footer);
}

body.is-account .account-page .account-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-bottom: 0.25rem;
}

body.is-account .account-page .account-error-summary ul {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
}

body.is-account .account-page .account-error-summary a {
    color: inherit;
    text-decoration: underline;
}

body.is-account .account-page .form-required,
body.is-account .account-page .form-optional {
    font-weight: 400;
    color: var(--brand-text-muted);
    font-size: 0.875rem;
}

body.is-account .account-page .form-input.is-invalid {
    border-color: #b91c1c;
}

body.is-account .account-page .account-settings-summary {
    display: grid;
    gap: 0.65rem;
    margin: 0.75rem 0 0;
}

body.is-account .account-page .account-settings-summary dt {
    font-size: 0.8rem;
    color: var(--brand-text-muted);
    margin: 0;
}

body.is-account .account-page .account-settings-summary dd {
    margin: 0.15rem 0 0;
    color: var(--brand-footer);
    font-weight: 600;
}

body.is-account .account-page .account-settings-shortcut-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

body.is-account .account-page .account-settings-shortcut-list a {
    display: flex;
    align-items: center;
    min-height: var(--account-touch);
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--brand-border);
    border-radius: 0.65rem;
    background: var(--brand-white);
    color: var(--brand-footer);
    text-decoration: none;
    font-weight: 600;
}

body.is-account .account-page .account-settings-shortcut-list a:hover,
body.is-account .account-page .account-settings-shortcut-list a:focus-visible {
    border-color: var(--brand-primary);
    outline: none;
}

.study-catalogue-select {
    position: relative;
}

.study-catalogue-select__control {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.study-catalogue-select__control .form-input {
    flex: 1 1 12rem;
    min-width: 0;
}

.study-catalogue-select__clear {
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0 0.85rem;
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    background: var(--brand-white);
    color: var(--brand-footer);
    font-weight: 600;
    cursor: pointer;
}

.study-catalogue-select__clear:hover,
.study-catalogue-select__clear:focus-visible {
    border-color: var(--brand-primary);
    outline: none;
}

.study-catalogue-select__results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% - 0.15rem);
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    max-height: 14rem;
    overflow: auto;
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.study-catalogue-select__option {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.65rem 0.85rem;
    min-height: 2.75rem;
    color: var(--brand-footer);
    cursor: pointer;
}

.study-catalogue-select__option:hover,
.study-catalogue-select__option:focus-visible {
    background: color-mix(in srgb, var(--brand-primary) 10%, white);
    outline: none;
}

.study-catalogue-select__option--add {
    font-weight: 600;
}

.study-catalogue-select__empty {
    padding: 0.65rem 0.85rem;
    color: var(--brand-text-muted);
    font-size: 0.9rem;
}

@media (max-width: 374px) {
    .study-catalogue-select__control {
        flex-direction: column;
    }

    .study-catalogue-select__clear {
        width: 100%;
    }
}

body.is-account .account-page .account-empty-state {
    margin: 0;
    color: var(--brand-text-muted);
}

body.is-account .account-page .account-payment-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

body.is-account .account-page .account-payment-card {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem;
}

body.is-account .account-page .account-payment-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

body.is-account .account-page .account-payment-card__title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--brand-footer);
}

body.is-account .account-page .account-payment-card__meta {
    margin: 0.4rem 0 0;
    color: var(--brand-text-muted);
    font-size: 0.9rem;
}

body.is-account .account-page .account-payment-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

body.is-account .account-page .account-payment-card__confirm {
    width: 100%;
}

body.is-account .account-page .status-pill--neutral {
    background: #f3f4f6;
    color: #374151;
}

body.is-account .account-page .status-pill--warning {
    background: #fef3c7;
    color: #92400e;
}

body.is-account .account-page .account-address-form .address-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

body.is-account .account-page .account-address-form .address-type-options label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: var(--account-touch);
}

@media (max-width: 991px) {
    body.is-account .account-page .account-settings-actions {
        padding-bottom: calc(
            0.5rem
            + var(--account-mobile-bar-height)
            + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px))
        );
    }

    body.is-account .account-page .account-payment-card-list {
        padding-bottom: calc(
            0.75rem
            + var(--account-mobile-bar-height)
            + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px))
        );
    }

    body.is-account .account-page .account-settings-stack,
    body.is-account .account-page .account-form-narrow {
        max-width: none;
    }
}

/* My books for sale — unified selling page */
body.is-account .account-page .books-for-sale-hold {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
}

body.is-account .account-page .books-for-sale-hold > .books-for-sale-hold__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
    min-height: var(--account-touch, 44px);
}

body.is-account .account-page .books-for-sale-hold > .books-for-sale-hold__summary::-webkit-details-marker {
    display: none;
}

body.is-account .account-page .books-for-sale-hold__summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 auto;
}

body.is-account .account-page .books-for-sale-hold__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--brand-footer);
    line-height: 1.3;
}

body.is-account .account-page .books-for-sale-hold__status {
    margin: 0;
    color: var(--brand-text-muted);
    font-size: 0.9375rem;
    line-height: 1.35;
}

body.is-account .account-page .books-for-sale-hold__chevron {
    flex: 0 0 auto;
    width: 0.65rem;
    height: 0.65rem;
    margin-top: 0.35rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    color: var(--brand-text-muted);
}

body.is-account .account-page .books-for-sale-hold[open] > .books-for-sale-hold__summary .books-for-sale-hold__chevron {
    transform: rotate(225deg);
    margin-top: 0.55rem;
}

body.is-account .account-page .books-for-sale-hold__panel {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--brand-border);
}

body.is-account .account-page .books-for-sale-hold__copy {
    margin: 0.85rem 0 0.75rem;
    color: var(--brand-text-muted);
    font-size: 0.9375rem;
}

body.is-account .account-page .books-for-sale-hold__actions {
    display: grid;
    gap: 0.85rem;
}

body.is-account .account-page .books-for-sale-hold__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

body.is-account .account-page .books-for-sale-hold__row .form-input {
    min-width: min(100%, 11rem);
    max-width: 14rem;
}

body.is-account .account-page .books-for-sale-hold__form .btn {
    min-height: var(--account-touch, 44px);
}

body.is-account .account-page .account-filter-tabs--books-for-sale {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

body.is-account .account-page .account-filter-tabs--books-for-sale .account-filter-tabs__link {
    text-align: center;
    justify-content: center;
    white-space: normal;
    line-height: 1.25;
    min-height: var(--account-touch);
}

body.is-account .account-page .account-filter-tabs__count {
    font-weight: 600;
    color: inherit;
}

body.is-account .account-page .books-for-sale-history-link {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
}

body.is-account .account-page .books-for-sale-history-link a.is-active {
    font-weight: 700;
    color: var(--brand-primary-dark);
}

/* Media cards: cover + heading stay in one row; details sit under body on desktop
   and span the full card width below that row on mobile. */
body.is-account .account-page .account-entity-card--media {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.85rem;
    row-gap: 0.4rem;
    align-items: start;
}

body.is-account .account-page .account-entity-card--media > .account-entity-card__media {
    display: contents;
}

body.is-account .account-page .account-entity-card--media > .account-entity-card__media > .account-entity-card__cover {
    grid-column: 1;
    grid-row: 1 / -1;
}

body.is-account .account-page .account-entity-card--media > .account-entity-card__media > .account-entity-card__body {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

body.is-account .account-page .account-entity-card--media > .account-entity-card__details {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

body.is-account .account-page .account-entity-card__cover {
    flex: 0 0 auto;
    width: 72px;
    height: 96px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--brand-border);
    background: var(--brand-surface);
    position: relative;
    contain: paint;
}

body.is-account .account-page .account-entity-card__cover-media,
body.is-account .account-page .account-entity-card__cover .book-cover,
body.is-account .account-page .account-entity-card__cover .book-cover--fallback,
body.is-account .account-page .account-entity-card__cover .book-cover--missing {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    box-sizing: border-box;
}

body.is-account .account-page .account-entity-card__cover .book-cover--fallback,
body.is-account .account-page .account-entity-card__cover .book-cover--missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.2rem;
}

body.is-account .account-page .account-entity-card__cover .book-cover-fallback-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    max-width: 100%;
    flex-shrink: 0;
    padding: 0;
    border-radius: 999px;
    overflow: hidden;
}

body.is-account .account-page .account-entity-card__cover .book-cover-fallback-mark svg {
    width: 12px;
    height: 12px;
    display: block;
}

body.is-account .account-page .account-entity-card__cover .book-cover-fallback-title {
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    white-space: normal;
    text-overflow: ellipsis;
    font-size: 0.55rem;
    line-height: 1.15;
    padding: 0;
    box-sizing: border-box;
    word-break: break-word;
}

body.is-account .account-page .account-entity-card__badges .status-pill,
body.is-account .account-page .account-entity-card__note .status-pill {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
}

body.is-account .account-page .account-filter-tabs--books-for-sale .account-filter-tabs__count {
    white-space: nowrap;
    margin-left: 0.35rem;
    letter-spacing: normal;
    display: inline;
}

body.is-account .account-page .books-for-sale-pagination-summary {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

body.is-account .account-page .account-entity-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

body.is-account .account-page .account-entity-card--media .account-entity-card__header {
    margin-bottom: 0;
}

body.is-account .account-page .account-entity-card--media .account-entity-card__note,
body.is-account .account-page .account-entity-card--media .account-entity-card__attention {
    margin-bottom: 0;
    max-width: 100%;
}

body.is-account .account-page .account-entity-card--media .account-entity-card__actions {
    margin-top: 0.15rem;
    max-width: 100%;
}

body.is-account .account-page .account-entity-card--media > .account-entity-card__details > .account-entity-card__note,
body.is-account .account-page .account-entity-card--media > .account-entity-card__details > .account-entity-card__attention,
body.is-account .account-page .account-entity-card--media > .account-entity-card__details > .account-entity-card__actions {
    width: 100%;
}

body.is-account .account-page .account-entity-card__title {
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.is-account .account-page .account-entity-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

body.is-account .account-page .books-for-sale-payment-note {
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

/* Listing tiles: keep Withdrawn / Suspended pills on one line; header adapts. */
body.is-account .account-page .books-for-sale-listing-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
    min-width: 0;
}

body.is-account .account-page .books-for-sale-listing-card__heading {
    flex: 1 1 auto;
    min-width: 0;
}

body.is-account .account-page .books-for-sale-listing-card__heading .account-entity-card__meta {
    margin-top: 0.2rem;
}

body.is-account .account-page .books-for-sale-listing-card__status-pill {
    flex: 0 0 auto;
    flex-shrink: 0;
    white-space: nowrap;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    word-break: keep-all;
    hyphens: none;
}

body.is-account .account-page .books-for-sale-listing-list,
body.is-account .account-page [data-account-sale-list] {
    overflow-x: clip;
}

body.is-account .account-page .books-for-sale-listing-card,
body.is-account .account-page [data-sale-card] {
    min-width: 0;
    overflow-x: clip;
}

body.is-account .account-page .books-for-sale-listing-card .account-entity-card__title,
body.is-account .account-page [data-sale-card] .account-entity-card__title {
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.is-account .account-page .books-for-sale-withdraw {
    margin: 0;
}

body.is-account .account-page .books-for-sale-listing-card .account-entity-card__actions .btn,
body.is-account .account-page [data-sale-card] .account-entity-card__actions .btn {
    min-height: var(--account-touch, 44px);
}

@media (max-width: 991px) {
    /* Content-driven sizing: avoid 12rem flex-basis becoming vertical blank in column headers. */
    body.is-account .account-page .books-for-sale-listing-card__header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    body.is-account .account-page .books-for-sale-listing-card__heading {
        flex: 0 1 auto;
        width: 100%;
    }

    body.is-account .account-page .books-for-sale-listing-card__status-pill {
        align-self: flex-start;
    }

    body.is-account .account-page .account-entity-card--media .account-entity-card__header {
        width: 100%;
        gap: 0.4rem;
    }

    body.is-account .account-page .account-entity-card--media .account-entity-card__badges {
        justify-content: flex-start;
    }

    /* Cover stays beside heading only; dates/reasons/actions use the full card width. */
    body.is-account .account-page .account-entity-card--media > .account-entity-card__media > .account-entity-card__cover {
        grid-row: 1;
    }

    body.is-account .account-page .account-entity-card--media > .account-entity-card__details {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }
}

@media (max-width: 767px) {
    body.is-account .account-page .account-filter-tabs--books-for-sale {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    body.is-account .account-page .account-filter-tabs--books-for-sale .account-filter-tabs__link {
        padding: 0.55rem 0.45rem;
        font-size: 0.875rem;
    }

    body.is-account .account-page .account-entity-card__cover {
        width: 64px;
        height: 86px;
    }

    body.is-account .account-page .account-entity-card--media {
        column-gap: 0.7rem;
    }
}

@media (max-width: 991px) {
    body.is-account .account-page .account-card-list,
    body.is-account .account-page .books-for-sale-hold,
    body.is-account .account-page .account-filter-tabs--books-for-sale {
        padding-bottom: 0.25rem;
    }

    body.is-account .account-page [data-account-listing-list],
    body.is-account .account-page [data-account-sale-list] {
        padding-bottom: calc(
            0.75rem
            + var(--account-mobile-bar-height)
            + var(--account-safe-area-bottom, env(safe-area-inset-bottom, 0px))
        );
    }
}

body.is-account .account-page .books-for-sale-history-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
}

body.is-account .account-page .books-for-sale-history-bar__link {
    font-weight: 700;
    color: var(--brand-primary-dark);
    text-decoration: none;
}

body.is-account .account-page .books-for-sale-history-bar__link.is-active,
body.is-account .account-page .books-for-sale-history-bar__link:hover {
    text-decoration: underline;
}

body.is-account .account-page .books-for-sale-history-bar__back {
    color: var(--brand-text-muted);
    font-size: 0.9375rem;
}

.legal-terms {
    max-width: 40rem;
    overflow-wrap: anywhere;
}

.legal-terms h2 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

.legal-terms p,
.legal-terms li {
    overflow-wrap: anywhere;
}

.legal-terms ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
}

.legal-consent {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
    margin-top: 0.25rem;
}

.legal-consent__choice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 44px;
    margin: 0;
    line-height: 1.45;
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
}

.legal-consent__choice input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    flex: 0 0 auto;
    accent-color: var(--brand-primary);
}

.legal-consent__choice span {
    min-width: 0;
}

.legal-consent__note,
.legal-consent .form-error {
    margin: 0;
}

.legal-consent__note {
    color: var(--brand-text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .legal-consent,
    .legal-terms {
        max-width: 100%;
    }

    .legal-consent__choice {
        align-items: flex-start;
    }
}


/* Suggestions belong to the existing street input, including inside dialogs. */
.address-suggestions { width: 100%; min-width: 0; background: #fff; color: #1f1f1f; border: 1px solid #cbd5e1; border-radius: 6px; margin-top: 4px; overflow: hidden; }
.address-suggestions[hidden] { display: none; }
.address-suggestions [role="listbox"] { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.address-suggestions [role="option"] { padding: 12px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.address-suggestions [role="option"]:hover, .address-suggestions [aria-selected="true"] { background: #e2e8f0; color: #0f172a; }
.address-suggestions-attribution { padding: 8px 12px; border-top: 1px solid #e2e8f0; font-family: Roboto, sans-serif; font-style: normal; font-weight: 400; font-size: 12px; letter-spacing: normal; white-space: nowrap; color: #5e5e5e; }
.address-suggestions-status { font-size: 12px; margin: 4px 0 0; }
.address-suggestions-status:empty { display: none; }
@media (max-width: 767px) { .address-suggestions [role="listbox"] { max-height: 200px; } }

/* Super Admin business overview: period flows, current work and observed coverage. */
.business-overview { color: var(--brand-text); }
.business-heading,.business-section-heading,.business-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.business-heading h1 { color:var(--brand-navy); font-size:1.8rem; margin:0 0 .4rem; }
.business-heading p,.business-panel p,.business-period p { color:#66758a; font-size:.8rem; line-height:1.6; }
.business-badge { font-size:.7rem; background:#edf1f6; padding:.4rem .6rem; border-radius:5px; white-space:nowrap; }
.business-period { margin:1.3rem 0; }
.business-period form { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.business-period input,.business-period select { width:auto; min-height:44px; max-width:100%; }
.business-period label { font-size:.75rem; }
.business-cards { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:.8rem; }
.business-card { display:block; border:1px solid #dfe6ed; border-top:3px solid var(--brand-primary); border-radius:10px; padding:1rem .8rem; background:white; color:var(--brand-text); min-width:0; }
.business-card:hover { color:var(--brand-text); box-shadow:0 3px 10px #192e4510; }
.business-card span { font-size:.75rem; color:#5e6f85; display:block; }
.business-card strong { display:block; font-size:clamp(1.1rem,1.8vw,1.75rem); margin:.6rem 0; color:var(--brand-navy); overflow-wrap:anywhere; }
.business-card p { font-size:.7rem; line-height:1.4; }
.business-card small { font-size:.65rem; display:block; margin-top:.6rem; color:#66758a; }
.business-coverage,.business-breakdown { margin:1rem 0; font-size:.75rem; color:#596c83; }
.business-coverage summary,.business-breakdown summary { cursor:pointer; min-height:44px; display:list-item; align-content:center; }
.business-coverage p { line-height:1.6; }
.business-section-heading { margin:1.3rem 0 .8rem; }
.business-section-heading h2 { font-size:1rem; margin:0; color:var(--brand-navy); }
.business-section-heading p { font-size:.7rem; color:#66758a; }
.business-charts,.business-work { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.business-panel { background:white; border:1px solid #dfe6ed; border-radius:11px; padding:1rem; min-width:0; }
.business-panel h3 { margin:0 0 .4rem; font-size:.9rem; color:var(--brand-navy); }
.business-panel-heading { align-items:start; }
.business-panel-heading select { min-height:44px; font-size:.75rem; max-width:100%; }
.business-panel-heading label { font-size:.7rem; }
.business-legend { display:flex; flex-wrap:wrap; gap:.4rem .8rem; margin:.6rem 0; }
.business-legend label { font-size:.7rem; display:flex; align-items:center; gap:.3rem; min-height:44px; }
.business-legend input { accent-color:var(--brand-primary); }
.business-panel svg { width:100%; height:auto; display:block; }
.business-panel svg text { font-size:18px; fill:#5f7084; }
.business-chart-note { border-top:1px solid #edf0f3; padding-top:.6rem; margin-top:.6rem; }
.business-links { display:flex; flex-wrap:wrap; gap:.5rem 1rem; font-size:.75rem; }
.business-links a { min-height:44px; align-content:center; }
.business-work { margin:1rem 0; align-items:start; }
.business-balances { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; margin:1.5rem 0; }
.business-balances span,.business-balances small { display:block; font-size:.7rem; color:#66758a; }
.business-balances strong { font-size:1.4rem; display:block; color:var(--brand-navy); margin:.5rem 0; overflow-wrap:anywhere; }
.business-visitors { display:grid; grid-template-columns:1.1fr 1fr 1fr; gap:1rem; }
.business-conversion { font-size:1.5rem; color:var(--brand-navy); display:block; margin:1rem 0; }
.business-source { display:flex; justify-content:space-between; gap:1rem; font-size:.75rem; padding:.4rem 0; overflow-wrap:anywhere; }
.business-health { margin-top:1rem; background:#edf3ef; border:1px solid #dce8df; padding:1rem; border-radius:8px; display:flex; gap:1rem; flex-wrap:wrap; font-size:.7rem; }
.business-notice { background:#f5f7fa; padding:.8rem; border-radius:7px; font-size:.75rem; line-height:1.6; }
@media(max-width:1250px) { .business-cards { grid-template-columns:repeat(3,minmax(0,1fr)); } .business-visitors { grid-template-columns:1fr 1fr; } .business-visitors>.business-panel:first-child { grid-column:1/-1; } }
@media(max-width:767px) { .business-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } .business-charts,.business-work,.business-visitors { grid-template-columns:minmax(0,1fr); } .business-heading { align-items:start; } .business-heading h1 { font-size:1.4rem; } .business-badge { display:none; } .business-section-heading { align-items:start; } .business-section-heading p { text-align:right; max-width:45%; } .business-card strong { font-size:1.4rem; } .business-period form { display:grid; grid-template-columns:auto minmax(0,1fr); } .business-period form button { grid-column:1/-1; } .business-panel { padding:.8rem; } }

.business-work .admin-dashboard-queues { display:block; }
.business-work .admin-dashboard-queue { display:grid; grid-template-columns:minmax(0,1fr) auto; padding:.8rem; margin:.4rem 0; }
.business-work .admin-dashboard-queue .value { font-size:1rem; }
.business-work .admin-dashboard-queue .item-meta { grid-column:1/-1; }
.business-work .admin-dashboard-section__header h2 { font-size:.9rem; }
.business-work .admin-dashboard-section__header p { font-size:.7rem; }
.business-work>.business-panel .business-balances { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media(max-width:767px) { .business-work>.business-panel .business-balances { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.business-legend label::after { content:''; display:inline-block; width:15px; height:3px; background:var(--series-color, #1a365d); }

.business-panel p { margin:.35rem 0; }
.business-card p { margin:.35rem 0; }
.business-section-heading { margin-top:1rem; }

.business-period [hidden] { display:none; }

.business-overview--simple { max-width:1280px; margin:auto; }
.business-overview--simple .business-eyebrow { color:var(--brand-primary); font-size:.7rem; letter-spacing:.11em; text-transform:uppercase; font-weight:700; }
.business-overview--simple .business-heading { margin:0 0 1.3rem; }
.business-overview--simple .business-heading h1 { font-size:clamp(1.6rem,3vw,2rem); letter-spacing:-.03em; margin:.25rem 0; }
.business-ops { background:#fff; border:1px solid #e1e8ee; border-radius:10px; padding:1.2rem; margin-bottom:1.6rem; }
.business-ops h2 { margin:0; font-size:1rem; color:var(--brand-navy); }
.business-ops>p { font-size:.75rem; color:#66758a; margin:.25rem 0 1rem; }
.business-priority-queues { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.7rem; }
.business-priority-queue { display:flex; align-items:center; gap:.7rem; min-width:0; min-height:72px; padding:.8rem; background:#fffaf7; border:1px solid #f0ddd0; border-radius:7px; color:#703b25; }
.business-priority-queue>strong { font-size:1.6rem; line-height:1; }
.business-priority-queue>span:nth-child(2) { font-size:.75rem; font-weight:700; flex:1; min-width:0; overflow-wrap:anywhere; }
.business-priority-queue small { display:block; font-size:.65rem; color:#766d67; font-weight:400; }
.business-deferred-queues { border-top:1px solid #e5eaf0; margin-top:.8rem; padding-top:.6rem; }
.business-deferred-queues summary { cursor:pointer; min-height:44px; align-content:center; font-size:.75rem; color:var(--brand-navy); font-weight:700; }
.business-more-queues { list-style:none; padding:0; margin:.5rem 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.3rem 1rem; }
.business-more-queues a { display:flex; justify-content:space-between; gap:1rem; padding:.5rem 0; border-bottom:1px solid #edf0f3; font-size:.75rem; }
.business-seller-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; border-top:1px solid #e5eaf0; margin-top:.9rem; padding-top:.9rem; }
.business-seller-strip>div { min-width:0; }
.business-seller-strip span,.business-seller-strip small { display:block; font-size:.7rem; color:#66758a; }
.business-seller-strip strong,.business-seller-strip a { display:block; font-size:1.25rem; font-weight:700; color:var(--brand-navy); margin:.25rem 0; overflow-wrap:anywhere; }
.business-seller-strip a { font-size:.8rem; color:var(--brand-primary); }
.business-ops-foot { display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; font-size:.7rem; color:#66758a; margin-top:.8rem; }
.business-overview--simple .business-section-heading { margin:.6rem 0; }
.business-overview--simple .business-section-heading h2 { font-size:1.1rem; }
.business-overview--simple .business-section-heading p { text-align:left; max-width:none; }
.business-period-form { display:flex; align-items:end; flex-wrap:wrap; gap:.65rem; padding:1rem; background:#fff; border:1px solid #e1e8ee; border-radius:10px; }
.business-period-form>div { min-width:145px; flex:1; }
.business-period-form label { display:block; color:#66758a; font-size:.7rem; font-weight:700; margin-bottom:.3rem; }
.business-period-form .form-input { width:100%; min-height:44px; }
body.is-backend .business-overview .btn { min-height:44px; }
.business-period-form [hidden] { display:none; }
.business-period-caption { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.4rem; margin:.9rem 0; font-size:.75rem; color:#66758a; }
.business-period-caption strong { color:var(--brand-text); }
.business-cards--four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.business-cards--four .business-card { border-top:1px solid #dfe6ed; padding:1rem; }
.business-cards--four .business-card:first-child { border-top:3px solid var(--brand-navy); }
.business-cards--four .business-card:nth-child(2) { border-top:3px solid var(--brand-primary); }
.business-cards--four .business-card strong { font-size:clamp(1.25rem,2vw,1.8rem); margin:.5rem 0; }
.business-cards--four .business-card small { font-size:.72rem; }
.business-basis { font-size:.72rem; color:#66758a; margin:.8rem 0 1rem; }
.business-overview--simple .business-charts { grid-template-columns:1.25fr 1fr; }
.business-cost-list { margin:.7rem 0; }
.business-cost-row { display:flex; justify-content:space-between; gap:.5rem; font-size:.75rem; min-height:44px; align-items:center; }
.business-cost-row strong { color:var(--brand-navy); text-align:right; }
.business-cost-track { height:10px; background:#eff2f5; margin:0 0 .8rem; border-radius:3px; }
.business-cost-track>span { display:block; height:100%; background:var(--brand-navy); border-radius:3px; }
.business-cost-track>span.business-cost-estimated { background:repeating-linear-gradient(130deg,#b2c2d2 0 4px,#d9e3ed 4px 8px); }
.business-coverage-callout { display:flex; gap:.8rem; margin:1rem 0; padding:.8rem; background:#eef3f6; border-radius:8px; font-size:.72rem; color:#566574; }
.business-coverage-callout strong { color:var(--brand-navy); white-space:nowrap; }
.business-overview--simple .business-coverage { border:1px solid #dfe6ed; border-radius:8px; padding:.8rem; background:#fff; }
.business-overview--simple .business-coverage a { margin-right:.6rem; }
@media(max-width:900px) { .business-priority-queues,.business-seller-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } .business-cards--four { grid-template-columns:repeat(2,minmax(0,1fr)); } .business-overview--simple .business-charts { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) { .business-ops { padding:.85rem; } .business-priority-queues,.business-more-queues { grid-template-columns:minmax(0,1fr); } .business-seller-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } .business-seller-strip>div:last-child { grid-column:1/-1; border-top:1px solid #e5eaf0; padding-top:.7rem; } .business-period-form>div { flex-basis:100%; } .business-period-form>div[data-business-custom] { flex-basis:calc(50% - .4rem); min-width:0; } .business-period-form button { width:100%; } .business-cards--four { gap:.55rem; } .business-cards--four .business-card { padding:.75rem; } .business-cards--four .business-card strong { font-size:1.25rem; } .business-coverage-callout { display:block; } .business-coverage-callout strong { display:block; } }

.customer-message-form { margin-top: 1rem; min-width: 0; overflow-wrap: anywhere; }
.customer-message-form input:not([type="hidden"]), .customer-message-form textarea { width: 100%; box-sizing: border-box; }
.customer-message-form button { min-height: 44px; white-space: normal; }
@media (max-width: 767px) {
    .customer-message-form button { width: 100%; }
}
.order-buyer-communications, .order-buyer-thread { min-width: 0; overflow-wrap: anywhere; }
.order-buyer-thread { border-top: 1px solid #dce2e8; margin-top: 1.5rem; padding-top: 1rem; }
.order-buyer-message { margin: 1rem 0; padding: 1rem; background: #f5f7f9; border-radius: 6px; }
.order-buyer-communications summary { min-height: 44px; white-space: normal; }
@media (max-width: 767px) {
    .order-buyer-message { padding: .75rem; }
    .order-buyer-communications summary { width: 100%; }
}

/* The visitor funnel counts sessions at every step; page views remain supporting context. */
.business-visitor-panel { margin-top: 1rem; }
.business-visitor-status { color: #526277; font-size: .85rem; }
.business-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 1rem 0; }
.business-funnel-stage { min-width: 0; border: 1px solid #dfe6ee; border-radius: .6rem; padding: .85rem; background: #f8fafc; overflow-wrap: anywhere; }
.business-funnel-stage > span { display: block; font-weight: 600; color: #263c59; }
.business-funnel-stage > strong { display: block; font-size: 2rem; line-height: 1.3; margin: .35rem 0; color: #17385e; }
.business-funnel-stage > small { display: block; color: #526277; font-size: .8rem; line-height: 1.5; }
.business-funnel-track { height: .4rem; background: #e1e8f0; border-radius: 1rem; overflow: hidden; margin: .65rem 0; }
.business-funnel-track > span { display: block; height: 100%; background: #197260; }
.business-visitor-panel [data-retry-visitor-funnel] { min-height: 44px; }
@media (max-width: 991px) { .business-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .business-funnel { gap: .5rem; } .business-funnel-stage { padding: .65rem; } .business-funnel-stage > strong { font-size: 1.6rem; } }

/* Super Admin paid-order overview and seller activity. */
.business-cards--five { grid-template-columns:repeat(5,minmax(0,1fr)); }
.business-cards--five .business-card { min-width:0; overflow-wrap:anywhere; }
.business-cards--five .business-card strong { font-size:clamp(1.3rem,2vw,2rem); }
.business-card--profit { border-top:3px solid #008744; }
.business-profit-total { border-top:2px solid #dbe5df; margin-top:10px; padding-top:16px; }
.business-seller-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; }
.business-seller-metrics div { display:flex; flex-direction:column; gap:8px; min-width:0; overflow-wrap:anywhere; }
.business-seller-metrics strong { font-size:1.75rem; color:#1a365d; }
.business-seller-metrics small { color:#64748b; }
.business-balance-strip { grid-template-columns:repeat(4,minmax(0,1fr)); }
.business-cost-row small { display:block; font-weight:400; color:#64748b; }
.business-coverage p { overflow-wrap:anywhere; }
@media(max-width:1199px) { .business-cards--five { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:767px) { .business-cards--five,.business-seller-metrics,.business-balance-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } .business-cost-row { flex-wrap:wrap; gap:8px; } .business-section-heading { flex-wrap:wrap; gap:12px; } }
@media(max-width:399px) { .business-cards--five .business-card { padding:14px; } .business-cards--five .business-card strong { font-size:1.3rem; } .business-seller-metrics { gap:16px 12px; } }

/* Separate analytics reports: bounded tables and a single active report. */
.analytics-eyebrow { color: #009c58; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; }
.analytics-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.analytics-tabs a { padding: .8rem 1rem; border: 1px solid #d9e3ed; border-radius: .6rem; color: #24446c; background: #fff; text-decoration: none; }
.analytics-tabs a[aria-current] { background: #24446c; color: #fff; }
.analytics-panel { background: #fff; border: 1px solid #dce5ee; border-radius: .8rem; padding: 1.25rem; margin: 1rem 0; min-width: 0; }
.analytics-panel h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.analytics-panel p, .analytics-caption, .analytics-freshness small { color: #62758b; line-height: 1.6; }
.analytics-freshness { display: flex; gap: 1rem; justify-content: space-between; align-items: center; }
.analytics-freshness form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.analytics-filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.analytics-filters label { display: grid; gap: .35rem; flex: 1 1 160px; min-width: 0; }
.analytics-filters input, .analytics-filters select { width: 100%; min-height: 44px; box-sizing: border-box; }
.analytics-filters .btn, .analytics-freshness .btn { min-height: 44px; }
.analytics-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }
.analytics-cards > div { padding: 1rem; background: #f5f8fb; border-radius: .6rem; }
.analytics-cards span, .analytics-cards strong { display: block; }
.analytics-cards strong { font-size: 1.5rem; color: #24446c; margin-top: .5rem; overflow-wrap: anywhere; }
.analytics-waterfall > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #e4ebf2; padding: .8rem 0; }
[data-analytics-chart] svg { width: 100%; max-height: 300px; }
[data-analytics-chart] text { font-size: 14px; fill: #62758b; }
@media(max-width: 991px) { .analytics-cards { grid-template-columns: repeat(2,minmax(0,1fr)); } .analytics-freshness { align-items: stretch; flex-direction: column; } }
@media(max-width: 480px) { .analytics-tabs { display: grid; } .analytics-tabs a { min-height: 44px; } .analytics-panel { padding: .85rem; } .analytics-filters label { flex-basis: 100%; } .analytics-cards { gap: .5rem; } .analytics-cards > div { padding: .7rem; } .analytics-cards strong { font-size: 1.2rem; } }

[data-analytics-waterfall] svg { width:100%; max-height:280px; }
[data-analytics-waterfall] text { fill:#62758b; font-size:14px; }
.analytics-distribution > div { display:flex; align-items:center; gap:1rem; padding:.6rem 0; flex-wrap:wrap; }
.analytics-distribution progress { width:min(100%,300px); accent-color:#009c58; }

.analytics-records { min-width:1100px; table-layout:auto; }
.analytics-records td:last-child { min-width:300px; max-width:420px; }
@media(max-width:767px) { .analytics-panel .data-table { min-width:720px; } .analytics-panel .analytics-records { min-width:1100px; } }

.order-assignment-actions { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.order-assignment-actions label { min-width: 0; flex: 1 1 10rem; }
body.is-backend .order-assignment-actions button, body.is-backend .order-assignment-actions .btn { min-height: 44px; white-space: normal; }
@media (max-width: 767px) { .order-assignment-actions > * { flex-basis: 100%; width: 100%; } }
@media (max-width: 767px) {
    .order-assignment-table .data-table,
    .order-assignment-table tbody,
    .order-assignment-table tr,
    .order-assignment-table td { display: block; width: 100%; min-width: 0; }
    .order-assignment-table thead { display: none; }
    .order-assignment-table td { white-space: normal; overflow-wrap: anywhere; }
    .order-assignment-table tr { border-bottom: 1px solid var(--brand-border); }
}


/* Compact Order Items: the portal remains the sole vertical scroll container. */
body.is-backend .order-items-header { flex-direction:row; align-items:center; flex-wrap:wrap; gap:8px 16px; margin-bottom:10px; }
.order-items-header > div { min-width:0; flex:1 1 220px; }
.order-items-header h1 { margin-bottom:2px; }
.order-items-header p { margin:0; }
.order-items-layout-switch { display:flex; align-items:center; flex-shrink:0; gap:6px; margin:0 0 0 auto; }
body.is-backend .order-items-layout-switch .btn { min-height:44px; width:auto; }
.order-items-compact .compact-toolbar { gap:6px 10px; margin-bottom:0; padding:8px 10px; }
.compact-toolbar .admin-toolbar-field { flex:1 1 125px; width:auto; }
.compact-toolbar .admin-toolbar-search { flex:2 1 220px; }
.compact-toolbar .admin-toolbar-field .form-input { width:100%; min-width:0; min-height:44px; }
.order-items-compact .compact-toolbar > .btn { min-height:44px; }
.order-items-compact .pagination-bar-link { height:44px; min-width:44px; }
.order-items-compact [data-pagination-retry] { min-height:44px; }
body.is-backend .compact-table-wrap { overflow:visible; max-height:none; }
body.is-backend .compact-table { width:100%; table-layout:fixed; }
.compact-table th:nth-child(1) { width:26%; }
.compact-table th:nth-child(2) { width:34%; }
.compact-table th:nth-child(3) { width:23%; }
.compact-table th:nth-child(4) { width:9%; }
.compact-table th:nth-child(5) { width:8%; }
body.is-backend .order-items-compact .compact-table-wrap .compact-table > thead > tr > th { position:sticky; top:var(--compact-sticky-top, 0px); z-index:3; background:#173445; color:#fff; font-size:13px; line-height:1.35; white-space:normal; }
.compact-toolbar { align-items:end; flex-wrap:wrap; }
.compact-attention-filter { display:flex; gap:8px; align-items:center; min-height:44px; }
.compact-more-filters { position:relative; }
.compact-more-filters summary { padding:12px; cursor:pointer; }
.compact-filter-fields { position:fixed; z-index:30; box-sizing:border-box; max-height:calc(100vh - 24px); overflow-y:auto; box-shadow:0 8px 24px #17344526; border-radius:8px; display:grid; grid-template-columns:auto minmax(130px,1fr); gap:8px; padding:12px; background:var(--brand-surface); border:1px solid var(--brand-border); }
.compact-summary { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:6px 12px; color:var(--brand-text-muted); font-size:12px; }
body.is-backend .compact-order-heading th { background:#eef4f2; color:#173445; white-space:normal; }
.compact-order-meta { display:flex; align-items:center; flex-wrap:wrap; gap:6px 18px; font-weight:400; }
.compact-order-meta strong { font-weight:700; }
.compact-order-meta form { margin-left:auto; }
.compact-pin { border:0; background:transparent; color:#17644f; cursor:pointer; min-height:44px; padding:6px; }
body.is-backend .compact-item td { white-space:normal; overflow-wrap:anywhere; vertical-align:middle; padding:12px 10px; }
.compact-book, .compact-item .cell-meta { display:block; }
.compact-book { color:#173445; margin-bottom:4px; }
.compact-stages { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.compact-stages li { display:flex; flex-direction:column; align-items:center; text-align:center; color:#596976; font-size:13px; }
.compact-stages li > span { border:1px solid #b4c2c9; border-radius:50%; width:24px; height:24px; line-height:22px; margin-bottom:4px; font-weight:700; }
.compact-stages .is-complete > span { background:#17644f; color:#fff; border-color:#17644f; }
.compact-stages small { font-size:12px; margin-top:3px; }
.compact-history { margin-top:5px; font-size:12px; }
.compact-history summary { cursor:pointer; padding:8px 0; color:#17644f; }
.compact-history p { margin:4px 0; }
.compact-issues { position:relative; display:inline-block; }
.compact-issues summary { display:flex; align-items:center; gap:5px; min-width:44px; min-height:44px; padding:6px; cursor:pointer; list-style:none; border-radius:8px; }
.compact-issues summary::-webkit-details-marker { display:none; }
.compact-issues summary:focus-visible, .compact-history summary:focus-visible { outline:2px solid #17644f; outline-offset:2px; }
.compact-dot { width:10px; height:10px; flex-shrink:0; border-radius:50%; background:#ae2937; }
.compact-issues--warning .compact-dot { background:#c3890d; }
.compact-issue-popover { position:fixed; overflow:auto; width:340px; max-width:calc(100vw - 48px); z-index:6; background:#fff; color:#173445; border:1px solid #b4c2c9; border-radius:8px; padding:14px; box-shadow:0 8px 24px #17344526; }
.compact-issue-popover strong, .compact-issue-popover span { display:block; }
.compact-issue-popover span { font-size:12px; color:#596976; margin-top:4px; }
.compact-issue-popover p { margin:6px 0 12px; }
.compact-issue-popover a { display:block; padding:10px 0; }
body.is-backend .compact-open { min-height:44px; padding:8px; white-space:nowrap; }
@media (max-width:1100px) {
    .compact-table th:nth-child(1) { width:25%; }
    .compact-table th:nth-child(2) { width:34%; }
    .compact-table th:nth-child(3) { width:22%; }
    .compact-table th:nth-child(4) { width:9%; }
    .compact-table th:nth-child(5) { width:10%; }
}
@media (max-width:767px) {
    .compact-table, .compact-table tbody, .compact-table tr, .compact-table td, .compact-table th { display:block; width:100% !important; }
    .compact-table thead { display:none; }
    body.is-backend .compact-item { display:grid; grid-template-columns:minmax(0,1fr) auto; border-bottom:2px solid #dce5e8; padding:8px; }
    body.is-backend .compact-item td { padding:6px; border:0; }
    .compact-item td:nth-child(-n+3) { grid-column:1/-1; }
    .compact-item td:nth-child(3)::before { content:'Next action'; display:block; font-size:11px; color:#596976; margin-bottom:3px; }
    .compact-item td:nth-child(4) { align-self:center; }
    .compact-order-meta { gap:6px 12px; }
    .compact-order-meta form { margin-left:0; }
    .compact-toolbar > * { max-width:100%; }
    .compact-toolbar .admin-toolbar-field { flex:1 1 130px; }
    .compact-toolbar .admin-toolbar-search { flex-basis:100%; }
    .compact-filter-fields { grid-template-columns:minmax(0,1fr); }
    .compact-stages { padding:6px 0; }

}
/* Orders overview: the portal is the only vertical scrollport. */
.orders-list-page { min-width: 0; }
body.is-backend .orders-list-page .admin-table-wrap { overflow: visible; max-height: none; border-radius: 0; }
.orders-list-page .data-table { table-layout: fixed; width: 100%; }
.orders-list-page .data-table td { padding: .7rem .55rem; overflow-wrap: anywhere; }
.orders-list-page .data-table th { white-space: normal !important; padding: .65rem .55rem; }
.orders-list-page .data-table th:first-child { width: 17%; }
.orders-list-page .data-table th:nth-child(2) { width: 19%; }
.orders-list-page .data-table th:nth-child(6) { width: 5%; }
.orders-list-page .data-table th:nth-child(7) { width: 10%; }
.orders-list-page .orders-reference { display: inline-block; color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px; }
.orders-list-page .status-pill { white-space: normal; }
.orders-list-page .admin-toolbar { flex-wrap: wrap; }
.orders-list-page .admin-toolbar-field { min-width: 120px; flex: 1; }
.orders-list-page .admin-toolbar-search { flex: 2; min-width: min(250px, 100%); }
.orders-attention-filter { display: flex; gap: .5rem; align-items: center; min-height: 44px; }
.orders-more-filters { width: 100%; }
.orders-more-filters summary, .orders-attention summary { cursor: pointer; padding: .5rem 0; }
.orders-extra-filters { display: flex; flex-wrap: wrap; gap: .75rem; padding-top: .75rem; }
.orders-attention { position: relative; color: #b42318; font-size: .8rem; }
.orders-attention-detail { position: absolute; right: 0; width: min(280px, 80vw); z-index: 4; background: white; color: #243247; padding: 1rem; border: 1px solid #e4b5b1; border-radius: 8px; box-shadow: 0 6px 20px #182b4930; }
.orders-list-page a:focus-visible, .orders-list-page summary:focus-visible { outline: 3px solid #198754; outline-offset: 3px; }
@media (max-width: 991px) {
    .orders-list-page .data-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
    .orders-list-page .data-table, .orders-list-page .data-table tbody { display: block; }
    .orders-list-page .data-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--brand-border); padding: .5rem; }
    .orders-list-page .data-table td { display: block; border: 0; text-align: left; }
    .orders-list-page .data-table td[data-label]::before { content: attr(data-label); display: block; color: #64748b; font-size: .68rem; margin-bottom: .3rem; }
    .orders-list-page .orders-reference { min-height: 44px; display: flex; align-items: center; }
    .orders-attention-detail { position: static; width: auto; margin-top: .5rem; }
    .orders-list-page .form-input, .orders-list-page summary { min-height: 44px; }
}
.orders-attention--warning { color: #946200; }
.orders-attention-detail p { margin: 0 0 .75rem; }
.orders-list-page .col-money { white-space: normal; }

/* Book pricing shares the portal's vertical scroll; wide tables scroll horizontally only. */
.book-pricing { min-width: 0; max-width: none; }
.pricing-heading, .pricing-save-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pricing-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.pricing-assumptions-group { min-inline-size: 0; }
.pricing-settings-grid > .form-group { min-width: 0; }
.pricing-settings-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
body.is-backend .book-pricing .pricing-settings-grid input, body.is-backend .book-pricing .pricing-input-table input { width: 100%; min-height: 44px; box-sizing: border-box; }
.pricing-settings-grid output { font-weight: 700; }
.pricing-policy { padding: 1rem; background: var(--color-bg, #f3f4f6); border-left: 3px solid #36566c; }
.pricing-table-scroll { position: relative; overflow-x: auto; max-width: 100%; margin-bottom: 1.25rem; }
.pricing-input-table { min-width: 900px; }
.pricing-input-table .pricing-row-label { min-width: 150px; }
.pricing-derived { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pricing-input-table input { min-width: 110px; }
.pricing-results-table { min-width: 680px; }
.pricing-results-table th[scope="row"] { max-width: 200px; overflow-wrap: anywhere; white-space: normal; }
.pricing-condition { margin: 0; min-width: 125px; }
.pricing-condition div { display: flex; justify-content: space-between; gap: .75rem; }
.pricing-condition dd { margin: 0; font-variant-numeric: tabular-nums; }
.pricing-save-footer { border-top: 1px solid #d1d5db; padding-top: 1rem; }
.book-pricing .btn { min-height: 44px; }
@media (max-width: 991px) { .pricing-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .pricing-settings-grid { grid-template-columns: minmax(0, 1fr); } .pricing-heading, .pricing-save-footer { align-items: stretch; } .pricing-actions, .pricing-heading .btn, .pricing-save-footer .btn { width: 100%; } }

.order-items-payment-details summary { cursor: pointer; }
.order-items-payment-details ul { white-space: normal; max-width: 24rem; padding-left: 18px; margin: 6px 0; }

/* Courier actions escape only their clipping scrollport; other menus retain their layout. */
.order-more-menu.courier-menu-floating {
    display: block;
    position: fixed;
    right: auto;
    bottom: auto;
    width: 210px;
    z-index: 1200;
    overflow-y: auto;
    overflow-wrap: anywhere;
}
.order-more-menu.courier-menu-floating a,
.order-more-menu.courier-menu-floating button { min-height: 44px; }
.seller-response-timer { white-space: normal; font-variant-numeric: tabular-nums; }

/* Compact, textual stock evidence under order seller names. */
.assignment-stock-status {
    display: block;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Seller payment actions stay in the top layer, outside clipped order cards. */
.seller-payment-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.seller-payment-toggle { flex: 0 0 auto; min-width: 44px; min-height: 44px; }
.seller-payment-actions {
    position: fixed; inset: auto; margin: 0; padding: 0.5rem;
    width: 280px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px);
    box-sizing: border-box; overflow: auto; border: 1px solid #d1d5db; border-radius: 0.75rem;
    background: #fff; color: #1f2937; box-shadow: 0 4px 16px #0003;
    font-size: 1rem; font-weight: 400;
}
.seller-payment-actions summary { display: flex; align-items: center; gap: 0.65rem; list-style: none; cursor: pointer; min-height: 44px; padding: 0.65rem; box-sizing: border-box; }
.seller-payment-actions summary:hover { background: #f3f4f6; border-radius: 0.5rem; }
.seller-payment-actions summary:focus-visible, .seller-payment-toggle:focus-visible { outline: 2px solid #248636; outline-offset: 2px; }
.seller-payment-actions form { padding: 0.5rem; }
.seller-payment-actions textarea { width: 100%; box-sizing: border-box; }
.seller-payment-actions form button { min-height: 44px; margin-top: 0.5rem; }
@media (max-width: 480px) {
    .seller-payment-actions { width: 280px; }
    .seller-payment-actions form button { width: 100%; }
}

.seller-payment-actions summary::-webkit-details-marker { display: none; }
.seller-payment-actions summary svg { flex: 0 0 auto; }

.add-order-item-candidates .replacement-tab { min-height: 44px; }
.add-order-item-candidates .replacement-candidate-body { overflow-wrap: anywhere; }
.add-order-item-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
@media (max-width: 767px) {
    .add-order-item-candidates .replacement-tabs { flex-wrap: wrap; }
    .add-order-item-candidates .replacement-candidate-head { flex-wrap: wrap; gap: 0.25rem; }
}

/* Channel evidence stays beside the fulfilment heading, including on phones. */
.seller-fulfilment-heading,
.seller-fulfilment-heading-channels,
.seller-notification-channels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
}
.seller-fulfilment-heading { justify-content: space-between; }
.seller-fulfilment-heading-channels { gap: .65rem; min-width: 0; }
.seller-notification-indicator {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-height: 30px;
    padding: .2rem .45rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: .75rem;
    cursor: pointer;
}
.seller-notification-indicator--sent,
.seller-notification-indicator--delivered,
.seller-notification-indicator--read { color: #166534; border-color: #86b995; background: #f0fdf4; }
.seller-notification-indicator--failed,
.seller-notification-indicator--delivery_failed { color: #991b1b; border-color: #fca5a5; }
.seller-notification-indicator--unknown,
.seller-notification-indicator--redirected { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
.seller-notification-indicator:focus-visible { outline: 2px solid #166534; outline-offset: 3px; }
.seller-notification-popover {
    position: fixed;
    inset: auto;
    margin: 0;
    width: min(330px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: .85rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: white;
    color: #172033;
    box-shadow: 0 5px 20px #0003;
    font-size: .85rem;
}
.seller-notification-popover-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.seller-notification-popover-heading button { min-width: 36px; min-height: 36px; }
.seller-notification-popover p { margin: .5rem 0; }
.seller-notification-history { border-top: 1px solid #e2e8f0; margin-top: .65rem; padding-top: .6rem; }
.seller-notification-history summary { cursor: pointer; }
.seller-notification-history ul { padding-left: 1rem; overflow-wrap: anywhere; }
@media (max-width: 768px) {
    .seller-notification-indicator { min-height: 44px; }
    .seller-notification-popover button, .seller-notification-history summary { min-height: 44px; }
}

.replacement-stock-review { margin-block: 1rem; padding: 1rem; border: 1px solid var(--border-color, #d8dee7); border-radius: .5rem; overflow-wrap: anywhere; }
.replacement-stock-review form { display: grid; gap: .75rem; min-width: 0; }
.replacement-stock-review .form-input { width: 100%; max-width: 100%; min-width: 0; }
.replacement-stock-review summary, .is-backend .replacement-stock-review .btn { min-height: 44px; }
@media (max-width: 768px) { .replacement-stock-review { padding: .75rem; } .replacement-stock-review button { width: 100%; white-space: normal; } }

.order-items-reference-payment { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }

/* Current layout only: keep tracking and date values readable in narrower columns. */
.order-items-table th:nth-child(n+5):nth-child(-n+9),
.order-items-table td:nth-child(n+5):nth-child(-n+9) { padding-inline: 0.5rem; }
.order-items-table .order-items-tracking-trigger { min-height: 44px; min-width: 44px; }

@media (max-width: 768px) {
    .order-items-table th:nth-child(n+5):nth-child(-n+9),
    .order-items-table td:nth-child(n+5):nth-child(-n+9) { padding-inline: 0.375rem; }
}
body.is-backend .admin-table-wrap .order-items-table > thead > tr > th {
    top: var(--current-sticky-top, 0px);
    background-clip: border-box;
    white-space: normal;
    overflow-wrap: normal;
}

.order-items-book-title { margin-top: 0.2rem; font-size: 0.8125rem; }
.order-items-book-title summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.order-items-book-title summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-items-book-title summary::after { content: '▾'; flex: none; padding-left: 0.2rem; }
.order-items-book-title[open] summary::after { content: '▴'; }
.order-items-book-title summary:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.order-items-book-title p { margin: 0.25rem 0; overflow-wrap: anywhere; }
@media (max-width: 768px) { .order-items-book-title summary { min-height: 44px; } }

/* Keep prior assignment rows available to disclosure controls and search. */
.order-items-table tr[data-seller-history][hidden] { display: none !important; }
.order-items-history-toggle { display: block; padding: .25rem 0; min-height: 44px; background: transparent; border: 0; color: var(--brand, #185d8e); text-align: left; font-size: .75rem; cursor: pointer; text-decoration: underline; }
.order-items-history-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.order-items-comment-controls { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.order-items-comment-controls .order-items-pin-form { flex: none; margin: 0; }
.order-items-comment-controls .order-items-pin-btn { min-height: 44px; min-width: 44px; }
.order-items-comment-controls .order-items-comment-trigger { flex: 1; min-width: 0; }

.tracking-overview-heading { display: flex; align-items: center; gap: .7rem; padding: 1rem; border-radius: .75rem; background: #eff6ff; color: #173c69; }
.tracking-overview-heading > svg { flex: none; }
.tracking-overview-heading > div { min-width: 0; flex: 1; }
.tracking-overview-heading strong { font-size: 1.05rem; }
.tracking-overview-heading--review { background: #fff7e8; color: #7c4a03; }
.tracking-overview-heading--complete { background: #edf8f0; color: #195b36; }
.tracking-provider-link { padding: .5rem; min-height: 44px; display: inline-flex; align-items: center; font-size: .8rem; }
.tracking-progress { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.tracking-progress-step { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: .8rem; border: 1px solid #d6dee7; border-radius: .65rem; color: #526171; background: #f8fafc; }
.tracking-progress-step.is-recorded { color: #195b36; background: #edf8f0; border-color: #9bc9ab; }
.tracking-progress-step strong { font-size: .85rem; }
.tracking-progress-step span { font-size: .75rem; }
.tracking-review-note { padding: .7rem; border-left: 3px solid #b7791f; background: #fffbeb; font-size: .85rem; }
.tracking-overview .courier-history { border-top: 1px solid #d6dee7; padding-top: .5rem; }
.tracking-overview .courier-history summary { min-height: 44px; cursor: pointer; padding-block: .6rem; }
.tracking-event-list { list-style: none; padding: 0 0 0 .6rem; margin: 1rem 0; border-left: 2px solid #cbd5e1; }
.tracking-event-list li { position: relative; padding: .25rem 0 1rem .8rem; }
.tracking-event-list li::before { content: ''; position: absolute; left: -.9rem; top: .5rem; width: .5rem; height: .5rem; border-radius: 50%; background: #64748b; }
@media (max-width: 600px) {
    .tracking-overview-heading { flex-wrap: wrap; padding: .75rem; }
    .tracking-provider-link { margin-left: 2.5rem; }
    .tracking-progress { gap: .35rem; }
    .tracking-progress-step { padding: .55rem; }
}

.order-items-tracking-dialog { border: 1px solid #d6dee7; border-radius: 1rem; box-shadow: 0 20px 70px #10203355; }
.order-items-tracking-dialog::backdrop { background: #10203388; }
.tracking-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.tracking-dialog-heading h2 { margin: .35rem 0 1rem; font-size: 1.2rem; }
.tracking-dismiss { flex: none; width: 44px; height: 44px; border: 0; border-radius: .5rem; background: #f1f5f9; font-size: 1.5rem; cursor: pointer; }
.tracking-dismiss:focus-visible { outline: 2px solid #185d8e; outline-offset: 2px; }
@media (max-width: 600px) { .tracking-provider-link { flex-basis: 100%; margin-left: 2.5rem; padding-block: .25rem; } }
/* Notification preference controls remain usable on touch screens. */
.customer-notification-preferences .form-input,
.customer-notification-preferences button[type="submit"] {
    min-height: 44px;
}
