/* ==========================================================================
   BOB V3 — COMMAND CENTER
   Futuristic dark UI. Vanilla CSS, no frameworks.

   Structure:
     1. Tokens          6. Cards & panels     11. Modals
     2. Reset & base    7. Stat tiles         12. Toasts
     3. Layout          8. Buttons            13. Chat
     4. Top bar         9. Forms              14. Calendar
     5. Sidebar        10. Tables             15. Utility / responsive

   Every class name from the previous stylesheet is preserved — the page
   scripts generate this markup, so these are a contract, not decoration.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Depth: void is the page, panel is a card, elevated is a raised element. */
  --bg-void:      #060910;
  --bg-deep:      #0a0e17;
  --bg-panel:     #0d1420;
  --bg-elevated:  #111b2b;
  --bg-input:     #070c14;

  /* Glass surfaces sit over the animated background. */
  --glass:        rgba(14, 24, 40, 0.72);
  --glass-light:  rgba(20, 33, 54, 0.6);

  /* Cyan is the system colour. Dim borders, hot glows. */
  --cyan:         #00d4ff;
  --cyan-bright:  #00f0ff;
  --cyan-deep:    #0891b2;
  --cyan-shadow:  rgba(0, 212, 255, 0.5);

  --border:       rgba(0, 212, 255, 0.13);
  --border-mid:   rgba(0, 212, 255, 0.30);
  --border-hot:   rgba(0, 240, 255, 0.60);

  --text:         #d5e4f2;
  --text-muted:   #7e94ac;
  --text-dim:     #4c5f76;

  /* Status palette — used by the glowing indicator dots. */
  --green:        #00ff9d;
  --amber:        #ffb340;
  --red:          #ff4d6a;
  --purple:       #a97bff;
  --blue:         #4d9fff;

  --radius:       12px;
  --radius-sm:    7px;
  --sidebar-w:    236px;
  --topbar-h:     62px;

  --glow-sm:      0 0 12px rgba(0, 212, 255, 0.18);
  --glow-md:      0 0 22px rgba(0, 212, 255, 0.22);
  --glow-lg:      0 0 40px rgba(0, 212, 255, 0.26);
  --shadow:       0 18px 50px rgba(0, 0, 0, 0.7);

  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: 'Orbitron', var(--font);

  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. Reset & base ----------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-void);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Two fixed layers behind everything: a faint engineering grid, and a pair
   of slow-drifting cyan auroras. Both are decorative and non-interactive. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
}

body::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 18% 12%, rgba(0, 150, 200, 0.14), transparent 60%),
    radial-gradient(ellipse 45% 45% at 85% 78%, rgba(0, 100, 190, 0.11), transparent 62%),
    radial-gradient(ellipse 40% 30% at 55% 95%, rgba(90, 60, 200, 0.08), transparent 65%);
  animation: aurora 26s ease-in-out infinite alternate;
}

@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -1.5%, 0) scale(1.05); }
  100% { transform: translate3d(-1.5%, 1.5%, 0) scale(1.02); }
}

/* Everything real sits above the two decorative layers. */
.layout, .topbar, .modal-backdrop, .toast-stack, .chat-fab, .login-page {
  position: relative;
  z-index: 1;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.16s var(--ease); }
a:hover { color: var(--cyan-bright); text-shadow: 0 0 10px var(--cyan-shadow); text-decoration: none; }

h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; line-height: 1.25; letter-spacing: -0.2px; }
h1 { font-size: 25px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }

code, pre, .mono { font-family: var(--font-mono); font-size: 0.88em; }

::selection { background: rgba(0, 212, 255, 0.28); color: #fff; }

/* Slim cyan scrollbars, so they read as part of the console. */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.22);
  border-radius: 5px;
  border: 2px solid var(--bg-void);
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.42); }

/* --- 3. Layout ----------------------------------------------------------- */

.layout { display: flex; min-height: 100vh; }

.main {
  position: relative;
  z-index: 1;          /* above the ambient radar sweep */
  flex: 1;
  min-width: 0;
  padding: calc(var(--topbar-h) + 22px) 28px 96px;
  max-width: 1720px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-header h1 {
  display: flex;
  align-items: center;
  gap: 11px;
}
/* Short cyan rule before every page title. */
.page-header h1::before {
  content: "";
  width: 3px;
  height: 24px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan-bright), transparent);
  box-shadow: 0 0 12px var(--cyan-shadow);
}
.page-header .subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 2px 0 0 14px;
}
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* Section label: small uppercase mono heading used across the dashboard. */
.section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cyan);
  font-weight: 500;
  opacity: 0.92;
}

/* --- 4. Top bar ---------------------------------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: rgba(8, 13, 22, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
/* Hairline of cyan light along the bottom edge. */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), transparent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  background: rgba(0, 212, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.status-pill strong { color: var(--green); font-weight: 500; }

/* Glowing status dot with a pulsing halo. Colour set by a modifier. */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green), 0 0 18px rgba(0, 255, 157, 0.45);
  position: relative;
  flex: 0 0 auto;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: var(--green);
  opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
.status-dot.amber { background: var(--amber); box-shadow: 0 0 9px var(--amber), 0 0 18px rgba(255,179,64,.4); }
.status-dot.amber::after { color: var(--amber); }
.status-dot.red   { background: var(--red);   box-shadow: 0 0 9px var(--red),   0 0 18px rgba(255,77,106,.4); }
.status-dot.red::after { color: var(--red); }
.status-dot.dim   { background: var(--text-dim); box-shadow: none; }
.status-dot.dim::after { display: none; }

@keyframes ping {
  0%   { opacity: 0.85; transform: scale(0.7); }
  70%  { opacity: 0;    transform: scale(1.9); }
  100% { opacity: 0;    transform: scale(1.9); }
}

.topbar-clock {
  margin-left: auto;
  text-align: center;
  line-height: 1.15;
  min-width: 168px;
}
.topbar-clock .clock-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.topbar-clock .clock-time {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 500;
  color: var(--cyan-bright);
  text-shadow: 0 0 16px var(--cyan-shadow);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.topbar-clock + .topbar-right { margin-left: auto; }

.topbar-search { position: relative; }
.topbar-search input {
  width: 240px;
  background: rgba(7, 12, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font);
  transition: all 0.22s var(--ease);
}
.topbar-search input:focus {
  outline: none;
  width: 300px;
  border-color: var(--border-hot);
  box-shadow: var(--glow-md);
  background: rgba(7, 12, 20, 1);
}
.topbar-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 12px;
  pointer-events: none;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  position: relative;
}
.icon-btn:hover {
  color: var(--cyan-bright);
  border-color: var(--border-hot);
  box-shadow: var(--glow-sm);
  background: rgba(0, 212, 255, 0.07);
}
/* Red dot on the bell when something needs attention. */
.icon-btn .dot-alert {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 7px var(--red);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 13px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
  transition: all 0.18s var(--ease);
}
.profile-chip:hover { border-color: var(--border-mid); box-shadow: var(--glow-sm); }
.profile-chip .who { line-height: 1.15; text-align: right; }
.profile-chip .who b { display: block; font-size: 12.5px; font-weight: 600; }
.profile-chip .who span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cyan);
}
.profile-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cyan-deep), #0b3a5c);
  border: 1px solid var(--border-hot);
  box-shadow: var(--glow-sm);
  font-size: 14px;
}

/* --- 5. Sidebar ---------------------------------------------------------- */

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, rgba(10, 17, 30, 0.96), rgba(7, 11, 20, 0.98));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 95;
}
/* Vertical cyan light along the sidebar's right edge. */
.sidebar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: -1px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.45) 22%,
                              rgba(0, 212, 255, 0.45) 78%, transparent);
}

.sidebar-brand {
  padding: 19px 18px 17px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sidebar-brand .logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #eafaff;
  /* Layered glow — the title should look lit from behind. */
  text-shadow: 0 0 10px var(--cyan-shadow), 0 0 28px rgba(0, 212, 255, 0.4);
  animation: title-pulse 4.5s ease-in-out infinite;
}
@keyframes title-pulse {
  0%, 100% { text-shadow: 0 0 10px var(--cyan-shadow), 0 0 28px rgba(0,212,255,.35); }
  50%      { text-shadow: 0 0 15px var(--cyan-shadow), 0 0 42px rgba(0,212,255,.55); }
}
.sidebar-brand .logo-mark {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-hot);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 50%, rgba(0,212,255,.22), transparent 70%);
  box-shadow: var(--glow-sm), inset 0 0 12px rgba(0, 212, 255, 0.15);
  font-size: 15px;
}
.sidebar-brand .tagline {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--cyan-deep);
  margin: 6px 0 0 41px;
}

.nav { padding: 12px 0 18px; flex: 1; }
.nav-section {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-dim);
  padding: 16px 20px 7px;
  font-weight: 500;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: all 0.2s var(--ease);
  overflow: hidden;
}
/* Cyan sweep that slides in from the left on hover. */
.nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.16), transparent 75%);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.nav a:hover {
  color: #eafaff;
  text-decoration: none;
  transform: translateX(3px);
}
.nav a:hover::before { opacity: 1; }
.nav a:hover .icon { color: var(--cyan-bright); filter: drop-shadow(0 0 7px var(--cyan-shadow)); }

.nav a.active {
  color: #eafaff;
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.14), rgba(0, 212, 255, 0.02));
  box-shadow: inset 0 0 22px rgba(0, 212, 255, 0.07);
}
/* Bright bar marking the current page. */
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cyan-bright);
  box-shadow: 0 0 12px var(--cyan-bright), 0 0 22px var(--cyan-shadow);
}
.nav a.active .icon { color: var(--cyan-bright); filter: drop-shadow(0 0 8px var(--cyan-shadow)); }

.nav a .icon {
  width: 17px;
  text-align: center;
  font-size: 14px;
  flex: 0 0 auto;
  transition: all 0.2s var(--ease);
  position: relative;
  z-index: 1;
}
.nav a .label { position: relative; z-index: 1; }

.nav a .badge-count {
  margin-left: auto;
  position: relative;
  z-index: 1;
  min-width: 20px;
  text-align: center;
  background: rgba(0, 212, 255, 0.14);
  border: 1px solid var(--border-mid);
  color: var(--cyan-bright);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
  box-shadow: 0 0 9px rgba(0, 212, 255, 0.14);
}
/* Overdue counts turn red and pulse. */
.nav a .badge-count.alert {
  background: rgba(255, 77, 106, 0.16);
  border-color: rgba(255, 77, 106, 0.5);
  color: #ff8098;
  box-shadow: 0 0 10px rgba(255, 77, 106, 0.3);
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 77, 106, 0.25); }
  50%      { box-shadow: 0 0 16px rgba(255, 77, 106, 0.6); }
}
.nav a .badge-count:empty { display: none; }

.sidebar-footer {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- 6. Cards & panels --------------------------------------------------- */

.card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(13px) saturate(125%);
  -webkit-backdrop-filter: blur(13px) saturate(125%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 18px;
  margin-bottom: 18px;
  transition: border-color 0.28s var(--ease), box-shadow 0.28s var(--ease),
              transform 0.28s var(--ease);
}
/* Top highlight — the "lit edge" that sells the glass effect. */
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: 14%; right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.55), transparent);
  opacity: 0.55;
  transition: opacity 0.28s var(--ease);
}
.card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--glow-md), var(--shadow);
}
.card:hover::before { opacity: 1; }

/* Angular corner brackets, like a targeting reticle. Opt in with .bracketed. */
.card.bracketed::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 13px; height: 13px;
  border-top: 1px solid var(--border-mid);
  border-right: 1px solid var(--border-mid);
  border-radius: 0 4px 0 0;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 9px;
}
.card-header .link-more {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  text-transform: uppercase;
  transition: all 0.18s var(--ease);
}
.card-header .link-more:hover { color: var(--cyan-bright); text-shadow: 0 0 9px var(--cyan-shadow); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* Dashboard's asymmetric hero row: rail | centre | rail */
.grid-hero { grid-template-columns: 300px minmax(0, 1fr) 340px; }

/* --- 7. Stat tiles ------------------------------------------------------- */

.stat {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  overflow: hidden;
  transition: all 0.28s var(--ease);
}
/* Colour bar down the left, brightened per status modifier. */
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cyan);
  opacity: 0.55;
  box-shadow: 0 0 12px var(--cyan-shadow);
  transition: opacity 0.28s var(--ease);
}
.stat:hover {
  border-color: var(--border-mid);
  box-shadow: var(--glow-md);
  transform: translateY(-2px);
}
.stat:hover::before { opacity: 1; }

