/* ==========================================================================
   Repress Hunter — label.yoyaku.fr
   Consumes the shared design tokens from /css/label-light.css instead of a
   private --rh-* namespace. Light theme parity with admin-users / submission
   pages (IBM Plex Mono + Familjen Grotesk + var(--bg-card)/var(--border)).
   ========================================================================== */

:root {
  --rh-font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
  --rh-font-body: 'Familjen Grotesk', -apple-system, BlinkMacSystemFont, Arial, sans-serif;

  /* Tier semantic colors (preserved — sémantique métier) */
  --rh-urgent: #d63434;
  --rh-candidate: #e67e22;
  --rh-watch: #d4a514;
  --rh-low: #95a5a6;
  --rh-review: #9b59b6;
  --rh-exclusive: #6d28d9;

  /* Fallback tokens (when label-light.css not present — e.g. dark mode parity) */
  --rh-bg: var(--bg-dark, #fafafa);
  --rh-card: var(--bg-card, #ffffff);
  --rh-border: var(--border, #e5e5e5);
  --rh-text: var(--text-primary, #1a1a1a);
  --rh-muted: var(--text-muted, #6b7280);
  --rh-tint: var(--bg-tint-soft, rgba(0, 0, 0, 0.025));
  --rh-accent-emphasis: var(--accent-emphasis, #4c1d95);
  --rh-success: #166534;
  --rh-success-bg: #f0fdf4;
  --rh-success-border: #86efac;
  --rh-warn: #8a5b00;
  --rh-warn-bg: #fff4d9;
  --rh-warn-border: #f0d889;
  --rh-danger: #991b1b;
  --rh-danger-bg: #fef2f2;
  --rh-danger-border: #fecaca;
  --rh-info: #0e7490;
  --rh-info-bg: #ecfeff;
  --rh-info-border: #0891b2;
  --rh-purple: #5b21b6;
  --rh-purple-bg: #f5f3ff;
  --rh-purple-border: #c4b5fd;
  --rh-on-solid: #ffffff;
  --rh-catalog: #0f766e;
  --rh-catalog-bg: #ccfbf1;
  --rh-chip-neutral-bg: #f4f4f5;
  --rh-chip-neutral-border: #d4d4d8;
  --rh-shadow: rgba(0, 0, 0, 0.08);
}

body.repress-hunter-page {
  --rh-bg: #0d0f12;
  --rh-card: #171a1f;
  --rh-card-raised: #1e2229;
  --rh-input: #111419;
  --rh-border: #333943;
  --rh-text: #f3f4f6;
  --rh-muted: #b2bac6;
  --rh-tint: var(--bg-tint-soft, rgba(255, 255, 255, 0.03));
  --rh-accent-emphasis: #a78bfa;
  --rh-success: #86efac;
  --rh-success-bg: color-mix(in srgb, #10b981 18%, var(--rh-card));
  --rh-success-border: color-mix(in srgb, #10b981 72%, var(--rh-border));
  --rh-warn: #fbbf24;
  --rh-warn-bg: color-mix(in srgb, #f59e0b 18%, var(--rh-card));
  --rh-warn-border: color-mix(in srgb, #f59e0b 72%, var(--rh-border));
  --rh-danger: #fca5a5;
  --rh-danger-bg: color-mix(in srgb, #ef4444 17%, var(--rh-card));
  --rh-danger-border: color-mix(in srgb, #ef4444 72%, var(--rh-border));
  --rh-info: #67e8f9;
  --rh-info-bg: color-mix(in srgb, #0891b2 18%, var(--rh-card));
  --rh-info-border: color-mix(in srgb, #0891b2 72%, var(--rh-border));
  --rh-purple: #c4b5fd;
  --rh-purple-bg: color-mix(in srgb, #7c3aed 18%, var(--rh-card));
  --rh-purple-border: color-mix(in srgb, #7c3aed 72%, var(--rh-border));
  --rh-on-solid: #ffffff;
  --rh-catalog: #5eead4;
  --rh-catalog-bg: color-mix(in srgb, #14b8a6 18%, var(--rh-card));
  --rh-chip-neutral-bg: #242932;
  --rh-chip-neutral-border: #3e4652;
  --rh-shadow: rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

body.label-light.repress-hunter-page {
  --rh-bg: #fafafa;
  --rh-card: #ffffff;
  --rh-card-raised: #ffffff;
  --rh-input: #ffffff;
  --rh-border: #d8d8d4;
  --rh-text: #1e1e1e;
  --rh-muted: #5f6670;
  --rh-tint: rgba(0, 0, 0, 0.025);
  --rh-accent-emphasis: #4c1d95;
  --rh-watch: #8f6500;
  --rh-success: #166534;
  --rh-success-bg: #f0fdf4;
  --rh-success-border: #86efac;
  --rh-warn: #8a5b00;
  --rh-warn-bg: #fff4d9;
  --rh-warn-border: #f0d889;
  --rh-danger: #991b1b;
  --rh-danger-bg: #fef2f2;
  --rh-danger-border: #fecaca;
  --rh-info: #0e7490;
  --rh-info-bg: #ecfeff;
  --rh-info-border: #0891b2;
  --rh-purple: #5b21b6;
  --rh-purple-bg: #f5f3ff;
  --rh-purple-border: #c4b5fd;
  --rh-on-solid: #ffffff;
  --rh-catalog: #0f766e;
  --rh-catalog-bg: #ccfbf1;
  --rh-chip-neutral-bg: #f4f4f5;
  --rh-chip-neutral-border: #d4d4d8;
  --rh-shadow: rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
body.repress-hunter-page {
  margin: 0;
  font-family: var(--rh-font-body);
  background: var(--rh-bg);
  color: var(--rh-text);
  font-size: 14px;
  line-height: 1.5;
}

body.repress-hunter-page #app {
  min-height: 100vh;
}

body.repress-hunter-page input:not([type="checkbox"]):not([type="radio"]),
body.repress-hunter-page select,
body.repress-hunter-page textarea {
  background-color: var(--rh-input) !important;
  color: var(--rh-text) !important;
  border-color: var(--rh-border) !important;
}

body.repress-hunter-page:not(.label-light) input:not([type="checkbox"]):not([type="radio"]),
body.repress-hunter-page:not(.label-light) select,
body.repress-hunter-page:not(.label-light) textarea {
  background-color: var(--rh-input, #111419) !important;
  color: var(--rh-text, #f3f4f6) !important;
  border-color: var(--rh-border, #333943) !important;
}

body.repress-hunter-page input::placeholder,
body.repress-hunter-page textarea::placeholder {
  color: var(--rh-muted) !important;
  opacity: 0.74;
}

body.repress-hunter-page input[type="checkbox"],
body.repress-hunter-page input[type="radio"] {
  accent-color: var(--rh-accent-emphasis);
}

@media (max-width: 768px) {
  body.repress-hunter-page #app {
    flex-direction: column;
  }
  body.repress-hunter-page .sidebar {
    width: 100%;
    max-width: none;
  }
  body.repress-hunter-page .main-content {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }
}

body.repress-hunter-page .rh-shell-main {
  padding: 0;
  background: var(--rh-bg);
}

body.repress-hunter-page .rh-page-header {
  min-height: 76px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--rh-border);
  background: var(--rh-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.rh-page-header .page-title {
  margin: 0;
  font-family: var(--rh-font-mono);
  font-size: 22px;
  line-height: 1.1;
}

.rh-page-header .label-name {
  display: block;
  margin-top: 4px;
  color: var(--rh-muted);
  font-size: 13px;
}

.rh-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rh-btn-primary,
.rh-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--rh-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.rh-btn-primary {
  border: 1px solid var(--rh-text);
  background: var(--rh-text);
  color: var(--rh-card);
}

.rh-btn-primary:hover {
  background: var(--rh-accent-emphasis);
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-card);
}

.rh-btn-secondary {
  border: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-text);
}

a.rh-btn-secondary {
  text-decoration: none;
}

.rh-btn-secondary:hover {
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-accent-emphasis);
}

.rh-btn-primary:disabled,
.rh-btn-secondary:disabled {
  opacity: .55;
  cursor: default;
}

.rh-tab-count,
[data-rh-wishlist-count] {
  font-family: var(--rh-font-mono);
}

.rh-view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px 0;
  background: var(--rh-bg);
  overflow-x: auto;
}

.rh-view-tab {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--rh-border);
  border-radius: 999px;
  background: var(--rh-card);
  color: var(--rh-muted);
  font-family: var(--rh-font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.rh-view-tab:hover {
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-text);
}

.rh-view-tab.is-active {
  border-color: var(--rh-accent-emphasis);
  background: color-mix(in srgb, var(--rh-accent-emphasis) 8%, var(--rh-card));
  color: var(--rh-text);
}

.rh-view-panel,
.rh-wishlist-view,
.rh-plan-view,
.rh-maintenance-view {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 28px 32px;
}

.rh-plan-view[hidden],
.rh-maintenance-view[hidden] {
  display: none;
}

/* ========================================================================
   Header — light + IBM Plex Mono title
   ======================================================================== */
.rh-header {
  background: var(--rh-card);
  border-bottom: 1px solid var(--rh-border);
  padding: 20px 0;
}
.rh-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.rh-brand h1 {
  margin: 0;
  font-family: var(--rh-font-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--rh-text);
}
.rh-tagline {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--rh-muted);
  font-family: var(--rh-font-body);
}
.rh-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.rh-nav a {
  color: var(--rh-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 4px;
  transition: color 0.15s;
}
.rh-nav a:hover {
  color: var(--rh-accent-emphasis);
}

/* ========================================================================
   Main container
   ======================================================================== */
.rh-main {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  body.repress-hunter-page .rh-page-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }
  .rh-view-tabs {
    padding: 12px 16px 0;
  }
  .rh-view-panel,
  .rh-wishlist-view,
  .rh-plan-view,
  .rh-maintenance-view {
    padding: 16px;
  }
}

/* ========================================================================
   Overview KPI strip (7 clickable tiles)
   ======================================================================== */
.rh-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.rh-stat {
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  font-family: var(--rh-font-body);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.rh-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--rh-shadow);
  border-color: var(--rh-accent-emphasis);
}
.rh-stat:focus-visible {
  outline: 2px solid var(--rh-accent-emphasis);
  outline-offset: 2px;
}
.rh-stat.is-active {
  border-color: var(--rh-accent-emphasis);
  background: var(--rh-tint);
}
.rh-stat .rh-num {
  font-family: var(--rh-font-mono);
  font-size: 23px;
  font-weight: 700;
  color: var(--rh-text);
  line-height: 1.1;
}
.rh-stat .rh-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--rh-muted);
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 4px;
}
.rh-stat[data-tier="REPRESS_URGENT"] .rh-num { color: var(--rh-urgent); }
.rh-stat[data-tier="REPRESS_CANDIDATE"] .rh-num { color: var(--rh-candidate); }
.rh-stat[data-tier="WATCH"] .rh-num { color: var(--rh-watch); }
.rh-stat[data-tier="NEEDS_REVIEW"] .rh-num { color: var(--rh-review); }
.rh-stat-exclusive .rh-num { color: var(--rh-exclusive); }
.rh-stat-catalog-exclusive .rh-num { color: var(--rh-catalog); }
.rh-stat-exclusive,
.rh-stat-catalog-exclusive { position: relative; }
.rh-stat-exclusive::before,
.rh-stat-catalog-exclusive::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rh-exclusive);
  border-radius: 8px 8px 0 0;
  opacity: 0.7;
}
.rh-stat-catalog-exclusive::before { background: var(--rh-catalog); }

.rh-pricing-health {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  background: var(--rh-card);
  color: var(--rh-muted);
  font-size: 12px;
}
.rh-pricing-health[hidden] {
  display: none;
}
.rh-pricing-health-label {
  font-family: var(--rh-font-mono);
  font-weight: 700;
  color: var(--rh-text);
}
.rh-pricing-health button {
  padding: 2px 7px;
  border: 1px solid var(--rh-border);
  border-radius: 999px;
  background: var(--rh-tint);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.rh-pricing-health button:hover,
.rh-pricing-health button.is-active {
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-text);
  background: color-mix(in srgb, var(--rh-accent-emphasis) 8%, var(--rh-card));
}
/* Quick wins preset — galvano in possession + most hyped first (Ben 2026-06-07).
   Reuses the theme-aware --rh-accent-emphasis token → no separate light override. */
.rh-pricing-health button.rh-quick-wins-chip {
  font-weight: 600;
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-text);
  background: color-mix(in srgb, var(--rh-accent-emphasis) 14%, var(--rh-card));
}
.rh-pricing-health button.rh-quick-wins-chip:hover {
  background: color-mix(in srgb, var(--rh-accent-emphasis) 24%, var(--rh-card));
}

/* ========================================================================
   Quick-toggle pills (primary workflow shortcuts)
   ======================================================================== */
.rh-quick-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
}
.rh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-muted);
  font-family: var(--rh-font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rh-toggle:hover {
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-text);
}
.rh-toggle[aria-pressed="true"] {
  border-color: var(--rh-accent-emphasis);
  background: var(--rh-tint);
  color: var(--rh-text);
}
.rh-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rh-muted);
  display: inline-block;
}
.rh-dot-exclusive { background: var(--rh-exclusive); }
.rh-dot-urgent { background: var(--rh-urgent); }
.rh-toggle[aria-pressed="true"] .rh-toggle-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rh-accent-emphasis) 22%, transparent);
}
.rh-toggle-label {
  font-family: var(--rh-font-body);
}
.rh-toggle-hint {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--rh-muted);
  letter-spacing: 0.05em;
  padding: 2px 6px;
  background: var(--rh-tint);
  border-radius: 4px;
  font-weight: 600;
}

/* ========================================================================
   Catalog search — primary entry point for SKU/title/artist/label lookup
   ======================================================================== */
.rh-catalog-panel {
  position: relative;
  z-index: 8;
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  padding: 10px;
  margin-bottom: 10px;
}
.rh-command-row {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) 118px auto auto;
  gap: 8px;
  align-items: center;
}
.rh-command-row input,
.rh-command-row select {
  font-family: var(--rh-font-body);
  font-size: 13px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-input);
  color: var(--rh-text);
}
.rh-command-row input {
  font-size: 14px;
  font-weight: 600;
}
.rh-catalog-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rh-muted);
  white-space: nowrap;
}
.rh-hidden-filter {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rh-catalog-results {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(100% - 2px);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
  max-height: min(420px, 56vh);
  margin-top: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  background: var(--rh-card);
  box-shadow: 0 18px 40px var(--rh-shadow);
}
.rh-catalog-results:empty {
  display: none;
}
.rh-catalog-result {
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  padding: 8px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  background: var(--rh-card-raised);
}
.rh-catalog-thumb {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--rh-tint);
}
.rh-catalog-meta {
  min-width: 0;
}
.rh-catalog-sku {
  font-family: var(--rh-font-mono);
  font-size: 12px;
  color: var(--rh-muted);
}
.rh-catalog-title {
  font-weight: 600;
  color: var(--rh-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rh-catalog-sub {
  font-size: 12px;
  color: var(--rh-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rh-catalog-result button {
  min-width: 104px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--rh-text);
  background: var(--rh-text);
  color: var(--rh-card);
  font-weight: 600;
  cursor: pointer;
}
.rh-catalog-result button.is-secondary {
  border-color: var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-text);
}
.rh-catalog-empty {
  color: var(--rh-muted);
  font-size: 13px;
}
@media (max-width: 760px) {
  .rh-command-row { grid-template-columns: 1fr; }
  .rh-catalog-result { grid-template-columns: 42px 1fr; }
  .rh-catalog-result button { grid-column: 1 / -1; }
}

/* ========================================================================
   Detail filters
   ======================================================================== */
.rh-filters {
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  padding: 10px;
  margin-bottom: 10px;
}
.rh-filter-primary,
.rh-advanced-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.rh-advanced-filters:not([open]) .rh-advanced-grid {
  display: none;
}
.rh-filter-primary {
  width: 100%;
}
.rh-filter-primary select {
  flex: 0 0 auto;
  width: auto;
}
.rh-filter-primary #f-tier { min-width: 136px; }
.rh-filter-primary #f-status { min-width: 142px; }
.rh-filter-primary #f-format { min-width: 120px; }
.rh-filter-primary #f-catalog-exclusive { min-width: 158px; }
.rh-filter-primary #f-sort { min-width: 132px; }
.rh-advanced-filters {
  width: 100%;
  margin-top: 8px;
}
.rh-advanced-filters > summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  color: var(--rh-muted);
  cursor: pointer;
  user-select: none;
}
.rh-advanced-filters[open] > summary {
  margin-bottom: 8px;
  color: var(--rh-text);
  border-color: var(--rh-accent-emphasis);
}
.rh-filters input,
.rh-filters select,
.rh-filters button {
  font-family: var(--rh-font-body);
  font-size: 13px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-input);
  color: var(--rh-text);
}
.rh-filters input[type="search"] {
  min-width: 170px;
}
.rh-filters input:focus,
.rh-filters select:focus {
  outline: none;
  border-color: var(--rh-accent-emphasis);
}
.rh-filters select[multiple],
.rh-filters select[multiple] option {
  background-color: var(--rh-card);
  color: var(--rh-text);
}
.rh-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--rh-muted);
}
.rh-filters .rh-btn-primary,
.rh-ingest-panel .rh-btn-primary,
.rh-maintenance-actions .rh-btn-primary,
.rh-filters #btn-apply {
  background: var(--rh-text);
  color: var(--rh-card);
  border: 1px solid var(--rh-text);
  cursor: pointer;
  font-weight: 600;
}
.rh-filters .rh-btn-primary:hover,
.rh-ingest-panel .rh-btn-primary:hover,
.rh-maintenance-actions .rh-btn-primary:hover,
.rh-filters #btn-apply:hover {
  background: var(--rh-accent-emphasis);
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-card);
}
.rh-filters .rh-btn-secondary,
.rh-maintenance-actions .rh-btn-secondary,
.rh-ingest-panel .rh-btn-secondary {
  background: var(--rh-card);
  color: var(--rh-text);
  border: 1px solid var(--rh-border);
  cursor: pointer;
}
.rh-filters .rh-btn-secondary:hover,
.rh-maintenance-actions .rh-btn-secondary:hover,
.rh-ingest-panel .rh-btn-secondary:hover {
  border-color: var(--rh-accent-emphasis);
}
.rh-ingest-panel {
  margin: -8px 0 18px;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--rh-accent-emphasis) 38%, var(--rh-border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--rh-card) 96%, var(--rh-tint));
}
.rh-maintenance-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: -4px 0 14px;
}
.rh-ingest-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--rh-muted);
}
.rh-ingest-grid {
  display: grid;
  grid-template-columns: 130px minmax(260px, 1fr) repeat(4, auto);
  gap: 8px;
  align-items: stretch;
  margin-top: 10px;
}
.rh-ingest-panel textarea,
.rh-ingest-panel select,
.rh-ingest-panel input[type="number"] {
  min-height: 42px;
  max-height: 110px;
  font-family: var(--rh-font-mono);
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-text);
}
.rh-ingest-check,
.rh-ingest-limit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  color: var(--rh-muted);
  background: var(--rh-card);
  font-size: 12px;
  white-space: nowrap;
}
.rh-ingest-limit input {
  width: 64px;
}
.rh-ingest-panel textarea { resize: vertical; }
.rh-ingest-panel button {
  white-space: nowrap;
}
.rh-ingest-status {
  grid-column: 1 / -1;
  min-height: 18px;
  font-family: var(--rh-font-mono);
  font-size: 12px;
  color: var(--rh-muted);
}
@media (max-width: 980px) {
  .rh-ingest-grid { grid-template-columns: 1fr 1fr; }
  .rh-ingest-grid textarea { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rh-maintenance-actions {
    justify-content: flex-start;
  }
}

.rh-format-audit-panel,
.rh-discogs-review-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  background: var(--rh-card);
}
.rh-format-audit-head,
.rh-discogs-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.rh-format-audit-head h3,
.rh-discogs-review-head h3 {
  margin: 0;
  font-family: var(--rh-font-mono);
  font-size: 15px;
}
.rh-format-audit-head h3 span {
  color: var(--rh-muted);
  font-size: 12px;
}
.rh-format-audit-head p,
.rh-discogs-review-head p {
  margin: 3px 0 0;
  color: var(--rh-muted);
  font-size: 13px;
}
.rh-format-audit-actions,
.rh-discogs-review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.rh-format-audit-actions input,
.rh-format-audit-actions select,
.rh-discogs-review-actions input,
.rh-discogs-review-actions select {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-text);
  font-family: var(--rh-font-body);
  font-size: 13px;
}
.rh-format-audit-actions input,
.rh-discogs-review-actions input {
  width: clamp(170px, 22vw, 260px);
}
#rh-format-audit-q,
#rh-discogs-review-q {
  width: clamp(210px, 26vw, 320px);
}
.rh-format-audit-status,
.rh-discogs-review-status {
  min-height: 18px;
  color: var(--rh-muted);
  font-family: var(--rh-font-mono);
  font-size: 12px;
}
.rh-format-audit-list,
.rh-discogs-review-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.rh-format-audit-row,
.rh-discogs-review-row {
  display: grid;
  grid-template-columns: 46px minmax(210px, 1fr) minmax(260px, 1.35fr);
  gap: 10px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--rh-border);
  border-radius: 7px;
  background: var(--rh-card-raised);
}
.rh-format-audit-row {
  grid-template-columns: 46px minmax(210px, 1fr) minmax(180px, .75fr) auto;
}
.rh-format-audit-cover,
.rh-discogs-review-cover {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--rh-tint);
}
.rh-format-audit-meta,
.rh-format-audit-metrics,
.rh-format-audit-tools,
.rh-discogs-review-meta,
.rh-discogs-review-tools {
  min-width: 0;
}
.rh-format-audit-sku,
.rh-discogs-review-sku {
  font-family: var(--rh-font-mono);
  font-size: 12px;
  color: var(--rh-muted);
}
.rh-format-audit-title,
.rh-discogs-review-title {
  margin-top: 2px;
  font-weight: 700;
  color: var(--rh-text);
  overflow-wrap: anywhere;
}
.rh-format-audit-sub,
.rh-format-audit-reason,
.rh-discogs-review-sub,
.rh-discogs-review-reason {
  margin-top: 2px;
  color: var(--rh-muted);
  font-size: 12px;
}
.rh-format-audit-metrics {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--rh-muted);
  font-family: var(--rh-font-mono);
  font-size: 11px;
}
.rh-format-audit-chip {
  border: 1px solid color-mix(in srgb, var(--rh-catalog) 38%, var(--rh-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--rh-catalog) 10%, var(--rh-card));
  color: var(--rh-catalog);
  padding: 2px 7px;
  font-weight: 700;
}
.rh-format-audit-tools {
  display: flex;
  justify-content: flex-end;
}
.rh-format-audit-tools .rh-btn-secondary {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}
.rh-discogs-review-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.rh-discogs-review-quick .rh-btn-secondary {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
  text-decoration: none;
}
.rh-discogs-review-tools {
  display: grid;
  gap: 6px;
}
.rh-discogs-review-search {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 6px;
}
.rh-discogs-review-manual {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 6px;
}
.rh-discogs-review-search input,
.rh-discogs-review-manual input {
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-text);
}
.rh-discogs-review-matches {
  display: grid;
  gap: 5px;
}
.rh-discogs-review-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
}
.rh-discogs-review-match-title {
  min-width: 0;
  color: var(--rh-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rh-discogs-review-match-meta {
  color: var(--rh-muted);
  font-family: var(--rh-font-mono);
  font-size: 11px;
  white-space: nowrap;
}
.rh-discogs-review-match a {
  color: var(--rh-info);
  text-decoration: none;
  font-size: 12px;
}
.rh-discogs-review-match button {
  font-size: 12px;
}
.rh-format-audit-pager,
.rh-discogs-review-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  color: var(--rh-muted);
  font-family: var(--rh-font-mono);
  font-size: 12px;
}
.rh-format-audit-pager span,
.rh-discogs-review-pager span {
  min-width: 92px;
  text-align: center;
}
.rh-galvano-source-note {
  display: block;
  margin-top: 4px;
  color: var(--rh-muted);
  font-style: italic;
  font-size: 11px;
  line-height: 1.4;
}
.rh-galvano-op-note {
  margin-top: 6px;
}
.rh-galvano-op-note .rh-chip {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 10.5px;
}
@media (max-width: 980px) {
  .rh-format-audit-row,
  .rh-discogs-review-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .rh-format-audit-metrics,
  .rh-format-audit-tools,
  .rh-discogs-review-tools {
    grid-column: 1 / -1;
  }
  .rh-format-audit-tools {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .rh-format-audit-head,
  .rh-discogs-review-head {
    flex-direction: column;
  }
  .rh-format-audit-actions,
  .rh-discogs-review-actions,
  .rh-discogs-review-search,
  .rh-discogs-review-manual,
  .rh-discogs-review-match {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .rh-format-audit-actions input,
  .rh-discogs-review-actions input {
    width: 100%;
  }
  .rh-format-audit-actions select,
  .rh-format-audit-actions button,
  .rh-format-audit-tools .rh-btn-secondary,
  .rh-format-audit-pager button,
  .rh-discogs-review-actions select,
  .rh-discogs-review-actions button,
  .rh-discogs-review-quick .rh-btn-secondary,
  .rh-discogs-review-pager button {
    width: 100%;
  }
  .rh-format-audit-pager,
  .rh-discogs-review-pager {
    align-items: stretch;
    flex-direction: column;
  }
  .rh-format-audit-pager span,
  .rh-discogs-review-pager span {
    min-width: 0;
  }
}

/* ========================================================================
   Active filter summary — makes hidden/default filters visible
   ======================================================================== */
.rh-filter-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -6px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--rh-card) 96%, var(--rh-tint));
}
.rh-filter-count {
  font-family: var(--rh-font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--rh-text);
}
.rh-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.rh-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--rh-accent-emphasis) 32%, var(--rh-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--rh-accent-emphasis) 7%, var(--rh-card));
  color: var(--rh-text);
  padding: 4px 9px;
  font-family: var(--rh-font-mono);
  font-size: 11px;
  cursor: pointer;
}
.rh-filter-chip:hover {
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-accent-emphasis);
}
.rh-filter-empty {
  color: var(--rh-muted);
  font-size: 12px;
}
.rh-empty-action {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--rh-muted);
}
.rh-empty-action p {
  margin: 0;
}
.rh-empty-action button {
  padding: 7px 12px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-text);
  cursor: pointer;
}
.rh-empty-action button:hover {
  border-color: var(--rh-accent-emphasis);
}

