/* ============================================================
   JARVIS Influence — command surface
   Calm, precise, premium. Near-white canvas, graphite ink,
   one cyan accent, one warm amber approval accent.
   Hairline borders, very light shadows, max 8px radius.
   ============================================================ */
:root {
  color-scheme: light;

  /* Surfaces */
  --canvas: #f7f8f8;
  --panel: #ffffff;
  --panel-2: #fbfbfc;
  --rail: #ffffff;

  /* Ink */
  --ink: #16191c;
  --ink-2: #3d4249;
  --muted: #6b7178;
  --faint: #949aa1;

  /* Hairlines */
  --line: #e7e9ec;
  --line-2: #eef0f2;

  /* Accents — one cyan, one amber */
  --cyan: #0a9cb8;
  --cyan-ink: #067b93;
  --cyan-soft: #e6f6f9;
  --cyan-line: #bfe6ee;
  --amber: #b8791f;
  --amber-ink: #9a6413;
  --amber-soft: #fbf1df;
  --amber-line: #ecd6ac;

  /* Semantic */
  --ok: #2f9e6f;
  --danger: #c0472f;
  --danger-soft: #fbeae6;

  /* Shadow — very light */
  --shadow-s: 0 1px 2px rgba(20, 28, 34, .04);
  --shadow-m: 0 6px 20px -12px rgba(20, 28, 34, .16);
  --shadow-drawer: -18px 0 48px -24px rgba(20, 28, 34, .28);

  --radius: 8px;
  --radius-s: 6px;
  --rail-w: 78px;
  --stage-max: 1180px;

  --font: "SF Pro Text", "SF Pro", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, monospace;

  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
button, textarea, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
kbd {
  font: 600 10px/1 var(--mono);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 3px 5px; color: var(--muted);
}
.tnum { font-variant-numeric: tabular-nums; }

.visually-hidden, .sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius-s);
  transform: translateY(-140%); transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* ============ SHELL ============ */
.shell { display: flex; min-height: 100vh; }

/* ============ RAIL ============ */
.rail {
  width: var(--rail-w); flex: 0 0 var(--rail-w);
  background: var(--rail); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 16px; gap: 6px;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.rail-brand {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; color: var(--cyan);
  background: var(--cyan-soft); border: 1px solid var(--cyan-line);
  margin-bottom: 10px;
}
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; overflow: visible; }
.rail-item {
  position: relative; width: 56px; height: 46px; border-radius: var(--radius-s);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--faint); transition: background .14s ease, color .14s ease;
}
.rail-item svg { width: 20px; height: 20px; }
.rail-label { font-size: 10px; font-weight: 600; letter-spacing: 0; line-height: 1; max-width: 64px; text-align: center; }
.rail-item:hover { background: var(--panel-2); color: var(--ink-2); }
.rail-item.is-active { color: var(--cyan-ink); background: var(--cyan-soft); }
.rail-item.is-active::before {
  content: ""; position: absolute; left: -0px; top: 9px; bottom: 9px; left: 0;
  width: 2px; border-radius: 2px; background: var(--cyan);
}
.rail-item-sec .rail-label { color: inherit; }
.rail-divider { width: 30px; height: 1px; background: var(--line); margin: 8px 0; }
.rail-foot { margin-top: auto; }
.rail-badge {
  position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--amber); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 16px; text-align: center;
}
/* Rail tooltip */
.rail-item[data-tip]::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) scale(.96); transform-origin: left center;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 500; white-space: nowrap;
  padding: 5px 9px; border-radius: 6px; pointer-events: none; opacity: 0;
  transition: opacity .12s ease, transform .12s ease; z-index: 60;
}
.rail-item:hover[data-tip]:not(.is-active)::after, .rail-item:focus-visible[data-tip]::after { opacity: 1; transform: translateY(-50%) scale(1); }

/* ============ FRAME + TOPBAR ============ */
.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; flex: 0 0 60px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 28px; background: rgba(247,248,248,.86);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(1.4) blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-button { display: none; width: 36px; height: 36px; border-radius: var(--radius-s); border: 1px solid var(--line); color: var(--ink-2); align-items: center; justify-content: center; }
.menu-button svg { width: 20px; height: 20px; }
.workspace-id { display: flex; flex-direction: column; min-width: 0; }
.workspace-name { font-size: 15px; font-weight: 650; letter-spacing: 0; }
.workspace-sub { font-size: 11px; color: var(--muted); }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.conn {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  font-size: 11.5px; font-weight: 550; color: var(--ink-2);
}
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.conn[data-state="connected"] .conn-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(47,158,111,.14); }
.conn[data-state="connected"] { color: var(--ink-2); }
.conn[data-state="working"] .conn-dot { background: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.conn[data-state="connecting"] .conn-dot { background: var(--amber); }
.conn[data-state="offline"] .conn-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.conn[data-state="offline"] { color: var(--danger); border-color: var(--danger-soft); }
.conn[data-state="protected"] .conn-dot { background: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.conn[data-state="protected"] { color: var(--cyan-ink); border-color: var(--cyan-line); }
.clock { font: 500 12px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

.profile { position: relative; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.profile-pop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 220px; z-index: 50;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-m); padding: 6px;
}
.profile-pop-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.profile-pop-head strong { display: block; font-size: 13px; }
.profile-pop-head span { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.profile-pop button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--radius-s);
  font-size: 12.5px; color: var(--ink-2);
}
.profile-pop button:hover { background: var(--panel-2); }
.profile-pop button[aria-pressed="true"] { color: var(--cyan-ink); }
.icon-button { width: 34px; height: 34px; border-radius: var(--radius-s); border: 1px solid var(--line); color: var(--ink-2); display: inline-grid; place-items: center; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover { background: var(--panel-2); }

/* ============ MOBILE NAV ============ */
.mobile-nav-backdrop { position: fixed; inset: 0; background: rgba(22,25,28,.32); z-index: 90; }
.mobile-nav {
  position: fixed; top: 0; left: 0; bottom: 0; width: 264px; max-width: 82vw; z-index: 95;
  background: var(--panel); border-right: 1px solid var(--line); padding: 16px; overflow-y: auto;
}
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 12px; font-weight: 650; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.mobile-nav-items { display: grid; gap: 2px; }
.mobile-nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-s); color: var(--ink-2); font-size: 14px; font-weight: 500; width: 100%; text-align: left; }
.mobile-nav-item svg { width: 20px; height: 20px; color: var(--faint); }
.mobile-nav-item.is-active { background: var(--cyan-soft); color: var(--cyan-ink); }
.mobile-nav-item.is-active svg { color: var(--cyan); }
.mobile-nav-item b { margin-left: auto; background: var(--amber); color: #fff; border-radius: 8px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 10px; padding: 0 5px; }

/* ============ STAGE ============ */
.stage { flex: 1; min-width: 0; padding: 34px 28px 64px; }
.view { display: none; }
.view.is-active { display: block; animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ COMMAND STAGE ============ */
.command-stage { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.stage-eyebrow { align-self: stretch; font-size: 10px; font-weight: 700; letter-spacing: .22em; color: var(--faint); margin: 6px 0 0; }
.command-hero {
  position: relative; width: 100%;
  min-height: clamp(330px, calc(100dvh - 290px), 500px);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "orb";
  align-items: center; justify-items: center; isolation: isolate;
}
body.orb-engaged .command-hero {
  min-height: clamp(470px, calc(100dvh - 250px), 640px);
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  grid-template-areas: "work orb"; gap: clamp(28px, 5vw, 92px);
  border-bottom: 1px solid var(--line);
}
.command-hero::before { content: ""; position: absolute; z-index: -1; inset: 4% 4% 7%; opacity: 0; pointer-events: none; background: radial-gradient(ellipse 38% 54% at 78% 50%, rgba(130, 173, 255, .15), transparent 72%); filter: blur(18px); transition: opacity 520ms ease; }
body.orb-engaged .command-hero::before { opacity: 1; }
body[data-interaction-phase="thinking"] .command-hero::before,
body[data-interaction-phase="showing_data"] .command-hero::before,
body[data-interaction-phase="executing"] .command-hero::before { opacity: 1; }
body[data-interaction-phase="error"] .command-hero::before { background: radial-gradient(ellipse 38% 54% at 78% 50%, rgba(192, 71, 47, .11), transparent 72%); opacity: 1; }

/* ORB: a liquid system object with an active time-dial, not a decorative blob. */
.orb-wrap {
  position: relative; z-index: 2; grid-area: orb; width: clamp(300px, 34vw, 380px); min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-self: center;
  transform: translateY(0); transition: width 760ms cubic-bezier(.16,.96,.22,1), transform 760ms cubic-bezier(.16,.96,.22,1), opacity 360ms ease;
}
body.orb-engaged .orb-wrap { width: min(100%, 320px); justify-self: end; transform: translateY(4px); }
.arrival-greeting {
  margin: 0 0 6px; min-height: 18px; color: var(--ink); font-size: 13px; font-weight: 600;
  letter-spacing: .02em; transition: opacity 420ms ease, transform 620ms cubic-bezier(.22,.9,.24,1);
}
body.orb-arrived .arrival-greeting { opacity: .64; transform: translateY(-3px); }
.orb-stage {
  position: relative; width: 100%; aspect-ratio: 1; margin: 2px 0 0;
  display: grid; place-items: center; contain: layout paint size;
  transform-origin: 50% 50%; transition: transform 980ms cubic-bezier(.16,.96,.22,1), filter 640ms ease;
}
.orb-stage::before {
  content: ""; position: absolute; z-index: 4; inset: 13%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 28% 30%, rgba(255,255,255,.42), transparent 18%), radial-gradient(circle at 70% 65%, rgba(118,225,255,.34), transparent 27%), radial-gradient(circle at 42% 75%, rgba(255,150,190,.28), transparent 31%);
  mix-blend-mode: screen; filter: blur(11px); opacity: .24; will-change: transform, opacity;
  animation: orbAmbientFlow 8.5s cubic-bezier(.42,0,.24,1) infinite alternate;
}
@keyframes orbAmbientFlow { 0% { opacity: .12; transform: rotate(-9deg) scale(.92) translate(-3%, 2%); } 48% { opacity: .32; transform: rotate(6deg) scale(1.03) translate(3%, -2%); } 100% { opacity: .16; transform: rotate(12deg) scale(.96) translate(-1%, -3%); } }
body.orb-engaged .orb-stage { transform: scale(.94) rotate(5deg); filter: saturate(.94) contrast(1.01); }
/* Result/work state keeps JARVIS present in a dedicated companion lane. */
body.orb-engaged:not(.orb-workspace) .orb-wrap,
body.orb-workspace .orb-wrap { width: min(100%, 320px); }
body.orb-engaged:not(.orb-workspace) .orb-stage,
body.orb-workspace .orb-stage { width: 100%; }
body.orb-engaged:not(.orb-workspace) .orb-status { min-height: 38px; margin-top: -3px; }
body.orb-workspace .orb-stage { transform: scale(.82) rotate(5deg); filter: saturate(.94) contrast(1.01); }
/* Listening points back toward the composer so the next spoken turn has a
   clear visual destination without pulling the orb away from the operator. */
body[data-orb-phase="listening"] .orb-stage { transform: scale(1.035) translateY(3%); }
body[data-orb-phase="speaking"] .orb-stage { transform: scale(1.01) rotate(-2deg); }
body[data-orb-phase="thinking"] .orb-stage { transform: scale(.99) rotate(2deg); }
body[data-orb-phase="executing"] .orb-stage { transform: scale(.76) rotate(8deg); }
body[data-orb-phase="approval"] .orb-stage { transform: scale(.74) rotate(-6deg); }
body[data-orb-phase="completed"] .orb-stage { animation: orbCompletionPulse 900ms cubic-bezier(.18,.9,.24,1) both; }
body[data-orb-phase="error"] .orb-stage { transform: scale(.82) rotate(-3deg); }
@keyframes orbCompletionPulse { 0% { transform: scale(.76) rotate(5deg); } 42% { transform: scale(.88) rotate(-3deg); } 100% { transform: scale(.78) rotate(5deg); } }
.orb-dock {
  position: fixed; z-index: 70; top: calc(60px + clamp(12px, 2vh, 26px)); right: clamp(12px, 3vw, 42px); width: clamp(150px, 20vw, 238px);
  min-height: 218px; display: grid; place-items: center; pointer-events: none;
  opacity: 0; transform: translateY(-10px) scale(.96); transition: opacity 420ms ease, transform 720ms cubic-bezier(.16,.96,.22,1);
}
body.orb-docked .orb-dock { opacity: 1; transform: none; }
body.orb-docked .orb-dock .orb-wrap { position: relative; inset: auto; top: auto; left: auto; width: 100%; min-width: 0; transform: none; transition: none; }
body.orb-docked .orb-dock .orb-stage { width: min(100%, 208px); transform: scale(.78) rotate(5deg); }
body.orb-docked[data-orb-phase="listening"] .orb-dock .orb-stage { transform: scale(.9) translateY(3%) rotate(0deg); }
body.orb-docked[data-orb-phase="thinking"] .orb-dock .orb-stage { transform: scale(.78) rotate(2deg); }
body.orb-docked[data-orb-phase="navigating"] .orb-dock .orb-stage,
body.orb-docked[data-orb-phase="preparing"] .orb-dock .orb-stage { transform: scale(.74) translateX(4%) rotate(7deg); }
body.orb-docked[data-orb-phase="approval"] .orb-dock .orb-stage { transform: scale(.74) rotate(-6deg); }
body.orb-docked[data-orb-phase="executing"] .orb-dock .orb-stage { transform: scale(.76) rotate(8deg); }
body.orb-docked[data-orb-phase="showing"] .orb-dock .orb-stage { transform: scale(.78) rotate(5deg); }
body.orb-docked[data-orb-phase="error"] .orb-dock .orb-stage { transform: scale(.78) rotate(-3deg); }
.orb-dock .arrival-greeting { font-size: 10px; }
.orb-dock .orb-status { min-height: 34px; margin-top: -18px; }
.orb-dock .orb-state { font-size: 8px; }
.orb-dock .orb-transcript { max-width: 210px; font-size: 10px; }
.orb-dock .orb-controls { margin-top: 4px; transform: scale(.84); transform-origin: top center; }
.orb-dock .orb-hit { pointer-events: auto; touch-action: manipulation; }
body.orb-docked .view.is-active:not(#view-command) { padding-right: clamp(170px, 21vw, 250px); }
body[data-orb-phase="navigating"] .orb-stage,
body[data-orb-phase="preparing"] .orb-stage { transform: scale(.76) translateX(8%) rotate(7deg); }
body[data-orb-phase="listening"] .orb-stage::after {
  content: ""; position: absolute; inset: 10%; border: 1px solid rgba(10,156,184,.34); border-radius: 50%; pointer-events: none;
  animation: orbListeningRipple 1.8s ease-out infinite;
}
body[data-orb-phase="speaking"] .orb-stage { animation: orbSpeechPulse 1.15s ease-in-out infinite; }
@keyframes orbListeningRipple { 0% { opacity: .62; transform: scale(.82); } 72%, 100% { opacity: 0; transform: scale(1.25); } }
@keyframes orbSpeechPulse { 0%, 100% { transform: scale(calc(1.005 + var(--orb-speech-energy, 0) * .018)) rotate(-2deg); } 42% { transform: scale(calc(1.025 + var(--orb-speech-energy, 0) * .065)) rotate(1deg); } 70% { transform: scale(calc(1.015 + var(--orb-speech-energy, 0) * .028)) rotate(-1deg); } }
.orb-canvas, .orb-texture, .orb-shader { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.orb-canvas { z-index: 0; opacity: .66; }
.orb-texture { z-index: 2; opacity: .28; mix-blend-mode: soft-light; }
.orb-shader { z-index: 3; opacity: 1; mix-blend-mode: normal; }
.orb-core {
  position: absolute; z-index: 1; width: 69%; aspect-ratio: 1; overflow: hidden; border-radius: 50%;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.94) 0 3%, rgba(244,233,255,.52) 21%, transparent 46%),
    radial-gradient(circle at 76% 34%, rgba(122,210,255,.78) 0 7%, rgba(95,136,246,.48) 28%, transparent 56%),
    radial-gradient(circle at 38% 76%, rgba(255,180,204,.58) 0 11%, rgba(198,139,235,.38) 35%, transparent 62%),
    linear-gradient(138deg, #f3e8f4 4%, #b9d4f4 48%, #7875c5 100%);
  box-shadow: 0 22px 54px rgba(75,72,181,.16), inset 0 1px 0 rgba(255,255,255,.82);
  animation: orbFloat 16s ease-in-out infinite alternate;
}
.orb-core::before, .orb-core::after { content: ""; position: absolute; inset: -18%; border-radius: 44%; filter: blur(14px); mix-blend-mode: screen; transform-origin: 50% 50%; }
.orb-core::before {
  background: radial-gradient(circle at 35% 43%, rgba(255,164,196,.48) 0 7%, transparent 32%), radial-gradient(circle at 70% 57%, rgba(86,196,255,.52) 0 10%, transparent 39%), radial-gradient(circle at 51% 81%, rgba(139,116,235,.42) 0 9%, transparent 31%);
  animation: orbFlowA 10s cubic-bezier(.42,0,.24,1) infinite alternate;
}
.orb-core::after {
  background: radial-gradient(circle at 28% 68%, rgba(255,207,171,.36) 0 5%, transparent 32%), radial-gradient(circle at 72% 24%, rgba(137,177,255,.44) 0 10%, transparent 40%);
  opacity: .56; animation: orbFlowB 13s cubic-bezier(.42,0,.24,1) infinite alternate;
}
@keyframes orbFloat { 0% { transform: scale(.98) rotate(-2deg); } 100% { transform: scale(1.02) rotate(2deg); } }
@keyframes orbFlowA { 0% { transform: rotate(-12deg) scale(.94) translate(-3%, 4%); } 100% { transform: rotate(15deg) scale(1.1) translate(5%, -3%); } }
@keyframes orbFlowB { 0% { transform: rotate(17deg) scale(1.06) translate(5%, -3%); } 100% { transform: rotate(-12deg) scale(.94) translate(-4%, 5%); } }
.orb-stage[data-orb-state="thinking"] .orb-core, .orb-stage[data-orb-state="thinking"] .orb-core::before, .orb-stage[data-orb-state="thinking"] .orb-core::after { animation-duration: 6.2s; }
.orb-stage[data-orb-state="listening"] .orb-core, .orb-stage[data-orb-state="speaking"] .orb-core, .orb-stage[data-orb-state="listening"] .orb-core::before, .orb-stage[data-orb-state="speaking"] .orb-core::before { animation-duration: 2.4s; }
.orb-stage[data-orb-state="approval"] .orb-core { filter: saturate(.85) hue-rotate(-24deg); }
.orb-stage[data-orb-state="error"] .orb-core { filter: saturate(.68) hue-rotate(35deg); }
.orb-hit {
  position: relative; z-index: 4; width: 66px; height: 66px; border-radius: 50%; color: #182637;
  background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.98); box-shadow: 0 10px 28px rgba(42,52,108,.14), inset 0 1px 0 rgba(255,255,255,.9);
  touch-action: none; user-select: none; -webkit-user-select: none; display: grid; place-items: center;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.orb-hit-ring { position: absolute; inset: -14px; opacity: 0; border: 1px solid rgba(255,255,255,.6); border-radius: inherit; transition: transform .25s ease, border-color .25s ease, opacity .25s ease; }
.orb-mic { position: relative; width: 19px; height: 19px; }
.orb-hit:hover { transform: scale(1.07); background: #fff; box-shadow: 0 18px 40px rgba(30,39,77,.22), inset 0 1px 0 #fff; }
.orb-hit:hover .orb-hit-ring { opacity: 1; transform: scale(1.16); border-color: rgba(255,255,255,.9); }
.orb-hit:active { transform: scale(.96); }
.orb-stage[data-orb-state="listening"] .orb-hit, .orb-stage[data-orb-state="speaking"] .orb-hit { box-shadow: 0 0 0 8px rgba(255,255,255,.26), 0 16px 42px rgba(30,39,77,.22); }
.orb-stage[data-orb-state="approval"] .orb-hit { color: var(--amber-ink); }
.orb-stage[data-orb-state="error"] .orb-hit { color: var(--danger); }

.orb-status { width: min(100%, 520px); text-align: center; margin-top: -8px; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.orb-state { font-size: 10px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan-ink); }
.orb-state[data-tone="idle"] { color: var(--muted); }
.orb-state[data-tone="approval"] { color: var(--amber-ink); }
.orb-state[data-tone="error"] { color: var(--danger); }
.orb-transcript { font-size: 12px; color: var(--muted); max-width: 440px; line-height: 1.45; text-wrap: balance; }

.orb-controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  font-size: 12px; font-weight: 550; color: var(--ink-2); transition: all .14s ease;
}
.chip svg { width: 15px; height: 15px; }
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--cyan-soft); border-color: var(--cyan-line); color: var(--cyan-ink); }
.chip-ghost { color: var(--muted); }
.chip-amber { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-ink); font-weight: 650; }
.chip-amber:hover { border-color: var(--amber); }

