/* Pulse, the BreviBot client command centre.
   Premium palette mirrors brevibot.com: Inter, a #0066FF -> #7C3AED brand
   gradient, soft layered shadows, generous radius. Light is the default
   ([:root]); a polished dark theme is one toggle away ([data-theme='dark']).
   One stylesheet, no framework. */

:root {
  /* surfaces (light, default) */
  --bg: #f6f8fc;
  --bg-grad: radial-gradient(1200px 620px at 50% -10%, #ffffff 0%, #f6f8fc 60%);
  --bg-raise: #eef2f8;
  --card: #ffffff;
  --card-2: #f4f7fb;
  --border: #e6ebf3;
  --border-strong: #cfd8e6;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #8793a9;
  /* brand */
  --accent: #0066ff;
  --accent-hover: #0052cc;
  --accent-2: #7c3aed;
  --accent-soft: rgba(0, 102, 255, 0.08);
  --gradient-brand: linear-gradient(135deg, #0066ff 0%, #7c3aed 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(0, 102, 255, 0.07), rgba(124, 58, 237, 0.07));
  /* status */
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.10);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.08);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.09);
  /* chip + action-type text (light) */
  --chip-red: #c02626;
  --chip-amber: #b45309;
  --chip-green: #15803d;
  --chip-blue: #0a5ad6;
  --chip-purple: #6d28d9;
  /* shadows (brevibot.com layered softness) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.05), 0 10px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.10), 0 30px 64px rgba(15, 23, 42, 0.12);
  --shadow-brand: 0 10px 28px rgba(0, 102, 255, 0.20), 0 4px 12px rgba(124, 58, 237, 0.16);
  --header-bg: rgba(255, 255, 255, 0.82);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
}

/* Dark theme (toggle ☀️/🌙, persisted in localStorage, applied pre-paint
   from Base.astro). Deep navy, glow accents, the same brand gradient. */
html[data-theme='dark'] {
  --bg: #0a0d15;
  --bg-grad: radial-gradient(1200px 620px at 50% -10%, #141c30 0%, #0a0d15 60%);
  --bg-raise: #10141f;
  --card: #141927;
  --card-2: #1a2033;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf4;
  --text-muted: #9aa3b5;
  --text-dim: #69728a;
  --accent: #0066ff;
  --accent-hover: #2b80ff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(0, 102, 255, 0.16);
  --gradient-brand: linear-gradient(135deg, #2b80ff 0%, #a78bfa 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(0, 102, 255, 0.20), rgba(167, 139, 250, 0.16));
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.16);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.16);
  --chip-red: #ff8a8a;
  --chip-amber: #ffc44d;
  --chip-green: #57d98a;
  --chip-blue: #6ea8ff;
  --chip-purple: #c4b0ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.60);
  --shadow-brand: 0 10px 30px rgba(0, 102, 255, 0.45);
  --header-bg: rgba(10, 13, 21, 0.78);
}
html[data-theme='dark'] .email-msg { background: var(--bg-raise); }
html[data-theme='dark'] .email-head { background: var(--card-2); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 22px; }

/* ------------------------------------------------------------ header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 14, 20, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.pulse-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex: none;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pulse-ring 2.2s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 0.8; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}

/* Respect prefers-reduced-motion. The brand pulse, queue row hovers, and
   the modal slide-ins all stop animating when the OS preference is set.
   Same calm-tempo principle Jefferson Fisher describes for delivery (the
   transcripts library has the source). Nothing about how Pulse READS
   changes; only how it MOVES. */
@media (prefers-reduced-motion: reduce) {
  .pulse-dot::after { animation: none; }
  .queue tbody tr { transition: none; }
  *[class*="transition"] { transition: none !important; }
}

.brand-for {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12.5px;
  border-left: 1px solid var(--border-strong);
  padding-left: 12px;
  line-height: 1.3;
}

.header-nav {
  display: flex;
  gap: 14px;
  margin-left: 18px;
  font-size: 13px;
  font-weight: 600;
}
.header-nav a { color: var(--text-muted); }
.header-nav a:hover { color: var(--text); text-decoration: none; }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.refresh-stamp { white-space: nowrap; }
.refresh-stamp.stale { color: var(--amber); }

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }

/* Mobile header: the desktop single row does not fit a phone, so wrap it.
   Row 1 keeps the brand and the actions (theme, sign out, bell); the nav
   drops to its own full-width row beneath a divider. The subtitle and the
   "updated" stamp are hidden to keep row 1 uncluttered. */
