:root {
  color-scheme: dark;
  --bg: #080a0f;
  --surface: #0d1017;
  --surface-2: #111620;
  --surface-3: #171d29;
  --line: #222a38;
  --line-strong: #303a4c;
  --text: #eef2f8;
  --muted: #778295;
  --soft: #aeb8c7;
  --blue: #7892ff;
  --blue-rgb: 120, 146, 255;
  --amber: #f3b85d;
  --amber-rgb: 243, 184, 93;
  --green: #61dba7;
  --green-rgb: 97, 219, 167;
  --red: #ff647d;
  --red-rgb: 255, 100, 125;
  --rail: 242px;
  --inspector: 286px;
  --divider-size: 7px;
  --aura-alpha: 0.48;
  --aura-blur: 18px;
  --sans: Inter, "Segoe UI Variable", "Segoe UI", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -18%, rgba(87, 111, 205, 0.15), transparent 36%),
    linear-gradient(180deg, #0a0c12 0%, var(--bg) 42%, #06080c 100%);
  font-family: var(--sans);
  letter-spacing: -0.01em;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #a9b8ff;
  outline-offset: 2px;
}

.concept-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  min-height: 62px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(80, 92, 115, 0.24);
  background: rgba(8, 10, 15, 0.9);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #dfe6f3;
  font: 700 14px/1 var(--mono);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand-glyph {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid #3d4d72;
  border-radius: 6px;
  color: #aebdff;
  background: #111726;
  box-shadow: inset 0 0 14px rgba(var(--blue-rgb), 0.1);
}

.mode-switch {
  justify-self: center;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #242b38;
  border-radius: 9px;
  background: #0b0e14;
}

.mode-button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #7f8999;
  background: transparent;
  font: 650 11px/1 var(--mono);
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.mode-button span {
  margin-right: 7px;
  color: #526078;
}

.mode-button:hover {
  color: #d9e0eb;
  background: #141923;
}

.mode-button.is-active {
  color: #f4f7fc;
  background: #1a2030;
  box-shadow: inset 0 0 0 1px #303a50, 0 5px 14px rgba(0, 0, 0, 0.25);
}

.mode-button.is-active span {
  color: #91a6ff;
}

.concept-meta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #687386;
  font: 650 10px/1 var(--mono);
  letter-spacing: 0.08em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(var(--green-rgb), 0.7);
}

.page-shell {
  width: min(1640px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 28px;
}

.study-heading {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 0.65fr);
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 25px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #68758d;
  font: 650 10px/1.2 var(--mono);
  letter-spacing: 0.12em;
}

.study-heading h1 {
  margin: 0;
  color: #f4f6fa;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 620;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.study-heading h1 em {
  color: #8198ff;
  font-style: normal;
}

.study-heading > p {
  justify-self: end;
  max-width: 590px;
  margin: 0 0 4px;
  color: #929daf;
  font-size: 15px;
  line-height: 1.55;
}

.app-window {
  overflow: hidden;
  min-height: 704px;
  border: 1px solid #2a3242;
  border-radius: 11px;
  background: #0a0d12;
  box-shadow:
    0 42px 90px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.018) inset;
}

.window-titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 39px;
  padding: 0 13px;
  border-bottom: 1px solid #202633;
  color: #626d7e;
  background: #10131a;
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.035em;
}

.window-brand,
.window-runtime {
  display: flex;
  align-items: center;
  gap: 8px;
}

.window-brand b {
  color: #cbd3df;
}

.window-dots {
  display: flex;
  gap: 5px;
  margin-right: 5px;
}

.window-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #313947;
}

