:root {
  /* Polaris (internal) -- navy/near-black, starfield, single fixed point of light */
  --bg: #0a0d14;
  --panel: #121826;
  --panel-2: #1a2233;
  --border: #2a324a;
  --text: #e8eaed;
  --muted: #8b93a3;
  --accent: #7fa8ff;
  --green: #3ecf8e;
  --amber: #e8b93e;
  --red: #e8615c;
  --green-tint: rgba(62, 207, 142, 0.15);
  --amber-tint: rgba(232, 185, 62, 0.15);
  --red-tint: rgba(232, 97, 92, 0.15);
  --accent-tint: rgba(127, 168, 255, 0.15);
  --accent-rgb: 127, 168, 255;
  --glass-bg: rgba(18, 24, 38, 0.5);
  --ease: cubic-bezier(.16,.84,.44,1);
  --motion-fast: 150ms;
  --motion-med: 220ms;
}

:root[data-persona="kernel"] {
  /* Kernel (external/customer) -- warm gold/amber/brown, glowing orb */
  --bg: #1b1409;
  --panel: #2a1f10;
  --panel-2: #362717;
  --border: #4d3a1e;
  --text: #f5ecd9;
  --muted: #b8a67e;
  --accent: #e0a530;
  --green: #8fce6b;
  --amber: #f0b93e;
  --red: #e8615c;
  --green-tint: rgba(143, 206, 107, 0.18);
  --amber-tint: rgba(240, 185, 62, 0.18);
  --red-tint: rgba(232, 97, 92, 0.18);
  --accent-tint: rgba(224, 165, 48, 0.18);
  --accent-rgb: 224, 165, 48;
  --glass-bg: rgba(42, 31, 16, 0.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Ambient background motif -- a real night sky, not a tiled texture: each
   star is its own DOM element (see app.js's buildStarfield()) with
   randomized position, power-law-distributed size, color temperature, and
   twinkle phase/duration -- a single shared background-image (the old
   approach) can only vary opacity per LAYER, not per star, which is why it
   still read as a repeating dot pattern. */
#starfield-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  border-radius: 50%;
  animation-name: star-twinkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: var(--tw-min, 0.4); transform: scale(1); }
  50% { opacity: var(--tw-max, 1); transform: scale(1.18); }
}
/* Motion (twinkle, shooting stars -- see spawnShootingStar in app.js) is
   confined to Home and Constellation. Content tabs get a calm, static dense
   field instead of animating everywhere. */
body:not(.motion-view) .star { animation-play-state: paused; }
/* Cross-glint on the 1-2 designated bright stars per load. */
.star-bright::before, .star-bright::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  background: rgba(255,255,255,0.55);
  transform: translate(-50%, -50%);
}
.star-bright::before { width: 260%; height: 1px; }
.star-bright::after { width: 1px; height: 260%; }

/* Occasional shooting star -- a brief, randomly-timed streak (see app.js),
   purely decorative, never on the same clock twice so it doesn't feel
   mechanical. The bright head sits at the leading edge (100% -- the
   direction translateX moves it) and fades toward the trailing edge (0%),
   so the fading trail reads as behind the star's motion, not in front of it. */
.shooting-star {
  position: fixed;
  width: 130px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.95));
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: rotate(var(--star-angle, 20deg)) translateX(0);
  animation-name: shooting-star-move;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}
:root[data-persona="kernel"] .shooting-star {
  background: linear-gradient(90deg, rgba(255,210,140,0), rgba(255,210,140,0.95));
}
@keyframes shooting-star-move {
  0% { opacity: 0; transform: rotate(var(--star-angle, 20deg)) translateX(0); }
  12% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--star-angle, 20deg)) translateX(var(--star-distance, 320px)); }
}

header, nav, main { position: relative; z-index: 1; }

header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header .brand { display: flex; align-items: center; gap: 12px; }
header h1 { font-size: 20px; margin: 0; letter-spacing: 0.3px; }
header .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
header .header-controls { display: flex; align-items: center; gap: 12px; }

/* Point of light: fixed star point (Polaris) or glowing orb (Kernel).
   One shared visual (sized via modifier classes) reused for the header
   brand icon, the persona-hero icon, and any per-view slim header icon. */
