:root {
  color-scheme: light;
  --canvas: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #eaf1ee;
  --ink: #15211e;
  --muted: #586762;
  --brand: #1f5148;
  --brand-strong: #133d35;
  --brand-soft: #d6e9e3;
  --accent: #e8b760;
  --danger: #9a2f2f;
  --danger-soft: #fbe4e2;
  --success: #276a42;
  --border: #ccd7d3;
  --focus: #1268c4;
  --shadow: 0 12px 30px rgb(21 33 30 / 8%);
  --radius: 18px;
  --content: 1180px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--canvas);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgb(214 233 227 / 65%), transparent 35rem),
    var(--canvas);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--brand-strong);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button,
input,
select,
summary,
textarea {
  min-height: 44px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-banners {
  position: sticky;
  z-index: 50;
  top: 0;
}

.offline-banner {
  padding: 0.65rem 1rem;
  background: #6f2d17;
  color: white;
  text-align: center;
  font-weight: 750;
}

.support-mode-banner {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem max(1rem, calc((100% - var(--content)) / 2));
  border-block: 3px solid #27184d;
  background: #f2d86f;
  color: #21163d;
  box-shadow: 0 8px 18px rgb(33 22 61 / 18%);
}

.support-mode-banner > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.support-mode-banner strong {
  font-size: 1.05rem;
  text-transform: uppercase;
}

.support-mode-banner span {
  overflow-wrap: anywhere;
}

.support-mode-banner form {
  flex: 0 0 auto;
  margin: 0;
}

.support-mode-banner__exit {
  border-color: #21163d;
  background: #21163d;
  color: white;
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem max(1rem, calc((100% - var(--content)) / 2));
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px 12px 18px 18px;
  background: var(--brand);
  color: white;
  font-family: Georgia, serif;
  font-size: 1.35rem;
}

.worker-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.active-worker {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 0.4rem;
  align-items: center;
}

.active-worker__label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
}

.role-badge,
.status-chip,
.online-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  text-transform: capitalize;
}

.lock-form {
  margin: 0;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem) 0 7rem;
}

.hero {
  max-width: 760px;
  margin-bottom: 2rem;
}

.hero h1,
.auth-card h1 {
  margin: 0.2rem 0 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3.65rem);
  font-weight: 650;
  line-height: 1.05;
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.online-status {
  background: #ddf2e4;
  color: var(--success);
}

.online-status--offline {
  background: var(--danger-soft);
  color: var(--danger);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.work-card,
.panel,
.user-card,
.auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.work-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem;
}

.work-card h3 {
  margin: 1rem 0 0.4rem;
  font-size: 1.18rem;
}

.work-card p {
  flex: 1;
  color: var(--muted);
}

.work-card--ready {
  border-color: #7dac9e;
}

.work-card--coming_next {
  background: var(--surface-soft);
}

.button {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  padding: 0.65rem 1rem;
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

.button--primary {
  background: var(--brand);
  color: white;
}

.button--primary:hover {
  background: var(--brand-strong);
}

.button--secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
}

.button--danger {
  border-color: #dba4a0;
  background: var(--danger-soft);
  color: var(--danger);
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 750;
}

.auth-card {
  width: min(100%, 560px);
  margin: 3vh auto 0;
  padding: clamp(1.25rem, 5vw, 2.5rem);
}

.stack {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #9caaa5;
  border-radius: 11px;
  background: white;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
}

textarea {
  min-height: 12rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.field-help,
.privacy-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 450;
}

.auth-alternate {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

.field-error {
  margin: -0.35rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.privacy-note {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.notice {
  margin-bottom: 1rem;
  border: 1px solid;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-weight: 700;
}

.notice--success {
  border-color: #85b697;
  background: #e6f6eb;
  color: var(--success);
}

.notice--error {
  border-color: #dfa19d;
  background: var(--danger-soft);
  color: var(--danger);
}

.notice--info {
  border-color: #a8bdcf;
  background: #e9f1f8;
  color: #1b4e78;
}

.verification-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
  border: 2px solid #a8bdcf;
  border-radius: var(--radius);
  background: #f4f9fd;
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow);
}

.verification-notice h2 {
  margin-bottom: 0.5rem;
}

.verification-notice p:last-child {
  margin-bottom: 0;
}

.verification-actions {
  display: grid;
  min-width: min(100%, 230px);
  gap: 0.75rem;
}

.verification-actions form,
.verification-actions details {
  margin: 0;
}

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

.verification-confirmation {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  overflow-wrap: anywhere;
}

.verification-confirmation h2 {
  margin-top: 0;
}

.compact-stack {
  margin-bottom: 0;
}

.divider {
  height: 1px;
  margin: 1.75rem 0;
  background: var(--border);
}

.steps {
  padding-left: 1.4rem;
}

.secret-box {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0;
  border: 1px dashed var(--brand);
  border-radius: 12px;
  background: var(--brand-soft);
  padding: 1rem;
}

.secret-box strong,
.recovery-codes code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

time {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.secret-box .button {
  width: fit-content;
  max-width: 100%;
}

.break-all {
  overflow-wrap: anywhere;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.recovery-codes li {
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0.6rem;
  text-align: center;
}

.primary-nav {
  position: fixed;
  z-index: 20;
  top: 72px;
  bottom: 0;
  left: 0;
  display: grid;
  width: 220px;
  align-content: start;
  gap: 0.35rem;
  border-right: 1px solid var(--border);
  background: white;
  padding: 1rem;
}

.primary-nav > a,
.primary-nav > span {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 0.75rem;
  border-radius: 10px;
  padding: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.primary-nav [aria-current="page"] {
  color: var(--brand);
}

.primary-nav [aria-disabled="true"] {
  opacity: 0.6;
}

.primary-nav__disabled small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.authenticated-layout {
  padding-left: 220px;
}

.device-lock-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  background: var(--ink);
  color: white;
  text-align: center;
}

.device-lock-overlay[hidden] {
  display: none;
}

form[aria-busy="true"] {
  opacity: 1;
}

.account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.account-strip p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 1.5rem;
  align-items: start;
}

.panel {
  padding: 1.25rem;
}

.home-empty-state {
  margin-top: 1.25rem;
}

.user-list {
  display: grid;
  gap: 0.75rem;
}

.user-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.user-card h3,
.user-card p {
  margin-bottom: 0.25rem;
}

.user-card details {
  min-width: 150px;
}

.user-card summary {
  list-style: none;
}

.manage-panel {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.inline-form {
  display: grid;
  gap: 0.6rem;
}

.confirm-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 0.25rem;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
}

.confirm-row input {
  width: 22px;
  min-height: 22px;
}

.inventory-hero {
  border-left: 5px solid var(--accent);
}

.inventory-section {
  margin: 1rem 0;
}

.inventory-section h3 {
  margin: 1rem 0 0.35rem;
}

.inventory-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.inventory-fields--small {
  grid-template-columns: repeat(2, minmax(0, 14rem));
}

.inventory-fields__wide {
  grid-column: span 2;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.search-row label {
  min-width: 0;
}

.catalog-add {
  margin-top: 1rem;
}

.catalog-field {
  min-width: 0;
}

.receipt-list,
.recent-scans {
  display: grid;
  gap: 0.75rem;
}

.unit-label {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  width: 3in;
  min-height: 1.6in;
  border: 1px solid #111;
  border-radius: 6px;
  padding: 0.12in;
  color: #111;
  background: #fff;
  break-inside: avoid;
}

.unit-label > strong {
  font: 700 12pt/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.04em;
}

.unit-label > span,
.unit-label > small {
  color: #111;
  font-size: 9pt;
}

.unit-barcode {
  display: block;
  width: 100%;
  height: 0.58in;
  fill: #000;
}

.label-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, 3in);
  justify-content: center;
  gap: 0.2in;
}

.inventory-unit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.auction-label__number {
  font: 900 30pt/1 system-ui, sans-serif !important;
  text-align: center;
}

@media print {
  @page {
    margin: 0.2in;
  }

  .site-header,
  .primary-nav,
  .print-hidden,
  .status-banners {
    display: none !important;
  }

  .authenticated-layout,
  .page-shell {
    width: auto;
    margin: 0;
    padding: 0;
  }

  .label-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, 3in);
    gap: 0.1in;
  }
}

