:root {
  --accent: #ee9d53;
  --accent-dark: #d8883f;
  --dark: #2a2927;
  --page: #f3f1ee;
  --card: #fff;
  --ink: #1c1b19;
  --muted: #6a6560;
  --line: #e0dcd6;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--dark); color: #f4f1ea; }
[hidden] { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 0 20px; background: var(--accent); color: var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; white-space: nowrap; }
button.brand {
  align-self: stretch; margin: 0; padding: 0 12px 0 0; border: 0; border-radius: 0;
  background: transparent; color: inherit; font: inherit;
}
.brand span {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--dark); color: var(--accent); font-size: 18px; font-weight: 700;
}

.landing, .landing-message, .auth-form, #guest-footer { padding-left: clamp(20px, 6vw, 80px); padding-right: clamp(20px, 6vw, 80px); }
.landing { padding-top: 56px; max-width: 920px; }
.eyebrow { color: var(--accent); letter-spacing: .18em; font-size: 12px; font-weight: 650; }
.landing h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.1; letter-spacing: -.04em; margin: 18px 0; font-weight: 600; }
.lead { color: #c8c4be; font-size: 18px; line-height: 1.7; max-width: 540px; }
.landing-message { color: var(--accent); min-height: 1.5em; }
.auth-form { max-width: 420px; margin: 12px 0 40px; }
#guest-footer { padding-bottom: 40px; color: #9a958e; font-size: 13px; }

label { display: block; margin: 14px 0 8px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #6a6560; border-radius: 8px;
  background: #1c1b19; color: #f4f1ea; font: inherit;
}
body.app-mode input, body.app-mode select, body.app-mode textarea { background: #fff; color: var(--ink); border-color: var(--line); }
button {
  margin-top: 16px; padding: 10px 18px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--ink); font: inherit; cursor: pointer;
}
button.secondary { background: transparent; color: inherit; border: 1px solid currentColor; }
button:disabled { opacity: .6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.actions button { margin-top: 0; }
input:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

dialog { border: 0; border-radius: 12px; padding: 28px; background: #fff; color: var(--ink); max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgb(28 27 25 / .55); }
dialog form { margin: 0; max-width: none; }
dialog h2 { margin: 0 0 8px; }
dialog input, dialog textarea { background: #fff; color: var(--ink); border-color: var(--line); }
dialog button { background: var(--accent); color: var(--ink); }
dialog button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
dialog button.danger { background: transparent; color: #9f3a1f; border-color: var(--line); margin-top: 12px; width: 100%; }
#api-token-dialog { max-width: 520px; }
.token-hint { margin: 10px 0 16px; padding-left: 1.2em; color: var(--muted); font-size: 14px; line-height: 1.45; }
.token-hint li { margin: 6px 0; }
#register-message { color: #b45309; min-height: 1.4em; }

body.app-mode { background: var(--page); color: var(--ink); }
body.app-mode #guest-bar, body.app-mode #guest-footer, body.app-mode .landing-message { display: none !important; }
#workspace { min-height: 100vh; display: flex; flex-direction: column; }
.app-top {
  background: var(--accent); color: var(--ink);
  display: flex; align-items: stretch; gap: 8px; padding: 0 8px 0 16px;
  min-height: 56px;
}
.app-nav {
  display: flex; align-items: stretch; gap: 2px; overflow: visible;
  flex: 1; min-width: 0;
}
.app-nav button {
  margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  padding: 0 14px; white-space: nowrap; font-size: 14px;
}
.app-nav > button[aria-current="page"],
.nav-menu.is-current .nav-menu-toggle,
.nav-menu-toggle[aria-current="page"] { background: var(--accent-dark); box-shadow: inset 0 -3px 0 var(--dark); }
.nav-menu { position: relative; display: flex; align-items: stretch; }
.nav-caret { font-size: 11px; margin-left: 4px; opacity: .75; }
.nav-menu-list {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50;
  min-width: 200px; flex-direction: column; padding: 6px 0;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 0 0 10px 10px; box-shadow: 0 10px 24px rgba(42, 41, 39, 0.16);
}
.nav-menu:hover .nav-menu-list,
.nav-menu:focus-within .nav-menu-list,
.nav-menu.is-open .nav-menu-list { display: flex; }
.nav-menu-list button {
  width: 100%; margin: 0; padding: 10px 16px; text-align: left;
  background: transparent; color: var(--ink);
}
.nav-menu-list button:hover,
.nav-menu-list button[aria-current="page"] { background: #f7efe6; }
.nav-menu-list button:disabled { opacity: .45; cursor: default; background: transparent; }
.app-user { position: relative; display: flex; align-items: stretch; margin-left: auto; flex-shrink: 0; padding: 0; }
.user-trigger {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
  margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  padding: 6px 14px; min-width: 140px; font: inherit; text-align: right; line-height: 1.25;
}
.user-trigger .user-name { font-size: 14px; }
.user-trigger span { display: block; opacity: .8; font-size: 12px; }
.app-user:hover .user-trigger,
.app-user:focus-within .user-trigger,
.app-user.is-open .user-trigger { background: var(--accent-dark); }
.user-pop {
  display: none; position: absolute; top: calc(100% - 2px); right: 8px; z-index: 60;
  width: min(360px, calc(100vw - 24px)); padding: 8px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 18px 40px rgba(42, 41, 39, 0.2);
}
.app-user:hover .user-pop,
.app-user:focus-within .user-pop,
.app-user.is-open .user-pop { display: block; }
.user-pop-section { padding: 16px 16px 8px; }
.user-pop-section + .user-pop-section { border-top: 1px solid var(--line); }
.user-pop h2 { font-size: 13px; font-weight: 650; letter-spacing: .02em; color: var(--muted); margin: 0 0 12px; }
.user-pop-name { margin: 0; font-size: 16px; font-weight: 650; }
.user-pop-meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.user-warehouse-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.user-warehouse-list li { display: flex; align-items: center; gap: 8px; }
.user-warehouse {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; font: inherit;
}
.user-warehouse:hover { background: #f7efe6; }
.user-radio {
  width: 16px; height: 16px; flex-shrink: 0; border: 2px solid #c8c4be; border-radius: 50%;
}
.user-radio.is-on { border-color: var(--accent-dark); box-shadow: inset 0 0 0 3px var(--accent-dark); }
.user-warehouse-edit {
  margin: 0; padding: 6px 10px; flex-shrink: 0; font-size: 12px;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
}
.user-warehouse-edit:hover { color: var(--ink); border-color: #c8c4be; }
.user-pop-actions {
  display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 16px;
}
.user-pop-actions button { width: 100%; margin: 0; }
.user-pop-actions .secondary { background: #f7efe6; border: 0; color: var(--ink); }
.user-pop #logout { background: transparent; border: 1px solid var(--line); color: var(--ink); }

.settings-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 24px;
  border-bottom: 1px solid var(--line);
}
.settings-tabs button {
  margin: 0; padding: 10px 14px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); font: inherit;
}
.settings-tabs button:hover { color: var(--ink); }
.settings-tabs button[aria-current="page"] {
  color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent);
}
.mp-stock-tab-count { font-weight: 700; }
.mp-stock-tab-count.is-ok { color: #2f7a3e; }
.mp-stock-tab-count.is-bad { color: #b42318; }
.mp-stock-tab-count.is-all { color: var(--ink); }
.settings-form { max-width: 720px; }
[data-page="settings"] h2, [data-page="warehouse-edit"] h2 { font-size: 22px; margin: 0 0 16px; }
[data-page="warehouse-edit"] h3 { font-size: 16px; margin: 24px 0 12px; }
@media (max-width: 720px) {
  .settings-row { grid-template-columns: 1fr; }
}
.settings-row {
  display: grid; grid-template-columns: minmax(180px, 280px) minmax(200px, 1fr);
  gap: 16px; align-items: start; padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row label { margin: 0; font-weight: 650; }
.settings-row .muted { margin: 4px 0 0; }
.settings-row input { margin-top: 4px; }
.settings-danger { max-width: 720px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings-danger h3 { margin: 0 0 8px; font-size: 16px; }
button.danger { background: transparent; color: #9f3a1f; border: 1px solid var(--line); }
.mp-cards { display: grid; gap: 16px; max-width: 720px; }
.card.mp-card { min-height: 0; padding: 20px; }
.mp-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px;
}
.mp-card-head h3 { margin: 0; font-size: 18px; }
.mp-status {
  flex-shrink: 0; padding: 4px 10px; border-radius: 999px;
  background: #f3f1ee; color: var(--muted); font-size: 13px; font-weight: 650;
}
.mp-status.is-on { background: #f7efe6; color: var(--ink); }
.marketplace-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.marketplace-actions button { margin: 0; padding: 6px 10px; font-size: 13px; }
.mp-warehouse { display: grid; gap: 8px; margin: 16px 0 0; font-weight: 650; }
.mp-warehouse select { font-weight: 500; }
#mp-warehouse-message { margin: 0; min-height: 1.4em; color: #b45309; }
.export-stack { display: grid; gap: 16px; }
.card.wide.export-card { min-height: 0; }
.export-card h3 { margin: 0 0 8px; font-size: 16px; }
.export-card > .muted, .export-card > p { margin: 0 0 16px; }
.export-mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  padding: 4px; border-radius: 14px; background: #e8e4de;
}
.export-mode-tabs button {
  margin: 0; padding: 14px 18px; border: 0; border-radius: 11px;
  background: transparent; color: #8a847c; font: inherit; text-align: left;
}
.export-mode-tabs button strong { display: block; font-size: 16px; font-weight: 700; }
.export-mode-tabs button span { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; line-height: 1.35; }
.export-mode-tabs button[aria-checked="true"] {
  background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(28 27 25 / .12);
}
.export-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px; align-items: start;
}
.export-column { display: grid; gap: 16px; min-width: 0; }
.export-column.is-locked {
  opacity: .45; filter: grayscale(.18); pointer-events: none;
}
.export-card-head {
  display: flex; align-items: start; justify-content: space-between; gap: 16px;
}
.export-card-head .muted { margin: 0; }
.export-card-head h3 { margin: 0 0 6px; }
button.export-switch {
  position: relative; flex-shrink: 0; width: 51px; min-width: 51px; height: 31px;
  margin: 2px 0 0; padding: 0; border: 0; border-radius: 999px;
  background: #d4d0cb; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06);
}
button.export-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .28);
  transition: transform .18s ease;
}
button.export-switch[aria-checked="true"] { background: #34c759; }
button.export-switch[aria-checked="true"]::after { transform: translateX(20px); }
.export-ignore-input { display: grid; gap: 6px; margin: 16px 0 0; font-weight: 650; }
.export-ignore-input input { width: 7rem; margin: 0; }
.export-save { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-save button { margin: 0; }
#export-save-message { margin: 0; color: #3f6b3a; min-height: 1.4em; }
.export-settings.is-locked,
[data-export-settings].is-locked {
  opacity: .5;
  filter: grayscale(.12);
  pointer-events: none;
}
.export-shares.is-disabled .export-share-bar { opacity: .45; pointer-events: none; }
.export-share-fields {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px;
}
.export-share-fields label { margin: 0; flex: 1; min-width: 140px; display: grid; gap: 6px; font-weight: 650; }
.export-share-input { display: flex; align-items: center; gap: 6px; }
.export-share-input input { width: 5.5rem; margin: 0; }
.export-share-bar { position: relative; width: 100%; height: 40px; }
.export-share-track {
  display: grid; width: 100%; height: 100%; overflow: hidden; border-radius: 10px; background: var(--line);
}
.export-share-seg {
  display: flex; align-items: center; justify-content: center; min-width: 0;
  overflow: hidden; color: #fff; font-size: 13px; font-weight: 650; white-space: nowrap;
}
.export-share-seg[data-market="wildberries"] { background: var(--accent); color: var(--ink); }
.export-share-seg[data-market="ozon"] { background: var(--dark); color: #f4f1ea; }
.export-share-handle {
  position: absolute; top: 50%; width: 22px; height: 22px; margin: 0 0 0 -11px; padding: 0;
  transform: translateY(-50%); border-radius: 50%; border: 2px solid #fff;
  background: var(--ink); box-shadow: 0 1px 4px rgb(0 0 0 / .25); cursor: ew-resize; touch-action: none; z-index: 1;
}
.export-priority { list-style: none; margin: 0; padding: 0; }
.export-priority li {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--page); cursor: grab;
}
.export-priority li:last-child { margin-bottom: 0; }
.export-priority .drag-handle {
  margin: 0; padding: 6px; background: transparent; border: 0; color: var(--ink); line-height: 0; cursor: grab;
}
.export-priority .drag-handle svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.export-priority li.is-dragging { opacity: .45; }
.export-priority li.drop-target { background: #f7efe6; }
.export-priority-rank {
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px;
  background: #fff; font-size: 13px; font-weight: 700;
}
.export-dynamic {
  display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer;
}
.export-dynamic input {
  width: 1.15rem; height: 1.15rem; margin: 3px 0 0; padding: 0; flex-shrink: 0;
  accent-color: var(--accent-dark); cursor: pointer;
}
.export-dynamic span { display: grid; gap: 4px; }
.export-dynamic strong { font-size: 16px; }
.export-dynamic .muted { margin: 0; }
#profile-name-message, #profile-password-message, #api-token-message { color: #b45309; min-height: 1.4em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.content { flex: 1; width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.content-home {
  width: min(1680px, calc(100% - 48px));
  padding: 24px 0;
}
.content-home #cabinet-message:empty { display: none; }
.home-stack { display: grid; gap: 24px; }
.content h1 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.page-head .lede { margin-bottom: 0; }
.page-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.page-title h1 { margin: 0; }
.page-count { color: var(--muted); font-size: 18px; font-weight: 650; }
.page-head button { margin-top: 4px; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head-actions button { margin-top: 4px; }
[data-page="orders"],
[data-page="orders-ozon"],
.fbs-orders { display: grid; gap: 24px; align-content: start; }
[data-page="orders"] .page-head,
[data-page="orders-ozon"] .page-head,
.fbs-orders .page-head { align-items: center; margin: 0; }
[data-page="orders"] #orders-message,
[data-page="orders-ozon"] #orders-message,
.fbs-orders #orders-message { margin: 0; min-height: 0; }
[data-page="orders"] #orders-message:empty,
[data-page="orders-ozon"] #orders-message:empty,
.fbs-orders #orders-message:empty { display: none; }
.sync-meta { margin: 0; font-size: 13px; text-align: right; line-height: 1.35; }
.fbs-block { display: grid; gap: 16px; margin: 0; }
.fbs-block > h2, .fbs-heading h2 { font-size: 18px; margin: 0; }
.fbs-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fbs-queue-count { color: var(--muted); font-size: 16px; font-weight: 650; line-height: 1; }
.fbs-heading .fbs-queue-toggle {
  margin: 0; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 600;
}
.fbs-hint { position: relative; display: inline-flex; }
.fbs-hint-mark {
  margin: 0; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1px solid var(--muted); background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; line-height: 1; display: grid; place-items: center;
}
.fbs-hint-pop {
  display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 20;
  width: min(360px, 70vw); padding: 12px 14px; border-radius: 10px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgb(28 27 25 / .12); font-size: 14px; font-weight: 400; line-height: 1.45;
}
.fbs-hint:hover .fbs-hint-pop, .fbs-hint:focus-within .fbs-hint-pop { display: block; }
.fbs-stack { display: grid; gap: 16px; }
[data-page="orders"] .card.wide,
[data-page="orders-ozon"] .card.wide,
.fbs-orders .card.wide { min-height: 0; }
.fbs-supply-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 0 0 8px; min-height: 44px; }
.fbs-supply-head h2 { margin: 0; }
.fbs-supply-head button { margin: 0; }
.fbs-ship-note { margin: 0; max-width: 22rem; text-align: right; }
.fbs-orders-table { table-layout: fixed; width: 100%; }
.fbs-orders-table .fbs-col-id { width: 20%; }
.fbs-orders-table .fbs-col-sku { width: 16%; }
.fbs-orders-table .fbs-col-qty { width: 8%; }
.fbs-orders-table .fbs-col-name { width: 30%; }
.fbs-orders-table .fbs-col-barcode { width: 16%; }
.fbs-orders-table .fbs-col-status { width: 10%; }
.fbs-orders-table.is-no-barcode .fbs-col-id { width: 22%; }
.fbs-orders-table.is-no-barcode .fbs-col-sku { width: 20%; }
.fbs-orders-table.is-no-barcode .fbs-col-qty { width: 10%; }
.fbs-orders-table.is-no-barcode .fbs-col-name { width: 36%; }
.fbs-orders-table.is-no-barcode .fbs-col-status { width: 12%; }
.fbs-orders-table th, .fbs-orders-table td { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.fbs-orders-table .fbs-status, .fbs-orders-table .fbs-qty { white-space: nowrap; }
.op-item-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.op-item-copy .muted { font-size: 14px; font-weight: 500; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { color: var(--muted); font-size: 13px; font-weight: 650; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .cell-name { font-weight: 650; white-space: nowrap; }
.data-table .nowrap { white-space: nowrap; }
.data-table .qty { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qty-delta { font-weight: 700; }
.qty-delta.is-plus { color: #2f7d4a; }
.qty-delta.is-minus { color: #c0392b; }
[data-page="stock-movements"] .card.wide { min-height: 0; padding: 14px 12px; }
.movements-table { width: 100%; font-size: 13px; }
.movements-table th, .movements-table td { padding: 7px 5px; }
.movements-table th { font-size: 12px; }
.movements-table .qty { width: 4.25rem; }
.data-table.fbs-orders-table .cell-name { white-space: normal; }
.data-table .check { width: 2.5rem; text-align: center; vertical-align: middle; }
.data-table .check input {
  width: 1.15rem; height: 1.15rem; margin: 0; padding: 0; accent-color: var(--accent-dark); cursor: pointer;
}
.data-table .row-action { width: 1%; white-space: nowrap; text-align: right; vertical-align: middle; }
.data-table .row-action button { margin: 0; padding: 6px 12px; }
.data-table .row-action button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.data-table .row-edit { width: 1%; white-space: nowrap; text-align: center; vertical-align: middle; }
.data-table button.icon {
  margin: 0; padding: 6px; background: transparent; border: 0; color: var(--ink); line-height: 0;
}
.data-table button.icon svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.data-table .filter-th { white-space: nowrap; vertical-align: middle; }
.data-table .th-label { margin-right: 2px; }
.data-table .filter-btn { vertical-align: middle; }
.data-table .filter-th.is-filtered .filter-btn { color: var(--accent-dark); }
.data-table.movements-table .filter-th { white-space: normal; }
.data-table.movements-table button.icon { padding: 2px; }
.data-table.movements-table button.icon svg { width: 16px; height: 16px; }
.filter-pop {
  position: fixed;
  z-index: 40;
  width: min(240px, calc(100vw - 24px));
  max-height: 280px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(42, 41, 39, 0.16);
}
.filter-pop input[type="search"] { width: 100%; margin: 0 0 8px; }
.filter-pop ul { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; }
.filter-pop li { margin: 0; }
.filter-pop label {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 2px; cursor: pointer;
  color: var(--ink); font-weight: 500;
}
.filter-pop input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-dark); }
#barcode-message { color: #b45309; min-height: 1.4em; }
#warehouse-add-message, #warehouse-edit-message { color: #b45309; min-height: 1.4em; }
.choice-actions { display: grid; gap: 8px; margin-top: 16px; }
.choice-actions button { width: 100%; margin: 0; }
.addr-toggle {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; cursor: pointer;
  font-weight: 650; font-size: 13px; color: var(--muted);
}
.addr-toggle input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-dark); }
.range-title { margin: 12px 0 6px; font-weight: 650; font-size: 13px; color: var(--muted); }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-row label { margin: 0; display: grid; gap: 4px; }
#product-message, #product-settings-message, #product-import-message, #products-message, #stock-message, #product-stock-message, #product-stock-settings-message, #placement-message, #picking-message, #stock-movements-message { color: #b45309; min-height: 1.4em; }
#products-message:empty { display: none; margin: 0; min-height: 0; }
.placement-stack { display: grid; gap: 16px; }
.placement-table .rule-title { display: flex; align-items: flex-start; gap: 10px; }
.placement-table .rule-title strong { display: block; }
.placement-table .rule-title p { margin: 4px 0 0; }
.placement-table .drag-handle { cursor: grab; }
.placement-table tr.is-dragging { opacity: .45; }
.placement-table tr.drop-target td { background: #f7efe6; }
.placement-table .check label {
  display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.placement-table .check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-dark); }
.stock-filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px;
  margin: 0 0 16px;
}
.stock-filters label { margin: 0; display: grid; gap: 6px; font-weight: 650; font-size: 13px; color: var(--muted); }
.mp-stock-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px 0 0;
}
.mp-stock-page-size, .mp-stock-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mp-stock-page-size span { color: var(--muted); font-size: 13px; font-weight: 650; }
.mp-stock-pager button {
  margin: 0; padding: 6px 10px; font-size: 13px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
.mp-stock-pager button[aria-current] { border-color: var(--accent-dark); background: #f7efe6; }
.mp-stock-pager button:disabled { opacity: .45; cursor: default; }
.stock-cell-field { display: grid; gap: 6px; }
.stock-cell-field > span { font-weight: 650; font-size: 13px; color: var(--muted); }
.stock-cell-toggle {
  width: 100%; margin: 0; padding: 12px 14px; text-align: left; font-weight: 500;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
.stock-cell-field.is-filtered .stock-cell-toggle { border-color: var(--accent-dark); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px;
  min-height: 140px;
}
.card h2 { margin: 0 0 8px; font-size: 18px; }
[data-page="orders"] .fbs-supply-head h2,
[data-page="orders-ozon"] .fbs-supply-head h2,
.fbs-orders .fbs-supply-head h2 { margin: 0; }
.card p, .muted { color: var(--muted); }
.card form { margin-top: 12px; max-width: none; }
.home-fbs-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0;
}
.home-fbs-stat {
  background: #f7efe6; border-radius: 10px; padding: 16px 10px; text-align: center;
}
.home-fbs-stat strong { display: block; font-size: clamp(28px, 4vw, 36px); font-weight: 700; line-height: 1.1; }
.home-fbs-stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.home-fbs-markets {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px; margin-top: 16px;
}
.home-stock .home-fbs-markets {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.manual-export-summary { margin: 0 0 16px; }
.manual-export-summary .home-stock-source h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.home-fbs-market {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.home-fbs-market h3, .home-fbs-market-title { margin: 0; font-size: 15px; font-weight: 650; }
.home-fbs-market .home-fbs-stats { margin-top: 12px; }
.home-fbs-market .home-fbs-stat { background: var(--page); padding: 12px 8px; }
.home-fbs-market .home-fbs-stat strong { font-size: 24px; }
.home-fbs-market-go {
  display: block; width: 100%; margin: 14px 0 0; padding: 10px 14px; border-radius: 8px;
  background: var(--accent); color: var(--ink); font-size: 14px; font-weight: 650; text-align: center;
}
.card.home-fbs, .card.home-stock { min-height: 0; padding: 24px; }
.home-block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.home-block-head h2 { margin: 0; }
.home-sync { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.home-stock-source {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.home-stock-source .home-fbs-stats,
.home-fbs-market .home-fbs-stats { margin-top: 12px; }
.home-stock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-stock-source .home-fbs-stat { background: var(--page); padding: 12px 10px; }
.home-stock-source .home-fbs-stat strong { font-size: 22px; }
.home-stock-source .home-fbs-stat.home-stock-sku {
  position: relative;
  overflow: hidden;
}
.home-stock-sku-fill {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none;
}
.home-stock-source .home-fbs-stat.home-stock-sku > strong,
.home-stock-source .home-fbs-stat.home-stock-sku > span {
  position: relative;
  z-index: 1;
}
.wide { grid-column: 1 / -1; }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border-bottom: 1px solid var(--line); padding: 12px 0;
}
.list li:last-child { border-bottom: 0; }
.list button { margin: 0; padding: 6px 12px; }
.product-stock-columns label {
  display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-weight: 500;
}
.product-stock-columns input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-dark); }
.list select { width: auto; min-width: 160px; padding: 8px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline label { margin: 0; flex: 1; min-width: 180px; }
.inline button { margin: 0; }
.stack { display: grid; gap: 4px; }
.stack button { margin-top: 8px; }
button.linkish, button.text {
  margin: 0; padding: 0; background: transparent; border: 0; color: inherit;
  font: inherit; text-align: left; font-weight: 650;
}
button.text { font-weight: 500; color: var(--muted); }
.banner { background: #f7efe6; border-color: #efd3b0; }
#cabinet-message { color: #b45309; min-height: 1.3em; margin: 0 0 12px; }
.selection-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 32px); background: var(--dark); color: #f4f1ea;
}
.selection-bar[hidden] { display: none !important; }
.selection-bar p { margin: 0; font-weight: 650; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.selection-bar button { margin: 0; }
.selection-bar button.danger { background: #fff; color: var(--ink); }
body.has-selection .content { padding-bottom: 96px; }
body.has-term-nav #workspace {
  min-height: 100vh; min-height: 100dvh;
  height: 100vh; height: 100dvh;
  max-height: 100vh; max-height: 100dvh;
  overflow: hidden;
}
body.has-term-nav .content {
  flex: 1; min-height: 0; overflow: hidden; padding-bottom: 8px;
  display: flex; flex-direction: column;
}
body.has-term-nav #cabinet-message:empty { display: none; margin: 0; min-height: 0; }
.term-nav {
  flex-shrink: 0; width: 100%;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--accent) 78%, transparent); color: var(--ink);
}
.term-nav-btn, .term-nav-sound {
  margin: 0; min-height: 52px; padding: 10px 14px; border-radius: 10px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  font-size: 16px; font-weight: 650;
}
.term-nav-btn:disabled {
  color: var(--muted); background: #f7efe6; cursor: default; opacity: 1; pointer-events: none;
}
.term-nav-sound { width: 56px; padding: 10px; justify-self: center; }
.term-nav-sound svg { display: block; width: 28px; height: 28px; margin: 0 auto; }
.term-nav.fbs-term-nav { grid-template-columns: 1fr 1fr; }
.term-nav.fbs-term-nav.is-list { grid-template-columns: 1fr; }
.term-nav.walk-order-nav { grid-template-columns: 1fr 1fr 1fr; }
.term-nav.write-off-nav, .term-nav.transfer-nav { grid-template-columns: 1fr 1fr; }
.terminal-page { margin-top: 0; }
.terminal-shell { width: min(440px, 100%); margin: 0 auto; }
[data-page="receiving-cells"],
[data-page="walk-order"],
[data-page="write-off"],
[data-page="transfer"],
[data-page="fbs-assembly"] {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
[data-page="receiving-cells"] .terminal-shell,
[data-page="walk-order"] .terminal-shell,
[data-page="write-off"] .terminal-shell,
[data-page="transfer"] .terminal-shell,
[data-page="fbs-assembly"] .terminal-shell {
  flex: 1; min-height: 0; width: min(440px, 100%);
  display: flex; flex-direction: column;
  container-type: inline-size;
}
[data-page="receiving-cells"] h1,
[data-page="walk-order"] h1,
[data-page="write-off"] h1,
[data-page="transfer"] h1,
[data-page="fbs-assembly"] h1 {
  margin: 0 0 12px; white-space: nowrap;
  font-size: clamp(15px, 5.6cqi, 24px); line-height: 1.2;
}
[data-page="fbs-assembly"] .fbs-job-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px 12px; margin: 0 0 12px;
}
[data-page="fbs-assembly"] .fbs-job-head h1 { margin: 0; flex: 0 0 auto; }
[data-page="fbs-assembly"] .fbs-job-head .lede {
  margin: 0; flex: 1 1 auto; min-width: 0;
  font-size: 14px; line-height: 1.3; text-align: right;
}
.scan-top { flex-shrink: 0; }
.scan-mid {
  flex: 1; min-height: 0; margin: 12px 0;
  overflow-x: auto; overflow-y: auto;
}
.scan-bottom { flex-shrink: 0; }
[data-page="receiving-cells"] .scan-card,
[data-page="write-off"] .scan-card,
[data-page="transfer"] .scan-card,
[data-page="fbs-assembly"] .scan-card { margin: 12px 0 0; min-width: 100%; }
[data-page="fbs-assembly"] .scan-mid {
  display: flex; flex-direction: column;
  overflow: hidden; margin: 8px 0;
}
[data-page="fbs-assembly"] .scan-card {
  position: relative; padding-top: 44px;
  flex: 0 1 auto; min-height: 0; max-height: 100%;
  overflow-x: hidden; overflow-y: auto;
}
[data-page="fbs-assembly"] .scan-card.is-desk { padding-top: 16px; }
.fbs-pack-list {
  width: 100%; border-collapse: collapse; margin: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; font-size: 14px;
}
.fbs-pack-list th, .fbs-pack-list td {
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line);
}
.fbs-pack-list th { color: var(--muted); font-weight: 650; font-size: 12px; }
.fbs-pack-list td:last-child, .fbs-pack-list th:last-child { text-align: right; width: 4.5em; }
.fbs-pack-list tr:last-child td { border-bottom: 0; }
[data-page="fbs-assembly"] .scan-bottom { margin-top: auto; }
[data-page="fbs-assembly"] .scan-sku { color: #5c5852; }
[data-page="fbs-assembly"] .scan-name {
  margin-top: 10px;
  font-size: calc(22px * var(--fbs-card-scale, 1));
  font-weight: 650;
  line-height: 1.3;
}
.fbs-card-scale {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px;
}
.fbs-card-scale button {
  margin: 0; width: 36px; min-height: 36px; padding: 0;
  font-size: 15px; font-weight: 700; line-height: 1;
}
.fbs-card-scale button:disabled { opacity: .4; }
[data-page="fbs-assembly"] .fbs-market { margin: 0 0 18px; }
[data-page="fbs-assembly"] .fbs-market:last-child { margin-bottom: 0; }
.terminal-back { margin: 0 0 12px; font-size: 15px; min-height: 40px; }
.op-heading { margin: 24px 0 12px; font-size: 16px; font-weight: 650; color: var(--muted); }
.op-list { display: grid; gap: 10px; }
.op-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; margin: 0; min-height: 56px; padding: 16px 18px;
  font-size: 18px; font-weight: 650; text-align: left;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
}
.op-item:focus-visible { outline-offset: 0; }
.op-item:disabled {
  color: #b8b3ad; cursor: default; opacity: 1; pointer-events: none;
}
.op-item:disabled .op-chevron { color: #d0cbc4; }
.op-chevron { font-size: 28px; line-height: 1; color: var(--muted); font-weight: 400; }
.scan-block { margin: 0; }
.scan-putaway { margin: 0 0 8px; font-size: 18px; font-weight: 650; line-height: 1.3; }
.scan-block input {
  min-height: 56px; font-size: 22px; letter-spacing: .04em;
}
.scan-block select {
  min-height: 56px; font-size: 18px; width: 100%;
}
.scan-reason-label { display: block; margin: 0 0 8px; font-weight: 650; }
.scan-block input[readonly] { background: #f3f1ee; }
.scan-block button { margin-top: 10px; width: 100%; }
.fbs-market { margin: 0 0 22px; }
.fbs-market h2 { margin: 0 0 10px; font-size: 20px; }
#fbs-reprint { margin-top: 10px; width: 100%; }
.fbs-done {
  margin: 32px 0 0; text-align: center;
  font-size: 22px; font-weight: 650; line-height: 1.35;
}
#fbs-posting-note { margin: 0 0 10px; }
#fbs-posting-note:empty { display: none; margin: 0; }
.scan-success, .scan-error {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 8px;
  font-weight: 650; line-height: 1.35;
}
.scan-success { background: #e8f6ea; color: #157347; }
.scan-error { background: #e5252a; color: #fff; }
.scan-warehouse { margin: 0 0 14px; }
.scan-warehouse select { margin-top: 6px; }
.scan-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin: 16px 0 20px;
}
.scan-sku { font-size: clamp(28px, 8vw, 40px); font-weight: 700; line-height: 1.15; margin: 0 0 6px; word-break: break-word; }
.scan-name { font-size: 16px; line-height: 1.35; margin: 0; }
.scan-target-cell {
  margin: 0 0 12px; padding: 18px 16px; border-radius: 12px;
  text-align: center; font-size: clamp(40px, 10vw, 80px); font-weight: 700; line-height: 1.05;
  letter-spacing: .02em; word-break: break-word;
}
.scan-target-cell.is-ok { background: #e8f6ea; color: #157347; }
.scan-target-cell.is-lock { background: #fdecea; color: #9f3a1f; }
body.terminal-mode .content { width: min(720px, calc(100% - 24px)); padding: 24px 0 48px; }
body.has-term-nav.terminal-mode .content { padding: 16px 0 8px; overflow: hidden; }
@media (max-width: 720px) {
  .app-top { flex-wrap: wrap; padding: 0 8px 8px 12px; min-height: 0; }
  .brand { padding: 10px 0 0; }
  .app-user { padding-top: 8px; }
  .user-trigger { min-width: 0; padding: 6px 10px; }
  .app-nav { order: 3; flex: 1 1 100%; min-height: 44px; }
  .app-nav button { padding: 0 12px; font-size: 15px; }
  .nav-menu-list { min-width: 160px; }
  .content { width: calc(100% - 24px); padding: 16px 0 32px; }
  .content-home { width: calc(100% - 24px); padding: 16px 0; }
  body.terminal-mode .content { width: calc(100% - 24px); padding: 16px 0; }
  body.has-term-nav.terminal-mode .content { padding: 12px 0 8px; overflow: hidden; }
}