.point-of-light {
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 0 5px 1px rgba(255,255,255,0.9), 0 0 14px 3px rgba(160,190,255,0.5);
}
:root[data-persona="kernel"] .point-of-light {
  background: radial-gradient(circle at 35% 32%, #ffe6a8, #e0a530 55%, #7a4a12 100%);
  box-shadow: 0 0 16px 5px rgba(224,165,48,0.6);
}
.point-of-light.sm { width: 15px; height: 15px; }
.point-of-light.md { width: 26px; height: 26px; box-shadow: 0 0 10px 2px rgba(255,255,255,0.85), 0 0 22px 5px rgba(160,190,255,0.45); }
:root[data-persona="kernel"] .point-of-light.md { box-shadow: 0 0 22px 6px rgba(224,165,48,0.55); }
.point-of-light.lg { width: 54px; height: 54px; box-shadow: 0 0 20px 5px rgba(255,255,255,0.85), 0 0 40px 10px rgba(160,190,255,0.4); }
:root[data-persona="kernel"] .point-of-light.lg { box-shadow: 0 0 34px 10px rgba(224,165,48,0.55); }

/* Persona hero (Home landing) and slim per-view header, both built from .point-of-light.
   The orb/star is the deliberate JARVIS-style centerpiece: largest element on the
   page, dominating the top of the screen, with the conversational input attached
   directly to its base rather than floating as a disconnected form. */
.persona-hero { text-align: center; padding: 68px 0 32px; }
.hero-orb-wrap { display: flex; flex-direction: column; align-items: center; }
.persona-hero .point-of-light.lg {
  margin: 0 auto;
  width: clamp(280px, 34vw, 420px);
  height: clamp(280px, 34vw, 420px);
  box-shadow:
    0 0 50px 14px rgba(255,255,255,0.75),
    0 0 110px 32px rgba(160,190,255,0.35),
    0 0 200px 70px rgba(160,190,255,0.12);
  animation: twinkle 6s ease-in-out infinite;
  transition: box-shadow 0.3s ease;
}
.hero-orb-stem {
  width: 2px; height: 32px; margin-top: 4px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.75), rgba(255,255,255,0));
}
:root[data-persona="kernel"] .hero-orb-stem {
  background: linear-gradient(to bottom, rgba(224,165,48,0.85), rgba(224,165,48,0));
}
/* Scale only -- no brightness filter -- since filter: brightness() also
   amplifies the box-shadow halo, which otherwise washes out the "Talk to"
   label and copy sitting in its glow at the peak of the cycle. */
@keyframes twinkle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
/* Listening state: the orb visibly reacts when the talk input is focused --
   noticeably livelier than the idle twinkle, but still a gentle glow shift
   rather than a flash. */
.persona-hero .point-of-light.lg.listening,
.persona-hero .point-of-light.lg.pulsing {
  animation: listening-pulse 1.6s ease-in-out infinite;
  box-shadow:
    0 0 55px 16px rgba(255,255,255,0.82),
    0 0 120px 35px rgba(160,190,255,0.4),
    0 0 215px 75px rgba(160,190,255,0.14);
}
@keyframes listening-pulse {
  0%, 100% { transform: scale(1.02); }
  50% { transform: scale(1.07); }
}

/* v8: Polaris-only responsive fix -- the hero's vertical footprint (padding
   + orb + stem + heading + paragraph + talk block) comfortably exceeded
   800px, pushing "Talk to Polaris" below the fold with no visual cue there
   was more, on any real laptop viewport at 100% zoom. Shrinks the whole
   stack to fit within ~600px. Also trims the orb's bloom radius so it
   doesn't wash out the branching network sitting behind it. v10: Kernel
   gets the exact same shrink now (it gets the same dense star-chart +
   network Home as Polaris this round) -- just its own gold glow. */
:root[data-persona="polaris"] .persona-hero,
:root[data-persona="kernel"] .persona-hero { padding: 36px 0 24px; }
/* v9: shrunk again to roughly a third of the v8 size -- the orb should
   read as a prominent bright star, not a sun crowding out the (now much
   richer) constellation behind it. Bloom radii scaled down to match. */
:root[data-persona="polaris"] .persona-hero .point-of-light.lg,
:root[data-persona="kernel"] .persona-hero .point-of-light.lg {
  width: clamp(64px, 7vw, 90px);
  height: clamp(64px, 7vw, 90px);
}
:root[data-persona="polaris"] .persona-hero .point-of-light.lg {
  box-shadow:
    0 0 14px 4px rgba(255,255,255,0.65),
    0 0 28px 8px rgba(160,190,255,0.25),
    0 0 48px 14px rgba(160,190,255,0.09);
}
:root[data-persona="kernel"] .persona-hero .point-of-light.lg {
  box-shadow:
    0 0 14px 4px rgba(224,165,48,0.65),
    0 0 28px 8px rgba(224,165,48,0.3),
    0 0 48px 14px rgba(224,165,48,0.1);
}
:root[data-persona="polaris"] .persona-hero .point-of-light.lg.listening,
:root[data-persona="polaris"] .persona-hero .point-of-light.lg.pulsing {
  box-shadow:
    0 0 16px 5px rgba(255,255,255,0.72),
    0 0 32px 9px rgba(160,190,255,0.3),
    0 0 54px 16px rgba(160,190,255,0.11);
}
:root[data-persona="kernel"] .persona-hero .point-of-light.lg.listening,
:root[data-persona="kernel"] .persona-hero .point-of-light.lg.pulsing {
  box-shadow:
    0 0 16px 5px rgba(224,165,48,0.72),
    0 0 32px 9px rgba(224,165,48,0.34),
    0 0 54px 16px rgba(224,165,48,0.12);
}
:root[data-persona="polaris"] .hero-orb-stem,
:root[data-persona="kernel"] .hero-orb-stem { height: 20px; }
:root[data-persona="polaris"] .persona-hero h1,
:root[data-persona="kernel"] .persona-hero h1 { margin: 12px 0 0; font-size: 30px; }
:root[data-persona="polaris"] .persona-hero p,
:root[data-persona="kernel"] .persona-hero p { margin: 12px auto 0; }
:root[data-persona="polaris"] .persona-hero .hero-talk-block,
:root[data-persona="kernel"] .persona-hero .hero-talk-block { margin: 14px auto 0; }

