/* Mason Ventures Design System v1 (LOCKED) — tokens + shared components.
   Spec: docs/OWNER_APP_DESIGN_SYSTEM.md. Screens use these classes/tokens only. */

:root {
  /* typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  /* foundation */
  --black: #030507;
  --bg: #020509;
  --bg-elevated: #080d14;
  --surface-1: #0a1018;
  --surface-2: #0d141e;
  --surface-3: #111a26;

  /* text */
  --text-1: #f5f7fa;
  --text-2: #a9b2c1;
  --text-3: #6e7888;
  --text-disabled: #46505e;
  --nav-idle: #9aa5b4;

  /* lines */
  --border-quiet: rgba(170, 195, 225, .07);
  --border-card: rgba(170, 195, 225, .12);
  --border-strong: rgba(170, 195, 225, .20);
  --border-active: rgba(67, 140, 255, .40);

  /* product */
  --blue: #287bff;
  --blue-bright: #4a9cff;
  --cyan: #18d7e8;
  --teal: #19e0bc;

  /* semantic */
  --success: #20d9a3;
  --warning: #f6b94a;
  --danger: #ff5263;
  --purple: #b14cff;
  --pink: #f34fba;

  /* fixed status palette */
  --st-online: #21d7a4;
  --st-running: #429bff;
  --st-working: #f2b84b;
  --st-idle: #d05aff;
  --st-warning: #ffaa3c;
  --st-blocked: #ff5366;
  --st-offline: #667080;
  --st-measuring: #20d7cb;
  --st-validating: #b84dff;
  --st-building: #398cff;

  /* radius / spacing */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --pad: 16px;
  --gap: 12px;

  /* depth + light */
  --shadow-card: 0 12px 35px rgba(0, 0, 0, .32);
  --shadow-float: 0 24px 70px rgba(0, 0, 0, .52);
  --glow-blue: 0 0 8px rgba(65, 145, 255, .45), 0 0 22px rgba(34, 112, 255, .20), 0 0 48px rgba(25, 83, 190, .10);
  --ui-glow: 0 0 8px rgba(65, 145, 255, .45), 0 0 22px rgba(34, 112, 255, .20);
  --brand-glow: 0 0 10px rgba(84, 155, 255, .25), 0 0 32px rgba(43, 105, 225, .10);
  --logo-primary: #f4f7fb;
  --logo-secondary: #a7b0bd;

  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fast: 120ms; --normal: 180ms; --slow: 280ms;

  /* layout */
  --sidebar-w: 216px;
  --rail-w: 320px;
  --max-w: 1600px;
  --bottom-nav-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* compatibility aliases used by screen styles */
  --bg-0: var(--black); --bg-1: var(--bg); --bg-2: var(--bg-elevated);
  --surface: rgba(10, 16, 24, .82); --surface-solid: var(--surface-1); --surface-hover: rgba(17, 26, 38, .9);
  --border: var(--border-card);
  --text: var(--text-1); --text-4: var(--text-disabled);
  --accent: var(--blue); --accent-2: var(--blue-bright); --accent-glow: rgba(40, 123, 255, .35);
  --good: var(--success); --warn: var(--warning); --bad: var(--danger); --info: var(--st-running); --violet: var(--purple); --neutral: var(--st-offline);
  --font-sans: var(--font-ui); --font-serif: var(--font-display);
  --r: var(--r-md); --shadow: var(--shadow-float);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #020509;
  color: var(--text-1);
  font: 400 14px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { stroke-width: 1.7; }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; border-radius: var(--r-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: rgba(40, 123, 255, .4); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- brand ---------- */
.mark { display: block; color: var(--logo-primary); flex: none; }
.mark.lit { filter: drop-shadow(0 0 5px rgba(73, 145, 255, .45)) drop-shadow(0 0 15px rgba(42, 108, 255, .18)); }
.wordmark { font: 300 20px/1 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--text-1); }
.wordmark.sm { font-size: 13px; letter-spacing: .2em; }
.logo-subtitle { font: 500 9px/1 var(--font-ui); letter-spacing: .34em; text-transform: uppercase; color: #7d8796; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot .mark { animation: masonBoot 2s var(--ease) infinite; }
@keyframes masonBoot { 0%, 100% { opacity: .55; filter: drop-shadow(0 0 0 transparent); } 50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(65, 145, 255, .45)); } }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: flex; position: relative; isolation: isolate; }
.shell.earth-app::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-color: #020509;
  background-image:
    linear-gradient(90deg, rgba(2, 5, 9, .58) 0%, rgba(2, 5, 9, .22) 36%, rgba(2, 5, 9, 0) 70%),
    linear-gradient(180deg, rgba(2, 5, 9, .12) 0%, rgba(2, 5, 9, 0) 18%, rgba(2, 5, 9, .22) 62%, #020509 90%),
    url(/assets/backgrounds/earth-horizon-mobile.webp?v=owner-limb-2x),
    url(/assets/backgrounds/earth-horizon-mobile.jpg);
  background-repeat: no-repeat;
  background-position: left top, left top, right top, right top;
  background-size: auto, auto, cover, cover;
}
@media (min-width: 1024px) {
  .shell.earth-app::before {
    background-image:
      linear-gradient(90deg, rgba(2, 5, 9, .80) 0%, rgba(2, 5, 9, .32) 18%, rgba(2, 5, 9, .06) 40%, transparent 58%),
      linear-gradient(180deg, transparent 32%, rgba(2, 5, 9, .16) 58%, #020509 84%),
      url(/assets/backgrounds/earth-horizon.webp?v=owner-limb-2x),
      url(/assets/backgrounds/earth-horizon.jpg);
    background-position: left top, left top, right top, right top;
    background-size: auto, auto, 110% auto, 110% auto;
  }
}
.sidebar, .main, .bottom-nav { position: relative; z-index: 1; }
.main { flex: 1; min-width: 0; padding: calc(var(--safe-t) + 4px) 0 calc(var(--bottom-nav-h) + var(--safe-b) + 24px); background: transparent; }
.page { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }
.page.narrow { max-width: 780px; }
.glass {
  background: rgba(8, 16, 27, .68);
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  border: 1px solid rgba(145, 185, 230, .10);
}

.sidebar { display: none; }
.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  height: calc(var(--bottom-nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(5, 8, 13, .86); backdrop-filter: blur(18px) saturate(115%); -webkit-backdrop-filter: blur(18px) saturate(115%);
  border-top: 1px solid var(--border-card);
}
.bottom-nav a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 44px; color: var(--nav-idle); font-size: 10px; font-weight: 500; transition: color var(--normal) var(--ease); }
.bottom-nav a[aria-current="page"] { color: var(--text-1); }
.nav-ic { width: 40px; height: 26px; display: grid; place-items: center; border-radius: var(--r-sm); transition: box-shadow var(--normal) var(--ease), background var(--normal) var(--ease); }
.bottom-nav a[aria-current="page"] .nav-ic { color: #fff; background: rgba(42, 123, 255, .2); box-shadow: var(--ui-glow); }

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .main { padding: 16px 0 40px; }
  .page { padding: 0 24px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none; z-index: 2;
    padding: 20px 12px 14px; border-right: 1px solid rgba(145, 185, 230, .10);
    background: rgba(3, 8, 15, .78);
    backdrop-filter: blur(12px) saturate(115%);
    -webkit-backdrop-filter: blur(12px) saturate(115%);
  }
  .sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 26px; }
  .sidebar a.nav { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid transparent; color: var(--nav-idle); font-weight: 500; font-size: 13.5px; transition: color var(--normal) var(--ease), background var(--normal) var(--ease), box-shadow var(--normal) var(--ease); }
  .sidebar a.nav:hover { color: var(--text-1); background: rgba(255, 255, 255, .025); }
  .sidebar a.nav[aria-current="page"] {
    background: linear-gradient(90deg, rgba(42, 123, 255, .24), rgba(42, 123, 255, .07));
    border-color: rgba(78, 151, 255, .28);
    box-shadow: inset 0 0 20px rgba(30, 103, 235, .08), 0 0 20px rgba(28, 100, 235, .05);
    color: #fff;
  }
  .sidebar .count { margin-left: auto; font-size: 11px; min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--blue); color: #fff; }
  .sidebar .spacer { flex: 1; }
  .sidebar .owner { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--border-quiet); margin-top: 8px; }
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 0 8px; }
.topbar .grow { flex: 1; min-width: 0; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); color: var(--text-2); position: relative; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.icon-btn:hover { background: rgba(255, 255, 255, .035); color: var(--text-1); }
.icon-btn .dot { position: absolute; top: 11px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-bright); box-shadow: 0 0 0 2px var(--bg), var(--ui-glow); }
.searchbar { display: none; }
@media (min-width: 1024px) {
  .searchbar { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 640px; height: 40px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid rgba(145, 185, 230, .12); background: rgba(8, 16, 27, .52); backdrop-filter: blur(12px) saturate(115%); -webkit-backdrop-filter: blur(12px) saturate(115%); color: var(--text-3); transition: border-color var(--fast) var(--ease); }
  .searchbar:hover { border-color: var(--border-strong); }
  .searchbar kbd { margin-left: auto; font: 500 10.5px var(--font-ui); padding: 2px 7px; border-radius: var(--r-xs); border: 1px solid var(--border-card); color: var(--text-3); }
  .topbar .mobile-only { display: none; }
}

