/* MPCR Lab CRM — Bret Victor Observatory */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --blue: #003366;
  --blue-deep: #002244;
  --blue-mid: #126BD9;
  --blue-glow: #126BD9;
  --red: #CC0000;
  --red-soft: #e04040;
  --grey: #4D4C55;
  --light: #f8f9fa;
  --dark: #ffffff;
  --surface: #f0f2f5;
  --surface-raised: #ffffff;
  --surface-card: #ffffff;
  --white: #1a1a2e;
  --radius: 8px;
  --radius-lg: 14px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

.sidebar {
  width: 230px;
  background: var(--blue);
  color: #fff;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e0e0e0;
  position: relative;
}

.sidebar::after {
  display: none;
}

.sidebar .logo {
  padding: 0 1.25rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.3px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 0.75rem;
  color: #fff;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-left-color: rgba(255,255,255,0.5);
}

.sidebar nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
  border-left-color: #fff;
}

.sidebar .user-info {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
}

.sidebar .user-info a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar .user-info a:hover { color: #fff; }

.main {
  flex: 1;
  padding: 0;
  overflow-x: auto;
  background: var(--dark);
  position: relative;
}

/* Grid texture removed for light theme */

/* ── Dashboard ─────────────────────────────── */

.dash {
  padding: 2rem 2.5rem;
  position: relative;
  z-index: 1;
  max-width: 1400px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.dash-title h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--blue);
  letter-spacing: 0.5px;
}

.dash-subtitle {
  font-size: 0.78rem;
  color: var(--grey);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.dash-telemetry {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.heartbeat-svg {
  width: 200px;
  height: 32px;
  opacity: 0.7;
}

.heartbeat-line {
  stroke-dasharray: 560;
  stroke-dashoffset: 560;
  animation: heartbeat-draw 3s ease-out forwards, heartbeat-scroll 4s linear 3s infinite;
}

.heartbeat-glow {
  stroke-dasharray: 560;
  stroke-dashoffset: 560;
  animation: heartbeat-draw 3s ease-out forwards, heartbeat-scroll 4s linear 3s infinite;
  filter: blur(3px);
}

@keyframes heartbeat-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes heartbeat-scroll {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -140; }
}

.dash-pulse {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(16,185,129,0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 14px rgba(16,185,129,0.8); }
}

.pulse-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ── Radial Gauge Instruments ────────────────── */

.gauges {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.gauge-instrument {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  padding: 1rem 0.75rem 0.75rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: gauge-in 0.5s ease-out both;
  animation-delay: var(--gauge-delay);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s;
}

.gauge-instrument::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.6;
}

.gauge-instrument::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 6%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.gauge-instrument:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-2px);
}

@keyframes gauge-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gauge-arc-svg {
  width: 100%;
  max-width: 120px;
  height: auto;
  margin-bottom: -0.25rem;
  position: relative;
  z-index: 1;
}

.gauge-arc-track { opacity: 0.8; }

.gauge-arc-fill {
  transition: stroke-dashoffset 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  filter: drop-shadow(0 0 3px var(--accent));
}

.gauge-arc-dot { opacity: 0.9; }

.gauge-readout {
  text-align: center;
  position: relative;
  z-index: 1;
}

.gauge-value {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 0.25rem;
}

.gauge-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grey);
  display: block;
}

.gauge-alert {
  border-color: rgba(239,68,68,0.2);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(239,68,68,0.04) 100%);
}

.gauge-alert .gauge-value {
  animation: alert-pulse 1.5s ease-in-out infinite;
}

@keyframes alert-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Velocity Strip ───────────────────────── */

.velocity-strip {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 0.7rem 1.25rem;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  animation: section-in 0.6s ease-out both;
  animation-delay: 0.15s;
}

.velocity-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.velocity-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.velocity-value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--blue-glow);
  text-shadow: 0 0 10px rgba(29,111,191,0.25);
}