/* ========================================================================
   Repress plan tracker
   ======================================================================== */
.rh-plan-view-head,
.rh-maintenance-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.rh-plan-view-head h2,
.rh-maintenance-head h2 {
  margin: 0;
  font-family: var(--rh-font-mono);
  font-size: 18px;
}

.rh-plan-view-head p,
.rh-maintenance-head p {
  margin: 4px 0 0;
  color: var(--rh-muted);
  font-size: 13px;
}

.rh-plan-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rh-plan-filters select {
  min-height: 34px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-text);
  padding: 7px 10px;
  font-family: var(--rh-font-body);
  font-size: 13px;
}

.rh-plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.rh-plan-bridge {
  grid-column: 1 / -1;
  border: 1px solid var(--rh-accent-emphasis);
  border-radius: 8px;
  background: color-mix(in srgb, var(--rh-accent-emphasis) 6%, var(--rh-card));
  padding: 14px;
}

.rh-plan-bridge-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.rh-plan-bridge h3 {
  margin: 0;
  font-family: var(--rh-font-mono);
  font-size: 15px;
}

.rh-plan-bridge p {
  margin: 3px 0 0;
  color: var(--rh-muted);
  font-size: 13px;
}

.rh-plan-bridge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.rh-plan-bridge-list {
  display: grid;
  gap: 6px;
}