.stat .stat-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.stat .stat-value {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.05;
  letter-spacing: -1px;
  color: #eafaff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(0, 212, 255, 0.28);
}
.stat .stat-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.stat.accent .stat-value { color: var(--cyan-bright); text-shadow: 0 0 22px var(--cyan-shadow); }
.stat.good   .stat-value { color: var(--green); text-shadow: 0 0 22px rgba(0, 255, 157, 0.4); }
.stat.good::before   { background: var(--green); box-shadow: 0 0 12px var(--green); }
.stat.warn   .stat-value { color: var(--amber); text-shadow: 0 0 22px rgba(255, 179, 64, 0.4); }
.stat.warn::before   { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.stat.bad    .stat-value { color: var(--red); text-shadow: 0 0 22px rgba(255, 77, 106, 0.4); }
.stat.bad::before    { background: var(--red); box-shadow: 0 0 12px var(--red); }

/* --- 7b. Dashboard modules ---------------------------------------------- */

/* AI Core Overview — subsystem status rail */
.core-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  margin-bottom: 7px;
  transition: all 0.22s var(--ease);
}
.core-item:last-child { margin-bottom: 0; }
.core-item:hover {
  border-color: var(--border-mid);
  background: rgba(0, 212, 255, 0.05);
  transform: translateX(3px);
}
.core-item .core-icon {
  width: 29px; height: 29px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: rgba(0, 212, 255, 0.09);
  border: 1px solid var(--border);
  font-size: 13px;
}
.core-item .core-body { flex: 1; min-width: 0; line-height: 1.3; }
.core-item .core-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.core-item .core-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Central "AI CORE" hero orb */
.core-hero {
  position: relative;
  min-height: 292px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(0, 130, 190, 0.16), transparent 62%),
    var(--glass);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
}
/* Three concentric rings, counter-rotating. */
.core-hero .ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.18);
  transform: translate(-50%, -50%);
}
.core-hero .ring.r1 {
  width: 218px; height: 218px;
  border-style: dashed;
  animation: spin 34s linear infinite;
}
.core-hero .ring.r2 {
  width: 272px; height: 272px;
  border-color: rgba(0, 212, 255, 0.11);
  animation: spin 52s linear infinite reverse;
}
.core-hero .ring.r3 {
  width: 166px; height: 166px;
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: inset 0 0 32px rgba(0, 212, 255, 0.16), 0 0 32px rgba(0, 212, 255, 0.1);
  animation: spin 22s linear infinite;
}
/* Orbiting node on the inner ring. */
.core-hero .ring.r1::after {
  content: "";
  position: absolute;
  top: -3px; left: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan-bright);
  box-shadow: 0 0 12px var(--cyan-bright);
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.core-hero .core-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #eafaff;
  text-shadow: 0 0 18px var(--cyan-shadow), 0 0 46px rgba(0, 212, 255, 0.55);
  animation: title-pulse 4.5s ease-in-out infinite;
}
.core-hero .core-sub {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-top: 5px;
}
.core-hero .core-version {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-top: 12px;
}

/* Live Intelligence Feed */
.feed-item {
  display: flex;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { transform: translateX(3px); }
.feed-item .feed-icon {
  width: 27px; height: 27px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  font-size: 12px;
  background: rgba(0, 212, 255, 0.09);
  border: 1px solid var(--border);
}
.feed-item.alert .feed-icon { background: rgba(255, 77, 106, 0.12); border-color: rgba(255,77,106,.35); }
.feed-item.warn  .feed-icon { background: rgba(255, 179, 64, 0.12); border-color: rgba(255,179,64,.35); }
.feed-item.good  .feed-icon { background: rgba(0, 255, 157, 0.1);  border-color: rgba(0,255,157,.3); }
.feed-item .feed-body { flex: 1; min-width: 0; line-height: 1.4; }
.feed-item .feed-text { font-size: 12.5px; color: var(--text); }
.feed-item .feed-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Active Agents grid */
.agent-card {
  position: relative;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  transition: all 0.26s var(--ease);
  overflow: hidden;
}
.agent-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--glow-sm);
  transform: translateY(-2px);
}
.agent-card .agent-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.agent-card .agent-icon {
  width: 31px; height: 31px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--border-mid);
  font-size: 14px;
}
.agent-card .agent-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.agent-card .agent-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}
.agent-card.online  .agent-state { color: var(--green); }
.agent-card.standby .agent-state { color: var(--amber); }
.agent-card.offline .agent-state { color: var(--red); }
.agent-card.offline .agent-icon { opacity: 0.45; }

/* Mission Timeline */
.timeline { position: relative; padding-left: 19px; }
/* The vertical spine. */
.timeline::before {
  content: "";
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--cyan), rgba(0, 212, 255, 0.1));
}
.timeline-item { position: relative; padding: 8px 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -19px; top: 15px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 9px var(--cyan-shadow);
}
.timeline-item.done::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 9px var(--green); }
.timeline-item.overdue::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 9px var(--red); }
.timeline-item .tl-time {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--cyan);
  text-transform: uppercase;
}
.timeline-item .tl-title { font-size: 12.5px; font-weight: 500; margin-top: 1px; }
.timeline-item.done .tl-title { text-decoration: line-through; opacity: 0.5; }
.timeline-item .tl-meta { font-size: 11px; color: var(--text-dim); }

/* Quick Commands */
.cmd-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 13px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.cmd-btn:last-child { margin-bottom: 0; }
.cmd-btn:hover {
  border-color: var(--border-hot);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: var(--glow-sm);
  transform: translateX(4px);
  color: #eafaff;
}
.cmd-btn .cmd-icon {
  width: 26px; height: 26px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.11);
  border: 1px solid var(--border);
  font-size: 12px;
  transition: all 0.22s var(--ease);
}
.cmd-btn:hover .cmd-icon {
  background: rgba(0, 212, 255, 0.22);
  border-color: var(--border-hot);
  box-shadow: 0 0 11px rgba(0, 212, 255, 0.35);
}

/* --- 8. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 15px;
  font-size: 12.5px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: all 0.22s var(--ease);
}
/* Light sweep that crosses the button on hover. */
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -110%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.18), transparent);
  transition: left 0.55s var(--ease);
}
.btn:hover:not(:disabled)::after { left: 110%; }
.btn:hover:not(:disabled) {
  border-color: var(--border-hot);
  color: #eafaff;
  box-shadow: var(--glow-sm);
  background: rgba(0, 212, 255, 0.07);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.9), rgba(0, 150, 210, 0.85));
  border-color: var(--cyan-bright);
  color: #041018;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.32);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--cyan-bright), var(--cyan));
  color: #041018;
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.55);
}
.btn-danger { border-color: rgba(255, 77, 106, 0.4); color: #ff8098; }
.btn-danger:hover:not(:disabled) {
  background: rgba(255, 77, 106, 0.12);
  border-color: var(--red);
  color: #ffa0b2;
  box-shadow: 0 0 16px rgba(255, 77, 106, 0.3);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: rgba(0, 212, 255, 0.07); color: var(--cyan-bright); }
.btn-sm { padding: 4px 10px; font-size: 11.5px; }
.btn-block { width: 100%; }

.quick-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* --- 9. Forms ------------------------------------------------------------ */

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--cyan);
  margin-bottom: 6px;
  opacity: 0.85;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="email"],
input[type="search"], input[type="url"], select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--font);
  transition: all 0.22s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-hot);
  box-shadow: var(--glow-md), inset 0 0 12px rgba(0, 212, 255, 0.05);
  background: #050a12;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
/* Make the native date/time pickers visible on a dark background. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(4) hue-rotate(155deg);
  cursor: pointer;
}

.field-row { display: flex; gap: 13px; }
.field-row .field { flex: 1; }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
  padding: 13px 15px;
  background: var(--glass);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filters input[type="search"] { max-width: 250px; }
.filters select { width: auto; min-width: 145px; }

/* --- 10. Tables ---------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 11px 15px;
  background: rgba(0, 212, 255, 0.05);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-mid);
  white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; transition: color 0.18s var(--ease); }
thead th.sortable:hover { color: var(--cyan-bright); text-shadow: 0 0 9px var(--cyan-shadow); }
thead th.sortable::after { content: " ⇅"; opacity: 0.3; font-size: 9px; }
thead th.sort-asc::after  { content: " ↑"; opacity: 1; }
thead th.sort-desc::after { content: " ↓"; opacity: 1; }

tbody td { padding: 11px 15px; border-bottom: 1px solid rgba(0, 212, 255, 0.07); vertical-align: middle; }
tbody tr { transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover {
  background: rgba(0, 212, 255, 0.05);
  box-shadow: inset 2px 0 0 var(--cyan);
}
td.actions { white-space: nowrap; text-align: right; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* --- 10b. Badges --------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge-high, .badge-critical, .badge-overdue, .badge-not_interested {
  background: rgba(255, 77, 106, 0.11); border-color: rgba(255, 77, 106, 0.35);
  color: #ff8098; box-shadow: 0 0 10px rgba(255, 77, 106, 0.13);
}
.badge-medium, .badge-in_progress, .badge-sent, .badge-contacted {
  background: rgba(255, 179, 64, 0.11); border-color: rgba(255, 179, 64, 0.35);
  color: #ffc879; box-shadow: 0 0 10px rgba(255, 179, 64, 0.13);
}
.badge-low, .badge-todo, .badge-new {
  background: rgba(0, 212, 255, 0.1); border-color: var(--border-mid);
  color: var(--cyan-bright); box-shadow: 0 0 10px rgba(0, 212, 255, 0.13);
}
.badge-done, .badge-paid, .badge-active, .badge-replied,
.badge-meeting_scheduled, .badge-completed {
  background: rgba(0, 255, 157, 0.1); border-color: rgba(0, 255, 157, 0.32);
  color: #5cffc4; box-shadow: 0 0 10px rgba(0, 255, 157, 0.13);
}
.badge-researched, .badge-draft, .badge-pending, .badge-edited {
  background: rgba(169, 123, 255, 0.11); border-color: rgba(169, 123, 255, 0.35);
  color: #c9adff; box-shadow: 0 0 10px rgba(169, 123, 255, 0.13);
}
/* Terminal states — deliberately unlit, so a finished record reads as
   settled rather than competing with live ones for attention. */
.badge-closed, .badge-cancelled, .badge-churned {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.11);
  color: var(--text-dim);
}

/* --- 11. Modals ---------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 20px;
  z-index: 200;
  overflow-y: auto;
  animation: fade-in 0.18s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: linear-gradient(160deg, rgba(17, 28, 46, 0.97), rgba(10, 16, 27, 0.98));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow), var(--glow-lg);
  animation: modal-in 0.24s var(--ease);
  position: relative;
}
.modal::before {
  content: "";
  position: absolute;
  top: -1px; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-bright), transparent);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.modal.modal-wide { max-width: 820px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 21px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--cyan);
}
.modal-body { padding: 21px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 21px;
  border-top: 1px solid var(--border);
}
.modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
  transition: all 0.18s var(--ease);
}
.modal-close:hover { color: var(--red); text-shadow: 0 0 11px rgba(255, 77, 106, 0.6); }

/* --- 12. Toasts ---------------------------------------------------------- */

.toast-stack {
  position: fixed; bottom: 24px; left: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 9px; max-width: 400px;
}
.toast {
  background: rgba(14, 24, 40, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow), var(--glow-sm);
  animation: slide-in 0.24s var(--ease);
}
.toast.error   { border-left-color: var(--red);   box-shadow: var(--shadow), 0 0 20px rgba(255,77,106,.2); }
.toast.success { border-left-color: var(--green); box-shadow: var(--shadow), 0 0 20px rgba(0,255,157,.2); }
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: none; }
}

/* --- 13. Chat ------------------------------------------------------------ */

/* Chat page: session rail on the left, active conversation on the right. */
.chat-layout {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.chat-rail {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  max-height: calc(100vh - var(--topbar-h) - 60px);
}
.chat-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}
.chat-rail-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-dim);
  padding: 0 2px;
}

/* Collapsible project folder */
.chat-folder { margin-bottom: 4px; }
.chat-folder-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background 0.18s var(--ease);
}
.chat-folder-head:hover { background: rgba(0, 212, 255, 0.06); }
.chat-folder-caret {
  color: var(--cyan);
  font-size: 9px;
  transition: transform 0.2s var(--ease);
  transform: rotate(90deg);
}
.chat-folder.collapsed .chat-folder-caret { transform: rotate(0deg); }
.chat-folder-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-folder-count {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0 6px;
}
.chat-folder-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: all 0.18s var(--ease);
}
.chat-folder-head:hover .chat-folder-btn { opacity: 1; }
.chat-folder-btn:hover { color: var(--cyan-bright); }
.chat-folder-btn[data-folder-del]:hover { color: var(--red); }

.chat-folder-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 3px 0 3px 9px;
  border-left: 1px solid var(--border);
  margin-left: 11px;
}
.chat-folder.collapsed .chat-folder-body { display: none; }
.chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 3px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}
.chat-item:hover {
  border-color: var(--border-mid);
  background: rgba(0, 212, 255, 0.06);
  transform: translateX(2px);
}
.chat-item.active {
  border-color: var(--border-hot);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.13), rgba(0, 212, 255, 0.03));
  box-shadow: var(--glow-sm);
}
/* Bright bar marking the open chat, mirroring the sidebar's active state. */
.chat-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--cyan-bright);
  box-shadow: 0 0 10px var(--cyan-bright);
}
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-title {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item.active .chat-item-title { color: #eafaff; }
.chat-item-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item-btn {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: all 0.18s var(--ease);
}
.chat-item:hover .chat-item-btn { opacity: 1; }
.chat-item-btn:hover { color: var(--cyan-bright); text-shadow: 0 0 9px var(--cyan-shadow); }
.chat-item-btn.danger { font-size: 17px; }
.chat-item-btn.danger:hover { color: var(--red); text-shadow: 0 0 10px rgba(255, 77, 106, 0.6); }

.chat-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 11px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.chat-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cyan);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s var(--ease);
}
.chat-title:hover { color: var(--cyan-bright); text-shadow: 0 0 10px var(--cyan-shadow); }