.velocity-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.velocity-warn .velocity-value {
  color: var(--red-soft);
  text-shadow: 0 0 10px rgba(232,67,77,0.25);
}

/* Avg days label in river heads */
.river-avg-days {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: #aaa;
  margin-top: 0.15rem;
}

/* ── River Sections ────────────────────────── */

.river-section {
  margin-bottom: 2.5rem;
  animation: section-in 0.6s ease-out both;
}

.river-section:nth-of-type(1) { animation-delay: 0.3s; }
.river-section:nth-of-type(2) { animation-delay: 0.5s; }
.river-section:nth-of-type(3) { animation-delay: 0.7s; }

@keyframes section-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.river-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.river-title h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--white);
}

.river-total {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--grey);
  letter-spacing: 0.5px;
}

/* ── River (pipeline) ──────────────────────── */

.river {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.river::-webkit-scrollbar { height: 6px; }
.river::-webkit-scrollbar-track { background: transparent; }
.river::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.river-stage {
  flex: 1;
  min-width: 140px;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: stage-in 0.4s ease-out both;
  animation-delay: var(--delay);
}

@keyframes stage-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* The depth indicator — visual weight proportional to count */
.river-depth {
  position: absolute;
  bottom: 0;
  left: 2px;
  right: 2px;
  height: var(--depth);
  background: linear-gradient(
    to top,
    hsla(var(--phase-hue), 60%, 50%, 0.08),
    transparent
  );
  border-radius: 0 0 var(--radius) var(--radius);
  pointer-events: none;
  transition: height 0.8s ease-out;
}

.river-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem 0.5rem;
  position: relative;
  z-index: 1;
}

.river-count {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: hsla(var(--phase-hue), 60%, 65%, 1);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.river-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grey);
  text-align: center;
}

.river-cards {
  padding: 0.3rem 0.35rem 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  z-index: 1;
}

.river-card {
  padding: 0.45rem 0.55rem;
  background: var(--surface-raised);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--grey);
  transition: all 0.2s;
  animation: card-in 0.3s ease-out both;
  animation-delay: calc(var(--delay) + var(--card-delay, 0ms) + 200ms);
  cursor: default;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.river-card:hover {
  background: var(--surface-card);
  border-color: rgba(29,111,191,0.25);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 0 12px rgba(29,111,191,0.06);
}

.river-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.3rem;
}

.river-card strong {
  font-weight: 600;
  display: block;
  flex: 1;
}

.river-advance {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: #999;
  font-size: 0.65rem;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  padding: 0;
  font-family: var(--font-mono);
}

.river-advance svg { pointer-events: none; }

.river-advance:hover {
  background: var(--blue-glow);
  border-color: var(--blue-glow);
  color: var(--white);
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(29,111,191,0.4);
}

/* Inline advance form with note input */
.river-advance-form {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.river-note-input {
  width: 0;
  opacity: 0;
  padding: 0.15rem 0.35rem !important;
  font-size: 0.65rem !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 4px !important;
  background: var(--surface) !important;
  color: var(--white) !important;
  transition: width 0.2s, opacity 0.2s;
  font-family: var(--font-mono) !important;
}

.river-card:hover .river-note-input,
.river-note-input:focus {
  width: 80px;
  opacity: 1;
}

.river-meta {
  display: block;
  font-size: 0.68rem;
  color: var(--grey);
  margin-top: 0.15rem;
}

.river-time {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #aaa;
  margin-top: 0.15rem;
}

.river-time-warn {
  color: var(--red-soft);
  font-weight: 600;
}

.river-card-stalled {
  border-color: rgba(239,68,68,0.2);
  background: linear-gradient(135deg, var(--surface-raised) 0%, rgba(239,68,68,0.06) 100%);
}

.river-card-stalled::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red-soft);
  border-radius: 2px 0 0 2px;
}

