/* ======================================================================================
   Diamond Wholesale — "Facet Blue" visual identity.
   Light theme app; tokens kept on :root so a dark theme can come later.
   ====================================================================================== */

:root {
    /* Facet Blue palette (approved Option A) */
    --bar: #14283F;            /* app bar / nav */
    --bar-ink: #F2F7FB;
    --accent: #2E7CC0;
    --accent-deep: #1E5C93;
    --accent-soft: #DCEBF8;
    --on-accent: #FFFFFF;
    --ground: #F4F7FA;
    --card: #FFFFFF;
    --field: #EAF0F6;
    --line: #D8E1EA;
    --ink: #17273A;
    --muted: #62778C;
    --good: #1F8A5D;
    --warn: #B3641B;

    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
    --sh-card: 0 1px 2px rgba(20, 40, 63, 0.06);
    --sh-pop: 0 12px 32px rgba(20, 40, 63, 0.18);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    min-height: 100%;
}

#app {
    min-height: 100vh;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ── Diamond logo mark ─────────────────────────────────────────────────────────────── */

/* Faceted gem artwork lives in images/diamond.svg — shared by the header, login,
   loading splash, and favicon so the mark stays identical everywhere. */
.diamond-logo {
    width: 1.35rem;
    height: 1.35rem;
    flex: none;
    display: inline-block;
    background: url("images/diamond.svg") center / contain no-repeat;
}

.diamond-logo-lg {
    width: 2.6rem;
    height: 2.6rem;
}

/* Desktop: the header mark gets more presence. */
@media (min-width: 980px) {
    .shell-topbar .diamond-logo {
        width: 1.8rem;
        height: 1.8rem;
    }
}

/* ── Shell ─────────────────────────────────────────────────────────────────────────── */

.shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.shell-topbar {
    background: var(--bar);
    color: var(--bar-ink);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.shell-back {
    background: none;
    border: none;
    color: var(--bar-ink);
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    margin-left: -0.35rem;
    border-radius: var(--r-sm);
}

.shell-back svg {
    width: 100%;
    height: 100%;
}

.shell-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    min-width: 0;
}

.shell-brand-title {
    font-weight: 650;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shell-brand-eyebrow {
    font-weight: 400;
    font-size: 0.68rem;
    opacity: 0.75;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shell-app-menu {
    margin-left: auto;
    position: relative;
}

.shell-avatar {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: none;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shell-app-menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    border: none;
    z-index: 110;
}

.shell-app-menu-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 120;
    min-width: 15rem;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-pop);
    padding: 0.4rem;
}

.shell-app-menu-user {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.65rem;
}

.shell-app-menu-user-name {
    font-weight: 650;
    font-size: 0.9rem;
}

.shell-app-menu-user-meta {
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.shell-app-menu-separator {
    height: 1px;
    background: var(--line);
    margin: 0.3rem 0;
}

.shell-app-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    background: none;
    border: none;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-radius: var(--r-sm);
    font-size: 0.9rem;
    color: var(--ink);
}

.shell-app-menu-item:hover {
    background: var(--field);
}

.shell-app-menu-logout {
    color: var(--warn);
    font-weight: 600;
}

.shell-app-version-panel {
    padding: 0.4rem 0.65rem 0.55rem;
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shell-app-version-line {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.shell-app-version-line strong {
    color: var(--ink);
    font-weight: 600;
}

.shell-app-version-error {
    color: var(--warn);
}

.shell-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.9rem 0.9rem 2rem;
}

/* ── App update banner ─────────────────────────────────────────────────────────────── */

.app-update-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--accent-soft);
    color: var(--accent-deep);
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.app-update-banner-button {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--r-sm);
    padding: 0.45rem 0.9rem;
    font-weight: 650;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* ── Empty states / error boundary ─────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--muted);
}