/* Live work readout. It receives only actual execution, approval and connection data. */
.operator-pulse {
  position: relative; z-index: 1; grid-area: work; width: min(100%, 560px); min-width: 0;
  justify-self: start; padding: 22px 42px 24px clamp(22px, 3vw, 40px); border-left: 1px solid rgba(42,53,66,.18);
  visibility: hidden; opacity: 0; transform: translateX(-42px) scale(.975); filter: blur(4px);
  transition: opacity 360ms ease 350ms, transform 820ms cubic-bezier(.16,.96,.22,1) 350ms, filter 520ms ease 350ms, visibility 0s linear 1170ms;
}
body.orb-engaged .operator-pulse { visibility: visible; opacity: 1; transform: translateX(0) scale(1); filter: blur(0); transition-delay: 360ms, 360ms, 360ms, 0s; }
.operator-pulse::before { content: ""; position: absolute; left: -1px; top: 26px; width: 2px; height: 52px; background: var(--cyan); transition: background .2s ease; }
.operator-pulse::after { content: ""; position: absolute; top: 51px; left: 100%; width: min(23vw, 292px); height: 1px; transform-origin: left center; background: linear-gradient(90deg, rgba(10,156,184,.36), rgba(115,151,250,.16) 56%, transparent); opacity: .66; }
.operator-pulse-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--faint); font: 650 10px/1 var(--mono); letter-spacing: .14em; }
.operator-context-line { display: flex; align-items: center; gap: 10px; margin: 15px 0 0; color: var(--faint); font: 600 8.5px/1 var(--mono); letter-spacing: .09em; }
.operator-context-line i { flex: 0 0 16px; height: 1px; background: linear-gradient(90deg, rgba(10,156,184,.34), rgba(42,53,66,.12)); }
body[data-orb-phase="approval"] .operator-pulse::after { background: linear-gradient(90deg, rgba(184,121,31,.48), rgba(247,193,94,.14) 56%, transparent); }
body[data-orb-phase="error"] .operator-pulse::after { background: linear-gradient(90deg, rgba(192,71,47,.48), rgba(192,71,47,.10) 56%, transparent); }
.operator-signal { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--cyan-ink); font-size: 9px; }
.operator-signal i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(10,156,184,.35); animation: signalPulse 2s ease-out infinite; }
@keyframes signalPulse { 55% { box-shadow: 0 0 0 6px rgba(10,156,184,0); } 100% { box-shadow: 0 0 0 0 rgba(10,156,184,0); } }
.operator-status { margin-top: 23px; max-width: 420px; font-size: clamp(31px, 3.15vw, 48px); font-weight: 590; letter-spacing: 0; line-height: 1.02; text-wrap: balance; }
.operator-request { position: relative; max-width: 430px; margin-top: 19px; padding: 12px 0 0 16px; border-top: 1px solid var(--line); }
.operator-request > span { display: block; color: var(--faint); font: 650 9px/1 var(--mono); letter-spacing: .13em; }
.operator-task { max-width: 402px; margin-top: 8px; color: var(--ink-2); font-size: 14px; line-height: 1.55; text-wrap: pretty; }
.operator-request::before { content: ""; position: absolute; top: 12px; left: 0; width: 2px; height: 40px; background: var(--cyan); opacity: .65; }
.operator-insight { max-width: 390px; margin-top: 20px; border-top: 1px solid rgba(42,53,66,.15); border-bottom: 1px solid rgba(42,53,66,.1); padding: 14px 0; }
.operator-insight-label { color: var(--faint); font: 650 9px/1 var(--mono); letter-spacing: .12em; }
.operator-insight-answer { margin-top: 9px; color: var(--ink); font-size: 14px; font-weight: 580; line-height: 1.45; }
.operator-insight-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.operator-insight-metric { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--ink-2); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.operator-insight-next { display: grid; gap: 5px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.operator-insight-next span, .operator-insight-source { color: var(--faint); font: 650 9px/1.35 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.operator-insight-next strong { color: var(--ink-2); font-size: 12px; font-weight: 600; line-height: 1.45; }
.operator-insight-source { margin-top: 12px; letter-spacing: .04em; text-transform: none; }
.daily-chart { margin-top: 15px; }
.daily-chart-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 11px; font-weight: 700; }
.daily-chart-title em { color: var(--faint); font: 650 9px/1 var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.daily-chart-row { margin-top: 10px; }
.daily-chart-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink-2); font-size: 10.5px; }
.daily-chart-row-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-chart-row-head strong { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.daily-chart-row-head strong.is-negative { color: var(--danger); }
.daily-chart-track { height: 5px; margin-top: 5px; overflow: hidden; background: rgba(42,53,66,.10); }
.daily-chart-track i { display: block; width: 0; height: 100%; background: var(--cyan); transition: width .32s ease; }
.daily-chart-track i.is-negative { background: var(--danger); }
.data-view-scroll { max-width: 100%; margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); }
.data-view-table { width: 100%; min-width: 560px; border-collapse: collapse; color: var(--ink-2); font-size: 10.5px; }
.data-view-table th, .data-view-table td { padding: 8px 9px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.data-view-table th { color: var(--faint); font: 650 8px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-view-table td { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-view-table tr:last-child td { border-bottom: 0; }
.operator-ledger { margin: 34px 0 0; border-top: 1px solid rgba(42,53,66,.14); }
.operator-ledger > div { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 14px; padding: 13px 0; border-bottom: 1px solid rgba(42,53,66,.09); }
.operator-ledger dt { color: var(--faint); font: 650 9px/1.4 var(--mono); letter-spacing: .1em; }
.operator-ledger dd { min-width: 0; margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-flow { display: flex; align-items: center; gap: 9px; margin-top: 22px; color: var(--faint); font: 650 9px/1 var(--mono); letter-spacing: .13em; }
.operator-flow i { width: 24px; height: 1px; background: rgba(42,53,66,.18); position: relative; }
.operator-flow i::after { content: ""; position: absolute; top: -2px; right: 0; width: 5px; height: 5px; border-top: 1px solid var(--faint); border-right: 1px solid var(--faint); transform: rotate(45deg); }
.operator-pulse[data-mode="thinking"]::before, .operator-pulse[data-mode="listening"]::before, .operator-pulse[data-mode="speaking"]::before { background: var(--cyan); }
.operator-pulse[data-mode="approval"]::before { background: var(--amber); }
.operator-pulse[data-mode="approval"] .operator-signal { color: var(--amber-ink); }
.operator-pulse[data-mode="approval"] .operator-signal i { animation-name: approvalPulse; }
@keyframes approvalPulse { 55% { box-shadow: 0 0 0 6px rgba(184,121,31,0); } 100% { box-shadow: 0 0 0 0 rgba(184,121,31,0); } }
.operator-pulse[data-mode="error"]::before { background: var(--danger); }
.operator-pulse[data-mode="error"] .operator-signal { color: var(--danger); }

/* Conversation is the partner layer. Operational controls remain available in
   their own views and appear here only for real governed work. */
.operator-pulse.is-conversation {
  width: 100%; padding: 0; border-left: 0;
}
.operator-pulse.is-conversation::before,
.operator-pulse.is-conversation::after,
.operator-pulse.is-conversation .operator-pulse-head,
.operator-pulse.is-conversation .operator-context-line,
.operator-pulse.is-conversation .operator-status,
.operator-pulse.is-conversation .operator-request,
.operator-pulse.is-conversation .operator-ledger,
.operator-pulse.is-conversation .operator-flow { display: none; }
.operator-pulse.is-conversation .operator-insight {
  max-width: 520px; margin: 0; padding: 0; border: 0;
}
.conversation-response > span {
  display: block; margin-bottom: 16px; color: var(--cyan-ink);
  font: 700 10px/1 var(--mono); letter-spacing: .16em;
}
.conversation-response > div { color: var(--ink); font-size: clamp(18px, 1.75vw, 25px); line-height: 1.48; text-wrap: pretty; }
.conversation-response p { margin: 0; }
.conversation-response p + p { margin-top: 16px; }
.conversation-response strong { font-weight: 700; }
.conversation-response em { font-style: italic; }
.conversation-response code { border: 1px solid var(--line); border-radius: 5px; padding: 1px 4px; color: var(--ink-2); background: var(--panel-2); font: 600 .8em/1.35 var(--mono); }
.conversation-answer-heading { margin-top: 20px !important; color: var(--ink); font-size: .88em; font-weight: 750; line-height: 1.3; }
.conversation-answer-list { display: grid; gap: 8px; margin: 16px 0 0; padding-left: 1.2em; }
.conversation-answer-list li { padding-left: 4px; }
.conversation-response blockquote { margin: 17px 0 0; padding: 2px 0 2px 15px; border-left: 2px solid var(--cyan-line); color: var(--ink-2); }
.conversation-answer-divider { height: 1px; margin: 18px 0 0; border: 0; background: var(--line); }
.conversation-history { margin: 0 0 18px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.conversation-history > span { display: block; margin: 0 0 10px; color: var(--faint); font: 650 9px/1 var(--mono); letter-spacing: .11em; }
.conversation-history ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.conversation-turn { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.conversation-turn b { color: var(--faint); font: 700 9px/1.3 var(--mono); letter-spacing: .08em; }
.conversation-turn.is-jarvis b { color: var(--cyan-ink); }
.conversation-turn p { color: var(--ink-2); font-size: 12px; line-height: 1.42; }
.conversation-action-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.conversation-continue { display: flex; flex-wrap: wrap; gap: 7px; }
.conversation-continue button { min-height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; color: var(--ink-2); background: transparent; font: 650 11px/1 var(--mono); letter-spacing: .02em; cursor: pointer; }
.conversation-continue button:hover, .conversation-continue button:focus-visible { color: var(--ink); border-color: var(--ink-soft); background: var(--cyan-soft); }
.conversation-utilities { display: flex; align-items: center; gap: 6px; }
.conversation-new { min-height: 30px; padding: 0 4px; color: var(--muted); background: transparent; font: 650 10px/1 var(--mono); letter-spacing: .02em; }
.conversation-new:hover, .conversation-new:focus-visible { color: var(--ink); text-decoration: underline; }
.conversation-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.conversation-feedback-actions, .feedback-correction-actions { display: flex; align-items: center; gap: 6px; }
.feedback-button { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.feedback-button:hover, .feedback-button:focus-visible { color: var(--ink); border-color: var(--ink-soft); }
.feedback-button:disabled { opacity: .45; cursor: default; }
.feedback-button svg { width: 15px; height: 15px; }
.feedback-correction { display: grid; gap: 8px; flex: 1 0 100%; width: min(100%, 540px); margin-top: 2px; }
.feedback-correction textarea { min-height: 62px; width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; color: var(--ink); background: var(--panel); font: inherit; line-height: 1.45; }
.feedback-correction textarea:focus { outline: none; border-color: var(--cyan-line); box-shadow: 0 0 0 3px var(--cyan-soft); }
.feedback-save { min-height: 30px; border: 1px solid var(--ink); border-radius: 7px; padding: 0 10px; color: var(--surface); background: var(--ink); font: 700 11px/1 var(--mono); letter-spacing: .04em; cursor: pointer; }
.feedback-save:hover, .feedback-save:focus-visible { opacity: .86; }
.feedback-save:disabled { opacity: .45; cursor: default; }
.feedback-status { flex: 1 0 100%; margin: 0; color: var(--muted); font: 600 11px/1.4 var(--mono); }

/* COMPOSER */
.composer { width: 100%; max-width: 760px; margin: 14px 0 0; }
body.orb-engaged .composer { margin-top: 24px; }
.composer-shell {
  display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-m); transition: border-color .16s ease, box-shadow .16s ease;
}
.composer-shell:focus-within { border-color: var(--cyan-line); box-shadow: 0 0 0 4px var(--cyan-soft), var(--shadow-m); }
.composer textarea {
  flex: 1; min-width: 0; border: none; outline: none; resize: none; background: transparent;
  font-size: 15px; line-height: 1.5; color: var(--ink); padding: 6px 0; max-height: 168px; overflow-y: hidden;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-tools { display: flex; align-items: center; gap: 8px; }
.composer-icon {
  width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--line); color: var(--muted);
  display: grid; place-items: center; transition: all .14s ease; touch-action: none;
}
.composer-icon svg { width: 18px; height: 18px; }
.composer-icon:hover { color: var(--cyan-ink); border-color: var(--cyan-line); background: var(--cyan-soft); }
.composer-icon.is-recording { color: #fff; background: var(--cyan); border-color: var(--cyan); }
.composer-send {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  background: var(--ink); color: #fff; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: background .14s ease, opacity .14s ease;
}
.composer-send svg { width: 17px; height: 17px; }
.composer-send:hover { background: #000; }
.composer-send:disabled { opacity: .45; cursor: default; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 0 4px; }
.composer-hint { font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.composer-status {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cyan-ink); background: var(--cyan-soft); border: 1px solid var(--cyan-line);
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.composer-status[data-status="ready"] { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.composer-status[data-status="working"], .composer-status[data-status="live"] { color: var(--cyan-ink); background: var(--cyan-soft); border-color: var(--cyan-line); }
.composer-status[data-status="approval"] { color: var(--amber-ink); background: var(--amber-soft); border-color: var(--amber-line); }
.composer-status[data-status="offline"], .composer-status[data-status="error"] { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-soft); }

/* EXECUTION STRIP */
.strip { width: 100%; max-width: var(--stage-max); margin: 34px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.strip-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-s); min-height: 128px; display: flex; flex-direction: column; }
.strip-card > header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 11px; font-weight: 650; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.strip-icon { color: var(--faint); display: inline-grid; place-items: center; }
.strip-icon svg { width: 16px; height: 16px; }
.strip-card > header b { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.strip-card-approval > header { color: var(--amber-ink); }
.strip-card-approval > header .strip-icon { color: var(--amber); }
.strip-card-approval > header b { color: var(--amber-ink); }
.strip-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.mini-empty { color: var(--faint); font-size: 12px; margin: auto 0; }

.mini-row { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 8px; border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--line-2); }
.strip-body > button.mini-row { width: 100%; text-align: left; }
.mini-row-top { display: flex; align-items: center; gap: 8px; }
.mini-title { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mini-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-approve {
  align-self: flex-start; margin-top: 4px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--amber); color: #fff; font-size: 11.5px; font-weight: 650;
}
.mini-approve:hover { background: var(--amber-ink); }

.stage-more { margin: 28px auto 0; font-size: 12.5px; font-weight: 600; color: var(--cyan-ink); padding: 8px 12px; border-radius: var(--radius-s); }
.stage-more:hover { background: var(--cyan-soft); }

/* State dot */
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.state-dot.completed { background: var(--ok); }
.state-dot.needs_approval { background: var(--amber); }
.state-dot.failed, .state-dot.blocked, .state-dot.cancelled { background: var(--danger); }
.state-dot.running, .state-dot.planning, .state-dot.received, .state-dot.waiting_for_agent, .state-dot.waiting_for_connector { background: var(--cyan); }
.state-dot.paused { background: var(--amber); }

/* ============ SECONDARY VIEWS ============ */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; max-width: var(--stage-max); margin: 0 auto 22px; }
.view-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--faint); margin-bottom: 6px; }
.view-head h1 { font-size: 22px; font-weight: 650; letter-spacing: 0; }
.view-body { max-width: var(--stage-max); margin: 0 auto; }
.btn-ghost { height: 32px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 12.5px; font-weight: 550; color: var(--ink-2); background: var(--panel); }
.btn-ghost:hover { border-color: var(--faint); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); }

/* Tables */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; min-width: 560px; }
.data-table th, .data-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; vertical-align: middle; }
.data-table thead th { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--panel-2); }
.data-table tbody tr.is-focused td { background: var(--cyan-soft); box-shadow: inset 3px 0 0 var(--cyan); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.cell-strong { font-weight: 600; }
.pill { display: inline-block; font-size: 10.5px; font-weight: 650; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); text-transform: capitalize; }
.pill.ok { color: var(--ok); background: #eefaf3; border-color: #cdeeda; }
.pill.cyan { color: var(--cyan-ink); background: var(--cyan-soft); border-color: var(--cyan-line); }
.pill.amber { color: var(--amber-ink); background: var(--amber-soft); border-color: var(--amber-line); }
.pill.danger { color: var(--danger); background: var(--danger-soft); border-color: #f0cfc7; }
.link-btn { font-size: 12px; font-weight: 600; color: var(--cyan-ink); padding: 4px 6px; border-radius: 5px; }
.link-btn:hover { background: var(--cyan-soft); }

/* Empty / loading / error states */
.state-block { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); }
.state-block .state-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--faint); margin-bottom: 14px; }
.state-block .state-icon svg { width: 20px; height: 20px; }
.state-block h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.state-block p { font-size: 13px; color: var(--muted); max-width: 380px; line-height: 1.55; }
.state-block.error .state-icon { color: var(--danger); background: var(--danger-soft); border-color: #f0cfc7; }
.state-block .btn-ghost { margin-top: 16px; }
.skeleton { position: relative; overflow: hidden; background: var(--panel-2); border-radius: var(--radius-s); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 1.3s infinite; }
.skel-row { height: 52px; margin-bottom: 8px; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Connectors grid */
.connector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.connector-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-s); }
.connector-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.connector-name { font-size: 13px; font-weight: 650; letter-spacing: .01em; }
.connector-detail { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0 12px; }
.connector-setup { margin-top: 10px; padding: 10px 12px; background: var(--panel-2); border-left: 2px solid var(--cyan); border-radius: 0 6px 6px 0; }
.connector-setup .kv { font-size: 11.5px; color: var(--ink-2); line-height: 1.6; }
.connector-setup .kv b { color: var(--ink); }
.meta-connect-card { margin-bottom: 14px; }
.meta-connect-card .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Metric tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-s); }
.tile-label { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tile-val { font-size: 26px; font-weight: 650; letter-spacing: 0; font-variant-numeric: tabular-nums; line-height: 1; }
.tile-val small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* Section blocks */
.block { margin-bottom: 22px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h2 { font-size: 15px; font-weight: 600; }
.block-head .count { font-size: 11px; color: var(--muted); }

/* Forms */
.form-grid { display: grid; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-s); margin-bottom: 20px; }
.form-grid label { display: grid; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.form-grid input, .form-grid textarea, .form-grid select { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--panel); color: var(--ink); font-size: 13px; }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { outline: none; border-color: var(--cyan-line); box-shadow: 0 0 0 3px var(--cyan-soft); }
.form-grid textarea { resize: vertical; min-height: 60px; }
.btn-primary { height: 38px; padding: 0 18px; background: var(--ink); color: #fff; border-radius: var(--radius-s); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover { background: #000; }
.btn-primary:disabled { opacity: .45; cursor: default; }

/* Ops tabs */
.ops-tabs { display: flex; gap: 4px; max-width: var(--stage-max); margin: 0 auto 18px; overflow-x: auto; padding-bottom: 2px; }
.ops-tab { flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 550; color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.ops-tab:hover { background: var(--panel-2); color: var(--ink-2); }
.ops-tab.is-active { background: var(--cyan-soft); color: var(--cyan-ink); border-color: var(--cyan-line); }

/* Plan panel */
.plan-panel { max-width: var(--stage-max); margin: 20px auto 0; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--cyan); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-s); }
.plan-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 18px; }
.plan-summary > div { padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); }
.plan-summary span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.plan-summary strong { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.plan-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.plan-columns h4 { font-size: 12px; font-weight: 650; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.plan-columns ul { margin: 0; padding-left: 16px; font-size: 12.5px; }
.plan-columns li { margin-bottom: 7px; }
.plan-columns li span { color: var(--muted); margin-left: 6px; }

/* Portal */
.portal-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.attention-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--panel); margin-bottom: 8px; }
.attention-row strong { font-size: 12.5px; }
.attention-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ============ RIGHT CONTEXT DRAWER ============ */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw; z-index: 80;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-drawer);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
}
.drawer.is-open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--faint); margin-bottom: 5px; }
.drawer-head h2 { font-size: 16px; font-weight: 650; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }

/* ============ APPROVAL DRAWER ============ */
.approval-backdrop { position: fixed; inset: 0; background: rgba(22,25,28,.38); z-index: 98; }
.approval-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 96vw; z-index: 99;
  background: var(--panel); border-left: 1px solid var(--amber-line); box-shadow: var(--shadow-drawer);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
}
.approval-drawer.is-open { transform: translateX(0); }
.approval-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: var(--amber-soft); }
.approval-eyebrow { color: var(--amber-ink); }
.approval-drawer-head h2 { font-size: 16px; font-weight: 650; }
.approval-drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; }

.approval-item + .approval-item { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.approval-answer { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 14px; }
.approval-field { margin-bottom: 14px; }
.approval-field .k { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.approval-field .v { font-size: 13px; color: var(--ink-2); word-break: break-word; }
.approval-payload { font: 12px/1.55 var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; color: var(--ink-2); }
.approval-why { display: flex; gap: 8px; padding: 12px; background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: var(--radius-s); font-size: 12.5px; color: var(--amber-ink); line-height: 1.5; }
.approval-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-approve { flex: 1; height: 42px; background: var(--amber); color: #fff; border-radius: var(--radius-s); font-size: 13.5px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-approve:hover { background: var(--amber-ink); }
.btn-approve:disabled { opacity: .45; cursor: default; }
.btn-reject { flex: 0 0 auto; height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 13px; font-weight: 600; color: var(--danger); background: var(--panel); }
.btn-reject:hover { background: var(--danger-soft); border-color: #f0cfc7; }
.approval-audit { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12px; color: var(--cyan-ink); }
.approval-audit svg { width: 14px; height: 14px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-m); z-index: 120; opacity: 0; transition: opacity .2s ease, transform .2s ease; max-width: 90vw;
}
.toast.is-open { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ============ EXECUTION / AGENT LISTS (history + drawer) ============ */
.exec-list { display: flex; flex-direction: column; gap: 8px; }
.exec-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); }
.exec-body { min-width: 0; }
.exec-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exec-title:is(button) { width: 100%; text-align: left; }
.exec-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exec-state { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.exec-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.exec-controls button { height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; font-weight: 550; color: var(--ink-2); background: var(--panel); }
.exec-controls button:hover { border-color: var(--faint); }
.exec-controls .danger { color: var(--danger); }

.agent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.agent-row:first-child { border-top: none; }
.agent-role { font-size: 13px; font-weight: 600; }
.agent-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.agent-actions { display: flex; gap: 7px; align-items: center; }
.agent-actions select { height: 30px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); font-size: 11.5px; padding: 0 8px; max-width: 170px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  body.orb-engaged .orb-wrap,
  body.orb-engaged:not(.orb-workspace) .orb-wrap,
  body.orb-workspace .orb-wrap { top: auto; left: auto; width: min(100%, 320px); }
  .orb-wrap { width: min(100%, 360px); }
  .operator-pulse { width: min(100%, 560px); }
  .strip { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .plan-columns { grid-template-columns: 1fr; }
  .portal-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .command-hero { display: flex; flex-direction: column; min-height: 0; padding-bottom: 26px; }
  .orb-wrap { position: relative; top: auto; left: auto; width: min(100%, 360px); transform: none; transition: width 620ms cubic-bezier(.16,.96,.22,1), transform 620ms cubic-bezier(.16,.96,.22,1); }
  body.orb-engaged .orb-wrap,
  body.orb-engaged:not(.orb-workspace) .orb-wrap { top: auto; left: auto; width: min(100%, 320px); transform: none; order: 2; }
  body.orb-workspace .orb-wrap { position: relative; left: auto; top: auto; width: min(100%, 300px); transform: translateY(-4px); transition: width 620ms cubic-bezier(.16,.96,.22,1), transform 620ms cubic-bezier(.16,.96,.22,1); }
  .operator-pulse { position: relative; top: auto; left: auto; right: auto; width: min(100%, 540px); margin: 10px auto 0; padding-left: 24px; visibility: hidden; opacity: 0; transform: none; transition: none; }
  body:not(.orb-engaged) .operator-pulse { display: none; }
  body.orb-engaged .operator-pulse { visibility: visible; opacity: 1; transform: none; order: 1; }
  body.orb-engaged .operator-pulse.is-conversation { width: min(100%, 540px); max-width: 540px; margin: 18px auto 0; padding: 0; transform: none; }
  body.orb-engaged .operator-pulse.is-conversation .operator-insight { width: 100%; max-width: none; }
  .operator-status { font-size: 30px; }
}

/* Public Orb surface. The internal operations cockpit keeps its full
   navigation, while orb.velorabureau.com is a focused companion product.
   This is intentionally scoped to the public host and does not alter the
   private workspace layout or any backend capability. */
body.public-surface {
  background: #f7f8f8;
  color: #17212b;
}
body.public-surface .rail,
body.public-surface .mobile-nav,
body.public-surface .mobile-nav-backdrop,
body.public-surface .menu-button,
body.public-surface .profile,
body.public-surface .clock { display: none !important; }
body.public-surface .topbar {
  height: 72px; flex-basis: 72px; padding: 0 clamp(20px, 5vw, 72px);
  background: transparent; border-bottom: 1px solid rgba(42,53,66,.08);
  backdrop-filter: blur(12px) saturate(1.2);
}
body.public-surface .workspace-name { font-size: 16px; letter-spacing: .01em; }
body.public-surface .workspace-sub { color: #7b8791; }
body.public-surface .conn { border-color: rgba(42,53,66,.12); background: rgba(255,255,255,.66); }
body.public-surface .conn[data-state="connected"] .conn-dot { background: #25956b; }
body.public-surface .stage { padding: 0 clamp(20px, 5vw, 72px) 56px; }
body.public-surface .view:not(#view-command) { display: none !important; }
body.public-surface .command-stage {
  width: 100%; max-width: 1160px; min-width: 0; min-height: calc(100dvh - 72px);
  justify-content: center; align-items: stretch;
}
body.public-surface .stage-eyebrow {
  align-self: center; margin: clamp(26px, 6vh, 72px) 0 0;
  color: #8a969f; font-size: 9px; letter-spacing: .24em;
}
body.public-surface .command-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 0; gap: 0; padding: clamp(20px, 4vh, 42px) 0 0; border: 0;
}
body.public-surface .command-hero::before { display: none; }
body.public-surface .operator-pulse { display: none !important; }
body.public-surface .orb-wrap {
  width: min(76vw, 390px); max-width: 390px; transform: none !important;
  justify-self: center; order: 1;
}
body.public-surface .orb-stage { transform: none !important; }
body.public-surface .arrival-greeting { margin-bottom: 10px; font-size: 14px; color: #263441; }
body.public-surface .orb-status { margin-top: -12px; }
body.public-surface .orb-controls { margin-top: 16px; }
body.public-surface .composer {
  width: 100%; max-width: 740px; min-width: 0; margin: clamp(24px, 5vh, 54px) auto 0; order: 2;
}
body.public-surface .composer-shell {
  width: 100%; min-width: 0; overflow: hidden;
  padding: 11px 11px 11px 18px; border-color: rgba(42,53,66,.13);
  border-radius: 16px; background: rgba(255,255,255,.84);
  box-shadow: 0 18px 52px -34px rgba(20,28,34,.36);
}
body.public-surface .composer textarea { font-size: 15px; }
body.public-surface .composer-tools { flex: 0 0 auto; }
body.public-surface .composer-hint { color: #89959e; }
body.public-surface .composer-status { display: none; }
body.public-surface .strip,
body.public-surface .stage-more { display: none !important; }

/* After a turn, the answer earns the left side and the Orb becomes the
   persistent visual partner on the right. Both columns are bounded so long
   replies never create horizontal overflow. */
body.public-surface.orb-engaged .command-stage { justify-content: flex-start; }
body.public-surface.orb-engaged .command-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  grid-template-areas: "work orb"; align-items: center; gap: clamp(30px, 7vw, 112px);
  min-height: clamp(360px, calc(100dvh - 240px), 560px); padding-top: clamp(18px, 4vh, 44px);
}
body.public-surface.orb-engaged .operator-pulse {
  display: block !important; grid-area: work; width: min(100%, 560px); min-width: 0;
  justify-self: start; padding: 0 0 0 22px; border-left: 1px solid rgba(42,53,66,.16);
}
body.public-surface.orb-engaged .operator-pulse.is-conversation {
  padding-left: 0; border-left: 0; max-width: 560px;
}
body.public-surface.orb-engaged .orb-wrap { grid-area: orb; width: min(100%, 390px); justify-self: end; }
body.public-surface.orb-engaged .composer { margin-top: 24px; }

@media (max-width: 820px) {
  body.public-surface .topbar { height: 64px; flex-basis: 64px; padding: 0 18px; }
  body.public-surface .stage { padding: 0 16px 36px; }
  body.public-surface .command-stage { min-height: calc(100dvh - 64px); }
  body.public-surface .stage-eyebrow { margin-top: 26px; font-size: 8px; letter-spacing: .2em; }
  body.public-surface .command-hero { padding-top: 22px; }
  body.public-surface .orb-wrap { width: min(82vw, 330px); max-width: 330px; }
  body.public-surface .orb-stage { width: 100%; }
  body.public-surface .composer { margin-top: 30px; }
  body.public-surface .composer-foot { justify-content: center; }
  body.public-surface .composer-hint { display: block; text-align: center; }
  body.public-surface.orb-engaged .command-hero {
    display: flex; flex-direction: column; min-height: 0; gap: 0; padding-top: 18px;
  }
  body.public-surface.orb-engaged .orb-wrap {
    order: 1; width: min(64vw, 250px); max-width: 250px; justify-self: center;
  }
  body.public-surface.orb-engaged .operator-pulse {
    order: 2; width: 100%; max-width: 560px; margin: 22px auto 0; padding: 0;
    border: 0; min-width: 0; overflow: hidden;
  }
  body.public-surface.orb-engaged .operator-pulse.is-conversation { margin-top: 20px; }
  body.public-surface.orb-engaged .composer { order: 3; margin-top: 24px; }
  body.public-surface .operator-status,
  body.public-surface .operator-task,
  body.public-surface .conversation-response,
  body.public-surface .operator-insight { max-width: 100%; min-width: 0; overflow-wrap: anywhere; word-break: normal; }
}

@media (max-width: 440px) {
  body.public-surface .topbar { padding: 0 14px; }
  body.public-surface .conn { padding: 0 9px; }
  body.public-surface .conn-label { display: none; }
  body.public-surface .orb-wrap { width: min(86vw, 310px); }
  body.public-surface .composer-shell { padding-left: 14px; }
  body.public-surface .composer-icon,
  body.public-surface .composer-send { flex: 0 0 38px; width: 38px; min-width: 38px; padding: 0; justify-content: center; }
}

@media (max-width: 600px) {
  body.public-surface .composer { width: calc(100vw - 48px); max-width: calc(100vw - 48px); margin-left: auto; margin-right: auto; }
  body.public-surface .composer-shell { position: relative; display: block; padding-right: 104px; }
  body.public-surface .composer textarea { display: block; width: 100%; }
  body.public-surface .composer-tools { position: absolute; right: 10px; bottom: 11px; }
  body.public-surface .composer-icon,
  body.public-surface .composer-send { flex: 0 0 38px; width: 38px; min-width: 38px; padding: 0; justify-content: center; }
  body.public-surface .composer-send span { display: none; }
}

@media (max-width: 720px) {
  .rail { display: none; }
  .menu-button { display: inline-grid; place-items: center; }
  .stage { padding: 24px 16px 56px; }
  .topbar { padding: 0 16px; }
  .clock { display: none; }
  .conn-label { display: none; }
  .conn { padding: 0 9px; }
  .stage-eyebrow { margin-top: 2px; }
  .command-hero { min-height: 0; }
  .command-stage { align-items: stretch; }
  .command-hero { display: flex; flex-direction: column; align-items: stretch; padding-bottom: 18px; }
  .orb-wrap { width: 100%; max-width: 330px; }
  .orb-stage { width: min(78vw, 286px); }
  body.orb-engaged .orb-wrap { max-width: 240px; }
  body.orb-engaged:not(.orb-workspace) .orb-wrap { max-width: 330px; }
  body.orb-workspace .orb-wrap { max-width: 240px; }
  body.orb-engaged .orb-stage { width: min(54vw, 220px); }
  body.orb-engaged .orb-status { min-height: 38px; }
  body.orb-engaged .orb-controls { margin-top: 6px; }
  body.orb-engaged .operator-pulse.is-conversation { margin-top: 12px; }
  .conversation-response > div { font-size: 17px; line-height: 1.43; }
  .orb-status { min-height: 44px; padding: 0 8px; }
  .orb-transcript { max-width: 310px; }
  .orb-controls { margin-top: 10px; }
  .orb-hit { width: 58px; height: 58px; }
  .orb-mic { width: 20px; height: 20px; }
  .operator-pulse { padding: 22px 0 10px 20px; }
  /* On a phone, the operator's answer and work context lead. The Orb becomes
     a compact voice-flow control instead of consuming the working surface. */
  body.orb-engaged:not(.orb-docked) .command-stage { padding-bottom: 178px; }
  body.orb-engaged:not(.orb-docked) .operator-pulse { order: 1; margin: 14px auto 0; }
  body.orb-engaged:not(.orb-docked) .orb-wrap {
    position: fixed; z-index: 70; top: auto; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
    order: 2; display: grid; grid-template-columns: 120px minmax(0, 1fr);
    grid-template-areas: "stage status" "stage controls"; gap: 4px 12px;
    width: min(calc(100vw - 32px), 390px); max-width: none; margin: 0; transform: translateX(-50%);
    align-items: center; justify-items: start;
  }
  body.orb-engaged:not(.orb-docked) .orb-wrap .arrival-greeting { display: none; }
  body.orb-engaged:not(.orb-docked) .orb-stage { grid-area: stage; width: 120px; margin: 0; }
  body.orb-engaged:not(.orb-docked) .orb-status { grid-area: status; width: 100%; min-height: 0; margin: 0; text-align: left; align-items: flex-start; }
  body.orb-engaged:not(.orb-docked) .orb-transcript { max-width: none; }
  body.orb-engaged:not(.orb-docked) .orb-controls { grid-area: controls; margin: 0; justify-content: flex-start; gap: 6px; }
  body.orb-docked .stage { padding-top: 24px; padding-bottom: 196px; }
  body.orb-docked .view.is-active:not(#view-command) { padding-right: 0; }
  .orb-dock { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); right: 50%; width: 164px; min-height: 174px; transform: translate(50%, 8px) scale(.96); }
  body.orb-docked .orb-dock { transform: translate(50%, 0) scale(1); }
  .orb-dock .orb-stage { width: 138px; }
  .orb-dock .orb-status { min-height: 28px; }
  .orb-dock .orb-controls { display: none; }
  .operator-status { margin-top: 20px; font-size: 27px; }
  .operator-task { font-size: 13px; }
  .composer { margin-top: 20px; }
  .composer-hint { display: none; }
  .composer-foot { justify-content: flex-end; }
  .view-head h1 { font-size: 19px; }
  .drawer, .approval-drawer { width: 100%; max-width: 100%; }
}

@media (max-width: 440px) {
  .tiles { grid-template-columns: 1fr; }
  .portal-summary { grid-template-columns: 1fr; }
  .composer-send span { display: none; }
  .composer-send { padding: 0 12px; }
  .orb-controls .chip span { font-size: 11px; }
}

/* Embedded browsers and compact landscape windows need the controls in view,
   not a cropped decorative orb. Full-height phones keep the larger treatment. */
@media (max-width: 720px) and (max-height: 640px) {
  .stage { padding-top: 14px; }
  .stage-eyebrow, .arrival-greeting { display: none; }
  .orb-stage { width: min(55vw, 220px); }
  .orb-status { margin-top: -4px; min-height: 38px; }
  .orb-controls { margin-top: 6px; }
  .chip { height: 30px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .view.is-active { animation: none; }
  .orb-dock { transform: none !important; }
}
body[data-reduce-motion="true"] .view.is-active { animation: none; }
body[data-reduce-motion="true"] .orb-dock { transform: none !important; }

/* ============ V51 COMMAND COMPOSITION ============
   Arrival is a human-facing companion moment. Density is earned only after
   JARVIS has real work, a result, or an approval to show. */
.orb-home { display: none; }
body:not(.orb-engaged) .operator-pulse { display: none; }
body:not(.orb-engaged) .strip,
body:not(.orb-engaged) .stage-more { display: none; }
body:not(.orb-engaged) .stage-eyebrow { text-align: center; }
body:not(.orb-engaged) .command-hero { border-bottom: 0; }
body:not(.orb-engaged) .arrival-greeting { margin-bottom: 8px; font-size: clamp(16px, 1.4vw, 20px); font-weight: 600; }
body.orb-engaged .arrival-greeting { opacity: 0; transform: translateY(-12px); pointer-events: none; }
body:not(.orb-engaged) .orb-status { margin-top: -2px; }
body:not(.orb-engaged) .orb-controls { margin-top: 9px; }
body.orb-engaged .stage-eyebrow { text-align: left; }
body.orb-engaged .operator-pulse.is-conversation .operator-insight { width: 100%; }

@media (min-width: 821px) and (max-height: 720px) {
  .stage { padding-top: 22px; padding-bottom: 30px; }
  .command-hero { min-height: 330px; }
  body.orb-engaged .command-hero { min-height: 430px; }
  body:not(.orb-engaged) .orb-wrap { width: 280px; }
  body:not(.orb-engaged) .composer { margin-top: 9px; }
  body:not(.orb-engaged) .composer-foot { margin-top: 6px; }
}

@media (max-width: 820px) {
  body:not(.orb-engaged) .orb-wrap { width: min(100%, 320px); }
  body.orb-engaged .command-hero { min-height: 0; }
  body.orb-engaged .operator-pulse { width: min(100%, 560px); }
}

/* ============ V52 COMMERCIAL SURFACE POLISH ============
   The Orb remains present across the product, but secondary work surfaces
   need a quiet, compact presence lane so tables and approvals stay primary. */
.state-block .state-icon svg { width: 19px; height: 19px; }
.state-block { min-height: 188px; padding: 42px 24px; }
.orb-dock {
  width: 176px; min-height: 158px; padding: 10px 10px 12px;
  background: rgba(255,255,255,.78); border: 1px solid rgba(231,233,236,.9);
  border-radius: 16px; box-shadow: 0 12px 32px -24px rgba(20,28,34,.34);
  backdrop-filter: blur(10px) saturate(1.12);
}
.orb-dock .arrival-greeting { display: none; }
.orb-dock .orb-stage { width: 132px; }
.orb-dock .orb-status { min-height: 28px; margin-top: -12px; }
.orb-dock .orb-state { font-size: 8px; }
.orb-dock .orb-transcript { max-width: 150px; font-size: 10px; line-height: 1.25; }
.orb-dock .orb-controls { display: none; }
body.orb-docked .view.is-active:not(#view-command) { padding-right: 194px; }

@media (min-width: 821px) {
  body:not(.orb-engaged) .command-hero { min-height: clamp(320px, calc(100dvh - 360px), 430px); }
  body:not(.orb-engaged) .orb-wrap { width: clamp(290px, 31vw, 350px); }
  body:not(.orb-engaged) .composer { max-width: 820px; }
}

@media (max-width: 720px) {
  .orb-dock { width: 164px; min-height: 164px; padding: 8px 8px 10px; }
  .orb-dock .orb-stage { width: 132px; }
  .orb-dock .orb-status { margin-top: -14px; }
  body.orb-docked .view.is-active:not(#view-command) { padding-right: 0; }
}

/* ============ V53 COMMAND COMPOSITION ============
   The command surface is a working room, not an empty landing page. On a
   desktop viewport the operator readout and Orb share one deliberate frame;
   on smaller screens the same hierarchy collapses into a readable stack. */
@media (min-width: 821px) {
  .stage { padding-top: 28px; }
  .command-stage { max-width: 1240px; }
  body:not(.orb-engaged) .stage-eyebrow { text-align: left; }
  body:not(.orb-engaged) .command-hero {
    min-height: clamp(320px, calc(100dvh - 450px), 430px);
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    grid-template-areas: "work orb";
    gap: clamp(32px, 7vw, 112px);
    align-items: center;
    justify-items: initial;
  }
  body:not(.orb-engaged) .operator-pulse {
    display: block;
    width: min(100%, 520px);
    justify-self: start;
    padding-top: 18px;
    padding-bottom: 18px;
    visibility: visible;
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  body:not(.orb-engaged) .operator-pulse::after { width: min(18vw, 220px); }
  body:not(.orb-engaged) .operator-status { font-size: clamp(26px, 2.5vw, 38px); }
  body:not(.orb-engaged) .operator-ledger { margin-top: 24px; }
  body:not(.orb-engaged) .orb-wrap { justify-self: end; width: clamp(290px, 31vw, 360px); }
  body:not(.orb-engaged) .composer { max-width: 920px; margin-top: 12px; }
  body.orb-engaged .command-hero { min-height: clamp(420px, calc(100dvh - 390px), 540px); }
  body.orb-engaged .composer { margin-top: 18px; }
}

/* A no-data state should read as a calm status, not a full-width blank wall.
   Tables and real records retain their full working width. */
.view-body > .state-block { max-width: 720px; min-height: 220px; margin: 0; }
.connector-grid .state-block { grid-column: 1 / -1; max-width: 720px; }
.rail-item:hover[data-tip]:not(.is-active)::after,
.rail-item:focus-visible[data-tip]:not(.is-active)::after { opacity: 1; transform: translateY(-50%) scale(1); }

@media (max-width: 820px) {
  body:not(.orb-engaged) .operator-pulse {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: none;
    filter: none;
    order: 2;
    width: min(100%, 540px);
    margin: 18px auto 0;
    padding: 20px 0 8px 20px;
    border-left: 1px solid rgba(42,53,66,.18);
  }
  body:not(.orb-engaged) .operator-pulse::after { display: none; }
  body:not(.orb-engaged) .operator-status { font-size: clamp(25px, 7vw, 34px); }
  body:not(.orb-engaged) .operator-ledger { margin-top: 22px; }
  body:not(.orb-engaged) .orb-wrap { order: 1; }
  body:not(.orb-engaged) .composer { order: 3; margin-top: 14px; }
  body:not(.orb-engaged) .stage-eyebrow { text-align: center; }
  .view-body > .state-block { max-width: 680px; }
}

/* ============ V59 AUTHORITATIVE COMMAND LAYOUT ============
   Keep the command surface readable for a person first. The Orb is a live
   presence, but it must share the frame with the answer and composer instead
   of pushing either one off-screen. This final layer intentionally wins over
   the older composition passes above. */
.stage { overflow: clip; }
.command-stage { width: min(100%, 1280px); }
.command-hero { overflow: visible; }

@media (min-width: 821px) {
  .stage { padding: 30px clamp(28px, 4vw, 64px) 56px; }
  .command-stage { align-items: stretch; }
  .stage-eyebrow { margin-top: 4px; text-align: left; }

  body:not(.orb-engaged) .command-hero {
    min-height: clamp(390px, calc(100dvh - 360px), 520px);
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    grid-template-areas: "work orb";
    gap: clamp(28px, 6vw, 84px);
    align-items: center;
    justify-items: initial;
    padding: 28px 0 8px;
  }
  body:not(.orb-engaged) .operator-pulse {
    display: block;
    width: min(100%, 560px);
    min-width: 0;
    justify-self: start;
    padding: 18px 18px 24px 32px;
    visibility: visible;
    opacity: 1;
    transform: none;
    filter: none;
    border-left-color: rgba(42,53,66,.14);
  }
  body:not(.orb-engaged) .operator-pulse::after { width: min(20vw, 240px); }
  body:not(.orb-engaged) .operator-status { max-width: 500px; font-size: clamp(32px, 3.25vw, 48px); line-height: 1.04; }
  body:not(.orb-engaged) .operator-ledger { max-width: 540px; margin-top: 28px; }
  body:not(.orb-engaged) .orb-wrap { width: min(100%, 370px); justify-self: end; }
  body:not(.orb-engaged) .orb-stage { width: 100%; }

  body.orb-engaged .command-hero {
    min-height: clamp(430px, calc(100dvh - 330px), 580px);
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    grid-template-areas: "work orb";
    gap: clamp(22px, 5vw, 68px);
    align-items: center;
    padding: 24px 0 8px;
  }
  body.orb-engaged .operator-pulse { width: min(100%, 620px); padding-left: 32px; }
  body.orb-engaged .operator-pulse.is-conversation { padding-left: 0; }
  body.orb-engaged .orb-wrap { width: min(100%, 350px); justify-self: end; }
  body.orb-engaged .orb-stage { width: 100%; }
  body.orb-engaged .composer { max-width: 920px; margin: 20px auto 0; }
  .composer-shell { border-radius: 12px; }
}

/* Public Orb uses the same human-first hierarchy, without exposing cockpit
   navigation or private records. It should not open on a giant empty Orb. */
@media (min-width: 821px) {
  body.public-surface:not(.orb-engaged) .command-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    grid-template-areas: "work orb";
    gap: clamp(28px, 7vw, 96px);
    min-height: clamp(430px, calc(100dvh - 174px), 600px);
    padding: 34px 0 12px;
  }
  body.public-surface:not(.orb-engaged) .operator-pulse {
    display: block !important;
    grid-area: work;
    width: min(100%, 560px);
    justify-self: start;
    padding: 16px 0 24px 28px;
    border-left: 1px solid rgba(42,53,66,.14);
    visibility: visible;
    opacity: 1;
    transform: none;
    filter: none;
  }
  body.public-surface:not(.orb-engaged) .operator-pulse::after { display: none; }
  body.public-surface:not(.orb-engaged) .operator-status { max-width: 520px; font-size: clamp(34px, 4vw, 58px); line-height: 1.02; }
  body.public-surface:not(.orb-engaged) .operator-ledger { max-width: 520px; margin-top: 28px; }
  body.public-surface:not(.orb-engaged) .orb-wrap { grid-area: orb; width: min(100%, 370px); justify-self: end; }
  body.public-surface:not(.orb-engaged) .composer { max-width: 820px; margin-top: 18px; }
  body.public-surface.orb-engaged .command-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: clamp(24px, 6vw, 72px);
    min-height: clamp(400px, calc(100dvh - 190px), 560px);
    padding-top: 30px;
  }
  body.public-surface.orb-engaged .operator-pulse { width: min(100%, 600px); }
  body.public-surface.orb-engaged .orb-wrap { width: min(100%, 350px); }
}

@media (max-width: 820px) {
  .stage { padding: 22px 16px 48px; }
  .command-stage { width: 100%; }
  .stage-eyebrow { margin-top: 0; text-align: center; }
  .command-hero { padding-top: 16px; }
  body:not(.orb-engaged) .operator-pulse {
    display: block;
    width: min(100%, 560px);
    margin: 12px auto 0;
    padding: 18px 0 8px 18px;
    border-left-color: rgba(42,53,66,.14);
    visibility: visible;
    opacity: 1;
    transform: none;
    filter: none;
  }
  body:not(.orb-engaged) .operator-status { max-width: 100%; font-size: clamp(27px, 8vw, 36px); line-height: 1.06; }
  body:not(.orb-engaged) .operator-ledger { margin-top: 20px; }
  body:not(.orb-engaged) .orb-wrap { width: min(82vw, 320px); }
  body:not(.orb-engaged) .composer { margin-top: 20px; }

  body.public-surface:not(.orb-engaged) .command-hero {
    display: flex;
    min-height: 0;
    padding-top: 20px;
  }
  body.public-surface:not(.orb-engaged) .orb-wrap { width: min(78vw, 300px); order: 1; }
  body.public-surface:not(.orb-engaged) .operator-pulse {
    display: block !important;
    order: 2;
    width: min(100%, 540px);
    margin: 20px auto 0;
    padding: 16px 0 8px 18px;
    border-left: 1px solid rgba(42,53,66,.14);
  }
  body.public-surface:not(.orb-engaged) .operator-status { font-size: clamp(28px, 8vw, 38px); }
  body.public-surface:not(.orb-engaged) .composer { order: 3; width: 100%; max-width: none; margin-top: 22px; }
  body.public-surface .composer-shell { border-radius: 12px; }

  body.public-surface.orb-engaged:not(.orb-docked) .orb-wrap {
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: min(calc(100vw - 24px), 390px);
    max-width: none;
    transform: translateX(-50%) !important;
  }

  /* Keep the response rail readable on a phone; the Orb still docks only
     during a live turn, when it is useful as a persistent presence control. */
  body.orb-engaged .operator-pulse.is-conversation { width: 100%; max-width: 560px; margin-top: 12px; }
  body.orb-engaged .conversation-response > div { font-size: clamp(18px, 5.2vw, 24px); line-height: 1.42; }
  body.orb-engaged .composer { width: 100%; max-width: none; }
  .operator-ledger > div { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; }
}

@media (max-width: 440px) {
  .stage { padding-left: 14px; padding-right: 14px; }
  body:not(.orb-engaged) .orb-wrap { width: min(78vw, 292px); }
  body:not(.orb-engaged) .operator-pulse { padding-left: 14px; }
  body:not(.orb-engaged) .operator-status { font-size: 29px; }
  body.public-surface:not(.orb-engaged) .operator-pulse { padding-left: 14px; }
  body.public-surface:not(.orb-engaged) .operator-status { font-size: 30px; }
  .operator-task { font-size: 13px; }
  .operator-ledger dd { font-size: 11.5px; }
}

/* ============ V60 HUMAN-FIRST PUBLIC ORB ============
   The public companion should feel like a calm place to work with JARVIS,
   not a status console. Keep the actual execution state and controls intact,
   but give the person, the Orb, and the next action a clear visual order. */
body.public-surface {
  --canvas: #f5f7f8;
  background: var(--canvas);
}

body.public-surface .topbar {
  height: 68px;
  flex-basis: 68px;
  padding-inline: clamp(22px, 5vw, 72px);
  background: rgba(245,247,248,.92);
}

body.public-surface .workspace-name {
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -.01em;
}

body.public-surface .workspace-sub {
  margin-top: 1px;
  font-size: 11px;
}

body.public-surface .stage {
  padding: 0 clamp(24px, 6vw, 88px) 44px;
}

body.public-surface .command-stage {
  width: min(100%, 1180px);
  min-height: calc(100dvh - 68px);
  align-items: stretch;
}

body.public-surface .stage-eyebrow {
  margin: 30px 0 0;
  color: #89959e;
  font-size: 9px;
  letter-spacing: .24em;
  text-align: center;
}

body.public-surface .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: clamp(48px, 7vw, 112px);
  min-height: clamp(400px, calc(100dvh - 248px), 548px);
  padding: 34px 0 18px;
  align-items: center;
}

body.public-surface:not(.orb-engaged) .operator-pulse {
  width: min(100%, 510px);
  padding: 0;
  border-left: 0;
  justify-self: start;
}

body.public-surface:not(.orb-engaged) .operator-pulse::before,
body.public-surface:not(.orb-engaged) .operator-pulse::after,
body.public-surface:not(.orb-engaged) .operator-pulse-head,
body.public-surface:not(.orb-engaged) .operator-context-line,
body.public-surface:not(.orb-engaged) .operator-ledger,
body.public-surface:not(.orb-engaged) .operator-flow {
  display: none;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 510px;
  margin: 0;
  color: #19222b;
  font-size: clamp(42px, 4.5vw, 68px);
  font-weight: 570;
  letter-spacing: -.035em;
  line-height: .99;
  text-wrap: balance;
}

body.public-surface:not(.orb-engaged) .operator-request {
  max-width: 420px;
  margin-top: 26px;
  padding: 0 0 0 18px;
  border-top: 0;
}

body.public-surface:not(.orb-engaged) .operator-request::before {
  top: 1px;
  height: 42px;
  background: var(--cyan);
}

body.public-surface:not(.orb-engaged) .operator-request > span {
  color: var(--cyan-ink);
  font-size: 9px;
  letter-spacing: .16em;
}

body.public-surface:not(.orb-engaged) .operator-task {
  margin-top: 9px;
  color: #66727c;
  font-size: 14px;
  line-height: 1.55;
}

body.public-surface:not(.orb-engaged) .orb-wrap {
  width: min(100%, 430px);
  justify-self: end;
}

body.public-surface:not(.orb-engaged) .orb-stage {
  transform: scale(1.04) !important;
}

body.public-surface:not(.orb-engaged) .orb-status {
  margin-top: -2px;
}

body.public-surface:not(.orb-engaged) .orb-controls {
  margin-top: 16px;
}

body.public-surface .composer {
  width: min(100%, 900px);
  max-width: none;
  margin: 0 auto;
}

body.public-surface .composer-shell {
  min-height: 62px;
  padding: 10px 10px 10px 20px;
  border-color: #dfe4e7;
  border-radius: 14px;
  box-shadow: 0 12px 34px -26px rgba(28,42,52,.38);
}

body.public-surface .composer textarea {
  font-size: 15px;
}

body.public-surface .composer-foot {
  margin-top: 9px;
  padding-inline: 4px;
}

body.public-surface .composer-hint {
  color: #89959e;
}

body.public-surface.orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  min-height: 510px;
  gap: clamp(38px, 6vw, 90px);
}

body.public-surface.orb-engaged .operator-pulse {
  width: min(100%, 560px);
  padding: 0;
  border-left: 0;
}

body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 390px);
  justify-self: end;
}

body.public-surface.orb-engaged .operator-pulse.is-conversation {
  width: 100%;
}

body.public-surface.orb-engaged .conversation-response > div {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.32;
  letter-spacing: -.018em;
}

@media (max-width: 820px) {
  body.public-surface .topbar {
    height: 64px;
    flex-basis: 64px;
    padding-inline: 18px;
  }

  body.public-surface .stage {
    padding: 0 16px 34px;
  }

  body.public-surface .command-stage {
    min-height: calc(100dvh - 64px);
  }

  body.public-surface .stage-eyebrow {
    margin-top: 24px;
  }

  body.public-surface .command-hero {
    min-height: 0;
    padding: 16px 0 20px;
    gap: 0;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(70vw, 270px);
    justify-self: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse {
    width: min(100%, 540px);
    margin: 16px auto 0;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: 460px;
    font-size: clamp(34px, 9.5vw, 46px);
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    margin-top: 14px;
  }

  body.public-surface .composer {
    width: 100%;
  }

  body.public-surface.orb-engaged .command-hero {
    min-height: 0;
    gap: 20px;
  }

  body.public-surface.orb-engaged .operator-pulse {
    width: 100%;
  }

  body.public-surface.orb-engaged .orb-wrap {
    width: min(74vw, 292px);
    justify-self: center;
  }
}

@media (max-width: 440px) {
  body.public-surface .stage-eyebrow {
    margin-top: 22px;
    font-size: 8px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(88vw, 322px);
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: clamp(34px, 10.5vw, 44px);
  }

  body.public-surface .composer-shell {
    min-height: 58px;
    padding-left: 15px;
    border-radius: 12px;
  }
}

/* V62 short-viewport guard: keep the first human action visible on compact
   laptop windows and narrow phones without changing the active conversation
   or docked Orb geometry. */
@media (min-width: 821px) and (max-height: 800px) {
  body.public-surface:not(.orb-engaged) .command-hero {
    min-height: 390px;
    padding-top: 18px;
    padding-bottom: 8px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(100%, 310px);
  }

  body.public-surface:not(.orb-engaged) .orb-controls {
    margin-top: 10px;
    transform: scale(.92);
    transform-origin: top center;
  }
}

/* ============ V71 COMMERCIAL INTERACTION POLISH ============
   Feedback is part of the product surface: a submitted request must look
   active immediately, recoverable errors must offer a clear retry affordance,
   and the public voice lane should read like a companion rather than a
   provider diagnostic. */
body.public-surface .composer[data-state="preparing"] .composer-shell,
body.public-surface .composer[data-state="working"] .composer-shell,
body.public-surface .composer[data-state="live"] .composer-shell {
  border-color: #a9dce5;
  box-shadow: 0 0 0 4px rgba(230,246,249,.8), 0 16px 40px -30px rgba(28,42,52,.48);
}

body.public-surface .composer[data-state="error"] .composer-shell {
  border-color: #e7b8ae;
  box-shadow: 0 0 0 4px rgba(251,234,230,.8), 0 16px 40px -30px rgba(28,42,52,.48);
}

body.public-surface .composer-send[data-state="preparing"] svg,
body.public-surface .composer-send[data-state="working"] svg,
body.public-surface .composer-send[data-state="live"] svg {
  animation: composerProgress .85s linear infinite;
}

body.public-surface .composer-send[data-state="error"] {
  background: #9a3b2c;
}

@keyframes composerProgress {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.public-surface .composer-send[data-state="preparing"] svg,
  body.public-surface .composer-send[data-state="working"] svg,
  body.public-surface .composer-send[data-state="live"] svg { animation: none; }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(70vw, 270px);
  }
}

/* ============ V63 AUTHORITATIVE PUBLIC COMPOSITION ============
   One deliberate room for a person and their companion. The earlier release
   layers remain useful for private surfaces; this final public layer removes
   the competing dashboard geometry without changing runtime behavior. */
body.public-surface {
  background: #f4f6f7;
}

body.public-surface .topbar {
  height: 70px;
  flex-basis: 70px;
  padding-inline: clamp(22px, 5vw, 72px);
  background: rgba(244,246,247,.94);
  border-bottom-color: #e1e6e9;
}

body.public-surface .stage {
  padding: 0 clamp(22px, 5vw, 72px) 32px;
}

body.public-surface .command-stage {
  width: min(100%, 1080px);
  min-height: calc(100dvh - 70px);
  align-items: stretch;
  justify-content: initial;
}

  body.public-surface .stage-eyebrow {
  margin: clamp(18px, 3vh, 30px) 0 0;
  color: #82909a;
  font-size: 9px;
  letter-spacing: .2em;
  text-align: left;
}

body.public-surface:not(.orb-engaged) .command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr);
  grid-template-areas: "work orb";
  gap: clamp(36px, 7vw, 96px);
  min-height: clamp(360px, calc(100dvh - 270px), 470px);
  padding: 20px 0 4px;
  align-items: center;
}

body.public-surface:not(.orb-engaged) .operator-pulse {
  display: block !important;
  grid-area: work;
  width: min(100%, 470px);
  justify-self: start;
  padding: 0 0 0 22px;
  border-left: 1px solid #d8e0e4;
}

body.public-surface:not(.orb-engaged) .operator-pulse::before,
body.public-surface:not(.orb-engaged) .operator-pulse::after,
body.public-surface:not(.orb-engaged) .operator-pulse-head,
body.public-surface:not(.orb-engaged) .operator-context-line,
body.public-surface:not(.orb-engaged) .operator-ledger,
body.public-surface:not(.orb-engaged) .operator-flow {
  display: none;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 470px;
  margin: 0;
  color: #1b252d;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 570;
  line-height: 1.04;
  text-wrap: balance;
}

body.public-surface:not(.orb-engaged) .operator-request {
  max-width: 410px;
  margin-top: 22px;
  padding: 0 0 0 16px;
  border-top: 0;
}

body.public-surface:not(.orb-engaged) .operator-request::before {
  top: 1px;
  height: 38px;
  background: #11a6be;
}

body.public-surface:not(.orb-engaged) .operator-request > span {
  color: #07819a;
  font-size: 9px;
  letter-spacing: .14em;
}

body.public-surface:not(.orb-engaged) .operator-task {
  margin-top: 8px;
  color: #66747d;
  font-size: 13.5px;
  line-height: 1.5;
}

body.public-surface:not(.orb-engaged) .orb-wrap {
  grid-area: orb;
  width: min(100%, 350px);
  justify-self: end;
}

body.public-surface:not(.orb-engaged) .orb-stage {
  transform: scale(1) !important;
}

body.public-surface:not(.orb-engaged) .orb-status {
  margin-top: -8px;
}

body.public-surface:not(.orb-engaged) .orb-controls {
  margin-top: 12px;
}

body.public-surface .composer {
  width: min(100%, 820px);
  max-width: none;
  margin: 0 auto;
}

body.public-surface .composer-shell {
  min-height: 60px;
  padding: 9px 9px 9px 18px;
  background: rgba(255,255,255,.9);
  border-color: #dce3e7;
  border-radius: 14px;
  box-shadow: 0 14px 38px -28px rgba(28,42,52,.42);
}

body.public-surface .composer textarea {
  font-size: 15px;
}

body.public-surface .composer-foot {
  margin-top: 8px;
  padding-inline: 3px;
}

.starter-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px auto 0;
  color: #7d8992;
}

.starter-label {
  color: #9aa5ac;
  font: 650 9px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.starter-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 1px;
  color: #5d6c75;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color .14s ease, border-color .14s ease;
}

.starter-actions button svg {
  width: 13px;
  height: 13px;
  opacity: .68;
  transition: transform .14s ease;
}

.starter-actions button:hover,
.starter-actions button:focus-visible {
  color: #087f96;
  border-bottom-color: #9bdce6;
}

.starter-actions button:hover svg,
.starter-actions button:focus-visible svg {
  transform: translateX(2px);
}

body.public-surface.orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: clamp(28px, 6vw, 72px);
  min-height: clamp(360px, calc(100dvh - 246px), 500px);
  padding: 22px 0 4px;
}