.persona-hero h1 { margin: 18px 0 0; font-size: 34px; }
.persona-hero p { color: var(--muted); font-size: 13px; max-width: 560px; margin: 24px auto 0; line-height: 1.5; }
.persona-hero .hero-subhead { color: var(--muted); font-size: 12px; max-width: 560px; margin: 10px auto 0; line-height: 1.5; }
.persona-hero .hero-activity-line { color: var(--accent); font-size: 12px; margin: 14px auto 0; }
.hero-clickable { cursor: pointer; text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 0.15s ease; }
.hero-clickable:hover { text-decoration-color: currentColor; }
/* v10: voice briefing triggers -- Home's "Brief me" line, the header
   trigger's play icon, and Watchdog's play button all share this. */
.voice-play-label {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 12px; color: var(--accent);
}
.voice-play-label svg { flex-shrink: 0; }
.voice-play-label.pulsing { animation: listening-pulse 1.6s ease-in-out infinite; }
/* The activity line + opportunity line read as one joined summary line
   ("N contracts awaiting sign-off · N opportunities: ...") for Kernel,
   each half independently clickable through to Mark-to-Market. */
.persona-hero .hero-activity-line + .hero-opportunity::before { content: "\00b7"; margin-right: 8px; opacity: 0.6; }
.persona-hero .hero-talk-block { max-width: 640px; margin: 22px auto 0; }
.persona-hero .hero-talk-label {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 25px; font-weight: 800; color: var(--accent); margin: 0 0 16px; letter-spacing: 0.2px;
}
.persona-hero .hero-talk-label svg { flex-shrink: 0; }
.persona-hero .hero-input-row { display: flex; gap: 10px; margin: 0; }
.persona-hero .hero-opportunity { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); vertical-align: baseline; }
.persona-hero .hero-activity-line:has(+ .hero-opportunity) { display: inline-block; margin-right: 0; }
.hero-connections { margin: 30px auto 0; max-width: 640px; }
.hero-connections-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.hero-connections-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.connection-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 18px; font-size: 13px; font-weight: 600; color: var(--text);
}
.connection-chip svg { color: var(--accent); flex-shrink: 0; }
.connection-chip-more { color: var(--muted); font-weight: 600; border-style: dashed; }
.persona-hero .hero-input-row input {
  flex: 1; background: var(--panel-2); border: 1.5px solid var(--accent);
  border-radius: 12px; padding: 18px 20px; color: var(--text); font-size: 17px;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.2), 0 0 26px 2px rgba(var(--accent-rgb), 0.28);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.persona-hero .hero-input-row input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35), 0 0 44px 6px rgba(var(--accent-rgb), 0.5);
}
.persona-hero .hero-input-row button {
  background: var(--accent); border: none; color: #10131a; font-weight: 700;
  padding: 18px 30px; border-radius: 12px; cursor: pointer; font-size: 16px;
}

.view-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.view-header h2 { margin: 0; font-size: 15px; }
.view-header p { color: var(--muted); font-size: 12px; margin: 3px 0 0; max-width: 640px; line-height: 1.4; }

.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.live { color: var(--green); border-color: var(--green); }
.badge.offline { color: var(--amber); border-color: var(--amber); }

.persona-toggle { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.persona-toggle button {
  background: none; border: none; color: var(--muted); padding: 6px 14px;
  border-radius: 999px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.persona-toggle button.active { background: var(--accent-tint); color: var(--accent); }

.user-indicator { position: relative; }
.user-indicator-btn {
  display: flex; align-items: center; gap: 8px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
  cursor: pointer; color: var(--text); font-size: 12px; font-weight: 600;
}
/* This reads as an individual using their own product, not a footnote --
   deliberately the most prominent text in the header row after the brand. */
.user-indicator-btn .user-name { font-size: 15px; font-weight: 700; }
.user-indicator-btn .user-caret { color: var(--muted); font-size: 9px; }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 140px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px; display: none; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); font-size: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.user-dropdown-item:hover { background: var(--panel); }

nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
}
nav button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 2px solid transparent;
}
nav button.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}
/* Nav visibility per persona, driven by each button's data-scope
   ("polaris", "kernel", or "both") rather than a single hardcoded tab. */
nav button[data-scope="kernel"] { display: none; }
:root[data-persona="kernel"] nav button[data-scope="polaris"] { display: none; }
:root[data-persona="kernel"] nav button[data-scope="kernel"] { display: inline-block; }