.river-overflow {
  color: var(--grey);
  font-style: italic;
  border-style: dashed;
  background: transparent;
}

.river-empty {
  padding: 0.75rem;
  text-align: center;
  color: rgba(255,255,255,0.15);
  font-size: 0.9rem;
}

/* Flow connectors between stages */
.river-flow-connector {
  position: absolute;
  right: -10px;
  top: 0.5rem;
  width: 20px;
  height: 40px;
  z-index: 2;
}

.river-flow-connector svg {
  width: 100%;
  height: 100%;
}

.flow-arrow {
  opacity: 0.6;
}

.flow-particle {
  opacity: 0;
  animation: particle-fade 2s ease-in-out infinite;
}

@keyframes particle-fade {
  0%, 100% { opacity: 0; }
  30%, 70% { opacity: 0.8; }
}

/* Legacy flow arrow fallback */
.river-flow {
  position: absolute;
  right: -6px;
  top: 1.1rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.12);
  z-index: 2;
  font-family: var(--font-mono);
}

/* ── Header (non-dashboard pages) ──────────── */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--white);
}

/* ── Stats cards (fallback for non-dashboard) ─ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--blue-glow);
}

.stat-card.alert .value {
  color: var(--red-soft);
}

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

.table-wrap {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grey);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  background: var(--surface);
  font-weight: 600;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 0.88rem;
  vertical-align: middle;
  color: var(--grey);
}

tr:last-child td { border-bottom: none; }

tr:hover td {
  background: rgba(29,111,191,0.04);
}

/* ── Buttons ────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: #003366;
  color: #fff;
}

.btn-primary:hover {
  background: #002244;
  box-shadow: 0 4px 12px rgba(0,51,102,0.3);
}

.btn-danger {
  background: rgba(204,0,0,0.1);
  color: #CC0000;
  border: 1px solid rgba(197,39,48,0.2);
}

.btn-danger:hover {
  background: var(--red);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--grey);
}

.btn-outline:hover {
  border-color: var(--blue-glow);
  color: var(--white);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}

.btn-google {
  background: var(--white);
  color: var(--dark);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ── Forms ──────────────────────────────────── */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: #fff;
  color: #333;
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #003366;
  box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
}

textarea { resize: vertical; min-height: 80px; }

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}

.inline-form input { flex: 1; }

select option {
  background: var(--surface);
  color: var(--white);
}

