/* ==========================================================================
   Warehouse / Storage Subdomain — Mobile-first dark theme
   ========================================================================== */

:root {
    --bg: #0b0e14;
    --bg-soft: #11141d;
    --bg-card: #161a25;
    --bg-card-hover: #1c2030;
    --border: #2a2f40;
    --border-soft: #1e2230;
    --text: #e6e8ee;
    --text-muted: #9ba0b3;
    --text-dim: #6a6f80;
    --accent: #ff7e29;
    --accent-soft: rgba(255, 126, 41, 0.15);
    --accent-hover: #ff8d40;
    --success: #2ec27e;
    --success-soft: rgba(46, 194, 126, 0.15);
    --danger: #ff5b6d;
    --danger-soft: rgba(255, 91, 109, 0.15);
    --warning: #ffc04d;
    --warning-soft: rgba(255, 192, 77, 0.15);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.25);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

/* Flex/grid items default to min-content; let them shrink inside their parent */
.wh-app, .wh-main, .wh-card, .wh-list__item, .wh-list__body,
.wh-subcat-block, .wh-subcat-block__head, .wh-subcat-block__title,
.wh-mc, .wh-mc__head, .wh-mc__color,
.wh-product-picker, .wh-product-picker__toolbar,
.wh-pp-group, .wh-pp-group__head, .wh-pp-card, .wh-pp-card__body {
    min-width: 0;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Lock horizontal page scroll — only vertical panning */
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    /* Disable iOS Safari rubber-band horizontal drag */
    overscroll-behavior-x: none;
    /* Tell touch-screen browsers we only handle vertical gestures */
    touch-action: pan-y;
}

html {
    /* Belt-and-suspenders: nothing in <html> may overflow horizontally */
    overflow-x: clip;
}

body {
    position: relative;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ============= Layout ============= */

.wh-app {
    min-height: 100vh;
    padding-bottom: 80px; /* room for bottom nav */
    display: flex;
    flex-direction: column;
    /* Belt-and-suspenders horizontal lock — anything overflowing must scroll internally */
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

.wh-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
    background: rgba(11, 14, 20, 0.85);
    border-bottom: 1px solid var(--border-soft);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wh-header__brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    text-decoration: none;
    line-height: 1;
}

.wh-header__brand:hover {
    color: var(--text);
}

.wh-brand-mark {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--accent) 0%, #ffad6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wh-brand-sub {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wh-auth__accent {
    color: var(--accent);
    font-weight: 500;
}

.wh-header__title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: right;
}

.wh-header__actions {
    display: flex;
    gap: 8px;
}

.wh-main {
    flex: 1;
    padding: 16px;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    /* Prevent inline content (long words / pre / urls) from pushing past viewport */
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (min-width: 920px) {
    .wh-main {
        max-width: 1100px;
        padding: 24px;
    }
}

/* ============= Cards ============= */

.wh-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
    /* Card never extends past parent — children must scroll internally if needed */
    max-width: 100%;
    min-width: 0;
}

/* <pre>/<code> blocks must scroll internally and never bust the layout */
.wh-app pre {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: pre;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

.wh-app code {
    overflow-wrap: anywhere;
    word-break: break-all;
    max-width: 100%;
}

.wh-app pre code {
    /* Keep formatting inside <pre>; do not break */
    word-break: normal;
    overflow-wrap: normal;
}

/* Images: never overflow */
.wh-app img {
    max-width: 100%;
    height: auto;
}

.wh-card--accent {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-soft) 100%);
}

.wh-card__title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 8px;
    font-weight: 600;
}

.wh-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    margin: 0;
}

.wh-card__value--accent {
    color: var(--accent);
}

.wh-card__hint {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 6px;
}

.wh-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}

.wh-card__row:last-child {
    border-bottom: none;
}

/* ============= Grid ============= */

.wh-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

@media (min-width: 540px) {
    .wh-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 900px) {
    .wh-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============= Buttons ============= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 44px;
}

.btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.btn--primary {
    background: var(--accent);
    color: #0b0e14;
    border-color: var(--accent);
    font-weight: 600;
}

.btn--primary:hover {
    background: var(--accent-hover);
    color: #0b0e14;
}

.btn--ghost {
    background: transparent;
    border-color: var(--border);
}

.btn--danger {
    background: var(--danger);
    color: #0b0e14;
    border-color: var(--danger);
    font-weight: 600;
}

.btn--success {
    background: var(--success);
    color: #0b0e14;
    border-color: var(--success);
    font-weight: 600;
}

.btn--small {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
}

.btn--block {
    width: 100%;
}

.btn--icon {
    width: 44px;
    padding: 0;
}

