/*
  Rosseto WMS: built for a handheld held in one hand. Everything fits the width of the screen (nothing scrolls
  sideways), every target is at least 48px, and the thing to do next is the largest thing on the screen.
  Colours come from the kit's tokens, so light and dark both work.
*/

/* ---- The frame, tighter on a phone ------------------------------------------------------------- */

.kit-main { max-width: 760px; }

@media (max-width: 640px) {
    .kit-main { padding: 14px 12px 48px; }
    .kit h1 { font-size: 22px; margin-bottom: 2px; }
    .kit-page-head { margin-bottom: 12px; gap: 8px; }
    .kit-lead { font-size: 15px; }
    .kit-card { padding: 14px; border-radius: 16px; margin-bottom: 12px; }
    .kit-header-in { gap: 6px 10px; }
}

.wms-inline { display: inline; }

/* ---- Home: the logo, then the actions as a list ------------------------------------------------- */

.wms-brand { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.wms-brand img { border-radius: 16px; flex: none; }
.wms-brand h1 { margin: 0; }

.wms-menu {
    list-style: none; margin: 0; padding: 0; background: var(--kit-surface);
    border-radius: 16px; box-shadow: var(--kit-shadow); overflow: hidden;
}
.wms-menu > li + li { border-top: 1px solid var(--kit-line-soft); }
.kit a.wms-menu-item {
    display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px;
    color: var(--kit-ink); text-decoration: none;
}
.kit a.wms-menu-item:hover { background: var(--kit-raised); text-decoration: none; }
.kit a.wms-menu-item:active { background: var(--kit-accent-soft); }
.wms-menu-icon {
    flex: none; width: 50px; height: 50px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--kit-accent-soft); color: var(--kit-accent-strong);
}
.wms-menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wms-menu-title { font-size: 1.15rem; font-weight: 700; }
.wms-menu-sub { font-size: 14px; color: var(--kit-muted); }

/* ---- The page's one sentence back ------------------------------------------------------------------ */

.wms-notice .kit-notice { margin-bottom: 12px; font-weight: 600; }

/* ---- Scan field: the full width, large ---------------------------------------------------------- */

.wms-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.wms-label { font-weight: 600; color: var(--kit-ink); }
.wms-hint { font-size: 14px; color: var(--kit-muted); }

.kit-input.wms-scan {
    width: 100%; min-height: 58px; padding: 0 16px;
    font-size: 1.3rem; font-weight: 600; border-width: 2px; border-color: var(--kit-accent-line);
}
.kit-input.wms-scan:focus { border-color: var(--kit-focus); }
.kit-input.wms-scan::placeholder { color: var(--kit-muted); font-weight: 400; }

/* ---- Quantity ------------------------------------------------------------------------------------ */

.wms-qty-row { display: grid; grid-template-columns: 58px 1fr 58px; gap: 8px; }
.kit-input.wms-qty { min-height: 58px; font-size: 1.6rem; font-weight: 700; text-align: center; padding: 0 4px; }
.kit-button.wms-step { min-height: 58px; padding: 0; font-size: 1.7rem; }

/* ---- Buttons under a step: full width on a phone, the main one first ---------------------------------- */

.wms-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.wms-actions > .kit-button { flex: 1 1 150px; min-height: 50px; }

/* ---- What the worker is working on ----------------------------------------------------------------- */

.wms-subject {
    border: 1px solid var(--kit-line); border-radius: 12px; padding: 12px 14px 0; margin: 0 0 14px;
    display: flex; flex-direction: column; gap: 2px;
}
.wms-subject-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.wms-code { font-weight: 700; font-size: 1rem; direction: ltr; unicode-bidi: isolate; overflow-wrap: break-word; min-width: 0; }
.wms-desc { color: var(--kit-body); }

