/* ═══════════════════════════════════════════════════════════════
   GOLDEN RIVER — DESIGN SYSTEM
   Cream / Charcoal / Muted Gold / Subtle Blue
   Fonts: Playfair Display · DM Sans · JetBrains Mono
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── ROOT VARIABLES ───────────────────────────────────────────── */
:root {
  /* Cream palette */
  --cream:      #F9F5EA;
  --cream-d:    #EFE9D5;
  --cream-dd:   #E4DCC5;
  --cream-ddd:  #D8CFB5;

  /* Gold */
  --gold:       #C49B2A;
  --gold-l:     #DDB93E;
  --gold-d:     #A07E1E;
  --gold-glow:  rgba(196,155,42,0.15);
  --gold-glow-s:rgba(196,155,42,0.08);

  /* Ink / charcoal */
  --ink:        #18130D;
  --ink-l:      #3D3529;
  --ink-m:      #7A6E5F;
  --ink-faint:  #B0A494;
  --ink-ghost:  rgba(24,19,13,0.04);

  /* White */
  --white:      #FFFFFF;
  --white-90:   rgba(255,255,255,0.9);

  /* Accents */
  --blue:       #2A5FA0;
  --blue-l:     rgba(42,95,160,0.12);

  /* Severity */
  --critical:   #C0392B;
  --high:       #D4680E;
  --strategic:  #C49B2A;
  --watch:      #2D7D4E;
  --critical-bg: rgba(192,57,43,0.08);
  --high-bg:     rgba(212,104,14,0.08);
  --strategic-bg:rgba(196,155,42,0.10);
  --watch-bg:    rgba(45,125,78,0.08);

  /* Borders */
  --border:     rgba(196,155,42,0.22);
  --border-s:   rgba(196,155,42,0.12);
  --border-ink: rgba(24,19,13,0.10);

  /* Shadows */
  --shadow:    0 2px 12px rgba(24,19,13,0.07);
  --shadow-md: 0 4px 24px rgba(24,19,13,0.09);
  --shadow-lg: 0 8px 40px rgba(24,19,13,0.11);
  --shadow-xl: 0 16px 64px rgba(24,19,13,0.13);
  --shadow-card: 0 4px 20px rgba(24,19,13,0.06), 0 1px 3px rgba(24,19,13,0.04);

  /* Front page / intake */
  --card-bg:     #FDFCF9;
  --auto-accent:  #2A8FBD;
  --auto-accent-bg: rgba(43,143,189,0.06);
  --auto-accent-border: rgba(43,143,189,0.2);

  /* Radii */
  --r-sm:  6px;
  --r:     10px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;

  /* Layout */
  --topbar-h:     60px;
  --sidebar-l-w:  256px;
  --sidebar-r-w:  272px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── RESET ────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; height: 100%; width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-ddd); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ── APP SHELL ────────────────────────────────────────────────── */
.gr-app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  min-width: 0;
}

/* ── TOPBAR ───────────────────────────────────────────────────── */
.gr-topbar {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border-ink);
  box-shadow: 0 1px 8px rgba(24,19,13,0.06);
  z-index: 100;
  min-width: 0;
  position: relative;
}

.gr-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.gr-brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(145deg, var(--ink) 0%, var(--ink-l) 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(24,19,13,0.15);
}
.gr-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.2;
}
.gr-brand-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--ink-faint);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── STAGE NAV ────────────────────────────────────────────────── */
.gr-stage-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
  padding: 0 20px;
  overflow: hidden;
}
.gr-stage-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r);
  cursor: default;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
  position: relative;
}
.gr-stage-step.clickable { cursor: pointer; }
.gr-stage-step.clickable:hover { background: var(--gold-glow-s); }

.gr-step-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  border: 1.5px solid var(--cream-ddd);
  background: var(--cream-d);
  color: var(--ink-faint);
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
}
.gr-step-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-faint);
  transition: color 0.2s;
  white-space: nowrap;
}
.gr-step-connector {
  width: 24px;
  height: 1px;
  background: var(--cream-ddd);
  flex-shrink: 0;
  transition: background 0.3s;
}

/* Stage states */
.gr-stage-step.state-pending  .gr-step-dot { border-color: var(--cream-ddd); }
.gr-stage-step.state-active   .gr-step-dot {
  background: var(--ink); border-color: var(--ink);
  color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow);
}
.gr-stage-step.state-active   .gr-step-label { color: var(--ink); font-weight: 600; }
.gr-stage-step.state-complete .gr-step-dot {
  background: var(--gold); border-color: var(--gold); color: var(--white);
}
.gr-stage-step.state-complete .gr-step-label { color: var(--gold-d); }
.gr-stage-step.state-complete + .gr-step-connector { background: var(--gold); }