body.public-surface.orb-engaged .operator-pulse {
  width: min(100%, 540px);
  padding: 0 0 0 20px;
  border-left-color: #d8e0e4;
}

body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 330px);
  justify-self: end;
}

body.public-surface.orb-engaged .composer {
  margin-top: 12px;
}

@media (max-width: 820px) {
  body.public-surface .stage {
    padding: 0 16px 30px;
  }

  body.public-surface .command-stage {
    min-height: calc(100dvh - 64px);
  }

  body.public-surface .stage-eyebrow {
    margin-top: 23px;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .command-hero {
    display: flex;
    min-height: 0;
    padding: 18px 0 0;
    gap: 0;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    order: 1;
    width: min(76vw, 300px);
    justify-self: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse {
    order: 2;
    width: min(100%, 520px);
    margin: 18px auto 0;
    padding: 0 0 0 16px;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: clamp(32px, 8.7vw, 44px);
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    margin-top: 14px;
  }

  body.public-surface .composer {
    margin-top: 22px;
  }

  body.public-surface.orb-engaged .command-hero {
    display: flex;
    min-height: 0;
    padding-top: 16px;
    gap: 18px;
  }

  body.public-surface.orb-engaged .orb-wrap {
    order: 1;
    width: min(68vw, 250px);
    justify-self: center;
  }

  body.public-surface.orb-engaged .operator-pulse {
    order: 2;
    width: 100%;
    padding: 0;
    border-left: 0;
  }

  body.public-surface.orb-engaged .composer {
    order: 3;
    margin-top: 12px;
  }

  .starter-actions {
    gap: 4px 14px;
    margin-top: 13px;
  }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(72vw, 270px);
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: 34px;
  }

  .starter-label {
    flex-basis: 100%;
    text-align: center;
  }
}

/* Idle is a companion moment, not a two-column dashboard. Once a request has
   real evidence the active composition above restores the answer rail. */
@media (min-width: 821px) {
  body.public-surface:not(.orb-engaged) .command-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: clamp(330px, calc(100dvh - 300px), 430px);
    padding: 12px 0 0;
    gap: 0;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    order: 1;
    width: min(100%, 300px);
    justify-self: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse {
    order: 2;
    width: min(100%, 480px);
    margin: 2px auto 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: none;
    color: #51616b;
    font-size: 18px;
    font-weight: 560;
    line-height: 1.35;
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    display: none;
  }
}

body.public-surface:not(.orb-engaged) .operator-pulse.is-conversation {
  display: none !important;
}

/* Keep the human steering choices available after the Orb engages. The AI
   can continue the turn, while the operator can still redirect the next one. */
body.public-surface.orb-engaged .starter-actions {
  display: flex;
}

@media (max-width: 820px) {
  body.public-surface:not(.orb-engaged) .operator-pulse {
    display: block !important;
    width: min(100%, 480px);
    margin: 2px auto 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: none;
    color: #51616b;
    font-size: 21px;
    font-weight: 560;
    line-height: 1.35;
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    display: none;
  }
}

/* ============ V67 COMMERCIAL COMMAND COMPOSITION ============
   The public Orb is a working companion, not a centred marketing hero. Keep
   the human brief and the live presence in one deliberate frame, then bring
   the command field directly into that workflow. */
body.public-surface {
  background: #f4f6f7;
}

body.public-surface .stage {
  padding: 0 clamp(24px, 5vw, 84px) 34px;
}

body.public-surface .command-stage {
  width: min(100%, 1160px);
  min-height: calc(100dvh - 70px);
}

body.public-surface .stage-eyebrow {
  margin-top: clamp(22px, 4vh, 36px);
  color: #77858f;
  letter-spacing: .18em;
}

body.public-surface:not(.orb-engaged) .command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  grid-template-areas: "work orb";
  gap: clamp(42px, 7vw, 108px);
  min-height: clamp(410px, calc(100dvh - 260px), 580px);
  padding: 20px 0 8px;
  align-items: center;
}