.empty-state h2, .empty-state h1 {
    color: var(--ink);
    font-size: 1.15rem;
    margin: 0 0 0.4rem;
}

.empty-state p {
    margin: 0.25rem 0;
    font-size: 0.92rem;
}

.empty-state-detail {
    font-size: 0.8rem;
    opacity: 0.8;
    word-break: break-word;
}

.empty-state .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
}

.error-boundary {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--muted);
}

.action-button {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--r-md);
    padding: 0.6rem 1.25rem;
    font-weight: 650;
    font-size: 0.9rem;
}

.action-button:disabled {
    opacity: 0.55;
    cursor: default;
}

.action-button-secondary {
    background: var(--field);
    color: var(--ink);
}

/* ── Login ─────────────────────────────────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--ground);
    padding: 1.25rem;
}

.login-card {
    width: 100%;
    max-width: 22rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-card);
    padding: 1.75rem 1.5rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-brand h1 {
    font-size: 1.25rem;
    margin: 0.75rem 0 0.15rem;
}

.login-brand p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.login-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0.9rem 0 0.25rem;
}

.login-input {
    width: 100%;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    color: var(--ink);
    font-family: inherit;
}

.login-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.login-error {
    color: var(--warn);
    font-size: 0.85rem;
    margin: 0.75rem 0 0;
}

.login-submit {
    width: 100%;
    margin-top: 1.25rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--r-md);
    padding: 0.7rem;
    font-weight: 650;
    font-size: 0.95rem;
}

.login-submit:disabled {
    opacity: 0.55;
    cursor: default;
}

/* ── Dashboard tiles ───────────────────────────────────────────────────────────────── */

.dashboard-hero {
    margin: 0.4rem 0 1rem;
}

.dashboard-date {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-hero h1 {
    font-size: 1.35rem;
    margin: 0.15rem 0 0;
}

.dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.app-tile {
    width: 150px;
    height: 110px;
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid transparent;
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--sh-card);
    -webkit-tap-highlight-color: transparent;
}

.app-tile:hover {
    background: var(--accent-deep);
}

.app-tile-glyph {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
}

.app-tile-glyph svg {
    width: 100%;
    height: 100%;
}

.app-tile-title {
    font-size: 0.85rem;
    font-weight: 700;
}

.app-tile-description {
    font-size: 0.68rem;
    opacity: 0.75;
}

@media (max-width: 480px) {
    .app-tile {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        justify-content: flex-start;
    }
}

/* ── UPC Lookup page ───────────────────────────────────────────────────────────────── */

.upc-page {
    display: flex;
    flex-direction: column;
}

.upc-cols {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.upc-left, .upc-right {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 0;
}

/* Desktop: two columns — 340px left rail (scan + item + inventory), history on the right. */
@media (min-width: 980px) {
    .upc-cols {
        display: grid;
        grid-template-columns: 340px 1fr;
        gap: 1rem;
        align-items: start;
    }

    /* The mobile-rows/table swap lives at the END of this file — those media-query
       rules must come after the .upc-hist / .upc-table-wrap base styles to win the
       cascade at equal specificity. */
}

/* Scan row */

.scan-row {
    display: flex;
    gap: 0.5rem;
}

.scan-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    min-width: 0;
}