.chat-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 152px);
  min-width: 0;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 6px 6px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg { display: flex; gap: 12px; max-width: 86%; animation: msg-in 0.28s var(--ease); }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex: 0 0 auto; margin-top: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.msg.assistant .msg-avatar {
  background: radial-gradient(circle at 50% 40%, rgba(0, 212, 255, 0.3), rgba(0, 90, 140, 0.2));
  border-color: var(--border-hot);
  box-shadow: var(--glow-sm), inset 0 0 12px rgba(0, 212, 255, 0.2);
}

.msg-bubble {
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  position: relative;
}
/* Bob's replies glow; the user's are a plain darker card. */
.msg.assistant .msg-bubble {
  border-color: var(--border-mid);
  background: linear-gradient(145deg, rgba(0, 212, 255, 0.07), rgba(14, 24, 40, 0.82));
  box-shadow: var(--glow-sm), inset 0 1px 0 rgba(0, 212, 255, 0.12);
}
.msg.user .msg-bubble {
  background: rgba(8, 14, 24, 0.9);
  border-color: rgba(255, 255, 255, 0.07);
}

.msg-bubble p { margin: 0 0 10px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 7px 0; padding-left: 22px; }
.msg-bubble li { margin: 3px 0; }
.msg-bubble code {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
  color: var(--cyan-bright);
  font-family: var(--font-mono);
}
.msg-bubble pre {
  background: rgba(0, 0, 0, 0.5);
  padding: 12px 14px; border-radius: var(--radius-sm);
  overflow-x: auto; margin: 10px 0;
  border: 1px solid var(--border);
}
.msg-bubble pre code { background: none; border: none; padding: 0; color: var(--text); }
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  font-size: 14px; margin: 13px 0 7px; color: var(--cyan);
}
.msg-tool {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.msg-tool::before { content: "▸ "; color: var(--cyan); }

.chat-input-row {
  display: flex; gap: 11px; align-items: flex-end;
  padding: 14px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  transition: all 0.28s var(--ease);
}
/* The whole bar lights up when the textarea has focus. */
.chat-input-row:focus-within {
  border-color: var(--border-hot);
  box-shadow: var(--glow-md);
}
.chat-input-row textarea {
  min-height: 46px; max-height: 200px; resize: none;
  padding: 11px 14px;
  background: var(--bg-input);
}
.chat-input-row textarea:focus { box-shadow: none; }

/* Thinking indicator — a pulsing cyan wave while Bob works. */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 3px 0;
}
.typing .typing-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}
.typing .typing-wave span {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan-bright), var(--cyan-deep));
  box-shadow: 0 0 8px var(--cyan-shadow);
  animation: think-wave 1.25s ease-in-out infinite;
}
.typing .typing-wave span:nth-child(1) { animation-delay: 0s; }
.typing .typing-wave span:nth-child(2) { animation-delay: 0.11s; }
.typing .typing-wave span:nth-child(3) { animation-delay: 0.22s; }
.typing .typing-wave span:nth-child(4) { animation-delay: 0.33s; }
.typing .typing-wave span:nth-child(5) { animation-delay: 0.44s; }
@keyframes think-wave {
  0%, 100% { transform: scaleY(0.28); opacity: 0.45; }
  50%      { transform: scaleY(1);    opacity: 1; }
}
.typing .typing-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cyan);
  animation: label-fade 1.9s ease-in-out infinite;
}
@keyframes label-fade { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* Floating chat button */
.chat-fab {
  position: fixed; bottom: 26px; right: 26px; z-index: 150;
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--cyan-bright), var(--cyan-deep));
  color: #04121b;
  border: 1px solid var(--cyan-bright);
  font-size: 23px; cursor: pointer;
  box-shadow: 0 0 26px rgba(0, 212, 255, 0.5), var(--shadow);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.26s var(--ease);
  animation: fab-pulse 3.2s ease-in-out infinite;
}
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 0 22px rgba(0, 212, 255, 0.4), var(--shadow); }
  50%      { box-shadow: 0 0 38px rgba(0, 212, 255, 0.7), var(--shadow); }
}
.chat-fab:hover { transform: scale(1.09) rotate(-6deg); }

/* --- 14. Calendar -------------------------------------------------------- */

.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}
.cal-title {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--cyan-bright);
  text-shadow: 0 0 14px var(--cyan-shadow);
  min-width: 210px;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.cal-dayname {
  background: rgba(0, 212, 255, 0.06);
  padding: 9px 6px; text-align: center;
  font-family: var(--font-mono);
  font-size: 9px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--cyan); font-weight: 500;
}
.cal-cell {
  background: rgba(10, 16, 27, 0.85);
  min-height: 112px; padding: 7px 8px;
  display: flex; flex-direction: column; gap: 3px;
  transition: background 0.2s var(--ease);
}
.cal-cell:hover { background: rgba(0, 212, 255, 0.045); }
.cal-cell.other-month { background: rgba(6, 9, 16, 0.85); opacity: 0.42; }
.cal-cell.today {
  background: rgba(0, 212, 255, 0.09);
  box-shadow: inset 0 0 0 1px var(--border-mid);
}
.cal-cell .cal-daynum {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-muted); font-weight: 500;
}
.cal-cell.today .cal-daynum { color: var(--cyan-bright); text-shadow: 0 0 9px var(--cyan-shadow); }
.cal-event {
  font-size: 10.5px; padding: 3px 7px; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer; border-left: 2px solid;
  transition: all 0.18s var(--ease);
}
.cal-event:hover { transform: translateX(2px); filter: brightness(1.3); }
.cal-event.task      { background: rgba(0, 212, 255, 0.13);  border-left-color: var(--cyan);  color: #a5e4ff; }
.cal-event.follow_up { background: rgba(255, 179, 64, 0.13); border-left-color: var(--amber); color: #ffcf9b; }
.cal-event.google    { background: rgba(0, 255, 157, 0.11);  border-left-color: var(--green); color: #8effd0; }
.cal-event.done      { opacity: 0.42; text-decoration: line-through; }
.cal-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
}
.cal-legend .dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 2px; margin-right: 7px;
}

/* --- 15. Misc, login, utility, responsive -------------------------------- */

.empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}
.empty .empty-icon { font-size: 27px; display: block; margin-bottom: 9px; opacity: 0.5; }

.list-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { transform: translateX(3px); }
.list-item .item-body { flex: 1; min-width: 0; }
.list-item .item-title { font-weight: 500; font-size: 13px; }
.list-item .item-meta {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-dim); margin-top: 2px; letter-spacing: 0.4px;
}

.progress-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan-bright));
  box-shadow: 0 0 12px var(--cyan-shadow);
  transition: width 0.5s var(--ease);
}

.checkbox-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--cyan); cursor: pointer; flex: 0 0 auto;
}
.checkbox-row.done label { text-decoration: line-through; color: var(--text-dim); }
.checkbox-row label { flex: 1; cursor: pointer; font-size: 13px; }

.banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 17px;
  font-size: 13px;
  border: 1px solid;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.banner-warn  { background: rgba(255, 179, 64, 0.09); border-color: rgba(255, 179, 64, 0.35); color: #ffce8a; }
.banner-error { background: rgba(255, 77, 106, 0.09); border-color: rgba(255, 77, 106, 0.35); color: #ffa3b4; }
.banner-info  { background: rgba(0, 212, 255, 0.07); border-color: var(--border-mid); color: #9adcff; }
.banner code {
  background: rgba(0, 0, 0, 0.4); padding: 1px 6px;
  border-radius: 4px; color: var(--cyan-bright);
}

.prose { font-size: 13.5px; line-height: 1.7; }
.prose h2 {
  font-family: var(--font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--cyan); margin: 20px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; margin: 7px 0; }
.prose p { margin: 0 0 10px; }
.prose strong { color: #eafaff; }

.issue-list { list-style: none; padding: 0; margin: 0; }
.issue-list li {
  padding: 7px 0 7px 22px; position: relative; font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.issue-list li:last-child { border-bottom: none; }
.issue-list li::before {
  content: "▸"; position: absolute; left: 4px; color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 179, 64, 0.5);
}

/* Memory page rows */
.memory-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.memory-item:last-child { border-bottom: none; }
.memory-item:hover { transform: translateX(3px); }
.memory-body { flex: 1; min-width: 0; }
.memory-text { font-size: 13.5px; line-height: 1.55; }
.memory-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
}
.memory-actions { display: flex; gap: 6px; flex: 0 0 auto; opacity: 0; transition: opacity 0.18s var(--ease); }
.memory-item:hover .memory-actions { opacity: 1; }

.email-preview {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; white-space: pre-wrap;
  font-size: 13px; line-height: 1.7;
}

/* Login / error screens */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  background: linear-gradient(160deg, rgba(17, 28, 46, 0.95), rgba(10, 16, 27, 0.97));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius); padding: 36px; width: 100%; max-width: 390px;
  box-shadow: var(--shadow), var(--glow-lg);
  position: relative;
}
.login-box::before {
  content: "";
  position: absolute; top: -1px; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-bright), transparent);
}
.login-box .logo {
  font-size: 34px; text-align: center; margin-bottom: 10px;
  filter: drop-shadow(0 0 16px var(--cyan-shadow));
}
.login-box h1 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 21px; font-weight: 800; letter-spacing: 4px;
  margin-bottom: 6px; color: #eafaff;
  text-shadow: 0 0 14px var(--cyan-shadow);
}
.login-box .login-sub {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 2.6px; text-transform: uppercase;
  color: var(--cyan-deep); margin-bottom: 26px;
}

/* Utility */
.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); }
.small { font-size: 12px; }
.good  { color: var(--green); }
.warn  { color: var(--amber); }
.bad   { color: var(--red); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 10px; } .mb-1 { margin-bottom: 10px; }
.mt-2 { margin-top: 20px; } .mb-2 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* Respect users who ask for reduced motion — kill the ambient animation. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  body::after { animation: none; }
}

@media (max-width: 1400px) {
  .grid-hero { grid-template-columns: 270px minmax(0, 1fr) 300px; }
}
@media (max-width: 1200px) {
  .grid-hero { grid-template-columns: 1fr 1fr; }
  .grid-hero > .core-hero { grid-column: 1 / -1; order: -1; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-search input { width: 170px; }
  .topbar-search input:focus { width: 220px; }
}
@media (max-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-search { display: none; }
}
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .sidebar::after { display: none; }
  .nav { display: flex; flex-wrap: wrap; padding: 7px; }
  .nav-section { display: none; }
  .nav a { margin: 2px; padding: 7px 12px; }
  .nav a.active::after { display: none; }
  .nav a:hover { transform: none; }
  .sidebar-footer { display: none; }

  .topbar { position: static; left: 0; height: auto; padding: 11px 16px; flex-wrap: wrap; }
  .topbar-clock { min-width: 0; margin-left: auto; }
  .topbar-clock .clock-time { font-size: 17px; }

  .main { padding: 20px 16px 96px; }
  .grid-hero, .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-rail { position: static; max-height: 260px; }
  .chat-shell { height: calc(100vh - 250px); }
  .memory-actions { opacity: 1; }
  .chat-item-btn, .chat-folder-btn { opacity: 1; }
  .cal-cell { min-height: 74px; }
  .cal-event { font-size: 9px; }
  .msg { max-width: 96%; }
}

/* ==========================================================================
   16. Additions: particles, streaming chat, market scanner, briefing
   ========================================================================== */

/* Particle constellation layer — sits above the aurora, below all content. */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#particles canvas { pointer-events: none !important; }

/* --- Streaming chat ------------------------------------------------------ */

.stream-status { margin-bottom: 9px; }
.stream-step {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 2px 0;
}
.stream-step.done { color: var(--green); }
.stream-body { min-height: 1em; }

/* Blinking cursor that trails the streamed text. */
.stream-cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--cyan-bright);
  box-shadow: 0 0 9px var(--cyan-shadow);
  animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- Market scanner ------------------------------------------------------ */

