:root {
  --app-bg: #e8eef5;
  --ambient-bg: linear-gradient(135deg, #dbe7f2 0%, #edf2f7 48%, #dfe9e5 100%);
  --ambient-wash:
    linear-gradient(115deg, rgba(15, 118, 110, 0.16) 0%, transparent 30%),
    linear-gradient(152deg, transparent 35%, rgba(194, 138, 44, 0.14) 52%, transparent 74%),
    linear-gradient(34deg, transparent 42%, rgba(59, 130, 246, 0.13) 62%, transparent 88%);
  --ambient-pattern: rgba(15, 23, 42, 0.045);
  --surface: rgba(255, 255, 255, 0.76);
  --surface-muted: rgba(248, 250, 252, 0.56);
  --line: rgba(123, 143, 164, 0.34);
  --text: #15202b;
  --muted: #667789;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --dropzone-bg: linear-gradient(135deg, rgba(246, 248, 250, 0.94), rgba(232, 237, 242, 0.82));
  --dropzone-bg-active: linear-gradient(135deg, rgba(231, 241, 252, 0.96), rgba(222, 232, 239, 0.9));
  --dropzone-border: rgba(80, 93, 108, 0.42);
  --dropzone-border-active: rgba(57, 118, 184, 0.64);
  --skeleton-bg: linear-gradient(90deg, rgba(148, 163, 184, 0.30) 0%, rgba(203, 213, 225, 0.54) 45%, rgba(148, 163, 184, 0.30) 100%);
  --skeleton-shimmer: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  --glass-blur: blur(18px) saturate(135%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12), var(--glass-highlight);
}

[data-bs-theme="dark"] {
  --app-bg: #070b13;
  --ambient-bg: linear-gradient(135deg, #070b13 0%, #101724 46%, #0b1b1a 100%);
  --ambient-wash:
    linear-gradient(118deg, rgba(45, 212, 191, 0.14) 0%, transparent 34%),
    linear-gradient(150deg, transparent 26%, rgba(194, 138, 44, 0.12) 48%, transparent 74%),
    linear-gradient(32deg, transparent 40%, rgba(59, 130, 246, 0.16) 66%, transparent 92%);
  --ambient-pattern: rgba(255, 255, 255, 0.055);
  --surface: rgba(18, 24, 34, 0.72);
  --surface-muted: rgba(29, 38, 50, 0.58);
  --line: rgba(128, 151, 173, 0.28);
  --text: #edf3f8;
  --muted: #9caab8;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --dropzone-bg: linear-gradient(135deg, rgba(31, 39, 48, 0.86), rgba(19, 25, 31, 0.9));
  --dropzone-bg-active: linear-gradient(135deg, rgba(31, 58, 71, 0.92), rgba(25, 40, 49, 0.92));
  --dropzone-border: rgba(122, 144, 166, 0.46);
  --dropzone-border-active: rgba(45, 212, 191, 0.58);
  --skeleton-bg: linear-gradient(90deg, rgba(71, 85, 105, 0.34) 0%, rgba(100, 116, 139, 0.42) 45%, rgba(71, 85, 105, 0.34) 100%);
  --skeleton-shimmer: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.16), transparent);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.30), var(--glass-highlight);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--ambient-bg), var(--app-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background: var(--ambient-wash);
}

body::after {
  z-index: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(var(--ambient-pattern) 1px, transparent 1px),
    linear-gradient(90deg, var(--ambient-pattern) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.95));
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.95));
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 160ms ease;
}

.app-shell.rail-pinned {
  grid-template-columns: 252px minmax(0, 1fr);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  background-clip: padding-box;
  box-shadow: var(--glass-highlight);
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 48px;
  width: 52px;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: width 160ms ease;
}

.brand img {
  flex: 0 0 46px;
  max-width: 32px;
  max-height: 32px;
  margin: 0 7px;
  object-fit: contain;
}

.brand span,
.rail-link span {
  opacity: 0;
  white-space: nowrap;
  transition: opacity 120ms ease;
}

.brand span {
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: 0;
}

.app-shell.rail-pinned .brand {
  width: 204px;
}

.app-shell.rail-pinned .rail-head {
  justify-content: flex-start;
}

.app-shell.rail-pinned .brand span,
.app-shell.rail-pinned .rail-link span {
  opacity: 1;
}

.rail-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 30px;
  margin: 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.rail-toggle:hover,
.rail-toggle[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.rail-toggle:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.app-shell.rail-pinned .rail-toggle {
  width: 212px;
  justify-content: flex-end;
  padding-right: 14px;
}

.rail-nav {
  display: grid;
  gap: 10px;
}

.rail-nav-bottom {
  margin-top: auto;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 52px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  overflow: hidden;
  transition: width 160ms ease, color 120ms ease, background 120ms ease;
}

.rail-link i {
  flex: 0 0 22px;
  text-align: center;
}

.app-shell.rail-pinned .rail-link {
  width: 212px;
}

.rail-link:hover,
.rail-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  padding: 22px;
  overflow: hidden;
}

.spa-version {
  position: absolute;
  right: 24px;
  bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  line-height: 1;
  opacity: 0.72;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  height: 56px;
  padding: 0 4px 18px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-picker .form-select {
  width: min(280px, 24vw);
  min-width: 190px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--surface);
  color: var(--text);
  font-weight: 650;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 38vw);
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.topbar-selection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(320px, 28vw);
  min-height: 34px;
  padding: 5px 8px 5px 10px;
  border: 1px solid rgba(194, 138, 44, 0.45);
  border-radius: 999px;
  background: rgba(194, 138, 44, 0.14);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

.topbar-selection span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-selection button {
  display: inline-grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.18);
  color: var(--muted);
}

.avatar-button,
.signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
}

.avatar-button {
  width: 44px;
  padding: 0;
}

.avatar-button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.notifications-root {
  position: relative;
}

.notifications-button {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.notifications-button:hover,
.notifications-button[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.notifications-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--app-bg);
  border-radius: 999px;
  background: #a9343a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.notifications-menu {
  width: min(420px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 96px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.notifications-head strong {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 900;
}

.notifications-head small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.notifications-list {
  max-height: 480px;
  overflow: auto;
  padding: 8px;
}

.notification-item {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
}

.notification-item + .notification-item {
  margin-top: 6px;
}

.notification-item.is-unread {
  border-color: rgba(194, 138, 44, 0.34);
  background: rgba(194, 138, 44, 0.1);
}

.notification-item.is-complete {
  border-color: rgba(76, 125, 91, 0.28);
  background: rgba(76, 125, 91, 0.08);
}

.notification-item.is-failed {
  border-color: rgba(169, 52, 58, 0.28);
  background: rgba(169, 52, 58, 0.08);
}

.notification-main {
  display: grid;
  gap: 2px;
}

.notification-main strong {
  font-size: 0.88rem;
  font-weight: 900;
}

.notification-main span,
.notification-meta,
.notification-jobs li span,
.notifications-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.notification-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.notification-jobs {
  display: grid;
  gap: 6px;
}

.notification-jobs summary {
  cursor: pointer;
  color: #a96f16;
  font-size: 0.78rem;
  font-weight: 900;
}

.notification-jobs ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 7px 0 0 14px;
}

.notification-jobs li {
  display: grid;
  gap: 1px;
}

.notification-retry {
  justify-self: start;
}

.notifications-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 12px;
  text-align: center;
}

.signin {
  gap: 8px;
  padding: 0 14px;
  font-weight: 650;
}

.account-menu {
  width: 284px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-heading {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
}

.account-heading small,
.theme-group span {
  color: var(--muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
}

.theme-group {
  display: grid;
  gap: 8px;
  padding: 6px 8px 8px;
}

.account-toggle {
  padding: 6px 8px;
}

.account-toggle .form-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  gap: 16px;
}

.account-toggle .form-check-input {
  flex: 0 0 auto;
  margin-left: 0;
  order: 2;
}

.account-toggle .form-check-label {
  color: var(--text);
  font-weight: 650;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.theme-options button {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
}

.theme-choice-icon {
  width: 1rem;
  height: 1rem;
}

.theme-options button.active,
.theme-options button:hover {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.workspace-frame {
  /* Right context pane carries the dense Direct/catalog tables, so let it take
     more room and let the main pane shrink further. */
  --context-pane-width: clamp(440px, 54vw, 960px);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, var(--context-pane-width));
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.workspace-frame.context-pane-closed {
  grid-template-columns: minmax(0, 1fr) 48px;
}

.main-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.content-stage {
  min-height: 100%;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  background-clip: padding-box;
  box-shadow: var(--shadow);
}

.panel-skeleton {
  display: grid;
  gap: 14px;
  min-height: 360px;
  padding: 18px;
}

.skeleton-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.skeleton-title,
.skeleton-action,
.skeleton-cell {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--skeleton-bg);
  background-size: 220% 100%;
}

.skeleton-title::after,
.skeleton-action::after,
.skeleton-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--skeleton-shimmer);
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
  transform: translateX(-100%);
}

.skeleton-title {
  width: min(280px, 48vw);
  height: 28px;
}

.skeleton-action {
  width: 120px;
  height: 32px;
}

.skeleton-table {
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 0.7fr 0.7fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  min-width: 760px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.warehouse-stage .skeleton-row {
  grid-template-columns: 0.6fr 1fr 1.5fr 1fr 1.4fr 0.8fr 1.8fr;
}

.skeleton-cell {
  height: 16px;
}

.skeleton-cell-3,
.skeleton-cell-7,
.skeleton-cell-8,
.skeleton-cell-9 {
  height: 20px;
}

.panel-load-error {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 320px;
  align-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.panel-load-error h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 850;
}

.panel-load-error p {
  max-width: 420px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.panel-load-error .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 800;
}

@keyframes skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes live-board-paint {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.context-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  background-clip: padding-box;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Collapsed: the pane shrinks to a slim strip carrying only the expand
   chevron — mirroring the left rail's collapse, instead of close/re-open. */
.workspace-frame.context-pane-closed .context-pane {
  min-width: 0;
}

.workspace-frame.context-pane-closed .context-pane-body,
.workspace-frame.context-pane-closed .context-resizer,
.workspace-frame.context-pane-closed .context-pane-head > div:first-child,
.workspace-frame.context-pane-closed #popContextPane {
  display: none;
}

.workspace-frame.context-pane-closed .context-pane-head {
  justify-content: center;
  min-height: 0;
  padding: 10px 4px;
  border-bottom: 0;
}

.context-collapse-toggle .bi {
  display: inline-block;
  transition: transform 0.2s ease;
}

.context-collapse-toggle:disabled {
  opacity: 0.35;
  cursor: default;
}

.workspace-frame.context-pane-closed .context-collapse-toggle .bi {
  transform: scaleX(-1);
}

.context-resizer {
  position: absolute;
  inset: 0 auto 0 -8px;
  width: 16px;
  cursor: col-resize;
  z-index: 3;
}

.context-resizer::before {
  content: "";
  position: absolute;
  inset: 18px 7px;
  border-left: 1px solid var(--line);
}

.context-resizer:hover::before,
.context-resizer:focus-visible::before {
  border-color: var(--accent);
}

.context-resizer:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: -3px;
}

.context-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
}

.context-pane-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.context-pane-actions {
  display: flex;
  gap: 8px;
}

.context-pane-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

/* Live Overview context fills the pane so the map can pin to the bottom while
   the house-info cards scroll above it. */
.context-pane-body > [data-context-route="live-overview"] {
  height: 100%;
}

.context-route.d-none {
  display: none;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rail,
  .content-stage,
  .context-pane,
  .search,
  .company-picker .form-select,
  .avatar-button,
  .signin,
  .notifications-button,
  .notifications-menu,
  .account-menu {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
  }
}

.context-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 250px;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.context-empty h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
}

.context-empty p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 650;
}

.context-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.context-summary-row div,
.context-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.context-summary-row span,
.context-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.context-summary-row strong,
.context-card strong {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 900;
}

.context-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.live-context-stack {
  display: grid;
  gap: 10px;
}

.live-context-root {
  min-height: 100%;
}

.live-house-info-root {
  height: 100%;
  min-height: 0;
}

.live-house-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

/* Context-pane upper area: the active catalog's full job list + totals row.
   Flexes to fill the space above the Origins/Hubs columns and the map. */
.live-catalog-context {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.live-catalog-context-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  flex: 0 0 auto;
}

.live-catalog-context-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.live-catalog-context-title strong {
  color: #a96f16;
  font-size: 0.92rem;
  font-weight: 950;
}

.live-catalog-context-title span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.live-catalog-context-head time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.live-catalog-jobs-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.live-catalog-jobs {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.live-catalog-jobs th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-catalog-jobs td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  vertical-align: top;
}

