html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #0e1018;
}
html[data-mode="light"], html[data-mode="light"] body {
    background: var(--vs-bg);
}

/* Override MudBlazor defaults to let VS design tokens take over */
.mud-layout {
    background: transparent !important;
}
.mud-main-content {
    background: transparent !important;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.page-title {
    background: linear-gradient(96deg, #edeff5 0%, #edeff5 35%, #ff7d3f 70%, #d65818 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 34px !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
    line-height: 1.05 !important;
}

.mud-table-sort-label .mud-table-sort-label-icon {
    opacity: 0.3 !important;
    visibility: visible !important;
}

@media print {
    * {
        visibility: hidden;
    }

    .print-only, .print-only * {
        visibility: visible;
    }

    .print-only {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .label-page {
        page-break-after: always;
    }
}

.print-only {
    display: block;
}

.label-page {
    page-break-after: always;
    width: 46mm;             /* hug the label so cut guides land right on its edge */
    padding: 0;
    box-sizing: border-box;
}

.label {
    width: 46mm;
    height: 48mm;            /* fixed footprint so every label is exactly the same size */
    overflow: hidden;
    background: white;
    color: black;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 1mm;
    padding: 1.5mm;
    box-sizing: border-box;
}

.label-top {
    display: flex;
    align-items: flex-start;
}

.label-swatches-and-hex {
    display: flex;
    flex-direction: column;
    gap: 1mm;
}

.label-color-row {
    display: flex;
    align-items: center;
    gap: 1.5mm;
}

.label-swatch {
    width: 4mm;
    height: 4mm;
    border-radius: 50%;
    border: 0.3mm solid #999;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.label-hex {
    font-size: 5pt;
    font-family: monospace;
    color: #8a8a8a;          /* lightened — secondary reference info */
}

.label-id {
    font-size: 12pt;
    font-weight: 700;
    font-family: monospace;
}


.label-bar {
    background: black !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 1.5mm 2mm;
    border-radius: 1mm;
    display: flex;
    flex-direction: column;
    gap: 0.5mm;
    flex-shrink: 0;          /* black box keeps its height; never squeezed by the body */
}

.label-bar-bm {
    font-size: 7.5pt;
    font-weight: 700;
    line-height: 1.15;
    display: flex;
    align-items: center;
    gap: 1.2mm;
    min-width: 0;
}
/* Brand + material stays on one line (no wrap to the series row). */
.label-bar-bm-txt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Brand color chip — always a square (vs round color swatches). */
.label-brand-sw {
    width: 2.8mm;
    height: 2.8mm;
    border-radius: 0.4mm;
    border: 0.2mm solid rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Line 1 of the black box: brand (left) + spool ID (top-right corner). */
.label-bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2mm;
}
.label-bar-id {
    flex-shrink: 0;
    font-size: 6.5pt;
    font-weight: 400;
    color: #9a9a9a;          /* low-priority data, kept quiet against the black box */
}

/* Two columns under the name: spool + hexes (left); tiny date/spool meta then
   QR (right). The QR pins to the bottom so it lands at the same height on every
   label, and the label has a fixed footprint so all labels match in size. */
.label-body {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2mm;
    flex: 1;
}
.label-body-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1mm;
    min-width: 0;
}
.label-body-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
    gap: 1mm;
}
/* Reserve a little height above the QR so it starts near the hex codes. Kept
   short so the QR rides up and leaves clear white space below the label's edge. */
.label-meta {
    min-height: 8mm;
    font-size: 4.5pt;
    color: #777;
    line-height: 1.3;
}
.label-meta-k {
    color: #b8b8b8;          /* "Purchased" kept faint and unobtrusive */
}
.label-meta-v {
    font-weight: 400;
}

.vs-pick-render svg {
    display: block;
}

/* Brand color chip in the picker's Filament column — always square. */
.vs-brand-sq {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.label-hex-more {
    color: #999;
    font-style: italic;
}

/* Line 2 of the black box: material + series, flush to the far left. */
.label-bar-series {
    font-size: 6pt;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.label-name-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2mm;
}

.label-name {
    font-size: 9.5pt;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;     /* one line, so the QR lands at the same height on every label */
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    flex-shrink: 0;          /* never let the color-mode render squeeze the name row to nothing */
}

.label-position {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 7pt;
    font-weight: 600;
    color: #555;
}

.label-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;        /* pin render + QR to the bottom of the label */
    gap: 2mm;
}

.label-swatches-and-hex {
    display: flex;
    flex-direction: column;
    gap: 1.5mm;
}

/* Hex codes (left) + QR (right) on one row, both starting at the same height. */
.label-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2mm;
    margin-top: 1mm;
}
.label-qr {
    flex-shrink: 0;
}
.label-qr svg {
    width: 15mm;             /* smaller so it rides higher and clears the bottom edge */
    height: 15mm;
}

