* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--wms-color-background);
    color: var(--wms-color-text);
    font-family: var(--wms-font-family);
    overscroll-behavior: none;
    touch-action: manipulation;
    user-select: none;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
}

body.wms-app {
    min-height: 100vh;
    margin: 0;
    background: var(--wms-color-background);
    overscroll-behavior: none;
    touch-action: manipulation;
}

.wms-shell {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 12px;
}

.wms-app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 4px 0 12px;
}

.wms-app-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.wms-app-topbar__logo {
    display: block;
    height: 40px;
    width: auto;
    max-width: 174px;
    flex: 0 1 auto;
    object-fit: contain;
}

.wms-app-topbar__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid var(--wms-color-border);
    border-radius: var(--wms-radius-control);
    background: var(--wms-color-card);
    color: var(--wms-color-title);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.wms-main {
    padding-bottom: 24px;
}

.wms-welcome {
    margin: 0 0 12px;
}

.wms-welcome__title {
    margin: 0;
    color: var(--wms-color-title);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.wms-welcome__text {
    margin: 5px 0 0;
    color: var(--wms-color-muted);
    font-size: 15px;
    font-weight: 600;
}

.wms-picking-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 12px;
    min-height: 188px;
    padding: 16px;
    border: 1px solid rgba(249, 115, 22, .18);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(249, 115, 22, .06), rgba(255, 255, 255, 0) 42%),
        var(--wms-color-card);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--wms-shadow-card);
    touch-action: manipulation;
}

.wms-picking-card__top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wms-picking-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--wms-radius-control);
    background: rgba(249, 115, 22, .12);
    color: var(--wms-color-action);
}

.wms-picking-card__title {
    color: var(--wms-color-title);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
}

.wms-picking-card__stats {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    align-items: center;
    min-height: 58px;
}

.wms-picking-card__stat {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 4px;
}

.wms-picking-card__stat strong {
    color: var(--wms-color-action);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.wms-picking-card__stat span {
    color: var(--wms-color-muted);
    font-size: 12px;
    font-weight: 700;
}

.wms-picking-card__divider {
    width: 1px;
    height: 42px;
    background: var(--wms-color-border);
}

.wms-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    border-radius: var(--wms-radius-control);
    background: var(--wms-color-action);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
}

.wms-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.wms-menu-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 12px;
    border: 1px solid var(--wms-color-border);
    border-radius: var(--wms-radius-card);
    background: var(--wms-color-card);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--wms-shadow-card);
    touch-action: manipulation;
}

.wms-menu-card--danger .wms-menu-card__icon {
    background: rgba(239, 68, 68, .1);
    color: var(--wms-color-danger);
}

.wms-menu-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: var(--wms-radius-control);
    background: #eef2ff;
    color: var(--wms-color-primary);
}

.wms-menu-card--featured .wms-menu-card__icon {
    background: rgba(249, 115, 22, .12);
    color: var(--wms-color-action);
}