.scan-clear {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    width: 1.7rem;
    height: 1.7rem;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-clear:hover {
    background: var(--field);
    color: var(--ink);
}

.scan-input {
    flex: 1;
    min-width: 0;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.6rem 0.75rem;
    /* After the shorthand so the in-field clear (×) button never overlaps typed text. */
    padding-right: 2.2rem;
    color: var(--ink);
    font-family: Consolas, monospace;
    font-size: 0.95rem;
}

.scan-input::placeholder {
    color: var(--muted);
    font-family: "Segoe UI", system-ui, sans-serif;
}

.scan-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.scan-button {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--r-md);
    padding: 0.6rem 0.9rem;
    font-weight: 650;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.scan-button svg {
    width: 1rem;
    height: 1rem;
}

.scan-button:hover {
    background: var(--accent-deep);
}

/* Lookup status lines */

.upc-status {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.1rem 0.15rem;
}

.upc-status-error {
    color: var(--warn);
}

.upc-status-warn {
    color: var(--warn);
}

/* Found time + EA/DZ/CS toggle */

.upc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Recent scans (device-local MRU) ───────────────────────────────────────────────── */

.upc-recent {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0.85rem 0.9rem;
}

.upc-recent-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.upc-recent-head h4 {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.upc-recent-clear {
    background: none;
    border: none;
    color: var(--accent-deep);
    font-size: 0.75rem;
    font-weight: 650;
    padding: 0.15rem 0.3rem;
}

.upc-recent-list {
    display: flex;
    flex-direction: column;
}

.upc-recent-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid var(--line);
    text-align: left;
    padding: 0.5rem 0.15rem;
    border-radius: var(--r-sm);
    color: var(--ink);
    min-width: 0;
}

.upc-recent-item:first-of-type {
    border-top: 0;
}

.upc-recent-item:hover {
    background: var(--field);
}

.upc-recent-item b {
    font-family: Consolas, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    flex: none;
}

.upc-recent-item span {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No text-transform: the word is uppercased in markup so the seconds unit keeps its
   lowercase "s" (FOUND · 0.4s). */
.upc-found {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.upc-toggle {
    display: flex;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px;
    font-size: 0.75rem;
    font-weight: 650;
}

.upc-toggle button {
    padding: 0.25rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 650;
    font-size: 0.75rem;
}

.upc-toggle button.on {
    background: var(--accent);
    color: var(--on-accent);
}

/* Cards */

.upc-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0.85rem 0.9rem;
    box-shadow: var(--sh-card);
}

.upc-card h4 {
    margin: 0 0 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Product image (UPCitemdb enrichment) — top of the Item card. Retailer CDN images vary
   wildly in aspect ratio, so contain-fit inside a capped height keeps the card stable. */
.upc-item-image {
    display: flex;
    justify-content: center;
    margin: 0 0 0.65rem;
}

.upc-item-image img {
    max-height: 140px;
    max-width: 100%;
    object-fit: contain;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 4px;
    cursor: zoom-in;
}

.upc-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(20, 40, 63, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    cursor: zoom-out;
}

/* The white frame owns the rounded corners, padding, and the close button's
   positioning context, so the X sits inside the frame rather than on the page. */
.upc-image-lightbox-frame {
    position: relative;
    background: var(--card);
    border-radius: var(--r-lg);
    padding: 8px;
    box-shadow: var(--sh-pop);
}

/* No @onclick of its own — the click bubbles to the overlay's close handler. */
.upc-image-lightbox-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 1;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: var(--field);
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upc-image-lightbox-close:hover {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.upc-image-lightbox img {
    display: block;
    max-width: min(92vw, 900px);
    max-height: 84vh;
    object-fit: contain;
}

.upc-item-name {
    font-size: 1.02rem;
    font-weight: 650;
    line-height: 1.3;
    margin: 0 0 0.1rem;
}

.upc-item-upc {
    font-family: Consolas, monospace;
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 0.65rem;
}

.upc-kv {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.55rem 0.6rem;
}

.upc-kv-sells {
    grid-template-columns: repeat(5, 1fr);
    margin-top: 0.6rem;
}

.upc-kv div small {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.1rem;
}

.upc-kv div b {
    font-size: 0.92rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

/* Inventory stat tiles */

.upc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.upc-stat {
    background: var(--field);
    border-radius: var(--r-md);
    padding: 0.5rem 0.55rem;
}

.upc-stat small {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.upc-stat b {
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.upc-stat.good b {
    color: var(--good);
}

.upc-stat.warn b {
    color: var(--warn);
}

/* Buyer history — mobile rows */

.upc-hist {
    display: flex;
    flex-direction: column;
}

.upc-hrow {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
}

.upc-hrow:first-of-type {
    border-top: 0;
    padding-top: 0.1rem;
}

.upc-hrow .who {
    flex: 1;
    min-width: 0;
}

.upc-hrow .who b {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upc-hrow .who small {
    font-size: 0.7rem;
    color: var(--muted);
}

.upc-hrow .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.upc-hrow .num b {
    font-size: 0.85rem;
    display: block;
}

.upc-hrow .num small {
    font-size: 0.68rem;
    color: var(--muted);
}

/* Buyer history — desktop table */

.upc-table-wrap {
    overflow-x: auto;
}

.upc-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.upc-table th {
    text-align: left;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
    font-weight: 700;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--line);
}

.upc-table td {
    padding: 0.42rem 0.6rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
}

.upc-table td.r, .upc-table th.r {
    text-align: right;
}

/* Buyer history — responsive swap + desktop viewport scrolling. These come after the
   component styles above so the media-query rules win the cascade at equal specificity. */

@media (min-width: 980px) {
    /* Desktop shows only the real table. */
    .upc-hist {
        display: none;
    }

    /* Left rail stays put while the history column scrolls. */
    .upc-left {
        position: sticky;
        top: 4.5rem;
    }

    /* The table scrolls inside the viewport instead of growing the page. */
    .upc-table-wrap {
        max-height: calc(100vh - 15rem);
        overflow-y: auto;
    }

    .upc-table thead th {
        position: sticky;
        top: 0;
        background: var(--card);
        z-index: 1;
    }
}

@media (max-width: 979.98px) {
    /* Mobile shows only the compact rows. */
    .upc-table-wrap {
        display: none;
    }
}

.upc-table tr:last-child td {
    border-bottom: 0;
}

.upc-empty {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

/* Notes */

.upc-notebtn {
    width: 100%;
    border: 1.5px dashed var(--accent);
    color: var(--accent-deep);
    background: var(--accent-soft);
    border-radius: 12px;
    padding: 0.6rem;
    text-align: center;
    font-weight: 650;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.upc-note {
    border-top: 1px solid var(--line);
    padding: 0.55rem 0;
}

.upc-note:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.upc-note-text {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.upc-note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--muted);
}

.upc-note-status {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.62rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--field);
    color: var(--muted);
}

.upc-note-status-pending {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.upc-note-status-written {
    background: #E0F2EA;
    color: var(--good);
}

.upc-note-status-failed {
    background: #F7E5D6;
    color: var(--warn);
}

.upc-note-input {
    width: 100%;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    color: var(--ink);
    font-family: inherit;
    resize: vertical;
    margin-top: 0.35rem;
}

.upc-note-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.upc-note-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ── Barcode scanner overlay ───────────────────────────────────────────────────────── */

.scanner-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: grid;
    gap: 1.25rem;
    align-content: center;
    justify-items: center;
    padding: 1.5rem;
}

.scanner-overlay video {
    width: min(100%, 28rem);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1), var(--sh-pop);
}

.scanner-title {
    color: #FFFFFF;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.scanner-cancel {
    border: none;
    border-radius: var(--r-md);
    padding: 0.875rem 2.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    backdrop-filter: blur(12px);
    transition: background 150ms;
    -webkit-tap-highlight-color: transparent;
}

.scanner-cancel:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ── Loading overlay ───────────────────────────────────────────────────────────────── */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(20, 40, 63, 0.45);
    display: grid;
    align-content: center;
    justify-items: center;
}

.loading-overlay-message {
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ── Blazor error UI ───────────────────────────────────────────────────────────────── */

#blazor-error-ui {
    background: #FDF3CF;
    color: #6B5410;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    font-size: 0.9rem;
}

#blazor-error-ui .reload {
    color: inherit;
    font-weight: 700;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