/* The line's figures: one row of equal cells, a name over each value, thin rules between them. */
.wms-stats {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    margin: 10px -14px 0; border-top: 1px solid var(--kit-line);
}
.wms-stats > div { padding: 8px 14px 10px; min-width: 0; }
.wms-stats > div + div { border-inline-start: 1px solid var(--kit-line); }
.wms-stats dt { font-size: 12px; color: var(--kit-muted); margin: 0; }
.wms-stats dd {
    margin: 0; font-weight: 600; font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wms-stats dd.wms-stat-main { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.wms-stats dd.kit-ltr { text-align: end; }

.wms-instruction { font-size: 1rem; margin: 0 0 12px; color: var(--kit-body); }
.wms-question { font-size: 1.15rem; font-weight: 700; margin: 0 0 4px; }

/* ---- Lists: a row per thing, the whole row is the button -------------------------------------------- */

.wms-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.wms-list > li + li { border-top: 1px solid var(--kit-line-soft); }
.wms-list-title { font-size: 14px; color: var(--kit-muted); font-weight: 600; margin: 0 0 4px; }

.wms-row {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px;
    padding: 10px 4px; background: none; border: 0; border-radius: 10px;
    font: inherit; color: inherit; text-align: start;
}
button.wms-row { cursor: pointer; }
button.wms-row:hover:not(:disabled) { background: var(--kit-raised); }
button.wms-row:active:not(:disabled) { background: var(--kit-accent-soft); }
.wms-row:disabled { cursor: default; opacity: .6; }

.wms-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wms-row-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wms-row-num { color: var(--kit-muted); font-variant-numeric: tabular-nums; flex: none; }
.wms-row-sub { color: var(--kit-muted); font-size: 14px; overflow-wrap: anywhere; }

.wms-row-qty { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.wms-row-qty b { font-size: 1.35rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.wms-row-qty span { font-size: 12px; color: var(--kit-muted); white-space: nowrap; }
.wms-row-qty.mine b { color: var(--kit-good); }
.wms-row-qty.diff b { color: var(--kit-bad); }

.wms-row-go { flex: none; color: var(--kit-muted); font-size: 1.3rem; }
.wms-row-done { flex: none; }

.wms-remove {
    flex: none; width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--kit-line);
    background: var(--kit-surface); color: var(--kit-bad); font-size: 1.2rem; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.wms-remove:disabled { opacity: .5; cursor: default; }

/* ---- Folded list of what was saved -------------------------------------------------------------------- */

.wms-fold {
    display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px;
    background: none; border: 0; padding: 0; min-height: 48px;
    color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-align: start;
}
.wms-fold-count { font-weight: 400; color: var(--kit-muted); margin-inline-start: auto; }

/* ---- Choosing a document --------------------------------------------------------------------------- */

.wms-filters { margin-top: 4px; border-top: 1px solid var(--kit-line-soft); padding-top: 4px; }
.wms-filters > summary {
    cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600;
    color: var(--kit-accent-strong);
}
.wms-filter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 4px 0 12px; }
.wms-filter-grid .wms-field { margin: 0; min-width: 0; }
/* iPhone draws a date field at its own width, wider than the column: make it take the column's width. */
.wms-filter-grid input[type="date"] {
    display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none;
    line-height: 44px; text-align: start;
}
.wms-filter-grid input[type="date"]::-webkit-date-and-time-value { text-align: start; }
@media (max-width: 420px) { .wms-filter-grid { grid-template-columns: 1fr; } }

/* ---- Manager pages -------------------------------------------------------------------------------- */

.wms-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.wms-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
.wms-facts dt { color: var(--kit-muted); }
.wms-facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---- "המערכת מתעדכנת", only when the connection is really gone (wms-updating.js) ----------------------- */

.wms-updating {
    border: 0; padding: 0; background: transparent; color: var(--kit-ink);
    max-width: min(420px, calc(100vw - 32px));
}
.wms-updating::backdrop { background: var(--kit-scrim); }
.wms-updating-box {
    background: var(--kit-surface); border-radius: var(--kit-radius); box-shadow: var(--kit-shadow);
    padding: 26px 24px; text-align: center; font-family: var(--kit-font);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.wms-updating-box h2 { margin: 4px 0 0; font-size: 20px; font-weight: 700; }
.wms-updating-box p { margin: 0; color: var(--kit-body); }

/* ---- Inside a step ------------------------------------------------------------------------------- */

.wms-context {
    background: var(--kit-raised); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; color: var(--kit-body);
}
.wms-context strong { color: var(--kit-ink); font-size: 1.05rem; }
.kit-card .wms-facts { background: var(--kit-raised); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }

.wms-choices { display: grid; gap: 8px; margin: 0 0 14px; }
.kit-button.wms-choice {
    width: 100%; min-height: 56px; justify-content: space-between; white-space: normal; text-align: start; padding: 8px 14px;
}

.wms-recommend {
    border: 2px solid var(--kit-accent-line); background: var(--kit-accent-soft); border-radius: 14px;
    padding: 12px 14px; margin: 0 0 14px;
}
.wms-recommend .wms-actions { margin-top: 10px; }

/* ---- A field to type in and choose from (the partner filter) ------------------------------------------- */

.wms-wide { grid-column: 1 / -1; }
.wms-combo { min-width: 0; }
.wms-combo-box { position: relative; }
.wms-combo .kit-input { padding-inline-end: 48px; -webkit-appearance: none; appearance: none; }
.wms-combo .kit-input::-webkit-search-cancel-button { display: none; }
.wms-combo-clear {
    position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border: 0; background: none; color: var(--kit-muted); font-size: 1rem; cursor: pointer;
}
.wms-combo-list {
    list-style: none; margin: 6px 0 0; padding: 4px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--kit-surface); border: 1px solid var(--kit-field-line); border-radius: var(--kit-radius-control);
    box-shadow: var(--kit-shadow);
}
.wms-combo-option {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; min-height: 48px;
    padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--kit-ink);
    font: inherit; text-align: start; cursor: pointer;
}
.wms-combo-option:hover, .wms-combo-option:focus-visible { background: var(--kit-raised); }
[aria-selected="true"] > .wms-combo-option { background: var(--kit-accent-soft); color: var(--kit-accent-strong); }
.wms-combo-none { padding: 12px 10px; color: var(--kit-muted); }

/* ---- A fixed size, like an app ---------------------------------------------------------------- */

/* No double-tap zoom, no pinch zoom; the text keeps the size set here when the phone turns sideways. */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.kit, .kit button, .kit a { touch-action: manipulation; }
/* iPhone zooms into any field whose text is under 16px when it is tapped: none is. */
.kit-input, .kit select, .kit textarea, .kit input { font-size: max(16px, 1em); }

/* ---- The bar: the menu button on one side, the name on the other --------------------------------- */

.wms-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 8px;
    min-height: 56px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top));
    background: var(--kit-bar); color: var(--kit-bar-ink);
}
.wms-burger {
    flex: none; width: 48px; height: 48px; border: 0; border-radius: 12px;
    background: none; color: var(--kit-bar-ink); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.wms-burger:hover, .wms-burger[aria-expanded="true"] { background: var(--kit-bar-fill); }
.kit a.wms-bar-name {
    margin-inline-start: auto; display: inline-flex; align-items: center; gap: 10px;
    padding: 0 8px; min-height: 48px; color: var(--kit-bar-ink); font-weight: 700; font-size: 17px; text-decoration: none;
}
.wms-bar-name img { border-radius: 8px; }

/* ---- The menu: a panel from the menu button's side ------------------------------------------------ */

.wms-scrim { position: fixed; inset: 0; z-index: 40; background: var(--kit-scrim); }
.wms-drawer {
    position: fixed; z-index: 41; top: 0; bottom: 0; inset-inline-start: 0;
    width: min(320px, 86vw); background: var(--kit-surface); box-shadow: var(--kit-shadow);
    display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 12px 16px;
    overflow-y: auto;
}
.wms-drawer-who { display: flex; flex-direction: column; padding: 8px 12px 16px; border-bottom: 1px solid var(--kit-line); margin-bottom: 8px; }
.wms-drawer-name { font-size: 18px; font-weight: 700; color: var(--kit-ink); }
.wms-drawer-role { font-size: 14px; color: var(--kit-muted); }
.wms-drawer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wms-drawer-item {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 12px;
    border: 0; border-radius: 12px; background: none; color: var(--kit-ink);
    font: inherit; font-size: 16px; font-weight: 600; text-align: start; cursor: pointer;
}
.wms-drawer-item svg { color: var(--kit-muted); flex: none; }
.wms-drawer-item:hover { background: var(--kit-raised); }
.wms-drawer-value { margin-inline-start: auto; font-weight: 400; color: var(--kit-muted); font-size: 15px; }
.wms-drawer-item.danger, .wms-drawer-item.danger svg { color: var(--kit-bad); }
.wms-drawer-out { margin: auto 0 0; padding-top: 8px; border-top: 1px solid var(--kit-line); }
/* "Install as an app": only when the phone can (kit-app.js sets data-kit-install), never inside the installed app. */
.wms-drawer-install { display: none; }
[data-kit-install] .wms-drawer-install { display: block; }

/* ---- Sign-in ------------------------------------------------------------------------------------ */

.wms-signin { max-width: 420px; margin: 4vh auto 0; }
.wms-signin-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 20px; }
.wms-signin-head img { border-radius: 18px; }
.wms-signin-head h1 { margin: 0; }
.wms-signin .kit-form .kit-input { min-height: 52px; }
.wms-signin .kit-button.wms-block { width: 100%; min-height: 54px; font-size: 17px; }
.wms-signin-lang { display: flex; justify-content: center; margin-top: 14px; }
.kit a.wms-signin-lang-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--kit-muted); }