.opportunity .opp-head {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}
.opp-score {
  flex: 0 0 auto;
  width: 58px;
  text-align: center;
  padding: 7px 0;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: rgba(0, 212, 255, 0.07);
}
.opp-score.good { border-color: rgba(0,255,157,.45); background: rgba(0,255,157,.08); }
.opp-score.warn { border-color: rgba(255,179,64,.45); background: rgba(255,179,64,.08); }
.opp-score-value {
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  color: var(--cyan-bright);
  text-shadow: 0 0 14px var(--cyan-shadow);
}
.opp-score.good .opp-score-value { color: var(--green); text-shadow: 0 0 14px rgba(0,255,157,.5); }
.opp-score.warn .opp-score-value { color: var(--amber); text-shadow: 0 0 14px rgba(255,179,64,.5); }
.opp-score-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.opp-body { flex: 1; min-width: 0; }
.opp-title { font-size: 14px; font-weight: 500; line-height: 1.45; }
.opp-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.opp-detail {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  animation: fade-in 0.2s var(--ease);
}

/* --- Morning briefing panel ---------------------------------------------- */

.briefing {
  position: relative;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 18px 20px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(0, 212, 255, 0.10), transparent 62%),
    var(--glass);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  box-shadow: var(--glow-sm);
  margin-bottom: 18px;
}
.briefing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.briefing-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 9px;
}
.briefing-body { font-size: 13.5px; line-height: 1.65; }
.briefing-body h2 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--cyan);
  margin: 15px 0 6px;
}
.briefing-body h2:first-child { margin-top: 0; }
.briefing-body ul { padding-left: 20px; margin: 6px 0; }
.briefing-body p { margin: 0 0 8px; }
.briefing-collapsed .briefing-body {
  max-height: 108px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
}

/* --- Draft quality score -------------------------------------------------- */

.quality {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-mid);
  background: rgba(0, 212, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.quality.good { border-color: rgba(0,255,157,.4); background: rgba(0,255,157,.07); color: var(--green); }
.quality.warn { border-color: rgba(255,179,64,.4); background: rgba(255,179,64,.07); color: var(--amber); }
.quality-score { font-size: 15px; font-weight: 700; }

/* ==========================================================================
   Prospect tiers, PageSpeed, checklists and the email pipeline
   ========================================================================== */

/* --- Tier badges ---------------------------------------------------------
   The single most useful fact about a lead, so it gets its own colour scale:
   red = no website (hottest), amber = social only, blue = has a real site. */
.tier-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tier-no_website  { color: var(--red);   background: rgba(255, 77, 106, 0.10);
                    box-shadow: 0 0 14px rgba(255, 77, 106, 0.22); }
.tier-social_only { color: var(--amber); background: rgba(255, 179, 64, 0.10);
                    box-shadow: 0 0 14px rgba(255, 179, 64, 0.18); }
.tier-has_website { color: var(--blue);  background: rgba(77, 159, 255, 0.10); }

/* Compact variant for table cells. */
td .tier-badge { font-size: 8.5px; padding: 3px 7px; letter-spacing: 1px; }

/* Tier dot on list rows, for a colour cue without the full badge. */
.tier-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle;
}
.tier-dot.tier-no_website  { background: var(--red);   box-shadow: 0 0 8px var(--red); }
.tier-dot.tier-social_only { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.tier-dot.tier-has_website { background: var(--blue); }

/* --- Prospect detail layout ---------------------------------------------- */
.grid-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .grid-detail { grid-template-columns: minmax(0, 1fr); } }

.detail-list {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
  font-size: 13px;
}
.detail-list dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding-top: 2px;
}
.detail-list dd { margin: 0; color: var(--text); word-break: break-word; }
.detail-list dd a { color: var(--cyan); text-decoration: none; }
.detail-list dd a:hover { color: var(--cyan-bright); text-shadow: 0 0 9px var(--cyan-shadow); }
.tier-note { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }

.notes-block {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  max-height: 260px;
  overflow-y: auto;
}

/* --- PageSpeed scores ----------------------------------------------------- */
.ps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .ps-grid { grid-template-columns: repeat(2, 1fr); } }

.ps-score {
  text-align: center;
  padding: 13px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.015);
}
.ps-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ps-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  margin-top: 6px;
  color: var(--text-dim);
}
/* Google's own thresholds: 90+ green, 50-89 amber, under 50 red. */
.ps-good { color: var(--green); box-shadow: 0 0 16px rgba(0, 255, 157, 0.16); }
.ps-ok   { color: var(--amber); }
.ps-bad  { color: var(--red);   box-shadow: 0 0 16px rgba(255, 77, 106, 0.20); }

.ps-metrics { list-style: none; margin: 14px 0 0; padding: 0; font-size: 12px; }
.ps-metrics li {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  color: var(--text-muted); text-transform: capitalize;
}
.ps-metrics li:last-child { border-bottom: none; }
.ps-metrics b { font-family: var(--font-mono); color: var(--text); }

.callout {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--amber);
  background: rgba(255, 179, 64, 0.07);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
}
.callout-warn { border-left-color: var(--amber); }

/* --- Manual checklist ----------------------------------------------------- */
.checklist-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 0 0 15px; margin-bottom: 13px;
  border-bottom: 1px solid var(--border);
}
.checklist-score {
  flex: 0 0 88px; text-align: center;
  padding: 11px 6px; border-radius: var(--radius-sm);
  border: 1px solid currentColor;
}
.cl-value {
  font-family: var(--font-mono); font-size: 24px; font-weight: 700;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.cl-label {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-dim); margin-top: 5px;
}
.score-good { color: var(--green); }
.score-ok   { color: var(--amber); }
.score-bad  { color: var(--red); }
.score-weak { color: var(--red); }

.checklist-meta { flex: 1; min-width: 0; }
.checklist-meta .progress {
  height: 4px; border-radius: 3px; background: var(--bg-input);
  overflow: hidden; margin-bottom: 7px;
}
.checklist-meta .progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan-bright));
  box-shadow: 0 0 10px var(--cyan-shadow);
  transition: width 0.35s var(--ease);
}
.verdict { font-size: 12.5px; color: var(--text); margin-top: 5px; }

.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.check-row:last-child { border-bottom: none; }
.check-label { flex: 1; font-size: 12.5px; color: var(--text-muted); }
.check-row.answered .check-label { color: var(--text); }
.check-weight {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--text-dim);
}
.check-toggle { display: flex; gap: 4px; flex: 0 0 auto; }
.check-btn {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.check-btn:hover { border-color: var(--border-mid); color: var(--text); }
.check-yes.on {
  background: rgba(0, 255, 157, 0.12); color: var(--green);
  border-color: var(--green); box-shadow: 0 0 11px rgba(0, 255, 157, 0.25);
}
.check-no.on {
  background: rgba(255, 77, 106, 0.12); color: var(--red);
  border-color: var(--red); box-shadow: 0 0 11px rgba(255, 77, 106, 0.25);
}

/* --- Compact rows shared by detail panels --------------------------------- */
.mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.mini-row:last-child { border-bottom: none; }
.mini-title { font-size: 13px; color: var(--text); }

/* --- Email pipeline ------------------------------------------------------- */
.stage-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
  overflow-x: auto;
}
.stage-tab {
  position: relative;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--text-dim); padding: 10px 15px; white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.stage-tab:hover { color: var(--text); }
.stage-tab.active { color: var(--cyan-bright); text-shadow: 0 0 11px var(--cyan-shadow); }
.stage-tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan-shadow);
}
.stage-count {
  display: inline-block; margin-left: 5px; padding: 1px 6px;
  border-radius: 20px; background: var(--bg-elevated);
  font-size: 9.5px; color: var(--text-muted);
}
.stage-tab.active .stage-count { background: rgba(0, 212, 255, 0.15); color: var(--cyan-bright); }

.email-card { margin-bottom: 14px; }
.email-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 11px;
}
.email-business {
  display: block; font-size: 14.5px; font-weight: 600;
  color: var(--text); text-decoration: none;
}
.email-business:hover { color: var(--cyan-bright); text-shadow: 0 0 9px var(--cyan-shadow); }
.email-meta { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

.email-subject {
  font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 6px;
}
.email-preview {
  font-size: 12.5px; line-height: 1.6; color: var(--text-muted); margin-bottom: 13px;
}
.email-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.email-body {
  margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; max-height: 48vh; overflow-y: auto;
}

/* Evaluator score on a draft — under 7/10 was revised, under 6 is worth a look. */
.score-chip {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  border: 1px solid currentColor; background: rgba(255, 255, 255, 0.02);
}

/* --- Search history ------------------------------------------------------- */
.history-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; margin: 0 6px 6px 0;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--glass-light);
  font-size: 11.5px; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s var(--ease);
}
.history-chip:hover {
  border-color: var(--border-mid); color: var(--text);
  box-shadow: var(--glow-sm);
}
.history-chip b { color: var(--cyan); font-family: var(--font-mono); font-size: 10px; }

/* Feed rows that link somewhere must not pick up default anchor styling. */
a.feed-item { text-decoration: none; color: inherit; cursor: pointer; }
a.feed-item:hover .feed-text { color: var(--cyan-bright); }

/* --- Google connection walkthrough ---------------------------------------
   One step per prerequisite, coloured by whether it's blocking. */
.setup-step {
  display: flex; gap: 13px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.setup-step:last-child { border-bottom: none; }
.setup-num {
  flex: 0 0 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-mid);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--text-muted);
}
.setup-step.done .setup-num {
  color: var(--green); border-color: var(--green);
  background: rgba(0, 255, 157, 0.10); box-shadow: 0 0 11px rgba(0, 255, 157, 0.25);
}
.setup-step.blocked .setup-num {
  color: var(--red); border-color: var(--red);
  background: rgba(255, 77, 106, 0.10); box-shadow: 0 0 11px rgba(255, 77, 106, 0.25);
}
.setup-step.action .setup-num,
.setup-step.waiting .setup-num { color: var(--amber); border-color: var(--amber); }

.setup-body { flex: 1; min-width: 0; }
.setup-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.setup-step.done .setup-title { color: var(--text-muted); }
.setup-detail {
  font-size: 12.5px; line-height: 1.6; color: var(--text-muted);
  margin-top: 3px; white-space: pre-line;
}
.setup-value {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 9px;
}
.setup-value code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--cyan);
}
.setup-how {
  margin: 9px 0 0; padding-left: 18px;
  font-size: 12px; line-height: 1.75; color: var(--text-muted);
}
.setup-how li { margin-bottom: 2px; }
.setup-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--border);
}
.btn.disabled { opacity: 0.45; cursor: not-allowed; }

/* ==========================================================================
   In-person outreach and pitch practice
   --------------------------------------------------------------------------
   Everything below gets used on a phone or iPad, standing outside a shop.
   Tap targets are 48px minimum, text stays readable at arm's length, and the
   prep card fits one screen without scrolling on an iPad.
   ========================================================================== */

/* A tap target big enough to hit while walking. 48px is the accessibility
   floor; these are 52 because the user is often moving. */
.btn-tap {
  min-height: 52px;
  padding: 0 20px;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 14.5px; }
.btn-block { display: flex; width: 100%; margin-top: 14px; }

/* --- Route planner -------------------------------------------------------- */
.route-controls {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  margin-bottom: 15px;
}
.route-controls input[type="search"] { flex: 1 1 220px; min-height: 44px; }
.route-controls select { min-height: 44px; }
.route-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-muted); cursor: pointer;
  min-height: 44px;
}
.route-toggle input { width: 18px; height: 18px; accent-color: var(--cyan); }

.route-row {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light); cursor: pointer;
  transition: all 0.2s var(--ease);
}
.route-row:hover { border-color: var(--border-mid); }
.route-row.picked {
  border-color: var(--cyan); background: rgba(0, 212, 255, 0.07);
  box-shadow: var(--glow-sm);
}
.route-check {
  width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px;
  accent-color: var(--cyan); cursor: pointer;
}
.route-body { flex: 1; min-width: 0; display: block; }
.route-name { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.route-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px;
}
.ps-inline {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--amber);
}
.route-reason {
  display: block; font-size: 12px; color: var(--cyan); margin-top: 5px;
}
.route-address {
  display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 3px;
}

.route-footer {
  display: flex; flex-wrap: wrap; gap: 11px; align-items: center;
  margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border);
}
.route-selected {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.route-selected span { color: var(--cyan-bright); font-size: 16px; font-weight: 700; }
.route-footer input[type="date"] { min-height: 48px; }

.plan-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 15px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light); text-decoration: none; color: inherit;
  min-height: 56px; transition: all 0.2s var(--ease);
}
.plan-row:hover {
  border-color: var(--border-mid); box-shadow: var(--glow-sm);
  transform: translateX(3px);
}