/* ---------- typography ---------- */
.display, .h-title, .serif { font-family: var(--font-display); font-weight: 500; letter-spacing: -.005em; }
.display { font-size: 30px; line-height: 1; margin: 0; }
.display.xl { font-size: 34px; }
.h-title { font-size: 28px; line-height: 1.02; margin: 0; }
.h-sec { font: 600 17px/1.3 var(--font-ui); margin: 0; color: var(--text-1); }
.card-title { font: 600 15px/1.35 var(--font-ui); color: var(--text-1); }
.eyebrow { font: 600 10.5px/1.2 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.faint { color: var(--text-disabled); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.small { font-size: 12.5px; line-height: 1.4; }
.tiny { font-size: 10.5px; line-height: 1.35; font-weight: 500; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 1024px) {
  .display { font-size: 38px; }
  .display.xl { font-size: 54px; }
  .h-title { font-size: 38px; }
  .h-sec { font-size: 18px; }
  .card-title { font-size: 16px; }
  .eyebrow { font-size: 11px; }
  .tiny { font-size: 11px; }
}

/* ---------- layout ---------- */
.stack > *, .stack-lg > *, .split > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .with-rail > * { min-width: 0; }
.stack { display: grid; gap: var(--gap); }
.stack-lg { display: grid; gap: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.grid-stats { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4, .grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 20px; align-items: start; }
  .with-rail { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 20px; align-items: start; }
  .rail { position: sticky; top: 16px; display: grid; gap: 16px; }
}
@media (min-width: 1440px) { :root { --rail-w: 340px; } }
.split > * + * { margin-top: 24px; }
@media (min-width: 1024px) { .split > * + * { margin-top: 0; } }

/* ---------- surfaces ---------- */
.card {
  background: rgba(8, 16, 27, .68);
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  border: 1px solid rgba(145, 185, 230, .10); border-radius: var(--r-md);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.card.pad-lg { padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.quiet { background: rgba(8, 16, 27, .48); backdrop-filter: blur(10px) saturate(115%); -webkit-backdrop-filter: blur(10px) saturate(115%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); border-color: rgba(145, 185, 230, .08); }
a.card, button.card { display: block; text-align: left; width: 100%; transition: border-color var(--normal) var(--ease), box-shadow var(--normal) var(--ease), transform var(--normal) var(--ease); }
a.card.row, button.card.row { display: flex; }
a.card.stack, button.card.stack { display: grid; }
a.card:hover, button.card:hover { border-color: rgba(77, 146, 255, .28); transform: translateY(-1px); }
.card.glow { border-color: var(--border-active); box-shadow: var(--shadow-card), 0 0 24px rgba(38, 113, 255, .08); }
.card.tone-warn { border-color: rgba(246, 185, 74, .28); }
.card.tone-violet { border-color: rgba(177, 76, 255, .28); }
.card.tone-bad { border-color: rgba(255, 82, 99, .28); }
.card.illuminate { animation: illuminateOnce 1.6s var(--ease) 1; }
@keyframes illuminateOnce { 0% { box-shadow: var(--shadow-card), 0 0 0 rgba(65, 145, 255, 0); } 40% { box-shadow: var(--shadow-card), 0 0 28px rgba(65, 145, 255, .28); } 100% { box-shadow: var(--shadow-card); } }
.divider { height: 1px; background: var(--border-quiet); margin: 12px 0; border: 0; }
.list { display: grid; }
.list > * + * { border-top: 1px solid var(--border-quiet); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 48px; }
a.list-row { transition: background var(--fast) var(--ease); border-radius: var(--r-xs); }
a.list-row:hover { background: rgba(255, 255, 255, .018); }
.list-row .chev { color: var(--text-disabled); flex: none; }

.section { display: grid; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a, .link { color: var(--text-2); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; transition: color var(--fast) var(--ease); }
.section-head a:hover, .link:hover { color: var(--text-1); }

/* ---------- cinematic heroes (L4: Home / Intelligence / Research / agent hero / onboarding only) ---------- */
.hero { position: relative; margin: 0 calc(var(--pad) * -1); padding: 32px var(--pad) 40px; overflow: visible; isolation: isolate; min-height: 280px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 8, 13, .88) 0%, rgba(5, 8, 13, .42) 26%, rgba(5, 8, 13, .08) 52%, rgba(5, 8, 13, 0) 78%),
    linear-gradient(180deg, rgba(5, 8, 13, 0) 70%, var(--bg) 100%),
    var(--hero-img, url(/assets/backgrounds/earth-horizon-mobile.webp?v=owner-limb-2x)) right top / cover no-repeat,
    url(/assets/backgrounds/earth-horizon-mobile.jpg) right top / cover no-repeat,
    url(/assets/backgrounds/earth-horizon.jpg) right top / cover no-repeat;
}
.hero.intel { --hero-img: url(/assets/backgrounds/earth-horizon-mobile.webp?v=owner-limb-2x); }
.hero.research { --hero-img: url(/assets/backgrounds/research.webp); }
.hero.agents { --hero-img: url(/assets/backgrounds/agents-hangar.webp); }
@media (max-width: 1023px) {
  .hero.agents { min-height: 0; padding: 18px var(--pad) 16px; }
}
.hero.archive { --hero-img: url(/assets/backgrounds/archive-dusk.webp); }
.hero.briefing { --hero-img: url(/assets/backgrounds/earth-horizon-mobile.webp?v=owner-limb-2x); --hero-img-wide: url(/assets/backgrounds/earth-horizon.webp?v=owner-limb-2x); }
.hero.director { --hero-img: url(/assets/backgrounds/earth-horizon-mobile.webp?v=owner-limb-2x); --hero-img-wide: url(/assets/backgrounds/earth-horizon.webp?v=owner-limb-2x); }
.hero.ventures { --hero-img: url(/assets/backgrounds/ventures-worlds.webp); --hero-img-wide: url(/assets/backgrounds/ventures-worlds.webp); }
.hero.opportunity { --hero-img: url(/assets/backgrounds/opportunity-orbit.webp); --hero-img-wide: url(/assets/backgrounds/opportunity-orbit.webp); }
.hero.experiment { --hero-img: url(/assets/backgrounds/experiment-lab.webp); --hero-img-wide: url(/assets/backgrounds/experiment-lab.webp); }
.hero.experiments { --hero-img: url(/assets/backgrounds/experiments-lab.webp); --hero-img-wide: url(/assets/backgrounds/experiments-lab.webp); }
.hero.money { --hero-img: url(/assets/backgrounds/money-growth.webp); --hero-img-wide: url(/assets/backgrounds/money-growth.webp); }
.hero.settings { --hero-img: url(/assets/backgrounds/settings-control.webp); --hero-img-wide: url(/assets/backgrounds/settings-control.webp); }
.hero.activity { --hero-img: url(/assets/backgrounds/activity-timeline.webp); --hero-img-wide: url(/assets/backgrounds/activity-timeline.webp); }
.hero.authority { --hero-img: url(/assets/backgrounds/authority-shield.webp); --hero-img-wide: url(/assets/backgrounds/authority-shield.webp); }
.hero.decision { --hero-img: url(/assets/backgrounds/decision-reason.webp); --hero-img-wide: url(/assets/backgrounds/decision-reason.webp); }
.hero.search { --hero-img: url(/assets/backgrounds/search-cosmos.webp); --hero-img-wide: url(/assets/backgrounds/search-cosmos.webp); }
.hero.needs { --hero-img: url(/assets/backgrounds/needs-you-ambient.webp); --hero-img-wide: url(/assets/backgrounds/needs-you-ambient.webp); }
.hero.system { --hero-img: url(/assets/backgrounds/system-core.webp); --hero-img-wide: url(/assets/backgrounds/system-core.webp); }
.hero.incident { --hero-img: url(/assets/backgrounds/incident.webp); --hero-img-wide: url(/assets/backgrounds/incident.webp); }
.hero.quiet { min-height: 180px; }
.hero.quiet::before { opacity: 1; background-position: left center, center bottom, right center, right center; }
.hero.money::before, .hero.settings::before, .hero.authority::before { opacity: .72; }
.hero > * { position: relative; }
@media (min-width: 1024px) {
  .hero { margin: 0; border-radius: var(--r-lg); padding: 36px 32px 32px; border: 1px solid var(--border-quiet); min-height: 300px; overflow: visible; }
  .hero::before {
    background:
      linear-gradient(90deg, rgba(5, 8, 13, .78) 0%, rgba(5, 8, 13, .22) 30%, rgba(5, 8, 13, 0) 62%),
      var(--hero-img-wide, url(/assets/backgrounds/earth-horizon.webp?v=owner-limb-2x)) right top / cover no-repeat,
      url(/assets/backgrounds/earth-horizon.jpg) right top / cover no-repeat;
  }
  .hero.intel { --hero-img-wide: url(/assets/backgrounds/earth-horizon.webp?v=owner-limb-2x); }
  .hero.research { --hero-img-wide: url(/assets/backgrounds/research.webp); }
  .hero.agents { --hero-img-wide: url(/assets/backgrounds/agents-hangar.webp); }
  .hero.archive { --hero-img-wide: url(/assets/backgrounds/archive-dusk.webp); }
  .hero.archive::before {
    background:
      linear-gradient(90deg, rgba(5, 8, 13, .70) 0%, rgba(5, 8, 13, .22) 38%, rgba(5, 8, 13, .06) 72%, rgba(5, 8, 13, .35) 100%),
      url(/assets/backgrounds/archive-dusk.webp) right 72% / cover no-repeat;
  }
  .hero.quiet { min-height: 220px; padding: 28px 28px; }
  .hero.quiet::before {
    background:
      linear-gradient(90deg, rgba(5, 8, 13, .72) 0%, rgba(5, 8, 13, .18) 34%, rgba(5, 8, 13, 0) 68%),
      var(--hero-img-wide, url(/assets/backgrounds/earth-horizon.webp?v=owner-limb-2x)) right top / cover no-repeat,
      url(/assets/backgrounds/earth-horizon.jpg) right top / cover no-repeat;
  }
}
.hero.archive::before { background-position: center, center 72%; }
.venture-image { position: relative; overflow: hidden; background: var(--surface-2); }
.venture-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.08) brightness(.82); }
.venture-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 6, 10, .02), rgba(3, 6, 10, .12) 55%, rgba(3, 6, 10, .85) 100%); pointer-events: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(180, 205, 235, .16); color: var(--text-1);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--normal) var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, .06); border-color: var(--border-strong); }
.btn.primary, .btn.accent {
  background: linear-gradient(180deg, #4d94ff, #2f80ff);
  border: 1px solid rgba(133, 190, 255, .55); color: #fff;
  box-shadow: 0 0 12px rgba(47, 128, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn.primary:hover, .btn.accent:hover { background: linear-gradient(180deg, #5aa0ff, #2f80ff); }
.btn.danger { color: #ffb3bb; border-color: rgba(255, 82, 99, .3); }
.btn.quiet-danger { background: rgba(255, 255, 255, .025); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- tones (status palette is fixed; role colors live on avatars only) ---------- */
.tone-good, .tone-online { --tone: var(--st-online); }
.tone-info, .tone-running { --tone: var(--st-running); }
.tone-working { --tone: var(--st-working); }
.tone-idle { --tone: var(--st-idle); }
.tone-warn, .tone-warning { --tone: var(--st-warning); }
.tone-bad, .tone-blocked { --tone: var(--st-blocked); }
.tone-neutral, .tone-offline { --tone: var(--st-offline); }
.tone-cyan, .tone-measuring { --tone: var(--st-measuring); }
.tone-violet, .tone-validating { --tone: var(--st-validating); }
.tone-building { --tone: var(--st-building); }
[class*="tone-"] { color: var(--tone); }
.card[class*="tone-"], .notice[class*="tone-"], .stat[class*="tone-"] { color: inherit; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-pill);
  font: 500 11px/1 var(--font-ui); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  color: var(--tone, var(--st-offline));
  background: color-mix(in srgb, var(--tone, var(--st-offline)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone, var(--st-offline)) 24%, transparent);
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .03); border: 1px solid var(--border-card); color: var(--text-2); font-size: 12px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tone, var(--st-offline)); }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status-dot.live::before { animation: statusPulse 2.4s ease-out infinite; }
@keyframes statusPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 30%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: 34px; padding: 0 14px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; font-size: 13px; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px; transition: color var(--fast) var(--ease), background var(--normal) var(--ease), box-shadow var(--normal) var(--ease); }
.tab:hover { color: var(--text-1); }
.tab[aria-selected="true"] { background: rgba(42, 123, 255, .18); color: #fff; border-color: rgba(78, 151, 255, .4); box-shadow: 0 0 14px rgba(34, 112, 255, .16); }
.tab .n { font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: var(--r-pill); background: rgba(255, 255, 255, .08); }
.tab[aria-selected="true"] .n { background: var(--blue); }

/* ---------- metrics ---------- */
.stat { padding: 12px; border-radius: var(--r-md); background: rgba(8, 16, 27, .62); backdrop-filter: blur(12px) saturate(115%); -webkit-backdrop-filter: blur(12px) saturate(115%); border: 1px solid rgba(145, 185, 230, .10); display: grid; gap: 4px; align-content: start; min-height: 92px; transition: border-color var(--normal) var(--ease), transform var(--normal) var(--ease); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--tone, transparent) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .04); }
a.stat:hover { border-color: rgba(77, 146, 255, .32); transform: translateY(-1px); }
.stat .ic { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; }
.stat .v { font: 600 22px/1.1 var(--font-ui); letter-spacing: -.01em; color: var(--text-1); }
.stat .v.unknown { color: var(--text-3); font-size: 15px; font-weight: 500; }
.stat .l { color: var(--text-2); font-size: 12px; }
.stat .sub { font-size: 11px; font-weight: 500; }
.metric-basis { cursor: help; border-bottom: 1px dotted var(--text-disabled); }
.ic[class*="tone-"], .iconbox[class*="tone-"] { background: color-mix(in srgb, var(--tone) 13%, transparent); color: var(--tone); }

/* ---------- agents (role color = identity, never status) ---------- */
.avatar { flex: none; flex-shrink: 0; border-radius: 0; overflow: visible; position: relative; display: inline-block; transform: none; background: transparent; }
.avatar img { z-index: 1; width: 100%; height: 100%; object-fit: contain; object-position: center; border-radius: 0; transform: none; background: transparent; }
.avatar.has-bg img { object-fit: cover; }
.avatar::before { content: ""; position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, rgb(var(--agent-rgb, 59 140 255) / var(--aura, .14)), transparent 70%); pointer-events: none; }
.avatar.aura-none::before { display: none; }
.avatar.aura-strong { --aura: .22; }
.avatar.working::before { --aura: .18; }
.avatar.sq { border-radius: var(--r-md); }
.avatar .badge { position: absolute; z-index: 2; right: 4%; bottom: 4%; width: 10px; height: 10px; border-radius: 50%; background: var(--tone, var(--st-offline)); box-shadow: 0 0 0 2px var(--bg); }
.agent-card { background: rgba(8, 16, 27, .42); backdrop-filter: blur(10px) saturate(115%); -webkit-backdrop-filter: blur(10px) saturate(115%); border: 1px solid rgba(145, 185, 230, .10); border-radius: var(--r-md); overflow: visible; position: relative; }
a.agent-card { transition: border-color var(--normal) var(--ease), transform var(--normal) var(--ease); }
a.agent-card:hover { border-color: rgb(var(--agent-rgb, 59 140 255) / .35); }
.agent-portrait { position: relative; display: grid; place-items: center; overflow: visible; min-width: var(--av-size, 72px); min-height: var(--av-size, 72px); }
.agent-portrait::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; left: 15%; top: 18%; border-radius: 50%; background: radial-gradient(circle, rgb(var(--agent-rgb, 59 140 255) / .16), transparent 70%); pointer-events: none; }
.agent-portrait img { position: relative; z-index: 1; }
.thumb { flex: none; width: 44px; height: 44px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.08) brightness(.82); }
.iconbox { flex: none; width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: rgba(255, 255, 255, .04); color: var(--text-2); }

