/* Transitional views only. New desktop uses the frozen model tokens. */
@scope (.legacy-view) {
    :scope {
        font-family: Inter, 'Segoe UI', Arial, sans-serif;
        color: #18263b;
        background: #f5f7fa;
        font-size: 14px;
        --blue:#285de5;
        --navy:#14233e;
        --muted:#65758a;
        --border:#e4e9f0;
        --radius:14px;
    }
    /* Shared baseline, tokens and controls. */
    * {
        box-sizing: border-box;
    }
    :scope {
        margin: 0;
    }
    button,
    input,
    select,
    textarea {
        font: inherit;
    }
    button {
        cursor: pointer;
        transition:
            background .15s,
            box-shadow .15s;
    }
    button:disabled {
        cursor: not-allowed;
        opacity: .48;
    }
    button svg {
        flex-shrink: 0;
    }
    h1,
    h2,
    h3,
    p {
        margin-top: 0;
    }
    h1 {
        font-size: 32px;
        line-height: 1.2;
        letter-spacing: -1px;
        margin-bottom: 10px;
    }
    h2 {
        font-size: 19px;
        letter-spacing: -.35px;
        margin-bottom: 14px;
    }
    h3 {
        font-size: 15px;
        margin: 25px 0 12px;
    }
    p {
        line-height: 1.6;
    }
    small {
        font-size: 12px;
    }
    code {
        font-family: Consolas, monospace;
    }
    label {
        display: flex;
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
        font-weight: 600;
        margin: 0 0 18px;
        color: #38485f;
    }
    input:not([type=checkbox]),
    select,
    textarea {
        width: 100%;
        border: 1px solid #d8e0eb;
        border-radius: 8px;
        background: white;
        color: #18263b;
        min-height: 44px;
        padding: 10px 12px;
        outline: none;
    }
    input:focus,
    select:focus,
    textarea:focus {
        border-color: #6290f3;
        box-shadow: 0 0 0 3px #e8efff;
    }
    input::placeholder,
    textarea::placeholder {
        color: #8591a3;
        font-weight: 400;
    }
    input[type=checkbox] {
        width: 16px;
        height: 16px;
        accent-color: var(--blue);
    }
    textarea {
        resize: vertical;
    }
    button:focus-visible,
    a:focus-visible {
        outline: 3px solid #93b3ff;
        outline-offset: 3px;
    }
    a {
        color: var(--blue);
    }
    .muted {
        color: var(--muted);
    }
    .small {
        font-size: 12px;
    }
    .eyebrow {
        font-size: 10px;
        font-weight: 750;
        letter-spacing: 1.8px;
        color: #69809c;
        margin-bottom: 12px;
    }
    .button {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        gap: 9px;
        border-radius: 8px;
        padding: 12px 17px;
        min-height: 44px;
        font-weight: 650;
        border: 1px solid transparent;
        white-space: nowrap;
    }
    .button.primary {
        background: var(--blue);
        color: white;
        box-shadow: 0 3px 6px #285de515;
    }
    .button.primary:hover:enabled {
        background: #194bc9;
    }
    .button.secondary {
        background: white;
        border-color: #dfe5ed;
        color: #384b65;
    }
    .button.secondary:hover:enabled {
        background: #f0f4fb;
    }
    .button.compact {
        min-height: 35px;
        padding: 8px 12px;
        font-size: 12px;
    }
    .button.full {
        width: 100%;
    }
    .text-button {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 0;
        border: 0;
        background: none;
        color: var(--blue);
        font-weight: 600;
        font-size: 12px;
        text-align: left;
    }
    .text-button:hover {
        text-decoration: underline;
    }
    .icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #718199;
        padding: 8px;
    }
    .icon-button:hover {
        background: #edf2f9;
    }
    .pill {
        display: inline-flex;
        padding: 5px 9px;
        border-radius: 5px;
        background: #edf1f6;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .3px;
        color: #697991;
    }
    .pill.blue {
        color: #285ac5;
        background: #ecf2ff;
    }
    .pill.green {
        color: #188365;
        background: #e9f7f1;
    }
    /* Brand and retained layout primitives. */
    .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--navy);
    }
    .brand-light {
        color: #fff;
    }
    .brand-copy {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .brand-name {
        font-size: 24px;
        font-weight: 750;
        line-height: 1.15;
        letter-spacing: 1.5px;
    }
    .brand-mark {
        display: block;
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        border-radius: 11px;
    }
    .brand-sub {
        display: block;
        font-size: 10px;
        font-style: italic;
        font-weight: 400;
        line-height: 1.5;
        letter-spacing: 0;
        margin-top: 5px;
        color: #526681;
        white-space: nowrap;
    }
    .brand-light .brand-sub {
        color: #b5c7e2;
    }

    .sidebar {
        width: 240px;
        flex: 0 0 240px;
        background: var(--navy);
        padding: 33px 20px 22px;
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
    .sidebar > .brand,
    .sidebar nav,
    .sidebar-bottom {
        flex-shrink: 0;
    }
    .sidebar .brand {
        padding: 0 2px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .sidebar .brand-mark {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
    .sidebar .brand-copy {
        display: contents;
    }
    .sidebar .brand-name {
        font-size: 21px;
        letter-spacing: 1px;
    }
    .sidebar .brand-sub {
        width: 100%;
        font-size: 9px;
        margin-top: 0;
    }

    .sidebar nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .sidebar-bottom {
        margin-top: auto;
        padding: 28px 10px 0;
    }

    .sidebar-bottom > p {
        font-size: 10px;
        color: #8fa3c0;
        margin: 9px 0 25px;
    }
    .account {
        display: flex;
        align-items: center;
        gap: 10px;
        border-top: 1px solid #ffffff12;
        padding-top: 22px;
    }
    .avatar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 35px;
        height: 35px;
        flex-shrink: 0;
        border-radius: 50%;
        background: #2a3c59;
        color: #aabddb;
    }
    .account strong {
        display: block;
        color: #e2e9f4;
        font-size: 11px;
    }
    .account small {
        display: block;
        margin-top: 5px;
        color: #8d9eba;
        font-size: 10px;
    }
    .logout {
        color: #9cacc5;
        border: 0;
        background: none;
        padding: 12px 0 0 45px;
        font-size: 10px;
    }

    .topbar {
        border-bottom: 1px solid var(--border);
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 42px;
        font-size: 11px;
        color: #8290a3;
    }

    .topbar strong {
        font-weight: 600;
        color: #4c5d74;
    }
    .slash {
        padding: 0 12px;
        color: #bdc6d2;
    }

    .workspace {
        padding: 38px 42px 20px;
        max-width: 1570px;
        margin: auto;
    }
    .page-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 28px;
    }
    .page-heading p.muted {
        font-size: 13px;
        margin-bottom: 0;
    }
    .panel {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        overflow: hidden;
        box-shadow: 0 2px 4px #18355502;
    }

    .stat {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 26px;
        background: white;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        text-align: left;
    }
    .stat > span {
        color: #6e7f94;
        font-size: 12px;
    }
    .stat > strong {
        font-size: 38px;
        font-weight: 650;
        margin: 12px 0 16px;
        letter-spacing: -1.7px;
    }
    .stat > small {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        font-size: 10px;
        color: #8090a4;
    }
    .stat:hover {
        border-color: #b9caf0;
    }
    .amber-text {
        color: #b87417 !important;
    }

    .panel-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 23px 25px 20px;
        border-bottom: 1px solid #edf0f5;
    }
    .panel-heading h2 {
        font-size: 15px;
        margin: 0;
    }
    .panel-heading p {
        margin: 6px 0 0;
        font-size: 10px;
    }

    .document-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 37px;
        height: 37px;
        border-radius: 9px;
        flex-shrink: 0;
    }
    .document-icon.receipt {
        background: #edf8f4;
        color: #25876f;
    }
    .document-icon.issue {
        background: #eef3ff;
        color: #3c6dde;
    }

    .empty {
        padding: 36px 25px;
        text-align: center;
        color: #91a1b6;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 13px;
    }
    .empty strong,
    .empty h2 {
        color: #59708d;
        font-size: 14px;
        margin: 0;
    }
    .empty p {
        font-size: 12px;
        max-width: 300px;
        margin: 0;
    }
    .empty.large {
        padding: 60px 30px;
        min-height: 280px;
    }

    /* Feedback, stock forms and tables. */
    .notice {
        display: flex;
        align-items: center;
        gap: 10px;
        border-radius: 8px;
        padding: 13px 16px;
        font-size: 12px;
        line-height: 1.5;
        margin-bottom: 20px;
    }
    .notice span {
        flex: 1;
    }
    .notice button {
        display: flex;
        margin-left: auto;
        border: 0;
        background: none;
        color: inherit;
    }
    .notice.error {
        background: #fff0ef;
        border: 1px solid #f5d3ce;
        color: #ac4037;
    }
    .notice.success {
        background: #ebf8f1;
        border: 1px solid #c6e7d7;
        color: #237052;
    }
    .notice.warning {
        background: #fff7e7;
        border: 1px solid #f1ddb5;
        color: #93671c;
    }
    .notice.info {
        background: #edf3ff;
        border: 1px solid #cbdafa;
        color: #294f88;
    }
    .draft-tools {
        display: flex;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
        margin-bottom: 16px;
    }
    .draft-reference-warning {
        color: #93671c;
        font-size: 12px;
        line-height: 1.5;
        margin: 8px 0;
    }
    .catalog-toolbar {
        display: flex;
        align-items: center;
        gap: 18px;
        padding: 20px 23px;
        border-bottom: 1px solid var(--border);
        flex-wrap: wrap;
    }
    .search-field {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 240px;
    }
    .search-field > svg {
        color: #8294ad;
        width: 19px;
    }
    .search-field input {
        flex: 1;
        min-width: 60px;
    }
    .catalog-toolbar > select {
        width: 180px;
        font-size: 12px;
    }
    .check-label {
        flex-direction: row;
        align-items: center;
        gap: 7px;
        white-space: nowrap;
        margin: 0;
        color: #6f8096;
        font-size: 11px;
        font-weight: 400;
    }
    .table-scroll {
        overflow-x: auto;
    }
    table {
        border-collapse: collapse;
        width: 100%;
        text-align: left;
        white-space: nowrap;
    }
    th {
        padding: 14px 22px;
        font-size: 9px;
        letter-spacing: .8px;
        text-transform: uppercase;
        color: #8a99ad;
        background: #fafbfd;
        font-weight: 600;
        border-bottom: 1px solid #edf0f5;
    }
    td {
        padding: 17px 22px;
        border-bottom: 1px solid #eef2f6;
        font-size: 12px;
    }
    td small {
        display: block;
        color: #8d9db1;
        margin-top: 5px;
        font-size: 10px;
    }
    td.numeric,
    th.numeric {
        text-align: right;
    }

    .product-placeholder,
    .product-image {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 43px;
        height: 43px;
        flex-shrink: 0;
        border-radius: 10px;
        background: #f0f3f8;
        color: #8095b1;
        font-size: 12px;
        font-weight: 650;
        object-fit: cover;
    }
    .location {
        display: inline-block;
        padding: 5px 8px;
        border-radius: 4px;
        font-size: 10px;
        background: #f0f3f8;
        color: #6e829e;
        font-family: Consolas, monospace;
    }
    .stock-warning {
        font-size: 9px;
        color: #b77e2b;
    }

    .operation-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 310px;
        gap: 22px;
        align-items: start;
    }
    .operation-summary {
        padding: 24px;
        position: sticky;
        top: 20px;
    }
    .operation-summary h2 {
        font-size: 16px;
    }

    .operation-summary label {
        font-size: 11px;
    }
    .field-help {
        font-size: 10px;
        line-height: 1.6;
        color: #8e9db0;
        margin: -7px 0 20px;
    }

    .operation-summary > .button + .button {
        margin-top: 10px;
    }

    .scan-form {
        display: flex;
        gap: 10px;
        margin-bottom: 13px;
    }
    .scan-form input {
        height: 49px;
        font-size: 13px;
    }
    .scan-form button {
        min-width: 77px;
    }

    .availability {
        display: flex;
        justify-content: space-between;
        grid-column: 1/-1;
        align-items: center;
        font-size: 10px;
        color: #8e9fb5;
        padding-top: 3px;
    }
    .availability strong {
        color: #69819e;
        font-size: 12px;
    }
    .availability strong small {
        font-size: 10px;
        font-weight: 400;
    }

    /* Dialogs and detail presentation. */
    .modal {
        color: #263b58;
        background: white;
        border: 0;
        border-radius: 17px;
        padding: 29px;
        width: min(630px, calc(100vw - 30px));
        max-height: 90vh;
        box-shadow: 0 30px 90px #06193640;
    }
    .modal.wide {
        width: min(950px, calc(100vw - 30px));
    }
    .modal::backdrop {
        background: #0b1d38a3;
        backdrop-filter: blur(3px);
    }
    .modal-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
    }
    .modal-top .eyebrow {
        margin: 0;
    }
    .modal h2 {
        font-size: 23px;
        margin-bottom: 10px;
    }
    .modal > p.muted {
        font-size: 12px;
        margin-bottom: 24px;
    }
    .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 25px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
    }
    .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 18px;
    }
    .form-grid .span2 {
        grid-column: 1/-1;
    }
    .form-grid label {
        font-size: 11px;
    }
    .picker-results {
        margin-top: 20px;
    }
    .picker-row {
        display: flex;
        gap: 13px;
        align-items: center;
        width: 100%;
        padding: 13px 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        background: white;
        color: #36506f;
        text-align: left;
    }
    .picker-row > span:not(.product-placeholder) {
        flex: 1;
    }
    .picker-row strong {
        display: block;
        font-size: 12px;
    }
    .picker-row small {
        display: block;
        color: #899bb2;
        font-size: 10px;
        margin-top: 5px;
    }
    .picker-row > svg {
        color: #668bca;
    }
    .product-detail-heading {
        display: flex;
        gap: 17px;
        align-items: center;
        margin-bottom: 24px;
    }
    .product-detail-heading .product-image,
    .product-detail-heading .product-placeholder {
        width: 62px;
        height: 62px;
        font-size: 18px;
    }
    .product-detail-heading h2 {
        font-size: 21px;
    }
    .product-detail-heading p {
        margin: 0;
        font-size: 11px;
    }

    .detail-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 22px;
        padding: 25px 0;
        border-bottom: 1px solid var(--border);
    }
    .detail-grid span {
        display: block;
        font-size: 10px;
        color: #8e9db2;
        margin-bottom: 8px;
    }
    .detail-grid strong {
        display: block;
        font-size: 12px;
        margin-bottom: 5px;
    }
    .product-notes {
        font-size: 12px;
        color: #6f859f;
        margin: 20px 0;
    }
    .barcode-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid #eff2f7;
        gap: 15px;
    }
    .barcode-row code {
        font-size: 12px;
    }
    .barcode-row span {
        font-size: 10px;
        color: #8b9db4;
    }
    .detail-edit {
        font-size: 11px;
        margin-top: 20px;
        color: #5681ba;
    }
    .detail-edit summary {
        cursor: pointer;
        margin-bottom: 16px;
    }
    .detail-edit .button {
        margin-bottom: 15px;
    }
    .photo-upload {
        margin-top: 20px;
        font-size: 10px;
        color: #8a9bb2;
    }
    .photo-upload input {
        font-size: 10px;
    }
    .audit-row {
        border-left: 2px solid #dce7f8;
        padding: 4px 14px;
        margin: 14px 0;
    }
    .audit-row small {
        font-size: 10px;
        color: #91a1b7;
    }
    .audit-row p {
        font-size: 11px;
        margin: 7px 0 0;
    }
    .loading-screen {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: #6f84a0;
    }
    .loading-screen h1 {
        font-size: 23px;
        margin: 25px 0 10px;
    }
    .loading-screen p {
        font-size: 12px;
    }

    /* Viewport adaptations; keep their cascade position. */
    @media (max-width: 1200px) {
        .sidebar {
            width: 220px;
            flex-basis: 220px;
            padding: 30px 14px;
        }
        .workspace {
            padding: 30px 25px 20px;
        }
        .topbar {
            padding: 0 25px;
        }
        .operation-layout {
            grid-template-columns: minmax(0, 1fr) 270px;
            gap: 15px;
        }
        .operation-summary {
            padding: 19px;
        }

        .catalog-toolbar {
            gap: 12px;
        }
        .catalog-toolbar > select {
            width: 150px;
        }
        .check-label {
            font-size: 10px;
        }
        th,
        td {
            padding-left: 17px;
            padding-right: 17px;
        }
    }

    @media (max-width: 950px) {
        .sidebar {
            width: 76px;
            flex-basis: 76px;
            padding: 24px 12px;
        }
        .sidebar .brand {
            padding: 0;
            justify-content: center;
        }
        .sidebar .brand-mark {
            width: 44px;
            height: 44px;
            flex-basis: 44px;
        }
        .sidebar .brand-copy,
        .sidebar-bottom,
        .sidebar .brand-sub {
            display: none;
        }
        .sidebar nav {
            margin-top: 32px;
        }

        .topbar {
            height: 60px;
        }
        .workspace {
            padding: 27px 22px;
        }
        .page-heading h1 {
            font-size: 27px;
        }

        .operation-layout {
            grid-template-columns: 1fr;
        }
        .operation-summary {
            position: static;
        }

        .stat {
            padding: 20px;
        }
        .stat > span {
            font-size: 11px;
        }
    }

    @media (max-width: 600px) {
        .sidebar {
            height: auto;
            width: 100%;
            position: sticky;
            z-index: 5;
            padding: 0 10px;
            top: 0;
            overflow-y: visible;
        }
        .sidebar > .brand {
            display: none;
        }
        .sidebar nav {
            margin: 0;
            flex-direction: row;
            justify-content: flex-start;
            gap: 0;
            overflow-x: auto;
        }

        .topbar {
            height: 43px;
            padding: 0 17px;
            font-size: 9px;
        }

        .workspace {
            padding: 24px 15px 17px;
        }
        .page-heading {
            align-items: flex-start;
            margin-bottom: 23px;
            gap: 12px;
        }
        .page-heading h1 {
            font-size: 24px;
            letter-spacing: -.8px;
        }
        .eyebrow {
            font-size: 8px;
            letter-spacing: 1.4px;
        }
        .page-heading p.muted {
            font-size: 11px;
        }
        .page-heading > .button {
            padding: 9px;
            font-size: 10px;
        }
        .page-heading > .button svg {
            width: 15px;
        }

        .stat {
            padding: 14px 12px;
        }
        .stat > span {
            font-size: 9px;
            min-height: 23px;
        }
        .stat > strong {
            font-size: 29px;
            margin: 6px 0 9px;
        }
        .stat > small {
            font-size: 8px;
            min-height: 19px;
        }
        .stat > small svg {
            display: none;
        }

        .panel-heading {
            padding: 20px;
        }

        .catalog-toolbar {
            padding: 15px;
        }
        .search-field {
            min-width: 100%;
            gap: 8px;
        }
        .catalog-toolbar > select {
            width: 48%;
            flex: 1;
        }
        .check-label {
            white-space: normal;
            flex: 1;
        }

        .scan-form {
            gap: 7px;
        }
        .scan-form input {
            font-size: 11px;
            padding: 10px;
        }
        .scan-form .button {
            min-width: 60px;
            padding: 10px;
            font-size: 11px;
        }

        .modal {
            padding: 22px;
        }
        .modal h2 {
            font-size: 21px;
        }
        .form-grid {
            gap: 0 12px;
        }
        .form-grid label {
            font-size: 10px;
        }
        .modal-actions .button {
            font-size: 11px;
            padding: 10px;
        }
        .barcode-row {
            align-items: flex-start;
            flex-direction: column;
            gap: 6px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        * {
            transition: none !important;
        }
    }

    .button {
        text-decoration: none;
    }

    .assignment-edit {
        margin-top: 10px;
        font-size: 10px;
        white-space: normal;
    }
    .assignment-edit summary {
        color: #4976b7;
        cursor: pointer;
    }
    .assignment-edit select {
        margin: 10px 0;
        font-size: 11px;
        max-width: 240px;
    }

    /* One quantity control across all workflows; arrow buttons always change by one. */
    /* Quantity controls and language selection. */
    .quantity-control {
        display: flex;
        position: relative;
        width: 100%;
        min-width: 0;
    }
    .quantity-control input {
        width: 100%;
        padding-right: 38px;
        appearance: textfield;
        -moz-appearance: textfield;
    }
    .quantity-control input::-webkit-inner-spin-button,
    .quantity-control input::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    .quantity-arrows {
        position: absolute;
        right: 1px;
        top: 1px;
        bottom: 1px;
        width: 32px;
        display: flex;
        flex-direction: column;
        border-left: 1px solid #d4deed;
        border-radius: 0 8px 8px 0;
        overflow: hidden;
    }
    .quantity-arrows button {
        flex: 1;
        border: 0;
        background: #f1f5fb;
        color: #203a60;
        padding: 0;
        line-height: 1;
        cursor: pointer;
        font-size: 16px;
    }
    .quantity-arrows button:hover {
        background: #dce7fa;
    }
    .quantity-arrows button:disabled {
        opacity: .4;
        cursor: default;
    }

    /* Language choice remains available in narrow layouts without covering controls. */
    .language-picker label {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        font-size: 12px;
    }
    .language-picker select {
        width: auto;
        min-width: 125px;
        padding: 8px 28px 8px 10px;
        margin: 0;
        background: #fff;
        color: #17304d;
    }
    .language-picker small {
        display: block;
        max-width: 260px;
        margin-top: 5px;
        color: #855200;
    }

    .topbar {
        gap: 14px;
        min-height: 74px;
        height: auto;
        padding-top: 14px;
        padding-bottom: 14px;
        flex-wrap: wrap;
    }
    @media (max-width: 600px) {
        .topbar {
            padding: 12px 16px;
        }
        .topbar > span:first-child {
            flex: 1 1 100%;
        }
        .language-picker label {
            font-size: 11px;
        }
        .language-picker select {
            min-width: 120px;
        }
    }
    .document-progress {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        margin-top: 16px;
    }
    .document-progress progress {
        width: min(100%, 280px);
        height: 18px;
        accent-color: var(--primary, #2860e8);
    }

    /* Warehouse tools remain inside one main navigation section. */

    /* 6H: readable daily workflows and a consistent hierarchy of navigation/actions. */
    :scope {
        /* Accessibility contrast override; evaluated after the base palette. */
        --muted:#526579;
    }
    label {
        font-size: 13px;
    }
    .field-help,
    .availability,
    .detail-grid span,
    .barcode-row span,
    .photo-upload,
    .audit-row small,
    .picker-row small {
        color: #526579;
        font-size: 12px;
    }
    th {
        color: #526579;
        font-size: 12px;
    }
    td,
    .picker-row strong {
        font-size: 13px;
    }
    .empty {
        color: #526579;
    }
    .pill {
        font-size: 12px;
        letter-spacing: 0;
    }
    .eyebrow,
    .topbar {
        font-size: 12px;
    }
    input::placeholder,
    textarea::placeholder {
        color: #65758a;
    }
    .page-heading {
        flex-wrap: wrap;
    }
    .page-heading > div {
        flex: 1;
        min-width: min(100%, 260px);
    }
    .page-heading h1 {
        font-size: 30px;
        letter-spacing: -.7px;
    }
    .page-heading p.muted {
        font-size: 14px;
    }
    .workspace {
        padding-top: 28px;
    }
    .sidebar {
        scrollbar-width: thin;
    }

    .sidebar-bottom > p,
    .account small,
    .logout {
        font-size: 12px;
        color: #afc0d9;
    }
    .account strong {
        font-size: 13px;
    }
    .sidebar .brand-sub {
        font-size: 10px;
    }
    .topbar {
        color: #526579;
    }

    #main-content:focus {
        outline: 0;
    }

    .stat {
        padding: 18px 22px;
    }
    .stat > strong {
        font-size: 32px;
        margin: 8px 0 12px;
    }
    .stat > span,
    .stat > small {
        font-size: 12px;
        color: #526579;
    }

    .notice {
        flex-wrap: wrap;
        overflow-wrap: anywhere;
        font-size: 13px;
    }
    .notice > p {
        flex-basis: 100%;
        margin: 0 0 8px;
    }
    .notice .button {
        margin-left: 0;
        white-space: normal;
    }
    .notice .text-button {
        min-height: 32px;
    }
    /* Shared sections and viewport refinements. */
    .section-tab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: 1px solid transparent;
        border-radius: 7px;
        background: transparent;
        color: #435770;
        padding: 10px 12px;
        min-height: 44px;
        font-weight: 600;
        font-size: 13px;
        line-height: 1.3;
    }
    .section-tab:hover:enabled {
        background: #e7eefb;
    }
    .section-tab.active {
        background: #fff;
        color: #184cad;
        border-color: #cad8ed;
        box-shadow: 0 1px 3px #19375b0a;
    }

    @media (max-width: 600px) {
        .sidebar nav {
            display: none;
        }
    }

    .button.compact {
        min-height: 40px;
        font-size: 13px;
    }
    .text-button {
        min-height: 32px;
        font-size: 13px;
    }
    .icon-button {
        min-width: 40px;
        min-height: 40px;
    }
    .table-scroll {
        max-width: 100%;
        overscroll-behavior-inline: contain;
    }
    @media (max-width: 950px) {
        .sidebar .brand-name {
            display: none;
        }
    }
    @media (max-width: 600px) {
        .sidebar {
            position: relative;
        }

        .workspace {
            padding: 20px 12px;
        }
        .page-heading h1 {
            font-size: 26px;
        }
        .page-heading p.muted {
            font-size: 13px;
        }
        .page-heading > .button {
            font-size: 13px;
            padding: 10px 14px;
        }

        .stat {
            display: grid;
            grid-template-columns: 1fr auto;
            padding: 14px 18px;
            gap: 6px;
        }
        .stat > strong {
            grid-column: 2;
            grid-row: 1/3;
            margin: 0;
            font-size: 28px;
            align-self: center;
        }
        .stat > span,
        .stat > small {
            font-size: 12px;
            min-height: 0;
        }
        .button.compact,
        .text-button,
        .icon-button {
            min-height: 44px;
        }
        .icon-button {
            min-width: 44px;
        }
        .quantity-control input {
            min-height: 50px;
            font-size: 16px;
        }
        .quantity-arrows {
            width: 40px;
        }
        .quantity-arrows button {
            min-height: 24px;
        }
        .form-grid label,
        .operation-summary label {
            font-size: 13px;
        }
        .scan-form input {
            font-size: 14px;
        }
        .scan-form .button,
        .modal-actions .button {
            font-size: 13px;
        }
        .form-grid {
            grid-template-columns: 1fr;
        }
        .form-grid .span2 {
            grid-column: auto;
        }

        .catalog-toolbar > select {
            width: 100%;
        }

        .section-tab {
            padding: 10px;
            font-size: 13px;
        }
    }

    /* Read-only list filters, separate from editors and pending operation state. */

    /* Discovery, reports and operation state. */
    .discovery-hint {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 8px 24px 16px;
        color: var(--muted);
        font-size: 13px;
    }
    .discovery-hint strong {
        color: var(--ink);
    }

    .discovery-more {
        flex-basis: 100%;
        min-width: 0;
    }
    .discovery-more summary {
        cursor: pointer;
        color: var(--blue,#245bec);
        font-weight: 600;
        padding: 6px 0;
    }
    .discovery-more summary:focus-visible {
        outline: 2px solid #245bec;
        outline-offset: 3px;
    }

    /* 6H-D: one report and explicit save/data states. */
    .report-choice {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 20px;
        margin: 0 0 20px;
    }
    .report-choice label {
        display: grid;
        gap: 8px;
        max-width: 520px;
        font-weight: 600;
    }
    .report-choice p {
        margin: 10px 0 0;
        color: var(--muted);
    }
    .report-period {
        display: flex;
        gap: 8px 18px;
        flex-wrap: wrap;
        margin: 12px 0;
    }
    .report-period button {
        min-height: 40px;
    }
    .operation-status {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 18px;
        padding: 12px 16px;
        margin: 14px 0;
        border: 1px solid #cbdcf7;
        border-radius: 10px;
        background: #f2f6fe;
    }
    .operation-status.warning {
        background: #fff7e8;
        border-color: #edcd91;
    }
    .operation-status.saved {
        background: #edf9f3;
        border-color: #a8d6c0;
    }
    .operation-status span {
        font-size: 13px;
    }
    .cost-completeness {
        background: #fff7e8;
        border: 1px solid #edcd91;
        border-radius: 12px;
        padding: 16px;
        margin: 16px 0;
    }
    .cost-completeness strong {
        font-size: 20px;
    }
    .cost-completeness p {
        margin: 6px 0 0;
    }
    .service-filters {
        border: 0;
        padding: 0;
        min-width: 0;
    }
    .service-filters select {
        max-width: 100%;
    }
    @media (max-width: 600px) {
        .report-choice {
            padding: 16px;
        }
        .report-choice select {
            width: 100%;
            min-width: 0;
        }
        .operation-status {
            display: grid;
        }
        .report-period {
            gap: 4px 12px;
        }
    }

    /* D-078: readable feedback and keyboard/touch targets without changing operation state. */
    /* Validation, focus, cancellation and help. */
    .form-error {
        align-items: flex-start;
        font-size: 14px;
    }
    .form-error > div {
        flex: 1;
        min-width: 0;
    }
    .form-error p {
        margin: 6px 0 0;
    }
    .form-error > .icon-button {
        margin-left: auto;
    }
    .form-error:focus {
        outline: 3px solid #b42b35;
        outline-offset: 3px;
    }
    .form-validation:empty {
        display: none;
    }
    .form-validation:not(:empty) {
        background: #fff1f0;
        color: #922330;
        border: 1px solid #d57c83;
        border-radius: 10px;
        padding: 16px;
        margin: 12px 0;
    }
    .form-validation ul {
        margin: 8px 0 0;
        padding-left: 20px;
    }
    .form-validation .text-button {
        color: inherit;
        text-decoration: underline;
        text-align: left;
        white-space: normal;
    }
    [aria-invalid=true] {
        border: 2px solid #b42b35 !important;
    }
    :where(button, a, input, select, textarea, summary):focus-visible {
        outline: 3px solid #173fbb;
        outline-offset: 3px;
        scroll-margin: 30px;
    }
    .cancel-edit {
        flex-basis: 100%;
        padding: 12px;
        border: 1px solid #d2ddec;
        border-radius: 10px;
        background: #f5f8fc;
    }
    .cancel-edit p {
        margin: 0 0 10px;
    }
    .cancel-edit .button {
        margin: 0 8px 4px 0;
    }
    .application-help {
        width: min(680px, 94vw);
    }

    .help-disclosure {
        margin: 14px 0;
    }
    .help-disclosure summary {
        font-weight: 600;
        cursor: pointer;
        padding: 10px 0;
        min-height: 44px;
    }
    .help-disclosure p {
        line-height: 1.65;
    }
    .quantity-control input {
        min-height: 52px;
    }
    .quantity-arrows button {
        min-height: 24px;
        min-width: 32px;
    }
    .field-help,
    .picker-row small {
        font-size: 13px;
    }

    @media (max-width: 600px), (pointer: coarse) {
        .quantity-arrows {
            position: static;
            flex-direction: row;
            flex-shrink: 0;
            width: auto;
            border-radius: 0 8px 8px 0;
        }
        .quantity-arrows button {
            width: 44px;
            min-width: 44px;
            min-height: 44px;
        }
        .quantity-arrows button + button {
            border-left: 1px solid #c7d4e6;
        }
        .quantity-control input {
            flex: 1;
            min-width: 0;
            width: 0;
            padding-right: 12px;
        }
        .form-error {
            padding: 14px;
            font-size: 14px;
        }

        .button.compact {
            min-height: 44px;
        }
    }

    /* UX-05–09: compact headers, visible applied filters and readable loading. */
    .work-page .page-heading {
        margin-bottom: 16px;
    }
    .work-page .page-heading h1 {
        margin-bottom: 6px;
    }

    .activity-status {
        padding: 12px 16px;
        background: #eff4fc;
        border-radius: 8px;
        color: #264469;
    }

    .machine-add[hidden],
    .upload-disclosure[hidden] {
        display: none !important;
    }
    @media (max-width: 600px) {
        .work-page .page-heading {
            margin-bottom: 12px;
        }
    }
}
