:root {
  color-scheme: dark;
  --bg: #090f1b;
  --bg-2: #0e1726;
  --panel: rgba(13, 23, 38, 0.88);
  --panel-solid: #111c2d;
  --panel-2: rgba(24, 38, 58, 0.88);
  --line: rgba(147, 170, 203, 0.18);
  --line-strong: rgba(125, 220, 255, 0.34);
  --text: #edf5ff;
  --muted: #9fb0c9;
  --dim: #6f819a;
  --accent: #7ddcff;
  --mint: #7ce4b0;
  --gold: #f5c66a;
  --red: #f87171;
  --violet: #b9a6ff;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(29, 45, 67, 0.92);
  color: var(--text);
  padding: 0 11px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.os-shell {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  background:
    radial-gradient(circle at 18% 18%, rgba(125, 220, 255, 0.08), transparent 28%),
    radial-gradient(circle at 82% 30%, rgba(124, 228, 176, 0.06), transparent 24%),
    linear-gradient(180deg, #0c1322 0%, #070c15 100%);
  overflow: hidden;
}

.launcher {
  position: relative;
  z-index: 20;
  min-height: 100vh;
  width: 72px;
  display: grid;
  grid-template-rows: 58px minmax(0, auto) 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: rgba(7, 12, 22, 0.72);
  backdrop-filter: blur(14px);
}

.launcher-mark {
  grid-row: 1;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  min-height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(29, 45, 67, 0.72);
  color: var(--muted);
  border-color: rgba(147, 170, 203, 0.16);
}

.launcher-mark:hover,
.launcher-mark.active {
  border-color: rgba(125, 220, 255, 0.48);
  color: var(--text);
  background: rgba(125, 220, 255, 0.12);
  box-shadow:
    0 0 0 3px rgba(125, 220, 255, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.24);
}

.home-glyph {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launch {
  width: 52px;
  height: 56px;
  display: grid;
  grid-template-rows: 25px 15px;
  place-items: center;
  gap: 2px;
  padding: 6px 0;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-size: 10px;
  font-weight: 750;
}

.launch.active,
.launch:hover {
  color: var(--text);
  background: rgba(125, 220, 255, 0.1);
  border-color: rgba(125, 220, 255, 0.25);
}

.space-launcher-list {
  grid-row: 2;
  width: 100%;
  min-height: 0;
  max-height: calc(100vh - 150px);
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}

.space-launcher-list::-webkit-scrollbar {
  display: none;
}

.space-launch-button {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 56px;
  display: grid;
  grid-template-rows: 25px 15px;
  place-items: center;
  gap: 2px;
  padding: 6px 0;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-size: 10px;
  font-weight: 750;
}

.space-launch-button.active,
.space-launch-button:hover {
  z-index: 2;
  color: var(--text);
  background: rgba(125, 220, 255, 0.1);
  border-color: rgba(125, 220, 255, 0.25);
  box-shadow: inset 0 0 0 1px rgba(125, 220, 255, 0.2);
}

.space-launch-button:focus-visible {
  outline: 2px solid rgba(125, 220, 255, 0.62);
  outline-offset: -2px;
}

.space-launch-glyph {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1;
}

.admin-launch-button.active,
.admin-launch-button:hover {
  border-color: rgba(245, 198, 106, 0.38);
  background: rgba(245, 198, 106, 0.1);
  box-shadow: inset 0 0 0 1px rgba(245, 198, 106, 0.2);
}

.admin-launch-glyph {
  color: var(--gold);
  border-color: currentColor;
  background: rgba(245, 198, 106, 0.06);
}

.space-launch-crown {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launch-glyph {
  position: relative;
  width: 24px;
  height: 24px;
  display: block;
}

.glyph-dashboard {
  border: 2px solid currentColor;
  border-radius: 7px;
}

.glyph-dashboard::before,
.glyph-dashboard::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.glyph-nodes::before,
.glyph-nodes::after,
.glyph-task::before,
.glyph-task::after {
  content: "";
  position: absolute;
}

.glyph-nodes {
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.glyph-nodes::before,
.glyph-nodes::after {
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  top: 6px;
}

.glyph-nodes::before {
  left: 0;
}

.glyph-nodes::after {
  right: 0;
}

.glyph-task {
  border: 2px solid currentColor;
  border-radius: 6px;
}

.glyph-task::before {
  width: 10px;
  height: 2px;
  background: currentColor;
  left: 5px;
  top: 7px;
}

.glyph-task::after {
  width: 7px;
  height: 2px;
  background: currentColor;
  left: 5px;
  top: 13px;
}

.glyph-logs {
  border-left: 2px solid currentColor;
}

.glyph-modules {
  border: 2px solid currentColor;
  border-radius: 6px;
}

.glyph-modules::before,
.glyph-modules::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.glyph-modules::after {
  inset: 5px 9px;
  border: 0;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.glyph-logs::before,
.glyph-logs::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 0;
  height: 2px;
  background: currentColor;
}

.glyph-logs::before {
  top: 7px;
  box-shadow: 0 6px 0 currentColor;
}

.glyph-logs::after {
  top: 19px;
  width: 13px;
}

.glyph-observe {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.glyph-observe::before,
.glyph-observe::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.glyph-observe::before {
  inset: 5px;
  border: 2px solid currentColor;
}

.glyph-observe::after {
  width: 4px;
  height: 4px;
  left: 10px;
  top: 10px;
  background: currentColor;
}

.launcher-spacer {
  grid-row: 3;
  align-self: stretch;
  min-height: 0;
}

.launcher-login {
  grid-row: 4;
  position: relative;
  width: 52px;
  display: grid;
  place-items: center;
}

.login-avatar-button {
  position: relative;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: rgba(147, 170, 203, 0.18);
  background: rgba(13, 23, 38, 0.92);
}

.login-avatar-button:hover,
.login-avatar-button[aria-expanded="true"] {
  border-color: rgba(124, 228, 176, 0.42);
  background: rgba(124, 228, 176, 0.1);
}

.login-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(232, 238, 247, 0.12);
}

.login-avatar:has(.google-logo) {
  padding: 4px;
}

.google-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.login-state-dot {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #07101d;
  background: var(--dim);
}

.launcher-login.signed-in .login-state-dot {
  background: var(--mint);
}

.launcher-login.needs-config .login-state-dot,
.launcher-login.error .login-state-dot {
  background: var(--gold);
}

.login-popover {
  position: absolute;
  left: 62px;
  bottom: 0;
  z-index: 26000;
  width: min(286px, calc(100vw - 86px));
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(147, 170, 203, 0.2);
  border-radius: var(--radius);
  background: rgba(8, 14, 25, 0.96);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.login-head,
.login-user {
  display: grid;
  gap: 3px;
}

.login-head strong,
.login-user strong {
  font-size: 13px;
}

.login-head span,
.login-user span,
.login-message {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.google-signin-slot {
  min-height: 42px;
  display: grid;
  align-items: center;
  padding: 0;
  border-radius: 999px;
  background: transparent;
}

.google-signin-slot[hidden] {
  display: none;
}

.google-login-shell {
  position: relative;
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  overflow: hidden;
}

.google-login-face {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(147, 170, 203, 0.2);
  border-radius: inherit;
  background: rgba(10, 18, 30, 0.96);
  color: #e8eef7;
  font-size: 14px;
  font-weight: 750;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(232, 238, 247, 0.04);
}

.google-login-face-logo {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

.google-login-click-layer {
  position: absolute;
  inset: 0;
  opacity: 0.0001;
  overflow: hidden;
  cursor: pointer;
}

.google-login-click-layer > div,
.google-login-click-layer .S9gUrf-YoZ4jf,
.google-login-click-layer .nsm7Bb-HzV7m-LgbsSe {
  width: 100% !important;
  height: 100% !important;
}

.google-login-click-layer .nsm7Bb-HzV7m-LgbsSe {
  min-width: 100% !important;
}

.google-signin-slot .nsm7Bb-HzV7m-LgbsSe {
  border-color: rgba(147, 170, 203, 0.18) !important;
  background: rgba(10, 18, 30, 0.96) !important;
  color: #e8eef7 !important;
}

.google-signin-slot .nsm7Bb-HzV7m-LgbsSe-Bz112c-haAclf,
.google-signin-slot [id="container-div"] {
  background: transparent !important;
}

.google-signin-slot .nsm7Bb-HzV7m-LgbsSe-Bz112c-haAclf {
  min-width: 28px !important;
  width: 28px !important;
  height: 28px !important;
  margin-left: -4px !important;
  margin-right: 10px !important;
}

.google-login-shell:hover .google-login-face,
.google-signin-slot .nsm7Bb-HzV7m-LgbsSe:hover {
  border-color: rgba(124, 228, 176, 0.38) !important;
  background: rgba(18, 35, 48, 0.98) !important;
}

.auth-google-slot {
  width: min(260px, 100%);
  justify-items: center;
}

.login-secondary-button {
  width: 100%;
}

.os-shell[data-auth="checking"] .main-stage,
.os-shell[data-auth="locked"] .main-stage,
.os-shell[data-auth="checking"] .space-launcher-list,
.os-shell[data-auth="locked"] .space-launcher-list {
  display: none;
}

.os-shell[data-auth="checking"] .launcher-mark,
.os-shell[data-auth="locked"] .launcher-mark {
  pointer-events: none;
  opacity: 0.45;
}

.os-shell[data-auth="checking"] ~ .agent-overlay,
.os-shell[data-auth="locked"] ~ .agent-overlay {
  display: none;
}

.auth-gate {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  display: none;
  place-items: center;
  padding: 24px;
  background: #000;
}

.os-shell[data-auth="locked"] .auth-gate {
  display: grid;
}

.auth-card {
  width: min(280px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(147, 170, 203, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 14, 25, 0.94);
  text-align: center;
}

.auth-mark {
  width: 44px;
  height: 44px;
  padding: 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(232, 238, 247, 0.12);
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-message {
  min-height: 18px;
}

.mini-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(245, 198, 106, 0.11);
}

.mini-led.ok {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(124, 228, 176, 0.11);
}

.mini-led.err {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.11);
}

.main-stage {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  line-height: 1.1;
}

h2 {
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 780;
}

.pill,
.widget-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pill.ok,
.widget-chip.ok {
  color: var(--mint);
  border-color: rgba(124, 228, 176, 0.42);
}

.pill.err,
.widget-chip.err {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.42);
}

.icon-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.space-frame {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 342px;
  background: rgba(4, 8, 15, 0.92);
}

.space-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

#spaceCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.space-title {
  position: absolute;
  left: 20px;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  color: rgba(237, 245, 255, 0.74);
  font-size: 12px;
}

.home-actions {
  position: absolute;
  left: 20px;
  top: 18px;
  z-index: 10000;
  display: none;
  max-width: calc(100% - 40px);
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.home-action-button {
  min-width: 86px;
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  border-color: rgba(147, 170, 203, 0.24);
  background: rgba(7, 13, 24, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.home-action-button.primary {
  min-width: 132px;
  border-color: rgba(124, 228, 176, 0.42);
  background: rgba(124, 228, 176, 0.14);
}

.home-action-button:hover {
  border-color: rgba(125, 220, 255, 0.5);
  background: rgba(125, 220, 255, 0.12);
}

.os-shell[data-panel="home"] .home-actions {
  display: flex;
}

.space-label {
  font-weight: 800;
  color: var(--text);
}

.space-config-button {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 10000;
  background: rgba(7, 13, 24, 0.72);
  border-color: rgba(147, 170, 203, 0.24);
  backdrop-filter: blur(12px);
}

.space-config-button::before,
.space-config-button::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.space-config-button::after {
  inset: 15px;
  border: 0;
  background: currentColor;
  box-shadow: 0 -8px 0 currentColor, 0 8px 0 currentColor, -8px 0 0 currentColor, 8px 0 0 currentColor;
}

.app-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.space-app-button {
  position: absolute;
  width: 62px;
  height: 70px;
  min-height: 70px;
  display: grid;
  grid-template-rows: 42px 16px;
  justify-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  pointer-events: auto;
  touch-action: none;
}

.space-app-button:hover,
.space-app-button.open {
  color: var(--text);
  border-color: rgba(125, 220, 255, 0.22);
  background: rgba(125, 220, 255, 0.08);
}

.space-app-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(125, 220, 255, 0.34);
  border-radius: var(--radius);
  background: rgba(8, 14, 25, 0.78);
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

.space-context-menu {
  position: fixed;
  z-index: 27000;
  width: 168px;
  display: grid;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(147, 170, 203, 0.24);
  border-radius: var(--radius);
  background: rgba(8, 14, 25, 0.98);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
}

.space-context-menu button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-color: transparent;
  background: transparent;
}

button.danger,
.space-context-menu button.danger {
  color: #ffd6d6;
}

button.danger:hover,
.space-context-menu button.danger:hover {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.12);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 5, 12, 0.62);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(420px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(147, 170, 203, 0.2);
  border-radius: var(--radius);
  background: rgba(10, 17, 30, 0.97);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.46);
}

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

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close-button {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.modal-close-button::before,
.modal-close-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.confirm-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.confirm-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(147, 170, 203, 0.22);
  border-radius: var(--radius);
  background: rgba(3, 8, 16, 0.88);
  color: var(--text);
  padding: 0 10px;
}

.config-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.modal-module-list {
  max-height: 460px;
  overflow: auto;
  padding-right: 2px;
}

.widget {
  position: absolute;
  z-index: 4;
  min-width: 240px;
  min-height: 160px;
  border: 1px solid rgba(147, 170, 203, 0.2);
  border-radius: var(--radius);
  background: rgba(10, 20, 35, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 22px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  overflow: hidden;
  touch-action: none;
}

.widget.is-minimized {
  display: none;
}

.widget.is-maximized {
  left: 8px !important;
  top: 8px !important;
  right: auto !important;
  bottom: auto !important;
  width: calc(100% - 16px) !important;
  height: calc(100% - 16px) !important;
  aspect-ratio: auto !important;
  z-index: 9999 !important;
}

.widget-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border-bottom: 1px solid rgba(147, 170, 203, 0.14);
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.widget-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
}

.widget-control-button {
  position: relative;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-color: rgba(147, 170, 203, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.widget-control-button:hover,
.widget-control-button:focus-visible,
.widget-control-button.active {
  color: var(--text);
  border-color: rgba(125, 220, 255, 0.42);
}

.widget-minimize-button::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.widget-maximize-button::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.widget-add-button {
  min-height: 24px;
  padding: 0 8px;
  border-color: rgba(124, 228, 176, 0.3);
  background: rgba(124, 228, 176, 0.1);
  color: var(--mint);
  font-size: 11px;
}

.widget-head:active,
.widget.is-dragging .widget-head {
  cursor: grabbing;
}

.widget.is-dragging,
.widget.is-resizing,
.widget.is-layer-pulse {
  border-color: rgba(124, 228, 176, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 64px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(124, 228, 176, 0.14);
}

body.is-widget-dragging {
  cursor: grabbing;
  user-select: none;
}

body.is-widget-resizing {
  cursor: nwse-resize;
  user-select: none;
}

body.is-agent-dragging {
  cursor: grabbing;
  user-select: none;
}

.widget-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  z-index: 5;
  cursor: nwse-resize;
  touch-action: none;
}

.widget-resize-handle::before {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(125, 220, 255, 0.58);
  border-bottom: 2px solid rgba(125, 220, 255, 0.58);
}

.widget-chip {
  min-height: 24px;
  font-size: 11px;
}

.resources-widget {
  left: 4.2%;
  top: 9.2%;
  width: min(430px, 34vw);
  height: 292px;
}

.topology-widget {
  left: 38%;
  top: 8%;
  width: min(620px, 48vw);
  height: 430px;
}

.studio-widget {
  left: 9%;
  bottom: 8%;
  width: min(430px, 36vw);
  height: 292px;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) 48px;
}

.drop-widget {
  right: 5%;
  bottom: 9%;
  width: min(390px, 32vw);
  height: 260px;
  display: grid;
  grid-template-rows: 42px 82px minmax(0, 1fr);
}

.browser-widget {
  right: 4%;
  bottom: 7%;
  width: clamp(620px, 58vw, 980px);
  height: auto;
  aspect-ratio: 16 / 11.8;
  display: grid;
  grid-template-rows: 42px 76px minmax(0, 1fr) 30px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.metric {
  min-width: 0;
  min-height: 70px;
  border: 1px solid rgba(147, 170, 203, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.metric-label,
.node-meta,
.task-meta {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  margin-top: 5px;
  font-size: 18px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-bar {
  height: 4px;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(147, 170, 203, 0.16);
  overflow: hidden;
}

.metric-bar > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--mint));
}

.topology-nodes {
  position: relative;
  height: calc(100% - 42px);
  padding: 16px;
}

.topology-node {
  position: absolute;
  width: 150px;
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid rgba(125, 220, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(11, 24, 42, 0.86);
  padding: 10px;
  color: var(--text);
  text-align: left;
}

.topology-node.active {
  border-color: rgba(124, 228, 176, 0.56);
  box-shadow: 0 0 0 1px rgba(124, 228, 176, 0.12);
}

.node-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  flex: 0 0 auto;
}

.state-dot.running,
.state-dot.working {
  background: var(--mint);
}

.state-dot.error,
.state-dot.unknown,
.state-dot.stopped {
  background: var(--red);
}

textarea {
  width: 100%;
  min-width: 0;
  min-height: 0;
  resize: none;
  border: 0;
  outline: none;
  background: rgba(4, 10, 19, 0.54);
  color: var(--text);
  padding: 12px;
  line-height: 1.45;
}

textarea:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 10px;
  border-top: 1px solid rgba(147, 170, 203, 0.14);
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px;
  border: 1px dashed rgba(125, 220, 255, 0.34);
  border-radius: var(--radius);
  min-height: 58px;
  padding: 10px;
  color: var(--muted);
}

.drop-icon {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(125, 220, 255, 0.42);
  border-radius: var(--radius);
  position: relative;
}

.drop-icon::before,
.drop-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  color: var(--accent);
}

.drop-icon::before {
  width: 14px;
  height: 2px;
  left: 7px;
  top: 14px;
}

.drop-icon::after {
  width: 2px;
  height: 14px;
  left: 13px;
  top: 8px;
}

.task-output {
  min-height: 0;
  overflow: auto;
  padding: 0 12px 12px;
  color: var(--muted);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.browser-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(147, 170, 203, 0.14);
}

.browser-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.browser-nav button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.browser-nav button.is-live {
  color: var(--mint);
  border-color: rgba(124, 228, 176, 0.42);
  background: rgba(124, 228, 176, 0.12);
}

.browser-bar input {
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(147, 170, 203, 0.18);
  border-radius: 999px;
  background: rgba(4, 10, 19, 0.74);
  color: var(--text);
  outline: none;
  padding: 0 11px;
  font-size: 12px;
}

.browser-bar input:focus {
  border-color: rgba(125, 220, 255, 0.48);
}

.browser-screen {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(147, 170, 203, 0.16);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(125, 220, 255, 0.05), rgba(245, 198, 106, 0.03)),
    rgba(3, 8, 15, 0.78);
  overflow: hidden;
  outline: none;
  cursor: crosshair;
}

.browser-screen:focus {
  border-color: rgba(124, 228, 176, 0.58);
  box-shadow: 0 0 0 1px rgba(124, 228, 176, 0.18);
}

.browser-screen.is-busy::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 9px;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(125, 220, 255, 0.24);
  border-top-color: rgba(125, 220, 255, 0.94);
  border-radius: 50%;
  animation: browser-spin 0.8s linear infinite;
}

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

.browser-screen canvas,
.browser-screen img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: fill;
  background: #050914;
}

.browser-screen.has-canvas canvas {
  display: block;
}

.browser-screen.has-image img {
  display: block;
}

.browser-screen.has-canvas .browser-empty,
.browser-screen.has-image .browser-empty {
  display: none;
}

.browser-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.browser-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 11px;
}

.side-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: rgba(9, 15, 26, 0.86);
  backdrop-filter: blur(14px);
}

.panel-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 7px;
  border-bottom: 1px solid var(--line);
}