/* ---------- timeline ---------- */
.timeline { display: grid; position: relative; }
.timeline .t-item { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 8px 0; position: relative; }
.timeline .t-item::before { content: ""; position: absolute; left: 17px; top: 46px; bottom: -6px; width: 1px; background: var(--border-card); }
.timeline .t-item:last-child::before { display: none; }
.t-when { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.day-label { font: 600 13px var(--font-ui); color: var(--text-2); padding: 16px 0 4px; }

/* ---------- progress / steps / funnel ---------- */
.bar { height: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--blue-bright)); box-shadow: 0 0 8px rgba(65, 145, 255, .35); }
.steps { display: grid; gap: 10px; }
.step { display: flex; align-items: flex-start; gap: 10px; }
.step .sdot { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1.5px solid var(--text-disabled); color: var(--text-disabled); margin-top: 1px; }
.step.done .sdot { border-color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.step.current .sdot { border-color: var(--blue-bright); color: var(--blue-bright); box-shadow: var(--ui-glow); }
.funnel { display: grid; gap: 6px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.funnel-row .fbar { height: 22px; border-radius: var(--r-xs); background: rgba(255, 255, 255, .04); position: relative; overflow: hidden; }
.funnel-row .fbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(40, 207, 227, .55), rgba(40, 207, 227, .2)); border-radius: inherit; box-shadow: 0 0 8px rgba(40, 207, 227, .3); }
.funnel-row.off { color: var(--text-disabled); }
.funnel-row.off .fbar { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 6px, transparent 6px 12px); }

