/* HALO Community & TESI Enterprise Portal Stylesheet
 * Neutral slate & cobalt-azure visual system harmonizing with TESI Light/Dark appearance tokens.
 */
@font-face {
  font-family: Geist;
  src: url('/assets/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Mono;
  src: url('/assets/geist-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --halo-bg: #f8fafc;
  --halo-rail: #f1f5f9;
  --halo-surface: #ffffff;
  --halo-surface-2: #f8fafc;
  --halo-tint: #f1f5f9;
  --halo-tint-strong: #e2e8f0;
  --halo-ink: #0f172a;
  --halo-ink-soft: #334155;
  --halo-muted: #475569;
  --halo-line: #e2e8f0;
  --halo-line-strong: #cbd5e1;
  --halo-accent: #2563eb;
  --halo-accent-hover: #1d4ed8;
  --halo-accent-soft: #eff6ff;
  --halo-accent-border: #bfdbfe;
  --halo-accent-ink: #1e40af;
  --halo-on-accent: #ffffff;
  --halo-enterprise: #4f46e5;
  --halo-enterprise-soft: #eef2ff;
  --halo-enterprise-border: #c7d2fe;
  --halo-enterprise-ink: #312e81;
  --halo-danger: #b42334;
  --halo-danger-soft: #fff1f2;
  --halo-danger-border: #fecdd3;
  --halo-danger-ink: #881337;
  --halo-warn: #b45309;
  --halo-warn-soft: #fff7ed;
  --halo-warn-border: #fed7aa;
  --halo-warn-ink: #7c2d12;
  --halo-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 14px 36px rgba(15, 23, 42, 0.06);
  --halo-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --halo-ring: #2563eb;
  --halo-radius: 12px;
  --halo-radius-sm: 8px;
  --halo-radius-pill: 999px;
}

html[data-tesi-theme="dark"] {
  color-scheme: dark;
  --halo-bg: #0a0e17;
  --halo-rail: #0d121f;
  --halo-surface: #111827;
  --halo-surface-2: #182235;
  --halo-tint: #182235;
  --halo-tint-strong: #23304a;
  --halo-ink: #f1f5f9;
  --halo-ink-soft: #cbd5e1;
  --halo-muted: #94a3b8;
  --halo-line: #1e293b;
  --halo-line-strong: #334155;
  --halo-accent: #60a5fa;
  --halo-accent-hover: #93c5fd;
  --halo-accent-soft: #172554;
  --halo-accent-border: #1e40af;
  --halo-accent-ink: #dbeafe;
  --halo-on-accent: #091326;
  --halo-enterprise: #a5b4fc;
  --halo-enterprise-soft: #1e1b4b;
  --halo-enterprise-border: #3730a3;
  --halo-enterprise-ink: #e0e7ff;
  --halo-danger: #f87171;
  --halo-danger-soft: #2f1419;
  --halo-danger-border: #7f1d1d;
  --halo-danger-ink: #fecaca;
  --halo-warn: #fb923c;
  --halo-warn-soft: #2b180c;
  --halo-warn-border: #7c2d12;
  --halo-warn-ink: #fed7aa;
  --halo-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 18px 42px rgba(0, 0, 0, 0.42);
  --halo-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --halo-ring: #60a5fa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  background: var(--halo-bg);
  color: var(--halo-ink);
  font: 400 15px/1.55 Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--halo-ring); outline-offset: 2px; }
code, pre, .mono { font-family: Mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code:not(pre code) { padding: 0 4px; line-height: inherit; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 14px;
  background: var(--halo-surface);
  color: var(--halo-ink);
  border: 1px solid var(--halo-line-strong);
  border-radius: var(--halo-radius-sm);
  z-index: 200;
}
.skip-link:focus { left: 16px; }
[hidden] { display: none !important; }

/* ---- Coherent HALO Topbar (/halo, /halo/missions, /orgs, /halo/workspace) ---- */
.halo-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  min-height: 64px;
  height: 64px;
  background: var(--halo-surface);
  border-bottom: 1px solid var(--halo-line);
}
.halo-workspace-body .halo-topbar {
  min-height: 56px;
  height: 56px;
}
.halo-topbar-inner {
  width: min(1180px, calc(100% - 48px));
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}
.halo-workspace-body .halo-topbar-inner {
  width: 100%;
  max-width: none;
  padding: 0 20px;
  height: 56px;
}
.halo-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: none;
}
.halo-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--halo-ink);
  white-space: nowrap;
  text-decoration: none;
}
.halo-brand:hover { text-decoration: none; }
.halo-brand-mark { width: 31px; height: 26px; display: block; flex: none; }
.halo-footer .halo-brand-mark { width: 24px; height: 20px; }
html[data-tesi-theme="dark"] .halo-brand-mark { filter: invert(1) brightness(1.15); }

.halo-beta-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-tint);
  color: var(--halo-ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
}

.halo-product-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--halo-radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--halo-accent-soft);
  color: var(--halo-accent-ink);
  border: 1px solid var(--halo-accent-border);
  white-space: nowrap;
}
.halo-product-pill.enterprise {
  background: var(--halo-enterprise-soft);
  color: var(--halo-enterprise-ink);
  border-color: var(--halo-enterprise-border);
}

.halo-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  min-width: 0;
}
.halo-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--halo-ink-soft);
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.halo-nav a:hover {
  background: var(--halo-tint);
  color: var(--halo-ink);
  text-decoration: none;
}
.halo-nav a[aria-current="page"] {
  background: var(--halo-accent-soft);
  color: var(--halo-accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.halo-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: none;
}
.halo-auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.halo-signin-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--halo-ink-soft);
  white-space: nowrap;
  text-decoration: none;
}
.halo-signin-link:hover {
  background: var(--halo-tint);
  color: var(--halo-ink);
  text-decoration: none;
}
.halo-get-cta {
  font-weight: 600;
}

.halo-theme-btn,
.halo-theme-select {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface-2);
  color: var(--halo-ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.halo-theme-btn:hover {
  background: var(--halo-tint);
  border-color: var(--halo-ink-soft);
}

/* Pure-black translucent obsidian glass variant on /halo eclipse stage */
.halo-topbar-eclipse {
  background: rgba(0, 0, 0, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.halo-topbar-eclipse .halo-brand {
  color: #f8fafc;
}
.halo-topbar-eclipse .halo-brand-mark {
  filter: invert(1) brightness(1.15);
}
.halo-topbar-eclipse .halo-beta-pill {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}
.halo-topbar-eclipse .halo-nav a {
  color: #cbd5e1;
}
.halo-topbar-eclipse .halo-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.halo-topbar-eclipse .halo-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.halo-topbar-eclipse .halo-theme-btn {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.32);
  color: #e2e8f0;
}
.halo-topbar-eclipse .halo-theme-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.5);
  color: #ffffff;
}
.halo-topbar-eclipse .halo-signin-link {
  color: #e2e8f0;
}
.halo-topbar-eclipse .halo-signin-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.halo-topbar-eclipse .halo-get-cta {
  background: #60a5fa;
  border-color: #60a5fa;
  color: #091326;
}
.halo-topbar-eclipse .halo-get-cta:hover:not(:disabled) {
  background: #93c5fd;
  border-color: #93c5fd;
  color: #091326;
}
.halo-topbar-eclipse .halo-computer-link {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.34);
  color: #f1f5f9;
}
.halo-topbar-eclipse .halo-computer-link:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.55);
  color: #ffffff;
}
.halo-topbar-eclipse .halo-account-chip {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.32);
  color: #f1f5f9;
}

.halo-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-line);
  background: var(--halo-tint);
  color: var(--halo-ink);
  font-size: 12.5px;
  font-weight: 500;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.halo-account-chip:hover {
  border-color: var(--halo-line-strong);
  text-decoration: none;
}