.rh-plan-bridge-row {
  display: grid;
  grid-template-columns: 20px 92px minmax(120px, 1.3fr) minmax(100px, .8fr) minmax(190px, auto);
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--rh-border) 80%, transparent);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-text);
  font-size: 12px;
}

.rh-plan-bridge-row strong {
  font-family: var(--rh-font-mono);
}

.rh-plan-bridge-title,
.rh-plan-bridge-label,
.rh-plan-bridge-prices {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-plan-bridge-label,
.rh-plan-bridge-prices {
  color: var(--rh-muted);
}

.rh-plan-card {
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  background: var(--rh-card);
  padding: 14px;
}

.rh-plan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rh-plan-card-title {
  min-width: 0;
}

.rh-plan-card-title strong {
  display: block;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rh-plan-card-title span {
  color: var(--rh-muted);
  font-family: var(--rh-font-mono);
  font-size: 11px;
}

.rh-plan-status {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--rh-accent-emphasis) 9%, var(--rh-card));
  color: var(--rh-accent-emphasis);
  font-family: var(--rh-font-mono);
  font-size: 10px;
  font-weight: 700;
}

.rh-plan-card-body {
  display: grid;
  gap: 5px;
  color: var(--rh-muted);
  font-size: 13px;
}

.rh-plan-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rh-plan-lines {
  margin-top: 12px;
  border-top: 1px solid var(--rh-border);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.rh-plan-line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 2px 8px;
  font-size: 12px;
}

.rh-plan-line strong {
  font-family: var(--rh-font-mono);
}

.rh-plan-line span {
  min-width: 0;
  color: var(--rh-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rh-plan-line span:last-child {
  grid-column: 2;
}

.rh-plan-readiness {
  margin-top: 12px;
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--rh-card) 88%, var(--rh-bg));
  padding: 10px;
  display: grid;
  gap: 8px;
}