/* ============= Forms ============= */

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    /* Critical for nested flex/grid: allow shrinking below intrinsic width */
    min-width: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.form-field label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="search"],
select,
textarea {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    min-height: 44px;
    outline: none;
    transition: border-color 0.15s ease;
    /* Critical: prevent select/textarea from growing wider than their parent
       when a long <option> is present (iPhone SE 320px) */
    max-width: 100%;
    width: 100%;
}

/* Selects with long options should not expand the parent container */
select {
    text-overflow: ellipsis;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    color: var(--text-dim);
    font-size: 12px;
}

/* ============= Tables / Matrix ============= */

/* Generic table cards (history / today / finance / dashboard) — horizontal scroll */
.wh-card:has(> .wh-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Allow horizontal pan inside (overrides body pan-y) */
    touch-action: pan-x pan-y;
}

.wh-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.wh-table th,
.wh-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
}

.wh-table th {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.wh-table tr:hover td {
    background: var(--bg-card-hover);
}

.wh-matrix-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    /* Allow horizontal pan inside even though body locks it to pan-y */
    touch-action: pan-x pan-y;
    /* Scroll-shadow: gradient on right edge to hint "scroll here" */
    background-image:
        linear-gradient(to right, var(--bg-card), var(--bg-card)),
        linear-gradient(to right, var(--bg-card), var(--bg-card)),
        linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0)),
        linear-gradient(to left, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
    background-position: left center, right center, left center, right center;
    background-repeat: no-repeat;
    background-size: 30px 100%, 30px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
    -webkit-overflow-scrolling: touch;
}

.wh-matrix {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: max-content;
}

.wh-matrix th,
.wh-matrix td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    min-width: 56px;
    white-space: nowrap;
}

.wh-matrix tbody tr:last-child td {
    border-bottom: none;
}

.wh-matrix th {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Sticky first column (color) */
.wh-matrix th.size-col,
.wh-matrix td.size-col {
    background: var(--bg-soft);
    font-weight: 600;
    text-align: left;
    min-width: 130px;
    max-width: 180px;
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 4px 0 6px -3px rgba(0, 0, 0, 0.35);
}

.wh-matrix th.size-col { z-index: 4; }

.wh-matrix .wh-color-name {
    display: inline-block;
    vertical-align: middle;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-matrix .qty-cell {
    cursor: pointer;
    transition: background 0.1s ease;
    font-weight: 600;
    color: var(--text);
}

.wh-matrix .qty-cell:hover,
.wh-matrix .qty-cell:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.wh-matrix .qty-zero {
    color: var(--text-dim);
    font-weight: 400;
}

.wh-matrix .qty-positive {
    color: var(--success);
}

.wh-matrix .qty-low {
    color: var(--warning);
}

.wh-matrix__total-row td {
    background: var(--bg-soft);
}

/* ============= Mobile matrix cards (per-color) ============= */
.wh-matrix-cards { display: none; }

.wh-mc {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.wh-mc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.wh-mc__color {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.wh-mc__swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.wh-mc__name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.wh-mc__total {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.wh-mc__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
}

.wh-mc__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    min-height: 56px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: inherit;
}

.wh-mc__cell:active {
    transform: scale(0.97);
    background: var(--accent-soft);
}

.wh-mc__cell.qty-zero {
    opacity: 0.55;
}

.wh-mc__size {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.wh-mc__qty {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.wh-mc__cell.qty-positive .wh-mc__qty { color: var(--success); }
.wh-mc__cell.qty-low .wh-mc__qty { color: var(--warning); }
.wh-mc__cell.qty-zero .wh-mc__qty { color: var(--text-dim); }

/* Toggle: show cards on mobile, table on tablet+ */
@media (max-width: 599px) {
    .wh-matrix-wrap { display: none; }
    .wh-matrix-cards { display: block; }
}

/* ============= Color indicator ============= */

.wh-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
    vertical-align: middle;
    margin-right: 6px;
}

.wh-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-soft);
    border-radius: 99px;
    font-size: 13px;
    border: 1px solid var(--border-soft);
}

/* Color multi-select grid (settings + bulk_add) */
.wh-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}

.wh-color-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    min-height: 40px;
}