/* ---------- states ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 40px 20px; color: var(--text-2); }
.empty .big-ic { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-active); box-shadow: var(--glow-blue); color: #fff; }
.empty h3 { margin: 4px 0 0; font: 500 30px/1.02 var(--font-display); color: var(--text-1); }
.err { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--danger) 8%, var(--surface-1)); border: 1px solid rgba(255, 82, 99, .24); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, .025); border: 1px solid var(--border-card); color: var(--text-2); font-size: 12.5px; }
.notice.warn { background: color-mix(in srgb, var(--warning) 7%, var(--surface-1)); border-color: rgba(246, 185, 74, .24); color: #f3d7a3; }
.notice.info { background: color-mix(in srgb, var(--blue) 7%, var(--surface-1)); border-color: rgba(74, 156, 255, .24); color: #c3dcff; }
.skel { border-radius: var(--r-md); background: linear-gradient(90deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .065), rgba(255, 255, 255, .03)); background-size: 200% 100%; animation: shimmer 1.6s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.freshness { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.freshness.stale { color: var(--warning); }
.banner { position: sticky; top: 0; z-index: 30; padding: 8px var(--pad); font-size: 12.5px; text-align: center; background: rgba(246, 185, 74, .12); color: #f3d7a3; border-bottom: 1px solid rgba(246, 185, 74, .24); backdrop-filter: blur(12px); }
.banner.bad { background: rgba(255, 82, 99, .12); color: #ffc2c8; border-color: rgba(255, 82, 99, .24); }

/* ---------- overlay / modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 3, 7, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--normal) var(--ease); }
.sheet { width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; background: #090e15; border: 1px solid rgba(175, 205, 240, .17); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 10px 16px calc(16px + var(--safe-b)); box-shadow: 0 30px 90px rgba(0, 0, 0, .65), 0 0 60px rgba(27, 87, 180, .05); animation: rise 220ms var(--ease); }
.sheet .grab { width: 40px; height: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); margin: 0 auto 10px; }
.sheet .sheet-body { overflow-y: auto; flex: 1; min-height: 0; }
@media (min-width: 1024px) { .scrim { align-items: center; } .sheet { border-radius: 18px; max-height: 80vh; padding: 16px 20px 20px; } .sheet .grab { display: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: .6; } }

/* ---------- director ---------- */
.msg { display: grid; gap: 6px; max-width: 86%; }
.msg.owner { justify-self: end; }
.msg.owner .bubble {
  background: rgba(47, 128, 255, .22);
  backdrop-filter: blur(12px) saturate(115%); -webkit-backdrop-filter: blur(12px) saturate(115%);
  border: 1px solid rgba(133, 190, 255, .28); border-radius: 14px 14px 4px 14px; padding: 10px 14px;
}
.msg.director { grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; max-width: 92%; align-items: start; }
.msg.director .msg-body,
.msg.director .bubble,
.msg.director .director-actions,
.msg.director .msg-meta { grid-column: 2; min-width: 0; }
.msg.director .msg-body { display: grid; gap: 8px; }
.msg.director .bubble {
  padding: 12px 14px; color: var(--text-1); line-height: 1.6;
  background: rgba(8, 16, 27, .55); backdrop-filter: blur(12px) saturate(115%); -webkit-backdrop-filter: blur(12px) saturate(115%);
  border: 1px solid rgba(145, 185, 230, .10); border-radius: 14px 14px 14px 4px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.msg.director .bubble.card-reply { background: rgba(8, 16, 27, .62); }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .sec { display: block; font: 600 10.5px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-top: 12px; }
.bubble .sec:first-child { margin-top: 0; }
.msg-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg.owner .msg-meta { justify-content: flex-end; }
.director-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ctx-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .03); color: var(--text-2); font-size: 11.5px; border: 1px solid var(--border-strong); }
.ctx-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer {
  display: flex; align-items: flex-end; gap: 8px; min-height: 52px; padding: 6px 6px 6px 14px; border-radius: 16px;
  background: rgba(8, 16, 27, .62); backdrop-filter: blur(14px) saturate(115%); -webkit-backdrop-filter: blur(14px) saturate(115%);
  border: 1px solid rgba(145, 185, 230, .12); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color var(--normal) var(--ease), box-shadow var(--normal) var(--ease);
}
.composer:focus-within { border-color: rgba(65, 145, 255, .45); box-shadow: 0 0 0 3px rgba(50, 125, 255, .07), 0 0 24px rgba(35, 105, 255, .08); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 9px 4px; max-height: 160px; min-height: 38px; line-height: 1.45; }
.composer .send { width: 40px; height: 40px; flex: none; border-radius: 50%; background: linear-gradient(180deg, #4d94ff, #2f80ff); color: #fff; display: grid; place-items: center; box-shadow: 0 0 12px rgba(47, 128, 255, .28); }
.composer .send[disabled] { background: rgba(255, 255, 255, .05); color: var(--text-disabled); box-shadow: none; }
.suggest { display: grid; gap: 8px; }
.suggest button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; text-align: left; padding: 10px 14px; border-radius: var(--r-md); background: rgba(8, 16, 27, .62); border: 1px solid rgba(145, 185, 230, .10); color: var(--text-2); transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.suggest button:hover { border-color: rgba(77, 146, 255, .32); color: var(--text-1); }
.typing { display: inline-flex; gap: 4px; padding: 8px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-bright); opacity: .5; animation: typing 1.4s infinite var(--ease); }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 50% { opacity: 1; transform: translateY(-2px); } }