/* ── NOTIFY GLOW — stage completed in background ─────────────────── */
.gr-notify-dot {
  position: absolute;
  top: 2px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(196,155,42,0.7);
  animation: notifyPulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes notifyPulse {
  0%   { box-shadow: 0 0 0 0   rgba(196,155,42,0.7); }
  60%  { box-shadow: 0 0 0 6px rgba(196,155,42,0); }
  100% { box-shadow: 0 0 0 0   rgba(196,155,42,0); }
}

/* Step label subtly brightens when notified */
.gr-stage-step.has-notify .gr-step-label {
  color: var(--gold-d);
  font-weight: 600;
}
/* Step dot gets a gold ring */
.gr-stage-step.has-notify .gr-step-dot {
  border-color: var(--gold);
  color: var(--gold-d);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

/* ── TOPBAR ACTIONS ───────────────────────────────────────────── */
.gr-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.gr-btn-icon {
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--border-ink);
  border-radius: var(--r-sm);
  color: var(--ink-m);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease);
}
.gr-btn-icon:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow-s);
}

/* ── AUTO MODE TOGGLE ─────────────────────────────────────────── */
.gr-auto-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(249,245,234,0.14);
  background: transparent;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.gr-auto-toggle-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(249,245,234,0.2);
  transition: background 0.22s var(--ease), box-shadow 0.22s var(--ease);
  flex-shrink: 0;
}
.gr-auto-toggle-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  color: rgba(249,245,234,0.35);
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.22s var(--ease);
}
/* OFF hover */
.gr-auto-toggle:hover {
  border-color: rgba(91,200,255,0.35);
}
.gr-auto-toggle:hover .gr-auto-toggle-label { color: rgba(91,200,255,0.7); }
.gr-auto-toggle:hover .gr-auto-toggle-dot   { background: rgba(91,200,255,0.5); }
/* ON state */
.gr-auto-toggle.is-on {
  border-color: rgba(91,200,255,0.45);
  background: rgba(91,200,255,0.07);
}
.gr-auto-toggle.is-on .gr-auto-toggle-dot {
  background: #5BC8FF;
  box-shadow: 0 0 7px rgba(91,200,255,0.8);
}
.gr-auto-toggle.is-on .gr-auto-toggle-label { color: rgba(91,200,255,0.9); }
.gr-auto-toggle.is-on:hover { background: rgba(91,200,255,0.12); }

/* ── MAIN LAYOUT ──────────────────────────────────────────────── */
.gr-layout {
  grid-row: 2;
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr) 0;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
  transition: grid-template-columns 0.3s var(--ease);
  min-width: 0; /* allow shrink so layout stays within .gr-app */
}
.gr-layout.sidebar-left-open  { grid-template-columns: var(--sidebar-l-w) minmax(0, 1fr) 0; }
.gr-layout.sidebar-right-open { grid-template-columns: 0 minmax(0, 1fr) var(--sidebar-r-w); }
.gr-layout.both-open          { grid-template-columns: var(--sidebar-l-w) minmax(0, 1fr) var(--sidebar-r-w); }

/* ── SIDEBARS ─────────────────────────────────────────────────── */
.gr-sidebar {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s var(--ease);
  min-width: 0;
}
.gr-sidebar-left {
  border-right: 1px solid var(--border-ink);
  background: var(--white);
}
.gr-sidebar-right {
  border-left: 1px solid var(--border-ink);
  background: var(--white);
  overflow-y: auto;
}

.gr-sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-s);
}
.gr-sidebar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── MAIN CONTENT ─────────────────────────────────────────────── */
.gr-main {
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--cream);
  position: relative;
  min-width: 0; /* allow shrink so content doesn't force .gr-layout wider than .gr-app */
}

/* Stage sections */
.gr-stage { display: none; }
.gr-stage.gr-stage-active { display: block; }

/* ── QUEUE ITEMS ──────────────────────────────────────────────── */
.gr-queue-list, .gr-completed-list { display: flex; flex-direction: column; gap: 6px; }
.gr-queue-empty {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.gr-queue-item {
  padding: 10px 12px;
  background: var(--cream);
  border: 1px solid var(--border-s);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  position: relative;
}
.gr-queue-item:hover { border-color: var(--border); background: var(--cream-d); }
.gr-queue-item.is-active {
  background: var(--gold-glow);
  border-color: var(--gold);
}
.gr-queue-item.is-queued { border-left: 3px solid var(--blue); }
.gr-queue-item.is-completed {
  opacity: 0.6;
  border-left: 3px solid var(--watch);
}

.gr-qi-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 4px;
}
.gr-qi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gr-qi-ev {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--gold-d);
  font-weight: 500;
}
.gr-qi-status {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gr-qi-status.active    { background: var(--gold-glow); color: var(--gold-d); }
.gr-qi-status.queued    { background: var(--blue-l); color: var(--blue); }
.gr-qi-status.completed { background: var(--watch-bg); color: var(--watch); }

/* ── ACTIVE OPPORTUNITY SLOT ──────────────────────────────────── */
.gr-active-slot {
  min-height: 60px;
}
.gr-slot-empty {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}
.gr-active-card {
  padding: 12px;
  background: var(--gold-glow);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.gr-active-card .gr-qi-title { color: var(--gold-d); }

/* ── REVENUE RAIL ─────────────────────────────────────────────── */
.gr-revenue-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-s);
}
.gr-revenue-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.gr-revenue-sub {
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.gr-revenue-metrics { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }

.gr-revenue-metric {
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--border-s);
  border-radius: var(--r-sm);
  transition: all 0.2s;
}
.gr-revenue-metric.gr-metric-primary {
  background: var(--ink);
  border-color: var(--ink);
}
.gr-revenue-metric.gr-metric-gold {
  background: var(--gold-glow);
  border-color: var(--border);
}

