/* ============================================================================
   car-guy.css — "Deal Desk" feel layer (2026-06-04)
   Additive + reversible: remove the <link> to revert. No existing rules edited.
   Brief: confident/urgent/car-world, scoreboard typography, functional-urgency
   color (red=danger, green=money, yellow=act-now), cards-over-tables, mobile-first,
   speed (slide-in modals, live pulse), ambient Louie.
   ============================================================================ */

:root {
  --cg-danger: #d92d20;   /* red — aging, stips, lost, unfunded */
  --cg-danger-bg: #fef3f2;
  --cg-warn:   #b54708;   /* amber — act now, stalling, behind pace */
  --cg-warn-bg: #fffaeb;
  --cg-money:  #067647;   /* green — funded, approved, sold, ahead */
  --cg-money-bg: #ecfdf3;
  --cg-ink:    #0f172a;
  --cg-mute:   #5e728d;
}

/* ── Status signals: apply to any card/metric/badge ───────────────────────── */
.cg-danger { color: var(--cg-danger) !important; }
.cg-warn   { color: var(--cg-warn)  !important; }
.cg-money  { color: var(--cg-money) !important; }
.cg-state-danger { border-left: 4px solid var(--cg-danger) !important; background: var(--cg-danger-bg); }
.cg-state-warn   { border-left: 4px solid var(--cg-warn)  !important; background: var(--cg-warn-bg); }
.cg-state-money  { border-left: 4px solid var(--cg-money) !important; background: var(--cg-money-bg); }

.cg-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.cg-pill.danger { color: var(--cg-danger); background: var(--cg-danger-bg); }
.cg-pill.warn   { color: var(--cg-warn);   background: var(--cg-warn-bg); }
.cg-pill.money  { color: var(--cg-money);  background: var(--cg-money-bg); }

/* ── Scoreboard typography: the number a GM cares about can't be missed ────── */
.cg-score {
  font: 800 clamp(28px, 5vw, 44px)/0.95 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  color: var(--cg-ink); display: block;
}
.cg-score-label {
  font: 600 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .08em; text-transform: uppercase; color: var(--cg-mute);
  margin-bottom: 4px; display: block;
}

/* ── Deal cards (file-on-a-desk): name big, car below, gross bold-right ────── */
.cg-deal-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px 16px; display: grid; grid-template-columns: 1fr auto;
  gap: 4px 12px; align-items: start; transition: box-shadow .15s, transform .15s;
}
.cg-deal-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.10); transform: translateY(-1px); }
.cg-deal-name { font: 700 16px/1.2 'Plus Jakarta Sans', sans-serif; color: var(--cg-ink); }
.cg-deal-car  { font: 500 13px/1.3 'Plus Jakarta Sans', sans-serif; color: var(--cg-mute); }
.cg-deal-gross{ font: 800 18px/1 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; text-align: right; }

/* ── ⚡ Louie micro-badge for AI-generated output ─────────────────────────── */
.cg-louie-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font: 700 10px/1 'JetBrains Mono', ui-monospace, monospace;
  color: #003478; background: #eaf1fb; border: 1px solid #cfe0f7;
  padding: 2px 6px 2px 5px; border-radius: 6px; letter-spacing: .03em;
  vertical-align: middle;
}
.cg-louie-badge::before { content: '\26A1'; font-size: 11px; }

/* ── Ambient "Louie says…" bar: surfaced atop the main content area ───────── */
#louie-ambient {
  display: none; align-items: center; gap: 12px;
  margin: 12px 16px 0; padding: 11px 14px;
  border: 1px solid #e2e8f0; border-left: 4px solid #003478; border-radius: 10px;
  background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.05);
  font: 500 14px/1.4 'Plus Jakarta Sans', sans-serif; color: var(--cg-ink);
}
#louie-ambient.cg-state-danger { border-left-color: var(--cg-danger); }
#louie-ambient.cg-state-warn   { border-left-color: var(--cg-warn); }
#louie-ambient.cg-state-money  { border-left-color: var(--cg-money); }
#louie-ambient .cg-ambient-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  background: #003478; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; position: relative;
}
/* live pulse — signals the platform is "breathing" */
#louie-ambient .cg-ambient-avatar::after {
  content: ''; position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--cg-money);
  box-shadow: 0 0 0 0 rgba(6,118,71,.6); animation: cg-pulse 2.4s infinite;
}
#louie-ambient .cg-ambient-text { flex: 1; min-width: 0; }
#louie-ambient .cg-ambient-text b { font-weight: 700; }
#louie-ambient .cg-ambient-dismiss {
  flex: 0 0 auto; background: none; border: none; color: var(--cg-mute);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 4px;
}
@keyframes cg-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(6,118,71,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(6,118,71,0); }
  100% { box-shadow: 0 0 0 0 rgba(6,118,71,0); }
}

/* ── Speed feel: modals slide in instead of fading slowly ─────────────────── */
@keyframes cg-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cg-slide-in { animation: cg-slide-in .18s cubic-bezier(.22,.61,.36,1) both; }

/* ── Mobile-first: works on a 390px iPhone without pinching ───────────────── */
@media (max-width: 480px) {
  #louie-ambient { margin: 8px 10px 0; font-size: 13px; padding: 10px 12px; }
  .cg-score { font-size: clamp(24px, 8vw, 34px); }
  .cg-deal-card { grid-template-columns: 1fr; }
  .cg-deal-gross { text-align: left; }
  /* 40px+ tap targets on the brief's "instant" surfaces */
  #louie-ambient .cg-ambient-dismiss { padding: 8px; min-width: 40px; min-height: 40px; }
}
