:root {
  --base: #3a354f;
  --surface: #2f2b42;
  --elev: #45405c;
  --panel: var(--surface);
  --ink: #f4f2f7;
  --mute: #9e97b0;
  --line: rgba(244, 242, 247, 0.1);
  --line2: rgba(244, 242, 247, 0.16);
  --accent: #8eb4c8;
  --ba: #8b84a3;
  --ok: #5dce9a;
  --fail: #f07178;
  --warn: #c9b87a;
  --risk: var(--warn);
  --mutate: #ff9a86;
  --mutate-soft: #ffc4b8;
  /* Access / Decision kind accents (Quiet Orbit palette) */
  --access-profile: #c4b89a;
  --intel: var(--accent);
  --analyze: var(--ok);
  --k6: #7ec8b0;
  --r: 10px;
  /* Fallbacks if Google Fonts blocked (Amvera / network) */
  --font: "Plus Jakarta Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", "Consolas", "Courier New", monospace;
  /* Console Live motion — calm, shared easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 140ms;
  --t-in: 280ms;
  --t-num: 180ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  background: var(--base);
}

#app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes scan-y {
  0%,
  100% {
    top: 18%;
    opacity: 0.15;
  }
  50% {
    top: 62%;
    opacity: 0.65;
  }
}

@keyframes busy-pulse {
  50% {
    opacity: 0.45;
  }
}

/* brand-breath removed (Turing M2 — no glow/breath tell) */

@keyframes btn-breath {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(142, 180, 200, 0);
  }
  50% {
    transform: scale(1.008);
    box-shadow: 0 0 0 2px rgba(142, 180, 200, 0.1);
    filter: brightness(1.03);
  }
}

/* Intel idle/working: ghost button; letter breath ≈120f @60fps; border comet */
@property --intel-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes intel-letter-breath {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.78;
  }
}

@keyframes intel-border-spin {
  to {
    --intel-angle: 360deg;
  }
}

@keyframes status-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— Auth (Quiet Orbit / Access gate) —— */
.hero-login,
.access-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
}

.auth-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--base);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.auth-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-atmosphere-svg {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1;
}

.auth-ring {
  stroke: var(--ba);
  stroke-opacity: 0.1;
  stroke-width: 1;
}

.auth-frame {
  fill: rgba(47, 43, 66, 0.14);
  stroke: rgba(142, 180, 200, 0.34);
  stroke-width: 1.4;
  animation: auth-frame-in 0.9s var(--ease-out) 0.12s both;
}

.auth-frame-line {
  stroke: rgba(244, 242, 247, 0.16);
  stroke-width: 1;
  fill: none;
}

.auth-frame-line-dim {
  stroke: rgba(244, 242, 247, 0.09);
}

.auth-frame-chip {
  fill: rgba(142, 180, 200, 0.1);
  stroke: rgba(142, 180, 200, 0.28);
  stroke-width: 1;
}

.auth-signal-dot {
  fill: var(--ok);
  opacity: 0.85;
}

.auth-scan {
  position: absolute;
  left: 8%;
  right: 42%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(142, 180, 200, 0.35),
    transparent
  );
  animation: auth-scan-once 2.6s var(--ease-out) 0.25s both;
  opacity: 0;
}

.auth-brand {
  position: absolute;
  z-index: 2;
  left: clamp(28px, 5vw, 72px);
  top: 42%;
  bottom: auto;
  max-width: min(32rem, 40vw);
  transform: translateY(-50%);
  animation: auth-brand-in 0.7s var(--ease-out) both;
}

