/* Workflow + operator + lock UI — touch-first, built on the Liquid Glass tokens from app.css. */

:root {
    --tap: 72px; /* primary touch-target height */
    --tap-lg: 84px; /* keypad keys */
    --wf-radius: 18px;
}

/* Hide the camera while a workflow is running (component stays mounted; scanning is paused). */
.viewfinder-wrapper.is-hidden {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
}

.viewfinder-toolbar.is-hidden-flow {
    display: none;
}

/* --- Bigger camera toolbar (when visible) --- */
.viewfinder-toolbar {
    gap: var(--s-3);
}

    .viewfinder-toolbar .icon-button {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

        .viewfinder-toolbar .icon-button svg {
            width: 26px;
            height: 26px;
        }

/* --- Header chips (operator / lock) --- */
.op-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    color: var(--t);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.16s var(--ease-out), border-color 0.16s var(--ease-out), color 0.16s var(--ease-out);
}

@media (hover: hover) {
    .op-chip:hover {
        border-color: rgba(11, 206, 136, 0.5);
        color: var(--t-strong);
        background: rgba(11, 206, 136, 0.1);
    }
}

.op-chip:active {
    transform: scale(0.96);
}


/* Workflow panel: fills height — header / scrollable body / pinned actions */
.wf-panel {
    flex: 1 1 auto;
    align-self: stretch;
    min-height: 0;
    margin: var(--s-4);
    padding: var(--s-4) var(--s-4) var(--s-4);
    border-radius: var(--wf-radius);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

.wf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    flex: none;
}

    .wf-head .icon-button {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

        .wf-head .icon-button svg {
            width: 24px;
            height: 24px;
        }

.wf-code {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--c-accent);
    word-break: break-all;
    line-height: 1.2;
}

/* --- Busy --- */
.wf-busy {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-4);
    padding: var(--s-6) var(--s-3);
    color: var(--t);
    font-family: var(--font-ui);
    font-size: 1.05rem;
    text-align: center;
}

.wf-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: var(--c-primary);
    animation: wf-spin 0.8s linear infinite;
}

/* .wf-confirm-dialog è una colonna flex con align-items:stretch (default): un elemento a larghezza fissa come .wf-spinner non viene "stretchato" e resta ancorato asinistra invece di essere centrato come il testo. */
.wf-confirm-dialog > .wf-spinner {
    align-self: center;
}

@keyframes wf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Body / cards (scrollable) --- */
.wf-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    -webkit-overflow-scrolling: touch;
}

.wf-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--t-strong);
    margin: 0;
}

.wf-kicker {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-primary);
    font-weight: 600;
}

.wf-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    user-select: none;
}


.wf-card-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--t-strong);
    line-height: 1.25;
    display: flex;
    gap: 10px;
    align-items: baseline;
}

    .wf-card-name .ms {
        margin-right: 0;
    }

.wf-line {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    color: var(--t);
    display: flex;
    gap: 10px;
    align-items: baseline;
    line-height: 1.35;
    min-width: 0;
}

/* Etichetta compatta su una riga propria dentro .wf-card-fields (es. "Occupato" su un centro), allineata a sinistra. */
.wf-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
}

.wf-badge-busy {
    color: var(--c-warning);
    background: rgba(255, 72, 0, 0.12);
    border-color: rgba(255, 72, 0, 0.45);
}

/* Tronca visivamente un valore lungo e senza spazi invece di fare lo scroll orizzontale. */
.wf-ellipsis {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-line .mono {
    font-family: var(--font-mono);
    color: var(--t-strong);
    font-weight: 600;
}

.wf-line em {
    color: var(--t-strong);
    font-style: normal;
}

.wf-line strong {
    color: var(--c-accent);
}

.wf-metrics {
    display: flex;
    gap: var(--s-3);
    flex-wrap: wrap;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--t-strong);
    margin-top: 4px;
}

.wf-message {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    color: var(--t);
    white-space: pre-wrap;
    line-height: 1.6;
}

    .wf-message.success {
        color: var(--c-primary-hi);
        font-weight: 600;
    }

.wf-error {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    color: var(--c-error);
    white-space: pre-wrap;
    line-height: 1.5;
}

