/*
 * StockWave design system — translated from the Google Stitch design
 * (D:\Business\stitch_stockwave_b2b_reseller_platform\stockwave_wholesale_b2b\DESIGN.md).
 *
 * How to change the look: edit the TOKENS block. Components below only use
 * tokens, never raw colours, so light and dark mode both follow automatically.
 *
 * Fonts (loaded from Google Fonts in each page's <head>):
 *   Plus Jakarta Sans — headings      Inter — body text
 *   JetBrains Mono    — SKUs, prices, figures and small labels
 * Icons: Material Symbols Outlined, used as <span class="icon">name</span>.
 */

/* ============================== TOKENS ============================== */

:root {
    --primary: #00873f; /* Kelly/wholesale green: main actions, profit */
    --primary-strong: #006b30; /* hover / pressed */
    --primary-tint: rgba(0, 150, 71, 0.08);
    --slate-900: #0f172a; /* secondary buttons, strong text */
    --ink: #0b1c30; /* body text */
    --muted: #64748b; /* secondary text */
    --info: #0284c7; /* logistics blue: tracking, shops, links to eBay */
    --info-tint: rgba(2, 132, 199, 0.08);
    --loss: #e11d48; /* loss, failures, fees */
    --loss-tint: rgba(225, 29, 72, 0.08);
    --warn: #d97706; /* low stock, pending */
    --warn-tint: rgba(217, 119, 6, 0.1);

    --canvas: #f8fafc; /* page background */
    --card: #ffffff;
    --card-alt: #f1f5f9; /* hover rows, insets */
    --line: #e2e8f0; /* hairline borders */
    --line-strong: #cbd5e1; /* input borders */

    --font-head: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

    --r-sm: 4px; /* buttons, inputs, badges */
    --r-lg: 8px; /* cards, tables, panels */

    --s1: 0.25rem;
    --s2: 0.5rem;
    --s3: 0.75rem;
    --s4: 1rem;
    --s5: 1.25rem;
    --s6: 1.5rem;
    --s8: 2rem;

    --shadow-pop: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #00a651;
        --primary-strong: #19c16b;
        --primary-tint: rgba(0, 166, 81, 0.14);
        --slate-900: #e2e8f0;
        --ink: #e5edf7;
        --muted: #94a3b8;
        --info: #38bdf8;
        --info-tint: rgba(56, 189, 248, 0.12);
        --loss: #fb7185;
        --loss-tint: rgba(251, 113, 133, 0.12);
        --warn: #fbbf24;
        --warn-tint: rgba(251, 191, 36, 0.12);
        --canvas: #090d16;
        --card: #0f172a;
        --card-alt: #162033;
        --line: #1e293b;
        --line-strong: #334155;
        --shadow-pop: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
        color-scheme: dark;
    }
}

/* ============================== BASE ============================== */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 14px / 1.45 var(--font-body);
}

h1,
h2,
h3 {
    font-family: var(--font-head);
    color: var(--ink);
    margin: 0 0 var(--s3);
    line-height: 1.2;
    letter-spacing: -0.01em;
}
h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
h2 {
    font-size: 18px;
    font-weight: 700;
}
h3 {
    font-size: 15px;
    font-weight: 600;
}

p {
    margin: 0 0 var(--s3);
    max-width: 75ch;
}
a {
    color: var(--primary);
}
a:hover {
    color: var(--primary-strong);
}

.muted {
    color: var(--muted);
}
.small {
    font-size: 12.5px;
}
.mono,
.money,
.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.money,
.num {
    white-space: nowrap;
}
.gain {
    color: var(--primary);
}
.loss {
    color: var(--loss);
}

/* Small upper-case monospace label above a value or section (the Stitch "eyebrow"). */
.label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    user-select: none;
}
.icon.sm {
    font-size: 16px;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

/* ============================== TOP BAR ============================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--s6);
    padding: 0 var(--s6);
    height: 60px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 18px;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.brand .icon {
    color: #fff;
    background: var(--primary);
    border-radius: var(--r-sm);
    padding: 4px;
    font-size: 20px;
}
.brand .tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-tint);
    border-radius: var(--r-sm);
    padding: 2px 6px;
}

.tabs {
    display: flex;
    gap: var(--s1);
    flex: 1;
    height: 100%;
}
.tabs a {
    display: flex;
    align-items: center;
    padding: 0 var(--s3);
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tabs a:hover {
    color: var(--ink);
}
.tabs a[aria-current='page'] {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.who {
    display: flex;
    align-items: center;
    gap: var(--s3);
    white-space: nowrap;
}
.shop-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--card-alt);
    color: var(--ink);
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
}
.dot.off {
    background: var(--muted);
}
.dot.bad {
    background: var(--loss);
}

/* Phone: tabs move to a bottom navigation bar. */
.bottom-nav {
    display: none;
}
@media (max-width: 860px) {
    .topbar {
        padding: 0 var(--s4);
        gap: var(--s3);
    }
    .topbar .tabs {
        display: none;
    }
    .topbar .who {
        margin-left: auto;
    }
    .topbar .shop-chip {
        display: none;
    }
    .bottom-nav {
        display: flex;
        position: fixed;
        inset: auto 0 0 0;
        z-index: 10;
        background: var(--card);
        border-top: 1px solid var(--line);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 8px 0 6px;
        font-size: 11px;
        color: var(--muted);
        text-decoration: none;
    }
    .bottom-nav a[aria-current='page'] {
        color: var(--primary);
        font-weight: 600;
    }
    body {
        padding-bottom: 72px;
    }
}

/* ============================== LAYOUT ============================== */

main {
    max-width: 1320px;
    margin: 0 auto;
    padding: var(--s6);
}
@media (max-width: 640px) {
    main {
        padding: var(--s4) var(--s3);
    }
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s4);
    flex-wrap: wrap;
    margin-bottom: var(--s5);
}
.page-head h1 {
    margin: 2px 0 0;
}
.page-head p {
    margin: 4px 0 0;
    color: var(--muted);
}
.page-head .actions {
    display: flex;
    gap: var(--s2);
    flex-wrap: wrap;
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s5);
    margin-bottom: var(--s5);
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    margin-bottom: var(--s4);
}
.panel-head h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: var(--s5);
    align-items: start;
}
.split.narrow {
    grid-template-columns: minmax(0, 1fr) 340px;
}
@media (max-width: 1100px) {
    .split,
    .split.narrow {
        grid-template-columns: 1fr;
    }
}