/* ── Badges ─────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* Phase badges — all using subtle dark backgrounds */
.badge-active      { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-alumni      { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-inactive    { background: rgba(0,0,0,0.1); color: var(--grey); }
.badge-new         { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-accepted    { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-declined    { background: rgba(239,68,68,0.15); color: #f87171; }

.badge-idea        { background: rgba(167,139,250,0.15); color: #a78bfa; }
.badge-researching { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-development { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-prototype   { background: rgba(251,146,60,0.15); color: #fb923c; }
.badge-functioning { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-improving   { background: rgba(45,212,191,0.15); color: #2dd4bf; }
.badge-published   { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-archived    { background: rgba(0,0,0,0.1); color: var(--grey); }

.badge-draft       { background: rgba(0,0,0,0.1); color: var(--grey); }
.badge-writing     { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-submitted   { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-under_review { background: rgba(251,146,60,0.15); color: #fb923c; }
.badge-revision    { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-cited       { background: rgba(167,139,250,0.15); color: #a78bfa; }

.badge-prospect    { background: rgba(167,139,250,0.15); color: #a78bfa; }
.badge-onboarding  { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-senior      { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-graduating  { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-collaborator { background: rgba(45,212,191,0.15); color: #2dd4bf; }
.badge-interviewing { background: rgba(251,146,60,0.15); color: #fb923c; }
.badge-reviewed    { background: rgba(96,165,250,0.15); color: #60a5fa; }

/* ── Login page ─────────────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--dark);
}

.login-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  max-width: 380px;
  width: 100%;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.login-card p {
  color: var(--grey);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* ── Join form (public) ─────────────────────── */

.join-page {
  max-width: 560px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.join-page h1 {
  font-family: var(--font-display);
  color: var(--white);
  margin-bottom: 0.25rem;
}

.join-page .subtitle {
  color: var(--grey);
  margin-bottom: 2rem;
}

.join-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

/* ── Pipeline (legacy compat) ────────────── */

.section-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  margin: 2rem 0 0.75rem;
  color: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-bottom: 0.4rem;
}

.pipeline {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.pipeline-stage {
  flex: 1;
  min-width: 130px;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.pipeline-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey);
}

.pipeline-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-glow);
  background: rgba(29,111,191,0.1);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipeline-cards {
  padding: 0.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pipeline-card {
  padding: 0.4rem 0.5rem;
  background: var(--surface-raised);
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.3;
  border-left: 3px solid var(--blue-glow);
  color: var(--grey);
}

.pipeline-card:hover {
  background: var(--surface-card);
}

.pipeline-empty {
  padding: 0.5rem;
  text-align: center;
  color: rgba(255,255,255,0.15);
  font-size: 0.8rem;
}

/* ── Utilities ──────────────────────────────── */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.text-muted { color: var(--grey); }
.text-center { text-align: center; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0,0,0,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* ── Meeting Cards ──────────────────────────── */

.meetings-upcoming {
  margin-bottom: 2rem;
}

.meeting-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meeting-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.meeting-card:hover {
  border-color: rgba(29,111,191,0.2);
  background: var(--surface-raised);
}

.meeting-card-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  padding: 0.25rem 0.5rem;
  background: rgba(29,111,191,0.1);
  border-radius: 6px;
}

.meeting-day {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--blue-glow);
  line-height: 1;
}

.meeting-month {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meeting-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meeting-card-body strong {
  font-size: 0.9rem;
  color: var(--white);
}

.meeting-card-meta {
  font-size: 0.78rem;
  color: var(--grey);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.meeting-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.meeting-edit-form {
  padding: 0.75rem;
}

/* Action items */
.action-item-row input[type="text"],
.action-item-row select {
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
}

.outcomes-section textarea {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ── Upcoming Meetings Widget (dashboard) ──── */

.upcoming-widget {
  margin-bottom: 2.5rem;
  animation: section-in 0.6s ease-out both;
  animation-delay: 0.2s;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.upcoming-item:hover {
  border-color: rgba(29,111,191,0.15);
  background: var(--surface-raised);
}

.upcoming-date-pip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
}

.upcoming-day {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue-glow);
  line-height: 1;
}

.upcoming-month {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--grey);
  letter-spacing: 0.5px;
}

.upcoming-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.upcoming-info strong {
  font-size: 0.85rem;
  color: var(--white);
}

.upcoming-meta {
  font-size: 0.73rem;
  color: var(--grey);
}

/* ── Compose Form ──────────────────────────── */

.compose-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.compose-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.compose-quick-fill {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: rgba(29,111,191,0.1);
  border: 1px solid rgba(29,111,191,0.2);
  border-radius: 99px;
  font-size: 0.7rem;
  font-family: var(--font-body);
  color: var(--blue-glow);
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  background: rgba(29,111,191,0.2);
  border-color: var(--blue-glow);
  color: var(--white);
}

/* ── Message Status Badges ─────────────────── */

.badge-scheduled  { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-confirmed  { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-in_progress { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-completed  { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-cancelled  { background: rgba(0,0,0,0.1); color: var(--grey); }
.badge-queued     { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-sent       { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-failed     { background: rgba(239,68,68,0.15); color: #f87171; }

/* Meeting type badges */
.badge-lab_meeting     { background: rgba(96,165,250,0.1); color: #60a5fa; }
.badge-project_checkin { background: rgba(251,146,60,0.1); color: #fb923c; }
.badge-defense         { background: rgba(167,139,250,0.1); color: #a78bfa; }
.badge-seminar         { background: rgba(45,212,191,0.1); color: #2dd4bf; }
.badge-other           { background: rgba(0,0,0,0.1); color: var(--grey); }

/* ══════════════════════════════════════════════
   Mission Control Dashboard (v2)
   ══════════════════════════════════════════════ */

/* ── MC Header ─────────────────────────────── */

.mc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  animation: mc-fade-in 0.5s ease-out both;
}

.mc-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.mc-subtitle {
  font-size: 0.72rem;
  color: var(--grey);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  display: block;
  margin-top: 0.2rem;
}

.mc-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mc-status-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mc-signal {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.mc-signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
  animation: pulse 2s ease-in-out infinite;
}

.mc-signal-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.mc-heartbeat {
  width: 140px;
  height: 24px;
  opacity: 0.6;
}

.mc-hb-line {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: heartbeat-draw 2.5s ease-out forwards, heartbeat-scroll 4s linear 2.5s infinite;
}

@keyframes mc-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Alert Banner ──────────────────────────── */

.mc-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  animation: mc-fade-in 0.5s ease-out 0.1s both;
}

.mc-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  text-decoration: none;
  transition: all 0.2s;
}

.mc-alert:hover {
  transform: translateY(-1px);
}

.mc-alert-warm {
  background: rgba(251,191,36,0.06);
  border-color: rgba(251,191,36,0.2);
  color: #fbbf24;
}

.mc-alert-warm:hover {
  background: rgba(251,191,36,0.1);
  box-shadow: 0 4px 16px rgba(251,191,36,0.08);
}

.mc-alert-danger {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
  color: #f87171;
}

.mc-alert-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.mc-alert-text {
  flex: 1;
  font-size: 0.85rem;
}

.mc-alert-text strong {
  font-weight: 600;
}

.mc-alert-action {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.mc-alert:hover .mc-alert-action {
  opacity: 1;
}

/* ── Instrument Panel ──────────────────────── */

.mc-instruments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  animation: mc-fade-in 0.5s ease-out 0.15s both;
}

.mc-inst {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  padding: 1.1rem 0.75rem 0.85rem;
  text-align: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.25s;
  animation: gauge-in 0.5s ease-out both;
  animation-delay: var(--inst-delay);
}

.mc-inst::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--inst-color);
  opacity: 0.7;
}

.mc-inst::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--inst-color) 5%, transparent) 0%, transparent 65%);
  pointer-events: none;
}

.mc-inst:hover {
  border-color: color-mix(in srgb, var(--inst-color) 30%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--inst-color) 10%, transparent);
  transform: translateY(-3px);
}

.mc-inst-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  background: linear-gradient(to top, color-mix(in srgb, var(--inst-color) 8%, transparent), transparent);
  pointer-events: none;
  transition: height 0.8s ease-out;
}

.mc-inst-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--inst-color);
  line-height: 1;
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 0.25rem;
}

.mc-inst-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white);
  position: relative;
  z-index: 1;
  display: block;
}

.mc-inst-sub {
  font-size: 0.62rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0.1rem;
}

/* ── Telemetry Strip ───────────────────────── */

.mc-telemetry {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 0.6rem 1.1rem;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  animation: mc-fade-in 0.5s ease-out 0.2s both;
}

.mc-telem-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--grey);
}

.mc-telem-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-glow);
  text-shadow: 0 0 10px rgba(29,111,191,0.2);
}

.mc-telem-lbl {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc-telem-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.08);
}

.mc-telem-warn {
  color: var(--red-soft);
}

.mc-telem-warn .mc-telem-val {
  color: var(--red-soft);
  text-shadow: 0 0 10px rgba(232,67,77,0.2);
}

/* ── Two-Column Command Grid ───────────────── */

.mc-command-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  animation: mc-fade-in 0.5s ease-out 0.25s both;
}

/* ── Panels ────────────────────────────────── */

.mc-panel {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mc-panel-danger {
  border-color: rgba(239,68,68,0.15);
  margin-bottom: 1.25rem;
}

.mc-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.mc-panel-head h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--white);
}

.mc-panel-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--red-soft);
  background: rgba(239,68,68,0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.mc-panel-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--grey);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.mc-panel-link:hover {
  color: var(--blue-glow);
}

/* ── Stalled Items List ────────────────────── */

.mc-stalled-list {
  display: flex;
  flex-direction: column;
}

.mc-stalled-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.mc-stalled-item:last-child {
  border-bottom: none;
}

.mc-stalled-item:hover {
  background: rgba(239,68,68,0.04);
}

.mc-stalled-info strong {
  font-size: 0.82rem;
  color: var(--white);
  display: block;
  line-height: 1.3;
}

.mc-stalled-meta {
  font-size: 0.68rem;
  color: var(--grey);
}

.mc-stalled-days {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red-soft);
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  background: rgba(239,68,68,0.1);
  border-radius: 4px;
}

.mc-stalled-overflow {
  padding: 0.5rem 1.1rem;
  font-size: 0.75rem;
  color: var(--grey);
  font-style: italic;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* ── Quick Actions Grid ────────────────────── */

.mc-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
}

.mc-quick-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-raised);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  color: var(--grey);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.mc-quick-btn:hover {
  background: var(--surface-card);
  border-color: rgba(29,111,191,0.25);
  color: var(--white);
  transform: translateY(-1px);
}

.mc-quick-btn svg {
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.mc-quick-btn:hover svg {
  opacity: 0.9;
}

.mc-quick-btn-alert {
  border-color: rgba(251,191,36,0.2);
}

.mc-quick-btn-alert:hover {
  border-color: rgba(251,191,36,0.4);
}

.mc-quick-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(251,191,36,0.2);
  color: #fbbf24;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  margin-left: auto;
}

/* ── Meetings List ─────────────────────────── */

.mc-meetings-list {
  display: flex;
  flex-direction: column;
}

.mc-meeting-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.15s;
}

.mc-meeting-row:last-child {
  border-bottom: none;
}

.mc-meeting-row:hover {
  background: rgba(29,111,191,0.04);
}

.mc-meeting-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 38px;
  padding: 0.25rem 0.4rem;
  background: rgba(29,111,191,0.08);
  border-radius: 6px;
  flex-shrink: 0;
}

.mc-meeting-day {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue-glow);
  line-height: 1;
}

.mc-meeting-mon {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mc-meeting-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mc-meeting-info strong {
  font-size: 0.82rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-meeting-meta {
  font-size: 0.7rem;
  color: var(--grey);
}

.mc-meeting-agenda {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.mc-empty-state p {
  font-size: 0.82rem;
  color: var(--grey);
}

/* ── Pipeline Horizons ─────────────────────── */

.mc-horizon {
  margin-bottom: 2rem;
  animation: section-in 0.6s ease-out both;
}

.mc-horizon:nth-of-type(1) { animation-delay: 0.35s; }
.mc-horizon:nth-of-type(2) { animation-delay: 0.45s; }
.mc-horizon:nth-of-type(3) { animation-delay: 0.55s; }
.mc-horizon:nth-of-type(4) { animation-delay: 0.65s; }

.mc-horizon-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.mc-horizon-head h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--white);
}

.mc-horizon-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.mc-horizon-total {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--grey);
}

.mc-horizon-activity {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #10b981;
}

.mc-horizon-stalled {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--red-soft);
}

/* Stacked bar visualization */
.mc-horizon-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.1);
}

.mc-horizon-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 2rem;
  padding: 0 0.4rem;
  background: color-mix(in srgb, var(--seg-color) calc(8% + var(--seg-idx) * 4%), transparent);
  border-right: 1px solid rgba(0,0,0,0.08);
  transition: all 0.2s;
  cursor: default;
  position: relative;
}

.mc-horizon-seg:last-child {
  border-right: none;
}

.mc-horizon-seg:hover {
  background: color-mix(in srgb, var(--seg-color) calc(15% + var(--seg-idx) * 4%), transparent);
}

.mc-horizon-seg-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-horizon-seg-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--seg-color);
  flex-shrink: 0;
}

.mc-horizon-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.15);
}