body.public-surface:not(.orb-engaged) .operator-pulse {
  display: block !important;
  grid-area: work;
  width: min(100%, 520px);
  margin: 0;
  padding: 0 0 0 30px;
  border: 0;
  text-align: left;
  visibility: visible;
  opacity: 1;
  transform: none;
  filter: none;
}

body.public-surface:not(.orb-engaged) .operator-pulse::before {
  left: 0;
  top: 0;
  width: 3px;
  height: 88px;
  border-radius: 2px;
  background: #11a6be;
}

body.public-surface:not(.orb-engaged) .operator-pulse::after {
  display: none;
}

body.public-surface:not(.orb-engaged) .operator-pulse-head {
  display: flex;
  color: #81909a;
}

body.public-surface:not(.orb-engaged) .operator-context-line {
  display: flex;
  margin-top: 14px;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 500px;
  margin: 22px 0 0;
  color: #1c2831;
  font-size: clamp(36px, 4.1vw, 58px);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
}

body.public-surface:not(.orb-engaged) .operator-request {
  display: block;
  max-width: 430px;
  margin: 24px 0 0;
  padding: 13px 0 0 16px;
  border-top: 1px solid #dbe2e6;
}

body.public-surface:not(.orb-engaged) .operator-request > span {
  color: #07819a;
}