/* ============================== METRIC TILES ============================== */

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--s4);
    margin-bottom: var(--s5);
}
.metric {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s4) var(--s5);
}
.metric-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.metric-top .icon {
    color: var(--primary);
    background: var(--primary-tint);
    border-radius: var(--r-sm);
    padding: 6px;
}
.metric-value {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: var(--s2) 0 2px;
    font-variant-numeric: tabular-nums;
}
.metric-value small {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-left: 4px;
}
.metric-note {
    font-size: 12.5px;
    color: var(--muted);
}

/* ============================== NOTICES & ALERTS ============================== */

.notice {
    background: var(--warn-tint);
    color: var(--ink);
    border-left: 3px solid var(--warn);
    border-radius: var(--r-sm);
    padding: var(--s3) var(--s4);
    margin-bottom: var(--s4);
}
.notice.bad {
    background: var(--loss-tint);
    border-left-color: var(--loss);
}
.notice.good {
    background: var(--primary-tint);
    border-left-color: var(--primary);
}
.notice.info {
    background: var(--info-tint);
    border-left-color: var(--info);
}

/* "Needs your attention" rows */
.alerts {
    display: grid;
    gap: var(--s2);
}
.alert {
    display: flex;
    align-items: center;
    gap: var(--s3);
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--warn);
    border-radius: var(--r-lg);
    padding: var(--s3) var(--s4);
}
.alert.bad {
    border-left-color: var(--loss);
}
.alert.info {
    border-left-color: var(--info);
}
.alert .icon {
    color: var(--warn);
}
.alert.bad .icon {
    color: var(--loss);
}
.alert.info .icon {
    color: var(--info);
}
.alert-body {
    flex: 1;
    min-width: 0;
}
.alert-body strong {
    display: block;
    font-weight: 600;
}
.alert-body span {
    color: var(--muted);
    font-size: 12.5px;
}

/* ============================== SETUP CHECKLIST ============================== */

.checklist-progress {
    height: 6px;
    background: var(--card-alt);
    border-radius: 999px;
    overflow: hidden;
    margin: var(--s3) 0 var(--s4);
}
.checklist-progress > div {
    height: 100%;
    background: var(--primary);
}
.checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--s3);
}
.check-item {
    display: flex;
    gap: var(--s2);
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s3);
    background: var(--card);
}
.check-item .icon {
    color: var(--line-strong);
}
.check-item.done .icon {
    color: var(--primary);
}
.check-item strong {
    display: block;
    font-weight: 600;
}
.check-item a {
    font-size: 12.5px;
}

/* ============================== BUTTONS & FORMS ============================== */

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    font: 600 13.5px / 1 var(--font-body);
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
button:hover,
.button:hover {
    background: var(--card-alt);
}
button.primary,
.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
button.primary:hover,
.button.primary:hover {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}
button.dark {
    background: var(--slate-900);
    border-color: var(--slate-900);
    color: var(--card);
}
button.danger-solid {
    background: var(--loss);
    border-color: var(--loss);
    color: #fff;
}
button.danger {
    color: var(--loss);
}
button.big {
    min-height: 46px;
    font-size: 15px;
    width: 100%;
}
button.link {
    min-height: 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
}
button.link.danger {
    color: var(--loss);
}
button.icon-only {
    padding: 0 8px;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

label {
    display: block;
    font-weight: 600;
    font-size: 12.5px;
    margin-bottom: 4px;
}
.field {
    margin-bottom: var(--s4);
}
.hint {
    font-weight: 400;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    font: 14px var(--font-body);
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    padding: 7px 10px;
}
textarea {
    min-height: 5rem;
    resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
}
input[type='number'] {
    font-family: var(--font-mono);
}

.row {
    display: flex;
    gap: var(--s3);
    flex-wrap: wrap;
    align-items: flex-end;
}
.row > .field {
    flex: 1 1 8rem;
}
.inline {
    display: flex;
    gap: var(--s2);
    align-items: center;
}
.inline > :first-child {
    flex: 1;
    min-width: 0;
}
.inline > :not(:first-child) {
    flex: none;
}

.money-input {
    position: relative;
}
.money-input::before {
    content: '£';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-family: var(--font-mono);
}
.money-input input {
    padding-left: 24px;
}

.search {
    position: relative;
}
.search .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}
.search input {
    padding-left: 36px;
}

.checkbox {
    display: flex;
    gap: var(--s2);
    align-items: flex-start;
    font-weight: 400;
    font-size: 14px;
}
.checkbox input {
    width: auto;
    min-height: 0;
    margin-top: 3px;
    accent-color: var(--primary);
}

.toolbar {
    display: flex;
    gap: var(--s3);
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: var(--s4);
}
.toolbar .search {
    flex: 1 1 260px;
}
.toolbar select {
    width: auto;
}

/* Filter chips (e.g. order status) */
.chips {
    display: flex;
    gap: var(--s2);
    flex-wrap: wrap;
}
.chip {
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 12.5px;
    background: var(--card-alt);
    border-color: transparent;
}
.chip[aria-pressed='true'] {
    background: var(--slate-900);
    color: var(--card);
}

/* ============================== BADGES ============================== */

.badge,
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    white-space: nowrap;
    background: var(--card-alt);
    color: var(--muted);
}
.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status.good,
.badge.good {
    background: var(--primary-tint);
    color: var(--primary);
}
.status.bad,
.badge.bad {
    background: var(--loss-tint);
    color: var(--loss);
}
.status.warn,
.badge.warn {
    background: var(--warn-tint);
    color: var(--warn);
}
.status.info,
.badge.info {
    background: var(--info-tint);
    color: var(--info);
}