.rh-plan-readiness-ready,
.rh-plan-readiness-warnings {
  border-color: color-mix(in srgb, var(--rh-ok) 50%, var(--rh-border));
}

.rh-plan-readiness-blocked {
  border-color: color-mix(in srgb, var(--rh-urgent) 45%, var(--rh-border));
}

.rh-plan-readiness-head,
.rh-plan-readiness-line {
  display: grid;
  grid-template-columns: minmax(76px, .7fr) minmax(90px, 1fr) minmax(0, 1.6fr);
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.rh-plan-readiness-head strong,
.rh-plan-readiness-line span:first-child {
  font-family: var(--rh-font-mono);
}

.rh-plan-readiness-head span,
.rh-plan-readiness-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-plan-readiness-list {
  margin: 0;
  padding-left: 18px;
  color: var(--rh-urgent);
  font-size: 12px;
}

.rh-plan-readiness-actions {
  margin: 0;
  padding-left: 18px;
  color: var(--rh-text);
  font-size: 12px;
}

.rh-plan-readiness-warnings,
.rh-plan-preview-result {
  color: var(--rh-muted);
  font-size: 12px;
}

.rh-plan-readiness-line.is-ready span:last-child {
  color: var(--rh-ok);
}

.rh-plan-readiness-line.is-blocked span:last-child {
  color: var(--rh-urgent);
}

.rh-plan-line-preorder {
  grid-column: 2;
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--rh-info-border);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--rh-info-bg);
  color: var(--rh-info);
  font-family: var(--rh-font-mono, monospace);
  font-size: 11px;
}

.rh-maintenance-view .rh-ingest-panel {
  margin: 0;
}

@media (max-width: 760px) {
  .rh-plan-view-head,
  .rh-maintenance-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .rh-plan-filters {
    width: 100%;
  }
  .rh-plan-filters select {
    flex: 1;
  }
  .rh-plan-bridge-head {
    flex-direction: column;
  }
  .rh-plan-bridge-actions {
    justify-content: flex-start;
  }
  .rh-plan-bridge-row {
    grid-template-columns: 20px 82px minmax(0, 1fr);
  }
  .rh-plan-bridge-label,
  .rh-plan-bridge-prices {
    grid-column: 3;
  }
}

/* ========================================================================
   Candidates grid
   ======================================================================== */
.rh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.rh-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--rh-muted);
  padding: 40px;
  font-size: 14px;
}

.rh-card {
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.rh-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--rh-shadow);
}
.rh-card-body {
  display: flex;
  gap: 12px;
  padding: 12px;
}
.rh-card-cover {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  background: var(--rh-tint);
  border-radius: 4px;
  object-fit: cover;
}
.rh-card-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--rh-border);
  /* Inline vinyl-disc SVG (no extra asset, no network call).
     Concentric grooves on a soft-grey background — communicates
     "no cover" without looking like a layout glitch. */
  background:
    radial-gradient(circle at center,
      var(--rh-tint) 0 12%,
      var(--rh-border) 12% 13%,
      var(--rh-tint) 13% 28%,
      var(--rh-border) 28% 29%,
      var(--rh-tint) 29% 44%,
      var(--rh-border) 44% 45%,
      var(--rh-tint) 45% 60%,
      var(--rh-border) 60% 61%,
      var(--rh-tint) 61% 100%);
}
.rh-card-info {
  flex: 1;
  min-width: 0;
}
.rh-card-info .sku {
  font-family: var(--rh-font-mono);
  font-size: 12px;
  color: var(--rh-muted);
}
.rh-card-info .title {
  font-weight: 600;
  font-size: 14px;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--rh-text);
}
.rh-card-info .artist {
  font-size: 12px;
  color: var(--rh-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rh-card-info .format-year {
  font-family: var(--rh-font-mono);
  font-size: 11px;
  color: var(--rh-muted);
}
.rh-card-prices {
  margin-top: 6px;
  font-family: var(--rh-font-mono);
  font-size: 12px;
}
.rh-card-prices strong { font-size: 14px; }

.rh-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rh-card-badge.t-REPRESS_URGENT { background: var(--rh-danger-bg); color: var(--rh-danger); }
.rh-card-badge.t-REPRESS_CANDIDATE { background: var(--rh-warn-bg); color: var(--rh-warn); }
.rh-card-badge.t-CATALOG_GAP { background: var(--rh-info-bg); color: var(--rh-info); }
.rh-card-badge.t-WATCH { background: var(--rh-warn-bg); color: var(--rh-warn); }
.rh-card-badge.t-LOW_VALUE { background: var(--rh-chip-neutral-bg); color: var(--rh-muted); }
.rh-card-badge.t-NEEDS_REVIEW { background: var(--rh-purple-bg); color: var(--rh-purple); }
.rh-card-badge.t-NO_MATCH { background: var(--rh-chip-neutral-bg); color: var(--rh-muted); }
.rh-card-badge.excl { background: var(--rh-purple-bg); color: var(--rh-purple); }
.rh-card-badge.catalog-excl { background: var(--rh-catalog-bg); color: var(--rh-catalog); }

.rh-card-footer {
  border-top: 1px solid var(--rh-border);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--rh-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================================================================
   Phase A.2 — Live signal chips on the card
   B2C status · B2B shelf · ❤ wishlist · 🥈 galvano routing · Discogs ↗
   ======================================================================== */
.rh-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px 0;
  align-items: center;
}
.rh-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 10px;
  border: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-text);
  white-space: nowrap;
  font-family: var(--rh-font-mono, monospace);
}
.rh-chip-ok {
  background: var(--rh-success-bg);
  border-color: var(--rh-success-border);
  color: var(--rh-success);
}
.rh-chip-ko {
  background: var(--rh-danger-bg);
  border-color: var(--rh-danger-border);
  color: var(--rh-danger);
}
.rh-chip-warn {
  background: var(--rh-warn-bg);
  border-color: var(--rh-warn-border);
  color: var(--rh-warn);
}
.rh-chip-neutral {
  background: var(--rh-chip-neutral-bg);
  border-color: var(--rh-chip-neutral-border);
  color: var(--rh-muted);
}
.rh-chip-heart {
  background: var(--rh-purple-bg);
  border-color: var(--rh-purple-border);
  color: var(--rh-purple);
}
.rh-chip-catalog {
  background: var(--rh-catalog-bg);
  border-color: color-mix(in srgb, var(--rh-catalog) 70%, var(--rh-border));
  color: var(--rh-catalog);
}
.rh-chip-discogs {
  background: var(--rh-card);
  border-color: var(--rh-border);
  color: var(--rh-text);
  text-decoration: none;
  margin-left: auto;  /* push to the right of the chips row */
  cursor: pointer;
}
.rh-chip-discogs:hover {
  background: var(--rh-purple-bg);
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-accent-emphasis);
}

/* ========================================================================
   Pagination
   ======================================================================== */
.rh-pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.rh-pagination button {
  font-family: var(--rh-font-body);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-text);
  border-radius: 6px;
  cursor: pointer;
}
.rh-pagination button:hover:not(:disabled) {
  border-color: var(--rh-accent-emphasis);
}
.rh-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#page-info {
  font-family: var(--rh-font-mono);
  font-size: 13px;
  color: var(--rh-muted);
}

/* ========================================================================
   Drawer — redesigned with visible close + ESC hint
   ======================================================================== */
.rh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 560px;
  max-width: 90vw;
  height: 100vh;
  background: var(--rh-card);
  border-left: 1px solid var(--rh-border);
  box-shadow: -8px 0 24px var(--rh-shadow);
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: rh-drawer-slide-in 0.18s ease-out;
}
.rh-drawer[hidden] { display: none; }

@keyframes rh-drawer-slide-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.rh-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rh-border);
  background: var(--rh-card);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* When the drawer is open, hide the floating Light/Dark pill — it sits at
   top:16px/right:16px and would otherwise cover the drawer Close button.
   The drawer is right-side and full-height; toggle re-appears on close. */
body.rh-drawer-open .yy-theme-toggle-floating {
  display: none;
}
.rh-drawer-title {
  margin: 0;
  font-family: var(--rh-font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--rh-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rh-drawer-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-text);
  cursor: pointer;
  font-family: var(--rh-font-body);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
}
.rh-drawer-close:hover {
  border-color: var(--rh-urgent);
  background: var(--rh-danger-bg);
  color: var(--rh-urgent);
}
.rh-close-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
.rh-close-label {
  font-size: 13px;
}
.rh-kbd {
  font-family: var(--rh-font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: var(--rh-tint);
  border: 1px solid var(--rh-border);
  border-radius: 4px;
  color: var(--rh-muted);
}

.rh-drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Generic floating close button (modal) — kept for backwards compat */
.rh-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--rh-text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rh-close:hover {
  border-color: var(--rh-urgent);
  color: var(--rh-urgent);
}

/* ========================================================================
   Modal
   ======================================================================== */
.rh-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.rh-modal[hidden] { display: none; }
.rh-modal-inner {
  background: var(--rh-card);
  border-radius: 12px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* ========================================================================
   Action buttons (drawer footer)
   ======================================================================== */
.rh-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.rh-actions button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-text);
  font-family: var(--rh-font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}
.rh-actions button.primary {
  background: var(--rh-text);
  color: var(--rh-card);
  border-color: var(--rh-text);
}
.rh-actions button.primary:hover {
  background: var(--rh-accent-emphasis);
  border-color: var(--rh-accent-emphasis);
  color: var(--rh-card);
}
.rh-actions button.danger {
  background: var(--rh-card);
  color: var(--rh-urgent);
  border-color: var(--rh-urgent);
}
.rh-actions button:hover:not(.primary):not(.danger) {
  border-color: var(--rh-accent-emphasis);
}

/* ========================================================================
   Draft email editor
   ======================================================================== */
.rh-draft-field {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-family: var(--rh-font-body);
  font-size: 14px;
  background: var(--rh-card);
  color: var(--rh-text);
}
.rh-draft-field.body {
  min-height: 280px;
  font-family: var(--rh-font-mono);
  font-size: 13px;
  white-space: pre-wrap;
}

/* ========================================================================
   Phase A — Card picking, sticky bar, cockpit, preview (2026-05-29)
   ======================================================================== */

/* Pick workflow toggle pill — card checkboxes are always visible; this only
   gives the operator a stronger visual focus while picking. */
.rh-toggle-select .rh-toggle-dot.rh-dot-select {
  background: linear-gradient(135deg, var(--rh-accent-emphasis) 0%, var(--rh-purple) 100%);
}
.rh-toggle-select[aria-pressed="true"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--rh-accent-emphasis) 18%, var(--rh-card)) 0%, var(--rh-card) 100%);
  border-color: var(--rh-accent-emphasis);
}