.gr-metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.gr-metric-primary .gr-metric-label { color: rgba(249,245,234,0.5); }

.gr-metric-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.gr-metric-primary .gr-metric-value { color: var(--gold-l); }

.gr-metric-sub {
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 3px;
}
.gr-metric-primary .gr-metric-sub { color: rgba(249,245,234,0.4); }

/* ── ACTIVITY FEED ────────────────────────────────────────────── */
.gr-activity-section {
  padding: 12px 16px;
  border-top: 1px solid var(--border-s);
}
.gr-activity-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.gr-activity-feed { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.gr-activity-item {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-s);
  align-items: flex-start;
}
.gr-activity-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.gr-activity-dot.ok  { background: var(--watch); }
.gr-activity-dot.info{ background: var(--gold); }
.gr-activity-dot.warn{ background: var(--high); }
.gr-activity-dot.err { background: var(--critical); }

.gr-activity-text {
  font-size: 0.7rem;
  color: var(--ink-m);
  line-height: 1.4;
  flex: 1;
}
.gr-activity-empty {
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* ── CARDS ────────────────────────────────────────────────────── */
.gr-card {
  background: var(--white);
  border: 1px solid var(--border-s);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.gr-card + .gr-card { margin-top: 20px; }

.gr-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.gr-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.gr-card-sub {
  font-size: 0.8125rem;
  color: var(--ink-m);
  margin-top: 6px;
  line-height: 1.55;
}

/* ── FORM ELEMENTS ────────────────────────────────────────────── */
.gr-fg { display: flex; flex-direction: column; gap: 6px; }
.gr-fl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-m);
}
.gr-fi, .gr-ft, .gr-fs {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--cream-dd);
  border-radius: var(--r);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gr-fi:focus, .gr-ft:focus, .gr-fs:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.gr-ft { min-height: 84px; resize: vertical; line-height: 1.6; }
.gr-fh { font-size: 0.75rem; color: var(--ink-faint); line-height: 1.45; }

.gr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gr-form-row.full { grid-template-columns: 1fr; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.gr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--r);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.gr-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.gr-btn-primary {
  background: var(--ink);
  color: var(--cream);
}
.gr-btn-primary:hover:not(:disabled) {
  background: var(--ink-l);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(24,19,13,0.20);
}

.gr-btn-gold {
  background: var(--gold);
  color: var(--white);
}
.gr-btn-gold:hover:not(:disabled) {
  background: var(--gold-l);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196,155,42,0.30);
}

.gr-btn-outline {
  background: transparent;
  border: 1.5px solid var(--cream-dd);
  color: var(--ink-m);
}
.gr-btn-outline:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow-s);
}

.gr-btn-ghost {
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--ink-m);
}
.gr-btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--cream-d); }

.gr-btn-sm { padding: 7px 14px; font-size: 0.78rem; }
.gr-btn-lg { padding: 13px 28px; font-size: 0.96rem; }

/* Button actions row */
.gr-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border-s);
  margin-top: 20px;
}

/* ── BADGES ───────────────────────────────────────────────────── */
.gr-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
}
.gr-badge-count {
  background: var(--ink);
  color: var(--cream);
}
.gr-badge-critical {
  background: var(--critical);
  color: var(--white);
  border: 1px solid var(--critical);
  font-weight: 700;
}
.gr-badge-high {
  background: var(--high);
  color: var(--white);
  border: 1px solid var(--high);
  font-weight: 700;
}
.gr-badge-strategic {
  background: var(--gold);
  color: var(--white);
  border: 1px solid var(--gold);
  font-weight: 700;
}
.gr-badge-watch {
  background: var(--watch-bg);
  color: var(--watch);
  border: 1px solid rgba(45,125,78,0.2);
}
.gr-badge-category {
  background: var(--blue-l);
  color: var(--blue);
  border: 1px solid rgba(42,95,160,0.2);
}

/* ── CONFIDENCE INDICATOR ─────────────────────────────────────── */
.gr-confidence {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gr-conf-bar {
  width: 32px;
  height: 4px;
  background: var(--cream-dd);
  border-radius: 2px;
  overflow: hidden;
}
.gr-conf-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gold);
  transition: width 0.3s;
}
.gr-conf-fill.high   { background: var(--watch); }
.gr-conf-fill.medium { background: var(--gold); }
.gr-conf-fill.low    { background: var(--ink-faint); }

.gr-conf-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--ink-faint);
}

/* ── PROGRESS PIPELINE ────────────────────────────────────────── */
/* ── SCAN CHAMBER ─────────────────────────────────────────────── */
.gr-pipeline {
  background: var(--ink);
  border: 1px solid rgba(196,155,42,0.28);
  border-radius: var(--r-lg);
  padding: 0;
  margin: 24px 0;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 60px rgba(196,155,42,0.03), 0 4px 24px rgba(24,19,13,0.18);
}