/* ============================== TABLES ============================== */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
}
.panel .table-wrap {
    border: none;
    border-radius: 0;
    margin: 0 calc(-1 * var(--s5));
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px var(--s5);
    border-bottom: 1px solid var(--line);
    background: var(--card-alt);
    white-space: nowrap;
}
td {
    padding: 12px var(--s5);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
tbody tr:last-child td {
    border-bottom: none;
}
tbody tr:hover td {
    background: color-mix(in srgb, var(--card-alt) 60%, transparent);
}
tr.selected td {
    background: var(--primary-tint) !important;
}
td.money,
th.money,
td.num,
th.num {
    text-align: right;
}

.product-cell {
    display: flex;
    gap: var(--s3);
    align-items: center;
    min-width: 220px;
}
.product-cell strong {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}
.product-cell .sku {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
}
.thumb {
    width: 48px;
    height: 48px;
    flex: none;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--card-alt);
}
.thumb.lg {
    width: 72px;
    height: 72px;
}

.empty,
.loading-text {
    color: var(--muted);
    padding: var(--s6) 0;
    text-align: center;
}
.panel .empty {
    padding: var(--s8) 0;
}

/* ============================== PRICING LEDGER (signature element) ============================== */

.pricing {
    position: sticky;
    top: 76px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
}
.pricing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--line);
    background: var(--card-alt);
}
.pricing-head h2 {
    margin: 0;
    font-size: 16px;
    display: flex;
    gap: var(--s2);
    align-items: center;
}
.pricing-body {
    padding: var(--s5);
}
.pricing-product {
    display: flex;
    gap: var(--s3);
    margin-bottom: var(--s4);
}

.quick-profits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s2);
    margin-bottom: var(--s4);
}
.quick-profits button {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12.5px;
}

.ledger {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s4);
    margin-bottom: var(--s4);
    font-variant-numeric: tabular-nums;
}
.ledger-line {
    display: flex;
    justify-content: space-between;
    gap: var(--s4);
    padding: 3px 0;
    font-size: 13px;
}
.ledger-line > :last-child {
    font-family: var(--font-mono);
    white-space: nowrap;
}
.ledger-line.minus {
    color: var(--muted);
}
.ledger-line.minus > :last-child {
    color: var(--loss);
}
.ledger-line.total {
    margin-top: var(--s2);
    padding-top: var(--s3);
    border-top: 1px dashed var(--line-strong);
    font-weight: 600;
    font-size: 14px;
}
.profit-box {
    text-align: center;
    margin-top: var(--s3);
    padding: var(--s4);
    border-radius: var(--r-lg);
    background: var(--card-alt);
}
.profit-figure {
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 4px 0 6px;
    transition: color 150ms ease;
}
.profit-figure.gain {
    color: var(--primary);
}
.profit-figure.loss {
    color: var(--loss);
}

.suggestions {
    list-style: none;
    margin: var(--s2) 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    max-height: 14rem;
    overflow: auto;
}
.suggestions li button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-weight: 400;
    padding: 8px 10px;
}
.suggestions li:last-child button {
    border-bottom: none;
}

/* ============================== INLINE PRICE POPOVER (My listings) ============================== */

.price-cell {
    position: relative;
}
.price-button {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    border-style: dashed;
}
/* Fixed (not absolute) so the scrolling table can't clip it; reseller.js sets top/left. */
.popover {
    position: fixed;
    z-index: 20;
    width: min(320px, calc(100vw - 16px));
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
    padding: var(--s4);
}
.popover .ledger {
    margin-bottom: var(--s3);
}
.popover-actions {
    display: flex;
    gap: var(--s2);
}
.popover-actions button.primary {
    flex: 1;
}

/* ============================== ORDER CARDS & TIMELINE ============================== */

.order-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s5);
    margin-bottom: var(--s4);
}
.order-card.bad {
    border-left: 3px solid var(--loss);
}
.order-head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
    align-items: center;
    margin-bottom: var(--s4);
}
.order-head .ref {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px;
}
.order-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    gap: var(--s4);
}
@media (max-width: 760px) {
    .order-grid {
        grid-template-columns: 1fr;
    }
}
.money-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s2);
    background: var(--card-alt);
    border-radius: var(--r-lg);
    padding: var(--s3);
}
.money-grid div {
    font-family: var(--font-mono);
    font-weight: 600;
}
.money-grid .label {
    display: block;
    margin-bottom: 2px;
}

.timeline {
    display: flex;
    margin-top: var(--s5);
}
.timeline .step {
    flex: 1;
    position: relative;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}
.timeline .step::before {
    content: '';
    position: absolute;
    top: 13px;
    left: -50%;
    width: 100%;
    height: 3px;
    background: var(--line);
    z-index: 0;
}
.timeline .step:first-child::before {
    display: none;
}
.timeline .step.done::before,
.timeline .step.current::before {
    background: var(--primary);
}
.timeline .step.failed::before {
    background: var(--loss);
}
.timeline .node {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    margin: 0 auto 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-alt);
    color: var(--muted);
    border: 2px solid var(--line);
}
.timeline .node .icon {
    font-size: 16px;
}
.timeline .done .node {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.timeline .current .node {
    background: var(--info-tint);
    border-color: var(--info);
    color: var(--info);
}
.timeline .failed .node {
    background: var(--loss);
    border-color: var(--loss);
    color: #fff;
}
.timeline .step strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}
.timeline .failed strong {
    color: var(--loss);
}

/* ============================== STAFF: PACKING QUEUE ============================== */

.queue-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: var(--s4);
    overflow: hidden;
}
.queue-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s5);
    background: var(--card-alt);
    border-bottom: 1px solid var(--line);
}
.queue-card-head .ref {
    font-family: var(--font-mono);
    font-weight: 700;
}
.queue-card-head .age {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}
.queue-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: var(--s5);
    padding: var(--s5);
}
@media (max-width: 960px) {
    .queue-card-body {
        grid-template-columns: 1fr;
    }
}
.ship-to {
    font-size: 14px;
    line-height: 1.5;
}
.ship-to strong {
    font-size: 15px;
}
.ship-form {
    display: grid;
    gap: var(--s2);
}
.ship-form .row {
    gap: var(--s2);
}
.qty {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
}

/* ============================== FUNDS ============================== */