.window-dots i:first-child { background: #6a4050; }
.window-dots i:nth-child(2) { background: #6c5d37; }
.window-dots i:last-child { background: #365e50; }

.window-center {
  color: #7d8797;
}

.window-runtime {
  justify-self: end;
}

.window-runtime i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #54c997;
}

.app-body {
  display: grid;
  grid-template-columns: var(--rail) minmax(660px, 1fr) var(--inspector);
  height: 665px;
}

.fleet-rail {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid #202734;
  background: #0d1016;
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 0 13px 0 15px;
  color: #8e98a8;
  font: 650 11px/1 var(--mono);
  letter-spacing: 0.09em;
}

.rail-heading button {
  width: 25px;
  height: 25px;
  border: 1px solid #2b3341;
  border-radius: 5px;
  color: #7f8a9b;
  background: #111620;
  cursor: pointer;
}

.rail-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 8px 9px;
  border-bottom: 1px solid #1d2430;
}

.rail-tabs button {
  height: 29px;
  border: 0;
  border-bottom: 1px solid transparent;
  color: #596476;
  background: transparent;
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.05em;
}

.rail-tabs button.active {
  border-bottom-color: #6d86ef;
  color: #cbd5e5;
  background: linear-gradient(180deg, transparent, rgba(var(--blue-rgb), 0.06));
}

.server-row {
  display: grid;
  grid-template-columns: 13px 27px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 8px;
  min-height: 51px;
  padding: 0 12px;
}

.server-row.muted {
  min-height: 47px;
  opacity: 0.74;
}

.server-caret {
  color: #535e70;
  font-size: 14px;
}

.server-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid #2c3544;
  border-radius: 6px;
  color: #9ba8ba;
  background: #151a23;
  font: 700 10px/1 var(--mono);
}

.server-row div {
  min-width: 0;
}

.server-row b,
.server-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-row b {
  color: #b6c0cf;
  font: 650 11px/1.4 var(--mono);
  letter-spacing: 0.035em;
}

.server-row small {
  color: #596476;
  font: 600 9px/1.5 var(--mono);
}

.online-dot,
.sleep-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4fcb94;
  box-shadow: 0 0 8px rgba(var(--green-rgb), 0.3);
}

.sleep-dot {
  background: #4a5464;
  box-shadow: none;
}

.space-list {
  padding: 0 7px 8px;
}

.space-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.space-row:hover {
  background: #121721;
}

.space-row.active {
  border-color: #2d3850;
  background: #171d29;
  box-shadow: inset 2px 0 #7088ee;
}

.space-row.held {
  opacity: 0.56;
}

.space-index {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid #2c3544;
  border-radius: 5px;
  color: #647084;
  font: 650 9px/1 var(--mono);
}

.space-row.active .space-index {
  border-color: #495a8b;
  color: #aebcff;
  background: rgba(var(--blue-rgb), 0.07);
}

.space-row div {
  min-width: 0;
}

.space-row b,
.space-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-row b {
  color: #aeb8c6;
  font: 650 11px/1.45 var(--mono);
}

.space-row small {
  color: #5e6979;
  font: 500 9px/1.45 var(--mono);
}

.space-signal {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  color: #8f9bad;
  background: #222936;
  font: 700 8px/1 var(--mono);
}

.space-signal.running { color: #b8c4ff; background: rgba(var(--blue-rgb), 0.16); }
.space-signal.done { color: #9cecc8; background: rgba(var(--green-rgb), 0.14); }
.space-signal.waiting { color: #f4ca87; background: rgba(var(--amber-rgb), 0.14); }

.rail-section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px 4px;
  color: #4e596a;
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.08em;
}

.rail-section-label i {
  height: 1px;
  flex: 1;
  background: #202631;
}

.rail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 33px;
  margin-top: auto;
  padding: 0 13px;
  border-top: 1px solid #202631;
  color: #596477;
  font: 600 8px/1 var(--mono);
}

.rail-footer span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rail-footer i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.workspace-stage {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #080a0e;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 9px 0 0;
  border-bottom: 1px solid #202734;
  background: #0d1016;
}

.tab-strip {
  align-self: stretch;
  display: flex;
  align-items: stretch;
}

.workspace-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 150px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid #202734;
  color: #768195;
  background: #0f131a;
  font: 600 9px/1 var(--mono);
}

.workspace-tab.active {
  color: #c8d1df;
  background: #151a23;
  box-shadow: inset 0 2px #7189f2;
}

.workspace-tab > span {
  margin-left: auto;
  color: #536073;
}

.agent-mark {
  display: inline-grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #354057;
  border-radius: 4px;
  color: #aebdff;
  background: #172035;
  font: 700 8px/1 var(--mono);
  font-style: normal;
}

.agent-mark.claude {
  border-color: #604938;
  color: #e8b98f;
  background: #261c17;
}