.rh-card-pick {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.rh-card-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rh-card-pick-box {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1.5px solid color-mix(in srgb, var(--rh-text) 34%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--rh-card) 92%, transparent);
  box-shadow: 0 1px 4px var(--rh-shadow);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.rh-card-pick-box::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}
.rh-card-pick:hover .rh-card-pick-box,
body.rh-pick-emphasis .rh-card-pick-box {
  border-color: var(--rh-accent-emphasis);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rh-accent-emphasis) 14%, transparent);
}
.rh-card-select:checked + .rh-card-pick-box {
  background: var(--rh-accent-emphasis);
  border-color: var(--rh-accent-emphasis);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rh-accent-emphasis) 24%, transparent), 0 3px 10px var(--rh-shadow);
}
.rh-card-select:checked + .rh-card-pick-box::after {
  content: "✓";
  width: auto;
  height: auto;
  background: transparent;
  color: var(--rh-on-solid);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.rh-card.selected {
  border-color: var(--rh-accent-emphasis);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--rh-accent-emphasis) 20%, transparent), inset 0 0 0 2px color-mix(in srgb, var(--rh-accent-emphasis) 62%, transparent);
  background: color-mix(in srgb, var(--rh-accent-emphasis) 11%, var(--rh-card));
}
.rh-card.selected::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--rh-accent-emphasis);
  z-index: 2;
  pointer-events: none;
}
.rh-card.selected::after {
  content: "✓ Selected";
  position: absolute;
  top: 8px;
  right: 42px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--rh-accent-emphasis);
  color: var(--rh-on-solid);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--rh-font-mono, monospace);
  line-height: 1;
}

/* Sticky bar at the bottom of the grid — appears whenever selection > 0. */
.rh-sticky-bar {
  position: sticky;
  bottom: 12px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--rh-card);
  border: 1px solid var(--rh-accent-emphasis);
  border-radius: 999px;
  box-shadow: 0 8px 24px var(--rh-shadow);
  font-family: var(--rh-font-body);
  font-size: 14px;
  z-index: 50;
  max-width: 640px;
}
.rh-sticky-bar[hidden] { display: none; }
.rh-sticky-spacer { flex: 1; }
.rh-sticky-count strong {
  font-family: var(--rh-font-mono);
  color: var(--rh-accent-emphasis);
  font-size: 16px;
  margin-right: 4px;
}

/* Plan cockpit — wider modal, per-label sections. */
.rh-cockpit-inner {
  max-width: 880px;
}
.rh-cockpit-header h2 {
  margin: 0 0 6px;
  font-family: var(--rh-font-mono);
  font-size: 18px;
  letter-spacing: -0.01em;
}
.rh-cockpit-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: color-mix(in srgb, var(--rh-text) 70%, transparent);
}
.rh-plan-section {
  border: 1px solid var(--rh-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--rh-card) 96%, transparent);
}
.rh-plan-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.rh-plan-label-name {
  font-family: var(--rh-font-mono);
  font-weight: 700;
  font-size: 15px;
}
.rh-plan-label-lang {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--rh-border);
  color: var(--rh-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rh-spec-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rh-border);
  color: color-mix(in srgb, var(--rh-text) 60%, transparent);
}
.rh-spec-chip.chip-pattern { color: var(--rh-accent-emphasis); border-color: var(--rh-accent-emphasis); }
.rh-spec-chip.chip-history { color: var(--rh-info); border-color: var(--rh-info); }
.rh-spec-chip.chip-manual { color: color-mix(in srgb, var(--rh-text) 50%, transparent); }
.rh-plan-section-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.rh-plan-section-actions button {
  background: transparent;
  border: none;
  color: var(--rh-accent-emphasis);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
}
.rh-plan-section-actions button.danger { color: var(--rh-urgent); }

.rh-plan-row {
  display: grid;
  grid-template-columns: 60px 1fr 90px 80px 80px;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px dashed var(--rh-border);
}
.rh-plan-row:first-of-type { border-top: none; }
.rh-plan-row-cover {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  background: var(--rh-border);
  background-size: cover;
  background-position: center;
}
.rh-plan-row-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rh-plan-row-sku {
  font-family: var(--rh-font-mono);
  font-size: 12px;
  font-weight: 700;
}
.rh-plan-row-title {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rh-plan-row-sub {
  font-size: 11px;
  color: color-mix(in srgb, var(--rh-text) 60%, transparent);
}
.rh-plan-row-sub a {
  color: inherit;
  text-decoration: underline;
}
.rh-plan-row input[type="number"] {
  font-family: var(--rh-font-mono);
  padding: 6px 8px;
  border: 1px solid var(--rh-border);
  border-radius: 4px;
  background: var(--rh-card);
  color: var(--rh-text);
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.rh-plan-row input.invalid {
  border-color: var(--rh-urgent);
  outline: 1px solid var(--rh-urgent);
}
@media (max-width: 720px) {
  .rh-cockpit-inner {
    max-width: calc(100vw - 24px);
  }
  .rh-plan-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }
  .rh-plan-row-cover {
    width: 48px;
    height: 48px;
  }
  .rh-plan-row-qty,
  .rh-plan-row-b2c,
  .rh-plan-row-b2b {
    grid-column: 2;
    max-width: 160px;
  }
  .rh-plan-row-specs,
  .rh-plan-row-preorder,
  .rh-plan-row-remove {
    grid-column: 1 / -1;
  }
}
.rh-plan-row-preorder {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: auto auto minmax(92px, 110px) minmax(132px, 160px) minmax(160px, 1fr);
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-muted);
  font-size: 12px;
}
.rh-plan-row-preorder.is-enabled {
  border-color: var(--rh-info-border);
  background: var(--rh-info-bg);
  color: var(--rh-info);
}
.rh-plan-row-preorder select,
.rh-plan-row-preorder input {
  min-width: 0;
  width: 100%;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--rh-border) 85%, transparent);
  border-radius: 4px;
  background: var(--rh-card);
  color: var(--rh-text);
  font-size: 12px;
}
.rh-plan-row-preorder input[type="checkbox"] {
  width: auto;
}
.rh-plan-row-preorder input:disabled,
.rh-plan-row-preorder select:disabled {
  opacity: .45;
}
.rh-plan-row-specs {
  grid-column: 2 / -1;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .rh-plan-row-preorder,
  .rh-plan-row-specs {
    grid-column: 1 / -1;
  }
  .rh-plan-row-preorder {
    grid-template-columns: auto auto minmax(82px, 1fr);
  }
  .rh-plan-row-preorder input[type="date"],
  .rh-plan-row-preorder input[type="text"] {
    grid-column: 1 / -1;
  }
}
.rh-plan-row-specs details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--rh-accent-emphasis);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rh-plan-row-specs details summary::before {
  content: "▸";
  display: inline-block;
  font-size: 10px;
  transition: transform 0.12s;
}
.rh-plan-row-specs details[open] summary::before { transform: rotate(90deg); }
.rh-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.rh-spec-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: color-mix(in srgb, var(--rh-text) 70%, transparent);
}
.rh-spec-grid input, .rh-spec-grid select {
  padding: 4px 6px;
  border: 1px solid var(--rh-border);
  border-radius: 3px;
  background: var(--rh-card);
  color: var(--rh-text);
  font-size: 12px;
  font-family: var(--rh-font-body);
}
.rh-plan-row-remove {
  background: transparent;
  border: none;
  color: var(--rh-urgent);
  cursor: pointer;
  font-size: 18px;
  align-self: center;
  padding: 0 6px;
}
.rh-cockpit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rh-border);
}

/* Plan preview / send — same modal-inner sizing. */
.rh-preview-inner {
  max-width: 840px;
}
.rh-preview-header h2 {
  margin: 0 0 8px;
  font-family: var(--rh-font-mono);
  font-size: 18px;
}
.rh-preview-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--rh-warn-bg);
  border: 1px solid var(--rh-warn-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--rh-text);
}
.rh-preview-banner[hidden] { display: none; }
.rh-preview-banner strong { font-family: var(--rh-font-mono); }

/* U4 — "learned from Objects quotes" advisory signal (read-only). */
.rh-learning-signal {
  margin-bottom: 14px;
  padding: 9px 14px;
  background: var(--rh-info-bg);
  border: 1px solid var(--rh-info-border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--rh-text);
  line-height: 1.5;
}
.rh-learning-head { font-family: var(--rh-font-mono); font-weight: 600; color: var(--rh-info); }
.rh-learning-body { color: color-mix(in srgb, var(--rh-text) 85%, transparent); }
.rh-learning-top { margin-top: 4px; font-size: 12px; }
.rh-learning-top-label { color: color-mix(in srgb, var(--rh-text) 55%, transparent); }
.rh-learning-top-name { font-family: var(--rh-font-mono); }
.rh-learning-top-count { color: color-mix(in srgb, var(--rh-text) 55%, transparent); }

