/* ====================================================================
   HCMC BROCHURE APP — GLOBAL SPECIFICATION STYLESHEET
   Style ID: HCMC-STYLE-v1.0
   Brand Posture: Military-medal, squared-corner, crisp, restrained
   ==================================================================== */

:root {
  /* HSL Color System */
  --navy: hsl(213, 68%, 15%);         /* #0c2340 */
  --navy-light: hsl(213, 68%, 22%);   /* Lighter interactive navy */
  --navy-deep: hsl(213, 68%, 8%);     /* Deep rich panels */
  
  --red: hsl(353, 68%, 41%);          /* #b22234 */
  --red-hover: hsl(353, 68%, 46%);    
  --red-deep: hsl(353, 68%, 31%);
  
  --gold: hsl(46, 65%, 52%);          /* #d4af37 (Brass accent) */
  --gold-dim: hsl(46, 35%, 42%);      /* Restrained gold */
  
  --slate: hsl(215, 16%, 35%);        /* #475569 */
  --slate-light: hsl(215, 20%, 65%);
  --slate-dark: hsl(215, 20%, 20%);
  
  --bg-paper: hsl(220, 15%, 97%);     /* #f7f8fa */
  --bg-white: hsl(0, 0%, 100%);
  --bg-header: hsl(213, 68%, 10%);
  
  --border-color: hsl(214, 32%, 91%); /* #e2e8f0 */
  --border-heavy: hsl(213, 68%, 15%);
  
  /* Font Families */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Calibri, sans-serif;
  --font-mono: 'Consolas', 'SF Mono', monospace;
  
  /* Spacing Scale (Strict 8-Point Grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-xxxl: 48px;
  
  /* Easing Curve */
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== RESET & BASE DEFAULTS ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-paper);
  color: var(--navy);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

input, button {
  font-family: inherit;
  font-size: inherit;
}

input:focus {
  outline: none;
}

/* ===== LAYOUT WRAPPER ===== */
.workspace-grid {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  height: calc(100vh - 64px - 40px); /* Subtract header and footer */
  width: 100vw;
  background-color: var(--bg-paper);
}

/* ===== TOP MENU BRIDGE ===== */
.bridge-header {
  height: 64px;
  background-color: var(--bg-header);
  border-top: 6px solid var(--red);
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  color: var(--bg-white);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.badge-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--gold);
  background-color: var(--navy-deep);
  font-weight: 800;
  font-size: 20px;
  color: var(--gold);
}

.brand-group h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.1;
  color: var(--bg-white);
}

.brand-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background-color: var(--navy-deep);
  border: 1px solid var(--navy-light);
  padding: var(--space-xs) var(--space-md);
  font-size: 11px;
}

.indicator-dot {
  width: 6px;
  height: 6px;
  background-color: var(--slate);
}

.indicator-dot.active {
  background-color: var(--gold);
  box-shadow: 0 0 4px var(--gold);
}

.user-name {
  font-weight: 700;
  letter-spacing: 0.05em;
}

.user-id {
  font-family: var(--font-mono);
  color: var(--gold);
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: inherit;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 120ms var(--ease-premium);
}

.header-logout {
  border-color: var(--red);
  color: var(--bg-white);
  background-color: var(--red-deep);
}

.header-logout:hover {
  background-color: var(--red);
}

