:root {
  color-scheme: light;
  --ink: #17322b;
  --muted: #66776f;
  --paper: #fbfcf9;
  --surface: #ffffff;
  --line: #d9e2dc;
  --green: #173f35;
  --green-2: #286657;
  --mint: #e8f2ed;
  --lime: #dce9b1;
  --amber: #f6e9b7;
  --red: #b84e46;
  --surface-subtle: #f4f7f5;
  --shadow: 0 20px 54px rgba(27, 59, 49, 0.10);
  --shadow-soft: 0 1px 2px rgba(23, 50, 43, 0.04), 0 8px 24px rgba(23, 50, 43, 0.055);
  --shadow-raised: 0 2px 4px rgba(23, 50, 43, 0.04), 0 14px 34px rgba(23, 50, 43, 0.085);
  --ease-fluid: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-optical-sizing: auto;
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(220, 233, 177, 0.14), transparent 24rem),
    linear-gradient(180deg, #fcfdfa 0%, var(--paper) 40%, #f8faf7 100%);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@supports (min-height: 100svh) {
  body.login-page { min-height: 100svh; }
}

button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
::selection { background: #cfe3d8; color: var(--ink); }

.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;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.login-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 44px) 20px;
  background:
    radial-gradient(circle at 15% 10%, rgba(220, 233, 177, 0.75), transparent 26%),
    linear-gradient(145deg, #f8faf5 0%, #eaf2ed 100%);
}