.auth-brand .brand {
  font-size: clamp(3.8rem, 9vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.9;
  margin: 0;
}

.auth-brand .brand span {
  color: var(--ba);
}

.auth-brand .brand-tagline {
  margin: 16px 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(244, 242, 247, 0.8);
  max-width: 18em;
}

.auth-credit {
  position: absolute;
  z-index: 2;
  left: clamp(28px, 5vw, 72px);
  bottom: clamp(18px, 3.5vh, 32px);
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  opacity: 0.5;
}

.auth-dock.form-pane {
  position: absolute;
  z-index: 3;
  top: 62%;
  right: clamp(20px, 4vw, 56px);
  transform: translateY(-50%);
  width: min(380px, calc(100% - 40px));
  padding: 0;
  margin: 0;
  background: transparent;
  animation: auth-dock-in 0.75s var(--ease-out) 0.1s both;
  align-content: unset;
  display: block;
}

.auth-orbit {
  animation: none;
}

/* Flat glass on gate — beat shared .orbit-glass::before */
.orbit-glass.auth-orbit::before {
  opacity: 0;
}

.auth-orbit-status {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.auth-orbit .orbit-signal.is-bad {
  color: var(--fail);
}

.auth-orbit .orbit-signal.is-ok {
  color: var(--ok);
}

.auth-body {
  overflow: hidden;
}

.auth-body.is-auth-swap {
  transition: height 0.62s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-form {
  margin: 0;
  display: flex;
  flex-direction: column;
  transform-origin: top center;
  transition:
    opacity 0.24s ease,
    transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form.is-leave {
  opacity: 0;
  transform: translateY(-12px) scaleY(0.94);
  pointer-events: none;
}

.auth-form.auth-form-enter {
  transition: none;
  animation: auth-form-unfold 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-form.auth-form-enter.is-expand {
  animation-name: auth-form-unfold-deep;
  animation-duration: 0.58s;
}

.auth-form.auth-form-enter > * {
  animation: auth-field-unfold 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-form.auth-form-enter.is-expand > * {
  animation-duration: 0.52s;
}

.auth-form.auth-form-enter > *:nth-child(1) {
  animation-delay: 0.05s;
}

.auth-form.auth-form-enter > *:nth-child(2) {
  animation-delay: 0.12s;
}

.auth-form.auth-form-enter > *:nth-child(3) {
  animation-delay: 0.19s;
}

.auth-form.auth-form-enter > *:nth-child(4) {
  animation-delay: 0.26s;
}

.auth-form.auth-form-enter > *:nth-child(5) {
  animation-delay: 0.33s;
}

.auth-form .hint {
  margin-bottom: 14px;
}

.hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  margin: 0 0 16px;
}

.orbit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--mute);
  font-weight: 500;
}

.orbit-field input,
.access-orbit .orbit-field input,
.auth-orbit input {
  width: 100%;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  padding: 10px 12px;
  font: 400 0.9rem/1.35 var(--font);
}

.orbit-field input:focus,
.access-orbit .orbit-field input:focus,
.auth-orbit input:focus {
  outline: none;
  border-color: rgba(142, 180, 200, 0.4);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.auth-cta {
  width: 100%;
  margin-top: 4px;
}

.auth-cta:disabled {
  opacity: 0.55;
  cursor: wait;
}

.seg,
.auth-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(142, 180, 200, 0.12);
  border-radius: 12px;
  margin-bottom: 14px;
}

.seg button,
.auth-seg button {
  border: none;
  background: transparent;
  color: var(--mute);
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
  font: 600 12px/1 var(--font);
  transition:
    background var(--t-fast, 0.15s) ease,
    color var(--t-fast, 0.15s) ease;
}

.seg button.active,
.seg button.on,
.auth-seg button.active {
  background: rgba(142, 180, 200, 0.18);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@keyframes auth-form-unfold {
  from {
    opacity: 0;
    transform: translateY(12px) scaleY(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-form-unfold-deep {
  from {
    opacity: 0;
    transform: translateY(20px) scaleY(0.84);
    clip-path: inset(0 0 28% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes auth-field-unfold {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-brand-in {
  from {
    opacity: 0;
    transform: translateY(calc(-50% + 14px));
  }
  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@keyframes auth-dock-in {
  from {
    opacity: 0;
    transform: translateY(calc(-50% + 16px));
  }
  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@keyframes auth-frame-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes auth-scan-once {
  0% {
    top: 24%;
    opacity: 0;
  }
  18% {
    opacity: 0.45;
  }
  100% {
    top: 70%;
    opacity: 0;
  }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .auth-brand {
    max-width: min(26rem, 36vw);
  }

  .auth-dock.form-pane {
    width: min(350px, calc(100% - 36px));
    right: clamp(16px, 3vw, 36px);
  }
}

@media (min-width: 1200px) {
  /* Keep brand + dock as one composition on wide screens */
  .auth-brand {
    left: max(48px, calc(50vw - 520px));
  }

  .auth-dock.form-pane {
    right: max(48px, calc(50vw - 520px));
  }

  .auth-credit {
    left: max(48px, calc(50vw - 520px));
  }
}

@media (max-width: 860px) {
  .auth-stage {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* C1: keep safe-area (do not wipe base env insets) */
    padding: max(28px, env(safe-area-inset-top, 0px))
      max(20px, env(safe-area-inset-right, 0px))
      max(28px, env(safe-area-inset-bottom, 0px))
      max(20px, env(safe-area-inset-left, 0px));
    gap: 22px;
  }

  .auth-brand {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    max-width: none;
    transform: none;
    animation: auth-brand-in-mobile 0.65s var(--ease-out) both;
  }

  .auth-brand .brand {
    font-size: clamp(2.8rem, 14vw, 3.6rem);
  }

  .auth-dock.form-pane {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    animation: auth-dock-in-mobile 0.65s var(--ease-out) 0.08s both;
  }

  .auth-credit {
    position: relative;
    left: auto;
    bottom: auto;
    order: 3;
    opacity: 0.55;
  }

  .auth-atmosphere-svg {
    opacity: 0.7;
  }

  .auth-scan {
    right: 10%;
  }
}

@keyframes auth-brand-in-mobile {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-dock-in-mobile {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

label {
  display: block;
  font-size: 12px;
  color: var(--mute);
  margin: 0 0 6px;
  font-weight: 500;
}

input,
select:not(.orbit-profile),
textarea {
  width: 100%;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  margin-bottom: 12px;
}

input:focus,
select:not(.orbit-profile):focus,
textarea:focus {
  outline: none;
  border-color: rgba(142, 180, 200, 0.4);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.btn,
button.cta {
  border: none;
  background: var(--ink);
  color: var(--base);
  font: 700 13px/1 var(--font);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover,
button.cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn.accent,
.btn.cta {
  width: 100%;
  margin-top: 6px;
}

#intel.intel-btn,
#intel {
  width: 100%;
  margin-top: 6px;
  position: relative;
  isolation: isolate;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
  filter: none;
  transform: none;
}

#intel.intel-btn:hover,
#intel:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  filter: brightness(1.08);
  transform: none;
}

#intel.intel-btn:disabled,
#intel:disabled {
  opacity: 0.45;
  background: transparent;
}

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

.row-between h3 {
  margin: 0;
}

.btn.tiny-ok {
  width: auto;
  padding: 6px 10px;
  font-size: 11px;
}

.llm-cloud-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 8px;
  transition: opacity 0.25s ease;
}

.llm-cloud-list.is-refreshing {
  opacity: 0.7;
  pointer-events: none;
}

.llm-cloud-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 10px 0;
  border-bottom: 1px solid rgba(244, 242, 247, 0.08);
}

.llm-cloud-row:last-child {
  border-bottom: none;
}

.llm-cloud-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.llm-cloud-model {
  color: var(--ink);
  min-width: 7rem;
}

.llm-cloud-left {
  color: color-mix(in srgb, var(--accent) 75%, var(--mute));
  font-weight: 500;
}

.llm-skel-row {
  pointer-events: none;
}

.llm-skel-model,
.llm-skel-text {
  display: inline-block;
  height: 10px;
  border-radius: 4px;
  background: rgba(142, 180, 200, 0.12);
}

.llm-skel-model {
  width: 6.5rem;
}

.llm-skel-text {
  width: 9rem;
}

.bar-track {
  position: relative;
  height: 5px;
  width: 100%;
  max-width: 28rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  border: none;
  overflow: hidden;
  contain: paint;
  isolation: isolate;
}

/* Neon lamp strip — SIGNAL OK green, bright core */
.bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ok) 42%, #fff) 0%,
    #7aebb0 38%,
    var(--ok) 72%,
    color-mix(in srgb, var(--ok) 72%, #1a3d2e) 100%
  );
  box-shadow:
    inset 0 0 3px color-mix(in srgb, var(--ok) 70%, transparent),
    0 0 6px color-mix(in srgb, var(--ok) 45%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-track.is-pending {
  box-shadow:
    0 0 8px color-mix(in srgb, var(--ok) 38%, transparent),
    0 0 3px color-mix(in srgb, var(--ok) 55%, transparent);
}

.bar-track.is-pending .bar-fill {
  background: linear-gradient(
    180deg,
    #d4ffe8 0%,
    #8ef0bc 36%,
    var(--ok) 78%,
    color-mix(in srgb, var(--ok) 80%, #1a3d2e) 100%
  );
  box-shadow:
    inset 0 0 4px color-mix(in srgb, var(--ok) 85%, transparent),
    0 0 8px color-mix(in srgb, var(--ok) 55%, transparent);
  transform: scaleX(0.42);
  animation: llm-bar-pending 1.6s ease-in-out infinite;
}

@keyframes llm-bar-pending {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

/* remaining levels — ok lamp / amber / rose */
.llm-bar.is-ok .bar-fill {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ok) 48%, #fff) 0%,
    #7aebb0 40%,
    var(--ok) 100%
  );
  box-shadow:
    inset 0 0 3px color-mix(in srgb, var(--ok) 65%, transparent),
    0 0 5px color-mix(in srgb, var(--ok) 40%, transparent);
}

.llm-bar.is-warn .bar-fill {
  background: rgba(196, 168, 110, 0.48);
  box-shadow: none;
}

.llm-bar.is-low .bar-fill {
  background: rgba(200, 130, 138, 0.48);
  box-shadow: none;
}

.llm-cloud-row.is-filling .llm-cloud-left {
  opacity: 0.55;
  transition: opacity 0.35s ease;
}

.llm-cloud-row.is-filling.is-filled .llm-cloud-left {
  opacity: 1;
}

.token-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.token-sub {
  margin-top: 4px;
  color: var(--mute);
  font-size: 10px;
}

.budget-edit {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.budget-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.budget-row input {
  margin: 0;
  margin-bottom: 0;
}

.user-card {
  border: 1px solid rgba(142, 180, 200, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.user-card .orbit-check {
  margin: 4px 8px 4px 0;
}

.user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.user-access-inner .user-actions {
  margin-top: 2px;
}

.user-actions .btn.secondary {
  width: auto;
}

.feat-checks {
  margin-top: 0;
}

#intel-hint {
  margin: 8px 0 0;
  color: var(--mute);
  font-size: 11px;
}

.btn.secondary,
.nav-btn {
  background: transparent;
  color: var(--mute);
  border: 1px solid var(--line2);
  font: 500 12px/1 var(--font);
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.btn.secondary:hover,
.nav-btn:hover {
  color: var(--ink);
  border-color: var(--mute);
  transform: none;
  filter: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.is-working:not(#intel) {
  animation: btn-breath 1.8s ease-in-out infinite;
}

.btn.is-working:disabled:not(#intel) {
  opacity: 0.95;
  cursor: wait;
}

.btn.secondary.is-working {
  color: var(--ink);
  border-color: rgba(142, 180, 200, 0.55);
  background: rgba(142, 180, 200, 0.08);
}

/* Intel working: accent = run-status; minimal letter breath; clockwise border light */
#intel.is-working,
#intel.is-working:disabled {
  cursor: wait;
  opacity: 1;
  color: var(--accent);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  filter: none;
  transform: none;
  animation: intel-letter-breath 2s ease-in-out infinite;
  will-change: opacity;
}

#intel.is-working::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: conic-gradient(
    from var(--intel-angle),
    transparent 0deg,
    transparent 300deg,
    rgba(142, 180, 200, 0.15) 320deg,
    var(--accent) 348deg,
    #e8e0ff 354deg,
    var(--accent) 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: intel-border-spin 2.8s linear infinite;
  will-change: --intel-angle;
}

#intel.is-working::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(142, 180, 200, 0.28);
  box-sizing: border-box;
}

.err {
  color: var(--fail);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 8px;
}

/* Progress / AI status under Run — calm accent, not alarm red */
.run-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.35em;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--mute);
  opacity: 0;
  transition: opacity var(--t-fast) ease, color var(--t-fast) ease;
}

.run-status.is-active,
.run-status.is-error {
  opacity: 1;
}

.run-status.is-active {
  color: var(--accent);
}

.run-status.is-active::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.12);
  animation: status-dot 1.5s ease-in-out infinite;
}

.run-status.is-error {
  color: var(--fail);
}

.run-status.is-error::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fail);
  box-shadow: none;
  animation: none;
}

/* Agent Frame — Quiet Orbit + Glass Link + LINK·SIGNAL */
.agent-panel {
  margin-top: 14px;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.agent-frame .agent-panel {
  margin-top: 8px;
}

.orbit-glass {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(142, 180, 200, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 42%
    ),
    linear-gradient(
      165deg,
      rgba(69, 64, 92, 0.72) 0%,
      rgba(47, 43, 66, 0.94) 52%,
      rgba(36, 32, 52, 0.98) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(244, 242, 247, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 18px 48px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.orbit-glass::before {
  content: none;
}

.orbit-glass > * {
  position: relative;
  z-index: 1;
}

.orbit-status {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  padding-bottom: 4px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

/* Top: zone + session clock + TOK */
.orbit-status-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 14px;
  min-width: 0;
  width: 100%;
}

.orbit-status-meta-end {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 10px 12px;
  margin-left: auto;
  min-width: 0;
}

/* Bottom: PWR → profile → agent status → SIGNAL */
.orbit-status-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  width: 100%;
}

.orbit-link {
  color: rgba(142, 180, 200, 0.9);
  letter-spacing: 0.1em;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Conductor PWR — CRT console green, mute when off (no neon spam) */
.orbit-pwr {
  flex: 0 0 auto;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid rgba(244, 242, 247, 0.14);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--mute);
  font: 600 10px/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.orbit-pwr:hover {
  border-color: rgba(93, 206, 154, 0.35);
  color: rgba(93, 206, 154, 0.75);
}

.orbit-pwr.is-on {
  color: var(--ok);
  border-color: rgba(93, 206, 154, 0.5);
  background: rgba(93, 206, 154, 0.1);
}

.orbit-pwr.is-on:hover {
  border-color: rgba(93, 206, 154, 0.65);
  color: var(--ok);
}

.orbit-glass.is-pwr-off .orbit-compose {
  display: none;
}

/* PWR OFF — quiet empty orbit (mockup face), not a stretched void */
.orbit-glass.is-pwr-off .agent-log {
  min-height: 160px;
  max-height: min(42vh, 320px);
  max-height: min(42dvh, 320px);
}

.orbit-glass.is-pwr-off .orbit-empty {
  min-height: 160px;
  padding: 16px 4px 24px;
}

.orbit-glass.is-pwr-off .orbit-empty-title {
  color: var(--mute);
  font-weight: 600;
}

.orbit-glass.is-pwr-off .orbit-log {
  opacity: 0.55;
}

.orbit-signal.is-pwr-off {
  color: var(--mute);
}

.orbit-signal.is-pwr-off::before {
  background: currentColor;
  box-shadow: none;
  animation: none;
  opacity: 0.45;
}

.live-wrap.is-pwr-off .live-meta {
  color: var(--mute);
}

/* Custom profile picker — OS <select> popup cannot be styled */
.orbit-profile-dd {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  z-index: 5;
}

.orbit-profile-dd.is-open {
  z-index: 30;
}

.orbit-profile-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

button.orbit-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: auto;
  min-width: 7.5rem;
  max-width: min(220px, 46vw);
  margin: 0;
  border: 1px solid rgba(244, 242, 247, 0.14);
  border-radius: 8px;
  color: var(--ink);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 5px 10px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

button.orbit-profile:hover {
  border-color: rgba(142, 180, 200, 0.35);
  background: rgba(142, 180, 200, 0.08);
}

button.orbit-profile:focus,
.orbit-profile-dd.is-open button.orbit-profile {
  outline: none;
  border-color: rgba(142, 180, 200, 0.5);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.14);
}

.orbit-profile-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.orbit-profile-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--mute);
  margin-left: auto;
  transition: transform 0.15s ease;
}

.orbit-profile-dd.is-open .orbit-profile-caret {
  transform: rotate(180deg);
  border-top-color: rgba(142, 180, 200, 0.9);
}

.orbit-profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: max(100%, 12rem);
  max-width: min(280px, 80vw);
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(142, 180, 200, 0.38);
  background: linear-gradient(
      160deg,
      rgba(48, 42, 68, 0.98) 0%,
      rgba(22, 20, 32, 0.98) 100%
    ),
    rgba(16, 14, 24, 0.98);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(244, 242, 247, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.55);
  z-index: 50;
  animation: orbit-menu-in 160ms var(--ease-out, ease-out);
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--ink);
}

@keyframes orbit-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.orbit-profile-menu[hidden] {
  display: none !important;
}

.orbit-profile-menu [role="option"] {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font: 500 12px/1.3 var(--mono);
  color: rgba(244, 242, 247, 0.88);
  cursor: pointer;
  letter-spacing: 0.01em;
  text-transform: none;
}

.orbit-profile-menu [role="option"]::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(244, 242, 247, 0.25);
}

.orbit-profile-menu [role="option"]:hover,
.orbit-profile-menu [role="option"]:focus {
  outline: none;
  background: rgba(142, 180, 200, 0.18);
  color: #fff;
}

.orbit-profile-menu [role="option"][aria-selected="true"] {
  background: rgba(142, 180, 200, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(142, 180, 200, 0.35);
}

.orbit-profile-menu [role="option"][aria-selected="true"]::before {
  background: rgba(142, 180, 200, 0.95);
}

.orbit-session {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.orbit-tokens {
  flex: 0 0 auto;
  letter-spacing: 0.06em;
  font-size: 11px;
  white-space: nowrap;
}

.orbit-notice {
  flex: 1 1 8rem;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
  color: var(--mute);
}

.orbit-notice:empty {
  display: none;
}

/* Запускаю Intel… / Думаю… — зелёный + дыхание как SIGNAL OK */
.orbit-notice.is-think,
.orbit-notice.is-ok {
  color: var(--ok);
  animation: orbit-breathe 2.8s var(--ease-out) infinite;
}

.orbit-notice.is-err {
  color: var(--fail);
  animation: none;
}

.orbit-work {
  margin-left: 0;
  color: var(--mute);
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.orbit-work::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: 1px;
  opacity: 0.35;
}

.orbit-work.is-work {
  color: var(--accent);
}

.orbit-work.is-work::before {
  opacity: 1;
  animation: orbit-breathe 1.4s ease-in-out infinite;
  box-shadow: none;
}

.orbit-work.is-memory {
  color: var(--ok);
}

.orbit-work.is-memory::before {
  opacity: 1;
  animation: none;
}

.orbit-signal {
  color: var(--ok);
  letter-spacing: 0.08em;
  flex: 0 0 auto;
  white-space: nowrap;
}

.orbit-signal::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: 1px;
  box-shadow: 0 0 8px rgba(93, 206, 154, 0.35);
  animation: orbit-breathe 2.8s var(--ease-out) infinite;
}

.orbit-signal.is-warn {
  color: var(--warn);
}

.orbit-signal.is-warn::before {
  box-shadow: 0 0 8px rgba(201, 184, 122, 0.35);
  animation: none;
}

.orbit-signal.is-bad {
  color: var(--fail);
}

.orbit-signal.is-bad::before {
  box-shadow: none;
  animation: none;
}

@keyframes orbit-breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* B · Soft fill — track + scaleX fill on PWR, then quiet breath */
.orbit-scan {
  position: relative;
  height: 2px;
  width: 100%;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  margin: 2px 0 0;
}

.orbit-scan::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(142, 180, 200, 0.72);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0.85;
}

.orbit-glass.is-pwr-on .orbit-scan,
.orbit-scan.is-boot,
.orbit-scan.is-ready {
  opacity: 1;
}

/* PWR ON — fill 0→100% */
.orbit-scan.is-boot::after {
  animation: orbit-soft-fill 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* After fill — soft breath (full width) */
.orbit-scan.is-ready::after {
  transform: scaleX(1);
  animation: orbit-soft-breath 3s ease-in-out infinite;
}

/* WORK — same fill, slightly stronger breath */
.orbit-scan.is-on.is-ready::after,
.orbit-scan.is-on:not(.is-boot)::after {
  transform: scaleX(1);
  background: rgba(142, 180, 200, 0.85);
  animation: orbit-soft-breath-work 2.4s ease-in-out infinite;
}

@keyframes orbit-soft-fill {
  from {
    transform: scaleX(0);
    opacity: 0.35;
  }
  to {
    transform: scaleX(1);
    opacity: 0.85;
  }
}

@keyframes orbit-soft-breath {
  0%,
  100% {
    opacity: 0.38;
  }
  50% {
    opacity: 0.88;
  }
}

@keyframes orbit-soft-breath-work {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.agent-log {
  position: relative;
  min-height: 200px;
  max-height: min(52vh, 440px);
  max-height: min(52dvh, 440px);
  overflow-y: auto;
  padding: 8px 4px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 180, 200, 0.28) transparent;
}

.agent-log.has-decision {
  gap: 14px;
  max-height: min(58vh, 520px);
  max-height: min(58dvh, 520px);
}

.agent-msg-meta {
  margin: -4px 2px 2px;
  padding: 0 2px;
  font-size: 0.78rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.agent-msg-meta.is-ok {
  color: var(--ok);
  font-family: var(--mono, ui-monospace, monospace);
}

/* ORBIT LOG — orchestrator teletype under answer (Quiet Orbit) */
.orbit-log {
  border-top: 1px solid rgba(244, 242, 247, 0.08);
  padding-top: 6px;
  margin-top: 2px;
}

.orbit-log-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  font: 400 10px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

.orbit-log-toggle:hover {
  color: rgba(142, 180, 200, 0.95);
  background: rgba(142, 180, 200, 0.06);
}

.orbit-log-summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.06em;
}

.orbit-log-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.18s var(--ease-out);
}

.orbit-log.is-open .orbit-log-caret {
  transform: rotate(180deg);
}

.orbit-log-body {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(244, 242, 247, 0.08);
  background: rgba(0, 0, 0, 0.22);
  font: 400 11px/1.55 var(--mono);
  color: var(--mute);
  max-height: min(28vh, 200px);
  max-height: min(28dvh, 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 180, 200, 0.28) transparent;
  animation: orbit-in var(--t-in) var(--ease-out);
}

.orbit-log-body[hidden] {
  display: none !important;
}

.orbit-log-turn + .orbit-log-turn {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(244, 242, 247, 0.06);
}

.orbit-log-turn-head {
  color: rgba(142, 180, 200, 0.85);
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
}

.orbit-log-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0 0.55em;
  white-space: normal;
  word-break: break-word;
}

.orbit-log-line .orbit-log-time {
  flex: 0 0 4.6em;
  color: rgba(244, 242, 247, 0.38);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.orbit-log-line .k {
  flex: 0 0 7.2em;
  color: rgba(244, 242, 247, 0.5);
  white-space: nowrap;
}

.orbit-log-line .orbit-log-msg {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.orbit-log-empty {
  margin: 0;
  font-size: 11px;
}

/* Analyze-in-Orbit: digest affordance + inline drawer (not «Отчёт» expand) */
.analyze-digest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(142, 180, 200, 0.18);
  background: rgba(0, 0, 0, 0.16);
  color: var(--ink);
  font: 400 11px/1.4 var(--mono);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.18s var(--ease-out),
    background 0.18s var(--ease-out);
}

.analyze-digest:hover {
  border-color: rgba(142, 180, 200, 0.35);
  background: rgba(0, 0, 0, 0.22);
}

.analyze-digest[hidden] {
  display: none !important;
}

.analyze-digest.sev-ok {
  border-color: color-mix(in srgb, var(--ok) 32%, var(--line));
  background: color-mix(in srgb, var(--ok) 6%, transparent);
}

.analyze-digest.sev-warn {
  border-color: color-mix(in srgb, var(--warn) 32%, var(--line));
  background: color-mix(in srgb, var(--warn) 6%, transparent);
}

.analyze-digest.sev-fail,
.analyze-digest.sev-error {
  border-color: color-mix(in srgb, var(--fail) 35%, var(--line));
  background: color-mix(in srgb, var(--fail) 6%, transparent);
}

.analyze-digest.sev-skip,
.analyze-digest.sev-idle {
  border-color: rgba(142, 180, 200, 0.16);
  background: rgba(0, 0, 0, 0.14);
}

.analyze-digest.is-busy {
  border-color: rgba(142, 180, 200, 0.28);
}

.analyze-digest-sev {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.analyze-digest.sev-ok .analyze-digest-sev {
  color: var(--ok);
}

.analyze-digest.sev-warn .analyze-digest-sev {
  color: var(--warn);
}

.analyze-digest.sev-fail .analyze-digest-sev,
.analyze-digest.sev-error .analyze-digest-sev {
  color: var(--fail);
}

.analyze-digest.sev-skip .analyze-digest-sev,
.analyze-digest.sev-idle .analyze-digest-sev {
  color: var(--mute);
}

.analyze-digest-msg {
  flex: 1 1 10rem;
  min-width: 0;
  color: var(--ink);
}

.analyze-digest-aff {
  margin-left: auto;
  color: var(--ok);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.analyze-orbit-drawer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 2px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(244, 242, 247, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  max-width: 100%;
  width: 100%;
  animation: analyze-drawer-in 0.32s var(--ease-out) both;
}

.analyze-orbit-drawer[hidden] {
  display: none !important;
}

@keyframes analyze-drawer-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.analyze-drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.analyze-drawer-run {
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(100%, 22rem);
}

.analyze-drawer-sev {
  color: var(--mute);
}

.analyze-drawer-sev.sev-ok {
  color: var(--ok);
}

.analyze-drawer-sev.sev-warn {
  color: var(--warn);
}

.analyze-drawer-sev.sev-fail,
.analyze-drawer-sev.sev-error {
  color: var(--fail);
}

.analyze-drawer-sev.sev-skip,
.analyze-drawer-sev.sev-idle {
  color: var(--mute);
}

.analyze-drawer-close {
  margin-left: auto;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  font: 400 14px/1 var(--mono);
  padding: 2px 6px;
}

.analyze-drawer-close:hover {
  color: var(--ink);
}

.analyze-drawer-tabs {
  margin: 0;
}

.analyze-drawer-body {
  margin: 0;
  min-height: 120px;
  max-height: min(40vh, 280px);
  max-height: min(40dvh, 280px);
  overflow: auto;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(244, 242, 247, 0.08);
  background: rgba(0, 0, 0, 0.22);
  font: 400 12px/1.55 var(--mono);
  color: var(--mute);
  white-space: pre-wrap;
  word-break: break-word;
}

.analyze-drawer-body.is-busy {
  color: var(--accent);
  font-style: normal;
  letter-spacing: 0.02em;
}

.analyze-drawer-foot {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(244, 242, 247, 0.06);
  padding-top: 8px;
}

.analyze-drawer-hist-btn {
  appearance: none;
  border: 1px solid rgba(244, 242, 247, 0.14);
  background: transparent;
  color: var(--mute);
  border-radius: 8px;
  padding: 5px 10px;
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.analyze-drawer-hist-btn:hover,
.analyze-drawer-hist-btn[aria-expanded="true"] {
  color: var(--ink);
  border-color: rgba(142, 180, 200, 0.35);
}

.analyze-drawer-hist {
  margin: 0;
  max-height: min(28vh, 180px);
  max-height: min(28dvh, 180px);
  overflow-y: auto;
  padding: 0;
  list-style: none;
}

.analyze-drawer-hist[hidden] {
  display: none !important;
}

.analyze-drawer-hist li {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analyze-drawer-hist li:hover,
.analyze-drawer-hist li.on {
  background: rgba(142, 180, 200, 0.08);
}

.orbit-glass.is-pwr-off .analyze-orbit-drawer,
.orbit-glass.is-pwr-off .analyze-digest {
  display: none !important;
}

.agent-log::-webkit-scrollbar {
  width: 5px;
}

.agent-log::-webkit-scrollbar-track {
  background: transparent;
}

.agent-log::-webkit-scrollbar-thumb {
  background: rgba(142, 180, 200, 0.28);
  border-radius: 3px;
}

.agent-log::-webkit-scrollbar-thumb:hover {
  background: rgba(142, 180, 200, 0.45);
}

.orbit-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  max-width: 100%;
  width: 100%;
  padding: 12px 4px 20px;
  animation: orbit-in var(--t-in) var(--ease-out);
}

.orbit-empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.orbit-empty-sub {
  margin: 0;
  max-width: 28em;
  font-size: 0.88rem;
  color: var(--mute);
  line-height: 1.45;
}

.orbit-boot-egg {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(158, 151, 176, 0.45);
}

@keyframes orbit-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes orbit-hero-glow {
  0% {
    box-shadow:
      inset 0 1px 0 rgba(244, 242, 247, 0.08),
      0 8px 28px rgba(0, 0, 0, 0.18),
      0 0 0 0 rgba(142, 180, 200, 0);
  }
  40% {
    box-shadow:
      inset 0 1px 0 rgba(244, 242, 247, 0.1),
      0 14px 40px rgba(0, 0, 0, 0.22),
      0 0 0 6px rgba(142, 180, 200, 0.12);
  }
  100% {
    box-shadow:
      inset 0 1px 0 rgba(244, 242, 247, 0.08),
      0 12px 36px rgba(0, 0, 0, 0.2),
      0 0 0 0 rgba(142, 180, 200, 0);
  }
}

@keyframes orbit-accepting {
  to {
    opacity: 0.35;
    transform: scale(0.96) translateY(-4px);
    filter: blur(0.2px);
  }
}

@keyframes orbit-result-in {
  0% {
    opacity: 0.65;
    transform: translateY(8px);
    box-shadow: 0 0 0 0 rgba(142, 180, 200, 0);
  }
  40% {
    opacity: 1;
    transform: none;
    box-shadow: 0 0 0 4px rgba(142, 180, 200, 0.14);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(142, 180, 200, 0);
  }
}

.agent-msg {
  max-width: 100%;
  width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  transition: opacity var(--t-fast) var(--ease-out);
}

.agent-msg.is-quiet {
  opacity: 0.42;
}

/* Focused agent answer stays readable; paired with open card → softer, less wall */
.agent-msg-assistant:not(.is-quiet) {
  opacity: 1;
}

.agent-msg-assistant.is-card-paired {
  opacity: 0.72;
  font-size: 0.88rem;
  line-height: 1.4;
  max-height: 5.6em;
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
}

@keyframes agent-reply-in {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.agent-msg-assistant.is-enter {
  animation: agent-reply-in 0.95s var(--ease-out) both;
}

.agent-msg-user {
  color: var(--mute);
}

.agent-frame .agent-msg-assistant,
.agent-msg-assistant {
  color: var(--ink);
}

.agent-role {
  display: inline-block;
  min-width: 3.4em;
  margin-right: 6px;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agent-msg-assistant .agent-role {
  color: rgba(142, 180, 200, 0.85);
}

.agent-msg-user .agent-role {
  color: var(--mute);
}

.orbit-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(244, 242, 247, 0.08);
  max-width: 100%;
  width: 100%;
}

.agent-actions {
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.agent-actions .btn {
  flex: 0 0 auto;
}

/* Orbit glass checkbox — not OS native white square */
.orbit-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.orbit-check input {
  position: absolute;
  left: 2px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: 0;
  transform: translateY(-50%);
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.orbit-check-mark {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(142, 180, 200, 0.32);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out);
}

.orbit-check-mark::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4.5px;
  height: 8px;
  border: solid rgba(244, 242, 247, 0.95);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg) scale(0.55);
  opacity: 0;
  transition:
    opacity var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
}

.orbit-check input:checked + .orbit-check-mark {
  border-color: rgba(142, 180, 200, 0.75);
  background: rgba(142, 180, 200, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.orbit-check input:checked + .orbit-check-mark::after {
  opacity: 1;
  transform: rotate(42deg) scale(1);
}

.orbit-check input:checked ~ .orbit-check-text {
  color: rgba(142, 180, 200, 0.92);
}

.orbit-check input:focus-visible + .orbit-check-mark {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(142, 180, 200, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.orbit-check-text {
  letter-spacing: 0.01em;
}

.agent-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.35;
}

.agent-panel textarea:focus {
  outline: none;
  border-color: rgba(142, 180, 200, 0.4);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.agent-panel .err,
.agent-panel .agent-status {
  margin-top: 0;
  min-height: 0;
}

/* Compose status: lesson ok / thinking / error */
.agent-status {
  margin: 4px 0 0;
  min-height: 1.15em;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--mute);
}

.agent-status.is-ok {
  color: var(--ok);
  font-family: var(--mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
}

.agent-status.is-err {
  color: var(--fail);
}

.agent-status.is-think {
  color: var(--accent);
  animation: agent-think-pulse 1.1s ease-in-out infinite;
}

@keyframes agent-think-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.orbit-glass.is-thinking .orbit-signal {
  animation: orbit-breathe 1.4s ease-in-out infinite;
}

.orbit-glass.is-thinking .orbit-link {
  color: var(--accent);
}

.agent-frame-head h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.agent-proposal,
.decision-card {
  position: relative;
  isolation: isolate;
  z-index: 0;
  margin: 8px 2px 6px;
  padding: 16px 16px 14px;
  max-width: 100%;
  width: 100%;
  border: 1px solid rgba(142, 180, 200, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 42%
    ),
    linear-gradient(
      165deg,
      rgba(69, 64, 92, 0.72) 0%,
      rgba(47, 43, 66, 0.94) 52%,
      rgba(36, 32, 52, 0.98) 100%
    );
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow:
    inset 0 1px 0 rgba(244, 242, 247, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 18px 48px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.decision-card.is-orbit-hero {
  margin: 12px 0 8px;
  padding: 20px 20px 18px;
  max-width: 100%;
  width: 100%;
  animation:
    orbit-in 380ms var(--ease-out),
    orbit-hero-glow 700ms var(--ease-out) 120ms;
}

.decision-card.is-accepting {
  animation: orbit-accepting 380ms var(--ease-out) forwards;
  pointer-events: none;
}

.decision-card.is-settled {
  pointer-events: none;
  opacity: 0.95;
}

.decision-actions .proposal-accept.is-busy,
.decision-actions .proposal-accept.is-settled-ok,
.decision-actions .proposal-accept.is-settled-fail,
.decision-actions .proposal-reject.is-settled-no {
  min-width: min(100%, 11.5rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Busy (Intel/Load/…): same green + breathe as SIGNAL OK */
.decision-actions .proposal-accept.is-busy {
  color: var(--ok);
  border-color: rgba(93, 206, 154, 0.55);
  background: rgba(93, 206, 154, 0.14);
  box-shadow: 0 0 0 1px rgba(93, 206, 154, 0.12), 0 0 12px rgba(93, 206, 154, 0.22);
  animation: orbit-breathe 2.8s var(--ease-out) infinite;
}

.decision-actions .proposal-accept.is-busy::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  box-shadow: 0 0 8px rgba(93, 206, 154, 0.35);
  animation: orbit-breathe 2.8s var(--ease-out) infinite;
}

.decision-actions .proposal-accept.is-settled-ok {
  color: var(--ok);
  border-color: rgba(93, 206, 154, 0.55);
  background: rgba(93, 206, 154, 0.12);
  box-shadow: 0 0 0 1px rgba(93, 206, 154, 0.1), 0 0 10px rgba(93, 206, 154, 0.18);
}

.decision-actions .proposal-accept.is-settled-ok::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  box-shadow: 0 0 8px rgba(93, 206, 154, 0.35);
}

.decision-actions .proposal-accept.is-settled-fail {
  color: var(--fail);
  border-color: rgba(240, 113, 120, 0.55);
  background: rgba(240, 113, 120, 0.12);
  box-shadow: none;
}

.decision-actions .proposal-reject.is-settled-no {
  color: var(--mute);
  border-color: rgba(244, 242, 247, 0.22);
  background: rgba(244, 242, 247, 0.06);
}

.decision-actions .btn.is-locked {
  opacity: 0.35;
  filter: grayscale(0.35);
}

/* legacy name kept for contracts; breathe uses orbit-breathe */
@keyframes decision-btn-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.load-result.orbit-result-arrive,
.orbit-result.orbit-result-arrive,
.panel.orbit-result-arrive {
  animation: orbit-result-in 700ms var(--ease-out);
}

/* Shared agent Result pane — Console + Load */
.orbit-result,
.load-result.orbit-result {
  border: 1px solid rgba(244, 242, 247, 0.1);
  border-radius: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.14);
  align-self: start;
  transition: box-shadow var(--t-in) var(--ease-out);
}

.orbit-result > h3,
.load-result.orbit-result > h3 {
  margin: 0 0 10px;
  font: 600 0.95rem/1.25 var(--font);
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}

.orbit-result-meta {
  margin: -4px 0 12px;
  font-size: 11px;
}

.orbit-result-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(244, 242, 247, 0.08);
}

.orbit-result-sub {
  margin: 0 0 8px;
  font: 500 10px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.orbit-result > .report,
.load-result.orbit-result > .report {
  margin: 0;
  min-height: 160px;
  max-height: 380px;
  overflow: auto;
  font: 400 11px/1.5 var(--mono);
  padding: 10px 12px;
  border: 1px solid rgba(244, 242, 247, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--mute);
  white-space: pre-wrap;
}

.directive-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(142, 180, 200, 0.9);
}

.agent-proposal.is-done,
.decision-card.is-done {
  opacity: 0.7;
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
  padding: 8px 10px;
}

.proposal-title {
  font-weight: 600;
  font-family: var(--font);
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.proposal-commit {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.92;
}

.decision-edit-hint {
  margin: 4px 0 0;
  font-size: 11px;
}

.decision-mutate-check .orbit-check-text {
  color: var(--mutate);
}

.decision-mutate-hint {
  margin: 0;
  font-size: 11px;
  color: var(--mute);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--mute);
  box-shadow: none;
}

.btn.ghost:hover {
  color: var(--ink);
  background: rgba(244, 242, 247, 0.04);
}

@media (prefers-reduced-motion: reduce) {
  .orbit-scan,
  .orbit-scan.is-boot,
  .orbit-scan.is-ready,
  .orbit-scan.is-on,
  .orbit-scan.is-boot::after,
  .orbit-scan.is-ready::after,
  .orbit-scan.is-on::after,
  .orbit-glass.is-pwr-on .orbit-scan,
  .orbit-empty,
  .decision-card.is-orbit-hero,
  .decision-card.is-accepting,
  .load-result.orbit-result-arrive,
  .orbit-result.orbit-result-arrive,
  .panel.orbit-result-arrive,
  .orbit-signal::before,
  .brand-orbits,
  .brand-mark,
  .btn.accent,
  #intel.is-working,
  #intel.is-working::before,
  .orbit-glass,
  .agent-think,
  .agent-msg-assistant.is-enter,
  .analyze-orbit-drawer,
  .status-dot,
  .busy-pulse,
  .bar-track.is-pending .bar-fill,
  .bar-fill,
  .auth-brand,
  .auth-dock.form-pane,
  .auth-frame,
  .auth-scan,
  .auth-signal-dot,
  .auth-form.auth-form-enter,
  .auth-form.auth-form-enter > *,
  .auth-form.is-leave {
    animation: none !important;
    transition: none !important;
  }

  .auth-body.is-auth-swap {
    transition: none !important;
  }

  .auth-brand,
  .auth-scan,
  .auth-signal-dot {
    opacity: 1 !important;
  }
}

@media (prefers-reduced-motion: reduce) and (min-width: 861px) {
  .auth-brand {
    transform: translateY(-50%) !important;
  }

  .auth-dock.form-pane {
    transform: translateY(-50%) !important;
  }
}

.proposal-why {
  color: color-mix(in srgb, var(--ink) 62%, var(--mute));
  font-size: 0.84rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.proposal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Shield chips — Quiet Orbit compact family (same language as Access shields) */
.proposal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.2;
  padding: 5px;
  border: 1px solid rgba(142, 180, 200, 0.22);
  border-radius: 4px;
  color: var(--mute);
  background: transparent;
  box-sizing: border-box;
}

.proposal-chip-risk {
  color: var(--risk);
  border-color: color-mix(in srgb, var(--risk) 45%, var(--line));
  background: transparent;
}

.proposal-chip-mutate,
.proposal-chip.is-mutate {
  color: var(--mutate);
  border-color: var(--mutate);
  background: transparent;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.proposal-actions,
.decision-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.proposal-actions .btn,
.decision-actions .btn {
  position: relative;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.decision-actions .proposal-accept {
  min-width: 96px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Нет / Корректировка — solid chip chrome (not ghost text over report) */
.decision-actions .btn.secondary,
.decision-actions .proposal-reject,
.decision-actions .proposal-correct,
.decision-apply.btn.secondary {
  color: var(--ink);
  border: 1px solid rgba(244, 242, 247, 0.22);
  background: rgba(22, 20, 32, 0.92);
  box-shadow: inset 0 1px 0 rgba(244, 242, 247, 0.06);
}

.decision-actions .btn.secondary:hover,
.decision-actions .proposal-correct:hover,
.decision-apply.btn.secondary:hover {
  color: var(--ink);
  border-color: rgba(142, 180, 200, 0.4);
  background: rgba(36, 32, 52, 0.98);
}

/* Reject stays glanceable even while Да is busy / disabled */
.decision-actions .proposal-reject:disabled,
.decision-actions .proposal-reject.is-locked,
.decision-actions .btn.secondary.proposal-reject:disabled {
  opacity: 0.72;
  color: var(--mute);
  border-color: rgba(244, 242, 247, 0.28);
  background: rgba(22, 20, 32, 0.75);
  cursor: default;
}

/* Inline mutate confirm — stitched into Decision Card glass (not modal) */
.decision-mutate-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--mutate) 35%, var(--line));
}

.decision-mutate-confirm .directive-kicker {
  color: var(--mutate-soft);
}

.decision-mutate-confirm-msg {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: color-mix(in srgb, var(--ink) 78%, var(--mutate-soft));
}

.decision-card.is-mutate-confirm {
  border-color: color-mix(in srgb, var(--mutate) 42%, var(--line2));
}

.decision-card[data-decision-mutate="1"].is-orbit-hero {
  border-color: color-mix(in srgb, var(--mutate) 42%, var(--line2));
  box-shadow:
    inset 0 1px 0 rgba(244, 242, 247, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 0 0 1px color-mix(in srgb, var(--mutate) 18%, transparent),
    0 18px 48px rgba(0, 0, 0, 0.28);
}

.decision-card[data-decision-risk="llm"].is-orbit-hero,
.decision-card[data-decision-risk="stand"].is-orbit-hero {
  border-color: color-mix(in srgb, var(--risk) 38%, var(--line2));
}

@media (max-width: 720px) {
  .orbit-status-meta {
    flex-wrap: wrap;
  }

  .orbit-status-meta-end {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .orbit-notice {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Actions stay in-card (same glass) — no sticky floating overlay over verdict */
  .decision-card.is-orbit-hero .decision-actions,
  .decision-card.is-accepting .decision-actions,
  .decision-card.is-mutate-confirm .decision-actions,
  .decision-card.is-correcting .decision-actions {
    position: static;
    z-index: auto;
    margin: 2px 0 0;
    padding: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .decision-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .decision-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 12px 10px;
    font-size: 0.95rem;
  }

  .decision-actions .proposal-accept,
  .decision-actions .proposal-reject {
    flex: 1 1 calc(50% - 6px);
    min-width: 5.5rem;
  }

  .decision-actions .proposal-correct {
    flex: 1 1 100%;
  }

  .orbit-work.is-work {
    font-weight: 700;
  }
}

.decision-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(142, 180, 200, 0.16);
}

.decision-card.is-correcting .decision-edit {
  border-top-color: rgba(142, 180, 200, 0.28);
}

.decision-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--mute);
}

.decision-field input,
.decision-field select {
  margin-bottom: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
}

.decision-field input:focus,
.decision-field select:focus {
  outline: none;
  border-color: rgba(142, 180, 200, 0.4);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.decision-field.check,
.decision-edit .orbit-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--mute);
}

.decision-apply {
  grid-column: 1 / -1;
  justify-self: start;
}

.power-path {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.power-path > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

.power-path.orbit-ext > summary {
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(142, 180, 200, 0.75);
}

.power-path.orbit-ext {
  border-top: none;
  margin-top: 10px;
  padding-top: 0;
}

.power-path > summary::-webkit-details-marker {
  display: none;
}

.power-path > summary::after {
  content: " ▾";
  opacity: 0.7;
}

.power-path[open] > summary::after {
  content: " ▴";
}

.power-path-panel {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .topbar .brand.is-working,
  .btn.is-working,
  #intel.is-working,
  #intel.is-working::before,
  .run-status.is-active::before {
    animation: none;
  }

  #intel.is-working {
    border-color: var(--accent);
  }

  #intel.is-working::before,
  #intel.is-working::after {
    display: none;
  }
}

.muted {
  color: var(--mute);
}

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

/* —— App shell —— */
.shell {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 18px 48px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-bottom: max(48px, env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  animation: view-in 0.32s ease both;
  min-width: 0;
  box-sizing: border-box;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: wrap;
}

.topbar .brand {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1;
  animation: none;
  transform-origin: left bottom;
  transition: filter var(--t-in) var(--ease-out);
}

.brand span {
  color: var(--ba);
}

.product-version {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.85;
  user-select: none;
  transform: translateY(-1px);
}

.topbar .product-version {
  color: rgba(142, 180, 200, 0.72);
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-row .product-version {
  color: rgba(142, 180, 200, 0.7);
}

.topbar .brand.is-working {
  opacity: 0.92;
}

.topbar-nav {
  gap: 6px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.topbar-nav .btn.secondary {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
}

.topbar-nav .nav-tab.is-active {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line2));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 2px;
  padding: 5px 10px 5px 8px;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

.session-chip-text {
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
  }

  .topbar-nav {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
  }

  .session-chip {
    flex: 1 1 100%;
  }
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--mute);
  box-shadow: none;
}

.status-dot.is-ok {
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(93, 206, 154, 0.12), 0 0 8px rgba(93, 206, 154, 0.45);
}

.status-dot.is-busy {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(142, 180, 200, 0.14);
}

.status-dot.is-bad {
  background: var(--fail);
  box-shadow: 0 0 0 2px rgba(224, 122, 122, 0.14), 0 0 8px rgba(224, 122, 122, 0.4);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ok);
  border: 1px solid rgba(93, 206, 154, 0.35);
  background: rgba(93, 206, 154, 0.08);
  padding: 5px 8px;
  border-radius: var(--r, 10px);
}

.pill.ok {
  color: var(--ok);
  border-color: rgba(93, 206, 154, 0.35);
}

.pill.bad {
  color: var(--fail);
  border-color: rgba(240, 113, 120, 0.4);
  background: rgba(240, 113, 120, 0.08);
}

.pill.busy {
  color: var(--accent);
  border-color: rgba(142, 180, 200, 0.4);
  background: rgba(142, 180, 200, 0.1);
  animation: busy-pulse 1s steps(2) infinite;
}

.grid-2 {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 10px;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.panel {
  border: 1px solid var(--line2);
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px;
}

.panel + .panel {
  margin-top: 10px;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}

.checks {
  display: flex;
  gap: 12px;
  margin: 4px 0 12px;
  flex-wrap: wrap;
}

.checks label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.checks input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
}

.list li:hover,
.list li.on {
  background: var(--base);
  border-color: var(--line2);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 10px;
  padding: 4px;
  background: var(--base);
  border-radius: 10px;
}

.tabs button {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  color: var(--mute);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tabs button.active {
  background: var(--elev);
  color: var(--ink);
}

pre,
.report {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  line-height: 1.6;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  animation: view-in 0.25s ease both;
}

.summary {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  line-height: 1.55;
}

.step {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
  animation: step-in 0.35s ease both;
}

.step .id {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step .msg {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--mute);
  font-size: 12px;
  line-height: 1.45;
}

.step .status-ok,
.step .status-fail {
  white-space: nowrap;
  padding-top: 1px;
}

.step:nth-child(1) {
  animation-delay: 0.05s;
}
.step:nth-child(2) {
  animation-delay: 0.1s;
}
.step:nth-child(3) {
  animation-delay: 0.15s;
}
.step:nth-child(4) {
  animation-delay: 0.2s;
}
.step:nth-child(5) {
  animation-delay: 0.25s;
}

.step:last-child {
  border-bottom: none;
}

.id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

.status-ok {
  color: var(--ok);
  font-family: var(--mono);
  font-size: 11px;
}

.status-fail {
  color: var(--fail);
  font-family: var(--mono);
  font-size: 11px;
}

.code {
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: 0.08em;
}

/* —— Access Orbit (owner) —— same shell width as topbar / Conductor */
.access-orbit-root {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0 0 24px;
  min-width: 0;
}

.access-orbit {
  gap: 0;
  /* Compact control family — shield-adjacent, shared by Access actions */
  --access-ctl-pad-y: 5px;
  --access-ctl-pad-x: 10px;
  --access-ctl-radius: 4px;
  /* Collapsed user ribbon — owner footprint is the size ceiling */
  --access-user-row-h: 28px;
}

.access-lead {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--mute);
  letter-spacing: -0.01em;
}

.access-section {
  padding: 16px 0;
  border-top: 1px solid rgba(142, 180, 200, 0.1);
}

.access-section:first-of-type {
  border-top: none;
  padding-top: 8px;
}

.access-section h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.access-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.access-section-head h3 {
  margin: 0;
}

#task-qa-panel #task-qa-tracker {
  margin: 0.35rem 0 0.6rem;
}

#task-qa-panel .task-qa-executor-filter-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: 0 0 0.45rem;
}

#task-qa-panel .task-qa-executor-filter {
  min-height: 44px;
  min-width: 10rem;
  max-width: 100%;
  background: color-mix(in srgb, var(--panel, #1a2229) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink, #c8d0d8) 18%, transparent);
  color: inherit;
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
}

#task-qa-panel #task-qa-executor-rollup {
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

#task-qa-panel .task-qa-recent {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  max-height: 9.5rem;
  overflow: auto;
}

#task-qa-panel .task-qa-recent-item {
  margin: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink, #c8d0d8) 12%, transparent);
}

#task-qa-panel .task-qa-recent-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 0.4rem 0.15rem;
  cursor: pointer;
  min-height: 44px;
}

#task-qa-panel .task-qa-recent-item.is-selected .task-qa-recent-btn {
  color: var(--accent, #8eb4c8);
}

#task-qa-panel #task-qa-status {
  margin: 0 0 0.4rem;
}

#task-qa-panel .task-qa-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 12px;
}

#task-qa-panel .task-qa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

#task-qa-panel #task-qa-confirm {
  margin-top: 10px;
}

#task-qa-panel .task-qa-draft {
  margin: 0;
  padding: 10px 12px;
  max-height: min(28vh, 220px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

#task-qa-panel .task-qa-journal-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  max-height: min(22vh, 180px);
  overflow: auto;
  font-size: 11px;
  color: var(--mute);
}

#task-qa-panel .task-qa-journal-list li {
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}

#task-qa-panel .task-qa-journal-list li:last-child {
  border-bottom: none;
}