.fund-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--s4);
}
.fund-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s5);
}
.fund-card .code {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
}
.share-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--card-alt);
    margin: var(--s3) 0 var(--s2);
}
.share-bar > span {
    display: block;
    height: 100%;
}
.share-list {
    list-style: none;
    margin: 0 0 var(--s3);
    padding: 0;
    font-size: 13px;
}
.share-list li {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: 2px 0;
}
.share-list .swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex: none;
}
.fund-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s2);
    border-top: 1px solid var(--line);
    padding-top: var(--s3);
}
.fund-stats div {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Distinct, colour-blind-safe-ish swatches for investor shares (by position). */
.sw-0 {
    background: #00873f;
}
.sw-1 {
    background: #0284c7;
}
.sw-2 {
    background: #d97706;
}
.sw-3 {
    background: #7c3aed;
}
.sw-4 {
    background: #db2777;
}
.sw-5 {
    background: #475569;
}

/* ============================== SCREEN DETAILS ============================== */

/* Panel whose table runs edge to edge. */
.panel.flush {
    padding: 0;
    overflow: hidden;
}
.panel.flush .table-wrap {
    margin: 0;
    border: none;
    border-radius: 0;
}
.panel.flush > .empty,
.panel.flush > .loading-text {
    padding: var(--s8) var(--s4);
}

.icon.xs {
    font-size: 14px;
}
.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
.section-title {
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin: var(--s2) 0 var(--s3);
}
.section-title .icon {
    color: var(--loss);
}
.who-name {
    font-weight: 600;
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-head .label {
    display: block;
}
#home-attention {
    margin-bottom: var(--s5);
}

/* Notice with an icon on the left (e.g. "postage included"). */
.notice.banner {
    display: flex;
    gap: var(--s3);
    align-items: flex-start;
    max-width: none;
}
.notice.banner .icon {
    color: var(--primary);
}
.notice.tip {
    margin: var(--s4) 0 0;
}

.alert.banner-alert {
    margin-bottom: var(--s5);
    flex-wrap: wrap;
    background: var(--loss-tint);
}
.alert .button,
.alert button {
    flex: none;
}

.cell-extra {
    margin-top: 4px;
    display: flex;
    gap: var(--s1);
    flex-wrap: wrap;
}
.product-cell .sku {
    display: block;
}
div.thumb {
    display: block;
}
.thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--line-strong);
}
.no-icons .icon {
    display: none !important;
}
/* Icon-only buttons fall back to their label when icons can't load. */
.no-icons .icon-only::after {
    content: attr(aria-label);
}
.shop-chip {
    text-decoration: none;
}
.row-actions {
    display: inline-flex;
    gap: var(--s2);
    justify-content: flex-end;
}
.error-text {
    max-width: 28ch;
    margin-top: 4px;
}

/* Pricing drawer extras */
.pricing-empty {
    padding: var(--s8) var(--s6);
    text-align: center;
    color: var(--muted);
}
.pricing-empty .icon {
    font-size: 40px;
    color: var(--primary);
    background: var(--primary-tint);
    border-radius: 50%;
    padding: 12px;
    margin-bottom: var(--s3);
}
.pricing-empty p {
    margin: 0 auto;
}
.pricing-product h3 {
    margin: 2px 0 6px;
}
.pricing-product .sku {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--primary);
}
.quick-label {
    margin-bottom: 6px;
}
.drawer-subhead {
    margin-top: var(--s5);
    padding-top: var(--s4);
    border-top: 1px solid var(--line);
}
.ledger-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--s2);
    padding-bottom: var(--s2);
    border-bottom: 1px solid var(--line);
}

/* My listings: price editor */
.price-button .icon {
    color: var(--muted);
}
.popover-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--s3);
}
.popover-head strong {
    display: flex;
    align-items: center;
    gap: 6px;
}
.popover .field {
    margin-bottom: var(--s3);
}
.ledger.compact {
    padding: var(--s3);
}
.ledger.compact .ledger-line.total {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.ledger-line.was {
    color: var(--muted);
}
.ledger-line.was > :last-child {
    text-decoration: line-through;
}

/* Orders */
.order-head-end {
    margin-left: auto;
}
.order-note {
    margin: var(--s3) 0 0;
}
.profit-cell {
    background: var(--card);
    border-radius: var(--r-sm);
    padding: 4px 8px;
}
@media (max-width: 760px) {
    .money-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .order-head-end {
        margin-left: 0;
        width: 100%;
    }
    .timeline .step span {
        display: none;
    }
}

/* Settings */
.shop-row,
.card-row {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card-alt);
    margin-bottom: var(--s3);
}
.shop-avatar,
.card-visual {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 13px var(--font-mono);
    color: var(--info);
    background: var(--info-tint);
}
.card-visual {
    width: 56px;
    height: 38px;
    font-size: 10px;
    color: #fff;
    background: var(--slate-900);
}
@media (prefers-color-scheme: dark) {
    .card-visual {
        color: var(--canvas);
    }
}
.shop-info {
    flex: 1;
    min-width: 0;
}
.shop-info strong {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.shop-info span {
    display: block;
}
.inline-actions {
    display: flex;
    gap: var(--s2);
    flex-wrap: wrap;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    gap: var(--s3);
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}
.detail-row:last-child {
    border-bottom: none;
}
.choice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 var(--s2);
    font-weight: 400;
    margin-bottom: var(--s3);
}
.choice input {
    width: auto;
    min-height: 0;
    margin-top: 3px;
    accent-color: var(--primary);
    grid-row: span 2;
}

@media (max-width: 860px) {
    .topbar .who-name {
        display: none;
    }
    .page-head .actions {
        width: 100%;
    }
    .page-head .actions .button {
        flex: 1;
    }
}

/* ============================== STAFF SCREENS ============================== */

.section-title.plain .icon {
    color: var(--primary);
}
.split.even {
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 1100px) {
    .split.even {
        grid-template-columns: 1fr;
    }
}
tr.inactive td {
    opacity: 0.6;
}
.grow {
    flex: 1;
}
.warn-text {
    color: var(--warn);
    margin: var(--s2) 0 0;
}

/* Packing queue */
.queue-card.next {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}
.queue-card .label {
    display: block;
    margin-bottom: var(--s2);
}
.pick {
    display: flex;
    gap: var(--s3);
    align-items: flex-start;
}
.pick strong {
    display: block;
    line-height: 1.3;
}
.pick .sku {
    display: block;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
}
.pick .qty {
    margin-top: var(--s2);
    font-size: 22px;
}
.ship-to strong {
    display: block;
}
.ship-form label {
    margin-bottom: 2px;
}
.ship-form .field {
    margin-bottom: 0;
}
.ship-form .narrow-field {
    flex: 0 1 8rem;
}
.ship-form button.link {
    justify-self: center;
}