/* --- Stops on the day's route --------------------------------------------- */
.stop-card {
  background: var(--glass); backdrop-filter: blur(13px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 13px;
  transition: all 0.25s var(--ease);
}
.stop-card.done { opacity: 0.62; border-style: dashed; }
.stop-head { display: flex; align-items: flex-start; gap: 12px; }
.stop-number {
  flex: 0 0 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-mid);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--cyan);
}
.stop-card.done .stop-number {
  color: var(--green); border-color: var(--green);
  background: rgba(0, 255, 157, 0.10);
}
.stop-title { flex: 1; min-width: 0; }
.stop-name { font-size: 16.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.stop-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.stop-address {
  display: block; margin: 11px 0 0 44px;
  font-size: 12.5px; color: var(--cyan); text-decoration: none;
}
.stop-outcome {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  margin: 12px 0 0 44px;
}
.stop-notes {
  margin: 9px 0 0 44px; font-size: 12.5px; line-height: 1.6;
  color: var(--text-muted);
}
.stop-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.stop-actions .btn { flex: 1 1 auto; min-width: 96px; }

.reaction-chip {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 5px 11px; border-radius: 20px; border: 1px solid currentColor;
  white-space: nowrap;
}
.r-good    { color: var(--green); background: rgba(0, 255, 157, 0.10); }
.r-ok      { color: var(--amber); background: rgba(255, 179, 64, 0.10); }
.r-bad     { color: var(--red);   background: rgba(255, 77, 106, 0.10); }
.r-neutral { color: var(--text-muted); }

/* --- The post-visit log (used one-handed on a doorstep) -------------------- */
.log-form { display: flex; flex-direction: column; gap: 18px; }
.log-section { display: block; }
.log-label {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 1.3px; color: var(--text-dim); margin-bottom: 9px;
}
.log-input {
  width: 100%; min-height: 50px; font-size: 15px;  /* 15px+ stops iOS zooming */
  padding: 13px 14px;
}
textarea.log-input { min-height: 96px; line-height: 1.6; }

.tap-group { display: flex; gap: 9px; }
.tap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.tap-btn {
  min-height: 54px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-muted);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; flex: 1;
  transition: all 0.18s var(--ease);
}
.tap-btn:hover { border-color: var(--border-mid); color: var(--text); }
.tap-btn.on {
  color: var(--cyan-bright); border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.12); box-shadow: var(--glow-sm);
}
.tap-good.on { color: var(--green); border-color: var(--green);
               background: rgba(0, 255, 157, 0.12);
               box-shadow: 0 0 14px rgba(0, 255, 157, 0.25); }
.tap-ok.on   { color: var(--amber); border-color: var(--amber);
               background: rgba(255, 179, 64, 0.12); }
.tap-bad.on  { color: var(--red); border-color: var(--red);
               background: rgba(255, 77, 106, 0.12); }
.log-followup { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.log-followup .log-input { flex: 1 1 160px; }

/* --- The prep card (the one-screen, parking-lot view) ---------------------- */
.prep-page { max-width: 760px; margin: 0 auto; padding-bottom: 90px; }
.prep-top { display: flex; justify-content: space-between; align-items: center; }
.prep-name {
  font-size: 27px; line-height: 1.2; margin: 10px 0 0;
  letter-spacing: -0.5px;
}
.prep-sub {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 9px 0 18px; font-size: 12.5px; color: var(--text-muted);
}

.prep-headline {
  font-size: 15px; line-height: 1.55; color: var(--text);
  padding-bottom: 15px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.prep-block {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.prep-label {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--text-dim); margin-bottom: 9px;
}
.prep-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.prep-big { font-size: 16px; line-height: 1.5; color: var(--text); font-weight: 500; }

/* The opener is the single most important thing on this screen — it's what
   he needs in his head when the door opens, so it gets the most weight. */
.prep-opener {
  border-color: var(--border-hot);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.09), rgba(0, 212, 255, 0.03));
  box-shadow: var(--glow-md);
}
.prep-opener-text {
  font-size: 19px; line-height: 1.45; color: #eafaff; font-weight: 500;
  letter-spacing: -0.2px;
}
.prep-problem { border-left: 2px solid var(--amber); }
.prep-price { border-left: 2px solid var(--green); }

.prep-list { margin: 0; padding-left: 19px; }
.prep-list li {
  font-size: 14px; line-height: 1.55; color: var(--text); margin-bottom: 9px;
}
.prep-scores { margin-top: 13px; }
.prep-stamp { text-align: center; margin-top: 16px; }

/* Pinned to the bottom so the actions are always thumb-reachable. */
.prep-actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 9px; padding: 11px 16px;
  padding-bottom: calc(11px + env(safe-area-inset-bottom));
  background: rgba(6, 9, 16, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.prep-actions .btn { flex: 1; }

/* --- Practice: mode picker ------------------------------------------------ */
.mode-card {
  text-align: left; cursor: pointer;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: all 0.25s var(--ease);
  min-height: 148px;
  display: flex; flex-direction: column;
}
.mode-card:hover {
  border-color: var(--border-hot); box-shadow: var(--glow-md);
  transform: translateY(-3px);
}
.mode-icon { font-size: 26px; margin-bottom: 11px; }
.mode-title {
  font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 7px;
}
.mode-desc { font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }

/* --- Practice: the live session ------------------------------------------- */
.session-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.session-mode {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--cyan);
}
.scenario-card {
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.08), transparent);
  border: 1px solid var(--border-mid); border-left: 2px solid var(--cyan);
  border-radius: var(--radius); padding: 17px 19px; margin-bottom: 18px;
  font-size: 15.5px; line-height: 1.6; color: #eafaff;
}

.turn { margin-bottom: 15px; max-width: 82%; }
.turn-luke { margin-left: auto; }
.turn-who {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-dim); margin-bottom: 5px;
}
.turn-luke .turn-who { text-align: right; }
.turn-text {
  padding: 13px 16px; border-radius: var(--radius);
  font-size: 14.5px; line-height: 1.6;
  border: 1px solid var(--border); background: var(--glass-light);
  color: var(--text);
}
.turn-luke .turn-text {
  background: rgba(0, 212, 255, 0.10); border-color: var(--border-mid);
  color: #eafaff;
}
.turn-coach { max-width: 100%; }
.turn-text.thinking { color: var(--text-dim); font-style: italic; }
.turn-text.thinking::after {
  content: "▍"; animation: blink 1s steps(2) infinite; margin-left: 2px;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.say-bar {
  position: sticky; bottom: 0;
  display: flex; gap: 10px; align-items: flex-end;
  padding: 13px 0;
  background: linear-gradient(180deg, transparent, var(--bg-deep) 22%);
}
.say-bar textarea {
  flex: 1; resize: none; min-height: 52px; font-size: 15px;
  padding: 14px; line-height: 1.5;
}
.say-bar .btn { flex: 0 0 auto; }

/* --- Practice: feedback --------------------------------------------------- */
.fb-card {
  background: var(--glass); border: 1px solid var(--border-mid);
  border-radius: var(--radius); padding: 19px;
}
.fb-head { display: flex; gap: 17px; align-items: center; margin-bottom: 17px; }
.score-ring {
  flex: 0 0 74px; height: 74px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid currentColor;
}
.score-num {
  font-family: var(--font-mono); font-size: 25px; font-weight: 700; line-height: 1;
}
.score-out { font-family: var(--font-mono); font-size: 9px; opacity: 0.75; margin-top: 2px; }
.fb-summary { flex: 1; font-size: 14.5px; line-height: 1.6; color: var(--text); }

.fb-section { margin-top: 15px; }
.fb-title {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 1.3px; margin-bottom: 8px;
}
.fb-good { color: var(--green); }
.fb-bad  { color: var(--red); }
.fb-ok   { color: var(--cyan); }
.fb-list { margin: 0; padding-left: 19px; }
.fb-list li { font-size: 13.5px; line-height: 1.6; color: var(--text); margin-bottom: 7px; }
.fb-text { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.fb-quote {
  font-size: 14px; line-height: 1.65; color: #eafaff;
  padding: 12px 15px; border-left: 2px solid var(--cyan);
  background: rgba(0, 212, 255, 0.06); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.fb-bars { display: flex; flex-direction: column; gap: 9px; margin-bottom: 13px; }
.fb-bar { display: flex; align-items: center; gap: 11px; }
.fb-bar-label {
  flex: 0 0 104px; font-size: 11.5px; color: var(--text-muted);
}
.fb-bar-track {
  flex: 1; height: 6px; border-radius: 3px; background: var(--bg-input);
  overflow: hidden;
}
.fb-bar-track span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan-bright));
  box-shadow: 0 0 9px var(--cyan-shadow);
}
.fb-bar-value {
  flex: 0 0 26px; text-align: right;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text);
}
.fb-actions { display: flex; gap: 10px; margin: 18px 0 30px; }
.fb-actions .btn { flex: 1; }

.stat-inline {
  font-family: var(--font-mono); font-size: 19px; font-weight: 700;
  color: var(--cyan-bright);
}

/* Score history, drawn without a charting library. */
.spark {
  display: flex; align-items: flex-end; gap: 4px;
  height: 68px; margin-top: 11px; padding: 9px 11px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.spark-bar {
  flex: 1; min-width: 5px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--cyan-bright), var(--cyan-deep));
  box-shadow: 0 0 7px var(--cyan-shadow);
  transition: opacity 0.2s var(--ease);
}
.spark-bar:hover { opacity: 0.7; }

.pulse { animation: pulse-glow 1.6s ease-in-out infinite; }
@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--glow-sm); }
  50%      { box-shadow: var(--glow-lg); }
}

/* --- Phone and iPad ------------------------------------------------------- */
@media (max-width: 900px) {
  .mode-card { min-height: auto; }
  .turn { max-width: 92%; }
  .prep-name { font-size: 24px; }
  .prep-opener-text { font-size: 18px; }
}

@media (max-width: 640px) {
  /* Field use: one column, nothing side by side, nothing to pinch. */
  .route-controls { flex-direction: column; align-items: stretch; }
  .route-controls input[type="search"],
  .route-controls select,
  .route-controls .btn { width: 100%; }
  .route-footer { flex-direction: column; align-items: stretch; }
  .route-footer .btn { width: 100%; }

  .stop-actions .btn { flex: 1 1 100%; }
  .stop-address, .stop-outcome, .stop-notes { margin-left: 0; }

  .prep-name { font-size: 22px; }
  .prep-opener-text { font-size: 17px; }
  .prep-block { padding: 14px; }

  .fb-head { flex-direction: column; align-items: flex-start; gap: 13px; }
  .fb-bar-label { flex-basis: 84px; }
  .fb-actions { flex-direction: column; }

  .tap-grid { grid-template-columns: 1fr; }
  .turn { max-width: 100%; }
  .say-bar { flex-direction: column; align-items: stretch; }
  .say-bar .btn { width: 100%; }
}

/* ==========================================================================
   Proposals, portfolio and industry intel
   ========================================================================== */

/* --- Proposal list -------------------------------------------------------- */
.proposal-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 16px 15px; margin-bottom: 9px; min-height: 62px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light); text-decoration: none; color: inherit;
  transition: all 0.2s var(--ease);
}
.proposal-row:hover {
  border-color: var(--border-mid); box-shadow: var(--glow-sm);
  transform: translateX(3px);
}
.proposal-main { flex: 1; min-width: 0; }
.proposal-side {
  display: flex; align-items: center; gap: 11px; flex-shrink: 0;
}
.proposal-price {
  font-family: var(--font-mono); font-size: 13px; color: var(--cyan-bright);
  white-space: nowrap;
}

/* --- Split-screen editor -------------------------------------------------- */
.proposal-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  align-items: start;
}
.proposal-pane, .editor-pane {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.pane-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.pane-title {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-dim);
}
.pane-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* The proposal renders in a sandboxed iframe — it's white paper inside a
   dark app, and it must not inherit any of the app's styling. */
.proposal-paper { background: #e9ecf1; padding: 12px; min-height: 60vh; }
.proposal-frame {
  width: 100%; height: 72vh; border: none; border-radius: var(--radius-sm);
  background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}

.editor-pane { max-height: 82vh; }
.editor-turns {
  flex: 1; overflow-y: auto; padding: 15px; min-height: 220px;
}
.editor-hint { font-size: 12.5px; line-height: 1.7; color: var(--text-muted); }
.editor-hint ul { margin: 9px 0 0; padding-left: 18px; }
.editor-hint li { margin-bottom: 5px; color: var(--cyan); }

.edit-turn { margin-bottom: 13px; }
.edit-turn .turn-text {
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--border); background: var(--glass-light);
}
.edit-luke .turn-text {
  background: rgba(0, 212, 255, 0.10); border-color: var(--border-mid);
  color: #eafaff;
}
.edit-failed .turn-text { border-color: var(--red); color: var(--red); }

.editor-bar {
  display: flex; gap: 9px; align-items: flex-end;
  padding: 12px; border-top: 1px solid var(--border); background: var(--bg-panel);
}
.editor-bar textarea {
  flex: 1; resize: none; min-height: 48px; font-size: 15px; padding: 12px;
  line-height: 1.5;
}

.version-list { display: flex; flex-direction: column; gap: 8px; }
.version-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light);
}

/* --- Portfolio edit mode -------------------------------------------------- */
.portfolio-card .section-label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.hidden-flag { color: var(--amber); }

.shot-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; }
.shot-thumb {
  position: relative; width: 116px; height: 82px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg-input);
}
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-remove {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: none; background: rgba(6, 9, 16, 0.85); color: var(--red);
  font-size: 12px; line-height: 1;
}
.shot-empty {
  font-size: 12px; color: var(--text-dim); margin-top: 9px;
  padding: 13px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
}