/* ===== LEFT CONTROL PANEL ===== */
.control-panel {
  background-color: var(--navy-deep);
  color: var(--bg-paper);
  border-right: 2px solid var(--navy);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.panel-section-title {
  background-color: var(--navy);
  border-bottom: 1px solid var(--navy-light);
  color: var(--bg-white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  padding: var(--space-md) var(--space-lg);
  border-left: 4px solid var(--gold);
}

.search-wrap {
  position: relative;
  padding: var(--space-md);
  border-bottom: 1px solid var(--navy-light);
}

.search-wrap input {
  width: 100%;
  background-color: var(--navy-deep);
  border: 1px solid var(--navy-light);
  color: var(--bg-white);
  padding: 8px 12px;
  padding-right: 48px;
  font-size: 12px;
  border-radius: 0;
}

.search-wrap input::placeholder {
  color: var(--slate-light);
}

.search-mono-hint {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--slate-light);
  border: 1px solid var(--navy-light);
  padding: 2px 4px;
  background-color: var(--navy);
}

.filter-accordion {
  flex: 1;
  overflow-y: auto;
}

.filter-group {
  border-bottom: 1px solid var(--navy-light);
}

.filter-title {
  padding: var(--space-md) var(--space-lg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  background-color: var(--navy-deep);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-options {
  padding: var(--space-sm) var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background-color: hsl(213, 68%, 6%);
}

.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  color: var(--slate-light);
  padding: 4px 0;
}

.checkbox-wrap:hover {
  color: var(--bg-white);
}

.checkbox-wrap input {
  display: none;
}

.checkbox-box {
  width: 14px;
  height: 14px;
  border: 1px solid var(--navy-light);
  background-color: var(--navy-deep);
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  transition: all 120ms var(--ease-premium);
}

.checkbox-wrap input:checked + .checkbox-box {
  background-color: var(--gold);
  border-color: var(--gold);
}

.checkbox-wrap input:checked + .checkbox-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: solid var(--navy-deep);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  line-height: 1.3;
}

/* ===== CENTER CATALOG PANEL ===== */
.catalog-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-white);
  border-right: 2px solid var(--border-color);
}

.catalog-bar {
  height: 48px;
  border-bottom: 2px solid var(--border-color);
  background-color: var(--bg-paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.catalog-stats {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--navy);
}

.ctrl-btn.text-only {
  border: none;
  color: var(--red);
  padding: 0;
  text-decoration: underline;
}

.ctrl-btn.text-only:hover {
  color: var(--red-hover);
}

.catalog-grid {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--space-lg);
  align-content: start;
}

/* ===== PRODUCT & BROCHURE CARDS ===== */
.product-card {
  border: 1px solid var(--border-color);
  background-color: var(--bg-white);
  display: flex;
  flex-direction: column;
  transition: all 150ms var(--ease-premium);
  position: relative;
}

.product-card:hover {
  border-color: var(--navy-light);
  box-shadow: 0 4px 16px rgba(12, 35, 64, 0.06);
}

.product-card-header {
  padding: var(--space-md) var(--space-md) var(--space-xs);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.product-sku {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--slate-light);
  letter-spacing: 0.05em;
  display: block;
}

.product-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 2px;
}

.product-mfg {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-xs);
}

.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border-color);
}

.badge.red-pill {
  border-color: var(--red);
  color: var(--red);
  background-color: hsl(353, 68%, 98%);
}

.badge.gold-pill {
  border-color: var(--gold);
  color: var(--gold-dim);
  background-color: hsl(46, 65%, 98%);
}

/* GREEN = brochure ready in Drive — distinct from gold (used elsewhere for branding accents). */
.badge.green-pill {
  border-color: #15803d;
  color: #15803d;
  background-color: hsl(142, 76%, 96%);
}

/* AMBER = awaiting manufacturer brochure — clearly different from green so reps can spot the gap. */
.badge.amber-pill {
  border-color: #b45309;
  color: #b45309;
  background-color: hsl(38, 92%, 95%);
}