.director-page { width: 100%; max-width: none; margin: 0; padding: 0 var(--pad); display: flex; flex-direction: column; height: calc(100dvh - var(--bottom-nav-h) - var(--safe-b) - 60px); overflow: hidden; }
.director-desk { display: flex; flex: 1; min-height: 0; gap: 16px; }
.director-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.director-rail { display: none; }
.director-head { position: relative; z-index: 2; display: grid; gap: 10px; padding: 10px 0; flex: none; background: transparent; }
.director-head.hero { margin: 0; border: 0; border-radius: 0; min-height: 0; padding: 8px 0 12px; background: transparent; overflow: visible; }
.director-head.hero::before { display: none; }
.director-focal { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 4px 0; }
.director-hero { display: grid; place-items: center; overflow: visible; }
@media (max-width: 1023px) {
  .shell.is-director { height: 100dvh; max-height: 100dvh; overflow: hidden; }
  .shell.is-director .main {
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-b));
  }
  .shell.is-director .director-topbar { flex: none; }
  .director-page { flex: 1; min-height: 0; height: auto; overflow: hidden; }
  .director-hero .avatar,
  .director-hero .avatar-life {
    --av-size: 112px;
    width: 112px; height: 112px; min-width: 112px; min-height: 112px; max-width: 112px; max-height: 112px;
  }
  .director-chips { max-height: 72px; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; justify-content: flex-start; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .director-chips::-webkit-scrollbar { display: none; }
  .director-chips button { flex: none; }
}
.director-id { justify-items: center; max-width: 520px; }
.director-hist { position: absolute; top: 8px; right: 0; }
.director-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.director-chips button {
  height: 32px; padding: 0 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: rgba(8, 16, 27, .55); backdrop-filter: blur(10px) saturate(115%); -webkit-backdrop-filter: blur(10px) saturate(115%);
  border: 1px solid rgba(145, 185, 230, .12);
}
.director-chips button:hover { color: var(--text-1); border-color: rgba(77, 146, 255, .32); }
.director-chips button:disabled { opacity: .45; }
@media (min-width: 1024px) {
  .director-page { height: calc(100dvh - 72px); padding: 0 8px 0 0; }
  .director-head.hero { margin: 0; border: 0; border-radius: 0; min-height: 0; padding: 8px 0 12px; }
  .director-focal { grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; gap: 20px; }
  .director-id { justify-items: start; }
  .director-chips { justify-content: flex-start; }
  .director-rail {
    display: grid; width: 320px; flex: none; gap: 14px; align-content: start; overflow-y: auto;
    padding: 8px 4px 16px 0;
  }
}
.director-log { flex: 1; display: grid; gap: 16px; align-content: start; padding: 8px 0 16px; overflow-y: auto; min-height: 0; }
.director-compose { flex: none; padding: 10px 0 12px; background: linear-gradient(0deg, rgba(2, 5, 9, .55) 70%, transparent); position: relative; z-index: 30; }
form.composer { width: 100%; }
.agent-see-more { margin-top: 2px; scroll-margin-bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 20px); }
@media (min-width: 1024px) { .director-head .mobile-only { display: none; } }
.director-col.glass {
  background: rgba(8, 16, 27, .42);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  border: 1px solid rgba(145, 185, 230, .10);
  border-radius: var(--r-lg);
  padding: 8px 16px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.director-vent { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: start; text-decoration: none; color: inherit; }
.director-vent-img { width: 72px; height: 56px; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .25); }
.director-vent-img img { width: 100%; height: 100%; object-fit: cover; }
.director-agents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.director-agent { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.director-agent .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.director-qa .list-row { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid rgba(145, 185, 230, .08); border-radius: 0; }
.director-qa .list-row:last-child { border-bottom: 0; }
.director-chip { height: 32px; padding: 0 12px; }

.agent-strip { display: flex; gap: 10px; overflow-x: auto; overflow-y: visible; scrollbar-width: none; padding: 8px 0 10px; }
.agent-strip::-webkit-scrollbar { display: none; }
.agent-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 430px) {
  .home-page .agent-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .home-page .agent-tile { padding: 2px 0 8px; }
  .home-page .agent-tile .card-title { font-size: 11px; }
  .home-page .agent-tile .status-dot { font-size: 10px; }
}
@media (min-width: 640px) { .agent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .agent-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1280px) { .agent-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.agent-tile { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 14px 8px 16px; overflow: visible; width: auto; }

.home-page { overflow-x: hidden; }
.home-page .hero { margin: 0; border: 0; border-radius: 0; min-height: 0; padding: 12px 0 8px; background: transparent; overflow: visible; }
.home-page .hero::before { display: none; }
.home-sky { display: grid; gap: 16px; }
.home-syschip { display: none; }
@media (min-width: 1024px) {
.home-syschip {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r-md);
  background: rgba(8, 16, 27, .62); backdrop-filter: blur(12px) saturate(115%); -webkit-backdrop-filter: blur(12px) saturate(115%);
  border: 1px solid rgba(145, 185, 230, .10); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  text-decoration: none; color: inherit; max-width: 280px; justify-self: end;
}
}
.home-syschip .chip-k { font: 600 12px/1.3 var(--font-ui); color: var(--text-1); }
.home-syschip .chip-bar { height: 3px; border-radius: 99px; background: rgba(32, 217, 163, .22); overflow: hidden; }
.home-syschip .chip-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #20d9a3, #4d94ff); }
.home-page .agent-tile {
  background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  border-color: transparent; box-shadow: none; padding: 4px 4px 10px;
  min-width: 0; max-width: 100%;
}
.home-page .agent-tile:hover { border-color: transparent; transform: none; }
.home-tri { display: grid; gap: 12px; }
.home-qa button.list-row, .home-qa a.list-row { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid rgba(145, 185, 230, .08); border-radius: 0; }
.home-qa .list-row:last-child { border-bottom: 0; }
.home-rail { display: grid; gap: 12px; }
.home-kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(145, 185, 230, .08); font-size: 13px; }
.home-kv:last-child { border-bottom: 0; }
.home-kv .k { color: var(--text-3); }
.home-kv .n { font-weight: 600; }
.home-rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-ring { text-align: center; padding: 8px 4px; border-radius: var(--r-sm); background: rgba(255,255,255,.02); border: 1px solid rgba(145,185,230,.08); }
.home-ring-n { font: 600 16px/1.2 var(--font-ui); }
.home-focus-img { aspect-ratio: 16 / 9; }
@media (min-width: 1024px) {
  .home-sky { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); align-items: start; gap: 12px 24px; padding: 4px 0 8px; min-height: 220px; }
  .home-sky .grid-stats { grid-column: 1 / -1; }
  .home-desk { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
  .home-tri { grid-template-columns: 1.15fr .95fr .9fr; }
  .home-page .agent-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
}