.access-label {
  display: block;
  font-size: 12px;
  color: var(--mute);
  margin: 0 0 8px;
  font-weight: 500;
}

/* Invite label — proper Quiet Orbit field (shield radius/type, not a fake chip) */
.invite-label-input {
  display: block;
  width: 100%;
  max-width: 28ch;
  margin: 0;
  box-sizing: border-box;
  padding: var(--access-ctl-pad-y, 5px) var(--access-ctl-pad-x, 10px);
  border: 1px solid rgba(142, 180, 200, 0.22);
  border-radius: var(--access-ctl-radius, 4px);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.2;
  appearance: none;
}

.invite-label-input::placeholder {
  color: var(--mute);
  opacity: 0.75;
}

.invite-label-input:focus {
  outline: none;
  border-color: rgba(142, 180, 200, 0.5);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.12);
  background: rgba(0, 0, 0, 0.28);
}

/* Access Orbit buttons — one compact family (shield-adjacent padding/radius) */
.access-orbit .btn.accent,
.access-orbit #mk {
  width: auto;
  margin-top: 4px;
  padding: var(--access-ctl-pad-y, 5px) var(--access-ctl-pad-x, 10px);
  border-radius: var(--access-ctl-radius, 4px);
  font-size: 12px;
  line-height: 1.2;
}