/* Today: right-hand blockers column */
.side-panel {
    padding: var(--s4);
}
.side-panel .panel-head {
    margin-bottom: var(--s3);
}
.side-panel h2 {
    font-size: 15px;
}
.side-list {
    display: grid;
    gap: var(--s2);
}
.side-row {
    display: flex;
    gap: var(--s3);
    align-items: center;
    justify-content: space-between;
    padding: var(--s2) 0;
    border-top: 1px solid var(--line);
}
.side-row:first-child {
    border-top: none;
    padding-top: 0;
}
.side-row strong {
    display: block;
    font-weight: 600;
    font-size: 13px;
}
.side-row span {
    display: block;
}

/* Stock grouped by fund */
.fund-section {
    margin-bottom: var(--s5);
}
.fund-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--line);
}
.fund-section-head .code,
.fund-card .code {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-tint);
    padding: 2px 8px;
    border-radius: var(--r-sm);
}

/* Fund cards */
.fund-grid {
    margin-bottom: var(--s5);
}
.fund-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--s2);
}
.fund-card h3 {
    margin-bottom: var(--s3);
}
.sell-through {
    display: flex;
    justify-content: space-between;
}
.fund-card .checklist-progress {
    margin: var(--s2) 0 var(--s4);
}
.fund-stats {
    margin-bottom: var(--s4);
}
.fund-stats .label {
    display: block;
    margin-bottom: 2px;
}
.investors-label {
    margin-top: var(--s2);
}

/* Reseller applications */
.application-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--s4);
    margin-bottom: var(--s5);
}
.application {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s5);
    display: flex;
    flex-direction: column;
    gap: var(--s4);
}
.application-head {
    display: flex;
    gap: var(--s3);
    align-items: center;
}
.application-head h3 {
    margin: 0;
}
.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s3);
    background: var(--card-alt);
    border-radius: var(--r-lg);
    padding: var(--s3);
    font-size: 13px;
}
.facts .label {
    display: block;
    margin-bottom: 2px;
}
.application-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--s2);
}

.fee-row > .field {
    flex: 1 1 10rem;
}

/* ============================== AUTH & AGREEMENT PAGES ============================== */

.auth {
    max-width: 420px;
    margin: 8vh auto var(--s8);
    padding: 0 var(--s4);
}
.auth .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s6);
}
.auth .brand,
.agreement .brand {
    margin-bottom: var(--s5);
}
.auth button.primary {
    width: 100%;
    min-height: 42px;
}

.agreement {
    max-width: 46rem;
    margin: var(--s8) auto;
    padding: 0 var(--s4);
}
.agreement h2 {
    margin-top: var(--s6);
}

/* ============================== FEEDBACK: PROGRESS, SPINNERS, TOAST, DIALOG ============================== */

.progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 30%, var(--primary) 70%, transparent 100%) 0 0 /
        40% 100% no-repeat;
}
.progress.active {
    opacity: 1;
    animation: progress-sweep 1.1s ease-in-out infinite;
}
@keyframes progress-sweep {
    from {
        background-position: -40% 0;
    }
    to {
        background-position: 140% 0;
    }
}

button[aria-busy='true'] {
    opacity: 0.85;
    cursor: progress;
}
button[aria-busy='true']::before {
    content: '';
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.toast {
    position: fixed;
    right: var(--s6);
    bottom: var(--s6);
    max-width: 420px;
    background: var(--slate-900);
    color: var(--card);
    padding: var(--s3) var(--s4);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-pop);
    z-index: 40;
}
.toast.error {
    background: var(--loss);
    color: #fff;
}
@media (max-width: 860px) {
    .toast {
        left: var(--s4);
        right: var(--s4);
        bottom: 84px;
    }
}

.dialog {
    width: min(34rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s6) var(--s6) 0;
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-pop);
}
.dialog::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
}
.dialog-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: var(--s3);
    margin: var(--s4) calc(-1 * var(--s6)) 0;
    padding: var(--s4) var(--s6);
    background: var(--card);
    border-top: 1px solid var(--line);
}

details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
}
pre {
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--card-alt);
    padding: var(--s3);
    border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
    .progress.active {
        animation: none;
        background: var(--primary);
    }
    button[aria-busy='true']::before {
        animation: none;
        border-right-color: currentColor;
        border-style: dotted;
    }
}
td .mono {
    white-space: nowrap;
}

/* Phones: number tiles two per row and tighter, so the work (queue, orders) starts higher up. */
@media (max-width: 640px) {
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--s2);
    }
    .metric {
        padding: var(--s3);
    }
    .metric-value {
        font-size: 22px;
        margin-top: var(--s1);
    }
    .metric-note {
        font-size: 11.5px;
    }
    .metric-top .icon {
        display: none;
    }
    h1 {
        font-size: 24px;
    }
}

/* Stock screen: one row per product, its stock lines (one SKU per investor group) listed inside. */
.line-list {
    display: grid;
    gap: 6px;
    min-width: 260px;
}
.line-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2);
}
.sku-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--r-sm);
    background: var(--card-alt);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.line-list .add-line {
    justify-self: start;
    font-size: 12.5px;
}
.category-form {
    margin-top: var(--s4);
}
.category-form button {
    margin-bottom: var(--s4);
}

/* ============================== FULFILMENT ============================== */

.form-section {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s3) var(--s4) 0;
    margin: 0 0 var(--s4);
}
.form-section legend {
    font-weight: 600;
    font-size: 13px;
    padding: 0 var(--s1);
}
button.link.warn-link {
    color: var(--warn);
}

.queue-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s3);
}
.queue-tools .checkbox {
    margin: 0;
}
.queue-tick {
    width: 18px;
    height: 18px;
    min-height: 0;
    accent-color: var(--primary);
}
.queue-card.ticked {
    border-color: var(--info);
}
.pick-lines {
    display: grid;
    gap: 4px;
    margin: var(--s3) 0;
}
.location {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--info);
}
.parcel-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1);
}
a.badge {
    text-decoration: none;
}