.improve-list { list-style: none; margin: 10px 0 0; padding: 0; }
.improve-list li {
  position: relative; padding: 11px 38px 11px 13px; margin-bottom: 7px;
  border-left: 2px solid var(--green); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(0, 255, 157, 0.05);
}
.improve-plain { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.improve-tech {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim);
  margin-top: 4px;
}
.improve-remove {
  position: absolute; top: 9px; right: 9px;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: none; background: transparent; color: var(--text-dim); font-size: 12px;
}
.improve-remove:hover { color: var(--red); }

/* --- Industry intel ------------------------------------------------------- */
.intel-layout {
  display: grid; grid-template-columns: minmax(200px, 0.32fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
.intel-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 12px 13px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light); cursor: pointer; text-align: left;
  transition: all 0.18s var(--ease);
}
.intel-row:hover { border-color: var(--border-mid); }
.intel-row.on {
  border-color: var(--cyan); background: rgba(0, 212, 255, 0.09);
  box-shadow: var(--glow-sm);
}
.intel-name {
  font-size: 13.5px; color: var(--text); text-transform: capitalize;
  font-weight: 500;
}
.stale-flag { color: var(--amber); }

/* Nuggets are for memorising — bigger and further apart than a normal list. */
.nugget-list { list-style: none; margin: 10px 0 0; padding: 0; }
.nugget-list li {
  font-size: 15px; line-height: 1.5; color: #eafaff;
  padding: 13px 15px; margin-bottom: 8px;
  border-left: 2px solid var(--cyan);
  background: rgba(0, 212, 255, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.objection-angle {
  padding: 12px 14px; margin-bottom: 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light);
}
.objection-key {
  font-family: var(--font-mono); font-size: 11px; color: var(--amber);
  margin-bottom: 6px;
}
.brief-body { font-size: 13.5px; line-height: 1.75; color: var(--text-muted); }

/* --- Presentation mode ----------------------------------------------------
   Shown on an iPad to a prospect. No sidebar, no top bar — the whole viewport
   is one project, swiped horizontally. */
.present-body {
  margin: 0; padding: 0; overflow: hidden;
  background: var(--bg-void); color: var(--text);
  font-family: var(--font);
}
.present-deck {
  display: flex; height: 100vh; height: 100dvh;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.present-deck::-webkit-scrollbar { display: none; }

.present-slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  padding: 44px 48px 96px;
  -webkit-overflow-scrolling: touch;
}
.present-brand {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2.4px;
  text-transform: uppercase; color: var(--cyan);
}
.present-title {
  font-size: 40px; line-height: 1.12; margin: 12px 0 8px;
  letter-spacing: -1px; color: #eafaff;
}
.present-sub { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; }

.ba-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ba-panel { margin: 0; }
.ba-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 10px; display: block;
}
.ba-label-before { color: var(--red); }
.ba-label-after { color: var(--green); }
.ba-shots { display: flex; flex-direction: column; gap: 12px; }
.ba-shots img {
  width: 100%; border-radius: var(--radius); cursor: zoom-in;
  border: 1px solid var(--border); background: #fff;
}
.ba-before .ba-shots img { border-color: rgba(255, 77, 106, 0.35); }
.ba-after .ba-shots img {
  border-color: rgba(0, 255, 157, 0.35);
  box-shadow: 0 0 28px rgba(0, 255, 157, 0.13);
}

.present-improvements { margin-top: 34px; }
.present-improvements h2, .present-results h2 {
  font-size: 13px; font-family: var(--font-mono); letter-spacing: 2px;
  text-transform: uppercase; color: var(--cyan); margin: 0 0 16px;
}
.present-improvements ul { list-style: none; margin: 0; padding: 0; }
.present-improvements li {
  position: relative; font-size: 19px; line-height: 1.5;
  color: #eafaff; padding: 0 0 0 32px; margin-bottom: 16px;
}
/* A tick, not a bullet: every line is something that got better. */
.present-improvements li::before {
  content: "✓"; position: absolute; left: 0; top: 1px;
  color: var(--green); font-size: 17px; font-weight: 700;
}
.present-results { margin-top: 32px; }
.present-results p {
  font-size: 19px; line-height: 1.55; color: #eafaff; margin: 0;
  padding: 18px 22px; border-left: 2px solid var(--green);
  background: rgba(0, 255, 157, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.present-link {
  display: inline-block; margin-top: 26px; font-size: 15px;
  color: var(--cyan); text-decoration: none;
}

.present-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(6, 9, 16, 0.94) 55%);
}
.present-arrow {
  width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border-mid); background: rgba(13, 20, 32, 0.9);
  color: var(--cyan-bright); font-size: 27px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease);
}
.present-arrow:hover:not(:disabled) {
  border-color: var(--cyan); box-shadow: var(--glow-md);
}
.present-arrow:disabled { opacity: 0.28; cursor: default; }
.present-dots { display: flex; gap: 9px; }
.present-dot {
  width: 11px; height: 11px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid var(--border-mid); background: transparent;
}
.present-dot.on {
  background: var(--cyan); border-color: var(--cyan);
  box-shadow: 0 0 11px var(--cyan-shadow);
}
.present-exit {
  position: fixed; top: 18px; right: 20px; z-index: 31;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: rgba(13, 20, 32, 0.85);
  color: var(--text-dim); text-decoration: none; font-size: 16px;
}
.present-exit:hover { color: var(--text); border-color: var(--border-mid); }
.present-empty {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; text-align: center;
  padding: 30px;
}

.shot-overlay {
  position: fixed; inset: 0; z-index: 60; cursor: zoom-out;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3, 5, 10, 0.96); padding: 24px;
}
.shot-overlay img {
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius); border: 1px solid var(--border-mid);
}

/* --- Tablet and phone ----------------------------------------------------- */
@media (max-width: 1100px) {
  /* Stack the editor: the document matters more than the chat, so it leads. */
  .proposal-split { grid-template-columns: minmax(0, 1fr); }
  .proposal-frame { height: 58vh; }
  .editor-pane { max-height: none; }
  .intel-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .present-slide { padding: 32px 26px 92px; }
  .present-title { font-size: 30px; }
  .present-improvements li { font-size: 17px; }
  .present-results p { font-size: 17px; }
}

@media (max-width: 700px) {
  /* Before and after stack rather than shrinking to unreadable thumbnails. */
  .ba-wrap { grid-template-columns: 1fr; gap: 24px; }
  .present-title { font-size: 25px; }
  .present-improvements li { font-size: 16px; padding-left: 28px; }
  .proposal-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .proposal-side { width: 100%; justify-content: space-between; }
  .editor-bar { flex-direction: column; align-items: stretch; }
  .editor-bar .btn { width: 100%; }
  .shot-thumb { width: 92px; height: 66px; }
}

/* --- Printing a proposal from inside the app ------------------------------ */
@media print {
  .sidebar, .topbar, .page-header, .pane-bar, .editor-pane,
  .present-nav, .present-exit, #particles-js { display: none !important; }
  .proposal-split { display: block; }
  .proposal-paper { background: #fff; padding: 0; }
  .proposal-frame { height: auto; min-height: 100vh; box-shadow: none; }
  body, .layout, .main { background: #fff !important; }
}

/* ==========================================================================
   Ambient life: agent status rings, heartbeats, radar sweep
   --------------------------------------------------------------------------
   Everything here is CSS-only and animates transform/opacity/filter, which
   the compositor handles off the main thread — no JS timers, no layout work
   per frame, so it holds 60fps even with every card animating at once.
   ========================================================================== */

/* --- Status ring around each agent's indicator ---------------------------- */
.status-ring {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px;
  flex: 0 0 auto; margin-right: 7px;
}
.status-core {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* The ring itself is a pseudo-element so it can scale independently of the
   dot without affecting layout. */
.status-ring::before,
.status-ring::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
}

.agent-card.online .status-ring,
.agent-card.processing .status-ring { color: var(--green); }
.agent-card.standby .status-ring { color: var(--amber); }
.agent-card.offline .status-ring { color: var(--red); }

.agent-card.online .status-core,
.agent-card.processing .status-core {
  background: var(--green); box-shadow: 0 0 8px var(--green);
}
.agent-card.standby .status-core {
  background: var(--amber); box-shadow: 0 0 7px rgba(255, 179, 64, 0.7);
}
.agent-card.offline .status-core {
  background: var(--red); box-shadow: 0 0 7px rgba(255, 77, 106, 0.7);
}

/* Online pulses outward slowly. Standby breathes in place. Offline holds a
   steady ring — a dead subsystem shouldn't look busy. */
.agent-card.online .status-ring::before,
.agent-card.processing .status-ring::before {
  animation: ring-pulse 2.8s ease-out infinite;
}
.agent-card.online .status-ring::after,
.agent-card.processing .status-ring::after {
  animation: ring-pulse 2.8s ease-out infinite 1.4s;
}
.agent-card.standby .status-ring::before {
  animation: ring-breathe 3.6s ease-in-out infinite;
}
.agent-card.offline .status-ring::before { opacity: 0.4; }

@keyframes ring-pulse {
  0%   { opacity: 0.85; transform: scale(0.55); }
  70%  { opacity: 0;    transform: scale(1.5); }
  100% { opacity: 0;    transform: scale(1.5); }
}
@keyframes ring-breathe {
  0%, 100% { opacity: 0.22; transform: scale(0.8); }
  50%      { opacity: 0.6;  transform: scale(1.05); }
}

/* --- Heartbeat border while an agent is actually working ------------------ */
.agent-card { position: relative; }
.agent-card.processing {
  border-color: rgba(0, 255, 157, 0.4);
  animation: heartbeat-border 1.9s ease-in-out infinite;
}
@keyframes heartbeat-border {
  /* Two beats then rest — a real cardiac rhythm reads as "working", an even
     sine reads as "decorative". */
  0%   { box-shadow: 0 0 0 rgba(0, 255, 157, 0); }
  12%  { box-shadow: 0 0 18px rgba(0, 255, 157, 0.35); }
  24%  { box-shadow: 0 0 4px rgba(0, 255, 157, 0.12); }
  36%  { box-shadow: 0 0 22px rgba(0, 255, 157, 0.45); }
  55%  { box-shadow: 0 0 3px rgba(0, 255, 157, 0.08); }
  100% { box-shadow: 0 0 0 rgba(0, 255, 157, 0); }
}

/* --- Heart-monitor trace -------------------------------------------------- */
.ecg {
  display: block; width: 100%; height: 22px; margin-top: 9px;
  overflow: visible;
}
.ecg path { fill: none; stroke-width: 1.4; stroke-linecap: round;
            stroke-linejoin: round; }
.ecg-flat  { stroke: var(--border-mid); opacity: 0.55; }
.ecg-trace { stroke: var(--cyan); opacity: 0; }

/* Idle: only the flat line shows. Nothing animates, so an idle dashboard
   costs no frames at all. */
.agent-card.standby .ecg-trace,
.agent-card.offline .ecg-trace { opacity: 0; }
.agent-card.offline .ecg-flat  { stroke: rgba(255, 77, 106, 0.35); }

/* Active: the trace sweeps across, drawn with a dash offset. */
.agent-card.online .ecg-trace,
.agent-card.processing .ecg-trace {
  opacity: 1;
  stroke-dasharray: 34 260;
  animation: ecg-sweep 2.4s linear infinite;
}
.agent-card.online .ecg-trace  { stroke: var(--cyan); }
.agent-card.processing .ecg-trace {
  stroke: var(--green);
  filter: drop-shadow(0 0 4px rgba(0, 255, 157, 0.65));
  animation-duration: 1.5s;
}
.agent-card.online .ecg-flat,
.agent-card.processing .ecg-flat { opacity: 0.28; }

@keyframes ecg-sweep {
  from { stroke-dashoffset: 294; }
  to   { stroke-dashoffset: 0; }
}

/* --- "3 of 8 Online" ------------------------------------------------------ */
.online-count {
  color: var(--green);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 255, 157, 0.75);
  animation: count-glow 3.4s ease-in-out infinite;
}
@keyframes count-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(0, 255, 157, 0.5); }
  50%      { text-shadow: 0 0 15px rgba(0, 255, 157, 0.95); }
}

/* --- One-shot ripple when a card's status changes ------------------------- */
.agent-card.just-changed::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 22px 22px,
              rgba(0, 240, 255, 0.28), transparent 62%);
  animation: status-ripple 0.9s ease-out 1 forwards;
}
@keyframes status-ripple {
  0%   { opacity: 0;    transform: scale(0.94); }
  30%  { opacity: 1;    transform: scale(1); }
  100% { opacity: 0;    transform: scale(1.02); }
}

/* --- Radar sweep across the dashboard ------------------------------------- */
/* A single fixed element behind everything. Fixed + transform means it never
   triggers layout, and it sits under the content so it can't intercept taps. */
.radar-sweep {
  position: fixed;
  left: var(--sidebar-w); right: 0; top: var(--topbar-h);
  height: 180px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(180deg,
              transparent,
              rgba(0, 212, 255, 0.045) 45%,
              rgba(0, 240, 255, 0.085) 50%,
              rgba(0, 212, 255, 0.045) 55%,
              transparent);
  animation: radar-drop 11s linear infinite;
  will-change: transform;
}
@keyframes radar-drop {
  0%   { transform: translate3d(0, -200px, 0); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translate3d(0, 100vh, 0); opacity: 0; }
}
@media (max-width: 860px) {
  .radar-sweep { left: 0; }
}