.access-orbit .btn.secondary,
.access-orbit .btn.tiny-ok {
  padding: var(--access-ctl-pad-y, 5px) var(--access-ctl-pad-x, 10px);
  border-radius: var(--access-ctl-radius, 4px);
  font: 500 11px/1.2 var(--font);
}

.access-orbit .btn.tiny,
.access-orbit button.tiny {
  padding: var(--access-ctl-pad-y, 5px) var(--access-ctl-pad-x, 10px);
  border-radius: var(--access-ctl-radius, 4px);
  font-size: 11px;
  line-height: 1.2;
}

.access-orbit .access-section-head .btn {
  flex-shrink: 0;
}

.access-table-wrap,
.access-invite-list {
  overflow: auto;
  max-height: min(42vh, 320px);
  max-height: min(42dvh, 320px);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(142, 180, 200, 0.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 180, 200, 0.35) rgba(0, 0, 0, 0.2);
}

.access-invite-list {
  padding: 5px;
}

.access-table-wrap::-webkit-scrollbar,
.access-invite-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.access-table-wrap::-webkit-scrollbar-track,
.access-invite-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0 12px 12px 0;
  margin: 4px 0;
}

.access-table-wrap::-webkit-scrollbar-thumb,
.access-invite-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.access-table-wrap::-webkit-scrollbar-thumb:hover,
.access-invite-list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  background-clip: padding-box;
}