/* ---- Buttons & Badges ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--halo-radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--halo-accent); border-color: var(--halo-accent); color: var(--halo-on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--halo-accent-hover); border-color: var(--halo-accent-hover); }
.btn-secondary { background: var(--halo-surface); border-color: var(--halo-line-strong); color: var(--halo-ink); }
.btn-secondary:hover:not(:disabled) { background: var(--halo-tint); border-color: var(--halo-ink-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--halo-ink-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--halo-tint); color: var(--halo-ink); }
.btn-subtle { background: var(--halo-surface-2); border-color: var(--halo-line); color: var(--halo-ink-soft); }
.btn-subtle:hover:not(:disabled) { background: var(--halo-tint); border-color: var(--halo-line-strong); color: var(--halo-ink); }
.btn-danger { background: var(--halo-danger-soft); border-color: var(--halo-danger-border); color: var(--halo-danger-ink); }
.btn-danger:hover:not(:disabled) { background: var(--halo-danger); border-color: var(--halo-danger); color: #ffffff; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--halo-radius-pill);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--halo-line);
  background: var(--halo-tint);
  color: var(--halo-ink-soft);
  white-space: nowrap;
}
.badge-blue { background: var(--halo-accent-soft); border-color: var(--halo-accent-border); color: var(--halo-accent-ink); }
.badge-enterprise { background: var(--halo-enterprise-soft); border-color: var(--halo-enterprise-border); color: var(--halo-enterprise-ink); }
.badge-warn { background: var(--halo-warn-soft); border-color: var(--halo-warn-border); color: var(--halo-warn-ink); }
.badge-danger { background: var(--halo-danger-soft); border-color: var(--halo-danger-border); color: var(--halo-danger-ink); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--halo-accent); display: inline-block; flex: none; }
.status-dot.muted { background: var(--halo-muted); }
.status-dot.warn { background: var(--halo-warn); }
.status-dot.danger { background: var(--halo-danger); }

/* ---- 3-State Segmented Pill Controls (Zero-Green Semantics) ---- */
.seg-control {
  display: inline-flex;
  align-items: center;
  background: var(--halo-tint);
  border: 1px solid var(--halo-line-strong);
  border-radius: var(--halo-radius-sm);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.seg-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--halo-muted);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.seg-btn:hover:not(:disabled):not(.active) { background: var(--halo-surface); color: var(--halo-ink); }
.seg-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.seg-btn.active.state-enabled {
  background: var(--halo-accent);
  border-color: var(--halo-accent);
  color: var(--halo-on-accent);
  font-weight: 600;
}
.seg-btn.active.state-ask {
  background: var(--halo-accent-soft);
  border-color: var(--halo-accent);
  color: var(--halo-accent-ink);
  font-weight: 600;
}
.seg-btn.active.state-disabled {
  background: var(--halo-tint-strong);
  border-color: var(--halo-line-strong);
  color: var(--halo-ink);
  font-weight: 600;
}

/* ---- Hub Layout (/halo and /orgs) ---- */
.halo-wrap { max-width: 1260px; margin: 0 auto; padding: 32px 24px 72px; }
.halo-hero {
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  border-radius: 18px;
  padding: 36px;
  box-shadow: var(--halo-shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 36px;
}
.halo-hero > * { min-width: 0; }
.halo-hero-elevated {
  background: radial-gradient(circle at 88% 12%, rgba(37, 99, 235, 0.08), transparent 46%), var(--halo-surface);
}
html[data-tesi-theme="dark"] .halo-hero-elevated {
  background: radial-gradient(circle at 88% 12%, rgba(96, 165, 250, 0.12), transparent 46%), var(--halo-surface);
}
.halo-eyebrow {
  font: 600 12px/1.4 Mono, ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--halo-accent);
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.halo-hero h1 {
  font-size: clamp(32px, 3.8vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--halo-ink);
}
.halo-lead { font-size: 16.5px; line-height: 1.55; color: var(--halo-muted); margin: 0 0 22px; max-width: 640px; }
.halo-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.hero-proof-strip { display: flex; flex-wrap: wrap; gap: 8px; }

.halo-arch-card {
  background: var(--halo-surface-2);
  border: 1px solid var(--halo-line);
  border-radius: 14px;
  padding: 18px;
}
.arch-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.halo-arch-card h2 { font-size: 14.5px; font-weight: 600; margin: 0; color: var(--halo-ink); }
.halo-arch-layers { display: flex; flex-direction: column; gap: 8px; }
.halo-arch-layer {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.halo-arch-layer.interactive-layer { justify-content: flex-start; }
.halo-arch-layer.interactive-layer:hover { border-color: var(--halo-accent-border); transform: translateY(-1px); }
.arch-layer-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--halo-accent-soft);
  color: var(--halo-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.arch-layer-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.halo-arch-layer strong { color: var(--halo-ink); font-weight: 600; }
.halo-arch-layer span { color: var(--halo-muted); font-size: 12px; }

.halo-section-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 32px 0 16px;
}
.halo-section-bar h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; margin: 0; }
.section-sub { margin: 4px 0 0; font-size: 14px; color: var(--halo-muted); }
.halo-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.halo-input, .halo-select, .halo-textarea {
  padding: 9px 12px;
  border-radius: var(--halo-radius-sm);
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface);
  color: var(--halo-ink);
  font-size: 14px;
  min-width: 0;
}
.halo-input:focus, .halo-select:focus, .halo-textarea:focus {
  border-color: var(--halo-accent);
  outline: 2px solid var(--halo-ring);
  outline-offset: -1px;
}
.table-scroll { width: 100%; overflow-x: auto; max-width: 100%; }

.halo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.halo-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }

.halo-card {
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--halo-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.halo-card:hover { border-color: var(--halo-accent-border); }
.halo-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.halo-card h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--halo-ink); }
.halo-card p { margin: 0; font-size: 14px; color: var(--halo-muted); }
.halo-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--halo-line); }
.halo-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Blueprint cards */
.bp-kicker-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bp-comp-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.bp-highlights { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--halo-ink-soft); display: flex; flex-direction: column; gap: 4px; }
.bp-meta-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bp-subhead { margin: 14px 0 8px; font-size: 14px; font-weight: 600; }
.bp-tree-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bp-tree-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  font-size: 13.5px;
}
.bp-tree-item.depth-1 { margin-left: 14px; }
.bp-tree-item.depth-2 { margin-left: 28px; }
.bp-tree-desc { font-size: 12.5px; color: var(--halo-muted); margin-top: 2px; }
.muted-inline { color: var(--halo-muted); font-size: 12.5px; }

/* Full-width enterprise sign-in / launch banner */
.orgs-signin-banner {
  background: var(--halo-surface);
  border: 1px solid var(--halo-accent-border);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: var(--halo-shadow-sm);
}
.orgs-signin-banner strong { display: block; font-size: 16px; margin-bottom: 4px; }
.orgs-signin-banner p { margin: 0; font-size: 14px; color: var(--halo-muted); }

/* 4-Pillar Comparison Cards */
.comparison-tagline { font-size: 13.5px; color: var(--halo-ink-soft); font-weight: 500; }
.comparison-box { padding: 11px 13px; border-radius: 10px; border: 1px solid var(--halo-line); display: flex; flex-direction: column; gap: 4px; }
.comparison-box.tesi { background: var(--halo-accent-soft); border-color: var(--halo-accent-border); }
.comparison-box.standard { background: var(--halo-surface-2); }
.comparison-box p { margin: 0; font-size: 13.5px; color: var(--halo-ink-soft); }