.live-catalog-jobs a {
  color: #a96f16;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.live-catalog-col-job { width: 92px; }
.live-catalog-col-invoice { width: 96px; }
.live-catalog-col-budget { width: 84px; white-space: nowrap; }
.live-catalog-col-status { min-width: 160px; }

.live-catalog-job-row {
  cursor: pointer;
}

.live-catalog-job-row:hover > td {
  background: var(--surface-muted);
}

.live-catalog-job-row.is-active-job > td {
  background: var(--accent-soft);
}

.live-catalog-job-row.is-active-job > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Keep the active tint while hovering an active row (don't drop to muted). */
.live-catalog-job-row.is-active-job:hover > td {
  background: var(--accent-soft);
}

.live-catalog-status {
  display: block;
  color: var(--text);
  font-weight: 760;
}

.live-catalog-status.is-tracking {
  color: var(--muted);
  font-weight: 700;
}

.live-catalog-total-row td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-top: 2px solid var(--line);
  border-bottom: 0;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 900;
}

/* The house-info cards scroll; the map below them stays pinned to the bottom. */
.live-house-info-cards {
  display: grid;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.live-house-info-card,
.live-house-info-grid div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.live-house-info-card span,
.live-house-info-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.live-house-info-card strong,
.live-house-info-grid strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 900;
}

.live-house-info-card em,
.live-house-info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}

.live-house-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.live-house-info-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-house-info-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 760;
}

.live-house-info-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.live-house-info-skeletons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-context-shell {
  display: grid;
  gap: 12px;
}

.live-board-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.live-board-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.15;
}

.live-board-heading span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.live-board-back {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 1.45rem;
}

.live-board-back:hover,
.live-board-back:focus-visible {
  border-color: rgba(194, 138, 44, 0.48);
  background: rgba(194, 138, 44, 0.14);
  color: var(--text);
}

.live-context-shell-loading {
  animation: live-board-paint 260ms ease 160ms both;
}

.live-context-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.live-context-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.25;
}