/* Phase detail columns */
.mc-horizon-detail {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.mc-horizon-detail::-webkit-scrollbar { height: 5px; }
.mc-horizon-detail::-webkit-scrollbar-track { background: transparent; }
.mc-horizon-detail::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.mc-phase-col {
  flex: 1;
  min-width: 130px;
  animation: stage-in 0.35s ease-out both;
  animation-delay: calc(var(--phase-idx) * 50ms + 0.3s);
}

.mc-phase-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.3rem;
}

.mc-phase-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--grey);
}

.mc-phase-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--phase-color);
  opacity: 0.7;
}

.mc-phase-cards {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mc-phase-card {
  padding: 0.4rem 0.5rem;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 5px;
  font-size: 0.74rem;
  color: var(--grey);
  transition: all 0.2s;
  animation: card-in 0.3s ease-out both;
  animation-delay: calc(var(--card-d, 0ms) + 0.4s);
  position: relative;
}

.mc-phase-card:hover {
  background: var(--surface-raised);
  border-color: rgba(29,111,191,0.2);
  transform: translateY(-1px);
}

.mc-phase-card-stalled {
  border-left: 2px solid var(--red-soft);
}

.mc-phase-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.25rem;
}

.mc-phase-card-top strong {
  font-weight: 600;
  font-size: 0.74rem;
  flex: 1;
}