/* --- Breathing logo ------------------------------------------------------- */
.sidebar-brand .logo-mark {
  display: inline-flex;
  animation: logo-breathe 4.5s ease-in-out infinite;
  will-change: filter, transform;
}
@keyframes logo-breathe {
  0%, 100% {
    filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.4));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 11px rgba(0, 240, 255, 0.9));
    transform: scale(1.045);
  }
}
.sidebar-brand .logo-text {
  display: inline-block;
  animation: logo-text-glow 4.5s ease-in-out infinite;
}

/* --- Reusable one-shot flash for any card whose value changed ------------- */
.value-changed {
  animation: value-flash 0.85s ease-out 1;
}
@keyframes value-flash {
  0%   { box-shadow: 0 0 0 rgba(0, 240, 255, 0);
         border-color: var(--border); }
  25%  { box-shadow: 0 0 22px rgba(0, 240, 255, 0.4);
         border-color: var(--border-hot); }
  100% { box-shadow: 0 0 0 rgba(0, 240, 255, 0);
         border-color: var(--border); }
}
@media (prefers-reduced-motion: reduce) {
  .value-changed { animation: none !important; }
}
@keyframes logo-text-glow {
  0%, 100% { text-shadow: 0 0 6px rgba(0, 212, 255, 0.22); }
  50%      { text-shadow: 0 0 14px rgba(0, 212, 255, 0.55); }
}

/* --- Respect the user's motion preference --------------------------------- */
/* Someone who gets motion sickness still needs the status colours, so the
   colours stay and only the movement stops. */
@media (prefers-reduced-motion: reduce) {
  .radar-sweep { display: none; }
  .status-ring::before,
  .status-ring::after,
  .agent-card.processing,
  .online-count,
  .sidebar-brand .logo-mark,
  .sidebar-brand .logo-text,
  .agent-card.just-changed::after,
  .ecg-trace {
    animation: none !important;
  }
  .status-ring::before { opacity: 0.45; }
  .ecg-trace { opacity: 1; stroke-dasharray: none; }
}

/* ==========================================================================
   Daily journal
   ========================================================================== */

.journal-form { display: flex; flex-direction: column; gap: 16px; }
.journal-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--border);
}

/* 1-10 rating. Ten tap targets that stay usable on a phone. */
.rating-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rating-btn {
  flex: 1 1 44px; min-width: 44px; min-height: 46px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-dim);
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.18s var(--ease);
}
.rating-btn:hover { border-color: var(--border-mid); color: var(--text); }
.rating-btn.on { color: #04121b; font-weight: 700; }
.rating-good.on {
  background: var(--green); border-color: var(--green);
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.4);
}
.rating-ok.on {
  background: var(--amber); border-color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 179, 64, 0.35);
}
.rating-bad.on {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 14px rgba(255, 77, 106, 0.35);
}

.rating-pill {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; border: 1px solid currentColor;
}
.rating-pill.rating-good { color: var(--green); background: rgba(0, 255, 157, 0.1); }
.rating-pill.rating-ok   { color: var(--amber); background: rgba(255, 179, 64, 0.1); }
.rating-pill.rating-bad  { color: var(--red);   background: rgba(255, 77, 106, 0.1); }

/* --- Timeline ------------------------------------------------------------- */
.journal-entry {
  position: relative;
  padding: 16px 16px 16px 18px; margin-bottom: 11px;
  border: 1px solid var(--border); border-left: 2px solid var(--cyan-deep);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--glass-light);
  transition: border-color 0.22s var(--ease);
}
.journal-entry:hover { border-left-color: var(--cyan); }
.journal-date {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--cyan);
}
.journal-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px;
}
.journal-cols:empty { display: none; }
.journal-lesson {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
/* Delete stays out of the way until you're actually reading that entry. */
.journal-delete {
  position: absolute; top: 12px; right: 12px;
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.journal-entry:hover .journal-delete,
.journal-entry:focus-within .journal-delete { opacity: 1; }

/* --- Weekly review -------------------------------------------------------- */
.week-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 6px;
}
.week-metric {
  text-align: center; padding: 13px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-input);
}
.week-value {
  font-family: var(--font-mono); font-size: 21px; font-weight: 700;
  color: var(--cyan-bright); line-height: 1;
}
.week-label {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim); margin-top: 6px;
}

@media (max-width: 700px) {
  .journal-cols { grid-template-columns: 1fr; }
  .week-metrics { grid-template-columns: repeat(2, 1fr); }
  /* Touch has no hover, so the delete button must always be reachable. */
  .journal-delete { opacity: 1; position: static; margin-top: 12px; }
  .rating-btn { flex: 1 1 18%; }
}

/* ==========================================================================
   Difficulty picker and quiz mode
   ========================================================================== */

.level-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.level-card {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 12px; cursor: pointer; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light); color: inherit;
  transition: all 0.2s var(--ease);
  min-height: 118px;
}
.level-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.level-card.on {
  border-color: var(--cyan); background: rgba(0, 212, 255, 0.09);
  box-shadow: var(--glow-sm);
}
.level-num {
  font-family: var(--font-mono); font-size: 21px; font-weight: 700;
  color: var(--text-dim); line-height: 1;
}
.level-card.on .level-num { color: var(--cyan-bright); }
.level-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.level-blurb {
  font-size: 11.5px; line-height: 1.45; color: var(--text-muted); flex: 1;
}
/* Five bars, lit to the chosen level — reads as intensity at a glance. */
.level-bars { display: flex; gap: 3px; margin-top: auto; }
.level-bars i {
  flex: 1; height: 3px; border-radius: 2px; background: var(--bg-input);
}
.level-bars i.lit { background: var(--cyan-deep); }
.level-card.on .level-bars i.lit {
  background: var(--cyan); box-shadow: 0 0 6px var(--cyan-shadow);
}
/* The top two levels earn a warmer colour — a visual warning. */
.level-card[data-level="4"].on .level-bars i.lit { background: var(--amber); box-shadow: none; }
.level-card[data-level="5"].on .level-bars i.lit { background: var(--red); box-shadow: none; }
.level-card[data-level="4"].on { border-color: var(--amber); background: rgba(255, 179, 64, 0.08); }
.level-card[data-level="5"].on { border-color: var(--red);   background: rgba(255, 77, 106, 0.08); }
.level-card[data-level="4"].on .level-num { color: var(--amber); }
.level-card[data-level="5"].on .level-num { color: var(--red); }

.level-badge {
  display: inline-block; margin-left: 9px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px;
  border: 1px solid currentColor; color: var(--cyan);
}
.level-badge.level-4 { color: var(--amber); }
.level-badge.level-5 { color: var(--red); }

.quiz-options { margin: 16px 0 14px; }
.quiz-options select {
  width: 100%; min-height: 48px; margin-top: 10px; font-size: 15px;
}

/* --- The scenario board (everyone in the room reads this) ----------------- */
.scenario-board {
  padding: 26px 28px; margin-bottom: 18px;
  border: 1px solid var(--border-mid); border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.08), transparent 70%);
}
.scenario-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 10px;
}
.scenario-headline {
  font-size: 24px; font-weight: 600; color: #eafaff; line-height: 1.25;
  margin-bottom: 12px;
}
.scenario-body { font-size: 18px; line-height: 1.6; color: var(--text); }
.scenario-note {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted);
  margin-top: 14px;
}

/* --- Quizmaster panel -----------------------------------------------------
   Read aloud, at arm's length, by someone who isn't a salesperson. Type is
   deliberately much larger than anywhere else in the app. */
.quizmaster {
  border: 1px solid var(--amber); border-radius: var(--radius);
  background: rgba(255, 179, 64, 0.045);
  padding: 22px 24px 20px;
}
.qm-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; padding-bottom: 15px; margin-bottom: 17px;
  border-bottom: 1px solid rgba(255, 179, 64, 0.28);
}
.qm-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--amber);
}
.qm-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.qm-progress {
  font-family: var(--font-mono); font-size: 15px; color: var(--amber);
  white-space: nowrap;
}
.qm-waiting {
  font-size: 15px; color: var(--text-muted); font-style: italic;
  padding: 18px 0;
}

.qm-objection {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--border);
  animation: objection-in 0.35s var(--ease) 1;
}
.qm-objection:last-child { border-bottom: none; }
@keyframes objection-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.qm-number {
  flex: 0 0 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--amber);
  background: rgba(255, 179, 64, 0.12); color: var(--amber);
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
}
.qm-body { flex: 1; min-width: 0; }
/* The line itself — big enough to read across a kitchen table. */
.qm-line {
  font-size: 23px; line-height: 1.4; color: #eafaff; font-weight: 500;
}
.qm-hint {
  font-size: 13px; line-height: 1.5; color: var(--text-muted); margin-top: 8px;
  font-style: italic;
}
.qm-actions {
  display: flex; gap: 11px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 17px;
  border-top: 1px solid rgba(255, 179, 64, 0.28);
}
.qm-actions .btn { flex: 1 1 auto; min-width: 160px; }

@media (max-width: 900px) {
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .scenario-headline { font-size: 21px; }
  .scenario-body { font-size: 16.5px; }
  .qm-line { font-size: 20px; }
}
@media (max-width: 560px) {
  .level-grid { grid-template-columns: 1fr; }
  .level-card { min-height: auto; flex-direction: row; align-items: center;
                gap: 12px; flex-wrap: wrap; }
  .level-blurb { flex: 1 1 100%; }
  .level-bars { flex: 1 1 100%; }
  .qm-actions .btn { flex: 1 1 100%; }
  .qm-line { font-size: 18.5px; }
}

/* Prep card sections added with the sales-framework update. Each gets its own
   left-edge colour so they're distinguishable at a glance in a car park. */
.prep-timing  { border-left: 2px solid var(--blue); }
.prep-signals { border-left: 2px solid var(--cyan); }
.prep-close   { border-left: 2px solid var(--green);
                background: linear-gradient(180deg, rgba(0, 255, 157, 0.07), transparent); }
.prep-busy    { border-left: 2px solid var(--text-dim); }
.prep-close .prep-opener-text { font-size: 17px; color: #eafaff; }

/* --- Notification bell ----------------------------------------------------
   A count, not a dot: "3 things need you" is actionable, a dot is a mystery. */
.bell-wrap { position: relative; }
.bell-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--red); color: #fff;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 77, 106, 0.65);
  animation: count-glow 3s ease-in-out infinite;
}
.bell-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 200;
  width: min(380px, calc(100vw - 32px));
  background: linear-gradient(160deg, rgba(17, 28, 46, 0.98), rgba(10, 16, 27, 0.99));
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-mid); border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow-md);
  overflow: hidden;
  animation: bell-in 0.18s var(--ease) 1;
}
@keyframes bell-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.bell-title {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--cyan);
}
.bell-list { max-height: min(60vh, 460px); overflow-y: auto; }
.bell-item {
  display: flex; gap: 11px; align-items: flex-start; width: 100%;
  padding: 12px 14px; text-align: left; cursor: pointer;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.16s var(--ease);
}
.bell-item:hover { background: rgba(0, 212, 255, 0.06); }
.bell-item:last-child { border-bottom: none; }
/* Read items fade back rather than disappearing — the history is still useful. */
.bell-item.read { opacity: 0.48; }
.bell-icon {
  flex: 0 0 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid currentColor;
  font-size: 12px; color: var(--cyan);
}
.bell-follow_up   { color: var(--amber); }
.bell-task        { color: var(--red); }
.bell-opportunity { color: var(--purple); }
.bell-email       { color: var(--cyan); }
.bell-system      { color: var(--text-dim); }
.bell-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bell-item-title { font-size: 13px; color: var(--text); line-height: 1.35; }
.bell-msg {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.45;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bell-when {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--text-dim);
}
@media (max-width: 560px) {
  .bell-panel { position: fixed; top: calc(var(--topbar-h) + 6px);
                left: 12px; right: 12px; width: auto; }
}

/* PageSpeed progress. Shown for up to two minutes, so it has to look alive
   without being annoying. */
.ps-running { padding: 6px 0; }
.ps-running-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--text); margin-bottom: 11px;
}
.ps-running .progress {
  height: 5px; border-radius: 3px; background: var(--bg-input);
  overflow: hidden; margin-bottom: 9px;
}
.ps-running .progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan-bright));
  box-shadow: 0 0 10px var(--cyan-shadow);
  transition: width 1.2s linear;
}

/* --- Strategy Room --------------------------------------------------------
   Gold, not cyan. The colour is the warning: this room costs real money per
   message, and it should never be mistaken for the everyday chat. */
