/* ==========================================================================
   Violent Sunflower theme
   Every colour is a token below; nothing outside :root hard-codes a hex value.
   ========================================================================== */

:root {
    --vs-aubergine: #2B1447;
    --vs-purple: #5B2A9D;
    --vs-mid-purple: #7B4BC4;
    --vs-deep-text: #3D1D6B;
    --vs-lavender: #E9DFF7;
    --vs-ground: #F6F2FA;
    --vs-border: #D9CCEC;
    --vs-sunflower: #F5B400;
    --vs-amber: #D98E04;
    --vs-seed: #5A3A1B;
    --vs-leaf-bg: #EAF3DF;
    --vs-leaf-ink: #2C4A14;
    --vs-text: #23123A;
    --vs-muted: #5E4E78;
    --vs-input-border: #8E73BF;
    --vs-low-bg: #FFF3CC;
    --vs-low-ink: #7A4F00;
    --vs-soldout: #3A3442;
    --vs-soldout-bg: #ECE9F0;
    --vs-tint: #F1EAFA;
    --vs-paper: #FBF9FE;
    --vs-chip-muted: #EDE6F5;
    --vs-lilac: #C9B3E8;
    --vs-white: #FFFFFF;

    /* Height of the top bar on one line (8px padding + 48px links + 8px padding). */
    --vs-topbar-height: 64px;

    --vs-font-body: 'Figtree', system-ui, 'Segoe UI', sans-serif;
    --vs-font-display: 'DM Serif Display', Georgia, serif;
}

/* ---------- Base ---------- */

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

html, body {
    margin: 0;
    background: var(--vs-ground);
    color: var(--vs-text);
    font-family: var(--vs-font-body);
}

#app {
    min-height: 100vh;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    touch-action: manipulation;
}

h1, h2, h3, p {
    margin: 0;
}

.vs-display {
    font-family: var(--vs-font-display);
    font-weight: 400;
}

:focus-visible {
    outline: 3px solid var(--vs-mid-purple);
    outline-offset: 2px;
}

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

/* ---------- Shared building blocks (also used by the Home and Sales screens) ---------- */

.vs-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
}

.vs-page-title {
    font-size: 30px;
}

.vs-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: var(--vs-white);
    border: 1px solid var(--vs-border);
    border-radius: 16px;
}

.vs-card__title {
    font-size: 26px;
}

.vs-caption {
    font-size: 15px;
    line-height: 1.4;
    color: var(--vs-muted);
}

.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 20px;
    border: none;
    border-radius: 14px;
    background: var(--vs-lavender);
    color: var(--vs-deep-text);
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}

.vs-btn--primary {
    background: var(--vs-sunflower);
    color: var(--vs-aubergine);
    font-weight: 700;
}

.vs-btn--purple {
    background: var(--vs-purple);
    color: var(--vs-white);
}

.vs-btn--outline {
    background: var(--vs-white);
    border: 2px solid var(--vs-purple);
    color: var(--vs-deep-text);
}

.vs-btn--soft {
    background: var(--vs-lavender);
    color: var(--vs-deep-text);
}

.vs-btn--dashed {
    background: var(--vs-white);
    border: 2px dashed var(--vs-input-border);
    color: var(--vs-deep-text);
}

.vs-btn--warn {
    background: var(--vs-low-bg);
    border: 2px solid var(--vs-amber);
    color: var(--vs-low-ink);
    font-weight: 700;
}

.vs-btn--lg {
    min-height: 60px;
    font-size: 20px;
}

.vs-btn:disabled,
.vs-icon-btn:disabled {
    opacity: .45;
    cursor: default;
}

.vs-icon-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 14px;
    background: var(--vs-lavender);
    color: var(--vs-deep-text);
    cursor: pointer;
    touch-action: manipulation;
}

.vs-icon-btn.vs-btn--purple {
    background: var(--vs-purple);
    color: var(--vs-white);
}

.vs-icon-btn--sm {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.vs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--vs-lavender);
    color: var(--vs-deep-text);
    font-size: 14px;
    font-weight: 600;
}

.vs-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.vs-check-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: 0;
    accent-color: var(--vs-purple);
    cursor: pointer;
}

/* Labels wrap between words; a single word only breaks if it is wider than the whole row. */
.vs-check-row > span {
    overflow-wrap: break-word;
    word-break: normal;
}