/* Interactive 5-Department Enterprise Architecture Preview */
.dept-preview-shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.dept-tabs-col { display: flex; flex-direction: column; gap: 8px; }
.dept-tab-card {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dept-tab-card:hover { border-color: var(--halo-accent-border); background: var(--halo-surface-2); }
.dept-tab-card[aria-selected="true"] {
  border-color: var(--halo-accent);
  background: var(--halo-accent-soft);
}
.dept-tab-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.dept-tab-path { font-size: 12px; color: var(--halo-muted); }
.dept-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dept-detail-box {
  background: var(--halo-surface-2);
  border: 1px solid var(--halo-line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Interactive Sales TESI vs HR TESI Sandbox ---- */
.sandbox-section {
  margin-top: 40px;
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--halo-shadow);
}
.sandbox-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sandbox-header h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.025em; }
.sandbox-subtitle { margin: 0; font-size: 14px; color: var(--halo-muted); max-width: 720px; }
.sandbox-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.sandbox-role-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sandbox-role-pill {
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface-2);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sandbox-role-pill:hover { border-color: var(--halo-accent); }
.sandbox-role-pill[aria-selected="true"] {
  background: var(--halo-accent-soft);
  border-color: var(--halo-accent);
  color: var(--halo-accent-ink);
  font-weight: 600;
}
.sandbox-role-tag { font-size: 11px; color: var(--halo-muted); }

.sandbox-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.sandbox-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sandbox-panel {
  background: var(--halo-surface-2);
  border: 1px solid var(--halo-line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.sandbox-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sandbox-panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sandbox-meta-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.sandbox-brief-list { display: flex; flex-direction: column; gap: 8px; }
.sandbox-comp-chip {
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sandbox-comp-chip.grant { border-color: var(--halo-enterprise-border); }
.sandbox-comp-chip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }

.sandbox-probe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sandbox-probe-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.sandbox-probe-btn:hover { border-color: var(--halo-accent); transform: translateY(-1px); }
.sandbox-probe-result {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sandbox-probe-result.allowed { border-color: var(--halo-accent-border); background: var(--halo-accent-soft); }
.sandbox-probe-result.denied { border-color: var(--halo-danger-border); background: var(--halo-danger-soft); }
.sandbox-probe-result.asking { border-color: var(--halo-enterprise-border); background: var(--halo-enterprise-soft); }
.sandbox-disclaimer { margin: 6px 0 0; font-size: 12px; color: var(--halo-muted); }
.sandbox-comp-chip.revoked { opacity: 0.72; border-style: dashed; border-color: var(--halo-danger-border); }
.sandbox-approval-card {
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-enterprise-border);
  background: var(--halo-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sandbox-grant-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sandbox-probe-quote { margin: 0; font-size: 13.5px; color: var(--halo-ink); }
.sandbox-trace-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--halo-ink-soft); display: flex; flex-direction: column; gap: 3px; }

.sandbox-tool-hint { margin: 0; font-size: 13px; color: var(--halo-muted); }
.sandbox-tools-list { display: flex; flex-direction: column; gap: 8px; }
.sandbox-tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  flex-wrap: wrap;
}
.sandbox-tool-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 200px; }
.sandbox-tool-title-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.sandbox-tool-desc { font-size: 12px; color: var(--halo-muted); }

.sandbox-audit-list { display: flex; flex-direction: column; gap: 6px; }
.sandbox-audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.sandbox-audit-msg { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.sandbox-audit-hash { font-size: 11.5px; color: var(--halo-muted); }

/* 3-Step Org Wizard */
.wizard-stepper { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-step-pill {
  flex: 1 1 140px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.wizard-step-pill[aria-selected="true"] {
  background: var(--halo-accent-soft);
  border-color: var(--halo-accent);
  color: var(--halo-accent-ink);
  font-weight: 600;
}
.wizard-dept-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wizard-dept-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  flex-wrap: wrap;
}

.halo-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.halo-info-box { background: var(--halo-surface); border: 1px solid var(--halo-line); border-radius: 14px; padding: 20px; }
.halo-info-box h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.halo-info-box p { margin: 0; font-size: 14px; color: var(--halo-muted); }

/* ---- Unified Project & Department Workspace ---- */
.halo-workspace-body { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.ws-shell { flex: 1 1 0%; min-height: 0; display: grid; grid-template-columns: 304px minmax(0, 1fr); overflow: hidden; }
.ws-rail {
  background: var(--halo-rail);
  border-right: 1px solid var(--halo-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 32px;
  gap: 14px;
}
.ws-rail-section { background: var(--halo-surface); border: 1px solid var(--halo-line); border-radius: 12px; padding: 12px; }
.ws-rail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--halo-muted);
  margin: 0 0 10px;
}
.ws-rail-title > span:first-child {
  white-space: nowrap;
  flex-shrink: 0;
}
#scope-role-badge {
  max-width: 154px;
  font-size: 10px;
  padding: 2px 7px;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comp-tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.comp-tree-child { position: relative; }
.comp-node-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--halo-ink);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.comp-node-btn:hover { background: var(--halo-tint); }
.comp-node-btn[aria-current="true"] {
  background: var(--halo-accent-soft);
  border-color: var(--halo-accent-border);
  color: var(--halo-accent-ink);
  font-weight: 600;
}
.comp-node-btn.depth-1 { padding-left: 18px; border-left: 2px solid var(--halo-line-strong); }
.comp-node-btn.depth-2 { padding-left: 28px; border-left: 2px solid var(--halo-line-strong); }
.comp-node-btn.depth-3 { padding-left: 38px; border-left: 2px solid var(--halo-line-strong); }
.comp-node-name { flex: 1 1 0%; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.comp-node-btn .badge { flex: none; }

.scope-list { display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.scope-subtitle { margin: -4px 0 10px; font-size: 12px; color: var(--halo-muted); }
.scope-row { display: flex; flex-direction: column; gap: 4px; padding-top: 7px; border-top: 1px solid var(--halo-line); }
.scope-row:first-child { padding-top: 0; border-top: 0; }
.scope-label { font-size: 11px; font-weight: 600; color: var(--halo-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.scope-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.scope-chips .badge { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.scope-summary-line { font-size: 12.5px; line-height: 1.45; color: var(--halo-ink-soft); font-weight: 500; overflow-wrap: anywhere; }

.copy-pill-btn {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-tint);
  color: var(--halo-ink-soft);
  font-size: 11.5px;
  cursor: pointer;
}
.copy-pill-btn:hover { border-color: var(--halo-accent); color: var(--halo-ink); }
.scope-tech-details { padding-top: 7px; border-top: 1px solid var(--halo-line); font-size: 12px; color: var(--halo-muted); }
.scope-tech-details summary { cursor: pointer; font-weight: 500; margin-bottom: 6px; }

/* ---- Workspace Main Stage ---- */
.ws-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--halo-bg); }
.ws-stage-header {
  flex: none;
  background: var(--halo-surface);
  border-bottom: 1px solid var(--halo-line);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ws-breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ws-breadcrumb h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.ws-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ws-tab {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--halo-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.ws-tab:hover { background: var(--halo-tint); color: var(--halo-ink); }
.ws-tab[aria-selected="true"] { background: var(--halo-accent-soft); border-color: var(--halo-accent-border); color: var(--halo-accent-ink); font-weight: 600; }

.ws-panel { flex: 1 1 0%; min-height: 0; overflow-y: auto; padding: 16px 18px; }
.ws-panel-split { overflow: hidden; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; }

/* ---- Desktop & Chat Panes ---- */
.pane-card {
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--halo-shadow-sm);
}
.pane-head {
  flex: none;
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--halo-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--halo-surface-2);
}
.pane-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.desktop-head-left { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
#desktop-mode-badge { display: none !important; }
@media (max-width: 1480px) {
  #desktop-tier-badge { display: none; }
}
@media (min-width: 1100px) {
  #tab-workspace .pane-head {
    flex-wrap: nowrap;
    height: 48px;
  }
  #tab-workspace .pane-head .halo-filter-row {
    flex-wrap: nowrap;
    gap: 6px;
    flex-shrink: 0;
  }
  #tab-workspace .pane-head .btn-sm {
    padding: 0 10px;
    font-size: 12.5px;
    white-space: nowrap;
  }
}

.desktop-stage {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  background: #0d1320;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  position: relative;
}
.desktop-vnc-mount { flex: 1 1 0%; display: flex; flex-direction: column; gap: 8px; }
.desktop-vnc-banner { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #94a3b8; }
.desktop-vnc-canvas { width: 100%; flex: 1 1 0%; border-radius: 8px; background: #0a0e17; border: 1px solid #1e293b; }

.desktop-screen-frame {
  flex: 1 1 0%;
  border-radius: 10px;
  border: 1px solid #23304a;
  background: linear-gradient(155deg, #162033 0%, #0d1320 65%, #121c2e 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.desktop-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #a8b7d0;
  border-bottom: 1px solid #23304a;
  padding-bottom: 10px;
}
.desktop-standby-hero {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 18px 14px;
  border-radius: 10px;
  border: 1px dashed #2b3d5c;
  background: radial-gradient(circle at 50% 25%, rgba(59, 130, 246, 0.14), rgba(10, 14, 23, 0.35) 70%);
}
.desktop-standby-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.desktop-standby-hero strong { font-size: 14.5px; color: #f1f5f9; }
.desktop-standby-hero p { margin: 0; max-width: 420px; font-size: 12.5px; color: #94a3b8; }
.desktop-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.desktop-meta-tile {
  background: rgba(10, 14, 23, 0.72);
  border: 1px solid #23304a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  min-width: 0;
}
.desktop-meta-tile .label { display: block; font-size: 11px; color: #8ea1bf; margin-bottom: 3px; }
.desktop-meta-tile strong { display: block; color: #f1f5f9; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.desktop-lease-bar {
  flex: none;
  padding: 10px 14px;
  border-top: 1px solid var(--halo-line);
  background: var(--halo-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.lease-status-col { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; min-width: 0; }
.lease-progress-track { width: 100%; max-width: 220px; height: 5px; border-radius: 999px; background: var(--halo-tint-strong); overflow: hidden; }
.lease-progress-fill { height: 100%; background: var(--halo-accent); transition: width 0.4s ease; width: 100%; }
.lease-progress-fill.pct-90 { width: 90%; }
.lease-progress-fill.pct-80 { width: 80%; }
.lease-progress-fill.pct-70 { width: 70%; }
.lease-progress-fill.pct-60 { width: 60%; }
.lease-progress-fill.pct-50 { width: 50%; }
.lease-progress-fill.pct-40 { width: 40%; }
.lease-progress-fill.pct-30 { width: 30%; }
.lease-progress-fill.pct-20 { width: 20%; }
.lease-progress-fill.pct-10 { width: 10%; }
.lease-progress-fill.pct-0 { width: 0%; }

/* Character Avatar Chips & Chronological Chat */
.char-chips-bar {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 6px;
  padding: 8px 14px;
  scroll-padding-inline: 14px;
  border-bottom: 1px solid var(--halo-line);
  background: var(--halo-surface);
}
.char-chips-bar::-webkit-scrollbar { display: none; }
.char-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.char-chip[aria-checked="true"] {
  background: var(--halo-accent-soft);
  border-color: var(--halo-accent);
  color: var(--halo-accent-ink);
  font-weight: 600;
}
.char-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--halo-accent);
  color: var(--halo-on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
}
.char-handle { font-size: 11px; color: var(--halo-muted); }

.chat-transcript { flex: 1 1 0%; min-height: 0; overflow-y: auto; scroll-padding-top: 12px; padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-transcript > .empty-state { margin: auto 0; padding: 36px 24px; }
.chat-entry {
  border-radius: 12px;
  padding: 11px 14px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  font-size: 14px;
  line-height: 1.55;
  max-width: 92%;
}
.chat-entry.user { align-self: flex-end; background: var(--halo-accent-soft); border-color: var(--halo-accent-border); }
.chat-entry.assistant { align-self: flex-start; background: var(--halo-surface); border-color: var(--halo-line); }
.chat-entry.blocked { align-self: flex-start; background: var(--halo-danger-soft); border-color: var(--halo-danger-border); color: var(--halo-danger-ink); }
.chat-entry-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--halo-muted); margin-bottom: 5px; }
.chat-entry-body { overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; }
.chat-md-p { margin: 0; }
.chat-md-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.inline-code { padding: 0 4px; line-height: inherit; border-radius: 4px; background: var(--halo-tint); font-size: 12.5px; }
.chat-code-block { margin: 4px 0; padding: 10px 12px; border-radius: 8px; background: var(--halo-tint); border: 1px solid var(--halo-line); overflow-x: auto; font-size: 12.5px; }

.chat-citations-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--halo-line); }
.cite-chip {
  padding: 2px 8px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-accent-border);
  background: var(--halo-accent-soft);
  color: var(--halo-accent-ink);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.cite-chip.grant { border-color: var(--halo-enterprise-border); background: var(--halo-enterprise-soft); color: var(--halo-enterprise-ink); }
.cite-chip:hover { text-decoration: underline; }

.chat-composer-wrap { flex: none; border-top: 1px solid var(--halo-line); padding: 10px 14px 12px; background: var(--halo-surface-2); display: flex; flex-direction: column; gap: 8px; }
.chat-composer-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.composer-status-text { font-size: 12px; color: var(--halo-muted); }
.chat-composer-row { display: flex; gap: 8px; align-items: center; }
.chat-composer-row input { flex: 1 1 auto; min-width: 0; }
.chat-composer-row textarea { flex: 1 1 auto; min-width: 0; resize: none; min-height: 44px; max-height: 112px; border-radius: 10px; }
.kb-brief-card { display: flex; flex-direction: column; gap: 10px; text-align: left; min-width: 0; }
.kb-brief-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; max-height: 220px; overflow-y: auto; line-height: 1.5; font-size: 13px; }

/* ---- Permissions 5 Sub-Tabs & Tool Filter Bar ---- */
.perm-subtabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--halo-line);
}
.perm-subtab {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--halo-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.perm-subtab:hover { background: var(--halo-tint); color: var(--halo-ink); }
.perm-subtab[aria-selected="true"] {
  background: var(--halo-accent-soft);
  border-color: var(--halo-accent-border);
  color: var(--halo-accent-ink);
  font-weight: 600;
}

.tools-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tools-filter-bar .halo-input { flex: 1 1 260px; max-width: 340px; min-width: 0; }
.filter-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  padding: 5px 10px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface);
  color: var(--halo-muted);
  font-size: 12.5px;
  cursor: pointer;
}
.filter-pill.active { background: var(--halo-accent-soft); border-color: var(--halo-accent); color: var(--halo-accent-ink); font-weight: 600; }
.tool-desc-sub { font-size: 12px; color: var(--halo-muted); margin-top: 2px; }

/* ---- Tables, Console Cards, Forms ---- */
.console-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.console-card {
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--halo-shadow-sm);
}
.console-card > .pane-head {
  margin: -18px -18px 4px;
  padding: 10px 18px;
  min-height: 48px;
  border-radius: 14px 14px 0 0;
}
#tab-knowledge .console-grid > .console-card:not(.full),
#tab-board .console-grid > .console-card {
  min-height: 440px;
}
#knowledge-list,
#knowledge-brief-detail,
#board-feed,
#board-crons-list {
  flex: 1 1 auto;
}
.console-card.full { grid-column: 1 / -1; }
.console-card h2, .console-card h3 { margin: 0; font-size: 16px; font-weight: 600; }
.console-card > .pane-head h2 { font-size: 14.5px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--halo-line); text-align: left; vertical-align: middle; }
.data-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--halo-muted); font-weight: 600; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 500; color: var(--halo-ink-soft); }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.check-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--halo-ink); }