/* ---- A working screen: the title, the step, and a bar fixed at the bottom (FlowFrame) ------------------ */

.wms-frame { padding-bottom: 96px; }
.wms-frame-head { margin: 0 0 12px; }
.wms-frame-head h1 { margin: 0; }
.wms-frame-head .kit-lead { margin-top: 2px; }

.wms-bottom {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 25;
    background: var(--kit-surface); border-top: 1px solid var(--kit-line);
    box-shadow: 0 -6px 20px rgba(11, 18, 32, .06);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.wms-bottom-in {
    max-width: 760px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(88px, auto) auto minmax(0, 1fr); align-items: center; gap: 8px;
}
.wms-bottom-back {
    min-height: 54px; padding: 0 12px 0 8px; border-radius: 14px; border: 1px solid var(--kit-line);
    background: var(--kit-surface); color: var(--kit-ink); font: inherit; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.wms-bottom-back.placeholder { border: 0; background: none; cursor: default; }
[dir="ltr"] .wms-bottom-back svg { transform: scaleX(-1); }
.wms-bottom-count {
    min-height: 54px; min-width: 58px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--kit-line);
    background: var(--kit-raised); color: var(--kit-muted); font: inherit; cursor: pointer;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.wms-bottom-count b { font-size: 19px; color: var(--kit-ink); font-variant-numeric: tabular-nums; }
.wms-bottom-count span { font-size: 12px; }
.wms-bottom-count.has { border-color: var(--kit-accent-line); background: var(--kit-accent-soft); }
.wms-bottom-count.has b { color: var(--kit-accent-strong); }
.wms-bump { animation: wms-bump .35s ease-out; }
@keyframes wms-bump { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.wms-bottom-main {
    min-height: 54px; padding: 0 16px; border-radius: 14px; border: 0;
    background: var(--kit-accent); color: var(--kit-on-accent); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.wms-bottom-main:disabled { opacity: .55; cursor: default; }
.wms-bottom-main.danger { background: var(--kit-bad); }
.wms-bottom-main.placeholder { background: none; cursor: default; }

/* ---- The sentence back: floating above the bar, never pushing the page ------------------------------------ */

.wms-toast {
    position: fixed; inset-inline: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 26;
    max-width: 736px; margin: 0 auto;
    padding: 12px 16px; border-radius: 14px; font-weight: 600; box-shadow: var(--kit-shadow);
    background: var(--kit-accent-soft); color: var(--kit-accent-strong); border: 1px solid var(--kit-accent-line);
}
.wms-toast.good { background: var(--kit-good-soft); color: var(--kit-good); border-color: transparent; }
.wms-toast.bad { background: var(--kit-bad-soft); color: var(--kit-bad); border-color: var(--kit-bad); }
.wms-toast.wait { background: var(--kit-wait-soft); color: var(--kit-wait); border-color: transparent; }
.wms-toast.fade { animation: wms-toast-fade 3.5s ease-in forwards; pointer-events: none; }
@keyframes wms-toast-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .wms-bump { animation: none; } }

/* ---- Saved lines: a sheet from below --------------------------------------------------------------------- */

.wms-sheet {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 41; max-height: 78dvh;
    background: var(--kit-surface); border-radius: 20px 20px 0 0; box-shadow: var(--kit-shadow);
    display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom);
    animation: wms-sheet-in .2s ease-out;
}
@keyframes wms-sheet-in { from { transform: translateY(30%); opacity: .6; } to { transform: none; opacity: 1; } }
.wms-sheet-head {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--kit-line);
}
.wms-sheet-head h2 { margin: 0; font-size: 18px; }
.wms-sheet-close {
    width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--kit-raised); color: var(--kit-ink);
    font-size: 16px; cursor: pointer;
}
.wms-sheet-body { overflow-y: auto; padding: 4px 12px 16px; overscroll-behavior: contain; }