.rh-preview-card {
  border: 1px solid var(--rh-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--rh-card);
}
.rh-preview-card.sent {
  border-color: var(--rh-success-border);
  background: var(--rh-success-bg);
}
.rh-preview-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.rh-preview-meta {
  font-family: var(--rh-font-mono);
  font-size: 12px;
  color: color-mix(in srgb, var(--rh-text) 65%, transparent);
}
.rh-preview-subject {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-family: var(--rh-font-mono);
  font-size: 13px;
  background: var(--rh-card);
  color: var(--rh-text);
  margin-bottom: 8px;
  box-sizing: border-box;
}
.rh-preview-body-text {
  width: 100%;
  min-height: 280px;
  padding: 12px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-family: var(--rh-font-mono);
  font-size: 12.5px;
  background: var(--rh-card);
  color: var(--rh-text);
  white-space: pre-wrap;
  resize: vertical;
  box-sizing: border-box;
}
.rh-preview-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}
.rh-preview-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.rh-preview-status.draft { background: var(--rh-border); color: var(--rh-text); }
.rh-preview-status.sent { background: var(--rh-success); color: var(--rh-card); }
.rh-preview-status.error { background: var(--rh-danger); color: var(--rh-card); }

/* Phase I — asset-state 4-dot strip (galvano/master/PAO/invoice) + readiness pill */
.rh-asset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px 0;
  align-items: center;
}
.rh-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--rh-border);
  font-family: var(--rh-font-mono, monospace);
  cursor: default;
}
.rh-dot-ok { background: var(--rh-success-bg); border-color: var(--rh-success-border); color: var(--rh-success); }
.rh-dot-ko { background: var(--rh-danger-bg); border-color: var(--rh-danger-border); color: var(--rh-danger); }
.rh-dot-warn { background: var(--rh-warn-bg); border-color: var(--rh-warn-border); color: var(--rh-warn); }
.rh-dot-neutral { background: var(--rh-card); border-color: var(--rh-border); color: var(--rh-muted); }
.rh-readiness {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 10px;
  margin-left: 2px;
  font-family: var(--rh-font-mono, monospace);
}
.rh-readiness-ok { background: var(--rh-success); color: var(--rh-card); }
.rh-readiness-warn { background: var(--rh-warn-bg); border: 1px solid var(--rh-warn-border); color: var(--rh-warn); }
.rh-readiness-ko { background: var(--rh-danger); color: var(--rh-card); }

.rh-owner-filter { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.rh-owner-filter input { min-width: 190px; }
.rh-owner-clear {
  border: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-muted);
  border-radius: 4px;
  cursor: pointer;
  font-size: .86rem;
  line-height: 1;
  padding: 4px 7px;
}
.rh-owner-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 46px;
  min-width: 260px;
  max-width: 360px;
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--rh-text) 16%, transparent);
  overflow: hidden;
}
.rh-owner-suggest {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--rh-border);
  background: var(--rh-card);
  color: var(--rh-text);
  cursor: pointer;
  padding: 7px 9px;
}
.rh-owner-suggest:last-child { border-bottom: 0; }
.rh-owner-suggest:hover { background: color-mix(in srgb, var(--rh-accent-emphasis) 8%, var(--rh-card)); }
.rh-owner-suggest strong { display: block; font-size: .84rem; }
.rh-owner-suggest span { display: block; color: var(--rh-muted); font-size: .74rem; margin-top: 2px; }

/* ========================================================================
   WAVE W — Repress Research Board (persistent shortlist) + card picking
   ======================================================================== */
.rh-toggle-primary { box-shadow: none; font-weight: 600; }
.rh-dot-heart { background: var(--rh-purple); }
.rh-toggle-wishlist .rh-toggle-label { color: var(--rh-purple); }

/* card wishlist toggle chip */
.rh-chip-wishlist {
  cursor: pointer;
  border: 1px solid var(--rh-purple-border);
  background: var(--rh-purple-bg);
  color: var(--rh-purple);
}
.rh-chip-wishlist:hover { border-color: var(--rh-accent-emphasis); }
.rh-chip-wishlist.is-in {
  background: var(--rh-success-bg);
  border-color: var(--rh-success-border);
  color: var(--rh-success);
}
.rh-chip-wishlist[disabled] { opacity: .5; cursor: default; }

/* view switching: hide the triage UI while the wishlist grid is open */
#wishlist-view { display: none; }
body.rh-wishlist-open #wishlist-view { display: block; }
body.rh-wishlist-open #discover-view,
body.rh-wishlist-open #plan-view,
body.rh-wishlist-open #maintenance-view,
body.rh-plan-open #discover-view,
body.rh-plan-open #wishlist-view,
body.rh-plan-open #maintenance-view,
body.rh-maintenance-open #discover-view,
body.rh-maintenance-open #wishlist-view,
body.rh-maintenance-open #plan-view {
  display: none !important;
}

body.rh-plan-open #plan-view,
body.rh-maintenance-open #maintenance-view {
  display: block;
}

.rh-wishlist-view { margin-top: 8px; }
.rh-wishlist-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rh-wishlist-head h2 { margin: 0; font-size: 1.2rem; }
.rh-wishlist-sub { color: var(--rh-muted); font-size: .82rem; }
.rh-wishlist-head .rh-sticky-spacer { flex: 1; }
.rh-wishlist-head select {
  min-height: 34px;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  background: var(--rh-card);
  color: var(--rh-text);
  padding: 7px 10px;
  font-family: var(--rh-font-body);
  font-size: 13px;
}

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

.rh-onboarding-card {
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  background: var(--rh-card);
  padding: 16px;
}

.rh-onboarding-card h2 {
  margin: 0 0 8px;
  font-family: var(--rh-font-mono);
  font-size: 15px;
}

.rh-onboarding-card p {
  margin: 0 0 10px;
  color: var(--rh-muted);
  font-size: 13px;
}

.rh-onboarding-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--rh-text);
  font-size: 13px;
}

.rh-onboarding-card li + li {
  margin-top: 4px;
}
.rh-wishlist-job {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--rh-border);
  border-radius: 999px;
  padding: 4px 9px;
  font-family: var(--rh-font-mono, monospace);
  font-size: .72rem;
  color: var(--rh-muted);
  background: var(--rh-card);
}
.rh-wishlist-job-running { border-color: var(--rh-info-border); background: var(--rh-info-bg); color: var(--rh-info); }
.rh-wishlist-job-ok { border-color: var(--rh-success-border); background: var(--rh-success-bg); color: var(--rh-success); }
.rh-wishlist-job-error { border-color: var(--rh-danger-border); background: var(--rh-danger-bg); color: var(--rh-danger); }
.rh-wishlist-grid { container-type: inline-size; }