/* Scanline overlay — subtle CRT texture across the whole chamber */
.gr-pipeline::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 1;
  border-radius: var(--r-lg);
}

/* ── ORBITAL / RADAR CORE ── */
.gr-scan-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px 28px;
  width: 100%;
  z-index: 2;
}

.gr-orbit-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Idle diamond breath — kept for pre-scan state */
@keyframes diamondBreath {
  0%, 100% { opacity: 0.75; }
  50%       { opacity: 1; filter: drop-shadow(0 0 6px rgba(196,155,42,0.8)); }
}

/* ── PASS LABEL AREA ── */
.gr-pipe-header {
  text-align: center;
  margin-bottom: 6px;
}
.gr-pipe-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(249,245,234,0.92);
  letter-spacing: 0.01em;
  min-height: 1.4em;
  transition: opacity 0.3s;
}
.gr-pipe-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: rgba(196,155,42,0.75);  /* was 0.6 */
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── SHIMMER PROGRESS BAR ── */
.gr-pipe-bar {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.06);
  margin-bottom: 0;
  overflow: hidden;
  position: relative;
}
.gr-pipe-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(196,155,42,0.5), var(--gold), rgba(221,185,62,0.9));
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
  position: relative;
}
/* Shimmer highlight on the fill */
.gr-pipe-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: barShimmer 1.8s ease-in-out infinite;
}
@keyframes barShimmer {
  0%   { transform: translateX(-60px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateX(30px); opacity: 0; }
}

/* ── PASS CHIPS ── */
.gr-pipe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 18px 28px 4px;
  justify-content: center;
  z-index: 2;
  position: relative;
}
.gr-pass-chip {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  text-align: center;
  transition: all 0.3s var(--ease);
  min-width: 58px;
  position: relative;
  overflow: hidden;
}
/* Sweep-in highlight on activation */
.gr-pass-chip.state-running {
  border-color: rgba(196,155,42,0.55);
  background: rgba(196,155,42,0.08);
}
.gr-pass-chip.state-running::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; bottom: 0; width: 100%;
  background: linear-gradient(90deg, transparent, rgba(196,155,42,0.18), transparent);
  animation: chipSweep 1.6s ease-in-out infinite;
}
@keyframes chipSweep {
  0%   { left: -100%; }
  100% { left: 100%; }
}
.gr-pass-chip.state-done {
  border-color: rgba(45,125,78,0.28);
  background: rgba(45,125,78,0.06);
}
.gr-pass-chip.state-error {
  border-color: rgba(192,57,43,0.3);
  background: rgba(192,57,43,0.06);
}
.gr-pass-chip-label {
  font-size: 0.58rem;
  color: rgba(249,245,234,0.78);
  line-height: 1.2;
  transition: color 0.3s;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}
.gr-pass-chip.state-running .gr-pass-chip-label { color: rgba(196,155,42,0.95); }
.gr-pass-chip.state-done    .gr-pass-chip-label { color: rgba(149,210,175,0.92); }
/* Chip icon row */
.gr-pass-chip-icon {
  font-size: 0.85rem;
  margin-bottom: 2px;
  opacity: 0.75;
  transition: opacity 0.3s;
}
.gr-pass-chip.state-running .gr-pass-chip-icon { opacity: 1; }
.gr-pass-chip.state-done    .gr-pass-chip-icon { opacity: 0.88; }