/* TapCheck: a button with role="checkbox" for the two-person Home screen. The whole row is the target. */
.vs-tapcheck {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.vs-tapcheck:disabled {
    opacity: .45;
    cursor: default;
}

/* Off is an empty outlined box; on is a filled box with a check mark, so the state is not colour alone. */
.vs-tapcheck__box {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--vs-input-border);
    border-radius: 7px;
    background: var(--vs-white);
    color: var(--vs-white);
}

.vs-tapcheck--sm .vs-tapcheck__box {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

.vs-tapcheck[aria-checked="true"] .vs-tapcheck__box {
    border-color: var(--vs-purple);
    background: var(--vs-purple);
}

.vs-tapcheck:focus-visible .vs-tapcheck__box {
    outline: 3px solid var(--vs-mid-purple);
    outline-offset: 2px;
}

.vs-tapcheck > span:not(.vs-tapcheck__box) {
    min-width: 0;
    overflow-wrap: break-word;
}

.vs-chip--dark {
    background: var(--vs-aubergine);
    color: var(--vs-white);
}

.vs-empty {
    padding: 24px;
    border: 2px dashed var(--vs-border);
    border-radius: 14px;
    font-size: 18px;
    line-height: 1.4;
    color: var(--vs-muted);
}

.vs-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--vs-border);
    border-radius: 14px;
    background: var(--vs-tint);
    color: var(--vs-deep-text);
    font-size: 16px;
    font-weight: 600;
}

.vs-notice--warn {
    border: 2px solid var(--vs-amber);
    background: var(--vs-low-bg);
    color: var(--vs-low-ink);
}

.vs-notice__text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
}

.vs-notice a {
    color: inherit;
    font-weight: 700;
}

.vs-notice__close {
    background: transparent;
    color: inherit;
}

.vs-link-btn {
    align-self: flex-start;
}

.vs-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--vs-muted);
}

.vs-input {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 2px solid var(--vs-input-border);
    border-radius: 12px;
    background: var(--vs-white);
    color: var(--vs-text);
    font-family: inherit;
    font-size: 18px;
    font-weight: 500;
}

.vs-input::placeholder {
    color: var(--vs-muted);
    opacity: 1;
}

.vs-input[aria-invalid="true"] {
    border-color: var(--vs-amber);
    background: var(--vs-low-bg);
}

.vs-field-error {
    font-size: 15px;
    font-weight: 600;
    color: var(--vs-low-ink);
}

/* Stepper: minus / count over caption / plus */
.vs-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vs-stepper__value {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 68px;
}

.vs-stepper__count {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--vs-text);
}

.vs-stepper__caption {
    font-size: 13px;
    color: var(--vs-muted);
}

/* ---------- App shell ---------- */

.vs-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 8px 24px;
    background: var(--vs-aubergine);
    color: var(--vs-white);
}

.vs-topbar :focus-visible {
    outline-color: var(--vs-sunflower);
}

.vs-brand {
    font-size: 24px;
}

.vs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: auto;
}

.vs-nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 10px;
    color: var(--vs-lavender);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.vs-nav-link.active {
    background: var(--vs-purple);
    color: var(--vs-white);
}

.vs-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 100vh;
    padding: 24px;
    text-align: center;
}

.vs-status__text {
    font-size: 26px;
    color: var(--vs-deep-text);
}

.vs-status__detail {
    max-width: 40em;
    font-size: 15px;
    color: var(--vs-muted);
}

/* ---------- Books & stock ---------- */

.books-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.books-head__summary {
    font-size: 16px;
    color: var(--vs-muted);
}

.books-head__add {
    margin-left: auto;
    padding: 0 22px;
    font-size: 18px;
}

.books-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
}

.books-list {
    flex: 999 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.book-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--vs-white);
    border: 2px solid var(--vs-border);
    border-radius: 14px;
}

.book-row.is-selected {
    background: var(--vs-tint);
    border-color: var(--vs-purple);
}

.book-row__cover {
    flex-shrink: 0;
    width: 40px;
    height: 59px;
    border-radius: 4px;
    object-fit: cover;
}

.book-row__swatch {
    display: block;
    box-shadow: inset 4px 0 0 rgba(0, 0, 0, 0.2);
}