.wms-menu-card__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.wms-menu-card__title {
    display: block;
    color: var(--wms-color-title);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.wms-menu-card__description {
    display: block;
    color: var(--wms-color-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wms-menu-card__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--wms-color-muted);
}

.wms-icon--chevron {
    width: 20px;
    height: 20px;
}

.wms-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.wms-page-hero {
    margin: 4px 0 12px;
}

.wms-page-hero__title {
    margin: 0;
    color: var(--wms-color-title);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.wms-page-hero__description {
    margin: 5px 0 0;
    color: var(--wms-color-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wms-segment-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.wms-segment-control__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    flex-direction: column;
    gap: 3px;
    padding: 8px 6px;
    border: 1px solid var(--wms-color-border);
    border-radius: var(--wms-radius-control);
    background: var(--wms-color-card);
    color: var(--wms-color-title);
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.wms-segment-control__item span {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
}

.wms-segment-control__item strong {
    color: var(--wms-color-primary);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.wms-segment-control__item--problem strong {
    color: var(--wms-color-danger);
}

.wms-order-section {
    margin-top: 14px;
}

.wms-order-section__title {
    margin: 0 0 8px;
    color: var(--wms-color-muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.wms-order-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.wms-order-card {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--wms-color-border);
    border-radius: var(--wms-radius-card);
    background: var(--wms-color-card);
    box-shadow: var(--wms-shadow-card);
}

.wms-order-card--problem {
    border-color: rgba(239, 68, 68, .28);
}

.wms-order-card__main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.wms-order-card__top {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.wms-order-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--wms-radius-control);
    background: rgba(37, 99, 235, .1);
    color: var(--wms-color-primary);
}

.wms-order-card--problem .wms-order-card__icon {
    background: rgba(239, 68, 68, .1);
    color: var(--wms-color-danger);
}

.wms-order-card__identity {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.wms-order-card__number {
    color: var(--wms-color-title);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
}

.wms-order-card__marketplace {
    color: var(--wms-color-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.wms-order-card__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .1);
    color: var(--wms-color-primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.wms-order-card__status--new {
    background: rgba(249, 115, 22, .12);
    color: var(--wms-color-action);
}

.wms-order-card__status--problem {
    background: rgba(239, 68, 68, .1);
    color: var(--wms-color-danger);
}

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

.wms-order-card__details span {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--wms-color-background);
    color: var(--wms-color-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.wms-order-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: var(--wms-radius-control);
    background: var(--wms-color-action);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    touch-action: manipulation;
}

.wms-order-card__action--active {
    background: var(--wms-color-primary);
}

.wms-order-card__action--problem {
    background: var(--wms-color-danger);
}

.wms-picking-session {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wms-session-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wms-session-progress__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.wms-session-progress__title {
    margin: 0;
    color: var(--wms-color-title);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.wms-session-progress__count {
    color: var(--wms-color-title);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.wms-progress-bar {
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--wms-color-border);
}

.wms-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--wms-color-action);
}

.wms-drawer-focus {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    min-height: 68px;
    padding: 10px 14px;
    border: 1px solid var(--wms-color-border);
    border-radius: 18px;
    background: var(--wms-color-card);
    box-shadow: var(--wms-shadow-card);
    text-align: center;
}

.wms-drawer-focus__label {
    color: var(--wms-color-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.wms-drawer-focus__code {
    margin-top: 4px;
    color: var(--wms-color-title);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}

.wms-session-product {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 10px;
    padding: 2px 0 0;
    text-align: center;
}

.wms-session-product--fade {
    animation: wms-product-fade .18s ease-out;
}

.wms-product-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 132px;
    height: 132px;
    border: 1px solid var(--wms-color-border);
    border-radius: var(--wms-radius-control);
    background: var(--wms-color-card);
    overflow: hidden;
}

.wms-product-image--normal {
    border-color: var(--wms-color-border);
    background: var(--wms-color-card);
}

.wms-product-image--success {
    border-color: rgba(34, 197, 94, .75);
    background: rgba(34, 197, 94, .08);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .08);
}

.wms-product-image--error {
    border-color: rgba(239, 68, 68, .75);
    background: rgba(239, 68, 68, .08);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .08);
}

.wms-product-image--warning {
    border-color: rgba(249, 115, 22, .8);
    background: rgba(249, 115, 22, .08);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .08);
}

.wms-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wms-session-product__info {
    min-width: 0;
    width: 100%;
}

.wms-session-product__name {
    margin: 0;
    color: var(--wms-color-title);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

.wms-session-product__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 0;
}

.wms-session-product__meta div {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 8px;
    border-radius: 12px;
    background: var(--wms-color-card);
    border: 1px solid var(--wms-color-border);
}

.wms-session-product__meta dt,
.wms-session-product__meta dd {
    margin: 0;
}

.wms-session-product__meta dt {
    color: var(--wms-color-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.wms-session-product__meta dd {
    color: var(--wms-color-title);
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.wms-scan-status {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    min-height: 122px;
    justify-content: center;
    padding: 16px;
    border: 1px solid rgba(249, 115, 22, .18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(249, 115, 22, .1), rgba(249, 115, 22, .03));
    color: var(--wms-color-title);
    text-align: center;
}

.wms-scan-status__mark {
    color: var(--wms-color-action);
}

.wms-scan-status__mark .wms-icon {
    width: 34px;
    height: 34px;
}

.wms-scan-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 34px;
}

.wms-scan-loader span {
    display: block;
    width: 5px;
    height: 18px;
    border-radius: 999px;
    background: currentColor;
    opacity: .35;
    animation: wms-barcode-breathe 2.1s ease-in-out infinite;
}

.wms-scan-loader span:nth-child(2) {
    animation-delay: .12s;
}

.wms-scan-loader span:nth-child(3) {
    animation-delay: .24s;
}

.wms-scan-loader span:nth-child(4) {
    animation-delay: .36s;
}

.wms-scan-loader span:nth-child(5) {
    animation-delay: .48s;
}

.wms-scan-loader span:nth-child(6) {
    animation-delay: .6s;
}

.wms-scan-status strong {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.wms-scan-status span:last-child {
    color: var(--wms-color-muted);
    font-size: 13px;
    font-weight: 700;
}

.wms-scan-status--waiting {
    border-color: rgba(249, 115, 22, .18);
    background: linear-gradient(180deg, rgba(249, 115, 22, .1), rgba(249, 115, 22, .03));
}

.wms-scan-status--success {
    border-color: rgba(34, 197, 94, .24);
    background: linear-gradient(180deg, rgba(34, 197, 94, .1), rgba(34, 197, 94, .03));
}

.wms-scan-status--success .wms-scan-status__mark,
.wms-scan-status--success strong {
    color: var(--wms-color-success);
}

.wms-scan-status--error {
    border-color: rgba(239, 68, 68, .24);
    background: linear-gradient(180deg, rgba(239, 68, 68, .1), rgba(239, 68, 68, .03));
}

.wms-scan-status--error .wms-scan-status__mark,
.wms-scan-status--error strong {
    color: var(--wms-color-danger);
}

.wms-scan-status--warning {
    border-color: rgba(245, 158, 11, .28);
    background: linear-gradient(180deg, rgba(245, 158, 11, .12), rgba(245, 158, 11, .04));
}

.wms-scan-status--warning .wms-scan-status__mark,
.wms-scan-status--warning strong {
    color: var(--wms-color-warning);
}

.wms-scan-status--next .wms-scan-status__mark,
.wms-scan-status--next strong {
    color: var(--wms-color-primary);
}

.wms-scan-debug {
    min-height: 18px;
    margin: -4px 0 0;
    color: var(--wms-color-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.wms-completion-panel {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 142px;
    padding: 18px;
    border: 1px solid rgba(34, 197, 94, .25);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(34, 197, 94, .12), rgba(34, 197, 94, .04));
    color: var(--wms-color-title);
    text-align: center;
    box-shadow: var(--wms-shadow-card);
}

.wms-completion-panel[hidden] {
    display: none;
}

.wms-completion-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 2px solid var(--wms-color-success);
    color: var(--wms-color-success);
}

.wms-completion-panel strong {
    color: var(--wms-color-success);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
}

.wms-completion-panel p {
    margin: 0;
    color: var(--wms-color-text);
    font-size: 15px;
    font-weight: 700;
}

.wms-scan-test-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: -4px;
}

.wms-scan-test-tools button {
    min-height: 38px;
    border: 1px dashed var(--wms-color-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
    color: var(--wms-color-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    touch-action: manipulation;
}

@keyframes wms-barcode-breathe {
    0%,
    100% {
        opacity: .35;
    }

    50% {
        opacity: 1;
    }
}

@keyframes wms-product-fade {
    from {
        opacity: .72;
    }

    to {
        opacity: 1;
    }
}

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

.wms-session-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    gap: 8px;
    padding: 0 10px;
    border-radius: var(--wms-radius-control);
    border: 1px solid var(--wms-color-border);
    background: var(--wms-color-card);
    color: var(--wms-color-title);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    touch-action: manipulation;
}

.wms-session-action--problem {
    border-color: rgba(249, 115, 22, .55);
    color: var(--wms-color-action);
}

.wms-session-action--save {
    border-color: #d1d5db;
}

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

.wms-problem-actions[hidden] {
    display: none;
}

.wms-problem-action {
    min-height: 54px;
    border: 1px solid var(--wms-color-border);
    border-radius: var(--wms-radius-control);
    background: var(--wms-color-card);
    color: var(--wms-color-title);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    touch-action: manipulation;
}

.wms-problem-action--next {
    border-color: rgba(37, 99, 235, .35);
    background: var(--wms-color-primary);
    color: #fff;
}

.wms-problem-action--stay {
    border-color: rgba(245, 158, 11, .45);
    color: var(--wms-color-warning);
}

.wms-problem-sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
}

.wms-problem-sheet[hidden] {
    display: none;
}

.wms-problem-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .48);
}

.wms-problem-sheet__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 452px);
    padding: 18px;
    border: 1px solid var(--wms-color-border);
    border-radius: 24px 24px 18px 18px;
    background: var(--wms-color-background);
    box-shadow: 0 -18px 44px rgba(15, 23, 42, .2);
    animation: wms-sheet-enter .22s ease-out;
}

.wms-problem-sheet__header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
    text-align: center;
}

.wms-problem-sheet__header strong {
    color: var(--wms-color-title);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.wms-problem-sheet__header span {
    color: var(--wms-color-muted);
    font-size: 14px;
    font-weight: 700;
}

.wms-problem-sheet__options {
    display: grid;
    gap: 9px;
}

.wms-problem-sheet__options button,
.wms-problem-sheet__cancel {
    min-height: 52px;
    border-radius: var(--wms-radius-control);
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    touch-action: manipulation;
}

.wms-problem-sheet__options button {
    border: 1px solid rgba(245, 158, 11, .34);
    background: #fff;
    color: var(--wms-color-title);
}

.wms-problem-sheet__cancel {
    width: 100%;
    margin-top: 12px;
    border: 1px solid var(--wms-color-border);
    background: transparent;
    color: var(--wms-color-muted);
}

.wms-problem-sheet-open {
    overflow: hidden;
}

@keyframes wms-sheet-enter {
    from {
        opacity: .6;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 481px) {
    .wms-shell {
        padding-top: 24px;
    }
}

@media (max-width: 412px) {
    .wms-shell {
        max-width: 100%;
    }
}

@media (max-width: 360px) {
    .wms-shell {
        padding: 12px;
    }

    .wms-menu-card {
        grid-template-columns: 48px 1fr;
    }

    .wms-menu-card__icon {
        width: 48px;
        height: 48px;
    }

    .wms-menu-card__chevron {
        grid-column: 2;
        justify-self: end;
    }
}

@media (max-width: 320px) {
    .wms-shell {
        padding: 10px;
    }

    .wms-app-topbar__title {
        font-size: 17px;
    }

    .wms-welcome__title {
        font-size: 20px;
    }

    .wms-picking-card {
        padding: 14px;
    }

    .wms-picking-card__stat strong {
        font-size: 25px;
    }

    .wms-order-card__top {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .wms-order-card__status {
        justify-self: start;
        grid-column: 2;
    }

    .wms-order-card__details {
        grid-template-columns: 1fr;
    }

    .wms-drawer-focus__code {
        font-size: 32px;
    }

    .wms-product-image {
        width: 120px;
        height: 120px;
    }
}