/* ── STATUS LINE ── */
.gr-pipe-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(249,245,234,0.5);   /* was 0.4 */
  min-height: 18px;
  padding: 12px 28px 22px;
  text-align: center;
  letter-spacing: 0.3px;
  z-index: 2;
  position: relative;
}
.gr-pipe-status .s-running {
  color: rgba(196,155,42,0.88);   /* was 0.75 */
  animation: statusFade 0.4s ease;
}
.gr-pipe-status .s-done { color: rgba(120,210,155,0.9); }   /* was 0.8 — brighter green */
.gr-pipe-status .s-err  { color: rgba(220,90,80,0.95); }    /* was 0.85 */
@keyframes statusFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CLICKABLE METRIC VALUES ──────────────────────────────────────── */
.gr-metric-clickable {
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border-bottom: 1px dashed rgba(196,155,42,0.35);
  transition: border-color 0.15s;
}
.gr-metric-clickable:hover {
  border-bottom-color: var(--gold);
}
.gr-metric-why {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  font-weight: 700;
  color: rgba(196,155,42,0.55);
  background: rgba(196,155,42,0.1);
  border-radius: 50%;
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-bottom: 1px;
}
.gr-metric-clickable:hover .gr-metric-why {
  background: var(--gold);
  color: #fff;
}
.gr-opp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.gr-opp-card {
  background: var(--white);
  border: 1px solid rgba(24,19,13,0.10);
  border-radius: var(--r-lg);
  padding: 18px 20px 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(24,19,13,0.05);
}
.gr-opp-card:hover {
  border-color: rgba(24,19,13,0.18);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.gr-opp-card.selected { border-color: var(--gold); }
.gr-opp-card.is-active {
  border-color: var(--gold);
  box-shadow: var(--shadow-md), 0 0 0 2px var(--gold-glow);
}
.gr-opp-card.is-queued { border-color: var(--blue); border-top-width: 3px; }
.gr-opp-card.is-completed { opacity: 0.5; }

/* Top edge tier stripe — replaces left stripe */
.gr-opp-card-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stripe-critical  { background: var(--critical); }
.stripe-high      { background: var(--high); }
.stripe-strategic { background: var(--gold); }
.stripe-watch     { background: var(--watch); }

.gr-opp-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.gr-opp-card-badges { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.gr-opp-card-select {
  width: 20px; height: 20px;
  border: 1.5px solid var(--cream-dd);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
  background: var(--cream);
  margin-top: 2px;
}
.gr-opp-card.selected .gr-opp-card-select,
.gr-opp-card.is-active .gr-opp-card-select,
.gr-opp-card.is-queued .gr-opp-card-select {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}
.gr-opp-card-select::after { content: '✓'; font-size: 0.6rem; color: var(--white); display: none; }
.gr-opp-card.selected .gr-opp-card-select::after,
.gr-opp-card.is-active .gr-opp-card-select::after,
.gr-opp-card.is-queued .gr-opp-card-select::after { display: block; }

/* ── OPP CARD TYPOGRAPHY ──────────────────────────────────────── */
.gr-opp-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.gr-opp-subtitle {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-l);
  margin-bottom: 13px;
  line-height: 1.45;
}
.gr-opp-body {
  font-size: 0.82rem;
  color: var(--ink-l);
  line-height: 1.65;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gr-opp-body.expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}
.gr-opp-body strong, .gr-opp-body b {
  color: var(--ink);
  font-weight: 700;
}

/* ── WHY YOU — warm dark spotlight block ─────────────────────── */
.gr-opp-why-you {
  background: #2E2820;
  border-radius: var(--r-sm);
  padding: 13px 16px;
  margin-bottom: 14px;
  position: relative;
  border: 1px solid rgba(196,155,42,0.12);
}
.gr-opp-why-you-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.gr-opp-why-you-label::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}
.gr-opp-why-you-text {
  font-size: 0.84rem;
  color: rgba(249,245,234,0.88);
  line-height: 1.58;
  font-weight: 400;
}
.gr-opp-why-you-text strong, .gr-opp-why-you-text b {
  color: var(--cream);
  font-weight: 600;
}

/* ── ACT NOW — warm coaching strip ────────────────────────────── */
.gr-opp-why-now {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 13px;
  margin-bottom: 12px;
  background: rgba(212,104,14,0.06);
  border: 1px solid rgba(212,104,14,0.18);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  color: var(--ink-l);
  line-height: 1.55;
}
.gr-opp-why-now-icon { display: none; }
.gr-opp-why-now .act-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--high);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}
.gr-opp-why-now strong, .gr-opp-why-now b {
  color: var(--ink);
  font-weight: 700;
}

/* ── STATS GRID ───────────────────────────────────────────────── */
.gr-opp-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--cream-dd);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--cream-d);
}
.gr-opp-metric {
  text-align: center;
  background: #F4EDD8;
  padding: 11px 6px 10px;
  border-right: 1px solid var(--cream-dd);
  position: relative;
}
.gr-opp-metric:last-child { border-right: none; }
.gr-opp-metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
  line-height: 1.35;
}
.gr-opp-metric-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.gr-opp-metric-source {
  font-size: 0.54rem;
  color: var(--ink-faint);
  margin-top: 4px;
  line-height: 1.25;
  font-style: italic;
}
.gr-opp-metric-val.ev { color: var(--ink); }

/* ── NEXT MOVE — action block ─────────────────────────────────── */
.gr-opp-nextmove {
  padding: 10px 14px;
  background: rgba(196,155,42,0.06);
  border-radius: var(--r-sm);
  border: 1px solid rgba(196,155,42,0.18);
  margin-top: 4px;
  margin-bottom: 10px;
}
.gr-opp-nextmove-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold-d);
  font-weight: 600;
  margin-bottom: 5px;
}
.gr-opp-nextmove-text {
  font-size: 0.81rem;
  color: var(--ink-l);
  line-height: 1.55;
}
.gr-opp-nextmove-text strong, .gr-opp-nextmove-text b {
  color: var(--ink);
  font-weight: 700;
}

/* Number facts skeleton + animation */
@keyframes skelPulse {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.55; }
}
@keyframes factSlideIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gr-skel-pulse {
  animation: skelPulse 1.4s ease-in-out infinite;
  color: var(--ink-faint) !important;
  font-size: 0.9rem !important;
  letter-spacing: 3px;
}

/* ── CONTACT CARDS ────────────────────────────────────────────── */
.gr-contact-grid { display: flex; flex-direction: column; gap: 10px; }
.gr-contact-card {
  background: var(--white);
  border: 1.5px solid var(--border-s);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.gr-contact-card:hover { border-color: var(--border); box-shadow: var(--shadow); }
.gr-contact-card.selected { border-color: var(--gold); background: var(--gold-glow-s); }

.gr-contact-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.gr-contact-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink-l), var(--ink));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.gr-contact-name { font-weight: 600; color: var(--ink); font-size: 0.9rem; }
.gr-contact-role { font-size: 0.75rem; color: var(--ink-m); margin-top: 1px; }
.gr-contact-company { font-size: 0.72rem; color: var(--ink-faint); font-style: italic; }

