/* ══════════════════════════════════════════════════════════════
   Leads — Autonomous Sales Swarm Dashboard
   Official Design System (Strict Light Theme Only)
   ══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'microgrammaBold';
  src: url('/static/fonts/microgramma-bold.woff2') format('woff2'),
       url('/static/fonts/microgramma-bold.otf') format('opentype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Microgramma';
  src: url('/static/fonts/microgramma-bold.woff2') format('woff2'),
       url('/static/fonts/microgramma-bold.otf') format('opentype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Microgramma Bold';
  src: url('/static/fonts/microgramma-bold.woff2') format('woff2'),
       url('/static/fonts/microgramma-bold.otf') format('opentype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Michroma';
  src: url('/static/fonts/michroma.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Obrive Design Tokens (Strict Light Theme) ───────────────── */

:root {
  /* Official Obrive Font Stacks */
  --font-heading: 'microgrammaBold', 'Microgramma', 'Microgramma Bold', sans-serif;
  --font-brand:   'Michroma', 'Michroma Fallback', sans-serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Mono', monospace;

  /* Aliases for template compatibility */
  --serif: var(--font-heading);
  --sans:  var(--font-sans);
  --mono:  var(--font-mono);

  --r-sm:   0.5rem;   /* 8px */
  --r-md:   0.75rem;  /* 12px - Obrive standard button radius */
  --r-lg:   1.25rem;  /* 20px - Obrive card radius */
  --r-pill: 9999px;
  --gut:    32px;

  /* Obrive Light Palette: Signature Mint Canvas */
  --bg:            #A2F1DF;             /* Obrive signature mint background */
  --panel:         rgba(255, 255, 255, 0.90);
  --panel-raised:  rgba(255, 255, 255, 0.70);
  --panel-hover:   #FFFFFF;
  --border:        rgba(7, 57, 51, 0.15);
  --border-strong: rgba(7, 57, 51, 0.28);
  --rule:          rgba(7, 57, 51, 0.18);
  --text:          #073933;             /* Obrive dark teal */
  --text-2:        #163830;
  --text-3:        #2D554C;

  --ink:           #073933;
  --ink-contrast:  #FFFFFF;
  --ink-soft:      rgba(7, 57, 51, 0.08);

  --obrive-primary:     #073933;
  --obrive-teal:        #074139;
  --obrive-mint:        #A2F1DF;
  --obrive-glow:        #00E5A3;

  /* Status Colors */
  --s-good:        #057A55;
  --s-good-bg:     rgba(0, 229, 163, 0.16);
  --s-good-line:   rgba(0, 229, 163, 0.50);

  --s-wait:        #B45309;
  --s-wait-bg:     rgba(245, 158, 11, 0.14);
  --s-wait-line:   rgba(245, 158, 11, 0.38);

  --s-bad:         #C81E1E;
  --s-bad-bg:      rgba(239, 68, 68, 0.14);
  --s-bad-line:    rgba(239, 68, 68, 0.38);

  --s-active:      #0E7490;
  --s-active-bg:   rgba(6, 182, 212, 0.14);
  --s-active-line: rgba(6, 182, 212, 0.38);

  --s-note:        #6B21A8;
  --s-note-bg:     rgba(168, 85, 247, 0.14);
  --s-note-line:   rgba(168, 85, 247, 0.38);

  --shadow-sm:     0 2px 8px rgba(7, 57, 51, 0.06);
  --shadow:        0 8px 30px rgba(7, 57, 51, 0.08);
  --shadow-hover:  0 12px 32px rgba(7, 57, 51, 0.16);
  --shadow-btn:    0 4px 14px rgba(7, 57, 51, 0.25);
  --shadow-btn-h:  0 8px 24px rgba(7, 57, 51, 0.38);

  color-scheme: light !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: #073933; color: #A2F1DF; }

html {
  scroll-behavior: smooth;
  color-scheme: light !important;
}
body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Obrive Slim Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(7, 57, 51, 0.22);
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(7, 57, 51, 0.45);
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-color: var(--text);
}
:focus-visible {
  outline: 2px solid var(--obrive-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── Masthead / Brand Header ─────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px var(--gut);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(7, 57, 51, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .brand-logo {
  height: 44px;
  width: auto;
  max-width: 70px;
  flex: none;
  filter: drop-shadow(0 2px 6px rgba(7, 57, 51, 0.15));
  transition: transform .2s cubic-bezier(.16,1,.3,1);
}
.brand .brand-logo:hover {
  transform: rotate(-6deg) scale(1.06);
}

.brand .mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #073933;
  color: #FFFFFF;
  border-radius: var(--r-sm);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.brand .brand-text {
  display: flex;
  flex-direction: column;
}

.brand h1, .brand .brand-title {
  font-family: 'microgrammaBold', 'Microgramma', 'Microgramma Bold', var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--obrive-teal);
  line-height: 1.1;
}

.brand .tagline {
  font-family: var(--font-brand);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 3px;
  font-weight: 400;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.harvey-status,
.leads-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--font-brand);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(7, 57, 51, 0.04);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--text-3);
  transition: background .2s, box-shadow .2s;
}
.status-dot.running {
  background: #00E5A3;
  box-shadow: 0 0 8px #00E5A3;
}
.status-dot.stopped {
  background: var(--text-3);
}
.status-dot.offline {
  background: var(--s-bad);
  box-shadow: 0 0 8px var(--s-bad);
}