.notice-banner { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--halo-line); background: var(--halo-surface-2); color: var(--halo-ink-soft); font-size: 13.5px; }
.notice-banner.error { background: var(--halo-danger-soft); border-color: var(--halo-danger-border); color: var(--halo-danger-ink); }
.notice-banner.warn { background: var(--halo-warn-soft); border-color: var(--halo-warn-border); color: var(--halo-warn-ink); }
.notice-banner.info { background: var(--halo-accent-soft); border-color: var(--halo-accent-border); color: var(--halo-accent-ink); }

.empty-state { padding: 26px 20px; text-align: center; border: 1px dashed var(--halo-line-strong); border-radius: 12px; color: var(--halo-muted); font-size: 14px; }

/* ---- Modal Dialogs ---- */
dialog.halo-dialog {
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface);
  color: var(--halo-ink);
  box-shadow: var(--halo-shadow);
}
dialog.halo-dialog-wide { width: min(760px, calc(100vw - 32px)); }
dialog.halo-dialog::backdrop { background: rgba(10, 14, 23, 0.68); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--halo-line); }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--halo-muted); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
#wizard-prev-btn,
#wizard-back-btn {
  margin-right: auto;
}

/* ---- Footer ---- */
.halo-footer {
  width: min(1180px, calc(100% - 48px));
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 0 40px;
  border-top: 1px solid var(--halo-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13.5px;
  color: var(--halo-muted);
}
.halo-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.halo-footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.halo-footer-links a { color: var(--halo-ink-soft); }
.halo-footer-links a:hover { color: var(--halo-ink); }

/* ---- Responsive ---- */
@media (min-width: 1020px) and (max-width: 1220px) {
  .halo-topbar-inner { gap: 8px; }
  .halo-brand-group { gap: 7px; }
  .halo-beta-pill { display: none; }
  .halo-nav { gap: 1px; }
  .halo-nav a { font-size: 12.5px; padding: 5px 6px; }
  .halo-topbar-actions,
  .halo-auth-slot { gap: 6px; }
  .halo-theme-btn { font-size: 11.5px; padding: 0 8px; }
  .halo-signin-link { font-size: 12.5px; padding: 0 6px; }
  .halo-auth-slot .btn-sm { padding: 0 10px; font-size: 12px; }
  .halo-account-chip { max-width: 142px; font-size: 11.5px; padding: 4px 8px; }
}

@media (max-width: 1024px) {
  .halo-hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; }
  .halo-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .halo-info-grid { grid-template-columns: minmax(0, 1fr); }
  .dept-preview-shell { grid-template-columns: minmax(0, 1fr); }
  .dept-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .sandbox-grid { grid-template-columns: minmax(0, 1fr); }
  .ws-shell { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .halo-workspace-body { height: auto; overflow: auto; }
  .ws-rail { border-right: 0; border-bottom: 1px solid var(--halo-line); }
  .ws-panel-split { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .console-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 641px) and (max-width: 1019px) {
  .halo-topbar,
  .halo-workspace-body .halo-topbar {
    height: 58px;
    min-height: 58px;
  }
  .halo-topbar-inner,
  .halo-workspace-body .halo-topbar-inner {
    width: calc(100% - 28px);
    height: 58px;
    min-height: 58px;
    padding: 0;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .halo-beta-pill { display: none; }
  .halo-brand { font-size: 18px; gap: 7px; }
  .halo-brand-mark { width: 26px; height: 22px; }
  .halo-nav {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding: 0 2px;
  }
  .halo-nav::-webkit-scrollbar { display: none; }
  .halo-nav a {
    font-size: 12.5px;
    padding: 5px 7px;
    flex: none;
  }
  .halo-topbar-actions,
  .halo-auth-slot { gap: 6px; }
  .halo-theme-btn { height: 30px; font-size: 11.5px; padding: 0 8px; }
  .halo-signin-link { min-height: 30px; font-size: 12px; padding: 0 6px; }
  .halo-auth-slot .btn-sm { min-height: 30px; padding: 0 9px; font-size: 12px; }
  .halo-account-chip { max-width: 118px; font-size: 11.5px; padding: 3px 8px; }
}

@media (max-width: 640px) {
  .halo-topbar,
  .halo-workspace-body .halo-topbar {
    height: auto;
    min-height: 0;
  }
  .halo-topbar-inner,
  .halo-workspace-body .halo-topbar-inner {
    width: calc(100% - 24px);
    height: auto;
    min-height: 0;
    padding: 5px 0 4px;
    flex-wrap: wrap;
    row-gap: 4px;
    column-gap: 6px;
  }
  .halo-beta-pill,
  .halo-workspace-body #ws-mode-pill { display: none; }
  .halo-brand { font-size: 17px; gap: 6px; line-height: 1.2; }
  .halo-brand-mark { width: 24px; height: 20px; }
  .halo-topbar-actions {
    margin-left: auto;
    gap: 5px;
  }
  .halo-auth-slot { gap: 5px; }
  .halo-theme-btn,
  .halo-theme-select { height: 28px; min-height: 28px; font-size: 11px; padding: 0 7px; }
  .halo-signin-link { min-height: 28px; height: 28px; font-size: 11.5px; padding: 0 5px; }
  .halo-auth-slot .btn-sm { min-height: 28px; height: 28px; padding: 0 8px; font-size: 11.5px; }
  .halo-account-chip { max-width: 92px; font-size: 11px; padding: 3px 7px; }
  .halo-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: flex-start;
    gap: 2px 4px;
    padding: 4px 0 2px;
    border-top: 1px solid var(--halo-line);
  }
  .halo-topbar-eclipse .halo-nav {
    border-top-color: rgba(255, 255, 255, 0.08);
  }
  .halo-nav a {
    font-size: 11.5px;
    line-height: 1.3;
    padding: 3px 6px;
    flex: none;
  }
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .glass-input {
    font-size: 16px;
  }
  .halo-footer { width: calc(100% - 28px); }
  .halo-wrap { padding: 18px 14px 48px; }
  .halo-hero { padding: 20px 16px; gap: 20px; margin-bottom: 24px; }
  .halo-hero h1 { font-size: 28px; }
  .halo-eyebrow { font-size: 11px; letter-spacing: 0.05em; }
  .halo-hero-actions .btn { width: 100%; }
  .badge { white-space: normal; line-height: 1.35; }
  .sandbox-section { padding: 16px 14px; }
  .sandbox-probe-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .desktop-meta-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================================
 * Pure Full-Screen 100dvh Minimalist Solar Eclipse /halo Hub
 * Pure #000000 cosmic void, neutral charcoal/slate, cobalt-azure, warm ivory-gold
 * eclipse highlight — zero green hues, museum-grade optical glass framing.
 * ============================================================================ */

body.halo-eclipse-page {
  background: #000000 !important;
  color: #f8fafc !important;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.eclipse-viewport-main {
  flex: 1 1 auto;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #000000;
}

@media (min-width: 1020px) {
  .eclipse-viewport-main {
    margin-top: -64px;
  }
}

/* Pure #000000 Single-Screen 100dvh Stage — Zero Overlap Flex Column */
.eclipse-stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 100dvh;
  height: auto;
  background: #000000;
  color: #f8fafc;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(216px, 26.8vh, 248px) 20px 14px;
}

/* Ultra-Minimal Transparent Floating Navigation */
.eclipse-float-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: none;
}

.eclipse-float-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #e2e8f0;
  text-decoration: none;
}