/* ---------- search ---------- */
.search-input { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: var(--r-md); background: rgba(13, 19, 28, .92); border: 1px solid rgba(175, 200, 230, .14); }
.search-input:focus-within { border-color: rgba(65, 145, 255, .45); box-shadow: 0 0 0 3px rgba(50, 125, 255, .07); }
.search-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; }

/* ---------- auth / onboarding ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; isolation: isolate; }
.auth::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(3, 5, 7, .15), rgba(3, 5, 7, .55) 72%, var(--black)), url(/assets/backgrounds/onboarding.webp) center / cover no-repeat, var(--black); }
.auth .card { width: 100%; max-width: 400px; padding: 24px; }
.code-input { width: 100%; height: 52px; text-align: center; font: 500 22px var(--font-mono); letter-spacing: .3em; text-transform: uppercase; border-radius: var(--r-md); border: 1px solid rgba(175, 200, 230, .14); background: rgba(13, 19, 28, .92); outline: 0; }
.code-input:focus { border-color: rgba(65, 145, 255, .45); box-shadow: 0 0 0 3px rgba(50, 125, 255, .07); }
.auth-field { display: grid; gap: 6px; }
.auth-field span { font: 500 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.auth-input { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid rgba(175, 200, 230, .14); background: rgba(13, 19, 28, .92); outline: 0; }
.auth-input:focus { border-color: rgba(65, 145, 255, .45); box-shadow: 0 0 0 3px rgba(50, 125, 255, .07); }
.auth .logo-subtitle { margin-top: -6px; }
.pair-code { font: 500 34px var(--font-mono); letter-spacing: .18em; text-align: center; padding: 16px; border-radius: var(--r-lg); background: rgba(13, 19, 28, .92); border: 1px dashed var(--border-strong); }

/* ---------- key/value / prose ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text-1); min-width: 0; overflow-wrap: anywhere; }
.prose { color: var(--text-2); line-height: 1.6; white-space: pre-wrap; }
.quote { font: italic 500 19px/1.3 var(--font-display); color: var(--text-2); }
.tag-unknown { color: var(--text-3); font-style: italic; }