.refresh-btn {
  background: rgba(255, 255, 255, 0.80);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: var(--shadow-sm);
}

.refresh-btn:hover {
  background: #FFFFFF;
  border-color: var(--text);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(7, 57, 51, 0.15);
}

/* ── Navigation Tabs (Obrive Filter Pills) ───────────────────── */

nav {
  display: flex;
  gap: 8px;
  padding: 12px var(--gut);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }

nav button {
  padding: 0.45rem 1.15rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  font-family: var(--font-brand);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
}

nav button:hover {
  background: #FFFFFF;
  border-color: var(--obrive-primary);
  color: var(--obrive-primary);
  transform: translateY(-1px);
}

nav button.active {
  background: #073933;
  color: #FFFFFF;
  border-color: #073933;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(7, 57, 51, 0.25);
  transform: translateY(-1px);
}

.nav-count {
  display: none;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: var(--s-wait-bg);
  color: var(--s-wait);
  border: 1px solid var(--s-wait-line);
}
.nav-count.on { display: inline-block; }

nav button.active .nav-count {
  background: rgba(162, 241, 223, 0.3);
  color: #A2F1DF;
  border-color: rgba(162, 241, 223, 0.5);
}

/* ── Main Layout ─────────────────────────────────────────────── */

main {
  padding: 32px var(--gut) 88px;
  max-width: 1440px;
  margin: 0 auto;
}

.section {
  display: none;
  scroll-margin-top: 140px;
}
.section.active {
  display: block;
  animation: rise .24s cubic-bezier(.16,1,.3,1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ── Headings ────────────────────────────────────────────────── */

.section-head { margin-bottom: 24px; }

.section-head h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.25;
}

.section-head p {
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 6px;
  max-width: 68ch;
  text-wrap: pretty;
}

.subhead {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin: 28px 0 16px;
}

/* ── Today Screen ────────────────────────────────────────────── */

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.today-rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 22px;
}
.rail-block > .subhead { margin-top: 0; }

@media (max-width: 1080px) {
  .today-grid { grid-template-columns: 1fr; gap: 24px; }
  .today-rail { position: static; }
}

/* Action Queue */
.queue {
  border-top: 1px solid var(--rule);
}
.queue-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.queue-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--obrive-primary);
}
.queue-item::before {
  content: '';
  width: 4px;
  border-radius: var(--r-pill);
  align-self: stretch;
  flex: none;
  background: var(--text-3);
}
.queue-item.warn::before { background: var(--s-wait); }
.queue-item.bad::before  { background: var(--s-bad); }
.queue-item.good::before { background: var(--obrive-glow); }

.queue-item .qtext { flex: 1; min-width: 0; }
.queue-item .qtitle {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.006em;
  color: var(--text);
}
.queue-item .qdetail {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  max-width: 68ch;
  text-wrap: pretty;
}
.queue-item .btn { flex: none; margin-top: 1px; }