.rh-wl-section { margin-bottom: 18px; }
.rh-wl-label { font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--rh-border); margin-bottom: 6px; }
.rh-wl-row {
  display: grid;
  grid-template-columns: 24px 44px minmax(160px, 1.15fr) 70px 70px 70px minmax(130px, 150px) 78px auto minmax(160px, .8fr) 30px;
  align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--rh-border);
  transition: background .3s;
}
.rh-wl-row.rh-wl-saved { background: var(--rh-success-bg); }
.rh-wl-check { grid-column: 1; grid-row: 1; }
.rh-wl-cover { grid-column: 2; grid-row: 1; }
.rh-wl-cover img { width: 40px; height: 40px; object-fit: cover; border-radius: 3px; }
.rh-wl-meta { grid-column: 3; grid-row: 1; overflow: hidden; }
.rh-wl-title { color: var(--rh-muted); font-size: .82rem; }
.rh-wl-galv { font-size: .74rem; color: var(--rh-warn); }
.rh-wl-num { width: 100%; padding: 3px 4px; font-size: .82rem; }
.rh-wl-qty { grid-column: 4; grid-row: 1; }
.rh-wl-b2c { grid-column: 5; grid-row: 1; }
.rh-wl-b2b { grid-column: 6; grid-row: 1; }
.rh-wl-status { font-size: .78rem; padding: 3px; max-width: 160px; }
.rh-wl-status { grid-column: 7; grid-row: 1; }
.rh-wl-notify { grid-column: 8; grid-row: 1; font-size: .74rem; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
.rh-wl-order { grid-column: 1 / 4; grid-row: 2; display: flex; align-items: center; gap: 4px; padding-left: 32px; font-size: .74rem; min-width: 0; }
.rh-wl-order-sel { font-size: .74rem; padding: 3px; max-width: 130px; }
.rh-wl-order-stamp { color: var(--rh-muted); font-size: .7rem; white-space: nowrap; }
.rh-wl-preorder {
  grid-column: 4 / 11;
  grid-row: 2;
  display: grid;
  grid-template-columns: auto auto minmax(82px, 96px) minmax(126px, 142px) minmax(180px, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px 5px;
  border: 1px solid var(--rh-border);
  border-radius: 5px;
  background: var(--rh-card);
  color: var(--rh-muted);
  font-size: .72rem;
}
.rh-wl-preorder.is-enabled {
  border-color: var(--rh-info-border);
  background: var(--rh-info-bg);
  color: var(--rh-info);
}
.rh-wl-preorder select,
.rh-wl-preorder input {
  min-width: 0;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--rh-border) 85%, transparent);
  border-radius: 3px;
  background: var(--rh-card);
  color: var(--rh-text);
  font-size: .72rem;
  padding: 2px 4px;
}
.rh-wl-preorder input[type="checkbox"] {
  width: auto;
}
.rh-wl-preorder input:disabled,
.rh-wl-preorder select:disabled {
  opacity: .45;
}
.rh-wl-specs { grid-column: 9; grid-row: 1; font-size: .76rem; }
.rh-wl-specgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; margin-top: 4px; }
.rh-wl-spec { width: 100%; padding: 2px 3px; font-size: .74rem; }
.rh-wl-note { grid-column: 10; grid-row: 1; width: 100%; padding: 3px 4px; font-size: .76rem; color: var(--rh-muted); }
.rh-wl-remove { grid-column: 11; grid-row: 1; background: var(--rh-urgent, #a02525); color: var(--rh-on-solid); border: none; border-radius: 4px; cursor: pointer; width: 26px; height: 26px; font-weight: 700; }
.rh-wl-remove:hover { background: color-mix(in srgb, var(--rh-urgent) 84%, var(--rh-text)); }
.rh-wl-assets {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 0 4px 32px;
  font-size: .74rem;
}
.rh-wl-asset-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rh-border);
  border-radius: 999px;
  padding: 2px 7px;
  font-family: var(--rh-font-mono, monospace);
  line-height: 1.2;
  background: var(--rh-card);
  color: var(--rh-muted);
}
.rh-wl-decision {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rh-border);
  border-radius: 5px;
  padding: 3px 7px;
  font-family: var(--rh-font-mono, monospace);
  font-size: .73rem;
  font-weight: 700;
  line-height: 1.2;
}
.rh-wl-asset-ok { background: var(--rh-success-bg); border-color: var(--rh-success-border); color: var(--rh-success); }
.rh-wl-asset-warn { background: var(--rh-warn-bg); border-color: var(--rh-warn-border); color: var(--rh-warn); }
.rh-wl-asset-ko { background: var(--rh-danger-bg); border-color: var(--rh-danger-border); color: var(--rh-danger); }
.rh-wl-asset-neutral { background: var(--rh-card); border-color: var(--rh-border); color: var(--rh-muted); }
.rh-wl-asset-candidates {
  color: var(--rh-purple);
  max-width: min(760px, 100%);
}
.rh-wl-asset-candidates summary {
  cursor: pointer;
  font-family: var(--rh-font-mono, monospace);
  font-size: .73rem;
}
.rh-wl-asset-candidate {
  margin-top: 2px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 2px 0;
  color: var(--rh-muted);
}
.rh-wl-candidate-text {
  min-width: 180px;
  max-width: min(620px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rh-wl-candidate-action {
  border: 1px solid var(--rh-purple-border);
  background: var(--rh-purple-bg);
  color: var(--rh-purple);
  border-radius: 4px;
  padding: 1px 6px;
  text-decoration: none;
  font-family: var(--rh-font-body);
  font-size: .7rem;
  cursor: pointer;
}
.rh-wl-candidate-use {
  border-color: var(--rh-success-border);
  background: var(--rh-success-bg);
  color: var(--rh-success);
}
.rh-wl-candidate-use:disabled {
  opacity: .65;
  cursor: default;
}
.rh-wl-asset-candidate-confirmed {
  background: var(--rh-success-bg);
  border-radius: 4px;
}
.rh-wl-research-one {
  border: 1px solid var(--rh-info-border);
  background: var(--rh-info-bg);
  color: var(--rh-info);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 8px;
  font-size: .74rem;
}
.rh-wl-research-one:disabled { opacity: .55; cursor: default; }
@container (max-width: 1180px) {
  .rh-wl-row { grid-template-columns: 24px 44px minmax(0, 1fr); grid-auto-flow: row; }
  .rh-wl-row > * { grid-column: 1 / -1; grid-row: auto; }
  .rh-wl-check { grid-column: 1; }
  .rh-wl-cover { grid-column: 2; }
  .rh-wl-meta { grid-column: 3; }
  .rh-wl-preorder { grid-template-columns: auto auto minmax(82px, 1fr); }
  .rh-wl-preorder input[type="date"],
  .rh-wl-preorder input[type="text"] { grid-column: 1 / -1; }
  .rh-wl-assets { padding-left: 0; }
}
@media (max-width: 1280px) {
  .rh-wl-row { grid-template-columns: 24px 44px 1fr; grid-auto-flow: row; }
  .rh-wl-row > * { grid-column: 1 / -1; grid-row: auto; }
  .rh-wl-check { grid-column: 1; }
  .rh-wl-cover { grid-column: 2; }
  .rh-wl-meta { grid-column: 3; }
  .rh-wl-preorder { grid-template-columns: auto auto minmax(82px, 1fr); }
  .rh-wl-preorder input[type="date"],
  .rh-wl-preorder input[type="text"] { grid-column: 1 / -1; }
  .rh-wl-assets { padding-left: 0; }
}

/* P4/U3a — per-SKU recipe editor (durable manufacturing_specs SSOT). Full-width row
   under the inline wishlist cells; teal accent to distinguish from the per-plan specs. */
.rh-wl-recipe { grid-column: 1 / -1; font-size: .78rem; margin-top: 2px; }
.rh-wl-recipe > summary { cursor: pointer; color: var(--rh-info); font-weight: 600; padding: 2px 0; }
.rh-recipe-body { border: 1px solid color-mix(in srgb, var(--rh-info-border) 35%, var(--rh-border)); border-left: 3px solid var(--rh-info-border); background: var(--rh-info-bg); border-radius: 4px; padding: 8px 10px; margin-top: 4px; }
.rh-recipe-status { color: var(--rh-muted); font-size: .74rem; margin-bottom: 6px; }
.rh-recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; }
.rh-recipe-cell { display: flex; flex-direction: column; gap: 2px; }
.rh-recipe-lab { font-size: .7rem; color: var(--rh-info); text-transform: uppercase; letter-spacing: .03em; }
.rh-recipe-cell input, .rh-recipe-cell select { width: 100%; padding: 3px 4px; font-size: .8rem; border: 1px solid color-mix(in srgb, var(--rh-info-border) 35%, var(--rh-border)); border-radius: 3px; background: var(--rh-card); color: var(--rh-text); }
.rh-recipe-low-confidence { outline: 1.5px dashed var(--rh-warn-border); }
.rh-recipe-extract { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.rh-recipe-paste { width: 100%; font-family: var(--rh-font-mono, monospace); font-size: .74rem; padding: 5px 6px; border: 1px solid color-mix(in srgb, var(--rh-info-border) 35%, var(--rh-border)); border-radius: 3px; resize: vertical; background: var(--rh-card); color: var(--rh-text); }
.rh-recipe-extract-btn { align-self: flex-start; font-size: .76rem; padding: 3px 10px; border: 1px solid var(--rh-info-border); background: var(--rh-card); color: var(--rh-info); border-radius: 4px; cursor: pointer; }
.rh-recipe-extract-btn:hover { background: color-mix(in srgb, var(--rh-info-border) 10%, var(--rh-card)); }
.rh-recipe-import {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rh-recipe-import-url {
  flex: 1 1 340px;
  min-width: 220px;
  padding: 4px 6px;
  border: 1px solid color-mix(in srgb, var(--rh-info-border) 35%, var(--rh-border));
  border-radius: 3px;
  background: var(--rh-card);
  color: var(--rh-text);
  font-family: var(--rh-font-mono, monospace);
  font-size: .74rem;
}
.rh-recipe-actions { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.rh-recipe-import-btn {
  font-size: .76rem;
  padding: 4px 10px;
  border: 1px solid var(--rh-purple-border);
  background: var(--rh-purple-bg);
  color: var(--rh-purple);
  border-radius: 4px;
  cursor: pointer;
}
.rh-recipe-import-btn:hover { background: color-mix(in srgb, var(--rh-purple-border) 18%, var(--rh-card)); }
.rh-recipe-save { font-size: .8rem; padding: 4px 14px; border: none; background: var(--rh-info-border); color: var(--rh-on-solid); border-radius: 4px; cursor: pointer; font-weight: 600; }
.rh-recipe-save:hover { background: var(--rh-info); }
.rh-recipe-save:disabled, .rh-recipe-extract-btn:disabled, .rh-recipe-import-btn:disabled { opacity: .55; cursor: default; }
.rh-recipe-fb { font-size: .76rem; color: var(--rh-info); }
.rh-recipe-fb-warn { color: var(--rh-warn); }

/* Phase M — asset-fetch escalation controls in the recipe panel. */
/* Dashboard-driven email modal (demand-check + order brief) */
.rh-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 1000; overflow-y: auto; }
.rh-modal { background: var(--rh-card); color: var(--rh-text); border: 1px solid var(--rh-border); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.35); width: 100%; max-width: 640px; padding: 22px 24px; }
.rh-modal h3 { margin: 0 0 4px; font-size: 1.05rem; }
.rh-demand-from { margin: 0 0 14px; font-size: .76rem; color: var(--rh-muted); }
.rh-demand-warn { margin: 0 0 12px; font-size: .8rem; color: var(--rh-warn); }
.rh-demand-field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .82rem; }
.rh-demand-field > span { flex: 0 0 64px; color: var(--rh-muted); }
.rh-demand-field input { flex: 1 1 auto; padding: 5px 8px; font-size: .85rem; border: 1px solid var(--rh-border); border-radius: 4px; background: var(--rh-card); color: var(--rh-text); }
.rh-demand-body { width: 100%; box-sizing: border-box; margin: 6px 0 12px; padding: 10px; font-family: var(--rh-font-mono, monospace); font-size: .82rem; line-height: 1.5; border: 1px solid var(--rh-border); border-radius: 4px; background: var(--rh-card); color: var(--rh-text); resize: vertical; }
.rh-demand-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.rh-demand-fb { margin-right: auto; font-size: .8rem; color: var(--rh-info); }
.rh-demand-fb-warn { color: var(--rh-danger); }
.rh-wl-demand-btn { margin-left: auto; font-size: .74rem; padding: 2px 10px; border: 1px solid var(--rh-info-border); background: var(--rh-info-bg); color: var(--rh-info); border-radius: 4px; cursor: pointer; }
.rh-wl-demand-btn:hover { background: color-mix(in srgb, var(--rh-info-border) 18%, var(--rh-card)); }
.rh-wl-brief-btn { font-size: .72rem; padding: 2px 8px; border: 1px solid var(--rh-success-border); background: var(--rh-success-bg); color: var(--rh-success); border-radius: 4px; cursor: pointer; white-space: nowrap; }
.rh-wl-brief-btn:hover { background: color-mix(in srgb, var(--rh-success-border) 18%, var(--rh-card)); }
.rh-brief-banner { margin: 0 0 12px; padding: 8px 12px; border-radius: 5px; font-size: .82rem; border: 1px solid var(--rh-border); }
.rh-brief-ok { background: var(--rh-success-bg); border-color: var(--rh-success-border); color: var(--rh-success); }
.rh-brief-warn { background: var(--rh-warn-bg); border-color: var(--rh-warn-border); color: var(--rh-warn); }
.rh-wl-label { display: flex; align-items: center; gap: 10px; }
.rh-recipe-copy { margin-top: 8px; font-size: .76rem; }
.rh-recipe-copy > summary { cursor: pointer; color: var(--rh-info); font-weight: 600; padding: 2px 0; }
.rh-recipe-copy-body { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rh-recipe-copy-list { display: flex; flex-wrap: wrap; gap: 4px 12px; flex-basis: 100%; }
.rh-recipe-copy-item { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--rh-text); }
.rh-recipe-esc { margin-top: 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--rh-info-border) 35%, var(--rh-border)); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rh-recipe-esc-lab { font-size: .72rem; color: var(--rh-muted); }
.rh-recipe-esc-btn { font-size: .74rem; padding: 2px 8px; border: 1px solid var(--rh-warn-border); background: var(--rh-warn-bg); color: var(--rh-warn); border-radius: 4px; cursor: pointer; }
.rh-recipe-esc-btn:hover { background: color-mix(in srgb, var(--rh-warn-border) 18%, var(--rh-card)); }
.rh-recipe-esc-preview { flex-basis: 100%; margin-top: 6px; padding: 8px; background: var(--rh-card); border: 1px solid color-mix(in srgb, var(--rh-warn-border) 45%, var(--rh-border)); border-radius: 4px; font-family: var(--rh-font-mono, monospace); font-size: .72rem; white-space: pre-wrap; color: var(--rh-text); }

