:root {
    --mi7-blue: #0241b3;
    --mi7-cyan: #0ed6fe;
    --mi7-ink: #0c131c;
    --mi7-cloud: #ebebeb;
    --black: var(--mi7-ink);
    --black-soft: #172331;
    --gold: var(--mi7-cyan);
    --gold-dark: var(--mi7-blue);
    --gold-pale: #def8ff;
    --paper: #f5f8fc;
    --surface: #ffffff;
    --text: #152233;
    --muted: #617085;
    --border: #dce5ef;
    --success: #087a55;
    --success-bg: #e7f8f1;
    --danger: #b4233a;
    --danger-bg: #fff0f2;
    --warning: #946200;
    --warning-bg: #fff7df;
    --shadow: 0 16px 42px rgba(12, 19, 28, 0.09);
    --shadow-soft: 0 8px 24px rgba(12, 19, 28, 0.07);
    --radius: 18px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --bs-primary: #0241b3;
    --bs-primary-rgb: 2, 65, 179;
    --bs-body-color: #152233;
    --bs-body-bg: #f5f8fc;
    --bs-border-color: #dce5ef;
    --bs-body-font-family: "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    color-scheme: light;
    background: var(--paper);
    font-family: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 100% 0, rgba(14, 214, 254, 0.11), transparent 32rem),
        linear-gradient(180deg, #f8fbff 0, var(--paper) 28rem),
        var(--paper);
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

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

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: calc(68px + var(--safe-top));
    padding: calc(10px + var(--safe-top)) 14px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    background: var(--black);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 2px solid var(--gold);
    border-radius: 10px;
    color: var(--gold);
    font-weight: 900;
    line-height: 1;
}

.brand-mark-large {
    width: 62px;
    height: 62px;
    border-radius: 15px;
    font-size: 30px;
}