.live-context-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.live-context-head > span {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.live-context-filter-group {
  display: grid;
  gap: 6px;
}

.live-context-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.live-context-filter-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.live-context-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-context-pill,
.live-context-pill-shell,
.live-context-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.live-context-pill {
  padding: 4px 8px;
}

.live-context-pill-shell {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.live-context-pill-label,
.live-context-pill-check {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: inherit;
}

.live-context-pill-label {
  gap: 6px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  font: inherit;
}

.live-context-pill-check {
  justify-content: center;
  width: 30px;
  padding: 0;
}

.live-context-pill-check:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.live-context-pill-check.is-checked,
.live-context-pill-check.is-indeterminate {
  color: #a96f16;
}

.live-context-pill i {
  font-size: 0.82rem;
}

.live-context-pill span,
.live-context-pill-label span {
  max-width: 142px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-context-filter-grid .live-context-pill span,
.live-context-filter-grid .live-context-pill-label span {
  max-width: 104px;
}

.live-context-pill strong,
.live-context-pill-label strong,
.live-context-tab strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.16);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
}

.live-context-pill.is-on,
.live-context-pill-shell.is-on,
.live-context-tab.is-active {
  border-color: rgba(194, 138, 44, 0.48);
  background: rgba(194, 138, 44, 0.14);
  color: var(--text);
}

.live-context-pill.is-current,
.live-context-pill-shell.is-current {
  border-color: rgba(169, 111, 22, 0.74);
  background: rgba(194, 138, 44, 0.2);
  color: var(--text);
  box-shadow: inset 0 0 0 2px rgba(194, 138, 44, 0.36);
}

.live-context-pill.is-current strong,
.live-context-pill-shell.is-current strong {
  background: rgba(169, 111, 22, 0.22);
}

.live-context-pill-shell.is-disabled {
  color: var(--muted);
}

.live-context-pill-control {
  border-style: dashed;
}

/* Hub filter pills carry a left brand stripe (the hue matches the overview hub
   pill + the map marker for the same provider). The gold is-on state stays. */
.live-context-pill-shell.live-pill-branded {
  border-left: 3px solid hsl(var(--hub-hue, 210), 60%, 50%);
}

.live-context-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.live-context-tab {
  justify-content: center;
  min-width: 0;
  padding: 6px 7px;
  border-radius: 8px;
}

.live-context-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-action-tooltip {
  display: inline-flex;
}

.live-reassign-control {
  display: grid;
  grid-template-columns: auto minmax(120px, 180px) auto;
  align-items: center;
  gap: 6px;
}

.live-reassign-control label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-reassign-control .form-control {
  min-height: 31px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.live-schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.live-schedule-grid .tool-field {
  margin: 0;
}

.live-hold-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  min-height: min(68vh, 720px);
}

.live-hold-list-pane,
.live-hold-main-pane,
.live-hold-editor,
.live-hold-secondary {
  min-width: 0;
}

.live-hold-list-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.live-hold-pane-head,
.live-hold-job-head,
.live-hold-action-row,
.live-hold-secondary-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-hold-pane-head {
  justify-content: space-between;
}

.live-hold-pane-head strong,
.live-hold-job-head strong {
  font-weight: 950;
}

.live-hold-list {
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
}

.live-hold-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.live-hold-list-row.is-active {
  border-color: rgba(169, 111, 22, 0.5);
  background: rgba(169, 111, 22, 0.08);
}

.live-hold-list-row span,
.live-hold-list-row strong,
.live-hold-list-row small {
  min-width: 0;
}

.live-hold-list-row span {
  display: grid;
  gap: 2px;
}

.live-hold-list-row strong,
.live-hold-list-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-hold-list-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.live-hold-list-row em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.live-hold-main-pane {
  display: grid;
  align-content: start;
  gap: 12px;
}

.live-hold-job-head {
  flex-wrap: wrap;
}

.live-hold-job-head span,
.live-hold-field span,
.live-hold-detail-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-hold-job-head em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.live-hold-detail {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.live-hold-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-hold-detail-grid div,
.live-hold-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.live-hold-detail-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-hold-comment-preview,
.live-hold-warning {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 760;
}

.live-hold-comments {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.live-hold-comment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.live-hold-comment-row strong,
.live-hold-comment-row time {
  font-size: 0.72rem;
  font-weight: 850;
}

.live-hold-comment-row time {
  color: var(--muted);
}

.live-hold-comment-row p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.78rem;
}

.live-hold-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.live-hold-field-wide {
  grid-column: 1 / -1;
}

.live-hold-field .form-control,
.live-hold-field .form-select {
  min-height: 31px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 760;
}

.live-hold-action-row,
.live-hold-secondary-row {
  flex-wrap: wrap;
  margin-top: 10px;
}

.live-hold-action-row .btn,
.live-hold-secondary-row .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  border-radius: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.live-hold-secondary {
  padding-top: 2px;
}

.live-hold-comment-field {
  flex: 1 1 280px;
}

.live-hold-contact-field {
  width: 140px;
}

.live-hold-empty,
.live-hold-loading,
.live-hold-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.live-hold-error {
  color: #a9343a;
}

.live-hold-warning {
  color: #a9343a;
}

/* New simplified hold modal */
.live-hold-new {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.live-hold-new-job {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.live-hold-new-intro,
.live-hold-new-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.live-hold-new-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.live-hold-new-open div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.live-hold-new-open span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-hold-new-open strong {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 850;
}

.live-hold-new-comment {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 760;
}

.live-hold-new-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.live-hold-new-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  border-radius: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.manifest-email-grid {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 16px;
}

.manifest-email-config,
.manifest-email-progress {
  min-width: 0;
}

.manifest-email-config {
  display: grid;
  align-content: start;
}

.manifest-compose {
  display: grid;
  gap: 12px;
}

.manifest-send-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
}

.manifest-send-row .btn {
  min-height: 31px;
  white-space: nowrap;
}

.manifest-field,
.manifest-send-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
}

.manifest-field span,
.manifest-send-row label span,
.manifest-bcc summary {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manifest-field textarea {
  min-height: 72px;
  resize: vertical;
}

.manifest-bcc summary {
  cursor: pointer;
  list-style: none;
}

.manifest-bcc summary::-webkit-details-marker {
  display: none;
}

.manifest-email-options {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.manifest-email-options legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manifest-progress-empty,
.manifest-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.manifest-warning {
  border-color: rgba(169, 52, 58, 0.28);
  background: rgba(169, 52, 58, 0.08);
  color: #a9343a;
}

.manifest-progress-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.manifest-progress-head > div {
  display: grid;
  gap: 2px;
}

.manifest-progress-head strong {
  font-size: 1rem;
  font-weight: 900;
  text-transform: capitalize;
}

.manifest-progress-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.manifest-ready-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(76, 125, 91, 0.14);
  color: #4c7d5b !important;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  white-space: nowrap;
}

.manifest-failed-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(169, 52, 58, 0.12);
  color: #a9343a !important;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  white-space: nowrap;
}

.manifest-compose-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manifest-compose-fields label {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
}

.manifest-compose-fields label span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manifest-compose-subject {
  grid-column: 1 / -1;
}

.manifest-attachments {
  display: grid;
  gap: 8px;
}

.manifest-priority {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

.manifest-priority i {
  color: var(--accent);
}

.manifest-attachment-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.manifest-pdf-row .form-select {
  width: 86px;
  min-height: 31px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.manifest-pdf-abort {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border-radius: 8px;
}

.manifest-attachment-row > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.manifest-attachment-row strong,
.manifest-attachment-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manifest-attachment-row strong {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.manifest-attachment-row small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.manifest-attachment-row em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.manifest-attachment-done i {
  color: #4c7d5b;
}

.manifest-attachment-running i {
  color: #a96f16;
}

.manifest-attachment-blocked i,
.manifest-attachment-failed i {
  color: #a9343a;
}

.manifest-step-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.manifest-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.manifest-step i {
  margin-top: 1px;
  color: var(--muted);
}

.manifest-step-done i {
  color: #4c7d5b;
}

.manifest-step-running i {
  color: #a96f16;
}

.manifest-step-blocked i,
.manifest-step-failed i {
  color: #a9343a;
}

.manifest-step strong,
.manifest-failed-jobs strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 900;
}

.manifest-step span,
.manifest-failed-jobs span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.manifest-failed-jobs,
.manifest-email-preview,
.manifest-history {
  margin-bottom: 14px;
}

.manifest-failed-jobs summary,
.manifest-email-preview summary,
.manifest-history summary {
  cursor: pointer;
  color: #a96f16;
  font-size: 0.82rem;
  font-weight: 900;
}

.manifest-failed-jobs ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.manifest-artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.manifest-artifacts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
}

.manifest-preview-pane {
  min-width: 0;
}

.manifest-preview-pane iframe {
  width: 100%;
  min-height: min(68vh, 720px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.manifest-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: min(68vh, 720px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.manifest-preview-blocked {
  border-color: rgba(169, 52, 58, 0.28);
  background: rgba(169, 52, 58, 0.08);
  color: #a9343a;
}

.manifest-history .manifest-step-list {
  margin-top: 8px;
}

.manifest-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-context-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 850;
}

.live-context-table-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.live-context-table {
  width: 100%;
  min-width: 760px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.live-context-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-context-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: top;
}

.live-context-table tr:last-child td {
  border-bottom: 0;
}

.live-context-table a {
  color: #a96f16;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.live-context-table .live-col-selected {
  width: 36px;
  text-align: center;
}

.live-context-table .live-col-job {
  width: 104px;
}

.live-context-table .live-col-invoice {
  width: 96px;
}

.live-context-table .live-col-indicators {
  width: 58px;
  text-align: center;
}

.live-context-table .live-col-agent {
  width: 78px;
}

.live-context-table .live-col-booked,
.live-context-table .live-col-scheduled,
.live-context-table .live-col-received {
  width: 112px;
}

.live-context-table .live-col-items {
  min-width: 320px;
}

.live-catalog-divider-row td {
  position: sticky;
  top: 34px;
  z-index: 1;
  padding: 0;
  background: var(--surface);
}

.live-catalog-divider {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-block: 1px solid var(--line);
  background: var(--surface-muted);
}

.live-catalog-divider strong {
  color: #a96f16;
  font-size: 0.84rem;
  font-weight: 950;
}

.live-catalog-divider span {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 850;
}

.live-catalog-divider time {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

/* Click a board row to set the active job/catalog (synced to the context pane).
   Hover + active highlight; clicking a divider activates the whole catalog. */
.live-context-table tbody tr.live-job-row,
.live-catalog-divider-row {
  cursor: pointer;
}

.live-context-table tbody tr.live-job-row:hover > td {
  background: var(--surface-muted);
}

.live-context-table tbody tr.live-job-row.is-active-job > td {
  background: var(--accent-soft);
}

.live-context-table tbody tr.live-job-row.is-active-job > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.live-context-table tbody tr.live-job-row.is-active-job:hover > td {
  background: var(--accent-soft);
}

.live-catalog-divider-row.is-active-catalog .live-catalog-divider {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.live-nls-job-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: max-content;
  white-space: nowrap;
}

.live-nls-job-cell a,
.live-nls-job-cell span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.live-job-hold,
.live-job-ticket,
.live-job-indicator {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
}

.live-job-indicators {
  display: inline-flex;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.live-job-indicator {
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: rgba(100, 116, 139, 0.44);
}

.live-job-indicator.is-active {
  color: var(--text);
}

.live-job-hold.is-active {
  color: #dc2626;
}

.live-job-ticket:hover,
.live-job-ticket:focus-visible {
  background: transparent;
}

.live-job-hold:hover,
.live-job-hold:focus-visible {
  background: transparent;
  color: #475569;
}

.live-job-hold.is-active:hover,
.live-job-hold.is-active:focus-visible {
  color: #b91c1c;
}

.live-job-ticket-urgent {
  color: #dc2626;
}

.live-job-ticket-urgent:hover,
.live-job-ticket-urgent:focus-visible {
  color: #b91c1c;
}

.live-job-ticket-high {
  color: #d97706;
}

.live-job-ticket-high:hover,
.live-job-ticket-high:focus-visible {
  color: #b45309;
}

.live-job-ticket-normal {
  color: #2563eb;
}

.live-job-ticket-normal:hover,
.live-job-ticket-normal:focus-visible {
  color: #1d4ed8;
}

.live-job-ticket-low,
.live-job-ticket-unknown {
  color: #64748b;
}

.live-job-ticket-low:hover,
.live-job-ticket-low:focus-visible,
.live-job-ticket-unknown:hover,
.live-job-ticket-unknown:focus-visible {
  color: #475569;
}

.live-job-hold i,
.live-job-ticket i,
.live-job-indicator i {
  font-size: 0.78rem;
}

.live-nls-job-cell a,
.live-invoice-link {
  font-weight: 900;
}

.live-job-external {
  flex: 0 0 auto;
  color: var(--muted) !important;
  font-size: 0.7rem;
  text-decoration: none !important;
}

.live-invoice-link {
  color: var(--muted) !important;
  font-size: 0.72rem;
  font-weight: 850 !important;
}

.live-job-check,
.live-job-check-all {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.live-book-cell {
  display: block;
  white-space: nowrap;
}

.live-date-full {
  white-space: nowrap;
}

/* Inhouse "Not picked up": a small control that only appears when its row is
   hovered (or keyboard-focused), sitting under the Rcvd date. Visual-only
   affordance to revert a pickup; the click itself is confirm-gated. */
.live-not-picked-up {
  display: block;
  margin-top: 2px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.live-context-table tbody tr:hover .live-not-picked-up,
.live-context-table tbody tr:focus-within .live-not-picked-up {
  opacity: 1;
}

.live-not-picked-up:hover,
.live-not-picked-up:focus-visible {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.5);
}

/* SLA late: a red pill on the late job's date cell, plus the per-catalog and
   per-house "N jobs · M days late" roll-ups. */
.live-sla-late {
  display: inline-block;
  margin-top: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1.6;
  white-space: nowrap;
}

.live-sla-catalog-late {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.live-sla-house-summary {
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 2px 10px;
  border: 1px solid rgba(180, 35, 24, 0.4);
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
  font-size: 0.72rem;
  font-weight: 800;
}

.live-inhouse-pro {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Shipping documents next to a ProNum: a single-file link opens the PDF in a
   new tab; the multi-file button opens a filename/type popover. */
.live-docs-single,
.live-docs-multi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  text-decoration: none;
}

.live-docs-single:hover,
.live-docs-single:focus-visible,
.live-docs-multi:hover,
.live-docs-multi:focus-visible {
  color: var(--text);
}

.live-docs-popover {
  position: fixed;
  z-index: 1080;
  width: max-content;
  max-width: min(460px, 92vw);
  max-height: 260px;
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.live-docs-pop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.live-docs-pop-table th {
  text-align: left;
  padding: 2px 8px 4px 0;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.66rem;
}

.live-docs-pop-table td {
  padding: 3px 8px 3px 0;
  border-top: 1px dashed var(--line);
  white-space: nowrap;
}

.live-docs-pop-table td:first-child {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-docs-pop-table td:last-child {
  color: var(--muted);
  font-weight: 650;
}

.live-docs-pop-table td a {
  text-decoration: none;
  font-weight: 650;
}

.live-docs-pop-table td a:hover,
.live-docs-pop-table td a:focus-visible {
  text-decoration: underline;
}

.live-items-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.live-context-table .live-items-table td {
  padding: 2px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.25;
  vertical-align: top;
}

.live-context-table .live-items-table tr:last-child td {
  border-bottom: 0;
}

.live-context-table .live-items-table .live-item-description {
  width: 24ch;
  padding-right: 10px;
  white-space: nowrap;
}

.live-context-table .live-items-table .live-item-description a,
.live-context-table .live-items-table .live-item-description span {
  display: inline-block;
  max-width: 24ch;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: top;
}

.live-context-table .live-items-table .live-item-details {
  width: auto;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-bidder-cell {
  min-width: 0;
}

.live-bidder-open {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a96f16;
  font: inherit;
  font-weight: 850;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
}

.icon-button:hover,
.icon-button:focus-visible,
.icon-button.is-copied {
  border-color: rgba(194, 138, 44, 0.48);
  background: rgba(194, 138, 44, 0.14);
  color: var(--text);
}

.icon-button.live-job-hold,
.icon-button.live-job-hold:hover,
.icon-button.live-job-hold:focus-visible {
  border-color: transparent;
  background: transparent;
}

.live-bidder-details {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.live-bidder-modal-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
  gap: 16px;
}

.live-bidder-shipping,
.live-bidder-jobs {
  display: grid;
  gap: 10px;
  align-content: start;
}

.live-bidder-shipping {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.live-bidder-shipping span,
.live-bidder-jobs-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.live-bidder-shipping strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
}

.live-bidder-shipping p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.live-bidder-jobs-head,
.live-bidder-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-bidder-pager {
  justify-content: flex-end;
}

.live-bidder-jobs-table {
  min-width: 720px;
}

.live-context-empty-row {
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.live-context-skeleton {
  position: relative;
  display: inline-block;
  min-height: 18px;
  min-width: 74px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--skeleton-bg);
  background-size: 220% 100%;
  color: transparent;
  line-height: 1;
  user-select: none;
}

.live-context-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--skeleton-shimmer);
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
  transform: translateX(-100%);
}

.live-context-skeleton-title {
  min-width: 210px;
  min-height: 24px;
}

.live-context-skeleton-small {
  min-width: 58px;
}

.live-context-skeleton-pill {
  min-width: 92px;
  min-height: 30px;
}

.live-context-skeleton-tab {
  width: 100%;
  min-height: 34px;
}

.live-context-skeleton-wide {
  min-width: 126px;
}

.context-modal-dialog {
  max-width: min(96vw, 1360px);
}

.context-pane .live-context-table-wrap {
  overflow-x: hidden;
}

.context-pane .live-context-table {
  min-width: 0;
  table-layout: fixed;
}

.context-pane .live-context-table th,
.context-pane .live-context-table td {
  padding: 8px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.context-pane .live-col-agent,
.context-pane .live-col-pro_num,
.context-pane .live-col-tracking {
  display: none;
}

.context-pane .live-col-selected {
  width: 30px;
}

.context-pane .live-col-job {
  width: 88px;
}

.context-pane .live-context-table .live-col-job {
  overflow: visible;
  text-overflow: clip;
}

.context-pane .live-col-invoice {
  width: 82px;
}

.context-pane .live-col-indicators {
  width: 48px;
}

.context-pane .live-job-hold,
.context-pane .live-job-ticket,
.context-pane .live-job-indicator {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}

.context-pane .live-job-hold i,
.context-pane .live-job-ticket i,
.context-pane .live-job-indicator i {
  font-size: 0.68rem;
}

.context-pane .live-col-booked,
.context-pane .live-col-scheduled,
.context-pane .live-col-received {
  width: 104px;
  text-align: center;
}

.context-pane .live-book-cell {
  display: block;
}

.context-pane .live-bidder-cell {
  min-width: 0;
}

.context-pane .live-bidder-open {
  max-width: 94px;
}

.context-pane .live-bidder-details {
  white-space: normal;
}

.logs-stage {
  overflow: auto;
}

.events-stage {
  overflow: hidden;
}

.events-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
  padding: 18px;
}

.events-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.events-head h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
}

.events-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.events-summary strong {
  color: var(--text);
}

.events-empty-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 18px 18px 0;
}

.events-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.events-import-dropzone {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0;
  border: 1px dashed var(--dropzone-border);
  border-radius: 8px;
  background: var(--dropzone-bg);
  color: var(--text);
}

.events-import-dropzone-standalone {
  margin: 0;
}

.events-import-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 850;
}

.events-import-dropzone.is-dragging {
  border-color: var(--dropzone-border-active);
  background: var(--dropzone-bg-active);
}

.events-import-dropzone.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.events-filter-bar {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.events-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.events-filter.is-active {
  border-color: rgba(194, 138, 44, 0.48);
  background: rgba(194, 138, 44, 0.14);
  color: var(--text);
}

.events-filter strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.16);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
}

.events-board {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.events-table {
  min-width: 900px;
  margin: 0;
  background: var(--surface);
}

.events-table [data-events-catalog-row],
.events-table [data-events-main-catalog-row] {
  cursor: pointer;
}

.events-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.events-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: top;
}

.events-table tr:last-child td {
  border-bottom: 0;
}

/* StartDate pill: far = muted, recent (<=3 days past) = green, soon (today or
   <=3 days ahead) = warning amber. */
.events-date-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2, #eef1f5);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.events-date-pill.events-date-recent {
  background: color-mix(in srgb, #1c7c54 16%, transparent);
  color: #1c7c54;
}

.events-date-pill.events-date-soon {
  background: color-mix(in srgb, #b78103 22%, transparent);
  color: #8a5b00;
}

.events-house-group td {
  position: sticky;
  top: 34px;
  z-index: 1;
  padding: 7px 10px;
  background: var(--surface-muted);
  color: var(--text);
}

.events-house-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.events-house-group-label strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.events-house-group-label span,
.events-house-group-label small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.events-catalog-label {
  color: #a96f16;
  font-weight: 900;
}

.events-catalog-label.is-active,
.events-table tr.is-active .events-catalog-label {
  color: #0f766e;
}

.events-table [data-events-catalog-row]:hover td,
.events-table [data-events-main-catalog-row]:hover td,
.events-table tr.is-active td {
  background: rgba(15, 118, 110, 0.08);
}

.events-external-link {
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.events-catalog-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.events-catalog-main.d-none {
  display: none;
}

.events-catalog-main-board {
  min-height: 0;
}

.events-type-pill,
.live-house-type {
  --house-type-bg: rgba(90, 109, 124, 0.16);
  --house-type-fg: #465967;
  --house-type-border: rgba(90, 109, 124, 0.28);
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid var(--house-type-border);
  border-radius: 999px;
  background: var(--house-type-bg);
  color: var(--house-type-fg);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.events-type-full-service,
.live-house-type-full-service {
  --house-type-bg: rgba(44, 122, 73, 0.16);
  --house-type-fg: #2c7a49;
  --house-type-border: rgba(44, 122, 73, 0.34);
}

.events-type-hybrid,
.live-house-type-hybrid {
  --house-type-bg: rgba(177, 114, 29, 0.18);
  --house-type-fg: #8a5b13;
  --house-type-border: rgba(177, 114, 29, 0.38);
}

.events-type-elabel,
.live-house-type-elabel {
  --house-type-bg: rgba(54, 92, 168, 0.16);
  --house-type-fg: #365ca8;
  --house-type-border: rgba(54, 92, 168, 0.34);
}

.events-type-elabel-only,
.live-house-type-elabel-only {
  --house-type-bg: rgba(94, 67, 123, 0.18);
  --house-type-fg: #5e437b;
  --house-type-border: rgba(94, 67, 123, 0.38);
}

.events-catalog-context {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.events-catalog-context-head {
  display: grid;
  gap: 6px;
}

.events-catalog-context-head > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.events-catalog-context-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.22;
}

.events-catalog-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.events-catalog-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.events-catalog-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-catalog-tab strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.14);
  color: var(--text);
  font-size: 0.66rem;
}

.events-catalog-tab.is-active {
  border-color: rgba(169, 111, 22, 0.38);
  background: rgba(169, 111, 22, 0.12);
  color: var(--text);
}

.events-catalog-table-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.events-catalog-filter-groups {
  display: grid;
  gap: 8px;
}

.events-catalog-filter-group {
  display: grid;
  gap: 5px;
}

.events-catalog-filter-group > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.events-catalog-filter-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.events-catalog-filter-pill {
  cursor: pointer;
  opacity: 0.46;
}

.events-catalog-filter-pill.is-active {
  opacity: 1;
}

.events-catalog-filter-pill strong {
  margin-left: 3px;
  font-weight: 950;
}

.events-catalog-context-table {
  width: 100%;
  min-width: 760px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.events-catalog-context-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.events-catalog-context-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 760;
  vertical-align: top;
}

.events-catalog-context-table a {
  color: #a96f16;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.events-catalog-context-table .live-invoice-link {
  color: #a96f16 !important;
}

.events-catalog-context-table tr:last-child td {
  border-bottom: 0;
}

.events-catalog-invoice-cell {
  width: 86px;
  white-space: nowrap;
}

.events-catalog-job-column {
  width: 104px;
  white-space: nowrap;
}

.events-catalog-job-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.events-catalog-job-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.events-job-pill {
  --events-pill-bg: rgba(100, 116, 139, 0.12);
  --events-pill-fg: #475569;
  --events-pill-border: rgba(100, 116, 139, 0.25);
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--events-pill-border);
  border-radius: 999px;
  background: var(--events-pill-bg);
  color: var(--events-pill-fg);
  font-size: 0.63rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.events-jobtype-full {
  --events-pill-bg: rgba(44, 122, 73, 0.14);
  --events-pill-fg: #2c7a49;
  --events-pill-border: rgba(44, 122, 73, 0.3);
}

.events-jobtype-elabel {
  --events-pill-bg: rgba(54, 92, 168, 0.14);
  --events-pill-fg: #365ca8;
  --events-pill-border: rgba(54, 92, 168, 0.3);
}

.events-jobtype-pad {
  --events-pill-bg: rgba(94, 67, 123, 0.16);
  --events-pill-fg: #5e437b;
  --events-pill-border: rgba(94, 67, 123, 0.32);
}

.events-status-booked {
  --events-pill-bg: rgba(15, 118, 110, 0.14);
  --events-pill-fg: #0f766e;
  --events-pill-border: rgba(15, 118, 110, 0.3);
}

.events-status-quoted {
  --events-pill-bg: rgba(37, 99, 235, 0.12);
  --events-pill-fg: #2563eb;
  --events-pill-border: rgba(37, 99, 235, 0.26);
}

.events-status-cancelled {
  --events-pill-bg: rgba(220, 38, 38, 0.12);
  --events-pill-fg: #b91c1c;
  --events-pill-border: rgba(220, 38, 38, 0.26);
}

.events-status-certified {
  --events-pill-bg: rgba(177, 114, 29, 0.16);
  --events-pill-fg: #8a5b13;
  --events-pill-border: rgba(177, 114, 29, 0.32);
}

.events-status-not-certified {
  --events-pill-bg: rgba(100, 116, 139, 0.12);
  --events-pill-fg: #475569;
  --events-pill-border: rgba(100, 116, 139, 0.25);
}

.events-catalog-bidder-cell {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-catalog-quote-cell {
  white-space: nowrap;
}

.context-empty-compact {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.events-direct-upload {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.events-direct-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
  padding: 12px;
  border: 1px dashed var(--dropzone-border);
  border-radius: 8px;
  background: var(--dropzone-bg);
  color: var(--text);
}

.events-direct-dropzone > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}

.events-direct-dropzone i {
  grid-row: span 2;
  color: #a96f16;
  font-size: 1.15rem;
}

.events-direct-dropzone span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-direct-dropzone small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.events-direct-dropzone.is-dragging {
  border-color: var(--dropzone-border-active);
  background: var(--dropzone-bg-active);
}

.events-direct-dropzone.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.events-direct-files {
  min-width: 0;
}

.events-direct-file-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.events-direct-file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.events-direct-file-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-direct-file-list small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.events-direct-imports {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.events-direct-book-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.events-direct-book-actions span,
.events-direct-ready,
.events-direct-booking-error {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 820;
}

.events-direct-booking-error {
  color: #8a1f11;
  white-space: normal;
}

.events-direct-book-link {
  white-space: nowrap;
}

.events-direct-import-issues {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #efc36d;
  border-radius: 8px;
  background: #fff9e9;
  color: #6d4300;
  font-size: 0.72rem;
  font-weight: 800;
  list-style: none;
}

.events-direct-import-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.events-direct-import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.events-direct-import-table th,
.events-direct-import-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.events-direct-import-table th {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.events-direct-import-table tbody tr:last-child td {
  border-bottom: 0;
}

.events-direct-import-table .events-direct-import-address {
  min-width: 240px;
  white-space: normal;
}

.events-direct-import-table .events-direct-import-items {
  min-width: 300px;
  white-space: normal;
}

.events-direct-link {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 850;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Inline (right-pane) compact item list */
.events-direct-items-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.events-direct-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.events-direct-item-main {
  min-width: 0;
}

.events-direct-item-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

/* Shared numeric column styling (flat wide table + detail) */
.events-direct-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.events-direct-import-table th.events-direct-num {
  text-align: right;
}

.events-direct-dim-empty {
  color: var(--muted);
  opacity: 0.55;
}

.events-direct-col-thumb {
  width: 1%;
  white-space: nowrap;
}

/* Shared Direct order table (top = finalized offlive orders, bottom = pending
   uploaded rows). Order-level cells (Inv/Job, Client, Charges, Hub, Book) rowspan
   the item rows. */
.events-direct-order-table .events-direct-order-row > td {
  vertical-align: top;
}

/* Left column: Invoice over Job, two labelled lines. */
.events-direct-invjob {
  display: grid;
  gap: 2px;
  white-space: nowrap;
}

.events-direct-invjob-line {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.events-direct-invjob-line em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.events-direct-invjob-hub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Invoice (order) row hover. */
.events-direct-order-table tbody tr.events-direct-order-row:hover > td {
  background: var(--surface-hover, rgba(91, 157, 255, 0.07));
}

/* Client: stacked name + contact lines. */
.events-direct-order-table .events-direct-client {
  display: grid;
  gap: 1px;
  min-width: 150px;
  max-width: 230px;
  white-space: normal;
}

.events-direct-client-name {
  font-weight: 850;
}

.events-direct-client-line {
  color: var(--muted);
  font-size: 0.72rem;
}

/* Items cell: one hoverable row per item. Every row shares the same fixed grid
   template (thumb · text · value) so the columns line up down the cell without
   table rowspan. The description link sits above its muted dims line. */
.events-direct-items-cell {
  min-width: 280px;
  white-space: normal;
}

.events-direct-item-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding: 4px 6px;
  border-radius: 6px;
}

.events-direct-item-row + .events-direct-item-row {
  margin-top: 2px;
}

/* Item row hover, separate from the invoice-row hover. */
.events-direct-item-row:hover {
  background: var(--surface-2, #eef1f5);
}

.events-direct-item-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

/* Description truncates to two lines so long titles can't crowd the cell. */
.events-direct-itemdesc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

/* Dims on the left, value pushed to the right (space-between) — no value col. */
.events-direct-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.events-direct-itemdims {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.72rem;
}

.events-direct-itemval {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.events-direct-thumb--sm {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2, #eef1f5);
}

.events-direct-thumb--sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.events-direct-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  opacity: 0.5;
}

/* Status cell: resolved status word + Book action when not yet booked. */
.events-direct-status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  white-space: nowrap;
}

.events-direct-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2, #eef1f5);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.events-direct-status-pill.is-booked {
  background: color-mix(in srgb, #1c7c54 16%, transparent);
  color: #1c7c54;
}

/* Charges: Pick/Pack/Shipping/Insure/Total stacked vertically. */
.events-direct-prices-cell {
  min-width: 132px;
}

.events-direct-prices {
  display: grid;
  gap: 1px;
  margin: 0;
}

.events-direct-price-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}

.events-direct-price-line dt {
  color: var(--muted);
  font-weight: 700;
}

.events-direct-price-line dd {
  margin: 0;
  font-weight: 760;
}

.events-direct-price-line.is-total {
  margin-top: 2px;
  padding-top: 3px;
  border-top: 1px solid var(--line-soft);
}

.events-direct-price-line.is-total dt,
.events-direct-price-line.is-total dd {
  font-weight: 900;
  color: var(--ink);
}

.events-direct-booked {
  color: var(--muted);
  font-weight: 800;
}

.events-direct-col-lot {
  min-width: 150px;
  white-space: normal;
}

.events-direct-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  flex: 0 0 auto;
}

.events-direct-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.events-direct-thumb-empty {
  color: var(--muted);
  opacity: 0.6;
  font-size: 0.9rem;
}

.events-direct-lot-link {
  display: block;
}

.events-direct-item small,
.events-direct-import-table small,
.events-direct-item em,
.events-direct-import-table em,
.events-direct-empty {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 760;
}

.events-direct-item em,
.events-direct-import-table em {
  color: #8a5b00;
}

.events-direct-imports-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.events-direct-imports-head span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 820;
}

.events-direct-import-table .events-direct-import-items {
  min-width: 220px;
}

/* Wide/modal flat table: dims stay tight, item rows align to invoice */
.events-direct-import-table--flat td,
.events-direct-import-table--flat th {
  vertical-align: top;
}

.events-direct-import-table-wrap--wide {
  overflow-x: auto;
  border: 0;
}

.events-direct-detail-modal.is-wide .modal-dialog {
  max-width: min(1320px, calc(100vw - 28px));
}

/* Clickable invoice rows in the context table */
.events-direct-import-row {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.events-direct-import-row:hover {
  background: var(--surface-hover, rgba(91, 157, 255, 0.07));
}

.events-direct-import-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.events-direct-client-name {
  font-weight: 850;
  color: var(--ink);
}

.events-direct-item-lot {
  display: block;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.events-direct-item-more {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  padding-left: 46px;
}

/* Booking / quote cell in the context table */
.events-direct-quote-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.events-direct-quote-cell.is-error {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.events-direct-quote-btn {
  white-space: nowrap;
}

.events-direct-quote-btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.events-direct-quote-panel-actions {
  margin-top: 12px;
}

.events-direct-quote-figures {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.events-direct-quote-total {
  font-size: 0.92rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.events-direct-quote-job {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 820;
  white-space: nowrap;
}

.events-direct-ready {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1f7a4d;
}

/* Invoice modal */
.events-direct-invoice {
  display: grid;
  gap: 18px;
}

.events-direct-invoice-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 720px) {
  .events-direct-invoice-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

.events-direct-invoice-client,
.events-direct-quote-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}

.events-direct-invoice-client-id {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.events-direct-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
}

.events-direct-invoice-client-id h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
}

.events-direct-invoice-tag {
  display: inline-block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.events-direct-invoice-fields {
  display: grid;
  gap: 10px;
  margin: 0;
}

.events-direct-invoice-fields div {
  display: grid;
  gap: 2px;
}

.events-direct-invoice-fields dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.events-direct-invoice-fields dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Quote panel */
.events-direct-quote-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.events-direct-quote-panel.is-quoted {
  border-color: rgba(31, 122, 77, 0.4);
  background: linear-gradient(0deg, rgba(31, 122, 77, 0.05), rgba(31, 122, 77, 0.05)), var(--surface);
}

.events-direct-quote-panel .events-direct-quote-label {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.events-direct-quote-amount {
  font-size: 1.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.events-direct-quote-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.events-direct-quote-breakdown div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.events-direct-quote-breakdown dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.events-direct-quote-breakdown dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.events-direct-quote-panel.is-error {
  border-color: rgba(138, 31, 17, 0.4);
  background: #fff6f4;
  color: #8a1f11;
}

.events-direct-quote-panel.is-pending,
.events-direct-quote-panel.is-ready {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.events-direct-quote-panel.is-ready strong {
  color: #1f7a4d;
}

.events-direct-quote-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.events-direct-invoice-items-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.events-direct-invoice-items-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
}

.events-direct-invoice-items-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.events-direct-invoice-empty {
  padding: 18px;
  text-align: center;
}

.events-direct-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.events-direct-detail-list div {
  display: grid;
  gap: 2px;
}

.events-direct-detail-list dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.events-direct-detail-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.events-direct-lot-detail {
  display: grid;
  gap: 14px;
}

.events-direct-lot-detail img {
  max-width: min(100%, 520px);
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.catalog-import-modal .modal-dialog {
  max-width: min(1320px, calc(100vw - 28px));
}

.catalog-import-body {
  display: grid;
  gap: 14px;
}

.catalog-import-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.catalog-import-summary h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  word-break: break-word;
}

.catalog-import-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.catalog-import-counts,
.catalog-import-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.catalog-import-counts span,
.catalog-import-filter,
.catalog-import-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.catalog-import-filter {
  border-radius: 8px;
  background: var(--surface);
}

.catalog-import-filter.is-active {
  border-color: rgba(57, 118, 184, 0.46);
  background: rgba(57, 118, 184, 0.12);
  color: var(--text);
}

.catalog-import-table-wrap {
  max-height: min(60vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.catalog-import-table {
  min-width: 1160px;
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.catalog-import-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.catalog-import-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 720;
  vertical-align: top;
}

.catalog-import-row-running td {
  background: rgba(57, 118, 184, 0.06);
}

.catalog-import-row-error td {
  background: rgba(185, 71, 61, 0.07);
}

.catalog-import-row-cancelled td {
  background: rgba(100, 116, 139, 0.08);
}

.catalog-import-row-new td {
  background: rgba(76, 125, 91, 0.07);
}

.catalog-import-row-updated td {
  background: rgba(194, 138, 44, 0.08);
}

.catalog-import-state-running {
  background: rgba(57, 118, 184, 0.14);
  color: #315f92;
}

.catalog-import-state-new {
  background: rgba(76, 125, 91, 0.14);
  color: #3f704e;
}

.catalog-import-state-updated {
  background: rgba(194, 138, 44, 0.16);
  color: #865c19;
}

.catalog-import-state-error {
  background: rgba(185, 71, 61, 0.14);
  color: #994038;
}

.catalog-import-state-cancelled {
  background: rgba(100, 116, 139, 0.16);
  color: var(--muted);
}

.catalog-import-message {
  min-width: 220px;
  max-width: 460px;
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: normal;
}

.catalog-import-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.catalog-import-ready-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.reports-stage {
  overflow: auto;
}

.zendesk-stage {
  overflow: hidden;
}

.zendesk-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.zendesk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.zendesk-head h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
}

.zendesk-summary,
.zendesk-filter-bar,
.zendesk-filter-group,
.zendesk-context-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.zendesk-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.zendesk-summary strong {
  color: var(--text);
}

.zendesk-filter-bar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.zendesk-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.zendesk-filter.is-active {
  border-color: rgba(194, 138, 44, 0.48);
  background: rgba(194, 138, 44, 0.14);
  color: var(--text);
}

.zendesk-filter strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.16);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
}

.zendesk-board {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.zendesk-table {
  min-width: 1180px;
  margin: 0;
}

.zendesk-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.zendesk-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text);
  font-size: 0.78rem;
  vertical-align: middle;
}

.zendesk-row {
  cursor: pointer;
}

.zendesk-row:hover td,
.zendesk-row.is-active td {
  background: rgba(194, 138, 44, 0.09);
}

.zendesk-ticket-pill,
.zendesk-status,
.zendesk-urgency,
.zendesk-attention {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 850;
}

.zendesk-status-new {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.zendesk-status-open {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}

.zendesk-status-pending,
.zendesk-status-on-hold {
  background: rgba(194, 138, 44, 0.16);
  color: #a96f16;
}

.zendesk-status-solved {
  color: var(--muted);
}

.zendesk-urgency-urgent,
.zendesk-attention {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.zendesk-urgency-high {
  background: rgba(194, 138, 44, 0.16);
  color: #a96f16;
}

.zendesk-subject {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zendesk-date-cell {
  display: grid;
  gap: 2px;
}

.zendesk-date-cell small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.zendesk-table a {
  color: #a96f16;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.zendesk-hold-icon {
  color: #dc2626;
}

.zendesk-context-shell {
  display: grid;
  gap: 12px;
}

.zendesk-context-shell header {
  display: grid;
  gap: 8px;
}

.zendesk-context-shell h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.3;
}

.zendesk-context-shell .context-card {
  gap: 8px;
}

.zendesk-context-shell .context-card div,
.zendesk-context-shell .context-summary-row div {
  display: grid;
  gap: 2px;
}

.zendesk-hold-card {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(220, 38, 38, 0.08);
}

.reports-shell {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.reports-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.reports-head h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-content: start;
}

.report-card {
  display: grid;
  grid-template-rows: auto minmax(132px, 1fr);
  gap: 12px;
  min-height: 208px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.report-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.report-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 920;
}

.report-card small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-card header strong {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 920;
  line-height: 1;
}

.report-chart {
  display: grid;
  grid-template-rows: minmax(108px, 1fr) 20px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.report-plot {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 108px;
}

.report-plot-dual {
  grid-template-columns: 40px minmax(0, 1fr) 36px;
}

.report-y-axis {
  position: relative;
  border-right: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 860;
}

.report-y-axis span {
  position: absolute;
  right: 5px;
  max-width: 34px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-y-axis-right {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.report-y-axis-right span {
  right: auto;
  left: 5px;
  text-align: left;
}

.report-y-axis-high {
  top: 5px;
}

.report-y-axis-mid {
  top: 50%;
  transform: translateY(-50%);
}

.report-series-area {
  position: relative;
  min-width: 0;
  min-height: 108px;
  height: 100%;
}

.report-bars {
  position: absolute;
  inset: 8px 0 0;
  display: flex;
  align-items: flex-end;
  gap: 0;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.report-bar {
  flex: 1 1 0;
  min-width: 1px;
  background: linear-gradient(180deg, #2dd4bf, #0f766e);
}

.report-chart-gold .report-bar {
  background: linear-gradient(180deg, #f7c66b, #a96f16);
}

.report-bar:hover {
  filter: brightness(1.08);
}

.report-line-overlay {
  position: absolute;
  inset: 8px 0 0;
  width: 100%;
  height: calc(100% - 8px);
  overflow: visible;
  pointer-events: none;
}

.report-line-overlay polyline {
  fill: none;
  stroke: #2563eb;
  stroke-width: 1.35;
  opacity: 0.82;
  vector-effect: non-scaling-stroke;
}

.report-line-point {
  fill: #2563eb;
  opacity: 0.9;
  vector-effect: non-scaling-stroke;
}

.report-year-axis {
  display: flex;
  min-width: 0;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}

.report-year-axis span {
  min-width: 0;
  overflow: hidden;
  padding: 3px 2px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 860;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1400px) {
  .reports-grid {
    grid-template-columns: repeat(var(--report-xl-columns, 5), minmax(0, 1fr));
  }
}

.admin-stage {
  overflow: hidden;
}

.admin-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-head h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
}

.admin-current {
  display: grid;
  gap: 2px;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  text-align: right;
}

.admin-current span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.admin-current strong {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 900;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.admin-tab {
  min-width: 84px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 880;
}

.admin-tab.active {
  background: var(--app-bg);
  border-color: var(--line);
  color: var(--text);
}

.admin-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-tab-panel {
  display: none;
  min-height: 0;
}

.admin-tab-panel.active {
  display: grid;
}

.admin-board {
  min-height: 0;
  overflow: auto;
}

.admin-route-table {
  min-width: 900px;
  margin: 0;
}

.admin-route-table th,
.admin-route-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  vertical-align: middle;
}

.admin-route-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-route-table tbody th {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.admin-route-table tbody th span,
.admin-route-table tbody th small,
.admin-route-table tbody th em {
  display: block;
}

.admin-route-table tbody th small,
.admin-route-table tbody th em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 750;
}

.admin-route-table td {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  text-align: center;
}

.admin-route-table td.is-current {
  background: var(--accent-soft);
}

.admin-access-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.admin-access-toggle:hover,
.admin-access-toggle:focus-visible {
  background: var(--surface-muted);
}

.admin-access-toggle.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.admin-access-yes {
  color: #0f766e;
}

.admin-access-no {
  color: rgba(100, 116, 139, 0.55);
}

.admin-override-dot {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.scheduler-panel.active {
  overflow: hidden;
}

.scheduler-shell {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.scheduler-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--app-bg);
}

.scheduler-summary article {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.scheduler-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.scheduler-summary strong {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 920;
}

.scheduler-board {
  min-height: 0;
  overflow: auto;
}

.scheduler-table {
  min-width: 1040px;
  margin: 0;
}

.scheduler-table th,
.scheduler-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  vertical-align: middle;
}

.scheduler-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scheduler-table tbody th {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.scheduler-table tbody th span,
.scheduler-table tbody th small,
.scheduler-table tbody th em,
.scheduler-table td small {
  display: block;
}

.scheduler-table tbody th small,
.scheduler-table tbody th em,
.scheduler-table td small {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 750;
}

.scheduler-table td {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.scheduler-table code {
  color: var(--text);
  font-size: 0.72rem;
  white-space: nowrap;
}

.scheduler-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scheduler-status-success {
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.scheduler-status-failed {
  border-color: rgba(185, 28, 28, 0.22);
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
}

.scheduler-status-running,
.scheduler-status-queued {
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(96, 165, 250, 0.12);
  color: #1d4ed8;
}

.scheduler-run-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
}

.scheduler-run-btn:hover,
.scheduler-run-btn:focus-visible {
  background: var(--accent-soft);
}

.scheduler-run-btn.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.scheduler-runs {
  display: grid;
  min-height: 0;
  border-top: 1px solid var(--line);
}

.scheduler-runs header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.scheduler-runs h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 900;
}

.scheduler-runs-board {
  max-height: 260px;
}

.scheduler-log-detail summary {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.scheduler-log-detail summary:hover {
  background: var(--surface-muted);
}

.scheduler-log-detail pre {
  max-width: 520px;
  max-height: 220px;
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--app-bg);
  color: var(--text);
  font-size: 0.72rem;
  white-space: pre-wrap;
}

.logs-shell {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.logs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.logs-refresh-note {
  align-self: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.logs-tabs {
  border-bottom-color: var(--line);
}

.logs-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.logs-tabs .nav-link.active {
  border-color: var(--line) var(--line) var(--surface);
  background: var(--surface);
  color: var(--text);
}

.logs-tab-content {
  min-height: 0;
}

.logs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.log-card,
.celery-worker-card,
.command-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow: hidden;
}

.log-card header,
.celery-worker-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.log-card header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.log-card strong,
.celery-worker-card strong,
.command-status h2,
.celery-workers h2 {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.log-card small,
.celery-worker-card header span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.log-card pre {
  max-height: 340px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.logs-empty,
.logs-warning {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 240px;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.logs-empty-inline {
  min-height: 96px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.logs-warning {
  grid-auto-flow: column;
  justify-content: start;
  min-height: auto;
  margin-bottom: 12px;
  border: 1px solid rgba(169, 52, 58, 0.28);
  border-radius: 8px;
  background: rgba(169, 52, 58, 0.08);
  color: #a9343a;
  text-align: left;
}

.celery-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 14px;
}

.celery-workers,
.command-status {
  display: grid;
  gap: 10px;
  align-content: start;
}

.celery-worker-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  list-style: none;
}

.celery-worker-card li {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.celery-worker-card li span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-table-wrap {
  overflow: auto;
}

.command-table {
  width: 100%;
  min-width: 720px;
  margin: 0;
  border-collapse: collapse;
}

.command-table th,
.command-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.command-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.command-table tr:last-child td {
  border-bottom: 0;
}

.command-row-done {
  background: rgba(76, 125, 91, 0.06);
}

.command-row-failed {
  background: rgba(169, 52, 58, 0.06);
}

.command-table code {
  color: var(--text);
  font-size: 0.72rem;
}

.command-result {
  display: grid;
  gap: 2px;
  max-width: 300px;
  white-space: normal;
}

.command-result strong {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.command-result span,
.command-result small,
.command-action-muted {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.command-status-pill {
  display: inline-grid;
  min-width: 58px;
  place-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.16);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.command-status-done {
  background: rgba(76, 125, 91, 0.16);
  color: #4c7d5b;
}

.command-status-failed {
  background: rgba(169, 52, 58, 0.14);
  color: #a9343a;
}

.stub-stage {
  display: grid;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-content: start;
  padding: 18px;
}

.tool-widget {
  display: flex;
  flex-direction: column;
  min-height: 212px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow: hidden;
}

.tool-widget-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tool-widget-head h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.tool-widget-head p {
  min-height: 2.25rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.28;
}

.tool-widget-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.tool-widget-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.tool-widget-fields,
.tool-widget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.tool-widget-actions {
  justify-content: flex-end;
}

.tool-widget-result {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.86rem;
  line-height: 1.3;
}

.tool-widget-result.is-ok {
  border-color: var(--success, #2f9e44);
}

.tool-widget-result.is-error {
  border-color: var(--danger, #e03131);
}

.tool-widget-result .widget-result-message {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.tool-widget-result .widget-result-data {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin: 8px 0 0;
}

.tool-widget-result .widget-result-data dt {
  color: var(--muted);
  font-weight: 700;
}

.tool-widget-result .widget-result-data dd {
  margin: 0;
  color: var(--text);
}

.tool-widget-result .widget-result-errors {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--danger, #e03131);
}

.tool-field {
  display: grid;
  gap: 5px;
  min-width: 124px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.92rem;
  font-weight: 500;
}

.tool-field .errorlist {
  margin: 0;
  padding-left: 18px;
  color: #b42318;
  font-weight: 600;
}

.tool-widget .btn {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 700;
}

.tool-widget-bottom {
  margin-top: auto;
  padding-top: 14px;
}

.warehouse-stage {
  padding: 0;
}

.warehouse-board {
  min-width: 100%;
  overflow: auto;
}

.warehouse-table {
  margin: 0;
  table-layout: auto;
  white-space: normal;
}

.warehouse-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.warehouse-table td {
  padding: 10px 14px;
  color: var(--text);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.warehouse-table .JobDisplayID,
.warehouse-table .jobDisplayID,
.warehouse-table .Location,
.warehouse-table .step,
.warehouse-table .startComplete,
.warehouse-table .labels,
.warehouse-table .opsForm {
  width: 1%;
  white-space: nowrap;
}

.warehouse-table .notes,
.warehouse-table .note,
.warehouse-table .Note,
.warehouse-table .Notes {
  min-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.warehouse-table .btn {
  min-width: 62px;
  border-radius: 8px;
  font-weight: 750;
}

.packing {
  width: clamp(260px, 26vw, 320px);
  min-width: 260px;
  white-space: normal;
}

.packing-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.packing-list {
  display: grid;
  gap: 8px;
}

.packing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.packer-card {
  cursor: pointer;
}

.packer-card:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

.packing-card.is-loading {
  opacity: 0.72;
}

.packing-card.status-active {
  border-color: rgba(22, 163, 74, 0.65);
  box-shadow: inset 4px 0 0 #16a34a;
}

.packing-card.status-paused {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: inset 4px 0 0 #f59e0b;
}

.packing-card.status-pending {
  border-color: var(--line);
}

.packing-card.status-unassigned {
  border-color: rgba(14, 165, 233, 0.65);
  box-shadow: inset 4px 0 0 #0ea5e9;
}

.packer-card:hover,
.packer-card.is-hovered,
.packer-card.is-active {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--accent), 0 8px 24px rgba(15, 23, 42, 0.1);
}

.packing-line {
  display: grid;
  grid-template-columns: 40px minmax(96px, 1fr) 32px 32px;
  gap: 8px;
  align-items: center;
  padding: 8px;
}

.packer-copy {
  min-width: 0;
}

.packer-name {
  overflow: hidden;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.packer-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.status-active .status-dot {
  background: #16a34a;
}

.status-paused .status-dot {
  background: #f59e0b;
}

.status-pending .status-dot {
  background: var(--muted);
}

.status-unassigned .status-dot {
  background: #0ea5e9;
}

.unassigned-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(14, 165, 233, 0.45);
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.14);
  color: #0ea5e9;
}

.unassigned-packer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px auto;
  gap: 8px;
  padding: 0 8px 8px 56px;
}

.add-packer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.priority-control {
  display: grid;
  place-items: center;
  grid-template-rows: 13px 26px 13px;
  width: 40px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.priority-control:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #22d3ee;
  color: #06222a;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.14);
}

.priority-step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.priority-control .priority-step {
  width: 100%;
  height: 13px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
}

.priority-step:hover,
.priority-control:focus-within .priority-step,
.icon-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.priority-control .priority-step:active {
  color: #06222a;
  background: #22d3ee;
}

.icon-btn,
.packing-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.icon-btn.start {
  color: #16a34a;
}

.icon-btn.pause {
  color: #f59e0b;
}

.packing-history {
  padding: 8px 12px 10px 54px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.worklog-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 10px;
  padding: 4px 0;
  color: var(--text);
  font-size: 0.74rem;
}

.worklog-row span:first-child {
  color: var(--muted);
}

.add-packer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.packer-job-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.packer-job-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.packer-job-row.is-dragging {
  opacity: 0.45;
}

.packer-job-row.is-drop-target {
  border-color: var(--accent);
}

.packer-job-row[draggable="true"] {
  cursor: grab;
}

.packer-job-row[draggable="true"]:active {
  cursor: grabbing;
}

.packer-job-drag {
  display: grid;
  place-items: center;
  width: 28px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.packer-job-drag.is-hidden {
  visibility: hidden;
}

.packer-job-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.packer-job-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 850;
}

.packer-job-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packer-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.packer-job-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
}

.packer-job-tie {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(214, 168, 0, 0.18);
  color: #946200;
  font-size: 0.7rem;
  font-weight: 900;
}

.context-save-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border-radius: 8px;
  font-weight: 850;
}

.tools-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1090;
  display: grid;
  width: min(420px, calc(100vw - 36px));
  gap: 10px;
}

.tools-toast-stack .alert {
  margin: 0;
}

.live-overview-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.live-overview-stage > [data-live-overview-list] {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.live-overview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.live-overview-head-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.live-overview-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.live-overview-filter {
  --overview-filter-bg: var(--surface);
  --overview-filter-fg: var(--muted);
  --overview-filter-border: var(--line);
  --overview-filter-count-bg: rgba(100, 116, 139, 0.16);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--overview-filter-border);
  border-radius: 8px;
  background: var(--overview-filter-bg);
  color: var(--overview-filter-fg);
  font-size: 0.78rem;
  font-weight: 850;
}

.live-overview-filter.is-active {
  border-color: rgba(194, 138, 44, 0.48);
  background: rgba(194, 138, 44, 0.14);
  color: var(--text);
}

/* A filter that is toggled OFF reads as dimmed/greyed so the active set is
   glanceable. `is-active` is the canonical ON marker for every filter kind
   (house-type, low-volume, on-hold/zendesk), so :not(.is-active) targets all
   off buttons. Visual-only — they stay clickable to turn back on. */
.live-overview-filter:not(.is-active) {
  opacity: 0.45;
  filter: grayscale(0.5);
}

.live-overview-filter:not(.is-active):hover,
.live-overview-filter:not(.is-active):focus-visible {
  opacity: 0.75;
}

.live-overview-filter.is-only {
  border-color: rgba(15, 118, 110, 0.48);
  background: rgba(15, 118, 110, 0.14);
}

.live-overview-filter-house-type {
  --overview-filter-bg: var(--house-type-bg);
  --overview-filter-fg: var(--house-type-fg);
  --overview-filter-border: var(--house-type-border);
  --overview-filter-count-bg: var(--house-type-bg);
}

.live-overview-filter-house-type.is-active {
  border-color: var(--house-type-border);
  background: var(--house-type-bg);
  color: var(--house-type-fg);
}

.live-overview-filter-type-full-service {
  --house-type-bg: rgba(44, 122, 73, 0.16);
  --house-type-fg: #2c7a49;
  --house-type-border: rgba(44, 122, 73, 0.42);
}

.live-overview-filter-type-hybrid {
  --house-type-bg: rgba(177, 114, 29, 0.18);
  --house-type-fg: #8a5b13;
  --house-type-border: rgba(177, 114, 29, 0.45);
}

.live-overview-filter-type-elabel {
  --house-type-bg: rgba(54, 92, 168, 0.16);
  --house-type-fg: #365ca8;
  --house-type-border: rgba(54, 92, 168, 0.42);
}

.live-overview-filter-type-elabel-only {
  --house-type-bg: rgba(94, 67, 123, 0.18);
  --house-type-fg: #5e437b;
  --house-type-border: rgba(94, 67, 123, 0.45);
}

.live-overview-filter strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--overview-filter-count-bg);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
}

.live-overview-filter i {
  font-size: 0.9rem;
}

.live-overview-filter-skeleton {
  width: 112px;
  pointer-events: none;
}

.live-overview-filter-skeleton-wide {
  width: 150px;
}

.live-overview-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.live-overview-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.live-overview-metrics strong {
  color: var(--text);
  font-size: 1rem;
}

.live-overview-board {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.live-overview-stage.is-house-selected .live-overview-board {
  flex: 0 0 auto;
  max-height: 220px;
  border-bottom: 1px solid var(--line);
}

.live-overview-stage.is-house-selected .live-overview-head {
  padding-block: 12px;
}

.live-overview-table {
  margin: 0;
  min-width: 900px;
  table-layout: fixed;
}

.live-overview-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 10px;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.live-overview-table td {
  padding: 10px;
  border-color: var(--line);
  color: var(--text);
  vertical-align: middle;
}

.live-catalog-row {
  cursor: pointer;
}

.live-house-row {
  cursor: pointer;
}

.live-house-row.is-active td {
  background: var(--accent-soft);
}

.live-loading-row {
  cursor: default;
  pointer-events: none;
}

.live-catalog-row:hover td,
.live-catalog-row.is-active td,
.live-house-row:hover td {
  background: var(--accent-soft);
}

.live-overview-table th:nth-child(2),
.live-overview-table td:nth-child(2) {
  width: 82px;
}

.live-overview-table th:nth-child(n+3),
.live-overview-table td:nth-child(n+3) {
  width: 94px;
}

.live-house-col {
  width: 280px;
}

.live-house {
  background: var(--surface-muted);
  vertical-align: top;
}

.live-house-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.live-house-name a,
.live-link-cell a {
  color: #c28a2c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.live-house-name span,
.live-agent-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.18);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

/* Icon-only house-type badge in the overview list: keeps the per-type color
   coding (the generic name-pill grey above would otherwise win). */
.live-house-name span.live-house-type-icon {
  width: 24px;
  min-height: 24px;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--house-type-border);
  border-radius: 999px;
  background: var(--house-type-bg);
  color: var(--house-type-fg);
  font-size: 0.78rem;
}

.live-house-hubs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.live-house-hub-pill {
  --hub-hue: 210;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px 1px 7px;
  border: 1px solid hsla(var(--hub-hue), 48%, 52%, 0.5);
  border-radius: 999px;
  background: hsla(var(--hub-hue), 60%, 50%, 0.1);
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 800;
}

.live-house-hub-pill .live-house-hub-count {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: hsla(var(--hub-hue), 55%, 42%, 0.92);
  color: #fff;
  font-size: 0.58rem;
  line-height: 1.4;
}

.live-house-hub-pill:hover,
.live-house-hub-pill:focus-visible {
  border-color: hsla(var(--hub-hue), 60%, 48%, 0.85);
  background: hsla(var(--hub-hue), 62%, 50%, 0.2);
  color: var(--text);
}

/* Presence avatars on a house row: compact, no pill chrome from the generic
   name-span rule, no typing bubble. */
.live-house-name span.live-row-presence {
  gap: 3px;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
}

.live-row-presence .live-presence-avatar {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  border-width: 1px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.56rem;
}

.live-agent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.live-catalog-cell {
  display: grid;
  gap: 2px;
}

.live-catalog-house-cell {
  background: var(--surface);
}

.live-catalog-house-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.live-overview-stage.is-house-selected .live-overview-table td {
  padding-block: 7px;
}

.live-house-board-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.live-house-board-main .live-context-shell {
  height: 100%;
  min-height: 0;
  /* heading · tabs · action bar · table (Origins/Hubs filters moved to the
     context pane, above the map). */
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.live-house-board-main .live-context-table-wrap {
  min-height: 0;
  overflow: auto;
}

.live-house-board-main .live-context-table {
  min-width: 920px;
}

.live-house-map {
  /* Bottom of the context pane; the job list above it flexes/scrolls, so
     dragging the top edge moves the TOP (bottom stays put). Allowed to shrink
     (0 1 auto) so the 50vh default can never overflow/clip a short pane —
     it gives way to its min-height before the list is pushed out. */
  flex: 0 1 auto;
  display: grid;
  grid-template-rows: auto auto 1fr; /* resize handle · head · map mount */
  gap: 6px;
  height: 50vh; /* default; overridden by the inline px height the drag handle sets */
  min-height: 200px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.live-house-map-resize {
  height: 8px;
  margin: -6px 0 0;
  border-radius: 0 0 4px 4px;
  background: var(--line);
  opacity: 0.55;
  cursor: ns-resize;
  touch-action: none;
}

.live-house-map-resize:hover,
.live-house-map-resize:active {
  opacity: 1;
}

.live-house-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-house-map-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Origins/Hubs filter pills, between the job list and the map; drive board + map. */
.live-house-info-filters {
  display: grid;
  gap: 8px;
}

/* Origins (left) and Hubs (right) sit in side-by-side columns so the two
   filter groups share vertical space instead of stacking into two full rows. */
.live-house-info-filters-cols {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
  flex: 0 0 auto;
}

.live-house-map-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 3px;
  border: 1px solid #fff;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.live-house-map-key-house {
  background: #c28a2c;
}

.live-house-map-key-hub {
  background: hsl(210, 70%, 45%);
}

.live-house-map-mount,
.live-house-map-canvas {
  width: 100%;
  height: 100%;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.live-house-map-tip {
  color: #222;
  font-size: 0.72rem;
  font-weight: 700;
}

.live-date-cell {
  display: grid;
  gap: 2px;
}

.live-date-cell small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.live-catalog-cell span {
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-metric-skeleton {
  position: relative;
  display: block;
  width: 100%;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--skeleton-bg);
  background-size: 220% 100%;
}

.live-metric-skeleton-short {
  display: inline-block;
  width: 44px;
  vertical-align: middle;
}

.live-metric-skeleton-text {
  width: 68%;
}

.live-metric-skeleton-wide {
  width: 86%;
}

.live-metric-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--skeleton-shimmer);
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
  transform: translateX(-100%);
}

.live-overview-table .live-skeleton-token,
.live-house-name .live-skeleton-token,
.live-catalog-cell .live-skeleton-token {
  position: relative;
  display: inline-block;
  max-width: 100%;
  min-height: 18px;
  padding: 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--skeleton-bg);
  background-size: 220% 100%;
  color: transparent;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.live-overview-table .live-skeleton-token::after,
.live-house-name .live-skeleton-token::after,
.live-catalog-cell .live-skeleton-token::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--skeleton-shimmer);
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
  transform: translateX(-100%);
}

.live-overview-table .live-skeleton-token-fill {
  display: block;
  width: 100%;
  min-height: 22px;
  text-align: center;
}

.live-house-name .live-metric-skeleton,
.live-catalog-cell .live-metric-skeleton {
  display: block;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
}

.live-house-name .live-metric-skeleton {
  height: 24px;
}

.live-catalog-cell strong .live-metric-skeleton {
  height: 18px;
}

.live-progress {
  position: relative;
  display: flex;
  align-items: center;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.18);
}

.live-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 4px;
  border-radius: inherit;
}

.live-progress strong {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 8px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.live-progress-complete .live-progress-fill {
  background: rgba(76, 125, 91, 0.76);
}

.live-progress-partial .live-progress-fill {
  background: #d6a800;
}

.live-progress-behind .live-progress-fill,
.live-progress-empty .live-progress-fill {
  background: #a9343a;
}

.empty-panel {
  display: grid;
  place-items: center;
}

.panel-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 1.8rem;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.rail-pinned {
    grid-template-columns: 1fr;
  }

  .rail {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-nav {
    display: flex;
  }

  .rail-nav-bottom {
    margin-top: 0;
  }

  .brand,
  .app-shell.rail-pinned .brand {
    width: 48px;
  }

  .brand span,
  .rail-link span,
  .app-shell.rail-pinned .brand span,
  .app-shell.rail-pinned .rail-link span {
    display: none;
  }

  .rail-toggle {
    display: none;
  }

  .rail-link,
  .app-shell.rail-pinned .rail-link {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 69px);
    overflow: visible;
    padding: 16px;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .company-picker {
    flex: 1;
  }

  .company-picker .form-select {
    width: 100%;
    min-width: 0;
  }

  .search {
    display: none;
  }

  .content-stage {
    min-height: calc(100vh - 150px);
    border-radius: 14px;
  }

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

  .workspace-frame.context-pane-closed {
    grid-template-columns: 1fr;
  }

  .main-pane {
    overflow: visible;
  }

  .context-pane {
    min-width: 0;
    min-height: 320px;
  }

  .context-resizer {
    display: none;
  }

  .widget-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .tool-widget-actions {
    justify-content: flex-start;
  }

  .notifications-menu {
    width: calc(100vw - 24px);
  }

  .scheduler-shell {
    grid-template-rows: auto minmax(240px, 1fr) auto;
  }

  .scheduler-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .scheduler-table {
    min-width: 920px;
  }

  .logs-grid,
  .celery-layout {
    grid-template-columns: 1fr;
  }

  .logs-shell {
    padding: 12px;
  }

  .manifest-email-grid {
    grid-template-columns: 1fr;
  }

  .live-hold-shell,
  .live-hold-field-grid,
  .live-hold-detail-grid {
    grid-template-columns: 1fr;
  }

  .live-hold-list-pane {
    max-height: 260px;
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .manifest-compose-fields {
    grid-template-columns: 1fr;
  }

  .events-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-import-summary,
  .catalog-import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .events-import-dropzone,
  .events-import-button,
  .events-direct-dropzone,
  .catalog-import-actions .btn {
    width: 100%;
  }

  .events-direct-dropzone {
    align-items: stretch;
    flex-direction: column;
  }

  .manifest-progress-head {
    display: grid;
  }
}

/* ---- Upload Configs panel ------------------------------------------------ */
.uploads-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
}
.uploads-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  min-height: 0;
}
.uploads-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.uploads-rail-head h1 { font-size: 1.05rem; margin: 2px 0 0; }
.uploads-list { display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.uploads-group-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 6px;
}
.uploads-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.uploads-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.uploads-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.uploads-item-name { font-weight: 600; font-size: 0.9rem; }
.uploads-badge {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(120, 130, 140, 0.18);
  color: var(--muted);
}
.uploads-badge.is-on { background: var(--accent-soft); color: var(--accent); }
.uploads-muted { color: var(--muted); font-size: 0.85rem; }

.uploads-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  overflow: auto;
  min-height: 0;
}
.uploads-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.uploads-title-input { font-size: 1.1rem; font-weight: 600; }
.uploads-editor-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.uploads-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }

.uploads-editor-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.uploads-form-col { display: flex; flex-direction: column; gap: 14px; }
.uploads-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-muted);
}
.uploads-card h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.uploads-card label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 9px; }
.uploads-card label.uploads-inline { display: inline-flex; }

.uploads-map-col h3,
.uploads-preview-col h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.uploads-section { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.uploads-section > summary {
  cursor: pointer;
  padding: 9px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.uploads-scope { font-size: 0.6rem; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; }
.uploads-map-table { width: 100%; border-collapse: collapse; }
.uploads-map-table td { padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.uploads-field-label { width: 38%; font-size: 0.82rem; }
.uploads-field-label code { display: block; font-size: 0.66rem; color: var(--muted); }
.uploads-kind { width: 110px; }
.uploads-flow-args { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.uploads-arg span { display: block; font-size: 0.68rem; color: var(--muted); }

.uploads-preview-col { position: sticky; top: 0; }
.uploads-dropzone {
  border: 1.5px dashed var(--dropzone-border);
  border-radius: 12px;
  background: var(--dropzone-bg);
  padding: 18px;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s;
}
.uploads-dropzone.is-drag { border-color: var(--dropzone-border-active); background: var(--dropzone-bg-active); }
.uploads-dropzone i { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.uploads-dropzone p { font-size: 0.8rem; margin: 0 0 10px; }
.uploads-preview { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.uploads-preview-row { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--surface-muted); }
.uploads-preview-head { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; flex-wrap: wrap; }
.uploads-preview-head span { color: var(--muted); }
.uploads-chip { font-size: 0.62rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.uploads-preview-items { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; }
.uploads-row-issues { margin-top: 6px; font-size: 0.72rem; color: #b45309; }
.uploads-issues { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.uploads-issues li { font-size: 0.76rem; padding: 6px 9px; border-radius: 8px; background: rgba(180, 83, 9, 0.12); color: #b45309; }
.uploads-issues li.sev-error { background: rgba(220, 38, 38, 0.14); color: #dc2626; }

@media (max-width: 1180px) {
  .uploads-editor-grid { grid-template-columns: 1fr; }
  .uploads-preview-col { position: static; }
}

/* House board presence: other users currently viewing this board. Avatar pops
   in with an iMessage-style typing bubble (three dots pulsing in sequence). */
.live-presence {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-right: 4px;
}

.live-presence-viewer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: live-presence-pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.live-presence-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--panel, #fff);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  user-select: none;
}

.live-presence-typing {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 999px;
  border-bottom-left-radius: 4px;
  background: var(--surface-2, #e9ecf1);
}

.live-presence-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted, #8a93a3);
  animation: live-presence-dot 1.2s ease-in-out infinite;
}

.live-presence-typing i:nth-child(2) { animation-delay: 0.15s; }
.live-presence-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes live-presence-dot {
  0%, 60%, 100% { opacity: 0.35; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.05); }
}

@keyframes live-presence-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.85); }
}

@media (prefers-reduced-motion: reduce) {
  .live-presence-viewer { animation: none; }
  .live-presence-typing i { animation: none; opacity: 0.7; }
}

/* Agent Pay panel: InvoiceDetails summarized by AP date. */
.agent-pay-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.agent-pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-pay-head h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
}

.agent-pay-scope {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2, #e9ecf1);
  color: var(--muted, #5d6675);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.agent-pay-board {
  overflow: auto;
  min-height: 0;
}

.agent-pay-table {
  margin: 0;
}

.agent-pay-table th,
.agent-pay-table td {
  white-space: nowrap;
}

.agent-pay-table .agent-pay-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.agent-pay-table tfoot th {
  border-top: 2px solid var(--line, #d8dde4);
}

.agent-pay-row {
  cursor: pointer;
}

.agent-pay-row:hover {
  background: var(--surface-2, #e9ecf1);
}

.agent-pay-row:focus-visible {
  outline: 2px solid var(--accent, #2f6fed);
  outline-offset: -2px;
}

.agent-pay-row.is-active {
  background: var(--surface-2, #e9ecf1);
  background: color-mix(in srgb, var(--accent, #2f6fed) 12%, transparent);
}

/* ---- Agent Pay context pane (AP-date breakdown) --------------------------- */

.ap-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.ap-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ap-detail-date {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
}

.ap-detail-total {
  text-align: right;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.ap-detail-total-pay {
  font-size: 1.1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ap-detail-total small {
  color: var(--muted, #5d6675);
}

.ap-detail-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  min-height: 0;
}

.ap-house {
  border: 1px solid var(--line, #d8dde4);
  border-radius: 8px;
  overflow: hidden;
}

.ap-house-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.ap-house-summary::-webkit-details-marker {
  display: none;
}

.ap-house-summary::before {
  content: "\F285";
  font-family: "bootstrap-icons";
  font-weight: 400;
  color: var(--muted, #5d6675);
  margin-right: 2px;
  transition: transform 0.15s ease;
}

.ap-house[open] > .ap-house-summary::before {
  transform: rotate(90deg);
}

.ap-house-summary:hover {
  background: var(--surface-2, #e9ecf1);
}

.ap-house-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-house-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 0 0 auto;
}

.ap-house-count {
  color: var(--muted, #5d6675);
  font-weight: 600;
  font-size: 0.82rem;
}

.ap-house-pay {
  font-variant-numeric: tabular-nums;
}

.ap-jobs-table {
  margin: 0;
  font-size: 0.82rem;
}

.ap-jobs-table th,
.ap-jobs-table td {
  white-space: nowrap;
  padding: 4px 8px;
}

.ap-jobs-table .agent-pay-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ap-jobs-table .ap-job-id {
  font-variant-numeric: tabular-nums;
}

.ap-catalog-row td {
  background: var(--surface-2, #e9ecf1);
}

.ap-catalog-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ap-catalog-title {
  color: var(--muted, #5d6675);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-catalog-meta {
  margin-left: auto;
  color: var(--muted, #5d6675);
  font-variant-numeric: tabular-nums;
}

/* ---- Dashboards panel ----------------------------------------------------- */

.dashboards-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.dashboards-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboards-head-detail {
  align-items: flex-start;
}

.dashboards-head h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
}

.dashboards-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboards-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboards-back:hover {
  color: var(--accent);
}

.dashboards-count {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.dashboards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--glass-highlight);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.dashboard-card-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.25rem;
}

.dashboard-card-body {
  min-width: 0;
}

.dashboard-card-body h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.dashboard-card-body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.dashboard-card-go {
  margin-left: auto;
  color: var(--muted);
}

.dashboards-table-wrap {
  overflow: auto;
  min-height: 0;
}

.dashboards-table {
  margin: 0;
  font-size: 0.86rem;
}

.dashboards-table th,
.dashboards-table td {
  white-space: nowrap;
}

.dashboards-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--app-bg);
}

/* Ready-to-Ship inline shipping controls (allowlisted operators). */
.ship-cell {
  white-space: nowrap;
}

.ship-controls,
.ship-booked-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ship-chip {
  padding: 1px 7px;
  border: 1px solid var(--border, #d5d9e0);
  border-radius: 999px;
  background: var(--surface, #fff);
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: nowrap;
}

.ship-btn {
  padding: 1px 9px;
  border: 1px solid var(--bs-primary, #0d6efd);
  border-radius: 6px;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.5;
  cursor: pointer;
}

.ship-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.ship-select {
  max-width: 15rem;
  padding: 2px 6px;
  border: 1px solid var(--border, #d5d9e0);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: inherit;
  font-size: 0.74rem;
  line-height: 1.4;
}

.ship-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--border, #d5d9e0);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: inherit;
  cursor: pointer;
}

.ship-icon:disabled {
  opacity: 0.45;
  cursor: default;
}

.ship-icon.is-done {
  border-color: var(--bs-success, #198754);
  color: var(--bs-success, #198754);
}

.ship-icon.is-busy {
  opacity: 0.6;
}

.ship-pro {
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  font-size: 0.74rem;
}

.ship-booked,
.ship-booked-wrap .live-docs-single {
  color: var(--bs-danger, #dc3545);
}

.ship-error {
  color: var(--bs-secondary, #6c757d);
}

.live-presence-viewer.is-self .live-presence-avatar {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 0 0 2px #4d7fae66;
}

/* ---- Packed Dims modal ---------------------------------------------------- */

.live-packing-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 10px;
  border: 1px solid var(--accent, #0f766e);
  border-radius: 999px;
  background: var(--accent-soft, rgba(15, 118, 110, 0.12));
  color: var(--accent, #0f766e);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  /* Hover-reveal, like .live-not-picked-up. */
  opacity: 0;
  transition: opacity 0.12s ease;
}

.live-context-table tbody tr:hover .live-packing-open,
.live-context-table tbody tr:focus-within .live-packing-open {
  opacity: 1;
}

.live-packing-open:hover {
  background: var(--accent, #0f766e);
  color: #fff;
}

.live-packing-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.live-packing-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.live-packing-kicker {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-packing-job {
  font-size: 1.05rem;
  font-weight: 800;
}

.live-packing-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.live-packing-buyer {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: auto;
  text-align: right;
}

.live-packing-buyer strong {
  font-size: 1.1rem;
  line-height: 1.25;
}

.live-packing-buyer span + span,
.live-packing-buyer strong + span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.live-packing-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-packing-clock {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 1.05rem;
  cursor: pointer;
}

.live-packing-clock:hover:not(:disabled) {
  color: var(--accent, #0f766e);
  border-color: var(--accent, #0f766e);
}

.live-packing-clock:disabled {
  opacity: 0.4;
  cursor: default;
}

.live-packing-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 12px;
  z-index: 10;
  width: min(440px, 92vw);
  max-height: 250px;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.live-packing-pop-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.76rem;
}

.live-packing-pop-row:last-child {
  border-bottom: 0;
}

.live-packing-pop-when {
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.live-packing-pop-dims {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live-packing-pop-muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.live-packing-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.live-packing-pill.is-initial {
  border-style: dashed;
  color: var(--muted);
}

.live-packing-pill.is-change {
  border-color: var(--accent, #0f766e);
  color: var(--accent, #0f766e);
}

.live-packing-ship-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-packing-caption {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-packing-lots {
  margin: 0 0 14px;
  max-height: 168px;
  overflow-y: auto;
}

.live-packing-lot {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.8rem;
}

.live-packing-lot:last-child {
  border-bottom: 0;
}

.live-packing-lot-num {
  flex: 0 0 auto;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
}

.live-packing-lot-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.live-packing-lot-dims {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live-packing-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
}

.live-packing-controls.is-inert {
  opacity: 0.55;
  pointer-events: none;
}

.live-packing-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.live-packing-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.live-packing-seg-btn + .live-packing-seg-btn {
  border-left: 1px solid var(--line);
}

.live-packing-seg-btn.is-active {
  background: var(--accent, #0f766e);
  color: #fff;
}

.live-packing-seg-btn small {
  font-size: 0.64rem;
  font-weight: 750;
  opacity: 0.85;
}

.live-packing-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.live-packing-stepper > button {
  width: 48px;
  border: 0;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
}

.live-packing-stepper > button:hover {
  background: var(--accent, #0f766e);
  color: #fff;
}

.live-packing-stepper-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.live-packing-stepper-mid input {
  width: 64px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 850;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.live-packing-stepper-mid input::-webkit-outer-spin-button,
.live-packing-stepper-mid input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.live-packing-stepper-mid small {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-packing-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-packing-rowx {
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) 0.7fr 1fr 1fr 1fr 1.1fr;
  gap: 8px;
  align-items: center;
}

.live-packing-grid-head span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-packing-rowx input,
.live-packing-rowx select {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.live-packing-rowx select,
.live-packing-rowx input[type="text"] {
  font-size: 0.9rem;
}

.live-packing-rowx input::placeholder {
  color: var(--muted);
  opacity: 0.7;
  font-weight: 650;
}

.live-packing-rowx input:focus,
.live-packing-rowx select:focus {
  border-color: var(--accent, #0f766e);
  outline: 2px solid var(--accent-soft, rgba(15, 118, 110, 0.25));
}

.live-packing-save-bar {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}

.live-packing-save {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: var(--accent, #0f766e);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.live-packing-save:not(:disabled):hover {
  filter: brightness(1.07);
}

.live-packing-save:disabled {
  opacity: 0.55;
  cursor: default;
}

.live-packing-save.is-saved {
  background: #2e7d32;
  opacity: 1;
}

.live-packing-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-packing-confirm-msg {
  flex: 1;
  font-weight: 800;
  color: #b42318;
}

.live-packing-confirm .live-packing-save {
  width: auto;
  min-height: 44px;
  padding: 0 26px;
}

.live-packing-discard {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.live-packing-discard:hover {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.5);
}

.live-packing-shimmer {
  display: inline-block;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-muted), var(--line), var(--surface-muted));
  background-size: 200% 100%;
  animation: live-packing-shimmer 1.2s linear infinite;
}

@keyframes live-packing-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .live-packing-shimmer {
    animation: none;
  }
}

.live-packing-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--muted);
  font-weight: 650;
}

.live-packing-error p {
  margin: 0;
}

@media (max-width: 640px) {
  .live-packing-buyer {
    margin-left: 0;
    text-align: left;
  }

  .live-packing-rowx {
    grid-template-columns: minmax(90px, 1.2fr) 0.7fr 1fr 1fr 1fr 1fr;
    gap: 5px;
  }
}

/* ---- Quotes panel (public SPA quoter) ------------------------------------ */

.quotes-stage {
  overflow-y: auto;
}

.quotes-root {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 4px 48px;
}

.quotes-head {
  margin: 18px 0 22px;
}

.quotes-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.quotes-title {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.quotes-subtitle {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 15px;
}

.quotes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 18px;
  align-items: start;
}

.quotes-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quotes-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}

.quotes-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.quotes-card-head h2 {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.quotes-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.quotes-step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* Pickup constants: a muted aside that stays out of the input flow. */
.quotes-aside {
  position: sticky;
  top: 8px;
  background: var(--surface-muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  color: var(--muted);
}

.quotes-aside h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.quotes-aside address {
  margin: 0 0 10px;
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.5;
}

.quotes-aside p {
  margin: 0;
  font-size: 12.5px;
}

/* Search-style pickup: a wider right column holds the live dealer candidates,
   which refresh as the operator types into any pickup field. */
.quotes-layout.has-dealer-pane {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.quotes-dealer-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.quotes-dealer-pane.is-invalid {
  border-style: solid;
  border-color: #dc3545;
}

.quotes-dealer-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.quotes-dealer-hint {
  margin: 2px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.quotes-dealer-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}

button.quotes-dealer-card:hover,
button.quotes-dealer-card:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.quotes-dealer-card.is-selected {
  cursor: default;
  border-color: #198754;
  background: rgba(25, 135, 84, 0.06);
}

.quotes-dealer-picked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #198754;
}

.quotes-dealer-co {
  font-size: 13.5px;
  font-weight: 700;
}

.quotes-dealer-name {
  font-size: 12.5px;
  color: var(--text);
}

.quotes-dealer-addr {
  font-size: 12px;
  color: var(--muted);
}

.quotes-dealer-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

.quotes-span-2 { grid-column: span 2; }
.quotes-span-4 { grid-column: span 4; }

.quotes-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.quotes-field span {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.quotes-required > span::after {
  content: " *";
  color: var(--accent);
}

.quotes-field input,
.quotes-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.quotes-field input:focus,
.quotes-field textarea:focus,
.quotes-lot-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.quotes-field input.quotes-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.quotes-check {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: end;
  padding-bottom: 9px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.quotes-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quotes-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

/* Form layer. With a carousel it floats above the lot images on a translucent
   panel so inputs stay readable; on "peek" (carousel scroll) it fades to near
   zero so the photo shows through, then transitions back. */
.quotes-item-content {
  position: relative;
  z-index: 1;
  padding: 12px 14px 14px;
  border-radius: inherit;
}

.quotes-item.has-carousel {
  min-height: 220px;
}

.quotes-item.has-carousel .quotes-item-content {
  transition: opacity 0.4s ease;
}

.quotes-item.has-carousel .quotes-item-content::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface-muted);
  opacity: 0.9;
  border-radius: inherit;
}

.quotes-item.has-carousel.is-peeking .quotes-item-content {
  opacity: 0.12;
}

/* Background image carousel */
.quotes-item-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--surface-muted);
}

.quotes-item-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.quotes-item-slide.is-active {
  opacity: 1;
}

.quotes-item-carousel-nav {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
}

.quotes-carousel-arrow {
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.quotes-carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.18);
}

.quotes-carousel-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.quotes-carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.quotes-carousel-dot.is-active {
  background: #fff;
}

.quotes-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.quotes-item-index {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.quotes-item-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.quotes-item-remove:hover:not(:disabled) {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.quotes-item-remove:disabled {
  opacity: 0.35;
  cursor: default;
}

.quotes-lot-search {
  position: relative;
  margin-bottom: 10px;
}

.quotes-lot-search > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.quotes-lot-search input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}

.quotes-lot-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 4px;
}

.quotes-lot-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.quotes-lot-option:hover,
.quotes-lot-option:focus-visible {
  background: var(--accent-soft);
}

.quotes-lot-option img,
.quotes-lot-thumb {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.quotes-lot-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.quotes-lot-copy strong {
  font-size: 13.5px;
}

.quotes-lot-copy small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quotes-lot-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.quotes-item-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.quotes-item-dims {
  display: grid;
  grid-template-columns: repeat(6, minmax(64px, 1fr));
  gap: 8px;
  min-width: 0;
}

/* Estimated packed crate size (per item) — restored legacy readout. */
.quotes-item-packed {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 16px;
  margin: 0;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.quotes-item-packed i {
  margin-right: 4px;
  color: var(--accent);
}

.quotes-item-packed strong {
  color: var(--text);
  font-weight: 700;
}

.quotes-item-packed small {
  font-weight: 400;
  opacity: 0.8;
}

.quotes-item-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.quotes-item-checks .quotes-check {
  align-self: center;
  padding-bottom: 0;
}

.quotes-item-notes {
  margin-top: 10px;
}

.quotes-add-item {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}

.quotes-add-item:hover {
  background: var(--accent-soft);
}

.quotes-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quotes-submit {
  align-self: flex-start;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.quotes-submit:hover:not(:disabled) {
  filter: brightness(1.06);
}

.quotes-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.quotes-errors {
  border: 1px solid rgba(220, 53, 69, 0.4);
  background: rgba(220, 53, 69, 0.08);
  color: #b02a37;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
}

[data-bs-theme="dark"] .quotes-errors {
  color: #f1aeb5;
}

.quotes-result-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.quotes-result-ok { border-left: 4px solid #198754; }
.quotes-result-warn { border-left: 4px solid #ffc107; }
.quotes-result-info { border-left: 4px solid #0d6efd; }
.quotes-result-bad { border-left: 4px solid #dc3545; }

.quotes-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quotes-result-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Certification verdict badge — the certified / needs-check confirmation. */
.quotes-result-cert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.quotes-cert-ok   { background: rgba(25, 135, 84, 0.12); color: #198754; }
.quotes-cert-warn { background: rgba(255, 193, 7, 0.18); color: #8a6d00; }
.quotes-cert-info { background: rgba(13, 110, 253, 0.12); color: #0d6efd; }
.quotes-cert-bad  { background: rgba(220, 53, 69, 0.12); color: #dc3545; }

.quotes-result-total {
  margin: 2px 0 4px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.quotes-result-status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13.5px;
}

.quotes-result-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-bottom: 10px;
}

.quotes-result-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text);
}

.quotes-result-job {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .quotes-layout,
  .quotes-layout.has-dealer-pane {
    grid-template-columns: 1fr;
  }

  .quotes-aside {
    position: static;
    order: -1;
  }

  /* The dealer candidates belong with the pickup fields, not above the form. */
  .quotes-dealer-pane {
    order: 0;
    max-height: none;
  }

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

  .quotes-span-2,
  .quotes-span-4 {
    grid-column: span 2;
  }

  .quotes-item-dims {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }
}

/* ---- Editable ProNum (allowlisted board operators) ----------------------- */

.live-pro-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-pro-edit {
  width: 11rem;
  padding: 2px 8px;
  border: 1px solid var(--border, #d5d9e0);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: inherit;
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  font-size: 0.78rem;
  line-height: 1.4;
}

.live-pro-edit:focus {
  outline: none;
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.live-pro-edit:disabled {
  opacity: 0.55;
}

.live-pro-provider {
  padding: 2px 6px;
  border: 1px solid var(--border, #d5d9e0);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: inherit;
  font-size: 0.74rem;
  line-height: 1.4;
  max-width: 6.5rem;
}

.live-pro-provider:focus {
  outline: none;
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.live-pro-provider:disabled {
  opacity: 0.55;
}

/* A keyed pro with no carrier yet — prompt the operator to pick one. */
.live-pro-provider.is-unset {
  border-color: var(--bs-warning, #f0ad4e);
  background: rgba(240, 173, 78, 0.12);
}
