/* ==========================================================================
   FlipPnL™ - Interactive Calculator Stylesheet (Unit Economics, Floors & Lots)
   ========================================================================== */

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.calc-section {
  padding: 30px 0 0;
  margin-bottom: 0 !important;
  position: relative;
}

/* Rigid two-column workbench layout on desktop */
.calc-workbench {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 24px !important;
  align-items: start !important; /* Prevents output pane from stretching unnaturally with tall input content */
  width: 100% !important;
  overflow: hidden;
  position: relative;
  transition: border-color var(--transition-smooth);
  box-sizing: border-box !important;
}

.calc-workbench:hover {
  border-color: var(--border-hover);
}

/* Ensure child panes cannot force width expansion */
.calc-input-pane,
.calc-output-pane {
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* --------------------------------------------------------------------------
   Left Pane: Inputs & Configuration
   -------------------------------------------------------------------------- */
.calc-input-pane {
  padding: 32px 28px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg-surface);
  height: 100% !important; /* Ensures right border line extends to bottom */
  box-sizing: border-box !important;
}

.calc-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.calc-pane-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Simple vs Pro Mode Segment Toggle */
.mode-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mode-pill-group {
  display: inline-flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border);
  gap: 2px;
}

.btn-mode {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
}

.btn-mode:hover {
  color: var(--text-primary);
}

.btn-mode.active {
  background: var(--accent-emerald);
  color: #070c1a;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

/* Pro Logistics Section */
.pro-logistics-card,
.calc-grid .pro-logistics-card,
#proLogisticsSection {
  grid-column: span 2 !important;
  width: 100% !important;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-surface-elevated);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box !important;
  transition: all var(--transition-smooth);
}

.pro-logistics-card .pro-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  width: 100%;
}

.pro-logistics-card .calc-field-row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px;
  margin-top: 4px;
  width: 100%;
}

.pro-logistics-card .calc-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.pro-logistics-card .calc-input {
  padding: 10px 12px !important;
  font-size: 0.95rem;
  min-height: 44px;
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 600px) {
  .pro-logistics-card .calc-field-row {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
}

.calc-label-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.effective-cogs-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

/* Simple Mode Hidden Rules (Smooth Layout Adaptation) */
.calc-workbench.simple-mode .pro-logistics-card,
.calc-workbench.simple-mode #proLogisticsSection,
.calc-workbench.simple-mode .mode-toggle-card,
.calc-workbench.simple-mode #batch-lot-inputs,
.calc-workbench.simple-mode #batch-recovery-card,
.calc-workbench.simple-mode .target-margin-card,
.calc-workbench.simple-mode .pricing-floors-card,
.calc-workbench.simple-mode .tax-reserve-field-group,
.calc-workbench.simple-mode #calc-tax-reserve-group,
.calc-workbench.simple-mode #waterfallPrepRow,
.calc-workbench.simple-mode #ledger-tax-row,
.calc-workbench.simple-mode #ledger-retained-row,
.calc-workbench.simple-mode #micro-tax-disclaimer {
  display: none !important;
}

/* Marketplace Tab Selector */
.platform-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--bg-input);
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .platform-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

.platform-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.platform-tab-btn:hover {
  color: var(--text-primary);
}

.platform-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.platform-tab-btn.active.amazon {
  border-bottom: 2px solid var(--badge-amazon);
  color: #ffb84d;
}

.platform-tab-btn.active.ebay {
  border-bottom: 2px solid var(--badge-ebay);
  color: #93c5fd;
}

.platform-tab-btn.active.mercari {
  border-bottom: 2px solid var(--badge-mercari);
  color: #fca5a5;
}

/* Payout Velocity & Cash Flow Lag Factor */
.payout-velocity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  background: var(--bg-surface-elevated, #131f42);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-sm, 8px);
  padding: 8px 12px;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  position: relative;
  transition: all 0.2s ease;
}

.payout-velocity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.payout-velocity-icon {
  font-size: 0.95rem;
}