@media (max-width: 600px) {
  .site-header .wrap {
    flex-wrap: wrap;
    height: auto;
    min-height: 52px;
    padding: 7px 0;
    row-gap: 8px;
    column-gap: 10px;
  }
  .brand-for { display: none; }
  .header-right { order: 2; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .refresh-stamp, .whoami { display: none; }
  .header-nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 4px;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .header-nav a { padding: 3px 6px; }
}

/* ------------------------------------------------------------- banner -- */

.banner {
  display: none;
  background: var(--accent-soft);
  border-bottom: 1px solid rgba(0, 102, 255, 0.35);
  color: var(--text);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
}
.banner.show { display: block; }
.banner button {
  margin-left: 10px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 3px 12px;
  font: inherit;
  cursor: pointer;
}

/* -------------------------------------------------------------- stats -- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stat:hover { border-color: var(--border-strong); }
.stat.active { border-color: var(--accent); background: var(--accent-soft); }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.stat .lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat.s-red .num { color: var(--red); }
.stat.s-amber .num { color: var(--amber); }
.stat.s-green .num { color: var(--green); }
.stat.s-blue .num { color: var(--accent-hover); }

/* builds board */
a.stat { display: flex; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat.s-dim .num { color: var(--text-dim); }
.stat.s-purple .num { color: var(--purple); }
.stat-total {
  background: linear-gradient(135deg, var(--accent-soft), var(--card));
  border-color: rgba(0, 102, 255, 0.35);
}
.stat-total .num { color: var(--accent-hover); }
.section-title { scroll-margin-top: 72px; }
.section-title .chip { margin-left: 4px; }

/* ----------------------------------------------------------- controls -- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 18px 0 14px;
}

.search {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
}
.search:focus-within { border-color: var(--accent); }
.search input {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
}
.search .hint {
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.fchip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.fchip:hover { border-color: var(--border-strong); color: var(--text); }
.fchip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.fchip .n { opacity: 0.75; font-size: 11px; margin-left: 4px; }

/* -------------------------------------------------------------- table -- */

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 26px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.section-title .count {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12.5px;
}

.tablewrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

table.queue { width: 100%; border-collapse: collapse; min-width: 900px; }

.queue th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.queue td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.queue tbody tr:last-child td { border-bottom: 0; }
.queue tbody tr { transition: background 0.12s; }
.queue tbody tr:hover { background: var(--bg-raise); }
.queue tr.hidden { display: none; }
.queue tr.is-sent td { opacity: 0.45; }
/* Search/filter hide for whole sections, drawers, and headers (rows use .hidden). */
.is-hidden { display: none !important; }

td.c-rank { color: var(--text-dim); font-size: 13px; width: 34px; }

td.c-sla { white-space: nowrap; width: 120px; }
.sla-age { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }

td.c-client { min-width: 200px; }
.client-name { font-weight: 600; font-size: 14px; }
.client-name a { color: var(--text); }
.client-name a:hover { color: var(--accent-hover); text-decoration: none; }
.client-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.client-sub a { color: var(--text-dim); }
.client-sub a:hover { color: var(--accent-hover); }

td.c-build { width: 150px; }
.due-line { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; white-space: nowrap; }

td.c-action { max-width: 420px; }
.action-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 5px;
  padding: 2px 7px;
  margin-right: 7px;
  vertical-align: 1px;
}
.action-text {
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

td.c-reply { width: 170px; white-space: nowrap; }

/* -------------------------------------------------------------- chips -- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip-red    { background: var(--red-soft);    color: var(--chip-red); }
.chip-amber  { background: var(--amber-soft);  color: var(--chip-amber); }
.chip-green  { background: var(--green-soft);  color: var(--chip-green); }
.chip-blue   { background: var(--accent-soft); color: var(--chip-blue); }
.chip-purple { background: var(--purple-soft); color: var(--chip-purple); }
.chip-gray   { background: var(--card-2); color: var(--text-muted); }
.chip-ghost  { border-color: var(--border); color: var(--text-dim); background: none; }

.at-REPLY { background: var(--red-soft); color: var(--chip-red); }
.at-DELIVER { background: var(--accent-soft); color: var(--chip-blue); }
.at-BOTH, .at-REPLY-DELIVER { background: var(--purple-soft); color: var(--chip-purple); }
.at-NUDGE { background: var(--amber-soft); color: var(--chip-amber); }
.at-NONE { background: var(--card-2); color: var(--text-dim); }

/* ------------------------------------------------------------ buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  cursor: pointer;
  transition: all 0.13s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-hover); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-ghost { background: none; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

/* -------------------------------------------------------------- modal -- */

.modal-back {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(3px);
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-back.open { display: flex; }

.modal {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.modal h3 { margin: 0 0 4px; font-size: 16px; }
.modal .sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 14px; }

.modal textarea, .reply-box textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 12px 14px;
  outline: none;
}
.modal textarea:focus, .reply-box textarea:focus { border-color: var(--accent); }

.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.modal-foot .spacer { flex: 1; }
.charcount { font-size: 11.5px; color: var(--text-dim); }

/* on-brand confirm/alert dialog (replaces window.confirm/alert) */
.confirm-modal { max-width: 400px; }
.confirm-modal .sub {
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.btn.pc-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.pc-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

/* VA work-time clock (lives in the tracking bar) */
.clk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 11px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font: 600 11.5px/1 var(--font); font-variant-numeric: tabular-nums;
  background: var(--green); color: #04210f;
}
.clk-btn:hover { filter: brightness(1.07); }
.clk-btn.on { background: var(--red-soft); color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); }
.clk-time {
  font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600;
  color: var(--text); text-decoration: none; min-width: 54px; text-align: right;
}
.clk-time:hover { text-decoration: underline; }

/* Tracking bar: slim, solid (opaque), sticky; houses the VA work clock.
   Always shown for a VA so the clock is reachable; the amber "being tracked"
   notice + the usage log only when that VA has tracking on. The bar follows
   on scroll; the page header below it stops sticking (has-track-bar). */
.track-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 30px; padding: 0 14px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--text-muted);
  background: var(--bg-raise);
  border-bottom: 1px solid var(--border);
}
.track-bar.tracking { color: #f3c781; background: #191407; border-bottom-color: rgba(245, 158, 11, 0.45); }
html[data-theme='light'] .track-bar.tracking { color: #92590c; background: #fbf0db; border-bottom-color: rgba(245, 158, 11, 0.45); }
.track-bar .tb-left { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
.track-bar .tb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-bar .tb-muted { color: var(--text-dim); }
.track-bar .tb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }
.track-bar .tb-right { display: inline-flex; align-items: center; gap: 10px; flex: none; }
body.has-track-bar .site-header { position: static; }

.send-result { font-size: 12.5px; margin-top: 10px; }
.send-result.ok { color: var(--green); }
.send-result.err { color: var(--red); }

/* -------------------------------------------------------- client page -- */

.crumb { font-size: 12.5px; color: var(--text-dim); margin: 18px 0 8px; }

.hero {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-raise) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
}
.hero h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.hero .who { color: var(--text-muted); font-size: 13.5px; margin-top: 3px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 600;
}
.card .md { font-size: 13.5px; color: var(--text-muted); }
.card .md ul { margin: 0; padding-left: 18px; }
.card .md li { margin: 5px 0; }

.action-callout {
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13.5px;
}

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; color: var(--text-muted); overflow-wrap: anywhere; }