/* Spool render + hex codes on the label (replaces the dot swatches). */
.label-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1mm;
}

.label-render svg {
    width: 12mm;
    height: 12mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
/* Holds the render's place in B&W mode so the hex codes still start at the same
   spot and the QR stays aligned. */
.label-render-spacer {
    height: 12mm;
}

.label-hexes {
    display: flex;
    flex-direction: column;
    gap: 0.15mm;            /* hex codes stacked tight */
}
.label-hexes .label-hex {
    line-height: 1.05;
}

/* "Fit to sheet" mode: tile labels onto one page instead of one-per-page. */
.label-page {
    break-inside: avoid;
}
.label-sheet {
    display: flex;
    flex-wrap: wrap;
    gap: 0;                  /* pack tight so more labels fit per sheet */
    align-items: flex-start;
}
.label-sheet .label-page {
    page-break-after: auto;
    padding: 0;
}
/* Very faint dotted cut guides between labels when more than one prints. */
.label-sheet--cut .label-page {
    border: 0.2mm dotted #c9c9c9;
}

/* ── 1" (25.4 mm) round spool-tag label: a QR with a black centre "hole" that
   fakes the spool bore, + the VisualSpool.io wordmark. Prints on 1" round
   thermal labels and sticks on the mini-spool swatch's flat bottom. ── */
.label-size-round .label-page {
    width: 25.4mm;
    height: 25.4mm;
    padding: 0;
}
/* The black "spool flange" ring is the whole label's background; a white inner
   circle is the label face. */
.label-round {
    width: 25.4mm;
    height: 25.4mm;
    border-radius: 50%;
    background: #fff;
    color: black;
    font-family: Arial, sans-serif;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.label-round svg { display: block; width: 100%; height: 100%; }
.label-round-inner {
    position: absolute;
    inset: 2.1mm;                 /* black ring width */
    border-radius: 50%;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
/* Centre "core": the QR (to the filament page) with a black bore-hole dot. */
.label-round-qrwrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 9mm;
    height: 9mm;
}
.label-round-qrwrap svg {
    width: 9mm;
    height: 9mm;
}
/* Faked bore hole: a black dot ringed in white that knocks out the QR modules
   beneath it (~17% of the code). The QR is generated at ECC H, so it scans. */
.label-round-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3.8mm;
    height: 3.8mm;
    transform: translate(-50%, -50%);
    background: black;
    border: 0.7mm solid white;
    border-radius: 50%;
    box-sizing: content-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
/* Curved text overlay: white ring text + the big black filament name. */
.label-round-text {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
/* The colour name in the site's display font (Space Grotesk). */
.label-round-text .lrt-name {
    font-family: var(--vs-display);
}

/* ── Bulk action bar (Spools page selection) ── */
.vs-bulk-bar {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: var(--vs-surface-2, #171b27);
    border: 1px solid var(--vs-border, #2a3142);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.vs-bulk-count {
    font-size: 14px;
    color: var(--vs-text, #e6e9f0);
    white-space: nowrap;
}
.vs-bulk-count strong {
    color: #9db8ff;
    font-weight: 700;
}
.vs-bulk-clear {
    margin-left: 10px;
    background: none;
    border: none;
    color: var(--vs-muted, #8a8aa0);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}
.vs-bulk-clear:hover {
    color: var(--vs-text, #e6e9f0);
}
.vs-bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.vs-batch-edit-card {
    width: min(420px, 92vw);
    background: var(--vs-surface-2, #171b27);
    border: 1px solid var(--vs-border, #2a3142);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.vs-batch-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--vs-text, #e6e9f0);
}
.vs-batch-hint {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--vs-muted, #8a8aa0);
}
.vs-batch-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}