.access-table-wrap::-webkit-scrollbar-corner,
.access-invite-list::-webkit-scrollbar-corner {
  background: transparent;
}

.invite-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.invite-card {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(142, 180, 200, 0.12);
  background: rgba(0, 0, 0, 0.16);
}

.invite-card.is-revoking {
  border-color: rgba(240, 113, 120, 0.35);
  background: rgba(240, 113, 120, 0.06);
}

.invite-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.invite-uses {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
}

.invite-card-label {
  margin: 4px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.invite-card-meta {
  margin: 5px 0 0;
  display: grid;
  gap: 4px;
}

.invite-meta-row {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 3px 8px;
  align-items: start;
  min-width: 0;
}

.invite-meta-row dt {
  margin: 0;
  padding-top: 1px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.invite-meta-row dd {
  margin: 0;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--mute);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.invite-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(142, 180, 200, 0.1);
}

.invite-key-btn {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(142, 180, 200, 0.22);
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.invite-key-btn:hover {
  color: var(--ink);
  border-color: rgba(142, 180, 200, 0.4);
}

.invite-key-btn:focus-visible {
  outline: none;
  border-color: rgba(142, 180, 200, 0.55);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.12);
}

.invite-key-btn[hidden] {
  display: none;
}

.invite-key-btn.is-copied {
  color: var(--accent);
  border-color: rgba(142, 180, 200, 0.42);
  background: rgba(142, 180, 200, 0.08);
}

.invite-copied-toast {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(142, 180, 200, 0.28);
  background: rgba(12, 18, 24, 0.92);
  color: var(--ink);
  font: 500 10px/1.2 var(--font);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 2;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.invite-key-btn.is-copied .invite-copied-toast {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .invite-copied-toast {
    transition: none;
    transform: translateX(-50%);
  }

  .invite-key-btn.is-copied .invite-copied-toast {
    transform: translateX(-50%);
  }
}

.invite-feats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  white-space: normal;
}

.invite-feat {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 4px;
  border-radius: 4px;
  border: 1px solid rgba(142, 180, 200, 0.22);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--mute);
  vertical-align: middle;
  line-height: 1.15;
}