/* --- Actions: pinned at the bottom, big touch targets --- */
.wf-actions {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wf-btn-row {
    display: flex;
    gap: var(--s-3);
}

.wf-btn {
    flex: 1 1 auto;
    min-height: var(--tap);
    min-width: 0;
    padding: 0 var(--s-4);
    border-radius: var(--wf-radius);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
    color: var(--t-strong);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.16s var(--ease-out), border-color 0.16s var(--ease-out), transform 0.1s var(--ease-out);
}

@media (hover: hover) {
    .wf-btn:hover:not(:disabled) {
        background: rgba(11, 206, 136, 0.18);
        border-color: rgba(11, 206, 136, 0.55);
    }
}

.wf-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.wf-btn.primary {
    background: linear-gradient(180deg, rgba(28, 214, 133, 0.95), rgba(11, 206, 136, 0.82));
    border-color: transparent;
    color: #05231a;
    box-shadow: 0 10px 28px rgba(11, 206, 136, 0.28);
}

@media (hover: hover) {
    .wf-btn.primary:hover:not(:disabled) {
        background: linear-gradient(180deg, rgba(40, 224, 145, 1), rgba(20, 214, 140, 0.9));
    }
}

.wf-btn.success {
    background: linear-gradient(180deg, rgba(28, 214, 133, 0.95), rgba(11, 206, 136, 0.82));
    border-color: transparent;
    color: #05231a;
    box-shadow: 0 10px 28px rgba(11, 206, 136, 0.28);
}

.wf-btn.danger {
    background: linear-gradient(180deg, rgba(255, 108, 64, 0.95), rgba(255, 72, 0, 0.82));
    border-color: transparent;
    color: #240a00;
    box-shadow: 0 10px 28px rgba(255, 72, 0, 0.28);
}

    .wf-btn.danger:has(+ .wf-btn.caret) {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

.wf-btn.count {
    flex: 0 0 96px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--t-soft);
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.wf-btn.is-dim {
    flex: 0 0 72px;
}

.wf-btn.back {
    flex: 0 0 72px;
    padding: 0;
}

    .wf-btn.back .ms {
        margin-right: 0;
    }

.wf-btn.caret {
    flex: 0 0 56px;
    padding: 0;
    margin-left: calc(var(--s-3) * -1);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.25);
}

    .wf-btn.caret .ms {
        margin-right: 0;
    }

/* Riga di pulsanti azione per tenant: con 1-2 pulsanti resta icona+testo; da 3 in su passano tutti a icona sola */
.wf-btn-row-icons:has(> .wf-btn:nth-child(3)) > .wf-btn {
    flex: 0 0 72px;
    padding: 0;
}

    .wf-btn-row-icons:has(> .wf-btn:nth-child(3)) > .wf-btn .wf-btn-label {
        display: none;
    }

    .wf-btn-row-icons:has(> .wf-btn:nth-child(3)) > .wf-btn .ms {
        margin-right: 0;
    }

.wf-btn:disabled {
    opacity: 0.32;
    cursor: default;
    box-shadow: none;
}

.wf-card-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* --- Workcenter layout --- */
.wf-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--t-soft);
    padding: var(--s-2) 0 var(--s-1);
}

.wf-small-btn {
    margin-top: var(--s-2);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: var(--t-soft);
    font-size: 0.82rem;
    cursor: pointer;
    align-self: flex-start;
}

    .wf-small-btn:active {
        opacity: 0.7;
    }

/* --- Card with side icon button --- */
.wf-card-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--s-2);
}

.wf-card-fields {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wf-icon-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--icon-accent, rgba(255, 255, 255, 0.3));
    background: rgba(255, 255, 255, 0.12);
    color: var(--t-strong);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    flex-shrink: 0;
}

    .wf-icon-btn:active {
        opacity: 0.7;
    }

    .wf-icon-btn .ms {
        margin-right: 0;
        font-size: 1.3em;
        color: var(--icon-accent, inherit);
        font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    }

.wf-icon-btn-blue {
    --icon-accent: #00bfff;
}

.wf-icon-btn-yellow {
    --icon-accent: #ffbb00;
}

/* --- Goods/wastes stepper (close working) --- */
.qty-card {
    gap: var(--s-3);
}

.qty-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
}