.reply-box .toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 11px;
  flex-wrap: wrap;
}
.reply-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 8px; }

/* ----------------------------------------------------------- timeline -- */

.timeline { max-height: 640px; overflow-y: auto; padding-right: 6px; }

.tmsg {
  border-left: 3px solid var(--border-strong);
  background: var(--bg-raise);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.tmsg.r-CLIENT { border-left-color: var(--amber); }
.tmsg.r-TEAM { border-left-color: var(--accent); }
.tmsg.r-AUTO { border-left-color: var(--text-dim); }
.timeline .tmsg:last-child {
  border-left-width: 4px;
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.tmsg .meta { font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.tmsg .meta b { color: var(--text-muted); font-weight: 600; }
.tmsg .body { font-size: 13px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }

.ghl-block { margin-bottom: 14px; }
.ghl-block h3 { font-size: 12.5px; margin: 0 0 8px; color: var(--text-muted); text-transform: capitalize; }

/* ------------------------------------------------------------- footer -- */

.site-footer {
  margin: 44px 0 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}
.site-footer .pulse-dot { display: inline-block; vertical-align: -1px; margin-right: 6px; width: 8px; height: 8px; }

/* ------------------------------------------------------ flags + notes -- */

.flag-line {
  font-size: 12px;
  color: var(--amber);
  margin-top: 5px;
  max-width: 420px;
}

.note-box { margin-top: 16px; }
/* Note input mirrors the suggested-reply box: full-width textarea, then a
   row of buttons beneath it (not a narrow field with buttons alongside). */
.note-box .note-row { display: flex; flex-direction: column; gap: 9px; align-items: stretch; }
.note-box .note-actions { display: flex; flex-direction: row; gap: 9px; align-items: center; flex-wrap: wrap; }
.note-box .note-actions .btn { white-space: nowrap; }
.note-box textarea {
  width: 100%;
  min-height: 84px;
  max-height: 240px;
  resize: vertical;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  outline: none;
}
.note-box textarea:focus { border-color: var(--accent); }
.hintline { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; }

/* build detail page */
.svc-list { margin: 0; padding-left: 22px; font-size: 13.5px; color: var(--text-muted); }
.svc-list li { margin: 4px 0; }

/* email windows (GHL email channel on client + build pages) */
.email-msg {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-raise);
}
.email-head {
  padding: 8px 11px;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
}
.email-subject { font-weight: 600; font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
.email-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.email-body {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow-y: auto;
}
html[data-theme='light'] .email-msg { background: #ffffff; }
html[data-theme='light'] .email-head { background: #f3f5f9; }
.note-box .current-note {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 9px;
}

/* processed note history: each note is a three-level disclosure
   (collapsed line -> tidied summary -> verbatim original) */
.note-history { margin-bottom: 11px; display: flex; flex-direction: column; gap: 7px; }
.note-item {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.note-item > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.note-item > summary::-webkit-details-marker { display: none; }
.note-item > summary::before {
  content: '▸';
  color: var(--text-dim);
  font-size: 11px;
  align-self: center;
}
.note-item[open] > summary::before { content: '▾'; }
.note-item > summary b {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}
.note-badge {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--amber-soft);
  color: var(--chip-amber);
}
.note-oneliner {
  flex: 1;
  min-width: 0;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-item > summary .local-ts {
  flex: none;
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
/* narrow screens (card is full-width): drop the one-liner onto its own row
   so nothing is clipped. Row 1 stays badge + title + timestamp. */
@media (max-width: 900px) {
  .note-oneliner {
    flex-basis: 100%;
    order: 1;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .note-item > summary .local-ts { margin-left: auto; }
}
.note-summary {
  padding: 2px 13px 11px;
  border-top: 1px solid var(--border);
  margin-top: -1px;
}
.note-summary p { margin: 8px 0; }
.note-summary p:first-child { margin-top: 10px; }
.note-original { margin: 0 12px 11px; }
.note-original > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 4px 0;
}
.note-original > summary::-webkit-details-marker { display: none; }
.note-original > summary::before { content: '▸ '; }
.note-original[open] > summary::before { content: '▾ '; }
.note-raw {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.source-line {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 11px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}
.source-line code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  user-select: all;
}

/* ------------------------------------------------------------- helpers -- */

.muted { color: var(--text-dim); }
.nowrap { white-space: nowrap; }
.collapsed-section summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 2px;
  color: var(--text-muted);
  list-style: none;
}
.collapsed-section summary::before { content: '▸ '; color: var(--text-dim); }
.collapsed-section[open] summary::before { content: '▾ '; }
.empty-note {
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
  text-align: center;
  padding: 26px;
  font-size: 13.5px;
}

/* ------------------------------------------- identity + notifications -- */

.whoami { color: var(--text-dim); white-space: nowrap; }
.bell-btn { position: relative; }
.bell-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  box-sizing: border-box;
  background: var(--red);
  color: #fff;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* admin review panel (pending VA replies, top of the queue) */
.review-panel {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), var(--card));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0 22px;
}
.rp-title { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.rp-pill {
  background: var(--amber);
  color: #1a1205;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  padding: 1px 8px;
}
.review-item {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
}
.ri-head { font-size: 12.5px; color: var(--text-muted); margin-bottom: 7px; }
.ri-msg {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.ri-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ri-rejectbox { margin-top: 10px; }
.ri-feedback {
  width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 9px 11px;
  resize: vertical;
}
.ri-rejectbox-foot { display: flex; gap: 8px; margin-top: 8px; }
.ri-result { font-size: 12.5px; margin-top: 8px; min-height: 1em; }
.ri-result.ok { color: var(--green); }
.ri-result.err { color: var(--red); }
.rp-empty { padding: 6px 2px; }

/* Slim clickable bar on the queue: "N replies awaiting your review" -> /review/.
   Replaces the old top-of-queue panel so reviews no longer block the work. */
.review-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), var(--card));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius);
  padding: 11px 16px;
  margin: 18px 0 2px;
  color: var(--text);
  font-size: 13.5px;
}
.review-bar:hover { border-color: var(--amber); text-decoration: none; }
.review-bar .rb-bell { font-size: 15px; line-height: 1; }
.review-bar .rb-text b { color: var(--amber); font-weight: 700; }
.review-bar .rb-go { margin-left: auto; color: var(--accent-hover); font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) {
  .review-bar { flex-wrap: wrap; gap: 6px 10px; }
  .review-bar .rb-go { margin-left: 28px; }
}

/* VA feedback banners (admin's decision on their submissions) */
.va-banners { margin: 18px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.va-banner {
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.va-banner.rej {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), var(--card));
  border-color: rgba(245, 158, 11, 0.45);
}
.va-banner.app {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), var(--card));
  border-color: rgba(34, 197, 94, 0.45);
}
.vb-title { font-size: 14px; font-weight: 600; }
.vb-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--text-muted);
  margin: 7px 0 10px;
  line-height: 1.5;
}
.vb-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* website edit session panel (client + VA client pages) */
#edit-panel {
  display: block;
  background: linear-gradient(135deg, var(--accent-soft), var(--card));
  border: 1px solid rgba(0, 102, 255, 0.35);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 18px;
}
#edit-panel[hidden] { display: none; }
.edit-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.edit-head h2 { margin: 0; font-size: 16px; }
.edit-step { font-size: 13.5px; color: var(--text-muted); margin-top: 8px; }
.edit-step.muted { color: var(--text-dim); font-size: 12.5px; }
.edit-plan {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
/* visual HTML plan */
.edit-plan-wrap { margin-top: 12px; }
.edit-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}
.edit-plan-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-raise);
}
.plan-iframe {
  display: block;
  width: 100%;
  height: 440px;
  border: 0;
  background: #ffffff;
}
.edit-plan-d, .edit-plan-text { margin-top: 8px; font-size: 12.5px; }
.edit-plan-d > summary, .edit-plan-text > summary {
  cursor: pointer;
  color: var(--text-muted);
  list-style: none;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-raise);
}
.edit-plan-d > summary:hover, .edit-plan-text > summary:hover { border-color: var(--border-strong); color: var(--text); }
.edit-plan-d > summary::before { content: '▸ '; color: var(--text-dim); }
.edit-plan-d[open] > summary::before { content: '▾ '; }
.edit-plan-d[open] > summary { margin-bottom: 8px; }
.edit-plan-d > summary { color: var(--accent-hover); }
.sum-line { margin: 5px 0; }
.sum-line:first-child { color: var(--text); margin-bottom: 8px; }
.edit-plan-sum {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
  line-height: 1.5;
}
.edit-approve { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ed-changebox { flex-basis: 100%; }
.ed-feedback {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 9px 11px;
  resize: vertical;
}
.ed-changebox-foot { display: flex; gap: 8px; margin-top: 8px; }
.ed-result { flex-basis: 100%; font-size: 12.5px; color: var(--text-muted); min-height: 1em; margin-top: 4px; }
.edit-msg {
  margin-top: 12px;
  background: var(--bg-raise);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.edit-msg-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.edit-msg-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 10px;
}
.edit-log { margin-top: 12px; font-size: 12.5px; }
.edit-log summary { cursor: pointer; color: var(--text-muted); }
.edit-log ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  max-height: 240px;
  overflow-y: auto;
}
.edit-log li { margin: 4px 0; overflow-wrap: anywhere; }
.edit-log .local-ts { color: var(--text-dim); font-variant-numeric: tabular-nums; margin-right: 4px; }
.edit-foot { margin-top: 12px; }