.invite-feat.is-mutate {
  color: var(--mutate);
  border-color: var(--mutate);
}

.invite-feat.is-intel {
  color: var(--intel);
  border-color: var(--intel);
}

.invite-feat.is-analyze {
  color: var(--analyze);
  border-color: var(--analyze);
}

.invite-feat.is-profile {
  color: var(--access-profile);
  border-color: var(--access-profile);
}

.invite-revoke-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.invite-revoke-confirm[hidden] {
  display: none;
}

.invite-revoke-msg {
  font-size: 10px;
  color: var(--fail);
  letter-spacing: 0.04em;
}

#inv-err {
  margin-top: 8px;
}

.access-users {
  display: grid;
  gap: 5px;
}

.access-orbit .user-card,
.user-card.access-user {
  border: 1px solid rgba(142, 180, 200, 0.12);
  border-radius: 8px;
  padding: 5px 8px;
  margin-bottom: 0;
  background: rgba(0, 0, 0, 0.16);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.access-orbit .user-card.is-owner,
.access-orbit .user-card.access-user:not(.is-open) {
  /* collapsed: same box rhythm; gear must not inflate past owner */
  min-height: calc(var(--access-user-row-h) + 10px);
}

.access-orbit .user-card.is-open,
.user-card.access-user.is-open {
  border-color: rgba(142, 180, 200, 0.28);
  background: rgba(0, 0, 0, 0.2);
}

.access-orbit .user-card.is-dirty,
.user-card.access-user.is-dirty {
  border-color: rgba(142, 180, 200, 0.45);
}

.access-orbit .user-card.is-dirty [data-act="save"]:not(:disabled),
.user-card.access-user.is-dirty [data-act="save"]:not(:disabled) {
  color: var(--ink);
  border-color: rgba(142, 180, 200, 0.55);
}

.access-orbit .user-card.is-dirty .user-gear-btn,
.user-card.access-user.is-dirty .user-gear-btn {
  color: var(--accent);
}

.user-del-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(240, 113, 120, 0.08);
  border: 1px solid rgba(240, 113, 120, 0.28);
}

.user-del-confirm[hidden] {
  display: none;
}

.user-del-msg {
  flex: 1;
  min-width: 8rem;
  font-size: 11px;
  color: var(--fail);
}

.access-orbit .user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  border-radius: 0;
  min-height: var(--access-user-row-h);
  height: var(--access-user-row-h);
  max-height: var(--access-user-row-h);
  box-sizing: border-box;
}

.access-orbit .user-row .user-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.access-orbit .user-row-trail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Role as Quiet Orbit shield chip — sand for owner, mute for operator */
.access-orbit .user-row .role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid rgba(142, 180, 200, 0.22);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--mute);
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-orbit .user-card.is-owner .role {
  color: var(--access-profile);
  border-color: var(--access-profile);
}

@keyframes user-gear-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Frameless gear — height matches operator role shield chip */
.user-gear-btn {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  transition: color 0.22s ease;
}

.user-gear-btn:hover {
  color: var(--ink);
}

.user-gear-btn:focus-visible {
  outline: none;
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.12);
  border-radius: 4px;
}

.user-card.is-open .user-gear-btn {
  color: var(--ok);
}