/* A secondary action inside a step: quiet, full width, under the step's fields. */
.wms-secondary { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.wms-secondary > .kit-button { width: 100%; min-height: 50px; }

/* ---- Orders in progress, first in order selection ------------------------------------------------------- */

.wms-progress {
    margin: 0 0 16px; padding: 10px 12px 4px; border-radius: 14px;
    background: var(--kit-wait-soft); border: 1px solid transparent;
}
.wms-progress .wms-list-title { color: var(--kit-wait); }
.wms-progress .wms-list > li + li { border-top-color: rgba(138, 75, 0, .15); }
.wms-progress-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--kit-wait); }
.wms-menu-badge {
    flex: none; font-size: 13px; font-weight: 600; white-space: nowrap;
    padding: 3px 10px; border-radius: 999px; background: var(--kit-wait-soft); color: var(--kit-wait);
}

/* ---- History ----------------------------------------------------------------------------------- */

/* A filter of a few choices: one row of equal buttons, the chosen one filled. */
.wms-segments {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
    padding: 3px; margin: 0 0 10px; border-radius: 12px; background: var(--kit-quiet-soft);
}
.wms-segment {
    min-height: 40px; padding: 0 4px; border: 0; border-radius: 9px; background: none;
    color: var(--kit-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wms-segment.on { background: var(--kit-surface); color: var(--kit-ink); box-shadow: 0 1px 2px rgba(11, 18, 32, .12); }
.wms-segments.small { width: min(100%, 260px); }

.wms-day { margin-top: 14px; }
.wms-day-title {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 14px; font-weight: 700; color: var(--kit-muted); margin: 0 4px 6px;
}
.wms-day-sum { font-weight: 400; }
.kit-card.wms-list { padding: 4px 12px; }
.wms-history-icon {
    flex: none; width: 40px; height: 40px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--kit-raised); color: var(--kit-accent-strong);
}
.wms-history-kind { font-weight: 600; color: var(--kit-body); }
.wms-stats-card {
    background: var(--kit-surface); border: 1px solid var(--kit-line); border-radius: 14px;
    margin: 0 0 12px; overflow: hidden;
}

/* A scan field reads codes left to right; while it is empty, its hint (Hebrew) keeps the page's direction, so "סרוק…"
   reads correctly with its dots at the end. */
.kit-input.kit-ltr:placeholder-shown { direction: inherit; }

/* The bottom bar with a second action (a preview link): Back, the count, the second action, then the main button. */
.wms-bottom-in { display: flex; }
.wms-bottom-back { flex: none; min-width: 88px; }
.wms-bottom-count { flex: none; }
.wms-bottom-main { flex: 1 1 auto; min-width: 0; }
.kit a.wms-bottom-extra, .wms-bottom-extra {
    flex: none; min-height: 54px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--kit-accent-line);
    background: var(--kit-surface); color: var(--kit-accent-strong); font-weight: 600; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.wms-bottom-main span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* With a second action, Back keeps only what it needs, so the main button keeps its words on one line. */
.wms-bottom-in.has-extra .wms-bottom-back { min-width: 0; padding: 0 10px 0 6px; }
.wms-bottom-in.has-extra .wms-bottom-extra { padding: 0 10px; }
.wms-bottom-in.has-extra .wms-bottom-main { padding: 0 10px; }

/* ---- Brand: Rossetto's R on a white tile; SAP-Port's logo on sign-in; the copyright line ---------------- */

.wms-logo-tile {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; border-radius: 18px; background: #fff; box-shadow: var(--kit-shadow);
}
.wms-logo-tile.small { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }
.wms-signin-logo {
    width: 190px; height: auto; max-width: 70vw; border-radius: 14px; background: #fff; padding: 10px 14px;
    box-sizing: content-box; box-shadow: var(--kit-shadow);
}
.wms-signin-head .kit-lead { margin: 0; }

/* A thin line fixed at the very bottom of every screen; the working screens' bar sits just above it. */
.wms-footer {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 24;
    padding: 4px 12px calc(4px + env(safe-area-inset-bottom));
    background: var(--kit-page); border-top: 1px solid var(--kit-line);
    color: var(--kit-muted); font-size: 11.5px; text-align: center; line-height: 1.4;
}
.wms-app .kit-main { padding-bottom: 72px; }
.wms-bottom { bottom: calc(24px + env(safe-area-inset-bottom)); padding-bottom: 8px; }
.wms-toast { bottom: calc(108px + env(safe-area-inset-bottom)); }
.wms-frame { padding-bottom: 120px; }
.wms-sheet { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---- Choosing an order: list or scan, a search beside the date, cards -------------------------------------- */

.wms-chooser-mode { margin-bottom: 12px; }
.wms-chooser-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0 0 12px; }
.wms-search { position: relative; margin: 0; }
.wms-search .kit-input {
    min-height: 54px; padding-inline-start: 42px; border-width: 2px; border-color: var(--kit-accent-line);
    -webkit-appearance: none; appearance: none;
}
.wms-search .kit-input:focus { border-color: var(--kit-focus); }
.wms-search-icon { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--kit-muted); pointer-events: none; }
.wms-date {
    display: flex; flex-direction: column; justify-content: center; gap: 0; min-height: 54px; padding: 2px 10px;
    border: 1px solid var(--kit-field-line); border-radius: var(--kit-radius-control); background: var(--kit-surface);
}
.wms-date span { font-size: 11px; color: var(--kit-muted); line-height: 1.2; }
.wms-date input {
    border: 0; background: none; color: var(--kit-ink); font: inherit; font-size: 16px; font-weight: 600; padding: 0;
    width: 8.4em; min-width: 0; -webkit-appearance: none; appearance: none;
}
.wms-date input:focus { outline: none; }