/* ---- conversation attachments + clickable links ---- */
.msg-link { color: var(--accent-hover); text-decoration: underline; overflow-wrap: anywhere; }
.msg-link:hover { color: var(--text); }
.att-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-thumb-btn {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-raise);
  cursor: zoom-in;
  line-height: 0;
  overflow: hidden;
}
.att-thumb-btn:hover { border-color: var(--border-strong); }
.att-thumb { display: block; width: 120px; height: 90px; object-fit: cover; }
.att-vid {
  width: 220px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #000;
}
.att-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.att-file:hover { border-color: var(--border-strong); color: var(--text); }
.att-file.att-missing { cursor: default; opacity: 0.7; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ---- The List (worklist) ---- */
.wl-stats { margin-left: auto; }
.wl-table .wl-note { max-width: 280px; font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.wl-table .wl-vanotes { font-size: 12px; color: var(--text-dim); margin-top: 5px; overflow-wrap: anywhere; }
.wl-editrow > td { background: var(--bg-raise); border-top: 0; }
.wl-editor { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 10px; max-width: 760px; }
.wl-editor label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.wl-editor select, .wl-editor textarea {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 7px 9px;
}
.wl-editor select { max-width: 220px; }
.wl-editor textarea { resize: vertical; }
.wl-editor-foot { display: flex; gap: 8px; align-items: center; }

/* ===================================================== Agent Factory == */
/* These pages poll their own live state, so the global "fresh data" reload
   banner is redundant noise here. */
body:has(#factory-cmd) #update-banner,
body:has(#feed-stream) #update-banner { display: none !important; }

/* The /agents/ control room. The crew, the pipeline board and the live
   feed are rendered at runtime by /js/agents.js from factory.json, so
   these rules are global (Astro scoped styles would not match JS DOM). */

.factory-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0 14px;
}
.factory-intro .fi-left { min-width: 0; }
.factory-intro h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.factory-intro .lede { color: var(--text-muted); margin: 2px 0 0; font-size: 12.5px; }
.factory-intro .fi-right { display: flex; align-items: center; gap: 10px; }

.runtime-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.runtime-pill .rt-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
}
.runtime-pill.online { color: var(--green); border-color: var(--green-soft); }
.runtime-pill.online .rt-dot { background: var(--green); animation: rt-ping 1.8s infinite; }
.runtime-pill.offline { color: var(--text-muted); }
.runtime-pill.offline .rt-dot { background: var(--amber); }
@keyframes rt-ping {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.runtime-note {
  margin: 10px 0 0;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
}

/* ---- command bar: one centered pill ---- */
.factory-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 20px;
  max-width: 760px;
  padding: 7px 7px 7px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-wrap: wrap;
}
.factory-cmd:focus-within { border-color: var(--accent); }
.factory-cmd #cmd-input {
  flex: 1 1 260px;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 2px;
  font-family: var(--font);
  font-size: 14px;
}
.factory-cmd #cmd-input:focus { outline: none; }
.factory-cmd #cmd-input::placeholder { color: var(--text-dim); }
.factory-cmd select {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  padding: 7px 11px;
  font-family: var(--font);
  font-size: 12.5px;
}
.factory-cmd select:focus { outline: none; border-color: var(--accent); }
.factory-cmd .btn-primary { border-radius: 999px; padding-left: 18px; padding-right: 18px; }
.cmd-result { width: 100%; text-align: center; font-size: 12px; color: var(--text-muted); }
.cmd-result:empty { display: none; }
.cmd-result.ok { color: var(--green); }
.cmd-result.err { color: var(--amber); }
@media (max-width: 600px) {
  .factory-cmd { border-radius: var(--radius); padding: 10px; }
  .factory-cmd #cmd-input { flex: 1 1 100%; }
  .factory-cmd select { flex: 1; }
}

/* ---- crew strip ---- */
.crew {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 4px;
}
@media (max-width: 820px) { .crew { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .crew { grid-template-columns: 1fr; } }
.agent-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color .15s, transform .15s;
}
.agent-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.agent-card.working { border-color: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.agent-card.blocked { box-shadow: inset 3px 0 0 var(--amber); }
.agent-card.error { box-shadow: inset 3px 0 0 var(--red); }
.agent-top { display: flex; align-items: center; gap: 10px; }
.agent-emoji {
  position: relative;
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--card-2);
  font-size: 21px;
  overflow: hidden;
}
/* Face image (ChatGPT-generated) fills the tile; if it fails to load the
   onerror handler removes it and the emoji shows through. */
.agent-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.agent-id { display: flex; flex-direction: column; line-height: 1.2; }
.agent-id .nm { font-weight: 700; font-size: 14.5px; }
.agent-id .rl { color: var(--text-dim); font-size: 11.5px; }
.agent-status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
  color: var(--text-muted);
}
.agent-status .sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.agent-card.working .agent-status { color: var(--accent-hover); }
.agent-card.working .agent-status .sdot { background: var(--accent); animation: rt-ping 1.8s infinite; }
.agent-card.blocked .agent-status .sdot { background: var(--amber); }
.agent-step { font-size: 12.5px; color: var(--text); min-height: 17px; }
.agent-step .muted { color: var(--text-dim); }
.agent-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.agent-card .agent-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ---- pipeline board ---- */
.board-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; }
.board-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
.board-head .count { color: var(--text-dim); font-size: 12.5px; font-weight: 500; }
/* Horizontal pipeline: ~4 comfortable columns visible, scroll/drag for the
   rest. Cards stay readable rather than cramming all 9 stages on one line. */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 250px;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  cursor: grab;
  scrollbar-width: thin;
}
.board.dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; }
.board.dragging .job-card { cursor: grabbing; }
@media (max-width: 560px) { .board { grid-auto-columns: 82vw; } }
.stage-col {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 10px;
  min-height: 130px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 9px;
}
.stage-col.is-review { border-color: var(--amber-soft); }
.stage-head { display: flex; align-items: center; gap: 7px; }
.stage-head .se { font-size: 15px; }
.stage-head .sl { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-head .sc {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--card-2); color: var(--text-muted);
  border-radius: 999px; padding: 1px 8px;
}
.stage-empty { font-size: 18px; color: var(--text-dim); padding: 6px 2px; opacity: .3; text-align: center; }