.mc-advance-form {
  flex-shrink: 0;
}

.mc-advance-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  color: #aaa;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s;
}

.mc-advance-btn:hover {
  background: var(--blue-glow);
  border-color: var(--blue-glow);
  color: var(--white);
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(29,111,191,0.3);
}

.mc-card-meta {
  display: block;
  font-size: 0.65rem;
  color: var(--grey);
  margin-top: 0.1rem;
}

.mc-card-time {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: rgba(255,255,255,0.25);
  margin-top: 0.1rem;
  display: inline-block;
}

.mc-card-time-warn {
  color: var(--red-soft);
  font-weight: 600;
}

.mc-phase-more {
  padding: 0.35rem 0.5rem;
  font-size: 0.68rem;
  color: var(--grey);
  text-decoration: none;
  border: 1px dashed rgba(0,0,0,0.1);
  border-radius: 5px;
  text-align: center;
  transition: all 0.2s;
}

.mc-phase-more:hover {
  border-color: rgba(29,111,191,0.2);
  color: var(--blue-glow);
}

/* ── Responsive ─────────────────────────────── */

@media (max-width: 900px) {
  .gauges {
    grid-template-columns: repeat(3, 1fr);
  }
  .mc-instruments {
    grid-template-columns: repeat(3, 1fr);
  }
  .mc-command-grid {
    grid-template-columns: 1fr;
  }
  .dash {
    padding: 1.5rem 1rem;
  }
  .mc-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .mc-telemetry {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .sidebar { width: 60px; }
  .sidebar .logo { font-size: 0; padding: 0.5rem; }
  .sidebar .logo::first-letter { font-size: 1.1rem; }
  .sidebar nav a { padding: 0.6rem; font-size: 0; text-align: center; }
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .mc-instruments { grid-template-columns: repeat(2, 1fr); }
  .mc-quick-grid { grid-template-columns: 1fr; }
  .mc-horizon-bar { height: 24px; }
  .mc-horizon-seg-label { display: none; }
}