/* === Custom scrollbars — gold permanent, no blue-on-navy invisibility (Aaron 2026-06-01) === */
* { scrollbar-color: #d4af37 #07182b; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: #07182b; }
*::-webkit-scrollbar-thumb { background: #d4af37; border-radius: 2px; border: 2px solid #07182b; }
*::-webkit-scrollbar-thumb:hover { background: #f0c850; }
*::-webkit-scrollbar-corner { background: #07182b; }

/* === Regulatory class chips (added 2026-06-01 after WebFetch verification pass) === */
.badge.reg-510k     { border-color: #15803d; color: #15803d; background-color: hsl(142, 76%, 96%); }
.badge.reg-pma      { border-color: #1e40af; color: #1e40af; background-color: hsl(217, 91%, 96%); }
.badge.reg-361      { border-color: #92400e; color: #92400e; background-color: hsl(38, 85%, 96%); }
.badge.reg-classi   { border-color: #1e3a8a; color: #1e3a8a; background-color: hsl(225, 73%, 97%); }
.badge.reg-classi-exempt { border-color: #64748b; color: #475569; background-color: hsl(210, 20%, 96%); }
.badge.reg-classii  { border-color: #5b21b6; color: #5b21b6; background-color: hsl(266, 60%, 97%); }
.badge.reg-classiii { border-color: #9f1239; color: #9f1239; background-color: hsl(340, 75%, 97%); }
.badge.reg-noreg    { border-color: #475569; color: #475569; background-color: hsl(210, 20%, 96%); }
.badge.reg-unk      { border-color: #991b1b; color: #991b1b; background-color: hsl(0, 75%, 97%); }
.badge.reg-other    { border-color: #475569; color: #475569; background-color: hsl(220, 13%, 96%); }

/* FDA 510(k) chip — clickable link to FDA record */
.badge.fda-k {
  background: #0c2340;
  color: #d4af37;
  border-color: #d4af37;
  font-family: 'Consolas', monospace;
  text-decoration: none;
  cursor: pointer;
}
.badge.fda-k:hover { background: #d4af37; color: #0c2340; }

/* ClinicalTrials.gov NCT pill — verified study reference */
.badge.nct-pill {
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
  font-family: 'Consolas', monospace;
  text-decoration: none;
  cursor: pointer;
}
.badge.nct-pill:hover { background: #10b981; color: #fff; }

/* HCPCS reimbursement code chip — gold-on-navy, doctors scan this BEFORE FDA class */
.badge.hcpcs-pill {
  background: #fffbea;
  color: #5b4a14;
  border-color: #d4af37;
  font-family: 'Consolas', monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* NEW pulse — FDA-cleared within the last 12 months. Pulse animation = sales conversation hook. */
.badge.new-pulse {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
  font-weight: 800;
  letter-spacing: 0.08em;
  animation: hcmc-new-pulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(22,163,74,0.45);
}
@keyframes hcmc-new-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,0.55); transform: scale(1); }
  50%  { box-shadow: 0 0 0 6px rgba(22,163,74,0); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .badge.new-pulse { animation: none; }
}

.product-card-body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 11px;
}

.product-spec-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}

.spec-label {
  color: var(--slate);
  font-weight: 600;
}

.spec-val {
  font-weight: 700;
  text-align: right;
}

.product-card-footer {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-paper);
}

.brochure-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brochure-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  font-size: 11px;
}

.brochure-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.brochure-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--slate);
}

.add-btn {
  background-color: var(--navy);
  color: var(--bg-white);
  border: none;
  font-weight: 700;
  font-size: 9px;
  padding: 2px 8px;
  cursor: pointer;
  transition: background 120ms;
}

.add-btn:hover {
  background-color: var(--red);
}

.add-btn.added {
  background-color: var(--gold);
  color: var(--navy-deep);
}

/* ===== RIGHT DISPATCH CART DRAWER ===== */
.dispatch-drawer {
  background-color: var(--bg-paper);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-left: 2px solid var(--border-color);
  padding: 0;
  /* Hard clamp so no child can push the right column wider than its grid track */
  min-width: 0;
  max-width: 340px;
  box-sizing: border-box;
}

.cart-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border-bottom: 2px solid var(--border-color);
}

.empty-cart-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 120px;
  border: 1px dashed var(--slate-light);
  color: var(--slate);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  gap: var(--space-sm);
}

.empty-state-dash {
  width: 24px;
  height: 2px;
  background-color: var(--slate);
}

.cart-item {
  background-color: var(--bg-white);
  border: 1px solid var(--navy-light);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  border-left: 4px solid var(--gold);
  position: relative;
}

.cart-item-title {
  font-size: 11px;
  font-weight: 800;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--slate);
}

.remove-cart-item {
  position: absolute;
  right: 12px;
  top: 8px;
  background: none;
  border: none;
  color: var(--red);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

/* Dispatch Form inputs */
.dispatch-form-group {
  padding: var(--space-lg);
  background-color: var(--bg-white);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  /* Column flex defaults min-width:auto which lets children push parent wider;
     min-width:0 + max-width:100% + box-sizing:border-box keeps the warning card
     and platinum attestation INSIDE the 340px drawer column. */
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.dispatch-form-group label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--slate);
}

.dispatch-form-group input {
  width: 100%;
  border: 1px solid var(--border-color);
  padding: 8px var(--space-sm);
  font-size: 12px;
}

.dispatch-form-group input:focus {
  border-color: var(--navy);
}

.compliance-warning-card {
  border: 1px solid var(--red);
  background-color: hsl(353, 68%, 98%);
  padding: var(--space-sm) var(--space-md);
  font-size: 9px;
  line-height: 1.45;
  /* Same overflow guards as .platinum-attestation got 2026-06-01.
     Without these the always-visible compliance message overflows the
     dispatch drawer's right edge when Platinum is staged. */
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.compliance-warning-card p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.warning-header {
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.action-btn {
  background-color: var(--navy);
  color: var(--bg-white);
  border: none;
  padding: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 120ms;
}

.action-btn:hover:not(:disabled) {
  background-color: var(--red);
}

.action-btn:disabled {
  background-color: var(--border-color);
  color: var(--slate-light);
  cursor: not-allowed;
  border-color: var(--border-color);
}

/* Secure share result styling */
.dispatch-result-card {
  padding: var(--space-lg);
  border-top: 2px solid var(--gold);
  background-color: hsl(213, 68%, 8%);
  color: var(--bg-white);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.result-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.success-green {
  background-color: hsl(142, 70%, 45%);
}

.link-display {
  display: flex;
  gap: 4px;
}

.link-display input {
  flex: 1;
  background-color: var(--navy-deep);
  border: 1px solid var(--navy-light);
  color: var(--bg-white);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 6px;
}

.btn-square {
  background-color: var(--gold);
  border: none;
  color: var(--navy-deep);
  font-weight: 800;
  padding: 6px 12px;
}

.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  background-color: var(--bg-white);
  padding: var(--space-md);
  border: 2px solid var(--gold);
}

/* Bigger QR so the demo screenshot reads cleanly at a glance.
   The center logo overlay sits inside ~22% of the area; Reed-Solomon error
   correction (~30%) on the real QR will absorb that. */
.qr-canvas-wrap svg {
  width: 260px;
  height: 260px;
}

.qr-explanation {
  font-size: 9px;
  color: var(--slate-light);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

/* ===== FOOTER AUDIT ===== */
.bridge-footer {
  height: 40px;
  background-color: var(--navy-deep);
  border-top: 1px solid var(--navy);
  color: var(--slate-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 100;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--gold);
}

.status-indicator.secure {
  background-color: hsl(142, 70%, 45%);
  box-shadow: 0 0 4px hsl(142, 70%, 45%);
}

/* Scrollbars Spec */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--navy-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--navy-light);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ============================================================
   HCMC EXTENSIONS — added 2026-05-26 (Platinum gate, spec tags,
   Drive folder link, cart item style, attestation checkbox)
   ============================================================ */

/* Platinum doctor-must-ask banner — sits at top of product card */
.platinum-card { border-color: #b22234 !important; box-shadow: 0 0 0 1px #b22234 inset, 0 6px 16px rgba(178,34,52,0.12); }
.platinum-banner {
  background: linear-gradient(180deg, #b22234 0%, #8e1b29 100%);
  color: #fff;
  padding: 6px 14px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-top: 1px solid rgba(212,175,55,0.6);
}

/* Specialty pills inside product spec rows */
.spec-tag {
  display: inline-block;
  background: rgba(12,35,64,0.06);
  color: #0c2340;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 2px;
  margin: 0 3px 3px 0;
}

/* Open-in-Drive link on product card footer */
.open-drive-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #b22234;
  text-decoration: none;
  margin-right: auto;
}
.open-drive-link:hover { color: #0c2340; }

/* Cart items — staged for share bundle */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #0c2340;
  margin-bottom: 8px;
  border-radius: 2px;
}
.cart-item-mfg {
  font-family: 'Oswald', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: #b22234;
  text-transform: uppercase;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cart-item-name {
  font-family: 'Outfit', sans-serif;
  color: #0c2340;
  font-weight: 600;
  margin-top: 2px;
  font-size: 0.92rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cart-item-file {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cart-item-info {
  min-width: 0;
  flex: 1 1 auto;
}
.cart-item-flag {
  margin-top: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #b22234;
  text-transform: uppercase;
}
.cart-remove {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.cart-remove:hover { color: #b22234; border-color: #b22234; }

/* Platinum attestation checkbox — appears in dispatch drawer when Platinum staged.
   CRITICAL fixes 2026-06-01: the span containing the message used to overflow the
   dispatch drawer's right edge. Added `min-width:0` + `flex:1` to the message span
   so it wraps inside the flex parent. Also `width:100%; box-sizing:border-box` on
   the container so it never grows past the drawer. */
/* 2026-06-08 rebuild: flex was failing to honor min-width:0 in some Chrome
   versions, letting the message text overflow the dispatch drawer's right
   edge. Switched to CSS grid with a 1fr message column — grid enforces the
   column constraint absolutely, the span cannot grow beyond its track. */
.platinum-attestation {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fef3c7;
  border: 1px solid #d4af37;
  border-left: 4px solid #b22234;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 0.78rem;
  color: #5b4a14;
  line-height: 1.45;
  cursor: pointer;
}
.platinum-attestation > input {
  margin-top: 2px;
  grid-column: 1;
}
.platinum-attestation > span {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

/* ============================================================
   PRODUCT CARD THUMBNAIL TILE — added 2026-05-26 late night
   Renders a styled visual anchor on every card. When real PDF
   thumbnails are available post-Sheet-rebuild, swap the gradient
   for an <img> rendered from the Worker's PDF-page-1 snapshot.
   ============================================================ */
.product-thumb {
  position: relative;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(212,175,55,0.4);
}
.product-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 12px, transparent 12px 24px),
    radial-gradient(circle at 80% 10%, rgba(212,175,55,0.20), transparent 55%);
  pointer-events: none;
}
.thumb-initial {
  position: absolute;
  top: -12px; right: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 7rem;
  font-weight: 800;
  color: rgba(212,175,55,0.14);
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
.thumb-overlay {
  position: relative;
  z-index: 2;
}
.thumb-type {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  font-weight: 600;
}
.thumb-label {
  display: inline-block;
  margin-top: 6px;
  font-family: 'Consolas', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  padding: 3px 9px;
  border-radius: 2px;
  font-weight: 700;
}
.thumb-label.ready   { background: rgba(212,175,55,0.85); color: #0c2340; }
.thumb-label.pending { background: rgba(255,255,255,0.10); color: #d4af37; border: 1px solid rgba(212,175,55,0.4); }
.thumb-action {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
}
.thumb-preview-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 12px;
  font-family: 'Consolas', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.thumb-preview-btn:hover {
  background: #d4af37;
  border-color: #d4af37;
  color: #0c2340;
}
.thumb-no-link {
  color: rgba(255,255,255,0.45);
  font-family: 'Consolas', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  font-style: italic;
}

/* ============================================================
   PREVIEW MODAL — iframe embed of the Drive folder
   ============================================================ */
.preview-modal {
  position: fixed; inset: 0;
  display: none;
  z-index: 9999;
}
.preview-modal.open { display: block; }
.preview-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(7,18,38,0.78);
  backdrop-filter: blur(4px);
}
.preview-modal-box {
  position: relative;
  width: min(960px, 92vw);
  height: min(720px, 88vh);
  margin: 4vh auto 0;
  background: #fff;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  border-top: 3px solid #b22234;
}
.preview-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f7f8fa;
}
.preview-modal-mfr {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #b22234;
  text-transform: uppercase;
  font-weight: 700;
}
.preview-modal-product {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: #0c2340;
  font-size: 1.1rem;
  margin-top: 2px;
}
.preview-modal-close {
  background: transparent;
  border: 1px solid #e2e8f0;
  width: 32px; height: 32px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  color: #475569;
  font-family: inherit;
}
.preview-modal-close:hover { background: #b22234; color: #fff; border-color: #b22234; }
.preview-modal-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fafbfc;
}
.preview-modal-foot {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.preview-modal-open {
  color: #b22234;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}
.preview-modal-open:hover { color: #0c2340; }
.preview-modal-stage {
  background: #0c2340;
  color: #fff;
  border: 1px solid #0c2340;
  padding: 9px 18px;
  font-family: 'Consolas', monospace;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 2px;
}
.preview-modal-stage:hover { background: #b22234; border-color: #b22234; }

/* ============================================================
   MOBILE — collapse three-pane bridge to stacked layout
   ============================================================ */
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto;
  }
  .control-panel,
  .catalog-panel,
  .dispatch-drawer {
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    max-height: none;
  }
  .bridge-header {
    padding: 14px 18px;
  }
  .bridge-header h1 { font-size: 1rem; }
  .brand-sub { display: none; }
  .header-right { gap: 10px; }
  .user-pill { font-size: 0.74rem; padding: 4px 10px; }
  .filter-accordion {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .product-thumb {
    height: 120px;
  }
  .thumb-initial { font-size: 5.4rem; }
  .preview-modal-box {
    width: 96vw;
    height: 92vh;
    margin: 2vh auto 0;
  }
}
@media (max-width: 560px) {
  .filter-accordion {
    grid-template-columns: 1fr;
  }
  .bridge-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* ============================================================
   CLARITY ROWS IN PREVIEW MODAL — added 2026-05-28
   Tells the rep exactly what the doctor receives if they STAGE,
   so seeing the full folder doesn't confuse them.
   ============================================================ */
.preview-modal-clarity {
  padding: 10px 20px;
  background: #fffbea;
  border-bottom: 1px solid #f5e6a8;
  font-size: 0.84rem;
  color: #5b4a14;
  line-height: 1.5;
}
.clarity-row { margin-bottom: 6px; }
.clarity-row:last-child { margin-bottom: 0; }
.clarity-row-action {
  background: rgba(178,34,52,0.06);
  border-left: 3px solid #b22234;
  padding: 8px 12px;
  color: #5b1018;
  margin-top: 8px;
}
.clarity-row code {
  background: #fff;
  border: 1px solid #f5e6a8;
  padding: 1px 6px;
  border-radius: 2px;
  font-family: 'Consolas', monospace;
  font-size: 0.8rem;
  color: #b22234;
  word-break: break-all;
}

/* STAGE button toggle state */
.preview-modal-stage.staged {
  background: #b22234;
  border-color: #b22234;
}
.preview-modal-stage.staged:hover {
  background: #0c2340;
  border-color: #0c2340;
}

/* Cart item — filename shown so rep sees exactly what doctor gets */
.cart-item-file {
  margin-top: 3px;
  font-family: 'Consolas', monospace;
  font-size: 0.72rem;
  color: #475569;
  word-break: break-all;
}

/* Dispatch close button — added 2026-05-28
   Sits in the top-right of the dispatch-result panel so the rep can dismiss
   the QR overlay and continue editing the cart. */
.dispatch-result-card { position: relative; }
.dispatch-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(178,34,52,0.10);
  border: 1px solid rgba(178,34,52,0.4);
  color: #b22234;
  font-size: 1.2rem;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}
.dispatch-close-btn:hover { background: #b22234; color: #fff; }