/* =============================================================================
   Vivier — catalog-gap references for the exclusively-distributed labels.
   Uses ONLY --rh-* tokens, which body.label-light.repress-hunter-page redefines,
   so light mode works with no per-selector override (Ben 2026-06-07).
   ============================================================================= */
.rh-vivier-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.rh-vivier-head h2 { margin: 0 0 4px; color: var(--rh-text); }
.rh-vivier-head p { margin: 0; color: var(--rh-muted); font-size: .82rem; max-width: 64ch; }
.rh-vivier-head code { font-family: var(--rh-font-mono, monospace); font-size: .78rem; background: var(--rh-chip-neutral-bg); border: 1px solid var(--rh-chip-neutral-border); border-radius: 3px; padding: 0 4px; color: var(--rh-text); }
.rh-vivier-actions { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.rh-vivier-knob { display: flex; flex-direction: column; gap: 3px; font-size: .72rem; color: var(--rh-muted); text-transform: uppercase; letter-spacing: .03em; }
.rh-vivier-knob input { width: 84px; padding: 5px 7px; border: 1px solid var(--rh-border); background: var(--rh-input); color: var(--rh-text); border-radius: 5px; font-size: .82rem; }
.rh-vivier-summary { color: var(--rh-muted); font-size: .8rem; font-family: var(--rh-font-mono, monospace); margin-bottom: 14px; }
.rh-vivier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.rh-vivier-card { border: 1px solid var(--rh-border); background: var(--rh-card); border-radius: 9px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--rh-shadow, none); }
.rh-vivier-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.rh-vivier-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rh-vivier-card-name { font-weight: 600; font-size: .96rem; color: var(--rh-text); text-decoration: none; }
.rh-vivier-card-name:hover { text-decoration: underline; }
.rh-vivier-chip { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: var(--rh-chip-neutral-bg); border: 1px solid var(--rh-chip-neutral-border); color: var(--rh-muted); }
.rh-vivier-discogs { font-size: .72rem; color: var(--rh-info); text-decoration: none; }
.rh-vivier-discogs:hover { text-decoration: underline; }
.rh-vivier-card-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.rh-vivier-stat { font-size: .78rem; font-family: var(--rh-font-mono, monospace); color: var(--rh-text); }
.rh-vivier-stat-muted { color: var(--rh-muted); }
.rh-vivier-stat-hot { color: var(--rh-accent-emphasis); font-weight: 600; }
.rh-vivier-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rh-vivier-preview, .rh-vivier-card-gaps { display: flex; flex-direction: column; gap: 6px; }
.rh-vivier-card-gaps:empty { display: none; }
.rh-vivier-ref { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--rh-border); border-radius: 6px; background: var(--rh-card-raised, var(--rh-card)); }
.rh-vivier-ref-cover { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.rh-vivier-ref-meta { flex: 1; min-width: 0; }
.rh-vivier-ref-title { font-size: .82rem; color: var(--rh-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-vivier-ref-sub { font-size: .7rem; color: var(--rh-muted); font-family: var(--rh-font-mono, monospace); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-vivier-ref-title .rh-card-badge { margin-right: .4rem; vertical-align: middle; }
.rh-vivier-ref-known { font-size: .68rem; color: #b45309; margin-top: 2px; }
body.label-light .rh-vivier-ref-known { color: #92400e; }
.rh-vivier-ref-stats { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rh-vivier-ref-median { font-size: .82rem; font-weight: 600; color: var(--rh-accent-emphasis); font-family: var(--rh-font-mono, monospace); }
.rh-vivier-ref-wh { font-size: .7rem; color: var(--rh-muted); font-family: var(--rh-font-mono, monospace); }
.rh-vivier-ref-link { font-size: .7rem; color: var(--rh-info); text-decoration: none; }
.rh-vivier-ref-link:hover { text-decoration: underline; }

/* Order-brief rescan + wishlist readiness board + demand reply badge (2026-06-08 Phase 2) */
.rh-brief-rescan { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.rh-brief-rescan-btn { font-size: .74rem; padding: 3px 10px; }
.rh-brief-rescan-fb { font-size: .74rem; color: var(--rh-muted); }
.rh-wl-board { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; padding: 8px 12px; border: 1px solid var(--rh-border); background: var(--rh-card); border-radius: 6px; }
.rh-wl-board-stat { font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rh-border); color: var(--rh-muted); }
.rh-wl-board-ok { color: var(--rh-success); border-color: var(--rh-success-border); background: var(--rh-success-bg); }
.rh-wl-board-warn { color: var(--rh-warn); border-color: var(--rh-warn-border); background: var(--rh-warn-bg); }
.rh-wl-board-resolve { margin-left: auto; font-size: .74rem; padding: 3px 10px; }
.rh-wl-board-fb { font-size: .74rem; color: var(--rh-muted); }
.rh-wl-demand-badge { font-size: .72rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rh-border); background: var(--rh-card); color: var(--rh-muted); cursor: pointer; }
.rh-wl-demand-badge:hover { border-color: var(--rh-accent-emphasis); }
.rh-wl-demand-yes { color: var(--rh-success); border-color: var(--rh-success-border); background: var(--rh-success-bg); }
.rh-wl-demand-no { color: var(--rh-warn); border-color: var(--rh-warn-border); background: var(--rh-warn-bg); }
.rh-wl-demand-awaiting { color: var(--rh-info); border-color: var(--rh-info-border); background: var(--rh-info-bg); }

/* "Validé label" one-click marker on the wishlist row (2026-06-08) */
.rh-wl-valid-btn { font-size: .72rem; padding: 2px 9px; border-radius: 4px; border: 1px solid var(--rh-border); background: var(--rh-card); color: var(--rh-muted); cursor: pointer; white-space: nowrap; }
.rh-wl-valid-btn:hover { border-color: var(--rh-success-border); }
.rh-wl-valid-btn:disabled { cursor: default; opacity: .9; }
.rh-wl-valid-on { color: var(--rh-success); border-color: var(--rh-success-border); background: var(--rh-success-bg); font-weight: 600; }

/* ── W2/W4/W5 (2026-06-11) — brief PJ note · spec editor in modal · Learning · Validation ── */
/* Tokens only (--rh-*) → light/dark parity for free (label-light.css mapping). */

/* W2 — invoice-PDF note + structured spec editor inside the brief modal */
.rh-brief-pj { font-size: .76rem; color: var(--rh-success); margin: 0 0 8px; }
.rh-brief-pj:empty { display: none; margin: 0; }
.rh-brief-specs { margin: 0 0 12px; border: 1px solid var(--rh-border); border-radius: 6px; background: var(--rh-card); }
.rh-brief-specs > summary { font-size: .78rem; font-weight: 600; padding: 7px 12px; cursor: pointer; color: var(--rh-muted); }
.rh-brief-specs[open] > summary { color: var(--rh-text); border-bottom: 1px solid var(--rh-border); }
.rh-brief-specs .rh-recipe-body { padding: 10px 12px; }

/* W4 — Learning loop list (maintenance view) + diff modal lines */
.rh-learning-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; padding: 8px 12px; border: 1px solid var(--rh-border); border-radius: 6px; background: var(--rh-card); margin: 0 0 8px; cursor: pointer; font-size: .8rem; }
.rh-learning-row:hover { border-color: var(--rh-accent-emphasis); }
.rh-learning-meta { color: var(--rh-muted); font-size: .74rem; }
.rh-learning-chip { font-size: .68rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rh-border); }
.rh-learning-open { color: var(--rh-info); border-color: var(--rh-info-border); background: var(--rh-info-bg); }
.rh-learning-finalized { color: var(--rh-success); border-color: var(--rh-success-border); background: var(--rh-success-bg); }
.rh-learning-cancelled, .rh-learning-lost { color: var(--rh-warn); border-color: var(--rh-warn-border); background: var(--rh-warn-bg); }
.rh-learning-diff-line { font-family: var(--rh-font-mono); font-size: .74rem; margin: 2px 0; color: var(--rh-text); }

/* W5 — Validation tab (per-label cards + per-SKU rows + manual storage-site entry) */
.rh-validation-label { margin: 0 0 16px; }
.rh-validation-chip { font-size: .68rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rh-border); margin-left: 8px; vertical-align: middle; color: var(--rh-text); }
.rh-validation-sku { cursor: default; }
.rh-validation-sku:hover { border-color: var(--rh-border); }
.rh-validation-seed { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.rh-validation-seed input { font-size: .72rem; padding: 3px 7px; border: 1px solid var(--rh-border); border-radius: 4px; background: var(--rh-bg); color: var(--rh-text); }
.rh-validation-seed button { font-size: .74rem; padding: 3px 9px; }