.book-row__text {
    flex: 1 1 160px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.book-row__title {
    font-size: 19px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.book-row__detail {
    font-size: 15px;
    color: var(--vs-muted);
}

.book-editor {
    flex: 1 1 340px;
    min-width: 0;
    gap: 14px;
}

.book-editor__formats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.format-btn {
    flex: 1 1 auto;
    min-height: 52px;
    padding: 0 14px;
    border: 2px solid var(--vs-purple);
    border-radius: 12px;
    background: var(--vs-white);
    color: var(--vs-deep-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.format-btn[aria-pressed="true"] {
    background: var(--vs-purple);
    color: var(--vs-white);
}

/* Cover art: a 96x141 preview (the tiles' proportion) beside the stacked Choose / Remove buttons. */
.book-editor__cover-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.book-editor__cover {
    display: block;
    flex-shrink: 0;
    width: 96px;
    height: 141px;
    border-radius: 6px;
    object-fit: cover;
}

.book-editor__no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.2);
}

/* On a light pill so it reads on every swatch colour. */
.book-editor__no-cover-text {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--vs-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.book-editor__cover-actions {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-editor__cover-btn {
    width: 100%;
    padding: 0 12px;
}

/* Holds the visually hidden file input, so focusing it does not scroll the page. */
.book-editor__cover-pick {
    position: relative;
}

/* The ring for the hidden file input, drawn on its label. */
.book-editor__cover-pick:has(input:focus-visible) {
    outline: 3px solid var(--vs-mid-purple);
    outline-offset: 2px;
}

@supports not selector(:has(*)) {
    .book-editor__cover-pick:focus-within {
        outline: 3px solid var(--vs-mid-purple);
        outline-offset: 2px;
    }
}

.book-editor__cover-pick.is-busy {
    opacity: .45;
    cursor: default;
    pointer-events: none;
}

.book-editor__cover-hint {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--vs-muted);
}

/* Six 48px targets fit the 300px inner width of a 340px panel on one line. */
.book-editor__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.swatch-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

.swatch-btn__colour {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.swatch-btn[aria-pressed="true"] .swatch-btn__colour {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    box-shadow: 0 0 0 3px var(--vs-white), 0 0 0 6px var(--vs-text);
}

.book-editor__remove {
    width: 100%;
}

.book-editor__remove.vs-btn--outline {
    border-color: var(--vs-input-border);
}

/* ---------- Setup ---------- */

.setup-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
}

/* 360px leaves room for an extras row (label + three 48px buttons) without wrapping. */
.setup-card {
    flex: 1 1 360px;
    min-width: 0;
}

.setup-card--wide {
    flex-basis: 100%;
}

.setup-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 12px;
    background: var(--vs-white);
    border: 1px solid var(--vs-border);
    border-radius: 12px;
}

.setup-row.is-off {
    background: var(--vs-ground);
}

/* The label never gets narrower than its longest word (its automatic minimum size, capped at the row width),
   so short labels such as "Bookmark" never split inside a word; if even that does not fit beside the
   buttons, the buttons wrap below. Only a single word wider than the whole row is broken. */
.setup-row {
    flex-wrap: wrap;
}

.setup-row .vs-check-row {
    flex: 1 1 0;
    max-width: 100%;
    font-weight: 700;
}

.setup-row .vs-check-row > span {
    min-width: 0;
    overflow-wrap: break-word;
}

.setup-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.setup-add .vs-input {
    flex: 1 1 160px;
    width: auto;
    min-width: 0;
}

.setup-stock {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.setup-stock__label {
    font-size: 18px;
    font-weight: 600;
}

.setup-connections {
    font-size: 16px;
    font-weight: 600;
}

/* ---------- Home: signing queue + ring up ---------- */

/* Single pane (portrait or narrow): a switcher and one pane at a time. */
.home {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: calc(100vh - var(--vs-topbar-height));
}

.home-switch {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: var(--vs-white);
    border-bottom: 2px solid var(--vs-border);
}

.home-switch__btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 56px;
    padding: 0 12px;
    border: 2px solid var(--vs-purple);
    border-radius: 14px;
    background: var(--vs-white);
    color: var(--vs-deep-text);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.home-switch__btn[aria-pressed="true"] {
    background: var(--vs-purple);
    color: var(--vs-white);
}

.home-panes {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.home-pane {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px 20px 24px;
}

.home-pane--queue {
    background: var(--vs-white);
}

.home--sell .home-pane--queue,
.home--queue .home-pane--sell {
    display: none;
}

/* Wide landscape: both panes side by side, each scrolling on its own under the top bar. */
@media (min-width: 1000px) and (orientation: landscape) {
    .home {
        min-height: 0;
    }

    .home-switch {
        display: none;
    }

    .home-panes {
        flex-direction: row;
        height: calc(100vh - var(--vs-topbar-height));
        height: calc(100dvh - var(--vs-topbar-height));
    }

    .home-pane {
        flex: 1 1 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .home--sell .home-pane--queue,
    .home--queue .home-pane--sell {
        display: flex;
    }

    .home-pane--queue {
        border-right: 2px solid var(--vs-border);
    }

    .home .tile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.pane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pane-head__title {
    font-size: 28px;
}

.pane-head__chip {
    font-size: 15px;
    font-weight: 700;
}

.pane-head__aside {
    margin-left: auto;
    font-size: 15px;
    font-weight: 600;
    color: var(--vs-muted);
}

/* ---------- Signing queue ---------- */

.sign-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 2px solid var(--vs-purple);
    border-radius: 16px;
    background: var(--vs-paper);
}

.sign-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sign-card__total {
    font-size: 18px;
    font-weight: 700;
}

.sign-card__number {
    font-size: 15px;
    font-weight: 600;
    color: var(--vs-muted);
}

.sign-card__now {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--vs-muted);
}

.sign-card__name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.sign-card__name.is-empty,
.next-sale__name.is-empty,
.signed-to__name.is-empty {
    color: var(--vs-muted);
    font-weight: 600;
}

.sign-row {
    width: 100%;
    gap: 14px;
    min-height: 60px;
    padding: 8px 14px;
    border: 2px solid var(--vs-border);
    border-radius: 14px;
    background: var(--vs-white);
    color: var(--vs-text);
}

.sign-row[aria-checked="true"] {
    border-color: var(--vs-purple);
    background: var(--vs-tint);
}

.sign-row__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sign-row__label {
    font-size: 18px;
    font-weight: 700;
}

.sign-row__sub {
    font-size: 14px;
    font-weight: 500;
    color: var(--vs-muted);
}

.sign-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sign-row--extra {
    flex: 1 1 auto;
    width: auto;
    gap: 10px;
    padding: 6px 12px;
}

.sign-row--extra .sign-row__label {
    font-size: 16px;
}

.sign-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sign-card__later {
    flex: 1 1 140px;
    min-height: 60px;
}

.sign-card__done {
    flex: 2 1 200px;
}

.up-next__title {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--vs-muted);
}

.up-next {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.next-sale {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 60px;
    padding: 8px 14px;
    border: 2px solid var(--vs-border);
    border-radius: 14px;
    background: var(--vs-white);
    color: var(--vs-text);
    text-align: left;
    cursor: pointer;
}

.next-sale__pay {
    flex-shrink: 0;
    padding: 3px 10px;
}

.next-sale__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.next-sale__name {
    font-size: 17px;
    font-weight: 700;
    overflow-wrap: break-word;
}

.next-sale__items {
    font-size: 14px;
    color: var(--vs-muted);
    overflow-wrap: break-word;
}

.next-sale__total {
    flex-shrink: 0;
    font-size: 17px;
    font-weight: 700;
}

/* ---------- Ring up ---------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.book-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 2px solid var(--vs-border);
    border-radius: 16px;
    background: var(--vs-white);
}

.book-tile.is-in-cart {
    border-color: var(--vs-purple);
}

.book-tile.is-sold-out {
    background: var(--vs-soldout-bg);
}

.book-tile__main {
    display: flex;
    flex: 1 1 auto;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: none;
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.book-tile__main:disabled {
    cursor: default;
}

.is-sold-out .book-tile__main {
    filter: grayscale(1);
    opacity: .55;
}

.book-tile__cover {
    display: block;
    flex-shrink: 0;
    width: 68px;
    height: 100px;
    border-radius: 5px;
    object-fit: cover;
}

.book-tile__swatch {
    box-shadow: inset 5px 0 0 rgba(0, 0, 0, 0.2);
}

.book-tile__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.book-tile__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.book-tile__format {
    font-size: 14px;
    color: var(--vs-muted);
}

.book-tile__price {
    margin-top: auto;
    font-size: 22px;
    font-weight: 700;
    color: var(--vs-deep-text);
}

.book-tile__chip {
    align-self: flex-start;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--vs-leaf-bg);
    color: var(--vs-leaf-ink);
    font-size: 13px;
    font-weight: 600;
}

.book-tile__chip--muted {
    background: var(--vs-chip-muted);
    color: var(--vs-muted);
}

.book-tile__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    padding: 0 12px;
    border: none;
    background: none;
    color: var(--vs-muted);
    font-size: 15px;
    text-align: left;
}

button.book-tile__foot {
    cursor: pointer;
}

.book-tile__foot--add {
    padding-bottom: 12px;
}

.book-tile__foot--low,
.book-tile__foot--stepper.is-low {
    background: var(--vs-low-bg);
    color: var(--vs-low-ink);
}

.book-tile__foot--low {
    font-size: 16px;
    font-weight: 700;
}

.book-tile__foot--stepper {
    padding: 0 8px;
}

.book-tile__qty {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--vs-deep-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.book-tile__qty > span {
    white-space: nowrap;
}

.book-tile__foot--sold-out {
    justify-content: center;
    background: var(--vs-soldout);
    color: var(--vs-white);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.signed-to {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    width: 100%;
    min-height: 64px;
    padding: 8px 16px;
    border: 2px solid var(--vs-input-border);
    border-radius: 14px;
    background: var(--vs-white);
    color: var(--vs-text);
    text-align: left;
    cursor: pointer;
}

.signed-to__caption {
    font-size: 15px;
    font-weight: 600;
    color: var(--vs-muted);
}

.signed-to__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 22px;
    font-weight: 700;
    overflow-wrap: break-word;
}

.signed-to__pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--vs-lavender);
    color: var(--vs-deep-text);
    font-size: 15px;
    font-weight: 700;
}

.sale-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    padding: 10px 16px;
    border: 1px solid var(--vs-border);
    border-radius: 14px;
    background: var(--vs-white);
}

.sale-summary__tax {
    gap: 10px;
    min-height: 48px;
    font-size: 16px;
}

.sale-summary__count {
    font-size: 15px;
    color: var(--vs-muted);
}

.sale-summary__total {
    margin-left: auto;
    font-size: 32px;
    font-weight: 700;
    color: var(--vs-deep-text);
}

.pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 10px;
}

.pay-btn {
    min-height: 68px;
    padding: 0 8px;
    font-size: 18px;
    font-weight: 700;
}

.pay-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.pay-panel--wait {
    gap: 16px;
    padding-top: 24px;
}

.pay-panel__caption {
    font-size: 16px;
    color: var(--vs-muted);
}

.pay-panel__title {
    font-size: 30px;
}

.pay-panel__total {
    font-weight: 700;
    line-height: 1;
    color: var(--vs-deep-text);
}

.pay-panel__total--cash {
    font-size: 48px;
}

.pay-panel__total--wait {
    font-size: 52px;
}

.tender-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    width: 100%;
}

.tender-btn {
    min-height: 72px;
    padding: 0 8px;
    border: 3px solid var(--vs-purple);
    border-radius: 14px;
    background: var(--vs-white);
    color: var(--vs-deep-text);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
}

.tender-btn[aria-pressed="true"] {
    background: var(--vs-purple);
    color: var(--vs-white);
}

.change-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 12px 24px;
    border-radius: 16px;
    background: var(--vs-low-bg);
    color: var(--vs-seed);
}

.change-box__caption {
    font-size: 16px;
    font-weight: 600;
}

.change-box__amount {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.15;
}

.wait-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--vs-lavender);
    color: var(--vs-deep-text);
    font-size: 17px;
    font-weight: 600;
}

.wait-status__dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--vs-sunflower);
}

.pay-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.pay-actions__back {
    flex: 1 1 120px;
}

.pay-actions__paid {
    flex: 2 1 220px;
}

/* ---------- Customer name screen ---------- */

.name-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-height: calc(100vh - var(--vs-topbar-height));
    padding: 20px 24px;
    background: var(--vs-white);
}

.name-screen:focus {
    outline: none;
}

.name-screen__title {
    font-size: 34px;
    text-align: center;
}

.name-screen__title:focus {
    outline: none;
}

.name-screen__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    min-height: 92px;
    padding: 8px 20px;
    border: 3px solid var(--vs-purple);
    border-radius: 16px;
    background: var(--vs-paper);
    color: var(--vs-text);
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
}

.name-screen__preview.is-empty {
    color: var(--vs-muted);
}

.name-keys {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 1100px;
}

.name-key {
    flex: 1 1 0;
    min-width: 0;
    max-width: 104px;
    min-height: 74px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: var(--vs-lavender);
    color: var(--vs-text);
    font-size: 30px;
    font-weight: 700;
    cursor: pointer;
}

.name-key--word {
    max-width: none;
    font-size: 20px;
}

.name-key--capital {
    flex-grow: 1.4;
}

.name-key--capital[aria-pressed="true"] {
    background: var(--vs-purple);
    color: var(--vs-white);
}

.name-key--space {
    flex-grow: 4;
}

.name-key--delete {
    flex-grow: 1.6;
    background: var(--vs-lilac);
}

.name-screen__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 1100px;
}

.name-screen__again {
    flex: 1 1 160px;
    min-height: 64px;
    font-size: 19px;
}

.name-screen__done {
    flex: 3 1 320px;
    min-height: 64px;
    font-size: 22px;
}

/* ---------- Sales ---------- */

.sales-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.sales-stat {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 16px 20px;
    border: 1px solid var(--vs-border);
    border-radius: 16px;
    background: var(--vs-white);
}

.sales-stat--lead {
    flex: 1.2 1 200px;
    border-color: var(--vs-aubergine);
    background: var(--vs-aubergine);
    color: var(--vs-white);
}

.sales-stat__label {
    font-size: 15px;
    color: var(--vs-muted);
}

.sales-stat--lead .sales-stat__label {
    color: var(--vs-lavender);
}

.sales-stat__value {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
}

.sales-stat--lead .sales-stat__value {
    color: var(--vs-sunflower);
}

.sales-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.sales-section-title {
    font-size: 24px;
}

.sales-pay {
    flex: 1 1 300px;
    min-width: 0;
}

.sales-pay__row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-height: 40px;
}

