/* Smooth fade between pages in browsers that support cross-document view
   transitions (Chrome / Edge 126+, Safari TP). Browsers that don't support
   it just navigate normally — no flash, no fallback issues. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 140ms;
  animation-timing-function: ease-out;
}

:root {
  --global-bar-height: 74px;
  --bg: #f6f6f7;
  --bg-muted: #f6f6f7;
  --surface: #ffffff;
  --surface-subtle: #fbfbfb;
  --surface-hover: #f8f8f8;
  --surface-dark: #1f1f1f;
  --surface-dark-soft: #303030;
  --text: #303030;
  --text-strong: #1a1a1a;
  --muted: #616161;
  --muted-soft: #8a8a8a;
  --border: #d1d4d6;
  --border-strong: #c4c7c9;
  --primary: #008060;
  --primary-dark: #006e52;
  --danger: #d82c0d;
  --warning: #eab301;
  --warning-bg: #ffe58f;
  --warning-text: #5c4200;
  --neutral-pill-bg: #ececec;
  --shadow-sm: 0 1px 0 rgba(22, 29, 37, 0.04), 0 1px 3px rgba(22, 29, 37, 0.08);
  --shadow-md: 0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px rgba(63, 63, 68, 0.15);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, p, pre {
  margin: 0;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #5c6ac4;
  box-shadow: 0 0 0 1px #5c6ac4;
}

input::placeholder,
textarea::placeholder {
  color: #8c9196;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.62rem 1rem;
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--surface-dark);
  color: #fff;
}

.btn-primary:hover {
  background: #111213;
}

.btn-secondary {
  background: #f3f3f3;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: #ececec;
}

.btn-tertiary {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
}

.btn-tertiary:hover {
  background: #f6f6f7;
}

.alert {
  border-radius: 14px;
  border: 1px solid #bcd9ff;
  background: #edf4ff;
  color: #1f5199;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
}

.alert-danger {
  border-color: #f0b8b2;
  background: #fff1ef;
  color: #8a1f11;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 28px;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-muted {
  background: var(--neutral-pill-bg);
  color: #616161;
}

.badge-danger {
  background: #fff1ef;
  color: var(--danger);
}

.badge-warning,
.badge-shop-warn {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-success {
  background: #e3f1df;
  color: #0e6438;
}

.badge-shop-neutral {
  background: var(--neutral-pill-bg);
  color: #4a4a4a;
}

.badge-shop-fulfilled {
  background: #ededed;
  color: #5c5f62;
}

.badge-shop-unfulfilled {
  background: #ffe47a;
  color: #5a4b00;
}

.badge-shop-partial {
  background: #ffd29a;
  color: #6c4b00;
}

.badge-shop-restocked {
  background: #e8f4ea;
  color: #17603a;
}

.badge-shop-delivery-neutral {
  background: #ececec;
  color: #5f6164;
}

.badge-shop-delivery-info {
  background: #cae8ff;
  color: #0b4f71;
}

.badge-shop-delivery-success {
  background: #d8f5d0;
  color: #166534;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.app-shell {
  min-height: 100vh;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.global-bar {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface-dark);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.global-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #95bf47, #5c8631);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.brand-wordmark {
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.global-search input {
  min-height: 42px;
  padding-left: 2.65rem;
  padding-right: 3rem;
  border-color: rgba(255, 255, 255, 0.12);
  background: #303030;
  color: #fff;
}

.global-search input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.global-search-icon,
.keyboard-hint {
  position: absolute;
  color: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.global-search-icon {
  left: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.keyboard-hint {
  right: 0.9rem;
  border-radius: 7px;
  padding: 0.14rem 0.38rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

.global-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  justify-self: end;
  white-space: nowrap;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.92rem;
}

.account-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #36cfc9;
  color: #073b37;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
}

.sidebar {
  position: sticky;
  top: var(--global-bar-height);
  height: calc(100vh - var(--global-bar-height));
  overflow: auto;
  align-self: start;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 1.5rem;
  padding: 1rem 0.8rem;
  background: var(--bg-muted);
  border-right: 1px solid var(--border);
}

.sidebar-section {
  display: grid;
  gap: 0.45rem;
}

.sidebar-label {
  padding: 0 0.7rem;
  color: #8a8a8a;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: grid;
  gap: 0.1rem;
}

.sidebar-nav a,
.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 44px;
  padding: 0.62rem 0.95rem;
  border-radius: 14px;
  color: #4a4a4a;
  font-weight: 600;
}

.sidebar-nav a:hover,
.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.8);
}

.sidebar-nav a.active {
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d7175;
  flex: none;
}

.nav-svg {
  width: 21px;
  height: 21px;
  display: block;
}

.sidebar-nav a.active .nav-icon,
.sidebar-logout:hover .nav-icon,
.sidebar-nav a:hover .nav-icon {
  color: #303030;
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45rem;
  height: 1.95rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: #e8e8e8;
  color: #6d7175;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
}

.sidebar-nav a.active .nav-count {
  background: #ececec;
  color: #585858;
}

.sidebar-footer {
  align-self: end;
  padding-top: 1rem;
}

.dashboard-main {
  min-width: 0;
  padding: 1.4rem;
  display: grid;
  align-content: start;
  gap: 1rem;
  background: var(--bg);
}

.page-toolbar,
.section-head,
.summary-meta,
.table-actions,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-heading {
  display: grid;
  gap: 0.45rem;
}

.page-heading-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.page-heading h1 {
  font-size: clamp(1.4rem, 0.9vw + 1.1rem, 1.65rem);
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.page-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #efefef;
  color: #4a4a4a;
  font-size: 0.9rem;
  font-weight: 600;
}

.page-actions,
.action-cluster,
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.card,
.lookup-card,
.status-summary-card,
.auth-panel,
.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card,
.lookup-card,
.status-summary-card,
.surface-card {
  padding: 1.25rem;
}

.card-grid,
.metrics-grid,
.split-grid,
.detail-grid,
.form-grid,
.filters-grid {
  display: grid;
  gap: 1rem;
}

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

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

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

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after,
.summary-tile::after {
  content: "";
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 72px;
  height: 22px;
  opacity: 0.7;
  background:
    radial-gradient(circle at 12% 68%, #29a3ff 0 2px, transparent 3px),
    radial-gradient(circle at 28% 42%, #29a3ff 0 2px, transparent 3px),
    radial-gradient(circle at 46% 74%, #29a3ff 0 2px, transparent 3px),
    radial-gradient(circle at 64% 30%, #29a3ff 0 2px, transparent 3px),
    radial-gradient(circle at 82% 54%, #29a3ff 0 2px, transparent 3px);
}

.metric-card span,
.summary-tile span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.metric-card strong,
.summary-tile strong {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-strong);
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.metric-card small,
.summary-tile small {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted-soft);
}

.speed-meter-card {
  position: relative;
  overflow: visible;
  background: var(--surface);
}

.speed-meter-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
}

.speed-meter-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.speed-meter-panel h2 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.speed-meter-topbar p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 52ch;
  margin-top: 0.15rem;
}

.speed-filter-toolbar {
  position: relative;
}

.speed-range-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 190px;
  min-height: 40px;
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.speed-range-trigger-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.speed-range-trigger-copy svg,
.speed-range-trigger-caret {
  width: 16px;
  height: 16px;
  flex: none;
}

.speed-range-popover {
  position: absolute;
  top: calc(100% + 0.8rem);
  /* Anchor to the trigger's right edge. The trigger lives in a right-aligned
     header cluster, so left-anchoring pushed the 680px dialog off the right of
     the viewport (second calendar + Apply/Cancel clipped). Right-anchoring
     opens it leftward so the whole dialog stays on screen. */
  right: 0;
  left: auto;
  z-index: 60;
  width: min(680px, calc(100vw - 3rem));
}

/* While the date-range popover is open, lift its whole card above the cards
   below (each .speed-meter-panel is its own z-index:1 stacking context, so the
   popover's z-index alone can't escape past a later card). */
.speed-meter-card:has(.speed-range-popover:not([hidden])) {
  z-index: 70;
}

.speed-range-dialog {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(27, 39, 32, 0.12);
  background: #fff;
  box-shadow: 0 22px 50px rgba(23, 33, 28, 0.18), 0 2px 10px rgba(23, 33, 28, 0.08);
}

.speed-range-sidebar {
  display: grid;
  align-content: start;
  background: #f7f7f7;
  border-right: 1px solid #e4e5e7;
}

.speed-range-sidebar-section {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid #e4e5e7;
}

.speed-range-sidebar-section:last-child {
  border-bottom: none;
}

.speed-range-preset {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: #313335;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.speed-range-preset:hover {
  background: rgba(0, 0, 0, 0.04);
}

.speed-range-preset.is-active {
  background: #e6e6e6;
}

.speed-range-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  overflow-x: auto;
}

.speed-range-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.1rem 0.7rem;
}

.speed-range-input {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  border-radius: 11px;
  border: 1px solid #b7babd;
  color: #2f3235;
  font-size: 0.9rem;
  font-weight: 600;
}

.speed-range-arrow {
  color: #8a8d91;
  font-size: 1.3rem;
}

.speed-range-calendars {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0 0.8rem 0.85rem;
  min-width: 0;
  overflow-y: auto;
  max-height: 500px;
}

.speed-range-nav {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #727579;
  font-size: 1.3rem;
  cursor: pointer;
}

.speed-range-nav:hover {
  background: rgba(0, 0, 0, 0.04);
}

.speed-range-calendar-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
}

@media (max-width: 600px) {
  .speed-range-calendar-panels {
    grid-template-columns: 1fr;
  }
}

.speed-range-calendar {
  display: grid;
  gap: 0.55rem;
}

.speed-range-month-head {
  text-align: center;
  color: #313335;
  font-size: 0.9rem;
  font-weight: 700;
}

.speed-range-weekdays,
.speed-range-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.speed-range-weekdays span {
  padding: 0.2rem 0;
  color: #6d7175;
  font-size: 0.76rem;
  text-align: center;
}

.speed-range-day-spacer,
.speed-range-day {
  min-height: 34px;
  border-radius: 10px;
}

.speed-range-day-spacer {
  visibility: hidden;
}

.speed-range-day {
  border: none;
  background: transparent;
  color: #36383b;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.speed-range-day:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* In-between days: a clearly visible band (the old #ededed was almost
   invisible on white). The box-shadow pair paints the band into the 0.25rem
   grid gap on each side so the range reads as one continuous bar rather than
   disconnected squares. */
.speed-range-day.is-in-range {
  background: #d8dee8;
  border-radius: 0;
  box-shadow: -0.28rem 0 0 0 #d8dee8, 0.28rem 0 0 0 #d8dee8;
}

.speed-range-day.is-range-start,
.speed-range-day.is-range-end {
  background: #313131;
  color: #fff;
}

/* Extend the band from each endpoint toward the middle so the dark start/end
   caps connect flush to the band with no white sliver in the gap. */
.speed-range-day.is-range-start {
  border-radius: 10px 0 0 10px;
  box-shadow: 0.28rem 0 0 0 #d8dee8;
}

.speed-range-day.is-range-end {
  border-radius: 0 10px 10px 0;
  box-shadow: -0.28rem 0 0 0 #d8dee8;
}

/* Single-day selection: a lone rounded cap, no band to bridge. */
.speed-range-day.is-range-start.is-range-end {
  border-radius: 10px;
  box-shadow: none;
}

.speed-range-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid #e7e7e7;
  background: #fff;
}

.speed-meter-wrap {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}

.speed-meter-wrap-shell {
  position: relative;
  min-height: 0;
}

.speed-meter-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: stretch;
  z-index: 2;
}

.speed-meter-card.is-loading .speed-meter-loading {
  display: grid;
}

.speed-meter-card.is-loading [data-speed-live-content] {
  visibility: hidden;
}

.speed-meter-loading-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1.1rem;
  width: 100%;
  align-items: center;
}

.speed-meter-loading-meter,
.speed-meter-loading-side {
  height: 100%;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  box-shadow: none;
}

.speed-meter-loading-meter {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.6rem;
  padding: 0;
}

.speed-meter-loading-side {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 0;
}

.speed-meter-loading-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.speed-meter-loading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.speed-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(225, 231, 226, 0.9) 0%, rgba(241, 245, 242, 0.95) 50%, rgba(225, 231, 226, 0.9) 100%);
  background-size: 200% 100%;
  animation: speed-skeleton-shimmer 1.2s linear infinite;
}

.speed-skeleton-arc {
  width: min(100%, 150px);
  height: 90px;
  border-radius: 999px 999px 16px 16px;
}

.speed-skeleton-score {
  width: 80px;
  height: 26px;
}

.speed-skeleton-caption {
  width: 130px;
  height: 12px;
}

.speed-skeleton-pill {
  width: 96px;
  height: 22px;
  border-radius: 999px;
}

.speed-skeleton-average {
  width: 130px;
  height: 30px;
}

.speed-skeleton-copy {
  width: min(100%, 320px);
  height: 28px;
}

.speed-skeleton-stat {
  min-height: 58px;
}

@keyframes speed-skeleton-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.speed-meter-visual {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  max-width: 170px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.speed-meter-headline {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.speed-meter-svg {
  width: 100%;
  height: auto;
  display: block;
}

.speed-meter-track,
.speed-meter-value {
  fill: none;
  stroke-width: 20;
  stroke-linecap: round;
}

.speed-meter-track {
  stroke: rgba(21, 35, 28, 0.08);
}

.speed-meter-value {
  stroke: var(--speed-accent);
}

.speed-meter-needle {
  stroke: #1f2f27;
  stroke-width: 5;
  stroke-linecap: round;
}

.speed-meter-pivot {
  fill: #1f2f27;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4;
}

.speed-meter-readout {
  margin-top: -1rem;
  display: grid;
  gap: 0.1rem;
  justify-items: center;
  text-align: center;
}

.speed-meter-readout strong {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.speed-meter-readout span {
  color: var(--primary);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.speed-meter-readout small {
  color: var(--muted);
  font-size: 0.66rem;
}

.speed-meter-scale {
  display: none;
}

.speed-meter-side {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.speed-meter-headline strong {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.speed-meter-headline small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
  max-width: 50ch;
}

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

.speed-stat {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  box-shadow: none;
  min-width: 0;
}

.speed-stat span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.speed-stat strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.speed-stat small {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.summary-tile {
  position: relative;
  padding: 1.15rem 1.2rem;
  border-right: 1px solid var(--border);
}

.summary-tile:last-child {
  border-right: none;
}

.orders-shell {
  padding: 0;
  overflow: hidden;
}

.products-shell {
  padding: 0;
  overflow: hidden;
}

.products-dashboard-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid #e3e3e3;
  background: #fff;
  margin-bottom: 1rem;
}

.products-kpi {
  padding: 1rem 1.1rem;
  border-right: 1px solid #ececec;
}

.products-kpi:last-child {
  border-right: none;
}

.products-kpi span {
  display: block;
  color: #60646a;
  font-size: 0.92rem;
  font-weight: 600;
}

.products-kpi strong {
  display: block;
  margin-top: 0.3rem;
  color: #24282d;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.products-kpi small {
  display: block;
  margin-top: 0.25rem;
  color: #7b8087;
}

.shop-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #ececec;
}

.filter-leading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.view-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.3rem 0.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text-strong);
  font-size: 0.95rem;
  font-weight: 700;
  flex: none;
}

.filter-icon {
  position: absolute;
  left: 4.9rem;
  color: #8c9196;
  font-size: 1rem;
}

.filter-leading input {
  width: 100%;
  padding-left: 1.9rem;
  background: transparent;
  border: none;
  min-height: 32px;
  font-size: 0.95rem;
}

.filter-leading input:focus {
  box-shadow: none;
}

.filter-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  flex: none;
}

.filter-controls select {
  width: auto;
  min-width: 190px;
  min-height: 48px;
  border-radius: 14px;
  background: #fbfbfb;
  font-size: 0.95rem;
}

.shop-table-actions {
  padding: 1rem;
  border-bottom: 1px solid #ececec;
}

.bulk-select {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.bulk-select select {
  width: auto;
  min-width: 290px;
  min-height: 48px;
  border-radius: 14px;
  background: #fff;
}

.table-meta {
  color: var(--muted-soft);
  font-size: 0.92rem;
}

.shop-table-wrap {
  overflow-x: auto;
}

.variant-supplier-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.variant-ops-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.shop-table.variant-ops-table {
  min-width: 1180px;
  font-size: 0.92rem;
}

.variant-ops-table th,
.variant-ops-table td {
  padding: 0.34rem 0.58rem;
  vertical-align: middle;
}

.variant-ops-table thead th {
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
  white-space: nowrap;
}

.variant-ops-table tbody tr {
  min-height: 0;
}

.variant-ops-table td strong {
  line-height: 1.1;
}

.variant-ops-table td small {
  margin-top: 0.04rem;
  line-height: 1.08;
  font-size: 0.82rem;
}

.variant-ops-table .fulfillment-status-pill {
  min-height: 28px;
  padding: 0.28rem 0.78rem 0.28rem 0.8rem;
  font-size: 0.8rem;
}

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

.shop-table {
  min-width: 1320px;
  background: var(--surface);
}

th,
td {
  padding: 0.62rem 0.85rem;
  border-bottom: 1px solid #ececec;
  text-align: left;
  vertical-align: middle;
}

thead th {
  background: #fafafa;
  color: #666b70;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  padding-top: 0.76rem;
  padding-bottom: 0.76rem;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.shop-table tbody tr {
  min-height: 48px;
}

.products-table tbody tr {
  height: 70px;
}

td small {
  display: block;
  margin-top: 0.2rem;
  color: #6d7175;
  font-size: 0.86rem;
}

.check-cell {
  width: 44px;
}

.order-cell,
.customer-cell,
.items-cell,
.shop-updated-cell {
  min-width: 0;
}

.cell-primary {
  display: block;
}

.product-cell {
  min-width: 340px;
}

.supplier-link {
  color: #1f6feb;
  font-weight: 600;
  text-decoration: none;
}

.supplier-link:hover,
.supplier-link:focus-visible {
  text-decoration: underline;
}

.suppliers-table {
  min-width: 2640px;
}

.supplier-product-cell {
  min-width: 280px;
}

.supplier-product-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.supplier-product-copy {
  min-width: 0;
}

.supplier-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.supplier-row-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 10px;
  white-space: nowrap;
}

.supplier-thumb,
.supplier-slot-thumb {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
}

.supplier-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.supplier-slot-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  margin-bottom: 0.15rem;
}

.supplier-thumb img,
.supplier-slot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.supplier-stack-cell,
.supplier-slot-cell {
  vertical-align: top;
}

.supplier-stack {
  display: grid;
  gap: 0.75rem;
  min-width: 220px;
}

.supplier-kv {
  display: grid;
  gap: 0.2rem;
}

.supplier-kv-label {
  display: block;
  color: #6d7175;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.supplier-week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 0.8rem;
}

.supplier-slot-card {
  display: grid;
  gap: 0.75rem;
  min-width: 255px;
  padding: 0.9rem;
  border: 1px solid #ececec;
  border-radius: 16px;
  background: #fbfbfb;
}

.supplier-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.supplier-slot-platform {
  font-size: 0.95rem;
  font-weight: 700;
  color: #202223;
  text-transform: capitalize;
}

.supplier-slot-body {
  display: grid;
  gap: 0.22rem;
}

.supplier-slot-body strong,
.supplier-slot-body .supplier-link {
  word-break: break-word;
}

.supplier-live-stock-panel {
  display: grid;
  gap: 0.5rem;
}

.supplier-live-stock-button {
  min-height: 34px;
  padding: 0.48rem 0.78rem;
  justify-self: start;
  font-size: 0.88rem;
}

.supplier-live-stock-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.supplier-live-stock-result {
  display: grid;
  gap: 0.22rem;
  padding: 0.68rem 0.78rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.supplier-live-stock-result[hidden] {
  display: none;
}

.supplier-live-stock-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.8rem;
  margin: 0.35rem 0 0;
  padding: 0.45rem 0;
  border-top: 1px dashed #e5e7eb;
}

.supplier-live-stock-metrics[hidden] {
  display: none;
}

.supplier-live-stock-metrics div {
  min-width: 0;
}

.supplier-live-stock-metrics dt {
  margin: 0;
  color: #6d7175;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.supplier-live-stock-metrics dd {
  margin: 0.1rem 0 0;
  color: #202223;
  font-size: 0.92rem;
  font-weight: 600;
}

.supplier-live-positive {
  color: #0c6f56;
}

.supplier-live-negative {
  color: #b42318;
}

.supplier-place-order-button,
.supplier-find-alternate-button {
  min-height: 34px;
  padding: 0.48rem 0.78rem;
  justify-self: start;
  font-size: 0.88rem;
}

.supplier-find-alternate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.place-order-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-order-modal[hidden] {
  display: none;
}

.place-order-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.5);
}

.place-order-modal-card {
  position: relative;
  width: min(640px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 18, 22, 0.3);
  padding: 1.5rem 1.6rem 1.4rem;
}

.place-order-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6d7175;
  cursor: pointer;
  border-radius: 8px;
}

.place-order-modal-close:hover {
  background: #f3f4f6;
  color: #202223;
}

.place-order-modal-head h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.place-order-modal-head p {
  margin: 0;
  color: #6d7175;
  font-size: 0.88rem;
}

.place-order-modal-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 1rem 0 0.85rem;
  flex-wrap: wrap;
}

.place-order-modal-picker {
  display: grid;
  gap: 0.3rem;
  flex: 1 1 320px;
  min-width: 0;
}

.place-order-modal-picker-label {
  color: #6d7175;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.place-order-picker {
  position: relative;
}

.place-order-picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #202223;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.place-order-picker-trigger:hover:not(:disabled) {
  border-color: #c1c5cb;
}

.place-order-picker.is-open .place-order-picker-trigger,
.place-order-picker-trigger:focus-visible {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.place-order-picker-trigger:disabled {
  cursor: not-allowed;
  background: #f6f6f7;
  color: #6d7175;
}

.place-order-picker-trigger-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.place-order-picker-trigger-primary {
  font-weight: 600;
  font-size: 0.94rem;
  color: #202223;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-order-picker-trigger-meta {
  font-size: 0.78rem;
  color: #6d7175;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-order-picker-trigger-meta:empty {
  display: none;
}

.place-order-picker-trigger-status:empty {
  display: none;
}

.place-order-picker-caret {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #6d7175;
  transition: transform 0.15s ease;
}

.place-order-picker.is-open .place-order-picker-caret {
  transform: rotate(180deg);
}

.place-order-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(15, 18, 22, 0.18);
  max-height: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.place-order-picker-panel[hidden] {
  display: none;
}

.place-order-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #ececec;
  background: #fafafa;
  flex-wrap: wrap;
}

.place-order-picker-search {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.88rem;
}

.place-order-picker-search:focus-visible {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.place-order-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #49505a;
  cursor: pointer;
  user-select: none;
}

.place-order-picker-toggle input {
  accent-color: #1f6feb;
}

.place-order-picker-options {
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.place-order-picker-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.place-order-picker-option:hover {
  background: #f3f4f6;
}

.place-order-picker-option.is-selected {
  background: #eef4ff;
}

.place-order-picker-option.is-ordered {
  opacity: 0.62;
}

.place-order-picker-option.is-ordered:hover {
  opacity: 0.85;
}

.place-order-picker-option-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.place-order-picker-option-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #202223;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-order-picker-option-meta {
  font-size: 0.78rem;
  color: #6d7175;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-order-picker-pill {
  flex: 0 0 auto;
  min-width: auto;
  min-height: 22px;
  padding: 0.08rem 0.55rem 0.08rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  gap: 0.3rem;
}

.place-order-picker-pill::after {
  display: none;
}

.place-order-picker-empty {
  margin: 0;
  padding: 1rem 0.75rem;
  text-align: center;
  color: #6d7175;
  font-size: 0.88rem;
}

.place-order-picker-empty[hidden] {
  display: none;
}

.find-alternate-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.find-alternate-modal[hidden] {
  display: none;
}

.find-alternate-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.5);
}

.find-alternate-modal-card {
  position: relative;
  width: min(780px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 18, 22, 0.3);
}

.find-alternate-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6d7175;
  cursor: pointer;
  border-radius: 8px;
}

.find-alternate-modal-close:hover {
  background: #f3f4f6;
  color: #202223;
}

.find-alternate-modal-head {
  padding: 1.3rem 1.5rem 0.85rem;
  border-bottom: 1px solid #ececec;
}

.find-alternate-modal-head h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.find-alternate-modal-head p {
  margin: 0;
  color: #6d7175;
  font-size: 0.88rem;
}

.find-alternate-modal-body {
  padding: 1rem 1.5rem 1.3rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.find-alternate-loading,
.find-alternate-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1rem;
  color: #6d7175;
  font-size: 0.92rem;
  text-align: center;
}

.find-alternate-loading[hidden] {
  display: none;
}

.find-alternate-empty {
  padding: 1.75rem 1rem;
  color: #6d7175;
  font-size: 0.92rem;
  text-align: center;
}

.find-alternate-empty p {
  margin: 0 0 0.75rem;
}

.find-alternate-debug {
  margin: 0 auto;
  max-width: 480px;
  text-align: left;
  font-size: 0.82rem;
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.find-alternate-debug[hidden] {
  display: none;
}

.find-alternate-debug summary {
  cursor: pointer;
  color: #49505a;
  font-weight: 600;
}

.find-alternate-debug ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  line-height: 1.45;
}

.find-alternate-debug li {
  color: #6d7175;
}

.find-alternate-debug strong {
  color: #202223;
}

.find-alternate-error {
  color: #b42318;
}

.find-alternate-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: #1f6feb;
  border-radius: 50%;
  animation: bbpf-spin 0.7s linear infinite;
}

@keyframes bbpf-spin {
  to { transform: rotate(360deg); }
}

.find-alternate-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.find-alternate-result {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.75rem;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fafafa;
}

.find-alternate-thumb {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.find-alternate-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.find-alternate-thumb-empty {
  font-size: 0.74rem;
  color: #9ca3af;
}

.find-alternate-result-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.find-alternate-result-title {
  font-weight: 600;
  color: #202223;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.find-alternate-result-title:hover {
  color: #1f6feb;
  text-decoration: underline;
}

.find-alternate-result-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.find-alternate-price {
  font-weight: 700;
  color: #0c6f56;
  font-size: 1.02rem;
}

.find-alternate-shipping {
  font-size: 0.82rem;
  color: #49505a;
}

.find-alternate-tag {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #eef0f3;
  color: #49505a;
  font-size: 0.76rem;
  font-weight: 600;
}

.find-alternate-result-stock {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: -0.05rem;
}

.find-alternate-stock,
.find-alternate-sold {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1.4;
}

.find-alternate-stock-in {
  background: #d7efb9;
  color: #0c6f56;
}

.find-alternate-stock-low {
  background: #ffe29a;
  color: #6b4e08;
}

.find-alternate-stock-out {
  background: #fde2e2;
  color: #b42318;
}

.find-alternate-stock-neutral {
  background: #eef0f3;
  color: #49505a;
}

.find-alternate-sold {
  background: #eef4ff;
  color: #1f5fb4;
}

.find-alternate-result-seller {
  font-size: 0.84rem;
  color: #6d7175;
}

.find-alternate-result-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.find-alternate-result-actions .btn {
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  font-size: 0.84rem;
  border-radius: 8px;
}

@media (max-width: 540px) {
  .find-alternate-result {
    grid-template-columns: minmax(0, 1fr);
  }
  .find-alternate-thumb {
    width: 100%;
    height: 160px;
  }
}

.place-order-modal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.place-order-modal-actions .btn {
  min-height: 36px;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  border-radius: 10px;
}

.place-order-modal-actions .btn.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.place-order-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.85rem;
  margin: 0;
  padding-top: 0.6rem;
  border-top: 1px solid #ececec;
}

.place-order-fields > div {
  min-width: 0;
}

.place-order-fields dt {
  margin: 0;
  color: #6d7175;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.place-order-fields dd {
  margin: 0.18rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.place-order-fields dd [data-place-order-value] {
  flex: 1 1 auto;
  min-width: 0;
  color: #202223;
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-order-field-empty dd [data-place-order-value] {
  color: #9ca3af;
  font-weight: 500;
}

.place-order-copy {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: #202223;
}

.place-order-copy:hover:not(:disabled) {
  background: #f6f6f7;
}

.place-order-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.place-order-modal-status {
  min-height: 1.1rem;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #6d7175;
}

.place-order-modal-status[data-tone="ok"] {
  color: #0c6f56;
}

.place-order-modal-status[data-tone="error"] {
  color: #b42318;
}

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

.supplier-live-stock-result small {
  color: #6d7175;
  line-height: 1.22;
}

.supplier-live-stock-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.supplier-live-stock-topline strong {
  font-size: 0.92rem;
  color: #202223;
}

.supplier-live-stock-hint {
  color: #6d7175;
  line-height: 1.25;
}

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

.supplier-metrics div {
  min-width: 0;
}

.supplier-metrics dt {
  margin: 0 0 0.18rem;
  color: #6d7175;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.supplier-metrics dd {
  margin: 0;
  color: #202223;
  font-size: 0.96rem;
  font-weight: 600;
  word-break: break-word;
}

.supplier-metrics-wide {
  grid-column: 1 / -1;
}

.supplier-slot-list {
  display: grid;
  gap: 0.9rem;
  min-width: 290px;
}

.supplier-empty {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #8c9196;
  font-weight: 600;
}

.product-row-link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.product-row-link:hover strong {
  color: #005bd3;
}

.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.product-thumb-placeholder {
  padding: 0.35rem;
  color: #8c9196;
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.2;
}

.product-copy {
  min-width: 0;
}

.product-copy strong {
  display: block;
  color: #202223;
  line-height: 1.32;
}

.product-tags-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.product-status-pill {
  min-width: 64px;
  justify-content: center;
}

.inventory-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.inventory-pill-success {
  background: rgba(20, 158, 72, 0.12);
  color: #0f7a39;
}

.inventory-pill-warning {
  background: rgba(214, 155, 18, 0.14);
  color: #976c00;
}

.inventory-pill-danger {
  background: rgba(217, 72, 95, 0.12);
  color: #b4233b;
}

.inventory-pill-muted {
  background: #eef0f2;
  color: #636a73;
}

.product-variant-summary strong {
  display: block;
  color: #1f2933;
}

.product-variant-summary small {
  display: block;
  margin-top: 0.16rem;
}

.product-row-updated {
  white-space: nowrap;
}

.products-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-page-shell {
  display: grid;
  gap: 1.15rem;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 1.15rem;
  align-items: start;
}

.product-main-column,
.product-side-column {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

.product-side-rail {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

.product-hero-panel {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.product-hero-media {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f6f6f7;
  min-height: 340px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-hero-placeholder {
  color: #8c9196;
  font-size: 1rem;
  font-weight: 600;
}

.product-hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-content: start;
  min-width: 0;
}

.product-page-title {
  line-height: 1.05;
}

.product-status-chip,
.product-type-pill {
  width: fit-content;
  justify-self: start;
}

.product-hero-heading {
  display: grid;
  gap: 0.65rem;
}

.product-hero-option-line {
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 600;
}

.product-hero-copy h3 {
  font-size: clamp(1.9rem, 2.5vw, 2.35rem);
  letter-spacing: -0.04em;
  color: #202223;
  line-height: 1.08;
  max-width: 30ch;
}

.product-hero-copy p {
  color: #616161;
  max-width: 52ch;
  font-size: 1.02rem;
  line-height: 1.45;
}

/* Stat strip — one unified panel split into 3 hairline-divided segments
   (denser + more premium than 3 floating cards). Inventory value is
   state-coloured: red when out, amber when low. */
.product-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.product-hero-metrics div {
  display: grid;
  gap: 0.1rem;
  align-content: center;
  padding: 0.5rem 0.8rem 0.55rem;
  border-right: 1px solid #eef0f2;
}

.product-hero-metrics div:last-child { border-right: 0; }

.product-hero-metrics span {
  color: #6d7175;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.product-hero-metrics strong {
  color: #1f2328;
  font-size: 1.02rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.product-stat-num.is-out { color: #b42318; }
.product-stat-num.is-low { color: #b54708; }

.product-meta-stack {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-meta-block {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e3e3e3;
  border-radius: 16px;
  background: #fafafa;
}

.product-meta-block span {
  color: #6d7175;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-meta-block strong {
  color: #202223;
  font-size: 1rem;
}

.variant-cell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.variant-thumb,
.variant-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid #e0e0e0;
  background: #f6f6f7;
  flex: none;
}

.variant-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.variant-thumb-placeholder {
  display: grid;
  place-items: center;
  color: #8c9196;
  font-size: 0.64rem;
  font-weight: 600;
  text-align: center;
  padding: 0.2rem;
}

.variant-copy {
  min-width: 0;
}

.variant-copy strong {
  display: block;
  color: #202223;
  font-size: 0.97rem;
  line-height: 1.35;
}

.variant-supplier-cell {
  display: grid;
  gap: 0.18rem;
}

.variant-supplier-cell strong {
  color: #202223;
  font-size: 0.94rem;
  line-height: 1.3;
}

.variant-supplier-cell small {
  color: #6d7175;
  font-size: 0.82rem;
}

.product-section-head {
  align-items: end;
}

.product-section-head p {
  color: #616161;
  text-align: right;
}

.shop-updated-cell {
  white-space: nowrap;
}

.customer-cell,
.items-cell {
  position: relative;
}

.popover-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.cell-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  cursor: default;
}

.cell-caret {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d7175;
  flex: none;
}

.cell-caret svg {
  width: 18px;
  height: 18px;
}

.popover-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
}

.popover-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

.popover-toggle[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.06);
}

.shop-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: min(560px, 70vw);
  padding: 0.3rem;
  border-radius: 24px;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  pointer-events: none;
}

.shop-popover.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.shop-popover[hidden] {
  display: none;
}

.shop-popover-frame,
.shop-popover-body {
  border-radius: 24px;
  border: 1px solid #dfe3e8;
  background: #fff;
  box-shadow: 0 12px 28px rgba(48, 48, 48, 0.16), 0 2px 6px rgba(48, 48, 48, 0.08);
}

.shop-popover-body {
  display: grid;
  gap: 0.55rem;
  padding: 1.2rem;
}

.shop-popover-body strong,
.shop-popover-shipping strong,
.shop-popover-item-copy strong {
  font-size: 0.98rem;
  color: #303030;
}

.shop-popover-body p,
.shop-popover-shipping p {
  color: #616161;
  line-height: 1.45;
}

.shop-popover-link {
  color: #005bd3;
}

.shop-popover-link:hover {
  text-decoration: underline;
}

.shop-popover-action {
  justify-content: center;
  margin-top: 0.35rem;
}

.items-popover {
  width: min(780px, 78vw);
}

.shop-popover-frame {
  overflow: hidden;
}

.shop-popover-head {
  padding: 1rem 1rem 0;
}

.shop-popover-shipping {
  margin: 0.7rem 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #e3e3e3;
  border-radius: 18px 18px 0 0;
  background: #f6f6f7;
  display: grid;
  gap: 0.55rem;
}

.shop-popover-items {
  border-top: 1px solid #ececec;
}

.shop-popover-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-top: 1px solid #ececec;
  background: #fff;
}

.shop-popover-item:first-child {
  border-top: none;
}

.shop-popover-item-media img,
.shop-popover-item-placeholder {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #e3e3e3;
  background: #fbfbfb;
}

.shop-popover-item-placeholder {
  display: block;
}

.shop-popover-item-copy {
  display: grid;
  gap: 0.55rem;
}

.shop-popover-item-copy small {
  font-family: "Inter", sans-serif;
  color: #303030;
  font-size: 0.96rem;
  line-height: 1.4;
}

.shop-popover-item-extra {
  display: grid;
  gap: 0.24rem;
  color: #616161;
  font-size: 0.82rem;
  line-height: 1.35;
}

.shop-variant-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: #e9e9ea;
  color: #4a4a4a;
  font-size: 0.82rem;
  font-weight: 600;
}

.shop-popover-item-qty {
  color: #303030;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  padding-top: 0.15rem;
}

.shop-popover-loading {
  padding: 1.2rem;
  color: #616161;
}

.order-item-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: auto;
  padding: calc(var(--global-bar-height) + 18px) 16px 16px;
}

.order-item-modal[hidden] {
  display: none;
}

.order-item-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 18, 19, 0.5);
  backdrop-filter: blur(4px);
}

.order-item-modal-card {
  position: relative;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - var(--global-bar-height) - 34px);
  margin: 0 auto;
  overflow: auto;
  border-radius: 28px;
  border: 1px solid #dfe3e8;
  background: #fff;
  box-shadow: 0 18px 48px rgba(48, 48, 48, 0.24);
}

.order-item-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid #dfe3e8;
  border-radius: 999px;
  background: #fff;
  color: #4a4a4a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.order-item-modal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

.order-item-modal-media {
  display: grid;
  align-content: start;
}

.order-item-modal-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  border: 1px solid #e3e3e3;
  object-fit: contain;
  background: #fff;
  padding: 0.9rem;
}

.order-item-modal-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  border: 1px solid #e3e3e3;
  background: #f6f6f7;
}

.order-item-modal-placeholder {
  display: grid;
  place-items: center;
  color: #8c9196;
  font-weight: 600;
}

.order-item-modal-media img[hidden],
.order-item-modal-placeholder[hidden] {
  display: none;
}

.order-item-modal-copy {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
  padding-top: 0.3rem;
}

.order-item-modal-head {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.order-item-modal-copy h3 {
  max-width: calc(100% - 54px);
  font-size: clamp(2rem, 3vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: #202223;
  overflow-wrap: anywhere;
}

.order-item-modal-copy p {
  color: #616161;
  font-size: 1.05rem;
  line-height: 1.4;
}

.order-item-modal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.order-item-modal-meta div {
  display: grid;
  gap: 0.22rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e3e3e3;
  border-radius: 16px;
  background: #fafafa;
}

.order-item-modal-meta span {
  color: #6d7175;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-item-modal-meta strong {
  color: #202223;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  border-radius: 6px;
  accent-color: #1f1f1f;
}

.order-link {
  font-weight: 700;
  color: var(--text-strong);
  font-size: 0.94rem;
}

.order-link:hover {
  text-decoration: underline;
}

.customer-cell,
.items-cell,
.shop-updated-cell,
.total-cell {
  font-size: 0.94rem;
}

.total-cell {
  font-weight: 500;
}

.list-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.list-pill-more {
  color: #616161;
  font-size: 0.92rem;
  white-space: nowrap;
}

.muted-cell-empty {
  display: inline-block;
  min-height: 1rem;
}

.inline-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 30px;
  padding: 0.3rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--pill-color, var(--primary)) 28%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill-color, var(--primary)) 15%, white);
  color: #2d2d2d;
  font-size: 0.84rem;
  font-weight: 600;
}

.fulfillment-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 140px;
  min-height: 36px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.fulfillment-status-pill::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid currentColor;
  opacity: 0.9;
  transform: translateY(1px);
}

.fulfillment-status-pill-ordered {
  background: #d7efb9;
  color: #0c6f56;
}

.fulfillment-status-pill-international {
  background: #1f5fb4;
  color: #eef5ff;
}

.fulfillment-status-pill-out-of-stock {
  background: #ffe29a;
  color: #4e3c1f;
}

.fulfillment-status-pill-on-hold {
  background: #6b3fa0;
  color: #f4ebff;
}

.fulfillment-status-pill-cancelled {
  background: #c30f06;
  color: #fff2f2;
}

.fulfillment-status-pill-neutral {
  background: #e3e8ef;
  color: #49505a;
}

.shop-pill {
  min-height: 28px;
  padding: 0.2rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.custom-pill {
  color: #616161;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--dot-color, #8c9196);
  flex: none;
}

.neutral-dot {
  background: #6d7175;
}

.delivery-dot {
  width: 12px;
  height: 12px;
}

.delivery-dot.shop-delivery-neutral {
  position: relative;
  background: transparent;
  border: 2px solid #6b6e72;
}

.delivery-dot.shop-delivery-neutral::after {
  content: "";
  position: absolute;
  inset: 4px 1px;
  background: #6b6e72;
  transform: rotate(-45deg);
  border-radius: 999px;
}

.delivery-dot.shop-delivery-info {
  position: relative;
  background: transparent;
  border: 2px solid #0b4f71;
}

.delivery-dot.shop-delivery-info::after {
  content: "";
  position: absolute;
  inset: 4px 1px;
  background: #0b4f71;
  transform: rotate(-45deg);
  border-radius: 999px;
}

.delivery-dot.shop-delivery-success {
  background: #166534;
}

.fulfillment-dot {
  width: 12px;
  height: 12px;
}

.fulfillment-dot.shop-fulfilled {
  background: #636567;
}

.fulfillment-dot.shop-unfulfilled {
  background: transparent;
  border: 2px solid #5a4b00;
}

.fulfillment-dot.shop-partial {
  position: relative;
  background: transparent;
  border: 2px solid #6c4b00;
}

.fulfillment-dot.shop-partial::after {
  content: "";
  position: absolute;
  inset: 4px 1px;
  background: #6c4b00;
  transform: rotate(-45deg);
  border-radius: 999px;
}

.fulfillment-dot.shop-restocked {
  background: #17603a;
}

.stack-list > :not(:last-child),
.status-row,
.activity-item,
.status-config-card {
  border-bottom: 1px solid #ececec;
}

.status-row,
.activity-item,
.status-config-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.status-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #ececec;
}

.status-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f7cf6, #4ab8ff);
}

.empty-state {
  color: var(--muted);
  padding: 1.25rem 0;
}

.item-preview-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.item-preview {
  display: grid;
  gap: 0.25rem;
  width: 84px;
}

.item-preview img,
.item-photo-placeholder,
.item-preview-placeholder {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f1f1f1;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.item-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-subtle);
}

.item-card img,
.item-card .item-photo-placeholder {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.item-card > div {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
}

.item-card p {
  color: var(--muted);
}

.order-page-shell {
  display: grid;
  gap: 1.25rem;
}

.dashboard-main > .order-page-shell:first-child {
  margin-top: 0.1rem;
}

.order-command-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.order-command-meta {
  display: grid;
  gap: 0.45rem;
}

.order-command-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.order-back-link {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d7175;
  transition: background 0.15s ease, color 0.15s ease;
}

.order-back-link:hover {
  background: #f1f1f1;
  color: #303030;
}

.order-back-link svg {
  width: 18px;
  height: 18px;
}

.order-command-title h2 {
  font-size: 1.95rem;
  letter-spacing: -0.04em;
  color: var(--text-strong);
}

.order-command-meta p {
  color: var(--muted);
  font-size: 0.95rem;
}

.order-icon {
  color: #6d7175;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-icon svg {
  width: 20px;
  height: 20px;
}

.order-command-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.order-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(320px, 0.9fr);
  gap: 1.35rem;
  align-items: start;
}

.order-main-column,
.order-side-column {
  display: grid;
  gap: 1rem;
}

.shopify-order-panel,
.shopify-side-card {
  padding: 1rem;
  min-width: 0;
}

.panel-header-row,
.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-header-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.panel-dots,
.side-card-head span:last-child {
  color: #8a8a8a;
}

.shipping-summary-box {
  margin-top: 0.65rem;
  border: 1px solid #e3e3e3;
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
}

.shipping-summary-line {
  display: grid;
  gap: 0.15rem;
}

.shipping-summary-line strong {
  font-size: 0.98rem;
  font-weight: 500;
}

.shipping-summary-line small,
.muted-link-row span {
  color: var(--muted);
}

.muted-link-row strong {
  font-size: 0.95rem;
  color: #3a3a3a;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.order-line-list {
  margin-top: 0.75rem;
  border: 1px solid #e3e3e3;
  border-radius: 14px;
  overflow: hidden;
}

.order-line-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border-bottom: 1px solid #ececec;
  background: #fff;
}

.order-line-row:last-child {
  border-bottom: none;
}

.order-line-media img,
.order-line-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  object-fit: cover;
  background: #f4f4f4;
}

.order-line-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.65rem;
  text-align: center;
}

.order-line-copy {
  min-width: 0;
}

.order-line-copy strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
}

.order-item-detail-trigger {
  padding: 0;
  border: none;
  background: transparent;
  color: #2b2b2b;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.order-item-detail-trigger:hover {
  text-decoration: underline;
}

.order-line-supplier {
  display: block;
  margin-top: 0.25rem;
  color: #616161;
  font-size: 0.82rem;
  line-height: 1.35;
}

.order-line-supplier strong {
  color: #303030;
}

.order-line-copy p,
.order-line-copy small {
  margin-top: 0.2rem;
  color: var(--muted);
}

.order-line-copy small {
  font-family: "Inter", sans-serif;
  color: #616161;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 16px;
}

.order-line-status-pill {
  min-width: 0;
  min-height: 30px;
  margin-top: 0.45rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
}

.order-line-status-pill::after,
.order-modal-status-pill::after {
  display: none;
}

.order-modal-status-pill {
  min-width: 0;
  min-height: 32px;
  padding: 0.3rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.order-item-modal-meta strong .order-modal-status-pill {
  color: inherit;
}

.order-item-modal-meta strong .order-modal-status-pill.fulfillment-status-pill-ordered {
  color: #0c6f56;
}

.order-item-modal-meta strong .order-modal-status-pill.fulfillment-status-pill-international {
  color: #f5f9ff;
}

.order-item-modal-meta strong .order-modal-status-pill.fulfillment-status-pill-out-of-stock {
  color: #4e3c1f;
}

.order-item-modal-meta strong .order-modal-status-pill.fulfillment-status-pill-on-hold {
  color: #f4ebff;
}

.order-item-modal-meta strong .order-modal-status-pill.fulfillment-status-pill-cancelled {
  color: #fff2f2;
}

.order-item-modal-meta strong .order-modal-status-pill.fulfillment-status-pill-neutral {
  color: #49505a;
}

.order-line-price,
.order-line-total {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.order-line-price {
  color: #3d3d3d;
}

.line-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #efefef;
  color: #616161;
  font-size: 0.85rem;
  font-weight: 600;
}

.order-line-total strong {
  font-size: 1rem;
}

.money-summary-table {
  margin-top: 0.7rem;
  border: 1px solid #e3e3e3;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.money-summary-table > div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #ececec;
}

.money-summary-table > div:last-child {
  border-bottom: none;
}

.money-summary-table span:nth-child(2) {
  color: #4f4f4f;
}

.money-summary-table strong {
  white-space: nowrap;
}

.money-summary-total {
  font-weight: 700;
}

.shopify-side-card h3 {
  font-size: 0.98rem;
}

.side-card-body {
  margin-top: 0.9rem;
}

.side-card-copy p,
.address-stack p,
.activity-feed-item p {
  color: #444;
  line-height: 1.45;
}

.side-tag-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.customer-card-stack,
.workflow-form,
.activity-feed {
  display: grid;
  gap: 1rem;
}

.customer-link {
  color: #005bd3;
  font-weight: 500;
}

.customer-link:hover {
  text-decoration: underline;
}

.customer-card-stack small {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
}

.address-stack {
  display: grid;
  gap: 0.2rem;
}

.address-stack strong {
  margin-bottom: 0.25rem;
}

.workflow-form {
  margin-top: 0.1rem;
}

.workflow-form textarea {
  min-height: 108px;
}

.activity-feed-item {
  display: grid;
  gap: 0.18rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #ececec;
}

.activity-feed-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.activity-feed-item small {
  color: var(--muted);
}

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

.order-header h2 {
  font-size: 1.9rem;
  letter-spacing: -0.03em;
}

.order-header-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.address-block {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.address-block p {
  color: var(--muted);
}

.meta-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.meta-list > div {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.meta-list span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.preview-panel {
  margin-top: 1rem;
  border-radius: 14px;
  background: #111213;
  color: #f6f6f7;
  padding: 1rem;
  white-space: pre-wrap;
}

.sync-progress-banner {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.sync-inline-alert {
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}

.sync-inline-alert strong {
  color: inherit;
}

.sync-inline-alert-success {
  background: #eefaf4;
  border-color: #bfe3cd;
  color: #145b41;
}

.sync-inline-alert-warning {
  background: #fff7e6;
  border-color: #f2d397;
  color: #6f4b00;
}

.sync-inline-alert-info {
  background: #eef6ff;
  border-color: #bfd7ff;
  color: #174e94;
}

.sync-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.9fr);
  gap: 1.2rem;
  padding: 1.35rem;
  margin-bottom: 1rem;
  background:
    radial-gradient(circle at top left, rgba(41, 163, 255, 0.11), transparent 35%),
    radial-gradient(circle at bottom right, rgba(0, 128, 96, 0.1), transparent 30%),
    var(--surface);
}

.sync-card-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: #f1f3f5;
  color: #616161;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sync-hero-copy {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.sync-hero-copy h2 {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: #202223;
}

.sync-hero-copy p {
  max-width: 64ch;
  color: #5d646d;
  font-size: 1rem;
  line-height: 1.6;
}

.sync-chip-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #dde3e7;
  color: #46505a;
  font-size: 0.84rem;
  font-weight: 600;
}

.sync-live-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.36rem 0.8rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sync-live-pill.is-success {
  background: #dbf2df;
  color: #145b41;
}

.sync-live-pill.is-warning {
  background: #fff1c7;
  color: #7b5302;
}

.sync-live-pill.is-danger {
  background: #ffe3e0;
  color: #92220d;
}

.sync-live-pill.is-info {
  background: #e4efff;
  color: #1c4f96;
}

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

.sync-pulse-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid #e2e6ea;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 0.28rem;
}

.sync-pulse-card span {
  color: #6d7175;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sync-pulse-card strong {
  color: #202223;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.sync-pulse-card small {
  color: #5d646d;
  font-size: 0.9rem;
  line-height: 1.45;
}

.sync-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.sync-command-card,
.sync-live-card,
.sync-source-section {
  padding: 1.25rem;
}

.sync-recommendation-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  margin-top: 0.8rem;
  border: 1px solid #dfe6eb;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fb 100%);
}

.sync-recommendation-card strong {
  color: #202223;
  font-size: 1.04rem;
}

.sync-recommendation-card p {
  color: #5d646d;
  line-height: 1.55;
}

.sync-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.sync-command-tile {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid #e3e7eb;
  border-radius: 18px;
  background: #fbfbfc;
}

.sync-command-tile strong {
  display: block;
  color: #202223;
  font-size: 1rem;
}

.sync-command-tile p {
  margin-top: 0.3rem;
  color: #5d646d;
  line-height: 1.5;
}

.sync-command-tile-danger {
  background: #fff8f7;
  border-color: #f0d6d2;
}

.sync-playbook-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.sync-playbook-item {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: #f5f6f7;
  border: 1px solid #e2e6ea;
}

.sync-playbook-item strong {
  display: block;
  color: #202223;
  font-size: 0.96rem;
}

.sync-playbook-item p {
  margin-top: 0.25rem;
  color: #5d646d;
  line-height: 1.5;
}

.sync-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sync-live-headline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sync-progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #ececec;
}

.sync-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #008060, #29a3ff);
}

.muted-text {
  color: var(--muted);
  font-size: 0.88rem;
}

.sync-live-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.sync-live-stat {
  display: grid;
  gap: 0.18rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid #e3e7eb;
  background: #fafbfc;
}

.sync-live-stat-wide {
  grid-column: 1 / -1;
}

.sync-live-stat span {
  color: #6d7175;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sync-live-stat strong {
  color: #202223;
  font-size: 0.98rem;
  line-height: 1.35;
}

.sync-log-head {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

#bg-sync-logs {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  padding: 0.9rem;
  border-radius: 14px;
  background: #111213;
  color: #d8d8d8;
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.sync-source-section {
  margin-bottom: 1rem;
}

.sync-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 0.9rem;
}

.sync-source-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid #e2e6ea;
  background: #fbfcfd;
}

.sync-source-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.sync-source-head h3 {
  margin-top: 0.38rem;
  color: #202223;
  font-size: 1.15rem;
  line-height: 1.15;
}

.sync-source-value {
  color: #202223;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.sync-source-value-label {
  color: #46505a;
  font-size: 0.95rem;
}

.sync-source-meta {
  display: grid;
  gap: 0.32rem;
  color: #67707a;
  font-size: 0.88rem;
  line-height: 1.45;
}

.sync-source-form {
  margin-top: 0.2rem;
}

.sync-automation-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.25rem;
  padding-top: 0.95rem;
  border-top: 1px solid #e4e8eb;
}

.sync-automation-form.is-disabled {
  background: linear-gradient(180deg, #fcfcfd 0%, #f8fafb 100%);
  border-radius: 16px;
  padding: 0.95rem;
  border-top: none;
}

.sync-automation-form.is-enabled {
  background: linear-gradient(180deg, #f8fffb 0%, #f5fbf8 100%);
  border-radius: 16px;
  padding: 0.95rem;
  border: 1px solid #d8ece2;
  border-top: none;
}

.sync-automation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sync-automation-heading {
  display: grid;
  gap: 0.28rem;
}

.sync-automation-head strong {
  color: #202223;
  font-size: 0.96rem;
}

.sync-automation-heading p {
  color: #67707a;
  font-size: 0.86rem;
  line-height: 1.45;
}

.sync-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: auto;
  color: #46505a;
  font-size: 0.88rem;
  font-weight: 700;
}

.sync-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  min-height: 1px;
  margin: 0;
}

.sync-toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d9dde1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: background 0.18s ease;
}

.sync-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.18);
  transition: transform 0.18s ease;
}

.sync-toggle input[type="checkbox"]:checked + .sync-toggle-track {
  background: #008060;
}

.sync-toggle input[type="checkbox"]:checked + .sync-toggle-track .sync-toggle-knob {
  transform: translateX(20px);
}

.sync-toggle-label {
  min-width: 1.9rem;
}

.sync-automation-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: start;
}

.sync-automation-grid label {
  gap: 0.35rem;
  color: #5d646d;
}

.sync-automation-grid label span,
.sync-automation-meta-card span {
  color: #6d7175;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sync-automation-meta-card {
  display: grid;
  gap: 0.18rem;
  min-height: 100%;
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  border: 1px solid #e3e7eb;
  background: #f8fafb;
}

.sync-automation-meta-card strong {
  color: #202223;
  font-size: 0.92rem;
  line-height: 1.35;
}

.sync-automation-meta-card small {
  color: #67707a;
  font-size: 0.8rem;
  line-height: 1.45;
}

.sync-automation-error {
  color: #a02814;
  font-size: 0.84rem;
  line-height: 1.45;
}

.edit-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fafafa;
  padding: 1rem;
}

.edit-card summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.edit-card summary::-webkit-details-marker {
  display: none;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
}

.timeline-marker {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #f3f3f3;
  border: 1px solid var(--border);
}

.timeline-step-current .timeline-marker {
  border-color: #7f8cff;
  box-shadow: 0 0 0 4px rgba(92, 106, 196, 0.14);
}

.timeline-step-upcoming {
  opacity: 0.62;
}

.timeline-content p {
  margin-top: 0.35rem;
  color: var(--muted);
}

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.auth-layout,
.customer-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(180deg, #f6f6f7, #ececed);
}

.auth-brand {
  display: grid;
  align-content: space-between;
  gap: 2rem;
  padding: 2.5rem;
  background:
    linear-gradient(135deg, rgba(0, 128, 96, 0.92), rgba(0, 128, 96, 0.62)),
    linear-gradient(135deg, #173526, #315d43);
  color: #fff;
}

.auth-brand h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
  max-width: 10ch;
}

.auth-brand p {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.9);
}

.auth-metrics {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.auth-metrics div {
  min-width: 160px;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.auth-metrics strong {
  display: block;
  font-size: 1.15rem;
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-form {
  width: min(440px, 100%);
  display: grid;
  gap: 1rem;
}

.customer-layout {
  grid-template-columns: 1fr;
  max-width: 1080px;
  margin: 0 auto;
}

.customer-hero,
.lookup-card,
.status-summary-card {
  padding: 2rem;
}

.customer-hero {
  padding-top: 3rem;
}

.customer-hero h1,
.status-summary-card h1 {
  margin: 0.45rem 0 1rem;
  font-size: clamp(2.1rem, 5vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.customer-hero p,
.status-summary-card p {
  color: var(--muted);
  max-width: 62ch;
}

.lookup-form {
  display: grid;
  gap: 1rem;
}

.customer-timeline-layout {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

@media (max-width: 1200px) {
  .shop-summary-bar,
  .sync-source-grid,
  .sync-command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sync-hero-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .global-bar {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    justify-items: stretch;
  }

  .sidebar-toggle {
    display: inline-flex;
    grid-row: 1;
    grid-column: 1;
  }

  .global-brand {
    grid-row: 1;
    grid-column: 2;
  }

  .global-search {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .global-actions {
    grid-row: 3;
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .dashboard-layout,
  .auth-layout,
  .split-grid,
  .metrics-grid,
  .detail-grid,
  .form-grid,
  .order-layout-grid,
  .sync-center-grid,
  .sync-main-grid,
  .product-detail-grid {
    grid-template-columns: 1fr;
  }

  .product-side-rail {
    position: static;
  }

  .product-hero-panel {
    grid-template-columns: 1fr;
  }

  .product-hero-media {
    max-width: 420px;
  }

  .product-hero-copy h3 {
    max-width: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 210;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-md);
  }

  .admin-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(20, 22, 24, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .admin-shell.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .shop-filter-bar {
    flex-wrap: wrap;
  }

  .filter-leading {
    width: 100%;
  }

  .filter-icon {
    left: 4.9rem;
  }

  .filter-controls {
    flex-wrap: wrap;
  }

  .speed-meter-wrap,
  .speed-meter-stats,
  .speed-meter-loading-grid,
  .speed-meter-loading-stats {
    grid-template-columns: 1fr;
  }

  .speed-filter-toolbar,
  .speed-range-trigger,
  .speed-range-popover {
    width: 100%;
  }

  .speed-range-popover {
    position: static;
    margin-top: 0.8rem;
  }

  .speed-range-dialog,
  .speed-range-calendar-panels {
    grid-template-columns: 1fr;
  }

  .product-hero-metrics,
  .product-meta-stack {
    grid-template-columns: 1fr;
  }

  .order-item-modal-grid,
  .order-item-modal-meta {
    grid-template-columns: 1fr;
  }

  .sync-pulse-grid,
  .sync-live-stats,
  .sync-automation-grid {
    grid-template-columns: 1fr;
  }

  .sync-live-stat-wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .dashboard-main,
  .auth-layout,
  .customer-layout {
    padding: 1rem;
  }

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

  .sync-command-grid,
  .sync-source-grid {
    grid-template-columns: 1fr;
  }

  .sync-source-head,
  .sync-progress-head,
  .sync-automation-head {
    flex-direction: column;
    align-items: start;
  }

  .product-hero-media {
    max-width: none;
    min-height: 0;
  }

  .product-section-head {
    align-items: start;
  }

  .product-section-head p {
    text-align: left;
  }

  .order-item-modal-card {
    width: min(100vw - 20px, 920px);
    max-height: calc(100vh - var(--global-bar-height) - 26px);
    margin: 0 auto;
  }

  .order-item-modal-grid {
    padding: 1rem;
  }

  .summary-tile {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .summary-tile:last-child {
    border-bottom: none;
  }

  .page-heading h1 {
    font-size: 1.6rem;
  }

  .speed-meter-wrap {
    grid-template-columns: 1fr;
  }

  .speed-range-header,
  .speed-range-calendars {
    grid-template-columns: 1fr;
  }

  .speed-range-arrow,
  .speed-range-nav:last-child {
    display: none;
  }

  .speed-range-dialog {
    border-radius: 24px;
  }

  .speed-meter-readout {
    margin-top: -0.8rem;
  }

  .speed-meter-readout strong {
    font-size: 2.2rem;
  }

  .speed-meter-scale {
    font-size: 0.66rem;
  }

  .order-line-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .order-line-price,
  .order-line-total {
    grid-column: 2;
  }

  .money-summary-table > div {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

.products-table-actions-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.products-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.products-toolbar .products-filter-form {
  flex: 1 1 360px;
  min-width: 0;
}

.products-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.products-toolbar-actions .inline-form { display: inline-flex; }

.product-section-head-with-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-detail-add-status {
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #f4f6f8;
  color: #49505a;
  font-size: 0.85rem;
}

.product-detail-add-status[data-tone="error"] {
  background: #fff0f0;
  color: #b42318;
}

.product-detail-add-status[data-tone="ok"] {
  background: #ecfdf3;
  color: #0c6f56;
}

/* --- Add Product wizard ----------------------------------------------- */
.new-product-shell {
  display: grid;
  gap: 1.1rem;
}

.new-product-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.new-product-draft-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem;
  background: #fff8e6;
  border: 1px solid #f3d27d;
  border-radius: 12px;
  color: #5c4400;
  font-size: 0.88rem;
}

.new-product-draft-banner[hidden] { display: none; }

.new-product-draft-banner strong { margin-right: 0.4rem; }

.new-product-back {
  font-size: 0.85rem;
  color: #49505a;
  text-decoration: none;
  width: max-content;
}

.new-product-back:hover { color: #1f6feb; }

.new-product-heading h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: #202223;
}

.new-product-heading p {
  margin: 0.2rem 0 0;
  color: #6d7175;
  font-size: 0.92rem;
  max-width: 720px;
}

.new-product-card {
  padding: 1.3rem 1.4rem;
  display: grid;
  gap: 1rem;
}

.new-product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.new-product-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #202223;
}

.new-product-card-head p {
  margin: 0.25rem 0 0;
  color: #6d7175;
  font-size: 0.85rem;
  max-width: 540px;
}

.new-product-fetch-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.new-product-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.new-product-field.grow { flex: 1 1 320px; min-width: 0; }
.new-product-field.compact { width: 200px; }

.new-product-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #49505a;
  text-transform: none;
  letter-spacing: 0;
}

.new-product-field input,
.new-product-field textarea,
.new-product-field select {
  border: 1px solid #d2d5da;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #ffffff;
  color: #202223;
  width: 100%;
}

.new-product-field input:focus,
.new-product-field textarea:focus,
.new-product-field select:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.new-product-field textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  resize: vertical;
}

.new-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.new-product-source-status {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #f4f6f8;
  color: #49505a;
  font-size: 0.85rem;
}

.new-product-source-status[data-tone="error"] {
  background: #fff0f0;
  color: #b42318;
}

.new-product-source-status[data-tone="ok"] {
  background: #ecfdf3;
  color: #0c6f56;
}

.new-product-title-field input { font-size: 1rem; padding: 0.7rem 0.85rem; }

.new-product-title-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.new-product-title-head > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #49505a;
}

.new-product-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.new-product-title-actions button {
  border: 1px solid #d2d5da;
  background: #ffffff;
  color: #49505a;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.new-product-title-actions button:hover {
  border-color: #1f6feb;
  color: #1f6feb;
}

.new-product-title-actions button:active {
  background: #ecf2ff;
}

.new-product-title-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: #6d7175;
}

.new-product-desc-field { gap: 0; }

.new-product-desc-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
}

.new-product-desc-label > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #49505a;
}

.new-product-desc-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.codex-usage {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #e3e6ea;
  background: #fafbfc;
  font-size: 0.75rem;
  color: #49505a;
  font-variant-numeric: tabular-nums;
}

.codex-usage[hidden] { display: none; }

.codex-usage-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.codex-usage-row strong {
  font-weight: 600;
  color: #6d7175;
}

.codex-usage-divider {
  width: 1px;
  height: 12px;
  background: #d2d5da;
}

.codex-usage[data-tone="warning"] {
  background: #fff8e6;
  border-color: #f3d27d;
  color: #5c4400;
}

.codex-usage[data-tone="warning"] strong { color: #8a6500; }

.codex-usage[data-tone="danger"] {
  background: #fff0f0;
  border-color: #f5a3a0;
  color: #b42318;
}

.codex-usage[data-tone="danger"] strong { color: #b42318; }

.new-product-desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #d2d5da;
  background: #ffffff;
  color: #49505a;
  border-radius: 8px;
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}

.new-product-desc-toggle:hover { border-color: #b1b5bb; color: #202223; }

.new-product-desc-toggle[aria-pressed="true"] {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #ffffff;
}

.new-product-desc-toggle svg { width: 14px; height: 14px; }

.new-product-desc-preview {
  border: 1px solid #d2d5da;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #ffffff;
  color: #202223;
  font-size: 0.92rem;
  line-height: 1.55;
  min-height: 220px;
  max-height: 480px;
  overflow-y: auto;
  cursor: text;
}

.new-product-desc-preview[contenteditable="true"]:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.new-product-desc-preview[hidden] { display: none; }

.new-product-desc-preview p { margin: 0 0 0.8rem; }
.new-product-desc-preview p:last-child { margin-bottom: 0; }
.new-product-desc-preview ul,
.new-product-desc-preview ol { margin: 0 0 0.85rem 1.3rem; padding: 0; }
.new-product-desc-preview li { margin: 0.15rem 0; }
.new-product-desc-preview strong { color: #202223; }

.new-product-desc-field[data-desc-view="preview"] textarea { display: none; }
.new-product-desc-field[data-desc-view="preview"] .new-product-desc-preview { display: block; }

.new-product-extra-instructions textarea {
  min-height: 60px;
  resize: vertical;
}

.new-product-category-field [data-category-panel] {
  max-height: 380px;
}

.new-product-desc-status {
  margin: 0.4rem 0 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: #f4f6f8;
  color: #49505a;
  font-size: 0.82rem;
}

.new-product-desc-status[data-tone="error"] {
  background: #fff0f0;
  color: #b42318;
}

.new-product-desc-status[data-tone="ok"] {
  background: #ecfdf3;
  color: #0c6f56;
}

.new-product-desc-debug {
  margin-top: 0.55rem;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  background: #fafbfc;
  padding: 0 0.85rem;
  font-size: 0.82rem;
}

.new-product-desc-debug[hidden] { display: none; }

.new-product-desc-debug summary {
  cursor: pointer;
  padding: 0.55rem 0;
  color: #49505a;
  font-weight: 600;
  list-style: revert;
}

.new-product-desc-debug summary:hover { color: #1f6feb; }

.new-product-desc-debug ul {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  border-top: 1px solid #ececec;
  padding-top: 0.55rem;
}

.new-product-desc-debug li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 0.6rem;
  align-items: baseline;
}

.new-product-desc-debug li strong {
  color: #49505a;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.new-product-desc-debug .debug-applied { color: #0c6f56; }
.new-product-desc-debug .debug-rejected { color: #b42318; }
.new-product-desc-debug .debug-empty { color: #6d7175; font-style: italic; }
.new-product-desc-debug code {
  background: #ffffff;
  border: 1px solid #e3e6ea;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.78rem;
}

.new-product-desc-debug details {
  margin: 0;
}

.new-product-desc-debug details summary {
  padding: 0.1rem 0;
  font-weight: 500;
  font-size: 0.78rem;
}

.debug-raw {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.75rem;
  background: #ffffff;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  max-height: 320px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #202223;
  white-space: pre-wrap;
  word-break: break-word;
}

.new-product-images-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.new-product-images-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.new-product-upload-status {
  margin: 0 0 0.6rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  background: #f4f6f8;
  color: #49505a;
  font-size: 0.82rem;
}

.new-product-upload-status[data-tone="error"] {
  background: #fff0f0;
  color: #b42318;
}

.new-product-upload-status[data-tone="ok"] {
  background: #ecfdf3;
  color: #0c6f56;
}

.new-product-images-head strong {
  font-size: 0.88rem;
  color: #202223;
}

.new-product-images-head span {
  font-size: 0.78rem;
  color: #6d7175;
}

/* --- Combobox (vendor / product type) ------------------------------- */
.combobox-trigger {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid #d2d5da;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: #202223;
  cursor: pointer;
  text-align: left;
  min-height: 38px;
}

.combobox-trigger:hover { border-color: #b1b5bb; }

.combobox-trigger:focus,
.new-product-field[data-combobox].is-open .combobox-trigger {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.combobox-trigger-value {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.combobox-trigger-value.is-placeholder {
  color: #9ca3af;
}

.combobox-caret {
  width: 14px;
  height: 14px;
  color: #6d7175;
  flex-shrink: 0;
  transition: transform 120ms ease;
}

.new-product-field[data-combobox].is-open .combobox-caret {
  transform: rotate(180deg);
}

.new-product-field[data-combobox] {
  position: relative;
}

.combobox-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 18, 22, 0.12);
  max-height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.combobox-panel[hidden] { display: none; }

.combobox-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #ececec;
  background: #ffffff;
}

.combobox-search svg {
  width: 16px;
  height: 16px;
  color: #6d7175;
  flex-shrink: 0;
}

.combobox-search input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  font: inherit;
  font-size: 0.9rem;
  padding: 0;
  background: transparent;
  color: #202223;
}

.combobox-options {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.combobox-options li { margin: 0; padding: 0; }

.combobox-option {
  width: 100%;
  display: block;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  color: #202223;
  cursor: pointer;
}

.combobox-option:hover,
.combobox-option:focus {
  background: #f4f6f8;
  outline: none;
}

.combobox-option.is-selected {
  background: #ecf2ff;
  color: #1f6feb;
  font-weight: 600;
}

.combobox-empty {
  margin: 0;
  padding: 0.7rem 0.95rem;
  color: #6d7175;
  font-size: 0.85rem;
}

.combobox-add {
  width: 100%;
  display: block;
  text-align: left;
  border: none;
  border-top: 1px solid #ececec;
  background: #fafbfc;
  padding: 0.6rem 0.95rem;
  font: inherit;
  font-size: 0.88rem;
  color: #1f6feb;
  font-weight: 600;
  cursor: pointer;
}

.combobox-add:hover { background: #ecf2ff; }

.new-product-tag-suggestions,
.new-product-collection-picker {
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fafbfc;
  display: grid;
  gap: 0.6rem;
}

.new-product-tag-suggestions[hidden],
.new-product-collection-picker[hidden],
.new-product-tag-suggestions-launcher[hidden] { display: none; }

.new-product-tag-suggestions-launcher {
  display: inline-flex;
}

.new-product-tag-suggestions-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 0.4rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #1f6feb;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.new-product-tag-suggestions-count:empty { display: none; }

/* --- Suggested tags popup ------------------------------------------- */
.tag-suggestions-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tag-suggestions-modal[hidden] { display: none; }

.tag-suggestions-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.tag-suggestions-modal-card {
  position: relative;
  max-width: min(92vw, 760px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.tag-suggestions-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.1rem 0.5rem;
}

.tag-suggestions-modal-head strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.tag-suggestions-modal-head small {
  color: #6b7280;
  font-size: 0.82rem;
}

.tag-suggestions-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f1f4f8;
  color: #1f2937;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.tag-suggestions-modal-close:hover { background: #e3e8ee; }

.tag-suggestions-modal-body {
  padding: 0.5rem 1.1rem 1rem;
  overflow-y: auto;
}

.tag-suggestions-modal-body .new-product-collection-search {
  width: 100%;
  margin-bottom: 0.7rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d4d8df;
  border-radius: 8px;
  font: 500 0.88rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #ffffff;
}

.tag-suggestions-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem 1rem;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}

.new-product-chip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.new-product-chip-head strong {
  font-size: 0.92rem;
  color: #202223;
}

.new-product-chip-head small {
  font-size: 0.78rem;
  color: #6d7175;
}

.new-product-collection-search {
  border: 1px solid #d2d5da;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: #ffffff;
  color: #202223;
}

.new-product-collection-search:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.new-product-chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* When the collection picker uses grouped sections, switch the cloud to block flow
   so the section headers stack instead of fighting the flex layout. */
.new-product-chip-cloud.new-product-collection-chips {
  display: block;
  max-height: 460px;
}

.collection-group { margin: 0.5rem 0 1rem; }
.collection-group:first-child { margin-top: 0; }
.collection-group[hidden] { display: none; }

.collection-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #eceff3;
  position: sticky;
  top: 0;
  background: #fafbfc;
  z-index: 1;
}

.collection-group-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #202223;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.collection-group-count {
  font-size: 0.7rem;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.collection-group-selected {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1f4ed1;
  background: #ecf2ff;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.collection-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.new-product-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d2d5da;
  background: #ffffff;
  color: #49505a;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.new-product-chip:hover {
  border-color: #b1b5bb;
  color: #202223;
}

.new-product-chip.is-selected {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #ffffff;
}

.new-product-chip.is-selected::before {
  content: "✓";
  font-size: 0.7rem;
}

.new-product-chip.is-pinned.is-selected {
  background: #1f4ed1;
  border-color: #1f4ed1;
  cursor: default;
}

.new-product-chip.is-pinned.is-selected:hover { background: #1f4ed1; }

/* --- Settings page: Default collections picker --------------------- */
.default-collections-form {
  display: grid;
  gap: 0.85rem;
}

.default-collections-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.default-collections-meta span {
  font-size: 0.82rem;
  color: #6d7175;
}

.default-collections-search {
  border: 1px solid #d2d5da;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: #ffffff;
  color: #202223;
  min-width: 220px;
}

.default-collections-search:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.default-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.2rem;
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fafbfc;
}

.default-collection-chip {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d2d5da;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.85rem;
  color: #202223;
  user-select: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.default-collection-chip:hover {
  border-color: #b1b5bb;
}

.default-collection-chip.is-selected {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #ffffff;
}

.default-collection-chip.is-selected small { color: rgba(255, 255, 255, 0.78); }

.default-collection-chip small {
  font-size: 0.72rem;
  color: #6d7175;
}

.default-collection-chip input[type="checkbox"] {
  display: none;
}

.default-collection-chip[hidden] { display: none; }

/* --- Codex brand-voice prompt editor ----------------------------- */
.codex-prompt-form { display: grid; gap: 0.75rem; }

.codex-prompt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.codex-prompt-meta span {
  font-size: 0.82rem;
  color: #6d7175;
}

.codex-prompt-textarea {
  width: 100%;
  min-height: 360px;
  border: 1px solid #d2d5da;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  background: #ffffff;
  color: #202223;
  resize: vertical;
}

.codex-prompt-textarea:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

.new-product-chip[hidden] { display: none; }

.new-product-default-pricing {
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #fafbfc;
  display: grid;
  gap: 0.7rem;
}

.new-product-default-pricing-head { display: grid; gap: 0.2rem; }

.new-product-default-pricing-head strong {
  font-size: 0.92rem;
  color: #202223;
}

.new-product-default-pricing-head small {
  font-size: 0.78rem;
  color: #6d7175;
}

.new-product-default-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}

.new-product-image-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
}

.new-product-image-grid li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  background: transparent;
}

/* The thumbnail container hosts the image + badges + edit/remove buttons.
   Square aspect ratio and overflow:hidden live here (not on the <li>) so
   the alt-text input below stays unclipped and can grow vertically if
   the user types a long alt. */
.new-product-image-thumb {
  position: relative;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f8f9fa;
}

.new-product-image-grid li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* The <li> is the draggable element for reorder. Stop the browser's
     native image-drag from hijacking the grab (caused "some photos move,
     some don't" depending on where the tile was grabbed). */
  -webkit-user-drag: none;
  user-drag: none;
}

.new-product-image-grid li.is-selected .new-product-image-thumb {
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.22);
}

/* Alt-text input — narrow, lightweight, sits flush under the thumbnail. */
.new-product-image-alt {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d1d5da;
  border-radius: 6px;
  background: #ffffff;
  font: 500 0.72rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #24292f;
  outline: none;
  cursor: text;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.new-product-image-alt::placeholder {
  color: #8b949e;
  font-style: italic;
}

.new-product-image-alt:focus {
  border-color: #1f6feb;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.18);
}

/* Make the alt input visually pop when it has a value, so the user can
   see at-a-glance which images have alt text and which don't. */
.new-product-image-alt:not(:placeholder-shown) {
  background: #f0f7ff;
  border-color: #b3d4f8;
}

/* ===================================================================== */
/* CRO image-suggestions modal                                            */
/* ===================================================================== */
/* Triggered by the 🎯 CRO image ideas button. While the pipeline runs
   (analysis → prompts → image generation → upload) we show a stepped
   progress list. When it returns we swap in the analysis summary + 3
   generated images side-by-side, each with its own "Add to product"
   button. */

.cro-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cro-modal[hidden] { display: none; }

.cro-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.66);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.cro-modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.cro-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem 0.9rem;
  border-bottom: 1px solid #eaecef;
}

.cro-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.cro-modal-head p {
  margin: 0.2rem 0 0;
  color: #586069;
  font-size: 0.85rem;
}

.cro-modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #586069;
  padding: 0 0.3rem;
}

.cro-modal-body {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.cro-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid #eaecef;
  background: #f6f8fa;
}

/* --- Progress panel ------------------------------------------------ */
.cro-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
}

.cro-progress-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e1e4e8;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: cro-spin 0.9s linear infinite;
}

@keyframes cro-spin {
  to { transform: rotate(360deg); }
}

.cro-progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 0.92rem;
  color: #586069;
}

.cro-progress-steps li {
  padding: 0.25rem 0;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.cro-progress-steps li.is-active {
  color: #6366f1;
  font-weight: 700;
}

.cro-progress-steps li.is-done {
  color: #1a7f37;
  text-decoration: line-through;
}

/* --- Analysis panel ------------------------------------------------ */
.cro-analysis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding: 1rem;
  background: #f6f8fa;
  border-radius: 10px;
}

.cro-analysis-block {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #eaecef;
}

.cro-analysis-block h4 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #586069;
}

.cro-analysis-block ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.85rem;
  color: #24292f;
}

.cro-analysis-block li {
  margin: 0.15rem 0;
}

/* --- Image grid (3-up) -------------------------------------------- */
.cro-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.cro-image-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #eaecef;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.cro-image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  background: #f8f9fa;
}

.cro-image-card-meta {
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cro-image-card-meta strong {
  font-size: 0.92rem;
}

.cro-image-card-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ddf4ff;
  color: #0969da;
  align-self: flex-start;
}

.cro-image-card-prompt {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #586069;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  cursor: pointer;
  transition: max-height 0.2s ease;
}

.cro-image-card-prompt.is-expanded {
  max-height: 50em;
  -webkit-line-clamp: 50;
}

.cro-image-card-actions {
  display: flex;
  gap: 0.4rem;
  padding: 0 0.85rem 0.85rem;
}

.cro-image-card-actions button {
  flex: 1;
}

.cro-image-card.is-added {
  border-color: #1a7f37;
  box-shadow: 0 0 0 2px rgba(26, 127, 55, 0.15);
}

.cro-image-card.is-added .cro-image-card-actions button[data-cro-add] {
  background: #1a7f37;
  color: #ffffff;
  cursor: default;
}

/* --- Failures + error states --------------------------------------- */
.cro-failures {
  margin-top: 1rem;
  padding: 0.7rem 0.85rem;
  background: #fff8c5;
  border: 1px solid #d4a72c;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #59470c;
}

.cro-failures ul {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
}

.cro-error {
  background: #ffebe9;
  border: 1px solid #cf222e;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: #82071e;
  font-size: 0.88rem;
  margin: 0;
}

/* Variant card alt-text input. Lives in the variant body next to the
   other metadata; same styling as the product-image alt input for a
   coherent look. */
.new-product-variant-alt {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid #d1d5da;
  border-radius: 6px;
  background: #ffffff;
  font: 500 0.74rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #24292f;
  outline: none;
  cursor: text;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.new-product-variant-alt::placeholder {
  color: #8b949e;
  font-style: italic;
}
.new-product-variant-alt:focus {
  border-color: #1f6feb;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.18);
}
.new-product-variant-alt:not(:placeholder-shown) {
  background: #f0f7ff;
  border-color: #b3d4f8;
}

.new-product-image-grid li {
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.new-product-image-grid li:active { cursor: grabbing; }

.new-product-image-grid li img {
  cursor: zoom-in;
  pointer-events: auto;
}

.new-product-image-grid li.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.new-product-image-grid li.is-drop-target {
  box-shadow: 0 0 0 3px #1f6feb, 0 8px 18px rgba(31, 111, 235, 0.25);
  transform: translateY(-1px);
}

.new-product-image-position {
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 18, 22, 0.72);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.new-product-image-size {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(15, 18, 22, 0.72);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  letter-spacing: 0.01em;
}

.new-product-image-size.is-oversized {
  background: rgba(180, 35, 24, 0.92);
}

.new-product-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
  padding: 0;
}

.new-product-image-grid li:hover .new-product-image-remove {
  opacity: 1;
}

.new-product-image-remove:hover {
  background: #b42318;
}

.new-product-image-edit {
  position: absolute;
  top: 4px;
  right: 32px;
  width: 24px;
  height: 24px;
  background: rgba(31, 111, 235, 0.92);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
  padding: 0;
}

.new-product-image-grid li:hover .new-product-image-edit { opacity: 1; }
.new-product-image-edit:hover { background: #1f4ed1; }

/* --- Local Photoshop edit modal ----------------------------------- */
.image-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-editor-modal[hidden] { display: none; }

.image-editor-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.55);
}

.image-editor-modal-card {
  position: relative;
  width: min(640px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 18, 22, 0.3);
  display: flex;
  flex-direction: column;
}

.image-editor-modal-head {
  padding: 1rem 1.3rem 0.8rem;
  border-bottom: 1px solid #ececec;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-editor-modal-head strong { font-size: 1.05rem; color: #202223; }

.image-editor-modal-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: #6d7175;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.image-editor-modal-close:hover {
  background: #f3f4f6;
  color: #202223;
}

.image-editor-modal-body {
  padding: 1rem 1.3rem;
  overflow-y: auto;
  flex: 1 1 auto;
  display: grid;
  gap: 0.85rem;
}

.image-editor-steps {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid #ececec;
  display: grid;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: #49505a;
}

.image-editor-steps li strong { color: #1f6feb; margin-right: 0.35rem; }
.image-editor-steps code {
  background: #ffffff;
  border: 1px solid #d2d5da;
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-size: 0.82rem;
}

.image-editor-status {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #ecf2ff;
  color: #1f4ed1;
  font-size: 0.85rem;
}

.image-editor-status[data-tone="ok"] {
  background: #ecfdf3;
  color: #0c6f56;
}

.image-editor-status[data-tone="error"] {
  background: #fff0f0;
  color: #b42318;
}

.image-editor-unsupported {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #fff8e6;
  color: #5c4400;
  font-size: 0.85rem;
}

.image-editor-current {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  background: #fafbfc;
}

.image-editor-current img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.image-editor-current strong {
  display: block;
  font-size: 0.9rem;
  color: #202223;
  word-break: break-all;
}

.image-editor-current small {
  display: block;
  font-size: 0.78rem;
  color: #6d7175;
  margin-top: 0.2rem;
}

.image-editor-modal-footer {
  padding: 0.85rem 1.3rem;
  border-top: 1px solid #ececec;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* --- Image lightbox -------------------------------------------------- */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox[hidden] { display: none; }

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}

.image-lightbox-figure {
  position: relative;
  margin: 0;
  max-width: min(92vw, 1400px);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox-figure img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 10px;
  background: #111;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.image-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #202223;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Above the editing overlays so it's always clickable (see actions note). */
  z-index: 8;
}

.image-lightbox-close:hover {
  background: #ffffff;
}

.variant-pick-grid li {
  cursor: pointer;
}

.variant-pick-grid li.is-selected::before {
  content: "✓";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  background: #1f6feb;
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}

/* Variant image picker tools — preview + "add to product" buttons that
   appear in the top-right corner of each tile. Always slightly visible
   so users can discover them, fully opaque on hover. */
.variant-pick-grid li .variant-pick-tools {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.variant-pick-grid li .variant-pick-tool {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #1f2937;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  opacity: 0.85;
  transition: opacity 0.12s ease, transform 0.05s ease, background-color 0.12s ease;
}

.variant-pick-grid li:hover .variant-pick-tool {
  opacity: 1;
}

.variant-pick-grid li .variant-pick-tool:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1px);
}

.variant-pick-grid li .variant-pick-tool:disabled {
  background: rgba(0, 122, 92, 0.92);
  color: #ffffff;
  cursor: default;
  opacity: 0.95;
}

.variant-pick-grid li .variant-pick-tool svg {
  width: 14px;
  height: 14px;
}

.new-product-variant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.new-product-variant-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  background: #fafbfc;
}

.new-product-variant-thumb-hint {
  font-size: 0.72rem;
  color: #9ca3af;
  text-align: center;
  padding: 0 0.3rem;
}

.new-product-variant-seller {
  background: #ecf2ff !important;
  color: #1f4ed1 !important;
  border-color: #cfdbff !important;
}

.new-product-variant-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #1f6feb;
  text-decoration: none;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-product-variant-link:hover { text-decoration: underline; }

.new-product-variant-thumb {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f1f3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.72rem;
}

.new-product-variant-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.new-product-variant-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.new-product-variant-body strong {
  font-size: 0.95rem;
  color: #202223;
}

.new-product-variant-body small {
  color: #6d7175;
  font-size: 0.8rem;
}

.new-product-variant-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #49505a;
}

.new-product-variant-meta span {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.new-product-variant-actions {
  display: flex;
  gap: 0.4rem;
}

.new-product-variant-actions button {
  border: 1px solid #d2d5da;
  background: #ffffff;
  color: #49505a;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.new-product-variant-actions button:hover {
  border-color: #b42318;
  color: #b42318;
}

.new-product-variant-empty {
  margin: 0;
  padding: 1.1rem;
  border: 1px dashed #d2d5da;
  border-radius: 10px;
  text-align: center;
  color: #6d7175;
  font-size: 0.88rem;
}

.new-product-submit-card {
  flex-direction: row;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.new-product-submit-summary {
  display: grid;
  gap: 0.15rem;
}

.new-product-submit-summary strong {
  font-size: 1rem;
  color: #202223;
}

.new-product-submit-summary span {
  font-size: 0.85rem;
  color: #6d7175;
}

.new-product-submit-actions {
  display: flex;
  gap: 0.5rem;
}

.new-product-submit-status {
  flex-basis: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #f4f6f8;
  color: #49505a;
  font-size: 0.85rem;
}

.new-product-submit-status[data-tone="error"] {
  background: #fff0f0;
  color: #b42318;
}

.new-product-submit-status[data-tone="ok"] {
  background: #ecfdf3;
  color: #0c6f56;
}

/* Variant fetch modal */
.variant-fetch-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.variant-fetch-modal[hidden] { display: none; }

.variant-fetch-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.5);
}

.variant-fetch-modal-card {
  position: relative;
  width: min(780px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 18, 22, 0.3);
  overflow: hidden;
}

.variant-fetch-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: #6d7175;
  cursor: pointer;
  border-radius: 8px;
}

.variant-fetch-modal-close:hover {
  background: #f3f4f6;
  color: #202223;
}

.variant-fetch-modal-head {
  padding: 1.2rem 1.4rem 0.85rem;
  border-bottom: 1px solid #ececec;
}

.variant-fetch-modal-head h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.variant-fetch-modal-head p {
  margin: 0;
  color: #6d7175;
  font-size: 0.85rem;
}

.variant-fetch-modal-body {
  padding: 1rem 1.4rem 1.2rem;
  overflow-y: auto;
  flex: 1 1 auto;
  display: grid;
  gap: 0.85rem;
}

.variant-fetch-status {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #f4f6f8;
  color: #49505a;
  font-size: 0.85rem;
}

.variant-fetch-status[data-tone="error"] {
  background: #fff0f0;
  color: #b42318;
}

.variant-fetch-preview { display: grid; gap: 0.85rem; }

.variant-fetch-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}

.variant-fetch-images-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.variant-fetch-images-head strong {
  font-size: 0.88rem;
  color: #202223;
}

.variant-fetch-modal-footer {
  border-top: 1px solid #ececec;
  padding: 0.85rem 1.4rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn.btn-primary[disabled],
.btn.btn-secondary[disabled],
.new-product-submit-actions .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .new-product-variant-row {
    grid-template-columns: 60px 1fr;
  }
  .new-product-variant-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .new-product-variant-thumb { width: 60px; height: 60px; }
}

/* --- Inline edit (product title + variant SKU) -------------------- */
/* Title: clickable headline that turns into an input on click. SKU cells
   in the variants table get the same treatment. Hover hints with a faint
   underline + pencil affordance so it's discoverable without being noisy. */

[data-product-title-edit] {
  cursor: text;
  border-radius: 6px;
  padding: 0.1rem 0.3rem;
  margin: -0.1rem -0.3rem;
  transition: background-color 0.15s ease;
  position: relative;
}

[data-product-title-edit]:hover {
  background: rgba(0, 122, 92, 0.06);
  box-shadow: inset 0 -2px 0 rgba(0, 122, 92, 0.2);
}

[data-product-title-edit][data-inline-editing="1"] {
  background: transparent;
  box-shadow: none;
}

.inline-sku-cell {
  cursor: text;
  display: inline-block;
  border-radius: 5px;
  padding: 0.15rem 0.4rem;
  margin: -0.15rem -0.4rem;
  border: 1px dashed transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.inline-sku-cell:hover {
  background: rgba(0, 122, 92, 0.05);
  border-color: rgba(0, 122, 92, 0.25);
}

.inline-sku-cell[data-inline-editing="1"] {
  border-color: transparent;
  background: transparent;
}

.inline-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  vertical-align: middle;
}

.inline-edit-input {
  border: 1px solid rgba(0, 122, 92, 0.6);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  background: #fff;
  outline: none;
  font: inherit;
  color: inherit;
  box-shadow: 0 0 0 3px rgba(0, 122, 92, 0.12);
  width: auto;
  max-width: 100%;
}

.inline-edit-input:disabled {
  opacity: 0.7;
  cursor: progress;
}

.inline-edit-save,
.inline-edit-cancel {
  font: 600 0.78rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.inline-edit-save {
  background: #007a5c;
  color: #fff;
  border: 1px solid #007a5c;
}
.inline-edit-save:hover:not(:disabled) {
  background: #006b50;
  border-color: #006b50;
}
.inline-edit-save:disabled {
  opacity: 0.65;
  cursor: progress;
}

.inline-edit-cancel {
  background: #fff;
  color: #4b5563;
  border: 1px solid #d4d4d4;
}
.inline-edit-cancel:hover:not(:disabled) {
  background: #f5f5f5;
  color: #1f2937;
}
.inline-edit-cancel:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.inline-edit-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 0.55rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #f1f1f1;
  color: #4b5563;
  white-space: nowrap;
}
/* display:inline-flex overrides the bare `hidden` attribute, so a hidden
   status pill renders as a stray grey blob/line — guard it everywhere. */
.inline-edit-status[hidden] { display: none; }

.inline-edit-status[data-tone="ok"] {
  background: rgba(0, 122, 92, 0.12);
  color: #007a5c;
}

.inline-edit-status[data-tone="error"] {
  background: rgba(217, 51, 51, 0.12);
  color: #b32828;
}

[data-variant-sku-status] {
  display: block;
  margin: 0.25rem 0 0;
}

/* --- Lightbox: Process image (watermarkremover.io) ---------------- */
/* Sits bottom-left inside the lightbox figure with a status pill to the
   right. The button gets a subtle glow so it stands out against the dark
   backdrop, and turns dim while processing. */

/* Force-hide for elements toggled via the `hidden` HTML attribute — my
   custom `display: inline-flex` rules on these classes would otherwise win
   on specificity over the UA's `[hidden] { display: none }` rule and leave
   the buttons / dividers visible even when JS toggles them off. */
.image-lightbox-actions[hidden],
.image-lightbox-process[hidden],
.image-lightbox-divider[hidden],
.image-lightbox-status[hidden],
.image-lightbox-cropper[hidden],
.image-lightbox-cropper-rect[hidden],
.image-lightbox-cropper-hint[hidden] {
  display: none !important;
}

/* Professional lightbox toolbar — dark glass panel with grouped icon+label
   cards, like a desktop image editor's quick-action bar. Buttons inherit
   accent colour from `data-group` (AI tools = violet, manual tools = sky,
   utility = neutral, primary/cancel = green/red).

   `position: fixed` because the toolbar is draggable — once the user grabs
   the drag handle and moves it, JS sets inline `left`/`top` in viewport
   pixel coords, so fixed-positioning is what makes that math work. The
   default centred-bottom layout still uses left:50% + translateX(-50%);
   the `.is-dragged` modifier (added by JS on first drag) drops the
   transform so the inline left/top can land precisely. */
.image-lightbox-actions {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: stretch;
  gap: 1px;
  /* Must sit ABOVE the editing overlays (text z3 / erase + aicrop z4) —
     they're transparent and span the stage, so a lower z-index here would
     let them swallow clicks on these buttons (you'd see the button but a
     click would paint a brush dot instead of applying). */
  z-index: 8;
  padding: 7px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28, 31, 38, 0.86), rgba(18, 20, 26, 0.9));
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  max-width: calc(100vw - 2rem);
  flex-wrap: wrap;
  justify-content: center;
  /* Don't animate `transform` while dragging — pointermove updates the
     inline left/top many times per second and a transition would lag
     the toolbar behind the pointer. */
  transition: box-shadow 0.18s ease, opacity 0.18s ease;
}

/* When the user has dragged the toolbar at least once, JS toggles this
   class and writes inline `left`/`top` in viewport px. We clear the
   centring transform so those coordinates take effect literally. */
.image-lightbox-actions.is-dragged {
  transform: none;
  bottom: auto;
  right: auto;
}

/* Subtle lift while the user is actively dragging. */
.image-lightbox-actions.is-dragging {
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0.96;
  cursor: grabbing;
  user-select: none;
}

/* Drag handle — six-dot grip at the left edge of the toolbar. The
   pointerdown on this element starts a viewport-clamped drag; double-
   click resets the toolbar to its default centred-bottom position. */
.image-lightbox-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  align-self: stretch;
  margin-right: 2px;
  padding: 0 2px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.42);
  cursor: grab;
  touch-action: none; /* let pointermove drive the drag, not the browser scroll */
  transition: background-color 0.14s ease, color 0.14s ease;
  flex: 0 0 auto;
}

.image-lightbox-drag-handle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.image-lightbox-drag-handle:active,
.image-lightbox-actions.is-dragging .image-lightbox-drag-handle {
  cursor: grabbing;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.image-lightbox-drag-handle svg {
  width: 8px;
  height: 16px;
  display: block;
}

.image-lightbox-divider {
  width: 1px;
  align-self: center;
  height: 26px;
  margin: 0 5px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.16) 22%,
    rgba(255, 255, 255, 0.16) 78%,
    rgba(255, 255, 255, 0)
  );
}

.image-lightbox-process {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 62px;
  padding: 7px 9px 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  border-radius: 10px;
  font: 600 0.68rem/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.08s ease;
}

.image-lightbox-process span {
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.68rem;
  text-align: center;
}

.image-lightbox-process:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.image-lightbox-process:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(1px);
}

.image-lightbox-process:disabled {
  opacity: 0.38;
  cursor: progress;
  transform: none;
}

.image-lightbox-process svg {
  width: 19px;
  height: 19px;
  display: block;
  transition: color 0.14s ease, transform 0.12s ease;
}

.image-lightbox-process:hover:not(:disabled) svg {
  transform: translateY(-1px);
}

/* --- Group accents -------------------------------------------------- */
.image-lightbox-process[data-group="ai"] svg {
  color: #a78bfa;
}
.image-lightbox-process[data-group="ai"]:hover:not(:disabled) {
  background: rgba(167, 139, 250, 0.18);
}
.image-lightbox-process[data-group="ai"]:hover:not(:disabled) svg {
  color: #c4b5fd;
}

.image-lightbox-process[data-group="manual"] svg {
  color: #7dd3fc;
}
.image-lightbox-process[data-group="manual"]:hover:not(:disabled) {
  background: rgba(125, 211, 252, 0.16);
}

.image-lightbox-process[data-group="util"] svg {
  color: rgba(255, 255, 255, 0.78);
}

/* Primary action (Apply / Save) — pops with brand green. A real button:
   filled, subtly gradient'd, with its label always visible (white). */
.image-lightbox-process[data-group="primary"] {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #ffffff;
  margin-left: 3px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.image-lightbox-process[data-group="primary"] svg { color: #ffffff; }
.image-lightbox-process[data-group="primary"]:hover:not(:disabled) {
  background: linear-gradient(180deg, #28d067, #15803d);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.image-lightbox-process[data-group="primary"]:hover:not(:disabled) svg {
  transform: none;
}
.image-lightbox-process[data-group="primary"]:disabled {
  background: rgba(34, 197, 94, 0.4);
  box-shadow: none;
}

/* Cancel / destructive — quiet ghost button with a red tint on hover. */
.image-lightbox-process[data-group="cancel"] {
  color: rgba(255, 255, 255, 0.66);
}
.image-lightbox-process[data-group="cancel"] svg {
  color: #f87171;
}
.image-lightbox-process[data-group="cancel"]:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
}

/* --- Status pill ---------------------------------------------------- */
/* Sits inside the dark glass toolbar, so it's a tinted-glass chip — NOT a
   bright solid block that fights the action buttons. A coloured dot carries
   the tone; the text stays calm and legible. */
.image-lightbox-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  padding: 0.42rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font: 500 0.72rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 260px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  margin-left: 6px;
}

/* Tone dot — drawn with a pseudo-element so no markup change is needed. */
.image-lightbox-status::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.image-lightbox-status[data-tone="ok"] {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.32);
}
.image-lightbox-status[data-tone="ok"]::before {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.image-lightbox-status[data-tone="error"] {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.34);
}
.image-lightbox-status[data-tone="error"]::before {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* Tighter spacing on narrower viewports — toolbar wraps to 2 rows
   gracefully because of flex-wrap above. */
@media (max-width: 640px) {
  .image-lightbox-actions {
    bottom: 0.7rem;
    padding: 4px;
    gap: 1px;
  }
  .image-lightbox-process {
    min-width: 56px;
    padding: 6px 8px;
  }
  .image-lightbox-process span {
    font-size: 0.65rem;
  }
}

/* --- Image lightbox: Extract on white (crop selector) ---------------- */
/* The stage wraps the <img> so the cropper overlay can absolute-position
   over the same box. Image sizing is unchanged — stage just hugs it. */
.image-lightbox-stage {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  max-height: 92vh;
}

.image-lightbox-cropper {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  user-select: none;
  touch-action: none;
}

.image-lightbox-cropper[hidden] { display: none; }

.image-lightbox-cropper-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  font: 600 0.85rem/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.image-lightbox-cropper-aspect {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font: 600 0.78rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: background-color 0.12s ease;
}

.image-lightbox-cropper-aspect::before {
  content: "⛶";
  font-size: 0.95rem;
  line-height: 1;
}

.image-lightbox-cropper-aspect:hover {
  background: rgba(0, 0, 0, 0.75);
}

.image-lightbox-cropper-aspect[data-locked="true"] {
  background: rgba(0, 122, 92, 0.95);
  border-color: rgba(255, 255, 255, 0.55);
}

.image-lightbox-cropper-hint[hidden] { display: none; }

.image-lightbox-cropper-rect {
  position: absolute;
  border: 2px dashed #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  cursor: move;
}

.image-lightbox-cropper-rect[hidden] { display: none; }

.image-lightbox-cropper-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #1f2937;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.image-lightbox-cropper-handle[data-crop-handle="nw"] { top: -8px; left: -8px; cursor: nwse-resize; }
.image-lightbox-cropper-handle[data-crop-handle="ne"] { top: -8px; right: -8px; cursor: nesw-resize; }
.image-lightbox-cropper-handle[data-crop-handle="sw"] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.image-lightbox-cropper-handle[data-crop-handle="se"] { bottom: -8px; right: -8px; cursor: nwse-resize; }
.image-lightbox-cropper-handle[data-crop-handle="n"]  { top: -8px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.image-lightbox-cropper-handle[data-crop-handle="s"]  { bottom: -8px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.image-lightbox-cropper-handle[data-crop-handle="w"]  { left: -8px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.image-lightbox-cropper-handle[data-crop-handle="e"]  { right: -8px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

/* Fill-category-metafields status pill under the product detail command bar. */
.metafields-fill-status {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font: 500 0.85rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
  background: #f1f4f8;
}

.metafields-fill-status[data-tone="ok"] {
  background: #e0f5ec;
  color: #075e3d;
}

.metafields-fill-status[data-tone="error"] {
  background: #fdecec;
  color: #8a1c1c;
}

/* ===================================================================== */
/* Brand-font text editor                                                 */
/* ===================================================================== */
/* In-browser editor that opens when the user clicks "Brand font" on the
   image lightbox. The cleaned (inpainted) background is shown as the
   <img> source; each detected text becomes a draggable, content-editable
   overlay rendered with the actual brand font via @font-face. When the
   user clicks Apply, the frontend POSTs the final text positions and
   contents back; the server rasterises them onto the cleaned background
   with Pillow using identical metrics (font, size, tracking) so the
   in-browser preview is pixel-faithful to the saved result. */

@font-face {
  font-family: "FuturaPT Heavy Oblique";
  src: url("/static/fonts/FuturaPT-HeavyOblique.otf") format("opentype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/* Overlay container — sits exactly on top of the rendered image and
   provides the coordinate space for absolutely-positioned text
   elements. The container's pixel dimensions match the IMAGE's
   rendered size (not natural size), and a JS scale factor converts
   between natural and rendered coords. */
.lightbox-text-editor {
  position: absolute;
  inset: 0;
  pointer-events: none;            /* default — only text elements opt in */
  z-index: 3;                       /* above cropper overlay */
}

.lightbox-text-editor[hidden] { display: none !important; }

/* Canvas: holds all draggable text elements. Identical to the editor
   container in size and inset; separated so JS can wipe just the text
   elements (innerHTML = "") on enter without nuking the toolbar. */
.lightbox-text-editor-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Top-of-overlay toolbar — Add Text button + size/color controls for
   the selected text. Visually matches the erase toolbar so the editor
   modes feel consistent. */
.lightbox-text-editor-toolbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(28, 31, 38, 0.9), rgba(18, 20, 26, 0.92));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  z-index: 5;
  pointer-events: auto;
}

.lightbox-text-editor-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  color: #ffffff;
  font: 600 0.72rem/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: background-color 0.14s ease, box-shadow 0.14s ease, transform 0.05s ease;
}

.lightbox-text-editor-action svg {
  width: 14px;
  height: 14px;
}

.lightbox-text-editor-action:hover {
  background: linear-gradient(180deg, #7c7ff5, #4f46e5);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.lightbox-text-editor-action:active {
  transform: translateY(1px);
}

.lightbox-text-editor-divider {
  width: 1px;
  align-self: center;
  height: 26px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.12);
}

/* Controls wrapper — disabled state dims everything when no text is
   selected so it's obvious why the inputs aren't doing anything. */
.lightbox-text-editor-controls {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
  transition: opacity 0.14s ease;
}

.lightbox-text-editor-controls.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.lightbox-text-editor-control {
  display: inline-flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}

.lightbox-text-editor-step {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  padding: 0 8px;
  font: 700 0.78rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  min-width: 28px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.lightbox-text-editor-step:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.lightbox-text-editor-num {
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  width: 54px;
  text-align: center;
  font: 600 0.74rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Hide the spinner arrows that Firefox/Chromium add — we have our
     own +/− buttons that match the toolbar look. */
  -moz-appearance: textfield;
}
.lightbox-text-editor-num::-webkit-outer-spin-button,
.lightbox-text-editor-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Color control — the dot is purely visual; the real <input type="color">
   sits behind it taking the same footprint. Clicking opens the picker. */
.lightbox-text-editor-color {
  position: relative;
  align-items: center;
  padding: 0 4px;
  cursor: pointer;
}

.lightbox-text-editor-color-label {
  font-size: 1.2rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  padding: 0 4px;
  text-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.55));
}

.lightbox-text-editor-color input[type="color"] {
  /* Native picker takes the whole control. The visual swatch above
     gets coloured by JS via a `style` attr to match the current pick. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;       /* hidden — we rely on the label's coloured dot */
}

/* Each text element is positioned absolutely inside the editor with
   left/top/width/font-size set INLINE BY JS in rendered (post-scale)
   pixel coords. The element's natural coords are kept in JS state
   (textEditorState.elements) so we can re-layout on resize and POST
   them to /finalize for server-side rendering. */
.lightbox-text-element {
  position: absolute;
  /* left, top, width, min-height, font-size, color set by JS. */
  /* Centre the text vertically within the box (and grow downward past
     min-height for multi-line) so the editor preview matches the
     server, which centres the rendered block in the same box. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: "FuturaPT Heavy Oblique", "Futura PT", "Futura", sans-serif;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  /* −44 em-units (Adobe/InDesign convention) = −0.044em letter-spacing.
     Must match BRAND_TRACKING_EM on the server so what you see in the
     browser is what Pillow rasterises on save. */
  letter-spacing: -0.044em;
  text-align: center;
  padding: 0;
  margin: 0;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  /* Dashed outline so text is always findable against any background;
     swaps to a solid indigo ring while selected, green while editing. */
  outline: 1px dashed rgba(99, 102, 241, 0.45);
  outline-offset: 2px;
  border-radius: 2px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  transform-origin: 0 0;
  transition: outline-color 0.1s ease, box-shadow 0.12s ease;
}

/* Inner content span — this is the contenteditable bit. Keeping the
   editable region separate from the wrapper means drag/click/delete-
   button events on the wrapper don't get tangled with caret handling
   inside the editable text. */
.lightbox-text-element-content {
  display: block;
  width: 100%;
  /* No fixed height: the span hugs its line(s) so the flex parent can
     centre it vertically. white-space:pre keeps explicit Shift+Enter
     line breaks without auto-wrapping (the server renders each line
     as-is, so the editor must not wrap either). */
  outline: none;          /* the wrapper draws the selection outline */
  pointer-events: none;   /* drag interactions live on the wrapper */
  white-space: pre;
  overflow: visible;
}

.lightbox-text-element.is-editing .lightbox-text-element-content {
  pointer-events: auto;   /* only intercept clicks while editing */
  cursor: text;
}

.lightbox-text-element:hover {
  outline-color: rgba(99, 102, 241, 0.8);
}

.lightbox-text-element.is-selected {
  outline: 2px solid #6366f1;
  outline-offset: 3px;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.lightbox-text-element.is-dragging {
  cursor: grabbing;
  outline-color: #4338ca;
  opacity: 0.92;
}

.lightbox-text-element.is-editing {
  cursor: text;
  outline: 2px solid #22c55e;
  outline-offset: 3px;
  /* Tiny background so the cursor is visible on any colour. */
  background: rgba(255, 255, 255, 0.06);
}

/* Per-element delete button — appears at top-right of a selected
   element. Removes the text from the editor; on Apply it won't be
   rendered at all (handy for stripping watermarks the OCR caught). */
.lightbox-text-element-delete {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.lightbox-text-element.is-selected .lightbox-text-element-delete {
  display: inline-flex;
}

.lightbox-text-element-delete:hover {
  background: #dc2626;
  transform: scale(1.08);
}

/* ===================================================================== */
/* Object-erase ("magic eraser") overlay                                   */
/* ===================================================================== */
/* In erase mode the user clicks/drags on unwanted objects. Each click
   becomes a red dot at the current brush size; the dots accumulate
   visually so the user sees exactly what will be removed before they
   commit. On Apply, the dot list ships to /object-remove which builds
   a binary mask and runs LaMa inpainting. */

.lightbox-erase-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;            /* above text editor + cropper */
  cursor: crosshair;
  pointer-events: auto;
  touch-action: none;     /* swallow pinch/scroll so dragging draws */
}

.lightbox-erase-overlay[hidden] { display: none !important; }

/* The cursor preview ring — shows the brush footprint, positioned by
   JS via inline left/top each pointermove. Pointer-events:none so it
   never blocks the underlying overlay from receiving clicks. */
.lightbox-erase-cursor {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.9);
  background: rgba(239, 68, 68, 0.12);
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  /* No transition — should track the pointer exactly. */
}

.lightbox-erase-cursor[hidden] { display: none !important; }

/* SVG layer holding every painted shape (circle/brush/rect/polygon).
   The viewBox is set to natural pixel coords by JS so shape data can
   stay in natural space and auto-scale to whatever size the image is
   rendered at. The `width:100%; height:100%` fills the overlay; the
   overlay itself matches the image rect via the inset:0 rule above. */
.lightbox-erase-shapes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Every shape gets the same look: semi-transparent red fill + crisp
   red stroke. `vector-effect: non-scaling-stroke` keeps stroke widths
   visually constant no matter how aggressively the SVG scales. */
.lightbox-erase-svg-shape {
  fill: rgba(239, 68, 68, 0.4);
  stroke: rgba(239, 68, 68, 0.95);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

/* Polygon-in-progress: dashed preview line from the last vertex to
   the current pointer position (rendered by JS, refreshed on
   pointermove). Lighter so it reads as "not yet committed". */
.lightbox-erase-svg-preview {
  fill: rgba(239, 68, 68, 0.18);
  stroke: rgba(239, 68, 68, 0.85);
  stroke-width: 1.5;
  stroke-dasharray: 5 3;
  vector-effect: non-scaling-stroke;
}

/* Polygon vertex dots while the polygon is still being drawn. */
.lightbox-erase-svg-vertex {
  fill: rgba(255, 255, 255, 0.95);
  stroke: rgba(220, 38, 38, 1);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

/* Tool palette pinned to the top of the overlay. Floats above the
   image with a dark glass background so it stays readable on any
   image content. */
.lightbox-erase-toolbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(17, 20, 25, 0.86);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 5;
}

.lightbox-erase-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 56px;
  padding: 6px 9px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: 600 0.68rem/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.lightbox-erase-tool svg {
  width: 18px;
  height: 18px;
  display: block;
}

.lightbox-erase-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.lightbox-erase-tool.is-active {
  background: rgba(239, 68, 68, 0.22);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.55);
}

.lightbox-erase-tool.is-active svg {
  color: #fca5a5;
}

.lightbox-erase-toolbar-divider {
  width: 1px;
  align-self: center;
  height: 26px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.12);
}

/* Brush-size readout in the toolbar — sits next to the toolbar buttons
   while erase mode is open. We piggyback on the existing status-pill
   look so the toolbar stays visually coherent. */
.lightbox-erase-brush-readout {
  background: rgba(99, 102, 241, 0.95) !important;
  color: #ffffff !important;
  font: 600 0.72rem/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.02em;
}


/* Green "Place order to Cuztom" button — one-click Cuztom fulfillment */
.btn.btn-success {
  background: #1f8a4c;
  border-color: #1f8a4c;
  color: #ffffff;
}
.btn.btn-success:hover {
  background: #1a7741;
  border-color: #1a7741;
}
.btn.btn-success:active {
  background: #156336;
}
.btn.btn-success:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.supplier-place-order-cuztom-button {
  width: 100%;
}

/* AI Crop inline panel-selection input (in-app, replaces native prompt) */
.image-lightbox-aicrop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.image-lightbox-aicrop[hidden] {
  display: none;
}
.image-lightbox-aicrop-input {
  height: 34px;
  min-width: 240px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: 600 0.78rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.image-lightbox-aicrop-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}
.image-lightbox-aicrop-input:focus {
  outline: none;
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.14);
}

/* Multi-merge: panel-number prompt label (shares the aicrop input row) */
.image-lightbox-merge-prompt {
  color: rgba(255, 255, 255, 0.9);
  font: 600 0.74rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 320px;
}

/* Multi-merge: image picker overlay (grid of all product images) */
.lightbox-merge-picker {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(4px);
  border-radius: inherit;
}
.lightbox-merge-picker[hidden] {
  display: none;
}
.lightbox-merge-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: #ffffff;
  font: 700 0.95rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.lightbox-merge-picker-close {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-merge-picker-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-merge-picker-grid {
  list-style: none;
  margin: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  overflow-y: auto;
}
.lightbox-merge-pick {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  transition: border-color 0.14s ease, transform 0.05s ease;
}
.lightbox-merge-pick:hover {
  border-color: #a78bfa;
  transform: translateY(-1px);
}
.lightbox-merge-pick img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.lightbox-merge-pick-idx {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(15, 17, 21, 0.82);
  color: #fff;
  font: 700 0.72rem/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}

/* Dashboard: Recently added best sellers */
.recent-best-sellers-card .section-head {
  margin-bottom: 8px;
}
.recent-best-sellers {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.recent-best-seller-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.recent-best-seller-row:first-child {
  border-top: none;
}
.recent-best-seller-row .rbs-rank {
  font: 700 0.85rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #9ca3af;
  text-align: center;
}
.recent-best-seller-row .rbs-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.recent-best-seller-row .rbs-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f3f4f6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recent-best-seller-row .rbs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recent-best-seller-row .rbs-title {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-best-seller-row .rbs-main:hover .rbs-title {
  text-decoration: underline;
}
.recent-best-seller-row .rbs-units {
  font-size: 0.85rem;
  color: #6b7280;
  white-space: nowrap;
}
.recent-best-seller-row .rbs-units strong {
  color: #111827;
  font-size: 0.95rem;
}
.recent-best-seller-row .rbs-revenue {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: 84px;
  text-align: right;
}

/* Ask about our products — AI catalog Q&A on the Products page */
.ask-products {
  margin-bottom: 16px;
}
.ask-products-head h2 {
  margin: 0 0 2px;
}
.ask-products-head p {
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 0.85rem;
}
.ask-products-head p em {
  color: #374151;
  font-style: italic;
}
.ask-products-log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 540px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 4px;
}
.ask-turn {
  display: flex;
  flex-direction: column;
}
.ask-turn-user {
  align-items: flex-end;
}
.ask-turn-user .ask-bubble {
  background: var(--brand, #2563eb);
  color: #fff;
  padding: 8px 14px;
  border-radius: 14px 14px 2px 14px;
  max-width: 80%;
  font-size: 0.9rem;
  font-weight: 500;
}
.ask-answer {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #111827;
  white-space: pre-wrap;
}
.ask-answer.is-error {
  color: #b91c1c;
}
.ask-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.ask-result-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(22, 29, 37, 0.08));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.14s ease, transform 0.05s ease, box-shadow 0.14s ease;
}
.ask-result-card:hover {
  border-color: var(--brand, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 29, 37, 0.12);
}
.ask-result-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 9px;
  background: #f3f4f6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ask-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ask-result-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ask-result-title {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ask-result-price {
  font-weight: 700;
  font-size: 0.85rem;
  color: #111827;
}
.ask-result-reason {
  font-size: 0.74rem;
  color: #6b7280;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ask-products-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.ask-products-form textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--border, #d1d4d6);
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
}
.ask-products-form textarea:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
}
.ask-products-form .btn {
  flex: 0 0 auto;
  height: 42px;
}

/* Ask about our orders — order result cards + filter chips */
.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ask-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  padding: 2px 10px;
}
.ask-chip-muted {
  color: #9ca3af;
}
.ask-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.ask-order-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(22, 29, 37, 0.08));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.14s ease, transform 0.05s ease, box-shadow 0.14s ease;
}
.ask-order-card:hover {
  border-color: var(--brand, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 29, 37, 0.12);
}
.ask-order-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.ask-order-name {
  font-weight: 700;
  font-size: 0.92rem;
}
.ask-order-total {
  font-weight: 700;
  font-size: 0.9rem;
  color: #111827;
}
.ask-order-customer {
  font-size: 0.82rem;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ask-order-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ask-order-status {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--s, #6b7280);
  border-radius: 999px;
  padding: 2px 9px;
}
.ask-order-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 2px 9px;
  text-transform: capitalize;
}
.ask-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
  color: #6b7280;
}
.ask-order-due {
  color: #b45309;
  font-weight: 600;
}

/* Orders pagination controls */
.orders-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 8px 4px;
}
.orders-pagination-info {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 600;
}
.orders-pagination .btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

/* Live order search: subtle loading state while results refresh */
.orders-results {
  position: relative;
  transition: opacity 0.12s ease;
}
.orders-results.is-loading {
  opacity: 0.55;
  pointer-events: none;
}
.orders-results-meta {
  text-align: right;
  color: #6b7280;
  font-size: 0.82rem;
  padding: 0 2px 8px;
}

/* Order Time KPI — backfill control + breach metric cards */
.order-time-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.order-time-backfill-status {
  font-size: 0.74rem;
  color: #6b7280;
  max-width: 240px;
  text-align: right;
}
.metric-card.metric-card-danger strong {
  color: #d9485f;
}
.metric-card.metric-card-danger {
  border-color: rgba(217, 72, 95, 0.28);
}

/* Order Time year-over-year comparison chart */
.otc-card { margin-bottom: 16px; }
.otc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.otc-head h2 { margin: 2px 0; }
.otc-head p { margin: 0; color: #6b7280; font-size: 0.85rem; }
.otc-summary { text-align: right; }
.otc-legend { display: flex; gap: 14px; justify-content: flex-end; font-size: 0.78rem; color: #4b5563; }
.otc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.otc-swatch { width: 14px; height: 0; border-top: 3px solid; display: inline-block; border-radius: 2px; }
.otc-swatch-current { border-top-color: #2563eb; }
.otc-swatch-previous { border-top-color: #9ca3af; border-top-style: dashed; }
.otc-headline { display: flex; align-items: baseline; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.otc-headline strong { font-size: 1.4rem; }
.otc-delta { font-size: 0.85rem; font-weight: 700; }
.otc-delta.is-good { color: #1f9d72; }
.otc-delta.is-bad { color: #d9485f; }
.otc-summary small { color: #9ca3af; font-size: 0.76rem; }
.otc-chart { width: 100%; }
.otc-svg { width: 100%; height: auto; display: block; }
.otc-grid { stroke: #eef0f2; stroke-width: 1; }
.otc-axis { fill: #9ca3af; font-size: 11px; }
.otc-line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.otc-line-current { stroke: #2563eb; }
.otc-line-previous { stroke: #9ca3af; stroke-dasharray: 5 5; stroke-width: 2; }
.otc-area { stroke: none; }
.otc-dot { fill: #2563eb; }
.otc-dot-last { fill: #2563eb; stroke: #fff; stroke-width: 2; }
.otc-empty { color: #9ca3af; font-size: 0.85rem; padding: 24px 4px; text-align: center; }

/* Order Time KPI drill-down: clickable breach cards + orders filter banner */
.metric-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.14s ease, transform 0.05s ease, box-shadow 0.14s ease;
}
.metric-card-link:hover {
  border-color: var(--brand, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 29, 37, 0.12);
}
.metric-card-danger.metric-card-link:hover {
  border-color: #d9485f;
}
.orders-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(217, 72, 95, 0.28);
  background: rgba(217, 72, 95, 0.06);
  border-radius: 10px;
  font-size: 0.86rem;
  color: #374151;
}
.orders-filter-clear {
  font-weight: 700;
  font-size: 0.8rem;
  color: #b91c1c;
  text-decoration: none;
  white-space: nowrap;
}
.orders-filter-clear:hover { text-decoration: underline; }

/* ============================================================= *
 * Dashboard premium polish — cohesive hierarchy, spacing,
 * a11y (focus + reduced-motion), responsive. Appended last so it
 * harmonises the recently-added KPI/chart/best-seller sections.
 * ============================================================= */

/* Section labels that group the long dashboard stack into a clear narrative. */
.dash-section {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0.15rem 0.5rem;
}
.dash-section h3 {
  margin: 0;
  font: 700 0.78rem/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-section-meta {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* Consistent vertical rhythm between top-level dashboard blocks. */
.speed-meter-card,
.otc-card,
.recent-best-sellers-card,
[data-order-time-breaches] {
  margin-bottom: 0.25rem;
}
.dash-section + .metrics-grid,
.dash-section + [data-order-time-breaches] {
  margin-bottom: 1.25rem;
}

/* Inner result cards align to the design-token radius for a unified look. */
.ask-result-card,
.ask-order-card,
.recent-best-seller-row {
  border-radius: var(--radius-md, 14px);
}

/* Clickable cards/links: clear cursor + keyboard focus ring (a11y). */
.metric-card-link,
.ask-result-card,
.ask-order-card,
.lightbox-merge-pick,
[data-orders-page] {
  cursor: pointer;
}
.metric-card-link:focus-visible,
.ask-result-card:focus-visible,
.ask-order-card:focus-visible,
.recent-best-sellers a:focus-visible,
.orders-filter-clear:focus-visible,
[data-orders-page]:focus-visible {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 2px;
  border-radius: var(--radius-md, 14px);
}

/* Responsive: KPI grids reflow gracefully (4 → 2 → 1). */
@media (max-width: 1024px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

/* Respect reduced-motion: no transforms/animation for sensitive users. */
@media (prefers-reduced-motion: reduce) {
  .metric-card-link,
  .ask-result-card,
  .ask-order-card,
  .recent-best-seller-row,
  .otc-line,
  .speed-meter-needle,
  .speed-meter-value {
    transition: none !important;
    animation: none !important;
  }
  .metric-card-link:hover,
  .ask-result-card:hover,
  .ask-order-card:hover {
    transform: none !important;
  }
}

/* Product detail: tag chips + variant stock label (restored displays) */
.product-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .9rem;
}
.product-tag-chip {
  font-size: .72rem;
  letter-spacing: .01em;
  text-transform: capitalize;
}
.variant-stock-label {
  font-variant-numeric: tabular-nums;
  color: var(--text, #1f2328);
}

/* ── Find exact style on eBay (image search + AI exact-match re-rank) ── */
.product-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.find-exact-style-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
}
.find-exact-style-button svg { flex: 0 0 auto; }
.find-exact-style-hint { font-size: 0.78rem; color: #6d7175; }

.find-exact-style-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.find-exact-style-modal[hidden] { display: none; }

.find-exact-style-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.5);
}

.find-exact-style-card {
  position: relative;
  width: min(820px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 18, 22, 0.3);
}

.find-exact-style-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6d7175;
  cursor: pointer;
  border-radius: 8px;
}
.find-exact-style-modal-close:hover { background: #f3f4f6; color: #202223; }

.find-exact-style-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.5rem 0.85rem;
  border-bottom: 1px solid #ececec;
}
.find-exact-style-head-main { min-width: 0; padding-right: 1.5rem; }
.find-exact-style-head h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.find-exact-style-head p { margin: 0; color: #6d7175; font-size: 0.88rem; }
.find-exact-style-head .fxs-queries {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: #8a9099;
}
.find-exact-style-head .fxs-matched {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #0c6f56;
  font-weight: 600;
}
.find-exact-style-head .fxs-query {
  display: inline-block;
  margin: 0.1rem 0.25rem 0 0;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #eef0f3;
  color: #49505a;
  font-weight: 600;
}

.find-exact-style-refpick { flex: 0 0 auto; margin: 0; padding-right: 1.75rem; }
.find-exact-style-refpick[hidden] { display: none; }
.fxs-refpick-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-bottom: 0.3rem;
}
.fxs-refpick-label { font-size: 0.72rem; color: #6d7175; font-weight: 700; }
.fxs-refpick-hint { font-size: 0.68rem; color: #9ca3af; }
.fxs-refpick-strip {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 240px;
}
.fxs-refthumb {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid #e5e7eb;
  border-radius: 9px;
  overflow: hidden;
  background: #f3f4f6;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.12s, border-color 0.12s;
}
.fxs-refthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fxs-refthumb:hover { opacity: 1; }
.fxs-refthumb.is-selected { border-color: #1f6feb; opacity: 1; }
.fxs-refthumb-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: #1f6feb;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.fxs-refpick-rerun {
  margin-top: 0.4rem;
  min-height: 28px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 7px;
  display: block;
  margin-left: auto;
}
.fxs-refpick-rerun[hidden] { display: none; }

.find-exact-style-body {
  padding: 1rem 1.5rem 1.3rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.find-exact-style-loading,
.find-exact-style-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1rem;
  color: #6d7175;
  font-size: 0.92rem;
  text-align: center;
}
.find-exact-style-error { color: #b42318; }
.find-exact-style-loading[hidden],
.find-exact-style-error[hidden] { display: none; }

.find-exact-style-empty {
  padding: 1.75rem 1rem;
  color: #6d7175;
  font-size: 0.92rem;
  text-align: center;
}
.find-exact-style-empty[hidden] { display: none; }
.find-exact-style-empty p { margin: 0; }

.find-exact-style-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: #1f6feb;
  border-radius: 50%;
  animation: bbpf-spin 0.7s linear infinite;
}

.find-exact-style-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.find-exact-style-results[hidden] { display: none; }

.fxs-result {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.75rem;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fafafa;
}
.fxs-result-exact { border-left: 4px solid #0c8f4f; background: #f3fbf6; }
.fxs-result-likely { border-left: 4px solid #c98a00; background: #fffaf0; }
.fxs-result-different { opacity: 0.82; }
.fxs-result-fitment { border-left: 4px solid #c2410c; background: #fff6f0; opacity: 0.92; }

.fxs-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fxs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fxs-thumb-empty { font-size: 0.74rem; color: #9ca3af; }

.fxs-result-body { display: grid; gap: 0.35rem; min-width: 0; }
.fxs-result-top { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }

.fxs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.fxs-badge span { font-weight: 600; opacity: 0.85; }
.fxs-badge-exact { background: #d7efb9; color: #0c6f56; }
.fxs-badge-likely { background: #ffe29a; color: #6b4e08; }
.fxs-badge-different { background: #eef0f3; color: #49505a; }
.fxs-badge-unknown { background: #eef0f3; color: #6d7175; }
.fxs-badge-fitment { background: #ffe0cc; color: #9a3412; }

.fxs-result-title {
  font-weight: 600;
  color: #202223;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.3;
  flex: 1 1 200px;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fxs-result-title:hover { color: #1f6feb; text-decoration: underline; }

.fxs-result-meta { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.fxs-price { font-weight: 700; color: #0c6f56; font-size: 1.02rem; }
.fxs-shipping { font-size: 0.82rem; color: #49505a; }
.fxs-tag {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #eef0f3;
  color: #49505a;
  font-size: 0.76rem;
  font-weight: 600;
}

.fxs-result-stock { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.fxs-stock, .fxs-sold {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1.4;
}
.fxs-stock-in { background: #d7efb9; color: #0c6f56; }
.fxs-stock-low { background: #ffe29a; color: #6b4e08; }
.fxs-stock-out { background: #fde2e2; color: #b42318; }
.fxs-stock-neutral { background: #eef0f3; color: #49505a; }
.fxs-sold { background: #eef4ff; color: #1f5fb4; }

.fxs-diffs {
  font-size: 0.82rem;
  color: #6d7175;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.fxs-diffs-label { font-weight: 600; color: #b42318; }
.fxs-diff {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #fde2e2;
  color: #b42318;
  font-size: 0.76rem;
}
.fxs-diffs-none { color: #0c6f56; font-weight: 600; }

.fxs-notes { margin: 0; font-size: 0.82rem; color: #6d7175; font-style: italic; }
.fxs-result-seller { font-size: 0.84rem; color: #6d7175; }
.fxs-checked { color: #0c6f56; font-weight: 600; }

.fxs-result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.2rem; }
.fxs-result-actions .btn {
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  font-size: 0.84rem;
  border-radius: 8px;
}
.fxs-add-status { font-size: 0.8rem; color: #0c6f56; font-weight: 600; }
.fxs-add-status.is-error { color: #b42318; }

/* Ship-to badges on each result + the destination filter chip row */
.fxs-ship-row { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; font-size: 0.78rem; }
.fxs-ship-label { color: #6d7175; font-weight: 600; }
.fxs-ship {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.74rem;
}
.fxs-ship-yes { background: #d7efb9; color: #0c6f56; }
.fxs-ship-no { background: #eef0f3; color: #9097a0; }
.fxs-ship-excl { color: #b42318; font-size: 0.72rem; }

.fxs-shipfilter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.fxs-shipfilter[hidden] { display: none; }
.fxs-shipfilter-label { font-size: 0.8rem; color: #6d7175; font-weight: 600; }
.fxs-shipfilter-chip {
  padding: 0.2rem 0.7rem;
  border: 1px solid #d9dce1;
  border-radius: 999px;
  background: #fff;
  color: #49505a;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.fxs-shipfilter-chip:hover { background: #f3f4f6; }
.fxs-shipfilter-chip.is-active { background: #1f6feb; border-color: #1f6feb; color: #fff; }

/* Clickable result thumbnail (opens the photo gallery) + photo-count badge */
.fxs-thumb-btn {
  position: relative;
  padding: 0;
  border: none;
  cursor: pointer;
}
.fxs-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fxs-thumb-count {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 18, 22, 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

/* Listing-photo gallery (lightbox over the Find-Exact-Style modal) */
.fxs-gallery { position: absolute; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; }
.fxs-gallery[hidden] { display: none; }
.fxs-gallery-backdrop { position: absolute; inset: 0; background: rgba(15, 18, 22, 0.75); }
.fxs-gallery-card {
  position: relative;
  width: min(680px, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #ffffff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 20px 50px rgba(15, 18, 22, 0.35);
}
.fxs-gallery-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: #6d7175;
  cursor: pointer;
  border-radius: 8px;
}
.fxs-gallery-close:hover { background: #f3f4f6; color: #202223; }
.fxs-gallery-head { display: flex; align-items: baseline; gap: 0.6rem; padding-right: 1.5rem; }
.fxs-gallery-title { font-weight: 700; font-size: 0.95rem; color: #202223; }
.fxs-gallery-counter { font-size: 0.8rem; color: #6d7175; font-variant-numeric: tabular-nums; }
.fxs-gallery-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 10px;
  min-height: 280px;
  max-height: 52vh;
  overflow: hidden;
}
.fxs-gallery-main { max-width: 100%; max-height: 52vh; object-fit: contain; display: block; }
.fxs-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(15, 18, 22, 0.2);
  font-size: 1.5rem;
  line-height: 1;
  color: #202223;
  cursor: pointer;
}
.fxs-gallery-nav:hover { background: #fff; }
.fxs-gallery-prev { left: 0.5rem; }
.fxs-gallery-next { right: 0.5rem; }
.fxs-gallery-strip { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.fxs-gallery-thumb {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  cursor: pointer;
  opacity: 0.65;
}
.fxs-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fxs-gallery-thumb:hover { opacity: 1; }
.fxs-gallery-thumb.is-active { border-color: #1f6feb; opacity: 1; }
.fxs-gallery-foot { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.fxs-gallery-foot .btn { min-height: 32px; padding: 0.35rem 0.8rem; font-size: 0.86rem; border-radius: 8px; }

@media (max-width: 540px) {
  .find-exact-style-head { flex-direction: column; }
  .fxs-result { grid-template-columns: minmax(0, 1fr); }
  .fxs-thumb { width: 100%; height: 160px; }
}

/* Scan image sizes — toolbar status text (Products page) */
.image-scan-status {
  font-size: 0.82rem;
  color: #6b7280;
  align-self: center;
  white-space: nowrap;
}

/* ===========================================================================
   Find-exact-style DEBUG panel — full per-SKU trace of the AI pipeline
   (prompts sent, raw AI responses, which images went to vision, fitment math).
   =========================================================================== */
.fxs-debug-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #d4b483;
  border-radius: 999px;
  background: #fff8ec;
  color: #92610a;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.fxs-debug-toggle:hover { background: #fdeecd; }
.fxs-debug-toggle[hidden] { display: none; }
.fxs-debug-toggle[aria-expanded="true"] { background: #fdeecd; border-color: #c69749; }

.fxs-debug {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px dashed #e3c98f;
  font-size: 0.82rem;
  color: #2b2f33;
}
.fxs-debug[hidden] { display: none; }

.fxs-dbg-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.fxs-dbg-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #eef0f3;
  color: #49505a;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.fxs-dbg-summary-row { display: flex; flex-wrap: wrap; gap: 0.4rem; width: 100%; }
.fxs-dbg-copy { margin-left: auto; padding: 0.25rem 0.7rem !important; font-size: 0.76rem !important; }

.fxs-dbg-step {
  margin: 0 0 1.1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fcfcfd;
}
.fxs-dbg-step h4 {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  color: #1a1d20;
}
.fxs-dbg-step h5 {
  margin: 0.8rem 0 0.4rem;
  font-size: 0.8rem;
  color: #49505a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fxs-dbg-kv {
  display: flex;
  gap: 0.6rem;
  padding: 0.22rem 0;
  border-bottom: 1px dotted #eef0f3;
}
.fxs-dbg-kv:last-child { border-bottom: 0; }
.fxs-dbg-k { flex: 0 0 12rem; color: #6d7175; font-weight: 600; }
.fxs-dbg-v { flex: 1 1 auto; min-width: 0; word-break: break-word; }

.fxs-dbg-block {
  margin: 0.5rem 0;
  border: 1px solid #e6e8eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.fxs-dbg-block > summary {
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-weight: 600;
  color: #1f4f9e;
  font-size: 0.78rem;
  user-select: none;
}
.fxs-dbg-block > summary:hover { background: #f4f7fc; }
.fxs-dbg-pre {
  margin: 0;
  padding: 0.7rem 0.8rem;
  max-height: 22rem;
  overflow: auto;
  border-top: 1px solid #eef0f3;
  background: #1e2127;
  color: #e6e6e6;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.fxs-dbg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}
.fxs-dbg-table th,
.fxs-dbg-table td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #eef0f3;
  vertical-align: top;
}
.fxs-dbg-table th { color: #6d7175; font-weight: 600; }
.fxs-dbg-table tr.is-bad td { background: #fdecec; color: #9a2c2c; }
.fxs-dbg-table a { color: #1f6feb; }

.fxs-dbg-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.fxs-dbg-img {
  margin: 0;
  width: 92px;
  text-align: center;
}
.fxs-dbg-img img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d8dade;
  background: #fff;
  display: block;
}
.fxs-dbg-img figcaption {
  margin-top: 0.2rem;
  font-size: 0.66rem;
  color: #6d7175;
  line-height: 1.2;
}

.fxs-dbg-recall-row {
  padding: 0.4rem 0;
  border-bottom: 1px dotted #eef0f3;
}
.fxs-dbg-recall-row.is-bad { color: #9a2c2c; }
.fxs-dbg-recall-row:last-child { border-bottom: 0; }

.fxs-dbg-cand {
  margin: 0.5rem 0;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.fxs-dbg-cand > summary {
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  user-select: none;
}
.fxs-dbg-cand > summary:hover { background: #f7f8fa; }
.fxs-dbg-cand-head {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.fxs-dbg-cand-idx {
  flex: 0 0 auto;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #eef0f3;
  color: #49505a;
  font-weight: 700;
  font-size: 0.72rem;
}
.fxs-dbg-cand-score {
  flex: 0 0 auto;
  font-weight: 700;
  color: #1a1d20;
  font-size: 0.8rem;
}
.fxs-dbg-cand-title { color: #3a3f45; font-size: 0.78rem; }
.fxs-dbg-cand-body { padding: 0.6rem 0.8rem 0.85rem; border-top: 1px solid #eef0f3; }

.fxs-dbg-err { margin: 0.4rem 0; color: #b42318; font-weight: 600; font-size: 0.78rem; }
.fxs-dbg-muted { color: #8a9099; font-size: 0.78rem; margin: 0.3rem 0; }
.fxs-dbg-list { margin: 0.3rem 0 0.3rem 1.1rem; padding: 0; font-size: 0.76rem; color: #49505a; }
.fxs-dbg-list li { margin: 0.1rem 0; word-break: break-word; }
.fxs-dbg-notes li { color: #92610a; }
.fxs-debug .fxs-query {
  display: inline-block;
  margin: 0.1rem 0.25rem 0 0;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #eef0f3;
  color: #49505a;
  font-weight: 600;
  font-size: 0.74rem;
}

/* ============================================================= *
 * Compact dashboard redesign — dense, professional ops layout.
 * Two KPI gauges share one row; metric tiles tightened; decorative
 * noise removed. Appended last so it wins on source order.
 * ============================================================= */

/* The two fulfillment gauges sit side-by-side on wide screens. */
.dash-meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.dash-meters > .speed-meter-card {
  margin-bottom: 0;
  height: 100%;
}
@media (max-width: 1180px) {
  .dash-meters { grid-template-columns: 1fr; }
}

/* Pace badge is a compact pill, not a stretched full-width bar. */
.speed-meter-headline .badge {
  justify-self: start;
}

/* KPI / metric tiles: tighter padding, calmer numbers, no doodle. */
.metric-card {
  padding: 0.8rem 0.9rem;
}
.metric-card::after {
  content: none;
}
.metric-card span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.metric-card strong {
  margin-top: 0.2rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric-card small {
  margin-top: 0.25rem;
  font-size: 0.7rem;
}
.metrics-grid {
  gap: 0.75rem;
}

/* Dashboard section headings read as quiet labels, not page titles. */
.otc-head h2,
.recent-best-sellers-card .section-head h2 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.otc-head p,
.recent-best-sellers-card .section-head p {
  font-size: 0.78rem;
}

/* List + chart cards trimmed to match the new density. */
.recent-best-sellers-card,
.otc-card {
  padding: 1rem 1.1rem;
}

/* ============================================================
   Supplier ↔ product cross-links (suppliers table + per-supplier page)
   ============================================================ */

/* Clickable product name in the suppliers table */
.supplier-product-link {
  font-weight: 700;
  color: #111827;
  text-decoration: none;
  display: inline-block;
}
.supplier-product-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Make the product thumbnail clickable without breaking its sizing */
a.supplier-thumb {
  display: block;
  text-decoration: none;
}
a.supplier-thumb:hover {
  border-color: #1d4ed8;
}

/* Clickable supplier (seller) name inside each slot card */
.supplier-name-link {
  font-weight: 700;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px dashed #c7ccd4;
}
.supplier-name-link:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

/* Per-supplier products page (supplier_products.html) */
.supplier-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding: 1rem 0 0.25rem;
}

.supplier-product-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.supplier-product-tile:hover {
  border-color: #d0d5dd;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.supplier-product-tile-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  overflow: hidden;
}
.supplier-product-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.supplier-product-tile-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #9ca3af;
  font-size: 0.8rem;
}
.supplier-product-tile-platform {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  text-transform: capitalize;
}

.supplier-product-tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem 0.95rem;
  flex: 1;
}
.supplier-product-tile-title {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.3;
}
.supplier-product-tile-title a {
  color: #111827;
  text-decoration: none;
}
.supplier-product-tile-title a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.supplier-product-tile-meta {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.78rem;
}
.supplier-product-tile-meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.supplier-product-tile-meta dt {
  color: #6b7280;
}
.supplier-product-tile-meta dd {
  margin: 0;
  color: #111827;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.supplier-product-tile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.2rem;
}
.supplier-product-tile-unlinked {
  font-size: 0.78rem;
  color: #9ca3af;
}

.btn.btn-sm {
  min-height: 30px;
  padding: 0.32rem 0.7rem;
  font-size: 0.82rem;
  border-radius: 9px;
}

/* Ask about our products — stock / variant badges on result cards */
.ask-result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 1px;
}
.ask-badge {
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 8px;
  line-height: 1.5;
  white-space: nowrap;
}
.ask-badge.is-in {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.ask-badge.is-out {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.ask-badge-muted {
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid var(--border, #e5e7eb);
}

/* Dashboard owns its page header so the date-range picker sits in the top bar
   (outside the gauge cards). Own stacking context keeps the wide range popover
   above the cards below. */
.dash-toolbar {
  position: sticky;
  /* Tuck a few px under the opaque global bar so no content peeks through if the
     real bar height is slightly under --global-bar-height (it renders ~69px). */
  top: calc(var(--global-bar-height) - 8px);
  z-index: 30;
  background: var(--bg);
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   Supplier view switch + supplier directory (supplier_directory.html)
   ============================================================ */

.supplier-view-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0 0 1rem;
  background: #f3f4f6;
  border-radius: 12px;
}
.supplier-view-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.supplier-view-tab:hover {
  color: #111827;
}
.supplier-view-tab.is-active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.supplier-dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  padding: 0.5rem 0 0.25rem;
}
.supplier-dir-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.supplier-dir-card:hover {
  border-color: #1d4ed8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.supplier-dir-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
.supplier-dir-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}
.supplier-dir-name {
  font-weight: 700;
  color: #111827;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supplier-dir-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.supplier-dir-platforms .badge {
  text-transform: capitalize;
}
.supplier-dir-count {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  padding-left: 0.5rem;
}
.supplier-dir-count strong {
  font-size: 1.15rem;
  color: #111827;
}
.supplier-dir-count small {
  font-size: 0.68rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Supplier directory avatar shows a product image (falls back to the initial) */
.supplier-dir-avatar {
  overflow: hidden;
}
.supplier-dir-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ask about our products — expandable result cards (click to read full AI text) */
.ask-result-card {
  cursor: pointer;
}
.ask-result-open {
  display: none;
  width: fit-content;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand, #2563eb);
  text-decoration: none;
}
.ask-result-open:hover {
  text-decoration: underline;
}
.ask-result-card.is-expanded {
  align-items: flex-start;
  border-color: var(--brand, #2563eb);
}
.ask-result-card.is-expanded .ask-result-title,
.ask-result-card.is-expanded .ask-result-reason {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.ask-result-card.is-expanded .ask-result-open {
  display: inline-block;
}

/* Order detail — per-line "Ordered at" price under the unit price */
.order-line-price {
  flex-wrap: wrap;
}

.order-line-ordered-at {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #5c6470;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* --- Add supplier (manual eBay URL → first empty sheet slot) --- */
.supplier-rows-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.supplier-rows-head-copy {
  min-width: 0;
}
.add-supplier-trigger {
  flex: 0 0 auto;
  white-space: nowrap;
}

.add-supplier-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-supplier-modal[hidden] {
  display: none;
}
.add-supplier-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.5);
}
.add-supplier-modal-card {
  position: relative;
  width: min(520px, calc(100% - 2rem));
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 18, 22, 0.3);
  display: flex;
  flex-direction: column;
}
.add-supplier-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6d7175;
  cursor: pointer;
  border-radius: 8px;
}
.add-supplier-modal-close:hover {
  background: #f3f4f6;
  color: #202223;
}
.add-supplier-modal-head {
  padding: 1.3rem 1.5rem 0.85rem;
  border-bottom: 1px solid #ececec;
}
.add-supplier-modal-head h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}
.add-supplier-modal-head p {
  margin: 0;
  font-size: 0.85rem;
  color: #6d7175;
}
.add-supplier-modal-body {
  padding: 1.1rem 1.5rem;
}
.add-supplier-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.add-supplier-field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #202223;
}
.add-supplier-field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c9cccf;
  border-radius: 8px;
  font-size: 0.9rem;
}
.add-supplier-field input:focus {
  outline: none;
  border-color: #2c6ecb;
  box-shadow: 0 0 0 2px rgba(44, 110, 203, 0.18);
}
.add-supplier-status {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: #2c6ecb;
}
.add-supplier-status.is-error {
  color: #d72c0d;
}
.add-supplier-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem 1.2rem;
  border-top: 1px solid #ececec;
}

/* ── Image lightbox: gallery navigation (prev/next + counter) ──────────
   Buttons live at the left/right viewport edges and the counter pill at
   top-center, so they never overlap the centered image or its floating
   tool toolbar. Hidden via [hidden] when the product has one image. */
.image-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #202223;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.12s ease, transform 0.12s ease, opacity 0.12s ease;
}
.image-lightbox-nav[hidden] { display: none; }
.image-lightbox-nav svg { width: 22px; height: 22px; display: block; }
.image-lightbox-nav-prev { left: 1.25rem; }
.image-lightbox-nav-next { right: 1.25rem; }
.image-lightbox-nav:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.06);
}
.image-lightbox-nav:active {
  transform: translateY(-50%) scale(0.96);
}
.image-lightbox-nav:focus-visible {
  outline: 2px solid #2c6ecb;
  outline-offset: 2px;
}

.image-lightbox-counter {
  position: absolute;
  top: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.image-lightbox-counter[hidden] { display: none; }

@media (max-width: 640px) {
  .image-lightbox-nav { width: 40px; height: 40px; }
  .image-lightbox-nav-prev { left: 0.5rem; }
  .image-lightbox-nav-next { right: 0.5rem; }
}

/* ── AI Crop adjust: editable panel boxes over the original composite ──
   Shown after AI Crop picks panels. Each box is draggable (body) and
   resizable (8 edge/corner handles); positioned in stage CSS px by JS. */
.lightbox-aicrop-editor {
  position: absolute;
  inset: 0;
  z-index: 4;            /* same tier as the erase overlay */
  /* The container itself is transparent to clicks — only the boxes and
     their handles are interactive, so empty areas don't block anything. */
  pointer-events: none;
}
.lightbox-aicrop-box,
.lightbox-aicrop-handle { pointer-events: auto; }
.lightbox-aicrop-editor[hidden] { display: none; }
.lightbox-aicrop-editor.is-dragging { cursor: grabbing; }

.lightbox-aicrop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #2c6ecb;
  background: rgba(44, 110, 203, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7), 0 2px 10px rgba(0, 0, 0, 0.35);
  cursor: move;
  touch-action: none;
}

.lightbox-aicrop-box-label {
  position: absolute;
  top: -2px;
  left: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2c6ecb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px 0 4px 0;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.lightbox-aicrop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid #2c6ecb;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  touch-action: none;
}
.lightbox-aicrop-handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.lightbox-aicrop-handle-n  { top: -7px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.lightbox-aicrop-handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.lightbox-aicrop-handle-e  { top: 50%; right: -7px; transform: translateY(-50%); cursor: ew-resize; }
.lightbox-aicrop-handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.lightbox-aicrop-handle-s  { bottom: -7px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.lightbox-aicrop-handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.lightbox-aicrop-handle-w  { top: 50%; left: -7px; transform: translateY(-50%); cursor: ew-resize; }

/* ============================================================
   Variant detail — refined hero + tabbed layout (vd-*)
   Premium, professional product page. Replaces the old stacked
   hero metrics + always-on dual tables.
   ============================================================ */
.vd-layout {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}

/* --- Hero card --- */
.vd-hero {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  padding: 1.5rem;
}
.vd-hero-media {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f6f6f7;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vd-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Find-exact-style overlaid on the image, bottom-left — clear CTA, no clutter */
.vd-find-style-btn {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  color: #111827;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.vd-find-style-btn:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
}

.vd-hero-info {
  display: grid;
  gap: 1.05rem;
  align-content: start;
  min-width: 0;
}
.vd-hero-heading {
  display: grid;
  gap: 0.4rem;
}
.vd-hero-heading h3 {
  font-size: clamp(1.7rem, 2.2vw, 2.1rem);
  letter-spacing: -0.035em;
  color: #111827;
  line-height: 1.05;
  margin: 0;
}
.vd-hero-heading p {
  color: #6b7280;
  max-width: 54ch;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

/* Primary stats — clean tiles, clear hierarchy */
.vd-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.vd-stat {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #eceef1;
  min-width: 0;
}
.vd-stat span {
  display: block;
  color: #8a9099;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.vd-stat strong {
  display: block;
  margin-top: 0.25rem;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.vd-stat-warn {
  background: #fef2f2;
  border-color: #fecaca;
}
.vd-stat-warn strong { color: #b91c1c; }

/* Connection counts as quiet chips */
.vd-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.vd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.8rem;
  font-weight: 600;
}
.vd-chip em {
  font-style: normal;
  font-weight: 800;
  color: #111827;
}

.vd-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding-top: 0.25rem;
  border-top: 1px solid #f0f1f3;
}
.vd-meta-row div { display: grid; gap: 0.1rem; }
.vd-meta-row dt {
  color: #8a9099;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vd-meta-row dd {
  margin: 0;
  color: #374151;
  font-size: 0.92rem;
  font-weight: 600;
}

/* --- Tabs --- */
.vd-tabs { display: grid; gap: 1.15rem; min-width: 0; }
.vd-panel { min-width: 0; }
/* Card holding a wide table must clip so the inner table-wrap scrolls
   instead of pushing the whole page wider. */
.vd-panel > .card { min-width: 0; max-width: 100%; overflow: hidden; }
.vd-panel .table-wrap { max-width: 100%; overflow-x: auto; }
.vd-tablist {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.3rem;
  background: #f3f4f6;
  border-radius: 12px;
  width: fit-content;
}
.vd-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #4b5563;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.vd-tab:hover { color: #111827; }
.vd-tab.is-active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}
.vd-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 0.74rem;
  font-weight: 700;
}
.vd-tab.is-active .vd-tab-count {
  background: #111827;
  color: #fff;
}
.vd-panel { display: none; }
.vd-panel.is-active { display: block; }

.vd-overview-card { padding: 1.25rem 1.35rem; }
.vd-metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.vd-metric {
  padding: 1rem 1.1rem;
  border: 1px solid #eceef1;
  border-radius: 14px;
  background: #fff;
}

@media (max-width: 980px) {
  .vd-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .vd-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .vd-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vd-metrics-grid { grid-template-columns: 1fr; }
  .vd-tablist { width: 100%; }
  .vd-tab { flex: 1; justify-content: center; }
}

/* ============================================================
   Variant detail — Suppliers tab card polish
   Equal-height slot cards, pinned full-width actions, no dupes.
   ============================================================ */
/* Cards in a row stretch to equal height (table rows equalize cells). */
.vd-panel .supplier-slot-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 240px;
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.vd-panel .supplier-slot-cell { padding-top: 0.9rem; padding-bottom: 0.9rem; }

.vd-panel .supplier-slot-head {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f1f2f4;
}
.vd-panel .supplier-slot-platform { font-size: 0.92rem; }

/* Status badge: tone by text */
.vd-panel .supplier-slot-head .shop-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

/* Metrics: tidy 2-col, muted labels */
.vd-panel .supplier-metrics {
  gap: 0.55rem 0.9rem;
  padding: 0.1rem 0;
}
.vd-panel .supplier-metrics dd { font-size: 0.92rem; }

/* Action stack pinned to the bottom, full-width buttons */
.supplier-slot-actions {
  margin-top: auto;
  display: grid;
  gap: 0.45rem;
}
.supplier-slot-actions > .btn {
  width: 100%;
  min-height: 36px;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 650;
  border-radius: 10px;
}
.supplier-slot-actions .supplier-place-order-button { order: 3; }
.supplier-slot-actions .supplier-find-alternate-button { order: 1; }
.supplier-slot-actions .supplier-live-stock-button { order: 2; }
.supplier-slot-actions .supplier-live-stock-result,
.supplier-slot-actions .supplier-live-stock-hint { order: 4; }

.supplier-slot-actions .supplier-live-stock-hint {
  color: #9097a1;
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Empty slot — quiet, centered, not a loud dash */
.vd-panel .supplier-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #c2c7ce;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Product + shopify-info cells: a touch more breathing room */
.vd-panel .supplier-product-cell,
.vd-panel .supplier-stack-cell { padding-top: 1rem; }

/* Live-stock status reflected in the supplier slot card's top badge */
.shop-pill.shop-pill-instock {
  background: #dcfce7;
  color: #15803d;
}
.shop-pill.shop-pill-oos {
  background: #fef3c7;
  color: #b45309;
}

/* Compact the suppliers matrix slot cards — thumbnail BESIDE the name/link
   instead of stacked above it, plus tighter spacing. Scoped to .suppliers-table
   so the variant-detail page's slot cards (which have no .supplier-slot-meta
   wrapper) are unaffected. */
.suppliers-table .supplier-slot-card {
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
}
.suppliers-table .supplier-slot-body {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.suppliers-table .supplier-slot-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  margin-bottom: 0;
}
.suppliers-table .supplier-slot-meta {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}

/* Safety backstop: never let a long supplier label / SKU explode a slot card's
   height. Raw-URL labels are already cleaned server-side; this clamps any stray
   long value to a few lines instead of a tall tower. */
.supplier-slot-meta .supplier-link,
.supplier-slot-meta strong {
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Add images from an eBay link modal ───────────────────────────────
   Mirrors the CRO modal shell; adds a paste-URL row + a selectable photo
   grid so the op can pull any eBay listing's photos into the product. */
.ebay-images-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ebay-images-modal[hidden] { display: none; }

.ebay-images-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.66);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.ebay-images-modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  max-width: min(820px, 96vw);
  max-height: 92vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.ebay-images-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem 0.9rem;
  border-bottom: 1px solid #eaecef;
}
.ebay-images-modal-head h3 { margin: 0; font-size: 1.1rem; }
.ebay-images-modal-head p { margin: 0.2rem 0 0; color: #586069; font-size: 0.85rem; }

.ebay-images-modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #586069;
  padding: 0 0.3rem;
}

.ebay-images-modal-body {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.ebay-images-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid #eaecef;
  background: #f6f8fa;
}

.ebay-images-fetch-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.ebay-images-url-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  font-size: 0.9rem;
}
.ebay-images-url-input:focus {
  outline: none;
  border-color: #2c6ecb;
  box-shadow: 0 0 0 3px rgba(44, 110, 203, 0.15);
}

.ebay-images-status {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #586069;
}
.ebay-images-status[data-tone="error"] { color: #cf222e; }
.ebay-images-status[data-tone="ok"] { color: #1a7f37; }

.ebay-images-picker { margin-top: 1rem; }
.ebay-images-picker[hidden] { display: none; }

.ebay-images-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}
.ebay-images-selectall {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.ebay-images-picker-meta {
  font-size: 0.8rem;
  color: #586069;
  text-align: right;
}

.ebay-images-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.6rem;
}
.ebay-images-cell { margin: 0; }
.ebay-images-cell label {
  position: relative;
  display: block;
  border: 2px solid #e1e4e8;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: #f6f8fa;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ebay-images-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* Hide the native checkbox; the cell itself reflects checked state. */
.ebay-images-cell input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ebay-images-cell-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #d0d7de;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  transition: background 0.12s ease, color 0.12s ease;
}
.ebay-images-cell input[type="checkbox"]:checked ~ .ebay-images-cell-check {
  background: #2c6ecb;
  border-color: #2c6ecb;
  color: #fff;
}
.ebay-images-cell label:has(input:checked) {
  border-color: #2c6ecb;
  box-shadow: 0 0 0 3px rgba(44, 110, 203, 0.15);
}

/* Product cell: lay the card out with flex so the copy fills the column even
   when a product has NO thumbnail. (As a grid with a fixed 64px first column,
   a thumbnail-less row put the lone copy in that 64px column, collapsing the
   name/SKU into a tall tower.) */
.supplier-product-card {
  display: flex;
  align-items: flex-start;
  grid-template-columns: none;
}
.supplier-product-card > .supplier-thumb {
  flex: 0 0 auto;
}
.supplier-product-copy {
  flex: 1;
}

/* ── Product image select-to-copy ─────────────────────────────────────
   A checkmark toggle (bottom-right of each thumb) marks images for the
   copy-to-clipboard bar. Bottom-right is the only free corner (number =
   top-left, size = bottom-left, edit/remove = top-right). */
.new-product-image-select {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(15, 18, 22, 0.45);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.new-product-image-select svg { width: 14px; height: 14px; display: block; }
.new-product-image-grid li:hover .new-product-image-select { opacity: 1; }
.new-product-image-select[aria-checked="true"] {
  opacity: 1;
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}

.new-product-image-select-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.7rem;
  padding: 0.5rem 0.7rem;
  background: #f1f6ff;
  border: 1px solid #cfe0fb;
  border-radius: 10px;
}
.new-product-image-select-bar[hidden] { display: none; }
.new-product-image-select-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f4ed1;
  margin-right: 0.2rem;
}
.new-product-image-select-bar .btn { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.new-product-image-select-status {
  font-size: 0.8rem;
  color: #586069;
  margin-left: auto;
}
.new-product-image-select-status[data-tone="ok"] { color: #1a7f37; }
.new-product-image-select-status[data-tone="error"] { color: #cf222e; }

/* ── Watermark-remover model label + param toggles ────────────────────── */
.image-lightbox-wm-model {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font: 600 0.68rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.image-lightbox-wm-model::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.image-lightbox-wm-toggle {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 6px 12px;
  border-radius: 9px;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
  font: 600 0.72rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.image-lightbox-wm-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.image-lightbox-wm-toggle.is-on {
  background: rgba(99, 102, 241, 0.28);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.7);
}

/* --- Reorder supplier slots (drag handle + drop targets) --- */
.supplier-slot-card {
  position: relative;
}
.supplier-slot-card[draggable="true"] {
  cursor: default;
}
.supplier-slot-drag {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  border: none;
  background: transparent;
  color: #9aa0a6;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: grab;
  z-index: 2;
}
.supplier-slot-drag:hover {
  background: #f1f2f4;
  color: #44474a;
}
.supplier-slot-drag:active {
  cursor: grabbing;
}
.supplier-slot-card.is-dragging {
  opacity: 0.5;
}
.supplier-slot-cell.is-drop-target {
  outline: 2px dashed #2c6ecb;
  outline-offset: -4px;
  background: rgba(44, 110, 203, 0.06);
  border-radius: 10px;
}
.supplier-reorder-busy {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Per-image processing spinner (background watermark removal etc.) ───
   Shown only on the specific thumbnail(s) whose request is in flight, so
   concurrent removals each show their own loader — never a global one. */
@keyframes ofp-img-spin { to { transform: rotate(360deg); } }

.new-product-image-spinner {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 4;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(1px);
}
.new-product-image-grid li.is-processing .new-product-image-spinner {
  display: block;
}
.new-product-image-grid li.is-processing .new-product-image-spinner::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 3px solid rgba(31, 111, 235, 0.25);
  border-top-color: #1f6feb;
  animation: ofp-img-spin 0.7s linear infinite;
}
/* Dim the thumbnail + block its hover buttons while processing. */
.new-product-image-grid li.is-processing .new-product-image-thumb img { opacity: 0.7; }
.new-product-image-grid li.is-processing .new-product-image-edit,
.new-product-image-grid li.is-processing .new-product-image-remove,
.new-product-image-grid li.is-processing .new-product-image-select { display: none; }

/* Lightbox stage spinner — when the on-screen image is mid-removal. */
.image-lightbox-stage.is-processing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
}
.image-lightbox-stage.is-processing::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  z-index: 7;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: ofp-img-spin 0.7s linear infinite;
}

/* ============================================================
   Product detail — image gallery + lightbox + description
   ============================================================ */
.product-gallery {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}
.product-gallery-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f6f6f7;
  aspect-ratio: 1 / 1;
}
.product-gallery-main {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}
.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  color: #111827;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  transition: background 0.15s ease, transform 0.15s ease;
}
.product-gallery-nav:hover { background: #fff; }
.product-gallery-prev { left: 0.6rem; }
.product-gallery-next { right: 0.6rem; }
.product-gallery-counter {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
}
.product-gallery-thumbs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.product-gallery-thumb {
  width: 58px;
  height: 58px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 11px;
  overflow: hidden;
  background: #f3f4f6;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.product-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-gallery-thumb:hover { border-color: #c7ccd3; }
.product-gallery-thumb.is-active { border-color: #111827; }

/* Description block replacing the old snapshot copy */
.product-description { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.45rem; min-width: 0; }
/* Long Shopify descriptions used to make the right column dwarf the product
   image. Box the body and cap its height near the gallery image height so the
   two columns balance; overflow scrolls inside the box. */
.product-description-body {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  max-height: 30rem;
  overflow-y: auto;
  padding: 0.9rem 1.05rem;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #cbd1d8 transparent;
}
.product-description-body > *:first-child { margin-top: 0; }
.product-description-body > *:last-child { margin-bottom: 0; }
/* paragraphs here inherit .product-hero-copy p { max-width: 52ch } and wrap at
   ~half the box — let description text fill the full box width instead. */
.product-description-body p,
.product-description-body li { max-width: none; }
.product-description-body::-webkit-scrollbar { width: 8px; }
.product-description-body::-webkit-scrollbar-thumb { background: #cbd1d8; border-radius: 8px; }
.product-description-body::-webkit-scrollbar-track { background: transparent; }
.product-description-body p { margin: 0 0 0.6rem; }
.product-description-body ul,
.product-description-body ol { margin: 0 0 0.6rem 1.1rem; }
.product-description-body img { max-width: 100%; height: auto; border-radius: 8px; }
/* Shopify-authored descriptions often embed a YouTube iframe with a fixed
   width attribute; as a replaced element it won't shrink and used to blow out
   the hero grid. Force embeds responsive (16:9 for the common video case). */
.product-description-body iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border: 0;
  border-radius: 8px;
}
.product-description-body video,
.product-description-body embed,
.product-description-body object { max-width: 100%; }
.product-description-empty { color: #9097a1; font-size: 0.92rem; }
.product-tags-details { margin-top: 0.2rem; }
.product-tags-details summary {
  cursor: pointer;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  list-style: none;
}
.product-tags-details summary::-webkit-details-marker { display: none; }
.product-tags-details[open] summary { margin-bottom: 0.5rem; }

/* Lightbox overlay */
.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-lightbox[hidden] { display: none; }
.product-lightbox-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 20, 0.82); }
.product-lightbox-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 900px);
  max-height: 90vh;
  display: grid;
  gap: 0.6rem;
}
.product-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-lightbox-img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 12px;
}
.product-lightbox-close {
  position: absolute;
  top: -2.4rem;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.product-lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
.product-lightbox-counter {
  position: absolute;
  top: -2.2rem;
  left: 0;
  color: #e5e7eb;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2;
}
.product-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.product-lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.product-lightbox-prev { left: -3.4rem; }
.product-lightbox-next { right: -3.4rem; }
@media (max-width: 720px) {
  .product-lightbox-prev { left: 0.4rem; }
  .product-lightbox-next { right: 0.4rem; }
}

/* Product detail spans full width — no empty reserved side column */
.product-detail-grid--full {
  grid-template-columns: minmax(0, 1fr);
}
.product-detail-grid--full .product-hero-panel {
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  align-items: start;
}

/* ── Multi-merge click-to-select ──────────────────────────────────────
   While picking a sub-image, the image takes a crosshair cursor and a
   subtle focus ring so it's obvious you click the picture to choose. */
.image-lightbox-stage.is-merge-picking { cursor: crosshair; }
.image-lightbox-stage.is-merge-picking [data-lightbox-img] {
  cursor: crosshair;
  outline: 3px solid rgba(99, 102, 241, 0.7);
  outline-offset: -3px;
  border-radius: 10px;
}

/* ── Original supplier photos (recovery strip) ─────────────────────────
   A permanent, separated list of every photo pulled from the supplier so
   a deleted/over-edited image can be re-added. */
.new-product-original {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid #e3e6ea;
}
.new-product-original[hidden] { display: none; }
.new-product-original-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.new-product-original-head strong { font-size: 0.9rem; }
.new-product-original-hint { font-size: 0.78rem; color: #6b7280; }

.new-product-original-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 0.5rem;
}
.new-product-original-tile { margin: 0; }
.new-product-original-thumb {
  position: relative;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f8f9fa;
}
.new-product-original-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
/* Used images dim slightly so the eye lands on the re-addable ones. */
.new-product-original-tile.is-used .new-product-original-thumb { opacity: 0.55; }

.new-product-original-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(26, 127, 55, 0.92);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}
.new-product-original-add {
  position: absolute;
  inset: auto 4px 4px 4px;
  padding: 0.25rem 0;
  border: none;
  border-radius: 6px;
  background: #1f6feb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.12s ease, background-color 0.12s ease;
}
.new-product-original-thumb:hover .new-product-original-add { opacity: 1; }
.new-product-original-add:hover { background: #1a5fd0; }

/* Product detail prev/next navigation arrows */
.product-nav-arrows {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}

.product-nav-arrow {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6d7175;
  transition: background 0.15s ease, color 0.15s ease;
}

.product-nav-arrow:hover {
  background: #f1f1f1;
  color: #303030;
}

.product-nav-arrow svg {
  width: 18px;
  height: 18px;
}

.product-nav-arrow.is-disabled {
  color: #c9cccf;
  cursor: default;
}

/* Alternate-suppliers result thumbnail → clickable photo gallery trigger. */
button.find-alternate-thumb {
  position: relative;
  padding: 0;
  border: 0;
  cursor: pointer;
  transition: transform 0.1s ease;
}

button.find-alternate-thumb:hover {
  transform: scale(1.03);
}

.find-alternate-thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  pointer-events: none;
}

/* Per-listing margin: what we'd make selling at our price from this supplier. */
.find-alternate-result-margin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.find-alternate-margin {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
}

.find-alternate-margin-good {
  background: #e3f5e9;
  color: #1a7f43;
}

.find-alternate-margin-ok {
  background: #fff4e0;
  color: #9a6700;
}

.find-alternate-margin-low {
  background: #fde6e6;
  color: #b42318;
}

.find-alternate-margin-cost {
  font-size: 0.74rem;
  color: #6b7280;
}

/* "Already a supplier" badge — replaces the Add button for listings we source. */
.find-alternate-already-added {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: #e3f5e9;
  color: #1a7f43;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Find-exact-style result margin display. */
.fxs-result-margin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fxs-margin {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
}

.fxs-margin-good {
  background: #e3f5e9;
  color: #1a7f43;
}

.fxs-margin-ok {
  background: #fff4e0;
  color: #9a6700;
}

.fxs-margin-low {
  background: #fde6e6;
  color: #b42318;
}

.fxs-margin-cost {
  font-size: 0.74rem;
  color: #6b7280;
}

/* =====================================================================
   Supplier profile — per-supplier page (rating / notes / blacklist)
   ===================================================================== */

/* The [hidden] attr must beat the explicit display rules below (an element
   with `display: grid/flex/inline-flex` ignores bare `hidden`). */
.supplier-about-edit[hidden],
.supplier-bl-banner[hidden],
.supplier-bl-state[hidden],
.supplier-bl-idle[hidden],
.supplier-bl-form[hidden],
.supplier-bl-reason[hidden],
.supplier-header-bl[hidden],
.supplier-inline-btn[hidden],
.supplier-dir-bl-badge[hidden] {
  display: none;
}

/* Header blacklist chip + side avatar */
.supplier-header-bl {
  text-transform: none;
}
.supplier-header-bl svg {
  flex: none;
}

/* Blacklist banner across the top of the main column */
.supplier-bl-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-lg);
  border: 1px solid #f4c4bc;
  background: linear-gradient(180deg, #fff5f3, #fff1ef);
  color: #8a2317;
}
.supplier-bl-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: #fde0db;
  color: var(--danger);
}
.supplier-bl-banner-copy {
  display: grid;
  gap: 0.15rem;
  line-height: 1.35;
}
.supplier-bl-banner-copy strong {
  color: #7a1d12;
  font-size: 0.97rem;
}
.supplier-bl-banner-copy span {
  color: #9a4034;
  font-size: 0.86rem;
}

/* Editable "About this supplier" block inside the hero */
.supplier-about {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}
.supplier-about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.supplier-card-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.supplier-about-text {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.supplier-about-text.is-empty {
  color: var(--muted-soft);
  font-style: italic;
}
.supplier-about-edit {
  display: grid;
  gap: 0.6rem;
}
.supplier-about-edit textarea {
  min-height: 96px;
  font-size: 0.9rem;
}
.supplier-about-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* small inline text-buttons (Edit / Add notes / Clear) */
.supplier-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.25rem 0.45rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.supplier-inline-btn:hover {
  background: rgba(29, 78, 216, 0.08);
}
.supplier-inline-btn svg {
  flex: none;
}
.supplier-inline-btn-muted {
  color: var(--muted);
}
.supplier-inline-btn-muted:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}
.supplier-inline-status {
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.supplier-inline-status.is-ok {
  color: #0e6438;
}
.supplier-inline-status.is-error {
  color: var(--danger);
}

/* Side "scorecard" card */
.supplier-scorecard {
  display: grid;
  gap: 1.05rem;
  position: sticky;
  top: calc(var(--global-bar-height) + 12px);
}
.supplier-scorecard-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.supplier-scorecard-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}
.supplier-scorecard-id {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.supplier-scorecard-id h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--text-strong);
  word-break: break-word;
}
.supplier-scorecard-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.supplier-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.supplier-status-dot.is-active {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.16);
}
.supplier-status-dot.is-blocked {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(216, 44, 13, 0.16);
}

.supplier-card-section {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border);
}
.supplier-card-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.supplier-card-hint {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

/* Star rating */
.supplier-rating-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}
.supplier-rating-value small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-soft);
}
.supplier-stars {
  display: inline-flex;
  gap: 0.25rem;
}
.supplier-star {
  display: inline-flex;
  padding: 0.1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.supplier-star svg {
  width: 28px;
  height: 28px;
  fill: #e2e5ea;
  transition: fill 0.12s ease, transform 0.12s ease;
}
.supplier-star:hover svg {
  transform: scale(1.12);
}
.supplier-star.is-on svg {
  fill: #f5b50a;
}
.supplier-star.is-preview svg {
  fill: #fcd768;
}
.supplier-rating-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 20px;
}

/* Blacklist controls */
.supplier-blacklist {
  display: grid;
  gap: 0.6rem;
}
.supplier-bl-state {
  display: grid;
  gap: 0.55rem;
}
.supplier-bl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #fff1ef;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}
.supplier-bl-reason {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.supplier-bl-idle {
  display: grid;
  gap: 0.55rem;
}
.supplier-bl-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: fit-content;
  background: #fff;
  border: 1px solid #f0c2ba;
  color: var(--danger);
}
.supplier-bl-trigger:hover {
  background: #fff5f3;
  border-color: var(--danger);
}
.supplier-bl-form {
  display: grid;
  gap: 0.55rem;
}
.supplier-bl-form textarea {
  font-size: 0.88rem;
  min-height: 76px;
}
.supplier-bl-form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.supplier-bl-confirm {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.supplier-bl-confirm:hover {
  background: #bf2710;
}
.supplier-bl-status:empty {
  display: none;
}

/* Directory blacklist badge */
.supplier-dir-card.is-blacklisted {
  border-color: #f1c4bc;
}
.supplier-dir-bl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #fff1ef;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
}

/* =====================================================================
   Supplier directory dashboard (KPI tiles + toolbar + filter/sort/view)
   ===================================================================== */

/* KPI stat tiles */
.supplier-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 0.7rem;
}
.supplier-stat {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.supplier-stat.is-danger {
  border-color: #f1c4bc;
  background: linear-gradient(180deg, #fffaf9, #fff5f3);
}
.supplier-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
}
.supplier-stat-icon-blue   { background: #e8f0ff; color: #1d4ed8; }
.supplier-stat-icon-violet { background: #eee9ff; color: #6d28d9; }
.supplier-stat-icon-amber  { background: #fff3d6; color: #b7791f; }
.supplier-stat-icon-green  { background: #e3f1df; color: #0e6438; }
.supplier-stat-icon-red    { background: #fff1ef; color: var(--danger); }
.supplier-stat-icon-slate  { background: #eceef1; color: #475569; }
.supplier-stat-body {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.supplier-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.supplier-stat-value-sm {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supplier-stat-split {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted-soft);
  margin-left: 0.15rem;
}
.supplier-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toolbar */
.supplier-dir-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #ececec;
}
.supplier-dir-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 200px;
}
.supplier-dir-search-icon {
  position: absolute;
  left: 0.7rem;
  color: var(--muted-soft);
  pointer-events: none;
}
.supplier-dir-search input {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 4.2rem 0.5rem 2.2rem;
  border-radius: 11px;
  background: var(--surface-subtle);
  font-size: 0.92rem;
}
.supplier-dir-search-clear {
  position: absolute;
  right: 2.1rem;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #e2e5ea;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.supplier-dir-search-clear[hidden] { display: none; }
.supplier-dir-search-clear:hover { background: #d4d8de; }
.supplier-dir-kbd {
  position: absolute;
  right: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted-soft);
  font-size: 0.7rem;
  font-family: inherit;
  pointer-events: none;
}
.supplier-dir-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.supplier-dir-filters select,
.supplier-dir-sort select {
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 0.4rem 1.9rem 0.4rem 0.7rem;
  border-radius: 11px;
  background-color: var(--surface-subtle);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}
.supplier-dir-toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}
.supplier-dir-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.supplier-dir-dir-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.supplier-dir-dir-btn:hover { background: var(--surface-hover); color: var(--text); }
.supplier-dir-dir-icon { transition: transform 0.18s ease; }
[data-dir-direction="asc"] .supplier-dir-dir-icon { transform: rotate(180deg); }

/* View toggle */
.supplier-dir-view {
  display: inline-flex;
  padding: 0.18rem;
  gap: 0.15rem;
  background: #f1f2f4;
  border-radius: 11px;
}
.supplier-dir-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.supplier-dir-view-btn:hover { color: var(--text); }
.supplier-dir-view-btn.is-active {
  background: #fff;
  color: var(--text-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

/* Results wrapper + loading fade */
.supplier-dir-results {
  position: relative;
  transition: opacity 0.12s ease;
  padding: 0.85rem 1rem 1rem;
}
.supplier-dir-results.is-loading {
  opacity: 0.5;
  pointer-events: none;
}
.supplier-dir-resultbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.7rem;
}
.supplier-dir-showing {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.supplier-dir-showing strong { color: var(--text-strong); }
.supplier-dir-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.supplier-dir-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid #d8def0;
  border-radius: 999px;
  background: #eef2ff;
  color: #3949ab;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.supplier-dir-chip:hover { background: #e1e7ff; border-color: #b9c4ee; }
.supplier-dir-chip span { font-size: 0.9rem; line-height: 1; }
.supplier-dir-chip-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.supplier-dir-chip-clear:hover { color: var(--text); }
.supplier-dir-empty {
  display: grid;
  gap: 0.7rem;
  justify-items: start;
}

/* Enriched card content */
.supplier-dir-card {
  align-items: flex-start;
}
.supplier-dir-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.supplier-dir-stars {
  display: inline-flex;
  gap: 0.02rem;
  flex: none;
  font-size: 0.78rem;
  line-height: 1;
}
.supplier-dir-star { color: #d7dae0; }
.supplier-dir-star.is-on { color: #f5b50a; }
.supplier-dir-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
}
.supplier-dir-type {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.supplier-dir-type.is-marketplace { background: #e8f0ff; color: #1d4ed8; }
.supplier-dir-type.is-inhouse { background: #e8f5ee; color: #0e6438; }
.supplier-dir-more {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-soft);
}
.supplier-dir-substats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.1rem;
}
.supplier-dir-substat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
}
.supplier-dir-substat svg { color: var(--muted-soft); }
.supplier-dir-stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}
.supplier-dir-stock.is-good { color: #0e6438; }
.supplier-dir-stock.is-warn { color: #b7791f; }
.supplier-dir-stock.is-bad { color: var(--danger); }

/* List view: same cards, full-width dense rows */
.supplier-dir-results.is-list .supplier-dir-grid {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
.supplier-dir-results.is-list .supplier-dir-card {
  align-items: center;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
}
.supplier-dir-results.is-list .supplier-dir-substats {
  margin-left: auto;
  margin-top: 0;
  padding-right: 0.5rem;
}
.supplier-dir-results.is-list .supplier-dir-info {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .supplier-dir-toolbar-end { margin-left: 0; width: 100%; justify-content: space-between; }
  .supplier-dir-search { flex-basis: 100%; }
  .supplier-dir-results.is-list .supplier-dir-substats { margin-left: 0; }
  .supplier-dir-results.is-list .supplier-dir-info { flex-direction: column; align-items: flex-start; }
}

/* =====================================================================
   Supplier searches — async Find-exact-style job board
   ===================================================================== */

/* Live indicator + nav badge */
.ss-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e3f1df;
  color: #0e6438;
  font-size: 0.74rem;
  font-weight: 700;
}
.ss-live[hidden] { display: none; }
.ss-live-dot, .ss-working-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: ss-pulse 1.3s ease-in-out infinite;
}
@keyframes ss-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.nav-count-accent {
  background: #1d4ed8;
  color: #fff;
}
.nav-count-accent[hidden] { display: none; }

/* Toolbar */
.ss-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #ececec;
}
.ss-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  background: #f1f2f4;
  border-radius: 11px;
}
.ss-tab {
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ss-tab:hover { color: var(--text); }
.ss-tab.is-active { background: #fff; color: var(--text-strong); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1); }
.ss-toolbar-end { display: flex; align-items: center; gap: 0.55rem; margin-left: auto; flex-wrap: wrap; }
.ss-search { flex: 0 1 280px; }

/* Job list */
.ss-list { display: grid; gap: 0.5rem; padding: 0.85rem 1rem 1rem; }
.ss-skeleton, .ss-empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }
.ss-job {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 12px;
  background: var(--surface);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.ss-job:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07); }
.ss-job-queued { border-left-color: #b7791f; }
.ss-job-running { border-left-color: #1d4ed8; }
.ss-job-done { border-left-color: var(--primary); }
.ss-job-error { border-left-color: var(--danger); }
.ss-job-canceled { border-left-color: var(--muted-soft); }
.ss-job-thumb {
  position: relative;
  width: 48px; height: 48px; flex: none;
  border-radius: 10px; overflow: hidden;
  background: #f3f4f6;
  display: inline-flex; align-items: center; justify-content: center;
}
.ss-job-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ss-job-noimg { color: #9ca3af; font-weight: 700; }
.ss-job-thumb.is-working::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid #c7d2fe; border-top-color: #1d4ed8; border-radius: 50%;
  width: 22px; height: 22px; margin: auto;
  animation: ofp-img-spin 0.8s linear infinite;
}
.ss-job-main { flex: 1; min-width: 0; display: grid; gap: 0.3rem; }
.ss-job-titlerow { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ss-job-title { font-weight: 700; color: var(--text-strong); font-size: 0.92rem; }
.ss-job-variant {
  font-size: 0.74rem; font-weight: 600; color: var(--muted);
  padding: 0.08rem 0.4rem; background: var(--neutral-pill-bg); border-radius: 6px;
}
.ss-job-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; font-size: 0.78rem; color: var(--muted); }
.ss-job-stat { font-weight: 600; color: var(--text); }
.ss-job-err { color: var(--danger); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-job-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.ss-job-del {
  border: none; background: transparent; cursor: pointer;
  font-size: 0.95rem; opacity: 0.5; padding: 0.3rem;
}
.ss-job-del:hover { opacity: 1; }
.ss-working { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; color: #1d4ed8; }

/* Status pill */
.ss-status {
  display: inline-flex; align-items: center;
  padding: 0.12rem 0.5rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.ss-status-queued { background: #fff3d6; color: #b7791f; }
.ss-status-running { background: #e8f0ff; color: #1d4ed8; }
.ss-status-done { background: #e3f1df; color: #0e6438; }
.ss-status-error { background: #fff1ef; color: var(--danger); }
.ss-status-canceled { background: var(--neutral-pill-bg); color: var(--muted); }

/* Result drawer (right slide-in) */
.ss-drawer { position: fixed; inset: 0; z-index: 1200; }
.ss-drawer[hidden] { display: none; }
.ss-drawer-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.45); }
.ss-drawer-card {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(640px, 100vw);
  background: var(--surface);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.22);
  animation: ss-slide-in 0.18s ease;
}
@keyframes ss-slide-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }
.ss-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  padding: 1rem 1.15rem; border-bottom: 1px solid var(--border);
}
.ss-drawer-headmain { min-width: 0; }
.ss-drawer-headmain h3 { margin: 0; font-size: 1.05rem; color: var(--text-strong); }
.ss-drawer-headmain p { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--muted); }
.ss-drawer-headactions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.ss-drawer-close {
  border: none; background: transparent; cursor: pointer; font-size: 1.4rem; line-height: 1;
  color: var(--muted); padding: 0 0.25rem;
}
.ss-drawer-close:hover { color: var(--text-strong); }
.ss-drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.15rem 1.5rem; }
.ss-drawer-body .find-exact-style-results { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.ss-drawer-body .find-exact-style-results[hidden] { display: none; }

@media (max-width: 720px) {
  .ss-toolbar-end { margin-left: 0; width: 100%; }
  .ss-job { flex-wrap: wrap; }
  .ss-job-actions { width: 100%; justify-content: flex-start; }
}

/* Find-exact-style "Run in background" affordance */
.fxs-run-bg-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; flex-wrap: wrap; }
.fxs-run-bg { display: inline-flex; align-items: center; gap: 0.35rem; }
.fxs-run-bg-status { font-size: 0.8rem; color: var(--muted); }
.fxs-run-bg-status.is-ok { color: #0e6438; }
.fxs-run-bg-status.is-error { color: var(--danger); }
.fxs-run-bg-status a { color: #1d4ed8; font-weight: 600; text-decoration: none; }
.fxs-run-bg-status a:hover { text-decoration: underline; }

/* Live preview button — opens the real storefront product page */
.product-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ============================================================ */
/* Additional Features page (af-*)                              */
/* ============================================================ */
.af-intro {
  margin-bottom: 1rem;
}
.af-automations {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
.af-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.25rem;
  display: grid;
  gap: 0.95rem;
}
.af-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.af-card-title {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.af-card-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f4f8;
  border: 1px solid var(--border);
  color: #2f6f57;
}
.af-card-icon svg { width: 21px; height: 21px; }
.af-card-icon.af-icon-muted {
  color: var(--muted-soft);
  font-size: 1.3rem;
  font-weight: 500;
}
.af-card-title h3 {
  margin: 0 0 0.18rem;
  font-size: 1.02rem;
  line-height: 1.2;
  color: var(--text-strong);
}
.af-card-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: 62ch;
}
.af-pill {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.af-pill.is-ready {
  background: #e7f5ec;
  color: #1c7a45;
  border-color: #bfe6cd;
}
.af-pill.is-unset {
  background: #fbf1e7;
  color: #9a5a14;
  border-color: #f0d9bd;
}

/* column map disclosure */
.af-mapping {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 0.5rem 0.8rem;
}
.af-mapping summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.af-mapping summary::-webkit-details-marker { display: none; }
.af-mapping summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--muted-soft);
  transition: transform 0.15s ease;
}
.af-mapping[open] summary::before { transform: rotate(90deg); }
.af-mapping ul {
  margin: 0.6rem 0 0.2rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.34rem;
}
.af-mapping li {
  font-size: 0.82rem;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.af-mapping li em { color: var(--muted); font-style: normal; }
.af-mapping code {
  font-size: 0.78rem;
  background: #eef0f2;
  border-radius: 5px;
  padding: 0.06rem 0.32rem;
}
.af-col {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--surface-dark);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* sheet setting */
.af-field { display: grid; gap: 0.4rem; }
.af-field > label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.af-field-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.af-field-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.86rem;
  color: var(--text);
  background: var(--surface);
}
.af-field-row input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(31, 31, 31, 0.06);
}
.af-field-row .btn { flex: 0 0 auto; }
.af-hint {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}
.af-hint code {
  font-size: 0.72rem;
  background: #eef0f2;
  border-radius: 5px;
  padding: 0.04rem 0.28rem;
}
.af-save-status {
  font-size: 0.78rem;
  font-weight: 600;
}
.af-save-status.is-ok { color: #1c7a45; }
.af-save-status.is-error { color: var(--danger); }

/* run row */
.af-run {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 0.95rem;
}
.af-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--text);
  cursor: pointer;
}
.af-toggle input { width: 15px; height: 15px; cursor: pointer; }
.af-catalog-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}
.af-run .btn-primary { flex: 0 0 auto; }

/* result banner */
.af-result {
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  font-size: 0.86rem;
  line-height: 1.45;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
}
.af-result.is-ok {
  background: #e7f5ec;
  border-color: #bfe6cd;
  color: #14633a;
}
.af-result.is-error {
  background: #fdecea;
  border-color: #f5c6c0;
  color: var(--danger);
}
.af-result-meta {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  opacity: 0.85;
}

.af-card-placeholder {
  border-style: dashed;
  background: var(--surface-subtle);
  box-shadow: none;
  opacity: 0.85;
}
.af-card-placeholder .af-card-title h3 { color: var(--muted); }

@media (min-width: 960px) {
  .af-automations { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* ---------------------------------------------------------------------------
   Product videos + compressor (product detail page)
   Scoped under [data-product-videos]; flat-namespaced product-video-*.
--------------------------------------------------------------------------- */
.product-videos-panel { margin-top: 16px; }
.product-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.product-video-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}
.product-video-player {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  display: block;
  object-fit: contain;
}
.product-video-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
}
.product-video-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.product-video-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.product-video-preset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.product-video-preset select {
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
}
.product-video-compress-btn { padding: 5px 12px; font-size: 12px; }
.product-video-compress-btn:disabled { opacity: 0.6; cursor: progress; }
.product-video-status {
  font-size: 12px;
  font-weight: 600;
  flex-basis: 100%;
}
.product-video-status.is-ok { color: #16a34a; }
.product-video-status.is-error { color: #dc2626; }
.product-video-status.is-muted { color: var(--text-muted, #9ca3af); font-weight: 500; }

/* ===================== Fitment — Find mods for your car ===================== */
.btn.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.btn-ghost:hover { background: var(--surface-subtle); }

.fitment-intro .section-head { margin-bottom: 14px; }
.fitment-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.fitment-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); }
.fitment-kpi-value { font-size: 22px; font-weight: 650; color: var(--text-strong); line-height: 1.1; }
.fitment-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fitment-kpi.is-accent { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.fitment-kpi.is-accent .fitment-kpi-value { color: var(--primary); }
.fitment-kpi.is-warn { background: var(--warning-bg, #fff7ed); border-color: #fdba74; }
.fitment-kpi.is-warn .fitment-kpi-value { color: #c2410c; }

.fitment-runner-row { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); }
.fitment-runner-row:first-child { border-top: 0; padding-top: 4px; }
.fitment-runner-main { max-width: 560px; }
.fitment-runner-main h3 { margin: 0 0 4px; font-size: 15px; }
.fitment-runner-main p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.fitment-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin-right: 14px; cursor: pointer; }
.fitment-runner-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 220px; }
.fitment-runner-actions .btn { white-space: nowrap; }
.fitment-progress { font-size: 12px; color: var(--muted); text-align: right; min-height: 16px; }
.fitment-progress.is-running { color: var(--primary); }
.fitment-progress.is-done { color: #16a34a; }
.fitment-progress.is-error { color: var(--danger); }

.fitment-platform-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fitment-platform { display: grid; grid-template-columns: 200px 1fr 44px; align-items: center; gap: 12px; }
.fitment-platform-name { font-size: 13px; color: var(--text); }
.fitment-platform-bar { height: 8px; background: var(--surface-subtle); border-radius: 999px; overflow: hidden; }
.fitment-platform-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.fitment-platform-count { font-size: 13px; font-weight: 600; color: var(--text-strong); text-align: right; }

.fitment-picker-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fitment-picker-controls select { min-width: 130px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 13px; color: var(--text); }
.fitment-picker-controls select:disabled { opacity: .5; }
.fitment-picker-meta { margin: 12px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-strong); }
.fitment-picker-results, .fitment-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 10px; }

.fit-card { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); border-left: 3px solid var(--border); }
.fit-card.fit-status-matched { border-left-color: #16a34a; }
.fit-card.fit-status-universal { border-left-color: #6366f1; }
.fit-card.fit-status-review { border-left-color: #f59e0b; }
.fit-card.fit-status-unresolved { border-left-color: var(--muted); }
.fit-card-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: var(--radius-sm, 6px); overflow: hidden; background: var(--surface-subtle); }
.fit-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fit-card-noimg { width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--surface-subtle), var(--surface-subtle) 6px, var(--surface) 6px, var(--surface) 12px); }
.fit-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fit-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fit-card-title { font-size: 13px; font-weight: 600; color: var(--text-strong); text-decoration: none; line-height: 1.3; }
.fit-card-title:hover { text-decoration: underline; }
.fit-card-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.fit-badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--surface-subtle); color: var(--text); border: 1px solid var(--border); }
.fit-badge.is-empty { color: var(--muted); font-style: italic; }
.fit-card-actions { display: flex; gap: 6px; margin-top: 2px; }
.fit-conf { font-size: 10px; text-transform: uppercase; letter-spacing: .03em; padding: 2px 6px; border-radius: 999px; flex: 0 0 auto; }
.fit-conf-high { background: #dcfce7; color: #15803d; }
.fit-conf-medium { background: #fef9c3; color: #a16207; }
.fit-conf-low { background: #fee2e2; color: #b91c1c; }

.fitment-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.fitment-tabs { display: inline-flex; gap: 2px; background: var(--surface-subtle); padding: 3px; border-radius: var(--radius-md); }
.fitment-tab { border: 0; background: transparent; padding: 6px 12px; border-radius: var(--radius-sm, 6px); font-size: 13px; color: var(--muted); cursor: pointer; }
.fitment-tab.is-active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); font-weight: 600; }
.fitment-search { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 13px; min-width: 220px; color: var(--text); }
.fitment-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 16px 0; text-align: center; }

.fitment-editor-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 1200; padding: 20px; }
.fitment-editor-backdrop[hidden] { display: none; }
.fitment-editor { background: var(--surface); border-radius: var(--radius-lg); width: min(720px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.fitment-editor-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.fitment-editor-head h3 { margin: 0; font-size: 15px; }
.fitment-editor-close { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.fitment-editor-body { padding: 16px 18px; }
.fitment-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.fitment-row { display: grid; grid-template-columns: 1.6fr 70px 70px 1fr 1fr 28px; gap: 6px; align-items: center; }
.fitment-row select, .fitment-row input { padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); font-size: 12px; background: var(--surface); color: var(--text); min-width: 0; }
.fitment-row-del { border: 0; background: transparent; color: var(--danger); font-size: 18px; cursor: pointer; line-height: 1; }
.fitment-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.fitment-editor-foot-right { display: flex; gap: 8px; }
.fitment-editor-status { padding: 0 18px 14px; font-size: 12px; color: var(--muted); min-height: 14px; }

@media (max-width: 900px) {
  .fitment-kpis { grid-template-columns: repeat(3, 1fr); }
  .fitment-runner-row { flex-direction: column; }
  .fitment-runner-actions { align-items: flex-start; }
  .fitment-platform { grid-template-columns: 130px 1fr 36px; }
}

/* Product detail — auto-restock opt-out (restock_service) */
.product-auto-restock {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafb;
}
/* settings-style row: label left, toggle switch right */
.product-auto-restock .checkbox-row {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: #353a3f;
  cursor: pointer;
}
/* Premium switch (shadcn/iOS-style) built from the native checkbox:
   42x24 track, 20px thumb with layered shadow, spring easing, focus ring. */
.product-auto-restock .checkbox-row input {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: #d0d5dd;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
  cursor: pointer;
  transition: background-color 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.product-auto-restock .checkbox-row input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2), 0 1px 3px rgba(16, 24, 40, 0.12);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.product-auto-restock .checkbox-row input:hover { background: #c4cad2; }
.product-auto-restock .checkbox-row input:checked { background: var(--primary, #008060); }
.product-auto-restock .checkbox-row input:checked:hover { background: var(--primary-dark, #006e52); }
.product-auto-restock .checkbox-row input:checked::after { transform: translateX(18px); }
.product-auto-restock .checkbox-row input:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06),
    0 0 0 3px color-mix(in srgb, var(--primary, #008060) 30%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .product-auto-restock .checkbox-row input,
  .product-auto-restock .checkbox-row input::after { transition: none; }
}
.product-auto-restock-meta { font-size: 0.72rem; color: #8a9097; }

/* ── Orders quick-filter strip ("needs attention" tiles) ─────────────────── */
.orders-quickbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
}
.orders-quick-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 108px;
  padding: 8px 14px;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: #11181c;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.orders-quick-tile:hover {
  border-color: #c5cad0;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}
.orders-quick-count {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.orders-quick-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}
.orders-quick-tile.is-active {
  border-color: #11181c;
  background: #11181c;
}
.orders-quick-tile.is-active .orders-quick-count { color: #fff; }
.orders-quick-tile.is-active .orders-quick-label { color: rgba(255, 255, 255, 0.72); }
/* Danger (overdue) + warning (blocked) accents — only when they have items. */
.orders-quick-danger.has-items { border-color: #f3c2c2; background: #fef4f4; }
.orders-quick-danger.has-items .orders-quick-count { color: #c0392b; }
.orders-quick-warning.has-items { border-color: #f1d7a8; background: #fffaf0; }
.orders-quick-warning.has-items .orders-quick-count { color: #b7791f; }
.orders-quick-danger.has-items.is-active,
.orders-quick-warning.has-items.is-active { background: #11181c; border-color: #11181c; }
.orders-quick-danger.has-items.is-active .orders-quick-count,
.orders-quick-warning.has-items.is-active .orders-quick-count { color: #fff; }
.orders-quick-clear {
  align-self: center;
  margin-left: 4px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
}
.orders-quick-clear:hover { color: #11181c; }

/* Per-slot "Remove supplier" action (variant detail Supplier Rows) — a subtle
   danger button, sorted to the bottom of the slot's action stack. */
.supplier-slot-actions .supplier-slot-remove { order: 5; }
.supplier-slot-remove {
  color: #c0392b;
  background: #fff;
  border: 1px solid #f0d2cf;
}
.supplier-slot-remove:hover {
  background: #fdeaea;
  border-color: #e3b7b2;
  color: #a93226;
}
.supplier-slot-remove:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ===================================================================== */
/* Wizard media grid — VIDEO tiles (edit mode)                            */
/* ===================================================================== */
/* Videos share the product-images grid so ops see them inline at their
   real media position and can drag-reorder them among the images. Videos
   are display + reorder only — no alt/crop/watermark/remove. */
.new-product-media-video {
  cursor: grab;
}
.new-product-media-video:active {
  cursor: grabbing;
}
.new-product-video-thumb {
  background: #0d1117;
}
.new-product-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
}
.new-product-video-noposter {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.16), transparent 60%),
    #0d1117;
}
/* ▶ Video badge — bottom-left, mirrors the file-size badge placement. */
.new-product-video-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(13, 17, 23, 0.82);
  color: #fff;
  font: 600 0.66rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  pointer-events: none;
}
/* Processing/uploading status chip (top-right) for not-yet-READY videos. */
.new-product-video-status {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 0.12rem 0.36rem;
  border-radius: 5px;
  background: rgba(176, 110, 0, 0.92);
  color: #fff;
  font: 600 0.6rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  pointer-events: none;
}
/* Caption sits where the alt-text input is on image tiles, so the grid
   rows stay vertically aligned. */
.new-product-video-caption {
  padding: 0.35rem 0.5rem;
  font: 500 0.7rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #8b949e;
  font-style: italic;
}

/* ── Instagram dashboard ─────────────────────────────────────────── */
[data-instagram-dashboard]{
  --ig-grad:linear-gradient(135deg,#feda75 0%,#fa7e1e 25%,#d62976 55%,#962fbf 80%,#4f5bd5 100%);
  max-width:1320px; margin:0 auto; padding:20px 24px 120px;
  font-size:13px; line-height:1.45;
}
[data-instagram-dashboard] svg{display:block;}
[data-instagram-dashboard] button{font-family:inherit; cursor:pointer;}

/* ── Page header ── */
.ig-page-header{display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px;}
.ig-page-title{display:flex; align-items:center; gap:13px;}
.ig-logo-chip{
  width:42px; height:42px; border-radius:12px; background:var(--ig-grad);
  display:flex; align-items:center; justify-content:center; color:#fff; flex-shrink:0;
  box-shadow:var(--shadow-sm);
}
.ig-logo-chip svg{width:24px; height:24px;}
.ig-title-text{font-size:19px; font-weight:680; color:var(--text-strong); letter-spacing:-.01em;}
.ig-title-sub{font-size:12.5px; color:var(--muted); margin-top:1px;}
.ig-page-actions{display:flex; gap:8px;}

/* ── Buttons ── */
.ig-btn{
  display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 13px;
  border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--surface);
  color:var(--text-strong); font-size:12.5px; font-weight:560; white-space:nowrap;
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.ig-btn svg{width:15px; height:15px;}
.ig-btn:hover{background:var(--surface-hover); border-color:var(--border-strong);}
.ig-btn:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}
.ig-btn.primary{background:var(--primary); border-color:var(--primary); color:#fff;}
.ig-btn.primary:hover{background:var(--primary-dark); border-color:var(--primary-dark);}
.ig-btn.primary:disabled{background:var(--border); border-color:var(--border); color:var(--muted-soft); cursor:not-allowed;}
.ig-btn.danger{color:var(--danger);}
.ig-btn.danger:hover{background:#fdf0ee; border-color:#f3b6ac;}

/* ── KPI strip ── */
.ig-kpis{display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:16px;}
.ig-kpi{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
  padding:13px 15px; box-shadow:var(--shadow-sm); display:flex; align-items:center; gap:12px;
}
.ig-kpi-icon{
  width:36px; height:36px; border-radius:10px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; color:var(--primary); background:#e6f4ef;
}
.ig-kpi-icon svg{width:18px; height:18px;}
.ig-kpi-icon.reel{color:#962fbf; background:#f4ecfa;}
.ig-kpi-icon.likes{color:var(--danger); background:#fdecea;}
.ig-kpi-val{font-size:21px; font-weight:700; color:var(--text-strong); letter-spacing:-.02em; line-height:1;}
.ig-kpi-label{font-size:11.5px; color:var(--muted); margin-top:3px; font-weight:520;}

/* ── Sticky toolbar ── */
.ig-toolbar{
  position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:rgba(246,246,247,.86); backdrop-filter:saturate(160%) blur(8px);
  padding:11px 0; margin:0 0 4px; border-bottom:1px solid var(--border);
}
.ig-segmented{display:inline-flex; padding:3px; background:var(--surface-subtle); border:1px solid var(--border); border-radius:11px; gap:2px; flex-wrap:wrap;}
.ig-seg{
  display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 11px; border:0; background:transparent;
  border-radius:8px; color:var(--muted); font-size:12.5px; font-weight:560;
  transition:background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ig-seg svg{width:14px; height:14px;}
.ig-seg:hover{color:var(--text-strong);}
.ig-seg.active{background:var(--surface); color:var(--text-strong); box-shadow:var(--shadow-sm);}
.ig-seg:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}
.ig-seg-count{font-size:11px; color:var(--muted-soft); font-weight:600;}
.ig-seg.active .ig-seg-count{color:var(--primary);}
.ig-toolbar-spacer{flex:1 1 auto;}
.ig-search-wrap{position:relative; display:inline-flex; align-items:center; flex:0 0 auto;}
.ig-search-wrap svg{position:absolute; left:10px; width:15px; height:15px; color:var(--muted-soft); pointer-events:none;}
.ig-search{
  height:34px; width:210px; padding:0 11px 0 31px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--text); font-size:12.5px; font-family:inherit;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.ig-search:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(0,128,96,.12);}
.ig-search::placeholder{color:var(--muted-soft);}
.ig-select{
  flex:0 0 auto; width:148px; box-sizing:border-box;
  height:34px; padding:0 30px 0 11px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23616161' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
  color:var(--text-strong); font-size:12.5px; font-weight:520; font-family:inherit; appearance:none; -webkit-appearance:none;
  transition:border-color .15s ease, box-shadow .15s ease; cursor:pointer;
}
.ig-select:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(0,128,96,.12);}
.ig-selectall{
  flex:0 0 auto;
  display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 11px;
  border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface);
  color:var(--text-strong); font-size:12.5px; font-weight:560;
  transition:background .15s ease, border-color .15s ease;
}
.ig-selectall:hover{background:var(--surface-hover); border-color:var(--border-strong);}
.ig-selectall svg{width:15px; height:15px;}

/* ── Results bar ── */
.ig-resultbar{display:flex; align-items:center; gap:10px; padding:13px 2px 11px; color:var(--muted); font-size:12.5px; min-height:38px;}
.ig-resultbar b{color:var(--text-strong); font-weight:620;}
.ig-dot{width:3px; height:3px; border-radius:50%; background:var(--border-strong); flex-shrink:0;}
.ig-sel-inline{color:var(--primary); font-weight:600;}
.ig-spinner{
  width:13px; height:13px; border:2px solid var(--border); border-top-color:var(--primary);
  border-radius:50%; animation:ig-spin .7s linear infinite;
}
.ig-spinner.hidden{display:none;}
@keyframes ig-spin{to{transform:rotate(360deg);}}

/* ── Grid ── */
.ig-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(186px,1fr)); gap:14px;}
.ig-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
  overflow:hidden; box-shadow:var(--shadow-sm); position:relative;
  transition:box-shadow .18s ease, border-color .18s ease;
}
.ig-card:hover{box-shadow:var(--shadow-md); border-color:var(--border-strong);}
.ig-card.selected{border-color:var(--primary); box-shadow:0 0 0 1px var(--primary),var(--shadow-md);}

.ig-thumb{position:relative; aspect-ratio:1; background:var(--surface-subtle); overflow:hidden; cursor:pointer;}
.ig-thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.ig-thumb-empty{
  width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:7px; color:var(--muted-soft); background:repeating-linear-gradient(45deg,var(--surface-subtle),var(--surface-subtle) 9px,#f4f4f5 9px,#f4f4f5 18px);
}
.ig-thumb-empty svg{width:26px; height:26px;}
.ig-thumb-empty span{font-size:11px; font-weight:520;}

/* type badge */
.ig-badge{
  position:absolute; top:8px; left:8px; display:inline-flex; align-items:center; gap:4px;
  height:23px; padding:0 8px; border-radius:7px; font-size:10.5px; font-weight:640; letter-spacing:.01em;
  background:rgba(31,31,31,.82); color:#fff; backdrop-filter:blur(4px); pointer-events:none;
}
.ig-badge svg{width:12px; height:12px;}
.ig-badge.reel{background:rgba(150,47,191,.9);}

/* selection check */
.ig-check{
  position:absolute; top:8px; right:8px; width:24px; height:24px; border-radius:7px;
  background:rgba(255,255,255,.92); border:1.5px solid rgba(255,255,255,.7);
  display:flex; align-items:center; justify-content:center; color:transparent;
  box-shadow:0 1px 3px rgba(0,0,0,.25); cursor:pointer;
  transition:background .15s ease, color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.ig-check svg{width:14px; height:14px; stroke-width:3;}
.ig-card:hover .ig-check{background:#fff; color:var(--muted);}
.ig-check:hover{box-shadow:0 0 0 2px rgba(0,128,96,.35),0 1px 3px rgba(0,0,0,.25);}
.ig-check:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}
.ig-card.selected .ig-check{
  background:var(--primary); border-color:#fff; color:#fff;
  box-shadow:0 0 0 2px rgba(0,128,96,.35),0 1px 4px rgba(0,0,0,.3);
}

/* hover overlay: caption + quick actions */
.ig-overlay{
  position:absolute; inset:0; display:flex; flex-direction:column; justify-content:flex-end;
  padding:10px; background:linear-gradient(to top,rgba(16,16,18,.78) 0%,rgba(16,16,18,.18) 48%,transparent 78%);
  opacity:0; transition:opacity .18s ease; pointer-events:none;
}
.ig-card:hover .ig-overlay{opacity:1; pointer-events:auto;}
.ig-overlay-caption{
  color:#fff; font-size:11.5px; line-height:1.4; font-weight:480; margin-bottom:9px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  text-shadow:0 1px 2px rgba(0,0,0,.4);
}
.ig-actions{display:flex; gap:6px;}
.ig-action{
  width:30px; height:30px; border-radius:8px; border:0; background:rgba(255,255,255,.16);
  color:#fff; display:flex; align-items:center; justify-content:center; backdrop-filter:blur(6px);
  transition:background .15s ease;
}
.ig-action svg{width:15px; height:15px;}
.ig-action:hover{background:rgba(255,255,255,.32);}
.ig-action.danger:hover{background:rgba(216,44,13,.85);}
.ig-action:focus-visible{outline:2px solid #fff; outline-offset:1px;}

/* card body — persistent stat chips */
.ig-card-body{padding:9px 10px 10px;}
.ig-user{display:flex; align-items:center; gap:6px; margin-bottom:8px;}
.ig-avatar{width:18px; height:18px; border-radius:50%; background:var(--ig-grad); flex-shrink:0;}
.ig-handle{font-size:12px; font-weight:600; color:var(--text-strong); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ig-stats{display:flex; flex-wrap:wrap; gap:5px;}
.ig-chip{
  display:inline-flex; align-items:center; gap:4px; height:22px; padding:0 7px;
  border-radius:6px; background:var(--surface-subtle); border:1px solid var(--border);
  color:var(--muted); font-size:11px; font-weight:560; font-variant-numeric:tabular-nums;
}
.ig-chip svg{width:12px; height:12px;}
.ig-chip.likes{color:var(--danger);}
.ig-chip.likes svg{color:var(--danger);}
.ig-chip.views{color:var(--primary);}

/* ── Empty state ── */
.ig-empty{
  grid-column:1/-1; text-align:center; padding:64px 20px;
  background:var(--surface); border:1px dashed var(--border-strong); border-radius:var(--radius-lg);
}
.ig-empty[hidden]{display:none;}
.ig-empty-icon{
  width:60px; height:60px; margin:0 auto 16px; border-radius:16px; background:#e6f4ef;
  display:flex; align-items:center; justify-content:center; color:var(--primary);
}
.ig-empty-icon svg{width:28px; height:28px;}
.ig-empty-title{font-size:16px; font-weight:660; color:var(--text-strong); margin-bottom:6px;}
.ig-empty-hint{font-size:13px; color:var(--muted); max-width:380px; margin:0 auto 18px; line-height:1.55;}

/* ── Pagination ── */
.ig-pager{display:flex; align-items:center; justify-content:center; gap:6px; margin-top:24px; flex-wrap:wrap;}
.ig-pager[hidden]{display:none;}
.ig-page{
  min-width:32px; height:32px; padding:0 9px; border:1px solid var(--border); border-radius:9px;
  background:var(--surface); color:var(--text-strong); font-size:12.5px; font-weight:560;
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
  transition:background .15s ease, border-color .15s ease;
}
.ig-page svg{width:15px; height:15px;}
.ig-page:hover:not(:disabled):not(.active){background:var(--surface-hover); border-color:var(--border-strong);}
.ig-page.active{background:var(--primary); border-color:var(--primary); color:#fff; cursor:default;}
.ig-page:disabled{color:var(--muted-soft); cursor:not-allowed;}
.ig-page:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}
.ig-pager-info{margin:0 8px; font-size:12px; color:var(--muted);}

/* ── Bulk action bar (slides in) ── */
.ig-bulkbar{
  position:fixed; left:50%; bottom:22px; transform:translate(-50%,160%);
  display:flex; align-items:center; gap:14px; z-index:60;
  background:var(--surface-dark); color:#fff; padding:9px 11px 9px 16px;
  border-radius:14px; box-shadow:0 12px 32px rgba(0,0,0,.28);
  transition:transform .26s cubic-bezier(.2,.8,.2,1);
}
.ig-bulkbar.show{transform:translate(-50%,0);}
.ig-bulk-count{display:flex; align-items:center; gap:8px; font-size:13px; font-weight:560;}
.ig-bulk-count b{font-weight:700;}
.ig-bulk-badge{
  display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:22px;
  padding:0 6px; border-radius:7px; background:var(--primary); font-size:12px; font-weight:700; color:#fff;
}
.ig-bulk-sep{width:1px; height:22px; background:rgba(255,255,255,.18);}
.ig-bulk-btn{
  display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 13px; border:0; border-radius:9px;
  font-size:12.5px; font-weight:600; background:rgba(255,255,255,.12); color:#fff;
  transition:background .15s ease;
}
.ig-bulk-btn svg{width:15px; height:15px;}
.ig-bulk-btn:hover{background:rgba(255,255,255,.22);}
.ig-bulk-btn.primary{background:var(--primary);}
.ig-bulk-btn.primary:hover{background:var(--primary-dark);}
.ig-bulk-btn.danger{background:rgba(216,44,13,.9);}
.ig-bulk-btn.danger:hover{background:var(--danger);}
.ig-bulk-btn.ghost{background:transparent; color:rgba(255,255,255,.75);}
.ig-bulk-btn.ghost:hover{background:rgba(255,255,255,.12); color:#fff;}
.ig-bulk-btn:focus-visible{outline:2px solid #fff; outline-offset:2px;}

/* ── Import modal ── */
.ig-modal-backdrop{
  position:fixed; inset:0; z-index:80; background:rgba(16,16,18,.42); backdrop-filter:blur(2px);
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.ig-modal-backdrop[hidden],.ig-modal-backdrop.hidden{display:none;}
.ig-modal{
  width:100%; max-width:480px; background:var(--surface); border-radius:var(--radius-lg);
  box-shadow:0 20px 56px rgba(0,0,0,.3); overflow:hidden;
}
.ig-modal-header{display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--border);}
.ig-modal-title{display:flex; align-items:center; gap:10px; font-size:15px; font-weight:660; color:var(--text-strong);}
.ig-modal-title .ig-logo-chip{width:30px; height:30px; border-radius:9px;}
.ig-modal-title .ig-logo-chip svg{width:17px; height:17px;}
.ig-modal-close{
  width:30px; height:30px; border:0; background:transparent; border-radius:8px; color:var(--muted);
  display:flex; align-items:center; justify-content:center; transition:background .15s ease, color .15s ease;
}
.ig-modal-close svg{width:17px; height:17px;}
.ig-modal-close:hover{background:var(--surface-hover); color:var(--text-strong);}
.ig-modal-close:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}
.ig-modal-body{padding:18px;}
.ig-import-hint{font-size:12.5px; color:var(--muted); line-height:1.55; margin:0 0 14px;}
.ig-import-hint b{color:var(--text-strong);}
.ig-field-label{display:block; font-size:12px; font-weight:560; color:var(--text-strong); margin-bottom:6px;}
.ig-field-label .ig-opt{color:var(--muted-soft); font-weight:480;}
.ig-input,.ig-textarea{
  width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--text); font-size:12.5px; font-family:inherit;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.ig-input:focus,.ig-textarea:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(0,128,96,.12);}
.ig-textarea{margin-top:13px; min-height:120px; resize:vertical; font-family:ui-monospace,"SF Mono",Menlo,monospace; font-size:12px; line-height:1.5;}
.ig-dropzone{
  margin-top:13px; border:1.5px dashed var(--border-strong); border-radius:var(--radius-md);
  padding:22px; text-align:center; color:var(--muted); background:var(--surface-subtle);
  display:flex; flex-direction:column; align-items:center; gap:8px; cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.ig-dropzone:hover,.ig-dropzone.dragover{border-color:var(--primary); background:#e6f4ef;}
.ig-dropzone svg{width:24px; height:24px; color:var(--primary);}
.ig-dropzone b{color:var(--text-strong); font-weight:600;}
.ig-modal-footer{display:flex; justify-content:flex-end; gap:9px; padding:14px 18px; border-top:1px solid var(--border); background:var(--surface-subtle);}
.ig-import-status{margin:13px 0 0; border-radius:var(--radius-sm); padding:8px 11px; font-size:12px;}
.ig-import-status[hidden]{display:none;}
.ig-import-status.info{background:#e6f4ef; color:var(--primary-dark);}
.ig-import-status.success{background:#e6f4ef; color:var(--primary-dark);}
.ig-import-status.error{background:#fdecea; color:var(--danger);}

@media (max-width:720px){
  [data-instagram-dashboard]{padding:14px 14px 120px;}
  .ig-kpis{grid-template-columns:1fr;}
  .ig-search{width:150px;}
  .ig-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px;}
}
@media (prefers-reduced-motion:reduce){
  [data-instagram-dashboard] *{transition:none !important;}
  .ig-bulkbar{transition:none !important;}
  .ig-spinner{animation:none !important;}
}

/* ── Instagram API key card (Settings page) ── */
.ig-apikey-row { margin: 10px 0; }
.ig-apikey-display { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ig-apikey-code { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 12px; font-family: monospace; color: var(--text-strong); word-break: break-all; }
.ig-apikey-none { color: var(--muted-soft); font-size: 13px; }
.ig-apikey-hint { font-size: 12px; color: var(--muted-soft); margin-top: 8px; }
.ig-apikey-hint code { background: var(--surface-subtle); padding: 2px 5px; border-radius: 4px; }

/* ── Fitment: AI verification badges + evidence (fitment.html) ─────────── */
.fit-verdict {
  display: inline-flex; align-items: center; margin-left: 6px;
  padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.fit-verdict-correct, .fit-verdict-approved { background: rgba(16, 185, 129, .12); color: #059669; }
.fit-verdict-corrected { background: rgba(245, 158, 11, .14); color: #b45309; }
.fit-verdict-wrong, .fit-verdict-uncertain { background: rgba(239, 68, 68, .12); color: #dc2626; }
.fit-card-evidence {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px;
  font-size: 11px; color: var(--muted); line-height: 1.35;
}
.fit-card-src { font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; opacity: .8; }
.fit-card-note { font-style: italic; }

/* ── Product Hunt (products_hunt.html) — ph-* ──────────────────────────── */
.ph-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.ph-kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}
.ph-kpi.is-accent { border-color: var(--primary); background: rgba(0, 128, 96, .05); }
.ph-kpi-value { font-size: 20px; font-weight: 700; color: var(--text-strong); line-height: 1.1; }
.ph-kpi.is-accent .ph-kpi-value { color: var(--primary); }
.ph-kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.ph-runner { margin-top: 14px; }
.ph-runner-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ph-runner-main h3 { margin: 0 0 4px; font-size: 14px; }
.ph-runner-main p { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 720px; }
.ph-runner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.ph-progress { font-size: 12px; color: var(--muted); min-width: 180px; text-align: right; }
.ph-progress.is-running { color: var(--primary); }
.ph-progress.is-error { color: var(--danger); }
.ph-progress.is-done { color: var(--text); }

.ph-results { margin-top: 14px; }
.ph-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ph-tabs { display: inline-flex; gap: 2px; background: var(--bg-muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.ph-tab {
  border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--muted);
}
.ph-tab.is-active { background: var(--surface); color: var(--text-strong); font-weight: 600; box-shadow: var(--shadow-sm); }
.ph-toolbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-search { width: 220px; min-width: 0; }
.ph-search, .ph-toolbar-controls select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 12.5px; background: var(--surface); color: var(--text);
  width: auto; max-width: 220px;
}
.ph-search { max-width: none; }

.ph-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.ph-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; text-align: center; padding: 26px 0; }
.ph-card {
  display: flex; gap: 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.ph-card.is-winner { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(0, 128, 96, .18); }
.ph-card-thumb { position: relative; flex-shrink: 0; }
.ph-card-thumb img, .ph-noimg { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-subtle); display: block; }
.ph-score {
  position: absolute; bottom: -6px; right: -6px;
  min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: #fff; border: 2px solid var(--surface);
}
.ph-score-hi { background: var(--primary); }
.ph-score-mid { background: #b45309; }
.ph-score-lo { background: #9ca3af; }
.ph-card-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.ph-card-top { display: flex; align-items: flex-start; gap: 8px; }
.ph-card-title {
  font-size: 13px; font-weight: 600; color: var(--text-strong); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.ph-card-title:hover { color: var(--primary); }
.ph-verdict { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.ph-verdict-winner { background: rgba(0, 128, 96, .12); color: var(--primary-dark); }
.ph-verdict-promising { background: rgba(245, 158, 11, .14); color: #b45309; }
.ph-verdict-skip { background: var(--neutral-pill-bg); color: var(--muted); }
.ph-verdict-unscored { background: var(--neutral-pill-bg); color: var(--muted-soft); }
.ph-card-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11.5px; color: var(--muted); }
.ph-seller { font-weight: 600; }
.ph-chip {
  padding: 1px 7px; border-radius: 999px; font-size: 10.5px;
  background: var(--neutral-pill-bg); color: var(--muted); white-space: nowrap;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.ph-chip-sold { background: rgba(0, 128, 96, .1); color: var(--primary-dark); font-weight: 600; }
.ph-chip-fits { background: rgba(59, 130, 246, .1); color: #1d4ed8; font-weight: 600; }
.ph-chip-carried { background: var(--warning-bg); color: var(--warning-text); font-weight: 600; }
.ph-chip-added { background: rgba(0, 128, 96, .12); color: var(--primary-dark); font-weight: 600; padding: 4px 10px; }
.ph-econ { font-size: 12.5px; color: var(--text); }
.ph-econ-margin { color: var(--primary-dark); font-weight: 700; }
.ph-reasons { margin: 0; padding-left: 16px; font-size: 11.5px; color: var(--muted); }
.ph-reasons li { margin: 1px 0; }
.ph-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
@media (max-width: 640px) {
  .ph-runner-row { flex-direction: column; }
  .ph-progress { text-align: left; }
}

/* ── Product Hunt v2 — signal breakdown, verdicts, tuning (ph-*) ────────── */
.ph-verdict-review { background: rgba(59, 130, 246, .12); color: #1d4ed8; }
button.ph-score { border: 2px solid var(--surface); cursor: pointer; }
button.ph-score:hover { transform: scale(1.08); }
.ph-signals[hidden] { display: none; }  /* [hidden] guard — flex overrides it */
.ph-signals {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--surface-subtle); font-size: 11.5px;
}
.ph-signal-row {
  display: grid; grid-template-columns: 82px 1fr 90px 52px;
  gap: 8px; align-items: center;
}
.ph-signal-row > span:first-child { font-weight: 600; color: var(--text-strong); }
.ph-signal-row.is-missing { grid-template-columns: 82px 1fr; color: var(--muted-soft); }
.ph-signal-detail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-signal-bar {
  height: 6px; border-radius: 999px; background: var(--neutral-pill-bg); overflow: hidden;
}
.ph-signal-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.ph-signal-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.ph-signal-foot { margin-top: 2px; padding-top: 5px; border-top: 1px solid var(--border); color: var(--muted); }
.ph-chip-via { background: rgba(139, 92, 246, .12); color: #6d28d9; font-weight: 600; }
.ph-chip-wrongfit { background: rgba(239, 68, 68, .12); color: #dc2626; font-weight: 700; }
.ph-chip-suppressed { background: var(--neutral-pill-bg); color: var(--muted-soft); font-style: italic; }
.ph-outcome-sold { background: rgba(0, 128, 96, .14); color: var(--primary-dark); font-weight: 700; padding: 4px 10px; text-decoration: none; }
.ph-outcome-pending { background: var(--warning-bg); color: var(--warning-text); font-weight: 600; padding: 4px 10px; text-decoration: none; }
.ph-dismiss-menu { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ph-dismiss-menu[hidden] { display: none; }
.ph-dismiss-menu .btn { font-size: 11px; padding: 3px 8px; color: var(--danger); }

.ph-config {
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-subtle);
}
.ph-config[hidden] { display: none; }
.ph-config-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.ph-config-head span { color: var(--muted); font-size: 11.5px; }
.ph-config-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.ph-config-field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.ph-config-field input {
  width: 84px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 12.5px; background: var(--surface);
}
.ph-config-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.ph-config-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ph-config-status { font-size: 12px; color: var(--muted); }

/* ── Product Hunt v2 — scorer report card (ph-eval-*) ──────────────────── */
.ph-eval { margin-top: 14px; }
.ph-eval-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.ph-eval-head h3 { margin: 0 0 4px; font-size: 14px; }
.ph-eval-head p { margin: 0; font-size: 12px; color: var(--muted); max-width: 620px; }
.ph-eval-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ph-eval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ph-eval-kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-subtle);
}
.ph-eval-kpi strong { font-size: 17px; color: var(--text-strong); }
.ph-eval-kpi span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ph-eval-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ph-eval-table th, .ph-eval-table td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--border); }
.ph-eval-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ph-eval-trend { margin-top: 10px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Product Hunt nav badge — pulsing "hunting…" while a run is live ────── */
.nav-hunting {
  background: rgba(0, 128, 96, .14); color: var(--primary-dark);
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  animation: ofp-hunt-pulse 1.6s ease-in-out infinite;
}
@keyframes ofp-hunt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ── Product Hunt — clone families (one card per product) ──────────────── */
button.ph-chip-family {
  background: rgba(0, 128, 96, .1); color: var(--primary-dark);
  font-weight: 700; cursor: pointer; border: none;
}
button.ph-chip-family:hover { background: rgba(0, 128, 96, .2); }
.ph-family-bar {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--text);
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-subtle);
}

/* ── Product Hunt — hunt digest (analyst briefing bar) ─────────────────── */
.ph-digest {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 12px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-subtle); font-size: 12px;
}
.ph-digest[hidden] { display: none; }
.ph-digest-lead { font-weight: 700; color: var(--text-strong); margin-right: 4px; }
.ph-digest-chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  background: var(--neutral-pill-bg); color: var(--text); font-size: 11.5px; border: none;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.ph-digest-chip { cursor: pointer; }
.ph-digest-chip.is-win { background: rgba(0, 128, 96, .14); color: var(--primary-dark); font-weight: 700; }
.ph-digest-chip.is-hot { background: rgba(245, 158, 11, .16); color: #b45309; font-weight: 600; }
.ph-digest-chip.is-muted { color: var(--muted); }

/* learning chip in the hunt digest */
.ph-digest-chip.is-learned { background: rgba(139, 92, 246, .12); color: #6d28d9; font-weight: 600; }

/* "looks like something we already sell" chip */
a.ph-chip-likeyours { background: rgba(245, 158, 11, .16); color: #92400e; font-weight: 600; text-decoration: none; }
a.ph-chip-likeyours:hover { background: rgba(245, 158, 11, .28); }

/* winner-notification email field in the tuning panel */
.ph-config-email input { width: 220px; text-transform: none; }

/* --- Product Hunt: MISSION (hunt-until-winners MAS round-loop) ------------ */
.ph-mission {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.ph-mission-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ph-mission-title { font-weight: 700; font-size: 13px; }
.ph-mission-hint {
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}
.ph-mission-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.ph-mission-field input {
  width: 52px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
  font-size: 12px;
}
.ph-mission-progress {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.ph-mission-progress[hidden] { display: none; }
.ph-mission-progress.is-running { color: var(--primary); }
.ph-mission-progress.is-done { color: #16a34a; }
.ph-mission-progress.is-error { color: var(--danger); }
.ph-mission-last {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.ph-mission-last[hidden] { display: none; }

/* --- Product Hunt: premium pass — intro + KPI tiles + engine deck --------- */
.ph-intro-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.ph-intro-title h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.01em; }
.ph-intro-sub { margin: 0; color: var(--muted); font-size: 13px; }
.ph-intro-actions { display: flex; gap: 8px; flex-shrink: 0; }

.ph-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.ph-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.ph-kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border);
}
.ph-kpi.is-winners::before { background: #d97706; }
.ph-kpi.is-promising::before { background: var(--primary); }
.ph-kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.ph-kpi-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ph-kpi.is-winners .ph-kpi-value { color: #b45309; }
.ph-kpi-foot { font-size: 11px; color: var(--muted); }

.ph-engines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ph-engine {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ph-engine:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: 0 1px 8px rgba(15, 40, 40, 0.06);
}
.ph-engine-head { display: flex; align-items: center; gap: 10px; }
.ph-engine-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  font-size: 16px;
  flex-shrink: 0;
}
.ph-engine-name h3 { margin: 0; font-size: 14px; letter-spacing: -0.01em; }
.ph-engine-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px dotted color-mix(in srgb, var(--muted) 60%, transparent);
  cursor: help;
}
.ph-engine-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  flex-grow: 1;
}
.ph-engine-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ph-engine .ph-progress,
.ph-engine .ph-mission-progress { margin-top: 2px; font-size: 12px; }
.ph-engine .ph-mission-last { margin-top: 0; }

@media (max-width: 1100px) {
  .ph-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ph-engines { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ph-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-intro-head { flex-direction: column; }
}

/* --- Product Hunt: premium pass — candidate cards + digest ---------------- */
.ph-card {
  padding: 14px;
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ph-card:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  box-shadow: 0 2px 12px rgba(15, 40, 40, 0.07);
}
.ph-card.is-winner {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent),
              0 2px 10px rgba(0, 128, 96, 0.06);
}
.ph-card-thumb img, .ph-noimg {
  width: 92px; height: 92px;
  border-radius: 10px;
}
.ph-noimg {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--primary) 7%, var(--surface-subtle)), var(--surface-subtle));
}
.ph-noimg::after {
  content: "";
  width: 26px; height: 26px;
  opacity: 0.45;
  background-color: var(--muted);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.6"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.5-3.5a2 2 0 0 0-2.8 0L5 21"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.6"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.5-3.5a2 2 0 0 0-2.8 0L5 21"/></svg>') center / contain no-repeat;
}
.ph-score {
  bottom: auto; right: auto;
  top: -7px; left: -7px;
  min-width: 30px; height: 22px;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 4px rgba(15, 40, 40, 0.18);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ph-score:hover { filter: brightness(1.08); }
.ph-card-actions {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  align-items: center;
}
.ph-card-actions [data-ph-dismiss],
.ph-card-actions [data-ph-status="new"] { margin-left: auto; color: var(--muted); }
.ph-card-actions [data-ph-dismiss]:hover { color: #b91c1c; }
.ph-reasons { margin: 0; }
.ph-digest {
  background: transparent;
  border: none;
  border-left: 3px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 0;
  padding: 4px 0 4px 12px;
}

/* ph-card action footer: one compact line — Create grows, Dismiss hugs right */
.ph-card-actions { gap: 6px; flex-wrap: nowrap; }
.ph-card-actions .btn {
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.ph-card-actions [data-ph-create] { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ph-card-actions .ph-chip { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ph-dismiss-menu { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-dismiss-menu[hidden] { display: none; }

/* ph-card icon buttons (shortlist star / dismiss ✕) + create sizing */
.ph-card-actions [data-ph-create] { overflow: visible; text-overflow: clip; flex-shrink: 0; }
.ph-iconbtn {
  width: 30px;
  padding: 5px 0 !important;
  text-align: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}
.ph-iconbtn.is-on { color: #b45309; border-color: color-mix(in srgb, #d97706 40%, var(--border)); }
.ph-card-actions .ph-iconbtn[data-ph-dismiss] { margin-left: auto; }

/* ph-signals: compact 3-col rows that can never overflow the card; the real
   measured number lives in the row tooltip. Dismiss menu becomes an anchored
   dropdown so it never squeezes the action footer. */
.ph-signals { overflow: hidden; }
.ph-signal-row { grid-template-columns: 82px minmax(0, 1fr) 34px; }
.ph-signal-row .ph-signal-detail { display: none; }
.ph-signal-row.is-missing { grid-template-columns: 82px minmax(0, 1fr); }
.ph-signal-row.is-missing .ph-signal-detail { display: block; }
.ph-card-actions { position: relative; }
.ph-dismiss-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 136px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 40, 40, 0.14);
  z-index: 30;
}
.ph-dismiss-menu[hidden] { display: none; }
.ph-dismiss-menu .btn { text-align: left; justify-content: flex-start; }

/* Product Hunt mobile: the tab strip + toolbar were the page's only
   horizontal-overflow sources (inline-flex pill rows never wrap). */
@media (max-width: 640px) {
  .ph-tabs { display: flex; flex-wrap: wrap; border-radius: 14px; }
  .ph-toolbar { flex-wrap: wrap; }
  .ph-toolbar input[type="search"], .ph-toolbar [data-ph-search] { flex: 1 1 160px; min-width: 0; }
  .ph-digest { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  /* page toolbar wraps instead of forcing a horizontal scroll */
  .page-toolbar { flex-wrap: wrap; row-gap: 8px; }
  .ph-kpi { padding: 10px 12px; min-width: 0; }
  .ph-kpi-foot { display: none; }
  .ph-kpi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ph engine badges + header buttons: inline Lucide SVG (no emoji) */
.ph-engine-badge svg { width: 17px; height: 17px; color: var(--primary); }
.ph-btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.ph-btn-icon svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ph-list "Load more" pagination (the grid used to cut off silently at 60) */
.ph-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.ph-more[hidden] { display: none; }
.ph-more-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Product Hunt: juice pass — action cluster, star states, micro-motion -- */
/* Star + dismiss live together as a tight icon cluster on the right; Create
   stays left. No more lone star floating in the void mid-card. */
.ph-card-actions .ph-iconbtn[data-ph-dismiss] { margin-left: 0; }
.ph-card-actions .ph-iconbtn:first-of-type { margin-left: auto; }
.ph-card-actions .ph-iconbtn {
  width: 32px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease,
              border-color 0.15s ease;
}
.ph-card-actions .ph-iconbtn:hover { transform: translateY(-1px); }
.ph-card-actions .ph-iconbtn:active { transform: scale(0.92); }
/* Shortlist star: outline → amber fill on hover; shortlisted = warm amber chip */
.ph-card-actions .ph-iconbtn[data-ph-status]:hover {
  color: #b45309;
  border-color: color-mix(in srgb, #d97706 45%, var(--border));
  background: color-mix(in srgb, #fbbf24 14%, var(--surface));
}
.ph-iconbtn.is-on {
  color: #b45309;
  background: color-mix(in srgb, #fbbf24 20%, var(--surface));
  border-color: color-mix(in srgb, #d97706 50%, var(--border));
}
.ph-card-actions .ph-iconbtn[data-ph-dismiss]:hover {
  color: #b91c1c;
  border-color: color-mix(in srgb, #dc2626 40%, var(--border));
  background: color-mix(in srgb, #ef4444 8%, var(--surface));
}

/* Card lift + thumbnail zoom — the "alive" feel */
.ph-card { will-change: transform; }
.ph-card:hover { transform: translateY(-2px); }
.ph-card-thumb a { display: block; overflow: hidden; border-radius: 10px; }
.ph-card-thumb img { transition: transform 0.25s ease; }
.ph-card:hover .ph-card-thumb img { transform: scale(1.05); }
.ph-card.is-winner {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--primary) 3.5%, var(--surface)) 0%, var(--surface) 34%);
}

/* Cards fade up as they land (tab switches, load-more) */
@keyframes ph-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ph-card { animation: ph-card-in 0.22s ease both; }

/* Primary CTA press feedback */
.ph-card-actions [data-ph-create] { transition: transform 0.12s ease, filter 0.15s ease; }
.ph-card-actions [data-ph-create]:hover { filter: brightness(1.12); transform: translateY(-1px); }
.ph-card-actions [data-ph-create]:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  .ph-card, .ph-card-thumb img, .ph-card-actions .ph-iconbtn,
  .ph-card-actions [data-ph-create] { animation: none; transition: none; }
  .ph-card:hover { transform: none; }
  .ph-card:hover .ph-card-thumb img { transform: none; }
}

/* Action-cluster alignment fix: :first-of-type matches by TAG, not class, so
   the star never got its auto-margin. The FIRST icon in the cluster carries
   margin-left:auto; a dismiss that follows a star sits tight beside it. */
.ph-card-actions .ph-iconbtn:first-of-type { margin-left: 0; }
.ph-card-actions .ph-iconbtn[data-ph-status] { margin-left: auto; }
.ph-card-actions .ph-iconbtn[data-ph-dismiss] { margin-left: auto; }
.ph-card-actions .ph-iconbtn[data-ph-status] ~ .ph-iconbtn[data-ph-dismiss] { margin-left: 0; }

/* --- Product Research page (pr-*) ------------------------------------------ */
.pr-form { margin-top: 4px; }
.pr-form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 12px;
}
.pr-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.pr-field span { font-weight: 600; color: var(--text-strong); }
.pr-field span em { font-weight: 400; color: var(--muted); font-style: normal; }
.pr-field input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}
.pr-field input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.pr-image-hint { font-size: 11px; font-weight: 500; color: var(--muted); }
.pr-image-hint.is-busy { color: var(--primary); }
.pr-image-hint.is-done { color: #16a34a; }
.pr-image-hint.is-error { color: var(--danger); }
.pr-image-preview {
  margin-top: 4px;
  max-width: 120px;
  max-height: 90px;
  width: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface);
}
.pr-form-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.pr-report-card { margin-top: 14px; }
.pr-report-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pr-report-thumb {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}
.pr-report-head h3 { margin: 0 0 2px; font-size: 15px; }
.pr-report-meta { margin: 0; font-size: 12px; color: var(--muted); }
.pr-summary { font-size: 13.5px; line-height: 1.6; }
.pr-recommendation {
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  border-radius: 0 8px 8px 0;
  font-weight: 600;
  font-size: 13px;
}
.pr-section { margin-top: 14px; }
.pr-section h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.pr-section p { margin: 0; font-size: 13px; line-height: 1.6; }
.pr-sources { display: flex; flex-direction: column; gap: 6px; }
.pr-source {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pr-source:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: 0 1px 6px rgba(15, 40, 40, 0.06);
}
.pr-source-kind {
  flex-shrink: 0;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted);
  min-width: 76px;
}
.pr-source-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pr-source-main strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-source-main small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-badge {
  flex-shrink: 0;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.pr-badge-same { background: rgba(0, 128, 96, .13); color: var(--primary-dark); }
.pr-badge-probable { background: rgba(245, 158, 11, .15); color: #b45309; }
.pr-badge-unverified { background: var(--neutral-pill-bg); color: var(--muted); }
.pr-excluded { margin-top: 12px; font-size: 12px; color: var(--muted); }

.pr-history { display: flex; flex-direction: column; gap: 6px; }
.pr-history-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease;
}
.pr-history-row:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.pr-history-status {
  flex-shrink: 0;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  background: var(--neutral-pill-bg); color: var(--muted);
}
.pr-history-status.is-done { background: rgba(0, 128, 96, .13); color: var(--primary-dark); }
.pr-history-status.is-running { background: rgba(59, 130, 246, .13); color: #1d4ed8; }
.pr-history-status.is-error { background: rgba(239, 68, 68, .12); color: #dc2626; }
.pr-history-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600; }
.pr-history-date { flex-shrink: 0; font-size: 11.5px; color: var(--muted); }

@media (max-width: 900px) {
  .pr-form-grid { grid-template-columns: 1fr; }
}

/* --- Lightbox v2: Check panel (lint + AI critique) ------------------------ */
/* Dense results card pinned to the stage's top-right. Same dark-overlay
   palette as the merge picker; [hidden] guard required because of the flex
   display (see the supplier-profile CSS note). */
.lightbox-check-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(340px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  background: rgba(15, 17, 21, 0.93);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: #e5e7eb;
  font-size: 12px;
  z-index: 7;
  overflow: hidden;
}
.lightbox-check-panel[hidden] {
  display: none;
}
.lightbox-check-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.lightbox-check-head strong {
  font-size: 12px;
  letter-spacing: 0.02em;
}
.lightbox-check-score {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.lightbox-check-score[data-band="good"] { color: #6ee7b7; border-color: rgba(110, 231, 183, 0.4); }
.lightbox-check-score[data-band="mid"] { color: #fcd34d; border-color: rgba(252, 211, 77, 0.4); }
.lightbox-check-score[data-band="bad"] { color: #fca5a5; border-color: rgba(252, 165, 165, 0.4); }
.lightbox-check-close {
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.lightbox-check-close:hover { color: #fff; }
.lightbox-check-list {
  list-style: none;
  margin: 0;
  padding: 6px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lightbox-check-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.35;
}
.lightbox-check-badge {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
.lightbox-check-item.is-pass .lightbox-check-badge { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.lightbox-check-item.is-warn .lightbox-check-badge { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }
.lightbox-check-item.is-fail .lightbox-check-badge { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.lightbox-check-item.is-info .lightbox-check-badge { background: rgba(148, 163, 184, 0.22); color: #cbd5e1; }
.lightbox-check-text strong {
  font-weight: 600;
  color: #f9fafb;
}
.lightbox-check-suggest {
  padding: 7px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #a7f3d0;
  line-height: 1.4;
}
.lightbox-check-suggest[hidden] {
  display: none;
}

/* ---- Mission Control (file-based build queue front-end) ---- */
.mc-intro h2 { margin: 0 0 4px; font-size: 17px; }
.mc-sub { margin: 0 0 14px; color: var(--muted, #6b7280); font-size: 12.5px; max-width: 760px; }
.mc-sub code { font-size: 11.5px; }
.mc-form { display: grid; gap: 10px; max-width: 760px; }
.mc-field { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.mc-field em { font-weight: 400; color: var(--muted, #6b7280); }
.mc-field input, .mc-field textarea { font: inherit; font-weight: 400; padding: 7px 9px; border: 1px solid var(--border, #d1d5db); border-radius: 8px; background: var(--surface, #fff); }
.mc-field textarea { resize: vertical; min-height: 96px; }
.mc-form-foot { display: flex; align-items: center; gap: 10px; }
.mc-form-status { font-size: 12px; color: var(--muted, #6b7280); }
.mc-form-status[data-tone="ok"] { color: var(--success, #047857); }
.mc-form-status[data-tone="err"] { color: var(--danger, #b91c1c); }
.mc-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
@media (max-width: 1100px) { .mc-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mc-columns { grid-template-columns: 1fr; } }
.mc-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-col-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.mc-col-head-r { display: flex; align-items: center; gap: 8px; }
.mc-count { font-size: 11px; font-weight: 700; background: var(--surface-muted, #f3f4f6); border-radius: 999px; padding: 2px 8px; }
.mc-col-clear { font-size: 11px; font-weight: 600; background: none; border: 1px solid var(--border, #e5e7eb); color: var(--muted, #6b7280); border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.mc-col-clear:hover { color: var(--danger, #b91c1c); border-color: var(--danger, #b91c1c); }
.mc-col-clear:disabled { opacity: 0.5; cursor: default; }
.mc-list { display: grid; gap: 6px; }
.mc-empty { font-size: 12px; color: var(--muted, #9ca3af); padding: 6px 2px; }
.mc-item { border: 1px solid var(--border, #e5e7eb); border-left-width: 3px; border-radius: 8px; padding: 7px 9px; font-size: 12.5px; background: var(--surface, #fff); }
.mc-item-queued { border-left-color: #94a3b8; }
.mc-item-doing { border-left-color: var(--info, #2563eb); }
.mc-item-done { border-left-color: var(--success, #059669); }
.mc-item-failed { border-left-color: var(--danger); }
.mc-item-row { display: flex; align-items: center; gap: 8px; }
.mc-item-name { font-weight: 600; word-break: break-all; margin-right: auto; }
.mc-item-time { color: var(--muted, #6b7280); font-size: 11px; white-space: nowrap; }
.mc-item-toggle { font: inherit; font-size: 11px; font-weight: 600; padding: 2px 8px; border: 1px solid var(--border, #d1d5db); border-radius: 6px; background: var(--surface-muted, #f9fafb); cursor: pointer; }
.mc-item-toggle:hover { background: var(--surface-hover, #f3f4f6); }
.mc-report { margin-top: 7px; border-top: 1px dashed var(--border, #e5e7eb); padding-top: 7px; }
.mc-report-branch { font-size: 11.5px; margin-bottom: 5px; }
.mc-report-branch code { background: var(--surface-muted, #f3f4f6); padding: 1px 6px; border-radius: 5px; }
.mc-report-body { margin: 0; max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; line-height: 1.5; background: var(--surface-muted, #f8fafc); border-radius: 6px; padding: 8px; }
.mc-report-loading { font-size: 12px; color: var(--muted, #6b7280); }

/* ---- Mission Control composer (attach + model + send) ---- */
.mc-composer { display: grid; gap: 8px; max-width: 760px; }
.mc-composer textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--border, #d1d5db); border-radius: 10px 10px 0 0; border-bottom: none; background: var(--surface, #fff); resize: vertical; min-height: 88px; margin-bottom: -8px; }
.mc-composer textarea:focus { outline: none; border-color: var(--primary, #0d9488); }
.mc-composer-bar { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border, #d1d5db); border-top: 1px dashed var(--border, #e5e7eb); border-radius: 0 0 10px 10px; padding: 6px 8px; background: var(--surface, #fff); }
.mc-composer textarea:focus + .mc-attach-list + .mc-composer-bar, .mc-composer textarea:focus + .mc-composer-bar { border-color: var(--primary, #0d9488); }
.mc-tool-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--border, #d1d5db); border-radius: 7px; background: var(--surface-muted, #f9fafb); color: var(--muted, #6b7280); cursor: pointer; }
.mc-tool-btn:hover { color: var(--primary, #0d9488); border-color: var(--primary, #0d9488); }
.mc-model-select { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--border, #d1d5db); border-radius: 7px; background: var(--surface-muted, #f9fafb); color: inherit; }
.mc-send-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: auto; border: none; border-radius: 8px; background: var(--primary, #0d9488); color: #fff; cursor: pointer; }
.mc-send-btn:hover { filter: brightness(1.08); }
.mc-send-btn:disabled { opacity: 0.55; cursor: default; }
.mc-attach-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border, #e5e7eb); border-left: 1px solid var(--border, #d1d5db); border-right: 1px solid var(--border, #d1d5db); padding: 6px 8px; background: var(--surface-muted, #f8fafc); font-size: 12px; margin-bottom: -8px; }
.mc-attach-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border, #e5e7eb); }
.mc-attach-name { color: var(--muted, #6b7280); word-break: break-all; }
.mc-attach-remove { margin-left: auto; border: none; background: none; font-size: 15px; line-height: 1; color: var(--muted, #9ca3af); cursor: pointer; padding: 2px 6px; }
.mc-attach-remove:hover { color: var(--danger, #b91c1c); }
.mc-attach-chip[hidden] { display: none; }

/* ---- Mission Control report artifacts (harvested screenshots) ---- */
.mc-artifacts { display: grid; gap: 8px; margin-top: 8px; }
.mc-artifact { margin: 0; }
.mc-artifact-img { display: block; max-width: 100%; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; }
.mc-artifact figcaption { font-size: 11px; color: var(--muted, #6b7280); margin-top: 3px; word-break: break-all; }

/* ---- Mission Control live transcript (stream-json feed) ---- */
.mc-live-dot { color: var(--info, #2563eb); font-size: 9px; animation: mc-pulse 1.2s ease-in-out infinite; }
@keyframes mc-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.mc-transcript { margin-top: 7px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: #0f172a; padding: 8px; display: grid; gap: 5px; font-size: 11px; line-height: 1.45; }
.mc-transcript code { font-family: var(--mono, ui-monospace, monospace); font-size: 10.5px; }
.mc-tr-sys { color: #94a3b8; font-style: italic; }
.mc-tr-text { color: #e2e8f0; white-space: pre-wrap; word-break: break-word; }
.mc-tr-tool { color: #7dd3fc; }
.mc-tr-tool-name { font-weight: 600; }
.mc-tr-tool code { color: #cbd5e1; background: rgba(148,163,184,0.15); padding: 1px 5px; border-radius: 4px; }
.mc-tr-toolresult { color: #94a3b8; padding-left: 10px; white-space: pre-wrap; word-break: break-word; }
.mc-tr-toolresult.is-error { color: #fca5a5; }
.mc-tr-final { color: #6ee7b7; white-space: pre-wrap; word-break: break-word; border-top: 1px dashed rgba(148,163,184,0.3); padding-top: 5px; margin-top: 2px; }
.mc-tr-final.is-error { color: #fca5a5; }

/* ---- Mission Control chat threads (follow-up turns) ---- */
.mc-thread { display: grid; gap: 8px; }
.mc-turn { display: grid; gap: 6px; }
.mc-turn-user { border: 1px solid var(--primary, #0d9488); border-left-width: 3px; border-radius: 8px; padding: 6px 9px; background: rgba(13,148,136,0.05); }
.mc-turn-user pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 11.5px; }
.mc-turn-who { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary, #0d9488); margin-bottom: 3px; }
.mc-fu { display: grid; gap: 6px; margin-top: 9px; border-top: 1px dashed var(--border, #e5e7eb); padding-top: 9px; }
.mc-fu textarea { font: inherit; font-size: 12px; padding: 7px 9px; border: 1px solid var(--border, #d1d5db); border-radius: 8px; resize: vertical; }
.mc-fu-bar { display: flex; align-items: center; gap: 8px; }
.mc-fu-bar .mc-send-btn { margin-left: auto; }
.mc-fu-chip { font-size: 11px; color: var(--muted, #6b7280); background: var(--surface-muted, #f3f4f6); border-radius: 6px; padding: 2px 7px; }
.mc-fu-chip button { border: none; background: none; cursor: pointer; color: var(--muted, #9ca3af); font-size: 13px; }
.mc-tr-turnsep { color: #fbbf24; text-align: center; font-size: 10.5px; letter-spacing: 0.04em; padding: 3px 0; }

/* ---- Mission Control full-screen conversation page ---- */
.mc-item-name-link { color: inherit; text-decoration: none; }
.mc-item-name-link:hover { color: var(--primary, #0d9488); text-decoration: underline; }
.mc-item-openrow { margin-top: 4px; }
.mc-item-open { font-size: 11px; font-weight: 600; color: var(--primary, #0d9488); text-decoration: none; }
.mc-item-open:hover { text-decoration: underline; }

.mc-task { position: fixed; top: 0; right: 0; bottom: 0; left: 280px; display: flex; flex-direction: column; background: var(--surface-muted, #f6f7f9); z-index: 5; }
@media (max-width: 900px) { .mc-task { left: 0; } }
.mc-task-head { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); flex: 0 0 auto; }
.mc-task-back { font-size: 12.5px; font-weight: 600; color: var(--primary, #0d9488); text-decoration: none; white-space: nowrap; }
.mc-task-back:hover { text-decoration: underline; }
.mc-task-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.mc-task-name { font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-task-status { flex: 0 0 auto; }
.mc-task-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 9px; border-radius: 999px; }
.mc-task-status-running { background: rgba(37,99,235,0.12); color: #2563eb; }
.mc-task-status-done { background: rgba(5,150,105,0.12); color: #059669; }
.mc-task-status-failed { background: rgba(220,38,38,0.12); color: #dc2626; }
.mc-task-branch { margin-left: auto; flex: 0 1 auto; min-width: 0; max-width: 42%; font-size: 11.5px; color: var(--muted, #6b7280); font-family: var(--mono, ui-monospace, monospace); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mc-task-thread { flex: 1 1 auto; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; max-width: 900px; width: 100%; margin: 0 auto; }
.mc-task-loading { color: var(--muted, #9ca3af); font-size: 13px; text-align: center; margin-top: 40px; }
.mc-msg { display: grid; gap: 4px; }
.mc-msg-who { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted, #6b7280); }
.mc-msg-user { justify-items: end; }
.mc-msg-user .mc-msg-who { color: var(--primary, #0d9488); }
.mc-msg-user .mc-msg-body { background: var(--primary, #0d9488); color: #fff; border-radius: 12px 12px 3px 12px; padding: 9px 13px; max-width: 78%; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; }
.mc-msg-agent .mc-msg-report { margin: 0; background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 12px 12px 12px 3px; padding: 11px 14px; max-width: 88%; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 12.5px; line-height: 1.55; }
.mc-msg-live .mc-msg-who .mc-live-dot { color: var(--info, #2563eb); font-size: 9px; }
.mc-task-feed { margin-top: 5px; max-height: 420px; overflow-y: auto; border-radius: 10px; background: #0f172a; padding: 10px; display: grid; gap: 5px; font-size: 11px; line-height: 1.45; max-width: 88%; }
.mc-task-fulltr { margin-top: 4px; }
.mc-task-tr-toggle { justify-self: start; }

.mc-task-composer { flex: 0 0 auto; border-top: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); padding: 12px 22px 16px; }
.mc-task-note { max-width: 856px; margin: 0 auto 8px; font-size: 11.5px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 7px 10px; }
.mc-task-attach-chip { max-width: 856px; margin: 0 auto 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.mc-task-attach-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border, #e5e7eb); }
.mc-task-attach-chip button { margin-left: auto; border: none; background: none; font-size: 15px; color: var(--muted, #9ca3af); cursor: pointer; }
.mc-task-composer-row { max-width: 856px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--border, #d1d5db); border-radius: 12px; padding: 7px 8px; background: var(--surface, #fff); }
.mc-task-composer-row:focus-within { border-color: var(--primary, #0d9488); }
.mc-task-composer-row textarea { flex: 1 1 auto; font: inherit; font-size: 13px; border: none; outline: none; resize: none; padding: 5px 4px; max-height: 200px; background: transparent; }
.mc-task-composer-row .mc-model-select { align-self: center; }
.mc-task-composer-row .mc-send-btn { flex: 0 0 auto; }
.mc-task-composer-status { max-width: 856px; margin: 6px auto 0; font-size: 11.5px; color: var(--muted, #6b7280); }
.mc-task-composer-status[data-tone="ok"] { color: var(--success, #047857); }
.mc-task-composer-status[data-tone="err"] { color: var(--danger, #b91c1c); }

/* =====================================================================
   Mission Control — Claude Code dark theme (scoped to MC pages only)
   Palette extracted from the Claude Code desktop app: warm near-black
   backgrounds, slightly lighter panels, muted gray text, terracotta accent.
   ===================================================================== */
body.mc-dark, [data-mission-control], [data-mc-task] {
  --cc-bg: #262523;           /* main warm near-black */
  --cc-bg-deep: #1f1e1c;      /* deepest (composer well, code) */
  --cc-panel: #2f2e2b;        /* cards / panels */
  --cc-panel-2: #35332f;      /* hover / raised */
  --cc-border: #3a3833;       /* hairline borders */
  --cc-border-soft: #322f2b;
  --cc-text: #ece9e3;         /* primary */
  --cc-text-2: #b8b3a9;       /* secondary */
  --cc-muted: #8a857b;        /* tertiary / meta */
  --cc-accent: #d97757;       /* terracotta — active, spark, focus */
  --cc-accent-dim: rgba(217,119,87,0.16);
  --cc-green: #7fae6b;        /* diff + */
  --cc-red: #cd6f63;          /* diff − / errors */
  --cc-blue: #7fa8c9;         /* running / info */
  --cc-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Board page ---------- */
/* Dark canvas that bleeds to fill the content area (cancels .dashboard-main's
   1.4rem padding) so no light app background shows between/around columns. */
[data-mission-control] { color: var(--cc-text); background: transparent; box-sizing: border-box; }
[data-mission-control] .surface-card { background: var(--cc-panel); border: 1px solid var(--cc-border); box-shadow: none; border-radius: 12px; }
[data-mission-control] .mc-intro h2 { color: var(--cc-text); }
[data-mission-control] .mc-sub { color: var(--cc-text-2); }
[data-mission-control] .mc-sub code, [data-mission-control] code { color: var(--cc-accent); background: none; }
[data-mission-control] .mc-count { background: var(--cc-bg-deep); color: var(--cc-text-2); }
[data-mission-control] .mc-col-clear { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-col-clear:hover { color: var(--cc-red); border-color: var(--cc-red); }
[data-mission-control] .mc-empty { color: var(--cc-muted); }
[data-mission-control] .mc-composer textarea,
[data-mission-control] .mc-composer-bar,
[data-mission-control] .mc-field input,
[data-mission-control] .mc-field textarea { background: var(--cc-bg-deep); border-color: var(--cc-border); color: var(--cc-text); }
[data-mission-control] .mc-composer textarea::placeholder { color: var(--cc-muted); }
[data-mission-control] .mc-tool-btn { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-tool-btn:hover { color: var(--cc-accent); border-color: var(--cc-accent); }
[data-mission-control] .mc-model-select { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text); }
[data-mission-control] .mc-send-btn { background: var(--cc-accent); color: #1f1e1c; }
[data-mission-control] .mc-send-btn:hover { filter: brightness(1.08); }

/* Columns: equal width, gapped, each a flat panel whose list scrolls on its own. */
[data-mission-control] .mc-columns { gap: 14px; }
[data-mission-control] .mc-col { background: var(--cc-panel); border: 1px solid var(--cc-border); border-radius: 12px; color: var(--cc-text); display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 232px); padding: 12px; }
[data-mission-control] .mc-col-head { margin-bottom: 10px; flex: 0 0 auto; }
[data-mission-control] .mc-col-head h3 { font-size: 11px; letter-spacing: 0.06em; color: var(--cc-text-2); }
[data-mission-control] .mc-list { overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 7px; min-width: 0; padding-right: 2px; }

/* Task cards: flat, quiet, clipped to the column. Line 1 dot+title, line 2 meta+actions. */
[data-mission-control] .mc-item { background: var(--cc-panel-2); border: 1px solid var(--cc-border); border-radius: 9px; padding: 9px 11px; overflow: visible; min-width: 0; flex: 0 0 auto; transition: border-color 0.12s, background 0.12s; }
[data-mission-control] .mc-item:hover { border-color: var(--cc-muted); }
[data-mission-control] .mc-item-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
[data-mission-control] .cc-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--cc-muted); }
[data-mission-control] .cc-dot-done { background: var(--cc-green); }
[data-mission-control] .cc-dot-failed { background: var(--cc-red); }
[data-mission-control] .cc-dot-doing { background: var(--cc-accent); }
[data-mission-control] .cc-dot-queued { background: var(--cc-muted); }
[data-mission-control] .cc-dot-live { animation: mc-pulse 1.2s ease-in-out infinite; }
[data-mission-control] .mc-item-name { flex: 1 1 auto; min-width: 0; color: var(--cc-text); font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
[data-mission-control] a.mc-item-name:hover { color: var(--cc-accent); }
[data-mission-control] .mc-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; min-width: 0; }
[data-mission-control] .mc-item-time { color: var(--cc-muted); font-size: 10.5px; white-space: nowrap; flex: 0 0 auto; margin-left: auto; }
[data-mission-control] .mc-item-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-top: 9px; }
[data-mission-control] .mc-item-actions-l, [data-mission-control] .mc-item-actions-r { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
[data-mission-control] .mc-item-actions-solo { justify-content: flex-end; }
[data-mission-control] .mc-item-open { color: var(--cc-accent); font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }
[data-mission-control] .mc-item-open:hover { text-decoration: underline; }
[data-mission-control] .mc-item-toggle { background: none; border: none; color: var(--cc-muted); font-size: 11px; padding: 0; cursor: pointer; white-space: nowrap; }
[data-mission-control] .mc-item-toggle:hover { color: var(--cc-text); }

/* In-progress card: inset transcript panel, capped height, internal scroll. */
[data-mission-control] .mc-item-doing { background: var(--cc-panel); }
[data-mission-control] .mc-item .cc-feed { margin-top: 9px; max-height: 240px; overflow-y: auto; border-radius: 8px; padding: 9px 10px; }

/* Inline report/thread peek (the real review UX is the full page). */
[data-mission-control] .mc-report { background: transparent; }
[data-mission-control] .mc-report-branch code, [data-mission-control] .mc-fu-chip { background: var(--cc-bg-deep); color: var(--cc-text-2); }
[data-mission-control] .mc-turn-user { background: var(--cc-accent-dim); border-color: var(--cc-accent); }
[data-mission-control] .mc-turn-who { color: var(--cc-accent); }
[data-mission-control] .mc-report-body { color: var(--cc-text-2); }
[data-mission-control] .mc-fu textarea { background: var(--cc-bg-deep); border-color: var(--cc-border); color: var(--cc-text); }

/* ---------- Claude-Code transcript feed (both pages) ---------- */
.cc-feed { background: var(--cc-bg-deep) !important; border-color: var(--cc-border) !important; color: var(--cc-text-2); }
.cc-prose { color: var(--cc-text); white-space: pre-wrap; word-break: break-word; line-height: 1.6; font-size: 12.5px; }
.cc-chip { font-family: var(--cc-mono); font-size: 0.92em; background: var(--cc-accent-dim); color: var(--cc-accent); padding: 1px 5px; border-radius: 4px; }
.cc-sys { color: var(--cc-muted); font-style: italic; font-size: 11px; }
.cc-group { border-radius: 7px; }
.cc-group-head { width: 100%; text-align: left; background: none; border: none; color: var(--cc-muted); font: inherit; font-size: 11.5px; cursor: pointer; padding: 3px 2px; display: flex; align-items: center; gap: 6px; }
.cc-group-head:hover { color: var(--cc-text-2); }
.cc-caret { margin-left: auto; transition: transform 0.15s; color: var(--cc-muted); }
.cc-group.is-open .cc-caret { transform: rotate(90deg); }
.cc-group-body { display: none; margin: 2px 0 4px 10px; padding-left: 8px; border-left: 1px solid var(--cc-border); }
.cc-group.is-open .cc-group-body { display: grid; gap: 3px; }
.cc-tool { font-size: 11px; color: var(--cc-text-2); }
.cc-tool-name { color: var(--cc-accent); font-weight: 600; }
.cc-tool .cc-chip { font-size: 10.5px; }
.cc-toolres { font-size: 10.5px; color: var(--cc-muted); padding-left: 4px; white-space: pre-wrap; word-break: break-word; }
.cc-toolres.is-error { color: var(--cc-red); }
.cc-turnsep { text-align: center; margin: 6px 0; }
.cc-turnsep span { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--cc-accent); background: var(--cc-bg-deep); padding: 0 8px; }
.cc-final { color: var(--cc-text); white-space: pre-wrap; word-break: break-word; line-height: 1.6; font-size: 12.5px; border-top: 1px solid var(--cc-border); padding-top: 8px; margin-top: 6px; }
.cc-final.is-error { color: var(--cc-red); }
.cc-meta { font-size: 10.5px; color: var(--cc-muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.cc-spark { color: var(--cc-accent); }

/* ---------- Full-screen conversation page ---------- */
.mc-task { background: var(--cc-bg); color: var(--cc-text); }
.mc-task-head { background: var(--cc-bg); border-bottom-color: var(--cc-border); }
.mc-task-back { color: var(--cc-accent); }
.mc-task-name { color: var(--cc-text); }
.mc-task-status-running { background: rgba(127,168,201,0.16); color: var(--cc-blue); }
.mc-task-status-done { background: rgba(127,174,107,0.16); color: var(--cc-green); }
.mc-task-status-failed { background: rgba(205,111,99,0.16); color: var(--cc-red); }
.mc-task-branch { color: var(--cc-muted); font-family: var(--cc-mono); }
.mc-task-thread { background: var(--cc-bg); }
.mc-task-loading { color: var(--cc-muted); }
.mc-msg-who { color: var(--cc-muted); }
.mc-msg-user .mc-msg-who { color: var(--cc-accent); }
.mc-msg-user .mc-msg-body { background: var(--cc-accent); color: #201d1a; }
.mc-msg-agent .mc-msg-report { background: transparent; border: none; padding: 2px 0; max-width: 100%; color: var(--cc-text); }
.mc-task-feed { max-width: 100%; }
.mc-msg-live .mc-msg-who .mc-live-dot { color: var(--cc-accent); }
.mc-task-composer { background: var(--cc-bg); border-top-color: var(--cc-border); }
.mc-task-note { background: rgba(217,119,87,0.10); border-color: rgba(217,119,87,0.4); color: #e6b8a4; }
.mc-task-composer-row { background: var(--cc-bg-deep); border-color: var(--cc-border); border-radius: 14px; }
.mc-task-composer-row:focus-within { border-color: var(--cc-accent); }
.mc-task-composer-row textarea { color: var(--cc-text); }
.mc-task-composer-row textarea::placeholder { color: var(--cc-muted); }
.mc-task-composer-row .mc-model-select { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text); }
.mc-task-composer-row .mc-send-btn { background: var(--cc-accent); color: #201d1a; }
.mc-task-composer-row .mc-tool-btn { background: transparent; border: none; color: var(--cc-muted); }
.mc-task-composer-row .mc-tool-btn:hover { color: var(--cc-accent); }
.mc-task-attach-chip { color: var(--cc-text-2); }
.mc-task-tr-toggle { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text-2); }

/* MC conversation page: hidden guards (elements default to flex/grid) + markdown-lite */
.mc-task-attach-chip[hidden], .mc-task-note[hidden], .mc-task-composer[hidden],
.mc-task-status[hidden], .mc-task-branch[hidden], .mc-task-composer-status[hidden] { display: none !important; }
.cc-h { display: inline; font-weight: 700; color: var(--cc-text); }
.cc-hr { display: block; height: 1px; background: var(--cc-border); margin: 8px 0; }

/* ---- Mission Control: Preview + Apply controls ---- */
/* Board card mini buttons */
[data-mission-control] .mc-item-mini { background: var(--cc-panel); border: 1px solid var(--cc-border); color: var(--cc-text-2); font-size: 11px; padding: 4px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap; line-height: 1.3; }
[data-mission-control] .mc-item-mini:hover { color: var(--cc-accent); border-color: var(--cc-accent); }
[data-mission-control] .mc-item-mini:disabled { opacity: 0.5; cursor: default; }
[data-mission-control] .mc-item-restart:hover { color: var(--cc-green); border-color: var(--cc-green); }
[data-mission-control] .mc-item-danger:hover { color: var(--cc-red); border-color: var(--cc-red); }
[data-mission-control] .mc-item-result { margin-top: 6px; font-size: 10.5px; color: var(--cc-muted); word-break: break-word; }
[data-mission-control] .mc-item-result.is-ok { color: var(--cc-green); }
[data-mission-control] .mc-item-result.is-err { color: var(--cc-red); }
[data-mission-control] .mc-item-result.is-info { color: var(--cc-text-2); }

/* Conversation-page action bar */
.mc-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 22px; background: var(--cc-bg); border-bottom: 1px solid var(--cc-border); flex: 0 0 auto; }
.mc-actionbar-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mc-act-btn { font: inherit; font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 8px; cursor: pointer; border: 1px solid var(--cc-border); background: var(--cc-panel-2); color: var(--cc-text); }
.mc-act-preview:hover { border-color: var(--cc-accent); color: var(--cc-accent); }
.mc-act-apply { background: var(--cc-accent); border-color: var(--cc-accent); color: #201d1a; }
.mc-act-apply:hover { filter: brightness(1.08); }
.mc-act-apply:disabled { opacity: 0.6; cursor: default; filter: none; }
.mc-preview-live { display: inline-flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--cc-text-2); }
.mc-preview-live[hidden] { display: none; }
.mc-preview-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cc-green); animation: mc-pulse 1.2s ease-in-out infinite; }
.mc-preview-open { color: var(--cc-accent); font-weight: 600; text-decoration: none; }
.mc-preview-open:hover { text-decoration: underline; }
.mc-preview-stop { background: none; border: 1px solid var(--cc-border); color: var(--cc-muted); font-size: 11px; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.mc-preview-stop:hover { color: var(--cc-red); border-color: var(--cc-red); }
.mc-apply-status { font-size: 11.5px; color: var(--cc-muted); max-width: 460px; }
.mc-apply-status.is-ok { color: var(--cc-green); }
.mc-apply-status.is-err { color: var(--cc-red); }
.mc-apply-status.is-info { color: var(--cc-text-2); }
.mc-act-btn[hidden], .mc-actionbar[hidden] { display: none; }

/* Preview destination hints */
[data-mission-control] .mc-item-dest { font-size: 10px; color: var(--cc-muted); white-space: nowrap; }
.mc-preview-dest { font-size: 11.5px; color: var(--cc-text-2); }

/* Live conversation page: elapsed timer + jump-to-latest */
.mc-task-status-running .mc-elapsed, .mc-elapsed { font-variant-numeric: tabular-nums; opacity: 0.85; margin-left: 2px; }
.mc-jump-latest { position: absolute; left: 50%; transform: translateX(-50%); bottom: 108px; z-index: 8; background: var(--cc-accent); color: #201d1a; border: none; border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.mc-jump-latest:hover { filter: brightness(1.08); }
.mc-jump-latest[hidden] { display: none; }
.mc-msg-live .mc-task-feed { max-height: none; }

/* Conversation user-bubble image attachments */
.mc-msg-imgs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 6px; max-width: 78%; }
.mc-msg-img-link { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--cc-border); background: var(--cc-bg-deep); }
.mc-msg-img-link:hover { border-color: var(--cc-accent); }
.mc-msg-img { display: block; max-width: 240px; max-height: 200px; width: auto; height: auto; object-fit: contain; }
.mc-msg-img-missing { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--cc-muted); background: var(--cc-bg-deep); border: 1px dashed var(--cc-border); border-radius: 8px; padding: 8px 12px; }

/* =====================================================================
   Mission Control — full-viewport dark takeover (route-scoped to <body>)
   The Claude-Code dark theme was scoped to the [data-mission-control] /
   [data-mc-task] CONTENT wrappers, which sit INSIDE the layout shell — so the
   sidebar, global bar and page-toolbar band stayed light and the dark content
   read as a dark iframe. base.html adds `mc-dark` to <body> on
   /admin/mission-control* routes (and /admin/prompt-builder, MC's sibling tool
   — see the Prompt Builder dark block at the bottom); these rules extend the
   takeover to the whole shell so the ENTIRE viewport is dark. No other route
   gets .mc-dark.
   ===================================================================== */
body.mc-dark { background: var(--cc-bg); }
body.mc-dark .admin-shell { background: var(--cc-bg); }

/* Global top bar (already dark — retinted to the warm cc palette for cohesion) */
body.mc-dark .global-bar { background: var(--cc-bg-deep); border-bottom-color: var(--cc-border); }
body.mc-dark .global-search input { background: var(--cc-panel); border-color: var(--cc-border); color: var(--cc-text); }
body.mc-dark .global-search input::placeholder { color: var(--cc-muted); }
body.mc-dark .global-search-icon, body.mc-dark .keyboard-hint { color: var(--cc-muted); }
body.mc-dark .keyboard-hint { background: var(--cc-panel-2); }
body.mc-dark .icon-button { color: var(--cc-text-2); }
body.mc-dark .icon-button:hover { background: var(--cc-panel-2); }

/* Sidebar */
body.mc-dark .sidebar { background: var(--cc-bg-deep); border-right-color: var(--cc-border); }
body.mc-dark .sidebar-label { color: var(--cc-muted); }
body.mc-dark .sidebar-nav a, body.mc-dark .sidebar-logout { color: var(--cc-text-2); }
body.mc-dark .sidebar-nav a:hover, body.mc-dark .sidebar-logout:hover { background: var(--cc-panel-2); color: var(--cc-text); }
body.mc-dark .sidebar-nav a.active { background: var(--cc-panel); color: var(--cc-text); box-shadow: none; }
body.mc-dark .nav-icon { color: var(--cc-muted); }
body.mc-dark .sidebar-nav a.active .nav-icon,
body.mc-dark .sidebar-nav a:hover .nav-icon,
body.mc-dark .sidebar-logout:hover .nav-icon { color: var(--cc-text); }
body.mc-dark .nav-count { background: var(--cc-panel-2); color: var(--cc-text-2); }
body.mc-dark .sidebar-nav a.active .nav-count { background: var(--cc-accent-dim); color: var(--cc-accent); }

/* Main region + the page-toolbar title band (Operations / title / All locations / Sync Center) */
body.mc-dark .dashboard-main { background: var(--cc-bg); }
body.mc-dark .eyebrow { color: var(--cc-muted); }
body.mc-dark .page-heading h1 { color: var(--cc-text); }
body.mc-dark .page-chip { background: var(--cc-panel); border-color: var(--cc-border); color: var(--cc-text-2); }
body.mc-dark .page-toolbar .btn-secondary { background: var(--cc-panel); border-color: var(--cc-border); color: var(--cc-text); }
body.mc-dark .page-toolbar .btn-secondary:hover { background: var(--cc-panel-2); border-color: var(--cc-muted); }
body.mc-dark .dashboard-main > .alert { background: var(--cc-panel); border-color: var(--cc-border); color: var(--cc-text-2); }
/* Account avatar: retint the cool teal to the warm accent so nothing cool-bright
   breaks the Claude-Code tone (the OF brand mark keeps its logo gradient). */
body.mc-dark .account-badge { background: var(--cc-accent-dim); color: var(--cc-accent); }
body.mc-dark .account-chip { color: var(--cc-text-2); }

/* ---- Mission Control composer artwork (decorative, pointer-inert) ---- */
/* Fills the dead region right of the 760px composer with a quiet terminal →
   branching-pipeline illustration. Absolutely positioned inside .mc-intro so it
   can never stretch the panel; width collapses with the card and the whole
   thing hides below 1360px where it would crowd the composer. Animations are
   deliberately near-imperceptible: a ~3px/s dash drift on the main pipeline, a
   lazy 5.5s cursor blink, a 7s node breath. */
[data-mission-control] .mc-intro { position: relative; overflow: hidden; }
[data-mission-control] .mc-intro-art { position: absolute; top: 50%; right: 22px; transform: translateY(-50%); width: clamp(220px, calc(100% - 824px), 430px); height: auto; pointer-events: none; user-select: none; }
[data-mission-control] .mc-intro-art .mca-flow { stroke-dasharray: 3 9; animation: mca-flow-drift 90s linear infinite; }
@keyframes mca-flow-drift { to { stroke-dashoffset: -240; } }
[data-mission-control] .mc-intro-art .mca-cursor { animation: mca-cursor-blink 5.5s ease-in-out infinite; }
@keyframes mca-cursor-blink { 0%, 100% { fill-opacity: 0.85; } 50% { fill-opacity: 0.3; } }
[data-mission-control] .mc-intro-art .mca-node { animation: mca-node-pulse 7s ease-in-out infinite; }
@keyframes mca-node-pulse { 0%, 100% { fill-opacity: 1; } 50% { fill-opacity: 0.65; } }
@media (max-width: 1360px) { [data-mission-control] .mc-intro-art { display: none; } }
@media (prefers-reduced-motion: reduce) {
  [data-mission-control] .mc-intro-art .mca-flow,
  [data-mission-control] .mc-intro-art .mca-cursor,
  [data-mission-control] .mc-intro-art .mca-node { animation: none; }
}

/* ---------- Composer: multi-image attach list + triage split review ---------- */
.mc-attach-list { display: flex; flex-wrap: wrap; gap: 6px; max-width: 760px; margin-bottom: -8px; }
.mc-attach-list[hidden] { display: none; }
.mc-attach-list .mc-attach-chip { margin-bottom: 0; border: 1px solid var(--border, #d1d5db); border-radius: 8px; }
.mc-attach-list .mc-attach-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-attach-note { flex: 1 0 100%; font-size: 11px; color: var(--muted, #6b7280); }

/* Split-review panel — shown only when the planner proposes 2+ tasks. */
.mc-split { max-width: 760px; margin-top: 12px; border: 1px solid var(--border, #d1d5db); border-radius: 12px; padding: 12px; background: var(--surface-muted, #f8fafc); display: block; }
.mc-split[hidden] { display: none; }
.mc-split-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mc-split-heading strong { font-size: 13px; }
.mc-split-note { display: block; font-size: 11.5px; color: var(--muted, #6b7280); margin-top: 2px; }
.mc-split-cancel { border: 1px solid var(--border, #d1d5db); background: var(--surface, #fff); color: var(--muted, #6b7280); border-radius: 7px; font-size: 12px; padding: 4px 10px; cursor: pointer; flex: 0 0 auto; }
.mc-split-cancel:hover { color: var(--danger, #b91c1c); border-color: var(--danger, #b91c1c); }
.mc-split-list { display: flex; flex-direction: column; gap: 8px; }
.mc-split-card { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 10px; background: var(--surface, #fff); display: grid; gap: 7px; }
.mc-split-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-split-rank { font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted, #6b7280); font-weight: 600; }
.mc-split-card-actions { display: flex; align-items: center; gap: 4px; }
.mc-split-act { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border, #d1d5db); border-radius: 6px; background: var(--surface, #fff); color: var(--muted, #6b7280); font-size: 13px; line-height: 1; cursor: pointer; }
.mc-split-act:hover:not(:disabled) { color: var(--primary, #0d9488); border-color: var(--primary, #0d9488); }
.mc-split-act[data-mc-split-act="del"]:hover:not(:disabled) { color: var(--danger, #b91c1c); border-color: var(--danger, #b91c1c); }
.mc-split-act:disabled { opacity: 0.35; cursor: default; }
.mc-split-title { font: inherit; font-weight: 600; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border, #d1d5db); border-radius: 7px; background: var(--surface, #fff); }
.mc-split-desc { font: inherit; font-size: 12.5px; padding: 7px 9px; border: 1px solid var(--border, #d1d5db); border-radius: 7px; background: var(--surface, #fff); resize: vertical; line-height: 1.5; }
.mc-split-title:focus, .mc-split-desc:focus { outline: none; border-color: var(--primary, #0d9488); }
.mc-split-reason { font-size: 11.5px; color: var(--muted, #6b7280); font-style: italic; }
.mc-split-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-split-img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border, #e5e7eb); }
.mc-split-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.mc-split-hint { font-size: 11px; color: var(--muted, #6b7280); }
.mc-split-foot-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mc-split-keep-one { border: 1px solid var(--border, #d1d5db); background: var(--surface, #fff); color: var(--muted, #6b7280); border-radius: 8px; font-size: 12px; padding: 7px 12px; cursor: pointer; }
.mc-split-keep-one:hover { color: var(--primary, #0d9488); border-color: var(--primary, #0d9488); }
.mc-split-keep-one:disabled { opacity: 0.55; cursor: default; }
.mc-split-approve { width: auto; margin-left: 0; padding: 7px 14px; font-size: 12.5px; font-weight: 600; gap: 6px; }

/* Dark cc-theme overrides (the composer lives inside [data-mission-control]). */
[data-mission-control] .mc-attach-list .mc-attach-chip { background: var(--cc-bg-deep); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-split { background: var(--cc-panel-2); border-color: var(--cc-border); }
[data-mission-control] .mc-split-heading strong { color: var(--cc-text); }
[data-mission-control] .mc-split-note, [data-mission-control] .mc-split-hint, [data-mission-control] .mc-split-rank, [data-mission-control] .mc-split-reason { color: var(--cc-muted); }
[data-mission-control] .mc-split-cancel { background: var(--cc-panel); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-split-cancel:hover { color: var(--cc-red); border-color: var(--cc-red); }
[data-mission-control] .mc-split-card { background: var(--cc-panel); border-color: var(--cc-border); }
[data-mission-control] .mc-split-act { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-split-act:hover:not(:disabled) { color: var(--cc-accent); border-color: var(--cc-accent); }
[data-mission-control] .mc-split-act[data-mc-split-act="del"]:hover:not(:disabled) { color: var(--cc-red); border-color: var(--cc-red); }
[data-mission-control] .mc-split-title, [data-mission-control] .mc-split-desc { background: var(--cc-bg-deep); border-color: var(--cc-border); color: var(--cc-text); }
[data-mission-control] .mc-split-title:focus, [data-mission-control] .mc-split-desc:focus { border-color: var(--cc-accent); }
[data-mission-control] .mc-split-approve { background: var(--cc-accent); color: #1f1e1c; }
[data-mission-control] .mc-attach-note { color: var(--cc-muted); }
[data-mission-control] .mc-split-keep-one { background: var(--cc-panel); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-split-keep-one:hover { color: var(--cc-accent); border-color: var(--cc-accent); }

/* ---------------------------------------------------------------------------
   Competitor Watch (/admin/competitors) — comp-*
--------------------------------------------------------------------------- */
[data-competitors] [hidden] { display: none !important; }
.comp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.comp-head-title h1 { margin: 2px 0 6px; font-size: 24px; color: var(--text-strong); }
.comp-sub { margin: 0; color: var(--muted); max-width: 640px; font-size: 13.5px; line-height: 1.5; }
.comp-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comp-scan-status { font-size: 12.5px; color: var(--muted); }

.comp-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.comp-add-form input[type="url"],
.comp-add-form input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
}
.comp-add-form [data-comp-add-url] { flex: 1 1 320px; }
.comp-add-form [data-comp-add-name] { flex: 0 1 220px; }
.comp-add-status { font-size: 12.5px; color: var(--muted); }

.comp-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.comp-store-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.comp-store-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.comp-store-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.comp-store-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.comp-store-card.is-paused { opacity: 0.6; }
/* Buttons/links inside the clickable card keep their own default cursor. */
.comp-store-card .comp-store-actions button,
.comp-store-card .comp-store-domain { cursor: pointer; }
.comp-store-main { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.comp-store-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.comp-store-title {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-strong);
  cursor: pointer;
  text-align: left;
}
.comp-store-title:hover { color: var(--primary); text-decoration: underline; }
.comp-store-domain {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comp-store-domain:hover { color: var(--primary); }
.comp-store-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.comp-store-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--neutral-pill-bg);
  color: var(--muted);
  white-space: nowrap;
}
.comp-store-badge.is-ok { background: #e3f1ec; color: var(--primary-dark); }
.comp-store-badge.is-error { background: #fbeae7; color: var(--danger); }
.comp-store-badge.is-paused { background: var(--warning-bg); color: var(--warning-text); }
.comp-store-error {
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fbeae7;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}
.comp-store-stats { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.comp-store-stats strong { color: var(--text-strong); font-size: 14px; }
.comp-store-new strong { color: var(--primary); }
.comp-store-actions { display: flex; gap: 8px; }
.comp-btn-danger { color: var(--danger); }

.comp-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.comp-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}
.comp-tab {
  border: none;
  background: none;
  padding: 6px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.comp-tab.is-active { background: var(--primary); color: #fff; }
.comp-tab span {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  margin-left: 4px;
}
.comp-tab.is-active span { background: rgba(255, 255, 255, 0.22); }
.comp-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.comp-filters select,
.comp-filters input[type="search"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
}
.comp-filters input[type="search"] { min-width: 240px; }

.comp-timeline { display: flex; flex-direction: column; gap: 10px; }
.comp-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comp-day:first-child { margin-top: 0; }
.comp-day-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.comp-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.comp-product {
  display: flex;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 10px;
  background: var(--surface);
}
.comp-thumb {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.comp-thumb-empty { font-size: 10.5px; color: var(--muted-soft); }
.comp-product-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.comp-product-toprow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.comp-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.comp-badge-new { background: var(--primary); color: #fff; }
.comp-badge-store { background: var(--neutral-pill-bg); color: var(--muted); font-weight: 500; }
.comp-badge-oos { background: #fbeae7; color: var(--danger); }
.comp-product-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.comp-product-title:hover { color: var(--primary); text-decoration: underline; }
.comp-product-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comp-product-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: auto; }
.comp-price { font-weight: 600; font-size: 13.5px; color: var(--text-strong); }
.comp-spotted { font-size: 11.5px; color: var(--muted-soft); }

.comp-pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.comp-pager-meta { font-size: 12.5px; color: var(--muted); }

/* ---- Competitor store analytics (graphs shown when clicked into a store) ---- */
.comp-analytics-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.comp-analytics-title { margin: 2px 0 0; font-size: 20px; color: var(--text-strong); }
.comp-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.comp-kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.comp-kpi-value { font-size: 22px; font-weight: 700; color: var(--text-strong); line-height: 1.1; }
.comp-kpi-label { font-size: 12px; color: var(--muted); }

.comp-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.comp-chart-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
  min-width: 0;
}
.comp-chart-wide { grid-column: 1 / -1; }
.comp-chart-title { margin: 0; font-size: 14px; color: var(--text-strong); }
.comp-chart-sub { margin: 2px 0 14px; font-size: 12px; color: var(--muted); }
.comp-chart-empty { font-size: 13px; color: var(--muted-soft); padding: 20px 0; text-align: center; }

/* Vertical bars (month timeline + price distribution) */
.comp-vbars { display: flex; align-items: flex-end; gap: 8px; }
.comp-vbar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.comp-vbar-track { width: 100%; display: flex; align-items: flex-end; position: relative; }
.comp-vbar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  transition: height 0.2s ease;
}
.comp-vbar-value {
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
}
.comp-vbar-label {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Horizontal bars (top product types) */
.comp-hbars { display: flex; flex-direction: column; gap: 8px; }
.comp-hbar { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 10px; }
.comp-hbar-label {
  font-size: 12.5px;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comp-hbar-track { height: 14px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; }
.comp-hbar-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.2s ease; }
.comp-hbar-value { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Donut (stock availability) */
.comp-donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.comp-donut-svg { width: 140px; height: 140px; flex-shrink: 0; }
.comp-donut-center-num { font-size: 26px; font-weight: 700; fill: var(--text-strong); }
.comp-donut-center-label { font-size: 11px; fill: var(--muted); }
.comp-donut-legend { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.comp-donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.comp-donut-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.comp-donut-legend-label { color: var(--text-strong); }
.comp-donut-legend-value { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .comp-charts { grid-template-columns: 1fr; }
  .comp-hbar { grid-template-columns: 100px 1fr auto; }
}

/* ---------- Mission Control: build-agent account switcher ---------- */
.mc-accounts { display: grid; gap: 10px; }
.mc-acc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mc-acc-heading strong { font-size: 13px; }
.mc-acc-active { display: block; font-size: 11.5px; color: var(--muted, #6b7280); margin-top: 2px; }
.mc-acc-verify { border: 1px solid var(--border, #d1d5db); background: var(--surface, #fff); color: var(--muted, #6b7280); border-radius: 7px; font-size: 12px; padding: 4px 11px; cursor: pointer; flex: 0 0 auto; }
.mc-acc-verify:hover { color: var(--primary, #0d9488); border-color: var(--primary, #0d9488); }
.mc-acc-list { display: grid; gap: 6px; }
.mc-acc-empty { font-size: 12px; color: var(--muted, #6b7280); }
.mc-acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 9px; padding: 8px 11px; background: var(--surface, #fff); }
.mc-acc-row.is-active { border-color: var(--primary, #0d9488); }
.mc-acc-info { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.mc-acc-label { font-size: 12.5px; font-weight: 600; }
.mc-acc-fp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted, #6b7280); }
.mc-acc-badge { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; color: var(--success, #047857); background: rgba(4,120,87,0.10); padding: 1px 7px; border-radius: 999px; }
.mc-acc-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.mc-acc-switch { border: 1px solid var(--primary, #0d9488); background: var(--primary, #0d9488); color: #fff; border-radius: 7px; font-size: 12px; padding: 4px 12px; cursor: pointer; }
.mc-acc-switch:hover { filter: brightness(1.08); }
.mc-acc-del { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border, #d1d5db); border-radius: 6px; background: var(--surface, #fff); color: var(--muted, #9ca3af); font-size: 15px; line-height: 1; cursor: pointer; }
.mc-acc-del:hover { color: var(--danger, #b91c1c); border-color: var(--danger, #b91c1c); }
.mc-acc-status { font-size: 12px; color: var(--muted, #6b7280); }
.mc-acc-status[data-tone="ok"] { color: var(--success, #047857); }
.mc-acc-status[data-tone="err"] { color: var(--danger, #b91c1c); }
.mc-acc-status[hidden] { display: none; }
.mc-acc-hint { font-size: 11px; color: var(--muted, #6b7280); line-height: 1.5; margin: 0; }

/* dark cc-theme (the MC page lives inside [data-mission-control]) */
[data-mission-control] .mc-acc-heading strong { color: var(--cc-text); }
[data-mission-control] .mc-acc-active, [data-mission-control] .mc-acc-hint, [data-mission-control] .mc-acc-empty, [data-mission-control] .mc-acc-fp { color: var(--cc-muted); }
[data-mission-control] .mc-acc-hint code { color: var(--cc-accent); }
[data-mission-control] .mc-acc-verify { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-acc-verify:hover { color: var(--cc-accent); border-color: var(--cc-accent); }
[data-mission-control] .mc-acc-row { background: var(--cc-panel-2); border-color: var(--cc-border); }
[data-mission-control] .mc-acc-row.is-active { border-color: var(--cc-accent); }
[data-mission-control] .mc-acc-label { color: var(--cc-text); }
[data-mission-control] .mc-acc-badge { color: var(--cc-green); background: rgba(127,174,107,0.14); }
[data-mission-control] .mc-acc-switch { background: var(--cc-accent); border-color: var(--cc-accent); color: #1f1e1c; }
[data-mission-control] .mc-acc-del { background: var(--cc-panel); border-color: var(--cc-border); color: var(--cc-muted); }
[data-mission-control] .mc-acc-del:hover { color: var(--cc-red); border-color: var(--cc-red); }
[data-mission-control] .mc-acc-status[data-tone="ok"] { color: var(--cc-green); }
[data-mission-control] .mc-acc-status[data-tone="err"] { color: var(--cc-red); }
/* =====================================================================
   Shipping Tracker — proactive shipment alerts (/admin/shipment-tracker).
   Dark navy dashboard panel + white rounded cards + orange accent.
   ===================================================================== */
[data-shipment-tracker] {
  --umst-navy: #0d1b4b;
  --umst-navy-2: #14235c;
  --umst-orange: #f59e0b;
  --umst-orange-dark: #d97706;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.umst-topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.umst-topbar-title h1 { margin: 2px 0 6px; }
.umst-sub { color: var(--muted); max-width: 640px; font-size: 13.5px; line-height: 1.5; margin: 0; }
.umst-topbar-actions { display: flex; align-items: center; gap: 10px; }

/* Notification bell */
.umst-bell { position: relative; }
.umst-bell-btn { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 42px; height: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-strong); }
.umst-bell-btn svg { width: 20px; height: 20px; }
.umst-bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--umst-orange); color: #3b2500; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.umst-bell-dropdown { position: absolute; right: 0; top: 48px; width: 360px; max-width: 88vw; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 48px rgba(13,27,75,.18); z-index: 60; overflow: hidden; }
.umst-bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.umst-bell-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.umst-linkbtn { background: none; border: none; color: var(--umst-orange-dark); font-weight: 600; cursor: pointer; font-size: 12.5px; }

/* Dashboard navy panel */
.umst-dashboard { background: linear-gradient(160deg, var(--umst-navy), var(--umst-navy-2)); border-radius: var(--radius-lg); padding: 22px; color: #fff; }
.umst-dashboard-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.umst-dashboard-head h2 { color: #fff; margin: 0; font-size: 16px; }
.umst-total { color: rgba(255,255,255,.72); font-size: 13px; }
.umst-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.umst-card { display: flex; justify-content: space-between; align-items: center; background: #fff; border: none; border-radius: 14px; padding: 18px 20px; cursor: pointer; text-align: left; transition: transform .12s ease, box-shadow .12s ease; }
.umst-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(13,27,75,.25); }
.umst-card-body { display: flex; flex-direction: column; gap: 4px; }
.umst-card-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.umst-card-count { font-size: 30px; font-weight: 800; color: var(--text-strong); line-height: 1; }
.umst-card-pct { font-size: 13px; color: var(--muted-soft); font-weight: 600; }
.umst-card-chevron { width: 22px; height: 22px; color: var(--muted-soft); }
.umst-card-delivered { border-left: 5px solid #16a34a; }
.umst-card-non_delivered { border-left: 5px solid var(--umst-orange); }
.umst-card-exception { border-left: 5px solid var(--danger); }
.umst-card-failed_deliver { border-left: 5px solid #7c3aed; }

/* Reminder panel */
.umst-reminder-head, .umst-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.umst-reminder-head h2, .umst-list-head h2, .umst-alerts-section h2 { margin: 0; font-size: 16px; }
.umst-reminder-rows { display: flex; flex-direction: column; gap: 8px; }
.umst-reminder-row { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; text-align: left; transition: background .12s ease; }
.umst-reminder-row:hover { background: var(--surface-hover); }
.umst-reminder-row.is-muted { opacity: .55; }
.umst-reminder-icon { font-size: 17px; }
.umst-reminder-count { font-weight: 800; font-size: 16px; min-width: 34px; color: var(--umst-orange-dark); }
.umst-reminder-text { flex: 1; color: var(--text-strong); font-size: 13.5px; }

/* Alert cards */
.umst-alert-cards { display: flex; flex-direction: column; gap: 12px; }
.umst-alert-card { display: flex; gap: 14px; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.umst-alert-card.umst-sev-critical { border-left: 5px solid var(--danger); }
.umst-alert-card.umst-sev-warn { border-left: 5px solid var(--umst-orange); }
.umst-alert-card.umst-sev-info { border-left: 5px solid #16a34a; }
.umst-alert-icon { font-size: 22px; line-height: 1; }
.umst-alert-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.umst-alert-title { font-weight: 800; font-size: 15px; color: var(--text-strong); }
.umst-alert-route { font-size: 12.5px; color: var(--muted); }
.umst-alert-route a, .umst-alert-carrier { color: var(--umst-orange-dark); font-weight: 600; text-decoration: none; }
.umst-alert-msg { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.umst-alert-card.umst-sev-info .umst-alert-msg { color: #15803d; }

/* Progress bar */
.umst-progress { width: 100%; }
.umst-progress-track { position: relative; height: 6px; background: #e6e8ef; border-radius: 999px; }
.umst-progress-fill { height: 100%; background: var(--umst-navy); border-radius: 999px; }
.umst-progress-dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--umst-navy); transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.umst-progress-dot.is-alert { background: var(--danger); }
.umst-progress-lg .umst-progress-track { height: 8px; }

/* Shipment list table */
.umst-list-tools { display: flex; gap: 10px; align-items: center; }
.umst-search { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 240px; font-size: 13px; }
.umst-add-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; }
.umst-add-form input[type=text] { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.umst-csv-label { font-size: 12.5px; color: var(--umst-orange-dark); font-weight: 600; cursor: pointer; }
.umst-add-status { font-size: 12.5px; color: var(--muted); }
.umst-filter-chips { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.umst-chip-clear { background: none; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 12px; color: var(--muted); }
.umst-table-wrap { overflow-x: auto; }
.umst-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.umst-table th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.umst-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.umst-table tbody tr { cursor: pointer; }
.umst-table tbody tr:hover { background: var(--surface-hover); }
.umst-track-link { font-weight: 700; color: var(--text-strong); }
.umst-table .umst-progress-track { width: 90px; }

/* Status badges */
.umst-status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.umst-status-delivered { background: #dcfce7; color: #166534; }
.umst-status-in_transit, .umst-status-info_received, .umst-status-pending { background: #dbeafe; color: #1e40af; }
.umst-status-out_for_delivery { background: #e0e7ff; color: #3730a3; }
.umst-status-pick_up { background: #fef3c7; color: #92400e; }
.umst-status-exception { background: #fee2e2; color: #991b1b; }
.umst-status-failed_attempt { background: #ede9fe; color: #5b21b6; }
.umst-status-expired { background: #fee2e2; color: #b91c1c; }

.umst-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.umst-empty { color: var(--muted-soft); font-size: 13px; padding: 12px; text-align: center; }
.umst-muted { color: var(--muted); font-size: 12.5px; }

/* Modal */
.umst-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.umst-modal-backdrop { position: absolute; inset: 0; background: rgba(13,27,75,.42); }
.umst-modal-panel { position: relative; background: var(--surface); border-radius: 16px; width: 520px; max-width: 92vw; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(13,27,75,.32); }
.umst-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.umst-modal-head h3 { margin: 0; }
.umst-modal-x { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.umst-modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.umst-modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.umst-rule { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.umst-rule-text { flex: 1; font-size: 13px; color: var(--text-strong); }
.umst-rule-days { width: 64px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; text-align: center; }
.umst-rule-toggle { position: relative; width: 42px; height: 24px; }
.umst-rule-toggle input { opacity: 0; width: 0; height: 0; }
.umst-rule-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: background .15s ease; }
.umst-rule-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s ease; }
.umst-rule-toggle input:checked + .umst-rule-slider { background: var(--umst-orange); }
.umst-rule-toggle input:checked + .umst-rule-slider::before { transform: translateX(18px); }

/* Detail page */
.umst-detail { display: flex; flex-direction: column; gap: 16px; }
.umst-back { display: inline-block; color: var(--umst-orange-dark); font-weight: 600; text-decoration: none; font-size: 13px; }
.umst-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.umst-detail-status { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.umst-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.umst-timeline-item { display: flex; gap: 14px; padding: 4px 0 16px; position: relative; }
.umst-timeline-item::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.umst-timeline-item:last-child::before { display: none; }
.umst-timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--umst-navy); margin-top: 3px; flex-shrink: 0; z-index: 1; }
.umst-timeline-status { font-weight: 700; font-size: 13.5px; color: var(--text-strong); }
.umst-timeline-msg { font-size: 13px; color: var(--muted); }
.umst-timeline-time { font-size: 11.5px; }
.umst-raw-summary { cursor: pointer; font-weight: 600; color: var(--text-strong); }
.umst-raw { background: var(--surface-dark); color: #e6e6e6; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 12px; margin-top: 10px; }

@media (max-width: 720px) {
  .umst-cards { grid-template-columns: 1fr; }
  .umst-bell-dropdown { position: fixed; right: 10px; left: 10px; width: auto; }
}

/* [hidden] guard — a bare hidden attr is ignored on elements given display:flex/grid/inline-flex (modal, add-form, chips, pager, bell badge/dropdown). Seal it. */
[data-shipment-tracker] [hidden] { display: none !important; }
.umst-modal[hidden] { display: none !important; }

/* Shipping Tracker — real-data ingestion (import from orders) */
.umst-import-status { font-size: 12px; color: var(--muted); max-width: 280px; text-align: right; align-self: center; }
.umst-demo-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; background: var(--umst-orange); color: #3b2500; vertical-align: middle; }
.umst-row-customer { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ── AI engine health card (Settings page) ─────────────────────────────── */
.ai-engine-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ai-engine-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.ai-engine-status {
  font-size: 12.5px;
  color: var(--muted);
}
.ai-engine-status.is-ok { color: #16a34a; }
.ai-engine-status.is-bad { color: var(--danger); }

/* ── Bundle Suggestor (/admin/bundles) ─────────────────────────────────── */
[data-bundles] [hidden] { display: none !important; }
.bnd-intro { margin-bottom: 16px; }
.bnd-intro-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bnd-intro-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.bnd-intro-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bnd-discount-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.bnd-discount-input { display: inline-flex; align-items: center; gap: 2px; color: var(--text); }
.bnd-discount-input input {
  width: 58px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 13px;
}
.bnd-progress {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}
.bnd-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.bnd-kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bnd-kpi-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bnd-kpi-value { font-size: 22px; font-weight: 700; color: var(--text-strong); }
.bnd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bnd-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.bnd-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.bnd-tab span { opacity: 0.75; margin-left: 4px; }
.bnd-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.bnd-search {
  min-width: 240px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.bnd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.bnd-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  padding: 28px 0;
  text-align: center;
}
.bnd-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bnd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bnd-thumbs { display: flex; align-items: center; gap: 4px; }
.bnd-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.bnd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bnd-thumb-empty { color: var(--muted); }
.bnd-thumb-plus { color: var(--muted); font-weight: 700; }
.bnd-score {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--surface-subtle);
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}
.bnd-card-body { display: flex; flex-direction: column; gap: 7px; }
.bnd-name { margin: 0; font-size: 14.5px; color: var(--text-strong); }
.bnd-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bnd-chip {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.bnd-badge {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bnd-badge.is-strong { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.bnd-badge.is-ok { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.bnd-badge.is-weak { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.bnd-badge.is-na { background: var(--surface-subtle); color: var(--muted); text-transform: none; font-weight: 600; }
.bnd-titles { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text); }
.bnd-titles a { color: inherit; }
.bnd-titles a:hover { color: var(--primary); }
.bnd-bought { font-size: 12px; color: var(--muted); }
.bnd-pricing { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bnd-price-sum { color: var(--muted); text-decoration: line-through; }
.bnd-price-arrow { color: var(--muted); }
.bnd-price-bundle { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.bnd-price-margin { font-size: 12px; color: #16a34a; font-weight: 600; }
.bnd-rationale {
  margin: 0;
  font-size: 12.5px;
  color: var(--text);
  border-left: 3px solid var(--border);
  padding-left: 9px;
}
.bnd-breakdown {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 9px 11px;
  font-size: 12px;
}
.bnd-bd-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; color: var(--text); }
.bnd-bd-row.is-missing { color: var(--muted); font-style: italic; }
.bnd-bd-signals {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  word-break: break-word;
}
.bnd-card-actions { display: flex; gap: 8px; margin-top: auto; }
.bnd-dismiss { color: var(--danger); }

/* Competitor Watch — timeline date-range selector + car-model breakdown */
.comp-daterange {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.comp-daterange-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.comp-date-fields { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comp-date-fields label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-strong);
}
.comp-date-fields input[type="date"] {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  background: var(--bg-surface, #fff);
  color: var(--text-strong);
}
.comp-date-presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.comp-date-preset {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface, #fff);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.comp-date-preset:hover { border-color: var(--primary); color: var(--primary); }
.comp-date-clear { color: var(--text-strong); }
.comp-range-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
}
@media (max-width: 720px) {
  .comp-date-presets { margin-left: 0; }
}

/* Mission Control — "Waiting on you" task state (agent paused to ask a question).
   Reuses the existing mc-item card; adds a warm attention dot + inline badges. */
[data-mission-control] .cc-dot-waiting { background: var(--cc-accent); }
[data-mission-control] .mc-item-waiting { border-color: color-mix(in srgb, var(--cc-accent) 45%, var(--cc-border)); background: color-mix(in srgb, var(--cc-accent) 6%, var(--cc-panel-2)); }
[data-mission-control] .mc-item-badge { flex: 0 0 auto; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
[data-mission-control] .mc-item-badge-waiting { background: rgba(217,119,87,0.16); color: var(--cc-accent); }
[data-mission-control] .mc-item-badge-stale { background: rgba(205,111,99,0.16); color: var(--cc-red); }
/* Task-detail page: waiting status pill matches the board accent. */
.mc-task-status-waiting { background: rgba(217,119,87,0.14); color: var(--cc-accent); }

/* Mission Control — descriptive board titles (mc-title header): the card
   heading is the human title; the timestamp id (= branch/worktree name) rides
   on this small secondary line so ops can still correlate to the branch. */
[data-mission-control] .mc-item-id { color: var(--cc-muted); font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0 0 16px; }

/* ── Prompt Builder (MC task-prompt assistant) ─────────────────────────── */
.pb-card { display: flex; flex-direction: column; gap: 14px; }
.pb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pb-newchat { flex: 0 0 auto; white-space: nowrap; }
.pb-log { display: flex; flex-direction: column; gap: 12px; max-height: 58vh; overflow-y: auto; padding: 4px 2px; }
.pb-log:empty { display: none; }
.pb-msg { max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.pb-msg-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.pb-msg-assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.pb-msg-assistant p { margin: 0 0 8px; }
.pb-msg-assistant p:last-child { margin-bottom: 0; }
.pb-msg-assistant ul { margin: 4px 0 8px; padding-left: 20px; }
.pb-msg-assistant code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.pb-codewrap { margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pb-codewrap.pb-task { border-color: var(--primary); }
.pb-code { margin: 0; padding: 12px; background: var(--surface-dark, #1e2329); color: #e6e6e6; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; overflow-x: auto; font-family: var(--font-mono, ui-monospace, monospace); }
.pb-code-actions { display: flex; justify-content: flex-end; padding: 8px 10px; background: var(--surface); border-top: 1px solid var(--border); }
.pb-thinking { color: var(--muted); font-style: italic; }
.pb-error { color: var(--danger); }
.pb-empty { color: var(--muted); font-size: 13px; margin: 0; }
.pb-composer { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.pb-input { width: 100%; resize: vertical; min-height: 62px; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.pb-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pb-hint { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .pb-msg { max-width: 96%; } .pb-head { flex-direction: column; } }

/* Prompt Builder — model picker in the composer actions row */
.pb-composer-actions .pb-hint { margin-right: auto; }
.pb-model { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.pb-model-label { font-weight: 500; white-space: nowrap; }
.pb-model-select { flex: 0 0 auto; min-width: 168px; font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface, #fff); color: inherit; cursor: pointer; }
.pb-model-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.pb-model-select:disabled { opacity: 0.6; cursor: not-allowed; }

/* Prompt Builder — reference-image attachment chips (composer). Mirrors the MC
   composer attach chips, themed for the dark --cc-* shell. */
.pb-attach-btn { flex: 0 0 auto; }
.pb-attach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-attach-list[hidden] { display: none; }
.pb-attach-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--cc-border, var(--border)); border-radius: 8px; padding: 5px 8px; background: var(--cc-bg-deep, var(--surface-muted, #f8fafc)); font-size: 12px; color: var(--cc-text-2, var(--muted)); }
.pb-attach-img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--cc-border, var(--border)); }
.pb-attach-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-attach-remove { margin-left: 2px; border: none; background: none; font-size: 15px; line-height: 1; color: var(--cc-text-2, var(--muted)); cursor: pointer; padding: 2px 6px; }
.pb-attach-remove:hover { color: var(--danger, #b91c1c); }

/* Mission Control — live triage-thinking panel (composer). Dark + terracotta,
   matched to the MC --cc-* theme: an "AI core" mark (counter-rotating orbit
   nodes + radar ping + glowing heart), pipeline step-chips with shimmer labels,
   and a scanning sheen along the top edge. */
.mc-think { position: relative; overflow: hidden; max-width: 760px; display: flex; flex-direction: column; margin-top: 10px; padding: 11px 14px; border: 1px solid var(--cc-border, #3a3833); border-radius: 10px; background: linear-gradient(180deg, var(--cc-panel, #2f2e2b), var(--cc-bg-deep, #1f1e1c)); color: var(--cc-text-2, #b8b3a9); font-size: 12.5px; }
.mc-think-scan { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--cc-accent, #d97757), transparent); background-size: 45% 100%; background-repeat: no-repeat; animation: mcThinkScan 2s ease-in-out infinite; opacity: .85; }
@keyframes mcThinkScan { 0% { background-position: -45% 0; } 100% { background-position: 145% 0; } }
.mc-think:has(.mc-think-done:not([hidden])) .mc-think-scan { display: none; }
.mc-think-run { display: flex; align-items: center; gap: 14px; width: 100%; }
/* the AI core mark */
.mc-think-core { flex: 0 0 auto; color: var(--cc-accent, #d97757); }
.mc-core-orbit { fill: none; stroke: currentColor; stroke-opacity: .28; stroke-width: 1; stroke-dasharray: 2.5 3.5; }
.mc-core-ring { transform-origin: 22px 22px; }
.mc-core-ring-a { animation: mcCoreSpin 2.6s linear infinite; }
.mc-core-ring-b { animation: mcCoreSpin 4.2s linear infinite reverse; }
@keyframes mcCoreSpin { to { transform: rotate(360deg); } }
.mc-core-node { fill: currentColor; }
.mc-core-node-mid { fill-opacity: .7; }
.mc-core-node-dim { fill-opacity: .35; }
.mc-core-ping { fill: none; stroke: currentColor; stroke-width: 1.2; transform-origin: 22px 22px; animation: mcCorePing 1.8s cubic-bezier(.2,.6,.4,1) infinite; }
@keyframes mcCorePing { 0% { transform: scale(.55); opacity: .9; } 80%, 100% { transform: scale(2); opacity: 0; } }
.mc-core-heart { fill: currentColor; transform-origin: 22px 22px; filter: drop-shadow(0 0 4px rgba(217,119,87,.75)); animation: mcCoreHeart 1.8s ease-in-out infinite; }
@keyframes mcCoreHeart { 0%,100% { transform: scale(1); } 50% { transform: scale(1.16); } }
/* pipeline steps */
.mc-think-steps { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.mc-think-step { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mc-think-chip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--cc-border, #3a3833); background: var(--cc-bg-deep, #1f1e1c); color: var(--cc-muted, #8a857b); transition: background .3s ease, border-color .3s ease, color .3s ease; flex: 0 0 auto; }
.mc-think-label { color: var(--cc-muted, #8a857b); transition: color .3s ease; white-space: nowrap; }
.mc-think-link { width: 14px; height: 1px; background: var(--cc-border, #3a3833); flex: 0 0 auto; }
.mc-think-step.is-active .mc-think-chip { border-color: var(--cc-accent, #d97757); color: var(--cc-accent, #d97757); animation: mcChipGlow 1.5s ease-in-out infinite; }
@keyframes mcChipGlow { 0%,100% { box-shadow: 0 0 0 3px rgba(217,119,87,.10), 0 0 8px rgba(217,119,87,.18); } 50% { box-shadow: 0 0 0 3px rgba(217,119,87,.22), 0 0 15px rgba(217,119,87,.42); } }
.mc-think-step.is-active .mc-think-label { background: linear-gradient(90deg, var(--cc-text-2, #b8b3a9) 25%, #fff 45%, var(--cc-accent, #d97757) 55%, var(--cc-text-2, #b8b3a9) 75%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: mcLabelShimmer 1.7s linear infinite; }
@keyframes mcLabelShimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }
.mc-think-step.is-done .mc-think-chip { background: var(--cc-accent, #d97757); border-color: var(--cc-accent, #d97757); color: #1f1e1c; }
.mc-think-step.is-done .mc-think-label { color: var(--cc-text-2, #b8b3a9); }
/* live timer */
.mc-think-elapsed { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--cc-muted, #8a857b); flex: 0 0 auto; }
.mc-think-elapsed::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cc-accent, #d97757); animation: mcCoreHeart 1.2s ease-in-out infinite; }
/* result line */
.mc-think-done { display: flex; align-items: center; gap: 9px; color: var(--cc-text, #ece9e3); }
.mc-think-doneicon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--cc-accent, #d97757); color: #1f1e1c; font-size: 11px; font-weight: 700; flex: 0 0 auto; box-shadow: 0 0 12px rgba(217,119,87,.45); animation: mcThinkPop .35s cubic-bezier(.2,1.4,.4,1); }
.mc-think-doneicon.is-err { background: #b3564d; color: #fff; box-shadow: none; }
@keyframes mcThinkPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* =====================================================================
   Prompt Builder — Mission Control dark + terracotta theme
   /admin/prompt-builder gets body.mc-dark from base.html (the same switch
   as /admin/mission-control*), which darkens the whole shell and supplies
   the --cc-* tokens by inheritance — no token values are duplicated here.
   These rules retint ONLY the pb-* components with those tokens, scoped
   under [data-prompt-builder] so nothing leaks into other admin pages.
   ===================================================================== */
[data-prompt-builder].pb-card { background: var(--cc-panel); border: 1px solid var(--cc-border); border-radius: 12px; box-shadow: none; color: var(--cc-text); }
[data-prompt-builder] .pb-head h2 { color: var(--cc-text); }
[data-prompt-builder] .pb-head p { color: var(--cc-text-2); }
[data-prompt-builder] .pb-empty { color: var(--cc-muted); }
[data-prompt-builder] .pb-empty em { color: var(--cc-text-2); }
/* "New chat" — mirrors MC's quiet tool buttons (mc-tool-btn / mc-col-clear) */
[data-prompt-builder] .pb-newchat { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-prompt-builder] .pb-newchat:hover { background: var(--cc-panel-2); color: var(--cc-accent); border-color: var(--cc-accent); }
/* Chat bubbles — user turn speaks MC's mc-turn-user language (accent-dim fill,
   accent border); assistant turn is a raised dark panel */
[data-prompt-builder] .pb-msg-user { background: var(--cc-accent-dim); border: 1px solid var(--cc-accent); color: var(--cc-text); }
[data-prompt-builder] .pb-msg-assistant { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text); }
[data-prompt-builder] .pb-msg-assistant code { background: var(--cc-accent-dim); color: var(--cc-accent); }
/* Draft/code blocks — deep well like MC's cc-feed; task drafts get the accent frame */
[data-prompt-builder] .pb-codewrap { border-color: var(--cc-border); }
[data-prompt-builder] .pb-codewrap.pb-task { border-color: var(--cc-accent); }
[data-prompt-builder] .pb-code { background: var(--cc-bg-deep); color: var(--cc-text); font-family: var(--cc-mono); }
[data-prompt-builder] .pb-code-actions { background: var(--cc-panel); border-top-color: var(--cc-border); }
[data-prompt-builder] .pb-thinking { color: var(--cc-muted); }
[data-prompt-builder] .pb-error { color: var(--cc-red); }
/* Composer — deep input well + accent focus, matching the MC composer */
[data-prompt-builder] .pb-composer { border-top-color: var(--cc-border); }
[data-prompt-builder] .pb-input { background: var(--cc-bg-deep); border-color: var(--cc-border); color: var(--cc-text); }
[data-prompt-builder] .pb-input::placeholder { color: var(--cc-muted); }
[data-prompt-builder] .pb-input:focus { outline: none; border-color: var(--cc-accent); }
[data-prompt-builder] .pb-hint { color: var(--cc-muted); }
[data-prompt-builder] .pb-model { color: var(--cc-muted); }
[data-prompt-builder] .pb-model-select { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text); }
[data-prompt-builder] .pb-model-select:focus { border-color: var(--cc-accent); box-shadow: 0 0 0 2px var(--cc-accent-dim); }
/* Primary actions (Send + the JS-rendered "Send to composer →") — MC's
   accent-on-dark send-button treatment (mc-send-btn) */
[data-prompt-builder] .btn-primary { background: var(--cc-accent); border-color: var(--cc-accent); color: #1f1e1c; }
[data-prompt-builder] .btn-primary:hover { background: var(--cc-accent); filter: brightness(1.08); }
[data-prompt-builder] .btn-primary:disabled { opacity: 0.55; }

/* Competitor Watch — "Add product" hand-off button on timeline cards */
.comp-foot-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.comp-foot-actions .comp-add-product { white-space: nowrap; }
.mc-think-run[hidden], .mc-think-done[hidden], .mc-think[hidden] { display: none; }

/* ---- Mission Control: applied-state badge on Done cards ---- */
[data-mission-control] .mc-item-badge-applied { background: rgba(127,174,107,0.16); color: var(--cc-green); }
[data-mission-control] .mc-item-badge-notapplied { background: rgba(138,133,123,0.14); color: var(--cc-muted); }
[data-mission-control] .mc-item-badge-applied-stale { background: rgba(217,119,87,0.16); color: var(--cc-accent); }
@media (prefers-reduced-motion: reduce) { .mc-think-scan, .mc-core-ring-a, .mc-core-ring-b, .mc-core-ping, .mc-core-heart, .mc-think-step.is-active .mc-think-chip, .mc-think-step.is-active .mc-think-label, .mc-think-elapsed::before { animation: none; } }

/* Admin Control (RBAC) — users / roles / audit / security */
.ac-head p { max-width: 860px; }
.ac-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 12px 0 14px; }
.ac-tab { appearance: none; background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.ac-tab.is-active { color: var(--text-strong, #111); border-bottom-color: var(--primary); font-weight: 600; }
.ac-status { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; border: 1px solid var(--border); }
.ac-status.is-ok { border-color: #16a34a55; background: #16a34a12; color: #15803d; }
.ac-status.is-err { border-color: #dc262655; background: #dc262612; color: #b91c1c; }
.ac-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ac-toolbar .ac-note { margin-right: auto; }
.ac-note { color: var(--muted); font-size: 12px; font-weight: 400; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.ac-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ac-cell-email { font-weight: 600; }
.ac-actions { white-space: nowrap; text-align: right; }
.ac-actions-col { text-align: right; }
.ac-act { appearance: none; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px; margin-left: 5px; font: inherit; font-size: 12px; color: inherit; cursor: pointer; }
.ac-act:hover { border-color: var(--primary); color: var(--primary); }
.ac-act-danger:hover { border-color: #dc2626; color: #dc2626; }
.ac-badge { display: inline-block; margin-left: 6px; padding: 1.5px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.ac-badge-super { background: #7c3aed18; color: #6d28d9; border: 1px solid #7c3aed44; }
.ac-badge-ok { background: #16a34a14; color: #15803d; }
.ac-badge-warn { background: #d9770614; color: #b45309; }
.ac-badge-off { background: #6b728014; color: #4b5563; }
.ac-form { margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted, #f8fafc); }
.ac-form h3 { margin: 0 0 10px; font-size: 14px; }
.ac-form h4 { margin: 14px 0 6px; font-size: 12.5px; }
.ac-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ac-form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.ac-form-grid input, .ac-form-grid select { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface, #fff); color: inherit; }
.ac-check { display: flex; flex-direction: row !important; align-items: center; gap: 7px !important; font-size: 12.5px !important; color: inherit !important; }
.ac-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ac-generated { margin-top: 10px; padding: 9px 12px; border: 1px dashed #b45309; border-radius: 8px; background: #d9770610; font-size: 13px; }
.ac-generated code { font-weight: 700; user-select: all; }
.ac-roles-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ac-role-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface, #fff); }
.ac-role-head { font-size: 13.5px; }
.ac-role-desc { margin: 6px 0 8px; color: var(--muted); font-size: 12.5px; min-height: 1em; }
.ac-role-actions { display: flex; justify-content: flex-end; }
.ac-perm-grid { border-collapse: collapse; font-size: 12.5px; min-width: 380px; }
.ac-perm-grid th { text-align: left; padding: 5px 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.ac-perm-grid td { padding: 4px 10px; border-top: 1px solid var(--border); }
.ac-perm-actions { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 4px; }
.ac-perm-actions .ac-check strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.ac-pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.ac-code { font-size: 11.5px; background: var(--surface-muted, #f1f5f9); padding: 1px 6px; border-radius: 5px; }
.ac-empty { text-align: center; color: var(--muted); padding: 18px 0 !important; }
.ac-security-form { max-width: 640px; }
.ac-panel[hidden], .ac-form[hidden], .ac-status[hidden], .ac-generated[hidden] { display: none; }

/* ---- Mission Control: "Triage & queue" planner button (composer bar) ---- */
.mc-send-one-btn { margin-left: auto; border: 1px solid var(--border, #d1d5db); background: var(--surface, #fff); color: var(--muted, #6b7280); border-radius: 8px; font-size: 12px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.mc-send-one-btn:hover { color: var(--primary, #0d9488); border-color: var(--primary, #0d9488); }
.mc-send-one-btn:disabled { opacity: 0.55; cursor: default; }
.mc-send-one-btn + .mc-send-btn { margin-left: 0; }
[data-mission-control] .mc-send-one-btn { background: var(--cc-panel-2); border-color: var(--cc-border); color: var(--cc-text-2); }
[data-mission-control] .mc-send-one-btn:hover { color: var(--cc-accent); border-color: var(--cc-accent); }

/* ---- Supplier searches: Today / Yesterday / date group headers ---- */
.ss-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ss-day:first-child { margin-top: 0; }
.ss-day-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.ss-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Product detail — variants table SKU/name search bar */
.variant-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 0.85rem;
  max-width: 360px;
}
.variant-search-icon {
  position: absolute;
  left: 0.7rem;
  display: inline-flex;
  color: var(--muted-soft);
  pointer-events: none;
}
.variant-search-input {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.75rem 0.5rem 2.2rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-subtle);
  font-size: 0.92rem;
}
.variant-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

/* Admin Control — API / MCP tokens tab */
.ac-mcp-connect { margin: 4px 0 14px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-muted, #f8fafc); font-size: 12.5px; }
.ac-mcp-connect strong { display: block; margin-bottom: 4px; }
.ac-mcp-endpoint { margin: 2px 0 6px; }
.ac-mcp-endpoint code { background: var(--surface, #fff); padding: 2px 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; user-select: all; }

/* ==========================================================================
   Social Media Calendar (/admin/social-calendar) — smc-*
   Planner over the Instagram library: month grid, day drawer, upload modal.
   Uses the app token set (teal --primary accent); motion is tasteful and
   disabled under prefers-reduced-motion.
   ========================================================================== */

[data-social-calendar] [hidden] { display: none !important; }

/* ── Page header (mirrors the Instagram page idiom) ── */
.smc-page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.smc-page-title { display: flex; align-items: center; gap: 12px; }
.smc-logo-chip { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: var(--shadow-sm); flex: 0 0 auto; }
.smc-logo-chip svg { width: 22px; height: 22px; }
.smc-logo-chip.small { width: 32px; height: 32px; border-radius: 9px; }
.smc-logo-chip.small svg { width: 16px; height: 16px; }
.smc-title-text { font-size: 19px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; }
.smc-title-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.smc-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ── */
.smc-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-strong); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease; text-decoration: none; }
.smc-btn svg { width: 15px; height: 15px; }
.smc-btn:hover { background: var(--surface-hover); }
.smc-btn:active { transform: scale(.97); }
.smc-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.smc-btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.smc-btn.primary:disabled { opacity: .6; cursor: default; }
.smc-btn.ghost { background: transparent; }
.smc-btn.ghost:hover { background: var(--surface-hover); }
.smc-btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }

/* ── Month toolbar ── */
.smc-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.smc-monthnav { display: flex; align-items: center; gap: 8px; }
.smc-nav-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background .15s ease, transform .12s ease; }
.smc-nav-btn svg { width: 17px; height: 17px; }
.smc-nav-btn:hover { background: var(--surface-hover); }
.smc-nav-btn:active { transform: scale(.94); }
.smc-month-label { min-width: 168px; text-align: center; font-size: 16.5px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; }
.smc-toolbar-spacer { flex: 1; }
.smc-month-count { font-size: 12.5px; color: var(--muted); }
.smc-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.smc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.smc-legend-post { width: 14px; height: 14px; border-radius: 4px; background: var(--surface); border: 2px solid var(--primary); display: inline-block; }
.smc-legend-story { width: 11px; height: 17px; border-radius: 5px; padding: 1.5px; background: linear-gradient(150deg, var(--primary), #35b795 55%, #7fd6c2); display: inline-flex; }
.smc-legend-story span { flex: 1; border-radius: 3.5px; background: var(--surface); }
.smc-legend-done { width: 15px; height: 15px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary); color: #fff; }
.smc-legend-done svg { width: 9px; height: 9px; }

/* ── Calendar shell ── */
.smc-cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.smc-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.smc-weekdays span { padding: 9px 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: right; }
.smc-grid-viewport { overflow: hidden; }
.smc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); }

/* month-change transitions */
@keyframes smcInRight { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes smcInLeft  { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes smcInFade  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.smc-grid.smc-in-right { animation: smcInRight .28s cubic-bezier(.22,.8,.36,1); }
.smc-grid.smc-in-left  { animation: smcInLeft  .28s cubic-bezier(.22,.8,.36,1); }
.smc-grid.smc-in-fade  { animation: smcInFade  .26s ease; }

/* ── Day cells ── */
.smc-cell { background: var(--surface); min-height: 118px; padding: 7px 8px 8px; position: relative; cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.smc-cell:hover { background: var(--surface-hover); }
.smc-cell.is-out { background: var(--surface-subtle); }
.smc-cell.is-out .smc-daynum { color: var(--muted-soft); }
.smc-cell-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.smc-daynum { font-size: 12.5px; font-weight: 600; color: var(--text); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; }
.smc-cell.is-today .smc-daynum { background: var(--primary); color: #fff; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 128, 96, .35); }
.smc-cell-count { font-size: 10.5px; font-weight: 700; color: var(--primary); background: rgba(0, 128, 96, .09); border-radius: 999px; padding: 1px 7px; }
.smc-day-items { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 5px; }

/* the + invite on empty days */
.smc-add-hint { position: absolute; right: 8px; bottom: 7px; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--primary); background: rgba(0, 128, 96, .08); opacity: 0; transform: scale(.8); transition: opacity .16s ease, transform .16s ease; pointer-events: none; }
.smc-add-hint svg { width: 13px; height: 13px; }
.smc-cell:hover .smc-add-hint { opacity: 1; transform: none; }

/* drag target */
.smc-cell.is-dropover { background: rgba(0, 128, 96, .07); box-shadow: inset 0 0 0 2px var(--primary); }
.smc-cell.is-dropover .smc-add-hint { opacity: 0; }

/* ── Item chips: post = square card, story = tall 9:16 gradient ring ── */
.smc-item { position: relative; padding: 0; border: none; background: none; cursor: grab; transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease; border-radius: 10px; }
.smc-item:hover { transform: translateY(-2px) scale(1.05); z-index: 2; }
.smc-item:active { cursor: grabbing; }
.smc-item.is-dragging { opacity: .35; transform: scale(.9); }
.smc-item-media { position: relative; display: block; overflow: hidden; background: var(--neutral-pill-bg); }
.smc-item-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.smc-item.kind-post .smc-item-media { width: 38px; height: 38px; border-radius: 9px; border: 2px solid var(--surface); outline: 2px solid var(--primary); box-shadow: var(--shadow-sm); }
.smc-item.kind-story { padding: 2.5px; background: linear-gradient(150deg, var(--primary), #35b795 55%, #7fd6c2); border-radius: 12px; box-shadow: var(--shadow-sm); }
.smc-item.kind-story .smc-item-media { width: 27px; height: 48px; border-radius: 9px; border: 2px solid var(--surface); }
.smc-item.is-done { filter: saturate(.35); opacity: .75; }
.smc-item-done { position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface); }
.smc-item-done svg { width: 8px; height: 8px; }
.smc-chip-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-soft); }
.smc-chip-ph svg { width: 15px; height: 15px; }
.smc-chip-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; pointer-events: none; }
.smc-chip-play svg { width: 8px; height: 8px; margin-left: 1px; }
.smc-more { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--neutral-pill-bg); border-radius: 8px; padding: 3px 7px; align-self: center; }

@keyframes smcPop { 0% { transform: scale(.55); opacity: 0; } 65% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.smc-item.smc-pop { animation: smcPop .38s cubic-bezier(.22,.8,.36,1); }

.smc-hint { margin-top: 10px; font-size: 12px; color: var(--muted-soft); }

/* ── Day drawer ── */
.smc-drawer-backdrop { position: fixed; inset: 0; background: rgba(26, 26, 26, 0); z-index: 220; transition: background .26s ease; }
.smc-drawer-backdrop.open { background: rgba(26, 26, 26, .42); }
.smc-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 94vw); background: var(--surface); box-shadow: -12px 0 34px rgba(22, 29, 37, .16); display: flex; flex-direction: column; transform: translateX(102%); transition: transform .28s cubic-bezier(.22,.8,.36,1); }
.smc-drawer-backdrop.open .smc-drawer { transform: none; }
.smc-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 18px 13px; border-bottom: 1px solid var(--border); }
.smc-drawer-title { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.smc-drawer-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.smc-drawer-head-actions { display: flex; align-items: center; gap: 8px; }
.smc-drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.smc-drawer-empty { text-align: center; padding: 40px 18px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 9px; font-size: 13px; }
.smc-drawer-empty a { color: var(--primary); font-weight: 600; text-decoration: underline; }
.smc-drawer-empty-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-subtle); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted-soft); }
.smc-drawer-empty-icon svg { width: 21px; height: 21px; }

/* drawer item cards */
@keyframes smcDitemIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.smc-ditem { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); animation: smcDitemIn .24s ease both; }
.smc-ditem.is-focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.smc-ditem.is-done { background: var(--surface-subtle); }
.smc-ditem-media { flex: 0 0 auto; width: 86px; height: 86px; border-radius: 10px; overflow: hidden; background: var(--neutral-pill-bg); position: relative; }
.smc-ditem-media.kind-story { width: 64px; height: 106px; border-radius: 12px; padding: 2.5px; background: linear-gradient(150deg, var(--primary), #35b795 55%, #7fd6c2); }
.smc-ditem-media.kind-story img, .smc-ditem-media.kind-story video { border-radius: 9.5px; }
.smc-ditem-media img, .smc-ditem-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.smc-ditem-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-soft); }
.smc-ditem-ph svg { width: 22px; height: 22px; }
.smc-ditem-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.smc-ditem-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.smc-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2.5px 8px; }
.smc-badge.kind-post { color: var(--primary-dark); background: rgba(0, 128, 96, .11); }
.smc-badge.kind-story { color: #fff; background: linear-gradient(135deg, var(--primary), #35b795); }
.smc-badge.st-planned { color: var(--muted); background: var(--neutral-pill-bg); }
.smc-badge.st-done { color: #fff; background: var(--primary); }
.smc-ditem-user { font-size: 11.5px; color: var(--muted-soft); }
.smc-ditem-caption { font-size: 12.5px; color: var(--text); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 72px; overflow: hidden; }
.smc-ditem-nocap { color: var(--muted-soft); font-style: italic; }
.smc-ditem-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.smc-mini-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background .14s ease, border-color .14s ease, transform .1s ease; text-decoration: none; }
.smc-mini-btn svg { width: 12px; height: 12px; }
.smc-mini-btn:hover { background: var(--surface-hover); }
.smc-mini-btn:active { transform: scale(.96); }
.smc-mini-btn.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.smc-mini-btn.primary:hover { background: var(--primary-dark); }
.smc-mini-btn.danger { color: var(--danger); }
.smc-mini-btn.danger:hover { background: rgba(216, 44, 13, .06); border-color: rgba(216, 44, 13, .35); }
.smc-ditem-edit { display: flex; flex-direction: column; gap: 9px; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 2px; }
.smc-ditem-edit-actions { display: flex; justify-content: flex-end; gap: 7px; }

/* ── Forms (shared: drawer edit + add modal) ── */
.smc-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.smc-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 130px; }
.smc-field-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.smc-opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted-soft); }
.smc-input, .smc-textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); font-size: 13px; font-family: inherit; color: var(--text); }
.smc-input:focus, .smc-textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.smc-textarea { resize: vertical; min-height: 60px; }
.smc-kindseg { display: inline-flex; background: var(--neutral-pill-bg); border-radius: 10px; padding: 3px; gap: 3px; }
.smc-kind { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.smc-kind.active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }
.smc-kind-glyph { display: inline-block; }
.smc-kind-glyph.post { width: 11px; height: 11px; border-radius: 3px; border: 2px solid var(--primary); }
.smc-kind-glyph.story { width: 8px; height: 14px; border-radius: 4px; background: linear-gradient(150deg, var(--primary), #7fd6c2); }
.smc-form-status { font-size: 12.5px; border-radius: 9px; padding: 8px 11px; }
.smc-form-status.info { background: var(--surface-subtle); color: var(--muted); }
.smc-form-status.err { background: rgba(216, 44, 13, .08); color: var(--danger); }
.smc-form-status.ok { background: rgba(0, 128, 96, .09); color: var(--primary-dark); }

/* ── Add / upload modal ── */
.smc-modal-backdrop { position: fixed; inset: 0; z-index: 230; background: rgba(26, 26, 26, 0); display: grid; place-items: center; padding: 18px; transition: background .22s ease; }
.smc-modal-backdrop.open { background: rgba(26, 26, 26, .45); }
.smc-modal { width: min(520px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 18px 50px rgba(22, 29, 37, .25); transform: translateY(14px) scale(.97); opacity: 0; transition: transform .22s cubic-bezier(.22,.8,.36,1), opacity .22s ease; max-height: 92vh; display: flex; flex-direction: column; }
.smc-modal-backdrop.open .smc-modal { transform: none; opacity: 1; }
.smc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 12px; border-bottom: 1px solid var(--border); }
.smc-modal-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.smc-modal-close { width: 30px; height: 30px; display: grid; place-items: center; border: none; background: transparent; border-radius: 8px; color: var(--muted); cursor: pointer; transition: background .14s ease, color .14s ease; }
.smc-modal-close svg { width: 16px; height: 16px; }
.smc-modal-close:hover { background: var(--surface-hover); color: var(--text-strong); }
.smc-modal-body { padding: 15px 18px; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; }
.smc-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 15px; border-top: 1px solid var(--border); }
.smc-dropzone { position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-subtle); min-height: 150px; display: grid; place-items: center; cursor: pointer; overflow: hidden; transition: border-color .16s ease, background .16s ease; padding: 0; }
.smc-dropzone:hover, .smc-dropzone.dragover { border-color: var(--primary); background: rgba(0, 128, 96, .04); }
.smc-drop-idle { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; padding: 18px; }
.smc-drop-idle svg { width: 26px; height: 26px; color: var(--muted-soft); }
.smc-drop-hint { font-size: 11.5px; color: var(--muted-soft); }
.smc-drop-preview { position: absolute; inset: 0; }
.smc-drop-preview img, .smc-drop-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.smc-drop-preview .smc-chip-play { width: 34px; height: 34px; }
.smc-drop-preview .smc-chip-play svg { width: 15px; height: 15px; }
.smc-drop-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 12px 8px; font-size: 11.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .62)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }

/* ── Toasts ── */
.smc-toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 260; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.smc-toast { background: var(--surface-dark); color: #fff; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 9px 16px; box-shadow: 0 8px 22px rgba(22, 29, 37, .28); opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .24s ease, transform .24s cubic-bezier(.22,.8,.36,1); }
.smc-toast.show { opacity: 1; transform: none; }
.smc-toast.ok { background: var(--primary-dark); }
.smc-toast.err { background: var(--danger); }

/* ── Responsive: tablet ── */
@media (max-width: 900px) {
  .smc-cell { min-height: 96px; padding: 5px 6px 6px; }
  .smc-item.kind-post .smc-item-media { width: 30px; height: 30px; }
  .smc-item.kind-story .smc-item-media { width: 21px; height: 38px; }
  .smc-month-label { min-width: 132px; font-size: 15px; }
  .smc-legend { display: none; }
}

/* ── Responsive: phone — chips become kind-shaped dots, drawer becomes a
      bottom sheet ── */
@media (max-width: 640px) {
  .smc-title-text { font-size: 16.5px; }
  .smc-weekdays span { padding: 7px 5px; text-align: center; font-size: 9.5px; }
  .smc-cell { min-height: 62px; padding: 4px; }
  .smc-cell-top { justify-content: center; margin-bottom: 4px; }
  .smc-daynum { width: 21px; height: 21px; font-size: 11px; }
  .smc-cell-count { display: none; }
  .smc-add-hint { display: none; }
  .smc-day-items { justify-content: center; gap: 3px; }
  .smc-item { border-radius: 4px; }
  .smc-item .smc-item-media img, .smc-item .smc-chip-ph, .smc-item .smc-chip-play, .smc-item-done { display: none; }
  .smc-item.kind-post .smc-item-media { width: 9px; height: 9px; border-radius: 3px; border: none; outline: none; background: var(--primary); box-shadow: none; }
  .smc-item.kind-story { padding: 0; border-radius: 4px; box-shadow: none; }
  .smc-item.kind-story .smc-item-media { width: 7px; height: 13px; border-radius: 3.5px; border: none; background: linear-gradient(150deg, var(--primary), #7fd6c2); }
  .smc-item.is-done { opacity: .4; filter: none; }
  .smc-more { font-size: 9px; padding: 1px 4px; }
  .smc-month-count { width: 100%; order: 5; }
  .smc-drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 84vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; transform: translateY(103%); }
  .smc-drawer-backdrop.open .smc-drawer { transform: none; }
  .smc-ditem-media { width: 70px; height: 70px; }
  .smc-ditem-media.kind-story { width: 54px; height: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .smc-grid, .smc-item, .smc-drawer, .smc-drawer-backdrop, .smc-modal, .smc-modal-backdrop, .smc-toast, .smc-ditem { animation: none !important; transition: none !important; }
}

/* ── Instagram page: "Schedule on calendar" modal bits (ig-sched-*) ── */
.ig-sched-preview { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-subtle); margin-bottom: 12px; }
.ig-sched-preview img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }
.ig-sched-noimg { width: 52px; height: 52px; border-radius: 9px; display: grid; place-items: center; background: var(--neutral-pill-bg); color: var(--muted-soft); flex: 0 0 auto; }
.ig-sched-noimg svg { width: 20px; height: 20px; }
.ig-sched-handle { font-size: 13px; font-weight: 700; color: var(--text-strong); }
.ig-sched-type { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ig-sched-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ig-sched-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }
.ig-sched-kindseg { display: inline-flex; background: var(--neutral-pill-bg); border-radius: 10px; padding: 3px; gap: 3px; align-self: flex-start; }
.ig-sched-seg { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; border-radius: 8px; padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.ig-sched-seg.active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }
.ig-sched-glyph { display: inline-block; }
.ig-sched-glyph.post { width: 11px; height: 11px; border-radius: 3px; border: 2px solid var(--primary); }
.ig-sched-glyph.story { width: 8px; height: 14px; border-radius: 4px; background: linear-gradient(150deg, var(--primary), #7fd6c2); }
.ig-sched-caption { min-height: 84px; }
/* the [hidden] gotcha: .ig-btn is inline-flex, so the "View calendar" link in
   the schedule modal footer needs an explicit guard to stay hidden pre-success */
.ig-modal-footer .ig-btn[hidden] { display: none; }

/* MCP OAuth consent screen */
.mcp-consent-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.mcp-consent-actions .btn { flex: 0 0 auto; }
.mcp-consent-dest { margin: 4px 0 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted, #f8fafc); font-size: 12.5px; }
.mcp-consent-dest strong { user-select: all; }
.mcp-consent-warn { color: #b45309; display: block; margin-top: 3px; }

/* --- Supplier Captures (extension push → server-downloaded media) -------- */
.spc-keywarn { border: 1px solid #f0c36d; background: #fdf6e3; color: #8a6d1a; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.spc-keywarn a { color: inherit; font-weight: 600; }
.spc-list { display: flex; flex-direction: column; gap: 10px; }
.spc-empty { border: 1px dashed var(--border); border-radius: 12px; padding: 26px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px; }
.spc-empty[hidden] { display: none; }
.spc-card { display: flex; gap: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 12px 14px; border-left-width: 3px; }
.spc-card.is-queued { border-left-color: #94a3b8; }
.spc-card.is-downloading { border-left-color: #6366f1; }
.spc-card.is-done { border-left-color: #10b981; }
.spc-card.is-error { border-left-color: #ef4444; }
.spc-thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface-muted, #f8fafc); }
.spc-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 26px; }
.spc-card-body { flex: 1; min-width: 0; }
.spc-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spc-title { font-size: 13.5px; font-weight: 600; margin: 0; flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spc-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.spc-badge-queued { background: #f1f5f9; color: #475569; }
.spc-badge-downloading { background: #eef2ff; color: #4f46e5; }
.spc-badge-done { background: #ecfdf5; color: #047857; }
.spc-badge-error { background: #fef2f2; color: #b91c1c; }
.spc-source { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.spc-meta { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 0; }
.spc-error { font-size: 12.5px; color: #b91c1c; margin: 4px 0 0; }
.spc-gallery { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.spc-gallery img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.spc-videos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.spc-video-link { font-size: 12.5px; color: var(--primary); text-decoration: none; }
.spc-video-link:hover { text-decoration: underline; }
.spc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.spc-btn-danger { color: #b91c1c; }
.spc-btn-danger:hover { background: #fef2f2; border-color: #fecaca; }

/* --- "+ From captures" picker in the Add Product wizard ------------------- */
.capture-pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.capture-pick-list[hidden] { display: none; }
.capture-pick-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.capture-pick-row:hover { border-color: var(--primary); background: var(--surface-subtle, #f8fafc); }
.capture-pick-row img, .capture-pick-noimg { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex: 0 0 auto; }
.capture-pick-noimg { display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--surface-muted, #f8fafc); }
.capture-pick-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.capture-pick-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.capture-pick-meta { font-size: 11.5px; color: var(--text-muted); text-transform: capitalize; }