.wms-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wms-doc-card {
    display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 100%; padding: 12px 14px;
    border: 1px solid var(--kit-line); border-radius: 14px; background: var(--kit-surface); color: var(--kit-ink);
    font: inherit; text-align: start; cursor: pointer; box-shadow: var(--kit-shadow);
}
.wms-doc-card:hover:not(:disabled) { border-color: var(--kit-accent-line); }
.wms-doc-card:active:not(:disabled) { background: var(--kit-accent-soft); }
.wms-doc-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wms-doc-card .wms-code { font-size: 1.1rem; }
.wms-doc-kind {
    flex: none; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
    background: var(--kit-good-soft); color: var(--kit-good);
}
.wms-doc-partner { font-weight: 600; color: var(--kit-body); }
.wms-search .kit-input { padding-inline-end: 8px; }
.wms-date input { font-size: 15px; }  .wms-search .kit-input { padding-inline-start: 38px; }  .wms-search-icon { inset-inline-start: 11px; }

/* The date as DD/MM/YYYY, drawn by us; the real date field lies invisible on top and opens the phone's picker. */
.wms-date { position: relative; cursor: pointer; }
.wms-date-value { font-size: 16px !important; font-weight: 600; color: var(--kit-ink) !important; line-height: 1.3 !important; direction: ltr; text-align: end; }
.wms-date .wms-date-native {
    position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
    border: 0; padding: 0; margin: 0; font-size: 16px;
}
.wms-date:focus-within { border-color: var(--kit-focus); box-shadow: 0 0 0 3px var(--kit-accent-line); }