/* Pick lists and packing slips: hidden on screen, the only thing printed. */
#print-area {
    display: none;
}
@media print {
    body {
        background: #fff;
        color: #000;
        padding: 0;
    }
    body > *:not(#print-area) {
        display: none !important;
    }
    #print-area {
        display: block;
    }
    .print-page {
        font: 11pt/1.4 var(--font-body);
        color: #000;
    }
    .print-page + .print-page {
        break-before: page;
    }
    .print-page h1 {
        font-size: 18pt;
        margin: 0 0 4pt;
        color: #000;
    }
    .print-page h2 {
        font-size: 12pt;
        margin: 14pt 0 4pt;
        color: #000;
    }
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 6pt;
    }
    .print-table th,
    .print-table td {
        border: 1px solid #999;
        padding: 4pt 6pt;
        text-align: left;
        vertical-align: top;
        background: none;
        color: #000;
        text-transform: none;
        letter-spacing: 0;
        font-size: 10pt;
    }
    .print-table .num {
        text-align: right;
    }
    .print-table .strong {
        font-weight: 700;
    }
    .print-table .tick-box {
        width: 18pt;
        text-align: center;
        font-size: 13pt;
    }
    .slip-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12pt;
        margin: 10pt 0;
    }
    .slip-shop {
        font-size: 12pt;
    }
    .slip-foot {
        margin-top: 18pt;
        font-size: 9pt;
    }
}

/* ============================== POP-UP WINDOWS (openModal) ============================== */

.modal {
    width: min(44rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
}
.modal.lg {
    width: min(56rem, calc(100vw - 2rem));
}
.modal::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}
.modal-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--line);
}
.modal-title {
    margin: 0;
    font-size: 18px;
}
.modal-body {
    padding: var(--s5);
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-top: 1px solid var(--line);
    background: var(--card-alt);
}
.modal-footer:empty {
    display: none;
}
.modal-footer .footer-hint {
    margin-right: auto;
}
.modal-busy {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s3);
    padding: var(--s6);
    text-align: center;
    background: color-mix(in srgb, var(--card) 92%, transparent);
}
.modal-busy strong {
    font-size: 18px;
}
@media (max-width: 640px) {
    .modal,
    .modal.lg {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    .modal-inner {
        max-height: 100vh;
        height: 100%;
    }
    .modal-footer {
        flex-wrap: wrap;
    }
    .modal-footer button {
        flex: 1;
    }
    .modal-footer .footer-hint {
        width: 100%;
    }
}

button.big-ish {
    min-height: 44px;
    padding: 0 20px;
    font-size: 15px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid var(--line-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
.spinner.lg {
    width: 48px;
    height: 48px;
    border-width: 5px;
}
.loading-line {
    display: flex;
    align-items: center;
    gap: var(--s2);
    color: var(--muted);
}

/* ============================== LISTING WIZARD ============================== */

.wizard-head {
    margin-bottom: var(--s4);
}
.steps {
    display: flex;
    gap: var(--s2);
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s4);
    flex-wrap: wrap;
}
.steps li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    background: var(--card-alt);
    color: var(--muted);
    font-weight: 500;
    font-size: 13px;
}
.steps .step-no {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--line-strong);
    font-weight: 700;
    font-size: 12px;
}
.steps li.current {
    background: var(--primary-tint);
    color: var(--primary);
}
.steps li.current .step-no {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.steps li.done .step-no {
    background: var(--primary-tint);
    border-color: var(--primary);
    color: var(--primary);
}
.wizard-product {
    display: flex;
    gap: var(--s3);
    align-items: center;
    margin-bottom: var(--s3);
}
.wizard-product strong {
    display: block;
}
.wizard-section {
    border-top: 1px solid var(--line);
    padding-top: var(--s4);
    margin-top: var(--s4);
}
.wizard-section h3 {
    margin-bottom: var(--s2);
}
.big-input input {
    font-size: 22px;
    min-height: 52px;
    font-weight: 700;
}
.big-input::before {
    font-size: 18px;
}
.breakdown {
    margin-top: var(--s3);
}
.breakdown .ledger {
    margin-top: var(--s2);
}
.chosen {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
}
.chosen strong {
    color: var(--ink);
}
.choice-list {
    display: grid;
    gap: var(--s2);
    margin-bottom: var(--s3);
}
.choice-button {
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    min-height: 44px;
    font-weight: 500;
}
.choice-button.selected {
    border-color: var(--primary);
    background: var(--primary-tint);
    color: var(--ink);
    box-shadow: 0 0 0 1px var(--primary);
}
.aspect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0 var(--s4);
}
.field .req {
    color: var(--loss);
    font-weight: 400;
    font-size: 11px;
}
.field-error input,
.field-error select {
    border-color: var(--loss);
    box-shadow: 0 0 0 3px var(--loss-tint);
}
.field-message {
    display: block;
    color: var(--loss);
    font-size: 12.5px;
    margin-top: 4px;
}
.check-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--s4);
    align-items: start;
}
@media (max-width: 760px) {
    .check-grid {
        grid-template-columns: 1fr;
    }
}
.summary-card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s3) var(--s4);
}
.success-screen {
    text-align: center;
    padding: var(--s6) var(--s4);
}
.success-screen p {
    margin-left: auto;
    margin-right: auto;
}
.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--s4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
}
.success-icon .icon {
    font-size: 44px;
}

/* ============================== NOTIFICATIONS ============================== */

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--s2);
    font-size: 14.5px;
    border-left: 4px solid var(--primary);
}
.toast.success {
    background: var(--slate-900);
    color: var(--card);
}
.toast.success .icon {
    color: #22c55e;
}
.toast.error {
    border-left-color: #7f1d1d;
}
.toast-text {
    flex: 1;
}
.toast-close {
    min-height: 0;
    padding: 0 4px;
    border: none;
    background: none;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    opacity: 0.8;
}
.no-icons .success-icon::after {
    content: '✓';
    font-size: 40px;
    font-weight: 700;
}

/* ============================== SIGN-UP CODES, MY SELLERS, BELL ============================== */