.queue-clear {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 26px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.queue-clear .glyph {
  color: var(--s-good);
  font-size: 20px;
  line-height: 1;
}
.queue-clear .qtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.queue-clear .qdetail {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
  max-width: 60ch;
}

/* Rail Figures */
.figures {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
}

.figure {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.figure:last-child { border-bottom: none; }
.figure .k { font-size: 12.5px; color: var(--text-2); }
.figure .v {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.01em;
}
.figure .v.zero { color: var(--text-3); font-weight: 400; }
.figure-note { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }

/* ── Obrive Official Buttons ─────────────────────────────────── */

.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #073933;
  color: #FFFFFF;
  border: 1.5px solid #073933;
  border-radius: 0.75rem; /* 12px rounded-xl */
  padding: 0.65rem 1.6rem;
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(7, 57, 51, 0.25);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn:hover,
.btn-primary:hover:not(:disabled) {
  background-color: #074139;
  border-color: #074139;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(7, 57, 51, 0.38);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.85);
  color: #073933;
  border: 1.5px solid #073933;
  border-radius: 0.75rem;
  padding: 0.65rem 1.6rem;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(7, 65, 57, 0.08);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled) {
  background-color: rgba(7, 65, 57, 0.08);
  border-color: #073933;
  color: #073933;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(7, 65, 57, 0.16);
}

.btn-danger {
  background-color: var(--s-bad-bg);
  border: 1px solid var(--s-bad-line);
  color: var(--s-bad);
  border-radius: 0.75rem;
  padding: 0.65rem 1.6rem;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.btn-danger:hover:not(:disabled) {
  background-color: var(--s-bad);
  border-color: var(--s-bad);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(200, 30, 30, 0.3);
}

.btn-sm {
  padding: 0.45rem 1.15rem;
  font-size: 10px;
  border-radius: 0.65rem;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--panel-raised);
  color: var(--text-2);
}

/* ── Cards & Panels (Obrive Glassmorphism) ───────────────────── */

.card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--obrive-primary);
}
.card h2 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--text);
}
.card .lede {
  font-size: 13.5px;
  color: var(--text-2);
  margin: -4px 0 16px;
  max-width: 66ch;
}

/* ── Badges & Status Chips ───────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.t-waiting { background: var(--s-wait-bg);   color: var(--s-wait);   border-color: var(--s-wait-line); }
.badge.t-active  { background: var(--s-active-bg); color: var(--s-active); border-color: var(--s-active-line); }
.badge.t-good    { background: var(--s-good-bg);   color: var(--s-good);   border-color: var(--s-good-line); }
.badge.t-bad     { background: var(--s-bad-bg);    color: var(--s-bad);    border-color: var(--s-bad-line); }
.badge.t-idle    { background: var(--panel-raised);color: var(--text-3);   border-color: var(--border); }
.badge.t-note    { background: var(--s-note-bg);   color: var(--s-note);   border-color: var(--s-note-line); }

/* ── Tables ──────────────────────────────────────────────────── */

.table-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: auto;
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th {
  text-align: left;
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  padding: 13px 18px;
  border-bottom: 1.5px solid var(--border-strong);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 2;
}

td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background .15s;
}
tbody tr:hover td {
  background: rgba(7, 57, 51, 0.06);
}
td a { text-decoration: none; font-weight: 500; }
td a:hover { text-decoration: underline; color: var(--obrive-primary); }
.muted { color: var(--text-3); }
.num { font-family: var(--font-mono); text-align: right; }

/* ── Signals ─────────────────────────────────────────────────── */

.sig-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.sig-stat {
  flex: 1;
  min-width: 130px;
  padding: 18px 22px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.sig-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--obrive-primary);
}
.sig-stat .n {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sig-stat .k {
  font-family: var(--font-brand);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 8px;
}
.sig-stat.confirmed .n { color: var(--s-good); }
.sig-stat.proposed .n  { color: var(--s-wait); }
.sig-stat.rejected .n  { color: var(--text-3); }

.sig-group { margin-bottom: 28px; }
.sig-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.sig-group-head h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.sig-group-head p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  max-width: 62ch;
  text-wrap: pretty;
}

.sig-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  transition: background .15s;
}
.sig-row:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.sig-row:last-child { border-bottom: none; border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.sig-row:hover { background: rgba(255, 255, 255, 0.98); }
.sig-row.rejected { opacity: .5; }
.sig-row .sig-main { flex: 1; min-width: 0; }
.sig-row .sig-label { font-size: 14px; font-weight: 600; color: var(--text); }
.sig-row .sig-code { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); margin-left: 8px; }
.sig-row .sig-desc { font-size: 13px; color: var(--text-2); margin-top: 5px; max-width: 68ch; text-wrap: pretty; }
.sig-row .sig-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.sig-row .sig-decide { display: flex; gap: 8px; flex: none; }

.cost-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  color: var(--text-3);
  background: var(--panel-raised);
}
.cost-chip.free { color: var(--s-good); background: var(--s-good-bg); border-color: var(--s-good-line); }
.cost-chip.paid { color: var(--s-wait); background: var(--s-wait-bg); border-color: var(--s-wait-line); }

/* ── Cohort Builder ──────────────────────────────────────────── */