.gr-contact-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.gr-contact-why {
  font-size: 0.78rem;
  color: var(--ink-m);
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--cream);
  border-radius: var(--r-sm);
}
.gr-contact-not-found {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-style: italic;
  padding: 4px 8px;
  background: var(--cream-d);
  border-radius: var(--r-sm);
  border: 1px dashed var(--cream-ddd);
  display: inline-block;
}

/* ── EMAIL PANEL ──────────────────────────────────────────────── */
.gr-email-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

.gr-email-controls { display: flex; flex-direction: column; gap: 14px; }
.gr-email-output-area {
  background: var(--white);
  border: 1px solid var(--border-s);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gr-email-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-s);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
}
.gr-email-subject-display {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-s);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--white);
}
.gr-email-subject-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--ink-faint);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.gr-email-body-display {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--ink-l);
  white-space: pre-wrap;
  font-family: 'DM Sans', sans-serif;
}
.gr-email-scores {
  padding: 14px 16px;
  border-top: 1px solid var(--border-s);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: var(--cream);
}
.gr-score-item { text-align: center; }
.gr-score-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--ink-faint);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.gr-score-val {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.gr-score-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--cream-dd);
  margin-top: 3px;
  overflow: hidden;
}
.gr-score-fill { height: 100%; border-radius: 2px; background: var(--gold); transition: width 0.5s; }

/* ── HERO METRICS (report header) ─────────────────────────────── */
.gr-report-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.gr-hero-metric {
  background: var(--white);
  border: 1px solid var(--border-s);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
}
.gr-hero-metric.accent-critical { border-color: rgba(192,57,43,0.3); }
.gr-hero-metric.accent-high     { border-color: rgba(212,104,14,0.3); }
.gr-hero-metric.accent-gold     { border-color: var(--border); background: var(--gold-glow-s); }
.gr-hero-metric.accent-watch    { border-color: rgba(45,125,78,0.3); }

.gr-hero-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.gr-hero-metric.accent-critical .gr-hero-num { color: var(--critical); }
.gr-hero-metric.accent-high     .gr-hero-num { color: var(--high); }
.gr-hero-metric.accent-gold     .gr-hero-num { color: var(--gold-d); }
.gr-hero-metric.accent-watch    .gr-hero-num { color: var(--watch); }

.gr-hero-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ── MODALS ───────────────────────────────────────────────────── */
.gr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24,19,13,0.55);
  backdrop-filter: blur(4px);
}
.gr-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--r-xl);
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s var(--ease-spring);
}
.gr-modal-wide { width: 700px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.gr-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.gr-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.gr-modal-close {
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--border-ink);
  border-radius: 6px;
  color: var(--ink-m);
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.gr-modal-close:hover { border-color: var(--critical); color: var(--critical); }

.gr-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.gr-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-ink);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* ── SETTINGS GROUPS ─────────────────────────────────────────── */
.gr-settings-group { margin-bottom: 24px; }
.gr-settings-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-s);
}
.gr-settings-row { display: flex; flex-direction: column; gap: 12px; }

/* ── PRICING CARDS ────────────────────────────────────────────── */
.gr-pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gr-pricing-card {
  border: 1.5px solid var(--border-s);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gr-pricing-featured {
  border-color: var(--border);
  background: var(--gold-glow-s);
  position: relative;
}
.gr-pricing-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.gr-pricing-badge-gold { color: var(--gold-d); }
.gr-pricing-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.gr-pricing-price {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-d);
  line-height: 1;
}
.gr-pricing-price span { font-size: 1rem; color: var(--ink-m); }
.gr-pricing-period { font-size: 0.72rem; color: var(--ink-faint); margin-top: -8px; }
.gr-pricing-desc { font-size: 0.8rem; color: var(--ink-m); line-height: 1.5; }
.gr-pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.gr-pricing-features li {
  font-size: 0.8rem;
  color: var(--ink-m);
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
}
.gr-pricing-features li::before {
  content: '◆';
  position: absolute;
  left: 0;
  font-size: 0.5rem;
  color: var(--gold);
  top: 3px;
}

/* ── TOAST ────────────────────────────────────────────────────── */
.gr-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--cream);
  padding: 10px 20px;
  border-radius: 40px;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.3s var(--ease-spring), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.gr-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.gr-toast.ok   { background: var(--watch); }
.gr-toast.err  { background: var(--critical); }
.gr-toast.info { background: var(--ink); }

/* ── EMPTY STATES ─────────────────────────────────────────────── */
.gr-empty {
  text-align: center;
  padding: 60px 24px;
  max-width: 400px;
  margin: 0 auto;
}
.gr-empty-icon { font-size: 2.5rem; margin-bottom: 16px; opacity: 0.4; }
.gr-empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--ink-l);
  margin-bottom: 8px;
}
.gr-empty-text { font-size: 0.82rem; color: var(--ink-faint); line-height: 1.6; }

