:root {
  --ink: #171a1f;
  --muted: #66707d;
  --line: #d9dee6;
  --paper: #f5f7f9;
  --surface: #ffffff;
  --blue: #235fc7;
  --blue-deep: #16448f;
  --blue-soft: #eaf1ff;
  --amber: #d88a14;
  --amber-soft: #fff4d8;
  --green: #137154;
  --green-soft: #e5f6ef;
  --red: #b42318;
  --red-soft: #fff0ee;
  --shadow: 0 10px 32px rgba(36, 47, 64, 0.08);
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

/* 2026 operator flow cleanup */
.notice[data-dismissible-notice] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.notice[data-dismissible-notice] > span { min-width: 0; }
.notice[data-dismissible-notice] button {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.notice[data-dismissible-notice] button:hover { background: rgba(0, 0, 0, 0.06); }

.login-shell { background: radial-gradient(circle at 50% 10%, #ffffff 0, #f5f7f9 42%, #edf1f5 100%); }
.login-panel {
  padding: 36px;
  text-align: center;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(.2,.8,.2,1), box-shadow 240ms ease;
}
.login-panel .brand-mark { margin: 0 auto 24px; }
.login-panel h1 { margin-bottom: 8px; font-size: 30px; }
.login-panel > .muted { margin: 0 auto 26px; max-width: 310px; font-size: 13px; }
.login-panel .google-signin { display: grid; justify-items: center; gap: 8px; }
.login-panel .google-signin-status { min-height: 20px; margin: 0; color: var(--muted); font-size: 12px; }
.login-panel.is-signing-in { transform: translateY(-3px) scale(.995); box-shadow: 0 20px 60px rgba(36, 47, 64, .13); }
.login-panel.is-signing-in [data-google-button] { opacity: .45; pointer-events: none; }
.login-panel.is-leaving { opacity: 0; transform: translateY(-10px) scale(.985); }

.settings-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.agent-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.agent-badge.is-online { background: var(--green-soft); color: var(--green); }
.agent-badge.is-offline { background: var(--amber-soft); color: #86520a; }
.source-action-popover .agent-badge { justify-content: center; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.source-sync-failed { color: var(--red); }

.parcel-sheets .allocation-panel {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.parcel-sheets .allocation-panel > .sheet-heading { padding-top: 18px; }
.import-charge-breakdown {
  display: grid;
  gap: 1px;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}
.import-charge-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px;
  background: #fff;
  font-size: 11px;
}
.import-charge-breakdown dt { color: var(--muted); }
.import-charge-breakdown dd { margin: 0; font-family: "SFMono-Regular", Consolas, monospace; font-weight: 800; }
.label-workspace > .label-sku-list { margin: 26px auto; }

.reports-page { width: min(1260px, calc(100% - 40px)); }
.reports-heading { margin-bottom: 20px; }
.report-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.report-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.report-filters select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.report-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}
.report-metrics article { display: grid; gap: 5px; padding: 16px; border-left: 1px solid var(--line); }
.report-metrics article:first-child { border-left: 0; background: var(--ink); color: #fff; }
.report-metrics span, .report-metrics small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.report-metrics article:first-child span, .report-metrics article:first-child small { color: #cbd2dc; }
.report-metrics strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 15px; letter-spacing: -.04em; }
.spending-chart, .report-table-section {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.spending-chart > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.spending-chart h2, .report-table-section h2 { margin: 0; }
.spending-chart header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; }
.chart-legend .is-purchase, .chart-bar .is-purchase { fill: #235fc7; background: #235fc7; }
.chart-legend .is-shipping, .chart-bar .is-shipping { fill: #55a0d8; background: #55a0d8; }
.chart-legend .is-fees, .chart-bar .is-fees { fill: #8d79c7; background: #8d79c7; }
.chart-legend .is-import, .chart-bar .is-import { fill: #d88a14; background: #d88a14; }
.chart-rows { display: grid; gap: 12px; }
.chart-row { display: grid; grid-template-columns: 120px minmax(180px, 1fr) 100px; align-items: center; gap: 12px; }
.chart-row-label { display: grid; gap: 2px; font-size: 11px; font-weight: 800; }
.chart-row-label small { color: var(--muted); font-size: 9px; font-weight: 500; }
.chart-track { height: 12px; border-radius: 3px; background: #edf0f4; overflow: hidden; }
.chart-bar { display: block; width: 100%; height: 12px; overflow: visible; }
.chart-row > strong { text-align: right; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.report-table-section h2 { margin-bottom: 14px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.report-table th, .report-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.report-table th:first-child, .report-table td:first-child { text-align: left; }
.report-table th { color: var(--muted); font-size: 9px; text-transform: uppercase; }

@media (max-width: 900px) {
  .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filters .button { grid-column: 1 / -1; }
  .report-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-metrics article:nth-child(4) { border-left: 0; }
}

@media (max-width: 620px) {
  .login-panel { padding: 28px 22px; }
  .settings-heading-row, .spending-chart > header { flex-direction: column; }
  .report-filters, .report-metrics { grid-template-columns: 1fr; }
  .report-metrics article { border-top: 1px solid var(--line); border-left: 0; }
  .chart-row { grid-template-columns: 82px minmax(100px, 1fr) 78px; gap: 8px; }
}

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

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: inherit; }
button, input, select { font: inherit; }
.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;
}
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 8px;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 750;
  letter-spacing: -0.045em;
}
h2 { margin-bottom: 4px; font-size: 20px; letter-spacing: -0.02em; }
h3 { margin: 6px 0; font-size: 16px; }

.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 62px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}
.app-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.app-brand > span, .brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-family: "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 800;
}
.app-bar nav { display: flex; gap: 4px; }
.app-bar nav a {
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.app-bar nav a[aria-current="page"] { color: var(--blue-deep); background: var(--blue-soft); }
.operator-chip { justify-self: end; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.operator-chip button { padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer; }

.page { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.narrow-page { width: min(1040px, calc(100% - 40px)); }
.page-heading, .parcel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}
.page-heading > div > p:last-child, .parcel-heading > div > p:last-child { margin-bottom: 0; }
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { border-color: #aeb8c5; }
.button:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(35, 95, 199, 0.3);
  outline-offset: 2px;
}
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button-primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.button-primary:hover { border-color: var(--blue-deep); background: var(--blue-deep); }
.button-quiet { background: transparent; }

.notice {
  margin-bottom: 20px;
  padding: 12px 15px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}
.notice-success { border-color: #a8dfca; background: var(--green-soft); color: var(--green); }
.notice-error { border-color: #ffc7c1; background: var(--red-soft); color: var(--red); }

.sync-stack { display: grid; gap: 10px; }
.sync-card {
  display: flex;
  min-width: 400px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sync-card > div { display: grid; gap: 3px; max-width: 420px; }
.sync-card span { font-size: 12px; }
.sync-card .sync-state { color: var(--ink); font-weight: 800; }
.sync-card .sync-warning { color: var(--red); font-size: 11px; font-weight: 800; }
.sync-card .sync-caveat { color: #8a5a0a; font-size: 10px; }

.accounting-note {
  display: grid;
  gap: 3px;
  margin: 14px 20px 0;
  padding: 12px 14px;
  border: 1px solid #eed9a9;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #70470d;
}
.accounting-note.is-open { border-color: #efc1bd; background: var(--red-soft); color: #8a2c23; }
.accounting-note strong { font-size: 13px; }
.accounting-note span { font-size: 12px; }
.accounting-note small { font-size: 11px; opacity: 0.82; }

.search-strip { display: flex; gap: 10px; margin-bottom: 20px; }
.search-strip input {
  width: min(520px, 100%);
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.parcel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stage-badge, .status-dot {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.stage-break-down, .stage-itemize { background: var(--amber-soft); color: #86520a; }
.stage-print-labels, .stage-store { background: var(--blue-soft); color: var(--blue-deep); }
.stage-complete, .status-complete { background: var(--green-soft); color: var(--green); }
.status-open { background: var(--amber-soft); color: #86520a; }
.progress-track { height: 4px; margin: 14px 0; border-radius: 99px; background: #e9edf2; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.progress-0 { width: 0; }
.progress-10 { width: 10%; }
.progress-20 { width: 20%; }
.progress-30 { width: 30%; }
.progress-40 { width: 40%; }
.progress-50 { width: 50%; }
.progress-60 { width: 60%; }
.progress-70 { width: 70%; }
.progress-80 { width: 80%; }
.progress-90 { width: 90%; }
.progress-100 { width: 100%; }

.home-page,
.inventory-page {
  width: min(1320px, calc(100% - 40px));
}
.home-heading,
.inventory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}
.home-heading p:last-child,
.inventory-heading p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
}
.home-summary {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(36, 47, 64, 0.05);
  overflow: hidden;
}
.home-summary > * {
  display: grid;
  min-height: 112px;
  align-content: center;
  gap: 3px;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
  text-decoration: none;
}
.home-summary > *:last-child { border-right: 0; }
.home-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-summary strong {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.home-summary small { color: var(--muted); font-size: 11px; }
.home-summary-primary {
  background: var(--blue-soft);
  color: var(--blue-deep);
}
.home-summary-primary span,
.home-summary-primary small { color: var(--blue-deep); }
.home-summary-primary:hover { background: #dfeaff; }

.source-center {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef1f5;
}
.source-center > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.source-center > summary::-webkit-details-marker { display: none; }
.source-center > summary > span:first-child { display: grid; gap: 2px; }
.source-center > summary strong { font-size: 12px; }
.source-center > summary small { color: var(--muted); font-size: 10px; }
.source-center > summary > span:last-child {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.source-center[open] > summary > span:last-child::after { content: " ↑"; }
.source-center .sync-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}
.source-center .sync-card {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: initial;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.source-center .sync-card > div { max-width: none; }

.provider-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  background-color: #fff;
  background-image: url("/provider-icons.png?v=20260726-1");
  background-position-y: center;
  background-repeat: no-repeat;
  background-size: 400% 100%;
  color: var(--muted);
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}
.provider-mark-compact {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 9px;
}
.provider-mark-fj { background-position-x: 0%; }
.provider-mark-zm { background-position-x: 33.333%; }
.provider-mark-pyu { background-position-x: 66.667%; }
.provider-mark-jr { background-position-x: 100%; }
.provider-mark-other {
  background-image: none;
}
.provider-all {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.parcel-controls,
.inventory-controls {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.parcel-search,
.inventory-search {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}
.parcel-search label,
.inventory-search label {
  display: grid;
  flex: 1;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.parcel-search input,
.inventory-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
}
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.filter-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.filter-pills,
.provider-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.filter-pills a,
.provider-filters a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.filter-pills a:hover,
.provider-filters a:hover { border-color: var(--line); background: #f7f8fa; color: var(--ink); }
.filter-pills a[aria-current="page"],
.provider-filters a[aria-current="page"] {
  border-color: #c6d6f2;
  background: var(--blue-soft);
  color: var(--blue-deep);
}
.recorded-definition {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #e7eaf0;
  color: var(--muted);
  font-size: 11px;
}
.recorded-definition strong { color: var(--green); }

.parcel-section { margin-top: 30px; }
.parcel-section + .parcel-section { margin-top: 38px; }
.parcel-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.parcel-section-heading h2 { margin: 0; font-size: 18px; }
.parcel-section-title { display: flex; align-items: center; gap: 9px; }
.parcel-section-count {
  display: inline-grid;
  min-width: 24px;
  padding: 3px 7px;
  place-items: center;
  border-radius: 99px;
  background: #eaedf2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stage-costs,
.stage-identity { background: var(--amber-soft); color: #86520a; }
.stage-recorded { background: #eef2f3; color: #4d5963; }

.inventory-heading-note {
  display: grid;
  min-width: 220px;
  gap: 3px;
  padding: 13px 15px;
  border-left: 3px solid var(--blue);
  background: var(--surface);
}
.inventory-heading-note strong { font-size: 13px; }
.inventory-heading-note span { color: var(--muted); font-size: 10px; }
.inventory-heading-note .title-language-toggle { margin-top: 8px; }

.title-language-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.title-language-toolbar > span {
  display: grid;
  gap: 2px;
}
.title-language-toolbar small {
  color: var(--muted);
  font-size: 10px;
}
.title-language-toggle {
  display: inline-flex;
  width: fit-content;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f3f6;
}
.title-language-toggle button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}
.title-language-toggle button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(36, 47, 64, 0.12);
}
.bilingual-title {
  display: inline-block;
  max-width: 100%;
}
.bilingual-title > span {
  overflow-wrap: anywhere;
}
.ledger-explainer {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef1f5;
}
.ledger-explainer summary {
  padding: 11px 14px;
  color: var(--blue-deep);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.ledger-explainer p {
  margin: 0;
  padding: 0 14px 13px;
  color: var(--muted);
  font-size: 11px;
}
.inventory-ledger {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(36, 47, 64, 0.05);
  overflow: hidden;
}
.inventory-table-wrap { overflow-x: auto; }
.inventory-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
}
.inventory-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f3f5f7;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}
.inventory-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e9ecf0;
  font-size: 11px;
  vertical-align: middle;
}
.inventory-table tbody tr:last-child td { border-bottom: 0; }
.inventory-table tbody tr:hover td { background: #f8faff; }
.inventory-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.inventory-table td:nth-child(4) {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inventory-provider { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.inventory-sku { color: var(--blue-deep); font-weight: 850; }
.money-cell {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.inventory-limit {
  margin: 0;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: var(--amber-soft);
  color: #70470d;
  font-size: 10px;
}

.parcel-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: stretch;
  gap: 18px;
  margin-bottom: 16px;
}
.parcel-overview-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}
.parcel-overview-identity h1 { margin: 0; }
.parcel-overview-identity p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.parcel-overview-identity p:last-child strong { color: var(--ink); }
.parcel-next {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 15px 17px;
  border: 1px solid #c7d6ef;
  border-radius: 12px;
  background: var(--blue-soft);
}
.parcel-next > strong { font-size: 14px; }
.parcel-next > small { color: var(--muted); font-size: 10px; }
.parcel-next .button { margin-top: 4px; }
.parcel-money-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2.2fr);
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
}
.parcel-money-total {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 16px 19px;
  background: var(--ink);
  color: #fff;
}
.parcel-money-total span {
  color: #bdc5cf;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.parcel-money-total strong {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 30px;
  letter-spacing: -0.04em;
}
.parcel-money-total small { color: #bdc5cf; font-size: 9px; }
.parcel-money-summary dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.parcel-money-summary dl > div {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
}
.parcel-money-summary dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.parcel-money-summary dd {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.parcel-record-note {
  display: flex;
  gap: 7px;
  margin: -12px 0 18px;
  color: var(--muted);
  font-size: 10px;
}
.parcel-record-note strong { color: var(--green); }
#items,
#labels,
#storage,
#parcel-context { scroll-margin-top: 88px; }

.breadcrumb { display: flex; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: var(--blue); }
.parcel-facts { display: grid; grid-template-columns: repeat(4, auto); gap: 12px 26px; margin: 0; }
.parcel-facts dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.parcel-facts dd { margin: 4px 0 0; font-size: 14px; font-weight: 800; }
.work-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
}
.work-step { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-right: 1px solid var(--line); }
.work-step:last-child { border-right: 0; }
.work-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #edf0f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.work-step.is-complete > span { background: var(--green-soft); color: var(--green); }
.work-step div { display: grid; gap: 2px; }
.work-step strong { font-size: 12px; }
.work-step small { color: var(--muted); font-size: 10px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.section-heading, .aside-card-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h2, .aside-card h2 { margin: 0; }
.section-heading > span { font-size: 12px; }
.section-spaced { margin-top: 36px; }
.lot-stack, .storage-list { display: grid; gap: 10px; }
.lot-card, .action-panel, .aside-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.lot-card { padding: 17px; }
.lot-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.lot-id { color: var(--blue); font-size: 11px; font-weight: 800; }
.lot-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; color: var(--muted); font-size: 11px; }
.item-summary-list { margin: 13px -17px 0; border-top: 1px solid var(--line); }
.item-summary { display: grid; grid-template-columns: 150px 1fr 60px 130px; gap: 12px; padding: 9px 17px; border-bottom: 1px solid #edf0f4; font-size: 11px; }
.item-summary:last-child { border-bottom: 0; }
.lot-action { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.lot-action label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.lot-action input { width: 92px; min-height: 40px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; }

.action-panel { overflow: hidden; }
.selection-list { display: grid; }
.selection-row {
  display: grid;
  grid-template-columns: 22px 150px minmax(0, 1fr) 80px 130px;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid #edf0f4;
  font-size: 11px;
}
.selection-row small { color: var(--muted); }
.selection-disabled { opacity: 0.54; }
.action-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 14px; background: #f9fafb; }
.check-label { display: flex; gap: 8px; color: var(--muted); font-size: 11px; }
.storage-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 260px) auto;
  align-items: end;
  gap: 10px 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.storage-row > div { display: grid; gap: 4px; font-size: 11px; }
.storage-row label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.storage-row input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
.storage-row .storage-controls { display: grid; gap: 8px; }
.storage-row .storage-check { display: flex; align-items: center; gap: 7px; }
.storage-row .storage-check input { width: auto; min-height: 0; padding: 0; }
.storage-row small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.workspace-aside { display: grid; gap: 12px; position: sticky; top: 82px; }
.aside-card { padding: 15px; }
.aside-card-heading a { color: var(--blue); font-size: 11px; }
.evidence-list, .activity-list { display: grid; margin-top: 12px; }
.evidence-row { display: grid; gap: 3px; padding: 9px 0; border-top: 1px solid #edf0f4; font-size: 11px; text-decoration: none; }
.evidence-row span, .evidence-row small { color: var(--muted); overflow-wrap: anywhere; }
.activity-row { display: grid; grid-template-columns: 8px 1fr; gap: 9px; padding: 8px 0; border-top: 1px solid #edf0f4; }
.activity-row > span { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--blue); }
.activity-row div { display: grid; gap: 3px; font-size: 11px; }
.activity-row small { color: var(--muted); }

.parcel-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.55fr) auto;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 18px;
}
.parcel-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 6px 0;
}
.parcel-identity h1 { margin: 0; }
.parcel-identity > p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.parcel-identity > p:last-child strong { color: var(--ink); }
.next-action {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 15px 17px;
  border: 1px solid #c5d6f7;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  text-decoration: none;
}
.next-action > span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.next-action strong { font-size: 15px; }
.next-action small { color: var(--muted); font-size: 10px; }
.parcel-hero-facts {
  align-content: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.parcel-hero-simple {
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
}
.parcel-hero-simple .parcel-hero-facts {
  width: min(480px, 100%);
}

.parcel-sheets {
  border: 1px solid #cbd2dc;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(36, 47, 64, 0.05);
  overflow: hidden;
}
.sheet-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 14px;
}
.sheet-heading h2 { margin: 0; font-size: 18px; }
.sheet-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.sheet-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.sheet-heading-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sheet-heading-actions > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.save-all-counts-form { margin: 0; }
.save-all-counts-form .button { min-height: 36px; padding: 7px 13px; }
.sheet-scroll { overflow-x: auto; }
.combined-inventory-sheet {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}
.combined-inventory-sheet th {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
  color: #596473;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-align: left;
}
.combined-inventory-sheet td {
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e8ed;
  color: #2b313a;
  font-size: 12px;
  vertical-align: top;
}
.combined-inventory-sheet tbody tr:last-child td { border-bottom: 0; }
.combined-inventory-sheet th:nth-child(1) { width: 150px; }
.combined-inventory-sheet th:nth-child(2) { width: 245px; }
.combined-inventory-sheet th:nth-child(4) { width: 154px; }
.lot-identity-cell { position: relative; }
.lot-identity-cell > strong { display: inline-block; padding-top: 8px; }
.lot-saved-check {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-left: 7px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}
.lot-title-cell { min-width: 0; }
.lot-title-clamp {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lot-title-clamp .bilingual-title,
.lot-title-clamp .bilingual-title > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lot-title-cell > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}
.lot-item-ledger { display: grid; gap: 0; }
.lot-item-ledger-head,
.lot-item-ledger-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 84px 78px 90px;
  align-items: center;
  gap: 10px;
}
.lot-item-ledger-head {
  padding: 0 0 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.lot-item-ledger-head span:not(:first-child) { text-align: right; }
.lot-item-ledger-row {
  min-height: 31px;
  padding: 5px 0;
  border-top: 1px solid #edf0f4;
}
.lot-item-ledger-row > span:first-child { display: flex; min-width: 0; align-items: baseline; gap: 5px; }
.lot-item-ledger-row > span:first-child > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot-item-ledger-row small { color: var(--muted); font-size: 9px; }
.lot-items-empty { display: block; padding-top: 8px; color: var(--muted); font-size: 10px; }
.lot-count-cell { vertical-align: middle !important; }
.lot-count-action { display: flex; align-items: center; gap: 6px; }
.lot-count-action input[type="number"] {
  width: 62px;
  height: 38px;
  padding: 0 5px;
  border: 1px solid #aeb7c3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}
.lot-count-action form { margin: 0; }
.lot-count-action .button { min-width: 72px; min-height: 36px; padding: 7px 9px; }
.combined-inventory-sheet tr:target td { background: #f2f7ff; }
.inventory-save-progress { display: inline-flex !important; align-items: center; gap: 5px; }
.inventory-save-progress i { color: var(--green); font-style: normal; font-weight: 900; }
.cost-saved-check {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.inventory-print-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #f7f8fa;
}
.inventory-print-action > div { display: grid; gap: 2px; }
.inventory-print-action strong { font-size: 12px; }
.inventory-print-action span { color: var(--muted); font-size: 10px; }
.inventory-print-actions { display: flex !important; align-items: center; gap: 8px !important; }
.inventory-print-actions form { margin: 0; }
.inventory-print-actions form .button { white-space: nowrap; }
.inventory-print-actions .copy-feedback { min-width: 70px; }
.inventory-print-action .button[disabled] { opacity: 0.55; cursor: not-allowed; }
.barcode-value {
  color: var(--blue-deep);
  letter-spacing: 0.02em;
}
.sheet-empty {
  margin: 0;
  padding: 38px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.next-stage {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.next-stage > summary {
  padding: 15px 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.next-stage > .downstream-work { margin: 0 14px 14px; }

.reconciliation-rail {
  margin-bottom: 18px;
  border: 1px solid #cfd5dd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(36, 47, 64, 0.06);
  overflow: hidden;
}
.reconciliation-rail > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px 11px;
}
.reconciliation-rail h2 { margin: 0; }
.reconciliation-status {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.reconciliation-status.is-matched { background: var(--green-soft); color: var(--green); }
.reconciliation-status.is-open { background: var(--amber-soft); color: #86520a; }
.money-equation {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 22px minmax(140px, 1fr) 22px minmax(150px, 1fr) 1px minmax(140px, 0.9fr) minmax(120px, 0.75fr);
  align-items: stretch;
  padding: 0 18px 17px;
}
.money-term {
  display: grid;
  align-content: center;
  min-height: 62px;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}
.money-term:first-child { border-radius: 10px 0 0 10px; }
.money-term.is-total {
  border-color: var(--ink);
  border-radius: 0 10px 10px 0;
  background: var(--ink);
  color: #fff;
}
.money-term span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.money-term.is-total span { color: #bcc4ce; }
.money-term strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(14px, 1.5vw, 19px);
  letter-spacing: -0.04em;
}
.money-operator {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
}
.money-divider { margin: 6px 12px; background: var(--line); }
.money-divider + .money-term {
  margin-left: 12px;
  border-radius: 10px 0 0 10px;
}
.money-equation > .money-term:last-child { border-radius: 0 10px 10px 0; }
.expense-ledger { border-top: 1px solid var(--line); background: #f8f9fb; }
.expense-ledger summary,
.workflow-panel summary,
.context-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}
.expense-ledger summary::-webkit-details-marker,
.workflow-panel summary::-webkit-details-marker,
.context-drawer summary::-webkit-details-marker { display: none; }
.expense-ledger summary { padding: 12px 18px; }
.expense-ledger summary > span:first-child,
.workflow-panel summary > span:first-child,
.context-drawer summary > span:first-child { display: grid; gap: 2px; }
.expense-ledger summary small,
.workflow-panel summary small,
.context-drawer summary small { color: var(--muted); font-size: 10px; font-weight: 500; }
.expense-ledger summary > span:last-child,
.workflow-panel summary > span:last-child,
.context-drawer summary > span:last-child { color: var(--blue); font-size: 10px; font-weight: 800; }
.expense-ledger[open] summary > span:last-child::after,
.workflow-panel[open] summary > span:last-child::after,
.context-drawer[open] summary > span:last-child::after { content: " ↑"; }
.expense-ledger-body {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}
.expense-ledger-body > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 9px 14px;
  background: #fff;
  font-size: 11px;
}
.expense-ledger-body > div span { color: var(--muted); }
.expense-ledger-body > div strong { font-family: "SFMono-Regular", Consolas, monospace; }
.expense-ledger-body .expense-total { background: var(--blue-soft); color: var(--blue-deep); }

.ledger-workspace {
  margin-top: 22px;
  border: 1px solid #cfd5dd;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 7px 24px rgba(36, 47, 64, 0.05);
  overflow: hidden;
}
.ledger-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.ledger-toolbar h2 { margin: 0; }
.ledger-toolbar > div:first-child > p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.ledger-controls { display: flex; align-items: flex-end; gap: 10px; }
.ledger-search { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.ledger-search input {
  width: min(260px, 32vw);
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-transform: none;
}
.view-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #eef1f4;
}
.view-switch button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.view-switch button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(36, 47, 64, 0.12); }
.parcel-ledger {
  width: 100%;
  --ag-balham-active-color: var(--blue);
  --ag-background-color: #fff;
  --ag-border-color: var(--line);
  --ag-data-color: var(--ink);
  --ag-font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ag-font-size: 12px;
  --ag-grid-size: 5px;
  --ag-header-background-color: #f2f4f7;
  --ag-header-foreground-color: #4f5966;
  --ag-header-height: 42px;
  --ag-row-border-color: #e7eaee;
  --ag-row-height: 48px;
  --ag-wrapper-border-radius: 0;
}
.parcel-ledger.ledger-short { height: 350px; }
.parcel-ledger.ledger-medium { height: 590px; }
.parcel-ledger.ledger-tall { height: 720px; }
.ledger-load-error {
  display: grid;
  min-height: 200px;
  place-items: center;
  padding: 30px;
  color: var(--red);
}
.ledger-cell-stack {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.15;
}
.ledger-cell-stack strong, .ledger-cell-stack small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger-cell-stack strong { font-size: 11px; font-weight: 750; }
.ledger-cell-stack small { color: var(--muted); font-size: 9px; }
.ledger-status {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}
.ledger-status[data-status="needs-itemization"],
.ledger-status[data-status="allocation-pending"] { background: var(--amber-soft); color: #86520a; }
.ledger-status[data-status="allocated"] { background: var(--green-soft); color: var(--green); }
.ledger-status[data-status="legacy-cost"] { background: #edf0f4; color: #4f5966; }
.ledger-action { color: var(--blue); font-size: 10px; font-weight: 800; }
.parcel-ledger .ag-row.ledger-row-pending { background: #fffaf0; }
.parcel-ledger .ag-header-cell-label { font-size: 9px; font-weight: 850; letter-spacing: 0.035em; text-transform: uppercase; }
.parcel-ledger .ag-cell { display: flex; align-items: center; }
.parcel-ledger .ag-right-aligned-cell { justify-content: flex-end; font-family: "SFMono-Regular", Consolas, monospace; }
.lot-card-view {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: #f5f7f9;
}

.itemization-dock {
  border-top: 1px solid var(--line);
  background: #f8f9fb;
}
.itemization-dock-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 12px;
}
.itemization-dock-heading h3 { margin: 0; font-size: 15px; }
.itemization-dock-heading > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.itemization-editors { display: grid; border-top: 1px solid var(--line); }
.itemize-editor {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  content-visibility: auto;
  contain-intrinsic-size: auto 58px;
  scroll-margin-top: 76px;
}
.itemize-editor:last-child { border-bottom: 0; }
.itemize-editor > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 18px;
  cursor: pointer;
  list-style: none;
}
.itemize-editor > summary::-webkit-details-marker { display: none; }
.itemize-editor > summary > span:first-child { display: grid; min-width: 0; gap: 3px; }
.itemize-editor > summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.itemize-editor[open] > summary { background: var(--blue-soft); }
.itemize-editor-body { padding: 16px 18px 18px; border-top: 1px solid var(--line); background: #f8f9fb; }
.itemize-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
}
.itemize-source-strip strong { color: var(--ink); }
.inline-breakdown-form .breakdown-row { box-shadow: 0 2px 8px rgba(36, 47, 64, 0.035); }
.inline-itemize-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}
.row-remove {
  position: absolute;
  top: -11px;
  right: 12px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}
.row-remove:disabled { display: none; }

.allocation-panel {
  padding-bottom: 18px;
  background: var(--surface);
  scroll-margin-top: 76px;
}
.allocation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.allocation-heading h2 { margin: 0; }
.allocation-heading p:last-child { max-width: 780px; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.allocation-input {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 14px 20px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8f9fb;
}
.allocation-input > label:first-of-type {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.allocation-input input[type="number"] {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.manual-duty-note {
  margin: 14px 20px -4px;
  color: var(--muted);
  font-size: 11px;
}
.duty-source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 20px 0;
  padding: 13px;
  border: 1px solid #b9d7c5;
  border-radius: 11px;
  background: #f3faf6;
}
.duty-source-card > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 3px 12px;
}
.duty-source-card span {
  color: #476253;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.duty-source-card strong {
  color: #173d29;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
}
.duty-source-card small {
  grid-column: 1 / -1;
  color: #476253;
  font-size: 10px;
}
.duty-source-card form { margin: 0; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.check-row input { width: 16px; height: 16px; margin: 0; }
.allocation-panel > .notice { margin: 14px 20px 0; }
.allocation-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 20px 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line);
  overflow: hidden;
}
.allocation-totals.imported-costs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}
.allocation-totals > div { display: grid; gap: 5px; padding: 12px 14px; background: #fff; }
.allocation-totals > div:last-child { background: var(--ink); color: #fff; }
.allocation-totals span { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.allocation-totals > div:last-child span { color: #bcc4ce; }
.allocation-totals strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 16px; }
.allocation-blockers {
  margin: 12px 20px 0;
  padding: 12px 14px;
  border: 1px solid #f2c36d;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #744707;
  font-size: 11px;
}
.allocation-blockers ul { margin: 7px 0 0; padding-left: 18px; }
.allocation-table-hint { display: none; margin: 12px 20px 0; color: var(--blue-deep); font-size: 10px; font-weight: 750; }
.allocation-table-wrap { margin: 12px 20px 0; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.allocation-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 11px; }
.allocation-table th {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: #f2f4f7;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}
.allocation-table th:first-child,
.allocation-table th:nth-child(2) { text-align: left; }
.allocation-table td { padding: 10px 11px; border-bottom: 1px solid #e9ecf0; text-align: right; white-space: nowrap; }
.allocation-table tr:last-child td { border-bottom: 0; }
.allocation-table td:first-child,
.allocation-table td:nth-child(2) {
  text-align: left;
}
.allocation-table td:nth-child(2) strong,
.allocation-table td:nth-child(2) small { display: block; }
.allocation-table td:nth-child(2) small { margin-top: 2px; color: var(--muted); }
.allocation-approval {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 13px 20px 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.allocation-empty { margin: 14px 20px 0; color: var(--muted); font-size: 11px; }
.cost-breakdown {
  margin: 10px 20px 0;
  border-bottom: 1px solid var(--line);
}
.cost-breakdown summary {
  display: flex;
  justify-content: space-between;
  padding: 9px 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.cost-breakdown summary span { font-weight: 600; }
.cost-breakdown > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding-bottom: 10px;
  background: var(--line);
}
.cost-breakdown p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 8px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
}
.cost-breakdown strong { color: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; }

.downstream-work {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.workflow-panel,
.context-drawer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.workflow-panel summary,
.context-drawer summary { padding: 14px 16px; }
.workflow-panel-body { border-top: 1px solid var(--line); }
.workflow-panel-body .action-panel { border: 0; border-radius: 0; }
.workflow-panel-body.storage-list { gap: 0; padding: 0; }
.workflow-panel-body .storage-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.workflow-panel-body .storage-row:last-child { border-bottom: 0; }
.storage-workflow { margin-top: 14px; }
.context-drawer { margin-top: 12px; }
.context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.context-grid > section { min-width: 0; padding: 16px; border-right: 1px solid var(--line); }
.context-grid > section:last-child { border-right: 0; }
.source-facts { display: grid; gap: 8px; margin: 12px 0 0; }
.source-facts > div { display: flex; justify-content: space-between; gap: 18px; font-size: 11px; }
.source-facts dt { color: var(--muted); }
.source-facts dd { margin: 0; font-family: "SFMono-Regular", Consolas, monospace; font-weight: 750; }
.source-refresh {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.source-refresh > div:first-child { display: grid; gap: 3px; }
.source-refresh small,
.source-refresh-result > span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.source-refresh-result {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.source-refresh-result .stack-form { margin-top: 0; }
.source-change-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.source-change-list li { display: grid; gap: 3px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10px; }
.source-change-list span { color: var(--muted); overflow-wrap: anywhere; }
.check-line { display: flex !important; align-items: center; gap: 8px !important; }
.check-line input { width: auto !important; min-height: 0 !important; }
.source-document-page { width: min(1080px, calc(100% - 40px)); }
.source-document-summary,
.source-document-content {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.source-document-content { display: grid; gap: 10px; }
.source-document-content details { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.source-document-content summary { padding: 12px 14px; font-weight: 800; }
.source-document-content pre {
  max-height: 560px;
  margin: 0;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  font: 11px/1.55 "SFMono-Regular", Consolas, monospace;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.breakdown-form { display: grid; gap: 18px; }
.breakdown-rows { display: grid; gap: 12px; }
.breakdown-row {
  position: relative;
  display: grid;
  grid-template-columns: 170px 150px minmax(220px, 1fr) 190px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.breakdown-row legend { padding: 0 7px; color: var(--blue); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.breakdown-row label, .mismatch-field, .stack-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.breakdown-row input, .breakdown-row select, .mismatch-field input, .stack-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.identity-preview { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.identity-preview small { color: var(--muted); }
.wide-field { grid-column: span 1; }
.mismatch-field { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--amber-soft); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.source-chip { display: grid; min-width: 140px; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.source-chip span { color: var(--muted); font-size: 10px; text-transform: uppercase; }

.label-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.label-toolbar-summary { display: grid; flex: 1; gap: 3px; }
.label-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.label-toolbar span { color: var(--muted); font-size: 11px; }
.copy-feedback { min-width: 72px; text-align: right; }
.print-confirmation { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px auto 0; padding: 12px 15px; width: min(900px, calc(100% - 32px)); border: 1px solid #c5d6f7; border-radius: 10px; background: var(--blue-soft); }
.print-confirmation > div { display: grid; gap: 4px; }
.print-confirmation form { display: flex; align-items: center; gap: 12px; }
.print-confirmation span { color: var(--muted); font-size: 11px; }
.print-confirmation.confirmed { border-color: #a8dfca; background: var(--green-soft); color: var(--green); }
.label-sku-list {
  width: min(720px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.label-sku-list > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.label-sku-list > header span { color: var(--muted); font-size: 10px; }
.label-sku-list ol { display: grid; margin: 0; padding: 0; list-style: none; }
.label-sku-list li { padding: 10px 15px; border-top: 1px solid #edf0f4; }
.label-sku-list li:first-child { border-top: 0; }
.label-sku-list li strong { font-size: 12px; }
.physical-label-sheet { display: none; }

@media print {
  @page { size: 2in 1in; margin: 0; }
  html, body { width: 2in; margin: 0; background: #fff; }
  .label-page > * { display: none !important; }
  .label-page > .label-workspace { display: block !important; }
  .label-workspace > * { display: none !important; }
  .label-workspace > .physical-label-sheet {
    display: block !important;
    width: 2in;
    margin: 0;
    padding: 0;
  }
  .physical-label {
    box-sizing: border-box;
    display: flex;
    width: 2in;
    height: 1in;
    margin: 0;
    padding: 0.045in 0.065in;
    break-after: page;
    page-break-after: always;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .physical-label:last-child { break-after: auto; page-break-after: auto; }
  .physical-label-barcode { display: block; width: 100%; height: 0.5in; }
  .physical-label-barcode svg { display: block; width: 100%; height: 100%; }
  .physical-label strong {
    margin-top: 0.025in;
    font: 700 10pt/1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0.025em;
  }
  .physical-label small {
    font: 6pt/1 "SFMono-Regular", Consolas, monospace;
  }
}

.activity-timeline { display: grid; }
.activity-timeline article { display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline-sequence { color: var(--blue); font-family: "SFMono-Regular", monospace; font-size: 11px; }
.activity-timeline p { margin: 4px 0; color: var(--muted); font-size: 11px; }
.activity-timeline a { color: var(--blue); font-size: 11px; }
.activity-timeline time { color: var(--muted); font-size: 10px; }
.empty-state { display: grid; grid-column: 1 / -1; gap: 5px; padding: 40px; border: 1px dashed #bfc7d3; border-radius: 12px; color: var(--muted); text-align: center; }
.empty-state.compact { padding: 18px; }
.login-shell, .error-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-panel { width: min(420px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.login-panel .brand-mark { margin-bottom: 28px; }
.login-panel h1 { font-size: 32px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-signin { display: grid; gap: 6px; justify-items: center; min-width: 240px; }
.google-signin > [data-google-button] { width: 100%; min-height: 40px; }
.google-signin-status { min-height: 16px; margin: 0; color: var(--muted); font-size: 11px; text-align: center; }
.password-recovery { width: 100%; }
.password-recovery > summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.password-recovery[open] > summary { color: var(--ink); }
.password-recovery .password-login-form { margin-top: 16px; }
.identity-provider { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #4285f4; font-weight: 800; }
.identity-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.identity-card > .google-signin { justify-self: end; }
.identity-copy { display: grid; gap: 3px; min-width: 0; }
.identity-copy span, .identity-copy small { color: var(--muted); overflow-wrap: anywhere; }
.account-section { display: grid; gap: 10px; margin-top: 34px; }
.account-section h2 { margin: 0; font-size: 18px; }
.account-section-note { margin: -6px 0 2px; color: var(--muted); font-size: 12px; }
.source-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.source-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid #edf0f4;
}
.source-row:first-child { border-top: 0; }
.source-row form { margin: 0; }
.source-row .button { min-height: 36px; padding: 7px 12px; font-size: 11px; }
.source-row-copy { display: grid; gap: 2px; min-width: 0; }
.source-row-copy strong { font-size: 13px; }
.source-row-copy span { font-size: 12px; }
.source-row-copy small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.api-configuration-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.api-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #86520a;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.api-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.api-status.is-connected { background: var(--green-soft); color: var(--green); }
.api-configuration-row dl { display: grid; gap: 9px; margin: 0; }
.api-configuration-row dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.api-configuration-row dt { color: var(--muted); font-size: 10px; font-weight: 750; }
.api-configuration-row dd { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.source-warning { color: #8a5a0a; font-weight: 750; }
.stack-form { display: grid; gap: 15px; margin-top: 26px; }
.error-shell { align-content: center; justify-items: start; width: min(620px, calc(100% - 40px)); margin: auto; }

/* Parcel home and detail hierarchy */
.home-heading { margin-bottom: 22px; }
.home-heading h1 { margin: 0; }
.home-tally {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pill-count {
  display: inline-grid;
  min-width: 19px;
  padding: 2px 5px;
  place-items: center;
  border-radius: 99px;
  background: #e6eaf0;
  color: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.filter-pills a[aria-current="page"] .pill-count { background: #d4e2fb; }
.home-page .parcel-controls {
  margin-bottom: 32px;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.source-sync-menu { position: relative; flex: 0 0 auto; }
.source-sync-menu > summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.source-sync-menu > summary::-webkit-details-marker { display: none; }
.source-sync-menu > summary:hover,
.source-sync-menu[open] > summary {
  border-color: #aeb9c7;
  color: var(--blue-deep);
  background: var(--blue-soft);
}
.source-sync-menu > summary svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.source-action-popover {
  position: absolute;
  z-index: 12;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 220px;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.source-action-heading {
  display: grid;
  gap: 3px;
}
.source-action-heading > strong { font-size: 11px; }
.source-sync-status {
  max-width: 200px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}
.source-sync-failed { color: var(--danger); }
.source-action-list {
  display: grid;
  gap: 7px;
}
.source-action-list form { margin: 0; }
.source-action-list .button {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  font-size: 10px;
}
.source-action-note {
  padding-top: 8px;
  border-top: 1px solid #edf0f4;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.source-action-note a { color: var(--blue); font-weight: 800; }
.parcel-section { margin-top: 34px; }
.parcel-section-heading { align-items: center; }
.parcel-section-heading h2 { font-size: 22px; }
.parcel-section-heading p { font-size: 12px; }
.parcel-card {
  display: grid;
  align-content: start;
  padding: 20px;
  border: 1px solid #e2e6eb;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(36, 47, 64, 0.02);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.parcel-card:hover {
  border-color: #aeb9c7;
  box-shadow: 0 14px 34px rgba(36, 47, 64, 0.09);
  transform: translateY(-2px);
}
.parcel-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.parcel-card-head .provider-mark { margin-top: 1px; }
.parcel-card-id {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}
.parcel-card-id strong {
  overflow: hidden;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 26px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.parcel-card-id span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.parcel-card-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(52px, .65fr));
  gap: 0;
  min-width: 0;
  margin-top: 22px;
}
.parcel-card-metric {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.parcel-card-metric + .parcel-card-metric {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid #eef1f5;
}
.parcel-card-metric > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}
.parcel-card-metric > strong {
  position: relative;
  width: fit-content;
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.parcel-card-metric > strong.is-warning {
  color: #a96500;
  cursor: help;
  overflow: visible;
}
.parcel-card-metric > strong.is-warning::after {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 170px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #242a32;
  box-shadow: 0 6px 18px rgba(25, 31, 40, .16);
  color: #fff;
  content: attr(data-warning);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 2px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.parcel-card-metric > strong.is-warning:hover::after,
.parcel-card:focus-visible .parcel-card-metric > strong.is-warning::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* Stage pill shared with the parcel detail overview */
.parcel-card-stage {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 99px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.parcel-card-stage.stage-itemize,
.parcel-card-stage.stage-costs,
.parcel-card-stage.stage-identity { background: var(--amber-soft); color: #9a5b08; }
.parcel-card-stage.stage-recorded,
.parcel-card-stage.stage-complete { background: var(--green-soft); color: var(--green); }
.duty-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.duty-mini::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.duty-mini.is-paid { color: var(--green); }
.duty-mini.is-open { color: #8a5a0a; }
.duty-mini.is-unpaid { color: var(--red); }

.parcel-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}
.parcel-overview-status {
  display: flex;
  align-items: center;
  gap: 14px;
}
.parcel-overview-status a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.parcel-receipt {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
}
.parcel-receipt > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.parcel-receipt h2 { margin: 0; font-size: 20px; }
.parcel-receipt-total {
  display: grid;
  justify-items: end;
  gap: 2px;
}
.parcel-receipt-total span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.parcel-receipt-total strong {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}
.parcel-receipt-lines { padding: 8px 20px 10px; }
.parcel-receipt-lines > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 22px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 12px;
}
.parcel-receipt-lines > div > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.parcel-receipt-lines small { color: #8a5a0a; font-size: 9px; }
.parcel-receipt-lines strong {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.parcel-receipt-lines .is-import-charge { color: #8a5a0a; }
.parcel-receipt-lines .parcel-receipt-subtotal {
  margin-top: 4px;
  padding-top: 11px;
  border-top: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 800;
}
.parcel-receipt-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}
.parcel-receipt-facts > div {
  min-width: 0;
  padding: 11px 14px;
  border-left: 1px solid var(--line);
}
.parcel-receipt-facts > div:first-child { border-left: 0; }
.parcel-receipt-facts dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.parcel-receipt-facts dd {
  overflow: hidden;
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.parcel-state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 24px;
  padding: 0 2px;
}
.parcel-state-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.parcel-state-row i {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
}
.parcel-state-row .is-complete { color: var(--green); }
.identity-exception {
  display: block;
  margin-top: 3px;
  color: #8a5a0a;
}
.allocation-panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
}
.allocation-heading { padding: 18px 20px 14px; }
.allocation-heading .eyebrow { margin-bottom: 5px; }
.allocation-heading h2 { font-size: 20px; }
.allocation-table th:first-child,
.allocation-table td:first-child { text-align: left; }
.allocation-table th:nth-child(n+2),
.allocation-table td:nth-child(n+2) { text-align: right; }
.allocation-table td:first-child strong,
.allocation-table td:first-child small { display: block; }
.allocation-table td:first-child small { margin-top: 3px; color: var(--muted); }
.allocation-approval > span { display: grid; gap: 2px; }
.allocation-approval > span small { color: var(--muted); }
.import-charge-audit {
  border-top: 1px solid var(--line);
  background: #fafbfc;
}
.import-charge-audit > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}
.import-charge-audit > summary::-webkit-details-marker { display: none; }
.import-charge-audit > summary > span:nth-child(2) { display: grid; flex: 1; min-width: 0; gap: 2px; }
.import-charge-audit > summary > span:nth-child(2) strong { font-size: 11px; }
.import-charge-audit > summary > span:nth-child(2) small { color: var(--muted); font-size: 9px; }
.import-charge-audit > summary > span:last-child { color: var(--blue); font-size: 10px; font-weight: 800; }
.import-charge-audit[open] > summary > span:last-child::after { content: " ↑"; }
.import-charge-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.import-charge-source-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.import-charge-list { display: grid; gap: 7px; margin-top: 11px; }
.import-charge-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px 20px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.import-charge-record > div:first-child { display: grid; gap: 3px; }
.import-charge-record > div:first-child span,
.import-charge-record > div:first-child small { color: var(--muted); font-size: 10px; }
.import-charge-record-money { display: grid; justify-items: end; gap: 2px; }
.import-charge-record-money small { color: var(--muted); font-size: 9px; }
.charge-status {
  padding: 5px 7px;
  border-radius: 7px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}
.charge-unpaid,
.charge-partially_paid { background: var(--red-soft); color: var(--red); }
.charge-paid,
.charge-waived { background: var(--green-soft); color: var(--green); }
.import-charge-record > details { grid-column: 1 / -1; }
.import-charge-payments {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.import-charge-payments li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  color: var(--muted);
  font-size: 10px;
}
.import-charge-payments li strong { color: var(--ink); }
.import-charge-payments li small { grid-column: 1 / -1; }
.import-charge-empty {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.import-charge-record > details > summary,
.import-charge-add > summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.import-charge-add { margin-top: 10px; }
.import-charge-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.import-charge-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.import-charge-form input,
.import-charge-form select,
.import-charge-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.import-charge-note { grid-column: 1 / -1; }
.import-charge-form .button { justify-self: end; grid-column: 1 / -1; }

@media (max-width: 1040px) {
  .parcel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-center .sync-stack { grid-template-columns: 1fr; }
  .filter-row { align-items: flex-start; flex-direction: column; }
  .parcel-overview { grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); }
  .parcel-money-summary { grid-template-columns: minmax(200px, 0.7fr) minmax(0, 2.3fr); }
  .parcel-money-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parcel-money-summary dl > div:nth-child(3),
  .parcel-money-summary dl > div:nth-child(4) { border-top: 1px solid var(--line); }
  .parcel-hero { grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr); }
  .parcel-hero-facts { grid-column: 1 / -1; width: 100%; }
  .money-equation { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr); }
  .money-divider { display: none; }
  .money-divider + .money-term { grid-column: 1 / 3; margin: 10px 0 0; border-radius: 10px 0 0 10px; }
  .money-equation > .money-term:last-child { grid-column: 3 / 6; margin-top: 10px; border-radius: 0 10px 10px 0; }
  .expense-ledger-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .downstream-work { grid-template-columns: 1fr; }
  .allocation-input { grid-template-columns: 1fr 1fr; }
  .allocation-input .button { grid-column: 1 / -1; justify-self: end; }
  .context-grid { grid-template-columns: 1fr; }
  .context-grid > section { border-right: 0; border-bottom: 1px solid var(--line); }
  .context-grid > section:last-child { border-bottom: 0; }
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-aside { position: static; grid-template-columns: repeat(3, 1fr); }
  .breakdown-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-bar { grid-template-columns: 1fr auto; padding: 0 16px; }
  .app-bar nav { order: 3; grid-column: 1 / -1; justify-content: center; padding-bottom: 8px; }
  .app-bar nav a { padding: 8px 10px; font-size: 12px; }
  .operator-chip span { display: none; }
  .page { width: min(100% - 24px, 1480px); padding-top: 28px; }
  .page-heading, .parcel-heading { flex-direction: column; }
  .home-heading,
  .inventory-heading { align-items: stretch; flex-direction: column; margin-bottom: 18px; }
  .home-summary { grid-template-columns: 1fr; }
  .home-summary > * { min-height: 92px; border-right: 0; border-bottom: 1px solid var(--line); }
  .home-summary > *:last-child { border-bottom: 0; }
  .source-center .sync-card { grid-template-columns: auto minmax(0, 1fr); }
  .source-center .sync-card .button { grid-column: 1 / -1; width: 100%; }
  .parcel-controls,
  .inventory-controls { padding: 12px; }
  .parcel-search,
  .inventory-search { align-items: stretch; flex-direction: column; }
  .parcel-search .button,
  .inventory-search .button { width: 100%; }
  .filter-tools { width: 100%; }
  .filter-tools .provider-filters { flex: 1 1 auto; }
  .filter-pills,
  .provider-filters { width: 100%; }
  .filter-pills a,
  .provider-filters a { flex: 1 1 auto; justify-content: center; }
  .parcel-section-heading { align-items: stretch; flex-direction: column; }
  .inventory-heading-note { min-width: 0; }
  .title-language-toolbar { align-items: stretch; flex-direction: column; }
  .parcel-overview { grid-template-columns: 1fr; }
  .parcel-overview-identity { align-items: flex-start; }
  .parcel-money-summary { grid-template-columns: 1fr; }
  .parcel-money-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parcel-money-summary dl > div { border-left: 0; border-top: 1px solid var(--line); }
  .parcel-money-summary dl > div:nth-child(even) { border-left: 1px solid var(--line); }
  .parcel-record-note { flex-direction: column; }
  .items-sheet-heading { align-items: stretch; flex-direction: column; }
  .sheet-heading-actions { justify-content: space-between; }
  .parcel-hero { grid-template-columns: 1fr; }
  .parcel-hero-facts { grid-column: auto; }
  .next-action { min-height: 88px; }
  .sync-card { width: 100%; min-width: 0; align-items: flex-start; flex-direction: column; }
  .parcel-grid { grid-template-columns: 1fr; }
  .parcel-facts { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .reconciliation-rail > header { align-items: flex-start; flex-direction: column; }
  .money-equation { grid-template-columns: 1fr; gap: 7px; }
  .money-operator, .money-divider { display: none; }
  .money-term,
  .money-term:first-child,
  .money-term.is-total,
  .money-divider + .money-term,
  .money-equation > .money-term:last-child {
    grid-column: auto;
    min-height: 54px;
    margin: 0;
    border-radius: 9px;
  }
  .expense-ledger summary { align-items: flex-start; }
  .expense-ledger-body { grid-template-columns: 1fr; }
  .ledger-toolbar { align-items: stretch; flex-direction: column; }
  .ledger-controls { align-items: stretch; flex-direction: column; }
  .ledger-search input { width: 100%; }
  .view-switch { align-self: flex-start; }
  .parcel-ledger.ledger-short,
  .parcel-ledger.ledger-medium,
  .parcel-ledger.ledger-tall { height: 560px; }
  .lot-card-view { grid-template-columns: 1fr; }
  .work-strip { grid-template-columns: repeat(2, 1fr); }
  .work-step:nth-child(2),
  .work-step:nth-child(4) { border-right: 0; }
  .work-step:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .work-step:nth-child(5) { grid-column: 1 / -1; border-right: 0; }
  .workspace-aside { grid-template-columns: 1fr; }
  .item-summary { grid-template-columns: 1fr auto; }
  .item-summary span:nth-child(2), .item-summary span:nth-child(4) { grid-column: 1 / -1; }
  .selection-row { grid-template-columns: 22px 1fr auto; }
  .selection-row span:nth-child(3), .selection-row small { grid-column: 2 / -1; }
  .action-panel-foot, .storage-row { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .storage-row small { grid-column: 1; }
  .breakdown-row { grid-template-columns: 1fr; }
  .itemization-dock-heading,
  .allocation-heading,
  .inline-itemize-tools,
  .allocation-approval { align-items: stretch; flex-direction: column; }
  .itemize-editor > summary { align-items: flex-start; }
  .allocation-input { grid-template-columns: 1fr; }
  .allocation-input .button { grid-column: auto; justify-self: stretch; }
  .duty-source-card { align-items: stretch; flex-direction: column; }
  .duty-source-card .button { width: 100%; }
  .allocation-totals,
  .allocation-totals.imported-costs { grid-template-columns: 1fr; }
  .cost-breakdown > div { grid-template-columns: 1fr; }
  .allocation-table-hint { display: block; }
  .allocation-table-hint + .allocation-table-wrap { margin-top: 6px; }
  .label-toolbar { flex-wrap: wrap; }
  .label-toolbar-actions { width: 100%; flex-wrap: wrap; }
  .label-toolbar-actions .copy-feedback { min-width: 0; margin-right: auto; }
  .label-sku-list { width: min(100% - 20px, 440px); margin-top: 20px; }
  .print-confirmation, .print-confirmation form { align-items: stretch; flex-direction: column; }
  .identity-card { grid-template-columns: auto 1fr; }
  .identity-card > .google-signin, .identity-card > .stage-badge { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
  .source-row { grid-template-columns: auto minmax(0, 1fr); }
  .source-row form { grid-column: 1 / -1; }
  .source-row .button { width: 100%; }
  .api-configuration-row { grid-template-columns: 1fr; }
  .api-status { justify-self: start; }
}

@media (max-width: 1040px) {
  .import-charge-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .parcel-overview {
    align-items: flex-start;
    flex-direction: column;
  }
  .parcel-overview-status {
    width: 100%;
    justify-content: space-between;
  }
  .parcel-receipt > header {
    align-items: flex-start;
    flex-direction: column;
  }
  .parcel-receipt-total { justify-items: start; }
  .parcel-receipt-lines > div { gap: 14px; }
  .parcel-receipt-lines > div > span { align-items: flex-start; flex-direction: column; gap: 2px; }
  .parcel-receipt-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parcel-receipt-facts > div:nth-child(odd) { border-left: 0; }
  .parcel-receipt-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .parcel-state-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-charge-audit > summary { align-items: flex-start; }
  .import-charge-record { grid-template-columns: minmax(0, 1fr) auto; }
  .import-charge-record-money { justify-items: start; }
  .import-charge-record .charge-status { justify-self: end; }
  .import-charge-form { grid-template-columns: 1fr; }
  .import-charge-note,
  .import-charge-form .button { grid-column: 1; }
  .combined-inventory-sheet { min-width: 880px; }
  .inventory-print-action { align-items: stretch; flex-direction: column; }
  .inventory-print-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-print-actions .copy-feedback { grid-column: 1 / -1; min-width: 0; }
  .inventory-print-action .button { width: 100%; }
}

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