body.public-surface:not(.orb-engaged) .operator-task {
  margin-top: 8px;
  color: #66747d;
  font-size: 14px;
  line-height: 1.55;
}

body.public-surface:not(.orb-engaged) .operator-ledger,
body.public-surface:not(.orb-engaged) .operator-flow {
  display: none;
}

body.public-surface:not(.orb-engaged) .orb-wrap {
  grid-area: orb;
  width: min(100%, 390px);
  justify-self: end;
}

body.public-surface:not(.orb-engaged) .orb-stage {
  width: 100%;
  transform: none !important;
}

body.public-surface:not(.orb-engaged) .orb-core {
  width: 74%;
  filter: saturate(1.08) contrast(1.03);
}

body.public-surface:not(.orb-engaged) .orb-status {
  margin-top: -4px;
}

body.public-surface:not(.orb-engaged) .orb-controls {
  margin-top: 14px;
}

body.public-surface .composer {
  width: min(100%, 860px);
  margin: 0 auto;
}

body.public-surface .composer-shell {
  min-height: 64px;
  padding: 10px 10px 10px 20px;
  background: rgba(255, 255, 255, .94);
  border-color: #d8e1e5;
  border-radius: 15px;
  box-shadow: 0 18px 42px -30px rgba(28, 42, 52, .5), 0 1px 2px rgba(28, 42, 52, .04);
}

body.public-surface .composer textarea {
  font-size: 15px;
}

body.public-surface .composer-send {
  min-width: 80px;
  height: 42px;
  border-radius: 11px;
}

body.public-surface .composer-foot {
  margin-top: 9px;
}

body.public-surface .starter-actions {
  justify-content: center;
  margin-top: 15px;
}

/* A quiet orbital frame keeps the Orb legible even while its texture is
   loading. The ring is deliberately soft and never competes with the input. */
body.public-surface .orb-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 5%;
  border-radius: 50%;
  border: 1px solid rgba(121, 170, 197, .28);
  box-shadow: 0 0 0 16px rgba(255, 255, 255, .18), 0 0 0 17px rgba(121, 170, 197, .1);
  pointer-events: none;
  opacity: .82;
  transform: rotate(-12deg);
  animation: orbFrameDrift 18s linear infinite;
}

@keyframes orbFrameDrift {
  to { transform: rotate(348deg); }
}

body.public-surface .orb-stage[data-orb-state="listening"]::after {
  inset: 3%;
  border-color: rgba(10, 156, 184, .48);
  box-shadow: 0 0 0 16px rgba(255, 255, 255, .16), 0 0 0 17px rgba(10, 156, 184, .18);
  animation: orbListeningRipple 1.8s ease-out infinite;
}

body.public-surface .orb-stage[data-orb-state="speaking"]::after {
  border-color: rgba(144, 121, 221, .48);
  box-shadow: 0 0 0 16px rgba(255, 255, 255, .16), 0 0 0 17px rgba(144, 121, 221, .14);
}

@media (max-width: 820px) {
  body.public-surface .stage {
    padding: 0 16px 28px;
  }

  body.public-surface .stage-eyebrow {
    margin-top: 22px;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .command-hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 18px 0 0;
    gap: 0;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    order: 1;
    width: min(82vw, 310px);
    justify-self: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse {
    order: 2;
    width: min(100%, 520px);
    margin: 18px auto 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse::before,
  body.public-surface:not(.orb-engaged) .operator-pulse::after {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse-head {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-context-line {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: none;
    margin-top: 0;
    color: #33434d;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: 0;
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    max-width: 360px;
    margin: 8px auto 0;
    padding: 0;
    border: 0;
  }

  body.public-surface:not(.orb-engaged) .operator-request::before {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-request > span {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-task {
    margin-top: 0;
    color: #77858f;
    font-size: 13px;
  }

  body.public-surface .composer {
    margin-top: 26px;
  }

  body.public-surface .starter-actions {
    margin-top: 14px;
  }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(80vw, 300px);
  }

  body.public-surface .composer-send {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  body.public-surface .composer-send span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.public-surface .orb-stage::after {
    animation: none;
  }
}

/* ============ V68 HUMAN COMMAND ROOM ============
   The public Orb is a product surface, not a landing-page hero. This final
   composition gives the person a clear left-to-right path: understand the
   brief, see the live companion, then issue the next request. It intentionally
   uses spacing and alignment for hierarchy instead of more cards or effects. */
body.public-surface {
  --canvas: #f3f6f7;
  background: var(--canvas);
}

body.public-surface .topbar {
  height: 74px;
  flex-basis: 74px;
  padding-inline: clamp(24px, 6vw, 96px);
  background: rgba(243,246,247,.94);
  border-bottom-color: #dfe6e9;
}

body.public-surface .workspace-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.015em;
}

body.public-surface .workspace-sub {
  color: #7d8b94;
  font-size: 11px;
}

body.public-surface .stage {
  padding: 0 clamp(28px, 7vw, 104px) 44px;
}

body.public-surface .command-stage {
  width: min(100%, 1190px);
  min-height: calc(100dvh - 74px);
}

body.public-surface .stage-eyebrow {
  align-self: stretch;
  margin-top: clamp(24px, 4.2vh, 42px);
  color: #788892;
  font-size: 9px;
  letter-spacing: .22em;
  text-align: left;
}

body.public-surface:not(.orb-engaged) .command-hero {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(380px, 1.08fr);
  grid-template-areas: "work orb";
  gap: clamp(48px, 8vw, 126px);
  min-height: clamp(420px, calc(100dvh - 282px), 530px);
  padding: 26px 0 24px;
  align-items: center;
}

body.public-surface:not(.orb-engaged) .operator-pulse {
  grid-area: work;
  display: block !important;
  width: min(100%, 470px);
  margin: 0;
  padding: 0 0 0 28px;
  border-left: 2px solid #b9dfe6;
  text-align: left;
  visibility: visible;
  opacity: 1;
  transform: none;
  filter: none;
}

body.public-surface:not(.orb-engaged) .operator-pulse::before,
body.public-surface:not(.orb-engaged) .operator-pulse::after {
  display: none;
}

body.public-surface:not(.orb-engaged) .operator-pulse-head {
  display: flex;
  color: #87959d;
}

body.public-surface:not(.orb-engaged) .operator-context-line {
  display: flex;
  margin-top: 16px;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 440px;
  margin: 22px 0 0;
  color: #1b2932;
  font-size: clamp(38px, 4.25vw, 58px);
  font-weight: 570;
  line-height: 1.04;
  letter-spacing: -.018em;
  text-wrap: balance;
}

body.public-surface:not(.orb-engaged) .operator-request {
  max-width: 390px;
  margin: 24px 0 0;
  padding: 13px 0 0;
  border-top: 1px solid #d6e0e4;
}

body.public-surface:not(.orb-engaged) .operator-request::before,
body.public-surface:not(.orb-engaged) .operator-request > span {
  display: none;
}

body.public-surface:not(.orb-engaged) .operator-task {
  margin-top: 0;
  color: #647680;
  font-size: 14px;
  line-height: 1.55;
}

body.public-surface:not(.orb-engaged) .operator-ledger,
body.public-surface:not(.orb-engaged) .operator-flow {
  display: none;
}

body.public-surface:not(.orb-engaged) .orb-wrap {
  grid-area: orb;
  width: min(100%, 420px);
  justify-self: end;
}

body.public-surface:not(.orb-engaged) .orb-stage {
  width: 100%;
}

body.public-surface:not(.orb-engaged) .orb-status {
  margin-top: -4px;
}

body.public-surface:not(.orb-engaged) .orb-controls {
  margin-top: 14px;
}

body.public-surface .composer {
  width: min(100%, 890px);
  margin: 0 auto;
}

body.public-surface .composer-shell {
  min-height: 64px;
  padding: 10px 10px 10px 20px;
  background: rgba(255,255,255,.94);
  border-color: #d6e0e4;
  border-radius: 14px;
  box-shadow: 0 16px 40px -30px rgba(28,42,52,.48), 0 1px 2px rgba(28,42,52,.04);
}

body.public-surface .composer textarea {
  font-size: 15px;
}

body.public-surface .composer-send {
  min-width: 78px;
  height: 42px;
  border-radius: 10px;
}

body.public-surface .composer-foot {
  margin-top: 9px;
}

body.public-surface .starter-actions {
  margin-top: 14px;
}

body.public-surface.orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(34px, 7vw, 96px);
  min-height: clamp(400px, calc(100dvh - 250px), 540px);
  padding: 30px 0 18px;
}

body.public-surface.orb-engaged .operator-pulse {
  width: min(100%, 590px);
  padding-left: 28px;
  border-left: 2px solid #b9dfe6;
}

body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 370px);
  justify-self: end;
}

body.public-surface.orb-engaged .composer {
  margin-top: 4px;
}

@media (min-width: 821px) and (max-height: 800px) {
  body.public-surface:not(.orb-engaged) .command-hero {
    min-height: 360px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(100%, 330px);
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: clamp(34px, 4vw, 48px);
  }
}

@media (max-width: 820px) {
  body.public-surface .stage {
    padding: 0 16px 30px;
  }

  body.public-surface .stage-eyebrow {
    margin-top: 22px;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .command-hero {
    display: flex;
    min-height: 0;
    padding: 16px 0 0;
    gap: 0;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    order: 1;
    width: min(78vw, 292px);
    justify-self: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse {
    order: 2;
    width: min(100%, 500px);
    margin: 16px auto 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse-head,
  body.public-surface:not(.orb-engaged) .operator-context-line {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: none;
    margin-top: 0;
    color: #33434d;
    font-size: 23px;
    line-height: 1.28;
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    max-width: 360px;
    margin: 7px auto 0;
    padding: 0;
    border: 0;
  }

  body.public-surface:not(.orb-engaged) .operator-task {
    color: #77858f;
    font-size: 13px;
  }

  body.public-surface .composer {
    margin-top: 22px;
  }

  body.public-surface.orb-engaged .command-hero {
    display: flex;
    min-height: 0;
    padding-top: 16px;
    gap: 18px;
  }

  body.public-surface.orb-engaged .orb-wrap {
    order: 1;
    width: min(68vw, 250px);
    justify-self: center;
  }

  body.public-surface.orb-engaged .operator-pulse {
    order: 2;
    width: 100%;
    padding: 0;
    border: 0;
  }

  body.public-surface.orb-engaged .composer {
    order: 3;
    margin-top: 4px;
  }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(76vw, 280px);
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: 22px;
  }

  body.public-surface .composer-shell {
    min-height: 58px;
    padding-left: 14px;
    border-radius: 12px;
  }

  body.public-surface .composer-send {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }
}

/* ============ V69 HUMAN-FIRST COMMAND FLOW ============
   Keep the public Orb calm and useful. The idle state gets one brief, one
   presence object and one next action; active turns retain the two-column
   work view without bringing the private cockpit chrome into this surface. */
body.public-surface .stage {
  padding: 0 clamp(28px, 6vw, 88px) 28px;
}

body.public-surface .command-stage {
  width: min(100%, 1160px);
  min-height: calc(100dvh - 74px);
}

body.public-surface .stage-eyebrow {
  margin-top: clamp(22px, 4vh, 38px);
  color: #82919a;
  letter-spacing: .16em;
}

body.public-surface .operator-context-line {
  display: none !important;
}

body.public-surface:not(.orb-engaged) .command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .88fr);
  grid-template-areas: "work orb";
  align-items: center;
  gap: clamp(36px, 7vw, 96px);
  min-height: clamp(380px, calc(100dvh - 430px), 470px);
  padding: 14px 0 8px;
}

body.public-surface:not(.orb-engaged) .operator-pulse {
  width: min(100%, 500px);
  padding-left: 26px;
  border-left: 2px solid #b9dfe6;
}

body.public-surface:not(.orb-engaged) .operator-pulse-head {
  color: #81919a;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 480px;
  margin-top: 18px;
  color: #1b2932;
  font-size: clamp(40px, 4.1vw, 56px);
  line-height: 1.04;
  letter-spacing: -.018em;
}

body.public-surface:not(.orb-engaged) .operator-request {
  max-width: 410px;
  margin-top: 20px;
  padding-top: 12px;
  border-top-color: #d6e0e4;
}

body.public-surface:not(.orb-engaged) .operator-task {
  color: #657680;
  font-size: 14px;
}

body.public-surface:not(.orb-engaged) .orb-wrap {
  width: min(100%, 370px);
}

body.public-surface .composer {
  width: min(100%, 900px);
  margin: 10px auto 0;
}

body.public-surface .composer-status[data-status="ready"] {
  display: none;
}

body.public-surface .composer-status:not([data-status="ready"]) {
  display: inline-flex;
}

body.public-surface .starter-actions {
  justify-content: flex-start;
  padding-inline: 3px;
}

body.public-surface.orb-engaged .command-hero {
  min-height: clamp(360px, calc(100dvh - 420px), 480px);
  padding: 20px 0 6px;
}

body.public-surface.orb-engaged .composer {
  margin-top: 10px;
}

@media (max-width: 820px) {
  body.public-surface .stage {
    padding: 0 16px 28px;
  }

  body.public-surface .command-stage {
    min-height: calc(100dvh - 64px);
  }

  body.public-surface .stage-eyebrow {
    margin-top: 22px;
  }

  body.public-surface:not(.orb-engaged) .command-hero {
    display: flex;
    min-height: 0;
    padding: 14px 0 0;
    gap: 0;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    order: 1;
    width: min(78vw, 292px);
  }

  body.public-surface:not(.orb-engaged) .operator-pulse {
    order: 2;
    width: min(100%, 500px);
    margin: 14px auto 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse-head {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: none;
    margin-top: 0;
    color: #33434d;
    font-size: 23px;
    line-height: 1.28;
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    max-width: 360px;
    margin: 6px auto 0;
    padding: 0;
    border: 0;
  }

  body.public-surface:not(.orb-engaged) .operator-task {
    color: #77858f;
    font-size: 13px;
  }

  body.public-surface .composer {
    margin-top: 20px;
  }

  body.public-surface .starter-actions {
    justify-content: center;
    padding-inline: 0;
  }

  body.public-surface.orb-engaged .command-hero {
    min-height: 0;
    padding-top: 14px;
    gap: 16px;
  }
}

@media (min-width: 821px) and (max-height: 800px) {
  body.public-surface:not(.orb-engaged) .command-hero {
    min-height: 340px;
    padding-top: 8px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap {
    width: min(100%, 320px);
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: clamp(36px, 4vw, 48px);
  }
}

/* ============ V73 PUBLIC ORB COMPOSITION ============
   One compact working surface. The idle state gives the operator a clear
   brief, a visible companion, and one obvious place to speak or type. The
   active state preserves the same geometry while making the response rail
   the visual anchor. */
body.public-surface {
  --canvas: #f6f8f8;
  background: var(--canvas);
}

body.public-surface .stage {
  padding: 0 clamp(24px, 5vw, 72px) 28px;
  overflow: visible;
}

body.public-surface .command-stage {
  width: min(100%, 1120px);
  min-height: calc(100dvh - 74px);
}

body.public-surface .stage-eyebrow {
  margin-top: clamp(20px, 3vh, 30px);
  color: #82919a;
  font-size: 9px;
  letter-spacing: .18em;
  text-align: center;
}

body.public-surface:not(.orb-engaged) .command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, .82fr);
  grid-template-areas: "work orb";
  align-items: center;
  gap: clamp(32px, 5vw, 68px);
  min-height: clamp(350px, calc(100dvh - 350px), 430px);
  padding: 10px 0 0;
}

body.public-surface:not(.orb-engaged) .operator-pulse {
  width: min(100%, 500px);
  padding: 0 0 0 24px;
  border-left: 2px solid #b9dfe6;
}

body.public-surface:not(.orb-engaged) .operator-pulse-head {
  color: #83929b;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 500px;
  margin-top: 18px;
  color: #1a2932;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 580;
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}

body.public-surface:not(.orb-engaged) .operator-request {
  max-width: 420px;
  margin-top: 20px;
  padding-top: 12px;
  border-top-color: #d6e0e4;
}

body.public-surface:not(.orb-engaged) .operator-task {
  color: #647680;
  font-size: 13.5px;
}

body.public-surface:not(.orb-engaged) .orb-wrap {
  width: min(100%, 360px);
  justify-self: end;
}

body.public-surface:not(.orb-engaged) .arrival-greeting {
  margin-bottom: 4px;
  color: #63727c;
  font-size: 14px;
}

body.public-surface:not(.orb-engaged) .orb-status {
  margin-top: -3px;
}

body.public-surface:not(.orb-engaged) .orb-controls {
  margin-top: 12px;
}

body.public-surface .composer {
  width: min(100%, 780px);
  margin: 8px auto 0;
}

body.public-surface .composer-shell {
  min-height: 62px;
  padding: 9px 9px 9px 18px;
  border-radius: 13px;
  border-color: #d5e0e4;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px -28px rgba(28,42,52,.48), 0 1px 2px rgba(28,42,52,.04);
}

body.public-surface .composer textarea {
  font-size: 15px;
}

body.public-surface .composer-foot {
  margin-top: 8px;
}

body.public-surface .starter-actions {
  justify-content: center;
  margin-top: 12px;
  padding-inline: 0;
  gap: 4px 16px;
}

body.public-surface.orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 370px);
  gap: clamp(30px, 5vw, 64px);
  min-height: clamp(350px, calc(100dvh - 350px), 460px);
  padding: 16px 0 0;
}