.sales-pay__name {
    font-size: 18px;
    font-weight: 700;
}

.sales-pay__count {
    font-size: 14px;
    color: var(--vs-muted);
}

.sales-pay__amount {
    margin-left: auto;
    font-size: 20px;
    font-weight: 700;
}

.sales-log {
    flex: 2 1 460px;
    min-width: 0;
    gap: 4px;
}

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

.sales-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-height: 64px;
    padding: 8px 0;
    border-top: 1px solid var(--vs-chip-muted);
}

.sales-row__no {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--vs-lavender);
    color: var(--vs-deep-text);
    font-size: 15px;
    font-weight: 700;
}

.sales-row__text {
    display: flex;
    flex: 1 1 200px;
    flex-direction: column;
    min-width: 0;
}

.sales-row__items {
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: break-word;
}

.sales-row__detail {
    font-size: 14px;
    color: var(--vs-muted);
    overflow-wrap: break-word;
}

.sales-row__state.is-signed {
    background: var(--vs-leaf-bg);
    color: var(--vs-leaf-ink);
}

.sales-row__state.is-waiting {
    background: var(--vs-low-bg);
    color: var(--vs-low-ink);
}

.sales-row__state.is-voided {
    background: var(--vs-chip-muted);
    color: var(--vs-muted);
}

.sales-row__total {
    min-width: 80px;
    font-size: 18px;
    font-weight: 700;
    text-align: right;
}

.sales-row__void {
    min-height: 48px;
    padding: 0 14px;
    font-size: 15px;
}

.sales-row__void.vs-btn--outline {
    border-color: var(--vs-input-border);
}

.sales-row.is-voided .sales-row__items,
.sales-row.is-voided .sales-row__total {
    color: var(--vs-muted);
}

/* ---------- Loading screen (index.html) ---------- */

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--vs-lavender);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--vs-purple);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    text-align: center;
    font-weight: 700;
    color: var(--vs-deep-text);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ---------- Unhandled error bar ---------- */

#blazor-error-ui {
    color-scheme: light only;
    display: none;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 1000;
    width: 100%;
    padding: 12px 64px 12px 20px;
    background: var(--vs-low-bg);
    border-top: 2px solid var(--vs-amber);
    color: var(--vs-low-ink);
    font-size: 17px;
    font-weight: 600;
}

#blazor-error-ui .reload {
    color: var(--vs-deep-text);
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--vs-low-ink);
    cursor: pointer;
}