.eclipse-float-brand:hover {
  color: #ffffff;
  text-decoration: none;
}

.eclipse-float-mark {
  width: 22px;
  height: 18px;
  display: block;
  filter: invert(1) brightness(1.12);
}

.eclipse-float-links {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.eclipse-float-links a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.16s ease;
}

.eclipse-float-links a:hover {
  color: #f8fafc;
  text-decoration: none;
}

.eclipse-backdrop-wrap {
  position: absolute;
  inset: 0;
  background: #000000;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.eclipse-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Zero-dependency pure CSS fallback shown ONLY when WebGL is unavailable */
.eclipse-css-fallback {
  display: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 42% at 50% 24%, rgba(255, 241, 208, 0.36) 0%, rgba(232, 184, 120, 0.16) 28%, rgba(29, 78, 216, 0.14) 55%, rgba(0, 0, 0, 0) 78%),
    #000000;
}
.eclipse-css-fallback::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 24%;
  width: 1360px;
  height: 1360px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #000000;
  box-shadow: 0 -2px 26px rgba(255, 241, 208, 0.55), 0 -1px 4px rgba(255, 255, 255, 0.85);
}
[data-eclipse-fallback="1"] .eclipse-css-fallback {
  display: block;
}

/* Centered Editorial Lockup Strictly Inside the Dark Planetary Void */
.eclipse-void-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 740px;
  margin: 0 auto 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eclipse-eyebrow {
  margin: 0 0 8px;
  font: 500 11px/1.2 Mono, ui-monospace, monospace;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #cbd5e1;
}