.cohort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.cohort-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.cohort-pick:hover {
  border-color: var(--border-strong);
  background: #FFFFFF;
}
.cohort-pick:has(input:checked) {
  border-color: var(--obrive-primary);
  background: rgba(255, 255, 255, 0.98);
}
.cohort-pick input { accent-color: var(--obrive-primary); }
.cohort-pick .n {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.cohort-size {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ── Decisions Desk ──────────────────────────────────────────── */

.desk {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.desk-list {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden auto;
  max-height: 640px;
  box-shadow: var(--shadow);
}
.desk-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all .15s;
}
.desk-item:last-child { border-bottom: none; }
.desk-item:hover { background: #FFFFFF; }
.desk-item.active {
  background: #FFFFFF;
  border-left-color: var(--obrive-primary);
}

.desk-item .to {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desk-item .sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-pane {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px 34px;
  box-shadow: var(--shadow);
}
.desk-pane .to-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.desk-pane .subject {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 14px 0 18px;
  line-height: 1.25;
  color: var(--text);
}
.desk-pane .body {
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  max-width: 68ch;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.desk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .desk { grid-template-columns: 1fr; }
  .desk-list { max-height: 240px; }
}

/* ── Discovery Providers ─────────────────────────────────────── */

.prov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.prov-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
  cursor: pointer;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.prov-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--obrive-primary);
}
.prov-card.selected {
  border-color: var(--obrive-primary);
  background: #FFFFFF;
}

.prov-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.prov-card h3 {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.prov-card .blurb { font-size: 13px; color: var(--text-2); text-wrap: pretty; }
.prov-card .row { display: flex; gap: 8px; font-size: 12px; }
.prov-card .row .k { color: var(--text-3); min-width: 44px; flex: none; }
.prov-card .row .v { color: var(--text-2); font-weight: 500; }
.prov-card .caveat {
  font-size: 12px;
  color: var(--s-wait);
  background: var(--s-wait-bg);
  border-left: 3px solid var(--s-wait-line);
  padding: 8px 12px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  text-wrap: pretty;
}

.estimate-box {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.estimate-box .amount {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.estimate-box .amount.free { color: var(--s-good); }
.estimate-box .amount.paid { color: var(--s-wait); }
.query-list {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  margin-top: 14px;
  line-height: 1.75;
  max-height: 160px;
  overflow-y: auto;
}

/* ── Forms & Controls ────────────────────────────────────────── */

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-family: var(--font-brand);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  background: #FFFFFF;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  transition: all .2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--obrive-primary);
  box-shadow: 0 0 0 3px rgba(7, 57, 51, 0.15);
}

.form-input::placeholder { color: var(--text-3); }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }

.test-result {
  font-size: 13px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
}
.test-result.success { background: var(--s-good-bg); color: var(--s-good); border-color: var(--s-good-line); }
.test-result.error   { background: var(--s-bad-bg);  color: var(--s-bad);  border-color: var(--s-bad-line); }
.test-result.pending { background: var(--panel-raised); color: var(--text-2); border-color: var(--border); }

/* ── Setup Checklist ─────────────────────────────────────────── */

.progress-wrap { margin-bottom: 20px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.progress-label .pct {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.progress-label .text { color: var(--text-3); }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  transition: width .5s cubic-bezier(.16,1,.3,1);
}
.progress-fill.green { background: #00E5A3; }
.progress-fill.yellow { background: var(--s-wait); }

.check-item {
  display: flex;
  gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.check-item:last-child { border-bottom: none; }
.check-icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.check-icon.done {
  background: var(--s-good-bg);
  color: var(--s-good);
  border: 1px solid var(--s-good-line);
}
.check-icon.pending {
  border: 1.5px dashed var(--border-strong);
  color: var(--text-3);
}
.check-info { flex: 1; min-width: 0; }
.check-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.check-label.done { color: var(--text-3); font-weight: 400; }
.check-help { font-size: 12px; color: var(--text-3); margin-top: 3px; text-wrap: pretty; }
.optional-tag { font-size: 10.5px; color: var(--text-3); font-weight: 400; margin-left: 6px; }

details summary { cursor: pointer; list-style: none; font-weight: 500; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '+ '; font-family: var(--font-mono); color: var(--obrive-primary); font-weight: 700; }
details[open] summary::before { content: '– '; }

/* ── Campaigns, Conversations, Activity ──────────────────────── */

.campaign-card, .convo-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.campaign-card:hover, .convo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--obrive-primary);
}
.campaign-card h3, .convo-card h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  color: var(--text);
}
.campaign-card .meta, .convo-card .meta {
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.email-step {
  border-left: 3px solid var(--border-strong);
  padding: 4px 0 4px 18px;
  margin-bottom: 18px;
}
.email-step:hover {
  border-left-color: var(--obrive-primary);
}

.email-step .step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 4px;
}
.email-step .subject {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.email-step .body {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.7;
  white-space: pre-wrap;
}

.thread-msg {
  max-width: 80%;
  padding: 13px 16px;
  border-radius: var(--r-md);
  margin-bottom: 10px;
  font-size: 13.5px;
  line-height: 1.65;
}
.thread-msg.sent {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.thread-msg.received {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-bottom-left-radius: 4px;
}
.thread-msg .sender {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 5px;
}

.activity-feed {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
}
.activity-item {
  display: flex;
  gap: 16px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: baseline;
  transition: background .15s;
}
.activity-item:hover {
  background: rgba(255, 255, 255, 0.5);
}
.activity-item:last-child { border-bottom: none; }
.activity-item .time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  min-width: 110px;
  flex: none;
}
.activity-item .agent {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--obrive-primary);
  min-width: 70px;
  flex: none;
}

.activity-item .action { color: var(--text-2); }

/* ── Help & Miscellaneous ────────────────────────────────────── */

.help-section { margin-bottom: 28px; }
.help-section h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  color: var(--text);
}
.help-section p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 10px;
  max-width: 72ch;
}
.help-section code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  color: var(--text);
}
.help-section pre {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}
.file-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.file-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.file-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  width: 220px;
}
.file-table td:last-child { color: var(--text-2); }
.file-table tr:last-child td { border-bottom: none; }