.field-message.good {
    color: var(--primary);
}
.field-message:empty {
    display: none;
}
.code-input {
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.account-type {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s3) var(--s4) 0;
    margin: 0 0 var(--s4);
}
.account-type legend {
    font-weight: 600;
    padding: 0 var(--s1);
}

.bell {
    position: relative;
}
.bell-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--loss);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.notification-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s3);
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--line);
}
.notification-list li:last-child {
    border-bottom: none;
}
.notification-list li > .icon {
    color: var(--muted);
}
.notification-list li.unread > .icon {
    color: var(--primary);
}
.notification-list li.unread strong::after {
    content: ' • new';
    color: var(--primary);
    font-size: 12px;
}
.notification-list p {
    margin: 2px 0 4px;
}
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
    padding: var(--s6) 0;
}

.code-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s4);
}
.code-card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s4);
    background: var(--card-alt);
    margin-bottom: var(--s3);
}
.code-cards .code-card {
    margin-bottom: 0;
}
.code-card.paused .code-value {
    opacity: 0.5;
    text-decoration: line-through;
}
.code-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s2);
}
.code-value {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: var(--s2) 0;
    user-select: all;
    overflow-wrap: anywhere;
}
.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2);
}

.metric-progress {
    height: 6px;
    background: var(--card-alt);
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0;
}
.metric-progress > div {
    height: 100%;
    background: var(--primary);
}
.markup-preview {
    background: var(--card-alt);
    border-radius: var(--r-sm);
    padding: var(--s3);
    line-height: 1.7;
    margin-bottom: var(--s3);
}
.markup-preview:empty {
    display: none;
}
.code-value.small-code {
    font-size: 15px;
    margin: 0;
}
.button-row.end {
    justify-content: flex-end;
}

/* Columns that only fit on a wide screen; .phone-only lines repeat what they said. */
.phone-only {
    display: none;
}
@media (max-width: 600px) {
    .wide-only {
        display: none;
    }
    .phone-only {
        display: block;
    }
    #network-prices .thumb {
        display: none;
    }
    #network-prices .product-cell {
        min-width: 0;
    }
    #network-prices th {
        white-space: normal;
    }
    #network-prices td,
    #network-prices th {
        padding-left: var(--s2);
        padding-right: var(--s2);
    }
}
.fact-list {
    margin: 0 0 var(--s3);
    padding-left: 1.2em;
    line-height: 1.6;
}
.reward-line {
    margin-bottom: var(--s4);
}

/* ============================== SELLER SCREENS: EASY READING (2026-10-20) ==============================
   For people who don't read easily: 16px text, no tiny capital-letter labels,
   bigger buttons, words next to icons. Only the seller dashboard (body.seller). */

body.seller {
    font-size: 16px;
    line-height: 1.5;
}
body.seller .small {
    font-size: 14px;
}
body.seller .label,
body.seller th,
body.seller .badge,
body.seller .status {
    font-family: var(--font-body);
    text-transform: none;
    letter-spacing: 0;
}
body.seller .label,
body.seller th {
    font-size: 14px;
    font-weight: 600;
}
body.seller .badge,
body.seller .status {
    font-size: 13px;
}
body.seller .money,
body.seller .num,
body.seller .mono {
    font-family: var(--font-body);
}
body.seller button,
body.seller .button {
    min-height: 44px;
    font-size: 15px;
}
body.seller h1 {
    font-size: 32px;
}
body.seller h2 {
    font-size: 20px;
}
body.seller .page-head p {
    font-size: 17px;
}
body.seller .tabs a {
    gap: 6px;
    font-size: 15px;
}
body.seller .metric-note {
    font-size: 14px;
}
body.seller .sku {
    font-family: var(--font-body);
    font-size: 13px;
}
.icon.xs {
    font-size: 14px;
}
.icon.lg {
    font-size: 40px;
}

/* Help button in the top bar */
.help-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Big full-width buttons */
button.full,
.button.full {
    width: 100%;
    justify-content: center;
}
.button.big {
    min-height: 48px;
    font-size: 16px;
    padding: 0 var(--s5);
}
button.small-button {
    min-height: 32px !important;
    font-size: 13px !important;
    padding: 0 10px;
    gap: 4px;
}

/* ---------- Products as cards ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--s5);
}
.product-grid.three {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.product-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition:
        box-shadow 0.15s,
        transform 0.15s;
}
.product-card:hover {
    box-shadow: var(--shadow-pop);
    transform: translateY(-2px);
}
.product-card.sold-out {
    opacity: 0.75;
}
.product-photo {
    position: relative;
    display: block;
    padding: 0;
    border: none;
    border-radius: 0;
    background: var(--card-alt);
    min-height: 0 !important;
    cursor: zoom-in;
}
.thumb.card {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 0;
}
.thumb.card.placeholder .icon,
.thumb.xl.placeholder .icon {
    font-size: 64px;
}
.photo-flag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--ink);
    color: var(--card);
    font-weight: 700;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 999px;
}
.product-body {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    padding: var(--s4);
    flex: 1;
}
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}
.product-tags:empty {
    display: none;
}
.badge.hot {
    background: #fff1e6;
    color: #c2410c;
}
@media (prefers-color-scheme: dark) {
    .badge.hot {
        background: rgba(251, 146, 60, 0.15);
        color: #fdba74;
    }
}
.product-title {
    font-size: 17px;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.price-facts {
    margin: 0;
    display: grid;
    gap: 4px;
}
.price-facts > div {
    display: flex;
    justify-content: space-between;
    gap: var(--s3);
}
.price-facts dt {
    color: var(--muted);
}
.price-facts dd {
    margin: 0;
    font-weight: 700;
}
.price-facts .you-make {
    background: var(--primary-tint);
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 2px;
}
.price-facts .you-make dt {
    color: var(--ink);
    font-weight: 600;
}
.price-facts .you-make dd {
    font-size: 18px;
}
.price-facts.big {
    font-size: 17px;
    margin: var(--s3) 0;
}
.stock-line {
    color: var(--muted);
    margin: 0;
}
.product-body > button.primary {
    margin-top: auto;
}
.empty-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s2);
    padding: var(--s8);
    background: var(--card);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    text-align: center;
}
.empty-card .icon {
    color: var(--muted);
}

/* Product details pop-up */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s6);
}
@media (max-width: 700px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}
.thumb.xl {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
}
.thumb-strip {
    display: flex;
    gap: var(--s2);
    margin-top: var(--s2);
    flex-wrap: wrap;
}
.thumb-button {
    padding: 0;
    border: none;
    background: none;
    min-height: 0 !important;
}
.description {
    white-space: pre-line;
}
.aspect-list {
    margin: 0;
    display: grid;
    gap: 4px;
}
.aspect-list > div {
    display: flex;
    gap: var(--s3);
}
.aspect-list dt {
    color: var(--muted);
    min-width: 40%;
}
.aspect-list dd {
    margin: 0;
}