main { padding: 24px 0 80px; width: 94%; max-width: 1440px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

.chat-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: #10131a; }
.msg.agent { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.msg.system { align-self: center; color: var(--muted); font-size: 12px; font-style: italic; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.actions span { font-size: 11px; background: var(--panel); border: 1px solid var(--border); padding: 3px 8px; border-radius: 999px; color: var(--muted); }

.chat-input { display: flex; border-top: 1px solid var(--border); padding: 12px; gap: 8px; }
.chat-input input { flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 14px; }
.chat-input button { background: var(--accent); border: none; color: #10131a; font-weight: 600; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.chat-input button:disabled { opacity: 0.5; cursor: default; }

.verdict-card {
  margin-top: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.verdict-card h3 { margin: 0 0 8px; font-size: 15px; }
.decision-pill { display: inline-block; font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.decision-pill.GREEN_LIGHT { background: var(--green-tint); color: var(--green); }
.decision-pill.REFINE { background: var(--amber-tint); color: var(--amber); }
.decision-pill.REDIRECT { background: var(--red-tint); color: var(--red); }
.decision-pill.sandbox-pill { background: var(--accent-tint); color: var(--accent); }
.score-row { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.score-chip { font-size: 12px; color: var(--muted); background: var(--panel); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); }
.pillar-read-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pillar-read { font-size: 13px; color: var(--text); }
.pillar-read strong { color: var(--muted); font-weight: 600; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.summary-card .num { font-size: 26px; font-weight: 700; }
.summary-card .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
tr:last-child td { border-bottom: none; }

.suggestion-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--border); }
.suggestion-row button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; }

.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-heading h2 { font-size: 15px; margin: 0; }
.section-heading .btn-primary { background: var(--accent); color: #10131a; border: none; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.section-heading:first-child, main > .section-heading:first-of-type { margin-top: 0; }

.hierarchy-group { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.hierarchy-group .breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.hierarchy-group .breadcrumb b { color: var(--text); }
.hierarchy-group table { border: none; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.package-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.package-card h4 { margin: 0 0 8px; font-size: 13px; text-transform: capitalize; }
.package-card ul { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.package-card .assignees { margin-top: 10px; font-size: 11px; color: var(--muted); }

.collab-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.collab-card h4 { margin: 0 0 4px; font-size: 13px; }
.collab-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.collab-category-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.collab-card .origin { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.collab-card .summary { font-size: 12px; color: var(--muted); }
.collab-usage-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.collab-usage-label { font-size: 11px; color: var(--muted); }
.collab-card .adoption { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; }
.collab-card .adoption b { color: var(--green); }
.collab-customer-attr {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px;
  color: var(--green);
}
.collab-customer-attr b { color: var(--text); }
.collab-idled-full { width: 100%; }
.escalation-track { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 8px 0; font-size: 10.5px; }
.escalation-step { color: var(--muted); padding: 2px 6px; border-radius: 999px; border: 1px solid var(--border); }
.escalation-step.reached { color: var(--text); }
.escalation-step.current { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.escalation-arrow { color: var(--muted); }

.extras-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.extra-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.extra-card h4 { margin: 0 0 10px; font-size: 13px; }
.extra-row { font-size: 12px; padding: 8px 0; border-top: 1px solid var(--border); color: var(--muted); }
.extra-row:first-of-type { border-top: none; padding-top: 0; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.clear, .status-dot.connected, .status-dot.outperforming { background: var(--green); }
.status-dot.change_detected, .status-dot.degraded, .status-dot.at_risk { background: var(--amber); }
.status-dot.offline { background: var(--red); }

.pulse-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.pulse-card .biz-name { font-size: 13px; font-weight: 600; }
.pulse-card .pulse-headline-stat { font-size: 19px; font-weight: 700; margin-top: 6px; }
.pulse-card .signal { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Watchdog rail content -- prominent bordered panel treatment (this used
   to be the old Alignment tab's watchdog column). */
.watchdog-rail-content {
  background: var(--panel-2); border: 1px solid var(--amber); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.watchdog-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--amber); background: var(--amber-tint);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}
.watchdog-rail-content h2 { margin: 0; font-size: 21px; }
.watchdog-rail-content #watchdog-subtitle { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }

.signal-item { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.signal-item:last-child { margin-bottom: 0; }
.signal-item .headline { font-size: 14px; font-weight: 700; line-height: 1.4; }
.signal-item .note { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.variance-pos { color: var(--green); font-weight: 600; }
.variance-neg { color: var(--red); font-weight: 600; }
.projected-tag { color: var(--muted); font-style: italic; font-size: 11px; }
.extra-empty { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .extras-grid { grid-template-columns: 1fr; }
}

.connections-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.connection-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.connection-card .conn-name { font-size: 13px; font-weight: 600; }
.connection-card .conn-status { font-size: 11px; text-transform: capitalize; color: var(--muted); margin-left: 4px; }
.connection-card .conn-role { font-size: 12px; color: var(--muted); margin-top: 4px; }
.connection-card .conn-sync { font-size: 11px; color: var(--muted); margin-top: 8px; }
.connection-card .conn-note { font-size: 11px; color: var(--amber); margin-top: 6px; }

/* Merchandiser OS / Kernel grain desk */
.commodity-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.commodity-tabs button { background: var(--panel); border: 1px solid var(--border); color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.commodity-tabs button.active { color: var(--text); border-color: var(--accent); background: var(--panel-2); }

.os-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.os-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.os-card h3 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.os-stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.os-stat { min-width: 92px; }
.os-stat .num { font-size: 20px; font-weight: 700; }
.os-stat .label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.os-mini-table { width: 100%; border-collapse: collapse; }
.os-mini-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; padding: 4px 8px 8px 0; }
.os-mini-table td { padding: 6px 8px 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.os-mini-table tr:last-child td { border-bottom: none; }
.os-empty { color: var(--muted); font-size: 13px; }
.os-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; line-height: 1.4; }
.os-action { border-top: 1px solid var(--border); padding: 10px 0; }
.os-action:first-of-type { border-top: none; padding-top: 0; }
.os-action-label { font-size: 13px; font-weight: 600; }
.os-action-rationale { font-size: 12px; color: var(--muted); margin-top: 2px; }
.os-action .actions { margin-top: 6px; }
.alert-banner { background: var(--amber-tint); border: 1px solid var(--amber); border-left: 4px solid var(--amber); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.alert-banner .alert-label { font-size: 13px; font-weight: 600; color: var(--text); }
.alert-banner .alert-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alert-banner.alert-clear { background: var(--panel); border-color: var(--border); border-left-color: var(--green); }
.os-idea { border-top: 1px solid var(--border); padding: 10px 0; }
.os-idea:first-of-type { border-top: none; padding-top: 0; }
.os-idea .impact { color: var(--green); font-weight: 700; font-size: 13px; }
@media (max-width: 800px) {
  .os-grid { grid-template-columns: 1fr; }
}

/* Mark-to-Market grid + cards */
.mtm-grid-table { width: 100%; border-collapse: collapse; }
.mtm-grid-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); background: none; }
.mtm-grid-table td { padding: 8px 10px; font-size: 12px; border-bottom: 1px solid var(--border); border-radius: 4px; }
.mtm-grid-table tr:last-child td { border-bottom: none; }
.mtm-grid-table .region-cell { font-size: 12px; color: var(--text); font-weight: 600; white-space: nowrap; }
.mtm-cell { transition: outline 0.15s ease; }
.mtm-cell .netback { font-weight: 700; }
.mtm-cell .sub { color: var(--muted); font-size: 10px; margin-top: 2px; }
.mtm-cell.highlight { outline: 2px solid var(--accent); outline-offset: -2px; }
.mtm-legend { font-size: 11px; color: var(--muted); margin: 8px 0 20px; }
.mtm-lock { font-size: 10px; margin-left: 5px; opacity: 0.7; cursor: help; }

/* Presentation-only execution confirmation toast. */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--green); color: var(--text);
  padding: 14px 22px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.open { opacity: 1; transform: translateX(-50%) translateY(0); }

.mtm-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 4px; }

.mtm-contracts-table td, .mtm-contracts-table th { font-size: 12px; }
.mtm-mtm-pos { color: var(--green); font-weight: 600; }
.mtm-mtm-neg { color: var(--red); font-weight: 600; }
.ledger-status-open { color: var(--muted); }
.ledger-status-needs_wash { color: var(--amber); font-weight: 600; }
.ledger-status-complete { color: var(--green); }

.dec-badge {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 4px;
  padding: 1px 5px; margin-left: 6px; vertical-align: middle;
}

/* DEC position hero -- the first thing a CreditCrop visitor sees, per the
   brief's explicit "DEC must be the first thing they think" requirement. */
.dec-hero {
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.dec-hero-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--accent); background: var(--accent-tint);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
/* v9: bold and a bit larger than body text, but NOT the .ds-hero-number
   scale (40-72px) -- that read as an obnoxiously giant number out of line
   with the rest of the card's fonts. */
.dec-hero-stat { font-size: 24px; font-weight: 700; color: var(--text); margin-top: 2px; }
.dec-hero-stat .unit { font-size: 0.55em; font-weight: 500; color: var(--muted); margin-left: 6px; }

/* The New Playbook's "how it works" strip -- self-explanatory without a
   narrator, so the tab makes sense cold. */
.how-it-works-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 800px) { .how-it-works-strip { grid-template-columns: 1fr; } }
.hiw-step { display: flex; gap: 14px; align-items: flex-start; }
.hiw-step .hiw-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  background: var(--accent-tint); color: var(--accent);
}
.hiw-step .hiw-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.hiw-step .hiw-body { font-size: 12px; color: var(--muted); line-height: 1.4; }

.kernel-caption-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--panel); border-top: 1px solid var(--border);
  padding: 14px 28px; text-align: center; font-size: 13px; color: var(--muted);
}
.kernel-caption-bar strong { color: var(--accent); }

/* Ask Polaris / Ask Kernel -- one shared button (relabeled/re-endpointed per
   persona at runtime, see app.js) + slide-over panel. v9: the floating
   unlabeled dot nobody could find is gone -- Polaris's version now docks in
   the header as a clearly-labeled, obviously-clickable "Talk to Polaris"
   affordance (small light + text), inline with the persona/tab controls.
   Kernel's "Handle It" stays exactly as it was pre-v9 -- floating,
   bottom-right -- via the persona-scoped override below. */
.polaris-launcher {
  /* v10: docked inline at the far right of the tab row (nav is a flex
     container) instead of floating in the corner -- clearly labeled,
     inline with the other controls, not background decoration. Same
     element/position for both personas now (see the Kernel dot-color
     override below); Kernel's old separate floating pill is gone.
     margin-left:auto lives on .voice-tab-play (the sibling right before
     this one) so the pair gets pushed to the far right together. */
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--text); transition: background 0.15s ease;
}
.polaris-launcher:hover { background: rgba(var(--accent-rgb), 0.1); }
.polaris-launcher .dot {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 10px 3px rgba(255,255,255,0.7), 0 0 18px 6px rgba(160,190,255,0.3);
  animation: twinkle 6s ease-in-out infinite;
  transition: box-shadow 0.3s ease;
}
.polaris-launcher.pulsing .dot {
  animation: listening-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 14px 4px rgba(255,255,255,0.85), 0 0 22px 8px rgba(160,190,255,0.4);
}

/* v10: Kernel gets the exact same inline nav-docked trigger as Polaris now
   (its old separate floating pill is gone) -- just its own gold glow,
   matching the gold used for Kernel's hero orb elsewhere in this file. */
:root[data-persona="kernel"] .polaris-launcher .dot {
  box-shadow: 0 0 10px 3px rgba(224,165,48,0.7), 0 0 18px 6px rgba(224,165,48,0.3);
}
:root[data-persona="kernel"] .polaris-launcher.pulsing .dot {
  box-shadow: 0 0 14px 4px rgba(224,165,48,0.85), 0 0 22px 8px rgba(224,165,48,0.4);
}

/* Header trigger's play affordance -- offers the current tab's voice brief
   without opening the chat panel. Reuses .pulsing (same keyframe as the
   launcher dot) while a clip plays. Kernel doesn't get voice this round --
   hidden via the existing nav data-scope mechanism (button[data-scope=
   "polaris"], same rule every other Polaris-only nav item already uses). */
.voice-tab-play {
  margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: none; border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease;
}
.voice-tab-play::before {
  content: ""; display: block; width: 0; height: 0;
  border-style: solid; border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 2px;
}
.voice-tab-play:hover { border-color: var(--accent); color: var(--accent); }
.voice-tab-play.pulsing { border-color: var(--accent); color: var(--accent); animation: listening-pulse 1.6s ease-in-out infinite; }

#polaris-panel-backdrop {
  position: fixed; inset: 0; background: rgba(3,5,10,0.55); z-index: 45;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
#polaris-panel-backdrop.open { opacity: 1; pointer-events: auto; }

#polaris-panel {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 92vw; height: 100vh;
  background: var(--panel); border-left: 1px solid var(--border);
  transition: right 0.25s ease; z-index: 46; display: flex; flex-direction: column;
}
#polaris-panel.open { right: 0; }
#polaris-panel .panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
#polaris-panel .panel-head h3 { margin: 0; font-size: 14px; }
#polaris-panel .panel-head .mode-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
#polaris-panel .panel-close { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }

/* Constellation node graph (v6 centerpiece) -- same visual language as the
   starfield: every business is a star, connections are faint light traces. */
.constellation-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.constellation-breadcrumb { font-size: 13px; color: var(--muted); flex: 1 1 auto; min-width: 160px; }
.constellation-breadcrumb button {
  background: none; border: none; color: var(--accent); font-size: 13px; cursor: pointer; padding: 0;
}
.constellation-breadcrumb button:hover { text-decoration: underline; }
.constellation-breadcrumb .crumb-sep { margin: 0 6px; color: var(--muted); }
.constellation-breadcrumb .crumb-current { color: var(--text); font-weight: 600; }

/* v8: level breadcrumb -- a small, visually prominent (not tiny gray text)
   indicator of what scope a tab's numbers represent, so a viewer is never
   unsure whether they're looking at the whole portfolio or one business.
   Shared by every Polaris tab: Constellation upgrades its existing dynamic
   breadcrumb to this same treatment; other tabs render a static one via
   renderLevelBreadcrumb(). */
.level-breadcrumb, .constellation-breadcrumb {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: rgba(var(--accent-rgb), 0.08); border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600;
  color: var(--muted); margin: 2px 0 18px;
}
.level-breadcrumb .crumb-sep { margin: 0 2px; color: var(--muted); opacity: 0.6; }
.level-breadcrumb .crumb-current, .constellation-breadcrumb .crumb-current {
  color: var(--accent); font-weight: 700;
}
.level-breadcrumb-scope-note {
  font-size: 11.5px; color: var(--muted); font-style: italic; margin: -10px 0 16px;
}
.constellation-search {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; width: 220px;
}
/* v7: the graph owns the full stage -- Watchdog is a collapsible rail
   (see below) instead of a fixed-width column, and the guidelines panel is
   a slide-in overlay next to the canvas instead of living below the fold. */
.constellation-stage { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
@media (max-width: 980px) { .constellation-stage { grid-template-columns: 1fr; } }
.constellation-graph-col { min-width: 0; }
.constellation-canvas-wrap {
  position: relative; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.03), transparent 70%);
}
#constellation-canvas { display: block; width: 100%; height: 620px; cursor: pointer; }
.constellation-hint { font-size: 11.5px; color: var(--muted); margin: 8px 2px 0; }
.constellation-tooltip {
  position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 12px; max-width: 220px; z-index: 5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35); display: none;
}
.constellation-tooltip .ct-name { font-weight: 700; margin-bottom: 4px; }
.constellation-tooltip .ct-row { color: var(--muted); font-size: 11.5px; }
.constellation-rollout-caption {
  display: none; position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: rgba(10,13,20,0.72); border: 1px solid rgba(var(--accent-rgb),0.3);
  color: var(--text); font-size: 12.5px; font-weight: 600; padding: 7px 16px;
  border-radius: 999px; z-index: 4; white-space: nowrap;
}

/* Guidelines side overlay -- the core of the whole concept, so it opens
   right next to the graph on node click instead of living below the fold. */
.constellation-guidelines-overlay {
  position: absolute; top: 14px; right: 14px; bottom: 14px; width: 320px;
  max-width: calc(100% - 28px); padding: 18px 20px; overflow-y: auto; z-index: 6;
  transform: translateX(calc(100% + 14px)); opacity: 0; pointer-events: none;
  transition: transform var(--motion-med) var(--ease), opacity var(--motion-med) var(--ease);
}
.constellation-guidelines-overlay.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.constellation-guidelines-overlay .cg-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.constellation-guidelines h4 { margin: 0 26px 4px 0; font-size: 15px; }
.constellation-guidelines .cg-note { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.constellation-guidelines .cg-inherited { border-left: 3px solid var(--border); padding-left: 10px; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.constellation-guidelines .cg-inherited b { color: var(--text); }
.constellation-guidelines .cg-local { border-left: 3px solid var(--accent); padding-left: 10px; margin-top: 10px; font-size: 12.5px; }
.constellation-guidelines .cg-shared-section { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.constellation-guidelines .cg-shared-section h5 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.constellation-guidelines .cg-playbook { margin-bottom: 10px; font-size: 12px; }
.constellation-guidelines .cg-playbook b { display: block; color: var(--text); }
.constellation-guidelines .cg-playbook span { color: var(--muted); }
.constellation-guidelines .cg-permission { margin-bottom: 8px; font-size: 12px; }
.constellation-guidelines .cg-permission b { color: var(--text); }

/* Watchdog collapsible right rail -- collapses to a thin strip so the
   graph can own the stage. */
.constellation-watchdog-rail {
  position: relative; width: 420px; transition: width var(--motion-med) var(--ease); flex-shrink: 0;
}
.constellation-watchdog-rail.collapsed { width: 44px; }
.constellation-watchdog-rail .watchdog-rail-content {
  width: 420px; opacity: 1; transition: opacity var(--motion-fast) var(--ease);
  /* Caps the rail to the canvas's own 620px so its own (often long) content
     scrolls internally instead of stretching the whole stage row and
     pushing Duplicative-Build far down the page. */
  max-height: 620px; overflow-y: auto;
}
.constellation-watchdog-rail.collapsed .watchdog-rail-content { opacity: 0; pointer-events: none; }
.watchdog-collapse-btn {
  position: absolute; top: 4px; left: -14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2;
  transition: transform var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.watchdog-collapse-btn:hover { border-color: var(--accent); color: var(--accent); }
.constellation-watchdog-rail.collapsed .watchdog-collapse-btn { transform: rotate(180deg); }
.watchdog-headline-stat {
  font-size: 20px; font-weight: 700; color: var(--accent); margin: 4px 0 16px;
}
.seeded-source-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-top: 1px solid var(--border); font-size: 12.5px;
}
.seeded-source-row:first-child { border-top: none; }
.seeded-source-row .ss-name { flex: 1 1 auto; }
.seeded-source-row .ss-kind { color: var(--muted); font-size: 11px; text-transform: capitalize; margin-left: 6px; }
.seeded-source-actions button {
  background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 6px;
  font-size: 11px; padding: 3px 8px; margin-left: 4px; cursor: pointer;
}
.seeded-source-actions button.active-approve { border-color: var(--green); color: var(--green); }
.seeded-source-actions button.active-deny { border-color: var(--red); color: var(--red); }
.seeded-source-actions button.active-tag { border-color: var(--amber); color: var(--amber); }

/* =========================================================================
   V7 DESIGN SYSTEM. Shared component classes (.os-card, .card-grid,
   .summary-card, .os-stat, .os-mini-table, .badge, buttons,
   .section-heading) are scoped per-persona under :root[data-persona=...]
   -- same mechanism already used for color tokens (see the top of this
   file) -- rather than applied unscoped, so each persona's rendered CSS is
   provably intentional, not a shared accident. v7-v9 scoped this to Polaris
   only, deliberately leaving Kernel unchanged while the system was being
   built out. v10: Kernel is brought up to the same standard -- every rule
   below now matches BOTH personas (its colors already resolve correctly
   per persona via the existing --accent/--accent-rgb fork, so this is pure
   selector broadening, no new declarations). Genuinely Polaris-exclusive
   views (Constellation, New Playbook, Returns, Collaborative, AI P&L) use
   the .ds-* classes directly or their own bespoke classes, unaffected
   either way since Kernel's markup never renders them. ==================== */

/* --- Motion utilities --- */
.ds-enter { opacity: 0; transform: translateY(10px); }
.ds-enter-active {
  opacity: 1; transform: translateY(0);
  transition: opacity var(--motion-med) var(--ease), transform var(--motion-med) var(--ease);
}

/* --- Typography: big light-weight numerals for hero figures, small
   uppercase letter-spaced labels for everything else --- */
.ds-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); font-weight: 600;
}
.ds-hero-number {
  font-size: clamp(40px, 6vw, 72px); font-weight: 200; line-height: 1.05;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text);
}
.ds-hero-number .unit { font-size: 0.4em; font-weight: 500; color: var(--muted); margin-left: 8px; }

/* --- Glass surface (for genuinely Polaris-only components) --- */
.ds-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.05), 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: box-shadow var(--motion-med) var(--ease), border-color var(--motion-med) var(--ease), transform var(--motion-med) var(--ease);
}
.ds-glass:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.14), 0 10px 36px rgba(0,0,0,0.4);
}