.eclipse-title {
  margin: 0 0 9px;
  max-width: 720px;
  font-size: clamp(1.8rem, 2.95vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 500;
  text-wrap: balance;
  color: #ffffff;
}

.eclipse-desc {
  margin: 0 0 16px;
  max-width: 520px;
  font-size: 14.5px;
  line-height: 1.52;
  text-wrap: balance;
  color: #cbd5e1;
}

/* Museum-Grade Optical Frosted-Glass Sign In / Sign Up Box */
.halo-glass-card {
  position: relative;
  width: 100%;
  max-width: 416px;
  padding: 18px 22px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.025) 48%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(36px) saturate(145%);
  -webkit-backdrop-filter: blur(36px) saturate(145%);
  box-shadow:
    0 32px 84px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 1px 0 rgba(255, 244, 222, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  text-align: left;
  color: #f8fafc;
  overflow: hidden;
}

.halo-glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 11%;
  right: 11%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 244, 222, 0.64) 50%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.glass-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 14px;
}

.glass-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.glass-tab:hover:not([aria-selected="true"]) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.glass-tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 600;
}

.glass-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.glass-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.glass-field label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #cbd5e1;
}

.glass-input {
  width: 100%;
  min-height: 41px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.52);
  color: #ffffff;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.glass-input::placeholder {
  color: #94a3b8;
}

.glass-input:focus {
  background: rgba(4, 8, 18, 0.78);
  border-color: #93c5fd;
  outline: 2px solid #60a5fa;
  outline-offset: -1px;
}

.glass-input-wrap {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.52);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.glass-input-wrap:focus-within {
  background: rgba(4, 8, 18, 0.78);
  border-color: #93c5fd;
  outline: 2px solid #60a5fa;
  outline-offset: -1px;
}

.glass-input-password {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 9px 0 0 9px;
  background: transparent;
  padding-right: 8px;
}

.glass-input-password:focus {
  background: transparent;
  border-color: transparent;
  outline: none;
}

.glass-pwd-toggle {
  flex: 0 0 40px;
  width: 40px;
  min-height: 41px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 9px 9px 0;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.glass-pwd-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.glass-pwd-toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
  color: #ffffff;
}

.glass-field-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: #94a3b8;
}

.glass-alert {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.glass-alert.error {
  background: rgba(127, 29, 29, 0.58);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.glass-alert.info {
  background: rgba(23, 37, 84, 0.68);
  border-color: rgba(96, 165, 250, 0.48);
  color: #dbeafe;
}

.glass-submit-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 3px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #ffffff;
  background: #f8fafc;
  color: #090d16;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.glass-submit-btn:hover:not(:disabled) {
  background: #ffffff;
  box-shadow: 0 0 28px rgba(255, 241, 208, 0.24);
}

.glass-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.glass-secondary-btn {
  width: 100%;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.glass-secondary-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.glass-card-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  text-align: center;
}

.glass-sublink-accent {
  color: #93c5fd !important;
  font-weight: 600;
}

.glass-sublink {
  font-size: 12.5px;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none;
}

.glass-sublink:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.glass-inline-cta {
  text-align: center;
  margin-top: 4px;
}

.glass-signed-in {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.glass-signed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.glass-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(96, 165, 250, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #dbeafe;
}

.glass-email-pill {
  font-size: 12.5px;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 245px;
}

.glass-signed-copy {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #cbd5e1;
}

.glass-signed-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.glass-existing-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glass-existing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #f8fafc;
  font-size: 12.5px;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.glass-existing-row:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(147, 197, 253, 0.42);
  text-decoration: none;
}

.glass-existing-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.glass-existing-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(96, 165, 250, 0.2);
  color: #dbeafe;
}

.glass-existing-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.glass-existing-arrow {
  flex: none;
  font-size: 12px;
  color: #93c5fd;
  font-weight: 500;
}

.glass-signed-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.glass-quick-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.glass-quick-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  text-decoration: none;
}

/* Normal flex-flow footer (NEVER position: absolute) — guarantees 0 overlap at every viewport! */
.eclipse-micro-footer {
  position: relative;
  margin-top: auto;
  width: 100%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  padding: 6px 16px 4px;
  font-size: 12.5px;
  color: #94a3b8;
}

.eclipse-micro-footer a {
  color: #94a3b8;
  text-decoration: none;
}

.eclipse-micro-footer a:hover {
  color: #f8fafc;
}

/* ---- Enterprise & Missions Shared Hero Polish ---- */
.orgs-hero-actions {
  gap: 8px;
}

@media (min-width: 1120px) {
  .orgs-hero-actions {
    flex-wrap: nowrap;
  }
  .orgs-hero-actions .btn {
    padding: 0 13px;
    font-size: 13.5px;
  }
}

.missions-mini-eclipse-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.eclipse-css-fallback-mini::after {
  width: 520px;
  height: 520px;
  top: 24%;
}

.moat-table th[scope="row"] {
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--halo-ink);
  font-weight: 600;
  width: 24%;
}

.moat-tesi-cell {
  color: var(--halo-ink);
  font-weight: 500;
}

@media (max-height: 759px) {
  .eclipse-stage {
    height: auto;
    min-height: 100dvh;
    padding-top: 184px;
    padding-bottom: 18px;
  }
}

@media (max-width: 1019px) {
  .eclipse-viewport-main {
    min-height: 0;
  }
  .eclipse-stage {
    height: auto;
    min-height: calc(100dvh - 88px);
    padding-top: 184px;
    padding-bottom: 16px;
  }
}

@media (max-width: 640px) {
  body.halo-eclipse-page {
    min-height: 100svh;
  }
  .eclipse-stage {
    height: auto;
    min-height: calc(100svh - 96px);
    padding: 162px 16px 20px;
  }
  .eclipse-eyebrow { font-size: 10px; letter-spacing: 0.2em; }
  .eclipse-title { font-size: 25px; }
  .eclipse-desc { font-size: 13.5px; margin-bottom: 14px; }
  .halo-glass-card { padding: 16px 16px 15px; border-radius: 18px; }
  .glass-tab,
  .glass-input,
  .glass-submit-btn,
  .glass-secondary-btn,
  .glass-quick-chip,
  .eclipse-micro-footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .glass-input {
    display: block;
    font-size: 16px;
  }
}