/* Home: how it works */
.how-steps {
    list-style: none;
    margin: 0 0 var(--s5);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s4);
}
.how-step {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.how-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-tint);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.how .button.big {
    display: inline-flex;
}
.popular {
    margin-bottom: var(--s6);
}

/* Listings: price + change button */
.price-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Help pop-up */
.help-list {
    display: grid;
    gap: var(--s2);
}
.help-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 var(--s4);
    background: var(--card);
}
.help-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: var(--s3) 0;
    list-style-position: inside;
}
.help-item[open] summary {
    color: var(--primary);
}
.help-contact {
    margin-top: var(--s4);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* The seller top bar holds more (Help, bell, shop) at 16px: keep it on one line. */
body.seller .topbar {
    gap: var(--s4);
    padding: 0 var(--s4);
}
body.seller .tabs a {
    padding: 0 10px;
}
body.seller .who {
    gap: var(--s2);
}
@media (max-width: 1440px) {
    body.seller .who-name {
        display: none;
    }
}
@media (max-width: 1180px) {
    body.seller .shop-chip {
        display: none !important;
    }
    body.seller .tabs .icon {
        display: none;
    }
}

/* Numbers in the seller app use the normal font (monospace looks like code). */
body.seller .profit-figure,
body.seller .quick-profits button,
body.seller input {
    font-family: var(--font-body);
}
.reset-link {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
}

/* eBay category "Find" helper (staff product and category forms) */
.cat-finder {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}
.cat-finder .inline {
    display: flex;
    gap: 6px;
}
.cat-finder input[type='search'] {
    flex: 1;
    min-width: 0;
}
.cat-results {
    max-height: 240px;
    overflow: auto;
}
.cat-results .choice-button {
    text-align: left;
}
.cat-chosen:empty {
    display: none;
}

/* ============================ STOCK SCREEN ============================ */
.sort-label {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}
.stock-filters {
    margin-bottom: var(--s2);
}
.chip.chip-warn {
    background: var(--warn-tint);
    color: var(--warn);
}
.chip.chip-bad {
    background: var(--loss-tint);
    color: var(--loss);
}
.chip.chip-warn[aria-pressed='true'],
.chip.chip-bad[aria-pressed='true'] {
    color: var(--card);
}
.chip.chip-warn[aria-pressed='true'] {
    background: var(--warn);
}
.chip.chip-bad[aria-pressed='true'] {
    background: var(--loss);
}
.stock-legend {
    margin: 0 0 var(--s3);
    max-width: 80ch;
}
td.big-num {
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.stock-level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    white-space: nowrap;
}
.stock-level.ok {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}
.stock-level.low {
    color: var(--warn);
}
.stock-level.out {
    color: var(--loss);
}
tr.row-out td:first-child {
    box-shadow: inset 4px 0 0 var(--loss);
}
tr.row-out td {
    background: var(--loss-tint);
}
tr.row-low td:first-child {
    box-shadow: inset 4px 0 0 var(--warn);
}

/* "This is an estimate, not financial advice" notes */
.estimate-note {
    color: var(--muted);
    margin: var(--s2) 0;
    max-width: 75ch;
}
.estimate-note .icon {
    vertical-align: -2px;
}

/* Investor group cards: edit buttons */
.fund-card-head {
    gap: var(--s2);
}
.fund-card-head .code {
    margin-right: auto;
}
.share-list li .link {
    font-size: 12.5px;
}
button.link.danger-link {
    color: var(--loss);
}
#investors .chips {
    gap: 4px;
}

/* Product photo uploader (staff) */
.photo-uploader {
    display: grid;
    gap: var(--s2);
    margin-top: var(--s2);
}
.photo-uploader .inline {
    display: flex;
    gap: var(--s3);
    align-items: center;
    flex-wrap: wrap;
}
.photo-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
}
.photo-thumbs:empty {
    display: none;
}
.photo-thumb {
    margin: 0;
    width: 104px;
    display: grid;
    gap: 4px;
}
.photo-thumb img {
    width: 104px;
    height: 104px;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--card-alt);
}
.photo-thumb figcaption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2px 6px;
    font-size: 12px;
}
#stock-table td:first-child {
    max-width: 340px;
}
#stock-table .line-list {
    min-width: 230px;
}
#stock-table th {
    white-space: normal;
}
.investors-panel > .panel-head,
.price-changes-panel > .panel-head {
    padding: var(--s4) var(--s5) var(--s3);
    gap: var(--s3);
}
.investors-panel #investor-search {
    max-width: 320px;
}

/* "Our prices are changing" pop-up (sellers must acknowledge) */
.price-notice-list {
    list-style: none;
    padding: 0;
    margin: var(--s3) 0;
    display: grid;
    gap: var(--s3);
}
.price-notice {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: var(--s3);
    padding: var(--s3);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
}
.price-notice.losing {
    border-color: var(--loss);
    background: var(--loss-tint);
}
.price-notice img,
.price-notice .thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--r-sm);
    background: var(--card-alt);
}
.price-notice .price-facts {
    margin: var(--s2) 0 0;
}
.big-check {
    display: flex;
    gap: var(--s2);
    align-items: flex-start;
    font-weight: 600;
    margin-top: var(--s3);
}
.big-check input {
    width: 22px;
    height: 22px;
    flex: none;
}
.paused-note {
    margin-top: 4px;
    max-width: 260px;
}
.paused-note p {
    margin: 0 0 4px;
}
@media (max-width: 560px) {
    .price-notice {
        grid-template-columns: 1fr;
    }
}