.user-gear-ico {
  display: block;
  /* Match operator `.role` shield outer height (~1+3+11.5+3+1) */
  width: 20px;
  height: 20px;
  transform-origin: 50% 50%;
  transition: color 0.22s ease;
}

.user-card.is-open .user-gear-ico {
  animation: user-gear-spin 0.85s linear infinite;
}

.user-key-ico {
  display: block;
}

.user-access-panel,
.user-access-menu {
  overflow: hidden;
  transition: height 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-access-panel[hidden],
.user-access-menu[hidden] {
  display: none;
}

.user-access-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 2px 2px;
  transform-origin: top center;
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-access-inner.is-leave {
  opacity: 0;
  transform: translateY(-8px) scaleY(0.96);
  pointer-events: none;
}

.user-access-inner.user-access-enter {
  transition: none;
  animation: auth-form-unfold 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.user-access-inner.user-access-enter.is-expand {
  animation-name: auth-form-unfold-deep;
  animation-duration: 0.46s;
}

.user-access-inner.user-access-enter > * {
  animation: auth-field-unfold 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.user-access-inner.user-access-enter.is-expand > * {
  animation-duration: 0.42s;
}

.user-access-inner.user-access-enter > *:nth-child(1) {
  animation-delay: 0.04s;
}

.user-access-inner.user-access-enter > *:nth-child(2) {
  animation-delay: 0.09s;
}

.user-access-inner.user-access-enter > *:nth-child(3) {
  animation-delay: 0.14s;
}

.user-access-inner.user-access-enter > *:nth-child(4) {
  animation-delay: 0.19s;
}

.user-access-inner.user-access-enter > *:nth-child(5) {
  animation-delay: 0.24s;
}

/* Access chips — rectangular frames; click whole chip to toggle */
.access-chip-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}

.user-access-inner .access-chip-block {
  margin: 0;
}

.access-chip-heading {
  display: block;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}

.access-chip-row,
.access-chip-row.feat-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Compact badges/shields — frame shrink-wraps to label; padding is fixed */
.access-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  margin: 0;
  min-width: 0;
  min-height: 0;
  padding: 5px; /* locked equal inset — do not use padding to size the frame */
  box-sizing: border-box;
  border-radius: 4px;
  border: 1px solid rgba(142, 180, 200, 0.22);
  background: transparent;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.16s var(--ease-out);
}

.access-chip:hover {
  color: var(--ink);
  border-color: rgba(142, 180, 200, 0.4);
}

.access-chip:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.12);
}

.access-chip-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.access-chip-text {
  pointer-events: none;
}

.access-chip:has(.access-chip-input:checked) {
  color: var(--access-profile);
  border-color: var(--access-profile);
  background: transparent;
}

.access-chip.is-analyze:has(.access-chip-input:checked) {
  color: var(--analyze);
  border-color: var(--analyze);
  background: transparent;
}

.access-chip.is-intel:has(.access-chip-input:checked) {
  color: var(--intel);
  border-color: var(--intel);
  background: transparent;
}

.access-chip.is-mutate:has(.access-chip-input:checked) {
  color: var(--mutate);
  border-color: var(--mutate);
  background: transparent;
}

/* Profiles: Quiet Orbit sand, distinct from feature kinds */
.access-chip.is-profile:has(.access-chip-input:checked) {
  color: var(--access-profile);
  border-color: var(--access-profile);
  background: transparent;
}

.access-chip.is-analyze:has(.access-chip-input:checked) .access-chip-text,
.access-chip.is-intel:has(.access-chip-input:checked) .access-chip-text,
.access-chip.is-mutate:has(.access-chip-input:checked) .access-chip-text,
.access-chip.is-profile:has(.access-chip-input:checked) .access-chip-text {
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .user-access-panel,
  .user-access-menu {
    transition: none;
  }

  .user-gear-btn,
  .user-card.is-open .user-gear-btn {
    transition: none;
  }

  .user-card.is-open .user-gear-ico {
    animation: none;
  }

  .access-chip {
    transition: none;
  }

  .user-access-inner,
  .user-access-inner.user-access-enter,
  .user-access-inner.user-access-enter.is-expand,
  .user-access-inner.user-access-enter > * {
    animation: none !important;
    transition: none;
  }
}

.user-fold {
  margin: 0 0 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(142, 180, 200, 0.08);
}

.user-fold > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  user-select: none;
}

.user-fold > summary::-webkit-details-marker {
  display: none;
}

.user-fold > summary::after {
  content: "▾";
  flex-shrink: 0;
  font-size: 10px;
  color: var(--mute);
  opacity: 0.8;
}

.user-fold[open] > summary::after {
  content: "▴";
}

.user-fold > summary:hover .user-fold-label {
  color: var(--ink);
}

.user-fold-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--mute);
  flex-shrink: 0;
}

.user-fold-sum {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 11px;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-fold .checks,
.user-fold .feat-checks {
  padding: 0 10px 10px;
}

.access-block-fold {
  margin: 0;
  background: transparent;
  border: none;
}

.access-block-fold > summary {
  padding: 0 0 10px;
  align-items: center;
}

.access-block-fold > summary .user-fold-label {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.access-block-fold .access-table-wrap,
.access-block-fold .access-invite-list {
  margin-top: 4px;
}

.access-block-fold .agent-status {
  margin-top: 8px;
}

.access-orbit .checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.access-orbit .budget-row input {
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  padding: 8px 10px;
  font-family: var(--mono);
}

.access-orbit .budget-row input:focus {
  outline: none;
  border-color: rgba(142, 180, 200, 0.4);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.1);
}

.access-orbit .bar-track {
  background: rgba(0, 0, 0, 0.34);
}

.access-empty {
  margin: 6px 8px 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.invite-card-head .invite-card-label {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.btn.tiny,
button.tiny {
  border: 1px solid rgba(240, 113, 120, 0.4);
  color: var(--fail);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  width: auto;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--base);
  margin-bottom: 8px;
}

.user-profiles {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ba);
  flex-shrink: 0;
}

.profile-pick {
  margin: 12px 0 14px;
}

.profile-pick > label {
  display: block;
  margin-bottom: 8px;
}

.profile-pick .checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.profile-pick .check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.profile-pick .check input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.lead {
  color: var(--mute);
  margin: 0 0 16px;
  max-width: 28rem;
}

.flex-row {
  display: flex;
  gap: 8px;
}

.flex-row > * {
  flex: 1;
}

.console-root {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

/* Console / Load: Agent Frame only — Live/Result/EXT stashed off-screen.
   Same content width as .topbar / .shell (1120px), not a narrower column. */
.agent-only-root {
  max-width: 100%;
  width: 100%;
  margin: 0;
  position: relative;
  min-width: 0;
}

.agent-only-root > .agent-frame,
.agent-only-root > .live-home {
  width: 100%;
  min-width: 0;
}

.agent-only-frame,
.agent-only-window {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.agent-only-root .run-status:empty {
  display: none;
}

/* Power stash: out of flow + a11y-inert via JS; CSS must not rely on [hidden] alone */
.agent-power-stash,
.agent-power-stash[hidden] {
  display: none !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  content-visibility: hidden;
}

/* Live strip home (collapsed when empty) */
.live-home:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
}

/* Quiet Orbit: Live strip stays in layout; cards only when expanded */
.live-bg {
  margin-bottom: 4px;
}

.live-wrap {
  margin-top: 0;
}

.live-console {
  border: 1px solid rgba(244, 242, 247, 0.1);
  border-radius: 12px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.14);
}

.live-console.live-enter {
  animation: view-in var(--t-in) var(--ease-out) both;
}

.live-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 28px;
}

.live-strip-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  min-width: 0;
  margin: 0;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.live-strip-main:hover .live-strip-kicker {
  color: rgba(142, 180, 200, 0.95);
}

.live-strip-kicker {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(142, 180, 200, 0.85);
}

.live-strip #live-meta,
.live-strip .live-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 11px;
  min-width: 0;
}

.live-strip-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--mute);
  transition: transform 0.15s ease;
}

.live-console:not(.is-collapsed) .live-strip-caret {
  transform: rotate(180deg);
  border-top-color: rgba(142, 180, 200, 0.9);
}

.live-expand {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(244, 242, 247, 0.08);
}

.live-expand[hidden] {
  display: none !important;
}

.live-console.is-collapsed .live-expand {
  display: none !important;
}

/* Legacy title class kept for contract / empty states */
.live-section-title {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.live-stat {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--r, 10px);
  border: 1px solid rgba(158, 151, 176, 0.28);
  background: rgba(158, 151, 176, 0.06);
  color: var(--mute);
  line-height: 1.3;
}

.live-stat.is-ok {
  color: var(--ok);
  border-color: rgba(93, 206, 154, 0.35);
  background: rgba(93, 206, 154, 0.08);
}

.live-stat.is-bad {
  color: var(--fail);
  border-color: rgba(224, 122, 122, 0.4);
  background: rgba(224, 122, 122, 0.08);
}

.live-interval {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  max-width: 100%;
}

.live-interval-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}