:root { --gold: #ffc857; --gold-deep: #d99b1e; --gold-shadow: rgba(255, 200, 87, 0.45); }

.strategy-room { max-width: 980px; }
.strategy-title { color: var(--gold); text-shadow: 0 0 22px var(--gold-shadow); }
.strategy-meter {
  font-family: var(--font-mono); font-size: 11px; color: var(--gold);
  padding: 8px 12px; border: 1px solid rgba(255, 200, 87, 0.35);
  border-radius: 20px; background: rgba(255, 200, 87, 0.07);
}
.strategy-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; margin-bottom: 18px;
  border: 1px solid rgba(255, 200, 87, 0.3);
  border-left: 2px solid var(--gold); border-radius: var(--radius);
  background: rgba(255, 200, 87, 0.05);
  font-size: 12.5px; line-height: 1.6; color: var(--text-muted);
}
.strategy-badge {
  flex: 0 0 auto; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700;
  color: #241a02; background: var(--gold); padding: 4px 9px; border-radius: 20px;
}
.btn-strategy {
  border-color: rgba(255, 200, 87, 0.45) !important; color: var(--gold) !important;
}
.btn-strategy:hover {
  border-color: var(--gold) !important;
  box-shadow: 0 0 18px var(--gold-shadow) !important;
}
.nav-flag {
  margin-left: auto; font-family: var(--font-mono); font-size: 8px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--gold);
  border: 1px solid rgba(255, 200, 87, 0.4); border-radius: 20px;
  padding: 2px 6px;
}

.strategy-thread { min-height: 40vh; margin-bottom: 16px; }
.strategy-intro { padding: 26px 0; }
.strategy-intro-title { font-size: 17px; color: var(--text); margin-bottom: 16px; }
.strategy-suggestions { display: flex; flex-direction: column; gap: 9px; }
.strategy-chip {
  text-align: left; cursor: pointer; padding: 13px 16px; min-height: 48px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-light); color: var(--text-muted);
  font-size: 13.5px; line-height: 1.5; transition: all 0.2s var(--ease);
}
.strategy-chip:hover {
  border-color: rgba(255, 200, 87, 0.5); color: var(--text);
  background: rgba(255, 200, 87, 0.06);
}

.s-turn { margin-bottom: 20px; }
.s-luke { max-width: 78%; margin-left: auto; }
.s-who {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px;
}
.s-luke .s-who { text-align: right; }
.s-body {
  padding: 14px 17px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--glass-light);
  font-size: 14.5px; line-height: 1.7; color: var(--text);
}
.s-luke .s-body {
  background: rgba(255, 200, 87, 0.09);
  border-color: rgba(255, 200, 87, 0.3); color: #fff5e0;
}
.s-bot .s-body { border-left: 2px solid var(--gold); }
.s-body pre {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px; overflow-x: auto;
  font-size: 12px; line-height: 1.6;
}
.s-thinking { color: var(--text-dim); font-style: italic; }
.s-thinking::after {
  content: "▍"; animation: blink 1s steps(2) infinite; margin-left: 2px;
}
.s-error { color: var(--red); }
.s-meta {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
}
.s-cost { color: var(--gold); font-weight: 700; }

.strategy-bar {
  position: sticky; bottom: 0; display: flex; gap: 10px; align-items: flex-end;
  padding: 13px 0;
  background: linear-gradient(180deg, transparent, var(--bg-deep) 22%);
}
.strategy-bar textarea {
  flex: 1; resize: none; min-height: 54px; font-size: 15px; padding: 14px;
  line-height: 1.5;
}
.strategy-send {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: var(--gold); color: #241a02; font-weight: 700;
}
.strategy-send:hover { box-shadow: 0 0 22px var(--gold-shadow); }
@media (max-width: 640px) {
  .strategy-bar { flex-direction: column; align-items: stretch; }
  .strategy-bar .btn { width: 100%; }
  .s-luke { max-width: 92%; }
}

/* Cold call prep sheet — markdown from the generator, sized to be skimmed in
   two minutes with a phone in the other hand. */
.call-sheet { font-size: 13.5px; line-height: 1.7; }
.call-sheet h2 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--cyan);
  margin: 20px 0 10px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.call-sheet h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.call-sheet h3 {
  font-size: 13.5px; color: var(--amber); margin: 15px 0 6px;
}
.call-sheet ul, .call-sheet ol { padding-left: 19px; margin: 8px 0; }
.call-sheet li { margin-bottom: 6px; }
.call-sheet strong { color: #eafaff; }
.call-sheet p { margin: 8px 0; }

/* --- Memory Health --------------------------------------------------------
   The question this panel answers is "does Bob actually know anything about
   my business yet", so the total is the biggest thing on it. */
.mem-health-top {
  display: flex; gap: 22px; align-items: flex-start;
  padding-bottom: 17px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.mem-total { flex: 0 0 auto; text-align: center; }
.mem-total-num {
  font-family: var(--font-mono); font-size: 40px; font-weight: 700;
  line-height: 1; color: var(--cyan-bright);
  text-shadow: 0 0 26px var(--cyan-shadow);
}
.mem-total-label {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--text-dim); margin-top: 7px;
}
.mem-health-note { flex: 1; min-width: 0; }
.mem-latest {
  font-size: 14px; line-height: 1.6; color: #eafaff;
  padding-left: 13px; border-left: 2px solid var(--cyan);
}
.mem-bars {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 20px;
}
.mem-bar { cursor: pointer; }
.mem-bar:hover .mem-bar-count { color: var(--cyan-bright); }
.mem-bar-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-bottom: 6px;
  font-size: 11.5px; color: var(--text-muted);
}
.mem-bar-count {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--text);
}
.mem-bar .progress {
  height: 4px; border-radius: 3px; background: var(--bg-input); overflow: hidden;
}
.mem-bar .progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan-bright));
}

.mem-group { margin-bottom: 14px; }
.mem-row {
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.mem-row:last-child { border-bottom: none; }
.mem-content { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.mem-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 7px;
}
.mem-actions { display: flex; gap: 5px; opacity: 0; transition: opacity 0.2s var(--ease); }
.mem-row:hover .mem-actions, .mem-row:focus-within .mem-actions { opacity: 1; }

@media (max-width: 900px) { .mem-bars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .mem-health-top { flex-direction: column; gap: 14px; }
  .mem-bars { grid-template-columns: 1fr; }
  .mem-actions { opacity: 1; }
}

/* --- Visit planner wizard -------------------------------------------------
   One step visible at a time. Used one-handed on an iPad, so every control
   is a full-width tap target and nothing scrolls sideways. */
.wizard { margin-bottom: 22px; }
.wizard-steps {
  display: flex; gap: 6px; list-style: none; margin: 0 0 16px; padding: 0;
  overflow-x: auto; scrollbar-width: none;
}
.wizard-steps::-webkit-scrollbar { display: none; }
.wizard-steps li {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--glass-light);
  font-size: 12px; color: var(--text-dim);
}
.wizard-steps li span {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid currentColor; font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
}
.wizard-steps li.on {
  color: var(--cyan-bright); border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.09); box-shadow: var(--glow-sm);
}
.wizard-steps li.done { color: var(--green); border-color: rgba(0, 255, 157, 0.4); }
.wizard-panel { display: none; }
.wizard-panel.on { display: block; animation: fade-in 0.22s var(--ease) 1; }

.town-input { display: flex; gap: 9px; }
.town-input input { flex: 1; min-height: 52px; font-size: 16px; }

.discover-total {
  font-size: 15px; color: var(--text); display: flex; align-items: baseline;
  gap: 10px; flex-wrap: wrap;
}
.discover-num {
  font-family: var(--font-mono); font-size: 38px; font-weight: 700;
  color: var(--cyan-bright); text-shadow: 0 0 24px var(--cyan-shadow);
  line-height: 1;
}
.tier-bars { display: flex; flex-direction: column; gap: 8px; }
.tier-bar {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border-left: 2px solid var(--border-mid); background: var(--glass-light);
}
.tier-bar-count {
  font-family: var(--font-mono); font-size: 19px; font-weight: 700;
  min-width: 34px; color: var(--text);
}
.tier-bar-label { font-size: 13px; color: var(--text-muted); }
.tier-row-no_website  { border-left-color: var(--red); }
.tier-row-no_website .tier-bar-count { color: var(--red); }
.tier-row-bad_website { border-left-color: var(--amber); }
.tier-row-bad_website .tier-bar-count { color: var(--amber); }
.tier-row-social_only { border-left-color: var(--purple); }
.tier-row-has_website { border-left-color: var(--blue); }
.type-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.stops-picker {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.stops-picker input[type="range"] { flex: 1; accent-color: var(--cyan); height: 32px; }
.stops-picker output {
  font-family: var(--font-mono); font-size: 26px; font-weight: 700;
  color: var(--cyan-bright); min-width: 42px; text-align: right;
}
.route-check-mark {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-mid); color: var(--text-dim);
  font-size: 14px; font-weight: 700;
}
.route-row.picked .route-check-mark {
  color: var(--cyan-bright); border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.14);
}
button.route-row { width: 100%; text-align: left; }

.prep-progress-head { font-size: 14px; color: var(--text); margin-bottom: 10px; }
.prep-tick-list { list-style: none; margin: 13px 0 0; padding: 0; }
.prep-tick-list li {
  font-size: 12.5px; color: var(--text-dim); padding: 4px 0;
  font-family: var(--font-mono);
}
.prep-tick-list li.ready { color: var(--green); }

/* --- Active route: colour tells you where you are ------------------------- */
.stop-upcoming { border-left: 3px solid var(--border-mid); }
.stop-current {
  border-left: 3px solid var(--cyan);
  box-shadow: var(--glow-md);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.07), transparent 40%);
}
.stop-done    { border-left: 3px solid var(--green); }
.stop-skipped { border-left: 3px solid var(--red); }
.stop-done .stop-number { color: var(--green); border-color: var(--green); }
.stop-skipped .stop-number { color: var(--red); border-color: var(--red); }

/* --- Day summary ---------------------------------------------------------- */
.day-summary { border-color: var(--border-hot); box-shadow: var(--glow-md); }
.day-top {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding-bottom: 16px; margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
}
.day-stat { text-align: center; }
.day-num {
  font-family: var(--font-mono); font-size: 32px; font-weight: 700;
  color: var(--cyan-bright); line-height: 1;
}
.day-label {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-dim); margin-top: 6px;
}
.day-outcomes { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 15px; }
.day-outcome { display: flex; align-items: center; gap: 8px; }
.day-outcome-num {
  font-family: var(--font-mono); font-size: 17px; font-weight: 700;
  color: var(--text);
}
.day-note {
  font-size: 14.5px; line-height: 1.6; color: #eafaff;
  padding: 14px 16px; border-left: 2px solid var(--cyan);
  background: rgba(0, 212, 255, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

@media (max-width: 640px) {
  .town-input { flex-direction: column; }
  .town-input .btn { width: 100%; }
  .discover-num { font-size: 32px; }
  .day-top { grid-template-columns: 1fr; gap: 14px; }
  .stops-picker { flex-wrap: wrap; }
}

/* --- Follow-Up Dashboard --------------------------------------------------
   The sequence strip is there so the shape of the process is never a
   mystery — three touches over five days, then close. */
.seq-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; margin-bottom: 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--glass-light);
}
.seq-step { display: flex; flex-direction: column; gap: 3px; }
.seq-day {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--cyan);
}
.seq-name { font-size: 12.5px; color: var(--text); }
.seq-end .seq-day { color: var(--text-dim); }
.seq-arrow { color: var(--text-dim); font-size: 14px; }

.seq-dots { display: inline-flex; gap: 4px; }
.seq-dot {
  width: 19px; height: 19px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  border: 1px solid var(--border-mid); color: var(--text-dim);
}
.seq-done { color: var(--green); border-color: var(--green);
            background: rgba(0, 255, 157, 0.12); }
.seq-now  { color: var(--cyan-bright); border-color: var(--cyan);
            background: rgba(0, 212, 255, 0.15);
            box-shadow: 0 0 9px var(--cyan-shadow); }

.fu-card { margin-bottom: 13px; }
.fu-card.overdue { border-left: 2px solid var(--red); }
.fu-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; margin-bottom: 12px;
}
.fu-name {
  font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none;
}
.fu-name:hover { color: var(--cyan-bright); }
.fu-when {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  flex-shrink: 0; text-align: right;
}
.fu-action {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  padding: 10px 13px; margin-bottom: 11px;
  border-left: 2px solid var(--cyan); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(0, 212, 255, 0.06);
}
.fu-step { font-size: 13.5px; color: #eafaff; font-weight: 500; }

/* The history is the point — "have I already chased these twice?" */
.fu-history { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.fu-touch {
  font-size: 11px; color: var(--text-muted);
  padding: 4px 9px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg-input);
}
.fu-touch b { color: var(--text); font-weight: 600; }
.fu-actions { display: flex; flex-wrap: wrap; gap: 7px; }

@media (max-width: 640px) {
  .fu-head { flex-direction: column; }
  .fu-when { align-items: flex-start; text-align: left; }
  .fu-actions .btn { flex: 1 1 100%; }
  .seq-arrow { display: none; }
  .seq-strip { gap: 14px; }
}