.catalog-cards {
  display: none;
}

.catalog-card {
  min-width: 0;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
}

.catalog-card > div {
  display: grid;
  gap: 0.2rem;
}

.catalog-card > div:last-child {
  justify-items: start;
}

.catalog-card span,
.catalog-card small {
  color: var(--muted);
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.pagination > :last-child {
  justify-self: end;
}

.invoice-line {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.invoice-line legend {
  padding: 0 0.35rem;
  font-weight: 800;
}

.inventory-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

.inventory-table td small,
.inventory-summary__item span,
.inventory-summary__item small,
.scan-result span,
.scan-result small {
  display: block;
  color: var(--muted);
}

.inventory-table code {
  overflow-wrap: anywhere;
}

.catalog-add {
  margin-top: 1rem;
}

.catalog-add > summary {
  width: fit-content;
  list-style: none;
}

.inventory-summary {
  display: grid;
  gap: 0.65rem;
}

.inventory-summary__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.inventory-summary__count {
  display: grid;
  min-width: 5rem;
  justify-items: end;
}

.inventory-summary__count strong {
  font-size: 1.75rem;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.progress-grid > div {
  display: grid;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--surface-soft);
}

.progress-grid strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.progress-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.scanner-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 1rem;
  border: 2px solid var(--brand);
  border-radius: 16px;
  padding: 1rem;
}

.catalog-card code {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.catalog-identity-card {
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.catalog-identity-card h2 {
  margin-block: 0.25rem 0.5rem;
}

.lookup-candidate {
  border-inline-start: 0.35rem solid var(--accent);
}

.lookup-sources {
  margin-block: 1rem;
}

.lookup-sources a {
  overflow-wrap: anywhere;
}

.lookup-review-form {
  margin-top: 1rem;
}

.lookup-identity-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-block: 1rem;
}

.lookup-identity-summary > div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--surface-soft);
}

.lookup-identity-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.lookup-identity-summary dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.lookup-uncertain-label,
.lookup-uncertain-field {
  display: block;
  margin-top: 0.3rem;
}

.lookup-uncertain-label {
  color: var(--brand-strong);
  font-size: 0.76rem;
}

.lookup-resolution-actions {
  margin-top: 1rem;
}

.lookup-review-form[hidden],
.lookup-resolution-actions[hidden],
[data-candidate-approval-paused][hidden] {
  display: none !important;
}

@media (max-width: 599px) {
  .lookup-identity-summary {
    grid-template-columns: 1fr;
  }
}

[data-scan-review-paused] .catalog-scanner {
  border-color: var(--border-strong);
}

.catalog-search-form {
  max-width: 44rem;
  margin-bottom: 1rem;
}

.camera-panel {
  align-self: start;
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--ink);
  color: white;
}

.camera-panel video {
  width: 100%;
  max-height: 22rem;
  border-radius: 8px;
  background: black;
  object-fit: cover;
}

.camera-panel p {
  margin-bottom: 0;
}

.scan-results {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-result {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-left: 5px solid var(--danger);
  border-radius: 12px;
  padding: 0.75rem;
}

.scan-result--accepted {
  border-left-color: var(--success);
}

.scan-result__icon {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 900;
}

.scan-result--accepted .scan-result__icon {
  background: var(--brand-soft);
  color: var(--success);
}

.post-receipt {
  margin-top: 1.5rem;
  border-top: 2px solid var(--border);
  padding-top: 1rem;
}

.manual-stock-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 1rem;
}

.manual-stock-layout > * {
  min-width: 0;
}

.manual-stock-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0;
}

.manual-stock-counts > div {
  display: grid;
  min-height: 82px;
  align-content: center;
  justify-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.65rem;
  text-align: center;
}

.manual-stock-counts strong {
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
}

.manual-stock-counts span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.manual-stock-latest {
  margin-bottom: 1rem;
}

.manual-stock-undo {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) auto;
  align-items: end;
  gap: 0.5rem;
}

.manual-stock-unit--voided {
  opacity: 0.7;
}

.manual-stock-unit--voided strong,
.manual-stock-unit--voided p {
  text-decoration: line-through;
}

.counted-workspace,
.counted-group-list,
.counted-review-list,
.counted-count-form,
.counted-queue {
  display: grid;
  gap: 1rem;
}

.counted-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .counted-totals--sticky {
    position: sticky;
    top: calc(76px + var(--status-banners-height, 0px));
    z-index: 4;
    background: var(--surface, #fff);
    box-shadow: 0 0.25rem 0.75rem rgb(15 23 42 / 12%);
  }
}

@media (max-width: 599px) {
  .counted-totals--sticky {
    top: calc(66px + var(--status-banners-height, 0px));
  }
}

.counted-totals > div {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.85rem;
}

.counted-totals strong {
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1;
}

.counted-totals span,
.counted-group__states span,
.counted-queue__item span {
  color: var(--text-muted);
}

.counted-receiving-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
}