body.public-surface.orb-engaged .operator-pulse {
  width: min(100%, 590px);
  padding-left: 24px;
  border-left: 2px solid #b9dfe6;
}

body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 350px);
  justify-self: end;
}

body.public-surface.orb-engaged .composer {
  margin-top: 8px;
}

@media (max-width: 820px) {
  body.public-surface .stage {
    padding: 0 16px 26px;
  }

  body.public-surface .command-stage {
    min-height: calc(100dvh - 64px);
  }

  body.public-surface .stage-eyebrow {
    margin-top: 20px;
    font-size: 8px;
  }

  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0;
    padding-top: 12px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    order: 1;
    width: min(78vw, 280px);
    justify-self: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse,
  body.public-surface.orb-engaged .operator-pulse {
    order: 2;
    width: 100%;
    margin: 14px auto 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse-head {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: none;
    margin-top: 0;
    color: #33434d;
    font-size: 23px;
    line-height: 1.28;
    letter-spacing: 0;
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    max-width: 360px;
    margin: 6px auto 0;
    padding: 0;
    border: 0;
  }

  body.public-surface:not(.orb-engaged) .operator-task {
    color: #77858f;
    font-size: 13px;
  }

  body.public-surface .composer {
    order: 3;
    width: 100%;
    margin-top: 20px;
  }

  body.public-surface.orb-engaged .operator-pulse.is-conversation {
    margin-top: 14px;
  }

  body.public-surface .starter-actions {
    justify-content: center;
    margin-top: 11px;
  }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    width: min(76vw, 270px);
  }

  body.public-surface .composer-shell {
    min-height: 58px;
    padding-left: 14px;
    border-radius: 12px;
  }

  body.public-surface .starter-label {
    flex-basis: 100%;
    text-align: center;
  }
}

/* ============ V74 COMMERCIAL MICRO-POLISH ============
   Remove duplicated system chrome from the idle companion moment and make the
   primary action read like a human conversation rather than an admin console. */
body.public-surface:not(.orb-engaged) .operator-signal {
  display: none;
}

body.public-surface .composer-send {
  width: 42px;
  min-width: 42px;
  padding-inline: 0;
  justify-content: center;
}

body.public-surface .composer-send span {
  display: none;
}

body.public-surface .composer-send:hover {
  background: #111b22;
  box-shadow: 0 7px 16px -10px rgba(17,27,34,.72);
}

body.public-surface .composer-send:focus-visible {
  box-shadow: 0 0 0 4px rgba(230,246,249,.95), 0 7px 16px -10px rgba(17,27,34,.72);
}

body.public-surface .starter-actions button {
  color: #52636d;
}

body.public-surface .starter-actions button:hover,
body.public-surface .starter-actions button:focus-visible {
  color: #087f96;
}

@media (max-width: 440px) {
  body.public-surface .composer-send {
    min-width: 42px;
    padding-inline: 0;
  }
}

/* ============ V76 HUMAN-FIRST COMPOSITION ============
   Final public-surface geometry. The command stays one calm workspace: the
   brief and composer share a visual column, while the Orb remains the live
   companion at the right. This is intentionally scoped to the public Orb. */
body.public-surface {
  --canvas: #f4f7f7;
  --line: #dfe6e8;
  --line-2: #e9eff0;
  background: var(--canvas);
}

body.public-surface .topbar {
  height: 68px;
  flex-basis: 68px;
  padding-inline: clamp(24px, 4vw, 58px);
  background: rgba(244,247,247,.88);
  border-bottom-color: rgba(174,190,195,.34);
}

body.public-surface .stage {
  padding: 0 clamp(24px, 4vw, 58px) 40px;
}

body.public-surface .command-stage {
  width: min(100%, 1160px);
  min-height: calc(100dvh - 68px);
  align-items: stretch;
}

body.public-surface .stage-eyebrow {
  margin: 26px 0 0;
  color: #82939a;
  font-size: 9px;
  letter-spacing: .2em;
  text-align: left;
}

body.public-surface:not(.orb-engaged) .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  grid-template-areas: "work orb";
  align-items: center;
  gap: clamp(42px, 7vw, 104px);
  min-height: clamp(350px, calc(100dvh - 390px), 430px);
  max-width: 1100px;
  margin-inline: auto;
  padding-top: 4px;
}

body.public-surface:not(.orb-engaged) .operator-pulse {
  width: min(100%, 560px);
  padding: 0;
  border-left: 0;
  align-self: center;
}

body.public-surface:not(.orb-engaged) .operator-pulse-head {
  display: none;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 560px;
  margin-top: 0;
  color: #172832;
  font-size: clamp(42px, 4.6vw, 64px);
  font-weight: 590;
  line-height: .99;
  letter-spacing: -.025em;
}

body.public-surface:not(.orb-engaged) .operator-request {
  max-width: 470px;
  margin-top: 24px;
  padding: 15px 0 0 17px;
  border-top-color: #cddadd;
}

body.public-surface:not(.orb-engaged) .operator-request::before {
  top: 15px;
  height: 38px;
  background: #68b9c8;
}

body.public-surface:not(.orb-engaged) .operator-task {
  color: #60747d;
  font-size: 14px;
  line-height: 1.55;
}

body.public-surface:not(.orb-engaged) .orb-wrap {
  width: min(100%, 370px);
  justify-self: center;
  transform: translateY(-3px);
}

body.public-surface:not(.orb-engaged) .arrival-greeting {
  margin-bottom: 7px;
  color: #6e8088;
}

body.public-surface:not(.orb-engaged) .orb-status {
  margin-top: -4px;
}

body.public-surface:not(.orb-engaged) .orb-controls {
  margin-top: 10px;
}

body.public-surface .composer {
  width: min(100%, 820px);
  margin: 10px auto 0;
}

body.public-surface .composer-shell {
  min-height: 64px;
  padding: 10px 10px 10px 19px;
  border-radius: 14px;
  border-color: #d1dfe2;
  background: rgba(255,255,255,.97);
  box-shadow: 0 16px 36px -30px rgba(28,42,52,.54), 0 1px 2px rgba(28,42,52,.04);
}

body.public-surface .composer textarea {
  font-size: 15px;
}

body.public-surface .composer-foot {
  margin-top: 8px;
}

body.public-surface .starter-actions {
  justify-content: flex-start;
  margin-top: 11px;
  padding-inline: 5px;
  gap: 4px 18px;
}

body.public-surface.orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(38px, 6vw, 88px);
  min-height: clamp(350px, calc(100dvh - 380px), 470px);
  max-width: 1100px;
  margin-inline: auto;
  padding-top: 12px;
}

body.public-surface.orb-engaged .operator-pulse {
  width: min(100%, 600px);
  padding-left: 0;
  border-left: 0;
}

body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 360px);
  justify-self: center;
}

body.public-surface.orb-engaged .composer {
  margin-top: 12px;
}

@media (max-width: 820px) {
  body.public-surface .topbar {
    height: 64px;
    flex-basis: 64px;
    padding-inline: 18px;
  }

  body.public-surface .stage {
    padding: 0 16px 32px;
  }

  body.public-surface .command-stage {
    min-height: calc(100dvh - 64px);
  }

  body.public-surface .stage-eyebrow {
    margin-top: 22px;
    text-align: center;
    font-size: 8px;
  }

  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    gap: 0;
    padding-top: 16px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    order: 1;
    width: min(78vw, 286px);
    max-width: 286px;
    justify-self: center;
    align-self: center;
    transform: none;
  }

  body.public-surface:not(.orb-engaged) .operator-pulse,
  body.public-surface.orb-engaged .operator-pulse {
    order: 2;
    width: 100%;
    margin: 17px auto 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: 340px;
    margin: 0 auto;
    color: #2f434c;
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.16;
    letter-spacing: -.01em;
  }

  body.public-surface:not(.orb-engaged) .operator-request {
    max-width: 360px;
    margin: 7px auto 0;
    padding: 0;
    border: 0;
  }

  body.public-surface:not(.orb-engaged) .operator-request::before {
    display: none;
  }

  body.public-surface:not(.orb-engaged) .operator-task {
    color: #77888f;
    font-size: 13px;
    line-height: 1.5;
  }

  body.public-surface .composer {
    order: 3;
    width: 100%;
    margin-top: 22px;
  }

  body.public-surface .starter-actions {
    justify-content: center;
    margin-top: 11px;
    padding-inline: 0;
  }

  body.public-surface.orb-engaged .operator-pulse.is-conversation {
    margin-top: 16px;
  }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    width: min(76vw, 270px);
    max-width: 270px;
  }

  body.public-surface .composer-shell {
    min-height: 58px;
    padding-left: 14px;
    border-radius: 12px;
  }

  body.public-surface .starter-label {
    flex-basis: 100%;
    text-align: center;
  }
}

/* ============ V77 RESPONSIVE COMMAND FRAME ============
   This is the authoritative final geometry. It keeps the Orb and companion
   lane inside the viewport on medium desktops while preserving mobile order. */
body.public-surface .command-stage {
  width: min(100%, 1140px);
}

body.public-surface:not(.orb-engaged) .command-hero,
body.public-surface.orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(24px, 4vw, 52px);
  min-height: clamp(360px, calc(100dvh - 410px), 460px);
  padding-top: 18px;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 600px;
  font-size: clamp(40px, 3.8vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

body.public-surface:not(.orb-engaged) .orb-wrap,
body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 350px);
}

body.public-surface .composer {
  margin-top: 6px;
}

body:not(.public-surface).orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: clamp(20px, 3vw, 42px);
}

@media (min-width: 821px) and (max-width: 1120px) {
  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero,
  body:not(.public-surface).orb-engaged .command-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
    gap: 24px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap,
  body:not(.public-surface).orb-engaged .orb-wrap {
    width: min(100%, 300px);
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: clamp(36px, 4vw, 48px);
  }
}

@media (max-width: 820px) {
  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero {
    min-height: 0;
    padding-top: 14px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    width: min(78vw, 286px);
  }

  body.public-surface .composer {
    margin-top: 18px;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    max-width: 340px;
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.16;
    letter-spacing: 0;
  }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    width: min(76vw, 270px);
  }
}

/* ============ V81 CONVERSATION CONTINUITY ============
   A commercial companion should make the handoff from request to answer
   obvious without wrapping the whole workspace in another card. */
body.public-surface .conversation-response {
  border-left: 2px solid #8bcbd3;
  padding-left: 18px;
}

body.public-surface .conversation-response-request {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e1e9ea;
}

body.public-surface .conversation-response-request span {
  display: block;
  color: #82959c;
  font: 650 9px/1 var(--mono);
  letter-spacing: .13em;
}