.qty-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: 1.05rem;
    color: var(--t-strong);
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    width: 100%;
    max-width: 320px;
}

.qty-btn {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
    color: var(--t-strong);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .qty-btn:active {
        opacity: 0.7;
    }

    .qty-btn:disabled {
        opacity: 0.35;
        cursor: default;
    }

.qty-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 48px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--t-strong);
    font-family: var(--font-mono);
    font-size: 1.15rem;
}

    .qty-input:focus {
        outline: none;
        border-color: rgba(11, 206, 136, 0.6);
    }

/* --- Selected card --- */
.wf-card.is-selected {
    border-color: rgba(11, 206, 136, 0.6);
    background: rgba(11, 206, 136, 0.06);
}

/* Order detail overlay — position: absolute on .wf-panel (position: relative via liquid-glass). Avoids the fixed-positioning bug caused by transform: translateZ(0) on the panel. */
.wf-detail-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: inherit;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.wf-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    animation: backdrop-in .22s var(--ease-out);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .wf-detail-backdrop {
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

.wf-detail-sheet {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-4) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 16, 13, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-top-left-radius: var(--wf-radius);
    border-top-right-radius: var(--wf-radius);
    overflow-y: auto;
    max-height: 78dvh;
    animation: wf-sheet-in .28s var(--ease-spring);
    user-select: none;
}

    .wf-detail-sheet .wf-line,
    .wf-detail-sheet .wf-card-name {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

.wf-detail-close {
    margin-top: var(--s-3);
}

@keyframes wf-sheet-in {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* --- Exit confirmation dialog --- */
.wf-confirm-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: inherit;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-4);
}

.wf-confirm-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    width: 100%;
    max-width: 320px;
    padding: var(--s-4);
    background: rgba(10, 16, 13, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--wf-radius);
    animation: wf-dialog-in .22s var(--ease-spring);
    user-select: none;
}

.wf-confirm-text {
    margin: 0;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 1.05rem;
    color: var(--t-strong);
}

.wf-confirm-dialog-error {
    border-color: rgba(255, 72, 0, 0.45);
}

.wf-confirm-text-error {
    color: var(--c-error);
}

@keyframes wf-dialog-in {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Main scanner: viewfinder fills remaining vertical space --- */
.scanner-shell .viewfinder-wrapper .viewfinder {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    aspect-ratio: unset;
    min-height: 0;
    align-self: stretch;
}

/* --- Order scan page --- */
.wf-body .viewfinder-wrapper {
    margin-top: var(--s-3);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

.wf-body .viewfinder {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    aspect-ratio: unset;
    min-height: 0;
    align-self: stretch;
}

/* --- Operator sheet fields --- */
.op-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--s-3);
}

.op-label {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--t-soft);
}

.op-input {
    min-height: 56px;
    padding: 0 var(--s-4);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--t-strong);
    font-family: var(--font-ui);
    font-size: 1.1rem;
}

    .op-input:focus {
        outline: none;
        border-color: rgba(11, 206, 136, 0.6);
    }

    .op-input.invalid {
        border-color: rgba(255, 108, 64, 0.7);
    }

.op-error {
    margin-top: -4px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: rgb(255, 138, 101);
}

.op-save {
    margin-top: var(--s-2);
    width: 100%;
}

.sheet-section .wf-btn-row {
    margin-top: var(--s-2);
}

    .sheet-section .wf-btn-row .op-save {
        margin-top: 0;
        width: auto;
    }

.op-status {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--t-soft);
    padding: var(--s-3) 0;
}

.op-status-error {
    color: rgb(255, 138, 101);
}

.op-search {
    margin-bottom: var(--s-3);
}

/* Keeps the search box pinned to the top of .wf-body while the cards below scroll underneath it */
.wf-search-sticky {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-2);
    padding-top: var(--s-2);
    padding-bottom: var(--s-2);
    margin-top: calc(var(--s-2) * -1);
    margin-bottom: 0;
}

.op-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: var(--s-3);
}

.op-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    min-height: 52px;
    padding: 0 var(--s-4);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--t-strong);
    font-family: var(--font-ui);
    text-align: left;
}

@media (hover: hover) {
    .op-item:hover {
        border-color: rgba(255, 255, 255, 0.24);
    }
}