.payout-velocity-label {
  color: var(--text-muted, #64748b);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.payout-velocity-text {
  color: var(--text-primary, #f8fafc);
  font-size: 0.82rem;
  font-weight: 700;
}

.payout-velocity-info-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.payout-velocity-sub {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.74rem;
  white-space: normal;
}

.payout-info-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border, #1e293b);
  color: var(--text-muted, #94a3b8);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.payout-info-btn:hover {
  background: var(--accent-emerald, #10b981);
  color: #070c1a;
  border-color: var(--accent-emerald, #10b981);
}

.payout-velocity-popover {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--bg-surface, #0b132b);
  border: 1px solid var(--border, #334155);
  border-radius: var(--radius-md, 10px);
  padding: 12px 14px;
  z-index: 50;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payout-velocity-popover.hidden {
  display: none;
}

.payout-popover-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan, #38bdf8);
}

.payout-popover-desc {
  font-size: 0.76rem;
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.4;
  margin: 0;
}

/* Multi-Channel Scoreboard Matrix Payout Velocity Badges */
.matrix-velocity-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.matrix-velocity-pill.fast {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.matrix-velocity-pill.medium {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.matrix-velocity-pill.slow {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

@media (max-width: 820px) {
  .payout-velocity-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .payout-velocity-info-wrap {
    width: 100%;
    justify-content: space-between;
  }
}

/* Mode Switch: Single Item vs Batch Lot */
.mode-toggle-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-emerald-glow);
  border-color: var(--accent-emerald);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: var(--accent-emerald);
}

/* Batch Lot Inputs Container */
.batch-lot-box {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease-in-out;
}

.batch-lot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.per-unit-cogs-chip {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

/* Pallet & Wholesale Friction Breakdown */
.batch-landed-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.pallet-friction-toggle-wrap {
  margin-top: 4px;
}

.btn-pallet-friction-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--accent-cyan);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.btn-pallet-friction-toggle:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
}

.pallet-toggle-icon {
  font-size: 0.95rem;
}

.pallet-friction-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-block;
  transition: transform 0.2s ease;
}

.pallet-friction-arrow.expanded {
  transform: rotate(90deg);
}

.pallet-friction-drawer {
  background: rgba(7, 12, 26, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease-in-out;
}

.pallet-friction-drawer.hidden {
  display: none !important;
}

.pallet-friction-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 14px;
}

@media (max-width: 640px) {
  .pallet-friction-grid {
    grid-template-columns: 1fr;
  }
}

.pallet-friction-grid .calc-field {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.pallet-friction-grid .calc-label-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-height: 18px !important;
  margin-bottom: 2px !important;
}

.pallet-friction-grid .calc-label-micro {
  white-space: nowrap !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  margin-bottom: 0 !important;
}

.friction-fee-amt {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.friction-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.friction-chip {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.friction-chip:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.friction-chip.active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.6);
}

.pallet-waterfall-ribbon {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pallet-ribbon-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.pallet-ribbon-formula strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.ribbon-total-hl {
  color: var(--accent-emerald) !important;
  font-weight: 800;
}

.pallet-friction-tip {
  font-size: 0.68rem;
  color: var(--accent-amber);
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 4px;
}

/* Isolated 50/50 Row */
.sourcing-row-50-50 {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 12px !important;
}

.sourcing-field-col {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  width: 50% !important;
  box-sizing: border-box !important;
}

.sourcing-field-col .calc-input-wrapper {
  width: 100% !important;
}

.sourcing-field-col .calc-input {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure Target ROI Card fills 100% of the pane */
.calc-input-pane > .target-margin-card {
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 14px !important;
}

/* Strict 50/50 two-column grid */
.calc-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure price and cost field groups share equal 50% space */
.calc-grid > .calc-field-group:not(.full-width) {
  min-width: 0 !important;
  width: 100% !important;
}

/* Target ROI card and other full-width items MUST span both columns */
.calc-grid > .target-margin-card,
.calc-grid > .full-width,
.calc-grid > .pro-logistics-card,
.calc-grid > .calc-field-row.full-width {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.calc-grid .calc-field-group .calc-input-wrapper {
  width: 100% !important;
}

.calc-grid .calc-field-group .calc-input {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Side-by-Side Flex Row for Input Pairs (Shipping + Ads, Batch Cost + Qty) */
.calc-field-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.calc-field-row .calc-field-group {
  flex: 1 1 0%;
  min-width: 0;
}

.calc-label-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-height: 22px !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  width: 100% !important;
  margin-bottom: 6px !important;
  box-sizing: border-box !important;
}

.calc-label-row .calc-label {
  margin-bottom: 0 !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  font-size: 0.78rem !important;
}

.calc-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.calc-label-tip {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cogs-badge-auto {
  display: none;
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  padding: 1px 4px !important;
  border-radius: var(--radius-sm);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.cogs-badge-auto.active {
  display: inline-flex !important;
  align-items: center !important;
}

.calc-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100% !important;
}

.calc-prefix, .calc-suffix {
  position: absolute;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.calc-prefix {
  left: 14px;
}

.calc-suffix {
  right: 14px;
}

.calc-input {
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 28px;
  min-height: 48px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.calc-input.no-prefix {
  padding: 12px 14px;
}

.calc-input.has-suffix {
  padding-left: 14px;
  padding-right: 32px;
}

.calc-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-emerald-glow);
}

.calc-input.cogs-locked {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  cursor: not-allowed;
}

.calc-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-height: 48px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  box-sizing: border-box;
}

.calc-select:focus {
  border-color: var(--border-focus);
}

.calc-helper-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Target Goal (ROI Markup on Cost up to 200%) Card */
.target-margin-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.target-margin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.target-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.preset-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 8px 6px;
  min-height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.preset-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.preset-chip.active {
  background: var(--accent-emerald-glow);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

/* Quick-Select Shipping Rate Preset Chips (Balanced 5-Column Grid) */
.shipping-preset-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
  width: 100%;
}

.shipping-chip {
  background: var(--bg-input, #0b132b);
  border: 1px solid var(--border, #1e293b);
  color: var(--text-secondary, #94a3b8);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.shipping-chip:hover {
  color: var(--text-primary, #f8fafc);
  border-color: var(--border-hover, #38bdf8);
  background: var(--bg-surface-hover, #1e293b);
}

.shipping-chip.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald, #10b981);
  color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

@media (max-width: 580px) {
  .shipping-preset-chips {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 380px) {
  .shipping-preset-chips {
    grid-template-columns: repeat(2, 1fr);
  }
}

[data-theme="light"] .shipping-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #475569;
}

[data-theme="light"] .shipping-chip:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .shipping-chip.active {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

/* --------------------------------------------------------------------------
   Weight & DIM Estimator Drawer (100% Non-Blocking)
   -------------------------------------------------------------------------- */
.ship-dim-toggle-wrap {
  width: 100%;
}

.ship-dim-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

@media (max-width: 540px) {
  .ship-dim-grid {
    grid-template-columns: 1fr;
  }
}

.ship-dim-result-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.76rem;
}

.ship-dim-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--accent-cyan, #38bdf8);
  font-size: 0.76rem;
}

.ship-dim-badge.dim-warning {
  color: var(--accent-amber, #f59e0b);
}

/* Light Mode Overrides for Weight & DIM Estimator */
[data-theme="light"] .ship-dim-result-strip {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .ship-dim-badge {
  color: #0284c7;
}

[data-theme="light"] .ship-dim-badge.dim-warning {
  color: #b45309;
}

/* --------------------------------------------------------------------------
   Multi-Pack Margin Opportunity Banner (Conditional)
   -------------------------------------------------------------------------- */
.bundle-opportunity-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 3.5px solid var(--accent-amber, #f59e0b);
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  margin-bottom: 12px;
  animation: fadeIn 0.25s ease;
}

.bundle-opportunity-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.bundle-opportunity-icon {
  font-size: 1rem;
  line-height: 1;
}

.bundle-opportunity-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-amber, #f59e0b);
}

.bundle-opportunity-text {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary, #cbd5e1);
  margin: 0;
}

.bundle-opportunity-text strong {
  color: var(--text-primary, #f8fafc);
}

.bundle-opportunity-text .hl-profit {
  color: var(--accent-emerald, #10b981);
  font-weight: 700;
}

.bundle-opportunity-text .hl-amber {
  color: var(--accent-amber, #f59e0b);
  font-weight: 700;
}

/* Light Mode Overrides for Multi-Pack Opportunity Banner */
[data-theme="light"] .bundle-opportunity-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: rgba(245, 158, 11, 0.45);
  border-left: 3.5px solid #d97706;
}

[data-theme="light"] .bundle-opportunity-title {
  color: #b45309;
}

[data-theme="light"] .bundle-opportunity-text {
  color: #334155;
}

[data-theme="light"] .bundle-opportunity-text strong {
  color: #0f172a;
}

[data-theme="light"] .bundle-opportunity-text .hl-profit {
  color: #047857;
}

[data-theme="light"] .bundle-opportunity-text .hl-amber {
  color: #b45309;
}

.margin-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.margin-slider {
  flex-grow: 1;
  height: 6px;
  accent-color: var(--accent-emerald);
  cursor: pointer;
  border-radius: 4px;
  background: var(--bg-input);
  outline: none;
}

.margin-slider-value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-emerald);
  min-width: 76px;
  text-align: right;
}

.calc-reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 12px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.calc-reset-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

/* --------------------------------------------------------------------------
   Right Pane: Live Output, High-Contrast Floors & Ledger
   -------------------------------------------------------------------------- */
.calc-output-pane {
  padding: 32px 28px;
  background: var(--bg-surface-elevated);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
}

/* Headline Profit */
.profit-headline-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  box-shadow: var(--shadow-sm);
}

.profit-primary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.profit-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profit-value {
  font-size: clamp(1.4rem, 2.5vw, 2.1rem) !important;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  line-height: 1.1;
  word-break: break-word;
}

.profit-value.negative {
  color: var(--accent-rose);
}

.profit-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.profit-health-badge.healthy {
  background: var(--accent-emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.profit-health-badge.moderate {
  background: var(--accent-amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
}

.profit-health-badge.loss {
  background: var(--accent-rose-glow);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-rose);
}

/* Dedicated High-Contrast Floor & Target Price Sub-Card */
.pricing-floors-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.pricing-floor-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 8px 12px !important;
  min-width: 0 !important;
}

.pricing-floor-row:not(:last-child) {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.pricing-floor-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.pricing-floor-title {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--text-secondary) !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px 8px !important;
  min-width: 0 !important;
}

.pricing-floor-badge {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: var(--radius-full) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Break-Even Hard Stop / Liquidation Floor Alert Treatment */
.pricing-floor-row.breakeven-floor-row {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3.5px solid #f59e0b;
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.08);
  transition: all 0.25s ease;
}

.pricing-floor-row.breakeven-floor-row.danger-alert {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 1px solid rgba(239, 68, 68, 0.55);
  border-left: 3.5px solid #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.22);
}

.breakeven-title-shield {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pricing-floor-badge.breakeven {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
  transition: all 0.2s ease;
}

.pricing-floor-badge.breakeven.danger {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

.pricing-floor-badge.target {
  background: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pricing-floor-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Price Decay / Floor Tolerance Cushion */
.floor-cushion-wrap {
  margin-top: 4px;
}

.floor-cushion-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan, #38bdf8);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
  transition: all 0.2s ease;
}

.floor-cushion-pill.safe {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.floor-cushion-pill.warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.floor-cushion-pill.danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Light Mode Overrides for Floor Cushion Pill */
[data-theme="light"] .floor-cushion-pill {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .floor-cushion-pill.safe {
  color: #047857;
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
}

[data-theme="light"] .floor-cushion-pill.warning {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .floor-cushion-pill.danger {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
}

.pricing-floor-val {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2vw, 1.45rem) !important;
  font-weight: 800;
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
}

.pricing-floor-val.breakeven-val {
  color: #fbbf24;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.pricing-floor-val.breakeven-val.danger {
  color: #f87171;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.pricing-floor-val-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.btn-icon-copy {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon-copy:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface-elevated);
}

.btn-icon-copy:active {
  transform: scale(0.95);
}

/* Secondary Metrics Bar */
.metrics-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card-value {
  font-size: clamp(1.1rem, 2vw, 1.75rem) !important;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.2;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Itemized Waterfall Ledger */
.waterfall-ledger {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ledger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

/* Zero-deduction collapse rule */
.waterfall-ledger .ledger-item.zero-hidden,
#ledgerPlatformFeeRow.zero-hidden,
#outboundShippingRow.zero-hidden,
#promotedAdsRow.zero-hidden,
#paymentProcessingRow.zero-hidden {
  display: none !important;
}

.ledger-name {
  color: var(--text-secondary);
}

.ledger-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.ledger-amount.deduction {
  color: var(--text-secondary);
}

.ledger-amount.tax-buffer {
  color: var(--accent-amber);
}

.ledger-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.ledger-item.total {
  font-size: 0.9rem;
  font-weight: 700;
}

.ledger-item.total .ledger-name {
  color: var(--text-primary);
}

.ledger-item.total .ledger-amount {
  color: var(--accent-emerald);
}

.ledger-item.total .ledger-amount.negative {
  color: var(--accent-rose);
}

.ledger-item.retained {
  background: rgba(16, 185, 129, 0.06);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.ledger-item.retained .ledger-name {
  color: var(--text-primary);
  font-weight: 700;
}

.ledger-item.retained .ledger-amount {
  color: var(--accent-emerald);
  font-weight: 800;
}

/* Micro Disclaimer */
.micro-disclaimer {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: left !important; /* Replaces ragged right alignment with natural sentence flow */
  line-height: 1.4;
  margin-top: 6px;
  opacity: 0.85;
}

/* Batch Lot Recovery Card */
.batch-recovery-card {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.batch-recovery-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  display: flex;
  justify-content: space-between;
}

.batch-recovery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 600px) {
  .batch-recovery-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.batch-stat-val {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.batch-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Summary Actions & Deal Copy */
.summary-actions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.btn-secondary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 11px 18px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  width: 100%;
}

.btn-secondary-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.15);
}

.btn-secondary-outline:active {
  transform: scale(0.99);
}

.btn-secondary-outline.copied,
.btn-secondary-outline.active {
  background: var(--accent-emerald-glow) !important;
  border-color: var(--accent-emerald) !important;
  color: var(--accent-emerald) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25) !important;
}

.copy-feedback-toast {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: var(--accent-emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  text-align: center;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.copy-feedback-toast.hidden {
  display: none;
  opacity: 0;
}

.copy-feedback-toast:not(.hidden) {
  display: flex;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Multi-Channel Arb Matrix Drawer
   -------------------------------------------------------------------------- */
.channel-matrix-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-smooth);
  margin-top: 4px;
}

.channel-matrix-container:hover {
  border-color: var(--border-hover);
}

.channel-matrix-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.channel-matrix-toggle:hover {
  background: rgba(255, 255, 255, 0.02);
}

.matrix-toggle-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.matrix-quick-summary {
  font-size: 0.74rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.toggle-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition-smooth);
}

.channel-matrix-toggle[aria-expanded="true"] .toggle-chevron,
.toggle-chevron.expanded {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

.channel-matrix-content {
  border-top: 1px solid var(--border);
  background: rgba(13, 20, 36, 0.5);
  padding: 10px 12px 14px;
  transition: all var(--transition-smooth);
}

.channel-matrix-content.hidden {
  display: none;
}

.channel-matrix-table-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.channel-matrix-table-wrapper::-webkit-scrollbar {
  height: 4px;
}

.channel-matrix-table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.channel-matrix-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.channel-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  text-align: left;
  table-layout: auto;
}

.channel-matrix-table th {
  padding: 8px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.channel-matrix-table th:first-child,
.channel-matrix-table td:first-child {
  padding-left: 8px;
}

.channel-matrix-table th:last-child,
.channel-matrix-table td:last-child {
  padding-right: 8px;
}

.channel-matrix-table th:not(:first-child),
.channel-matrix-table td:not(:first-child) {
  text-align: right;
}

.channel-matrix-table td {
  padding: 7px 5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  vertical-align: middle;
  white-space: nowrap;
}

.channel-matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.channel-name-cell {
  font-family: inherit;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.active-platform-row {
  background: rgba(56, 189, 248, 0.05);
}

.active-platform-row td {
  color: var(--text-primary);
}

.active-platform-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.matrix-net-positive {
  color: var(--accent-emerald);
  font-weight: 700;
}

.matrix-net-negative {
  color: var(--accent-rose);
  font-weight: 700;
}

.matrix-spread-pos {
  color: var(--accent-emerald);
  font-weight: 700;
}

.matrix-spread-neg {
  color: var(--accent-rose);
}

.matrix-spread-active {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.72rem;
}

.matrix-spread-even {
  color: var(--text-muted);
}

.lot-subtext {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  font-weight: 500;
  margin-top: 1px;
}

.matrix-footnote {
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 8px;
  padding-left: 2px;
}

/* --------------------------------------------------------------------------
   Recommended Reseller Gear Drawer
   -------------------------------------------------------------------------- */
.affiliate-gear-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-smooth);
  margin-top: 10px;
}

.affiliate-gear-drawer:hover {
  border-color: var(--border-hover);
}

.drawer-trigger-gear {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.drawer-trigger-gear:hover {
  background: rgba(255, 255, 255, 0.02);
}

.drawer-trigger-gear #gearArrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.affiliate-disclosure-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.gear-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .gear-grid-2x2 {
    grid-template-columns: 1fr;
  }
}

.gear-product-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.gear-product-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.gear-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.gear-badge-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  font-size: 17px;
  flex-shrink: 0;
}

.gear-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}

.gear-card-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.gear-card-cta {
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.gear-card-cta:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Divine Community Partner Callout
   -------------------------------------------------------------------------- */
.partner-callout-wrapper {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 0 16px;
}

.partner-callout-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .partner-callout-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    gap: 16px;
  }
}

.partner-callout-content {
  flex: 1 1 auto;
}

.partner-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.partner-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.partner-sub-disc {
  color: #64748b;
  font-size: 11px;
}

.partner-heading {
  color: #f8fafc;
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.partner-desc {
  color: #94a3b8;
  font-size: 13px;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.partner-perks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #cbd5e1;
}

.partner-perk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.partner-callout-action {
  flex: 0 0 auto;
}

.btn-partner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-partner-cta:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

.cta-arrow {
  font-size: 16px;
  transition: transform 0.15s ease;
}

.btn-partner-cta:hover .cta-arrow {
  transform: translateX(3px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .calc-workbench {
    grid-template-columns: 1fr;
  }
  .calc-input-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 20px;
  }
  .calc-output-pane {
    padding: 24px 20px;
  }
}

@media (max-width: 768px) {
  /* Stack Left Inputs and Right Outputs vertically */
  .calc-workbench {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    gap: 20px !important;
    box-sizing: border-box !important;
  }

  .calc-input-pane,
  .calc-output-pane {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Make Sourcing 50/50 fields and Logistics stack cleanly */
  .sourcing-row-50-50,
  .calc-field-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* Ensure button action bar wraps cleanly */
  .workbench-actions-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .workbench-actions-row button {
    flex: 1 1 calc(50% - 8px) !important;
  }

  /* Target ROI presets chips */
  .target-presets {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }

  .calc-field-group.full-width,
  .calc-field-row.full-width,
  .pro-logistics-card,
  .pro-feature-group.full-width,
  #proLogisticsSection {
    grid-column: span 1 !important;
  }

  /* Scratchpad Table Containment */
  .scratchpad-wrapper,
  .scratchpad-section {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 12px !important;
    box-sizing: border-box !important;
  }

  /* Strict horizontal scroll trap for the table */
  .scratchpad-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
  }

  .scratchpad-table {
    min-width: 620px !important; /* Preserves column spacing inside the scroll window */
  }

  .scratchpad-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .scratchpad-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

@media (max-width: 600px) {
  .channel-matrix-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding: 10px 8px 14px;
  }
  .channel-matrix-table {
    min-width: 100%;
    width: 100%;
  }
  .channel-matrix-table th,
  .channel-matrix-table td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .calc-input-pane,
  .calc-output-pane {
    padding: 18px 14px;
  }
  .profit-headline-box {
    padding: 14px 16px;
  }
  .profit-value {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
  }
  .pricing-floors-card {
    padding: 14px 16px;
  }
  .pricing-floor-val {
    font-size: clamp(1.2rem, 5vw, 1.45rem);
  }
  .waterfall-ledger {
    padding: 12px 14px;
  }
  .platform-tabs {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    padding: 3px !important;
  }
  .platform-tab-btn {
    font-size: 0.74rem !important;
    padding: 6px 2px !important;
  }
  .mode-pill-group .btn-mode {
    font-size: 0.72rem !important;
    padding: 4px 8px !important;
  }
}

@media (max-width: 420px) {
  .target-presets {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .platform-tabs {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .calc-field-row {
    flex-direction: column;
    gap: 14px;
  }
  .calc-field-row .calc-field-group {
    width: 100%;
    flex: 1 1 auto;
  }
}

/* --------------------------------------------------------------------------
   Modal Dialog & Overlay (Legal Safeguards)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(7, 12, 26, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100000 !important;
  padding: 20px !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  max-width: 500px !important;
  width: 100% !important;
  padding: 32px 28px !important;
  box-shadow: var(--shadow-lg) !important;
  position: relative !important;
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-card {
  transform: scale(1) !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-amber);
  background: var(--accent-amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.modal-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-amber);
  border-radius: 50%;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--accent-amber);
}

.modal-icon {
  width: 26px;
  height: 26px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-modal-accept {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
}

.btn-modal-cancel {
  width: 100%;
  padding: 10px;
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Recommended Reseller Gear Section (Always Visible)
   -------------------------------------------------------------------------- */
.reseller-gear-container {
  background: var(--bg-surface, #090e1d);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 16px);
  padding: 24px 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.gear-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.gear-drawer-disclosure {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
  margin-bottom: 20px;
}

[data-theme="light"] .reseller-gear-container {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .gear-drawer-disclosure {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}
  font-weight: 800;
  color: var(--text-primary);
}

.gear-disclosure-body {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.gear-disclosure-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 4-Tile Large Informative Gear Grid */
.gear-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .gear-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .gear-grid-4 {
    grid-template-columns: 1fr;
  }
}

.gear-tile-card {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-smooth, 0.25s ease);
}

.gear-tile-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gear-tile-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.gear-tile-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md, 8px);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.gear-tile-heading {
  min-width: 0;
}

.gear-tile-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.gear-tile-tag {
  font-size: 0.72rem;
  color: var(--accent-cyan, #38bdf8);
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

.gear-tile-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  flex-grow: 1;
}

.gear-tile-benefit {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg-surface, #090e1d);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 8px 10px;
  margin-bottom: 14px;
}

.gear-tile-benefit strong {
  color: var(--text-primary);
}

.btn-gear-cta {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  text-align: center;
  display: block;
  transition: all var(--transition-fast, 0.15s ease);
}

.btn-gear-cta:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Light Theme Overrides for 4-Card Gear Drawer */
[data-theme="light"] .gear-tile-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .gear-tile-benefit {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .btn-gear-cta {
  background: #f0f9ff;
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

[data-theme="light"] .btn-gear-cta:hover {
  background: #0284c7;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Partner Callout Card (Divine) - Aligned to Calculator Width
   -------------------------------------------------------------------------- */
.partner-callout-wrapper {
  width: 100%;
  max-width: var(--calculator-max-width, 1200px);
  margin-top: 36px;
  margin-bottom: 24px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  box-sizing: border-box;
}

.partner-callout-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.45);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.partner-callout-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 20px 38px -4px rgba(56, 189, 248, 0.2);
}

.partner-callout-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 500px;
}

.partner-callout-emoji {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-lg);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.partner-callout-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.partner-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.partner-subtext {
  color: var(--text-muted);
  font-size: 11px;
}

.partner-title {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.partner-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.partner-brand-text {
  color: var(--text-primary);
}

.partner-perks-row,
.partner-features {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-secondary, #cbd5e1);
}

.partner-callout-right {
  flex: 0 0 auto;
}

.partner-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-cyan);
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.partner-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

/* --------------------------------------------------------------------------
   AdSense Placement Containers
   -------------------------------------------------------------------------- */
.adsense-leaderboard-container,
.adsense-leaderboard-container ins,
.adsense-leaderboard-container iframe,
.adsense-rectangle-container,
.adsense-rectangle-container ins,
.adsense-rectangle-container iframe,
.adsbygoogle,
.adsbygoogle iframe {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.adsense-leaderboard-container {
  width: 100%;
  margin: 24px auto 0;
  text-align: center;
  overflow: hidden;
  min-height: 90px;
  background: transparent !important;
  border: none !important;
}

.adsense-rectangle-container {
  max-width: 336px;
  margin: 36px auto;
  text-align: center;
  min-height: 250px;
  background: transparent !important;
  border: none !important;
}

/* --------------------------------------------------------------------------
   Light Mode Theme Contrast Protection ([data-theme="light"])
   -------------------------------------------------------------------------- */
[data-theme="light"] .calc-workbench,
[data-theme="light"] .calc-input-pane,
[data-theme="light"] .calc-output-pane {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .calc-input,
[data-theme="light"] .calc-select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .calc-input:focus,
[data-theme="light"] .calc-select:focus {
  border-color: var(--accent-emerald);
  background: #ffffff;
}

[data-theme="light"] .metric-card,
[data-theme="light"] .pricing-floors-card,
[data-theme="light"] .waterfall-ledger,
[data-theme="light"] .pro-logistics-card,
[data-theme="light"] .channel-matrix-container,
[data-theme="light"] .mode-toggle-card,
[data-theme="light"] .target-margin-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .partner-callout-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .partner-title,
[data-theme="light"] .partner-brand-text {
  color: #0f172a;
}

[data-theme="light"] .partner-desc {
  color: #334155;
}

[data-theme="light"] .partner-perks-row,
[data-theme="light"] .partner-features {
  color: #475569 !important;
}

[data-theme="light"] .drawer-trigger-gear {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

[data-theme="light"] .drawer-trigger-gear:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .gear-drawer-content {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .gear-drawer-disclosure {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  color: #64748b;
}

[data-theme="light"] .gear-drawer-disclosure strong {
  color: #0f172a;
}

[data-theme="light"] .gear-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .gear-card:hover {
  background: #f1f5f9;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .gear-card-title {
  color: #0f172a;
}

[data-theme="light"] .gear-card-subtitle {
  color: #64748b;
}

[data-theme="light"] .gear-card-link {
  color: #0284c7;
}

[data-theme="light"] .preset-chip {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.15);
  color: #334155;
}

[data-theme="light"] .preset-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .preset-chip.active {
  background: var(--accent-emerald-glow);
  border-color: var(--accent-emerald);
  color: #047857;
}

[data-theme="light"] .btn-secondary-outline {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.18);
  color: #334155;
}

[data-theme="light"] .btn-secondary-outline:hover {
  border-color: var(--accent-cyan);
  color: #0284c7;
  background: rgba(6, 182, 212, 0.06);
}

[data-theme="light"] .channel-matrix-content {
  background: #ffffff;
}

[data-theme="light"] .channel-matrix-table td {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

/* Light Theme overrides for Break-Even Floor alert treatment */
[data-theme="light"] .pricing-floor-row.breakeven-floor-row {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  border-left: 3.5px solid #d97706 !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1) !important;
}

[data-theme="light"] .pricing-floor-row.breakeven-floor-row.danger-alert {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  border-left: 3.5px solid #dc2626 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12) !important;
}

[data-theme="light"] .breakeven-title-shield {
  color: #b45309 !important;
}

[data-theme="light"] .pricing-floor-badge.breakeven {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #92400e !important;
  border: 1px solid rgba(217, 119, 6, 0.4) !important;
}

[data-theme="light"] .pricing-floor-badge.breakeven.danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #b91c1c !important;
  border: 1px solid rgba(220, 38, 38, 0.4) !important;
}

[data-theme="light"] .pricing-floor-val.breakeven-val {
  color: #b45309 !important;
  text-shadow: none !important;
}

[data-theme="light"] .pricing-floor-val.breakeven-val.danger {
  color: #dc2626 !important;
  text-shadow: none !important;
}

/* Light Theme overrides for Batch Lot & Pallet Inbound Friction */
[data-theme="light"] .batch-lot-box {
  background: #f8fafc !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

[data-theme="light"] .btn-pallet-friction-toggle {
  background: #ffffff !important;
  border-color: rgba(14, 165, 233, 0.35) !important;
  color: #0369a1 !important;
}

[data-theme="light"] .btn-pallet-friction-toggle:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
}

[data-theme="light"] .pallet-friction-drawer {
  background: #f1f5f9 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

[data-theme="light"] .pallet-friction-grid .calc-label-micro {
  color: #475569 !important;
}

[data-theme="light"] .friction-fee-amt {
  color: #0284c7 !important;
}

[data-theme="light"] .friction-chip {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
  color: #334155 !important;
}

[data-theme="light"] .friction-chip:hover {
  border-color: #0284c7 !important;
  color: #0f172a !important;
}

[data-theme="light"] .friction-chip.active {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #0369a1 !important;
  border-color: #0284c7 !important;
}

[data-theme="light"] .pallet-waterfall-ribbon {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
}

[data-theme="light"] .pallet-ribbon-formula {
  color: #475569 !important;
}

[data-theme="light"] .pallet-ribbon-formula strong {
  color: #0f172a !important;
}

[data-theme="light"] .pallet-ribbon-formula .ribbon-total-hl {
  color: #047857 !important;
}

[data-theme="light"] .pallet-friction-tip {
  color: #b45309 !important;
  border-top-color: rgba(15, 23, 42, 0.08) !important;
}

/* Light Theme overrides for Payout Velocity Bar & Matrix Badges */
[data-theme="light"] .payout-velocity-bar {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .payout-velocity-pill {
  color: #0f172a !important;
}

[data-theme="light"] .payout-velocity-text {
  color: #0f172a !important;
}

[data-theme="light"] .payout-velocity-sub {
  color: #64748b !important;
}

[data-theme="light"] .payout-info-btn {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
  color: #475569 !important;
}

[data-theme="light"] .payout-info-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .payout-velocity-popover {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15) !important;
}

[data-theme="light"] .payout-popover-title {
  color: #0f172a !important;
}

[data-theme="light"] .payout-popover-desc {
  color: #334155 !important;
}

[data-theme="light"] .matrix-velocity-pill.fast {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #047857 !important;
}

[data-theme="light"] .matrix-velocity-pill.medium {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #b45309 !important;
}

[data-theme="light"] .matrix-velocity-pill.slow {
  background: rgba(100, 116, 139, 0.12) !important;
  border-color: rgba(100, 116, 139, 0.3) !important;
  color: #475569 !important;
}

/* --------------------------------------------------------------------------
   Summary & Export Action Buttons
   -------------------------------------------------------------------------- */
.btn-summary, .btn-summary-export {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

/* Copy button uses current look (lighter dark) */
.btn-summary {
  background: rgba(248, 250, 252, 0.05);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.15);
}
.btn-summary:hover {
  background: rgba(248, 250, 252, 0.1);
}

/* Export button uses accent look (cyan/bright green) */
.btn-summary-export {
  background: #10b981; /* Default success green */
  color: #0f172a;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-summary-export:hover {
  background: #34d399;
}

/* Loading State for Button */
.btn-summary-export.loading {
  background: #64748b;
  pointer-events: none;
  box-shadow: none;
  color: #cbd5e1;
}

/* Light Theme overrides for summary buttons */
[data-theme="light"] .btn-summary {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.18);
  color: #334155;
}
[data-theme="light"] .btn-summary:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   Brand Logo Icon + Typography Lockup
   -------------------------------------------------------------------------- */
.brand-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.footer-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.brand-text {
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}

.brand-text .text-white {
  color: #ffffff;
}

.brand-text .text-emerald-400 {
  color: #22c55e;
}

.brand-text .trademark,
.brand-tm,
.brand-text .brand-tm {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  margin-left: 3px;
  display: inline-block;
  transform: translateY(-5px); /* Lifts TM up to align with upper-middle of 'L' */
  line-height: 1;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* Light Theme Contrast for Brand Text */
[data-theme="light"] .brand-text .text-white {
  color: #0f172a;
}

.deal-card-brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Workbench Action Buttons Row Layout (Side-by-Side with 1-Click Copy)
   -------------------------------------------------------------------------- */
.workbench-actions-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  position: relative;
}

.btn-action-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-action-secondary:hover {
  background: #334155;
  color: #ffffff;
}

.btn-action-primary {
  flex: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  background: #22c55e;
  color: #022c22;
  border: 1px solid #16a34a;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-action-primary:hover {
  background: #16a34a;
  color: #ffffff;
}

.btn-action-primary.loading {
  background: #64748b;
  pointer-events: none;
  box-shadow: none;
  color: #cbd5e1;
  border-color: #64748b;
}

.btn-action-primary.bg-emerald-400 {
  background: #34d399;
  border-color: #34d399;
  color: #022c22;
}

.btn-action-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  box-sizing: border-box;
}

.btn-action-icon-only:hover {
  background: #334155;
  color: #ffffff;
}

.btn-action-icon-only.loading {
  background: #64748b;
  pointer-events: none;
  color: #cbd5e1;
  border-color: #64748b;
}

/* Light Theme Overrides for Action Buttons */
[data-theme="light"] .btn-action-secondary,
[data-theme="light"] .btn-action-icon-only {
  background: #f8fafc;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .btn-action-secondary:hover,
[data-theme="light"] .btn-action-icon-only:hover {
  background: #f1f5f9;
  color: #0f172a;
}

@media (max-width: 640px) {
  .workbench-actions-row {
    flex-wrap: wrap;
  }
  .btn-action-secondary,
  .btn-action-primary {
    flex: 1 1 100%;
    width: 100%;
  }
  .btn-action-icon-only {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Standardized Brand Logo Wordmark (Fallback)
   -------------------------------------------------------------------------- */
.brand-logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}
.brand-logo .logo-flip {
  color: #f8fafc; /* Crisp white */
}
.brand-logo .logo-pnl {
  color: #10b981; /* Neon/emerald profit green */
}
.brand-logo .logo-tm {
  color: #64748b; /* Muted slate */
  font-size: 10px;
  font-weight: 600;
  margin-left: 2px;
}

[data-theme="light"] .brand-logo .logo-flip {
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   Deal Card Template Styles (used by html2canvas for client-side rendering)
   -------------------------------------------------------------------------- */
.deal-card-template {
  width: 400px;
  background-color: #0f172a;
  color: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-variant-numeric: normal;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  box-sizing: border-box;
}

.deal-card-template .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.deal-card-template .deal-card-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

.deal-card-template .logo {
  font-size: 18px;
  font-weight: 900;
  color: #10b981;
}

.deal-card-template .mkt-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.deal-card-template .card-profit-row {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding-bottom: 12px;
}

.deal-card-template .card-profit-row .label {
  font-size: 14px;
  color: #94a3b8;
}

.deal-card-template .card-profit-row .profit-value {
  font-size: 36px;
  font-weight: 900;
  color: #10b981;
}

.deal-card-template .card-metrics-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.deal-card-template .metric-box {
  flex: 1;
  text-align: center;
  background: rgba(30, 41, 59, 0.6);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(248, 250, 252, 0.1);
}

.deal-card-template .metric-label {
  font-size: 12px;
  color: #94a3b8;
}

.deal-card-template .metric-value {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
}

.deal-card-template .card-pricing-waterfall {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 16px;
  line-height: 1.6;
}

.deal-card-template .card-pricing-waterfall .row {
  display: flex;
  justify-content: space-between;
}

.deal-card-template .card-pricing-waterfall .val {
  color: #f8fafc;
  font-weight: 700;
}

.deal-card-template .card-footer {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Modern SaaS Scratchpad & Deal Log Styling
   ========================================================================== */

/* Outer Section: Provide clean vertical rhythm */
.scratchpad-section {
  width: 100% !important;
  margin: 10px 0 0 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Container Card: Match .calc-workbench elevation and radius */
.scratchpad-container {
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 28px 24px !important;
  box-shadow: var(--shadow-lg) !important;
  transition: border-color var(--transition-smooth);
}

.scratchpad-container:hover {
  border-color: var(--border-hover) !important;
}

.scratchpad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.scratchpad-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.summary-metric-card {
  background: var(--bg-surface-elevated, #131f42);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
  border-radius: var(--radius-md, 10px);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
}

.summary-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #94a3b8);
}

@media (max-width: 768px) {
  .scratchpad-summary-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.scratchpad-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scratchpad-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin: 0;
}

.scratchpad-count {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.scratchpad-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-scratchpad-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-color, #334155);
  background: var(--input-bg, #1e293b);
  color: var(--text-primary, #cbd5e1);
  transition: all 0.15s ease;
}

.btn-scratchpad-tool:hover {
  background: var(--card-hover-bg, #334155);
  color: #ffffff;
}

#btnCopySheets:hover {
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-danger-clean {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger-clean:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Save to Scratchpad Button in Workbench */
.btn-save-to-pad {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.btn-save-to-pad:hover {
  background: #059669 !important;
}

/* Active Editing Banner */
.editing-banner {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #93c5fd;
  box-sizing: border-box;
  width: 100%;
}

.editing-banner-actions { display: flex; gap: 8px; }
.btn-banner { padding: 6px 12px; border-radius: 4px; font-weight: 600; cursor: pointer; border: none; font-size: 0.85rem; }
.btn-save-update { background: #3b82f6; color: #ffffff; }
.btn-cancel { background: #475569; color: #ffffff; }

/* Table Typography & Layout */
.scratchpad-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color, #1e293b);
  background: var(--card-bg, #0b1120);
}

.scratchpad-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.scratchpad-table th,
.scratchpad-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border-color, #1e293b);
  color: var(--text-primary, #cbd5e1);
  vertical-align: middle;
}

.scratchpad-table th {
  background: var(--table-header-bg, #141f32);
  color: var(--text-secondary, #94a3b8);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.lead-title-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 220px;
  min-width: 130px;
}

.lead-name {
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.lead-sku-sub {
  font-size: 0.71rem;
  color: var(--text-muted, #94a3b8);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.2;
}

.lead-source-link {
  font-size: 0.7rem;
  color: #38bdf8;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

.lead-comps-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.comp-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.comp-chip.sold-chip {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.comp-chip.sold-chip:hover {
  background: rgba(16, 185, 129, 0.22);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.comp-chip.active-chip {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.comp-chip.active-chip:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #0284c7;
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

[data-theme="light"] .comp-chip.sold-chip {
  background: rgba(5, 150, 105, 0.08);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.25);
}

[data-theme="light"] .comp-chip.sold-chip:hover {
  background: rgba(5, 150, 105, 0.16);
  color: #065f46;
}

[data-theme="light"] .comp-chip.active-chip {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .comp-chip.active-chip:hover {
  background: rgba(2, 132, 199, 0.16);
  color: #0369a1;
}

.badge-lead {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.badge-roi { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-profit { background: rgba(234, 179, 8, 0.2); color: #eab308; }

.platform-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.platform-pill.amazon { background: rgba(255, 153, 0, 0.2); color: #ff9900; }
.platform-pill.ebay { background: rgba(0, 100, 210, 0.2); color: #38bdf8; }
.platform-pill.mercari { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Deal Type Intent Badges */
.type-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
}

.type-pill.buy {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.type-pill.inventory,
.type-pill.stock {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.type-pill.offer {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Light Theme Overrides */
html[data-theme="light"] .type-pill.buy {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

html[data-theme="light"] .type-pill.inventory,
html[data-theme="light"] .type-pill.stock {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.25);
}

html[data-theme="light"] .type-pill.offer {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

/* Tabular Numbers & Cell Constraints */
.scratchpad-table td.tabular-nums {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.8rem;
}

/* Micro Compact Action Buttons in Table Rows */
.table-actions {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-table-action {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border-radius: 5px;
  cursor: pointer;
  background: var(--input-bg, #1e293b);
  border: 1px solid var(--border-color, #334155);
  color: var(--text-secondary, #94a3b8);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-table-action.edit:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
}

.btn-table-action.load {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-table-action.load:hover {
  background: rgba(16, 185, 129, 0.15);
}

.btn-table-action.discord {
  color: #818cf8;
}
.btn-table-action.discord:hover {
  color: #5865f2;
  border-color: rgba(88, 101, 242, 0.45);
  background: rgba(88, 101, 242, 0.15);
}

.btn-table-action.share:hover {
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.12);
}

.btn-table-action.delete {
  color: #94a3b8;
}
.btn-table-action.delete:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

/* Modal Theme Support */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.modal-card {
  background: var(--card-bg, var(--bg-surface, #111927));
  border: 1px solid var(--border-color, var(--border, #1e293b));
  border-radius: 12px;
  width: 90%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: var(--text-primary, #f8fafc);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary, #f8fafc); margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; color: var(--text-secondary, #94a3b8); cursor: pointer; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary, #cbd5e1); margin-bottom: 6px; }
.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg, var(--bg-input, #0b1120));
  border: 1px solid var(--border-color, var(--border, #1e293b));
  border-radius: 6px;
  color: var(--text-primary, #f8fafc);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Smooth Light Mode Adaptability */
html[data-theme="light"] .scratchpad-wrapper,
[data-theme="light"] #scratchpadSection {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .scratchpad-title,
[data-theme="light"] #scratchpadSection .scratchpad-title {
  color: #0f172a !important;
}

html[data-theme="light"] .scratchpad-table-wrapper,
[data-theme="light"] #scratchpadSection .scratchpad-table-wrapper {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .scratchpad-table,
[data-theme="light"] #scratchpadSection .scratchpad-table {
  background: #ffffff !important;
}

html[data-theme="light"] .scratchpad-table th,
[data-theme="light"] #scratchpadSection .scratchpad-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .scratchpad-table td,
[data-theme="light"] #scratchpadSection .scratchpad-table td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

html[data-theme="light"] .lead-name,
[data-theme="light"] #scratchpadSection .lead-name {
  color: #0f172a !important;
}

html[data-theme="light"] .btn-scratchpad-tool,
[data-theme="light"] #scratchpadSection .btn-scratchpad-tool {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .btn-scratchpad-tool:hover,
[data-theme="light"] #scratchpadSection .btn-scratchpad-tool:hover {
  background: #e2e8f0 !important;
}

html[data-theme="light"] .btn-table-action,
[data-theme="light"] #scratchpadSection .btn-table-action {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .btn-table-action.load,
[data-theme="light"] #scratchpadSection .btn-table-action.load {
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  background: rgba(16, 185, 129, 0.08) !important;
}
html[data-theme="light"] .btn-table-action.load:hover,
[data-theme="light"] #scratchpadSection .btn-table-action.load:hover {
  background: rgba(16, 185, 129, 0.18) !important;
}

html[data-theme="light"] .btn-table-action.share:hover,
[data-theme="light"] #scratchpadSection .btn-table-action.share:hover {
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
  background: rgba(2, 132, 199, 0.08) !important;
}

html[data-theme="light"] .btn-table-action.delete:hover,
[data-theme="light"] #scratchpadSection .btn-table-action.delete:hover {
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.4) !important;
  background: rgba(220, 38, 38, 0.08) !important;
}

/* Light Theme Modal Overrides */
html[data-theme="light"] .modal-card,
[data-theme="light"] #saveLeadModal .modal-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .modal-title,
[data-theme="light"] #saveLeadModal .modal-title {
  color: #0f172a !important;
}

html[data-theme="light"] #saveLeadModal label,
[data-theme="light"] #saveLeadModal .form-group label {
  color: #475569 !important;
}

html[data-theme="light"] #saveLeadModal input,
[data-theme="light"] #saveLeadModal .form-group input {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   Mobile Responsive Rules (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Eliminate horizontal page blowout */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* 2. Stack the workbench panes vertically */
  .calc-workbench,
  #calcWorkbench {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 12px !important;
    gap: 24px !important;
    box-sizing: border-box !important;
  }

  .calc-input-pane,
  .calc-output-pane {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }

  /* 3. Stack side-by-side inputs (Price vs COGS, Shipping vs Ads) */
  .sourcing-row-50-50,
  .calc-field-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .sourcing-field-col,
  .calc-field-group {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 4. Make workbench action buttons wrap cleanly */
  .workbench-actions-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .workbench-actions-row button {
    flex: 1 1 calc(50% - 8px) !important;
    font-size: 0.8rem !important;
  }

  /* 5. Contain Scratchpad and constrain table scroll */
  .scratchpad-section,
  .scratchpad-wrapper,
  .scratchpad-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 12px !important;
    box-sizing: border-box !important;
  }

  .scratchpad-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
  }

  .scratchpad-table {
    min-width: 600px !important;
  }

  /* 6. Partner Callout Responsive Wrap */
  .partner-callout-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
    padding: 20px !important;
  }

  .partner-callout-right {
    width: 100% !important;
  }

  .partner-cta-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   Strict Portrait Mobile Layout (< 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
  /* Force Workbench into a Single Full-Width Column */
  #calcWorkbench,
  .calc-workbench,
  .calc-workbench.simple-mode {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 12px !important;
    gap: 20px !important;
    box-sizing: border-box !important;
  }

  /* Full Width for Both Panes */
  .calc-input-pane,
  .calc-output-pane {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  /* Platform Tabs Responsive Grid for 8 Channels */
  .platform-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    width: 100% !important;
    gap: 6px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }

  .platform-tab-btn {
    flex: initial !important;
    padding: 8px 4px !important;
    font-size: 0.8rem !important;
    text-align: center !important;
    white-space: nowrap !important;
    min-width: 0 !important;
  }

  /* Mode Switch Bar Header */
  .calc-pane-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
    margin-bottom: 14px !important;
  }

  .workbench-title-group {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .mode-toggle-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .mode-pill-group {
    display: inline-flex !important;
    padding: 2px !important;
  }

  .mode-pill-group .btn-mode {
    padding: 5px 10px !important;
    font-size: 0.76rem !important;
  }

  /* Stack the input grid vertically */
  .calc-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 14px !important;
  }

  .calc-grid .full-width,
  .calc-field-group,
  #calc-tax-reserve-group,
  .tax-reserve-field-group {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Fix Inbound Logistics / Prep Header overlap */
  .pro-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .calc-label-sub {
    width: 100% !important;
    line-height: 1.3 !important;
  }

  .effective-cogs-pill {
    align-self: flex-start !important;
  }

  /* Unstack Side-by-Side Sourcing Inputs to 100% Full Width */
  .sourcing-row-50-50,
  .calc-field-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 12px !important;
  }

  .sourcing-field-col,
  .calc-field-group,
  .calc-field {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Large, Readable Mobile Input Fields */
  .calc-input-wrapper {
    width: 100% !important;
    height: 44px !important; /* Touch-friendly tap target */
  }

  .calc-input {
    width: 100% !important;
    height: 44px !important;
    font-size: 1rem !important; /* Prevents auto-zoom on iOS */
    padding: 8px 12px 8px 28px !important;
    box-sizing: border-box !important;
  }

  .calc-prefix {
    font-size: 1rem !important;
    line-height: 44px !important;
  }

  /* Contain Target ROI Preset Chips */
  .target-margin-card {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 14px !important;
  }

  .target-presets {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 10px 0 !important;
    box-sizing: border-box !important;
  }

  .preset-chip {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 2px !important;
    font-size: 0.72rem !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Output Pane Cards Expand Full Width */
  .profit-headline-box,
  .pricing-floors-card,
  .metrics-strip,
  .waterfall-ledger {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .pricing-floor-row {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .metrics-strip {
    display: flex !important;
    gap: 10px !important;
  }

  .metric-card {
    flex: 1 1 50% !important;
  }
}

/* ==========================================================================
   Mobile Display Corrections (< 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
  /* 1. Force Category and Tax Reserve to stack vertically */
  .calc-grid,
  .calc-workbench .calc-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 16px !important;
  }

  .calc-grid .full-width,
  .calc-field-group,
  #calc-tax-reserve-group,
  .tax-reserve-field-group {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 !important;
  }

  .calc-select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 2. Fix Inbound Logistics / Prep Header Overlap */
  .pro-logistics-card .pro-card-header,
  #proLogisticsSection .pro-card-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  #logisticsCardTitle {
    display: block !important;
    width: 100% !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .effective-cogs-pill {
    display: inline-block !important;
    align-self: flex-start !important;
    margin-top: 4px !important;
  }

  /* 3. Keep Target ROI Chips within Card Bounds */
  .target-margin-card {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 16px !important;
  }

  .target-presets {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 12px 0 !important;
  }

  .preset-chip {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 2px !important;
    font-size: 0.72rem !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* ==========================================================================
   Save Deal Modal Polished Component Styles
   ========================================================================== */
.save-deal-modal-card {
  background: var(--bg-surface, #0f172a) !important;
  border: 1px solid var(--border-color, #1e293b) !important;
  border-radius: 16px !important;
  max-width: 460px !important;
  width: 92% !important;
  padding: 24px 26px !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6) !important;
}

.deal-type-toggle-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.deal-type-toggle-group .btn-deal-type {
  flex: 1 1 50%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-color, #334155);
  background: var(--input-bg, #161f30);
  color: var(--text-secondary, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.deal-type-toggle-group .btn-deal-type:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.deal-type-toggle-group .btn-deal-type.active[data-deal-type="buy"] {
  border-color: rgba(16, 185, 129, 0.6) !important;
  background: rgba(16, 185, 129, 0.16) !important;
  color: #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.deal-type-toggle-group .btn-deal-type.active[data-deal-type="offer"] {
  border-color: rgba(245, 158, 11, 0.6) !important;
  background: rgba(245, 158, 11, 0.16) !important;
  color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.modal-footer-styled {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #1e293b);
}

.btn-deal-modal {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-deal-modal-cancel {
  border: 1px solid var(--border-color, #334155);
  background: var(--input-bg, #1e293b);
  color: var(--text-secondary, #94a3b8);
}

.btn-deal-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: #475569;
}

.btn-deal-modal-save {
  border: 1px solid #10b981;
  background: #10b981;
  color: #070c1a;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

.btn-deal-modal-save:hover {
  background: #34d399;
  border-color: #34d399;
  transform: translateY(-1px);
}

/* Emoji-Only Badge in Scratchpad Table */
.badge-intent-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  margin-left: 6px;
  cursor: default;
  vertical-align: middle;
}

/* ==========================================================================
   Polished Scratchpad Pagination Controls
   ========================================================================== */
.scratchpad-pagination {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  padding-top: 18px !important;
  margin-top: 16px !important;
  border-top: 1px solid var(--border-subtle) !important;
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
}

.pagination-info {
  font-size: 0.82rem !important;
  color: var(--text-muted) !important;
}

.pagination-info strong {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.pagination-buttons {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.btn-page-nav {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-surface-elevated) !important;
  color: var(--text-secondary) !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
  user-select: none !important;
}

.btn-page-nav:hover:not(:disabled) {
  background: var(--bg-surface-hover) !important;
  border-color: var(--border-hover) !important;
  color: var(--text-primary) !important;
  transform: translateY(-1px) !important;
}

.btn-page-nav:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.pagination-current {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  padding: 5px 12px !important;
  border-radius: var(--radius-sm) !important;
}

/* Light Theme Adaptations */
[data-theme="light"] .scratchpad-container {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .btn-page-nav {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}

[data-theme="light"] .btn-page-nav:hover:not(:disabled) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .pagination-current {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}

/* ==========================================================================
   Scratchpad Filter Bar & SKU Styling
   ========================================================================== */
.scratchpad-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  max-width: 280px;
}

.scratchpad-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-secondary, #94a3b8);
  pointer-events: none;
}

.scratchpad-search-input {
  width: 100%;
  height: 32px;
  background: var(--input-bg, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 6px;
  padding: 4px 28px 4px 30px;
  font-size: 0.8rem;
  color: var(--text-primary, #f8fafc);
  outline: none;
  box-sizing: border-box;
}

.scratchpad-search-input:focus {
  border-color: #10b981;
}

/* Edit Lead Button Styling */
.btn-table-action.edit {
  color: #94a3b8;
}
.btn-table-action.edit:hover {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

/* Light Mode Overrides */
html[data-theme="light"] .btn-table-action.edit:hover {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.1);
}

/* Clean Clear Button Position inside Search Input */
.clear-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  cursor: pointer;
  font-size: 13px;
  padding: 4px;
  line-height: 1;
  display: none;
  border-radius: 50%;
  transition: color 0.15s ease;
}

.clear-search-btn:hover {
  color: #ef4444 !important;
}

.scratchpad-sku-cell {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.78rem !important;
  color: var(--text-secondary, #94a3b8) !important;
  letter-spacing: 0.02em;
}

/* Scratchpad Tag Filter & Badges */
.scratchpad-tag-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.scratchpad-tag-select {
  height: 32px;
  background: var(--input-bg, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
}

.scratchpad-tag-select:focus {
  border-color: #10b981;
}

.lead-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.scratchpad-tag-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.scratchpad-tag-badge:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  border-color: #38bdf8;
}

/* Dynamic ROI Safety Highlighting */
.roi-safety-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.roi-safety-pill.safe {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.roi-safety-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.roi-safety-pill.loss {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.matrix-roi-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.2;
}

.matrix-roi-pill.warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.matrix-roi-pill.loss {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .matrix-roi-pill.warning {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .matrix-roi-pill.loss {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

html[data-theme="light"] .scratchpad-search-input,
html[data-theme="light"] .scratchpad-tag-select {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .scratchpad-tag-badge {
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
}

@media (max-width: 768px) {
  .scratchpad-search-wrap,
  .scratchpad-tag-filter-wrap {
    width: 100% !important;
    max-width: 100% !important;
    order: 2;
    margin: 4px 0;
  }
}

/* --- Marketplace Brand Colors --- */

/* Amazon */
.platform-tab-btn.active.amazon { border-bottom: 2px solid #ff9900; color: #ff9900; }
.platform-pill.amazon { background: rgba(255, 153, 0, 0.15); color: #ffb733; }

/* eBay */
.platform-tab-btn.active.ebay { border-bottom: 2px solid #0064d2; color: #3b82f6; }
.platform-pill.ebay { background: rgba(0, 100, 210, 0.15); color: #60a5fa; }

/* Mercari - Vibrant Cornflower Indigo */
.platform-tab-btn.active.mercari { border-bottom: 2px solid #5E6DF2; color: #818cf8; }
.platform-pill.mercari { background: rgba(94, 109, 242, 0.15); color: #818cf8; }

/* Walmart */
.platform-tab-btn.active.walmart { border-bottom: 2px solid #0071ce; color: #38bdf8; }
.platform-pill.walmart { background: rgba(0, 113, 206, 0.15); color: #38bdf8; }

/* Poshmark - Mulberry Wood / Wine Berry */
.platform-tab-btn.active.poshmark { border-bottom: 2px solid #610722; color: #fb7185; }
.platform-pill.poshmark { background: rgba(97, 7, 34, 0.25); color: #fda4af; }

/* Facebook */
.platform-tab-btn.active.facebook { border-bottom: 2px solid #1877f2; color: #60a5fa; }
.platform-pill.facebook { background: rgba(24, 119, 242, 0.15); color: #93c5fd; }

/* Etsy - Official Brand Orange */
.platform-tab-btn.active.etsy { border-bottom: 2px solid #F56400; color: #ff781f; }
.platform-pill.etsy { background: rgba(245, 100, 0, 0.18); color: #ff781f; }

/* TikTok Shop - Iconic Vibrant Crimson & Cyan Accent */
.platform-tab-btn.active.tiktok { border-bottom: 2px solid #FE2C55; color: #ff3b5c; }
.platform-pill.tiktok { background: rgba(254, 44, 85, 0.18); color: #ff3b5c; }

/* Light Theme Adjustments */
[data-theme="light"] .platform-pill.amazon { color: #b45309; background: rgba(255, 153, 0, 0.12); }
[data-theme="light"] .platform-pill.ebay { color: #1d4ed8; background: rgba(0, 100, 210, 0.1); }
[data-theme="light"] .platform-pill.mercari { color: #4338ca; background: rgba(94, 109, 242, 0.12); }
[data-theme="light"] .platform-pill.walmart { color: #0369a1; background: rgba(0, 113, 206, 0.1); }
[data-theme="light"] .platform-pill.poshmark { color: #881337; background: rgba(97, 7, 34, 0.12); }
[data-theme="light"] .platform-pill.facebook { color: #1d4ed8; background: rgba(24, 119, 242, 0.1); }
[data-theme="light"] .platform-pill.etsy { color: #c2410c; background: rgba(245, 100, 0, 0.12); }
[data-theme="light"] .platform-pill.tiktok { color: #e11d48; background: rgba(254, 44, 85, 0.12); }
[data-theme="light"] .platform-tab-btn.active.mercari { color: #4338ca; }
[data-theme="light"] .platform-tab-btn.active.poshmark { color: #881337; }
[data-theme="light"] .platform-tab-btn.active.etsy { color: #c2410c; }
[data-theme="light"] .platform-tab-btn.active.tiktok { color: #e11d48; }

/* Hero Multi-Channel Enhancements */
.hero-gradient-text,
.hero-title span.hero-gradient-text {
  background: linear-gradient(135deg, #10b981 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-supported-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.supported-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.supported-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Deal of the Day / Sourcing Intel Section
   -------------------------------------------------------------------------- */
.deal-of-the-day-wrapper {
  width: 100%;
  max-width: var(--calculator-max-width, 1200px);
  margin: 0 auto;
  box-sizing: border-box;
}

.deal-of-the-day-card {
  position: relative;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(15, 23, 42, 0.98) 50%, rgba(30, 41, 59, 0.85) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-xl, 20px);
  padding: 26px 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.5), 0 0 24px rgba(245, 158, 11, 0.08);
  transition: border-color var(--transition-smooth, 0.25s ease), box-shadow var(--transition-smooth, 0.25s ease), transform var(--transition-smooth, 0.25s ease);
  overflow: hidden;
}

.deal-of-the-day-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #38bdf8, #10b981);
}

.deal-of-the-day-card:hover {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 20px 42px -4px rgba(0, 0, 0, 0.6), 0 0 32px rgba(245, 158, 11, 0.18);
  transform: translateY(-2px);
}

.deal-day-left {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1 1 540px;
}

.deal-day-icon-box {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-lg, 16px);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(245, 158, 11, 0.12);
}

.deal-day-content {
  flex: 1;
}

.deal-day-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.deal-pill-featured {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.deal-pill-retailer {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #f8fafc);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
}

.deal-pill-category {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.deal-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
  margin-left: auto;
}

.deal-day-title {
  color: var(--text-primary, #f8fafc);
  font-size: 1.22rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  line-height: 1.35;
}

.deal-day-desc {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.86rem;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.deal-day-meta-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 0.82rem;
}

.deal-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary, #94a3b8);
}

.deal-meta-label {
  color: var(--text-muted, #64748b);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deal-meta-code {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deal-meta-code:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
}

.deal-day-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.deal-cta-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}

.deal-cta-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
  filter: brightness(1.08);
}

.deal-cta-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}

.deal-cta-btn-secondary:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
}

/* Light Mode Overrides */
[data-theme="light"] .deal-of-the-day-card {
  background: linear-gradient(135deg, #ffffff 0%, #fefce8 60%, #fff7ed 100%);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.08), 0 0 20px rgba(245, 158, 11, 0.1);
}

[data-theme="light"] .deal-pill-retailer {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .deal-day-title {
  color: #0f172a;
}

[data-theme="light"] .deal-day-desc {
  color: #475569;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .deal-of-the-day-card {
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .deal-day-left {
    flex-direction: column;
    gap: 14px;
  }
  .deal-day-icon-box {
    width: 54px;
    height: 54px;
    font-size: 26px;
  }
  .deal-day-right {
    align-items: stretch;
    width: 100%;
  }
  .deal-cta-btn-primary,
  .deal-cta-btn-secondary {
    width: 100%;
  }
}

/* Scroll Margin Offset for Sticky Header */
#deal-radar-section,
#calculator,
#features,
#scratchpad-section {
  scroll-margin-top: 85px;
}

/* --------------------------------------------------------------------------
   Floating Quick Nav ('Back to Top / Jump to Deals') - Mobile & Desktop
   -------------------------------------------------------------------------- */
.floating-quick-nav {
  position: fixed;
  bottom: 20px;
  right: 76px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 40px;
  padding: 4px 6px;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.15);
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.floating-quick-nav.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-quick-nav:hover {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.7), 0 0 22px rgba(56, 189, 248, 0.25);
}

.quick-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  padding: 6px 12px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.quick-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.quick-nav-calc {
  color: #10b981;
}

.quick-nav-calc:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.quick-nav-scratchpad {
  color: #38bdf8;
}

.quick-nav-scratchpad:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.quick-nav-target {
  color: #a855f7;
}

.quick-nav-target:hover {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.quick-nav-top {
  color: #94a3b8;
}

.quick-nav-top:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.quick-nav-icon {
  font-size: 14px;
  line-height: 1;
}

/* Light Theme Overrides */
[data-theme="light"] .floating-quick-nav {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.12), 0 0 14px rgba(56, 189, 248, 0.08);
}

[data-theme="light"] .quick-nav-btn {
  color: #475569;
}

[data-theme="light"] .quick-nav-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .quick-nav-calc {
  color: #059669;
}

[data-theme="light"] .quick-nav-calc:hover {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
}

[data-theme="light"] .quick-nav-scratchpad {
  color: #0284c7;
}

[data-theme="light"] .quick-nav-scratchpad:hover {
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
}

[data-theme="light"] .quick-nav-target {
  color: #7c3aed;
}

[data-theme="light"] .quick-nav-target:hover {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}

[data-theme="light"] .quick-nav-top {
  color: #475569;
}

[data-theme="light"] .quick-nav-top:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

@media (max-width: 640px) {
  .floating-quick-nav {
    bottom: 18px;
    left: 16px;
    right: auto;
    padding: 3px 5px;
  }
  .quick-nav-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   Save Deal Modal - Scoped Component Styles
   (Moved from inline <head> block; no !important overrides needed here)
   ========================================================================== */

#saveLeadModal .save-deal-modal-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 16px;
  max-width: 460px;
  width: 92%;
  padding: 24px 26px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

#saveLeadModal .deal-type-toggle-group {
  display: flex;
  gap: 12px;
  width: 100%;
}

#saveLeadModal .btn-deal-type {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
}

#saveLeadModal .btn-deal-type:hover {
  background: #283548;
  color: #ffffff;
}

/* Active Buy State - Emerald Outline & Glow */
#saveLeadModal #btnTypeBuy.active {
  background: rgba(16, 185, 129, 0.16);
  border: 2px solid #10b981;
  color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

/* Active Offer State - Amber Outline & Glow */
#saveLeadModal #btnTypeOffer.active {
  background: rgba(245, 158, 11, 0.16);
  border: 2px solid #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

/* Modal Footer & Buttons */
#saveLeadModal .modal-footer-styled {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}

#saveLeadModal .btn-deal-modal {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

#saveLeadModal .btn-deal-modal-cancel {
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
}

#saveLeadModal .btn-deal-modal-cancel:hover {
  background: #283548;
  color: #ffffff;
  border-color: #475569;
}

#saveLeadModal .btn-deal-modal-save {
  border: 1px solid #10b981;
  background: #10b981;
  color: #070c1a;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

#saveLeadModal .btn-deal-modal-save:hover {
  background: #34d399;
  border-color: #34d399;
  transform: translateY(-1px);
}














/* ============================================================
   Deal Radar - Card Grid Layout (v1.0, 2026-09-01)
   Zero horizontal scroll. Auto-fills columns based on viewport.
   ============================================================ */

.dr-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.dr-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

/* Auto-fill grid: 1 col mobile → 2 col tablet → 3 col desktop */
.dr-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dr-cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  touch-action: pan-y;
}

/* Card */
.dr-card {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border, #1e293b);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dr-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* Card top row: retailer name + category badge */
.dr-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.dr-retailer {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  line-height: 1.25;
}

.dr-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.6;
}

/* Event name (italic subheading) */
.dr-event {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  margin: 0;
  font-style: italic;
}

/* Discount headline */
.dr-discount {
  font-size: 0.92rem;
  font-weight: 700;
  color: #10b981;
  margin: 0;
  line-height: 1.3;
}

/* Details - max 3 lines, clipped */
.dr-details {
  font-size: 0.79rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Card bottom row: code + dates on left, CTA on right */
.dr-card-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dr-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

/* Promo code pill */
.dr-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px dashed rgba(248, 113, 113, 0.35);
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.dr-code-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.06em;
  font-family: inherit;
  text-transform: uppercase;
}

.dr-no-code {
  font-size: 0.73rem;
  color: var(--text-muted, #64748b);
  font-style: italic;
}

.dr-dates {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
}

/* CTA button */
.dr-btn {
  display: inline-block;
  background: #38bdf8;
  color: #0f172a !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

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

/* Empty / loading / error states */
.dr-state-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted, #64748b);
  font-size: 0.9rem;
}

/* Mobile overrides (< 480px) */
@media (max-width: 480px) {
  .dr-grid {
    grid-template-columns: 1fr;
  }

  .dr-card-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .dr-btn {
    width: 100%;
    text-align: center;
    padding: 10px 16px;
  }
}

/* ==========================================================================
   Deal Radar - Pagination, Urgency, Type Badges & New Layout Components
   ========================================================================== */

/* Pagination Controls */
.dr-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 0 4px;
  flex-wrap: wrap;
}

.dr-page-btn {
  background: var(--bg-elevated, #131f42);
  border: 1px solid var(--border, #1e293b);
  color: var(--text-primary, #e2e8f0);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dr-page-btn:hover:not(:disabled) {
  background: var(--accent-emerald, #10b981);
  border-color: var(--accent-emerald, #10b981);
  color: #070c1a;
}

.dr-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dr-page-info-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dr-page-info {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.01em;
}

.dr-swipe-hint {
  font-size: 0.68rem;
  color: var(--accent-cyan, #38bdf8);
  font-weight: 700;
  display: none;
}

@media (max-width: 768px) {
  .dr-swipe-hint {
    display: block;
  }
}

@keyframes drSlideLeft {
  from { opacity: 0.35; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes drSlideRight {
  from { opacity: 0.35; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.dr-count {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  padding: 4px 0;
}

/* Urgency */
.dr-card-urgent {
  border-color: rgba(239, 68, 68, 0.45) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.12);
}

.dr-urgent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.dr-new-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Store Type Badges */
.dr-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.dr-type-both {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.dr-type-online {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

/* Meta Rows Inside Cards */
.dr-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dr-meta-dates {
  margin-top: 2px;
}

/* Category Tag */
.dr-category-tag {
  display: inline-block;
  background: var(--bg-elevated, #131f42);
  border: 1px solid var(--border, #1e293b);
  color: var(--text-muted, #64748b);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}

/* Mobile Pagination Compact */
@media (max-width: 480px) {
  .dr-pagination {
    gap: 10px;
  }
  .dr-page-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
  }
  .dr-page-info {
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    order: -1;
  }
}

/* --------------------------------------------------------------------------
   Daily Retail Deal Radar - Light Theme Contrast Overrides
   -------------------------------------------------------------------------- */
[data-theme="light"] .dr-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .dr-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .dr-card-urgent {
  border-color: rgba(220, 38, 38, 0.45) !important;
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.08);
}

[data-theme="light"] .dr-retailer {
  color: #0f172a;
}

[data-theme="light"] .dr-badge {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0284c7;
}

[data-theme="light"] .dr-event {
  color: #64748b;
}

[data-theme="light"] .dr-discount {
  color: #059669;
}

[data-theme="light"] .dr-details {
  color: #334155;
}

[data-theme="light"] .dr-card-bottom {
  border-top-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .dr-dates {
  color: #64748b;
}

[data-theme="light"] .dr-category-tag {
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #475569;
  font-weight: 600;
}

[data-theme="light"] .dr-type-both {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
  color: #047857;
}

[data-theme="light"] .dr-type-online {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0284c7;
}

[data-theme="light"] .dr-code {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

[data-theme="light"] .dr-code-label {
  color: #64748b;
}

[data-theme="light"] .dr-no-code {
  color: #64748b;
}

[data-theme="light"] .dr-urgent-badge {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
}

[data-theme="light"] .dr-new-badge {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.35);
  color: #059669;
}

[data-theme="light"] .dr-live-badge {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.35);
  color: #059669;
}

[data-theme="light"] .dr-btn {
  background: #0284c7;
  color: #ffffff !important;
}

[data-theme="light"] .dr-btn:hover {
  background: #0369a1;
}

[data-theme="light"] .dr-page-btn {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.18);
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .dr-page-btn:hover:not(:disabled) {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

[data-theme="light"] .dr-page-btn:disabled {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
  color: #94a3b8;
  opacity: 0.5;
  box-shadow: none;
}

[data-theme="light"] .dr-page-info {
  color: #64748b;
}

[data-theme="light"] .dr-swipe-hint {
  color: #0284c7;
}

[data-theme="light"] .dr-count,
[data-theme="light"] .dr-state-msg {
  color: #64748b;
}

/* ==========================================================================
   Target Take-Home Engine (Reverse Goal Calculator)
   ========================================================================== */
.target-engine-section {
  padding-top: 20px !important;
  padding-bottom: 30px !important;
}

.target-engine-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.target-engine-title-group .section-subtitle {
  margin-top: 6px;
  max-width: 680px;
}

.target-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.target-controls-card {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-lg, 12px);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.target-controls-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .target-controls-grid {
    grid-template-columns: 1fr;
  }
}

.target-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.target-control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.target-control-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.target-control-tip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.target-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.target-chip {
  background: var(--bg-input, #0b132b);
  border: 1px solid var(--border, #1e293b);
  color: var(--text-secondary, #94a3b8);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.target-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.target-chip.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--accent-emerald);
  color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.target-cycle-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 3 Comparative Profiles Grid */
.target-profiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 992px) {
  .target-profiles-grid {
    grid-template-columns: 1fr;
  }
}

.target-compliance-alert {
  animation: fadeIn 0.2s ease-out;
}

[data-theme="light"] .target-compliance-alert {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #92400e !important;
}

[data-theme="light"] .target-compliance-alert strong {
  color: #b45309 !important;
}

.target-profile-card {
  background: var(--bg-surface, #090e1d);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-lg, 12px);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition-smooth, 0.25s ease);
}

.target-profile-card:hover {
  border-color: var(--border-hover, #38bdf8);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.target-profile-card.featured {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.profile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
  min-height: 52px;
}

.profile-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.profile-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.profile-title-text {
  min-width: 0;
  flex: 1;
}

.profile-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.profile-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
  line-height: 1.3;
}

.profile-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

.profile-badge.velocity {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.profile-badge.balanced {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.profile-badge.collector {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.profile-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-surface-elevated, #0e172e);
  font-size: 0.82rem;
}

.profile-metric-row.primary {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 10px 12px;
}

.profile-metric-row.primary .profile-metric-lbl {
  font-weight: 700;
  color: var(--text-primary);
}

.profile-metric-row.primary .profile-metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-emerald, #10b981);
}

.profile-metric-lbl {
  color: var(--text-secondary);
}

.profile-metric-val {
  font-weight: 700;
  color: var(--text-primary);
}

.profile-turnover-box {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-sm, 6px);
  padding: 12px;
  margin-bottom: 14px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.turnover-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  align-self: flex-start;
}

.turnover-status-badge.warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.turnover-status-badge.funded {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.turnover-status-badge.neutral {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.turnover-status-text {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.profile-insight {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 18px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  min-height: 70px;
  display: flex;
  align-items: center;
}

.profile-insight strong {
  color: var(--text-primary);
}

.btn-use-profile {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  width: 100%;
  text-align: center;
}

.btn-use-profile:hover {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Light Theme Overrides for Target Engine */
[data-theme="light"] .target-controls-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .target-profile-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .target-profile-card.featured {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
}

[data-theme="light"] .target-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #475569;
}

[data-theme="light"] .target-chip:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .target-chip.active {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

[data-theme="light"] .profile-metric-row {
  background: #f1f5f9;
}

[data-theme="light"] .profile-metric-row.primary {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="light"] .profile-metric-row.primary .profile-metric-val {
  color: #047857;
}

[data-theme="light"] .profile-turnover-box {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .turnover-status-badge.warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #d97706;
}

[data-theme="light"] .turnover-status-badge.funded {
  background: #d1fae5;
  color: #065f46;
  border-color: #10b981;
}

[data-theme="light"] .turnover-status-badge.neutral {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-use-profile {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

[data-theme="light"] .btn-use-profile:hover {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

/* ==========================================================================
   Target Take-Home Profile Distinctive Top-Borders
   ========================================================================== */
.target-profile-card.velocity-profile {
  border-top: 3.5px solid #38bdf8 !important;
}

.target-profile-card.balanced-profile {
  border-top: 3.5px solid #10b981 !important;
}

.target-profile-card.collector-profile {
  border-top: 3.5px solid #a855f7 !important;
}

[data-theme="light"] .target-profile-card.velocity-profile {
  border-top: 3.5px solid #0284c7 !important;
}

[data-theme="light"] .target-profile-card.balanced-profile {
  border-top: 3.5px solid #059669 !important;
}

[data-theme="light"] .target-profile-card.collector-profile {
  border-top: 3.5px solid #7c3aed !important;
}

/* ==========================================================================
   SaaS Micro-Borders and Ambient Glow Gradients
   ========================================================================== */
.calc-workbench,
.pricing-floors-card,
.pro-logistics-card,
.pallet-friction-card,
.target-controls-card,
.reseller-gear-container,
.target-profile-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.calc-workbench:focus-within {
  box-shadow: 0 0 25px -5px rgba(16, 185, 129, 0.15), var(--shadow-lg);
}

[data-theme="light"] .calc-workbench,
[data-theme="light"] .pricing-floors-card,
[data-theme="light"] .pro-logistics-card,
[data-theme="light"] .pallet-friction-card,
[data-theme="light"] .target-controls-card,
[data-theme="light"] .reseller-gear-container,
[data-theme="light"] .target-profile-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
}

/* ==========================================================================
   Mobile Sticky Action Bar (Persistent Live Metric Strip)
   ========================================================================== */
.mobile-sticky-action-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-sticky-action-bar {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)) 14px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-sticky-action-bar.is-visible {
    transform: translateY(0);
  }

  .mobile-sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
  }

  .mobile-sticky-metrics {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
  }

  .mobile-metric-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-metric-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #94a3b8);
    line-height: 1.1;
  }

  .mobile-metric-val {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
  }

  .mobile-metric-val.emerald {
    color: var(--accent-emerald, #10b981);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
  }

  .mobile-metric-val.emerald.negative {
    color: var(--accent-rose, #ef4444);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
  }

  .mobile-metric-val.amber {
    color: #fbbf24;
  }

  .btn-mobile-quick-log {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md, 8px);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 8px 14px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
    transition: all 0.15s ease;
    flex-shrink: 0;
  }

  .btn-mobile-quick-log:active {
    transform: scale(0.96);
  }

  /* Offset floating controls on mobile so they sit cleanly above the sticky bar */
  .theme-toggle-floating {
    bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .floating-quick-nav {
    bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
  }

  [data-theme="light"] .mobile-sticky-action-bar {
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }

  [data-theme="light"] .mobile-metric-val {
    color: #0f172a;
  }

  [data-theme="light"] .mobile-metric-val.emerald {
    color: #059669;
  }

  [data-theme="light"] .mobile-metric-val.amber {
    color: #d97706;
  }
}

/* ==========================================================================
   Treasury Shield & Capital Reserve Engine Styling
   ========================================================================== */

.target-engine-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.treasury-shield-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  padding: 4px 8px;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
}

.treasury-shield-toggle-wrap.mini {
  padding: 3px 6px;
  gap: 6px;
}

.treasury-toggle-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  display: flex;
  align-items: center;
  gap: 4px;
}

.treasury-shield-toggle-wrap.mini .treasury-toggle-label {
  font-size: 0.72rem;
}

.treasury-pill-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.6);
  padding: 2px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.treasury-shield-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.treasury-shield-toggle-wrap.mini .treasury-shield-toggle-btn {
  padding: 3px 8px;
  font-size: 0.68rem;
}

.treasury-shield-toggle-btn:hover {
  color: var(--text-primary, #f8fafc);
}

.treasury-shield-toggle-btn.active[data-shield-state="off"] {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary, #cbd5e1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.treasury-shield-toggle-btn.active[data-shield-state="on"] {
  background: var(--accent-emerald, #10b981);
  color: #ffffff;
  box-shadow: 0 1px 6px rgba(16, 185, 129, 0.4);
}

/* Treasury Shield Drawer */
.treasury-shield-drawer {
  margin-bottom: 24px;
  animation: fadeInDown 0.2s ease-out;
}

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

.treasury-card {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg, 12px);
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 12px rgba(16, 185, 129, 0.08);
}

.treasury-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #1e293b);
}

.treasury-header-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.treasury-icon {
  font-size: 1.5rem;
  line-height: 1;
  padding: 8px;
  background: rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-md, 8px);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.treasury-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.treasury-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin: 0;
  max-width: 600px;
  line-height: 1.4;
}

.treasury-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 10px 18px;
  border-radius: var(--radius-md, 8px);
}

.dry-powder-hero-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-emerald, #10b981);
}

.dry-powder-hero-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #10b981;
  line-height: 1.2;
}

.dry-powder-hero-val.deficit {
  color: #ef4444;
}

.btn-treasury-export {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald, #10b981);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-treasury-export:hover {
  background: var(--accent-emerald, #10b981);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .btn-treasury-export {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
}

[data-theme="light"] .btn-treasury-export:hover {
  background: #059669;
  color: #ffffff;
}

/* Micro-Tooltip Trigger & Bubble */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  margin-left: 4px;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-emerald, #10b981);
  color: #ffffff;
}

.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  width: max-content;
  max-width: 240px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 9999;
  text-align: left;
}

.tooltip-trigger:hover::after,
.tooltip-trigger:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

[data-theme="light"] .tooltip-trigger {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.15);
  color: #64748b;
}

[data-theme="light"] .tooltip-trigger::after {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.1);
}

/* Inputs Grid */
.treasury-inputs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .treasury-inputs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .treasury-inputs-grid {
    grid-template-columns: 1fr;
  }
}

.treasury-field-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
}

.treasury-label-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 28px;
  gap: 6px;
}

.treasury-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  line-height: 1.25;
}

.treasury-tip {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  flex-shrink: 0;
}

.treasury-field-group .calc-input-wrapper {
  height: 42px;
}

.treasury-floor-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  height: 42px;
  align-items: center;
}

.treasury-floor-chip {
  background: var(--bg-surface, #0b1120);
  border: 1px solid var(--border, #1e293b);
  color: var(--text-secondary, #cbd5e1);
  padding: 0 4px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.treasury-floor-chip:hover {
  border-color: var(--accent-emerald, #10b981);
  color: var(--text-primary, #f8fafc);
}

.treasury-floor-chip.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald, #10b981);
  color: var(--accent-emerald, #10b981);
  font-weight: 800;
}

.treasury-field-group .calc-helper-text {
  min-height: 32px;
  line-height: 1.35;
  margin-top: 2px;
}

/* Tri-Color Stacked Waterfall Visual Progress Bar */
.treasury-waterfall-card {
  background: rgba(11, 17, 32, 0.75);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-md, 8px);
  padding: 16px;
}

.wf-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.wf-bar-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wf-bar-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.wf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary, #cbd5e1);
}

.wf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.wf-dot.overhead { background: #38bdf8; }
.wf-dot.float { background: #f59e0b; }
.wf-dot.reserve { background: #a855f7; }
.wf-dot.deployable { background: #10b981; }

.wf-bar-track {
  display: flex;
  height: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wf-bar-segment {
  height: 100%;
  transition: width 0.25s ease;
}

.wf-segment-overhead {
  background: #38bdf8;
}

.wf-segment-float {
  background: #f59e0b;
}

.wf-segment-reserve {
  background: #a855f7;
}

.wf-segment-deployable {
  background: #10b981;
}

.wf-segment-lockout {
  background: #ef4444;
}

.wf-segment-empty {
  background: rgba(148, 163, 184, 0.2);
}

.wf-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 850px) {
  .wf-breakdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .wf-breakdown-cell.highlight {
    grid-column: span 2;
  }
}

.wf-breakdown-cell {
  background: var(--bg-surface, #0b1120);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-sm, 6px);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wf-breakdown-cell.highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

.wf-cell-lbl {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
}

.wf-cell-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.wf-cell-val.deduction {
  color: #f59e0b;
}

.wf-cell-val.deployable {
  color: #10b981;
  font-weight: 800;
}

.target-treasury-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--accent-emerald, #10b981);
  font-weight: 700;
  margin-top: 4px;
}

/* Stage 1: Single-Lead Allocation Gate in Calculator */
.lead-allocation-gate {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  margin-top: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lead-allocation-gate.safe {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.lead-allocation-gate.caution {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.06);
}

.lead-allocation-gate.breach {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.lead-gate-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  line-height: 1.2;
  white-space: nowrap;
}

.lead-gate-badge.safe {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.lead-gate-badge.caution {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.lead-gate-badge.breach {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.lead-gate-desc {
  font-size: 0.75rem;
  color: var(--text-secondary, #cbd5e1);
  margin: 0;
  flex: 1;
  line-height: 1.4;
}

/* Stage 2: Aggregate Scratchpad Portfolio Health Gate */
.scratchpad-treasury-banner {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.scratchpad-treasury-banner.status-optimal {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.04);
}

.scratchpad-treasury-banner.status-caution {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.04);
}

.scratchpad-treasury-banner.status-buffer {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.04);
}

.scratchpad-treasury-banner.status-lockout {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.scratchpad-treasury-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.scratchpad-treasury-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scratchpad-treasury-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.scratchpad-treasury-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
}

.scratchpad-health-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
}

.scratchpad-health-badge.optimal {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.scratchpad-health-badge.caution {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.scratchpad-health-badge.buffer {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.scratchpad-health-badge.lockout {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.scratchpad-health-desc {
  font-size: 0.75rem;
  color: var(--text-secondary, #cbd5e1);
  margin: 2px 0 0 0;
}

.scratchpad-runway-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.scratchpad-runway-lbl {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.scratchpad-runway-val {
  font-size: 1.15rem;
  font-weight: 800;
}

.scratchpad-runway-val.positive {
  color: #10b981;
}

.scratchpad-runway-val.negative {
  color: #ef4444;
}

.scratchpad-health-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scratchpad-health-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scratchpad-health-fill {
  height: 100%;
  transition: width 0.25s ease;
}

.scratchpad-health-fill.optimal { background: #10b981; }
.scratchpad-health-fill.caution { background: #f59e0b; }
.scratchpad-health-fill.buffer { background: #f97316; }
.scratchpad-health-fill.lockout { background: #ef4444; }

.scratchpad-health-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  flex-wrap: wrap;
  gap: 8px;
}

/* Light Theme Overrides */
html[data-theme="light"] .treasury-shield-toggle-wrap {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .treasury-pill-group {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .treasury-shield-toggle-btn.active[data-shield-state="off"] {
  background: #e2e8f0;
  color: #334155;
}

html[data-theme="light"] .treasury-card {
  background: #ffffff;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .treasury-hero-stat {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

html[data-theme="light"] .treasury-floor-chip {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

html[data-theme="light"] .treasury-floor-chip.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #059669;
}

html[data-theme="light"] .treasury-waterfall-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .wf-breakdown-cell {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .scratchpad-treasury-banner {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   Educational Knowledge Hub Section
   ========================================================================== */
.knowledge-hub-section {
  padding-top: 40px !important;
  padding-bottom: 60px !important;
  border-top: 1px solid var(--border-subtle);
}

.knowledge-hub-header {
  margin-bottom: 32px;
  text-align: left;
}

.knowledge-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 860px) {
  .knowledge-hub-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.knowledge-card {
  background: var(--bg-surface-elevated, #0e172e);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-lg, 12px);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth, 0.25s ease);
}

.knowledge-card:hover {
  border-color: var(--border-hover, #38bdf8);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.knowledge-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.knowledge-icon {
  font-size: 1.4rem;
  line-height: 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  flex-shrink: 0;
}

.knowledge-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin: 0;
  line-height: 1.35;
}

.knowledge-card-body {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary, #94a3b8);
}

.knowledge-card-body p {
  margin-bottom: 12px;
}

.knowledge-card-body p:last-child {
  margin-bottom: 0;
}

.knowledge-card-body ul {
  margin: 10px 0 12px 18px;
  padding: 0;
}

.knowledge-card-body li {
  margin-bottom: 6px;
}

.knowledge-formula-box {
  background: var(--bg-canvas, #070c1a);
  border: 1px solid var(--border, #1e293b);
  border-left: 3px solid var(--accent-emerald, #10b981);
  border-radius: var(--radius-sm, 6px);
  padding: 8px 12px;
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-emerald-light, #34d399);
  overflow-x: auto;
}

/* Pillar Guide Quick Links */
.knowledge-hub-footer-nav {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.hub-nav-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hub-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 860px) {
  .hub-links-grid {
    grid-template-columns: 1fr;
  }
}

.hub-link-card {
  background: var(--bg-surface, #090e1d);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-md, 10px);
  padding: 18px 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all var(--transition-smooth, 0.25s ease);
}

.hub-link-card:hover {
  border-color: var(--accent-emerald, #10b981);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
}

.hub-link-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  width: max-content;
}

.hub-link-badge.ebay {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.hub-link-badge.amazon {
  background: rgba(255, 153, 0, 0.15);
  color: #ffb733;
  border: 1px solid rgba(255, 153, 0, 0.35);
}

.hub-link-badge.usps {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.hub-link-card strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hub-link-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.hub-link-arrow {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-emerald, #10b981);
  margin-top: 4px;
}

/* Light Mode Overrides for Knowledge Hub */
html[data-theme="light"] .knowledge-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .knowledge-icon {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .knowledge-formula-box {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  border-left-color: #059669;
  color: #047857;
}

html[data-theme="light"] .hub-link-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .hub-link-card:hover {
  border-color: #059669;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.12);
}

/* --------------------------------------------------------------------------
   Decoupled Global Quantity Multiplier & Aggregate Deal Summary
   -------------------------------------------------------------------------- */
.cogs-qty-row {
  display: grid;
  grid-template-columns: 1fr 75px;
  gap: 8px;
  align-items: center;
}

.aggregate-summary-card {
  background: var(--bg-surface, #161f30);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-md, 8px);
  padding: 12px 16px;
  margin-bottom: 12px;
  transition: all 0.25s ease;
}

[data-theme="light"] .aggregate-summary-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
}

.qty-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
}

[data-theme="light"] .qty-pill {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
}

/* --------------------------------------------------------------------------
   Real-Time Buyer Offer & Counter-Negotiator Matrix
   -------------------------------------------------------------------------- */
.offer-negotiator-card {
  background: var(--bg-surface-elevated, #161f30);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: var(--radius-lg, 12px);
  margin-top: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.offer-negotiator-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .offer-negotiator-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .offer-negotiator-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
}

.offer-negotiator-card.collapsed .offer-negotiator-header {
  border-bottom: none;
}

.offer-negotiator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color, #1e293b);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.offer-negotiator-header:hover {
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .offer-negotiator-header {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .offer-negotiator-header:hover {
  background: #e2e8f0;
}

.offer-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.offer-preview-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="light"] .offer-preview-badge {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
}

.offer-negotiator-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.offer-negotiator-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.offer-negotiator-title-text {
  display: flex;
  flex-direction: column;
}

.offer-negotiator-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  letter-spacing: -0.01em;
}

[data-theme="light"] .offer-negotiator-title {
  color: #0f172a;
}

.offer-negotiator-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
}

.btn-toggle-offer-drawer {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.btn-toggle-offer-drawer:hover {
  color: var(--text-primary, #f8fafc);
}

.offer-drawer-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.offer-drawer-arrow.collapsed {
  transform: rotate(-90deg);
}

.offer-negotiator-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offer-negotiator-body.hidden {
  display: none;
}

/* Offer Input & Presets */
.offer-status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.offer-status-pill.safe {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.offer-status-pill.caution {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.offer-status-pill.loss {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.offer-preset-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.offer-chip {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--text-secondary, #cbd5e1);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.offer-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.offer-chip.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

[data-theme="light"] .offer-chip {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  color: #475569;
}

[data-theme="light"] .offer-chip:hover {
  background: rgba(2, 132, 199, 0.1);
  border-color: #0284c7;
  color: #0284c7;
}

[data-theme="light"] .offer-chip.active {
  background: rgba(2, 132, 199, 0.15);
  border-color: #0284c7;
  color: #0284c7;
}

/* Outcome Strip */
.offer-outcome-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
}

[data-theme="light"] .offer-outcome-strip {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

.offer-outcome-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.offer-outcome-lbl {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.offer-outcome-val {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  font-family: var(--font-mono, monospace);
}

.offer-outcome-val.impact-neg {
  color: #f59e0b;
}

.offer-outcome-val.impact-pos {
  color: #10b981;
}

/* 3-Tier Recommendation Cards Grid */
.counter-tiers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.counter-tier-card {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

[data-theme="light"] .counter-tier-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

.counter-tier-card.tier-sweet-spot {
  border-left: 3px solid #10b981;
}

.counter-tier-card.tier-turnaround {
  border-left: 3px solid #f59e0b;
}

.counter-tier-card.tier-walkaway {
  border-left: 3px solid #ef4444;
}

.counter-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.counter-tier-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.counter-tier-badge.badge-green { color: #10b981; }
.counter-tier-badge.badge-amber { color: #f59e0b; }
.counter-tier-badge.badge-rose  { color: #ef4444; }

.counter-tier-price {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: var(--text-primary, #f8fafc);
}

[data-theme="light"] .counter-tier-price {
  color: #0f172a;
}

.counter-tier-desc {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text-secondary, #cbd5e1);
  margin: 0;
}

[data-theme="light"] .counter-tier-desc {
  color: #475569;
}

.counter-tier-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.btn-counter-action {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-counter-action:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.btn-counter-copy {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-muted, #94a3b8);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-counter-copy:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-primary, #f8fafc);
}

.counter-tier-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.counter-tier-status.status-safe {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.counter-tier-status.status-danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Master Log Counter Button */
.btn-log-counter-offer {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-log-counter-offer:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.15) 100%);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
}

[data-theme="light"] .btn-log-counter-offer {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(217, 119, 6, 0.35);
  color: #b45309;
}

[data-theme="light"] .btn-log-counter-offer:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #d97706;
  color: #92400e;
}

@media (max-width: 640px) {
  .offer-preset-chips {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Collapsible Waterfall Ledger & Multi-Channel Scoreboard Cards
   -------------------------------------------------------------------------- */
.waterfall-ledger-card {
  background: var(--bg-surface-elevated, #161f30);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: var(--radius-lg, 12px);
  margin-top: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.waterfall-ledger-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .waterfall-ledger-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .waterfall-ledger-card:hover {
  border-color: rgba(5, 150, 105, 0.4);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.08);
}

.waterfall-ledger-card.collapsed .waterfall-ledger-header {
  border-bottom: none;
}

.waterfall-ledger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color, #1e293b);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.waterfall-ledger-header:hover {
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .waterfall-ledger-header {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .waterfall-ledger-header:hover {
  background: #e2e8f0;
}

.waterfall-header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.waterfall-header-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.waterfall-header-text {
  display: flex;
  flex-direction: column;
}

.waterfall-header-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  letter-spacing: -0.01em;
}

[data-theme="light"] .waterfall-header-title {
  color: #0f172a;
}

.waterfall-header-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
}

.waterfall-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.waterfall-preview-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="light"] .waterfall-preview-badge {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.btn-toggle-waterfall-drawer,
.btn-toggle-matrix-drawer {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.btn-toggle-waterfall-drawer:hover,
.btn-toggle-matrix-drawer:hover {
  color: var(--text-primary, #f8fafc);
}

.waterfall-drawer-arrow,
.matrix-drawer-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.waterfall-drawer-arrow.collapsed,
.matrix-drawer-arrow.collapsed {
  transform: rotate(-90deg);
}

.waterfall-ledger-body,
.channel-matrix-body {
  padding: 14px 16px;
  transition: all 0.25s ease;
}

.waterfall-ledger-body.hidden,
.channel-matrix-body.hidden {
  display: none;
}

/* Multi-Channel Scoreboard Card */
.channel-matrix-container {
  border: 1px solid var(--border-color, #1e293b);
  border-radius: var(--radius-lg, 12px);
  background: var(--bg-surface-elevated, #161f30);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.channel-matrix-container:hover {
  border-color: rgba(234, 179, 8, 0.4);
}

[data-theme="light"] .channel-matrix-container {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .channel-matrix-container:hover {
  border-color: rgba(202, 138, 4, 0.4);
}

.channel-matrix-container.collapsed .channel-matrix-header {
  border-bottom: none;
}

.channel-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color, #1e293b);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.channel-matrix-header:hover {
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .channel-matrix-header {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .channel-matrix-header:hover {
  background: #e2e8f0;
}

.channel-matrix-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-matrix-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.channel-matrix-title-text {
  display: flex;
  flex-direction: column;
}

.channel-matrix-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  letter-spacing: -0.01em;
}

[data-theme="light"] .channel-matrix-title {
  color: #0f172a;
}

.channel-matrix-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
}

.channel-matrix-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-matrix-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.12);
  color: #eab308;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="light"] .channel-matrix-badge {
  background: rgba(202, 138, 4, 0.1);
  color: #ca8a04;
/* =========================================================================
   Universal Multi-Platform Smart Import Modal Styling
   ========================================================================= */
.smart-paste-tabs {
  display: flex !important;
  gap: 6px !important;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  padding: 5px !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  flex-wrap: wrap !important;
}

.smart-tab-btn {
  flex: 1 1 110px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 8px 12px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-shadow: none !important;
}

.smart-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.smart-tab-btn:active {
  transform: scale(0.97) !important;
}

.smart-tab-btn.active {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

.smart-tab-btn[data-platform="ebay"].active {
  background: rgba(234, 179, 8, 0.2) !important;
  color: #facc15 !important;
  border-color: #eab308 !important;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

.smart-tab-btn[data-platform="mercari"].active {
  background: rgba(168, 85, 247, 0.2) !important;
  color: #c084fc !important;
  border-color: #a855f7 !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

.smart-tab-btn[data-platform="poshmark"].active {
  background: rgba(244, 63, 94, 0.2) !important;
  color: #fb7185 !important;
  border-color: #f43f5e !important;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

[data-theme="light"] .smart-paste-tabs {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .smart-tab-btn {
  color: #64748b !important;
}

[data-theme="light"] .smart-tab-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .smart-tab-btn.active {
  background: #ffffff !important;
  color: #0284c7 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.25) !important;
}

[data-theme="light"] .smart-tab-btn[data-platform="ebay"].active {
  background: #ffffff !important;
  color: #a16207 !important;
  border-color: #eab308 !important;
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.25) !important;
}

[data-theme="light"] .smart-tab-btn[data-platform="mercari"].active {
  background: #ffffff !important;
  color: #7e22ce !important;
  border-color: #a855f7 !important;
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.25) !important;
}

[data-theme="light"] .smart-tab-btn[data-platform="poshmark"].active {
  background: #ffffff !important;
  color: #be123c !important;
  border-color: #f43f5e !important;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.25) !important;
}