body.public-surface .conversation-response-request p {
  margin: 7px 0 0;
  color: #71848b;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.public-surface .conversation-response > span {
  margin-bottom: 13px;
}

@media (max-width: 820px) {
  body.public-surface .conversation-response {
    padding-left: 14px;
  }
}

/* ============ V83 ENGAGED COMPANION SCALE ============
   Idle is the arrival moment; after a turn, the answer owns the attention
   lane and the Orb remains visible as a smaller live companion. */
body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 284px);
}

body.public-surface.orb-engaged .orb-transcript {
  max-width: 280px;
}

@media (min-width: 821px) and (max-width: 1120px) {
  body.public-surface.orb-engaged .orb-wrap {
    width: 260px;
  }
}

@media (max-width: 820px) {
  body.public-surface.orb-engaged .orb-wrap {
    width: min(62vw, 224px);
  }
}

@media (max-width: 440px) {
  body.public-surface.orb-engaged .orb-wrap {
    width: min(62vw, 218px);
  }
}

/* Public manual workspaces are input lenses only. They preserve the public
   privacy boundary while giving the operator the side navigation requested. */
.public-workspace-rail { display: none; }
body.public-surface .public-workspace-rail {
  position: sticky; top: 0; z-index: 42;
  display: flex; flex: 0 0 88px; width: 88px; height: 100dvh;
  flex-direction: column; align-items: center; gap: 18px;
  padding: 18px 0; background: rgba(255,255,255,.72);
  border-right: 1px solid rgba(42,53,66,.10); backdrop-filter: blur(18px) saturate(1.15);
}
body.public-surface .public-rail-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid #b9e4ea; border-radius: 11px; background: #e8f8fa;
  color: #16849a; font-size: 15px; font-weight: 750; line-height: 1;
}
body.public-surface .public-rail-nav {
  display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%;
}
body.public-surface .public-rail-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 62px; min-height: 54px; padding: 6px 3px; border-radius: 8px;
  color: #71828a; font-size: 9px; font-weight: 650; line-height: 1.05;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
body.public-surface .public-rail-item svg { width: 19px; height: 19px; }
body.public-surface .public-rail-item:hover { background: rgba(220,242,245,.72); color: #1e5b68; transform: translateY(-1px); }
body.public-surface .public-rail-item.is-active { background: #e4f6f8; color: #147e94; }
body.public-surface .public-rail-item.is-active::before {
  content: ""; position: absolute; left: -13px; top: 10px; bottom: 10px;
  width: 2px; border-radius: 2px; background: #2db6c8;
}
@media (max-width: 820px) {
  /* Keep the public workspace tabs available on compact screens. The private
     rail remains replaced by the mobile menu; this compact rail only changes
     the active public input lens. */
  body.public-surface .public-workspace-rail {
    display: flex; flex: 0 0 62px; width: 62px; padding: 12px 0; gap: 12px;
  }
  body.public-surface .public-rail-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
  body.public-surface .public-rail-nav { gap: 5px; }
  body.public-surface .public-rail-item {
    width: 54px; min-height: 50px; padding: 5px 2px; gap: 2px; font-size: 8px;
  }
  body.public-surface .public-rail-item svg { width: 17px; height: 17px; }
  body.public-surface .public-rail-item.is-active::before { left: -4px; top: 8px; bottom: 8px; }
}

/* V93: companion response continuity. This is intentionally a final,
   public-only layer so interaction states cannot disturb the approved frame. */
body.public-surface .operator-insight:has(.conversation-progress),
body.public-surface .operator-insight:has(.conversation-recovery) {
  min-height: 208px;
}
body.public-surface .conversation-progress,
body.public-surface .conversation-recovery {
  width: min(100%, 570px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 12px 34px -29px rgba(18,35,48,.35);
  padding: 22px 24px;
  animation: companionPanelIn .28s ease both;
}
@keyframes companionPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.conversation-progress-head,
.conversation-reply-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.conversation-progress-head > span,
.conversation-recovery > span,
.conversation-reply-meta > span {
  color: var(--faint);
  font: 700 9px/1.2 var(--mono);
  letter-spacing: .15em;
}
.conversation-progress-head strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--cyan-ink);
  font: 650 11px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}
.conversation-progress-head i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  animation: companionDot 1.15s ease-in-out infinite;
}
.conversation-progress-head i:nth-child(2) { animation-delay: .16s; }
.conversation-progress-head i:nth-child(3) { animation-delay: .32s; }
@keyframes companionDot {
  0%, 100% { opacity: .2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}
.conversation-progress > p,
.conversation-recovery > p {
  margin: 13px 0 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
}
.conversation-progress-steps {
  display: flex;
  gap: 0;
  margin: 20px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 6px;
}
.conversation-progress-steps span {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line-2);
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
}
.conversation-progress-steps span:last-child { border-right: 0; }
.conversation-progress-steps .is-complete { color: var(--ok); background: rgba(47,158,111,.06); }
.conversation-progress-steps .is-active { color: var(--cyan-ink); background: var(--cyan-soft); }
.conversation-progress-actions,
.conversation-recovery > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}
.conversation-progress-actions button,
.conversation-recovery button,
.conversation-history-toggle,
.conversation-reply-meta button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink-2);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 650;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.conversation-progress-actions button:first-child,
.conversation-recovery button:first-child {
  border-color: var(--cyan-line);
  background: var(--cyan-soft);
  color: var(--cyan-ink);
}
.conversation-progress-actions button:hover,
.conversation-recovery button:hover,
.conversation-history-toggle:hover,
.conversation-reply-meta button:hover {
  border-color: var(--faint);
}
.conversation-recovery { border-color: var(--amber-line); background: #fffdf9; }
.conversation-recovery > span { color: var(--amber-ink); }
.conversation-reply-meta {
  margin: 0 0 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}
.conversation-reply-meta button { min-height: 26px; color: var(--cyan-ink); }
.conversation-history-toggle { margin-top: 9px; }
body.public-surface .conversation-history { margin-bottom: 16px; }
body.public-surface .conversation-continue { gap: 7px; }
body.public-surface .conversation-continue button { min-height: 30px; }
body.public-surface[data-interaction-phase="thinking"] .orb-status,
body.public-surface[data-interaction-phase="preparing_action"] .orb-status { opacity: 1; }
@media (max-width: 820px) {
  body.public-surface .operator-insight:has(.conversation-progress),
  body.public-surface .operator-insight:has(.conversation-recovery) { min-height: 0; }
  body.public-surface .conversation-progress,
  body.public-surface .conversation-recovery { padding: 18px 17px; }
  .conversation-progress-steps span { padding: 8px 5px; font-size: 9px; }
  .conversation-reply-meta { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .conversation-progress-head i,
  body.public-surface .conversation-progress,
  body.public-surface .conversation-recovery { animation: none; }
}

/* ============ V78 PUBLIC COMMAND COMPOSITION ============
   One final public-only layer. Earlier releases accumulated several responsive
   experiments; these rules define the stable geometry that wins at every
   viewport without changing the private cockpit or execution behaviour. */
body.public-surface {
  --canvas: #f3f6f6;
  background: var(--canvas);
}

body.public-surface .stage {
  padding: 0 clamp(22px, 5vw, 64px) 36px;
  overflow: visible;
}

body.public-surface .command-stage {
  width: min(100%, 1160px);
  min-height: 0;
  justify-content: flex-start;
}

body.public-surface .stage-eyebrow {
  align-self: stretch;
  margin: 26px 0 0;
  text-align: left;
  color: #81929a;
  font-size: 9px;
  letter-spacing: .2em;
}

body.public-surface:not(.orb-engaged) .command-hero,
body.public-surface.orb-engaged .command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  grid-template-areas: "work orb";
  align-items: center;
  justify-items: stretch;
  gap: clamp(30px, 5vw, 76px);
  width: min(100%, 1120px);
  min-height: clamp(340px, calc(100dvh - 370px), 480px);
  margin: 0 auto;
  padding: 24px 0 8px;
}

body.public-surface .operator-pulse {
  grid-area: work;
  display: block !important;
  width: min(100%, 560px);
  min-width: 0;
  justify-self: start;
  align-self: center;
  visibility: visible;
  opacity: 1;
  transform: none;
  filter: none;
  padding: 0 0 0 24px;
  border-left: 1px solid #d5e0e3;
}

body.public-surface .operator-pulse::before,
body.public-surface .operator-pulse::after,
body.public-surface .operator-pulse-head,
body.public-surface .operator-context-line,
body.public-surface .operator-ledger,
body.public-surface .operator-flow {
  display: none;
}

body.public-surface .operator-status {
  max-width: 560px;
  margin: 0;
  color: #1b2c35;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 590;
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
}

body.public-surface .operator-request {
  max-width: 460px;
  margin: 22px 0 0;
  padding: 0 0 0 16px;
  border-top: 0;
}

body.public-surface .operator-request::before {
  top: 1px;
  height: 38px;
  background: #43afc2;
}

body.public-surface .operator-request > span {
  color: #16849a;
  font-size: 9px;
  letter-spacing: .14em;
}

body.public-surface .operator-task {
  margin-top: 8px;
  color: #627780;
  font-size: 14px;
  line-height: 1.5;
}

body.public-surface .orb-wrap {
  grid-area: orb;
  width: 370px;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  justify-self: end;
  align-self: center;
  transform: none !important;
}

body.public-surface .orb-stage {
  width: 100%;
  min-width: 0;
  transform: none !important;
}

body.public-surface .arrival-greeting {
  margin-bottom: 8px;
  color: #71858d;
}

body.public-surface .orb-status { margin-top: -7px; }
body.public-surface .orb-controls { margin-top: 12px; }

body.public-surface .composer {
  width: min(100%, 820px);
  max-width: none;
  margin: 4px auto 0;
}

body.public-surface .composer-shell {
  min-height: 60px;
  border-radius: 13px;
  background: rgba(255,255,255,.96);
  border-color: #d1dfe2;
  box-shadow: 0 14px 34px -28px rgba(28,42,52,.5);
}

@media (min-width: 821px) and (max-width: 1120px) {
  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    width: min(100%, 980px);
  }

  body.public-surface .orb-wrap { width: 320px; }
  body.public-surface .operator-status { font-size: clamp(34px, 4vw, 48px); }
}

@media (max-width: 820px) {
  body.public-surface .stage { padding: 0 16px 32px; }
  body.public-surface .stage-eyebrow { margin-top: 22px; text-align: center; }
  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 0;
    padding-top: 14px;
  }

  body.public-surface .orb-wrap {
    order: 1;
    width: min(78vw, 286px);
    max-width: 286px;
    align-self: center;
    justify-self: center;
  }

  body.public-surface .operator-pulse {
    order: 2;
    width: 100%;
    max-width: 560px;
    margin: 18px auto 0;
    padding: 0;
    border-left: 0;
    text-align: center;
  }

  body.public-surface .operator-status {
    max-width: 360px;
    margin: 0 auto;
    color: #2e454e;
    font-size: clamp(25px, 7vw, 32px);
    line-height: 1.14;
  }

  body.public-surface .operator-request {
    max-width: 360px;
    margin: 7px auto 0;
    padding: 0;
  }

  body.public-surface .operator-request::before { display: none; }
  body.public-surface .operator-task { color: #72868e; font-size: 13px; }
  body.public-surface .composer { order: 3; width: 100%; margin-top: 20px; }
  body.public-surface .starter-actions { justify-content: center; margin-top: 10px; }
}

@media (max-width: 440px) {
  body.public-surface .orb-wrap { width: min(76vw, 270px); }
  body.public-surface .composer-shell { min-height: 58px; padding-left: 14px; }
  body.public-surface .starter-label { flex-basis: 100%; text-align: center; }
}

/* ============ V80 HUMAN COMMAND COMPOSITION ============
   The public Orb is a human operating surface, not a poster. Keep the live
   presence prominent while pulling the request lane into the same visual
   rhythm. This final layer is public-only and intentionally leaves all private
   cockpit/runtime geometry untouched. */
body.public-surface .command-stage {
  width: min(100%, 1180px);
}

body.public-surface .stage-eyebrow {
  margin-top: 20px;
}

body.public-surface:not(.orb-engaged) .command-hero,
body.public-surface.orb-engaged .command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 350px);
  gap: clamp(34px, 5vw, 70px);
  width: min(100%, 1080px);
  min-height: clamp(330px, calc(100dvh - 500px), 400px);
  padding-top: 8px;
}

body.public-surface:not(.orb-engaged) .operator-status {
  max-width: 520px;
  font-size: clamp(38px, 3.4vw, 50px);
  line-height: 1.03;
}

body.public-surface:not(.orb-engaged) .operator-request {
  max-width: 440px;
  margin-top: 18px;
  padding-top: 13px;
}

body.public-surface:not(.orb-engaged) .orb-wrap,
body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 330px);
}

body.public-surface:not(.orb-engaged) .orb-status,
body.public-surface.orb-engaged .orb-status {
  min-height: 34px;
  margin-top: -18px;
}

body.public-surface:not(.orb-engaged) .orb-transcript,
body.public-surface.orb-engaged .orb-transcript {
  font-size: 11px;
}

body.public-surface:not(.orb-engaged) .orb-controls,
body.public-surface.orb-engaged .orb-controls {
  margin-top: 7px;
  transform: scale(.9);
  transform-origin: top center;
}

body.public-surface .composer {
  width: min(100%, 760px);
  margin-top: 8px;
}

body.public-surface .composer-shell {
  min-height: 62px;
}

@media (min-width: 821px) and (max-width: 1120px) {
  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    width: min(100%, 960px);
    min-height: 340px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    width: 300px;
  }

  body.public-surface:not(.orb-engaged) .operator-status {
    font-size: clamp(34px, 4vw, 46px);
  }
}

@media (max-width: 820px) {
  body.public-surface .stage-eyebrow {
    margin-top: 22px;
  }

  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero {
    min-height: 0;
    padding-top: 14px;
  }

  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    width: min(78vw, 286px);
  }

  body.public-surface:not(.orb-engaged) .orb-status,
  body.public-surface.orb-engaged .orb-status {
    min-height: 40px;
    margin-top: -4px;
  }

  body.public-surface:not(.orb-engaged) .orb-controls,
  body.public-surface.orb-engaged .orb-controls {
    margin-top: 10px;
    transform: none;
  }

  body.public-surface .composer {
    width: 100%;
    margin-top: 18px;
  }
}

@media (max-width: 440px) {
  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    width: min(76vw, 270px);
  }
}
/* ============ V85 FINAL ENGAGED GEOMETRY ============
   These rules intentionally sit after the accumulated historical layers. */
body.public-surface.orb-engaged .orb-wrap {
  width: min(100%, 284px);
}

body.public-surface.orb-engaged .orb-transcript {
  max-width: 280px;
}

@media (min-width: 821px) and (max-width: 1120px) {
  body.public-surface.orb-engaged .orb-wrap {
    width: 260px;
  }
}

@media (max-width: 820px) {
  body.public-surface.orb-engaged .orb-wrap {
    width: min(62vw, 224px);
  }
}

@media (max-width: 440px) {
  body.public-surface.orb-engaged .orb-wrap {
    width: min(62vw, 218px);
  }
}

/* Final mobile containment: every public command element remains inside the
   viewport even when browser chrome, a long starter label, or a result grows. */
@media (max-width: 820px) {
  body.public-surface { overflow-x: hidden; }
  body.public-surface .frame,
  body.public-surface .stage,
  body.public-surface .command-stage,
  body.public-surface .command-hero,
  body.public-surface .composer,
  body.public-surface .composer-foot,
  body.public-surface .starter-actions { min-width: 0; max-width: 100%; }
  body.public-surface .composer-hint { display: block; white-space: normal; overflow-wrap: anywhere; }
  body.public-surface .starter-actions { width: 100%; flex-wrap: wrap; }
  body.public-surface .starter-actions button { max-width: 100%; white-space: normal; text-align: center; }
  body.public-surface:not(.orb-engaged) .command-hero,
  body.public-surface.orb-engaged .command-hero { display: flex; flex-direction: column; align-items: stretch; }
  body.public-surface:not(.orb-engaged) .orb-wrap,
  body.public-surface.orb-engaged .orb-wrap {
    order: 1; align-self: center; width: min(78vw, 286px) !important; max-width: 286px;
  }
  body.public-surface:not(.orb-engaged) .operator-pulse,
  body.public-surface.orb-engaged .operator-pulse { order: 2; width: 100%; min-width: 0; }
  body.public-surface .composer { order: 3; }
  body.public-surface .composer { width: calc(100% - 24px); max-width: calc(100% - 24px); }
}