.login-card {
  width: min(100%, 420px);
  padding: 36px 38px 32px;
  border: 1px solid rgba(23, 63, 53, 0.10);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-logo--login {
  width: 46px;
  height: 46px;
}

.brand-logo--header {
  width: 42px;
  height: 42px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-brand strong {
  color: var(--green);
  font-size: 1.08rem;
  font-weight: 880;
  line-height: 1.2;
  letter-spacing: 0.035em;
}

.login-card h1 {
  margin: 0 0 9px;
  font-size: clamp(1.65rem, 4vw, 1.92rem);
  font-weight: 820;
  letter-spacing: -0.035em;
}

.login-intro, .login-help {
  color: #566960;
  line-height: 1.6;
}

.login-intro {
  max-width: 24rem;
  margin: 0;
  font-size: 0.9rem;
  text-wrap: balance;
}

.login-form { margin-top: 25px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-weight: 700; }

.field input, .search-form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input:focus, .search-form input:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 4px rgba(40, 102, 87, 0.14);
}

.password-control { position: relative; }
.password-control input { padding-right: 108px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 92px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--green-2);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover { background: var(--mint); }
.password-toggle:active { transform: translateY(-50%) scale(0.96); }

.primary-button, .search-form button {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.primary-button { width: 100%; }
.primary-button:disabled { opacity: 0.72; }
.alert { padding: 12px 14px; border-radius: 10px; background: #fbe9e7; color: #8e332e; }
.login-alert { margin-bottom: 18px; font-size: 0.86rem; line-height: 1.5; }
.login-help {
  margin: 20px 0 0;
  font-size: 0.8rem;
  text-align: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 249, 0.94);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-text { display: grid; gap: 4px; line-height: 1.05; }
.wordmark-text strong { color: var(--green); font-size: 1.16rem; font-weight: 950; letter-spacing: 0.04em; }
.wordmark-text small { color: var(--muted); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.08em; }

.user-area { display: flex; align-items: center; gap: 16px; text-align: right; }
.user-area strong, .user-area span { display: block; }
.user-area span { margin-top: 2px; color: var(--muted); font-size: 0.78rem; }
.text-button { border: 0; background: transparent; color: var(--green-2); font-weight: 800; cursor: pointer; }
.text-button--link { text-decoration: none; }
.text-button--link:hover { text-decoration: underline; }

.app-shell {
  flex: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.site-footer {
  flex-shrink: 0;
  padding: 30px clamp(24px, 5vw, 64px) 32px;
  border-top: 1px solid #edf1ee;
  background: transparent;
  color: #89968f;
  text-align: center;
}
.site-footer__inner { width: min(920px, 100%); margin: 0 auto; }
.site-footer__title { margin: 0; color: #76847e; font-size: 0.72rem; font-weight: 700; line-height: 1.55; }
.site-footer__notice { width: min(720px, 100%); margin: 4px auto 0; font-size: 0.69rem; line-height: 1.7; text-wrap: balance; }
.site-footer__notice span { display: block; }
.site-footer--login { padding-block: 16px 18px; }
.site-about-button {
  min-height: 36px;
  margin-top: 5px;
  padding: 4px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #65766e;
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
}
.site-about-button:hover { background: rgba(232, 242, 237, 0.72); color: var(--green); }

.about-dialog {
  width: min(480px, calc(100% - 28px));
  max-width: none;
  max-height: min(78svh, 620px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 63, 53, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(14, 42, 34, 0.24);
}
.about-dialog::backdrop { background: rgba(15, 35, 29, 0.42); backdrop-filter: blur(4px); }
.about-dialog__surface { display: grid; max-height: inherit; }
.about-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 18px 14px 22px;
  border-bottom: 1px solid rgba(23, 63, 53, 0.08);
}
.about-dialog__header h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }
.about-dialog__close {
  min-width: 52px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  background: var(--mint);
  color: var(--green);
  font-weight: 760;
  cursor: pointer;
}
.about-dialog__content {
  overflow: auto;
  padding: 20px 22px 24px;
  color: #52665d;
  font-size: 0.86rem;
  line-height: 1.75;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.about-dialog__content p { margin: 0; }
.about-dialog__content p + p { margin-top: 12px; }

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 22px;
  align-items: center;
  margin-bottom: 40px;
  min-height: 180px;
  padding: 34px clamp(30px, 5vw, 60px);
  border-radius: 24px;
  background: linear-gradient(135deg, #12382f 0%, var(--green) 48%, #205646 100%);
  color: white;
  box-shadow: var(--shadow);
  text-align: center;
}

.search-panel h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(100%, 820px);
}
.search-form input { min-width: 0; border: 0; }
.search-form button { min-width: 92px; padding: 0 24px; background: var(--lime); color: var(--ink); }

.search-results { margin: 0 0 44px; scroll-margin-top: 88px; }
.clear-search { color: var(--green-2); font-weight: 800; text-decoration: none; }
.clear-search:hover { text-decoration: underline; }
.product-list { display: grid; gap: 18px; }
.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(27, 59, 49, 0.06);
}
.product-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  padding: 24px;
}
.product-code-line { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.product-code { font-size: 1.2rem; letter-spacing: 0.02em; }
.brand-pill { padding: 5px 9px; border-radius: 999px; background: var(--mint); color: var(--green-2); font-size: 0.74rem; font-weight: 800; }
.blue-box-pill { padding: 5px 9px; border-radius: 999px; background: #e6efff; color: #245aa8; font-size: 0.74rem; font-weight: 850; }
.purchase-note-pill { max-width: 360px; padding: 5px 9px; border-radius: 999px; background: #fff0d8; color: #76500e; font-size: 0.74rem; font-weight: 850; overflow-wrap: anywhere; }
.product-summary .purchase-reference, .receiving-product .purchase-reference { margin: 6px 0 0; color: #76500e; font-size: 0.78rem; font-weight: 750; }
.product-summary h3 { margin: 8px 0 5px; font-size: 1.15rem; }
.product-summary p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.location-block { min-width: 150px; text-align: right; }
.location-block > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 0.76rem; }
.location-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.location-list strong { padding: 6px 9px; border-radius: 9px; background: var(--amber); color: #665211; font-size: 0.82rem; }
.location-list .location-pending { background: #edf0ee; color: var(--muted); }
.location-list .location-inactive { background: #ececeb; color: #777; text-decoration: line-through; }
.sku-table { border-top: 1px solid var(--line); }
.sku-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 150px); gap: 16px; align-items: center; min-height: 58px; padding: 9px 24px; border-bottom: 1px solid #edf1ee; }
.sku-row:last-child { border-bottom: 0; }
.sku-row--head { min-height: 40px; background: #f5f8f5; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.sku-row--head > span:nth-child(2) { text-align: right; }
.stock-cell { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; text-align: right; }
.stock-quantity { font-size: 1.05rem; }
.stock-quantity--negative { color: var(--red); }
.stock-flag { padding: 4px 6px; border-radius: 7px; font-size: 0.68rem; font-weight: 800; line-height: 1.2; }
.stock-flag--danger { background: #fbe6e3; color: #963b35; }
.stock-flag--warning { background: var(--amber); color: #705c18; }
.empty-skus, .empty-result { padding: 26px 24px; color: var(--muted); }
.empty-result { border: 1px dashed #bdc9c2; border-radius: 18px; background: #f7f9f7; text-align: center; }
.empty-result strong { color: var(--ink); }
.empty-result p { margin: 7px 0 0; }
.inventory-note { margin: 0; padding: 12px 24px; border-top: 1px solid var(--line); background: #fbfcfb; color: var(--muted); font-size: 0.78rem; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.status-pill, .pending-pill { padding: 7px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }
.status-pill { background: var(--mint); color: var(--green-2); }
.pending-pill { background: var(--amber); color: #705c18; }

.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.action-card, .manager-card {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.action-card { display: flex; gap: 14px; min-height: 150px; padding: 20px; border-radius: 18px; }
.action-card:disabled, .manager-card:disabled { opacity: 1; }
.action-card--enabled { text-decoration: none; cursor: pointer; transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.action-card--enabled:hover { border-color: #a9bdb3; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(27, 59, 49, 0.08); }
.action-card--enabled:focus-visible { outline: 3px solid rgba(40, 102, 87, 0.25); outline-offset: 3px; }
.action-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 13px; background: var(--mint); color: var(--green); font-weight: 900; }
.action-card strong, .action-card small, .manager-card strong, .manager-card small { display: block; }
.action-card strong, .manager-card strong { margin: 2px 0 7px; font-size: 1rem; }
.action-card small, .manager-card small { color: var(--muted); line-height: 1.5; }
.action-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.action-title-row strong { margin-right: 2px; }
.action-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--amber); color: #705c18; font-size: 0.7rem; font-style: normal; font-weight: 850; white-space: nowrap; }

.manager-section { margin-top: 44px; padding-top: 34px; border-top: 1px solid var(--line); }
.manager-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.manager-card { min-height: 112px; padding: 18px; border-radius: 15px; }
.manager-card--enabled { text-decoration: none; cursor: pointer; transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.manager-card--enabled:hover { border-color: #a9bdb3; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(27, 59, 49, 0.08); }

.receiving-shell { width: min(980px, calc(100% - 32px)); }
.page-intro { margin-bottom: 24px; }
.page-intro h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.04em; }
.page-intro > p:last-child { max-width: 680px; margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.lookup-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  gap: 24px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.lookup-card h2 { margin: 0; font-size: 1.35rem; }
.receiving-search button { background: var(--green); color: white; }
.receiving-results { margin-top: 34px; }
.receiving-list { display: grid; gap: 18px; }
.receiving-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 28px rgba(27, 59, 49, 0.06); }
.receiving-product { display: flex; justify-content: space-between; gap: 24px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.receiving-product h3 { margin: 8px 0 5px; }
.receiving-product p { margin: 0; color: var(--muted); }
.receiving-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px; }
.receiving-form--new { grid-template-columns: minmax(170px, 1.15fr) minmax(210px, 1.35fr) minmax(160px, 1fr) minmax(130px, 0.75fr); }
.operation-panel { border-bottom: 1px solid var(--line); }
.operation-panel--receiving { background: #f8fbf9; box-shadow: inset 5px 0 0 #4b8a70; }
.operation-panel--receiving .operation-panel-heading { grid-template-columns: 1fr auto; }
.operation-panel-heading { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 20px 24px; border-bottom: 1px solid rgba(151, 164, 156, 0.25); }
.operation-panel-heading h4 { margin: 0 0 6px; font-size: 1.1rem; }
.operation-panel-heading p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.operation-panel-heading p strong { color: var(--ink); }
.operation-impact { padding: 7px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 900; white-space: nowrap; }
.operation-impact--safe { background: #dceddf; color: #246049; }
.operation-impact--warning { background: #f6dfb5; color: #7b500b; }
.new-product-card .receiving-product { align-items: flex-start; }
.new-product-size-type { min-width: 0; margin: 0; padding: 0; border: 0; }
.new-product-size-type legend { margin-bottom: 7px; font-size: 0.82rem; font-weight: 800; }
.new-product-size-type > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.new-product-size-type > div > div { min-width: 0; }
.new-product-size-type label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  margin: 0;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 100ms ease-out;
}
.new-product-size-type label:active { transform: scale(0.98); }
.new-product-size-type label.is-selected {
  border-color: var(--green-2);
  background: #e7f1ec;
  color: var(--green);
}
.receiving-field.new-product-size-type input[type="radio"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}
.receiving-field select:disabled { background: #f3f5f3; color: #8a9691; cursor: not-allowed; }
.receiving-field label { display: block; margin-bottom: 7px; font-size: 0.82rem; font-weight: 800; }
.receiving-field select, .receiving-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  outline: none;
}
.receiving-field select:focus, .receiving-field input:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(40, 102, 87, 0.12); }
.receiving-field--wide { grid-column: 1 / -1; }
.field-help { display: block; margin: -2px 0 9px; color: var(--muted); font-size: 0.75rem; }
.receiving-stock-heading {
  display: flex;
  align-items: baseline;
  gap: 8px 12px;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.receiving-stock-heading strong { font-size: 0.84rem; }
.receiving-stock-heading small { color: var(--muted); font-size: 0.74rem; }
.location-multi-field > div { display: grid; grid-template-columns: repeat(6, minmax(72px, 1fr)); gap: 8px; max-height: 205px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.location-multi-field > div > div { min-width: 0; }
.location-multi-field > div label { display: flex; align-items: center; gap: 7px; min-height: 40px; margin: 0; padding: 7px 9px; border: 1px solid #dce4df; border-radius: 9px; background: #f8faf8; cursor: pointer; }
.location-multi-field input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--green); box-shadow: none; }
.location-multi-field label:has(input:checked) { border-color: #6f9d89; background: #e7f2eb; color: var(--green); }
.confirm-receiving { grid-column: 1 / -1; min-height: 52px; border: 0; border-radius: 12px; background: var(--green); color: white; font-weight: 850; cursor: pointer; }
.field-error { display: block; margin-top: 5px; color: var(--red); }
.form-errors { grid-column: 1 / -1; padding: 11px 13px; border-radius: 10px; background: #fbe6e3; color: #963b35; }
.form-errors ul { margin: 0; padding-left: 20px; }
.message-stack { margin-bottom: 20px; }
.message { padding: 14px 16px; border-radius: 12px; font-weight: 750; }
.message--success { border: 1px solid #bddacb; background: #e9f5ee; color: #205b47; }
.message--error { border: 1px solid #efc4bf; background: #fbe6e3; color: #963b35; }
.purchase-batch-details { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: -6px 0 20px; padding: 14px 16px; border: 1px solid #f0dfbf; border-radius: 12px; background: #fffaf1; }
.purchase-batch-details span { color: #76500e; font-size: 0.86rem; }
.purchase-batch-details strong { margin-right: 8px; }
.catalog-shell { width: min(1080px, calc(100% - 32px)); }
.catalog-lookup { margin-bottom: 24px; }
.catalog-lookup > div > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 0.82rem; }
.catalog-scope-tabs { display: flex; gap: 9px; margin-bottom: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #f4f7f5; }
.catalog-scope-tabs a { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 8px 18px; border-radius: 10px; color: var(--muted); font-weight: 800; }
.catalog-scope-tabs a:hover, .catalog-scope-tabs a.is-active { background: var(--surface); color: var(--green); box-shadow: 0 2px 9px rgba(27, 59, 49, 0.08); }
.catalog-scope-tabs strong { padding: 3px 8px; border-radius: 999px; background: #e4eee8; font-size: 0.73rem; }
.catalog-page-summary { color: var(--muted); font-size: 0.78rem; }
.catalog-list { display: grid; gap: 20px; }
.catalog-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 28px rgba(27, 59, 49, 0.06); }
.catalog-card__summary { display: flex; justify-content: space-between; gap: 24px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.catalog-card__summary h3 { margin: 8px 0 5px; }
.catalog-card__summary p, .catalog-card__summary > small { margin: 0; color: var(--muted); }
.catalog-form { padding: 24px; }
.catalog-fields { display: grid; grid-template-columns: 1fr 1.5fr 1fr 1fr; gap: 16px; }
.catalog-subsection { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.catalog-subsection > div:first-child { display: flex; justify-content: space-between; gap: 16px; }
.catalog-subsection small { color: var(--muted); }
.catalog-size-grid { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 12px; margin-top: 14px; }
.catalog-size-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.75rem; }
.catalog-size-field input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 800; }
.catalog-locations { margin: 22px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.catalog-locations legend { padding: 0 8px; color: var(--green); font-weight: 850; }
.catalog-location-overview { display: grid; grid-template-columns: minmax(210px, 0.65fr) minmax(0, 1.35fr); gap: 18px; align-items: center; }
.catalog-location-overview strong, .catalog-location-overview small { display: block; }
.catalog-location-overview small { margin-top: 4px; color: var(--muted); font-size: 0.76rem; }
.catalog-current-locations { display: flex; flex-wrap: wrap; gap: 7px; }
.catalog-current-locations span { padding: 5px 9px; border-radius: 8px; background: #e7f2eb; color: var(--green); font-size: 0.77rem; font-weight: 850; }
.catalog-current-locations .catalog-location-empty { background: #eef1ef; color: var(--muted); font-weight: 700; }
.catalog-current-locations .catalog-location-pending { background: var(--amber); color: #665211; }
.catalog-location-picker { margin-top: 14px; border: 1px solid #dce4df; border-radius: 11px; background: var(--surface); }
.catalog-location-picker summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 46px; padding: 10px 14px; cursor: pointer; }
.catalog-location-picker summary::marker { color: var(--green); }
.catalog-location-picker summary small { color: var(--muted); font-size: 0.73rem; }
.catalog-location-picker[open] summary { border-bottom: 1px solid var(--line); }
.catalog-location-options { padding: 12px; }
.catalog-location-options > div { display: grid; grid-template-columns: repeat(6, minmax(72px, 1fr)); gap: 8px; max-height: 220px; overflow-y: auto; }
.catalog-location-options > div > div { min-width: 0; }
.catalog-location-options label { display: flex; align-items: center; gap: 7px; min-height: 39px; padding: 7px 9px; border: 1px solid #dce4df; border-radius: 9px; background: #f8faf8; font-weight: 750; cursor: pointer; }
.catalog-location-options input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--green); box-shadow: none; }
.catalog-location-options label:has(input:checked) { border-color: #6f9d89; background: #e7f2eb; color: var(--green); }
.catalog-pending-location { margin-top: 12px; padding: 13px 14px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f3f5f4; }
.catalog-pending-location input { margin-top: 3px; }
.catalog-pending-location label { display: grid; gap: 3px; cursor: pointer; }
.catalog-pending-location small { color: var(--muted); font-weight: 500; }
.catalog-safety-note { margin: 18px 0; padding: 11px 13px; border-radius: 10px; background: #f7f2df; color: #705c18; font-size: 0.82rem; }
.catalog-pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 28px; }
.catalog-page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.catalog-page-link { display: inline-flex; justify-content: center; align-items: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--green); font-size: 0.8rem; font-weight: 850; }
.catalog-page-link:hover { border-color: #8eb2a2; background: #eef6f1; }
.catalog-page-link.is-current { border-color: var(--green); background: var(--green); color: white; }
.catalog-page-link.is-disabled { background: #f4f5f4; color: #a5aaa7; }
.catalog-page-link--wide { min-width: 72px; }
.catalog-page-ellipsis { display: inline-flex; align-items: center; padding: 0 3px; color: var(--muted); }
.location-shell { width: min(980px, calc(100% - 32px)); }
.location-create-card { display: grid; grid-template-columns: minmax(220px, 0.65fr) minmax(420px, 1.35fr); gap: 26px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.location-create-card h2 { margin: 0; }
.location-create-card p:last-child { color: var(--muted); }
.location-create-form { display: grid; grid-template-columns: 0.8fr 1.4fr auto; gap: 12px; align-items: end; }
.location-create-form .confirm-receiving { grid-column: auto; min-width: 110px; }
.location-list-section { margin-top: 34px; }
.location-admin-list { display: grid; gap: 12px; }
.location-admin-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.location-admin-card--inactive { background: #f7f7f6; }
.location-admin-summary { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.location-admin-summary > div { display: flex; align-items: baseline; gap: 12px; }
.location-admin-summary strong { font-size: 1.15rem; }
.location-admin-summary span { color: var(--muted); font-size: 0.82rem; }
.inactive-pill { padding: 7px 11px; border-radius: 999px; background: #e7e8e7; color: #696d6b; font-size: 0.78rem; font-weight: 800; }
.location-update-form { display: grid; grid-template-columns: 0.8fr 1.3fr 1.2fr auto; gap: 12px; align-items: end; }
.location-active-toggle { display: flex; align-items: center; gap: 9px; min-height: 48px; }
.location-active-toggle input { width: 20px; height: 20px; }
.location-active-toggle strong, .location-active-toggle small { display: block; }
.location-active-toggle small { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.location-save-button { min-width: 84px; min-height: 48px; border: 0; border-radius: 11px; background: var(--green); color: white; font-weight: 850; cursor: pointer; }
.location-last-change { margin: 12px 0 0; color: var(--muted); font-size: 0.76rem; }
.account-shell { width: min(1100px, calc(100% - 32px)); }
.account-create-card { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.account-create-card h2 { margin: 0; }
.account-create-card > div > p:last-child { color: var(--muted); }
.account-create-form { display: grid; grid-template-columns: 1fr 1fr 0.8fr 1fr; gap: 12px; align-items: end; margin-top: 18px; }
.account-list-section { margin-top: 34px; }
.account-admin-list { display: grid; gap: 12px; }
.account-admin-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.account-admin-card--inactive { background: #f7f7f6; }
.account-admin-summary { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.account-admin-summary > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.account-admin-summary > div > strong { font-size: 1.12rem; }
.account-admin-summary > div > span:not(.status-pill) { color: var(--muted); }
.account-update-form { display: grid; grid-template-columns: 1fr 1fr 0.8fr 1.1fr 1.2fr auto; gap: 12px; align-items: end; }
.account-active-toggle { display: flex; align-items: center; gap: 9px; min-height: 48px; }
.account-active-toggle input { width: 20px; height: 20px; }
.account-active-toggle strong, .account-active-toggle small { display: block; }
.account-active-toggle small { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.account-save-button { min-width: 84px; min-height: 48px; border: 0; border-radius: 11px; background: var(--green); color: white; font-weight: 850; cursor: pointer; }
.account-safety-note { margin: 12px 0 0; color: #705c18; font-size: 0.78rem; }
.account-last-change { margin: 9px 0 0; color: var(--muted); font-size: 0.76rem; }
.task-status { align-self: flex-start; padding: 7px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 850; white-space: nowrap; }
.task-status--open { background: var(--amber); color: #705c18; }
.task-status--pending { background: #e7edf7; color: #38577f; }
.pending-review-note { padding: 28px 24px; background: #f7f9f8; }
.pending-review-note p { margin: 7px 0 0; color: var(--muted); }
.stocktake-workspace { margin-bottom: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.stocktake-workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.stocktake-workspace-heading > div > p { margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.stocktake-step-title { display: flex; align-items: center; gap: 10px; }
.stocktake-step-title > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--mint); color: var(--green); font-size: 0.82rem; font-weight: 900; }
.stocktake-step-title h2 { margin: 0; font-size: 1.35rem; }
.stocktake-count { min-width: 25px; padding: 4px 7px; border-radius: 999px; background: var(--amber); color: #705c18; font-size: 0.76rem; text-align: center; }
.recheck-assignment-details { margin-top: 18px; padding-top: 16px; border-top: 1px solid #edf1ee; }
.recheck-assignment-details summary { display: inline-flex; min-height: 40px; align-items: center; padding: 0 13px; border: 1px solid #b8c9c0; border-radius: 10px; color: var(--green-2); font-size: 0.82rem; font-weight: 850; cursor: pointer; list-style: none; }
.recheck-assignment-details summary::-webkit-details-marker { display: none; }
.recheck-assignment-details[open] summary { margin-bottom: 14px; background: var(--mint); }
.recheck-assignment-panel { display: grid; grid-template-columns: minmax(170px, 0.45fr) minmax(520px, 1.55fr); gap: 22px; align-items: end; padding: 18px; border-radius: 14px; background: #fffaf0; }
.recheck-assignment-copy { align-self: center; }
.recheck-assignment-copy strong, .recheck-assignment-copy span { display: block; }
.recheck-assignment-copy span { margin-top: 6px; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.recheck-assignment-form { display: grid; grid-template-columns: 0.7fr 1.5fr auto; gap: 12px; align-items: end; }
.recheck-assignment-form .confirm-receiving { grid-column: auto; min-width: 140px; padding-inline: 16px; }
.recheck-task-list { display: grid; gap: 12px; margin-top: 18px; }
.recheck-pagination { margin-top: 20px; }
.recheck-task-card { display: grid; grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1.45fr) minmax(145px, 0.55fr); gap: 20px; align-items: center; padding: 19px 20px; border: 1px solid #e0c781; border-left: 5px solid #d49a32; border-radius: 16px; background: #fffdf7; box-shadow: 0 8px 22px rgba(57, 45, 20, 0.05); }
.recheck-task-product h3 { margin: 6px 0 9px; font-size: 0.98rem; }
.recheck-location-list { justify-content: flex-start; }
.recheck-task-reason { display: grid; gap: 5px; padding-left: 18px; border-left: 1px solid #e5dcc8; }
.recheck-task-reason span, .recheck-task-action span { color: var(--muted); font-size: 0.72rem; font-weight: 750; }
.recheck-task-reason strong { line-height: 1.5; }
.recheck-task-reason small { color: var(--muted); }
.recheck-task-action { display: grid; gap: 5px; text-align: right; }
.recheck-task-action > strong { font-size: 1.35rem; }
.recheck-task-action a { display: inline-flex; justify-content: center; align-items: center; min-height: 43px; margin-top: 5px; padding: 0 13px; border-radius: 10px; background: var(--green); color: white; font-size: 0.82rem; font-weight: 850; text-decoration: none; }
.recheck-empty { margin-top: 18px; padding: 15px 18px; border-radius: 12px; text-align: left; }
.manual-stocktake-section { margin-top: 0; }
.stocktake-quick-search { margin-top: 18px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #f7f9f7; }
.stocktake-quick-search input { min-height: 48px; background: transparent; }
.stocktake-quick-search button { min-height: 48px; min-width: 92px; background: var(--green); color: white; }
.assigned-recheck-note { display: grid; gap: 5px; padding: 14px 24px; border-bottom: 1px solid #ead9ae; background: #fff8e8; }
.assigned-recheck-note span { color: #7b500b; font-size: 0.74rem; font-weight: 850; }
.assigned-recheck-note strong { line-height: 1.45; }
.stocktake-result-card {
  scroll-margin-top: 96px;
}
.stocktake-results { scroll-margin-top: 88px; }
.stocktake-result-card:target {
  border-color: rgba(40, 102, 87, 0.48);
  animation: stocktake-target-focus 900ms var(--ease-fluid) both;
}
@keyframes stocktake-target-focus {
  0% { box-shadow: 0 0 0 5px rgba(40, 102, 87, 0.16), var(--shadow-soft); }
  100% { box-shadow: var(--shadow-soft); }
}
.stocktake-form { padding: 0 24px 24px; }
.stocktake-grid { display: grid; grid-template-columns: minmax(70px, 0.3fr) minmax(100px, 0.5fr) minmax(130px, 1fr); gap: 16px; align-items: center; min-height: 62px; border-bottom: 1px solid #edf1ee; }
.stocktake-grid--head { min-height: 44px; color: var(--muted); font-size: 0.76rem; font-weight: 850; }
.stocktake-grid input[type="number"] { width: min(100%, 180px); min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 800; }
.expected-stock { font-weight: 800; }
.expected-stock--negative { color: var(--red); }
.stocktake-note { margin: 18px 0; }
.stocktake-note label { display: block; margin-bottom: 7px; font-size: 0.82rem; font-weight: 800; }
.stocktake-note input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.review-list { display: grid; gap: 20px; }
.review-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 28px rgba(27, 59, 49, 0.06); }
.review-summary { display: flex; justify-content: space-between; gap: 24px; padding: 22px 24px; }
.review-summary h3 { margin: 7px 0; }
.review-summary p { margin: 4px 0 0; color: var(--muted); font-size: 0.84rem; }
.review-table { border-top: 1px solid var(--line); }
.review-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: center; min-height: 50px; padding: 8px 24px; border-bottom: 1px solid #edf1ee; }
.review-row--head { min-height: 40px; background: #f5f8f5; color: var(--muted); font-size: 0.75rem; font-weight: 850; }
.difference--changed { color: var(--red); }
.review-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 18px 24px; background: #fbfcfb; }
.review-actions input { min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.receipt-review-admin { margin-bottom: 34px; }
.receipt-review-admin > .section-heading,
.review-stocktake-heading { margin: 0 0 14px; }
.receipt-review-admin .receipt-summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.receipt-review-exceptions { display: grid; gap: 7px; padding: 17px 24px; background: #fffdf7; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.receipt-review-exceptions > strong { color: var(--ink); font-size: 0.82rem; }
.receipt-review-exceptions > a { justify-self: start; margin-top: 4px; color: var(--green-2); font-weight: 850; text-decoration: none; }
.receipt-review-exceptions > a:hover { text-decoration: underline; }
.approve-button, .reject-button { min-height: 46px; padding: 0 16px; border-radius: 10px; font-weight: 850; cursor: pointer; }
.approve-button { border: 0; background: var(--green); color: white; }
.reject-button { border: 1px solid #e4b8b3; background: #fff3f1; color: #963b35; }
.import-upload-card { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 28px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.import-upload-copy h2 { margin: 0; }
.import-upload-copy p { color: var(--muted); line-height: 1.55; }
.template-download { display: inline-flex; min-height: 42px; align-items: center; padding: 0 14px; border-radius: 10px; background: var(--mint); color: var(--green-2); font-weight: 850; text-decoration: none; }
.import-upload-form { display: grid; gap: 15px; }
.import-upload-form .confirm-receiving { grid-column: auto; }
.purchase-page-switch { display: flex; justify-content: flex-end; margin: -42px 0 24px; }
.purchase-page-switch a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 15px; border: 1px solid #b8c9c0; border-radius: 11px; background: var(--surface); color: var(--green-2); font-size: 0.82rem; font-weight: 850; text-decoration: none; transition: transform 110ms var(--ease-press), border-color 160ms ease, background-color 160ms ease, box-shadow 220ms var(--ease-fluid); }
.purchase-page-switch a:hover { border-color: #789d8c; background: #f2f7f4; box-shadow: 0 8px 20px rgba(27, 59, 49, 0.08); }
.purchase-page-switch a:active { transform: scale(0.975); }
.purchase-page-switch a:focus-visible { outline: 3px solid rgba(55, 111, 87, 0.2); outline-offset: 2px; }
.purchase-history { scroll-margin-top: 90px; padding-top: 8px; }
.purchase-history-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 20px; }
.purchase-history-heading h2 { margin: 0; font-size: 1.65rem; letter-spacing: -0.025em; }
.purchase-history-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.55; }
.purchase-history-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.purchase-history-summary > div { padding: 16px 18px; background: var(--surface); }
.purchase-history-summary span, .purchase-history-summary strong { display: block; }
.purchase-history-summary span { margin-bottom: 6px; color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.purchase-history-summary strong { font-size: 1.25rem; }
.purchase-history-list { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.purchase-history-row { display: grid; grid-template-columns: 105px minmax(220px, 1fr) 95px minmax(220px, 0.85fr) 86px; gap: 18px; align-items: center; min-height: 84px; padding: 13px 17px; border-bottom: 1px solid #e8eeea; }
.purchase-history-row:last-child { border-bottom: 0; }
.purchase-history-row--head { min-height: 44px; background: #f6f8f7; color: var(--muted); font-size: 0.73rem; font-weight: 850; }
.purchase-history-batch, .purchase-history-source, .purchase-history-quantity, .purchase-history-time { min-width: 0; }
.purchase-history-batch { display: flex; align-items: center; gap: 8px; }
.purchase-history-batch > strong { font-size: 0.95rem; }
.purchase-history-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 0.69rem; font-weight: 850; white-space: nowrap; }
.purchase-history-status--preview { background: #fff0c7; color: #795813; }
.purchase-history-status--counting { background: #eaf0fb; color: #355c91; }
.purchase-history-status--receipt_review { background: #fff0c7; color: #795813; }
.purchase-history-status--confirmed { background: #e4f1ea; color: var(--green-2); }
.purchase-history-source strong, .purchase-history-source small, .purchase-history-quantity strong, .purchase-history-quantity small, .purchase-history-time span, .purchase-history-time strong, .purchase-history-time small { display: block; }
.purchase-history-source strong { overflow-wrap: anywhere; font-size: 0.86rem; line-height: 1.4; }
.purchase-history-source small, .purchase-history-quantity small, .purchase-history-time span, .purchase-history-time small { margin-top: 4px; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.purchase-history-quantity strong { font-size: 0.88rem; }
.purchase-history-time strong { margin-top: 5px; color: var(--green-2); font-size: 0.77rem; }
.purchase-history-time .purchase-history-not-stocked { color: #8a6415; }
.purchase-history-detail { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 11px; border: 1px solid #b8c9c0; border-radius: 10px; color: var(--green-2); font-size: 0.76rem; font-weight: 850; text-decoration: none; transition: transform 110ms var(--ease-press), background-color 160ms ease, border-color 160ms ease; }
.purchase-history-detail:hover { border-color: #789d8c; background: var(--mint); }
.purchase-history-detail:active { transform: scale(0.975); }
.purchase-history-empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.purchase-history-page-number { color: var(--muted); font-size: 0.78rem; font-weight: 750; }
.import-preview { margin-top: 36px; }
.import-summary { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 1px; overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.import-summary > div { min-width: 0; padding: 16px; background: var(--surface); }
.import-summary span, .import-summary strong { display: block; }
.import-summary span { margin-bottom: 6px; color: var(--muted); font-size: 0.75rem; }
.import-summary strong { overflow-wrap: anywhere; }
.duplicate-warning { margin-bottom: 14px; padding: 15px 17px; border: 1px solid #e7cc75; border-radius: 13px; background: #fff8df; color: #705c18; }
.duplicate-warning p { margin: 6px 0 0; }
.purchase-blocking-lines { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.purchase-blocking-lines span { padding: 6px 9px; border-radius: 8px; background: rgba(112, 92, 24, 0.08); font-size: 0.75rem; font-weight: 750; }
.purchase-size-audit { margin-bottom: 18px; padding: 22px; border: 1px solid #cbded4; border-radius: 18px; background: #f8fbf9; }
.purchase-size-audit__heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.purchase-size-audit__heading .eyebrow { margin: 0 0 7px; }
.purchase-size-audit__heading h3 { margin: 0; font-size: 1.25rem; letter-spacing: -0.015em; }
.purchase-size-audit__heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 0.8rem; }
.purchase-size-audit__heading > span { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--surface); color: var(--green-2); font-size: 0.76rem; font-weight: 850; }
.purchase-size-audit__status { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 11px; background: #e7f2eb; color: var(--green-2); font-size: 0.8rem; }
.purchase-size-audit__status > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green-2); color: white; font-size: 0.7rem; font-weight: 900; }
.purchase-conversion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.purchase-conversion-pair { display: grid; grid-template-columns: minmax(48px, auto) 22px minmax(72px, 1fr) auto; gap: 7px; align-items: center; min-height: 44px; padding: 8px 11px; border: 1px solid #dde8e2; border-radius: 11px; background: var(--surface); }
.purchase-conversion-pair > span { color: var(--muted); font-size: 0.82rem; }
.purchase-conversion-pair > b { color: #8aa398; font-size: 0.78rem; text-align: center; }
.purchase-conversion-pair > strong { color: var(--ink); font-size: 0.86rem; }
.purchase-conversion-pair > small { color: var(--muted); font-size: 0.7rem; white-space: nowrap; }
.purchase-detail-disclosure { overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.purchase-detail-disclosure > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; min-height: 72px; padding: 14px 18px; cursor: pointer; list-style: none; }
.purchase-detail-disclosure > summary::-webkit-details-marker { display: none; }
.purchase-detail-disclosure > summary strong,
.purchase-detail-disclosure > summary small { display: block; }
.purchase-detail-disclosure > summary small { margin-top: 4px; color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.purchase-detail-disclosure > summary > span { color: var(--muted); font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.purchase-detail-disclosure > summary::after { min-width: 40px; color: var(--green-2); content: "查看"; font-size: 0.78rem; font-weight: 850; text-align: right; }
.purchase-detail-disclosure[open] > summary { border-bottom: 1px solid var(--line); background: #f8faf8; }
.purchase-detail-disclosure[open] > summary::after { content: "收起"; }
.purchase-detail-disclosure .import-table { border: 0; border-radius: 0; }
.spot-batch-resolution-notice { display: grid; grid-template-columns: 1fr auto; gap: 12px 18px; align-items: center; }
.spot-batch-resolution-button { white-space: nowrap; }
.import-table { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.import-row { display: grid; grid-template-columns: 76px minmax(140px, 1fr) 100px 90px 120px; gap: 12px; align-items: center; min-height: 52px; padding: 8px 18px; border-bottom: 1px solid #edf1ee; }
.import-row:last-child { border-bottom: 0; }
.import-row--head { min-height: 42px; background: #f5f8f5; color: var(--muted); font-size: 0.75rem; font-weight: 850; }
.match-pill { justify-self: start; padding: 6px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 850; white-space: nowrap; }
.match-pill--existing_sku { background: var(--mint); color: var(--green-2); }
.match-pill--new_size { background: #e7edf7; color: #38577f; }
.match-pill--new_product { background: var(--amber); color: #705c18; }
.match-pill--matched { background: var(--mint); color: var(--green-2); }
.match-pill--unknown_product, .match-pill--unknown_size { background: #fbe6e3; color: #963b35; }
.match-pill--duplicate_order { background: #edf0ee; color: var(--muted); }
.match-pill--duplicate_detail { background: #edf0ee; color: var(--muted); }
.match-pill--changed_detail { background: #fff1c7; color: #705c18; }
.import-confirm, .import-confirmed { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.import-confirm { display: grid; grid-template-columns: 1fr auto; gap: 12px 18px; align-items: center; }
.import-confirm p { margin: 0; color: var(--muted); }
.import-confirm .approve-button:disabled { cursor: not-allowed; background: #9ba8a2; }
.duplicate-confirm { grid-column: 1 / -1; padding: 11px 13px; border-radius: 10px; background: #fff8df; color: #705c18; font-weight: 750; }
.import-confirmed p { margin: 6px 0 0; color: var(--muted); }

.spot-sale-shell { width: min(1240px, calc(100% - 32px)); }
.spot-help { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 16px 0 12px; padding: 13px 15px; border-radius: 12px; background: var(--mint); color: var(--green-2); }
.spot-order-list { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.spot-order-row { display: grid; grid-template-columns: minmax(145px, 0.9fr) minmax(240px, 1.8fr) minmax(105px, 0.65fr) minmax(90px, 0.6fr) minmax(250px, 1.6fr); gap: 14px; align-items: center; min-height: 74px; padding: 10px 16px; border-bottom: 1px solid #edf1ee; }
.spot-order-row:last-child { border-bottom: 0; }
.spot-order-row--head { min-height: 42px; background: #f5f8f5; color: var(--muted); font-size: 0.75rem; font-weight: 850; }
.spot-order-row--error { background: #fff8f7; }
.spot-order-row--shortage { background: #fff9e8; }
.spot-order-row--offline { background: #f7f8f7; }
.spot-order-row--changed { background: #fffbeb; }
.spot-order-row--muted { background: #fafbfa; color: var(--muted); }
.spot-order-id strong, .spot-order-id small, .spot-product-copy strong, .spot-product-copy small, .spot-sku-copy strong, .spot-sku-copy span, .spot-sku-copy small { display: block; }
.spot-order-id strong { font-size: 0.78rem; overflow-wrap: anywhere; }
.spot-order-id small, .spot-product-copy small, .spot-sku-copy small { margin-top: 4px; color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.spot-product-copy strong { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 0.82rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.spot-sku-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 8px; }
.spot-sku-copy strong { font-size: 1rem; }
.spot-sku-copy span { color: var(--green-2); font-weight: 850; }
.spot-sku-copy small { flex-basis: 100%; }
.spot-match-state { display: grid; justify-items: start; gap: 5px; }
.spot-match-state > small,
.spot-match-state > strong {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.5;
}
.spot-match-state > small { color: #80671d; }
.spot-match-state > strong { color: var(--ink); }
.spot-preview-note { margin-bottom: 12px; padding: 13px 16px; border-radius: 12px; }
.spot-preview-note p { margin: 5px 0 0; }
.spot-preview-note--shortage { border: 1px solid #ead18b; background: #fff9e8; color: #705c18; }
.spot-preview-note--offline { border: 1px solid var(--line); background: #f7f8f7; color: var(--muted); }
.spot-line-form { display: grid; grid-template-columns: minmax(112px, 1fr) minmax(90px, 0.8fr) auto; gap: 7px; align-items: center; }
.spot-line-form select { width: 100%; min-height: 38px; padding: 6px 28px 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.spot-size-resolve-form { display: grid; gap: 5px; }
.spot-size-resolve-form > small { grid-column: 1 / -1; color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.spot-resolve-field { display: grid; gap: 4px; }
.spot-resolve-field label { color: var(--muted); font-size: 0.69rem; font-weight: 800; }
.spot-resolve-field select,
.spot-resolve-field input { width: 100%; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.spot-resolve-field select { padding-right: 28px; }
.line-save-button { min-height: 38px; padding: 0 11px; border: 1px solid var(--green-2); border-radius: 9px; background: #fff; color: var(--green-2); font-weight: 850; cursor: pointer; }
.spot-line-form select,
.spot-resolve-field select,
.spot-resolve-field input,
.spot-line-form .line-save-button {
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.25;
}
.line-save-button:hover { background: var(--mint); }

.consignment-shell { width: min(1320px, calc(100% - 32px)); }
.consignment-list { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.consignment-row { display: grid; grid-template-columns: minmax(150px, 0.85fr) minmax(220px, 1.45fr) minmax(145px, 0.8fr) 68px minmax(135px, 0.8fr) minmax(205px, 1.2fr); gap: 14px; align-items: center; min-height: 74px; padding: 10px 16px; border-bottom: 1px solid #edf1ee; }
.consignment-row:last-child { border-bottom: 0; }
.consignment-row--head { min-height: 42px; background: #f5f8f5; color: var(--muted); font-size: 0.75rem; font-weight: 850; }
.consignment-row--error { background: #fff8f7; }
.consignment-row--shortage { background: #fff9e8; }
.consignment-row--offline { background: #f7f8f7; }
.consignment-row--changed { background: #fffbeb; }
.consignment-row--muted { background: #fafbfa; color: var(--muted); }
.consignment-id strong, .consignment-id small { display: block; }
.consignment-id strong { font-size: 0.78rem; overflow-wrap: anywhere; }
.consignment-id small { margin-top: 4px; color: var(--muted); font-size: 0.72rem; }
.consignment-logistics { overflow-wrap: anywhere; font-size: 0.78rem; }

.pending-scan-shell { width: min(940px, calc(100% - 32px)); }
.pending-scan-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr); gap: 36px; align-items: end; margin-bottom: 24px; }
.pending-scan-intro > div { min-width: 0; }
.pending-scan-intro h1 { margin-bottom: 0; }
.pending-scan-intro > p:last-child { margin: 0 0 3px; color: var(--muted); font-size: 0.84rem; line-height: 1.65; }
.scan-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.scanner-card, .scan-list-card { border: 1px solid rgba(23, 63, 53, 0.12); border-radius: 20px; background: var(--surface); }
.scanner-card { padding: 25px 26px 20px; }
.scanner-card h2, .scan-list-card h2 { margin: 0; }
.scanner-card__heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.scanner-card__heading .eyebrow { margin-bottom: 5px; }
.scanner-card__heading h2 { font-size: 1.28rem; line-height: 1.2; letter-spacing: -0.025em; }
.scan-feedback { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #e6f3eb; color: #26624f; font-size: 0.72rem; font-weight: 800; animation: scan-feedback-in 260ms var(--ease-fluid) both; }
.scan-feedback::before { content: '✓'; }
.scan-feedback.is-hiding { opacity: 0; transform: translateY(-3px); transition: opacity 180ms ease, transform 180ms ease; }
.scanner-form { margin-top: 17px; }
.scan-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 6px; padding: 5px; border: 1px solid #cbd8d1; border-radius: 15px; background: #f3f6f4; transition: border-color 160ms ease, box-shadow 180ms ease, background-color 160ms ease; }
.scan-input-row:focus-within { border-color: var(--green-2); background: #fff; box-shadow: 0 0 0 4px rgba(40, 102, 87, 0.11); }
.scanner-form input { width: 100%; min-height: 50px; box-sizing: border-box; padding: 9px 13px; border: 0; border-radius: 11px; background: #fff; color: var(--ink); font-size: 1rem; box-shadow: none; }
.scan-input-row input:focus { outline: none; box-shadow: none; }
.scanner-form .confirm-receiving { grid-column: auto; min-height: 50px; padding: 0 16px; border-radius: 11px; box-shadow: none; }
.scanner-form.is-submitting .confirm-receiving { opacity: 0.78; }
.scanner-note { margin: 9px 6px 0; color: var(--muted); font-size: 0.74rem; line-height: 1.5; }
.manual-scan-entry { margin-top: 15px; padding-top: 14px; border-top: 1px solid rgba(23, 63, 53, 0.09); }
.manual-scan-entry summary { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 7px 9px; border-radius: 9px; color: var(--green-2); font-size: 0.78rem; font-weight: 780; cursor: pointer; list-style: none; transition: color 150ms ease, background-color 150ms ease, transform 100ms var(--ease-press); }
.manual-scan-entry summary::-webkit-details-marker { display: none; }
.manual-scan-entry summary::before { content: '›'; font-size: 1rem; line-height: 1; transform: rotate(0); transition: transform 180ms var(--ease-fluid); }
.manual-scan-entry[open] summary::before { transform: rotate(90deg); }
.manual-scan-entry summary:hover { background: #f1f6f3; }
.manual-scan-entry summary:active { transform: scale(0.98); }
.manual-scan-entry[open] summary { margin-bottom: 11px; background: #f1f6f3; }
.manual-scan-form { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: #f7f9f7; animation: manual-entry-in 240ms var(--ease-fluid) both; transform-origin: top left; }
.manual-scan-fields { display: grid; grid-template-columns: minmax(230px, 1.18fr) minmax(150px, 0.92fr) 72px; gap: 10px; }
.manual-scan-fields > div { min-width: 0; }
.manual-scan-fields label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 0.7rem; font-weight: 780; }
.manual-scan-fields input { width: 100%; min-height: 42px; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d3ddd7; border-radius: 9px; background: #fff; color: var(--ink); font-size: 0.84rem; }
.manual-scan-fields input:focus { border-color: var(--green-2); outline: none; box-shadow: 0 0 0 3px rgba(32, 102, 82, 0.10); }
.manual-scan-submit { width: 100%; min-height: 42px; background: transparent; }
.scan-list-card { overflow: hidden; padding: 0; }
.scan-list-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 0; padding: 19px 22px 17px; border-bottom: 1px solid rgba(23, 63, 53, 0.09); }
.scan-list-heading .eyebrow { margin-bottom: 4px; }
.scan-list-heading h2 { font-size: 1.2rem; line-height: 1.2; letter-spacing: -0.02em; }
.scan-refresh-button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 9px; border-radius: 9px; color: var(--muted); font-size: 0.75rem; font-weight: 750; text-decoration: none; transition: color 150ms ease, background-color 150ms ease, transform 100ms var(--ease-press); }
.scan-refresh-button span { font-size: 1rem; line-height: 1; }
.scan-refresh-button:hover { background: #f0f5f2; color: var(--green-2); }
.scan-refresh-button:active { transform: scale(0.96); }
.scan-line-list { overflow: hidden; border: 0; border-radius: 0; }
.scan-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 15px; align-items: center; min-height: 64px; padding: 9px 22px; border-bottom: 1px solid #edf1ee; transition: background-color 180ms ease; }
.scan-line:last-child { border-bottom: 0; }
.scan-line:hover { background: #fafcfb; }
.scan-line--recent { animation: scan-line-arrive 560ms var(--ease-fluid) both; }
.scan-line code, .scan-line small { display: block; }
.scan-line code { overflow-wrap: anywhere; color: var(--ink); font-size: 0.88rem; }
.scan-line small { margin-top: 4px; color: var(--muted); font-size: 0.68rem; }
.scan-line > strong { white-space: nowrap; font-size: 0.86rem; }
.scan-decrease-button { min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: #f0f4f1; color: #687a73; font-size: 0.7rem; font-weight: 720; cursor: pointer; transition: color 150ms ease, background-color 150ms ease, transform 90ms var(--ease-press); }
.scan-decrease-button:hover { background: #e5eee9; color: var(--green-2); }
.scan-decrease-button:active { transform: scale(0.94); }
.manual-sku { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; }
.manual-sku strong { font-size: 0.88rem; }
.manual-sku span { color: var(--green-2); font-size: 0.84rem; font-weight: 800; }
.manual-sku em { padding: 3px 7px; border-radius: 999px; background: var(--mint); color: var(--green-2); font-size: 0.63rem; font-style: normal; font-weight: 800; }
.scan-list-card .empty-state { margin: 20px 22px 22px; }
.scan-pagination { display: grid; grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr); gap: 14px; align-items: center; padding: 15px 22px; border-top: 1px solid rgba(23, 63, 53, 0.09); }
.scan-pagination__step { display: inline-flex; align-items: center; justify-content: center; justify-self: start; min-height: 34px; padding: 0 11px; border-radius: 9px; color: var(--green-2); font-size: 0.75rem; font-weight: 760; text-decoration: none; transition: color 150ms ease, background-color 150ms ease, transform 90ms var(--ease-press); }
.scan-pagination__step--next { justify-self: end; }
.scan-pagination__step:not(.is-disabled):hover { background: #edf4f0; }
.scan-pagination__step:not(.is-disabled):active { transform: scale(0.96); }
.scan-pagination__step.is-disabled { color: #aeb9b3; cursor: default; }
.scan-pagination__pages { display: flex; gap: 5px; align-items: center; justify-content: center; }
.scan-pagination__number { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #617169; font-size: 0.75rem; font-weight: 760; text-decoration: none; transition: color 150ms ease, background-color 150ms ease, transform 90ms var(--ease-press); }
.scan-pagination__number:not(.is-current):hover { background: #f0f5f2; color: var(--green-2); }
.scan-pagination__number:not(.is-current):active { transform: scale(0.94); }
.scan-pagination__number.is-current { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(23, 63, 53, 0.14); }
.scan-pagination__ellipsis { display: inline-grid; place-items: center; width: 24px; color: #9aa7a0; font-size: 0.74rem; }
.scan-pagination__summary { display: none; color: var(--muted); font-size: 0.74rem; font-weight: 750; text-align: center; white-space: nowrap; }
.new-scan-batch { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin: 0; padding: 17px 22px; border-top: 1px solid var(--line); }
.new-scan-batch p { margin: 0; color: var(--muted); font-size: 0.76rem; }

@keyframes scan-feedback-in {
  from { opacity: 0; transform: translateY(5px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes manual-entry-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scan-line-arrive {
  0% { background: #dff2e7; transform: translateY(-4px); }
  45% { background: #edf7f1; transform: translateY(0); }
  100% { background: transparent; }
}

.movement-shell { width: min(1180px, calc(100% - 32px)); }
.movement-page-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr); gap: 42px; align-items: end; margin-bottom: 24px; }
.movement-page-intro > div { min-width: 0; }
.movement-page-intro h1 { margin-bottom: 0; }
.movement-page-intro > p:last-child { margin: 0 0 3px; color: var(--muted); font-size: 0.84rem; line-height: 1.65; }
.movement-filter-card { padding: 8px; border: 1px solid rgba(23, 63, 53, 0.13); border-radius: 16px; background: rgba(255, 255, 255, 0.86); transition: border-color 160ms ease, box-shadow 180ms ease; }
.movement-filter-card:focus-within { border-color: rgba(40, 102, 87, 0.34); box-shadow: 0 8px 24px rgba(23, 63, 53, 0.08); }
.movement-filter-form { display: grid; grid-template-columns: minmax(300px, 1.35fr) minmax(180px, 0.65fr) auto auto; gap: 7px; align-items: center; }
.movement-filter-form input, .movement-filter-form select { min-width: 0; min-height: 48px; padding: 9px 13px; border: 0; border-radius: 11px; background: #f5f7f5; color: var(--ink); font-family: inherit; font-size: 0.86rem; }
.movement-filter-form input:hover, .movement-filter-form select:hover { background: #f0f4f1; }
.movement-filter-form button { min-height: 48px; padding: 0 18px; border: 0; border-radius: 11px; background: var(--green); color: #fff; font-size: 0.83rem; font-weight: 820; cursor: pointer; }
.movement-filter-form a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 9px; border-radius: 9px; color: var(--muted); font-size: 0.75rem; font-weight: 760; text-decoration: none; transition: color 150ms ease, background-color 150ms ease, transform 90ms var(--ease-press); }
.movement-filter-form a:hover { background: #f0f4f1; color: var(--green-2); }
.movement-filter-form a:active { transform: scale(0.96); }
.movement-result-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin: 24px 4px 11px; }
.movement-result-heading strong { display: inline-flex; gap: 5px; align-items: baseline; font-size: 0.82rem; font-weight: 760; }
.movement-result-heading strong span { color: var(--ink); font-size: 1.12rem; font-weight: 850; }
.movement-result-heading > span { color: var(--muted); font-size: 0.75rem; }
.movement-list { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.movement-row { display: grid; grid-template-columns: minmax(145px, 0.85fr) minmax(130px, 0.7fr) minmax(160px, 0.9fr) minmax(170px, 1fr) minmax(200px, 1.35fr); gap: 14px; align-items: center; min-height: 68px; padding: 9px 16px; border-bottom: 1px solid #edf1ee; }
.movement-row:last-child { border-bottom: 0; }
.movement-row--head { min-height: 42px; background: #f5f8f5; color: var(--muted); font-size: 0.75rem; font-weight: 850; }
.movement-time strong, .movement-time span, .movement-sku strong, .movement-sku span, .movement-source strong, .movement-source span { display: block; }
.movement-time strong { font-size: 0.78rem; }
.movement-time span, .movement-sku span, .movement-source span { margin-top: 4px; color: var(--muted); font-size: 0.72rem; overflow-wrap: anywhere; }
.movement-change { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: center; }
.movement-delta { padding: 5px 8px; border-radius: 999px; font-size: 0.78rem; }
.movement-delta--positive { background: var(--mint); color: var(--green-2); }
.movement-delta--negative { background: #fbe6e3; color: #963b35; }
.movement-reason { font-size: 0.82rem; line-height: 1.45; }
.movement-operation-detail { scroll-margin-top: 90px; margin: 24px 0 34px; padding: 22px; border: 1px solid #bfd2c8; border-radius: 20px; background: #f8fbf9; box-shadow: var(--shadow-soft); }
.movement-operation-detail__heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 17px; }
.movement-operation-detail__heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.02em; }
.movement-operation-detail__heading p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 0.8rem; }
.movement-operation-detail__heading > a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 13px; border: 1px solid #b8c9c0; border-radius: 10px; background: var(--surface); color: var(--green-2); font-size: 0.78rem; font-weight: 850; text-decoration: none; transition: transform 110ms var(--ease-press), background-color 160ms ease, border-color 160ms ease; }
.movement-operation-detail__heading > a:hover { border-color: #789d8c; background: var(--mint); }
.movement-operation-detail__heading > a:active { transform: scale(0.975); }
.movement-operation-list { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.movement-operation-row { display: grid; grid-template-columns: minmax(155px, 0.85fr) minmax(220px, 1.25fr) minmax(120px, 0.65fr) minmax(120px, 0.65fr) minmax(130px, 0.65fr); gap: 18px; align-items: center; min-height: 78px; padding: 12px 17px; border-bottom: 1px solid #e8eeea; }
.movement-operation-row:last-child { border-bottom: 0; }
.movement-operation-row--head { min-height: 43px; background: #f5f8f5; color: var(--muted); font-size: 0.74rem; font-weight: 850; }
.movement-operation-time strong, .movement-operation-time span, .movement-operation-source strong, .movement-operation-source span, .movement-operation-source small, .movement-operation-counts strong, .movement-operation-counts span, .movement-operation-action > span { display: block; }
.movement-operation-time strong { font-size: 0.79rem; }
.movement-operation-time span, .movement-operation-source span, .movement-operation-counts span, .movement-operation-action > span { margin-top: 4px; color: var(--muted); font-size: 0.72rem; overflow-wrap: anywhere; }
.movement-operation-source { min-width: 0; }
.movement-operation-source strong { font-size: 0.88rem; line-height: 1.4; }
.movement-operation-match { margin-top: 5px; color: var(--green-2); font-size: 0.72rem; font-weight: 800; }
.movement-operation-totals { display: flex; flex-wrap: wrap; gap: 7px; }
.movement-total { padding: 5px 8px; border-radius: 999px; font-size: 0.78rem; }
.movement-total--positive { background: var(--mint); color: var(--green-2); }
.movement-total--negative { background: #fbe6e3; color: #963b35; }
.movement-operation-counts strong { font-size: 0.83rem; }
.movement-operation-action { text-align: right; }
.movement-operation-action a { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; margin-top: 6px; padding: 0 11px; border: 1px solid #b8c9c0; border-radius: 10px; color: var(--green-2); font-size: 0.76rem; font-weight: 850; text-decoration: none; transition: transform 110ms var(--ease-press), background-color 160ms ease, border-color 160ms ease; }
.movement-operation-action a:hover { border-color: #789d8c; background: var(--mint); }
.movement-operation-action a:active { transform: scale(0.975); }
.movement-page-number { color: var(--muted); font-size: 0.78rem; font-weight: 750; }

.export-shell { width: min(960px, calc(100% - 32px)); }
.export-card { display: grid; grid-template-columns: minmax(320px, 1.2fr) minmax(300px, 0.8fr); gap: 32px; align-items: center; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.export-copy h2 { margin: 0; }
.export-copy > p { color: var(--muted); line-height: 1.55; }
.export-copy ul { margin: 18px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 0.84rem; line-height: 1.75; }
.export-scope { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.export-scope span { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 11px; border-radius: 10px; background: #eef4f0; color: var(--muted); font-size: 0.75rem; }
.export-scope strong { color: var(--ink); font-size: 1rem; }
.export-contents { display: block; margin-top: 13px; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }
.export-form { display: grid; gap: 16px; padding: 20px; border-radius: 16px; background: #f5f8f5; }
.export-checkbox { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.export-checkbox input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); }
.export-checkbox span, .export-checkbox strong, .export-checkbox small { display: block; }
.export-checkbox small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.export-form .confirm-receiving { grid-column: auto; }
.backup-message-stack { margin-top: 22px; margin-bottom: 0; }
.backup-overview { display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(300px, 0.85fr); gap: 28px; align-items: center; margin-top: 24px; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.backup-overview h2 { margin: 0; }
.backup-overview__copy > p:last-of-type { color: var(--muted); }
.backup-overview__copy ul { margin: 16px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 0.84rem; line-height: 1.75; }
.backup-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.backup-facts span { padding: 7px 9px; border-radius: 9px; background: #edf4f0; color: var(--green-2); font-size: 0.72rem; font-weight: 800; }
.backup-guide { margin-top: 17px; }
.backup-guide summary { color: var(--green-2); font-size: 0.78rem; font-weight: 850; cursor: pointer; }
.backup-guide p { margin: 9px 0 0; padding: 11px 13px; border-radius: 10px; background: #f5f7f5; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }
.backup-status-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 20px; border-radius: 16px; background: #f5f8f5; }
.backup-status-card strong, .backup-status-card small { display: block; }
.backup-status-card small { margin-top: 6px; color: var(--muted); line-height: 1.45; }
.backup-status-card form { grid-column: 1 / -1; }
.backup-manual-button { width: 100%; min-height: 44px; border: 1px solid #9eb7ab; border-radius: 10px; background: var(--surface); color: var(--green-2); font-size: 0.82rem; font-weight: 850; cursor: pointer; transition: transform 100ms var(--ease-press), border-color 160ms ease, background-color 160ms ease, box-shadow 200ms var(--ease-fluid); }
.backup-manual-button:hover { border-color: #6f9684; background: #edf5f1; box-shadow: 0 7px 16px rgba(23, 63, 53, 0.08); }
.backup-manual-button:active { transform: scale(0.975); }
.backup-external-note { grid-column: 1 / -1; margin: 1px 0 0; padding-top: 13px; border-top: 1px solid #dfe8e3; color: #75611e; font-size: 0.74rem; line-height: 1.55; }
.backup-status-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 5px rgba(40, 102, 87, 0.12); }
.backup-status-dot--due { background: #c28b21; box-shadow: 0 0 0 5px rgba(194, 139, 33, 0.14); }
.backup-history { overflow: hidden; margin-top: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.backup-history > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; min-height: 82px; padding: 16px 20px; cursor: pointer; list-style: none; }
.backup-history > summary::-webkit-details-marker { display: none; }
.backup-history > summary h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.015em; }
.backup-history > summary .eyebrow { margin-bottom: 5px; }
.backup-history > summary > span { padding: 6px 9px; border-radius: 999px; background: var(--mint); color: var(--green-2); font-size: 0.73rem; font-weight: 850; white-space: nowrap; }
.backup-history > summary::after { min-width: 38px; color: var(--green-2); content: "查看"; font-size: 0.76rem; font-weight: 850; text-align: right; }
.backup-history[open] > summary { border-bottom: 1px solid var(--line); background: #f8faf8; }
.backup-history[open] > summary::after { content: "收起"; }
.backup-history__content { padding: 18px; }
.backup-history__content > p { margin: 0 0 14px; color: var(--muted); font-size: 0.77rem; line-height: 1.55; }
.backup-list { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.backup-row { display: grid; grid-template-columns: 1.2fr 0.7fr 0.5fr 1.4fr; gap: 16px; align-items: center; min-height: 62px; padding: 11px 16px; border-bottom: 1px solid #edf1ee; font-size: 0.82rem; }
.backup-row:last-child { border-bottom: 0; }
.backup-row--head { min-height: 42px; background: #f7f9f8; color: var(--muted); font-size: 0.74rem; font-weight: 850; }
.backup-row strong, .backup-row small { display: block; }
.backup-row small { margin-top: 4px; color: var(--muted); }
.backup-verification { color: var(--green); font-weight: 850; }
.backup-verification--error { color: var(--red); }
.backup-mobile-label { display: none !important; }

@media (max-width: 900px) {
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .manager-grid { grid-template-columns: repeat(2, 1fr); }
  .search-panel { grid-template-columns: 1fr; }
  .lookup-card { grid-template-columns: 1fr; }
  .receiving-form { grid-template-columns: repeat(2, 1fr); }
  .location-multi-field > div { grid-template-columns: repeat(4, minmax(72px, 1fr)); }
  .import-upload-card { grid-template-columns: 1fr; }
  .import-summary { grid-template-columns: repeat(2, 1fr); }
  .purchase-history-row { grid-template-columns: 90px minmax(180px, 1fr) 85px minmax(190px, 0.9fr) 82px; gap: 13px; padding-inline: 14px; }
  .spot-order-list { overflow-x: auto; }
  .spot-order-row { min-width: 980px; }
  .consignment-list { overflow-x: auto; }
  .consignment-row { min-width: 1080px; }
  .scan-workspace { grid-template-columns: 1fr; }
  .movement-filter-card { grid-template-columns: 1fr; }
  .export-card { grid-template-columns: 1fr; }
  .backup-overview { grid-template-columns: 1fr; }
  .backup-list { overflow-x: auto; }
  .backup-row { min-width: 760px; }
  .recheck-assignment-panel { grid-template-columns: 1fr; }
  .recheck-assignment-form { grid-template-columns: 0.8fr 1.4fr; }
  .recheck-assignment-form .confirm-receiving { grid-column: 1 / -1; }
  .recheck-task-card { grid-template-columns: 0.8fr 1.2fr; }
  .recheck-task-action { grid-column: 1 / -1; grid-template-columns: auto auto 1fr; align-items: center; text-align: left; }
  .recheck-task-action a { justify-self: end; min-width: 170px; }
  .movement-list { overflow-x: auto; }
  .movement-row { min-width: 940px; }
  .movement-operation-list { overflow-x: auto; }
  .movement-operation-row { min-width: 940px; }
}

/* Touch devices use the warehouse-focused home page even with a manager login. */
@media (hover: none) and (pointer: coarse) {
  .manager-section { display: none; }
}

@media (min-width: 600px) and (max-width: 900px) {
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .login-shell {
    place-items: start center;
    padding: max(28px, calc(env(safe-area-inset-top) + 16px)) 14px 28px;
  }
  .login-card { padding: 26px 22px 24px; border-radius: 20px; }
  .login-brand { margin-bottom: 19px; }
  .brand-logo--login { width: 42px; height: 42px; }
  .login-brand strong { font-size: 1rem; }
  .login-card h1 { font-size: 1.62rem; }
  .login-intro { font-size: 0.86rem; }
  .login-form { margin-top: 22px; }
  .login-page .field input { font-size: 1rem; }
  .login-page .field input:focus {
    border-color: var(--green-2);
    box-shadow: 0 0 0 2px rgba(40, 102, 87, 0.10);
  }
  .login-help { margin-top: 17px; font-size: 0.82rem; }
  .site-footer--login {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }
  .site-footer--login .site-footer__title { font-size: 0.7rem; }
  .topbar { align-items: flex-start; }
  .topbar .text-button { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 8px; }
  .user-area { gap: 8px; }
  .wordmark { gap: 9px; }
  .wordmark-text strong { font-size: 1rem; }
  .wordmark-text small { font-size: 0.59rem; letter-spacing: 0.04em; }
  .app-shell { width: min(100% - 22px, 1180px); padding-top: 20px; }
  .search-panel { padding: 24px 18px; border-radius: 18px; }
  .search-form { grid-template-columns: 1fr; }
  .product-summary { display: block; padding: 20px 18px; }
  .location-block { margin-top: 18px; text-align: left; }
  .location-list { justify-content: flex-start; }
  .sku-row { grid-template-columns: minmax(0, 1fr) minmax(76px, 34%); gap: 9px; padding: 9px 18px; }
  .inventory-note { padding-inline: 18px; }
  .manager-grid { grid-template-columns: 1fr; }
  .action-card { min-height: 112px; }
  .receiving-shell { width: min(100% - 22px, 980px); }
  .catalog-shell { width: min(100% - 22px, 1080px); }
  .location-shell { width: min(100% - 22px, 980px); }
  .account-shell { width: min(100% - 22px, 1100px); }
  .spot-sale-shell { width: min(100% - 22px, 1240px); }
  .consignment-shell { width: min(100% - 22px, 1320px); }
  .lookup-card { padding: 20px 18px; }
  .receiving-product { display: block; padding: 20px 18px; }
  .receiving-form { grid-template-columns: 1fr; padding: 20px 18px; }
  .operation-panel-heading { grid-template-columns: 1fr; padding: 18px; }
  .operation-impact { justify-self: start; }
  .location-multi-field > div { grid-template-columns: repeat(3, minmax(70px, 1fr)); max-height: 230px; }
  .catalog-card__summary { display: block; padding: 20px 18px; }
  .catalog-card__summary > small { display: block; margin-top: 12px; }
  .catalog-form { padding: 20px 18px; }
  .catalog-fields, .catalog-size-grid { grid-template-columns: 1fr; }
  .catalog-subsection > div:first-child { display: block; }
  .catalog-subsection > div:first-child small { display: block; margin-top: 6px; }
  .catalog-scope-tabs a { flex: 1; padding-inline: 10px; }
  .catalog-location-overview { grid-template-columns: 1fr; gap: 11px; }
  .catalog-location-options > div { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
  .catalog-location-picker summary { align-items: flex-start; }
  .catalog-location-picker summary small { text-align: right; }
  .catalog-pagination { gap: 8px; }
  .catalog-page-numbers { gap: 5px; }
  .catalog-page-link { min-width: 34px; height: 36px; padding-inline: 8px; }
  .catalog-page-link--wide { min-width: 64px; }
  .location-create-card { grid-template-columns: 1fr; padding: 20px 18px; }
  .location-create-form, .location-update-form { grid-template-columns: 1fr; }
  .location-create-form .confirm-receiving { min-width: 0; }
  .location-admin-summary { align-items: flex-start; }
  .location-admin-summary > div { display: block; }
  .location-admin-summary > div span { display: block; margin-top: 4px; }
  .location-save-button { width: 100%; }
  .account-create-form, .account-update-form { grid-template-columns: 1fr; }
  .account-admin-summary { align-items: flex-start; }
  .account-save-button { width: 100%; }
  .receiving-field--wide, .confirm-receiving { grid-column: auto; }
  .stocktake-form { padding: 0 18px 20px; }
  .stocktake-grid { grid-template-columns: 52px 82px minmax(0, 1fr); gap: 9px; }
  .stocktake-grid input[type="number"] { width: 100%; }
  .review-summary { display: block; padding: 20px 18px; }
  .stocktake-workspace { padding: 19px 17px; border-radius: 16px; }
  .stocktake-workspace-heading { align-items: flex-start; }
  .stocktake-workspace-heading .pending-pill { display: none; }
  .stocktake-step-title h2 { font-size: 1.2rem; }
  .recheck-assignment-panel { padding: 16px; }
  .recheck-assignment-form { grid-template-columns: 1fr; }
  .recheck-assignment-form .confirm-receiving { grid-column: auto; }
  .stocktake-quick-search { grid-template-columns: 1fr; padding: 0; border: 0; background: transparent; }
  .stocktake-quick-search input { border: 1px solid var(--line); background: #f7f9f7; }
  .recheck-task-card { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .recheck-task-reason { padding: 14px 0 0; border-top: 1px solid #e5dcc8; border-left: 0; }
  .recheck-task-action { grid-column: auto; grid-template-columns: 1fr; }
  .recheck-task-action a { justify-self: stretch; min-width: 0; }
  .recheck-task-action a { width: 100%; }
  .assigned-recheck-note { padding: 14px 18px; }
  .review-summary .task-status { display: inline-block; margin-top: 12px; }
  .review-row { grid-template-columns: 52px repeat(3, 1fr); gap: 8px; padding: 8px 18px; }
  .review-actions { grid-template-columns: 1fr; padding: 18px; }
  .receipt-review-admin { margin-bottom: 28px; }
  .receipt-review-exceptions { padding: 16px 18px; }
  .import-upload-card { padding: 20px 18px; }
  .purchase-page-switch { justify-content: flex-start; margin: 0 0 20px; }
  .purchase-page-switch a { width: 100%; }
  .purchase-history { padding-top: 0; }
  .purchase-history-heading { display: block; margin-bottom: 16px; }
  .purchase-history-heading h2 { font-size: 1.4rem; }
  .purchase-history-summary { grid-template-columns: repeat(2, 1fr); }
  .purchase-history-summary > div { padding: 13px 11px; text-align: center; }
  .purchase-history-summary strong { font-size: 1.05rem; }
  .purchase-history-list { overflow: visible; border: 0; background: transparent; }
  .purchase-history-row--head { display: none; }
  .purchase-history-row:not(.purchase-history-row--head) { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 12px; min-height: 0; margin-bottom: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .purchase-history-batch { grid-column: 1 / -1; }
  .purchase-history-source { grid-column: 1 / -1; padding-bottom: 12px; border-bottom: 1px solid #edf1ee; }
  .purchase-history-quantity { align-self: start; }
  .purchase-history-time { text-align: right; }
  .purchase-history-detail { grid-column: 1 / -1; width: 100%; min-height: 42px; }
  .purchase-history-page-number { order: -1; width: 100%; text-align: center; }
  .purchase-history .catalog-pagination { flex-wrap: wrap; }
  .import-summary { grid-template-columns: 1fr; }
  .import-table { overflow: visible; border: 0; background: transparent; }
  .import-row--head { display: none; }
  .import-row:not(.import-row--head) { grid-template-columns: 1fr 1fr; width: auto; margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
  .import-row:not(.import-row--head) > :nth-child(1) { display: none; }
  .import-row:not(.import-row--head) > :nth-child(2) { grid-column: 1 / -1; font-size: 1rem; }
  .import-row:not(.import-row--head) > :nth-child(5) { grid-column: 1 / -1; }
  .import-row:not(.import-row--head) > :nth-child(2)::before,
  .import-row:not(.import-row--head) > :nth-child(3)::before,
  .import-row:not(.import-row--head) > :nth-child(4)::before { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.68rem; font-weight: 700; }
  .import-row:not(.import-row--head) > :nth-child(2)::before { content: "货号"; }
  .import-row:not(.import-row--head) > :nth-child(3)::before { content: "尺码"; }
  .import-row:not(.import-row--head) > :nth-child(4)::before { content: "数量"; }
  .purchase-size-audit { padding: 19px 16px; }
  .purchase-size-audit__heading { display: block; }
  .purchase-size-audit__heading > span { display: inline-block; margin-top: 12px; }
  .purchase-conversion-grid { grid-template-columns: 1fr; }
  .purchase-detail-disclosure > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 13px 15px; }
  .purchase-detail-disclosure > summary::after { grid-column: 2; }
  .purchase-detail-disclosure > summary > span { grid-column: 2; grid-row: 1; align-self: start; }
  .import-confirm { grid-template-columns: 1fr; }
  .spot-batch-resolution-notice { grid-template-columns: 1fr; }
  .spot-batch-resolution-button { width: 100%; }
  .spot-order-list { overflow: visible; border: 0; background: transparent; }
  .spot-order-row--head { display: none; }
  .spot-order-row:not(.spot-order-row--head) { grid-template-columns: 1fr; min-width: 0; margin-bottom: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .spot-order-row--error:not(.spot-order-row--head) { background: #fff8f7; }
  .spot-order-row--shortage:not(.spot-order-row--head) { background: #fff9e8; }
  .spot-order-row--offline:not(.spot-order-row--head) { background: #f7f8f7; }
  .spot-order-row--changed:not(.spot-order-row--head) { background: #fffbeb; }
  .spot-line-form { grid-template-columns: 1fr 1fr; }
  .spot-line-form .line-save-button { grid-column: 1 / -1; }
  .spot-size-resolve-form { align-items: stretch; }
  .consignment-list { overflow: visible; border: 0; background: transparent; }
  .consignment-row--head { display: none; }
  .consignment-row:not(.consignment-row--head) { grid-template-columns: 1fr 1fr; min-width: 0; margin-bottom: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .consignment-row--error:not(.consignment-row--head) { background: #fff8f7; }
  .consignment-row--shortage:not(.consignment-row--head) { background: #fff9e8; }
  .consignment-row--offline:not(.consignment-row--head) { background: #f7f8f7; }
  .consignment-row--changed:not(.consignment-row--head) { background: #fffbeb; }
  .consignment-row:not(.consignment-row--head) > :nth-child(1),
  .consignment-row:not(.consignment-row--head) > :nth-child(2),
  .consignment-row:not(.consignment-row--head) > :nth-child(3),
  .consignment-row:not(.consignment-row--head) > :nth-child(6) { grid-column: 1 / -1; }
  .pending-scan-shell { width: min(100% - 22px, 1100px); }
  .scanner-card, .scan-list-card { padding: 20px 17px; }
  .manual-scan-fields { grid-template-columns: minmax(0, 1fr) minmax(88px, 0.72fr); }
  .manual-scan-fields > div:last-child { grid-column: 1 / -1; }
  .scan-line { gap: 9px; padding: 9px 10px; }
  .new-scan-batch { align-items: stretch; flex-direction: column; }
  .movement-shell { width: min(100% - 22px, 1320px); }
  .movement-filter-card { padding: 20px 17px; }
  .movement-filter-form { grid-template-columns: 1fr; }
  .movement-filter-form a { text-align: center; }
  .movement-result-heading { align-items: flex-start; flex-direction: column; }
  .movement-operation-detail { padding: 18px 15px; }
  .movement-operation-detail__heading { display: block; }
  .movement-operation-detail__heading > a { width: 100%; margin-top: 14px; }
  .movement-list { overflow: visible; border: 0; background: transparent; }
  .movement-row--head { display: none; }
  .movement-row:not(.movement-row--head) { grid-template-columns: 1fr 1fr; min-width: 0; margin-bottom: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .movement-row:not(.movement-row--head) > :nth-child(1),
  .movement-row:not(.movement-row--head) > :nth-child(4),
  .movement-row:not(.movement-row--head) > :nth-child(5) { grid-column: 1 / -1; }
  .movement-operation-list { overflow: visible; border: 0; background: transparent; }
  .movement-operation-row--head { display: none; }
  .movement-operation-row:not(.movement-operation-row--head) { grid-template-columns: 1fr 1fr; min-width: 0; margin-bottom: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .movement-operation-source { grid-column: 1 / -1; grid-row: 1; padding-bottom: 12px; border-bottom: 1px solid #edf1ee; }
  .movement-operation-time { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; gap: 12px; }
  .movement-operation-time span { margin-top: 0; }
  .movement-operation-counts { text-align: right; }
  .movement-operation-action { grid-column: 1 / -1; text-align: left; }
  .movement-operation-action > span { display: none; }
  .movement-operation-action a { width: 100%; min-height: 42px; margin-top: 0; }
  .movement-shell .catalog-pagination { flex-wrap: wrap; }
  .movement-page-number { order: -1; width: 100%; text-align: center; }
  .export-shell { width: min(100% - 22px, 960px); }
  .export-card { padding: 20px 17px; }
  .backup-overview { padding: 20px 17px; }
  .backup-history > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 15px 16px; }
  .backup-history > summary::after { grid-column: 2; }
  .backup-history > summary > span { grid-column: 2; grid-row: 1; align-self: start; }
  .backup-history__content { padding: 14px 0 0; }
  .backup-history__content > p { padding: 0 15px; }
  .backup-list { overflow: visible; border: 0; background: transparent; }
  .backup-row { grid-template-columns: 1fr; gap: 9px; min-width: 0; margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .backup-row--head { display: none; }
  .backup-mobile-label { display: block !important; margin: 0 0 2px !important; color: var(--muted); font-size: 0.7rem; font-weight: 750; }
  .export-form { padding: 16px; }
}

@media (max-width: 900px) and (max-height: 560px) {
  .login-shell {
    place-items: start center;
    padding: max(18px, calc(env(safe-area-inset-top) + 10px)) 18px 24px;
  }
  .login-card { padding: 26px 30px 24px; }
  .login-brand { margin-bottom: 16px; }
  .login-page .field input { font-size: 1rem; }
  .login-page .field input:focus { box-shadow: 0 0 0 2px rgba(40, 102, 87, 0.10); }
  .login-help { font-size: 0.82rem; }
}

/* Apple-inspired interaction polish: calm hierarchy, instant feedback, light motion. */
@keyframes surface-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes message-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-shell > *,
.login-card {
  animation: surface-enter 420ms var(--ease-fluid) both;
}

.app-shell > :nth-child(2) { animation-delay: 35ms; }
.app-shell > :nth-child(3) { animation-delay: 70ms; }
.message { animation: message-enter 320ms var(--ease-fluid) both; }

.topbar {
  min-height: 72px;
  border-bottom-color: rgba(23, 63, 53, 0.08);
  background: rgba(251, 252, 249, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75), 0 6px 24px rgba(23, 50, 43, 0.035);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.wordmark,
.wordmark .brand-logo,
.text-button,
.clear-search,
.template-download,
.catalog-scope-tabs a,
.catalog-page-link,
.recheck-assignment-details summary {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
    box-shadow 220ms var(--ease-fluid), transform 120ms var(--ease-press), opacity 160ms ease;
}

.wordmark:hover .brand-logo { transform: translateY(-1px) scale(1.025); }
.wordmark:active .brand-logo { transform: scale(0.96); transition-duration: 80ms; }
.wordmark-text strong { letter-spacing: 0.025em; }

.app-shell { padding-top: 42px; padding-bottom: 78px; }
.page-intro { margin-bottom: 28px; }
.page-intro h1,
.search-panel h1,
.section-heading h2,
.login-card h1 {
  line-height: 1.12;
  text-wrap: balance;
}
.page-intro > p:last-child { line-height: 1.75; }
.section-heading { margin-bottom: 20px; }
.manager-section { margin-top: 52px; padding-top: 40px; border-top-color: rgba(23, 63, 53, 0.10); }

.site-footer {
  padding-top: 34px;
  border-top-color: rgba(23, 63, 53, 0.065);
  background: rgba(248, 250, 247, 0.56);
}

.search-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: 22px;
  margin-bottom: 48px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 24px 60px rgba(19, 54, 45, 0.16);
}

.search-panel::after {
  position: absolute;
  z-index: -1;
  top: -105%;
  left: 50%;
  width: 78%;
  height: 260%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 233, 177, 0.15), transparent 67%);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.search-form {
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 12px 28px rgba(7, 31, 25, 0.14);
  transition: transform 180ms var(--ease-fluid), box-shadow 180ms ease, background-color 180ms ease;
}
.search-form:focus-within {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(220, 233, 177, 0.17), 0 16px 34px rgba(7, 31, 25, 0.17);
  transform: translateY(-1px);
}
.search-form input {
  min-height: 56px;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(23, 50, 43, 0.035);
}
.search-form button { min-width: 92px; }

/* Purchase receiving count */
.receiving-workflow-shell,
.purchase-receipt-shell { width: min(1060px, calc(100% - 40px)); }
.receiving-workflow-intro,
.purchase-receipt-intro {
  min-height: 76px;
  margin-bottom: 18px;
}
.receiving-workflow-intro .eyebrow {
  margin-bottom: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.receiving-workflow-intro h1 {
  font-size: clamp(2rem, 3.2vw, 2.45rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.receipt-page-tools {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 26px;
}
.receiving-workflow-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
  margin-bottom: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef3f0;
}
.receiving-workflow-switch a,
.receiving-workflow-switch span {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.receiving-workflow-switch span[aria-current="page"] {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(19, 54, 45, 0.08);
}
.receiving-workflow-switch a:active { transform: scale(0.97); }
.receipt-section-heading { margin-bottom: 18px; }
.receipt-section-heading > div { display: flex; gap: 9px; align-items: center; }
.purchase-receipt-shell .receipt-section-heading h2 { font-size: 1.16rem; font-weight: 650; letter-spacing: -0.01em; }
.receipt-section-heading span { padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-2); font-size: 0.7rem; font-weight: 600; }
.receipt-batch-list { display: grid; gap: 12px; }
.receipt-batch-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(19, 54, 45, 0.055);
  text-decoration: none;
  transition: transform 160ms var(--ease-fluid), border-color 160ms ease, box-shadow 160ms ease;
}
.receipt-batch-card:hover { border-color: #a8c3b7; box-shadow: 0 12px 28px rgba(19, 54, 45, 0.09); transform: translateY(-1px); }
.receipt-batch-card:active { transform: scale(0.985); }
.receipt-batch-card__number {
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 650;
}
.receipt-batch-card__main { display: grid; gap: 5px; min-width: 0; }
.receipt-batch-card__main strong { overflow: hidden; font-size: 0.96rem; font-weight: 650; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.receipt-batch-card__main small { color: var(--muted); font-size: 0.78rem; }
.receipt-batch-card__progress { display: grid; justify-items: end; gap: 2px; }
.receipt-batch-card__progress strong { color: var(--green); font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.receipt-batch-card__progress small { color: var(--muted); font-size: 0.7rem; }
.receipt-batch-card__arrow { color: #83918b; font-size: 1.65rem; font-weight: 400; }
.receipt-empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 13px;
  min-height: 180px;
  padding: 34px 24px;
  border: 1px dashed #cbd8d1;
  border-radius: 18px;
  background: rgba(249, 251, 249, 0.82);
  text-align: center;
}
.receipt-empty-state::before {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-2);
  content: "✓";
  font-size: 0.95rem;
  font-weight: 700;
}
.receipt-empty-state strong {
  color: #30443d;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}
.receipt-history { margin-top: 28px; border-top: 1px solid var(--line); }
.receipt-history > summary {
  display: flex;
  justify-content: space-between;
  padding: 20px 2px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.receipt-history > summary span { color: var(--muted); font-size: 0.76rem; }
.receipt-history-list { display: grid; gap: 8px; padding-bottom: 10px; }
.receipt-history-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 13px;
  background: #f3f6f4;
  text-decoration: none;
}
.receipt-history-list a > span:first-child { display: grid; gap: 3px; min-width: 0; }
.receipt-history-list strong { overflow: hidden; font-size: 0.84rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.receipt-history-list small,
.receipt-history-list a > span:last-child { color: var(--muted); font-size: 0.72rem; }
.receipt-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin: 0;
  padding: 8px 2px;
  color: var(--green-2);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.receipt-back-link::before { content: "‹"; margin-right: 5px; font-size: 1.1rem; font-weight: 500; }
.receipt-primary-workspace {
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(23, 63, 53, 0.13);
  border-radius: 24px;
  background: white;
  box-shadow: 0 14px 38px rgba(19, 54, 45, 0.07);
}
.receipt-batch-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin: 0;
  padding: 23px 25px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.receipt-batch-hero > div { display: grid; gap: 6px; min-width: 0; }
.receipt-batch-hero > div > span { color: var(--green-2); font-size: 0.72rem; font-weight: 600; }
.receipt-batch-hero h2 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
.receipt-batch-hero p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.receipt-batch-status { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #fff1c6; color: #765e13; font-size: 0.7rem; font-weight: 600; }
.receipt-batch-status--confirmed { background: var(--green-soft); color: var(--green-2); }
.receipt-scanner-card {
  margin: 0 12px 12px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #12382f, #1d5243);
  color: white;
  box-shadow: 0 18px 42px rgba(19, 54, 45, 0.16);
}
.receipt-scanner-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 16px; }
.receipt-scanner-heading > div { display: grid; gap: 3px; }
.receipt-scanner-heading span { color: var(--lime); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; }
.receipt-scanner-heading h2 { margin: 0; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.receipt-scanner-heading small { color: #c3d4cd; font-size: 0.72rem; }
.receipt-scanner-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 5px; border-radius: 16px; background: rgba(255, 255, 255, 0.12); }
.receipt-scanner-form input { min-width: 0; min-height: 54px; border: 0; border-radius: 11px; background: white; font-size: 1rem; }
.receipt-scanner-form button { min-width: 116px; border-radius: 11px; background: var(--lime); color: var(--ink); }
.receipt-feedback {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity 180ms ease, transform 180ms var(--ease-fluid);
}
.receipt-feedback.is-fresh { opacity: 0; transform: translateY(4px); }
.receipt-feedback.is-success { background: rgba(218, 238, 228, 0.16); color: #e7f5ee; }
.receipt-feedback.is-warning { background: rgba(255, 224, 130, 0.16); color: #fff0bd; }
.receipt-feedback.is-error { background: rgba(255, 184, 176, 0.16); color: #ffe3df; }
.receipt-quick-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.receipt-quick-actions form { margin: 0; }
.receipt-secondary-button,
.receipt-warning-button { min-height: 44px; padding: 10px 14px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 11px; background: rgba(255, 255, 255, 0.09); color: white; font-size: 0.77rem; }
.receipt-scanner-form button,
.receipt-secondary-button,
.receipt-warning-button { transition: transform 90ms var(--ease-press), filter 150ms ease, background-color 150ms ease; }
.receipt-scanner-form button:not(:disabled):active,
.receipt-secondary-button:not(:disabled):active,
.receipt-warning-button:not(:disabled):active { transform: scale(0.975); }
.receipt-last-defect-form { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto; gap: 8px; align-items: center; }
.receipt-last-defect-form label { color: #cbdad4; font-size: 0.72rem; font-weight: 500; }
.receipt-last-defect-form select { min-width: 0; min-height: 44px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 11px; background: rgba(255, 255, 255, 0.96); color: var(--ink); }
.receipt-warning-button { border-color: rgba(255, 224, 130, 0.3); color: #fff0bd; }
.receipt-locked-note {
  display: flex;
  gap: 13px;
  align-items: center;
  margin: 0 12px 12px;
  padding: 17px 19px;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
}
.receipt-locked-note > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: white; font-weight: 700; }
.receipt-locked-note > div { display: grid; gap: 2px; }
.receipt-locked-note small { color: var(--muted); font-size: 0.72rem; }
.receipt-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 24px rgba(19, 54, 45, 0.045); }
.receipt-summary > div { display: grid; grid-template-columns: 1fr auto auto; gap: 5px; align-items: baseline; padding: 18px 20px; border-right: 1px solid var(--line); }
.receipt-summary > div:last-child { border-right: 0; }
.receipt-summary span { grid-column: 1 / -1; color: var(--muted); font-size: 0.7rem; font-weight: 500; }
.receipt-summary strong { font-size: 1.48rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.receipt-summary .is-different strong { font-size: 1.08rem; letter-spacing: -0.01em; }
.receipt-summary small { color: var(--muted); font-size: 0.68rem; }
.receipt-summary .is-defective { background: #fffaf0; color: #765e13; }
.receipt-summary .is-different { background: #fff4ef; color: #9b372e; }
.receipt-result-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin: 0 2px 13px; }
.receipt-result-heading > div { display: flex; gap: 10px; align-items: baseline; }
.receipt-result-heading h2 { margin: 0; font-size: 1.26rem; font-weight: 700; letter-spacing: -0.015em; }
.receipt-result-heading span,
.receipt-result-heading > small { color: var(--muted); font-size: 0.72rem; }
.receipt-line-list { display: grid; gap: 10px; }
.receipt-line { overflow: hidden; border: 1px solid var(--line); border-left-width: 4px; border-radius: 17px; background: white; transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
.receipt-line--pending { border-left-color: #cbd6d1; }
.receipt-line--done { border-color: #bed8cc; border-left-color: #5f9a81; }
.receipt-line--over { border-color: #eab4aa; border-left-color: #ca6255; }
.receipt-line.is-recently-updated { animation: receipt-line-highlight 650ms ease-out; }
@keyframes receipt-line-highlight {
  0% { background: #e8f4ee; box-shadow: 0 0 0 4px rgba(84, 148, 119, 0.18); }
  100% { background: white; box-shadow: 0 0 0 0 rgba(84, 148, 119, 0); }
}
.receipt-line__main { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(360px, 1.4fr); gap: 24px; align-items: center; padding: 17px 19px 14px; }
.receipt-line__identity { display: grid; grid-template-columns: auto auto 1fr; gap: 5px 10px; align-items: baseline; min-width: 0; }
.receipt-line__identity > strong { font-size: 0.96rem; font-weight: 700; letter-spacing: -0.005em; }
.receipt-line__identity > span { padding: 3px 7px; border-radius: 8px; background: var(--green-soft); color: var(--green-2); font-size: 0.78rem; font-weight: 650; line-height: 1.25; }
.receipt-line__identity > small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.receipt-line__counts { display: grid; grid-template-columns: repeat(4, minmax(58px, 1fr)); gap: 8px; }
.receipt-line__counts > span { display: grid; gap: 2px; min-height: 48px; padding: 7px 9px; border-radius: 11px; background: #f4f7f5; }
.receipt-line__counts small { color: var(--muted); font-size: 0.62rem; }
.receipt-line__counts strong { font-size: 0.94rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.receipt-line__counts .is-defective { background: #fff6dd; color: #765e13; }
.receipt-line__result.is-done { background: var(--green-soft); color: var(--green-2); }
.receipt-line__result.is-over { background: #fff0ed; color: #a43e34; }
.receipt-progress { height: 4px; margin: 0 19px 13px; overflow: hidden; border-radius: 999px; background: #e9efec; }
.receipt-progress > span { display: block; width: var(--receipt-progress); height: 100%; border-radius: inherit; background: #72a58f; transition: width 220ms var(--ease-fluid); }
.receipt-line--over .receipt-progress > span { background: #d66c5e; }
.receipt-defect-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 19px 13px; }
.receipt-defect-tags > span { display: inline-flex; gap: 7px; align-items: center; padding: 5px 8px; border-radius: 999px; background: #fff3d3; color: #705a16; font-size: 0.68rem; font-weight: 500; }
.receipt-defect-tags form { display: inline; margin: 0; }
.receipt-defect-tags button { min-height: 24px; padding: 0 6px; border-radius: 999px; background: rgba(112, 90, 22, 0.1); color: inherit; font-size: 0.64rem; }
.receipt-line-tools { border-top: 1px solid #edf1ef; }
.receipt-line-tools > summary { padding: 12px 19px; color: var(--green-2); font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.receipt-line-tools__forms { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: 10px; padding: 0 19px 16px; }
.receipt-line-tools__forms form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin: 0; padding: 12px; border-radius: 13px; background: #f5f7f6; }
.receipt-line-tools__forms form:last-child { grid-template-columns: minmax(0, 1.3fr) minmax(80px, 0.7fr) auto; }
.receipt-line-tools__forms label { display: grid; gap: 5px; color: var(--muted); font-size: 0.68rem; font-weight: 500; }
.receipt-line-tools__forms input,
.receipt-line-tools__forms select { min-width: 0; min-height: 42px; border-radius: 9px; font-size: 0.78rem; }
.receipt-line-tools__forms button { min-height: 42px; padding: 9px 13px; border-radius: 9px; background: var(--green); color: white; font-size: 0.74rem; font-weight: 600; }
.receipt-complete-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  gap: 24px;
  align-items: center;
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid #b9d6c8;
  border-radius: 18px;
  background: #eff8f3;
}
.receipt-complete-card--warning { border-color: #e7ca78; background: #fff9e8; }
.receipt-complete-card > div { display: grid; gap: 5px; }
.receipt-complete-card > div strong { font-size: 1rem; }
.receipt-complete-card p { margin: 0; color: var(--muted); font-size: 0.75rem; }
.receipt-complete-card form { display: grid; gap: 9px; margin: 0; }
.receipt-difference-confirm { display: flex; gap: 7px; align-items: flex-start; color: #765e13; font-size: 0.7rem; font-weight: 720; }
.receipt-difference-confirm input { flex: 0 0 auto; margin-top: 2px; }
.receipt-completed-summary { display: grid; justify-items: center; gap: 5px; margin-top: 22px; padding: 24px; border-radius: 18px; background: var(--green-soft); text-align: center; }
.receipt-completed-summary strong { color: var(--green); font-size: 1.2rem; }
.receipt-completed-summary span { color: var(--ink); font-size: 0.78rem; }
.receipt-completed-summary small { color: var(--muted); font-size: 0.68rem; }
.import-confirmed--counting { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.import-confirmed--counting > div { display: grid; gap: 3px; }
.import-confirmed--counting .confirm-receiving { display: inline-grid; place-items: center; min-width: 150px; text-decoration: none; }

.field input,
.receiving-field input,
.receiving-field select,
.spot-line-form select,
.spot-resolve-field select,
.spot-resolve-field input,
.movement-filter-form input,
.movement-filter-form select,
.review-actions input,
.stocktake-grid input[type="number"],
.stocktake-note input,
.scanner-form input {
  transition: border-color 160ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

.field input:hover,
.receiving-field input:hover,
.receiving-field select:hover,
.spot-line-form select:hover,
.spot-resolve-field select:hover,
.spot-resolve-field input:hover,
.movement-filter-form input:hover,
.movement-filter-form select:hover,
.review-actions input:hover,
.stocktake-grid input[type="number"]:hover,
.stocktake-note input:hover {
  border-color: #bac9c1;
}

.field input:focus,
.receiving-field input:focus,
.receiving-field select:focus,
.spot-line-form select:focus,
.spot-resolve-field select:focus,
.spot-resolve-field input:focus,
.movement-filter-form input:focus,
.movement-filter-form select:focus,
.review-actions input:focus,
.stocktake-grid input[type="number"]:focus,
.stocktake-note input:focus,
.scanner-form input:focus {
  border-color: var(--green-2);
  outline: none;
  box-shadow: 0 0 0 4px rgba(40, 102, 87, 0.12), 0 4px 12px rgba(23, 50, 43, 0.04);
}

.product-card,
.receiving-card,
.catalog-card,
.review-card,
.stocktake-workspace,
.scanner-card,
.scan-list-card,
.location-admin-card,
.account-admin-card,
.import-table,
.spot-order-list,
.consignment-list,
.movement-list,
.backup-list {
  border-color: rgba(23, 63, 53, 0.12);
  box-shadow: var(--shadow-soft);
}

.lookup-card,
.import-upload-card,
.location-create-card,
.account-create-card,
.movement-filter-card,
.export-card,
.backup-overview {
  border-color: rgba(23, 63, 53, 0.12);
  box-shadow: var(--shadow-soft);
}

.action-card,
.manager-card {
  border-color: rgba(23, 63, 53, 0.12);
  box-shadow: 0 1px 1px rgba(23, 50, 43, 0.025);
}

.action-card { align-items: flex-start; padding: 22px; }
.action-card strong, .manager-card strong { letter-spacing: -0.01em; }
.action-icon {
  box-shadow: inset 0 0 0 1px rgba(40, 102, 87, 0.04);
  transition: transform 260ms var(--ease-fluid), background-color 180ms ease;
}
.action-icon svg { display: block; width: 24px; height: 24px; }

@media (hover: hover) and (pointer: fine) {
  .action-card--enabled:hover,
  .manager-card--enabled:hover {
    border-color: rgba(40, 102, 87, 0.30);
    transform: translateY(-3px);
    box-shadow: var(--shadow-raised);
  }
  .action-card--enabled:hover .action-icon { transform: scale(1.055); background: #deeee6; }
  .primary-button:hover,
  .confirm-receiving:hover,
  .approve-button:hover,
  .location-save-button:hover,
  .account-save-button:hover,
  .movement-filter-form button:hover,
  .search-form button:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 18px rgba(23, 63, 53, 0.16);
  }
  .text-button:hover,
  .clear-search:hover { color: var(--green); }
}

.primary-button,
.search-form button,
.confirm-receiving,
.approve-button,
.reject-button,
.line-save-button,
.location-save-button,
.account-save-button,
.movement-filter-form button,
.recheck-task-action a,
.template-download {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease,
    box-shadow 220ms var(--ease-fluid), filter 150ms ease, transform 100ms var(--ease-press);
}

.primary-button:not(:disabled):active,
.search-form button:not(:disabled):active,
.confirm-receiving:not(:disabled):active,
.approve-button:not(:disabled):active,
.reject-button:not(:disabled):active,
.line-save-button:not(:disabled):active,
.location-save-button:not(:disabled):active,
.account-save-button:not(:disabled):active,
.movement-filter-form button:not(:disabled):active,
.text-button:not(:disabled):active,
.recheck-task-action a:active,
.template-download:active,
.catalog-page-link:not(.is-disabled):active,
.catalog-scope-tabs a:active {
  transform: scale(0.975);
  transition-duration: 70ms;
}

.action-card--enabled:active,
.manager-card--enabled:active {
  transform: scale(0.985);
  box-shadow: 0 1px 3px rgba(23, 50, 43, 0.05);
  transition-duration: 70ms;
}

button:disabled,
.catalog-page-link.is-disabled { cursor: not-allowed; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgba(40, 102, 87, 0.26);
  outline-offset: 3px;
}

.sku-row:not(.sku-row--head),
.import-row:not(.import-row--head),
.spot-order-row:not(.spot-order-row--head),
.consignment-row:not(.consignment-row--head),
.movement-row:not(.movement-row--head),
.review-row:not(.review-row--head),
.backup-row:not(.backup-row--head) {
  transition: background-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .sku-row:not(.sku-row--head):hover,
  .import-row:not(.import-row--head):hover,
  .movement-row:not(.movement-row--head):hover,
  .review-row:not(.review-row--head):hover,
  .backup-row:not(.backup-row--head):hover { background-color: #f8faf8; }
}

.status-pill,
.pending-pill,
.action-badge,
.task-status,
.match-pill,
.stock-flag,
.brand-pill,
.blue-box-pill,
.purchase-note-pill {
  box-shadow: inset 0 0 0 1px rgba(23, 50, 43, 0.035);
}

.empty-result,
.empty-state {
  background: rgba(247, 249, 247, 0.78);
}

@media (max-width: 900px) {
  .app-shell { padding-top: 30px; padding-bottom: 64px; }
  .search-panel {
    gap: 20px;
    min-height: 0;
    margin-bottom: 38px;
    padding: 30px 32px;
  }
  .site-footer__notice span { display: block; }
  .receiving-workflow-shell,
  .purchase-receipt-shell { width: min(100% - 30px, 1060px); }
  .receipt-line__main { grid-template-columns: 1fr; gap: 12px; }
  .receipt-line-tools__forms { grid-template-columns: 1fr; }
  .receipt-complete-card { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 66px;
    padding: 10px 14px;
    align-items: center;
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
  }
  .brand-logo--header { width: 38px; height: 38px; }
  .user-area { align-items: center; }
  .user-area strong { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-shell { width: min(100% - 24px, 1180px); padding-top: 24px; padding-bottom: 52px; }
  .page-intro { margin-bottom: 22px; }
  .page-intro h1 { font-size: clamp(1.75rem, 9vw, 2.15rem); }
  .search-panel { gap: 17px; padding: 25px 17px; border-radius: 20px; box-shadow: 0 18px 38px rgba(19, 54, 45, 0.14); }
  .search-panel h1 { font-size: clamp(1.55rem, 7.3vw, 1.82rem); text-align: left; justify-self: stretch; }
  .search-form { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; width: 100%; padding: 4px; border-radius: 15px; }
  .search-form button { min-width: 70px; min-height: 50px; padding-inline: 15px; }
  .section-heading { align-items: flex-start; margin-bottom: 16px; }
  .action-card { padding: 18px; }
  .manager-section { margin-top: 38px; padding-top: 30px; }
  .site-footer { padding: 14px 14px 16px; }
  .site-footer__title { font-size: 0.64rem; line-height: 1.4; }
  .site-footer__notice { margin-top: 4px; font-size: 0.59rem; line-height: 1.5; }

  .app-shell--home {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
    padding-bottom: 22px;
  }
  .app-shell--home .search-panel {
    gap: 15px;
    margin-bottom: 28px;
    padding: 21px 18px;
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(19, 54, 45, 0.14);
  }
  .app-shell--home .search-panel h1 {
    font-size: clamp(1.42rem, 6.4vw, 1.58rem);
    line-height: 1.08;
    text-align: left;
  }
  .app-shell--home .search-form { gap: 7px; padding: 4px; border-radius: 14px; }
  .app-shell--home .search-form input { min-height: 49px; padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; }
  .app-shell--home .search-form button { min-width: 66px; min-height: 49px; padding-inline: 13px; border-radius: 10px; font-size: 0.86rem; }
  .app-shell--home .section-heading { align-items: center; margin-bottom: 14px; }
  .app-shell--home .section-heading .eyebrow { display: none; }
  .app-shell--home .section-heading h2 { font-size: 1.3rem; line-height: 1.15; letter-spacing: -0.025em; }
  .app-shell--home .status-pill { padding: 6px 9px; font-size: 0.7rem; }
  .app-shell--home .sku-row {
    grid-template-columns: minmax(0, 1fr) minmax(76px, 34%);
    gap: 6px 14px;
    padding: 12px 16px;
  }
  .app-shell--home .sku-row--head { min-height: 38px; padding-block: 8px; }
  .app-shell--home .sku-row > strong[role="cell"] {
    min-width: 0;
    font-size: 0.96rem;
    line-height: 1.35;
    overflow-wrap: normal;
  }
  .app-shell--home .stock-cell { flex-direction: column; align-items: flex-end; text-align: right; }
  .app-shell--home .stock-quantity { font-size: 0.98rem; font-variant-numeric: tabular-nums; }
  .app-shell--home .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 169px;
    gap: 12px;
  }
  .app-shell--home .action-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    min-height: 0;
    height: 100%;
    padding: 16px;
    border-radius: 17px;
  }
  .app-shell--home .action-card > span:last-child { width: 100%; min-width: 0; }
  .app-shell--home .action-icon { flex-basis: 40px; width: 40px; height: 40px; border-radius: 12px; font-size: 0.92rem; }
  .app-shell--home .action-card strong { margin: 0 0 6px; font-size: 0.96rem; line-height: 1.25; letter-spacing: -0.01em; }
  .app-shell--home .action-card small { display: -webkit-box; overflow: hidden; font-size: 0.68rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .app-shell--home .action-title-row { align-items: center; gap: 4px 5px; }
  .app-shell--home .action-badge { min-height: 20px; padding: 2px 6px; font-size: 0.58rem; line-height: 1.2; white-space: normal; }

  .receiving-workflow-shell,
  .purchase-receipt-shell { width: min(100% - 24px, 1060px); padding-top: 20px; }
  .receiving-workflow-intro,
  .purchase-receipt-intro { min-height: 66px; margin-bottom: 14px; }
  .receiving-workflow-intro h1,
  .purchase-receipt-intro h1 { font-size: 1.8rem; }
  .receipt-page-tools { display: grid; gap: 8px; margin-bottom: 22px; }
  .receiving-workflow-switch { display: grid; width: 100%; margin-bottom: 0; }
  .receiving-workflow-switch a,
  .receiving-workflow-switch span { display: grid; place-items: center; padding-inline: 10px; }
  .receipt-batch-card { grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; min-height: 84px; padding: 14px; border-radius: 16px; }
  .receipt-batch-card__number { min-width: 42px; min-height: 42px; border-radius: 12px; font-size: 0.72rem; }
  .receipt-batch-card__main strong { font-size: 0.88rem; }
  .receipt-batch-card__main small { font-size: 0.68rem; }
  .receipt-batch-card__progress { grid-column: 2; grid-row: 2; justify-items: start; display: flex; gap: 5px; align-items: baseline; }
  .receipt-batch-card__progress strong { font-size: 0.78rem; }
  .receipt-batch-card__progress small { font-size: 0.62rem; }
  .receipt-batch-card__arrow { grid-column: 3; grid-row: 1 / 3; }
  .receipt-batch-hero { padding: 18px 18px 16px; border-radius: 0; }
  .receipt-batch-hero h2 { font-size: 1.18rem; }
  .receipt-batch-status { padding: 6px 8px; font-size: 0.64rem; }
  .receipt-scanner-card { margin: 0 8px 8px; padding: 17px; border-radius: 16px; }
  .receipt-scanner-heading { align-items: start; margin-bottom: 13px; }
  .receipt-scanner-heading h2 { font-size: 1.28rem; }
  .receipt-scanner-heading small { max-width: 100px; text-align: right; }
  .receipt-scanner-form input { min-height: 50px; padding-inline: 11px; font-size: 0.88rem; }
  .receipt-scanner-form button { min-width: 102px; min-height: 50px; padding-inline: 10px; font-size: 0.76rem; }
  .receipt-quick-actions { grid-template-columns: 1fr; }
  .receipt-secondary-button { width: 100%; }
  .receipt-last-defect-form { grid-template-columns: minmax(0, 1fr) auto; }
  .receipt-last-defect-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .receipt-last-defect-form select { font-size: 0.76rem; }
  .receipt-warning-button { padding-inline: 12px; }
  .receipt-summary { grid-template-columns: repeat(2, 1fr); margin-bottom: 22px; border-radius: 16px; }
  .receipt-summary > div { padding: 14px 16px; }
  .receipt-summary > div:nth-child(2) { border-right: 0; }
  .receipt-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .receipt-summary strong { font-size: 1.35rem; }
  .receipt-result-heading { align-items: flex-start; }
  .receipt-result-heading > small { display: none; }
  .receipt-line__main { gap: 11px; padding: 15px 15px 12px; }
  .receipt-line__identity > strong { font-size: 0.92rem; }
  .receipt-line__identity > span { font-size: 0.86rem; }
  .receipt-line__counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .receipt-line__counts > span { min-height: 48px; padding: 7px 9px; }
  .receipt-line__counts strong { font-size: 0.9rem; }
  .receipt-line__result strong { font-size: 0.82rem; }
  .receipt-progress { margin: 0 15px 12px; }
  .receipt-defect-tags { margin: 0 15px 12px; }
  .receipt-line-tools > summary { padding: 12px 15px; }
  .receipt-line-tools__forms { padding: 0 15px 15px; }
  .receipt-line-tools__forms form,
  .receipt-line-tools__forms form:last-child { grid-template-columns: 1fr; }
  .receipt-line-tools__forms form:last-child label:nth-of-type(2),
  .receipt-line-tools__forms form:last-child button { grid-column: auto; grid-row: auto; }
  .receipt-line-tools__forms button { width: 100%; }
  .receipt-complete-card { margin-top: 18px; padding: 18px; border-radius: 16px; }
  .receipt-complete-card .approve-button { min-height: 48px; }
  .receipt-completed-summary { padding: 20px 16px; }
  .import-confirmed--counting { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #9eaea6; --muted: #4f6058; }
  .topbar { background: var(--paper); }
  .action-card, .manager-card, .product-card, .receiving-card, .catalog-card { border-color: #72877c; }
}

/* Outbound scan counting: fast, calm, and intentionally separate from inventory. */
.outbound-scan-shell { width: min(1040px, calc(100% - 32px)); }
.outbound-page-intro > p:last-child { max-width: 760px; }
.outbound-start-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(23, 63, 53, 0.12);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.outbound-start-card h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -0.025em; }
.outbound-start-card p:last-child { margin: 8px 0 0; max-width: 560px; color: var(--muted); }
.outbound-start-card form { min-width: 170px; }
.outbound-start-card .confirm-receiving { width: 100%; }
.outbound-start-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--mint);
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(40, 102, 87, 0.05);
}
.outbound-batch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 15px 18px;
  border: 1px solid rgba(23, 63, 53, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 1px 2px rgba(23, 50, 43, 0.035);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}
.outbound-batch-bar > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 11px; }
.outbound-batch-bar span, .outbound-batch-bar small { color: var(--muted); font-size: 0.76rem; }
.outbound-batch-bar > div > strong { color: var(--green); font-size: 1.1rem; }
.outbound-status { padding: 6px 10px; border-radius: 999px; font-weight: 850; white-space: nowrap; }
.outbound-status--open { background: var(--mint); color: var(--green-2) !important; }
.outbound-status--completed { background: #edf0ee; color: #68766f !important; }
.outbound-scanner-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(380px, 1.28fr);
  gap: 18px 34px;
  align-items: center;
  overflow: hidden;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  background: var(--green);
  color: white;
  box-shadow: 0 22px 52px rgba(19, 54, 45, 0.15);
}
.outbound-scanner-card::after {
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(220, 233, 177, 0.075);
  content: "";
  pointer-events: none;
}
.outbound-scanner-copy, .outbound-scanner-form, .outbound-feedback { position: relative; z-index: 1; }
.outbound-scanner-copy .eyebrow { color: var(--lime); }
.outbound-scanner-copy h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -0.025em; }
.outbound-scanner-copy > p:last-child { margin: 9px 0 0; color: #c8d8d1; font-size: 0.82rem; line-height: 1.65; }
.outbound-scanner-form { display: grid; gap: 8px; }
.outbound-scanner-form label { color: #c8d8d1; font-size: 0.76rem; font-weight: 800; }
.outbound-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 4px; border-radius: 15px; background: rgba(255, 255, 255, 0.10); }
.outbound-input-row input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(23, 50, 43, 0.04);
}
.outbound-input-row input:focus { box-shadow: inset 0 1px 0 rgba(23, 50, 43, 0.04), 0 0 0 4px rgba(220, 233, 177, 0.2); }
.outbound-input-row .confirm-receiving { grid-column: auto; min-width: 86px; padding: 0 18px; background: var(--lime); color: var(--ink); }
.outbound-feedback {
  grid-column: 1 / -1;
  min-height: 48px;
  padding: 13px 15px;
  border-radius: 13px;
  font-size: 0.86rem;
  font-weight: 850;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 180ms ease, transform 280ms var(--ease-fluid), background-color 160ms ease;
}
.outbound-feedback[hidden] { display: none; }
.outbound-feedback.is-success { background: rgba(220, 233, 177, 0.18); color: #eef7d6; }
.outbound-feedback.is-warning { background: rgba(255, 229, 178, 0.16); color: #ffe9be; }
.outbound-feedback.is-fresh { opacity: 0.4; transform: translateY(-4px) scale(0.99); }
.outbound-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid rgba(23, 63, 53, 0.11);
  border-radius: 18px;
  background: var(--line);
  box-shadow: var(--shadow-soft);
}
.outbound-summary > div { padding: 18px 20px; background: var(--surface); }
.outbound-summary span, .outbound-summary small { display: block; color: var(--muted); font-size: 0.72rem; }
.outbound-summary strong { display: inline-block; margin: 5px 4px 0 0; font-size: 1.7rem; line-height: 1; letter-spacing: -0.035em; }
.outbound-summary small { display: inline; font-weight: 750; }
.outbound-summary__warning strong { color: #9a6212; }
.outbound-result-section {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid rgba(23, 63, 53, 0.12);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.outbound-result-section--unknown { border-color: #ebd39e; background: #fffdf7; }
.outbound-result-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 15px; }
.outbound-result-heading h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.outbound-result-heading > span { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.outbound-section-note { margin: -5px 0 15px; color: #765f2e; font-size: 0.8rem; }
.outbound-line-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.outbound-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 10px 13px;
  border-bottom: 1px solid #edf1ee;
  transition: background-color 160ms ease;
}
.outbound-line:last-child { border-bottom: 0; }
.outbound-line--unknown { grid-template-columns: minmax(0, 1fr) auto auto; background: #fffdf8; }
.outbound-line--unknown code, .outbound-line--unknown small { display: block; }
.outbound-line--unknown code { overflow-wrap: anywhere; color: #704f15; font-size: 0.9rem; font-weight: 800; }
.outbound-line--unknown small { margin-top: 4px; color: #8d7751; font-size: 0.72rem; }
.outbound-product strong, .outbound-product span { display: block; }
.outbound-product strong { font-size: 1rem; letter-spacing: 0.015em; }
.outbound-product span { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.outbound-size small, .outbound-size strong { display: block; }
.outbound-size small { color: var(--muted); font-size: 0.68rem; }
.outbound-size strong { margin-top: 2px; }
.outbound-quantity { min-width: 54px; text-align: right; white-space: nowrap; }
.outbound-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 24px;
  border: 1px dashed #c7d1cb;
  border-radius: 14px;
  text-align: center;
}
.outbound-empty-state strong {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.6;
}
.outbound-complete-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid rgba(23, 63, 53, 0.12);
  border-radius: 18px;
  background: #f3f7f4;
}
.outbound-complete-card strong, .outbound-complete-card small { display: block; }
.outbound-complete-card small { margin-top: 5px; color: var(--muted); }
.outbound-complete-card form { min-width: 190px; }
.outbound-complete-card .confirm-receiving { width: 100%; }
.outbound-complete-card .confirm-receiving:disabled {
  background: #aeb8b3;
  color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  filter: none;
  opacity: 0.72;
}
.outbound-locked-note {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid #cce0d4;
  border-radius: 17px;
  background: #edf6f1;
}
.outbound-locked-note > span { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--green-2); color: white; font-weight: 900; }
.outbound-locked-note strong, .outbound-locked-note small { display: block; }
.outbound-locked-note small { margin-top: 3px; color: var(--muted); }
.outbound-current-link, .outbound-next-form { display: block; margin-top: 20px; }
.outbound-current-link { color: var(--green-2); font-weight: 850; text-align: center; text-decoration: none; }
.outbound-next-form .confirm-receiving { width: 100%; }
.outbound-history { margin-top: 42px; padding-top: 32px; border-top: 1px solid var(--line); }
.outbound-history-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.outbound-history-list a { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 64px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-decoration: none; transition: transform 110ms var(--ease-press), border-color 160ms ease, box-shadow 220ms var(--ease-fluid); }
.outbound-history-list a.is-current { border-color: #82a897; background: #f0f7f3; }
.outbound-history-list strong, .outbound-history-list small { display: block; }
.outbound-history-list small { margin-top: 3px; color: var(--muted); font-size: 0.7rem; }
.outbound-history-list > a > span:last-child { color: var(--green-2); font-size: 0.8rem; font-weight: 850; white-space: nowrap; }
.outbound-history-list a:active { transform: scale(0.985); transition-duration: 70ms; }

@media (hover: hover) and (pointer: fine) {
  .outbound-line:hover { background: #f8faf8; }
  .outbound-history-list a:hover { border-color: rgba(40, 102, 87, 0.30); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
}

@media (max-width: 900px) {
  .outbound-scan-shell { width: min(100% - 22px, 1040px); }
  .outbound-start-card { grid-template-columns: auto minmax(0, 1fr); padding: 22px 18px; }
  .outbound-start-card form { grid-column: 1 / -1; min-width: 0; }
  .outbound-scanner-card { grid-template-columns: 1fr; padding: 22px 18px; }
  .outbound-feedback { grid-column: auto; }
  .outbound-result-section { padding: 20px 16px; }
  .outbound-line { grid-template-columns: minmax(0, 1fr) 90px auto auto; gap: 10px; }
  .outbound-complete-card { align-items: stretch; flex-direction: column; }
  .outbound-complete-card form { min-width: 0; }
  .outbound-history-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .outbound-batch-bar { align-items: flex-start; padding: 13px 14px; }
  .outbound-batch-bar > div { display: grid; grid-template-columns: auto auto; gap: 2px 8px; }
  .outbound-batch-bar > div > strong { grid-column: 2; grid-row: 1; }
  .outbound-batch-bar > div > small { grid-column: 1 / -1; }
  .outbound-input-row { grid-template-columns: minmax(0, 1fr) 72px; gap: 6px; }
  .outbound-input-row .confirm-receiving { min-width: 0; padding: 0 10px; }
  .outbound-summary > div { padding: 15px 12px; }
  .outbound-summary strong { font-size: 1.4rem; }
  .outbound-result-heading { align-items: flex-start; }
  .outbound-line, .outbound-line--unknown { grid-template-columns: minmax(0, 1fr) auto; padding: 13px 12px; }
  .outbound-line .outbound-size { grid-column: 1; }
  .outbound-line .outbound-quantity { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .outbound-line form { grid-column: 1 / -1; }
  .outbound-line form .line-save-button { width: 100%; }
  .outbound-line--unknown > strong { grid-column: 2; grid-row: 1; }
  .outbound-line--unknown form { grid-column: 1 / -1; }
  .outbound-product span {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .outbound-batch-bar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .outbound-start-card, .outbound-result-section, .outbound-line-list, .outbound-history-list a { border-color: #72877c; }
}

/* Simplified outbound hierarchy: one instruction per section with more air. */
.outbound-page-intro { margin-bottom: 32px; }
.outbound-page-intro > p:last-child { margin-top: 12px; font-size: 0.95rem; line-height: 1.75; }
.outbound-start-card { gap: 26px; padding: 34px 36px; }
.outbound-start-card p:last-child { margin-top: 10px; line-height: 1.7; }
.outbound-scanner-card { gap: 28px 48px; padding: 34px 36px; }
.outbound-scanner-copy h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); line-height: 1.25; }
.outbound-summary { margin-top: 24px; }
.outbound-summary > div { padding: 21px 24px; }
.outbound-result-section { margin-top: 28px; padding: 28px; }
.outbound-result-heading { align-items: center; margin-bottom: 20px; }
.outbound-line { min-height: 76px; padding: 13px 16px; }
.outbound-complete-card { margin-top: 28px; padding: 24px 26px; }
.outbound-history { margin-top: 50px; padding-top: 38px; }

@media (max-width: 900px) {
  .outbound-start-card { padding: 28px 24px; }
  .outbound-scanner-card { padding: 28px 24px; }
  .outbound-result-section { padding: 24px 20px; }
}

@media (max-width: 560px) {
  .outbound-page-intro { margin-bottom: 26px; }
  .outbound-page-intro > p:last-child { margin-top: 10px; font-size: 0.9rem; }
  .outbound-start-card { gap: 18px; padding: 26px 20px; }
  .outbound-start-icon { width: 52px; height: 52px; border-radius: 16px; }
  .outbound-scanner-card { gap: 22px; padding: 26px 20px; }
  .outbound-summary { margin-top: 18px; }
  .outbound-summary > div { padding: 18px 13px; }
  .outbound-result-section { margin-top: 24px; padding: 22px 18px; }
  .outbound-result-heading { margin-bottom: 18px; }
  .outbound-line { min-height: 72px; padding: 14px 13px; }
  .outbound-complete-card { margin-top: 24px; padding: 22px 20px; }
}

/* Responsive top bar: one balanced type scale across desktop, iPad and iPhone. */
.topbar {
  gap: 24px;
  padding-block: 10px;
}

.wordmark {
  min-width: 0;
  margin-left: -8px;
  padding: 6px 8px;
  border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
}

.wordmark-text {
  gap: 3px;
  line-height: 1;
}

.wordmark-text strong {
  font-size: 1.08rem;
  font-weight: 880;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.wordmark-text small {
  font-size: 0.69rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.045em;
}

.user-area {
  flex: 0 0 auto;
  gap: 8px;
}

.user-area > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.user-area strong {
  font-size: 0.88rem;
  font-weight: 790;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.user-area span {
  margin-top: 0;
  font-size: 0.7rem;
  font-weight: 560;
  line-height: 1.3;
  letter-spacing: 0.025em;
}

.user-area form { margin: 0; }

.topbar .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .wordmark:hover { background: rgba(232, 242, 237, 0.72); }
  .topbar .text-button:hover {
    background: var(--mint);
    color: var(--green);
    text-decoration: none;
  }
}

.wordmark:active,
.topbar .text-button:active {
  transform: scale(0.965);
  transition-duration: 70ms;
}

@media (min-width: 561px) and (max-width: 900px) {
  .topbar {
    min-height: 68px;
    gap: 18px;
    padding-inline: 20px;
  }
  .brand-logo--header { width: 39px; height: 39px; }
  .wordmark { margin-left: -7px; }
  .wordmark-text strong { font-size: 1.02rem; }
  .wordmark-text small { font-size: 0.65rem; }
  .user-area strong { font-size: 0.84rem; }
  .topbar .text-button { min-height: 44px; }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 62px;
    gap: 8px;
    padding: 7px 10px;
  }
  .wordmark {
    gap: 8px;
    margin-left: -4px;
    padding: 4px;
    border-radius: 12px;
  }
  .brand-logo--header { width: 36px; height: 36px; }
  .wordmark-text { gap: 2px; }
  .wordmark-text strong {
    font-size: 0.94rem;
    line-height: 1.1;
    letter-spacing: 0.015em;
  }
  .wordmark-text small {
    font-size: 0.6rem;
    line-height: 1.2;
    letter-spacing: 0.025em;
  }
  .user-area { gap: 2px; }
  .user-area strong {
    max-width: 5.8rem;
    font-size: 0.76rem;
    line-height: 1.2;
  }
  .user-area span {
    font-size: 0.63rem;
    line-height: 1.25;
  }
  .topbar .text-button {
    min-height: 44px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: 0.76rem;
  }
}

@media (max-width: 360px) {
  .topbar { padding-inline: 8px; }
  .wordmark { gap: 7px; }
  .brand-logo--header { width: 34px; height: 34px; }
  .wordmark-text strong { font-size: 0.9rem; }
  .wordmark-text small { font-size: 0.57rem; }
  .user-area strong { max-width: 4.6rem; }
  .topbar .text-button { padding-inline: 7px; }
}

/* Receiving context: make every linked purchase batch scannable beside the item code. */
.receiving-purchase-links {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.receiving-purchase-links__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.receiving-purchase-links__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.receiving-purchase-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  max-width: min(100%, 420px);
  padding: 8px 10px;
  border: 1px solid #ead6ac;
  border-radius: 10px;
  background: #fffaf0;
  color: #76500e;
  font-size: 0.78rem;
  line-height: 1.4;
}

.receiving-purchase-link > strong { white-space: nowrap; }
.receiving-purchase-link > span { overflow-wrap: anywhere; }
.receiving-purchase-link > small {
  grid-column: 2;
  color: #8a734a;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .receiving-purchase-links__list { display: grid; }
  .receiving-purchase-link {
    grid-template-columns: 1fr;
    max-width: none;
    padding: 9px 10px;
  }
  .receiving-purchase-link > small { grid-column: auto; }
  .operation-panel--receiving .operation-panel-heading { grid-template-columns: 1fr; }
  .operation-panel--receiving .operation-impact { justify-self: start; }
  .receiving-stock-heading { display: grid; gap: 3px; }
}

/* Pending consignment scan: one calm, touch-friendly workflow. */
@media (max-width: 900px) {
  .pending-scan-shell { width: min(100% - 28px, 940px); }
  .pending-scan-intro { grid-template-columns: 1fr; gap: 10px; }
  .pending-scan-intro > p:last-child { max-width: 38rem; }
  .scanner-card { padding: 22px; }
  .scan-list-card { padding: 0; }
  .manual-scan-fields { grid-template-columns: minmax(180px, 1.18fr) minmax(110px, 0.92fr) 70px; }
  .manual-scan-fields > div:last-child { grid-column: auto; }
  .scan-line { gap: 12px; padding: 10px 18px; }
  .new-scan-batch { align-items: center; flex-direction: row; }
}

@media (max-width: 560px) {
  .pending-scan-shell { width: min(100% - 22px, 940px); padding-top: 22px; }
  .pending-scan-intro { gap: 8px; margin-bottom: 18px; }
  .pending-scan-intro h1 { font-size: 1.78rem; }
  .pending-scan-intro > p:last-child { font-size: 0.78rem; line-height: 1.55; }
  .scan-workspace { gap: 12px; }
  .scanner-card { padding: 19px 16px 15px; border-radius: 17px; }
  .scanner-card__heading h2 { font-size: 1.12rem; }
  .scan-feedback { padding: 5px 8px; font-size: 0.66rem; }
  .scan-input-row { grid-template-columns: minmax(0, 1fr) 68px; border-radius: 13px; }
  .scanner-form input { min-height: 47px; padding-inline: 11px; font-size: 0.92rem; }
  .scanner-form .confirm-receiving { min-height: 47px; padding: 0 10px; border-radius: 9px; font-size: 0.8rem; }
  .manual-scan-entry { margin-top: 13px; padding-top: 11px; }
  .manual-scan-form { padding: 11px; }
  .manual-scan-fields { grid-template-columns: minmax(112px, 1.45fr) minmax(76px, 0.75fr) 56px; gap: 7px; }
  .manual-scan-fields input { min-height: 40px; padding-inline: 8px; font-size: 0.78rem; }
  .manual-scan-submit { min-height: 40px; }
  .scan-list-card { border-radius: 17px; }
  .scan-list-heading { padding: 16px 15px 14px; }
  .scan-list-heading h2 { font-size: 1.08rem; }
  .scan-refresh-button { padding-inline: 7px; }
  .scan-line { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; min-height: 60px; padding: 9px 13px; }
  .scan-line code { font-size: 0.82rem; }
  .scan-line > strong { font-size: 0.8rem; }
  .scan-decrease-button { min-height: 31px; padding-inline: 7px; }
  .scan-pagination { grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 13px 15px; }
  .scan-pagination__pages { display: none; }
  .scan-pagination__summary { display: block; }
  .scan-pagination__step { min-height: 40px; padding: 0 8px; }
  .new-scan-batch { align-items: stretch; flex-direction: column; padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-feedback,
  .manual-scan-form,
  .scan-line--recent { animation: none; }
  .scan-feedback.is-hiding { transform: none; }
}

/* Inventory ledger: compact hierarchy and responsive filter bar. */
.movement-filter-card .movement-filter-form input:focus,
.movement-filter-card .movement-filter-form select:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(40, 102, 87, 0.10);
}

@media (max-width: 900px) {
  .movement-shell { width: min(100% - 28px, 1180px); }
  .movement-page-intro { grid-template-columns: 1fr; gap: 9px; }
  .movement-page-intro > p:last-child { max-width: 42rem; }
  .movement-filter-form { grid-template-columns: minmax(0, 1fr) minmax(160px, 0.5fr) auto auto; }
}

@media (max-width: 620px) {
  .movement-shell { width: min(100% - 22px, 1180px); padding-top: 22px; }
  .movement-page-intro { margin-bottom: 18px; }
  .movement-page-intro h1 { font-size: 1.78rem; }
  .movement-page-intro > p:last-child { font-size: 0.78rem; line-height: 1.55; }
  .movement-filter-card { padding: 7px; border-radius: 14px; }
  .movement-filter-form { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .movement-filter-form input { grid-column: 1 / -1; }
  .movement-filter-form select { grid-column: 1; }
  .movement-filter-form button { grid-column: 2; padding-inline: 16px; }
  .movement-filter-form .movement-filter-clear { grid-column: 1 / -1; justify-self: start; min-height: 34px; }
  .movement-result-heading { align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 20px; }
  .movement-result-heading > span { line-height: 1.45; }
}

/* Outbound counting: use the same calm hierarchy as the approved scan pages. */
.outbound-scan-shell { width: min(1080px, calc(100% - 32px)); }
.outbound-page-intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 22px;
}
.outbound-page-intro h1 { margin-top: 5px; }
.outbound-page-intro > p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}
.outbound-batch-bar {
  margin-bottom: 10px;
  padding: 11px 14px;
  border-radius: 13px;
  background: #f7f9f7;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.outbound-batch-bar > div > strong { font-size: 0.98rem; }
.outbound-status { padding: 5px 9px; font-size: 0.7rem; font-weight: 760; }
.outbound-scanner-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.54fr) minmax(360px, 1.46fr);
  gap: 13px 28px;
  padding: 20px;
  overflow: visible;
  border: 1px solid rgba(23, 63, 53, 0.11);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(23, 50, 43, 0.055);
}
.outbound-scanner-card::after { display: none; }
.outbound-scanner-copy .eyebrow { margin-bottom: 5px; color: var(--green-2); }
.outbound-scanner-copy h2 {
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.018em;
}
.outbound-input-row {
  gap: 7px;
  padding: 4px;
  border: 1px solid #dfe8e3;
  border-radius: 13px;
  background: #f1f5f3;
  transition: border-color 150ms ease, box-shadow 160ms ease, background-color 150ms ease;
}
.outbound-input-row:focus-within {
  border-color: #a9c5b8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(40, 102, 87, 0.09);
}
.outbound-input-row input {
  min-height: 48px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.94rem;
  box-shadow: none;
}
.outbound-input-row input:focus { box-shadow: none; }
.outbound-input-row .confirm-receiving {
  min-width: 76px;
  min-height: 48px;
  padding: 0 15px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 0.82rem;
}
.outbound-feedback {
  min-height: 0;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 720;
}
.outbound-feedback.is-success { background: #e9f4ee; color: var(--green-2); }
.outbound-feedback.is-warning { background: #fff4d8; color: #7c5c12; }
.outbound-summary {
  margin-top: 12px;
  border-radius: 15px;
  box-shadow: none;
}
.outbound-summary > div { padding: 13px 16px; }
.outbound-summary span,
.outbound-summary small { font-size: 0.68rem; }
.outbound-summary strong {
  margin-top: 4px;
  font-size: 1.28rem;
  font-weight: 760;
  letter-spacing: -0.025em;
}
.outbound-result-section {
  margin-top: 16px;
  padding: 19px;
  border-radius: 17px;
  box-shadow: 0 5px 18px rgba(23, 50, 43, 0.035);
}
.outbound-result-section--unknown {
  border-color: #ead6a8;
  background: #fffaf0;
}
.outbound-result-heading { align-items: baseline; margin-bottom: 12px; }
.outbound-result-heading h2 { font-size: 1.12rem; letter-spacing: -0.012em; }
.outbound-result-heading > span { font-size: 0.7rem; font-weight: 720; }
.outbound-line-list { border-radius: 12px; }
.outbound-line {
  grid-template-columns: minmax(0, 1fr) 90px 62px auto;
  gap: 11px;
  min-height: 60px;
  padding: 9px 12px;
}
.outbound-line--unknown { grid-template-columns: minmax(0, 1fr) 62px auto; }
.outbound-product strong { font-size: 0.9rem; }
.outbound-product span { font-size: 0.68rem; }
.outbound-size small { font-size: 0.64rem; }
.outbound-size strong,
.outbound-quantity { font-size: 0.82rem; }
.outbound-line .line-save-button {
  min-height: 34px;
  padding: 0 9px;
  border-color: #b7ccc2;
  border-radius: 9px;
  background: #f7faf8;
  font-size: 0.74rem;
  font-weight: 760;
}
.outbound-pagination {
  margin-top: 12px;
  border: 1px solid rgba(23, 63, 53, 0.10);
  border-radius: 14px;
  background: var(--surface);
}
.outbound-complete-card {
  margin-top: 18px;
  padding: 17px 19px;
  border-radius: 16px;
  background: #f3f7f4;
}
.outbound-complete-card strong { font-size: 0.88rem; }
.outbound-complete-card small { font-size: 0.7rem; }
.outbound-complete-card form { min-width: 160px; }
.outbound-complete-card .confirm-receiving { min-height: 44px; font-size: 0.8rem; }
.outbound-history { margin-top: 34px; padding-top: 26px; }

@media (hover: hover) and (pointer: fine) {
  .outbound-line .line-save-button:hover { border-color: #8eafa0; background: #edf5f1; }
}

@media (max-width: 900px) {
  .outbound-scan-shell { width: min(100% - 28px, 1080px); }
  .outbound-page-intro { grid-template-columns: 1fr; gap: 8px; }
  .outbound-page-intro > p:last-child { max-width: 38rem; }
  .outbound-scanner-card { grid-template-columns: 1fr; gap: 13px; padding: 19px; }
  .outbound-feedback { grid-column: auto; }
}

@media (max-width: 560px) {
  .outbound-scan-shell { width: min(100% - 22px, 1080px); padding-top: 22px; }
  .outbound-page-intro { gap: 7px; margin-bottom: 17px; }
  .outbound-page-intro h1 { font-size: 1.78rem; }
  .outbound-page-intro > p:last-child { font-size: 0.76rem; line-height: 1.5; }
  .outbound-batch-bar { padding: 10px 12px; }
  .outbound-scanner-card { gap: 11px; padding: 16px; border-radius: 16px; }
  .outbound-scanner-copy h2 { font-size: 1.08rem; }
  .outbound-input-row { grid-template-columns: minmax(0, 1fr) 66px; }
  .outbound-input-row input { min-height: 46px; font-size: 0.88rem; }
  .outbound-input-row .confirm-receiving { min-width: 0; min-height: 46px; padding-inline: 8px; }
  .outbound-summary > div { padding: 11px 10px; }
  .outbound-summary strong { font-size: 1.14rem; }
  .outbound-result-section { margin-top: 13px; padding: 15px 13px; border-radius: 15px; }
  .outbound-result-heading { margin-bottom: 10px; }
  .outbound-result-heading h2 { font-size: 1.02rem; }
  .outbound-line,
  .outbound-line--unknown {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-height: 58px;
    padding: 9px 10px;
  }
  .outbound-line .outbound-size { grid-column: 1; }
  .outbound-line .outbound-quantity {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .outbound-line form {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .outbound-line form .line-save-button { width: auto; min-height: 34px; }
  .outbound-line--unknown > strong { grid-column: 2; grid-row: 1; }
  .outbound-line--unknown form { grid-column: 3; grid-row: 1; }
  .outbound-complete-card { gap: 13px; margin-top: 14px; padding: 16px; }
  .outbound-complete-card form { min-width: 0; }
  .outbound-history { margin-top: 28px; padding-top: 22px; }
}

/* Stocktake entry: compact, optically aligned quantity rows on narrow phones. */
@media (max-width: 560px) {
  .stocktake-results { scroll-margin-top: 74px; }
  .stocktake-results .section-heading {
    align-items: flex-end;
    gap: 12px;
  }
  .stocktake-results .section-heading h2 { font-size: 1.18rem; }
  .stocktake-result-card .receiving-product { padding: 17px 15px; }
  .stocktake-result-card .assigned-recheck-note { padding: 12px 15px; }
  .stocktake-form { padding: 0 14px 18px; }
  .stocktake-grid {
    grid-template-columns: minmax(104px, 1fr) 68px 78px;
    gap: 8px;
    min-height: 52px;
  }
  .stocktake-grid--head {
    min-height: 38px;
    font-size: 0.68rem;
    font-weight: 720;
  }
  .stocktake-grid > :nth-child(2) { text-align: center; }
  .stocktake-grid > :nth-child(3) { text-align: center; }
  .stocktake-grid > strong {
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .stocktake-grid .expected-stock { font-size: 0.8rem; }
  .stocktake-grid > div:last-child {
    width: 76px;
    justify-self: center;
  }
  .stocktake-grid input[type="number"] {
    width: 76px;
    min-height: 38px;
    padding: 6px 7px;
    border-radius: 9px;
    font-size: 0.82rem;
    text-align: center;
  }
}

/* Keep the primary inventory search title centered on iPad and iPhone. */
@media (max-width: 900px) {
  .app-shell--home .search-panel { justify-items: center; text-align: center; }
  .app-shell--home .search-panel h1 {
    width: 100%;
    justify-self: center;
    text-align: center;
  }
}

/* Purchase receiving: ordinary count first, scanner as a secondary mode. */
.receipt-completed-list {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.receipt-history-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.receipt-history-pagination a {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eef4f0;
  color: var(--green-2);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.receipt-history-pagination a:last-child { justify-self: end; }
.receipt-history-pagination strong { color: var(--muted); font-size: 0.72rem; }
.receipt-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 20px 18px;
  padding: 4px;
  border-radius: 13px;
  background: #edf2ef;
}
.receipt-mode-switch a,
.receipt-mode-switch span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 180ms ease, transform 90ms var(--ease-press);
}
.receipt-mode-switch span[aria-current="page"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(23, 50, 43, 0.08);
}
.receipt-mode-switch a:active { transform: scale(0.975); }
.receipt-count-form { scroll-margin-top: 80px; }
.receipt-line-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px auto auto;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 18px rgba(23, 50, 43, 0.035);
}
.receipt-line-tools input,
.receipt-line-tools select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 13px;
  border: 1px solid #d3ddd8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 560;
  line-height: 1.35;
}
.receipt-line-tools button {
  min-height: 42px;
  padding: 8px 17px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}
.receipt-line-tools > a {
  padding: 9px 5px;
  color: var(--green-2);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.receipt-count-sheet,
.receipt-scan-progress,
.receipt-defect-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(23, 50, 43, 0.04);
}
.receipt-scan-progress .receipt-result-heading > a {
  color: var(--green-2);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}
.receipt-count-table {
  overflow: hidden;
  border: 1px solid #dfe7e3;
  border-radius: 13px;
}
.receipt-count-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 92px 118px 82px 92px;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 10px 14px;
  border-bottom: 1px solid #e7ece9;
  background: #fff;
  transition: background-color 150ms ease, box-shadow 180ms ease;
}
.receipt-count-row:last-child { border-bottom: 0; }
.receipt-count-group + .receipt-count-group { border-top: 7px solid #f0f4f2; }
.receipt-count-row--group {
  min-height: 58px;
  padding-block: 9px;
  border-bottom-color: #d9e4de;
  background: #f3f7f5;
}
.receipt-count-row--size { min-height: 58px; }
.receipt-count-row--header {
  min-height: 42px;
  padding-block: 8px;
  background: #f4f7f5;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 620;
}
.receipt-count-row--header span:not(:first-child) { text-align: center; }
.receipt-count-row.is-balanced { background: #fbfdfc; }
.receipt-count-row.is-over { background: #fffaf8; }
.receipt-count-row--group,
.receipt-count-row--group.is-balanced { background: #f3f7f5; }
.receipt-count-row--group.is-over { background: #fff5f1; }
.receipt-count-row:focus-within {
  position: relative;
  z-index: 1;
  background: #f8fbf9;
  box-shadow: inset 3px 0 #62947e;
}
.receipt-count-product { display: grid; gap: 4px; min-width: 0; }
.receipt-count-product strong { font-size: 0.88rem; font-weight: 760; letter-spacing: -0.005em; }
.receipt-count-product-meta {
  display: flex;
  gap: 7px;
  align-items: baseline;
  min-width: 0;
}
.receipt-count-product-meta b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 620;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.receipt-count-product-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 450;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.receipt-count-product.is-continuation {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding-left: 12px;
  border-left: 2px solid #dce7e1;
}
.receipt-count-product.is-continuation .receipt-count-product-meta b {
  font-size: 0.8rem;
}
.receipt-count-expected,
.receipt-count-net,
.receipt-count-arrived,
.receipt-count-difference { display: grid; justify-items: center; gap: 4px; }
.receipt-count-expected small,
.receipt-count-net small,
.receipt-count-arrived small,
.receipt-count-difference small { display: none; color: var(--muted); font-size: 0.6rem; }
.receipt-count-expected strong,
.receipt-count-arrived--summary strong,
.receipt-count-net strong,
.receipt-count-difference strong {
  font-size: 0.82rem;
  font-weight: 620;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.receipt-count-difference { color: #8b6820; }
.receipt-count-row.is-balanced .receipt-count-difference { color: var(--green-2); }
.receipt-count-row.is-over .receipt-count-difference { color: #a14338; }
.receipt-count-arrived input {
  width: 86px;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid #ccd9d3;
  border-radius: 9px;
  background: #fbfcfb;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 620;
  line-height: 1.35;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 160ms ease;
}
.receipt-count-arrived input:focus {
  border-color: #78a18f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(57, 118, 94, 0.1);
  outline: none;
}
.receipt-line-pagination {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 13px;
}
.receipt-line-pagination > a,
.receipt-line-pagination > button {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #c9dad2;
  border-radius: 9px;
  background: #f7faf8;
  color: var(--green-2);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.receipt-line-pagination > :last-child { justify-self: end; }
.receipt-line-pagination__status {
  display: grid;
  gap: 1px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.receipt-line-pagination__status small {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 500;
}
.receipt-lines-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 30px 16px;
  border: 1px dashed #cddbd4;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.74rem;
}
.receipt-lines-empty a { color: var(--green-2); font-weight: 700; text-decoration: none; }
.receipt-count-actions {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #d9e5df;
  border-radius: 15px;
  background: #f3f8f5;
}
.receipt-count-actions--confirmed { background: #eef7f2; }
.receipt-count-actions > div:first-child { display: grid; gap: 4px; min-width: 0; }
.receipt-count-actions > div:first-child strong {
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0;
}
.receipt-count-actions > div:first-child small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 480;
  line-height: 1.45;
}
.receipt-count-buttons { display: flex; gap: 11px; align-items: center; }
.receipt-count-buttons button {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}
.receipt-save-button {
  border: 1px solid #aec7bb;
  background: #fff;
  color: var(--green-2);
}
.receipt-count-buttons .receipt-difference-confirm {
  max-width: none;
  align-items: center;
  gap: 8px;
  color: #765e13;
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1.4;
  white-space: nowrap;
}
.receipt-count-buttons .receipt-difference-confirm input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green-2);
}
.receipt-defect-section { margin-top: 24px; scroll-margin-top: 80px; }
.receipt-defect-entry {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.75fr) minmax(160px, 1fr) 78px auto;
  gap: 9px;
  align-items: end;
  padding: 14px;
  border-radius: 13px;
  background: #f6f8f7;
}
.receipt-defect-entry label { display: grid; gap: 6px; color: var(--muted); font-size: 0.72rem; font-weight: 600; line-height: 1.35; }
.receipt-defect-entry select,
.receipt-defect-entry input {
  min-width: 0;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid #d3ddd8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 560;
  line-height: 1.35;
}
.receipt-defect-entry input { padding-right: 12px; }
.receipt-defect-entry select:disabled {
  opacity: 1;
  background-color: #f2f5f3;
  color: #78857f;
  font-weight: 560;
  -webkit-text-fill-color: #78857f;
}
.receipt-defect-entry button {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 9px;
  background: #7b5b16;
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}
.receipt-defect-list { display: grid; gap: 7px; margin-top: 12px; }
.receipt-defect-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid #ead9ac;
  border-radius: 11px;
  background: #fffbf1;
}
.receipt-defect-list > div > span { display: grid; gap: 2px; }
.receipt-defect-list strong { font-size: 0.78rem; }
.receipt-defect-list small { color: #816e43; font-size: 0.65rem; }
.receipt-defect-list form { margin: 0; }
.receipt-defect-list button {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #d8bd75;
  border-radius: 8px;
  background: #fff;
  color: #765e13;
  font-size: 0.68rem;
}
.receipt-no-defects {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 11px;
  background: #f7f9f8;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}
.receipt-scan-line-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.receipt-scan-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 82px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
}
.receipt-scan-line:last-child { border-bottom: 0; }
.receipt-scan-line > span:first-child { display: flex; gap: 8px; align-items: baseline; }
.receipt-scan-line small { color: var(--muted); }
.receipt-scan-line > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-scan-line.is-balanced { background: #f5faf7; color: var(--green-2); }
.receipt-scan-line.is-over { background: #fff7f4; color: #a14338; }
.receipt-scan-line.is-recently-updated { animation: receipt-line-highlight 650ms ease-out; }

@media (hover: hover) and (pointer: fine) {
  .receipt-mode-switch a:hover,
  .receipt-history-pagination a:hover { background: #e3eee8; color: var(--green); }
  .receipt-save-button:hover,
  .receipt-line-pagination > a:hover,
  .receipt-line-pagination > button:hover { background: #edf5f1; }
  .receipt-line-tools select:hover,
  .receipt-defect-entry select:not(:disabled):hover,
  .receipt-defect-entry input:hover { border-color: #aebfb6; background-color: #fcfdfc; }
}

.receipt-line-tools select:focus,
.receipt-defect-entry select:focus,
.receipt-defect-entry input:focus {
  border-color: #78a18f;
  outline: none;
  box-shadow: 0 0 0 3px rgba(57, 118, 94, 0.1);
}
.receipt-line-tools button,
.receipt-defect-entry button {
  transition: filter 150ms ease, box-shadow 180ms var(--ease-fluid), transform 90ms var(--ease-press);
}
.receipt-line-tools button:not(:disabled):active,
.receipt-defect-entry button:not(:disabled):active { transform: scale(0.975); }

@media (max-width: 760px) {
  .receipt-line-tools { grid-template-columns: minmax(0, 1fr) 150px auto; }
  .receipt-line-tools > a { grid-column: 1 / -1; justify-self: end; padding: 2px 5px; }
  .receipt-count-row { grid-template-columns: minmax(180px, 1fr) 78px 98px 64px 74px; gap: 8px; padding-inline: 11px; }
  .receipt-count-actions { grid-template-columns: 1fr; gap: 13px; }
  .receipt-count-buttons { justify-content: flex-end; }
  .receipt-defect-entry { grid-template-columns: repeat(2, minmax(0, 1fr)) 72px; }
  .receipt-defect-entry label:nth-of-type(3) { grid-column: 1 / 3; }
  .receipt-defect-entry button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .receipt-completed-list { margin-top: 28px; padding-top: 22px; }
  .receipt-history-list a { align-items: flex-start; }
  .receipt-history-list a > span:last-child { max-width: 82px; text-align: right; }
  .receipt-mode-switch { margin: 0 10px 12px; }
  .receipt-mode-switch a,
  .receipt-mode-switch span { min-height: 39px; font-size: 0.73rem; }
  .receipt-line-tools {
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 7px;
    margin-inline: 0;
    padding: 9px;
  }
  .receipt-line-tools button { grid-column: 1 / -1; min-height: 39px; }
  .receipt-line-tools > a { grid-column: 1 / -1; }
  .receipt-count-sheet,
  .receipt-scan-progress,
  .receipt-defect-section { padding: 14px 12px; border-radius: 15px; }
  .receipt-count-sheet .receipt-result-heading { align-items: baseline; }
  .receipt-count-row--header { display: none; }
  .receipt-count-row {
    grid-template-columns: minmax(0, 1fr) 70px 60px;
    grid-template-rows: auto auto;
    gap: 6px 8px;
    min-height: 82px;
    padding: 11px;
  }
  .receipt-count-group + .receipt-count-group { border-top-width: 6px; }
  .receipt-count-row--group { min-height: 78px; }
  .receipt-count-row--size { min-height: 74px; }
  .receipt-count-product { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .receipt-count-product strong { font-size: 0.84rem; }
  .receipt-count-product-meta { display: grid; gap: 2px; }
  .receipt-count-product-meta b { font-size: 0.72rem; }
  .receipt-count-product-meta small { display: -webkit-box; font-size: 0.61rem; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .receipt-count-product.is-continuation { padding-left: 8px; }
  .receipt-count-product.is-continuation .receipt-count-product-meta b { font-size: 0.76rem; }
  .receipt-count-expected { grid-column: 2; grid-row: 1; }
  .receipt-count-difference { grid-column: 3; grid-row: 1; }
  .receipt-count-arrived { grid-column: 2; grid-row: 2; }
  .receipt-count-net { grid-column: 3; grid-row: 2; }
  .receipt-count-expected small,
  .receipt-count-net small,
  .receipt-count-arrived small,
  .receipt-count-difference small { display: block; }
  .receipt-count-arrived input { width: 66px; min-height: 38px; padding: 5px; font-size: 0.78rem; }
  .receipt-count-expected strong,
  .receipt-count-arrived--summary strong,
  .receipt-count-net strong,
  .receipt-count-difference strong { font-size: 0.76rem; }
  .receipt-count-actions { margin-top: 10px; padding: 14px; }
  .receipt-line-pagination { grid-template-columns: 1fr auto 1fr; gap: 7px; }
  .receipt-line-pagination > a,
  .receipt-line-pagination > button { min-height: 38px; padding: 7px 8px; font-size: 0.64rem; }
  .receipt-line-pagination__status { font-size: 0.64rem; }
  .receipt-count-buttons { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .receipt-count-buttons .receipt-difference-confirm {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: none;
  }
  .receipt-count-buttons button { width: 100%; }
  .receipt-count-buttons button:only-child { grid-column: 1 / -1; }
  .receipt-defect-entry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 11px; }
  .receipt-defect-entry button { grid-column: 1 / -1; }
  .receipt-defect-entry select,
  .receipt-defect-entry input,
  .receipt-defect-entry button { min-height: 40px; }
  .receipt-defect-list > div { gap: 8px; padding: 8px 9px; }
  .receipt-scan-line { grid-template-columns: minmax(0, 1fr) 72px 58px; gap: 8px; padding-inline: 10px; }
  .receipt-scanner-card { margin-inline: 10px; }
}

/* Mobile home refinement: compact search, touch-first cards and anchored menus. */
.topbar { min-height: 64px; padding-block: 6px; }
.account-menu { position: relative; z-index: 20; }
.account-menu-backdrop {
  position: fixed;
  z-index: 9;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(15, 35, 29, 0.18);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.account-menu-backdrop[hidden] { display: none; }
.account-menu > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu__identity { display: grid; min-width: 0; gap: 1px; }
.account-menu__identity strong {
  overflow: hidden;
  max-width: 9.5rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu__chevron {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--green-2);
  border-bottom: 1.5px solid var(--green-2);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms var(--ease-fluid);
}
.account-menu[open] .account-menu__chevron { transform: translateY(2px) rotate(225deg); }
.account-menu__panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 156px;
  padding: 6px;
  border: 1px solid rgba(23, 63, 53, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(18, 49, 41, 0.16);
  transform-origin: top right;
}
.account-menu__full-identity {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 7px 12px 8px;
  border-bottom: 1px solid rgba(23, 63, 53, 0.08);
  text-align: left;
}
.account-menu__full-identity strong {
  overflow: visible;
  max-width: none;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 790;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}
.account-menu__full-identity span {
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.3;
}
.account-menu__logout {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.account-menu__logout:hover { background: var(--mint); }
.account-menu > summary:active,
.account-menu__logout:active,
.logout-dialog__cancel:active,
.logout-dialog__confirm:active,
.site-about-button:active,
.about-dialog__close:active { transform: scale(0.97); transition-duration: 70ms; }

.logout-dialog {
  width: min(360px, calc(100% - 28px));
  max-width: none;
  padding: 0;
  border: 1px solid rgba(23, 63, 53, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(14, 42, 34, 0.24);
}
.logout-dialog::backdrop { background: rgba(15, 35, 29, 0.42); backdrop-filter: blur(3px); }
.logout-dialog__surface { padding: 24px; }
.logout-dialog__surface h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.4;
  text-align: center;
}
.logout-dialog__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.logout-dialog__actions form { margin: 0; }
.logout-dialog__cancel,
.logout-dialog__confirm {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 780;
  cursor: pointer;
}
.logout-dialog__cancel {
  border: 1px solid rgba(23, 63, 53, 0.18);
  background: #fff;
  color: var(--green);
}
.logout-dialog__confirm {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}
.logout-dialog__confirm:disabled { opacity: 0.7; cursor: wait; }

.action-card__content { min-width: 0; }
.action-card .action-title-row { display: block; }
.action-card .action-badge-line {
  display: flex;
  min-height: 24px;
  align-items: center;
  margin: 2px 0 6px;
}

@media (max-width: 560px) {
  html { scroll-padding-top: 70px; }
  .topbar {
    min-height: 58px;
    padding: 5px 9px;
  }
  .wordmark { gap: 7px; padding: 3px; }
  .brand-logo--header { width: 34px; height: 34px; }
  .wordmark-text strong { font-size: 0.92rem; }
  .wordmark-text small { font-size: 0.59rem; }
  .user-area { gap: 0; }
  .account-menu > summary { gap: 7px; padding: 3px 5px 3px 7px; }
  .account-menu__identity strong { max-width: 5.6rem; font-size: 0.76rem; }
  .account-menu__identity span { font-size: 0.63rem; }
  .account-menu__panel {
    right: 0;
    width: 152px;
    padding: 5px;
  }

  .app-shell--home { padding-top: 14px; }
  .app-shell--home .search-panel {
    gap: 18px;
    margin-bottom: 22px;
    padding: 15px;
    border-radius: 18px;
  }
  .app-shell--home .search-panel h1 {
    justify-self: stretch;
    font-size: clamp(1.375rem, 5.8vw, 1.42rem);
    text-align: center;
  }
  .app-shell--home .search-form {
    gap: 6px;
    padding: 3px;
    border-color: rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 7px 18px rgba(7, 31, 25, 0.08);
  }
  .app-shell--home .search-form:focus-within {
    background: rgba(255, 255, 255, 0.075);
    box-shadow: 0 0 0 3px rgba(220, 233, 177, 0.12), 0 9px 22px rgba(7, 31, 25, 0.11);
  }
  .app-shell--home .search-form input {
    min-height: 46px;
    padding: 9px 11px;
    font-size: 1rem;
  }
  .app-shell--home .search-form button {
    min-width: 64px;
    min-height: 46px;
    padding-inline: 12px;
    font-size: 0.84rem;
  }
  .app-shell--home .search-results { scroll-margin-top: 74px; }
  .app-shell--home .section-heading { margin-bottom: 11px; }
  .app-shell--home .action-grid {
    grid-auto-rows: auto;
    gap: 10px;
  }
  .app-shell--home .action-card {
    height: auto;
    min-height: 0;
    gap: 8px;
    padding: 14px;
    border-radius: 15px;
  }
  .app-shell--home .action-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
  }
  .app-shell--home .action-icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  .app-shell--home .action-icon svg { width: 22px; height: 22px; }
  .app-shell--home .action-card strong {
    margin: 0;
    font-size: 0.91rem;
    line-height: 1.22;
  }
  .app-shell--home .action-card .action-badge-line {
    height: 20px;
    min-height: 20px;
    margin: 2px 0 4px;
  }
  .app-shell--home .action-badge {
    min-height: 19px;
    padding: 2px 6px;
    font-size: 0.59rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.015em;
    white-space: nowrap;
  }
  .app-shell--home .action-card small {
    display: block;
    overflow: visible;
    font-size: 0.72rem;
    line-height: 1.38;
    -webkit-line-clamp: unset;
  }

  .site-about-button { min-height: 38px; margin-top: 2px; }
  .about-dialog { width: calc(100% - 24px); max-height: min(78svh, 560px); border-radius: 19px; }
  .about-dialog__header { padding: 14px 12px 11px 18px; }
  .about-dialog__header h2 { font-size: 1.12rem; }
  .about-dialog__content { padding: 17px 18px 20px; font-size: 0.82rem; }
}

@media (max-width: 360px) {
  .account-menu__identity strong { max-width: 4.5rem; }
  .app-shell--home { width: min(100% - 20px, 1180px); }
  .app-shell--home .search-panel { padding-inline: 12px; }
  .app-shell--home .action-card { gap: 7px; padding: 10px; }
  .app-shell--home .action-icon { flex-basis: 34px; width: 34px; height: 34px; }
  .app-shell--home .action-icon svg { width: 21px; height: 21px; }
  .app-shell--home .action-card strong { font-size: 0.87rem; }
  .app-shell--home .action-card small { font-size: 0.69rem; }
  .app-shell--home .action-badge { font-size: 0.55rem; }
}

@media (max-width: 900px) and (max-height: 560px) {
  .topbar { min-height: 58px; padding-block: 5px; }
  .wordmark { gap: 8px; padding: 4px; }
  .brand-logo--header { width: 36px; height: 36px; }
  .wordmark-text strong { font-size: 0.98rem; }
  .wordmark-text small { font-size: 0.62rem; }
  .app-shell--home { padding-top: 13px; }
  .app-shell--home .search-panel {
    grid-template-columns: minmax(130px, 0.35fr) minmax(300px, 1fr);
    gap: 17px;
    margin-bottom: 20px;
    padding: 16px 18px;
  }
  .app-shell--home .search-panel h1 { font-size: 1.42rem; }
  .app-shell--home .search-form {
    border-color: rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 7px 18px rgba(7, 31, 25, 0.08);
  }
  .app-shell--home .search-form:focus-within {
    background: rgba(255, 255, 255, 0.075);
    box-shadow: 0 0 0 3px rgba(220, 233, 177, 0.12), 0 9px 22px rgba(7, 31, 25, 0.11);
  }
  .app-shell--home .search-form input { min-height: 46px; font-size: 1rem; }
  .app-shell--home .search-form button { min-height: 46px; }
  .app-shell--home .action-grid { grid-auto-rows: auto; gap: 10px; }
  .app-shell--home .action-card { min-height: 0; height: auto; padding: 13px; }
  .app-shell--home .action-card .action-badge-line { height: 24px; min-height: 24px; margin-block: 2px 4px; }
  .app-shell--home .action-card small { display: block; overflow: visible; -webkit-line-clamp: unset; }
}

@media (prefers-reduced-motion: reduce) {
  .account-menu__chevron { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .account-menu__panel,
  .logout-dialog,
  .about-dialog { background: #fff; backdrop-filter: none; }
  .account-menu-backdrop { background: rgba(15, 35, 29, 0.32); }
}

/* Receiving workflow: compact hierarchy and touch-first purchase lists. */
.topbar--receiving .user-area--receiving {
  min-width: 0;
  gap: 8px;
}
.topbar-home-link {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  flex: none;
  padding: 7px 8px;
  border-radius: 10px;
  color: var(--green-2);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-home-link:hover { background: var(--mint); }
.topbar-home-link:active { transform: scale(0.97); }

.receiving-workflow-intro,
.purchase-receipt-intro {
  min-height: 0;
  margin-bottom: 10px;
}
.receiving-workflow-intro h1,
.purchase-receipt-intro h1 {
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  line-height: 1.16;
}
.receipt-page-tools {
  align-items: center;
  margin-bottom: 22px;
}
.receiving-workflow-switch {
  border-color: rgba(23, 63, 53, 0.08);
  background: rgba(231, 240, 235, 0.78);
}
.receiving-workflow-switch a,
.receiving-workflow-switch span {
  color: #526860;
}
.receiving-workflow-switch span[aria-current="page"] {
  background: #dceee5;
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(23, 63, 53, 0.06);
}
.receiving-workflow-switch a:focus-visible,
.receipt-batch-card:focus-visible,
.receipt-history-card:focus-visible,
.topbar-home-link:focus-visible {
  outline: 3px solid rgba(39, 112, 84, 0.28);
  outline-offset: 2px;
}

.receipt-batch-section { margin-top: 0; }
.receipt-section-heading { margin-bottom: 13px; }
.receipt-section-heading > div { gap: 8px; }
.purchase-receipt-shell .receipt-section-heading h2 {
  font-size: 1.08rem;
  font-weight: 700;
}
.receipt-section-heading span {
  padding: 3px 7px;
  background: rgba(228, 239, 233, 0.82);
  font-size: 0.66rem;
}
.receipt-batch-list { gap: 10px; }
.receipt-batch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
  padding: 18px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(19, 54, 45, 0.06);
  -webkit-tap-highlight-color: transparent;
}
.receipt-batch-card__header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.receipt-batch-card__header strong {
  min-width: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.receipt-batch-card__arrow {
  flex: none;
  margin-top: -2px;
  color: #71867d;
  font-size: 1.55rem;
  line-height: 1;
}
.receipt-batch-card__meta,
.receipt-batch-card__transport {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.receipt-batch-card__transport { margin-top: 2px; }
.receipt-batch-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding-top: 12px;
  border-top: 1px solid rgba(23, 63, 53, 0.075);
}
.receipt-batch-card__footer > strong {
  color: var(--green);
  font-size: 0.94rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.receipt-status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.receipt-status-pill--pending {
  background: #f8e9b6;
  color: #755d19;
}

.receipt-completed-list {
  margin-top: 27px;
  padding-top: 21px;
  border-top: 1px solid rgba(23, 63, 53, 0.075);
}
.receipt-history-list { gap: 8px; }
.receipt-history-list .receipt-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(23, 63, 53, 0.055);
  border-radius: 13px;
  background: rgba(243, 246, 244, 0.72);
  -webkit-tap-highlight-color: transparent;
}
.receipt-history-list .receipt-history-card:hover { background: rgba(237, 243, 239, 0.94); }
.receipt-history-card:active { transform: scale(0.99); }
.receipt-history-card__main { display: grid; min-width: 0; gap: 6px; }
.receipt-history-list .receipt-history-card__name {
  display: block;
  min-width: 0;
  overflow: visible;
  font-size: 0.84rem;
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
.receipt-history-card__meta,
.receipt-history-list .receipt-history-card__aux {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}
.receipt-history-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(23, 63, 53, 0.075);
}
.receipt-history-card__quantity {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.receipt-history-card__action {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  color: var(--green-2);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.receipt-history-card__action b {
  margin-left: 5px;
  font-size: 1.05rem;
  font-weight: 500;
}

@media (max-width: 560px) {
  .topbar--receiving .wordmark { min-width: 0; }
  .topbar--receiving .wordmark-text { min-width: 0; }
  .topbar--receiving .wordmark-text strong,
  .topbar--receiving .wordmark-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar--receiving .user-area--receiving { margin-left: auto; }
  .topbar-home-link { min-height: 44px; padding-inline: 5px; font-size: 0.7rem; }
  .topbar--receiving .account-menu__identity strong { max-width: 4.8rem; }

  .receiving-workflow-shell,
  .purchase-receipt-shell {
    width: min(100% - 24px, 1060px);
    padding-top: 15px;
  }
  .receiving-workflow-intro,
  .purchase-receipt-intro {
    min-height: 0;
    margin-bottom: 9px;
  }
  .receiving-workflow-intro h1,
  .purchase-receipt-intro h1 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.015em;
  }
  .receipt-page-tools { gap: 7px; margin-bottom: 18px; }
  .receiving-workflow-switch { padding: 3px; border-radius: 12px; }
  .receiving-workflow-switch a,
  .receiving-workflow-switch span {
    min-height: 44px;
    padding: 8px 9px;
    border-radius: 9px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
  }
  .receiving-workflow-switch span[aria-current="page"] { font-weight: 600; }
  .receipt-back-link { min-height: 38px; justify-self: start; padding-block: 5px; }
  .receipt-section-heading { margin-bottom: 11px; }
  .purchase-receipt-shell .receipt-section-heading h2 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
  }
  .purchase-receipt-shell .receipt-section-heading span {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
  }
  .receipt-batch-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    min-height: 0;
    padding: 15px;
    border-radius: 15px;
  }
  .receipt-batch-card__header strong {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
  }
  .receipt-batch-card__meta,
  .receipt-batch-card__transport {
    color: #64766f;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
  }
  .receipt-batch-card__footer { margin-top: 8px; padding-top: 10px; }
  .receipt-batch-card__footer > strong {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
  }
  .receipt-status-pill {
    min-height: 26px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
  }
  .receipt-completed-list { margin-top: 23px; padding-top: 18px; }
  .receipt-history-list .receipt-history-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }
  .receipt-history-list .receipt-history-card__name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
  }
  .receipt-history-card__meta,
  .receipt-history-list .receipt-history-card__aux {
    color: #64766f;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
  }
  .receipt-history-card__footer {
    flex-wrap: wrap;
    gap: 4px 12px;
    padding-top: 10px;
  }
  .receipt-history-list .receipt-history-card > .receipt-history-card__footer {
    width: 100%;
    max-width: none;
    text-align: left;
  }
  .receipt-history-card__quantity {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
  }
  .receipt-history-card__action {
    min-width: 0;
    min-height: 44px;
    justify-content: flex-end;
    padding: 0;
    border: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
  }
}

@media (max-width: 350px) {
  .topbar--receiving { padding-inline: 7px; }
  .topbar--receiving .wordmark { gap: 5px; }
  .topbar--receiving .brand-logo--header { width: 32px; height: 32px; }
  .topbar--receiving .wordmark-text strong { font-size: 0.82rem; }
  .topbar--receiving .wordmark-text small { font-size: 0.51rem; }
  .topbar--receiving .account-menu > summary { gap: 5px; padding-inline: 4px; }
  .topbar--receiving .account-menu__identity strong { max-width: 3.6rem; font-size: 0.7rem; }
  .topbar--receiving .account-menu__identity span { font-size: 0.58rem; }
  .topbar-home-link { padding-inline: 3px; font-size: 0.66rem; }
  .receipt-history-card__footer { align-items: center; }
}

/* Purchase receipt detail: compact, task-first counting workspace. */
.purchase-receipt-shell--detail { width: min(960px, calc(100% - 40px)); }
.purchase-receipt-shell--detail .receipt-page-tools { margin-bottom: 14px; }
.purchase-receipt-shell--detail .receipt-primary-workspace {
  overflow: visible;
  margin-bottom: 18px;
  border: 1px solid rgba(23, 63, 53, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}
.purchase-receipt-shell--detail .receipt-batch-hero {
  align-items: flex-start;
  padding: 16px 18px 12px;
  border: 0;
  background: transparent;
}
.purchase-receipt-shell--detail .receipt-batch-hero h2 { font-size: 1.12rem; line-height: 1.4; overflow-wrap: anywhere; }
.purchase-receipt-shell--detail .receipt-batch-hero p { font-size: 0.78rem; line-height: 1.5; }
.purchase-receipt-shell--detail .receipt-mode-switch { margin: 0 14px 14px; }
.receipt-feedback--shared { margin: 0 0 12px; }

.receipt-detail-section {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid rgba(23, 63, 53, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}
.receipt-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.receipt-detail-heading > div { display: flex; flex-wrap: wrap; gap: 7px 9px; align-items: baseline; }
.receipt-detail-heading h2 { margin: 0; font-size: 1.08rem; font-weight: 700; line-height: 1.4; }
.receipt-detail-heading span {
  padding: 2px 7px;
  border-radius: 999px;
  background: #e9f2ed;
  color: var(--green-2);
  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1.45;
}
.receipt-detail-heading > a { min-height: 36px; padding: 7px 2px; color: var(--green-2); font-size: 0.72rem; font-weight: 700; text-decoration: none; }
.receipt-count-heading { align-items: flex-end; }
.receipt-count-heading p { max-width: 32rem; margin: 0; color: #63766e; font-size: 0.74rem; line-height: 1.5; text-align: right; }

.receipt-filter-section { padding-bottom: 14px; }
.receipt-filter-section .receipt-line-tools {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.45fr) auto;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.receipt-filter-section .receipt-line-tools label { display: grid; gap: 5px; min-width: 0; }
.receipt-filter-section .receipt-line-tools label > span { color: #5f746b; font-size: 0.7rem; font-weight: 650; line-height: 1.35; }
.receipt-filter-section .receipt-line-tools input,
.receipt-filter-section .receipt-line-tools select,
.receipt-filter-section .receipt-line-tools button { min-height: 44px; font-size: 0.82rem; }

.receipt-count-form { scroll-margin-top: 74px; }
.receipt-count-sheet { padding-bottom: 14px; }
.receipt-count-groups { display: grid; gap: 12px; }
.receipt-count-group { overflow: hidden; border: 1px solid rgba(23, 63, 53, 0.11); border-radius: 13px; background: #fff; }
.receipt-product-summary {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(360px, 1.3fr);
  gap: 14px;
  align-items: center;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(23, 63, 53, 0.1);
  background: #eef5f1;
}
.receipt-product-summary > div { display: grid; min-width: 0; gap: 2px; }
.receipt-product-summary > div strong { color: var(--ink); font-size: 1rem; font-weight: 720; line-height: 1.35; overflow-wrap: anywhere; }
.receipt-product-summary > div small { color: #60736b; font-size: 0.68rem; line-height: 1.4; }
.receipt-product-summary dl,
.receipt-size-metrics,
.receipt-order-metrics { margin: 0; }
.receipt-product-summary dl { display: grid; grid-template-columns: repeat(4, minmax(58px, 1fr)); gap: 8px; }
.receipt-product-summary dl > div { display: flex; gap: 5px; align-items: baseline; justify-content: center; }
.receipt-product-summary dt,
.receipt-size-metrics small,
.receipt-order-metrics dt { color: #64766f; font-size: 0.7rem; font-weight: 500; line-height: 1.35; }
.receipt-product-summary dd { margin: 0; color: var(--ink); font-size: 0.82rem; font-weight: 680; line-height: 1.35; font-variant-numeric: tabular-nums; }
.receipt-size-list { display: grid; }
.receipt-size-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.65fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 70px;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(23, 63, 53, 0.08);
  background: #fff;
  transition: background-color 150ms ease, box-shadow 160ms ease;
}
.receipt-size-row:last-child { border-bottom: 0; }
.receipt-size-row:focus-within { position: relative; z-index: 1; background: #f8fbf9; box-shadow: inset 3px 0 #62947e; }
.receipt-size-row__primary { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.receipt-size-name,
.receipt-arrival-control { display: flex; min-width: 0; align-items: center; gap: 6px; }
.receipt-size-name small,
.receipt-arrival-control small { color: #64766f; font-size: 0.7rem; line-height: 1.35; }
.receipt-size-name strong { min-width: 0; color: var(--ink); font-size: 0.92rem; font-weight: 680; line-height: 1.35; overflow-wrap: anywhere; }
.receipt-arrival-control input {
  width: 86px;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid #c8d8d0;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.receipt-arrival-control input:focus { border-color: #5f927c; outline: none; box-shadow: 0 0 0 2px rgba(57, 118, 94, 0.09); }
.receipt-arrival-control input:disabled { background: #f2f5f3; color: #53655d; opacity: 1; }
.receipt-size-metrics { display: grid; grid-template-columns: repeat(3, minmax(70px, 1fr)); gap: 8px; }
.receipt-size-metrics > span { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.receipt-size-metrics strong { color: var(--ink); font-size: 0.84rem; font-weight: 650; line-height: 1.35; font-variant-numeric: tabular-nums; }
.receipt-difference-value.is-different,
.receipt-difference-value.is-different strong,
.receipt-difference-value.is-different dd { color: #9b3e34; font-weight: 720; }
.receipt-difference-value.is-under,
.receipt-difference-value.is-under strong,
.receipt-difference-value.is-under dd { color: #9a4e25; }

.receipt-page-controls {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(230px, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(23, 63, 53, 0.08);
}
.receipt-page-controls__previous,
.receipt-page-controls__actions { display: flex; gap: 7px; align-items: center; }
.receipt-page-controls__actions { justify-content: flex-end; }
.receipt-page-controls a,
.receipt-page-controls button,
.receipt-page-controls .is-disabled {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  padding: 8px 12px;
  border: 1px solid #c9dad2;
  border-radius: 9px;
  background: #f7faf8;
  color: var(--green-2);
  font-family: inherit;
  font-size: 0.71rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.receipt-page-controls button.is-primary { border-color: var(--green); background: var(--green); color: #fff; }
.receipt-page-controls .is-disabled { border-color: transparent; background: transparent; color: #9aa7a1; }
.receipt-page-controls__status { display: grid; gap: 2px; text-align: center; font-variant-numeric: tabular-nums; }
.receipt-page-controls__status strong { font-size: 0.72rem; line-height: 1.35; }
.receipt-page-controls__status small { color: #66776f; font-size: 0.64rem; line-height: 1.4; }
.receipt-page-controls__status b { font-weight: 650; }
.receipt-page-controls__status b.is-warning { color: #8b651b; }
.receipt-page-controls__status b.is-saving { color: var(--green-2); }
.receipt-page-controls__status b.is-saved { color: #4e7463; }
.receipt-page-controls__status b.is-error { color: #a23e35; }

.receipt-defect-section { margin-top: 0; padding: 0; scroll-margin-top: 74px; }
.receipt-defect-disclosure > summary { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-radius: 15px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.receipt-defect-disclosure > summary::-webkit-details-marker { display: none; }
.receipt-defect-disclosure > summary > span:first-child { display: grid; gap: 2px; }
.receipt-defect-disclosure > summary strong { font-size: 1.02rem; line-height: 1.4; }
.receipt-defect-disclosure > summary small { color: #64766f; font-size: 0.7rem; line-height: 1.45; }
.receipt-defect-toggle { display: inline-grid; min-width: 92px; min-height: 42px; place-items: center; padding: 7px 12px; border: 1px solid #b8cec3; border-radius: 9px; color: var(--green-2); font-size: 0.72rem; }
.receipt-defect-toggle b { font-weight: 700; }
.receipt-defect-toggle .when-open { display: none; }
.receipt-defect-disclosure[open] .receipt-defect-toggle .when-closed { display: none; }
.receipt-defect-disclosure[open] .receipt-defect-toggle .when-open { display: inline; }
.receipt-defect-body { padding: 0 18px 16px; border-top: 1px solid rgba(23, 63, 53, 0.08); }
.receipt-defect-entry { margin-top: 14px; }
.receipt-defect-entry select,
.receipt-defect-entry input,
.receipt-defect-entry button { min-height: 44px; }

.receipt-order-summary { padding-bottom: 17px; }
.receipt-order-summary--confirmed { background: #f2f8f4; }
.receipt-order-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid rgba(23, 63, 53, 0.1); border-radius: 12px; }
.receipt-order-metrics > div { display: grid; gap: 3px; padding: 11px 13px; border-right: 1px solid rgba(23, 63, 53, 0.08); }
.receipt-order-metrics > div:last-child { border-right: 0; }
.receipt-order-metrics dd { margin: 0; color: var(--ink); font-size: 1.05rem; font-weight: 720; line-height: 1.25; font-variant-numeric: tabular-nums; }
.receipt-order-metrics .is-defective { background: #fffaf0; }
.receipt-order-rule { margin: 10px 1px 0; color: #61746b; font-size: 0.72rem; line-height: 1.55; }
.receipt-order-submit { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 13px; padding-top: 13px; border-top: 1px solid rgba(23, 63, 53, 0.08); }
.receipt-order-submit > span:first-child { display: grid; margin-right: auto; gap: 2px; }
.receipt-order-submit > span:first-child strong { font-size: 0.82rem; }
.receipt-order-submit > span:first-child small { color: #63766e; font-size: 0.7rem; }
.receipt-order-submit .receipt-difference-confirm { display: flex; min-height: 44px; align-items: center; gap: 8px; color: #765e13; font-size: 0.74rem; font-weight: 600; line-height: 1.4; }
.receipt-order-submit .receipt-difference-confirm input { width: 18px; height: 18px; margin: 0; accent-color: var(--green-2); }
.receipt-order-submit button { min-height: 46px; padding: 9px 16px; font-size: 0.78rem; }

@media (hover: hover) and (pointer: fine) {
  .receipt-page-controls a:hover,
  .receipt-page-controls button:not(.is-primary):hover { background: #edf5f1; }
  .receipt-defect-disclosure > summary:hover { background: #f8fbf9; }
}

@media (max-width: 760px) {
  .receipt-product-summary { grid-template-columns: 1fr; gap: 8px; }
  .receipt-product-summary dl { justify-self: stretch; }
  .receipt-size-row { grid-template-columns: minmax(160px, 0.75fr) minmax(230px, 1fr); gap: 12px; }
  .receipt-page-controls { grid-template-columns: auto 1fr; }
  .receipt-page-controls__status { grid-column: 1 / -1; grid-row: 1; }
  .receipt-page-controls__previous { grid-column: 1; grid-row: 2; }
  .receipt-page-controls__actions { grid-column: 2; grid-row: 2; }
}

@media (max-width: 560px) {
  .purchase-receipt-shell--detail { width: min(100% - 20px, 960px); padding-top: 12px; }
  .purchase-receipt-shell--detail .purchase-receipt-intro { margin-bottom: 6px; }
  .purchase-receipt-shell--detail .receipt-page-tools { margin-bottom: 12px; }
  .purchase-receipt-shell--detail .receipt-primary-workspace { margin-bottom: 12px; border-radius: 14px; }
  .purchase-receipt-shell--detail .receipt-batch-hero { gap: 10px; padding: 12px 13px 9px; }
  .purchase-receipt-shell--detail .receipt-batch-hero > div { gap: 3px; }
  .purchase-receipt-shell--detail .receipt-batch-hero > div > span { font-size: 13px; }
  .purchase-receipt-shell--detail .receipt-batch-hero h2 { font-size: 16px; font-weight: 600; line-height: 1.45; }
  .purchase-receipt-shell--detail .receipt-batch-hero p { font-size: 13px; line-height: 1.5; }
  .purchase-receipt-shell--detail .receipt-batch-status { font-size: 12px; }
  .purchase-receipt-shell--detail .receipt-mode-switch { margin: 0 9px 9px; }
  .receipt-feedback--shared { margin-bottom: 10px; font-size: 13px; }

  .receipt-detail-section { margin-bottom: 10px; padding: 13px 11px; border-radius: 14px; }
  .receipt-detail-heading { gap: 10px; margin-bottom: 10px; }
  .receipt-detail-heading h2 { font-size: 18px; font-weight: 600; line-height: 1.4; }
  .receipt-detail-heading span { font-size: 12px; font-weight: 600; }
  .receipt-detail-heading > a { min-height: 40px; font-size: 13px; }
  .receipt-count-heading { display: grid; gap: 5px; }
  .receipt-count-heading p { max-width: none; font-size: 13px; line-height: 1.5; text-align: left; }

  .receipt-filter-section .receipt-line-tools { grid-template-columns: minmax(0, 1fr) minmax(112px, 0.48fr); gap: 8px; }
  .receipt-filter-section .receipt-line-tools button { grid-column: 1 / -1; min-height: 44px; }
  .receipt-filter-section .receipt-line-tools label > span { font-size: 13px; }
  .receipt-filter-section .receipt-line-tools input,
  .receipt-filter-section .receipt-line-tools select { min-height: 44px; padding-inline: 10px 30px; font-size: 16px; }

  .receipt-count-groups { gap: 10px; }
  .receipt-count-group { border-radius: 11px; }
  .receipt-product-summary { gap: 7px; padding: 10px; }
  .receipt-product-summary > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  .receipt-product-summary > div strong { font-size: 16px; font-weight: 600; line-height: 1.4; }
  .receipt-product-summary > div small { font-size: 13px; }
  .receipt-product-summary dl { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .receipt-product-summary dl > div { display: grid; justify-items: start; gap: 1px; }
  .receipt-product-summary dt { font-size: 12px; }
  .receipt-product-summary dd { font-size: 14px; }

  .receipt-size-row { grid-template-columns: 1fr; gap: 6px; min-height: 0; padding: 9px 10px 8px; }
  .receipt-size-row__primary { gap: 10px; }
  .receipt-size-name { display: grid; gap: 1px; }
  .receipt-size-name small,
  .receipt-arrival-control small { font-size: 13px; }
  .receipt-size-name strong { font-size: 16px; font-weight: 600; line-height: 1.4; }
  .receipt-arrival-control input { width: 84px; min-height: 44px; font-size: 16px; }
  .receipt-size-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .receipt-size-metrics > span { justify-content: flex-start; gap: 5px; }
  .receipt-size-metrics small { font-size: 13px; }
  .receipt-size-metrics strong { font-size: 14px; }

  .receipt-page-controls { gap: 7px; margin-top: 10px; padding-top: 10px; }
  .receipt-page-controls__actions { flex-wrap: wrap; }
  .receipt-page-controls a,
  .receipt-page-controls button,
  .receipt-page-controls .is-disabled { min-height: 44px; padding: 7px 9px; font-size: 12px; }
  .receipt-page-controls__status strong { font-size: 13px; }
  .receipt-page-controls__status small { font-size: 12px; }

  .receipt-defect-section { padding: 0; }
  .receipt-defect-disclosure > summary { min-height: 66px; padding: 10px 11px; }
  .receipt-defect-disclosure > summary strong { font-size: 18px; font-weight: 600; }
  .receipt-defect-disclosure > summary small { font-size: 13px; }
  .receipt-defect-toggle { min-width: 84px; min-height: 44px; padding-inline: 9px; font-size: 13px; }
  .receipt-defect-body { padding: 0 11px 12px; }
  .receipt-defect-entry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 0 0; background: transparent; }
  .receipt-defect-entry label { font-size: 13px; }
  .receipt-defect-entry select,
  .receipt-defect-entry input,
  .receipt-defect-entry button { min-height: 44px; font-size: 16px; }
  .receipt-defect-entry button { font-size: 14px; }

  .receipt-order-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receipt-order-metrics > div { padding: 9px 10px; }
  .receipt-order-metrics > div:nth-child(2) { border-right: 0; }
  .receipt-order-metrics > div:nth-child(-n+2) { border-bottom: 1px solid rgba(23, 63, 53, 0.08); }
  .receipt-order-metrics dt { font-size: 13px; }
  .receipt-order-metrics dd { font-size: 18px; font-weight: 600; }
  .receipt-order-rule { font-size: 13px; }
  .receipt-order-submit { display: grid; gap: 8px; }
  .receipt-order-submit .receipt-difference-confirm { min-height: 44px; font-size: 13px; }
  .receipt-order-submit button { width: 100%; min-height: 48px; font-size: 14px; }
}

@media (max-width: 350px) {
  .purchase-receipt-shell--detail { width: min(100% - 16px, 960px); }
  .receipt-filter-section .receipt-line-tools { grid-template-columns: 1fr; }
  .receipt-filter-section .receipt-line-tools button { grid-column: auto; }
  .receipt-product-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
  .receipt-size-row { padding-inline: 8px; }
  .receipt-size-metrics { gap: 3px; }
  .receipt-size-metrics small { font-size: 12px; }
  .receipt-page-controls { grid-template-columns: 1fr; }
  .receipt-page-controls__status,
  .receipt-page-controls__previous,
  .receipt-page-controls__actions { grid-column: 1; }
  .receipt-page-controls__status { grid-row: 1; }
  .receipt-page-controls__previous { grid-row: 2; }
  .receipt-page-controls__actions { grid-row: 3; justify-content: stretch; }
  .receipt-page-controls__actions > * { flex: 1; }
}

/* Purchase receipt detail v2: one workspace, fixed five-column counting table. */
.purchase-receipt-shell--detail { padding-top: 18px; }
.receipt-back-link--detail {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin: -4px 0 6px;
  color: var(--green-2);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}
.purchase-receipt-shell--detail .receipt-primary-workspace { margin-bottom: 12px; }
.purchase-receipt-shell--detail .receipt-batch-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px 10px;
}
.purchase-receipt-shell--detail .receipt-batch-hero > div { display: grid; min-width: 0; gap: 4px; }
.purchase-receipt-shell--detail .receipt-batch-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.purchase-receipt-shell--detail .receipt-batch-hero > div > span {
  color: #63766e;
  font-size: 0.74rem;
  line-height: 1.45;
}
.receipt-batch-information { margin: 0 14px 9px; border-top: 1px solid rgba(23, 63, 53, 0.08); }
.receipt-batch-information > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #4d665c;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 650;
  list-style: none;
}
.receipt-batch-information > summary::-webkit-details-marker { display: none; }
.receipt-batch-information > summary > span:last-child { font-size: 1rem; transition: transform 160ms ease; }
.receipt-batch-information[open] > summary > span:last-child { transform: rotate(90deg); }
.receipt-batch-information > div { padding: 0 0 10px; color: #52675e; font-size: 0.76rem; line-height: 1.5; }
.receipt-batch-information p { margin: 0; }
.purchase-receipt-shell--detail .receipt-mode-switch {
  width: fit-content;
  min-width: 250px;
  margin: 0 14px 12px;
  padding: 3px;
  border-radius: 10px;
}
.purchase-receipt-shell--detail .receipt-mode-switch a,
.purchase-receipt-shell--detail .receipt-mode-switch span { min-height: 40px; padding: 8px 16px; font-size: 0.76rem; }

.receipt-count-sheet { padding-bottom: 14px; }
.receipt-count-sheet .receipt-line-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.48fr) auto auto;
  gap: 8px;
  align-items: end;
  margin: 0 0 14px;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  background: #f4f8f6;
  box-shadow: none;
}
.receipt-count-sheet .receipt-line-tools label { display: grid; min-width: 0; gap: 4px; }
.receipt-count-sheet .receipt-line-tools label > span { color: #5f746b; font-size: 0.7rem; font-weight: 650; line-height: 1.35; }
.receipt-count-sheet .receipt-line-tools input,
.receipt-count-sheet .receipt-line-tools select,
.receipt-count-sheet .receipt-line-tools button,
.receipt-count-sheet .receipt-filter-clear {
  min-height: 44px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.82rem;
}
.receipt-count-sheet .receipt-line-tools input,
.receipt-count-sheet .receipt-line-tools select { width: 100%; min-width: 0; border: 1px solid #c8d8d0; background-color: #fff; }
.receipt-count-sheet .receipt-line-tools button { padding-inline: 16px; }
.receipt-filter-clear {
  display: inline-grid;
  place-items: center;
  padding-inline: 10px;
  color: var(--green-2);
  font-weight: 700;
  text-decoration: none;
}
.receipt-count-groups { gap: 10px; }
.receipt-count-group {
  overflow: hidden;
  border: 1px solid rgba(23, 63, 53, 0.11);
  border-radius: 11px;
  background: #fff;
}
.receipt-product-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 9px 11px;
  background: #edf5f1;
}
.receipt-product-summary > strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 720;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.receipt-product-summary > p {
  margin: 0;
  color: #5b7067;
  font-size: 0.7rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.receipt-product-summary > p b { color: #324f44; font-weight: 700; }
.receipt-size-table { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.receipt-size-table__head,
.receipt-size-row {
  display: grid;
  grid-template-columns: minmax(68px, 29fr) minmax(36px, 15fr) minmax(64px, 24fr) minmax(40px, 16fr) minmax(40px, 16fr);
  gap: 4px;
  align-items: center;
  min-width: 264px;
  padding-inline: 9px;
  font-variant-numeric: tabular-nums;
}
.receipt-size-table__head {
  min-height: 34px;
  border-bottom: 1px solid rgba(23, 63, 53, 0.1);
  background: #f7f9f8;
  color: #61746b;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.35;
}
.receipt-size-table__head > span:first-child { text-align: left; }
.receipt-size-table__head > span:not(:first-child) { text-align: center; }
.receipt-size-row {
  min-height: 58px;
  border-bottom: 1px solid rgba(23, 63, 53, 0.075);
  background: #fff;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.receipt-size-row:last-child { border-bottom: 0; }
.receipt-size-row:focus-within { z-index: 1; background: #f7fbf8; box-shadow: inset 3px 0 #63917d; }
.receipt-size-cell {
  min-width: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 620;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}
.receipt-size-cell--size { font-size: 0.84rem; font-weight: 700; text-align: left; }
.receipt-size-cell--input { display: grid; place-items: center; }
.receipt-size-cell--input input {
  width: 100%;
  max-width: 84px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 5px;
  border: 1px solid #bfd1c8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 680;
  line-height: 1.3;
  text-align: center;
  font-variant-numeric: tabular-nums;
  scroll-margin-block: 90px 120px;
}
.receipt-size-cell--input input::-webkit-inner-spin-button,
.receipt-size-cell--input input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.receipt-size-cell:not(.receipt-size-cell--size):not(.receipt-size-cell--input) { white-space: nowrap; }
.receipt-size-table--wide .receipt-size-table__head,
.receipt-size-table--wide .receipt-size-row {
  grid-template-columns: minmax(88px, 29fr) minmax(52px, 15fr) minmax(74px, 24fr) minmax(52px, 16fr) minmax(52px, 16fr);
  min-width: 350px;
}
.receipt-size-cell--input input:focus { border-color: #4f876f; outline: none; box-shadow: 0 0 0 2px rgba(57, 118, 94, 0.08); }
.receipt-size-cell--input input:disabled { background: #f2f5f3; color: #52645d; opacity: 1; }

.receipt-page-controls { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.receipt-page-controls__status { grid-column: 2; grid-row: 1; }
.receipt-page-controls__previous { grid-column: 1; grid-row: 1; }
.receipt-page-controls__actions { grid-column: 3; grid-row: 1; }

.receipt-defect-disclosure > summary > strong { font-size: 1rem; }
.receipt-defect-disclosure > summary { min-height: 62px; }
.receipt-order-summary { padding: 0; }
.receipt-order-disclosure > summary {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.receipt-order-disclosure > summary::-webkit-details-marker { display: none; }
.receipt-order-disclosure > summary > span:first-child { display: grid; gap: 2px; }
.receipt-order-disclosure > summary strong { font-size: 1rem; line-height: 1.4; }
.receipt-order-disclosure > summary small { color: #5f746b; font-size: 0.72rem; line-height: 1.45; }
.receipt-order-disclosure > summary small b { color: var(--green-2); font-size: 0.78rem; }
.receipt-order-toggle { display: inline-grid; min-width: 78px; min-height: 42px; place-items: center; padding: 7px 10px; border: 1px solid #b8cec3; border-radius: 9px; color: var(--green-2); font-size: 0.72rem; }
.receipt-order-toggle b { font-weight: 700; }
.receipt-order-toggle .when-open { display: none; }
.receipt-order-disclosure[open] .receipt-order-toggle .when-closed { display: none; }
.receipt-order-disclosure[open] .receipt-order-toggle .when-open { display: inline; }
.receipt-order-body { padding: 0 18px 16px; border-top: 1px solid rgba(23, 63, 53, 0.08); }

@media (max-width: 560px) {
  .purchase-receipt-shell--detail { width: min(100% - 16px, 960px); padding-top: 8px; }
  .receipt-back-link--detail { margin-bottom: 3px; font-size: 13px; }
  .purchase-receipt-shell--detail .receipt-primary-workspace { border-radius: 13px; }
  .purchase-receipt-shell--detail .receipt-batch-hero { padding: 11px 11px 8px; }
  .purchase-receipt-shell--detail .receipt-batch-hero h2 { font-size: 16px; line-height: 1.45; }
  .purchase-receipt-shell--detail .receipt-batch-hero > div > span { font-size: 13px; }
  .purchase-receipt-shell--detail .receipt-batch-status { font-size: 12px; }
  .receipt-batch-information { margin-inline: 10px; }
  .receipt-batch-information > summary,
  .receipt-batch-information > div { font-size: 13px; }
  .purchase-receipt-shell--detail .receipt-mode-switch { width: auto; min-width: 0; margin: 0 9px 9px; }
  .purchase-receipt-shell--detail .receipt-mode-switch a,
  .purchase-receipt-shell--detail .receipt-mode-switch span { font-size: 13px; }

  .receipt-detail-section { padding: 12px 9px; }
  .receipt-count-heading { gap: 4px; }
  .receipt-count-heading p { font-size: 13px; }
  .receipt-count-sheet .receipt-line-tools {
    grid-template-columns: minmax(0, 1fr) minmax(106px, 0.46fr);
    gap: 7px;
    margin-bottom: 10px;
    padding: 8px;
  }
  .receipt-count-sheet .receipt-line-tools button { grid-column: 1 / 2; }
  .receipt-count-sheet .receipt-filter-clear { grid-column: 2 / 3; }
  .receipt-count-sheet .receipt-line-tools label > span { font-size: 12px; }
  .receipt-count-sheet .receipt-line-tools input,
  .receipt-count-sheet .receipt-line-tools select,
  .receipt-count-sheet .receipt-line-tools button,
  .receipt-count-sheet .receipt-filter-clear { min-height: 44px; font-size: 16px; }
  .receipt-count-sheet .receipt-line-tools button,
  .receipt-count-sheet .receipt-filter-clear { font-size: 13px; }

  .receipt-count-groups { gap: 9px; }
  .receipt-product-summary { padding: 8px 9px; }
  .receipt-product-summary > strong { font-size: 15px; }
  .receipt-product-summary > p { font-size: 12px; }
  .receipt-size-table__head,
  .receipt-size-row { padding-inline: 7px; }
  .receipt-size-table__head { font-size: 12px; }
  .receipt-size-row { min-height: 58px; }
  .receipt-size-cell { font-size: 14px; }
  .receipt-size-cell--size { font-size: 15px; }
  .receipt-size-cell--input input { min-height: 46px; font-size: 16px; }

  .receipt-page-controls { grid-template-columns: 1fr 1fr; gap: 7px; }
  .receipt-page-controls__status { grid-column: 1 / -1; grid-row: 1; }
  .receipt-page-controls__previous { grid-column: 1; grid-row: 2; }
  .receipt-page-controls__actions { grid-column: 2; grid-row: 2; }
  .receipt-page-controls__actions { flex-wrap: wrap; }
  .receipt-page-controls__actions > * { flex: 1; }

  .receipt-defect-section,
  .receipt-order-summary { padding: 0; }
  .receipt-defect-disclosure > summary,
  .receipt-order-disclosure > summary { min-height: 62px; padding: 9px 11px; }
  .receipt-defect-disclosure > summary > strong,
  .receipt-order-disclosure > summary strong { font-size: 16px; font-weight: 600; }
  .receipt-defect-toggle,
  .receipt-order-toggle { min-height: 44px; font-size: 13px; }
  .receipt-defect-body,
  .receipt-order-body { padding: 0 11px 12px; }
  .receipt-order-disclosure > summary small { font-size: 13px; }
}

@media (max-width: 350px) {
  .receipt-count-sheet .receipt-line-tools { grid-template-columns: 1fr; }
  .receipt-count-sheet .receipt-line-tools button,
  .receipt-count-sheet .receipt-filter-clear { grid-column: 1; }
  .receipt-size-table__head,
  .receipt-size-row {
    grid-template-columns: minmax(62px, 29fr) minmax(33px, 15fr) minmax(59px, 24fr) minmax(37px, 16fr) minmax(37px, 16fr);
    min-width: 244px;
    gap: 3px;
    padding-inline: 5px;
  }
  .receipt-size-table__head { font-size: 11px; }
  .receipt-size-cell { font-size: 13px; }
  .receipt-size-cell--size { font-size: 14px; }
  .receipt-size-cell--input input { padding-inline: 2px; }
  .receipt-page-controls__actions { justify-content: stretch; }
}

/* Purchase receipt detail v3: true-iPhone type and form alignment fixes. */
@media (max-width: 560px) {
  .purchase-receipt-shell--detail {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .receipt-count-sheet .receipt-line-tools {
    grid-template-columns: minmax(0, 1fr) minmax(124px, 42%);
    gap: 7px;
    padding: 8px;
  }

  .receipt-count-sheet .receipt-line-tools label {
    gap: 4px;
  }

  .receipt-count-sheet .receipt-line-tools label > span,
  .receipt-defect-entry label {
    color: #5c7067;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
  }

  .receipt-count-sheet .receipt-line-tools input,
  .receipt-count-sheet .receipt-line-tools select,
  .receipt-defect-entry select,
  .receipt-defect-entry input {
    min-height: 44px;
    border-radius: 9px;
    font-size: 16px;
    font-weight: 520;
    line-height: 1.2;
  }

  .receipt-count-sheet .receipt-line-tools input {
    padding: 9px 11px;
  }

  .receipt-count-sheet .receipt-line-tools select,
  .receipt-defect-entry select {
    width: 100%;
    padding: 9px 36px 9px 11px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23556860' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 14px 14px;
  }

  .receipt-defect-entry select:disabled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23818d87' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }

  .receipt-count-sheet .receipt-line-tools button {
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 9px 14px;
    font-size: 14px;
    line-height: 1.2;
  }

  .receipt-count-sheet .receipt-filter-clear {
    grid-column: 1 / -1;
    min-height: 44px;
    justify-self: end;
    padding-inline: 10px;
    font-size: 13px;
  }

  .receipt-defect-disclosure > summary {
    min-height: 56px;
    padding: 8px 11px;
  }

  .receipt-defect-body {
    padding: 0 11px 11px;
  }

  .receipt-defect-entry {
    grid-template-columns: minmax(0, 1fr) minmax(86px, 0.72fr);
    gap: 7px;
    align-items: end;
    padding: 9px 0 0;
    border-radius: 0;
    background: transparent;
  }

  .receipt-defect-entry label {
    min-width: 0;
    gap: 4px;
  }

  .receipt-defect-entry label:nth-of-type(3) {
    grid-column: 1;
  }

  .receipt-defect-entry label:nth-of-type(4) {
    grid-column: 2;
  }

  .receipt-defect-entry input {
    width: 100%;
    padding: 9px 11px;
  }

  .receipt-defect-entry button {
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 9px 14px;
    font-size: 14px;
    line-height: 1.2;
  }
}

@media (max-width: 350px) {
  .receipt-count-sheet .receipt-line-tools {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 43%);
  }
}