.counted-queue {
  align-content: start;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.counted-queue__item,
.counted-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.counted-queue__item {
  align-items: center;
  background: var(--surface);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.counted-queue__item > div,
.counted-group__identity {
  display: grid;
  gap: 0.25rem;
}

.counted-group {
  background: var(--surface);
  display: grid;
  gap: 0.85rem;
}

.counted-group__identity h3,
.counted-group__identity p,
.counted-group__financial {
  margin: 0;
}

.counted-group__states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.counted-correction {
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

.counted-correction summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0.7rem 0;
}

.counted-review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

@media (max-width: 720px) {
  .counted-receiving-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .counted-totals {
    grid-template-columns: 1fr 1fr;
  }

  .counted-queue__item {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .counted-totals {
    grid-template-columns: 1fr;
  }
}

.ai-review-panel {
  display: grid;
  gap: 1rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.ai-progress {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-left: 4px solid var(--brand);
  background: var(--surface);
  padding: 0.75rem 1rem;
}

.ai-progress span,
.manual-entry-heading p {
  color: var(--muted);
}

.manual-entry-heading {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.invoice-suggestion {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 1rem;
}

.invoice-suggestion + .invoice-suggestion {
  margin-top: 1rem;
}

.invoice-review-navigator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: sticky;
  z-index: 2;
  top: 0.5rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.65rem;
  box-shadow: var(--shadow);
}

.invoice-review-navigator[hidden] {
  display: none;
}

.invoice-suggestion legend {
  max-width: 100%;
  padding: 0 0.35rem;
  font-weight: 800;
}

.invoice-suggestion--removed {
  border-style: dashed;
  background: var(--surface-soft);
}

.invoice-suggestion--removed .invoice-review-fields {
  display: none;
}

.invoice-suggestion__action {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.invoice-suggestion__action label {
  flex: 1;
}

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

.review-warnings {
  border-left: 4px solid var(--warning, #9a6700);
  background: #fff8df;
  padding: 0.75rem 1rem;
}

.review-warnings ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.invoice-review-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.invoice-review-fields__wide {
  grid-column: 1 / -1;
}

.review-count {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.4rem 0.7rem;
  font-weight: 700;
}

.review-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.review-totals > div {
  display: grid;
  gap: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.8rem;
}

.review-totals strong {
  font-size: 1.15rem;
}

.review-totals span {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 820px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card {
    min-height: 0;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .verification-notice {
    grid-template-columns: 1fr;
  }

  .verification-actions {
    width: 100%;
  }

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

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

  .scanner-workspace {
    grid-template-columns: 1fr;
  }

  .manual-stock-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (min-width: 600px) and (max-width: 1023px) {
  .primary-nav {
    width: 88px;
    padding: 0.75rem;
  }

  .primary-nav > a,
  .primary-nav > span {
    display: grid;
    justify-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.72rem;
  }

  .primary-nav__disabled small {
    margin-left: 0;
  }

  .authenticated-layout {
    padding-left: 88px;
  }
}

@media (max-width: 599px) {
  .primary-nav {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    align-content: stretch;
    gap: 0;
    border-top: 1px solid var(--border);
    border-right: 0;
    padding: 0 0 env(safe-area-inset-bottom);
  }

  .primary-nav > a,
  .primary-nav > span {
    display: grid;
    min-height: 58px;
    justify-items: center;
    gap: 0;
    border-radius: 0;
    padding: 0.3rem 0.15rem;
    font-size: 0.68rem;
  }

  .primary-nav__disabled small {
    margin-left: 0;
    font-size: 0.66rem;
  }

  .authenticated-layout {
    padding-left: 0;
  }
}

@media (max-width: 620px) {
  .invoice-review-navigator .button {
    min-width: 92px;
  }

  .invoice-review-navigator strong {
    text-align: center;
  }

  .support-mode-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .support-mode-banner__exit {
    width: 100%;
  }

  .site-header {
    align-items: flex-start;
  }

  .brand > span:last-child {
    display: none;
  }

  .worker-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .active-worker {
    justify-items: end;
  }

  .page-shell {
    width: min(calc(100% - 1rem), var(--content));
  }

  .auth-card {
    margin-top: 0;
    border-radius: 14px;
  }

  .recovery-codes {
    grid-template-columns: 1fr;
  }

  .user-card {
    display: grid;
  }

  .account-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-fields,
  .inventory-fields--small {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .catalog-table {
    display: none;
  }

  .catalog-cards {
    display: grid;
    gap: 0.65rem;
  }

  .inventory-fields__wide {
    grid-column: auto;
  }

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

  .inventory-summary__item {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-summary__count {
    min-width: 0;
    justify-items: start;
  }

  .manual-stock-hero {
    align-items: stretch;
  }

  .manual-stock-undo {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .manual-stock-undo .button {
    width: 100%;
  }

  .ai-progress,
  .invoice-suggestion__action {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-review-fields,
  .review-totals {
    grid-template-columns: 1fr;
  }

  .invoice-review-fields__wide {
    grid-column: auto;
  }

  .invoice-suggestion__action .button {
    width: 100%;
  }
}

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

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1rem;
}

.section-tabs a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.permission-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.permission-switch small,
.role-assignment span {
  display: block;
}

.role-assignment-list {
  display: grid;
  gap: 1rem;
}

.role-assignment {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

@media (max-width: 640px) {
  .role-assignment {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sale-price-source-list,
.sale-price-lines,
.sale-price-dispositions {
  display: grid;
  gap: 1rem;
}

.sale-price-source-list > article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.sale-price-source-list > article > div {
  display: grid;
  gap: 0.25rem;
}

.sale-price-review-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}

.sale-price-photo {
  display: grid;
  gap: 0.75rem;
  position: sticky;
  top: 1rem;
}

.sale-price-photo > img {
  width: 100%;
  max-height: 42rem;
  object-fit: contain;
  border-radius: 0.75rem;
  background: #10131a;
}

.sale-price-line,
.sale-price-dispositions fieldset {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.sale-price-line--attention {
  border-width: 2px;
}

.sale-price-line dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.sale-price-line dl > div {
  display: grid;
  gap: 0.2rem;
}

.sale-price-photo-dialog {
  width: min(96vw, 72rem);
  max-width: none;
  height: min(94vh, 58rem);
  padding: 1rem;
  border: 2px solid currentColor;
  border-radius: 1rem;
}

.sale-price-photo-dialog::backdrop {
  background: rgb(8 12 20 / 78%);
}

.sale-price-photo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sale-price-photo-toolbar .button {
  min-height: 2.75rem;
}

.sale-price-photo-canvas {
  height: calc(100% - 4rem);
  overflow: auto;
  display: grid;
  place-items: center;
  background: #10131a;
}

.sale-price-photo-canvas img {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center;
}

@media (max-width: 720px) {
  .sale-price-review-grid,
  .sale-price-line dl {
    grid-template-columns: 1fr;
  }

  .sale-price-photo {
    position: static;
  }
}

@media (max-width: 360px) {
  .sale-price-source-list > article {
    align-items: stretch;
    flex-direction: column;
  }

  .sale-price-source-list .button,
  .sale-price-photo-toolbar .button {
    width: 100%;
    white-space: normal;
  }

  .sale-price-photo-dialog {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .sale-price-photo-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sale-price-photo-toolbar .button:last-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #53615d;
    --muted: #34413d;
  }

  .ai-review-panel,
  .invoice-suggestion,
  .review-totals > div {
    border-width: 2px;
  }
}

/* Premium operations system */

:root {
  --canvas: #f8f4ec;
  --surface: #fffdf8;
  --surface-soft: #f1eef9;
  --surface-raised: #fffaf3;
  --ink: #1f2a44;
  --muted: #5b6478;
  --brand: #4b50b6;
  --brand-strong: #3f449e;
  --brand-soft: #e9e9ff;
  --accent: #94600e;
  --danger: #a63d49;
  --danger-soft: #ffe9e5;
  --success: #26705a;
  --border: #dad5e0;
  --border-strong: #8d8698;
  --focus: #2359c4;
  --shadow: 0 2px 4px rgb(31 42 68 / 6%), 0 16px 38px rgb(31 42 68 / 8%);
  --shadow-soft: 0 1px 3px rgb(31 42 68 / 7%);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --content: 1240px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--canvas);
  letter-spacing: -0.006em;
}

.offline-banner {
  background: #762f3a;
}

.support-mode-banner {
  border-color: var(--brand-strong);
  background: #fff0bc;
  color: var(--ink);
  box-shadow: 0 8px 18px rgb(31 42 68 / 14%);
}

.support-mode-banner__exit {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.site-header {
  position: sticky;
  z-index: 19;
  top: 0;
  min-height: 76px;
  padding: 0.8rem clamp(1rem, 2.5vw, 2rem);
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(31 42 68 / 4%);
  backdrop-filter: none;
}

.brand {
  gap: 0.72rem;
}

.brand__mark {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: end;
  justify-content: center;
  gap: 3px;
  border-radius: 13px 13px 18px 13px;
  background: var(--brand);
  box-shadow: 0 7px 18px rgb(75 80 182 / 22%);
}

.brand__mark span {
  display: block;
  width: 4px;
  border-radius: 999px 999px 2px 2px;
  background: white;
  opacity: 0.96;
}

.brand__mark span:nth-child(1) {
  height: 11px;
  margin-bottom: 9px;
}

.brand__mark span:nth-child(2) {
  height: 19px;
  margin-bottom: 5px;
}

.brand__mark span:nth-child(3) {
  height: 14px;
  margin-bottom: 7px;
}

.brand__wordmark {
  display: grid;
  line-height: 1.02;
}

.brand__wordmark strong {
  font-size: 0.98rem;
  letter-spacing: -0.025em;
}

.brand__wordmark small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.active-worker {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f6f1fb;
}

.active-worker__label {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-badge {
  border: 0;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.primary-nav {
  top: 76px;
  width: 248px;
  gap: 0.28rem;
  padding: 1.2rem 0.85rem;
  border-color: var(--border);
  background: #f4f0e9;
}

.primary-nav > a,
.primary-nav > span {
  position: relative;
  min-height: 46px;
  gap: 0.8rem;
  border-radius: 11px;
  padding: 0.68rem 0.82rem;
  font-size: 0.91rem;
  font-weight: 670;
}

.primary-nav > a {
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.primary-nav > a:hover {
  background: #eae6f4;
  color: var(--ink);
}

.primary-nav [aria-current="page"] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 18px rgb(75 80 182 / 16%);
}

.primary-nav [aria-current="page"]::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -0.86rem;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  content: "";
}

.primary-nav__group-label {
  min-height: 0 !important;
  margin: 0.55rem 0 0.1rem;
  padding: 0.25rem 0.82rem !important;
  color: #666277 !important;
  font-size: 0.73rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary-nav__mobile-only {
  display: none !important;
}

.authenticated-layout {
  padding-left: 248px;
}

.page-shell {
  width: min(calc(100% - clamp(2rem, 5vw, 4.5rem)), var(--content));
  padding-top: clamp(1.3rem, 3vw, 2.4rem);
  padding-bottom: 4rem;
}

.page-shell > .notice:first-child {
  margin-bottom: 1rem;
}

.hero,
.page-heading {
  display: flex;
  min-height: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
  padding: 0.25rem 0 0.8rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
  box-shadow: none;
}

.hero h1,
.page-heading h1 {
  max-width: 760px;
  margin: 0.2rem 0 0.3rem;
  font-family: inherit;
  font-size: clamp(1.8rem, 3.2vw, 2.75rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.hero p,
.page-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.115em;
  text-transform: uppercase;
}

.panel,
.work-card,
.auth-card,
.catalog-card,
.user-card,
.verification-notice,
.account-strip {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: clamp(1rem, 2.2vw, 1.5rem);
}

.auth-card {
  width: min(100%, 520px);
  margin-top: clamp(1rem, 5vh, 4rem);
  border-color: var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 4vw, 2.4rem);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0.25rem 0 0.65rem;
  font-family: inherit;
  font-size: clamp(1.85rem, 5vw, 2.55rem);
  font-weight: 770;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.auth-card > p:not(.eyebrow, .field-error, .field-help, .privacy-note) {
  color: var(--muted);
}

.auth-card form .button--primary {
  width: 100%;
}

.auth-alternate {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.privacy-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.panel + .panel,
.inventory-section + .inventory-section {
  margin-top: 1rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading h2,
.panel h2 {
  letter-spacing: -0.025em;
}

.button {
  min-height: 46px;
  border-radius: 11px;
  padding-inline: 1rem;
  font-weight: 720;
  letter-spacing: -0.01em;
  box-shadow: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button--primary {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 7px 16px rgb(75 80 182 / 18%);
}

.button--primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.button--secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.button--secondary:hover {
  border-color: #9891a8;
  background: var(--surface-soft);
}

input,
select,
textarea {
  min-height: 48px;
  border-color: var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

label > span:first-child {
  color: #333c55;
  font-weight: 680;
}

.field-help,
small {
  color: var(--muted);
}

.notice {
  border-radius: 12px;
  box-shadow: none;
}

.notice--success {
  border-color: #9bc9b4;
  background: #e8f5ec;
  color: #205e49;
}

.notice--error {
  border-color: #e0a9ad;
  background: var(--danger-soft);
  color: #94313d;
}

.notice--info {
  border-color: #b5b9e4;
  background: #eceeff;
  color: #364384;
}

.status-chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: #454e64;
  font-size: 0.75rem;
  font-weight: 780;
  letter-spacing: 0.025em;
  text-transform: capitalize;
}

.progress-grid > div,
.review-totals > div {
  min-height: 88px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: none;
}

.progress-grid strong,
.review-totals strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.confirm-line,
.confirm-row {
  display: grid;
  min-height: 54px;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.85rem;
  color: var(--ink);
  font-size: 0.95rem;
}

.confirm-line input,
.confirm-row input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0.1rem 0 0;
  accent-color: var(--brand);
}

.work-grid {
  gap: 0.85rem;
}

.work-card {
  min-height: 210px;
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
}

.work-card h3 {
  font-size: 1.18rem;
  letter-spacing: -0.025em;
}

.work-card--ready {
  border-color: #c6c3e8;
  background: #f7f4ff;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.tool-card {
  display: grid;
  min-height: 112px;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.tool-card:hover {
  border-color: #aaa4b9;
  background: #f9f6ff;
  box-shadow: var(--shadow);
}

.tool-card .nav-icon {
  width: 25px;
  height: 25px;
  color: var(--brand);
}

.tool-card > span:nth-child(2) {
  display: grid;
  gap: 0.25rem;
}

.tool-card small {
  font-size: 0.86rem;
  font-weight: 500;
}

.tool-card--disabled {
  opacity: 0.7;
}

.auction-closeout-sales {
  display: grid;
  gap: 1rem;
}

.auction-closeout-sale,
.auction-closeout-preview {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}

.auction-closeout-sale h3,
.auction-closeout-preview h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.auction-closeout-sale__totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.auction-closeout-sale__totals div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--surface-soft);
}

.auction-closeout-sale__totals dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.auction-closeout-sale__totals dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .auction-closeout-sale__totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.choice-card {
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  padding: 0.85rem;
}

.choice-card input {
  min-height: 22px;
  width: 22px;
}

.choice-card span,
.inbound-cost-preview-values div {
  min-width: 0;
}

.choice-card small,
.inbound-cost-preview-values dt {
  color: var(--text-muted);
  display: block;
}

.inbound-cost-preview-values {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  margin: 0;
}

.inbound-cost-preview-values dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

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

/* Blind cycle-count workflow */
.cycle-count-queue {
  display: grid;
  gap: 1rem;
}

.cycle-count-card {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.cycle-count-card h2,
.cycle-count-card p {
  margin-block: 0.25rem;
}

.cycle-count-card h2 a {
  color: inherit;
}

.cycle-count-action-form {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: min(100%, 13rem);
}

.cycle-count-progress {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 1rem;
}

.cycle-count-progress div {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d9d6cf);
  border-radius: 1rem;
  padding: 1rem;
}

.cycle-count-progress dt {
  color: var(--muted, #5f6673);
  font-size: 0.875rem;
}

.cycle-count-progress dd {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  margin: 0.25rem 0 0;
}

.cycle-count-scan input[name="barcode"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  min-height: 3.25rem;
  width: 100%;
}

.cycle-count-controls dl {
  display: grid;
  gap: 0.75rem;
}

.cycle-count-controls dl div {
  display: grid;
  gap: 0.25rem;
}

.cycle-count-controls code {
  display: block;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  padding: 0.5rem;
}

.cycle-count-controls .button-row {
  align-items: flex-start;
}

.cycle-control-barcode-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin-block: 1rem;
}

.cycle-control-barcode {
  background: #fff;
  border: 1px solid var(--border, #d9d6cf);
  border-radius: 0.75rem;
  break-inside: avoid;
  color: #111;
  margin: 0;
  padding: 0.75rem;
}

.cycle-control-barcode svg {
  display: block;
  fill: #000;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.cycle-control-barcode figcaption {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
  text-align: center;
}

.cycle-count-latest {
  display: grid;
  gap: 0.5rem;
  list-style-position: inside;
  margin: 0;
  padding: 0;
}

.cycle-count-latest li {
  align-items: center;
  border-bottom: 1px solid var(--border, #d9d6cf);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 2.75rem;
  overflow-wrap: anywhere;
}

.cycle-count-safe-state .button,
.cycle-count-action-form .button,
.cycle-count-scan .button {
  min-height: 44px;
}

@media (max-width: 36rem) {
  .cycle-count-card {
    align-items: stretch;
    flex-direction: column;
  }

  .cycle-count-progress {
    grid-template-columns: 1fr;
  }

  .cycle-count-controls .button-row,
  .cycle-count-controls .cycle-count-action-form,
  .cycle-count-controls .button,
  .cycle-count-card .button {
    width: 100%;
  }
}

@media print {
  body:has(.cycle-count-controls) * {
    visibility: hidden;
  }

  body:has(.cycle-count-controls) .cycle-count-controls,
  body:has(.cycle-count-controls) .cycle-count-controls * {
    visibility: visible;
  }

  body:has(.cycle-count-controls) .cycle-count-controls {
    border: 0;
    box-shadow: none;
    inset: 0;
    padding: 0;
    position: absolute;
    width: 100%;
  }

  body:has(.cycle-scope-label-print) * {
    visibility: hidden;
  }

  body:has(.cycle-scope-label-print) .cycle-scope-label-print,
  body:has(.cycle-scope-label-print) .cycle-scope-label-print * {
    visibility: visible;
  }

  body:has(.cycle-scope-label-print) .cycle-scope-label-print {
    border: 0;
    box-shadow: none;
    inset: 0;
    padding: 0;
    position: absolute;
    width: 100%;
  }

  .cycle-control-barcode {
    border-color: #000;
    border-radius: 0;
    min-height: 1.25in;
    padding: 0.2in;
    page-break-inside: avoid;
  }

  .cycle-control-barcode svg {
    min-height: 0.7in;
  }

  .cycle-scope-label-print .cycle-control-barcode {
    margin: 0 auto;
    max-width: 4in;
  }
}

.support-request-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.75rem;
  margin: 0;
}

.support-request-details > div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.85rem;
}

.support-request-details dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.support-request-details dd {
  min-width: 0;
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.support-request-lookup form {
  max-width: 46rem;
}

.support-request-empty {
  margin-top: 1rem;
}

[data-support-request-notice] p {
  margin-bottom: 0;
}

[data-support-request-notice] .button {
  margin-top: 0.85rem;
}

.reliability-trends {
  margin-top: 1rem;
}

.reliability-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-block: 1rem;
}

.reliability-periods [aria-current="page"] {
  border-width: 2px;
  border-color: var(--ink);
  font-weight: 800;
}

.reliability-periods [aria-current="page"]::after {
  content: " ✓";
}

.reliability-trend-cards {
  display: none;
}

.reliability-trend-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.9rem;
}

.reliability-trend-card dl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.reliability-trend-card dl > div {
  min-width: 0;
}

.reliability-trend-card dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.reliability-trend-card dd {
  min-width: 0;
  margin: 0.2rem 0 0;
  font-weight: 800;
}

@media (max-width: 760px) {
  .reliability-trends-table {
    display: none;
  }

  .reliability-trend-cards {
    display: grid;
    gap: 0.75rem;
  }
}

@media (max-width: 380px) {
  .support-request-lookup .button,
  [data-support-request-notice] .button,
  .reliability-periods .button,
  [data-reliability-trends-notice] .button {
    width: 100%;
  }
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.account-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.account-panel p,
.account-panel h2 {
  margin-block: 0.2rem;
}

.empty-state {
  min-height: 180px;
  align-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 1.4rem;
  text-align: center;
}

.receipt-list {
  gap: 0.65rem;
}

.receipt-list .user-card {
  align-items: center;
  border-radius: 12px;
  box-shadow: none;
  text-decoration: none;
}

.camera-panel,
[data-camera-panel] {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #17213a;
  padding: 0.65rem;
}

[data-camera-preview] {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 9px;
}

.inventory-command-center {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.inventory-command-center .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
}

.inventory-command-center h2 {
  margin: 0.15rem 0 0;
}

.inventory-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  align-items: end;
  gap: 0.65rem;
}

.inventory-search__query {
  min-width: 0;
}

.filter-chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.1rem 0 0.2rem;
  scrollbar-width: thin;
}

.filter-chip {
  min-height: 44px;
  flex: 0 0 auto;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.45rem 0.8rem;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
}

.filter-chip:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.filter-chip--active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.filter-chip__current {
  margin-right: 0.22rem;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.inventory-command-center .filter-chips,
.inventory-sort {
  flex-wrap: wrap;
  overflow-x: visible;
}

.inventory-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.inventory-total-heading,
.inventory-results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.inventory-total-heading h3,
.inventory-results-heading h2,
.inventory-total-heading p,
.inventory-results-heading p {
  margin: 0;
}

.inventory-total-heading > p,
.inventory-results-heading > div > p:last-child {
  color: var(--muted);
  font-size: 0.84rem;
}

.inventory-kpi-card {
  display: grid;
  position: relative;
  min-height: 84px;
  align-content: center;
  gap: 0.1rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  padding: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.inventory-kpi-card:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  transform: translateY(-1px);
}

.inventory-kpi-card--static {
  cursor: default;
}

.inventory-kpi-card--static:hover {
  border-color: var(--border);
  background: var(--surface-soft);
  transform: none;
}

.inventory-kpi-card--selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.inventory-kpi-card--zero {
  color: var(--muted);
}

.inventory-kpi-card strong {
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.inventory-kpi-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.inventory-kpi-card small {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  color: var(--brand-strong);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-scope {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.inventory-results {
  min-width: 0;
}

.inventory-product-list {
  display: grid;
  gap: 0.65rem;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pagination > :last-child {
  justify-self: end;
}

.pagination > span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.inventory-product {
  overflow: clip;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.inventory-product__summary {
  display: grid;
  min-height: 92px;
  grid-template-columns: minmax(210px, 1.2fr) minmax(290px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.inventory-product__details[open] {
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.inventory-product__details > summary {
  min-height: 44px;
  align-content: center;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
}

.inventory-product__identity {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.inventory-product__identity strong {
  overflow: hidden;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-product__identity span {
  color: var(--muted);
  font-size: 0.83rem;
  text-transform: capitalize;
}

.inventory-product__value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.55rem;
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.inventory-product__value dt,
.inventory-product__value dd {
  margin: 0;
}

.inventory-product__value dd {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.inventory-product__states {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 0.4rem;
}

.inventory-product__state {
  display: grid;
  min-height: 52px;
  align-content: center;
  gap: 0.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.45rem 0.6rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-decoration: none;
}

.inventory-product__state[href]:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.inventory-product__state strong {
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.inventory-product__state--zero {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--ink);
}

.inventory-product__state--available {
  border-color: #a9cfbd;
}

.inventory-product__state--pending {
  border-color: #bcb6ec;
}

.inventory-product__state--hold {
  border-color: #e0bb68;
}

.inventory-attention-badge,
.inventory-routine-badge {
  min-height: 32px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-attention-badge {
  border-color: #e0bb68;
  background: #fff1ce;
  color: #80510c;
}

.inventory-routine-badge {
  background: var(--surface-soft);
  color: var(--muted);
}

.inventory-product__details-body {
  display: grid;
  gap: 0.75rem;
  padding: 0 0.85rem 0.85rem;
}

.inventory-next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.85rem;
}

.inventory-next-action p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.inventory-next-action--guidance {
  border-left: 4px solid var(--brand);
}

.inventory-product__more {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.inventory-product__more > summary {
  min-height: 44px;
  align-content: center;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.inventory-activity-link {
  justify-self: start;
}

.inventory-activity {
  display: grid;
  gap: 1rem;
}

.inventory-activity-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inventory-activity-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.9rem;
}

.inventory-activity-card p {
  margin: 0;
  color: var(--muted);
}

.inventory-activity__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.inventory-activity__heading > div,
.inventory-activity__private span {
  display: grid;
  gap: 0.15rem;
}

.inventory-activity__heading time,
.inventory-activity__private {
  color: var(--muted);
  font-size: 0.8rem;
}

.inventory-activity__private {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.inventory-activity__private strong {
  color: var(--ink);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.inventory-product__balances {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0.85rem;
}

.inventory-product__balances > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0.65rem;
}

.inventory-product__balances dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.inventory-product__balances dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.inventory-state--available {
  border-color: #a9cfbd !important;
  background: #e8f5ec !important;
  color: #205e49 !important;
}

.inventory-state--hold {
  border-color: #e0bb68 !important;
  background: #fff1ce !important;
  color: #80510c !important;
}

.inventory-product__open {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.inventory-product__open::after {
  display: inline-block;
  margin-left: 0.35rem;
  content: "⌄";
  transition: transform 140ms ease;
}

.inventory-product__details[open] .inventory-product__open::after {
  transform: rotate(180deg);
}

.inventory-mapping-notice {
  margin-top: 0.25rem;
}

.inventory-mapping-notice .button {
  margin-top: 0.55rem;
}

#inventory-results-title:focus-visible,
#individual-record-title:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

[data-inventory-results][aria-busy="true"] {
  cursor: progress;
}

.inventory-unit-list {
  display: grid;
}

.inventory-bottle {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(240px, 1fr) minmax(180px, 0.7fr);
  align-items: start;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.inventory-bottle:last-child {
  border-bottom: 0;
}

.inventory-bottle__identity {
  display: grid;
  justify-items: start;
  gap: 0.22rem;
}

.inventory-bottle__identity > strong {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.inventory-bottle__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
}

.inventory-bottle__facts div {
  display: grid;
  gap: 0.1rem;
}

.inventory-bottle__facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.inventory-bottle__facts dd {
  margin: 0;
  font-size: 0.86rem;
}

.inventory-bottle__action {
  justify-self: end;
}

.inventory-bottle__action > summary {
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 720;
  cursor: pointer;
}

.inventory-bottle__action[open] {
  grid-column: 1 / -1;
  width: min(100%, 520px);
  justify-self: end;
}

.inventory-bottle__action form {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.9rem;
}

.status-chip--available {
  border-color: #a9cfbd;
  background: #e8f5ec;
  color: #205e49;
}

.status-chip--hold {
  border-color: #e0bb68;
  background: #fff1ce;
  color: #80510c;
}

.status-chip--damaged,
.status-chip--missing {
  border-color: #e0a9ad;
  background: var(--danger-soft);
  color: #94313d;
}

.status-chip--reserved {
  border-color: #b9c2ed;
  background: #e8ecff;
  color: #3c4f93;
}

.status-chip--sold {
  border-color: #cac6d4;
  background: #edeaf1;
  color: #555b70;
}

.workflow-stepper {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.8rem;
  box-shadow: var(--shadow-soft);
}

.workflow-stepper ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-stepper__compact {
  display: none;
  font-weight: 800;
}

.workflow-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.35rem 0.65rem;
  color: var(--muted);
}

.workflow-step:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 2px;
  height: 18px;
  background: var(--border);
  content: "";
  transform: translateY(-50%);
}

.workflow-step > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.workflow-step strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step--complete {
  color: var(--success);
}

.workflow-step--complete > span {
  border-color: #9bc9b4;
  background: #e8f5ec;
}

.workflow-step--current {
  color: var(--brand-strong);
}

.workflow-step--current > span {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.scan-workspace-panel {
  border-color: #c9c6eb;
  box-shadow: 0 1px 2px rgb(31 42 68 / 5%), 0 16px 38px rgb(75 80 182 / 9%);
}

.workflow-stage {
  margin-top: 0.75rem;
  overflow: clip;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.workflow-stage > summary {
  display: grid;
  min-height: 72px;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.workflow-stage > summary::-webkit-details-marker {
  display: none;
}

.workflow-stage > summary:hover,
.workflow-stage[open] > summary {
  background: var(--surface-soft);
}

.workflow-stage[open] > summary {
  border-bottom: 1px solid var(--border);
}

.workflow-stage > summary > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
}

.workflow-stage > summary > div {
  display: grid;
  gap: 0.1rem;
}

.workflow-stage > summary small {
  font-size: 0.76rem;
  font-weight: 550;
}

.workflow-stage > summary > span:last-child {
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 750;
}

.workflow-stage > summary > span:last-child::after {
  display: inline-block;
  margin-left: 0.35rem;
  content: "⌄";
}

.workflow-stage[open] > summary > span:last-child::after {
  transform: rotate(180deg);
}

.workflow-stage__body {
  padding: clamp(1rem, 2.4vw, 1.5rem);
}

.workflow-stage__body > p:first-child {
  color: var(--muted);
}

.auction-allocation-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.auction-allocation-list article {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.auction-allocation-list article:last-child {
  border-bottom: 0;
}

.auction-allocation-list article:nth-child(even) {
  background: #f8f3ec;
}

.auction-allocation-list article > div {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.auction-allocation-list article strong,
.auction-allocation-list article small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auction-allocation__number {
  color: var(--brand-strong);
  font-size: 1rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.report-summary article {
  display: grid;
  min-height: 110px;
  align-content: center;
  gap: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.report-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.report-summary strong {
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
}

.report-list {
  display: grid;
  gap: 0.55rem;
}

.report-list > a {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.3fr) auto;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  color: var(--ink);
  text-decoration: none;
}

.report-list > a:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.report-list > a > div:first-child {
  display: grid;
  gap: 0.15rem;
}

.report-list > a > div:first-child span {
  color: var(--muted);
  font-size: 0.8rem;
}

.report-list dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.report-list dl div {
  display: grid;
  gap: 0.05rem;
}

.report-list dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.report-list dd {
  margin: 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.packing-resume,
.packing-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.packing-resume {
  margin-bottom: 1rem;
  border-color: #a9cfbd;
  background: #f2fbf5;
}

.packing-resume h2,
.packing-resume p:last-child,
.packing-hero h1,
.packing-hero p:last-child {
  margin-bottom: 0;
}

.packing-context {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.button--large {
  min-height: 54px;
  padding-inline: 1.25rem;
  font-size: 1rem;
}

.packing-scan-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.packing-scan-form .field-error,
.packing-scan-form [data-form-status] {
  grid-column: 1 / -1;
}

.packing-progress-number {
  color: var(--brand-strong);
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  font-variant-numeric: tabular-nums;
}

.pending-source-list {
  display: grid;
  gap: 1rem;
}

.pending-source-card,
.pending-source-context {
  margin-bottom: 0;
}

.pending-source-card .inventory-product__balances {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-inline: 0;
}

.pending-source-card > .button {
  margin-top: 0.9rem;
}

@media (max-width: 760px) {
  .pending-source-card .inventory-product__balances {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-source-card > .button,
  .pending-source-context .button {
    width: 100%;
  }
}

.packing-progress {
  display: block;
  width: 100%;
  height: 12px;
  margin: 1rem 0;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #e6e8ee;
}

.packing-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e6e8ee;
}

.packing-progress::-webkit-progress-value,
.packing-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--success);
}

.packing-scan-feedback {
  display: grid;
  gap: 0.2rem;
}

.packing-checklist {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.packing-check-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.packing-check-item > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  font-weight: 850;
}

.packing-check-item > div {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.packing-check-item strong,
.packing-check-item small {
  overflow-wrap: anywhere;
}

.packing-check-item--accepted {
  border-color: #a9cfbd;
  background: #f2fbf5;
}

.packing-check-item--accepted > span {
  background: #dff3e7;
  color: var(--success);
}

.packing-check-item--missing {
  border-color: #e0bb68;
  background: #fffaf0;
}

.packing-check-item--missing > span {
  background: #fff1ce;
  color: #80510c;
}

.packing-evidence-readiness,
.packing-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.packing-evidence-readiness > div,
.packing-summary > div {
  display: grid;
  gap: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.85rem;
}

.packing-evidence-readiness > div {
  grid-template-columns: 28px minmax(0, 1fr);
}

.packing-evidence-readiness > div > span {
  grid-row: 1 / 3;
  font-size: 1.25rem;
  font-weight: 850;
}

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

.packing-summary dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}

.packing-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.packing-exception {
  border-color: #e0bb68;
}

.packing-complete {
  border-width: 2px;
  text-align: center;
}

.packing-complete--verified {
  border-color: #85b697;
  background: #f2fbf5;
}

.packing-complete--exception {
  border-color: #e0bb68;
  background: #fffaf0;
}

.packing-complete .packing-summary {
  text-align: left;
}

.packing-privacy-mask {
  display: grid;
  min-height: 55dvh;
  place-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  text-align: center;
}

.packing-privacy-mask[hidden] {
  display: none;
}

@media (min-width: 600px) and (max-width: 1023px) {
  .primary-nav {
    width: 96px;
    padding: 0.85rem 0.55rem;
  }

  .primary-nav > a,
  .primary-nav > span {
    gap: 0.3rem;
    padding: 0.55rem 0.2rem;
    font-size: 0.72rem;
  }

  .primary-nav__group-label {
    display: none !important;
  }

  .primary-nav [aria-current="page"]::before {
    left: -0.56rem;
  }

  .authenticated-layout {
    padding-left: 96px;
  }

  .page-shell {
    width: min(calc(100% - 2rem), var(--content));
  }

  .inventory-product__summary {
    grid-template-columns: 1fr auto;
  }

  .inventory-product__states {
    grid-column: 1 / -1;
  }

  .inventory-bottle {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-bottle__action {
    grid-column: 1 / -1;
    justify-self: start;
  }

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

  .report-list > a {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 599px) {
  .site-header {
    min-height: 66px;
    padding: 0.65rem max(0.75rem, env(safe-area-inset-right)) 0.65rem max(0.75rem, env(safe-area-inset-left));
  }

  .brand__mark {
    width: 36px;
    height: 36px;
  }

  .brand__wordmark {
    display: none;
  }

  .active-worker {
    max-width: 150px;
    padding: 0.28rem 0.45rem;
  }

  .active-worker strong {
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .role-badge,
  .lock-form {
    display: none;
  }

  .primary-nav {
    z-index: 45;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-content: stretch;
    border-top: 1px solid var(--border);
    border-right: 0;
    padding: 0 0 max(0.2rem, env(safe-area-inset-bottom));
    background: var(--surface);
    box-shadow: 0 -10px 28px rgb(31 42 68 / 10%);
    backdrop-filter: none;
  }

  .primary-nav > a,
  .primary-nav > span {
    display: grid;
    min-height: 64px;
    justify-items: center;
    gap: 0.16rem;
    border-radius: 0;
    padding: 0.45rem 0.1rem 0.35rem;
    font-size: 0.75rem;
  }

  .primary-nav__group-label,
  .primary-nav__desktop-only {
    display: none !important;
  }

  .primary-nav__mobile-only {
    display: grid !important;
  }

  .primary-nav [aria-current="page"] {
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    box-shadow: inset 0 0 0 1px #cfd0f3;
  }

  .primary-nav [aria-current="page"]::before {
    inset: 0.18rem auto auto 50%;
    width: 22px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    transform: translateX(-50%);
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .page-shell {
    width: min(calc(100% - 1rem), var(--content));
    padding-top: 1rem;
    padding-bottom: calc(5.8rem + env(safe-area-inset-bottom));
  }

  body {
    overflow-x: clip;
  }

  .authenticated-layout {
    padding-left: 0;
  }

  .hero,
  .page-heading {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
  }

  .hero h1,
  .page-heading h1 {
    font-size: 1.72rem;
  }

  .panel {
    border-radius: 14px;
    padding: 1rem;
  }

  .button,
  button,
  input,
  select,
  textarea {
    font-size: 1rem;
  }

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

  .tool-card {
    min-height: 96px;
  }

  .account-panel,
  .account-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row {
    align-items: stretch;
  }

  .button-row > .button,
  .button-row > form,
  .button-row > form .button {
    width: 100%;
  }

  .progress-grid > div,
  .review-totals > div {
    min-height: 78px;
  }

  .inventory-search {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-search__query {
    grid-column: 1 / -1;
  }

  .inventory-search .button {
    width: 100%;
  }

  .inventory-search .inventory-scan-primary {
    grid-column: 1 / -1;
    min-height: 54px;
  }

  .inventory-activity-link {
    width: 100%;
  }

  .inventory-activity__heading {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .inventory-total-heading,
  .inventory-results-heading,
  .inventory-next-action {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-product__summary {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.9rem;
  }

  .inventory-product__identity strong {
    white-space: normal;
  }

  .inventory-product__open {
    justify-self: start;
  }

  .inventory-attention-badge,
  .inventory-routine-badge {
    justify-self: start;
  }

  .inventory-bottle {
    grid-template-columns: 1fr;
    padding: 0.9rem;
  }

  .inventory-bottle__facts {
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
  }

  .inventory-bottle__action,
  .inventory-bottle__action[open] {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
  }

  .workflow-stepper {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0.7rem;
  }

  .workflow-stepper ol {
    min-width: 590px;
  }

  .auction-allocation-list article {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .auction-allocation-list .status-chip {
    grid-column: 2;
    justify-self: start;
  }

  .report-summary {
    grid-template-columns: 1fr 1fr;
  }

  .report-summary article {
    min-height: 92px;
  }

  .report-list > a {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-list dl {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .packing-resume,
  .packing-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .packing-resume .button {
    width: 100%;
  }

  .packing-context {
    justify-content: flex-start;
  }

  .packing-scan-form {
    grid-template-columns: 1fr;
  }

  .packing-scan-form .button {
    width: 100%;
  }

  .packing-evidence-readiness,
  .packing-summary {
    grid-template-columns: 1fr;
  }
}

.catalog-action-dialog {
  position: fixed;
  inset: 0;
  width: min(52rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(31, 42, 68, 0.32);
}

.catalog-action-dialog:not([open]) {
  display: none;
}

.catalog-action-dialog::backdrop {
  background: rgba(31, 42, 68, 0.66);
}

.catalog-action-dialog[data-dialog-fallback][open] {
  box-shadow:
    0 0 0 100vmax rgba(31, 42, 68, 0.66),
    0 24px 64px rgba(31, 42, 68, 0.32);
}

body:has(.catalog-action-dialog[open]) {
  overflow: hidden;
}

.catalog-action-dialog__surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - 2rem);
}

.catalog-action-dialog__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem clamp(1rem, 3vw, 1.5rem);
  background: var(--surface-raised);
}

.catalog-action-dialog__header h2,
.catalog-action-dialog__header p,
.catalog-action-dialog__identity p,
.catalog-action-dialog__stock h3 {
  margin: 0;
}

.catalog-action-dialog__header h2,
.catalog-action-dialog__identity,
.catalog-action-dialog code {
  overflow-wrap: anywhere;
}

.catalog-action-dialog__close {
  min-height: 44px;
}

.catalog-action-dialog__body {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.catalog-action-dialog__body > *,
.catalog-action-dialog__body form,
.catalog-action-dialog__body fieldset,
.catalog-action-dialog__body label,
.catalog-action-dialog__body input,
.catalog-action-dialog__body select,
.catalog-action-dialog__body textarea,
.catalog-action-dialog__body button {
  min-width: 0;
  max-width: 100%;
}

.catalog-action-dialog__identity {
  display: grid;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.catalog-action-dialog__stock {
  display: grid;
  gap: 0.5rem;
}

.catalog-action-dialog__footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.catalog-action-dialog .catalog-action-panel {
  margin-top: 0;
}

.catalog-action-dialog .quick-pending-form > .button[type="submit"],
.catalog-action-dialog .catalog-action-choice > .button {
  min-height: 56px;
  font-size: 1rem;
}

.catalog-action-panel {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.catalog-action-panel h3,
.catalog-action-panel p {
  margin: 0;
}

.quick-pending-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.catalog-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.75rem;
}

.catalog-action-choice {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.catalog-action-choice .button {
  width: 100%;
}

.catalog-action-grid small {
  color: var(--muted);
}

.quick-pending-result {
  display: grid;
  gap: 0.75rem;
}

.quick-pending-result[hidden] {
  display: none;
}

.lot-adjustment-form {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.lot-adjustment-form[hidden] {
  display: none;
}

.lot-adjustment-summary,
.catalog-stock-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.lot-adjustment-summary span,
.catalog-stock-summary > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.catalog-stock-summary {
  margin: 0.85rem 0;
}

.catalog-stock-summary--compact {
  grid-template-columns: minmax(0, 12rem);
}

.catalog-stock-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.catalog-stock-summary dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.lot-adjustment-form fieldset {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  border: 0;
  padding: 0;
}

.lot-adjustment-form .choice-row {
  min-height: 48px;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.lot-adjustment-form .choice-row span,
.lot-adjustment-form .choice-row small {
  display: block;
}

.incident-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
}

.incident-code code {
  font-size: 1rem;
  font-weight: 800;
}

.scan-pending-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  overflow-wrap: anywhere;
}

.scan-pending-identity[hidden] {
  display: none;
}

.scan-pending-identity code {
  font-weight: 800;
}

.diagnostic-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.diagnostic-summary article {
  overflow-wrap: anywhere;
}

.diagnostic-source-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.diagnostic-source-nav .button {
  max-width: 100%;
  white-space: normal;
}

.diagnostic-source-nav .button[aria-current="page"] {
  border-width: 2px;
  border-color: var(--ink);
  font-weight: 800;
  box-shadow: inset 0 -4px 0 var(--accent);
}

.diagnostic-source-nav__selected {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.diagnostic-offline-message {
  margin-block: 0 1rem;
}

.diagnostic-source-note {
  display: grid;
  gap: 0.25rem;
  max-width: 72ch;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border-inline-start: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow-wrap: anywhere;
}

.diagnostic-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 0.8rem;
}

.diagnostic-filters .button {
  min-height: 48px;
}

.diagnostic-table small,
.diagnostic-table td > span,
.diagnostic-card__details span {
  display: block;
  margin-top: 0.25rem;
}

.diagnostic-cards {
  display: none;
}

.diagnostic-card,
.diagnostic-timeline__item {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.diagnostic-card *,
.diagnostic-timeline__item * {
  max-width: 100%;
}

.diagnostic-card p,
.diagnostic-timeline__item p,
.diagnostic-timeline__item h2 {
  overflow-wrap: anywhere;
}

.diagnostic-timeline {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.diagnostic-timeline__item > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (max-width: 760px) {
  .workflow-stepper {
    overflow: visible;
  }

  .workflow-stepper__compact {
    display: block;
  }

  .workflow-stepper ol {
    display: none;
    min-width: 0;
  }

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

  .quick-pending-fields,
  .catalog-action-grid,
  .lot-adjustment-summary,
  .catalog-stock-summary {
    grid-template-columns: 1fr;
  }

  .catalog-action-grid small {
    margin-bottom: 0.5rem;
  }

  .catalog-action-dialog .button-row,
  .catalog-action-dialog__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-action-dialog .button-row .button,
  .catalog-action-dialog__footer .button {
    width: 100%;
  }

  .diagnostic-summary,
  .diagnostic-filters {
    grid-template-columns: 1fr;
  }

  .diagnostic-table {
    display: none;
  }

  .diagnostic-cards {
    display: grid;
    gap: 0.75rem;
  }

  .incident-code,
  .incident-code .button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .catalog-action-dialog {
    width: calc(100% - 0.75rem);
    max-height: calc(100dvh - 0.75rem);
    border-radius: 12px;
  }

  .catalog-action-dialog__surface {
    max-height: calc(100dvh - 0.75rem);
  }

  .catalog-action-dialog__header {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .catalog-action-dialog__close {
    width: 100%;
  }

  .catalog-action-dialog__body,
  .catalog-action-panel {
    padding: 0.75rem;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #454d61;
    --border: #777187;
    --border-strong: #5d586d;
  }

  .panel,
  .work-card,
  .tool-card,
  .catalog-card,
  .catalog-action-dialog,
  .catalog-action-panel,
  .user-card,
  .confirm-line,
  .confirm-row {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .catalog-action-dialog {
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .catalog-action-dialog[data-dialog-fallback][open] {
    box-shadow: 0 0 0 100vmax Canvas;
  }

  .catalog-action-dialog::backdrop {
    background: Canvas;
    opacity: 0.75;
  }
}

.packing-report-filters {
  display: grid;
  grid-template-columns: minmax(15rem, 2fr) repeat(2, minmax(10rem, 1fr)) auto;
  gap: 1rem;
  align-items: end;
}

.packing-report-list,
.packing-evidence-grid {
  display: grid;
  gap: 0.9rem;
}

.packing-report-card,
.packing-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.packing-report-card > div:first-child,
.packing-alert a {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.packing-report-card__status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.packing-alert a {
  color: inherit;
  text-decoration: none;
}

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

.packing-evidence-photo {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.packing-evidence-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 0.75rem;
  background: var(--surface-soft);
}

@media (max-width: 760px) {
  .packing-report-filters,
  .packing-evidence-grid,
  .packing-alert,
  .packing-report-card {
    grid-template-columns: 1fr;
  }

  .packing-report-card__status {
    justify-content: flex-start;
  }
}

@media (max-width: 240px) {
  .inventory-kpis,
  .inventory-product__states,
  .inventory-product__balances {
    grid-template-columns: 1fr;
  }

  .inventory-kpi-card,
  .inventory-product__state,
  .inventory-next-action,
  .inventory-product__summary,
  .inventory-product__details > summary,
  .inventory-product__details-body {
    min-width: 0;
  }

  .inventory-product__open {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.packing-video-hero {
  align-items: center;
}

.recording-band {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  border: 2px solid currentColor;
  border-radius: 1rem;
  font-variant-numeric: tabular-nums;
}

.recording-band > div {
  display: grid;
  gap: 0.2rem;
}

.recording-band__signal {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  border: 3px solid currentColor;
  border-radius: 999px;
  background: currentColor;
}

.recording-band--ready {
  color: #175c4b;
  background: #e8f7f1;
}

.recording-band--active {
  color: #8d252b;
  background: #fff0ef;
}

.recording-band--active .recording-band__signal {
  animation: recording-pulse 1.25s ease-in-out infinite;
}

@keyframes recording-pulse {
  50% { opacity: 0.35; transform: scale(0.82); }
}

.packing-video-scan-panel input[data-packing-video-scan] {
  min-height: 4rem;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  letter-spacing: 0.04em;
}

.packing-control-guide,
.packing-video-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.packing-control-guide article,
.packing-video-evidence-card {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}

.packing-control-guide strong {
  font-size: 1.15rem;
}

.packing-video-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.packing-video-evidence-card video,
.packing-video-evidence-card img {
  width: 100%;
  max-height: 32rem;
  object-fit: contain;
  border-radius: 0.75rem;
  background: #10131a;
}

.evidence-timeline {
  position: relative;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: visible;
}

.evidence-timeline__marker {
  position: absolute;
  top: -0.25rem;
  width: 0.2rem;
  height: 1.1rem;
  background: #a12b32;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .packing-control-guide,
  .packing-video-evidence-grid,
  .packing-video-search {
    grid-template-columns: 1fr;
  }

  .recording-band {
    align-items: flex-start;
    padding: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recording-band--active .recording-band__signal {
    animation: none;
  }
}
