/* ── Reset & tokens ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Sponge brand palette (2026-04-30) — yellow sponge + deep-blue water.
     Designer can refine. --accent below is repointed to --sponge-primary so
     existing var(--accent) usages flip to gold without per-rule edits. */
  --sponge-primary:       #C9A227;
  --sponge-primary-hover: #B8860B;
  --sponge-accent:        #F5E1A4;
  --sponge-water:         #3A6B8C;
  --sponge-bg:            #FAF8F2;
  --sponge-text:          #2A2A2A;

  --bg:        #070b14;
  --surface:   #0f1623;
  --surface-2: #172032;
  --border:    rgba(201, 162, 39, 0.14);
  --border-2:  rgba(255, 255, 255, 0.06);
  --accent:    var(--sponge-primary);
  --accent-dim: rgba(201, 162, 39, 0.10);
  --teal:      #4ecdc4;
  --red:       #e15759;
  --text:      #dde6f3;
  --muted:     #4a6080;
  --nav-h:     56px;
  --radius:    12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav {
  height: var(--nav-h);
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-2);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--border-2);
}

.nav-cta {
  display: flex !important;
  align-items: center;
  gap: 6px;
  color: var(--accent) !important;
}

.badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(79,156,249,0.2);
}

/* Hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s, background 0.15s;
}

.nav-burger:hover span { background: var(--text); }

.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 80px 24px 60px;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(79,156,249,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 70%, rgba(78,205,196,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 35% 35% at 85% 20%, rgba(225,87,89,0.04) 0%, transparent 55%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 10;
  max-width: 700px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(79,156,249,0.2);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(42px, 9vw, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-accent {
  background: linear-gradient(135deg, var(--sponge-primary) 0%, var(--sponge-water) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.btn-primary {
  background: var(--sponge-primary);
  color: var(--sponge-text);
  box-shadow: 0 0 20px rgba(201,162,39,0.30);
}

.btn-primary:hover {
  background: var(--sponge-primary-hover);
  color: #fff;
  box-shadow: 0 0 28px rgba(201,162,39,0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--border-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

/* ── Stats bar ────────────────────────────────────────────────────── */
.stats-bar {
  border-top: 1px solid var(--border-2);
  border-bottom: 1px solid var(--border-2);
  background: var(--surface);
  padding: 24px 24px;
}

.stats-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 40px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-2);
}

/* ── Features ─────────────────────────────────────────────────────── */
.features {
  padding: 80px 24px;
}

.features-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}

.feature-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.feature-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(79,156,249,0.1);
  color: var(--accent);
  border: 1px solid rgba(79,156,249,0.15);
}

.feature-tag.coming {
  background: rgba(148,163,184,0.08);
  color: var(--muted);
  border-color: rgba(148,163,184,0.12);
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-2);
  padding: 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-logo {
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
}

.footer-meta {
  font-size: 12px;
  color: var(--muted);
}

/* ── Page header (network, etc.) ──────────────────────────────────── */
.page-header {
  border-bottom: 1px solid var(--border-2);
  background: var(--surface);
  padding: 24px;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}

.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.search-input {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 8px 14px;
  width: 260px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); }

/* ── Person grid ──────────────────────────────────────────────────── */
.person-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.person-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}

.person-card:hover {
  border-color: var(--border);
  transform: translateY(-1px);
}

.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.person-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.person-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.person-role {
  font-size: 13px;
  color: var(--muted);
}

.person-company {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
}

.person-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: auto;
}

.tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
}