/* ============================================================================
 * Jewel-Like Translucent Mission Pill inside /halo 100dvh Void +
 * /halo/missions Observatory Surface
 * Neutral slate & cobalt-indigo tokens — zero green hues, WCAG AA >= 4.5:1.
 * ============================================================================ */

.eclipse-mission-pill {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: min(560px, 100%);
  padding: 6px 14px 6px 7px;
  border-radius: 999px;
  background: rgba(13, 20, 36, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.eclipse-mission-pill:hover {
  background: rgba(23, 37, 84, 0.92);
  border-color: rgba(147, 197, 253, 0.52);
  color: #ffffff;
  text-decoration: none;
}

.mission-pill-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* HALO Community Research Missions Spotlight Callout */
.missions-spotlight-banner {
  margin: 0 0 34px;
  padding: 22px 26px;
  border-radius: 16px;
  background: radial-gradient(circle at 92% 16%, rgba(37, 99, 235, 0.08), transparent 48%), var(--halo-surface);
  border: 1px solid var(--halo-accent-border);
  box-shadow: var(--halo-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
html[data-tesi-theme="dark"] .missions-spotlight-banner {
  background: radial-gradient(circle at 92% 16%, rgba(96, 165, 250, 0.13), transparent 48%), var(--halo-surface);
}
.missions-spotlight-copy {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.missions-spotlight-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.missions-spotlight-copy h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--halo-ink);
}
.missions-spotlight-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--halo-ink-soft);
}
.missions-spotlight-copy code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--halo-tint);
  font-size: 12.5px;
}
.missions-spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* /halo/missions Observatory Page */
.missions-observatory-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.missions-mini-eclipse {
  position: relative;
  height: 112px;
  border-radius: 10px;
  background: #000000;
  overflow: hidden;
  border: 1px solid var(--halo-line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 14px rgba(15, 23, 42, 0.14);
}
.missions-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.missions-telemetry-tile {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.missions-telemetry-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--halo-muted);
}
.missions-telemetry-tile strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--halo-ink);
}
.missions-telemetry-sub {
  font-size: 12px;
  color: var(--halo-muted);
}

/* 4-Stage Anti-Slop Stewardship Pipeline */
.missions-pipeline-section {
  margin-bottom: 36px;
  padding: 26px;
  border-radius: 18px;
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  box-shadow: var(--halo-shadow-sm);
}
.missions-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.missions-section-head h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.missions-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.missions-stage-card {
  padding: 16px;
  border-radius: 12px;
  background: var(--halo-surface-2);
  border: 1px solid var(--halo-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.missions-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.missions-stage-num {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--halo-accent);
}
.missions-stage-card h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--halo-ink);
}
.missions-stage-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--halo-ink-soft);
}
.missions-stage-card code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--halo-tint);
  font-size: 12px;
}

/* Flagship Mission #01 Card */
.missions-flagship-card {
  background: radial-gradient(circle at 90% 8%, rgba(37, 99, 235, 0.07), transparent 44%), var(--halo-surface);
  border: 1px solid var(--halo-accent-border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--halo-shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}
html[data-tesi-theme="dark"] .missions-flagship-card {
  background: radial-gradient(circle at 90% 8%, rgba(96, 165, 250, 0.12), transparent 44%), var(--halo-surface);
}
.missions-flagship-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.missions-ribbon-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.missions-grant-pill {
  background: var(--halo-accent);
  border-color: var(--halo-accent);
  color: var(--halo-on-accent);
  font-weight: 600;
  padding: 4px 12px;
}
.missions-flagship-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--halo-line);
}
.missions-flagship-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.5vw, 29px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--halo-ink);
}
.missions-leads-line {
  margin: 0;
  font-size: 14px;
  color: var(--halo-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  overflow-wrap: anywhere;
}
.missions-repo-link {
  color: var(--halo-accent-ink);
  font-weight: 600;
}
.missions-stats-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.missions-flagship-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}
.missions-flagship-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.missions-body-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--halo-ink-soft);
}
.missions-subblock {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.missions-char-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.missions-char-pill {
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--halo-surface-2);
  border: 1px solid var(--halo-line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.missions-char-pill strong {
  font-size: 12.5px;
  color: var(--halo-accent-ink);
}
.missions-char-pill span {
  font-size: 12px;
  color: var(--halo-muted);
}

.missions-targets-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.missions-target-item {
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--halo-surface-2);
  border: 1px solid var(--halo-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.missions-target-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}
.missions-target-title {
  font-size: 13px;
  color: var(--halo-ink);
  overflow-wrap: anywhere;
}
.missions-target-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--halo-accent-ink);
  white-space: nowrap;
}

.missions-fellowship-box {
  padding: 22px;
  border-radius: 14px;
  background: var(--halo-surface-2);
  border: 1px solid var(--halo-line-strong);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.missions-fellowship-head h4 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--halo-ink);
}
.missions-perks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.missions-perks-list li {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--halo-surface);
  border: 1px solid var(--halo-line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.missions-perks-list strong {
  font-size: 13.5px;
  color: var(--halo-ink);
}
.missions-perks-list span {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--halo-muted);
}
.missions-perks-list code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--halo-tint);
  font-size: 11.5px;
}

.missions-submitted-banner {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--halo-accent-soft);
  border: 1px solid var(--halo-accent);
  color: var(--halo-accent-ink);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}
.missions-submitted-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--halo-accent);
  flex: none;
}
.missions-submitted-banner strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.missions-submitted-banner span {
  display: block;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.missions-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.missions-apply-cta {
  width: 100%;
  min-height: 44px;
  font-size: 14.5px;
  font-weight: 600;
}
.missions-cta-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.missions-auth-sublink {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--halo-accent-ink);
}

/* Additional Mined Missions Grid */
.missions-cards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.mission-grid-card {
  height: 100%;
}
.missions-card-stats,
.missions-card-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.missions-flagship-section-bar {
  margin-top: 8px;
}

/* Inline Sign-In / Sign-Up inside Fellowship Modal */
.missions-inline-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--halo-tint);
  border: 1px solid var(--halo-line-strong);
}

.missions-inline-auth-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--halo-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.missions-inline-auth-tab[aria-selected="true"] {
  background: var(--halo-surface);
  border-color: var(--halo-line-strong);
  color: var(--halo-ink);
  font-weight: 600;
  box-shadow: var(--halo-shadow-sm);
}

.missions-inline-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.missions-inline-auth-actions {
  justify-content: space-between;
}