.agent-mark.shell {
  width: 25px;
  color: #8cdab9;
  border-color: #285243;
  background: #10221c;
}

.tab-add,
.stage-actions button {
  border: 0;
  color: #657184;
  background: transparent;
  cursor: pointer;
}

.tab-add {
  width: 38px;
  font-size: 16px;
}

.stage-actions {
  display: flex;
  gap: 3px;
}

.stage-actions button {
  width: 27px;
  height: 27px;
  border-radius: 5px;
  font: 700 12px/1 var(--mono);
}

.stage-actions button:hover {
  color: #b7c2d1;
  background: #181e28;
}

.pane-grid {
  position: relative;
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) var(--divider-size) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--divider-size) minmax(0, 0.7fr);
  padding: 7px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    #080a0e;
  background-size: 28px 28px;
  transition: grid-template-columns 220ms ease, grid-template-rows 220ms ease;
}

body[data-mode="dividers"],
body[data-mode="together"] {
  --divider-size: 30px;
}

.terminal-pane {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #252d3a;
  border-radius: 5px;
  background: #0b0e13;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  cursor: default;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.terminal-pane:hover,
.terminal-pane.is-selected {
  border-color: #374256;
}

.pane-code { grid-column: 1; grid-row: 1; }
.pane-review { grid-column: 3; grid-row: 1; }
.pane-output { grid-column: 1 / 4; grid-row: 3; }

.aura-shell {
  position: absolute;
  z-index: -1;
  inset: -2px;
  border-radius: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

body[data-mode="aura"] .aura-shell,
body[data-mode="together"] .aura-shell {
  opacity: 1;
}

body[data-mode="dividers"] .terminal-pane {
  border-color: #2b3340;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
}

.terminal-pane.state-running .aura-shell {
  border: 1px solid rgba(var(--blue-rgb), calc(var(--aura-alpha) + 0.18));
  box-shadow:
    0 0 var(--aura-blur) rgba(var(--blue-rgb), var(--aura-alpha)),
    inset 0 0 13px rgba(var(--blue-rgb), 0.12);
  animation: current-flow 2.8s ease-in-out infinite;
}

.terminal-pane.state-waiting .aura-shell {
  border: 1px solid rgba(var(--amber-rgb), calc(var(--aura-alpha) + 0.16));
  box-shadow:
    0 0 var(--aura-blur) rgba(var(--amber-rgb), var(--aura-alpha)),
    inset 0 0 14px rgba(var(--amber-rgb), 0.12);
  animation: waiting-breath 2.2s ease-in-out infinite;
}

.terminal-pane.state-done .aura-shell {
  border: 1px solid rgba(var(--green-rgb), calc(var(--aura-alpha) + 0.05));
  box-shadow:
    0 0 calc(var(--aura-blur) * 0.65) rgba(var(--green-rgb), calc(var(--aura-alpha) * 0.65)),
    inset 0 0 12px rgba(var(--green-rgb), 0.1);
}

.terminal-pane.state-error .aura-shell {
  border: 1px solid rgba(var(--red-rgb), 0.9);
  box-shadow:
    0 0 calc(var(--aura-blur) * 1.15) rgba(var(--red-rgb), calc(var(--aura-alpha) + 0.12)),
    inset 0 0 15px rgba(var(--red-rgb), 0.15);
  animation: error-arrival 620ms ease-out 2;
}

body[data-intensity="quiet"] {
  --aura-alpha: 0.23;
  --aura-blur: 11px;
}

body[data-intensity="bold"] {
  --aura-alpha: 0.72;
  --aura-blur: 26px;
}

@keyframes current-flow {
  0%, 100% { filter: brightness(0.9); }
  50% { filter: brightness(1.2); }
}

@keyframes waiting-breath {
  0%, 100% { opacity: 0.46; }
  50% { opacity: 1; }
}

@keyframes error-arrival {
  0% { opacity: 0.2; transform: scale(0.998); }
  44% { opacity: 1; }
  100% { opacity: 0.64; transform: scale(1); }
}

.pane-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 39px;
  padding: 0 10px;
  border-bottom: 1px solid #202733;
  background: #10141b;
}

.pane-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.pane-head b {
  color: #bfc8d6;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.045em;
}

.pane-head span {
  overflow: hidden;
  color: #606b7c;
  font: 500 10px/1 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 7px rgba(var(--blue-rgb), 0.5);
}

.state-waiting .pane-status i { background: var(--amber); box-shadow: 0 0 7px rgba(var(--amber-rgb), 0.5); }
.state-done .pane-status i { background: var(--green); box-shadow: 0 0 7px rgba(var(--green-rgb), 0.5); }
.state-error .pane-status i { background: var(--red); box-shadow: 0 0 7px rgba(var(--red-rgb), 0.6); }

.pane-status small {
  color: #4f5b6c;
  font: 600 8px/1 var(--mono);
}

.terminal-lines {
  position: relative;
  z-index: 1;
  height: calc(100% - 65px);
  overflow: hidden;
  padding: 14px 15px;
  color: #aeb8c7;
  background:
    radial-gradient(circle at 100% 0%, rgba(77, 95, 140, 0.045), transparent 38%),
    #0a0d12;
  font: 500 12px/1.58 var(--mono);
}

.terminal-lines p {
  min-height: 1.62em;
  margin: 0;
  white-space: nowrap;
}

.prompt { color: #77d7b0; }
.path { color: #78a4ec; }
.branch { color: #d29c64; }
.cmd { color: #dce3ed; }
.dim { color: #536072; }
.ok { color: #63dba7; }
.spinner { color: #8aa0ff; }
.accent { color: #f1bd70; font-weight: 650; }

.cursor-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: #7e94f5;
  animation: cursor-blink 1.1s steps(2, jump-none) infinite;
}

.cursor.amber { background: #e8b560; }

@keyframes cursor-blink {
  50% { opacity: 0.18; }
}

.terminal-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: min(100%, 340px);
  min-height: 30px;
  margin: 5px 0;
  padding: 0 8px;
  border: 1px solid #29313e;
  border-radius: 4px;
  background: #11151c;
}

.terminal-choice:first-of-type {
  border-color: #5b4b31;
  background: rgba(var(--amber-rgb), 0.055);
}

.terminal-choice b {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #3b4657;
  border-radius: 3px;
  color: #aeb8c8;
  font-size: 9px;
}

.terminal-choice span { color: #bdc5d1; }
.terminal-choice em { color: #93774e; font-size: 8px; font-style: normal; }

.pane-foot {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  padding: 0 10px;
  border-top: 1px solid #202733;
  color: #505c6e;
  background: #0e1218;
  font: 600 8px/1 var(--mono);
}

.pane-foot b {
  color: #8290a4;
  font-weight: 650;
}

.output-grid {
  display: grid;
  grid-template-columns: 1fr 164px;
  align-items: center;
  gap: 22px;
}

.result-card {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid #285343;
  border-radius: 5px;
  background: rgba(var(--green-rgb), 0.045);
}

.result-card span {
  color: #69cfa5;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.result-card b {
  margin: 3px 0;
  color: #dce8e2;
  font-size: 19px;
}

.result-card small {
  color: #60766c;
  font-size: 8px;
}

.living-divider {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #59667a;
  background: #0b0e13;
  cursor: col-resize;
  opacity: 0.22;
  transition: opacity 180ms ease, background 180ms ease;
}

.divider-vertical {
  grid-column: 2;
  grid-row: 1;
  flex-direction: column;
  border-right: 1px solid #1e2530;
  border-left: 1px solid #1e2530;
}

.divider-horizontal {
  grid-column: 1 / 4;
  grid-row: 2;
  gap: 11px;
  border-top: 1px solid #1e2530;
  border-bottom: 1px solid #1e2530;
  cursor: row-resize;
}

body[data-mode="dividers"] .living-divider,
body[data-mode="together"] .living-divider {
  opacity: 1;
  background: #10141b;
}

.divider-flow,
.divider-load,
.divider-task,
.divider-progress,
.divider-throughput,
.divider-output,
.divider-grip {
  transition: opacity 150ms ease;
}

body[data-mode="aura"] .divider-flow,
body[data-mode="aura"] .divider-load,
body[data-mode="aura"] .divider-task,
body[data-mode="aura"] .divider-progress,
body[data-mode="aura"] .divider-throughput,
body[data-mode="aura"] .divider-output,
body[data-mode="aura"] .divider-grip {
  opacity: 0;
}

.divider-flow {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.divider-flow i {
  width: 4px;
  height: 4px;
  transform: rotate(45deg);
  border-top: 1px solid #88a0ff;
  border-right: 1px solid #88a0ff;
  opacity: 0.3;
  animation: flow-arrow 1.35s ease-in-out infinite;
}

.divider-flow i:nth-child(2) { animation-delay: 180ms; }
.divider-flow i:nth-child(3) { animation-delay: 360ms; }

@keyframes flow-arrow {
  0%, 100% { opacity: 0.2; transform: translateY(-2px) rotate(45deg); }
  50% { opacity: 1; transform: translateY(2px) rotate(45deg); }
}

.divider-load {
  margin: 8px 0;
  color: #9aa8bd;
  font: 650 8px/1 var(--mono);
}

.divider-grip {
  color: #596578;
  font: 700 8px/1 var(--mono);
  letter-spacing: -1px;
  writing-mode: vertical-rl;
}

.divider-grip.horizontal {
  writing-mode: horizontal-tb;
  letter-spacing: 0;
}

.divider-task {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 650 8px/1 var(--mono);
}

.divider-task span { color: #8293ae; }
.divider-task b { color: #9eb0ff; }

.divider-progress {
  width: min(19%, 140px);
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #252d39;
}

.divider-progress i {
  display: block;
  width: 68%;
  height: 100%;
  background: #738cf3;
  box-shadow: 0 0 8px rgba(var(--blue-rgb), 0.45);
}

.divider-throughput,
.divider-output {
  color: #667488;
  font: 600 8px/1 var(--mono);
}

.divider-output { color: #8b9aaf; }

.divider-popover {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: calc(100% + 9px);
  width: 220px;
  padding: 12px;
  transform: translate(6px, -50%);
  border: 1px solid #354157;
  border-radius: 7px;
  opacity: 0;
  background: rgba(17, 22, 31, 0.98);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.46);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.divider-popover::before {
  position: absolute;
  top: calc(50% - 5px);
  left: -6px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-bottom: 1px solid #354157;
  border-left: 1px solid #354157;
  background: #11161f;
  content: "";
}

.living-divider:hover .divider-popover,
.living-divider.is-pinned .divider-popover,
.living-divider:focus-visible .divider-popover {
  transform: translate(0, -50%);
  opacity: 1;
  pointer-events: auto;
}

.horizontal-popover {
  top: calc(100% + 8px);
  left: 50%;
  width: 290px;
  transform: translate(-50%, 6px);
}

.horizontal-popover::before {
  top: -6px;
  left: calc(50% - 5px);
  border: 0;
  border-top: 1px solid #354157;
  border-left: 1px solid #354157;
}

.living-divider:hover .horizontal-popover,
.living-divider.is-pinned .horizontal-popover,
.living-divider:focus-visible .horizontal-popover {
  transform: translate(-50%, 0);
}

.popover-kicker {
  display: block;
  margin-bottom: 8px;
  color: #69768b;
  font: 650 7px/1 var(--mono);
  letter-spacing: 0.08em;
}

.popover-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.popover-stat b {
  color: #e8edf5;
  font: 650 24px/1 var(--mono);
}

.popover-stat span,
.divider-popover p,
.build-readout span {
  color: #6e7a8d;
  font: 500 8px/1.45 var(--mono);
}

.popover-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 8px;
  padding: 7px;
  border: 1px solid #293241;
  border-radius: 4px;
  color: #9ba9bd;
  background: #0d1118;
  font: 650 8px/1 var(--mono);
}

.popover-flow i {
  color: #8299fb;
  font-style: normal;
}

.divider-popover p {
  margin: 7px 0 10px;
}

.divider-actions {
  display: flex;
  gap: 5px;
}

.divider-actions button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid #303a4b;
  border-radius: 4px;
  color: #8e9cb0;
  background: #171d27;
  font: 650 7px/1 var(--mono);
  cursor: pointer;
}

.divider-actions button:hover {
  border-color: #50618b;
  color: #dce4f2;
}

.build-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.build-readout b {
  color: #d9e0eb;
  font: 650 12px/1 var(--mono);
}

.stage-statusbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 31px;
  padding: 0 10px;
  border-top: 1px solid #202734;
  color: #566276;
  background: #0d1016;
  font: 600 8px/1 var(--mono);
}

.stage-statusbar b { color: #8591a3; }
.stage-statusbar > span:last-child { justify-self: end; }

.status-summary {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-summary i,
.legend-row > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.blue { background: var(--blue); box-shadow: 0 0 7px rgba(var(--blue-rgb), 0.55); }
.amber-dot { background: var(--amber); box-shadow: 0 0 7px rgba(var(--amber-rgb), 0.55); }
.green { background: var(--green); box-shadow: 0 0 7px rgba(var(--green-rgb), 0.48); }
.red { background: var(--red); box-shadow: 0 0 7px rgba(var(--red-rgb), 0.55); }

.concept-inspector {
  min-width: 0;
  overflow-y: auto;
  border-left: 1px solid #202734;
  background: #0e1118;
  scrollbar-color: #2e3746 transparent;
  scrollbar-width: thin;
}

.inspector-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 0 16px;
  border-bottom: 1px solid #202734;
}

.inspector-heading > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #465780;
  border-radius: 6px;
  color: #aabbff;
  background: rgba(var(--blue-rgb), 0.08);
  font: 700 10px/1 var(--mono);
}

.inspector-heading small,
.inspector-heading b {
  display: block;
}

.inspector-heading small,
.section-label {
  color: #596578;
  font: 650 7px/1.5 var(--mono);
  letter-spacing: 0.09em;
}

.inspector-heading b {
  color: #cbd4e1;
  font: 700 10px/1.5 var(--mono);
  letter-spacing: 0.04em;
}

.inspector-preview {
  position: relative;
  height: 78px;
  margin: 14px 16px 5px;
  overflow: hidden;
  border: 1px solid #293342;
  border-radius: 6px;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    #0a0d12;
  background-size: 14px 14px;
}

.aura-preview i,
.aura-preview span,
.aura-preview b {
  position: absolute;
  top: 17px;
  bottom: 17px;
  border: 1px solid;
  border-radius: 3px;
}

.aura-preview i {
  left: 15px;
  width: 34%;
  border-color: rgba(var(--blue-rgb), 0.75);
  box-shadow: 0 0 13px rgba(var(--blue-rgb), 0.43);
}

.aura-preview span {
  right: 15px;
  width: 43%;
  border-color: rgba(var(--amber-rgb), 0.72);
  box-shadow: 0 0 13px rgba(var(--amber-rgb), 0.38);
  animation: waiting-breath 2.2s ease-in-out infinite;
}

.aura-preview b {
  top: auto;
  right: 15px;
  bottom: 8px;
  left: 15px;
  height: 2px;
  border: 0;
  background: linear-gradient(90deg, var(--blue), var(--amber));
  opacity: 0;
}

.inspector-preview.divider-preview i,
.inspector-preview.divider-preview span,
.inspector-preview.divider-preview b {
  position: absolute;
  display: block;
}

.inspector-preview.divider-preview i {
  top: 12px;
  bottom: 12px;
  left: calc(50% - 5px);
  width: 10px;
  border-right: 1px solid #667594;
  border-left: 1px solid #667594;
  background: #171d27;
}

.inspector-preview.divider-preview span {
  top: calc(50% - 5px);
  right: 12px;
  left: 12px;
  height: 10px;
  border-top: 1px solid #667594;
  border-bottom: 1px solid #667594;
  background: #171d27;
}

.inspector-preview.divider-preview b {
  top: calc(50% - 1px);
  left: 25%;
  width: 44%;
  height: 2px;
  background: #8299fb;
  box-shadow: 0 0 8px rgba(var(--blue-rgb), 0.5);
}

.inspector-preview.together-preview i,
.inspector-preview.together-preview span {
  border-color: rgba(var(--blue-rgb), 0.8);
  box-shadow: 0 0 12px rgba(var(--blue-rgb), 0.42);
}

.inspector-preview.together-preview b {
  opacity: 1;
}

.inspector-section {
  padding: 14px 16px;
  border-bottom: 1px solid #202734;
}

.section-label {
  display: block;
  margin-bottom: 9px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid #29313f;
  border-radius: 5px;
  background: #0b0f15;
}

.segmented button {
  min-height: 26px;
  padding: 0 4px;
  border: 0;
  border-radius: 3px;
  color: #5c687a;
  background: transparent;
  font: 650 7px/1 var(--mono);
  cursor: pointer;
}

.segmented button.is-active {
  color: #bdc9ed;
  background: #20283a;
  box-shadow: inset 0 0 0 1px #36425a;
}

.legend-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 39px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #1c222c;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.legend-row:last-child { border-bottom: 0; }

.legend-row div {
  min-width: 0;
}

.legend-row b,
.legend-row small {
  display: block;
}

.legend-row b {
  color: #aeb8c7;
  font: 600 10px/1.35 var(--sans);
}

.legend-row small {
  color: #576375;
  font: 500 8px/1.4 var(--mono);
}

.legend-row > span {
  color: #4f5b6d;
  font: 650 7px/1 var(--mono);
}

.legend-row:hover b,
.legend-row:hover > span {
  color: #e0e6ef;
}

.concept-notes p {
  margin: 0 0 11px;
  color: #788496;
  font-size: 12px;
  line-height: 1.45;
}

.concept-notes p:last-child { margin-bottom: 0; }
.concept-notes b { color: #aeb8c6; font-weight: 650; }

.inspector-tip {
  margin: 14px 16px 18px;
  padding: 11px 12px;
  border: 1px solid #3b4661;
  border-radius: 6px;
  background: rgba(var(--blue-rgb), 0.05);
}

.inspector-tip > span {
  color: #8599ec;
  font: 650 7px/1 var(--mono);
  letter-spacing: 0.08em;
}

.inspector-tip p {
  margin: 6px 0 0;
  color: #7e899c;
  font-size: 12px;
  line-height: 1.45;
}

.inspector-tip b { color: #b8c5e6; }

.study-footer {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 20px;
  min-height: 69px;
  padding: 0 3px;
  color: #596477;
}

.study-footer div span,
.study-footer div b {
  display: block;
  font: 650 8px/1.6 var(--mono);
  letter-spacing: 0.06em;
}

.study-footer div b { color: #8995a8; }

.study-footer p {
  margin: 0;
  color: #707c8f;
  font-size: 12px;
  text-align: center;
}

.prototype-label {
  justify-self: end;
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.06em;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: 340px;
  padding: 12px 15px;
  transform: translateY(10px);
  border: 1px solid #3a465c;
  border-radius: 7px;
  opacity: 0;
  color: #c9d3e1;
  background: rgba(16, 21, 30, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
  font: 600 10px/1.4 var(--mono);
  pointer-events: none;
  transition: opacity 170ms ease, transform 170ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1240px) {
  :root {
    --rail: 215px;
    --inspector: 258px;
  }

  .page-shell {
    width: calc(100% - 28px);
  }

  .app-body {
    grid-template-columns: var(--rail) minmax(560px, 1fr) var(--inspector);
  }

  .terminal-lines {
    padding: 12px;
    font-size: 12px;
  }

  .window-center {
    display: none;
  }

  .window-titlebar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  .concept-bar {
    position: relative;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 10px 14px;
  }

  .mode-switch {
    grid-column: 1 / 3;
    grid-row: 2;
    width: 100%;
  }

  .mode-button {
    flex: 1;
  }

  .concept-meta {
    grid-column: 2;
    grid-row: 1;
  }

  .page-shell {
    width: calc(100% - 20px);
    padding-top: 28px;
  }

  .study-heading {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .study-heading > p {
    justify-self: start;
  }

  .app-window {
    overflow: auto;
  }

  .app-body {
    grid-template-columns: 190px minmax(600px, 1fr);
    width: 1000px;
  }

  .concept-inspector {
    display: none;
  }
}

@media (max-width: 640px) {
  .concept-meta {
    display: none;
  }

  .concept-bar {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    grid-column: 1;
  }

  .mode-button {
    padding: 0 7px;
    font-size: 8px;
  }

  .study-heading h1 {
    font-size: 39px;
  }

  .window-brand > span:last-child,
  .window-runtime {
    display: none;
  }

  .window-titlebar {
    grid-template-columns: 1fr;
  }

  .study-footer {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 15px 3px;
  }

  .study-footer p { text-align: left; }
  .prototype-label { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