.op-item.selected {
    border-color: rgba(11, 206, 136, 0.6);
    background: rgba(11, 206, 136, 0.12);
}

.op-item-name {
    font-size: 1rem;
}

.op-item-code {
    font-size: 0.85rem;
    color: var(--t-soft);
}

.op-mode-toggle {
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    padding: var(--s-2) 0;
    margin-bottom: var(--s-2);
    color: var(--c-primary);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

    .op-mode-toggle .ms {
        margin-right: 0;
        color: inherit;
    }

/* Testo è sottolineato, non l'icona. */
.op-mode-toggle-label {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Azione principale in caso di errore di caricamento di un elenco (es. "Riprova"): pulsante compatto con bordo. */
.op-retry {
    width: 100%;
    min-height: 52px;
    margin-bottom: var(--s-3);
    font-size: 1.05rem;
}

/* --- App lock (PIN gate) --- */
.lock-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-4);
    background: radial-gradient(1200px 800px at 50% -10%, rgba(11, 206, 136, 0.12), transparent 60%), var(--bg-0);
    z-index: 1000;
}

.lock-card {
    width: 100%;
    max-width: 420px;
    padding: var(--s-6) var(--s-5);
    border-radius: var(--wf-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-3);
    text-align: center;
}

.lock-logo {
    height: 40px;
    filter: drop-shadow(0 0 12px rgba(11, 206, 136, 0.4));
}

.lock-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--t-strong);
    margin: 0;
}

.lock-sub {
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--t-soft);
    margin: 0;
}

.pin-dots {
    display: flex;
    gap: var(--s-3);
    min-height: 20px;
    margin: var(--s-3) 0;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

    .pin-dot.is-filled {
        background: var(--c-primary);
        border-color: var(--c-primary);
        box-shadow: 0 0 10px rgba(11, 206, 136, 0.6);
    }

.pin-dots.is-error .pin-dot {
    border-color: var(--c-error);
    animation: lock-shake 0.4s var(--ease-out);
}

.lock-error {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--c-error);
    margin: 0;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-3);
    width: 100%;
    margin-top: var(--s-3);
}

.key {
    min-height: var(--tap-lg);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--t-strong);
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}

@media (hover: hover) {
    .key:hover {
        background: rgba(11, 206, 136, 0.16);
    }
}

.key:active {
    transform: scale(0.95);
}

.key-aux {
    color: var(--t-soft);
    font-size: 1.5rem;
}

.key-ok {
    background: linear-gradient(180deg, rgba(28, 214, 133, 0.95), rgba(11, 206, 136, 0.82));
    border-color: transparent;
    color: #05231a;
}

@keyframes lock-shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-7px);
    }

    75% {
        transform: translateX(7px);
    }
}

/* --- Material Symbols icon within field rows --- */
.ms {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 1.1em;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'liga';
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
    color: var(--t-soft);
    vertical-align: middle;
    flex-shrink: 0;
    margin-right: 0.35em;
}

.wf-line .ms {
    margin-right: 0;
}

/* Force scanner-shell to fill parent width, preventing the content-based flex sizing from causing the panel to shift horizontally between workflow stages. */
.scanner-shell {
    width: 100%;
}

/* --- Responsive layout tweaks (mobile) --- */
@media (max-width: 480px) {
    .scanner-shell {
        gap: var(--s-2);
    }

    .wf-panel {
        margin: var(--s-2) var(--s-3);
    }

    .wf-btn {
        padding-left: var(--s-2);
        padding-right: var(--s-2);
    }

    .wf-btn-row:has(> .wf-btn.back):has(> .wf-btn.success) > .wf-btn:not(.back):not(.success) {
        flex: 0 0 72px !important;
        padding: 0;
    }

        .wf-btn-row:has(> .wf-btn.back):has(> .wf-btn.success) > .wf-btn:not(.back):not(.success) .wf-btn-label {
            display: none;
        }

        .wf-btn-row:has(> .wf-btn.back):has(> .wf-btn.success) > .wf-btn:not(.back):not(.success) .ms {
            margin-right: 0;
        }
}

@media (max-width: 400px) {
    .op-name {
        display: none;
    }

    .op-chip {
        padding: 0 10px;
    }
}