.live-interval-seg {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(142, 180, 200, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}

.live-interval-btn {
  margin: 0;
  border: none;
  border-right: 1px solid rgba(142, 180, 200, 0.22);
  background: transparent;
  color: var(--mute);
  font: 500 11px/1 var(--mono);
  padding: 5px 7px;
  cursor: pointer;
  min-width: 1.75rem;
  transition: color var(--t-fast) ease, background var(--t-fast) ease;
}

.live-interval-btn:last-child {
  border-right: none;
}

.live-interval-btn:hover {
  color: var(--accent);
  background: rgba(142, 180, 200, 0.08);
}

.live-interval-btn.is-active {
  color: var(--accent);
  background: rgba(142, 180, 200, 0.14);
}

/* Wide: 3-tile Live grid for all profiles (apps + targets share one board) */
.live-board-legend {
  margin: 2px 0 4px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.live-section-title {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 600;
}

.live-target-meta {
  margin: 0 0 4px;
  font-size: 10px;
  flex: 0 0 auto;
}

.live-grid {
  display: contents;
}

.live-card {
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.live-card .live-head {
  flex: 0 0 auto;
}

.live-card .live-metrics-row,
.live-card > .live-metric {
  flex: 1 1 auto;
}

.live-grid > [data-live-empty] {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 720px) {
  .live-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 419px) {
  .live-board {
    grid-template-columns: 1fr;
  }
}

.live-card.live-card-enter {
  animation: view-in var(--t-in) var(--ease-out) both;
}

.live-card.live-card-enter:nth-child(2) {
  animation-delay: 40ms;
}

.live-card.live-card-enter:nth-child(3) {
  animation-delay: 80ms;
}

.live-card.live-bad {
  border-color: color-mix(in srgb, var(--fail) 55%, var(--line));
}

.live-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.live-head .pill {
  font-size: 10px;
  padding: 1px 6px;
}

.live-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.live-metric {
  margin-top: 0;
  min-width: 0;
}

.live-metric-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  color: var(--mute);
  margin-bottom: 2px;
}

.live-metric-top .mono {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: opacity var(--t-num) var(--ease-out);
}

.live-metric-top .mono.num-tick {
  opacity: 0.55;
}

.spark {
  width: 100%;
  height: 22px;
  display: block;
  color: var(--mute);
}

.spark polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* —— Load controls (modals + Conductor power stash; no peer Load face) —— */

/* One-line selected etalon — modal is the full selector */
.load-preset-summary {
  margin: 10px 0 0;
  padding: 0;
  border: none;
  background: transparent;
}

.load-preset-summary > .muted {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#load-preset-summary-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.load-advanced {
  margin-top: 12px;
  border: none;
}

.load-advanced > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

.load-advanced > summary::-webkit-details-marker {
  display: none;
}

.load-advanced > summary::after {
  content: " ▾";
  opacity: 0.7;
}

.load-advanced[open] > summary::after {
  content: " ▴";
}

.load-advanced > summary:hover {
  color: var(--ink);
}

.load-plan-vu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 8px;
}

.load-plan-vu-row label {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.load-plan-vu-row input[type="number"] {
  width: 100%;
  margin-bottom: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
}

.load-plan-vu-row input[type="number"]:focus {
  outline: none;
  border-color: rgba(142, 180, 200, 0.4);
  box-shadow: 0 0 0 3px rgba(142, 180, 200, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.intel-preset.is-k6:has(input:checked) {
  border-color: color-mix(in srgb, var(--k6) 50%, var(--line));
  background: color-mix(in srgb, var(--k6) 8%, transparent);
}

.intel-preset.is-k6 .intel-preset-badge {
  color: var(--k6);
  border-color: color-mix(in srgb, var(--k6) 45%, var(--line));
}

#load-plan-analyze-wrap {
  margin-top: 8px;
}

.load-vu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.load-vu-row input[type="number"] {
  margin-bottom: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#load-math {
  margin: 8px 0 0;
  font-size: 11px;
}

.load-actions {
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.load-run-btn {
  flex: 1 1 180px;
  min-height: 40px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.load-k6 {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--base) 80%, transparent);
  font-size: 11px;
  white-space: pre-wrap;
  color: var(--mute);
  max-height: 100px;
  overflow: auto;
}


/* —— Intel plan confirm modal —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 18, 32, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  animation: view-in var(--t-fast) var(--ease-out) both;
}

.modal-window {
  width: min(520px, 100%);
  max-height: min(86vh, 720px);
  max-height: min(86dvh, 720px);
  overflow: auto;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px 18px 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  animation: view-in var(--t-in) var(--ease-out) both;
}

.modal-window-wide {
  width: min(560px, 100%);
}

.modal-head h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin: 0 0 12px;
  font-size: 11px;
}

.modal-body label {
  display: block;
  margin: 10px 0 4px;
  font-size: 11px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-body textarea,
.modal-body input[type="text"] {
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--base);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  resize: vertical;
}

.intel-recommend {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(142, 180, 200, 0.28);
  background: rgba(142, 180, 200, 0.08);
}

.intel-recommend-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.intel-recommend-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.intel-recommend-list li + li {
  margin-top: 4px;
}

.intel-ai-note {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--mute);
  line-height: 1.4;
}

.intel-preset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intel-preset {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--base) 72%, transparent);
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--ink) !important;
  font-size: 13px !important;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease;
}

.intel-preset:hover {
  border-color: var(--line2);
}

.intel-preset:has(input:checked) {
  border-color: rgba(142, 180, 200, 0.55);
  background: rgba(142, 180, 200, 0.1);
}

.intel-preset.is-recommended:has(input:checked),
.intel-preset.is-recommended {
  border-color: rgba(142, 180, 200, 0.35);
}

.intel-preset input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.intel-preset-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.intel-preset-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.intel-preset-title {
  font-weight: 700;
  font-size: 13px;
}

.intel-preset-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  border: 1px solid rgba(142, 180, 200, 0.35);
  border-radius: var(--r, 10px);
  padding: 2px 7px;
}

.intel-preset-suites {
  font-size: 11px;
  color: var(--mute);
}

.intel-preset-blurb {
  font-size: 12px;
  color: var(--ink);
  opacity: 0.88;
  line-height: 1.4;
}

.intel-preset.is-mutate:has(input:checked) {
  border-color: color-mix(in srgb, var(--mutate) 55%, var(--line));
  background: color-mix(in srgb, var(--mutate) 8%, transparent);
}

.intel-preset.is-mutate .intel-preset-badge {
  color: var(--mutate);
  border-color: color-mix(in srgb, var(--mutate) 45%, var(--line));
}

.intel-mutate-gate {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--mutate) 45%, var(--line));
  background: color-mix(in srgb, var(--mutate) 10%, transparent);
}

.intel-mutate-warn {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--mutate-soft);
}

.intel-mutate-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
  color: var(--ink) !important;
  cursor: pointer;
}

.intel-mutate-check input {
  accent-color: var(--mutate);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.modal-confirm-msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

.btn.is-danger,
.modal-actions .btn.is-danger,
.decision-actions .btn.is-danger {
  background: color-mix(in srgb, var(--mutate) 78%, var(--ink));
  color: var(--base);
  border-color: color-mix(in srgb, var(--mutate) 55%, var(--line));
}

.btn.is-danger:hover,
.decision-actions .btn.is-danger:hover {
  background: color-mix(in srgb, var(--mutate) 88%, var(--ink));
}

/* —— Quiet Orbit Mobile Pass (TZ_UIDEV_MOBILE M1–M3 / S1 / S5 / S7) —— */
/* —— Quiet Orbit Mobile 10 (TZ_UIDEV_MOBILE_10 C1–C5) —— */

@media (max-width: 860px) {
  /* M1: no zoom-on-focus (iOS/Android) */
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select:not(.orbit-profile),
  textarea,
  .orbit-field input,
  .access-orbit .orbit-field input,
  .auth-orbit input,
  .agent-panel textarea,
  .decision-field input,
  .decision-field select,
  .modal-body input[type="text"],
  .modal-body input[type="number"],
  .modal-body textarea,
  .modal-body select,
  .load-plan-vu-row input[type="number"],
  .load-vu-row input[type="number"],
  .budget-row input {
    font-size: 16px !important;
  }
}

@media (max-width: 720px) {
  /* M2: critical chrome hit ≥44px */
  .orbit-pwr {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  button.orbit-profile {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    box-sizing: border-box;
  }

  #agent-send,
  .agent-actions .btn {
    min-height: 44px;
    padding-top: 12px;
    padding-bottom: 12px;
    box-sizing: border-box;
  }

  .topbar-nav .btn,
  .topbar-nav .btn.secondary,
  .topbar-nav .nav-tab {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
    box-sizing: border-box;
  }

  .auth-seg button {
    min-height: 44px;
    padding: 12px 10px;
    box-sizing: border-box;
  }

  .decision-actions .btn {
    min-height: 44px;
  }

  /* S-a: auth primary CTA */
  .auth-cta {
    min-height: 44px;
    box-sizing: border-box;
  }

  /* S5: ORBIT LOG readable on phone */
  .orbit-log-line {
    flex-wrap: wrap;
  }

  .orbit-log-time,
  .orbit-log-line .k {
    flex: 0 0 auto;
  }

  .orbit-log-msg {
    flex: 1 1 100%;
    min-width: 0;
  }

  /* C3: Analyze touch */
  .analyze-drawer-close {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .analyze-drawer-tabs .tabs button,
  .analyze-orbit-drawer .tabs button {
    min-height: 44px;
    padding: 12px 8px;
    font-size: 12px;
    box-sizing: border-box;
  }

  .analyze-drawer-hist-btn {
    min-height: 44px;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  /* C5a: Analyze sheet — opaque so Decision/Orbit chrome cannot bleed through */
  .analyze-orbit-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    isolation: isolate;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: min(88vh, 100%);
    max-height: min(88dvh, 100%);
    overflow: auto;
    border-radius: 16px 16px 0 0;
    border: 1px solid rgba(142, 180, 200, 0.22);
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    background:
      linear-gradient(
        165deg,
        #302a44 0%,
        #241f34 52%,
        #1c1828 100%
      );
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
  }

  /* Full-viewport scrim behind sheet — blocks Да/Нет/ORBIT LOG under report */
  .analyze-orbit-drawer:not([hidden])::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(12, 10, 18, 0.78);
    pointer-events: auto;
  }

  .analyze-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #241f34;
    padding: 4px 0 8px;
    margin: 0;
  }

  .analyze-drawer-tabs {
    position: relative;
    z-index: 1;
    background: #241f34;
  }

  .analyze-drawer-body {
    position: relative;
    z-index: 0;
    background: rgba(0, 0, 0, 0.35);
  }

  /* C4: Access invites cards (always cards; touch on phone) */
  .access-invite-list {
    overflow-x: visible;
    max-height: none;
  }

  .invite-meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .invite-card-actions .tiny,
  .invite-card-actions .tiny-ok,
  .invite-card-actions .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  /* Gear: visual matches role chip; 44px via invisible hit extender (no frame) */
  .user-gear-btn {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
  }

  .invite-key-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
  }

  .user-gear-btn::before,
  .invite-key-btn::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    transform: translate(-50%, -50%);
  }

  /* Access primary CTAs — compact desktop padding, phone hit ≥44px */
  .access-orbit #mk,
  .access-orbit #llm-refresh {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  /* Touch ≥44px via invisible hit extender — visual frame stays content-sized */
  .access-chip {
    min-height: 0;
    min-width: 0;
    padding: 5px; /* locked — same as desktop */
    box-sizing: border-box;
  }

  .access-chip::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    transform: translate(-50%, -50%);
  }

  .user-access-inner .user-actions .btn,
  .user-access-inner .user-actions .tiny,
  .user-access-inner .user-del-confirm .btn {
    min-height: 44px;
    box-sizing: border-box;
  }

  /* C5b: Load/Intel modal bottom sheet */
  .modal-backdrop {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .modal-window,
  .modal-window-wide {
    width: 100%;
    max-width: none;
    max-height: min(90vh, 100%);
    max-height: min(90dvh, 100%);
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-top: 12px;
    padding-top: 10px;
    padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    gap: 10px;
  }

  .modal-actions .btn {
    min-height: 44px;
    flex: 1 1 auto;
    box-sizing: border-box;
  }

  /* S-b: Decision actions may wrap on tight width */
  .decision-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  /* S1: decision edit single column */
  .decision-edit {
    grid-template-columns: 1fr;
  }
}