/* Fellowship Modal Dialog */
.missions-dialog-title {
  margin-top: 6px;
}
.missions-dialog-auth-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.missions-dialog-auth-copy {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.missions-applicant-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.missions-steward-pledge {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .missions-pipeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .missions-flagship-grid { grid-template-columns: minmax(0, 1fr); }
  .missions-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .eclipse-mission-pill {
    margin-top: 12px;
    padding: 7px 12px;
    border-radius: 16px;
    flex-wrap: wrap;
    font-size: 11.5px;
    gap: 5px 8px;
  }
  .missions-spotlight-banner { padding: 18px 16px; }
  .missions-spotlight-actions .btn { width: 100%; }
  .missions-pipeline-section { padding: 18px 16px; }
  .missions-pipeline-grid { grid-template-columns: minmax(0, 1fr); }
  .missions-flagship-card { padding: 20px 16px; }
  .missions-char-pills { grid-template-columns: minmax(0, 1fr); }
  .missions-telemetry-grid { grid-template-columns: minmax(0, 1fr); }
  .missions-cards-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================================
 * Round 8 — Deep Workspace Console: Unified Living Briefs, Scoped Search,
 * Proposals Queue, Tool Diff Preview, Ask-Gate Queue, Partition Matrix &
 * 5-Layer Policy Simulator (Neutral Slate & Cobalt, WCAG AA Light/Dark)
 * ============================================================================ */

.kb-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kb-search-bar .halo-input {
  flex: 1 1 200px;
  min-width: 0;
}
.kb-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kb-search-hit {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.kb-search-hit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.kb-search-snippet {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--halo-ink-soft);
  overflow-wrap: anywhere;
}

.kb-brief-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--halo-line);
}
.kb-brief-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kb-entries-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}
.kb-entry-card {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.kb-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--halo-muted);
}
.kb-entry-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kb-proposals-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kb-proposal-item {
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.kb-proposal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.kb-proposal-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.kb-proposal-rationale {
  margin: 0;
  font-size: 12.5px;
  color: var(--halo-muted);
  overflow-wrap: anywhere;
}
.kb-proposal-body {
  margin: 0;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.kb-proposal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.kb-proposal-note-input {
  flex: 1 1 200px;
  min-width: 0;
}

/* Tool Diff Preview & Ask-Gate Queue */
.tools-diff-banner {
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--halo-enterprise-border);
  background: var(--halo-enterprise-soft);
  color: var(--halo-enterprise-ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tools-diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.tools-diff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tool-row-control-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Knowledge Partition Matrix, Quick Slug Pills & Grants Split */
.partition-matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.partition-tile {
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.partition-tile strong {
  font-size: 13.5px;
  color: var(--halo-ink);
  overflow-wrap: anywhere;
}
.partition-tile-sub {
  font-size: 12px;
  line-height: 1.45;
  color: var(--halo-muted);
  overflow-wrap: anywhere;
}
.slug-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
  align-items: center;
}
.slug-quick-pill {
  padding: 3px 9px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface-2);
  color: var(--halo-ink-soft);
  font-size: 12px;
  cursor: pointer;
}
.slug-quick-pill:hover {
  border-color: var(--halo-accent);
  background: var(--halo-accent-soft);
  color: var(--halo-accent-ink);
}
.grants-split-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.grants-subblock {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 5-Layer Policy Simulator */
.sim-form-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto;
  align-items: end;
}
.sim-submit-field {
  justify-content: flex-end;
}
.sim-result-box {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sim-verdict-bar {
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sim-verdict-bar.allowed {
  background: var(--halo-accent-soft);
  border-color: var(--halo-accent-border);
  color: var(--halo-accent-ink);
}
.sim-verdict-bar.ask_gate {
  background: var(--halo-enterprise-soft);
  border-color: var(--halo-enterprise-border);
  color: var(--halo-enterprise-ink);
}
.sim-verdict-bar.denied {
  background: var(--halo-danger-soft);
  border-color: var(--halo-danger-border);
  color: var(--halo-danger-ink);
}
.sim-layers-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sim-layer-row {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sim-layer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 220px;
}
.sim-layer-detail {
  font-size: 12.5px;
  color: var(--halo-ink-soft);
  overflow-wrap: anywhere;
  flex: 1 1 260px;
}

@media (max-width: 1120px) {
  .partition-matrix-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sim-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .partition-matrix-grid,
  .sim-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sim-submit-field .btn {
    width: 100%;
  }
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .glass-input,
  #chat-input {
    font-size: 16px !important;
  }
}

/* ============================================================================
 * Round 9 — Zero-Signup Blueprint Preview Callout & File Inspector
 * ============================================================================ */
.ws-preview-callout {
  flex: none;
  margin: 10px 16px 0;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid var(--halo-accent-border);
  background: var(--halo-surface);
  box-shadow: var(--halo-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.ws-preview-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1 1 320px;
}
.ws-preview-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--halo-ink-soft);
}
.file-preview-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-preview-pre {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .ws-preview-callout .halo-filter-row .btn {
    width: 100%;
  }
}

/* ============================================================================
 * Round 10 — Interactive Proof Bundle Verifier & Co-Authored Steward PR Card
 * ============================================================================ */
.missions-proof-gate-card {
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--halo-line-strong);
  background: var(--halo-surface);
  box-shadow: var(--halo-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.missions-proof-gate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
}
.missions-proof-gate-head h3 {
  margin: 4px 0 4px;
  font-size: 18px;
  line-height: 1.3;
}
.missions-proof-gate-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.missions-proof-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.missions-proof-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
}
.missions-proof-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.missions-proof-commit-box {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.missions-proof-commit-pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .missions-proof-gate-card {
    padding: 16px 14px;
  }
  .missions-proof-actions .btn {
    width: 100%;
  }
}

/* ============================================================================
 * Round 13 — Mobile Above-the-Fold Workspace Rail & Scope Drawer Toggle
 * ============================================================================ */
.ws-rail-title-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ws-mobile-scope-toggle {
  display: none;
  padding: 2px 8px;
  font-size: 11px;
  min-height: 26px;
  text-transform: none;
  letter-spacing: 0;
}
@media (max-width: 768px) {
  .ws-rail {
    padding: 6px 10px;
    gap: 6px;
    min-width: 0;
  }
  .ws-rail-section {
    padding: 6px 10px;
    min-width: 0;
    overflow: hidden;
  }
  .ws-rail-title {
    margin-bottom: 5px;
  }
  .comp-tree {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    max-width: 100%;
  }
  .comp-tree::-webkit-scrollbar {
    display: none;
  }
  .comp-tree > li {
    flex: 0 0 auto;
  }
  .comp-node-btn,
  .comp-node-btn.depth-1,
  .comp-node-btn.depth-2,
  .comp-node-btn.depth-3 {
    width: auto;
    padding: 4px 9px;
    font-size: 12px;
    border: 1px solid var(--halo-line);
    background: var(--halo-surface-2);
    white-space: nowrap;
  }
  .comp-node-btn[aria-current="true"],
  .comp-node-btn.depth-1[aria-current="true"],
  .comp-node-btn.depth-2[aria-current="true"],
  .comp-node-btn.depth-3[aria-current="true"] {
    background: var(--halo-accent-soft);
    border-color: var(--halo-accent-border);
  }
  .comp-node-name {
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .comp-node-btn .badge {
    font-size: 10px;
    padding: 1px 5px;
    white-space: nowrap;
  }
  .ws-mobile-scope-toggle {
    display: inline-flex;
  }
  #ws-scope-rail-section:not(.mobile-expanded) .ws-scope-collapsible {
    display: none;
  }
  #ws-scope-rail-section:not(.mobile-expanded) .ws-rail-title {
    margin-bottom: 0;
  }
}

/* ============================================================================
 * Round 14 — Deep-Link Trace Permalinks & TESI Connect Compartment Pairing Box
 * ============================================================================ */
.connect-os-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.connect-preview-box {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.connect-cmd-pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ============================================================================
 * Round 15 — Zero-Signup Compartment Chat Quick-Try Prompts
 * ============================================================================ */
.chat-preview-prompts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.chat-preview-prompts[hidden] {
  display: none;
}
.chat-prompt-chip {
  padding: 4px 10px;
  border-radius: var(--halo-radius-pill);
  border: 1px solid var(--halo-accent-border);
  background: var(--halo-surface);
  color: var(--halo-accent-ink);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.3;
}
.chat-prompt-chip:hover {
  background: var(--halo-accent-soft);
}

/* ============================================================================
 * Round 16 — Mission Protected File Locks Strip
 * ============================================================================ */
.missions-locks-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--halo-line);
  background: var(--halo-surface-2);
}

@media (max-width: 640px) {
  .file-preview-box .kb-brief-toolbar,
  .missions-proof-commit-box .kb-brief-toolbar,
  .connect-preview-box .kb-brief-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .file-preview-box .halo-filter-row,
  .kb-proposal-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .file-preview-box .btn,
  .missions-proof-commit-box .btn,
  .connect-preview-box .btn,
  .kb-proposal-actions .btn,
  .chat-prompt-chip {
    max-width: 100%;
    height: auto;
    min-height: 34px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .missions-locks-strip .badge {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