.panel-tab {
  min-width: 0;
  min-height: 30px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.panel-tab.active,
.panel-tab:hover {
  color: var(--text);
  background: rgba(125, 220, 255, 0.1);
  border-color: rgba(125, 220, 255, 0.22);
}

.panel-view {
  min-width: 0;
  min-height: 0;
  display: none;
  overflow: auto;
  padding: 13px;
}

.panel-view.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.os-shell[data-panel="home"] .space-frame {
  grid-template-columns: minmax(0, 1fr) 0;
  grid-template-rows: minmax(0, 1fr);
}

.os-shell[data-panel="user-space"] .space-frame {
  grid-template-columns: minmax(0, 1fr) 0;
  grid-template-rows: minmax(0, 1fr);
}

.os-shell[data-panel="home"] .side-panel,
.os-shell[data-panel="home"] .space-title,
.os-shell[data-panel="home"] .space-config-button,
.os-shell[data-panel="home"] .app-layer,
.os-shell[data-panel="home"] .widget {
  display: none;
}

.os-shell[data-panel="user-space"] .side-panel,
.os-shell[data-panel="user-space"] .space-title,
.os-shell[data-panel="user-space"] .widget {
  display: none;
}

.os-shell[data-panel="admin"] .space-frame {
  grid-template-columns: minmax(0, 1fr) 0;
}

.os-shell[data-panel="admin"] .side-panel {
  display: none;
}

.panel-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-list,
.node-list,
.task-list,
.observation-timeline,
.module-list,
.timeline-graph {
  display: grid;
  gap: 8px;
  align-content: start;
}

.summary-item,
.node-card,
.task-card,
.observation-event,
.module-card,
.timeline-node {
  min-width: 0;
  border: 1px solid rgba(147, 170, 203, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.summary-item strong,
.node-card strong,
.task-card strong,
.observation-event strong,
.module-card strong,
.timeline-node strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-widget {
  left: 58%;
  top: 10%;
  width: min(390px, 31vw);
  min-height: 260px;
}

.timeline-graph {
  padding: 10px 12px;
}

.timeline-node {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
}

.timeline-dot {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(125, 220, 255, 0.72);
  border-radius: 50%;
  background: rgba(9, 15, 26, 0.96);
}

.timeline-node.checkpoint .timeline-dot {
  border-color: rgba(124, 228, 176, 0.86);
  background: rgba(124, 228, 176, 0.18);
}

.timeline-node span {
  display: block;
  color: var(--dim);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.timeline-details {
  display: grid;
  gap: 8px;
}

.module-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.module-card.enabled {
  border-color: rgba(124, 228, 176, 0.36);
}

.module-copy {
  min-width: 0;
}

.module-copy p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-copy span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.module-toggle {
  display: inline-grid;
  grid-template-columns: 1fr;
  align-items: center;
}

.module-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.module-toggle span {
  min-width: 52px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(147, 170, 203, 0.18);
  border-radius: var(--radius);
  background: rgba(13, 23, 38, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.module-toggle input:checked + span {
  border-color: rgba(124, 228, 176, 0.42);
  background: rgba(124, 228, 176, 0.11);
  color: var(--text);
}

.module-toggle input:focus-visible + span {
  outline: 2px solid rgba(125, 220, 255, 0.62);
  outline-offset: 2px;
}

.observation-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.agent-overlay {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  z-index: 30000;
  pointer-events: none;
}

.agent-avatar-button,
.agent-panel {
  pointer-events: auto;
}

.agent-avatar-button {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border-color: rgba(125, 220, 255, 0.35);
  background: #111c2d;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  touch-action: none;
}

.agent-avatar-core {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(237, 245, 255, 0.86);
  background:
    linear-gradient(90deg, transparent 0 34%, rgba(237, 245, 255, 0.86) 35% 45%, transparent 46% 54%, rgba(237, 245, 255, 0.86) 55% 65%, transparent 66%),
    radial-gradient(circle at 50% 72%, rgba(124, 228, 176, 0.9) 0 12%, transparent 13%),
    linear-gradient(135deg, rgba(125, 220, 255, 0.28), rgba(185, 166, 255, 0.18));
}

.agent-panel {
  position: absolute;
  right: auto;
  bottom: auto;
  width: min(430px, calc(var(--agent-app-width, 100vw) - 18px));
  max-height: calc(var(--agent-app-height, 100vh) - 18px);
  height: min(620px, calc(var(--agent-app-height, 100vh) - 18px));
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid rgba(147, 170, 203, 0.24);
  border-radius: var(--radius);
  background: rgba(9, 15, 26, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.agent-panel,
.agent-panel * {
  min-width: 0;
}

.agent-overlay[data-open="true"] .agent-panel {
  display: grid;
}

.agent-panel-head,
.agent-form {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(147, 170, 203, 0.16);
}

.agent-panel-head {
  position: relative;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
}

.agent-title-block {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.agent-panel-title {
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-node-picker {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-node-picker select {
  width: min(178px, 100%);
  min-width: 0;
  min-height: 28px;
  border: 1px solid rgba(147, 170, 203, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 14, 24, 0.96);
  color: var(--text);
  padding: 0 8px;
  font-size: 11px;
}

.agent-head-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.agent-tool-button,
.agent-close-button,
.agent-new-session-button {
  height: 34px;
  min-height: 34px;
  line-height: 1;
}

.agent-close-button {
  display: grid;
  place-items: center;
}

.agent-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.agent-icon-close::before,
.agent-icon-close::after,
.agent-icon-plus::before,
.agent-icon-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.agent-icon-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.agent-icon-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.agent-icon-plus::before {
  transform: translate(-50%, -50%);
}

.agent-icon-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.agent-icon-sessions {
  border-left: 2px solid currentColor;
}

.agent-icon-sessions::before,
.agent-icon-sessions::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.agent-icon-sessions::before {
  top: 2px;
}

.agent-icon-sessions::after {
  top: 2px;
  left: 0;
  right: auto;
  width: 2px;
}

.agent-icon-context {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.agent-icon-context::before,
.agent-icon-context::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.agent-icon-context::before {
  top: 4px;
}

.agent-icon-context::after {
  bottom: 4px;
}

.agent-icon-settings {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.agent-icon-settings::before,
.agent-icon-settings::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: currentColor;
}

.agent-icon-settings::before {
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
}

.agent-icon-settings::after {
  left: 50%;
  top: -4px;
  width: 2px;
  height: 24px;
  box-shadow: 7px 3px 0 currentColor, -7px -3px 0 currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.agent-balloon {
  position: absolute;
  top: 48px;
  z-index: 3;
  width: min(330px, calc(100% - 24px));
  max-height: min(360px, calc(var(--agent-app-height, 100vh) - 94px));
  border: 1px solid rgba(147, 170, 203, 0.24);
  border-radius: var(--radius);
  background: rgba(9, 15, 26, 0.98);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.agent-session-balloon {
  left: 12px;
}

.agent-context-balloon {
  right: 12px;
}

.agent-settings-balloon {
  right: 12px;
}

.agent-balloon[hidden] {
  display: none;
}

.agent-balloon-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(147, 170, 203, 0.14);
}

.agent-session-list {
  display: grid;
  gap: 4px;
  max-height: 276px;
  overflow: auto;
  padding: 8px;
}

.agent-session-row {
  min-width: 0;
  min-height: 44px;
  display: grid;
  gap: 2px;
  text-align: left;
}

.agent-session-row strong,
.agent-session-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-session-row span {
  color: var(--dim);
  font-size: 11px;
}

.agent-session-row.active {
  border-color: rgba(124, 228, 176, 0.42);
  background: rgba(124, 228, 176, 0.09);
}

.agent-messages {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding: 12px;
}

.agent-diagnostics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(147, 170, 203, 0.12);
  color: var(--muted);
  font-size: 10px;
}

.agent-diagnostics div {
  min-width: 0;
}

.agent-diagnostics dt {
  margin: 0 0 2px;
  color: var(--dim);
  font-weight: 800;
  text-transform: uppercase;
}

.agent-diagnostics dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-changed-details {
  min-width: 0;
  margin-top: 10px;
  border-top: 1px solid rgba(147, 170, 203, 0.14);
  color: var(--muted);
  font-size: 12px;
}

.agent-changed-summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.agent-changed-summary::-webkit-details-marker {
  display: none;
}

.agent-changed-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.62;
  transform: rotate(45deg) translateY(-2px);
}

.agent-changed-details[open] .agent-changed-summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.agent-file-list {
  display: grid;
  max-height: 124px;
  overflow: auto;
  border-top: 1px solid rgba(147, 170, 203, 0.12);
}

.agent-file-row {
  min-width: 0;
  min-height: 31px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(147, 170, 203, 0.08);
}

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

.agent-file-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.agent-file-diff {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.agent-diff-add {
  color: var(--mint);
}

.agent-diff-del {
  color: var(--red);
}

.agent-context-preview {
  display: grid;
  gap: 8px;
  max-height: 292px;
  overflow: auto;
  padding: 8px;
}

.agent-context-preview article {
  min-width: 0;
  border: 1px solid rgba(147, 170, 203, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 8px;
}

.agent-context-meta {
  margin: 3px 0 6px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-context-preview pre {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.agent-message {
  max-width: 88%;
  border: 1px solid rgba(147, 170, 203, 0.14);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}

.agent-message.is-thinking {
  border-color: rgba(125, 220, 255, 0.26);
  background: rgba(125, 220, 255, 0.065);
}

.agent-turn-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-turn-elapsed {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-turn-elapsed {
  min-width: 38px;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.agent-message-menu-button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.agent-message-menu-button:hover {
  color: var(--text);
  border-color: rgba(125, 220, 255, 0.24);
  background: rgba(125, 220, 255, 0.08);
}

.agent-menu-arrow {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.agent-message-menu {
  position: absolute;
  right: 0;
  top: 26px;
  z-index: 2;
  min-width: 144px;
  border: 1px solid rgba(147, 170, 203, 0.24);
  border-radius: var(--radius);
  background: rgba(9, 15, 26, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  padding: 5px;
}

.agent-message-menu-item {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  padding: 0 8px;
  text-align: left;
}

.agent-icon-copy {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.agent-icon-copy::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
  opacity: 0.62;
}

.agent-message-body {
  white-space: pre-wrap;
}

.agent-actions-chain {
  margin: 0 0 8px;
  border: 1px solid rgba(147, 170, 203, 0.12);
  border-radius: 6px;
  background: rgba(3, 8, 15, 0.28);
  overflow: hidden;
}

.agent-actions-summary {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.agent-actions-count {
  min-width: 20px;
  min-height: 20px;
  display: grid;
  place-items: center;
  margin-left: 2px;
  border: 1px solid rgba(147, 170, 203, 0.18);
  border-radius: 999px;
  color: var(--text);
  font-size: 10px;
  line-height: 1;
}

.agent-actions-summary::-webkit-details-marker {
  display: none;
}

.agent-actions-summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.62;
  transform: rotate(45deg) translateY(-2px);
}

.agent-actions-chain[open] .agent-actions-summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.agent-actions-list {
  display: grid;
  border-top: 1px solid rgba(147, 170, 203, 0.1);
}

.agent-action-row {
  color: var(--muted);
  border-bottom: 1px solid rgba(147, 170, 203, 0.08);
}

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

.agent-action-row-summary {
  min-height: 36px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  cursor: default;
  list-style: none;
}

details.agent-action-row .agent-action-row-summary {
  cursor: pointer;
}

.agent-action-row-summary::-webkit-details-marker {
  display: none;
}

.agent-action-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(124, 228, 176, 0.11);
}

.agent-action-row.running .agent-action-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 198, 106, 0.12);
}

.agent-action-row.error .agent-action-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.agent-action-main {
  display: grid;
  gap: 2px;
}

.agent-action-main strong,
.agent-action-main span,
.agent-action-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-action-main strong {
  color: var(--text);
  font-size: 11px;
}

.agent-action-main span {
  color: var(--dim);
  font-size: 10px;
}

.agent-action-kind {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(147, 170, 203, 0.14);
  border-radius: 999px;
  padding: 0 7px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-action-meta {
  max-width: 112px;
  color: var(--dim);
  font-size: 10px;
  text-align: right;
}

.agent-action-row.kind-tool .agent-action-kind {
  color: var(--accent);
  border-color: rgba(125, 220, 255, 0.22);
}

.agent-action-row.kind-context .agent-action-kind,
.agent-action-row.kind-media .agent-action-kind {
  color: var(--violet);
  border-color: rgba(185, 166, 255, 0.22);
}

.agent-action-row.kind-model .agent-action-kind {
  color: var(--mint);
  border-color: rgba(124, 228, 176, 0.22);
}

.agent-action-row.kind-timeline .agent-action-kind {
  color: var(--gold);
  border-color: rgba(245, 198, 106, 0.22);
}

.agent-action-row.kind-hmr .agent-action-kind,
.agent-action-row.kind-error .agent-action-kind {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.24);
}

.agent-action-preview {
  max-height: 160px;
  overflow: auto;
  margin: 0;
  border-top: 1px solid rgba(147, 170, 203, 0.08);
  background: rgba(4, 10, 19, 0.44);
  padding: 8px 9px 9px 29px;
  color: var(--muted);
  white-space: pre-wrap;
  font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.agent-message.user {
  justify-self: end;
  max-width: calc(100% - 24px);
  background: rgba(125, 220, 255, 0.11);
  border-color: rgba(125, 220, 255, 0.22);
}

.agent-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(147, 170, 203, 0.16);
  border-bottom: 0;
}

.agent-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.agent-mode {
  display: grid;
  gap: 6px;
  padding: 10px 12px 0;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-mode select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 24, 0.96);
  color: var(--text);
  padding: 0 8px;
}

.agent-mode-help {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.agent-mode-help p {
  margin: 0;
}

.agent-mode-help strong {
  color: var(--text);
}

.agent-form textarea {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  min-height: 92px;
  max-height: 160px;
  padding: 8px 12px;
  overflow-y: auto;
  resize: none;
}

#agentInput:focus {
  box-shadow: none;
}

.agent-send-button {
  flex-shrink: 0;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(29, 45, 67, 0.96);
  border-color: rgba(147, 170, 203, 0.34);
}

.agent-token-usage {
  flex: 1 1 auto;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.agent-attach-button {
  flex-shrink: 0;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius);
  color: var(--dim);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.agent-attach-button:hover {
  color: var(--text);
  border-color: rgba(147, 170, 203, 0.34);
}

.agent-attach-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agent-image-preview {
  display: flex;
  gap: 8px;
  padding: 0 0 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.agent-image-preview:not([hidden]) {
  display: flex;
}

.agent-image-preview-item {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(147, 170, 203, 0.24);
}

.agent-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-image-preview-item.is-summary {
  width: 150px;
  padding: 8px 24px 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  background: rgba(11, 18, 31, 0.92);
}

.agent-image-preview-file,
.agent-image-preview-file-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-image-preview-file {
  color: #e8effd;
  font-size: 12px;
}

.agent-image-preview-file-meta {
  color: #9fb0c9;
  font-size: 10px;
}

.agent-image-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  border: none;
  cursor: pointer;
  opacity: 1;
  z-index: 2;
}

.agent-image-preview-remove svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.agent-form.is-dragover {
  border-top-color: rgba(125, 220, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(125, 220, 255, 0.4);
}

.agent-message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.agent-message-images img {
  max-width: 100%;
  max-height: 320px;
  min-width: 0;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid rgba(147, 170, 203, 0.16);
}

.user .agent-message-images img {
  max-height: 200px;
  max-width: min(260px, 100%);
}

.agent-image-card {
  margin: 0 0 8px;
  border: 1px solid rgba(147, 170, 203, 0.18);
  border-radius: 6px;
  background: rgba(7, 11, 20, 0.58);
  overflow: hidden;
}

.agent-image-card-summary {
  min-height: 30px;
  padding: 7px 10px;
  color: #c8d6ec;
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
}

.agent-image-card-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.agent-image-card-item {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.agent-image-card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: #e8effd;
  font-size: 12px;
}

.agent-image-card-title strong,
.agent-image-card-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-image-card-title span {
  flex-shrink: 0;
  color: #9fb0c9;
}

.agent-image-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.agent-image-card-tags span {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(125, 220, 255, 0.1);
  color: #aee9ff;
  font-size: 10px;
  line-height: 1.2;
}

.agent-image-card-notes {
  margin: 0;
  color: #b5c4dc;
  font-size: 11px;
  line-height: 1.45;
}

.agent-image-card-evidence {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-image-card-evidence li {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9fb0c9;
  font-size: 10px;
  line-height: 1.25;
}

.agent-image-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  margin: 0;
}

.agent-image-card-metrics dt,
.agent-image-card-metrics dd {
  margin: 0;
  min-width: 0;
  font-size: 10px;
  line-height: 1.2;
}

.agent-image-card-metrics dt {
  color: #8293ae;
}

.agent-image-card-metrics dd {
  color: #e8effd;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-image-card-url {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8293ae;
  font-size: 10px;
}

.agent-send-button:hover {
  border-color: var(--accent);
}

.agent-send-arrow {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agent-send-stop {
  display: none;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: currentColor;
}

.agent-send-button.is-busy .agent-send-arrow {
  display: none;
}

.agent-send-button.is-busy .agent-send-stop {
  display: block;
}

.observation-stats .metric {
  min-height: 54px;
}

.observation-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.node-card {
  cursor: pointer;
  color: var(--text);
  text-align: left;
}

.node-card.active {
  border-color: rgba(124, 228, 176, 0.45);
}

.node-card:focus-visible {
  outline: 2px solid rgba(125, 220, 255, 0.62);
  outline-offset: 2px;
}

.node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.node-action {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(13, 23, 38, 0.76);
}

.node-action:hover,
.node-action:focus-visible {
  color: var(--text);
  border-color: rgba(125, 220, 255, 0.42);
}

.node-action.danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.28);
}

.node-action.danger:hover,
.node-action.danger:focus-visible {
  border-color: rgba(248, 113, 113, 0.58);
  background: rgba(248, 113, 113, 0.12);
}

.node-action-note {
  color: var(--dim);
  font-size: 11px;
}

#logsOutput,
.observation-snapshot {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(147, 170, 203, 0.14);
  border-radius: var(--radius);
  background: rgba(3, 8, 15, 0.72);
  padding: 10px;
  color: var(--muted);
  white-space: pre-wrap;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.observation-snapshot {
  max-height: 280px;
}

@media (max-width: 1120px) {
  .space-frame {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(620px, 1fr) 360px;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

}

@media (max-width: 820px) {
  .os-shell {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .launcher {
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: 58px minmax(0, auto) 1fr auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .space-frame {
    grid-template-rows: minmax(760px, 1fr) 360px;
  }

  .space-title {
    top: 12px;
  }

  .resources-widget,
  .topology-widget,
  .studio-widget,
  .browser-widget,
  .drop-widget {
    left: 14px;
    right: 14px;
    width: auto;
  }

  .resources-widget {
    top: 58px;
  }

  .topology-widget {
    top: 370px;
    height: 260px;
  }

  .studio-widget {
    top: 648px;
    bottom: auto;
  }

  .browser-widget {
    top: 958px;
    bottom: auto;
  }

  .drop-widget {
    display: none;
  }
}