/* ── LOADING SKELETON ─────────────────────────────────────────── */
.gr-skeleton {
  background: linear-gradient(90deg, var(--cream-d) 25%, var(--cream-dd) 50%, var(--cream-d) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── SECTION HEADER ───────────────────────────────────────────── */
.gr-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.gr-section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--gold-d);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.gr-section-eyebrow::after {
  content: '';
  flex: 0 0 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 1px;
}
.gr-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 4px;
}

/* Report stage — make “Report” and headline easy to spot */
.gr-section-title--report {
  position: relative;
  padding-left: 14px;
  border-left: 4px solid var(--gold);
  border-radius: 2px 0 0 2px;
}
.gr-section-title--report .gr-section-title__report-mark {
  color: var(--gold-d);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow:
    0 0 28px rgba(196, 155, 42, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.4);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .gr-section-title--report .gr-section-title__report-mark {
    background: linear-gradient(118deg, var(--gold-d) 0%, var(--gold) 42%, var(--gold-l) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 1px 1px rgba(160, 126, 30, 0.2));
  }
}

.gr-section-sub {
  font-size: 0.9375rem;
  color: var(--ink-m);
  line-height: 1.6;
  max-width: 36em;
  margin-top: 2px;
}

/* ── FRONT PAGE (INTAKE) ────────────────────────────────────────── */
.gr-stage-wrap {
  padding: 48px 48px 56px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.gr-stage-wrap.wide { max-width: 100%; padding: 28px 32px; }
.gr-stage-head {
  margin-bottom: 44px;
}

/* Premium intake card */
.gr-intake-card {
  max-width: 600px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid rgba(196,155,42,0.14);
  border-radius: var(--r-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--gold);
}
.gr-intake-card .gr-intake-hero {
  margin-bottom: 28px;
}
.gr-intake-card .gr-card-title {
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.gr-intake-card .gr-card-sub {
  font-size: 0.8125rem;
  color: var(--ink-m);
  margin-top: 8px;
  line-height: 1.55;
}

/* Auto Mode row */
.gr-intake-automode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-radius: var(--r);
  border: 1px solid var(--auto-accent-border);
  background: var(--auto-accent-bg);
  margin-bottom: 26px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.gr-intake-automode:hover {
  border-color: rgba(43,143,189,0.35);
  background: rgba(43,143,189,0.09);
  box-shadow: 0 2px 12px rgba(43,143,189,0.06);
}
.gr-intake-automode-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ink-m);
  margin-bottom: 4px;
}
.gr-intake-automode-desc {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
.gr-intake-form-section { margin-bottom: 24px; }
.gr-intake-url-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gr-intake-url-row .gr-fi { flex: 1; min-width: 0; }
.gr-intake-url-row .gr-btn { flex-shrink: 0; min-width: 108px; }
.gr-link-secondary {
  color: var(--gold-d);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s;
}
.gr-link-secondary:hover { color: var(--gold); }
.gr-intake-progress { margin-top: 18px; }
.gr-intake-progress-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.gr-intake-progress-status {
  font-size: 0.8125rem;
  color: var(--ink-m);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.4px;
}
.gr-intake-progress .gr-pipe-bar {
  background: var(--cream-dd);
  border-radius: 3px;
  height: 5px;
}
.gr-intake-progress .gr-pipe-fill { border-radius: 3px; }

/* Intake form labels: title case, readable */
.gr-intake-card .gr-fl {
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink-l);
}
.gr-intake-card .gr-fl .gr-inline-hint {
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0;
  color: var(--ink-faint);
}
.gr-intake-card .gr-fg { gap: 8px; }
.gr-intake-card .gr-fi,
.gr-intake-card .gr-ft {
  padding: 12px 16px;
  font-size: 0.9375rem;
  border-radius: var(--r);
}
.gr-intake-card .gr-fh {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* Primary CTA on intake */
.gr-intake-card .gr-btn-primary {
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(24,19,13,0.18);
}
.gr-intake-card .gr-btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(24,19,13,0.22);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .gr-stage-wrap { padding: 32px 24px 40px; }
  .gr-stage-head { margin-bottom: 32px; }
  .gr-intake-card { padding: 28px 24px; }
  .gr-section-title { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .gr-intake-url-row { flex-direction: column; align-items: stretch; }
  .gr-intake-url-row .gr-btn { min-width: 0; }
  .gr-stage-wrap { padding: 24px 20px 32px; }
  .gr-intake-card { padding: 24px 20px; }
}

/* ── CONTEXT PREVIEW CARD ─────────────────────────────────────── */
.gr-context-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: 20px;
}
.gr-context-header {
  background: var(--ink);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gr-context-company {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--cream);
  font-weight: 600;
}
.gr-context-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--gold);
}
.gr-context-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.gr-context-row { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: start; }
.gr-context-row-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 2px;
}
.gr-context-row-value {
  font-size: 0.82rem;
  color: var(--ink-l);
  line-height: 1.5;
}
.gr-context-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--cream);
  border: 1px solid var(--cream-ddd);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--ink-m);
  margin: 2px 2px 2px 0;
}