.wh-color-pill:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.wh-color-pill input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.wh-color-pill:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.wh-color-pill__swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.wh-color-pill__label {
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* Subcategory color section in category_detail (grouped view) */
.wh-subcat-block {
    margin-bottom: 24px;
}

.wh-subcat-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.wh-subcat-block__title {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    flex-wrap: wrap;
    min-width: 0;
}

.wh-subcat-block__total {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 2px 10px;
    border-radius: 99px;
}

.wh-subcat-block__colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

.wh-subcat-color-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 99px;
    font-size: 12px;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-subcat-color-pill__swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* ============= Product picker (print → products linkage) ============= */

.wh-product-picker {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 16px;
}

.wh-product-picker__toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wh-product-picker__search {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.wh-product-picker__search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.wh-product-picker__counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 6px 12px;
    border-radius: 99px;
    white-space: nowrap;
    border: 1px solid var(--border-soft);
}

.wh-product-picker__counter.is-selected {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.wh-product-picker__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.wh-product-picker__actions .btn.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}

.wh-product-picker__groups {
    max-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.wh-product-picker__empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 8px;
    font-size: 13px;
}

.wh-pp-group {
    margin-bottom: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.wh-pp-group[open] .wh-pp-group__head::after {
    transform: rotate(90deg);
}

.wh-pp-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.wh-pp-group__head::-webkit-details-marker { display: none; }

.wh-pp-group__head::after {
    content: '›';
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    transition: transform 0.15s ease;
    margin-left: 8px;
}

.wh-pp-group__title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-pp-group__count {
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid var(--border-soft);
}

.wh-pp-group__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    padding: 8px;
}

.wh-pp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s ease;
    min-height: 0;
}

.wh-pp-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.wh-pp-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

.wh-pp-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 2px 8px rgba(255, 126, 41, 0.18);
}

.wh-pp-card__thumb {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-soft);
    overflow: hidden;
    display: block;
}

.wh-pp-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wh-pp-card__no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 28px;
}

.wh-pp-card__check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.15s ease;
}

.wh-pp-card:has(input:checked) .wh-pp-card__check {
    background: var(--accent);
    color: #0b0e14;
    border-color: var(--accent);
}

.wh-pp-card__body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.wh-pp-card__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-pp-card__meta {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: auto;
}

.wh-pp-card:has(input:checked) .wh-pp-card__title {
    color: var(--text);
    font-weight: 600;
}

/* Mobile tweaks for product picker */
@media (max-width: 540px) {
    .wh-pp-group__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 6px;
        padding: 6px;
    }
    .wh-pp-card__check {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }
    .wh-product-picker__groups {
        max-height: 60vh;
    }
}

@media (max-width: 380px) {
    .wh-pp-group__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============= Bottom navigation ============= */

.wh-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 40;
    padding: 6px 4px env(safe-area-inset-bottom, 6px);
}

.wh-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    min-height: 56px;
    border-radius: 8px;
    transition: color 0.15s ease;
}

.wh-bottom-nav__item.active,
.wh-bottom-nav__item:hover {
    color: var(--accent);
}

.wh-bottom-nav__icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wh-bottom-nav__icon svg {
    width: 100%;
    height: 100%;
}

/* ============= Messages ============= */

.wh-messages {
    position: fixed;
    top: 70px;
    left: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.wh-message {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    animation: msgIn 0.25s ease-out;
}

.wh-message--success {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--success-soft) 100%);
}

.wh-message--error {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--danger-soft) 100%);
}

.wh-message--warning {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--warning-soft) 100%);
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============= Bottom sheet ============= */

.wh-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.wh-sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.wh-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 18px 18px calc(env(safe-area-inset-bottom, 18px) + 18px);
    z-index: 61;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    max-height: 92vh;
    overflow-y: auto;
}

.wh-sheet.open {
    transform: translateY(0);
}

.wh-sheet__grip {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 14px;
}

.wh-sheet__title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
}

.wh-sheet__row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

/* ============= Quick adjust controls ============= */

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

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--accent);
    color: #0b0e14;
    border-color: var(--accent);
}

.qty-value {
    min-width: 48px;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
}

/* ============= Login page ============= */

.wh-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.wh-auth__card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
}

.wh-auth__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    text-align: center;
}

.wh-auth__sub {
    color: var(--text-muted);
    margin: 0 0 24px;
    text-align: center;
    font-size: 14px;
}

/* ============= Lists ============= */

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

.wh-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: 1px solid var(--border-soft);
}

.wh-list__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.wh-list__body {
    flex: 1;
    min-width: 0;
}

.wh-list__title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.wh-list__meta {
    color: var(--text-muted);
    font-size: 13px;
}

.wh-list__action {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============= Section title ============= */

.wh-section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 22px 0 10px;
    font-weight: 600;
}

.wh-section-title:first-child {
    margin-top: 4px;
}

/* ============= Badges ============= */

.wh-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-soft);
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
}

.wh-badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.wh-badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.wh-badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.wh-badge--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ============= Utility ============= */

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-small { font-size: 13px; }
.text-tiny { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.text-bold { font-weight: 600; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap-8 { display: flex; gap: 8px; }
.flex-gap-12 { display: flex; gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

@media (max-width: 540px) {
    .wh-header__title { display: none; }
}