.job-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
  transition: border-color .15s;
}
.job-card:hover { border-color: var(--border-strong); }
.job-card .jt {
  font-weight: 600; font-size: 13.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.job-card .jsrc { font-size: 11px; color: var(--text-dim); }
.job-card .jbar { height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.job-card .jbar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.job-card .jfoot { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.job-card .jassignee { display: inline-flex; align-items: center; gap: 4px; }
.job-card.awaiting { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber-soft); }
.job-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.job-actions .btn { flex: 1 1 auto; }
.job-target {
  width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 11.5px;
}
.job-target:focus { outline: none; border-color: var(--accent); }

/* agent questions raised mid-job */
.job-card.asking { border-color: var(--purple-soft); }
.job-card.needs-you { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber-soft); }
.job-q {
  margin-top: 4px; padding: 8px 9px; border-radius: var(--radius-sm);
  background: var(--bg-raise); font-size: 11.5px; line-height: 1.45; color: var(--text-muted);
}
.job-q b { color: var(--text); font-weight: 600; }
.job-q .muted { color: var(--text-dim); margin-top: 3px; font-size: 11px; }
.job-q.ask-you { background: var(--amber-soft); }
.job-answer {
  width: 100%; margin-top: 7px; resize: vertical;
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 6px 8px; font-family: var(--font); font-size: 12px;
}
.job-answer:focus { outline: none; border-color: var(--accent); }

/* ---- dedicated live feed page (/agents/feed/) ---- */
.feed-page { max-width: 720px; margin: 0 auto; }
.feed-page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 22px 0 14px;
}
.feed-page-head h1 { font-size: 22px; font-weight: 700; margin: 0; }
.feed-stream {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feed-empty { padding: 26px 16px; color: var(--text-dim); text-align: center; }
.feed-item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-item.fresh { animation: feed-in 1.4s ease; }
@keyframes feed-in { from { background: var(--accent-soft); } to { background: transparent; } }
.feed-item .fe { font-size: 18px; flex: none; line-height: 1.25; }
.feed-item .fbody { font-size: 13.5px; line-height: 1.5; min-width: 0; }
.feed-item .fwho { font-weight: 700; }
.feed-item .ftime { color: var(--text-dim); font-size: 11px; margin-top: 3px; }
.feed-kind {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 0 5px; border-radius: 4px; background: var(--card-2); color: var(--text-muted);
}

/* agent / chip colour helpers (mirror chip palette) */
.c-blue { color: var(--accent-hover); } .bg-blue { background: var(--accent-soft); }
.c-purple { color: var(--purple); } .bg-purple { background: var(--purple-soft); }
.c-amber { color: var(--amber); } .bg-amber { background: var(--amber-soft); }
.c-green { color: var(--green); } .bg-green { background: var(--green-soft); }
.c-red { color: var(--red); } .bg-red { background: var(--red-soft); }
.c-accent { color: var(--accent-hover); } .bg-accent { background: var(--accent-soft); }

/* ============================================ PREMIUM POLISH (both themes) */
/* Layered on top of the rules above, using the design tokens, so light and
   dark both pick up brevibot.com's gradients, soft shadows and motion. */

body {
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* brand: gradient dot + tighter wordmark */
.pulse-dot { background: var(--gradient-brand); }
.pulse-dot::after { border-color: var(--accent-2); }
.brand { letter-spacing: -0.03em; font-weight: 800; }
.brand-for { font-weight: 600; }
.demo-pill {
  background: var(--gradient-brand) !important;
  box-shadow: var(--shadow-brand);
}

/* header: refined glass */
.site-header {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.header-nav a { transition: color .15s; }

/* stat cards: soft shadow, hover lift, gradient active */
.stat {
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .15s, background .2s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat.active { background: var(--gradient-brand-soft); border-color: var(--accent); }
.stat-total { background: var(--gradient-brand-soft); border-color: rgba(0, 102, 255, 0.3); }
.stat .num { letter-spacing: -0.04em; }

/* search + filter chips */
.search { box-shadow: var(--shadow-sm); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fchip { transition: transform .14s var(--ease), border-color .15s, color .15s, background .15s; box-shadow: var(--shadow-sm); }
.fchip:hover { transform: translateY(-1px); }
.fchip.active { background: var(--gradient-brand); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }

/* tables + cards lift off the page; rows tint on hover */
.tablewrap, .card { box-shadow: var(--shadow-sm); }
.card { border-radius: var(--radius); }
.queue tbody tr:hover { background: var(--accent-soft); }
.client-name a:hover { color: var(--accent); }

/* buttons: gradient primary with a brand glow */
.btn { transition: transform .14s var(--ease), box-shadow .14s, border-color .14s, background .14s, color .14s, filter .14s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gradient-brand); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--gradient-brand); filter: brightness(1.07); color: #fff; box-shadow: 0 16px 40px rgba(0, 102, 255, 0.28); }
.btn-primary:active { transform: translateY(0); }

/* hero: brand-tinted card with a gradient hairline */
.hero {
  background: var(--gradient-brand-soft), var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gradient-brand); }
.hero h1 { letter-spacing: -0.03em; }

/* section titles get a small gradient tick */
.section-title { position: relative; padding-left: 15px; }
.section-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 17px; border-radius: 3px; background: var(--gradient-brand);
}

/* modal depth + action callout / timeline accents */
.modal { box-shadow: var(--shadow-lg); border-radius: var(--radius-lg); }
.action-callout { background: var(--gradient-brand-soft), var(--card); border-color: rgba(0, 102, 255, 0.25); }
.timeline .tmsg:last-child { box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-sm); }
.email-msg { box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------- explainer videos -- */
/* A clearly-labelled "this is a guide, not the live tool" banner that opens
   a polished video modal. Sits at the top of the queue, builds and client. */
.explainer {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--gradient-brand-soft), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px 20px;
  margin: 22px 0 6px;
  position: relative;
  overflow: hidden;
}
.explainer::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gradient-brand); }
.explainer .ex-icon {
  flex: none;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-brand);
  font-size: 23px;
}
.explainer .ex-body { flex: 1 1 340px; min-width: 0; }
.explainer .ex-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 6px;
}
.explainer .ex-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.explainer .ex-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.explainer .ex-actions { display: flex; flex-wrap: wrap; gap: 9px; flex: none; }
.explainer .ex-dismiss {
  position: absolute; top: 10px; right: 12px;
  background: none; border: 0; color: var(--text-dim);
  font-size: 17px; line-height: 1; cursor: pointer; padding: 4px;
}
.explainer .ex-dismiss:hover { color: var(--text); }
.btn-play::before { content: '▶'; font-size: 10px; }
@media (max-width: 720px) {
  .explainer { padding: 16px; }
  .explainer .ex-body { flex-basis: 100%; }
  .explainer .ex-actions { flex-basis: 100%; width: 100%; }
  .explainer .ex-actions .btn { flex: 1 1 140px; justify-content: center; }
}

/* video modal */
.vmodal-back {
  display: none;
  position: fixed; inset: 0; z-index: 120;
  background: rgba(8, 11, 18, 0.74);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 22px;
}
.vmodal-back.open { display: flex; }
.vmodal {
  width: 100%; max-width: 920px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.vmodal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.vmodal-head .vm-title { font-weight: 700; font-size: 15px; }
.vmodal-head .vm-sub { font-size: 12px; color: var(--text-dim); }
.vmodal-head .vm-close {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  width: 30px; height: 30px; cursor: pointer; font-size: 16px; line-height: 1;
}
.vmodal-head .vm-close:hover { color: var(--text); border-color: var(--border-strong); }
.vmodal video { display: block; width: 100%; max-height: 76vh; background: #000; }
.vmodal-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.vmodal-tabs .vtab {
  font: inherit; font-size: 12.5px; font-weight: 600;
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 999px; padding: 6px 13px; cursor: pointer;
}
.vmodal-tabs .vtab:hover { border-color: var(--border-strong); color: var(--text); }
.vmodal-tabs .vtab.active { background: var(--gradient-brand); border-color: transparent; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .stat:hover, .btn:hover, .fchip:hover { transform: none; }
}