/* ── COLLAPSIBLE SECTIONS ─────────────────────────────────────── */
.gr-collapsible-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 0;
  user-select: none;
}
.gr-collapsible-trigger:hover .gr-collapsible-arrow { color: var(--gold); }
.gr-collapsible-arrow {
  font-size: 0.7rem;
  color: var(--ink-faint);
  transition: transform 0.2s;
}
.gr-collapsible.open .gr-collapsible-arrow { transform: rotate(90deg); }
.gr-collapsible-content { overflow: hidden; }
.gr-collapsible.closed .gr-collapsible-content { display: none; }

/* ── COPY BUTTON ──────────────────────────────────────────────── */
.gr-copy-btn {
  font-size: 0.7rem;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-ink);
  border-radius: 5px;
  color: var(--ink-m);
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'JetBrains Mono', monospace;
}
.gr-copy-btn:hover { border-color: var(--gold); color: var(--gold); }
.gr-copy-btn.copied { border-color: var(--watch); color: var(--watch); }

/* .gr-stage-wrap defined in FRONT PAGE (INTAKE) block above */
.gr-stage-wrap.wide { max-width: 100%; padding: 28px 32px; }

/* ── TABS ─────────────────────────────────────────────────────── */
.gr-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-s); margin-bottom: 20px; }
.gr-tab {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-m);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
  margin-bottom: -1px;
}
.gr-tab:hover { color: var(--ink); }
.gr-tab.active { color: var(--gold-d); border-bottom-color: var(--gold); font-weight: 600; }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root {
    --sidebar-l-w: 220px;
    --sidebar-r-w: 240px;
  }
}
@media (max-width: 860px) {
  .gr-report-hero { grid-template-columns: 1fr 1fr; }
  .gr-email-layout { grid-template-columns: 1fr; }
  .gr-stage-nav { display: none; }
  .gr-layout.both-open,
  .gr-layout.sidebar-right-open { grid-template-columns: 0 1fr 0; }
  .gr-layout.sidebar-left-open  { grid-template-columns: var(--sidebar-l-w) 1fr 0; }
}

/* ── UTILITY ──────────────────────────────────────────────────── */
.hidden { display: none !important; }
.vis-hidden { visibility: hidden; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.text-gold  { color: var(--gold-d); }
.text-ink   { color: var(--ink); }
.text-muted { color: var(--ink-m); }
.text-faint { color: var(--ink-faint); }
.font-mono  { font-family: 'JetBrains Mono', monospace; }
.font-serif { font-family: 'Playfair Display', serif; }
.text-sm  { font-size: 0.78rem; }
.text-xs  { font-size: 0.7rem; }
.text-xxs { font-size: 0.62rem; }

/* ── CHECK UPDATES SPINNER + PULSE ──────────────────────────────── */
@keyframes gr-spin { to { transform: rotate(360deg); } }
@keyframes gr-pulse-fade { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.gr-btn-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(196,155,42,0.25); border-top-color: var(--gold-d);
  border-radius: 50%; animation: gr-spin 0.7s linear infinite;
  vertical-align: middle; margin-right: 4px;
}
.gr-pulse-text {
  animation: gr-pulse-fade 1.5s ease-in-out infinite;
  font-style: italic; color: var(--ink-m);
}

/* ── APP LAUNCHER (burger menu) ─────────────────────────────── */
.gr-burger-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all 0.2s; color: var(--ink-m);
  flex-shrink: 0;
}
.gr-burger-btn:hover { border-color: var(--gold); color: var(--gold); }
.gr-burger-btn svg { width: 18px; height: 18px; display: block; }

.app-launcher-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  opacity: 0; visibility: hidden; transition: opacity 0.2s; z-index: 998;
}
.app-launcher-overlay.active { opacity: 1; visibility: visible; }

.app-launcher {
  position: fixed; top: 52px; left: 16px; width: 420px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 10px 40px rgba(24,19,13,0.18);
  opacity: 0; visibility: hidden; transform: scale(0.9) translateY(-10px);
  transform-origin: top left; transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  z-index: 999; overflow: hidden; max-height: 80vh;
}
.app-launcher.active { opacity: 1; visibility: visible; transform: scale(1) translateY(0); }

.app-launcher-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 0.85rem; color: var(--ink);
  font-family: 'DM Sans', sans-serif;
}
.app-launcher-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 10px;
  max-height: calc(80vh - 52px); overflow-y: auto;
}
.app-launcher-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; background: transparent; border: 1px solid transparent;
  border-radius: 10px; cursor: pointer; transition: all 0.2s;
  text-decoration: none; color: var(--ink);
}
.app-launcher-item:hover { background: var(--cream); border-color: var(--border); }
.app-launcher-item.current { background: var(--cream); border-color: var(--gold); }

.app-launcher-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.app-emoji { font-size: 1.35rem; }
.app-launcher-item:hover .app-launcher-icon {
  transform: scale(1.05); box-shadow: 0 4px 12px rgba(24,19,13,0.08);
}
.app-launcher-label {
  font-size: 0.7rem; font-weight: 500; text-align: center;
  color: var(--ink); line-height: 1.3; font-family: 'DM Sans', sans-serif;
}

@media (max-width: 480px) {
  .app-launcher { left: 8px; right: 8px; width: auto; }
  .app-launcher-grid { grid-template-columns: repeat(2, 1fr); }
}