/* --- Icon glow (custom line icons only -- no emoji, no icon fonts) --- */
.ds-icon-glow { filter: drop-shadow(0 0 3px rgba(var(--accent-rgb), 0.5)); }

/* --- Data-viz primitives --- */
.ds-hbar-track { background: rgba(var(--accent-rgb), 0.12); border-radius: 999px; height: 6px; overflow: hidden; }
.ds-hbar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 600ms var(--ease); }

/* --- Glass/numeral/motion treatment for shared components, both personas --- */
:root[data-persona="polaris"] .os-card,
:root[data-persona="polaris"] .summary-card,
:root[data-persona="polaris"] .collab-card,
:root[data-persona="polaris"] .package-card,
:root[data-persona="polaris"] .pulse-card,
:root[data-persona="kernel"] .os-card,
:root[data-persona="kernel"] .summary-card,
:root[data-persona="kernel"] .collab-card,
:root[data-persona="kernel"] .package-card,
:root[data-persona="kernel"] .pulse-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.05), 0 8px 28px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.03);
  transition: box-shadow var(--motion-med) var(--ease), border-color var(--motion-med) var(--ease), transform var(--motion-med) var(--ease);
}
:root[data-persona="polaris"] .os-card:hover,
:root[data-persona="polaris"] .summary-card:hover,
:root[data-persona="polaris"] .collab-card:hover,
:root[data-persona="polaris"] .package-card:hover,
:root[data-persona="polaris"] .pulse-card:hover,
:root[data-persona="kernel"] .os-card:hover,
:root[data-persona="kernel"] .summary-card:hover,
:root[data-persona="kernel"] .collab-card:hover,
:root[data-persona="kernel"] .package-card:hover,
:root[data-persona="kernel"] .pulse-card:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.12), 0 12px 36px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}
:root[data-persona="polaris"] .os-stat .num,
:root[data-persona="polaris"] .summary-card .num,
:root[data-persona="kernel"] .os-stat .num,
:root[data-persona="kernel"] .summary-card .num {
  font-size: 32px; font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
:root[data-persona="polaris"] .os-stat .label,
:root[data-persona="polaris"] .summary-card .label,
:root[data-persona="kernel"] .os-stat .label,
:root[data-persona="kernel"] .summary-card .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
:root[data-persona="polaris"] .card-grid,
:root[data-persona="kernel"] .card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
:root[data-persona="polaris"] .section-heading,
:root[data-persona="kernel"] .section-heading {
  border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
:root[data-persona="polaris"] .section-heading h2,
:root[data-persona="kernel"] .section-heading h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--text);
}
:root[data-persona="polaris"] button,
:root[data-persona="kernel"] button {
  transition: transform var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
:root[data-persona="polaris"] .btn-primary:hover,
:root[data-persona="kernel"] .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.35);
}
:root[data-persona="polaris"] .os-mini-table td,
:root[data-persona="kernel"] .os-mini-table td {
  transition: background var(--motion-fast) var(--ease);
}
:root[data-persona="polaris"] .os-mini-table tr:hover td,
:root[data-persona="kernel"] .os-mini-table tr:hover td {
  background: rgba(var(--accent-rgb), 0.05);
}
:root[data-persona="polaris"] .badge,
:root[data-persona="polaris"] .decision-pill,
:root[data-persona="kernel"] .badge,
:root[data-persona="kernel"] .decision-pill {
  letter-spacing: 0.04em;
}

/* --- Home branching light network (Polaris only) -- sits behind the
   persona-hero content, previewing the Constellation concept. #view-home
   is the positioning context; the hero markup stays z-index 1 above it. --- */
#view-home { position: relative; }
#home-network-canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; display: none; }
#home-hero { position: relative; z-index: 1; }
#polaris-panel .chat-panel { flex: 1; border: none; border-radius: 0; }