.brand-name {
    display: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-context {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.header-context strong,
.header-context span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-context strong {
    font-size: 15px;
}

.header-context span {
    margin-top: 2px;
    color: #bebebe;
    font-size: 11px;
}

.logout-form {
    margin: 0;
}

.icon-button {
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid #4b4b4b;
    border-radius: 10px;
    color: #ffffff;
    background: transparent;
    cursor: pointer;
}

.page-container {
    width: min(100%, 680px);
    margin: 0 auto;
    padding: 20px 14px calc(78px + var(--safe-bottom));
}

.wide-page {
    width: min(100%, 960px);
}

.page-intro {
    padding: 5px 2px 18px;
}

.page-intro.compact {
    padding-top: 10px;
}

.eyebrow,
.step-badge {
    color: var(--gold-dark);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.12em;
}

.page-intro h1,
.scan-panel h2,
.status-section h2,
.admin-panel h2 {
    margin: 5px 0 5px;
    color: var(--black);
    line-height: 1.12;
}

.page-intro h1 {
    font-size: 30px;
    font-size: clamp(25px, 8vw, 38px);
}

.page-intro p,
.scan-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.module-card {
    min-height: 122px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(22, 22, 22, 0.05);
}

.module-card:active {
    transform: translateY(1px);
    box-shadow: none;
}

.module-card.module-primary {
    border-color: var(--black);
    color: #ffffff;
    background: var(--black);
}

.module-number {
    margin-bottom: auto;
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 900;
}

.module-primary .module-number {
    color: var(--gold);
}

.module-card strong {
    font-size: 17px;
    line-height: 1.1;
}

.module-card small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.module-primary small {
    color: #bdbdbd;
}

.back-link,
.text-link {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    color: var(--gold-dark);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.scan-panel,
.admin-panel,
.status-section {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.scan-panel form {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.scan-input,
.stack-form input,
.form-grid input,
.form-grid select {
    width: 100%;
    min-height: 52px;
    padding: 11px 13px;
    border: 2px solid #cfcac0;
    border-radius: 10px;
    color: var(--text);
    background: #ffffff;
    outline: 0;
}

.scan-input {
    min-height: 62px;
    border-color: var(--gold);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.scan-input:focus,
.stack-form input:focus,
.form-grid input:focus,
.form-grid select:focus {
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(203, 163, 61, 0.24);
}

.button {
    min-height: 48px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    font-weight: 850;
    cursor: pointer;
}

.button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.button-primary {
    color: #ffffff;
    background: var(--black);
}

.button-primary:active {
    background: var(--black-soft);
}

.button-secondary {
    border: 1px solid var(--border);
    color: var(--text);
    background: #f4f2ec;
}

.button-warning {
    color: #5c3a00;
    background: #f4cd6b;
}

.button-danger,
.button-danger-outline {
    color: #ffffff;
    background: var(--danger);
}

.button-danger-outline {
    border: 1px solid #d48d87;
    color: var(--danger);
    background: transparent;
}

.button-large {
    min-height: 56px;
    font-size: 16px;
}

.scan-result {
    min-height: 82px;
    margin-top: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f7f6f2;
}

.scan-result strong {
    font-size: 17px;
}

.scan-result span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.scan-result.is-success {
    border-color: #87c9a8;
    color: var(--success);
    background: var(--success-bg);
}

.scan-result.is-error {
    border-color: #efaaa5;
    color: var(--danger);
    background: var(--danger-bg);
}

.scan-result.is-busy {
    border-color: #e3c46f;
    color: var(--warning);
    background: var(--warning-bg);
}

.foundation-note {
    margin-top: 14px;
    padding: 13px 14px;
    border-left: 4px solid var(--gold);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.65);
}

.connection-status {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: calc(12px + var(--safe-bottom));
    padding: 7px 11px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--success);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
    font-size: 11px;
    font-weight: 800;
}

.connection-status.is-offline {
    background: var(--danger);
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
    background:
        radial-gradient(circle at 80% 15%, rgba(203, 163, 61, 0.24), transparent 35%),
        var(--black);
}

.login-shell {
    width: min(100%, 400px);
}

.login-card {
    padding: 24px;
    border: 1px solid #3d3d3d;
    border-radius: 18px;
    background: #202020;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--gold);
}

.login-brand div {
    display: flex;
    flex-direction: column;
}

.login-brand strong {
    letter-spacing: 0.09em;
}

.login-brand span:not(.brand-mark) {
    color: #b5b5b5;
    font-size: 12px;
    letter-spacing: 0.16em;
}

.login-card h1 {
    margin: 28px 0 5px;
    font-size: 27px;
}

.login-card > p {
    margin: 0 0 20px;
    color: #bdbdbd;
    line-height: 1.4;
}

.stack-form {
    display: grid;
    gap: 9px;
}

.stack-form label,
.form-grid label {
    color: inherit;
    font-size: 13px;
    font-weight: 750;
}

.stack-form input {
    margin-bottom: 6px;
    border-color: #4a4a4a;
    color: #ffffff;
    background: var(--mi7-ink);
}

.stack-form .button {
    margin-top: 9px;
    color: var(--black);
    background: var(--gold);
}

.alert {
    margin: 12px 0;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
}

.alert-error {
    border-color: #efaaa5;
    color: #7f1d1d;
    background: var(--danger-bg);
}

.alert-success {
    border-color: #87c9a8;
    color: #145c3c;
    background: var(--success-bg);
}

.alert-warning {
    border-color: #e3c46f;
    color: #6e4700;
    background: var(--warning-bg);
}

.status-section,
.admin-panel {
    margin-bottom: 14px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.printer-list,
.job-list {
    display: grid;
    gap: 8px;
}

.printer-row,
.job-row {
    min-height: 66px;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #faf9f6;
}

.printer-row > div,
.job-row > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.printer-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 9px;
}

.printer-actions .text-link {
    min-height: 34px;
    font-size: 12px;
}

.printer-row strong,
.printer-row span,
.printer-row small,
.job-row strong,
.job-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.printer-row > div:first-child span,
.job-row > div span,
.printer-row small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.status-pill {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--black-soft);
    background: #e9e7e0;
    font-size: 10px;
    font-weight: 900;
}

.status-pill.status-ok {
    color: var(--success);
    background: var(--success-bg);
}

.status-pill.status-muted {
    color: var(--muted);
}

.status-pill.status-warning {
    color: var(--warning);
    background: var(--warning-bg);
}

.empty-state {
    padding: 18px;
    border: 1px dashed #cfcac0;
    border-radius: 9px;
    color: var(--muted);
    text-align: center;
}

.picking-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}

.picking-heading .button {
    flex: 0 0 auto;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.order-card {
    min-height: 128px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    text-align: left;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(22, 22, 22, 0.05);
    cursor: pointer;
}

.order-card:active {
    transform: translateY(1px);
}

.order-card .order-number {
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 900;
}

.order-card strong {
    font-size: 16px;
    line-height: 1.2;
}

.order-card > span:not(.order-number) {
    color: var(--muted);
    font-size: 12px;
}

.order-card small {
    margin-top: auto;
    padding-top: 8px;
    color: var(--success);
    font-weight: 750;
}

.in-progress-orders {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.picking-list-heading {
    margin-bottom: 12px;
    align-items: end;
}

.picking-list-heading h2 {
    margin: 3px 0 0;
}

.picking-list-heading > small {
    color: var(--muted);
}

.in-progress-order-card {
    cursor: default;
}

.in-progress-order-card:active {
    transform: none;
}

.order-card.in-progress-order-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 14px rgba(22, 22, 22, 0.05);
    transform: none;
}

.in-progress-order-card small {
    color: #956400;
}

.takeover-button {
    width: 100%;
    margin-top: 9px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.order-card .checking-order-counts {
    color: var(--text);
    font-weight: 750;
}

.checking-lists {
    margin: 10px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.checking-list-panel {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.checked-list-panel {
    border-color: #b8d8c5;
    background: #f7fcf9;
}

.checking-list-heading {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.checking-list-heading h2 {
    margin: 0;
    font-size: 14px;
}

.checking-list-heading > span {
    min-width: 26px;
    min-height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: var(--black);
    font-size: 11px;
    font-weight: 900;
}

.checked-list-panel .checking-list-heading > span {
    background: var(--success);
}

.checking-product-list {
    max-height: 180px;
    display: grid;
    gap: 6px;
    overflow: auto;
}

.checking-product-row {
    width: 100%;
    padding: 9px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-align: left;
    background: #ffffff;
}

.checking-product-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.checking-product-row span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.checking-product-row.is-checked {
    border-color: #c7dfd0;
    color: var(--success);
}

.checking-list-empty {
    padding: 10px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

.outbound-checking-page .picking-item-card {
    margin-top: 0;
}

.outbound-checking-page .checking-quantity-strip {
    margin-top: 14px;
}

.checking-product-empty {
    min-height: 132px;
    padding: 20px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    text-align: center;
    background: var(--surface);
}

.checking-product-empty h2,
.checking-product-empty p {
    margin: 0;
}

.checking-product-empty p {
    color: var(--muted);
    font-size: 13px;
}

.outbound-checking-page .dialog-card > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.reverse-open {
    width: 100%;
    margin-top: 16px;
}

.item-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.picking-lower-controls {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.volume-toolbar {
    margin: 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.volume-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.volume-toolbar > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.volume-toolbar > span strong {
    display: inline-grid;
    min-width: 30px;
    min-height: 30px;
    margin-left: 5px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: var(--black);
}

.item-navigation {
    margin: 0;
}

.item-navigation span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.item-navigation .button {
    min-height: 42px;
    padding: 8px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.item-navigation .button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.picking-item-card,
.completion-panel {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.product-summary {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
}

.product-photo {
    width: 92px;
    height: 92px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--muted);
    background: #f2f0ea;
}

.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.product-summary h2 {
    margin: 4px 0;
    font-size: 19px;
    line-height: 1.15;
}

.product-summary p,
.product-code {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.product-code {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 10px;
}

.product-code > span + span {
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

.product-code b {
    color: var(--text);
}

.address-grid {
    margin: 14px 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.address-grid div {
    padding: 9px 5px;
    border-radius: 8px;
    text-align: center;
    background: var(--black);
}

.address-grid dt {
    color: #bdbdbd;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.address-grid dd {
    margin: 2px 0 0;
    color: var(--gold);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 16px;
    font-weight: 900;
}

.quantity-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.quantity-strip span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.quantity-strip small {
    color: var(--muted);
    font-size: 9px;
}

.quantity-strip b {
    overflow: hidden;
    margin-top: 2px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.quantity-strip i {
    font-style: normal;
}

.picking-scan-form {
    margin-top: 14px;
    display: grid;
    gap: 7px;
}

.scan-toolbar,
.keyboard-field-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.keyboard-field-heading {
    margin-bottom: 6px;
}

.keyboard-field-heading label {
    min-width: 0;
    margin: 0;
}

.keyboard-toggle {
    min-height: 36px;
    padding: 5px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 6px;
    border: 1px solid #c7d5e5;
    border-radius: 10px;
    color: #536579;
    background: #f4f7fb;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.header-actions .header-keyboard-toggle { width: 44px; min-height: 44px; padding: 8px; }
@media (max-width: 480px) {
    .header-actions .header-keyboard-toggle { flex-direction: column; gap: 3px; padding: 4px 6px; font-size: 9px; }
}

.keyboard-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.keyboard-toggle.is-active {
    border-color: rgba(2, 65, 179, 0.4);
    color: var(--mi7-blue);
    background: #e9f3ff;
}

.keyboard-toggle:focus-visible {
    outline: 3px solid rgba(2, 65, 179, 0.18);
    outline-offset: 2px;
}

.lot-indicator {
    margin-top: 8px;
    padding: 9px 11px;
    border-radius: 9px;
    color: var(--success);
    background: var(--success-bg);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lot-indicator .button {
    min-height: 36px;
    padding: 6px 10px;
}

.picking-scan-form label,
.completion-panel label,
.dialog-card label {
    font-size: 13px;
    font-weight: 800;
}

.completion-panel {
    margin-top: 12px;
}

.completion-panel h2 {
    margin: 5px 0 4px;
    font-size: 22px;
}

.completion-panel > p {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.45;
}

.picking-step-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
}

.picking-step-actions .button {
    min-height: 56px;
}

.finish-step-button {
    width: 100%;
}

.completion-result {
    margin-top: 12px;
}

.completion-panel textarea,
.dialog-card input,
.dialog-card textarea {
    width: 100%;
    margin-top: 6px;
    padding: 11px;
    border: 2px solid #cfcac0;
    border-radius: 9px;
    resize: vertical;
}

.completion-actions {
    margin-top: 9px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.completion-panel > small {
    display: block;
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
}

.app-dialog {
    width: min(calc(100% - 24px), 440px);
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 0;
    border-radius: 15px;
    background: transparent;
}

.app-dialog::backdrop {
    background: rgba(0, 0, 0, 0.68);
}

.dialog-card {
    padding: 18px;
    display: grid;
    gap: 10px;
    background: var(--surface);
}

.dialog-fields {
    display: grid;
    gap: 10px;
}

.dialog-card h2 {
    margin: 0;
}

.dialog-close {
    color: var(--text);
    font-size: 24px;
}

.compact-result {
    min-height: 68px;
    margin: 0;
}

.photo-dialog .dialog-card {
    position: relative;
    padding: 8px;
}

.photo-dialog .photo-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
}

.photo-dialog img {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid label {
    display: grid;
    gap: 5px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.checkbox-label:not([hidden]) {
    min-height: 48px;
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px !important;
}

.checkbox-label input {
    width: 22px;
    min-height: 22px;
    margin: 0;
}

.field-error {
    color: var(--danger);
    font-weight: 650;
}

.field-hint {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.admin-breadcrumbs {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-breadcrumbs .back-link {
    margin-bottom: 0;
}

.admin-page-header {
    margin-bottom: 22px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.admin-page-header h1 {
    margin: 7px 0 5px;
    color: var(--text);
    font-size: clamp(28px, 6vw, 40px);
    font-weight: 760;
    letter-spacing: -0.04em;
}

.admin-page-header p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
}

.admin-create-button {
    min-width: 182px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.admin-create-button span {
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
}

.form-panel {
    padding: 22px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-actions .button {
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.datagrid-panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.datagrid-toolbar {
    min-height: 86px;
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.datagrid-toolbar > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.datagrid-toolbar h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 740;
}

.datagrid-search {
    width: min(100%, 370px);
    position: relative;
}

.datagrid-search svg {
    width: 19px;
    height: 19px;
    position: absolute;
    top: 50%;
    left: 14px;
    fill: none;
    stroke: #718095;
    stroke-linecap: round;
    stroke-width: 1.8;
    transform: translateY(-50%);
    pointer-events: none;
}

.datagrid-search input {
    width: 100%;
    min-height: 44px;
    padding: 9px 13px 9px 42px;
    border: 1px solid #cbd8e6;
    border-radius: 11px;
    color: var(--text);
    background: #f9fbfd;
    outline: 0;
}

.datagrid-search input:focus {
    border-color: var(--mi7-blue);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 65, 179, 0.1);
}

.datagrid-scroll {
    overflow-x: auto;
}

.admin-datagrid {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
    font-size: 13px;
}

.admin-datagrid th {
    padding: 12px 15px;
    color: #647388;
    background: #f5f8fc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-datagrid td {
    min-height: 64px;
    padding: 14px 15px;
    border-top: 1px solid #e5ebf2;
    vertical-align: middle;
}

.admin-datagrid tbody tr {
    transition: background 140ms ease;
}

.admin-datagrid tbody tr:hover {
    background: #f8fbff;
}

.datagrid-primary {
    display: block;
    font-size: 13px;
    font-weight: 720;
}

.datagrid-description {
    max-width: 270px;
    margin-top: 3px;
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.datagrid-code {
    padding: 4px 7px;
    border-radius: 6px;
    color: #174e99;
    background: #edf4ff;
    font-size: 11px;
}

.datagrid-tags {
    max-width: 280px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.datagrid-tag,
.datagrid-origin {
    padding: 4px 7px;
    border-radius: 999px;
    color: #46566a;
    background: #edf1f6;
    font-size: 9px;
    font-weight: 760;
}

.datagrid-muted {
    color: var(--muted);
    font-size: 12px;
}

.datagrid-actions-column,
.datagrid-actions {
    width: 84px;
    text-align: right !important;
}

.datagrid-action {
    min-height: 36px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd8e6;
    border-radius: 9px;
    color: var(--mi7-blue);
    font-size: 12px;
    font-weight: 720;
    text-decoration: none;
}

.datagrid-action:hover {
    border-color: var(--mi7-blue);
    color: #012d7a;
    background: #edf4ff;
}

.datagrid-empty {
    min-height: 250px;
    padding: 35px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    text-align: center;
}

.datagrid-empty strong {
    color: var(--text);
    font-size: 17px;
}

.datagrid-empty .button {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.selection-fieldset {
    min-width: 0;
    margin: 4px 0 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
}

.selection-fieldset legend {
    width: auto;
    margin: 0;
    padding: 0 5px;
    color: var(--text);
    font-size: 14px;
    font-weight: 780;
}

.selection-fieldset > p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.choice-grid,
.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.permission-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
    min-width: 0;
    min-height: 82px;
    padding: 12px;
    display: flex !important;
    align-items: flex-start;
    gap: 10px !important;
    border: 1px solid #cfdae6;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
}

.choice-card:has(input:checked) {
    border-color: var(--mi7-blue);
    background: #edf4ff;
    box-shadow: 0 0 0 2px rgba(2, 65, 179, 0.08);
}

.choice-card input {
    width: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 2px 0 0;
}

.choice-card > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.choice-card strong {
    color: var(--text);
    font-size: 13px;
}

.choice-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.choice-card em {
    width: fit-content;
    color: var(--mi7-blue);
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.choice-disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.permission-card {
    min-height: 114px;
}

.admin-record-list {
    display: grid;
    gap: 8px;
}

.admin-record-row {
    min-height: 78px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fbfdff;
}

.record-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.record-main strong,
.record-main span,
.record-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-main > span,
.record-main small,
.record-count {
    color: var(--muted);
    font-size: 12px;
}

.record-main code {
    color: var(--mi7-blue);
    font-size: 11px;
}

.record-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.status-pill.status-muted {
    color: #647183;
    background: #e8edf3;
}

@media (max-width: 760px) {
    .admin-page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
    }

    .admin-create-button {
        width: 100%;
    }

    .datagrid-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .datagrid-search {
        width: 100%;
    }

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

@media (max-width: 520px) {
    .choice-grid,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .admin-record-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .record-actions {
        width: 100%;
        justify-content: space-between;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .datagrid-scroll {
        padding: 10px;
        overflow: visible;
    }

    .admin-datagrid,
    .admin-datagrid tbody {
        display: block;
    }

    .admin-datagrid thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .admin-datagrid tr {
        margin-bottom: 10px;
        padding: 6px 12px;
        display: grid;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: #fbfdff;
    }

    .admin-datagrid td {
        min-height: 42px;
        padding: 9px 0 9px 46%;
        position: relative;
        display: flex;
        align-items: center;
        border-top: 1px solid #e5ebf2;
        text-align: left;
    }

    .admin-datagrid td:first-child {
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
        border-top: 0;
    }

    .admin-datagrid td::before {
        width: 42%;
        position: absolute;
        left: 0;
        color: #718095;
        content: attr(data-label);
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .admin-datagrid .datagrid-actions {
        width: auto;
        justify-content: flex-end;
    }

    .datagrid-description {
        max-width: 180px;
    }

    .datagrid-tags {
        justify-content: flex-start;
    }
}

.offline-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--black);
}

.offline-card {
    width: min(100%, 390px);
    padding: 26px;
    border-radius: 18px;
    color: #ffffff;
    text-align: center;
    background: #252525;
}

.offline-card .brand-mark {
    margin: 0 auto;
}

.offline-card p {
    color: #c4c4c4;
    line-height: 1.5;
}

.offline-card .button {
    width: 100%;
    margin-top: 10px;
    color: var(--black);
    background: var(--gold);
}

@media (min-width: 540px) {
    .brand-name {
        display: inline;
    }

    .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .page-container {
        padding-right: 10px;
        padding-left: 10px;
    }

    .module-grid,
    .form-grid,
    .order-grid {
        grid-template-columns: 1fr;
    }

    .picking-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .product-summary {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .product-photo {
        width: 76px;
        height: 76px;
    }

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

    .module-card {
        min-height: 104px;
    }

    .form-grid .full-width {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* MI7 design system - Bootstrap 5.3 foundation with brand-specific components. */

body,
button,
input,
select,
textarea {
    font-family: var(--bs-body-font-family);
}

button,
a,
input,
select,
textarea,
.module-card {
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease,
        color 160ms ease, transform 160ms ease;
}

:focus-visible {
    outline: 3px solid rgba(14, 214, 254, 0.62);
    outline-offset: 3px;
}

.app-header {
    min-height: calc(76px + var(--safe-top));
    padding: var(--safe-top) 0 0;
    display: block;
    color: #ffffff;
    background:
        linear-gradient(110deg, rgba(2, 65, 179, 0.2), transparent 42%),
        var(--mi7-ink);
    border-bottom: 1px solid rgba(14, 214, 254, 0.16);
    box-shadow: 0 8px 30px rgba(12, 19, 28, 0.2);
}

.app-header-inner {
    width: min(100%, 1120px);
    min-height: 76px;
    margin: 0 auto;
    padding: 10px 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
}

.brand {
    min-width: 0;
}

.brand-wordmark {
    width: 132px;
    height: auto;
    display: block;
}

.header-context {
    padding-left: 20px;
    border-left: 1px solid rgba(235, 235, 235, 0.18);
}

.header-context span {
    margin: 0 0 2px;
    color: var(--mi7-cyan);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.header-context strong {
    color: #ffffff;
    font-size: 15px;
    font-weight: 650;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.account-summary {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.account-summary span {
    color: #91a1b3;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account-summary strong {
    max-width: 180px;
    overflow: hidden;
    color: #ffffff;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-button {
    min-height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-color: rgba(235, 235, 235, 0.18);
    border-radius: 12px;
    color: #dce6f0;
}

.icon-button:hover {
    border-color: rgba(14, 214, 254, 0.56);
    color: #ffffff;
    background: rgba(14, 214, 254, 0.08);
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.account-password-link {
    text-decoration: none;
}

.account-page-header {
    margin-top: 8px;
}

.account-password-panel {
    max-width: 620px;
    margin: 0 auto;
}

.account-password-form {
    grid-template-columns: 1fr;
}

.account-security-note {
    padding: 11px 13px;
    border-left: 3px solid var(--mi7-cyan);
    border-radius: 8px;
    color: var(--muted);
    background: #f4f8fc;
    font-size: 12px;
    line-height: 1.45;
}

.page-container {
    width: min(100%, 760px);
    padding: 28px 18px calc(82px + var(--safe-bottom));
}

.wide-page,
.home-page {
    width: min(100%, 1120px);
}

.back-link,
.text-link {
    gap: 7px;
    color: var(--mi7-blue);
    font-weight: 700;
}

.back-link:hover,
.text-link:hover {
    color: #012e80;
}

.page-intro {
    padding: 12px 2px 24px;
}

.page-intro.compact {
    padding-top: 14px;
}

.eyebrow,
.step-badge {
    color: var(--mi7-blue);
    font-weight: 800;
    letter-spacing: 0.14em;
}

.page-intro h1 {
    margin-top: 7px;
    font-size: clamp(28px, 7vw, 42px);
    font-weight: 760;
    letter-spacing: -0.035em;
}

.page-intro p,
.scan-panel p {
    color: var(--muted);
}

.home-hero {
    min-height: 190px;
    margin-bottom: 26px;
    padding: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(2, 65, 179, 0.16);
    border-radius: 24px;
    background:
        radial-gradient(circle at 87% 8%, rgba(14, 214, 254, 0.28), transparent 14rem),
        linear-gradient(118deg, #0c131c 0%, #102d54 64%, #0241b3 130%);
    box-shadow: 0 24px 56px rgba(12, 19, 28, 0.16);
}

.home-hero::after {
    content: "7";
    position: absolute;
    top: -80px;
    right: 6%;
    color: rgba(235, 235, 235, 0.045);
    font-size: 300px;
    font-weight: 900;
    line-height: 1;
    transform: skewX(-8deg);
}

.home-hero > * {
    position: relative;
    z-index: 1;
}

.home-hero .eyebrow {
    color: var(--mi7-cyan);
}

.home-hero h1 {
    margin: 8px 0 5px;
    color: #ffffff;
    font-size: clamp(30px, 7vw, 48px);
    font-weight: 760;
    letter-spacing: -0.045em;
}

.home-hero p {
    margin: 0;
    color: #b8c7d7;
    font-size: 16px;
}

.hero-status {
    min-width: 206px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(235, 235, 235, 0.14);
    border-radius: 14px;
    background: rgba(12, 19, 28, 0.38);
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #29e09b;
    box-shadow: 0 0 0 5px rgba(41, 224, 155, 0.12);
}

.hero-status div {
    display: flex;
    flex-direction: column;
}

.hero-status strong {
    color: #ffffff;
    font-size: 12px;
}

.hero-status small {
    color: #92a5b8;
    font-size: 10px;
}

.section-label {
    margin-bottom: 12px;
    padding: 0 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
}

.section-label span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.section-label small {
    color: var(--muted);
}

.module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.module-card {
    min-height: 174px;
    padding: 18px;
    position: relative;
    justify-content: flex-end;
    border-color: var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.module-card:hover {
    border-color: rgba(2, 65, 179, 0.42);
    color: var(--text);
    box-shadow: 0 18px 38px rgba(12, 19, 28, 0.12);
    transform: translateY(-3px);
}

.module-card.module-primary {
    border-color: transparent;
    background:
        radial-gradient(circle at 100% 0, rgba(14, 214, 254, 0.35), transparent 12rem),
        linear-gradient(145deg, #0241b3, #012b77);
    box-shadow: 0 18px 42px rgba(2, 65, 179, 0.24);
}

.module-card.module-primary:hover {
    color: #ffffff;
}

.module-icon {
    width: 46px;
    height: 46px;
    margin-bottom: auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--mi7-blue);
    background: #edf4ff;
}

.module-primary .module-icon {
    color: var(--mi7-cyan);
    background: rgba(255, 255, 255, 0.12);
}

.module-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.module-number {
    position: absolute;
    top: 18px;
    right: 18px;
    margin: 0;
    color: #8392a4;
    font-size: 10px;
    letter-spacing: 0.1em;
}

.module-primary .module-number {
    color: #b6f4ff;
}

.module-card strong {
    padding-right: 24px;
    font-size: 18px;
    font-weight: 720;
}

.module-card small {
    color: var(--muted);
}

.module-primary small {
    color: #bbd5f0;
}

.module-arrow {
    position: absolute;
    right: 18px;
    bottom: 22px;
    color: #97a5b5;
    font-size: 18px;
}

.module-primary .module-arrow {
    color: var(--mi7-cyan);
}

.scan-panel,
.admin-panel,
.status-section,
.picking-item-card,
.completion-panel {
    border-color: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.scan-input,
.stack-form input,
.form-grid input,
.form-grid select,
.completion-panel textarea,
.dialog-card input,
.dialog-card textarea {
    border-color: #cbd8e6;
    border-radius: 12px;
    color: var(--text);
}

.scan-input {
    border-color: #8ec0ff;
    background: #f7fbff;
}

.scan-input:focus,
.stack-form input:focus,
.form-grid input:focus,
.form-grid select:focus,
.completion-panel textarea:focus,
.dialog-card input:focus,
.dialog-card textarea:focus {
    border-color: var(--mi7-blue);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(2, 65, 179, 0.12);
}

.button {
    border-radius: 12px;
    font-weight: 720;
}

.button-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #0241b3, #053486);
    box-shadow: 0 8px 20px rgba(2, 65, 179, 0.2);
}

.button-primary:hover,
.button-primary:active {
    color: #ffffff;
    background: #012e80;
    box-shadow: 0 10px 24px rgba(2, 65, 179, 0.28);
    transform: translateY(-1px);
}

.button-secondary {
    border-color: #cfdae6;
    background: #f5f8fc;
}

.button-secondary:hover {
    border-color: #9fb2c7;
    background: #eaf0f7;
}

.button-warning {
    color: #6e4800;
    background: #ffe59a;
}

.foundation-note {
    border-color: var(--mi7-cyan);
    border-radius: 0 12px 12px 0;
    background: #edf9fd;
}

.connection-status {
    padding: 8px 12px 8px 27px;
    color: #d8f9ed;
    background: #0b3e32;
    box-shadow: 0 8px 24px rgba(12, 19, 28, 0.2);
}

.connection-status::before {
    content: "";
    width: 7px;
    height: 7px;
    position: absolute;
    top: 50%;
    left: 12px;
    border-radius: 50%;
    background: #35e5a4;
    transform: translateY(-50%);
}

.connection-status.is-offline {
    color: #ffffff;
    background: var(--danger);
}

.connection-status.is-offline::before {
    background: #ffffff;
}

.alert {
    border-radius: 12px;
    line-height: 1.4;
}

.alert-error {
    border-color: #f0a9b5;
    color: #8f1c31;
    background: var(--danger-bg);
}

.alert-success {
    border-color: #87d4b8;
    color: #07583d;
}

.alert-warning {
    border-color: #e9ce7b;
    color: #704a00;
}

.printer-row,
.job-row,
.order-card {
    border-color: var(--border);
    border-radius: 13px;
    background: #fbfdff;
}

.order-card:hover {
    border-color: rgba(2, 65, 179, 0.4);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.order-card .order-number {
    color: var(--mi7-blue);
}

.address-grid div {
    background: linear-gradient(145deg, #0c131c, #17283a);
}

.address-grid dd {
    color: var(--mi7-cyan);
}

.status-pill.status-ok {
    color: #08704f;
}

.app-dialog {
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(12, 19, 28, 0.28);
}

.dialog-card {
    border-radius: 18px;
}

.login-page {
    min-height: 100dvh;
    padding: 28px;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 15%, rgba(14, 214, 254, 0.13), transparent 24rem),
        radial-gradient(circle at 88% 80%, rgba(2, 65, 179, 0.2), transparent 30rem),
        var(--mi7-ink);
}

.login-shell {
    width: min(100%, 940px);
}

.login-card {
    min-height: 570px;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    overflow: hidden;
    border: 1px solid rgba(235, 235, 235, 0.12);
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.36);
}

.login-brand-panel {
    padding: 44px 42px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 100% 0, rgba(14, 214, 254, 0.27), transparent 19rem),
        linear-gradient(145deg, #0c131c 0%, #10233b 58%, #0241b3 145%);
}

.login-brand-panel::after {
    content: "7";
    position: absolute;
    right: -14px;
    bottom: -82px;
    color: rgba(235, 235, 235, 0.045);
    font-size: 300px;
    font-weight: 900;
    line-height: 1;
}

.login-wordmark {
    width: 210px;
    position: relative;
    z-index: 1;
}

.login-product {
    margin: auto 0;
    position: relative;
    z-index: 1;
}

.product-kicker {
    color: var(--mi7-cyan);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.login-product strong {
    margin: 9px 0 10px;
    display: block;
    color: #ffffff;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.login-product p {
    max-width: 290px;
    margin: 0;
    color: #aabed1;
    line-height: 1.55;
}

.brand-proof {
    display: grid;
    gap: 8px;
    position: relative;
    z-index: 1;
    color: #c7d4e1;
    font-size: 11px;
}

.brand-proof span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-proof i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mi7-cyan);
    box-shadow: 0 0 0 4px rgba(14, 214, 254, 0.1);
}

.login-form-panel {
    padding: 58px 56px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.login-heading h1 {
    margin: 8px 0 6px;
    color: var(--text);
    font-size: 37px;
    font-weight: 760;
    letter-spacing: -0.045em;
}

.login-heading p {
    margin: 0 0 25px;
    color: var(--muted);
}

.stack-form {
    gap: 8px;
}

.stack-form label {
    margin-top: 6px;
    color: var(--text);
    font-size: 12px;
}

.stack-form input {
    min-height: 54px;
    margin-bottom: 3px;
    border: 1px solid #cbd8e6;
    color: var(--text);
    background: #fbfdff;
}

.stack-form input::placeholder {
    color: #97a4b3;
}

.stack-form .button {
    min-height: 56px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    background: linear-gradient(135deg, #0241b3, #053486);
}

.login-help {
    margin: 20px 0 0;
    color: #7c8998;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

.legal-footer {
    padding: 18px 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: #788b9e;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.legal-footer strong {
    color: #9db0c2;
}

.offline-page {
    background:
        radial-gradient(circle at 50% 20%, rgba(2, 65, 179, 0.28), transparent 28rem),
        var(--mi7-ink);
}

.offline-card {
    padding: 34px;
    border: 1px solid rgba(235, 235, 235, 0.12);
    border-radius: 22px;
    color: #ffffff;
    background: #111e2c;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.3);
}

.offline-logo {
    width: 178px;
    margin: 0 auto 35px;
    display: block;
}

.offline-card .eyebrow {
    color: var(--mi7-cyan);
}

.offline-card h1 {
    margin: 8px 0;
}

.offline-card p {
    color: #aebfd0;
}

.offline-card .button {
    color: #ffffff;
    background: var(--mi7-blue);
}

.offline-card > small {
    margin-top: 24px;
    display: block;
    color: #6f8295;
    font-size: 9px;
}

@media (max-width: 760px) {
    .app-header-inner {
        gap: 12px;
    }

    .brand-wordmark {
        width: 102px;
    }

    .header-context {
        padding-left: 12px;
    }

    .account-summary {
        display: none;
    }

    .icon-button span {
        display: none;
    }

    .icon-button {
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .header-actions {
        gap: 7px;
    }

    .account-password-panel {
        padding: 18px;
    }

    .account-password-form .form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .account-password-form .form-actions .button {
        min-width: 0;
    }

    .home-hero {
        min-height: 210px;
        padding: 24px;
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-status {
        min-width: min(100%, 230px);
    }

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

    .login-page {
        padding: 16px;
    }

    .login-card {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        min-height: 172px;
        padding: 26px;
    }

    .login-wordmark {
        width: 165px;
    }

    .login-product {
        margin: auto 0 0;
    }

    .product-kicker,
    .login-product p,
    .brand-proof {
        display: none;
    }

    .login-product strong {
        margin: 10px 0 0;
        font-size: 22px;
    }

    .login-form-panel {
        padding: 32px 26px 28px;
    }

    .login-heading h1 {
        font-size: 32px;
    }
}

@media (max-width: 430px) {
    .app-header-inner {
        padding-right: 12px;
        padding-left: 12px;
    }

    .brand-wordmark {
        width: 86px;
    }

    .header-context strong {
        font-size: 13px;
    }

    .header-context span {
        font-size: 8px;
    }

    .page-container {
        padding-top: 20px;
    }

    .home-hero {
        min-height: 196px;
        margin-bottom: 22px;
        padding: 20px;
        border-radius: 19px;
    }

    .home-hero h1 {
        font-size: 32px;
    }

    .home-hero p {
        font-size: 14px;
    }

    .section-label small {
        display: none;
    }

    .module-grid {
        gap: 10px;
    }

    .module-card {
        min-height: 154px;
        padding: 14px;
    }

    .module-icon {
        width: 40px;
        height: 40px;
    }

    .module-number {
        top: 15px;
        right: 14px;
    }

    .module-card strong {
        font-size: 15px;
    }

    .module-card small {
        font-size: 10px;
    }

    .module-arrow {
        right: 14px;
        bottom: 17px;
    }

    .legal-footer {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }

    /* Collector layout: keep the complete picking workflow inside short screens. */
    .picking-page {
        padding: 8px 8px calc(12px + var(--safe-bottom));
    }

    .checking-lists {
        grid-template-columns: 1fr;
    }

    .checking-product-list {
        max-height: 128px;
    }

    .picking-page .volume-toolbar {
        min-height: 38px;
        margin-bottom: 6px;
        padding: 5px 8px;
    }

    .picking-page .volume-toolbar .button {
        min-height: 34px;
        padding: 5px 9px;
        font-size: 12px;
    }

    .picking-page .volume-toolbar > span strong {
        min-width: 26px;
        min-height: 26px;
    }

    .picking-page .item-navigation {
        min-height: 52px;
        margin: 0;
        padding: 5px 0;
        gap: 8px;
    }

    .picking-page .item-navigation > span {
        min-width: 74px;
        font-size: 11px;
    }

    .picking-page .item-navigation .button {
        min-width: 96px;
        min-height: 44px;
        padding: 7px 10px;
    }

    .picking-page .item-navigation .button:not(:disabled):active {
        border-color: var(--mi7-cyan);
    }

    .picking-page .item-navigation .button:disabled {
        opacity: 1;
    }

    .picking-page .volume-actions {
        flex-direction: column-reverse;
    }

    .picking-page .picking-item-card {
        padding: 8px;
        border-radius: 13px;
    }

    .picking-page .product-summary {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 8px;
    }

    .picking-page .product-photo {
        width: 64px;
        height: 64px;
        border-radius: 9px;
    }

    .picking-page .product-summary h2 {
        margin: 2px 0;
        font-size: 16px;
        line-height: 1.1;
    }

    .picking-page .product-summary p,
    .picking-page .product-code {
        font-size: 10px;
    }

    .picking-page .product-code {
        gap: 3px 6px;
    }

    .picking-page .product-code > span + span {
        padding-left: 6px;
    }

    .picking-page .address-grid {
        margin: 7px 0;
        gap: 4px;
    }

    .picking-page .address-grid div {
        min-width: 0;
        padding: 5px 2px;
        border-radius: 7px;
    }

    .picking-page .address-grid dt {
        font-size: 7px;
    }

    .picking-page .address-grid dd {
        overflow: hidden;
        margin-top: 1px;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .picking-page .quantity-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 3px;
    }

    .picking-page .quantity-strip span {
        min-height: 39px;
        padding: 4px;
        border-radius: 7px;
    }

    .picking-page .quantity-strip small {
        overflow: hidden;
        font-size: 7px;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .picking-page .quantity-strip b {
        margin-top: 1px;
        font-size: 10px;
    }

    .picking-page .picking-scan-form {
        margin-top: 7px;
        gap: 4px;
    }

    .picking-page .picking-scan-form label {
        font-size: 11px;
    }

    .picking-page .step-badge {
        font-size: 9px;
    }

    .picking-page .keyboard-toggle {
        min-height: 32px;
        padding: 4px 7px;
        gap: 4px;
        font-size: 9px;
    }

    .picking-page .keyboard-toggle svg {
        width: 15px;
        height: 15px;
    }

    .picking-page .scan-input {
        min-height: 48px;
        padding: 8px 10px;
        font-size: 16px;
    }

    .picking-page .picking-scan-form .button-large {
        display: none;
    }

    .picking-page .scan-result {
        min-height: 54px;
        margin-top: 7px;
        padding: 8px 10px;
    }

    .picking-page .scan-result strong {
        font-size: 14px;
    }

    .picking-page .scan-result span {
        margin-top: 2px;
        font-size: 10px;
        line-height: 1.25;
    }

    .picking-page .lot-indicator {
        margin-top: 5px;
        padding: 5px 8px;
    }

    .picking-page .picking-step-actions {
        margin-top: 7px;
        grid-template-columns: minmax(96px, 0.72fr) minmax(0, 1.45fr);
        gap: 5px;
    }

    .picking-page .picking-step-actions .button {
        min-height: 44px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .picking-page .finish-step-button {
        font-size: 14px;
    }

    .picking-page .connection-status {
        width: 12px;
        height: 12px;
        min-width: 0;
        min-height: 0;
        padding: 0;
        top: calc(17px + var(--safe-top));
        right: 58px;
        bottom: auto;
        overflow: hidden;
        border: 2px solid var(--mi7-ink);
        border-radius: 50%;
        color: transparent;
        font-size: 0;
        background: #35e5a4;
        box-shadow: 0 0 0 3px rgba(53, 229, 164, 0.13);
    }

    .picking-page .connection-status::before {
        display: none;
    }

    .picking-page .connection-status.is-offline {
        background: var(--danger);
        box-shadow: 0 0 0 3px rgba(180, 35, 58, 0.16);
    }
}

@media (max-width: 430px) and (max-height: 760px) {
    .app-header {
        min-height: calc(60px + var(--safe-top));
    }

    .app-header-inner {
        min-height: 60px;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .brand-wordmark {
        width: 74px;
    }

    .header-context {
        padding-left: 8px;
    }

    .header-context strong {
        font-size: 11px;
    }

    .header-context span {
        font-size: 7px;
    }

    .icon-button {
        width: 38px;
        min-height: 38px;
        border-radius: 10px;
    }

    .picking-page .connection-status {
        top: calc(14px + var(--safe-top));
        right: 54px;
    }
}

@media (max-width: 350px) {
    .brand-wordmark {
        width: 72px;
    }

    .header-context {
        padding-left: 8px;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 140px;
    }
}

/* Product statement */
.statement-page { max-width: 1400px; }.statement-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }.statement-heading-icon { display:grid; place-items:center; width:56px; height:56px; flex:none; border-radius:16px; background:#e9f7f0; color:#168154; font-size:30px; font-weight:800; }
.statement-filter { display:grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap:14px; align-items:end; margin:24px 0; padding:22px; background:linear-gradient(135deg,#fff 0%,#f7fafc 100%); border:1px solid #dce5ec; border-radius:20px; box-shadow:0 12px 32px rgba(12,19,28,.07); }.statement-filter label { display:block; margin-bottom:7px; font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:#52606d; }.statement-filter input { width:100%; min-height:50px; padding:11px 13px; border:1px solid #ccd8e1; border-radius:12px; background:#fff; color:#17232e; font-size:15px; outline:none; transition:border-color .2s,box-shadow .2s; }.statement-filter input:focus { border-color:#168154; box-shadow:0 0 0 3px rgba(22,129,84,.13); }.statement-input-wrap { display:flex; align-items:center; min-height:50px; border:1px solid #ccd8e1; border-radius:12px; background:#fff; overflow:hidden; }.statement-input-wrap:focus-within { border-color:#168154; box-shadow:0 0 0 3px rgba(22,129,84,.13); }.statement-input-wrap span { padding-left:13px; color:#168154; font-weight:800; }.statement-input-wrap input { min-height:48px; border:0; box-shadow:none; }.statement-submit { min-height:50px; gap:12px; white-space:nowrap; }
.statement-summary { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-bottom:20px; }.statement-summary > div { display:flex; align-items:center; gap:13px; min-height:82px; padding:15px 18px; border:1px solid #e0e8ed; border-radius:16px; background:#fff; box-shadow:0 6px 20px rgba(12,19,28,.04); }.summary-icon { display:grid; place-items:center; width:38px; height:38px; flex:none; border-radius:11px; background:#edf3f7; color:#536675; font-size:21px; font-weight:800; }.summary-in { border-left:4px solid #209866 !important; }.summary-in .summary-icon { background:#e8f7ef; color:#168154; }.summary-out { border-left:4px solid #cf5a5a !important; }.summary-out .summary-icon { background:#fff0f0; color:#bc4c4c; }.statement-summary small { display:block; color:#647381; font-size:11px; font-weight:700; }.statement-summary strong { display:block; margin-top:3px; color:#0c131c; font-size:22px; }
.statement-table-wrap { overflow:auto; background:#fff; border:1px solid #e2e8ed; border-radius:16px; }.statement-table { width:100%; min-width:900px; border-collapse:collapse; font-size:13px; }.statement-table th,.statement-table td { padding:12px 14px; border-bottom:1px solid #edf1f4; text-align:left; vertical-align:middle; }.statement-table th { background:#f7f9fb; color:#52606d; font-size:11px; text-transform:uppercase; letter-spacing:.04em; }.statement-table tr:last-child td { border-bottom:0; }.qty-in { color:#147d4c; font-weight:700; }.qty-out { color:#b34242; font-weight:700; }.statement-empty { padding:30px 18px; text-align:center; color:#647381; background:#f7f9fb; border-radius:14px; }
@media (max-width: 760px) { .statement-heading { align-items:flex-start; }.statement-heading-icon { width:45px; height:45px; border-radius:13px; font-size:24px; }.statement-filter { grid-template-columns:1fr 1fr; gap:12px; padding:16px; margin:20px 0; border-radius:16px; }.statement-filter > div:first-child,.statement-filter .button { grid-column:1 / -1; }.statement-submit { width:100%; justify-content:center; }.statement-summary { grid-template-columns:1fr; gap:10px; }.statement-summary > div { min-height:70px; }.statement-table-wrap { overflow:visible; background:transparent; border:0; }.statement-table { min-width:0; display:block; }.statement-table thead { display:none; }.statement-table tbody,.statement-table tr,.statement-table td { display:block; }.statement-table tr { margin-bottom:12px; padding:10px 14px; background:#fff; border:1px solid #e2e8ed; border-radius:14px; box-shadow:0 5px 16px rgba(12,19,28,.04); }.statement-table td { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border:0; text-align:right; }.statement-table td::before { content:attr(data-label); color:#647381; font-weight:700; text-align:left; }.statement-empty { padding:25px 16px; } }

/* Allow native date controls and scanner inputs to shrink within the grid. */
.statement-filter { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.statement-field, .statement-heading > div, .statement-summary > div > span { min-width: 0; }
.statement-input-wrap { min-width: 0; width: 100%; }
.statement-filter input { min-width: 0; max-width: 100%; box-sizing: border-box; font-size: 16px; }
.statement-input-wrap input { flex: 1 1 0; width: 0; }
.statement-summary strong { overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .statement-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .statement-filter input[type="date"] { display: block; width: 100%; }
    .statement-table td { overflow-wrap: anywhere; min-width: 0; }
    .statement-table td::before { flex: 0 0 38%; }
}
@media (max-width: 480px) {
    .statement-filter { grid-template-columns: minmax(0, 1fr); }
    .statement-heading-icon { display: none; }
}

/* Compact sign-in flow for handhelds and phones with short viewports. */
@media (max-width: 760px) {
    .login-page {
        min-height: 100dvh;
        padding: max(10px, var(--safe-top)) 12px max(10px, var(--safe-bottom));
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-shell {
        width: min(100%, 420px);
    }

    .login-card {
        border-radius: 20px;
    }

    .login-brand-panel {
        min-height: 88px;
        padding: 14px 18px;
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

    .login-brand-panel::after {
        right: -4px;
        bottom: -58px;
        font-size: 170px;
    }

    .login-wordmark {
        width: 126px;
        flex: 0 0 auto;
    }

    .login-product {
        min-width: 0;
        margin: 0;
        padding-left: 14px;
        border-left: 1px solid rgba(235, 235, 235, 0.17);
    }

    .login-product strong {
        margin: 0;
        overflow: hidden;
        font-size: 18px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .login-form-panel {
        padding: 22px 22px 18px;
    }

    .login-heading .eyebrow {
        font-size: 9px;
    }

    .login-heading h1 {
        margin: 4px 0 2px;
        font-size: 28px;
    }

    .login-heading p {
        margin-bottom: 14px;
        font-size: 13px;
    }

    .login-form-panel .alert {
        margin: 0 0 10px;
        padding: 9px 11px;
        font-size: 12px;
    }

    .stack-form {
        gap: 5px;
    }

    .stack-form label {
        margin-top: 3px;
        font-size: 12px;
    }

    .stack-form input {
        min-height: 48px;
        margin-bottom: 1px;
        padding: 9px 12px;
    }

    .stack-form .button {
        min-height: 50px;
        margin-top: 10px;
    }

    .login-help {
        margin-top: 12px;
    }

    .legal-footer {
        padding: 8px 2px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: row;
        gap: 5px;
        font-size: 8px;
        text-align: center;
        white-space: nowrap;
    }

    .legal-footer strong::after {
        content: " ·";
    }
}

@media (max-width: 430px) and (max-height: 620px) {
    .login-page {
        padding: max(6px, var(--safe-top)) 10px max(6px, var(--safe-bottom));
        align-items: flex-start;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-brand-panel {
        min-height: 68px;
        padding: 9px 16px;
        gap: 10px;
    }

    .login-wordmark {
        width: 105px;
    }

    .login-product {
        padding-left: 10px;
    }

    .login-product strong {
        font-size: 15px;
    }

    .login-form-panel {
        padding: 14px 18px 12px;
    }

    .login-heading h1 {
        margin-top: 2px;
        font-size: 24px;
    }

    .login-heading p {
        margin-bottom: 9px;
        font-size: 12px;
    }

    .login-form-panel .alert {
        margin-bottom: 7px;
        padding: 7px 9px;
        line-height: 1.25;
    }

    .stack-form {
        gap: 3px;
    }

    .stack-form label {
        margin-top: 2px;
        font-size: 11px;
    }

    .stack-form input {
        min-height: 46px;
        padding: 8px 11px;
    }

    .stack-form .button {
        min-height: 48px;
        margin-top: 7px;
    }

    .login-help {
        display: none;
    }

    .legal-footer {
        padding-top: 5px;
        font-size: 7px;
    }
}

/* Animated hand-off between the native PWA splash and the MI7 application. */
html.splash-active {
    overflow: hidden;
}

html.splash-seen .app-splash {
    display: none;
}

.app-splash {
    min-height: 100vh;
    min-height: 100dvh;
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 44%, rgba(2, 65, 179, 0.34), transparent 32%),
        radial-gradient(circle at 82% 18%, rgba(14, 214, 254, 0.13), transparent 28%),
        linear-gradient(145deg, #070d14 0%, #0c1826 58%, #07111d 100%);
    animation: mi7-splash-fallback 0s 4s forwards;
}

.app-splash::before {
    content: "";
    width: min(82vw, 520px);
    aspect-ratio: 1;
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 214, 254, 0.12), transparent 67%);
    filter: blur(6px);
    animation: mi7-splash-breathe 1.8s ease-in-out infinite;
}

.app-splash-grid {
    position: absolute;
    z-index: -2;
    inset: -30%;
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(14, 214, 254, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 214, 254, 0.25) 1px, transparent 1px);
    background-size: 42px 42px;
    transform: perspective(420px) rotateX(66deg) translateY(18%);
    transform-origin: 50% 58%;
    -webkit-mask-image: radial-gradient(circle at center, #000 0%, transparent 68%);
    mask-image: radial-gradient(circle at center, #000 0%, transparent 68%);
    animation: mi7-splash-grid 2.2s linear infinite;
}

.app-splash-seven {
    position: absolute;
    z-index: -1;
    right: -0.04em;
    bottom: -0.24em;
    color: transparent;
    font-size: min(92vh, 700px);
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    -webkit-text-stroke: 2px rgba(14, 214, 254, 0.09);
    animation: mi7-splash-seven 1.4s 0.12s ease-out forwards;
}

.app-splash-content {
    width: min(84vw, 420px);
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
    text-align: center;
}

.app-splash-emblem {
    width: 100%;
    min-height: 128px;
    display: grid;
    place-items: center;
    position: relative;
}

.app-splash-logo-mask {
    width: min(76vw, 330px);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.app-splash-logo-mask img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
    animation: mi7-splash-logo 0.82s 0.12s cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.app-splash-scan-line {
    width: 38%;
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(14, 214, 254, 0.6), transparent);
    filter: blur(1px);
    transform: translateX(-150%) skewX(-12deg);
    animation: mi7-splash-scan 0.92s 0.32s ease-out forwards;
}

.app-splash-ring {
    width: 116px;
    height: 116px;
    position: absolute;
    border: 1px solid rgba(14, 214, 254, 0.22);
    border-radius: 50%;
    opacity: 0;
    animation: mi7-splash-ring 1.35s ease-out infinite;
}

.app-splash-ring-two {
    animation-delay: 0.48s;
}

.app-splash-product {
    margin: 2px 0 0;
    color: #dce8f5;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: 0.32em;
    text-indent: 0.32em;
    opacity: 0;
    transform: translateY(10px);
    animation: mi7-splash-copy 0.55s 0.68s ease-out forwards;
}

.app-splash-product span {
    color: var(--mi7-cyan);
}

.app-splash-tagline {
    margin: 9px 0 0;
    color: #8094a8;
    font-size: 10px;
    letter-spacing: 0.045em;
    opacity: 0;
    transform: translateY(8px);
    animation: mi7-splash-copy 0.55s 0.82s ease-out forwards;
}

.app-splash-progress {
    width: min(58vw, 210px);
    height: 2px;
    margin-top: 24px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(235, 235, 235, 0.09);
    opacity: 0;
    animation: mi7-splash-copy 0.35s 0.76s ease-out forwards;
}

.app-splash-progress span {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mi7-blue), var(--mi7-cyan));
    box-shadow: 0 0 12px rgba(14, 214, 254, 0.48);
    transform: scaleX(0);
    transform-origin: left;
    animation: mi7-splash-progress 1.15s 0.42s cubic-bezier(0.2, 0.68, 0.22, 1) forwards;
}

.app-splash.is-leaving {
    pointer-events: none;
    animation: mi7-splash-exit 0.44s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes mi7-splash-logo {
    0% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateY(5px) scale(0.98); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0) scale(1); }
}

@keyframes mi7-splash-scan {
    0% { opacity: 0; transform: translateX(-150%) skewX(-12deg); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateX(340%) skewX(-12deg); }
}

@keyframes mi7-splash-ring {
    0% { opacity: 0; transform: scale(0.72); }
    24% { opacity: 0.45; }
    100% { opacity: 0; transform: scale(2.45); }
}

@keyframes mi7-splash-copy {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes mi7-splash-progress {
    to { transform: scaleX(1); }
}

@keyframes mi7-splash-breathe {
    50% { opacity: 0.65; transform: scale(1.08); }
}

@keyframes mi7-splash-grid {
    to { background-position: 0 42px, 42px 0; }
}

@keyframes mi7-splash-seven {
    from { opacity: 0; transform: translateX(5%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes mi7-splash-exit {
    to { opacity: 0; visibility: hidden; transform: scale(1.025); }
}

@keyframes mi7-splash-fallback {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (max-width: 430px) {
    .app-splash-content {
        width: 88vw;
    }

    .app-splash-emblem {
        min-height: 108px;
    }

    .app-splash-logo-mask {
        width: min(78vw, 280px);
        padding: 14px 18px;
    }

    .app-splash-product {
        font-size: 12px;
        letter-spacing: 0.27em;
        text-indent: 0.27em;
    }

    .app-splash-tagline {
        max-width: 260px;
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash {
        animation: mi7-splash-fallback 0s 2s forwards;
    }

    .app-splash::before,
    .app-splash-grid,
    .app-splash-seven,
    .app-splash-logo-mask img,
    .app-splash-scan-line,
    .app-splash-ring,
    .app-splash-product,
    .app-splash-tagline,
    .app-splash-progress,
    .app-splash-progress span {
        animation: none;
    }

    .app-splash-seven,
    .app-splash-logo-mask img,
    .app-splash-product,
    .app-splash-tagline,
    .app-splash-progress {
        opacity: 1;
        clip-path: none;
        transform: none;
    }

    .app-splash-progress span {
        transform: scaleX(1);
    }

    .app-splash.is-leaving {
        animation: mi7-splash-exit 0.12s linear forwards;
    }
}