.tag-networking { background: rgba(78,205,196,0.12); color: #4ecdc4; border: 1px solid rgba(78,205,196,0.2); }
.tag-jobs       { background: rgba(255,107,53,0.12); color: #FF6B35; border: 1px solid rgba(255,107,53,0.2); }
.tag-mba        { background: rgba(242,142,43,0.12); color: #F28E2B; border: 1px solid rgba(242,142,43,0.2); }
.tag-learning   { background: rgba(52,152,219,0.12); color: #3498DB; border: 1px solid rgba(52,152,219,0.2); }

/* ── Person card as link ──────────────────────────────────────────── */
a.person-card { text-decoration: none; cursor: pointer; }
a.person-card:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ── Brief page ───────────────────────────────────────────────────── */
.brief-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.brief-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.brief-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.brief-meta { flex: 1; min-width: 200px; }

.brief-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.brief-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.brief-role { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.brief-at   { opacity: 0.5; margin: 0 4px; }
.brief-location { font-size: 12px; color: var(--muted); opacity: 0.7; margin-bottom: 10px; }
.brief-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.brief-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-start;
}

.btn-sm { padding: 7px 14px; font-size: 13px; }

.brief-about-wrap {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.brief-about {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── Brief two-col ────────────────────────────────────────────────── */
.brief-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.brief-col {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 20px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.career-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 13px;
}

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

.career-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.career-dot-current { background: #59A14F; box-shadow: 0 0 6px rgba(89,161,79,0.5); }
.career-dot-edu     { background: #F28E2B; }

.career-co  { font-weight: 500; flex: 1; }
.career-rel { font-size: 11px; color: var(--muted); opacity: 0.6; }

.shared-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 13px;
}
.shared-item:last-child { border-bottom: none; }

.shared-type {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(79,156,249,0.15);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Skill gap chart ──────────────────────────────────────────────── */
.chart-section {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 24px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.skill-group { margin-bottom: 24px; }
.skill-group:last-child { margin-bottom: 0; }

.skill-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: 8px;
  margin-bottom: 10px;
}

.skill-row {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}

.skill-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-bar-wrap { width: 100%; }

.skill-bar-bg {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-2);
}

.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 3px;
}

.skill-bar-empty {
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 4px,
    transparent 4px,
    transparent 8px
  );
}

.skill-route { text-align: right; }

.route-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
}

.route-mba  { background: rgba(242,142,43,0.15); color: #F28E2B; border: 1px solid rgba(242,142,43,0.25); }
.route-self { background: rgba(225,87,89,0.12);  color: #E15759; border: 1px solid rgba(225,87,89,0.2);  }

.route-has {
  font-size: 13px;
  color: #4ECDC4;
  font-weight: 700;
}

/* ── Skills pill list ─────────────────────────────────────────────── */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.skill-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(78,205,196,0.08);
  color: #4ECDC4;
  border: 1px solid rgba(78,205,196,0.15);
}

/* ── About expand ─────────────────────────────────────────────────── */
.about-details { list-style: none; }
.about-details[open] .about-toggle-hint { display: none; }
.about-details[open] .about-preview { display: none; }
.about-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.about-summary::-webkit-details-marker { display: none; }
.about-preview { font-size: 14px; color: var(--muted); line-height: 1.7; }
.about-toggle-hint {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.brief-about-full { font-size: 14px; color: var(--muted); line-height: 1.7; margin-top: 10px; }

/* ── Tag extras ───────────────────────────────────────────────────── */
.tag-status      { background: rgba(225,87,89,0.12); color: #E15759; border: 1px solid rgba(225,87,89,0.2); }
.tag-connections { background: rgba(79,156,249,0.08); color: var(--muted); border: 1px solid var(--border-2); }

/* ── Shared-type variant for relations ────────────────────────────── */
.shared-type-rel { color: var(--muted); background: var(--surface-2); border-color: var(--border-2); }

/* ── Compare panel ────────────────────────────────────────────────── */
.compare-details {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}
.compare-summary::-webkit-details-marker { display: none; }
.compare-summary:hover { background: var(--surface-2); }

.compare-summary-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.compare-summary-hint {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.compare-chevron {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s;
  line-height: 1;
}
.compare-details[open] .compare-chevron { transform: rotate(90deg); }

.compare-panel {
  border-top: 1px solid var(--border-2);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-card {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compare-card-ak   { border-color: rgba(78,205,196,0.2); }
.compare-card-them { border-color: rgba(225,87,89,0.2);  }

.compare-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.compare-card-ak   .compare-card-label { color: #4ECDC4; }
.compare-card-them .compare-card-label { color: #E15759; }

.compare-card-title   { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.compare-card-company { font-size: 13px; color: var(--muted); }
.compare-card-location{ font-size: 12px; color: var(--muted); opacity: 0.7; }
.compare-card-edu     { font-size: 12px; color: var(--muted); margin-top: 4px; }
.compare-card-headline{ font-size: 12px; color: var(--muted); margin-top: 4px; opacity: 0.8; }

.compare-career-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-2);
}

.compare-career-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-2);
}
.compare-career-item:last-child { border-bottom: none; }

.compare-shared { }
.compare-shared-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.shared-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--border-2);
  color: var(--muted);
  background: var(--bg);
}
.shared-pill-person    { color: #E15759; border-color: rgba(225,87,89,0.2); background: rgba(225,87,89,0.06); }
.shared-pill-company   { color: #59A14F; border-color: rgba(89,161,79,0.2);  background: rgba(89,161,79,0.06); }
.shared-pill-skill     { color: #4ECDC4; border-color: rgba(78,205,196,0.2); background: rgba(78,205,196,0.06); }
.shared-pill-concept   { color: #4f9cf9; border-color: rgba(79,156,249,0.2); background: rgba(79,156,249,0.06); }
.shared-pill-decision  { color: #E74C3C; border-color: rgba(231,76,60,0.2);  background: rgba(231,76,60,0.06); }

@media (max-width: 680px) {
  .brief-cols   { grid-template-columns: 1fr; }
  .compare-cols { grid-template-columns: 1fr; }
  .skill-row    { grid-template-columns: 130px 1fr 90px; }
  .skill-name   { font-size: 12px; }
  .brief-actions { width: 100%; }
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .nav-burger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-2);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 2px;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 10px 14px;
    font-size: 15px;
  }

  .hero { padding: 60px 20px 48px; min-height: auto; }

  .hero-sub { font-size: 15px; }

  .stats-inner { gap: 0; }
  .stat { padding: 8px 20px; }
  .stat-value { font-size: 26px; }
  .stat-divider { height: 28px; }

  .features { padding: 48px 16px; }

  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }

  .person-grid { grid-template-columns: 1fr; padding: 16px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stat-divider { display: none; }
  .stats-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border-2); }
  .stat { background: var(--surface); padding: 20px; }
}

/* ── Feature card as link ─────────────────────────────────────────── */
a.feature-card-link { text-decoration: none; display: block; }

/* ── Query page ───────────────────────────────────────────────────── */
.query-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.query-header {
  border-bottom: 1px solid var(--border-2);
  padding: 20px 0 16px;
  flex-shrink: 0;
}

.query-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.query-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.query-header-actions { flex-shrink: 0; padding-top: 2px; }

.query-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 16px;
}

/* ── Message list ─────────────────────────────────────────────────── */
.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.msg-list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
}

.msg-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(79,156,249,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-empty-icon svg { width: 22px; height: 22px; color: var(--accent); }

.msg-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.msg-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 600px;
  margin-top: 4px;
}

.suggestion {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1.4;
  text-align: center;
}
.suggestion:hover { border-color: var(--accent); color: var(--text); }

/* ── Messages ─────────────────────────────────────────────────────── */
.msg { display: flex; }
.msg-user      { justify-content: flex-end; }
.msg-assistant { justify-content: flex-start; }

.msg-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.65;
}

.msg-user .msg-bubble {
  background: var(--sponge-primary);
  color: var(--sponge-text);
  border-bottom-right-radius: 4px;
}

.msg-assistant .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* Markdown inside assistant bubble */
.msg-assistant .msg-bubble h1,
.msg-assistant .msg-bubble h2,
.msg-assistant .msg-bubble h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 14px 0 6px;
  letter-spacing: -0.01em;
}
.msg-assistant .msg-bubble h1 { font-size: 17px; }
.msg-assistant .msg-bubble p  { margin: 6px 0; }
.msg-assistant .msg-bubble ul,
.msg-assistant .msg-bubble ol { padding-left: 20px; margin: 6px 0; }
.msg-assistant .msg-bubble li { margin: 3px 0; }
.msg-assistant .msg-bubble table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  margin: 10px 0;
}
.msg-assistant .msg-bubble th,
.msg-assistant .msg-bubble td {
  border: 1px solid var(--border-2);
  padding: 6px 10px;
  text-align: left;
}
.msg-assistant .msg-bubble th { background: var(--surface-2); font-weight: 600; }
.msg-assistant .msg-bubble code {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Mono', monospace;
}
.msg-assistant .msg-bubble pre {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}
.msg-assistant .msg-bubble pre code {
  background: none;
  border: none;
  padding: 0;
}
.msg-assistant .msg-bubble strong { font-weight: 600; color: var(--text); }
.msg-assistant .msg-bubble blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: var(--muted);
  margin: 8px 0;
}
.msg-assistant .msg-bubble a { color: var(--accent); text-decoration: underline; }

/* Status / thinking */
.status-text  { color: var(--muted); font-size: 13px; font-style: italic; }
.msg-error    { color: #E15759; font-size: 13px; }

/* Thinking dots */
.thinking-dots { display: inline-flex; gap: 3px; align-items: center; }
.thinking-dots span {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: tdot 1.2s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tdot {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40%           { opacity: 1;    transform: scale(1); }
}

/* Tool chips */
.tool-chip {
  align-self: flex-start;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(79,156,249,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: 0;
}

/* ── Input bar ────────────────────────────────────────────────────── */
.query-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  transition: border-color 0.15s;
  flex-shrink: 0;
  margin-top: 8px;
}
.query-input-bar:focus-within { border-color: var(--accent); }

.query-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 180px;
  min-height: 24px;
  font-family: inherit;
}
.query-input::placeholder { color: var(--muted); }
.query-input:disabled { opacity: 0.5; }

.query-send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}
.query-send svg { width: 16px; height: 16px; fill: var(--sponge-text); }
.query-send:hover  { background: var(--sponge-primary-hover); }
.query-send:hover svg { fill: #fff; }
.query-send:disabled { opacity: 0.4; cursor: default; }
.query-send.loading { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:0.5 } 50% { opacity:1 } }

.query-footer-note {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.6;
  text-align: center;
  margin-top: 8px;
  flex-shrink: 0;
}

/* ── Node page ────────────────────────────────────────────────────── */
.node-type-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid var(--border-2);
}
.node-icon-decision    { background: rgba(231,76,60,0.1);   color: #E74C3C; border-color: rgba(231,76,60,0.2); }
.node-icon-concept     { background: rgba(79,156,249,0.1);  color: #4f9cf9; border-color: rgba(79,156,249,0.2); }
.node-icon-company     { background: rgba(89,161,79,0.1);   color: #59A14F; border-color: rgba(89,161,79,0.2); }
.node-icon-skill       { background: rgba(78,205,196,0.1);  color: #4ECDC4; border-color: rgba(78,205,196,0.2); }
.node-icon-institution { background: rgba(242,142,43,0.1);  color: #F28E2B; border-color: rgba(242,142,43,0.2); }
.node-icon-role_type   { background: rgba(155,89,182,0.1);  color: #9B59B6; border-color: rgba(155,89,182,0.2); }
.node-icon-document    { background: rgba(148,163,184,0.1); color: var(--muted); }

.node-status {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.node-status-open   { background: rgba(242,142,43,0.15); color: #F28E2B; border: 1px solid rgba(242,142,43,0.25); }
.node-status-closed { background: rgba(78,205,196,0.12); color: #4ECDC4; border: 1px solid rgba(78,205,196,0.2); }

/* Project status pills (project node type, 2026-04-26) */
.node-status-prospective { background: rgba(241,196,15,0.15); color: #B8860B; border: 1px solid rgba(241,196,15,0.30); }
.node-status-active      { background: rgba(89,161,79,0.15);  color: #59A14F; border: 1px solid rgba(89,161,79,0.25); }
.node-status-paused      { background: rgba(149,165,166,0.15); color: #6B7B7C; border: 1px solid rgba(149,165,166,0.30); }
.node-status-done        { background: rgba(78,205,196,0.12); color: #4ECDC4; border: 1px solid rgba(78,205,196,0.2); }
.node-status-lost        { background: rgba(231,76,60,0.15); color: #E74C3C; border: 1px solid rgba(231,76,60,0.25); }

/* Decision options */
.node-options-card {
  background: var(--surface);
  border: 1px solid rgba(231,76,60,0.2);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.node-options-list { display: flex; flex-direction: column; gap: 10px; }
.node-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
}
.node-option-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #E74C3C;
  flex-shrink: 0;
}
.node-deadline {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-2);
}

/* Connection groups */
.node-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.node-group {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.node-group-count {
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.node-group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Connection cards */
.node-conn-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s;
  font-size: 13px;
}
a.node-conn-card:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.node-conn-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}
.node-conn-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-2);
}
.node-conn-person .node-conn-type { color: #E15759; background: rgba(225,87,89,0.08); border-color: rgba(225,87,89,0.15); }
.node-conn-doc    .node-conn-type { color: #9B59B6; background: rgba(155,89,182,0.08); border-color: rgba(155,89,182,0.15); }

.node-conn-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.node-conn-label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-conn-sub   { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-conn-arrow { font-size: 14px; color: var(--muted); flex-shrink: 0; }

.node-conn-other.node-conn-concept     { border-color: rgba(79,156,249,0.15); }
.node-conn-other.node-conn-skill       { border-color: rgba(78,205,196,0.15); }
.node-conn-other.node-conn-company     { border-color: rgba(89,161,79,0.15);  }
.node-conn-other.node-conn-institution { border-color: rgba(242,142,43,0.15); }
.node-conn-other.node-conn-decision    { border-color: rgba(231,76,60,0.15);  }

/* ── Skill chart: edit mode (Task 1) ──────────────────────────────── */

/* Edit toggle button */
.chart-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chart-edit-btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 11px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chart-edit-btn:hover {
  color: var(--text);
  border-color: var(--border);
}
.chart-edit-btn-active {
  background: var(--sponge-primary);
  color: var(--sponge-text);
  border-color: var(--sponge-primary);
}
.chart-edit-btn-active:hover {
  background: var(--sponge-primary-hover);
  color: #fff;
}

/* Edit-mode visual cue — subtle accent on group labels */
.chart-section.edit-mode .skill-group-label {
  color: var(--text);
}
.chart-section.edit-mode .skill-group {
  padding-left: 2px;
}

/* "+ Add skill" row */
.add-skill-row {
  display: flex;
  margin-top: 6px;
  padding-left: 11px; /* align with group label border */
}
.add-skill-btn {
  background: none;
  border: 1px dashed var(--border-2);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.add-skill-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Input row for a new skill */
.skill-input-row {
  display: grid;
  grid-template-columns: 180px 1fr 70px 32px;
  align-items: center;
  gap: 8px;
  padding: 6px 0 6px 11px;
  animation: skillFadeIn 0.15s ease-out;
}
.skill-input-row .skill-name-input {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.skill-input-row .skill-name-input::placeholder { color: var(--muted); }

.skill-input-row .skill-route-select {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.skill-input-row .skill-route-select:hover,
.skill-input-row .skill-route-select:focus { border-color: var(--accent); }

.skill-input-row .skill-confirm-btn {
  background: var(--sponge-primary);
  color: var(--sponge-text);
  border: none;
  border-radius: 6px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.skill-input-row .skill-confirm-btn:hover { background: var(--sponge-primary-hover); color: #fff; }

.skill-input-row .skill-cancel-btn {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}
.skill-input-row .skill-cancel-btn:hover {
  color: #E15759;
  border-color: rgba(225,87,89,0.3);
}

/* Newly added skill: soft highlight fade-in */
.skill-row-new {
  animation: skillFadeIn 0.25s ease-out;
}
@keyframes skillFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@media (max-width: 680px) {
  .skill-input-row { grid-template-columns: 120px 1fr 60px 28px; }
}

/* ── Skill chart: Task 2 (inline edit name + route) ──────────────── */

/* Edit-mode: signal editable name + route */
.chart-section.edit-mode .skill-name {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s, color 0.15s;
  padding-bottom: 1px;
}
.chart-section.edit-mode .skill-name:hover {
  border-bottom-color: var(--accent);
  color: #fff;
}

.chart-section.edit-mode .skill-route .route-badge,
.chart-section.edit-mode .skill-route .route-has {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.chart-section.edit-mode .skill-route .route-badge:hover,
.chart-section.edit-mode .skill-route .route-has:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Inline name edit */
.skill-name-edit-input {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  width: 100%;
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Inline route edit */
.skill-route-edit-select {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-dim);
  max-width: 100%;
}

/* ── Skill chart: Task 3 (draggable bar) ──────────────────────────── */
.chart-section.edit-mode .skill-bar-bg {
  cursor: col-resize;
  transition: box-shadow 0.15s;
}
.chart-section.edit-mode .skill-bar-bg:hover {
  box-shadow: 0 0 0 2px var(--accent-dim);
}

body.dragging-bar,
body.dragging-bar * { user-select: none; cursor: col-resize !important; }

.bar-drag-tooltip {
  position: fixed;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  display: none;
  font-variant-numeric: tabular-nums;
}
.bar-drag-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--accent);
}

/* ── Q1: clickable pills everywhere ──────────────────────────────── */
a.shared-item-link,
a.career-item-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
a.shared-item-link:hover,
a.career-item-link:hover {
  background: var(--accent-dim);
  border-color: rgba(79,156,249,0.15);
  border-radius: 6px;
  transform: translateX(2px);
}
.shared-item-label { flex: 1; }

a.skill-pill-link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
a.skill-pill-link:hover {
  background: rgba(78,205,196,0.18);
  color: #6fe0d6;
  border-color: rgba(78,205,196,0.35);
}

/* ── Q2: Notes section ───────────────────────────────────────────── */
.notes-section {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px 22px 22px;
  margin-bottom: 20px;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.notes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notes-status {
  font-size: 11px;
  color: var(--muted);
  transition: color 0.15s;
  font-variant-numeric: tabular-nums;
}
.notes-status.ok  { color: #4ECDC4; }
.notes-status.err { color: #E15759; }
.notes-status.muted { color: var(--muted); }

.notes-ts-btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.notes-ts-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.notes-textarea {
  width: 100%;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.65;
  font-family: 'SF Mono', 'Fira Mono', ui-monospace, Menlo, monospace;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.notes-textarea::placeholder {
  color: var(--muted);
  font-family: inherit;
  opacity: 0.7;
}
.notes-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Ingest page ──────────────────────────────────────────────────── */
.ingest-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.ingest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 10px;
}

.ingest-stats {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  gap: 6px;
}

.ingest-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.ingest-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ingest-control label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ingest-control select {
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.ingest-control select:hover,
.ingest-control select:focus { border-color: var(--accent); }

.mode-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.mode-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active {
  background: var(--accent);
  color: #fff;
}

.ingest-control-hint {
  font-size: 11px;
  color: var(--muted);
  flex: 1 1 100%;
  opacity: 0.75;
}

.ingest-textarea {
  width: 100%;
  min-height: 220px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.65;
  font-family: 'SF Mono', 'Fira Mono', ui-monospace, Menlo, monospace;
  color: var(--text);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ingest-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.ingest-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.ingest-actions-commit { margin-top: 24px; }
.ingest-status {
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s;
}
.ingest-status.ok  { color: #4ECDC4; }
.ingest-status.err { color: #E15759; }
.ingest-status.muted { color: var(--muted); }
.ingest-violations {
  margin: 8px 0 4px;
  padding-left: 20px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #E15759;
}
.ingest-violations li { margin-bottom: 2px; }

/* ── Ingest results ───────────────────────────────────────────────── */
.ingest-results {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border-2);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.results-header h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.results-usage {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.result-section {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.result-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-2);
}
.result-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.result-count {
  font-size: 11px;
  background: var(--bg);
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  font-variant-numeric: tabular-nums;
}
.result-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
}
.add-icon    { background: rgba(89,161,79,0.15);   color: #59A14F; }
.edge-icon   { background: rgba(79,156,249,0.15);  color: #4f9cf9; }
.update-icon { background: rgba(242,142,43,0.15);  color: #F28E2B; }
.warn-icon   { background: rgba(231,76,60,0.15);   color: #E74C3C; }

.select-all-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-2);
  color: var(--muted);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.select-all-btn:hover { color: var(--accent); border-color: var(--accent); }

.result-items { padding: 8px 0; }
.result-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: flex-start;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-2);
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: rgba(79,156,249,0.03); }

.result-item-warn {
  grid-template-columns: 1fr;
  background: rgba(231,76,60,0.05);
  border-left: 3px solid #E74C3C;
}

.ri-check {
  margin-top: 5px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ri-body { font-size: 13px; line-height: 1.5; }
.ri-title { font-size: 13px; }
.ri-title code {
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-2);
  font-family: 'SF Mono', 'Fira Mono', monospace;
}
.ri-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(79,156,249,0.15);
}
.ri-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.ri-attrs {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ri-attrs b { color: var(--text); font-weight: 600; }
.ri-edge code {
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Mono', monospace;
}
.ri-rel {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 7px;
  border-radius: 4px;
  margin: 0 6px;
  font-weight: 600;
}

/* ── Sponge home (2026-04-30) ─────────────────────────────────────── */
/* Foundation styles. Empty sections render as deliberate placeholders so
   the page doesn't look broken before Agent B (dashboard) and Agent C
   (input + topics) fill them. */

.sponge-home {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.sponge-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.sponge-header h1 {
  font-size: clamp(48px, 9vw, 88px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, var(--sponge-primary) 0%, var(--sponge-water) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sponge-header .tagline {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--sponge-primary);
  text-transform: lowercase;
}

/* Empty-state placeholders for sections B + C will fill. They render an
   unobtrusive shimmer so the page feels intentional before JS hydrates. */
.sponge-home section:empty {
  min-height: 56px;
  border: 1px dashed var(--accent-dim);
  border-radius: var(--radius);
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(201, 162, 39, 0.04) 50%,
      transparent 100%
    );
  background-size: 200% 100%;
  animation: sponge-shimmer 2.4s ease-in-out infinite;
}

#sponge-input:empty   { min-height: 80px; }
#sponge-topics:empty  { min-height: 48px; }
#sponge-dashboard:empty { min-height: 96px; }

@keyframes sponge-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 680px) {
  .sponge-home { padding: 40px 16px 60px; gap: 28px; }
}

/* === SPONGE DASHBOARD WIDGETS (Agent B) === */
.sponge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}

.sponge-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 14px;
  background: var(--sponge-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--sponge-text);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

a.sponge-widget:hover {
  border-color: var(--sponge-water);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(58, 107, 140, 0.12);
}

.widget-count {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--sponge-primary);
  font-variant-numeric: tabular-nums;
}

.widget-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(42, 42, 42, 0.65);
  margin-top: 8px;
  text-align: center;
}

.widget-ok  { color: #59A14F; }
.widget-err { color: #E15759; }

.sponge-widget-error {
  padding: 16px;
  text-align: center;
  color: rgba(42, 42, 42, 0.6);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (max-width: 480px) {
  .sponge-grid { grid-template-columns: repeat(2, 1fr); }
  .widget-count { font-size: 24px; }
}
/* === END SPONGE DASHBOARD WIDGETS === */


/* === SPONGE INPUT + TOPICS (Agent C) === */
.sponge-input-form {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin: 0;
}

.sponge-input-form textarea {
  flex: 1;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.5;
  padding: 16px 18px;
  border: 2px solid var(--sponge-water);
  border-radius: var(--radius);
  background: var(--sponge-bg);
  color: var(--sponge-text);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sponge-input-form textarea::placeholder {
  color: rgba(42, 42, 42, 0.5);
}

.sponge-input-form textarea:focus {
  border-color: var(--sponge-primary);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
}

.sponge-submit {
  background: var(--sponge-primary);
  color: var(--sponge-text);
  border: none;
  border-radius: var(--radius);
  padding: 0 24px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.sponge-submit:hover { background: var(--sponge-primary-hover); }
.sponge-submit:active { transform: translateY(1px); }

.sponge-response {
  margin-top: 14px;
  min-height: 0;
}

.sponge-response-active {
  padding: 16px 18px;
  background: var(--sponge-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--sponge-text);
  min-height: 60px;
}

.sponge-response-status {
  font-style: italic;
  color: rgba(42, 42, 42, 0.65);
}

.sponge-response-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sponge-tool-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--sponge-accent);
  border-radius: 999px;
  font-size: 12px;
  color: var(--sponge-text);
}

.sponge-response-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--sponge-text);
}

.sponge-response-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(58, 107, 140, 0.35);
  color: rgba(42, 42, 42, 0.6);
  font-size: 12px;
}

.sponge-response-footer a { color: var(--sponge-water); text-decoration: none; }
.sponge-response-footer a:hover { text-decoration: underline; }

.sponge-response-error {
  color: #c0392b;
  font-size: 14px;
}

.sponge-chips-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

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

.sponge-chip {
  background: var(--sponge-accent);
  color: var(--sponge-text);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.sponge-chip:hover {
  background: var(--sponge-primary);
  border-color: var(--sponge-primary-hover);
}

.sponge-chip:active { transform: translateY(1px); }

.sponge-chips-empty,
.sponge-chips-error {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

@media (max-width: 480px) {
  .sponge-input-form { flex-direction: column; }
  .sponge-submit { padding: 12px 24px; }
}
/* === END SPONGE INPUT + TOPICS === */


/* === AGENT A: SPONGE SEARCH BAR === */
/* Centred search-bar (~700px) with voice-memo banner above. Compacts the
   dashboard widgets so they sit above the bar without dominating, and
   re-targets the inline response at the new top-level #sponge-response. */

.sponge-home { gap: 24px; }

.sponge-home .sponge-widget        { padding: 14px 12px; }
.sponge-home .widget-count         { font-size: 22px; }
.sponge-home .widget-label         { margin-top: 4px; font-size: 10px; }
.sponge-home .sponge-grid          { gap: 10px; }

.sponge-search-wrap {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#sponge-voice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--sponge-accent);
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 14px;
  font-size: 13px;
  color: var(--sponge-text);
  cursor: pointer;
  animation: sponge-banner-slide 0.18s ease-out;
}
#sponge-voice-banner[hidden] { display: none; }
#sponge-voice-banner:hover { border-color: var(--sponge-primary); }
.sponge-banner-text  { flex: 1; }
.sponge-banner-hint  { font-size: 11px; color: rgba(42,42,42,0.55); }
@keyframes sponge-banner-slide {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

#sponge-search-form { width: 100%; margin: 0; }

#sponge-search-input {
  width: 100%;
  min-height: 56px;
  max-height: 280px;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.45;
  padding: 16px 22px;
  border: 2px solid var(--sponge-water);
  border-radius: 28px;
  background: var(--sponge-bg);
  color: var(--sponge-text);
  resize: none;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow-y: auto;
}
#sponge-search-input::placeholder { color: rgba(42,42,42,0.45); }
#sponge-search-input:focus {
  border-color: var(--sponge-water);
  box-shadow: 0 0 0 4px rgba(58, 107, 140, 0.18);
}
#sponge-search-input.sponge-input-active {
  border-color: var(--sponge-primary);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.20);
}
#sponge-search-form button[type="submit"] { display: none; }

#sponge-response { max-width: 700px; margin: 0 auto; width: 100%; }
/* === END AGENT A === */

/* === SUB-05: CHAT UI === */
/* iMessage-style bubble stream: user right / assistant left / card full-width. */

#chat-stream {
  width: 100%;
  max-width: 700px;
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 60vh;
  scroll-behavior: smooth;
  padding: 0 4px 12px;
}
#chat-stream[hidden] { display: none; }

.chat-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 75%;
  word-break: break-word;
  line-height: 1.5;
  font-size: 15px;
  user-select: text;
  -webkit-user-select: text;
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--sponge-water);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble--assistant {
  align-self: flex-start;
  background: var(--surface-2, #1a2433);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-bubble--status {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 8px;
  max-width: 100%;
}

/* Card bubble: full-width, sponge-blue accent border-left. */
.chat-bubble--card {
  align-self: stretch;
  max-width: 100%;
  background: #fff;
  color: var(--sponge-text);
  border-left: 4px solid var(--sponge-water);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-bubble--card:hover { background: #f5f8fb; }

.card-title    { display: block; font-weight: 600; font-size: 14px; color: #1a1a2e; }
.card-subtitle { display: block; font-size: 12px; color: #666; margin-top: 2px; }
.card-link     { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--sponge-water); text-decoration: underline; }
.card-edges    { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: #444; }
.card-no-edges { font-size: 12px; color: #888; }
.card-detail   { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e0e0e0; }

/* Inline status / error annotations inside bubbles. */
.bubble-status  { color: var(--muted); font-style: italic; }
.bubble-error   { color: var(--red); }
.bubble-provisional {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--muted);
}
.bubble-provisional a { color: var(--accent); }

/* Long-press copy button. */
.bubble-copy-btn {
  position: absolute;
  top: -26px;
  right: 0;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
}

/* Mic button — positioned inside the form via absolute. */
#mic-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--sponge-water);
  background: var(--sponge-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
  /* Microphone icon via SVG mask — no emoji, no image file. */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.93V20H9v2h6v-2h-2v-2.07A7 7 0 0 0 19 11h-2z'/%3E%3C/svg%3E") center/20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.93V20H9v2h6v-2h-2v-2.07A7 7 0 0 0 19 11h-2z'/%3E%3C/svg%3E") center/20px no-repeat;
  background-color: var(--sponge-water);
}
#mic-button.mic-recording {
  background-color: var(--red);
  border-color: var(--red);
  animation: mic-pulse 0.8s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 87, 89, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(225, 87, 89, 0); }
}

/* Form needs relative positioning for the absolute mic button. */
#sponge-search-form { position: relative; }
#sponge-search-input { padding-right: 52px; }

/* Desktop: narrower max-width on bubbles (60%). */
@media (min-width: 768px) {
  .chat-bubble { max-width: 60%; }
  .chat-bubble--card { max-width: 100%; }
}

/* Mobile: safe-area padding at bottom. */
@media (max-width: 767px) {
  #sponge-search-form {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}
/* === END SUB-05 === */


/* === SUB-04: MOBILE SCAFFOLD === */
/* PWA / mobile shell: viewport-fit=cover safe-area insets, mobile-first
   responsive layout at <=768px (compact dashboard → horizontal scroll row,
   topic chips behind a "Topics" pill, full-width search), terminal-mode
   toggle (top-right glyph) that swaps in a fixed code-stream <pre>. */

/* Safe-area insets — top/bottom padding only, so wide-element layout is
   untouched. Inner gutters use safe-area-inset-left/right where needed. */
body {
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  /* Defensive: explicit text-select on body so iMessage chat-bubble copy/paste
     doesn't lose long-press menu in Mobile Safari. Sub-05's bubbles inherit. */
  -webkit-user-select: text;
          user-select: text;
}

/* Terminal toggle — fixed top-right; sits clear of the nav. */
#sponge-terminal-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0) + 12px);
  right: calc(env(safe-area-inset-right, 0) + 12px);
  z-index: 250;
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: var(--surface-2);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 17px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  /* Disable iOS tap highlight + double-tap zoom. */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#sponge-terminal-toggle:hover {
  background: var(--accent-dim);
  transform: rotate(45deg);
}

#sponge-terminal-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
}

/* Terminal stream — hidden by default; revealed when body.terminal-mode is set.
   Native [hidden] handles the JS-off case; body class wins via specificity. */
#sponge-terminal-stream {
  display: none;
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0) + 16px);
  left: max(16px, env(safe-area-inset-left, 0));
  right: max(16px, env(safe-area-inset-right, 0));
  max-height: 38vh;
  overflow-y: auto;
  margin: 0;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  background: rgba(7, 11, 20, 0.96);
  color: var(--teal);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 240;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  backdrop-filter: blur(8px);
}

body.terminal-mode #sponge-terminal-stream {
  display: block;
}

/* Mobile breakpoint — match the brief's 768px threshold. */
@media (max-width: 768px) {
  /* Search-bar: full-width minus modest gutters, prevent iOS zoom-on-focus. */
  .sponge-home .sponge-search-wrap {
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }

  .sponge-home #sponge-search-form {
    width: 100%;
  }

  .sponge-home #sponge-search-input {
    /* iOS Safari auto-zooms inputs <16px on focus; explicit 16px stops it. */
    font-size: 16px;
  }

  /* Compact dashboard — collapse the 2x2 grid into a horizontal scroll row. */
  .sponge-home #sponge-dashboard .sponge-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding: 4px 16px 8px;
    margin: 0 -16px;
    -webkit-overflow-scrolling: touch;
  }

  .sponge-home #sponge-dashboard .sponge-widget {
    flex: 0 0 auto;
    min-width: 132px;
    scroll-snap-align: start;
  }

  /* Topics: hidden behind a "Topics" pill until tapped. JS toggles
     .sub04-topics-open on the wrapper; the chevron flips. */
  .sponge-home #sponge-topics {
    position: relative;
    padding: 6px 16px 0;
  }

  .sponge-home #sponge-topics:not(.sub04-topics-open) .sponge-chips,
  .sponge-home #sponge-topics:not(.sub04-topics-open) .sponge-chips-label,
  .sponge-home #sponge-topics:not(.sub04-topics-open) .sponge-chips-empty,
  .sponge-home #sponge-topics:not(.sub04-topics-open) .sponge-chips-error {
    display: none;
  }

  .sponge-home #sponge-topics::before {
    content: "Topics ▾";
    display: inline-block;
    padding: 6px 14px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--border-2);
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .sponge-home #sponge-topics.sub04-topics-open::before {
    content: "Topics ▴";
    color: var(--accent);
    background: var(--accent-dim);
  }

  /* Header tightens. */
  .sponge-home .sponge-header h1 { font-size: 32px; }
  .sponge-home .sponge-header .tagline { font-size: 14px; }

  /* Top-right toggle moves slightly inboard on small viewports. */
  #sponge-terminal-toggle {
    top: calc(env(safe-area-inset-top, 0) + 8px);
    right: calc(env(safe-area-inset-right, 0) + 8px);
    width: 36px;
    height: 36px;
  }
}

/* === END SUB-04 === */


/* === MASTER 2026-05-02: dashboard collapse === */
.sponge-dashboard-wrap {
  margin-bottom: 0.75rem;
}
.sponge-dashboard-summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7480;
  padding: 0.4rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: color 0.15s ease;
}
.sponge-dashboard-summary:hover { color: #2f3a48; }
.sponge-dashboard-summary::-webkit-details-marker { display: none; }
.sponge-dashboard-summary::marker { content: ""; }
.sponge-dashboard-chevron { transition: transform 0.2s ease; }
.sponge-dashboard-wrap:not([open]) .sponge-dashboard-chevron { transform: rotate(-90deg); }
.sponge-dashboard-wrap[open] #sponge-dashboard { padding-top: 0.5rem; }
/* === END MASTER === */

/* === MASTER 2026-05-02: terminal/chat mutual exclusion === */
/* iMessage mode (default): show chat, hide terminal stream (already display:none baseline). */
/* Terminal mode: hide chat-stream entirely, terminal stream becomes flowing content not a fixed overlay. */
body.terminal-mode #chat-stream { display: none; }
body.terminal-mode #sponge-terminal-stream {
  position: static;
  margin: 1rem 16px calc(env(safe-area-inset-bottom, 0) + 1rem);
  max-height: none;
  min-height: 60vh;
  left: auto;
  right: auto;
  bottom: auto;
}
/* Make the toggle button more discoverable on mobile — slightly larger hit-target */
@media (max-width: 768px) {
  #sponge-terminal-toggle {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }
}
/* === END MASTER === */

/* === MASTER 2026-05-02 (later): nav menu z-index above terminal toggle === */
/* Terminal toggle is fixed top-right at z-index:250. When the mobile burger
   menu opens, it must overlay the toggle — bumping nav-links to z-index:300
   on mobile (overlay context only). */
@media (max-width: 768px) {
  .nav-links.open {
    z-index: 300;
  }
  /* Hide the toggle entirely when the nav overlay is open so it does not
     compete for thumb-target on tiny screens. */
  body:has(.nav-links.open) #sponge-terminal-toggle { display: none; }
}
/* === END MASTER === */

/* === SUB-13: REAL TERMINAL FEED ===
   Mirrors Sub-04's #sponge-terminal-stream layout but with a cyan border
   (vs Sub-04's var(--border)) to signal "live data". Hidden by default;
   JS shows it when the SSE feed connects successfully and hides Sub-04's mock. */
#sponge-terminal-real {
  display: none;
  margin: 0;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  background: rgba(7, 11, 20, 0.96);
  color: var(--teal);
  border: 1px solid #00bcd4;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  backdrop-filter: blur(8px);
}

/* In terminal mode: show the real feed (not the mock). The real feed takes the
   same flowing-content position that Sub-04's stream occupies. */
body.terminal-mode #sponge-terminal-real {
  display: block;
  position: static;
  margin: 1rem 16px calc(env(safe-area-inset-bottom, 0) + 1rem);
  max-height: none;
  min-height: 60vh;
}

/* When real feed is active, hide Sub-04's mock. JS adds .sub13-real-active to
   <body> once the EventSource connects and emits its first line. */
body.sub13-real-active #sponge-terminal-stream { display: none !important; }
/* === END SUB-13 === */