.control-panel {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
}
@media (max-width: 900px) { .control-panel { grid-template-columns: 1fr; } }
.status-big {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.status-big .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-3);
}
.status-big .dot.running {
  background: #00E5A3;
  box-shadow: 0 0 10px #00E5A3;
}
.status-big .label {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.status-big .label.running { color: var(--s-good); }

.status-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 18px;
  min-height: 16px;
}
.log-viewer {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.empty {
  text-align: center;
  padding: 50px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.empty .glyph {
  font-size: 22px;
  color: var(--text-3);
  margin-bottom: 12px;
}
.empty .title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}
.empty .copy {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.65;
  max-width: 48ch;
  margin: 0 auto;
  text-wrap: pretty;
}
.empty .copy b { color: var(--text-2); font-weight: 600; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(7, 57, 51, 0.25);
  animation: toast-in .25s cubic-bezier(.16,1,.3,1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.toast.success {
  background: #073933;
  color: #FFFFFF;
  border: 1px solid #073933;
}
.toast.error {
  background: var(--s-bad);
  color: #FFFFFF;
}

@media (max-width: 768px) {
  :root { --gut: 18px; }
  .brand .tagline { display: none; }
  .section-head h2 { font-size: 20px; }
  nav button { padding: 0.4rem 0.9rem; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ── Authentication & Access Control ── */
.auth-controls {
  display: flex;
  align-items: center;
}

.auth-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-strong);
}

.auth-pill.guest {
  padding: 0;
  border: none;
  background: transparent;
}

.auth-guest-tag {
  display: none;
}

.auth-login-btn {
  background: var(--obrive-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--r-pill);
  padding: 5px 13px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(7, 57, 51, 0.14);
}

.auth-login-btn:hover {
  background: #0d5248;
  transform: translateY(-1px);
}

.auth-user-email {
  color: var(--obrive-primary);
  font-weight: 600;
}

.auth-badge {
  background: var(--s-good-bg);
  color: var(--s-good);
  border: 1px solid var(--s-good-line);
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-logout-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all 0.15s ease;
}

.auth-logout-btn:hover {
  background: rgba(7, 57, 51, 0.08);
  color: var(--s-bad);
}

/* ── Protected / Locked Content States ── */
.locked-box {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 48px 32px;
  text-align: center;
  margin: 20px 0;
  box-shadow: 0 4px 20px rgba(7, 57, 51, 0.05);
}

.locked-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.locked-title {
  font-family: var(--font-brand);
  font-size: 17px;
  font-weight: 700;
  color: var(--obrive-primary);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.locked-copy {
  font-size: 13.5px;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

.locked-action .btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Login Modal ── */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 57, 51, 0.4);
  backdrop-filter: blur(4px);
}

.login-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(7, 57, 51, 0.25);
  z-index: 1;
  animation: modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-3);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
}

.login-modal-close:hover {
  color: var(--text);
  background: rgba(7, 57, 51, 0.06);
}

.login-modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-modal-header h3 {
  font-family: var(--font-brand);
  font-size: 16px;
  color: var(--obrive-primary);
  margin-top: 8px;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
}

.login-modal-header p {
  font-size: 12.5px;
  color: var(--text-3);
}

.modal-error-box {
  background: rgba(200, 30, 30, 0.1);
  border: 1px solid rgba(200, 30, 30, 0.3);
  color: #C81E1E;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
}

