:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

html {
  height: 100%;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.version-refresh-hint {
  position: fixed;
  z-index: 100;
  top: calc(64px + env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  max-width: calc(100vw - 28px);
  padding: 9px 13px;
  border: 1px solid #d49a17;
  border-radius: 999px;
  background: #fff4c2;
  box-shadow: 0 8px 24px rgba(90, 61, 0, 0.2);
  color: #5f4300;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  animation: message-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.version-refresh-hint:hover {
  background: #ffe998;
}

.version-refresh-hint:focus-visible {
  outline: 3px solid rgba(212, 154, 23, 0.32);
  outline-offset: 2px;
}

.shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-inline: 0;
}

.shell.game-shell {
  position: relative;
  width: 100vw;
  max-width: none;
  border-inline: 0;
  background: #111827;
}

.game-shell .topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 8;
  border-bottom-color: rgba(216, 222, 228, 0.3);
  background: rgba(251, 252, 253, 0.9);
  backdrop-filter: blur(14px);
}

.game-shell .topbar,
.game-shell .game-workbench-header,
.game-shell .game-tools-panel,
.game-shell .game-sync-debug-panel,
.game-shell .game-scene-reconnect-card {
  backdrop-filter: none;
}

.game-shell .game-workbench-header,
.game-shell .game-tools-panel,
.game-shell .game-sync-debug-panel {
  contain: layout paint style;
}

.topbar {
  position: relative;
  z-index: 10;
  min-height: 50px;
  padding: 7px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #d8dee4;
  background: #fbfcfd;
}

.topbar-left-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-icon-button {
  width: 36px;
  height: 36px;
  display: block;
  position: relative;
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
  padding: 0;
}

.settings-icon-button span {
  position: absolute;
  inset: 9px 8px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.settings-icon-button span::before {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 6px;
  width: 2px;
  background: currentColor;
}

.settings-icon-button span::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 3px;
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.brand {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.chatbee-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.client-version {
  flex: 0 0 auto;
  border: 1px solid #ccd4dd;
  border-radius: 6px;
  padding: 1px 5px;
  color: #5d6b7a;
  background: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center; gap: 6px;
}

.server-dashboard {
  position: absolute;
  z-index: 40;
  top: 58px;
  right: 12px;
  width: min(390px, calc(100% - 24px));
  max-height: calc(100dvh - 70px);
  display: flex;
  flex-direction: column;
  border: 1px solid #cbd8e5;
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 12px 30px rgba(28, 50, 72, .18);
  color: #243b53;
}
.server-dashboard > header { flex: none; display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #e1e8ef; }
.server-dashboard > header div { display: grid; gap: 2px; }
.server-dashboard > header span { color: #718096; font-size: 11px; }
.server-dashboard > header button { padding: 0 5px; }
.server-dashboard-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; font-size: 12px; }
.server-dashboard-empty { color: #718096; }
.server-dashboard-empty.is-error { color: #b42318; }
.server-dashboard-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.server-dashboard-summary div { display: grid; gap: 2px; padding: 8px; border-radius: 6px; background: #f4f7fa; }
.server-dashboard-summary span, .server-dashboard-disk header span { color: #718096; font-size: 10px; }
.server-dashboard-disk { margin-top: 14px; }
.server-dashboard-disk header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.server-dashboard-meter { height: 7px; overflow: hidden; border-radius: 99px; background: #e5edf4; }
.server-dashboard-meter span { display: block; height: 100%; border-radius: inherit; background: #27865c; }
.server-dashboard-disk ul { display: grid; gap: 4px; margin: 9px 0 0; padding: 0; list-style: none; }
.server-dashboard-disk li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #eef2f6; }
.server-dashboard-usage { padding-top: 12px; border-top: 1px solid #e1e8ef; }
.server-dashboard-disk .server-dashboard-window { flex-wrap: wrap; gap: 2px 8px; margin: 9px 0 4px; }
.server-dashboard-disk li small { color: #8a9aaa; font-size: 10px; }
.server-dashboard-body > .server-dashboard-usage:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.usage-reset { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: help; text-decoration: underline dotted; text-underline-offset: 2px; } .usage-reset .usage-reset-exact, .usage-reset:hover .usage-reset-relative, .usage-reset.is-exact .usage-reset-relative { display: none; } .usage-reset:hover .usage-reset-exact, .usage-reset.is-exact .usage-reset-exact { display: inline; }
.status-store { display: none; }

#threadIdValue {
  cursor: pointer;
}

#codexUsageValue {
  cursor: pointer;
}

#threadIdValue.expanded {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

h1,
h2,
p {
  margin: 0;
}

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

.topbar p {
  margin-top: 1px;
  color: #5d6b7a;
  font-size: 12px;
  line-height: 1.25;
}

button {
  border: 1px solid #1f6feb;
  border-radius: 6px;
  background: #1f6feb;
  color: #ffffff;
  padding: 9px 14px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

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

button:not(:disabled):active {
  transform: translateY(1px);
}

.login-panel {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 24px;
}

.login-panel form {
  width: min(100%, 360px);
  display: grid;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #ccd4dd;
  border-radius: 6px;
  padding: 11px 12px;
  background: #ffffff;
  color: #17202a;
}

textarea {
  resize: vertical;
}

.error {
  min-height: 20px;
  color: #b42318;
  white-space: pre-line;
}

.project-panel {
  height: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
}

.creative-tools-panel {
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(280px, 520px);
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #d8dee4;
  background: #f2f6fb;
}

.creative-tools-panel h2 {
  margin: 0;
  font-size: 16px;
}

.creative-tools-panel p {
  margin-top: 3px;
  color: #5d6b7a;
  font-size: 12px;
}

.creative-tool-card {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-color: #9cc5ee;
  background: #ffffff;
  color: #17202a;
  text-align: left;
}

.creative-tool-card:hover {
  border-color: #1f6feb;
  background: #f7fbff;
}

.creative-tool-card > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.creative-tool-card strong {
  color: #174f85;
  font-size: 13px;
}

.creative-tool-card small {
  overflow: hidden;
  color: #5d6b7a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-tool-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #7c3aed, #2563eb);
  color: #ffffff;
  font-size: 18px;
}

.motion-page {
  overflow: hidden;
  background: #0f1720;
}

.motion-shell {
  width: 100vw;
  height: 100lvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: #e8eef5;
  background: #111923;
}

.motion-topbar {
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #344353;
  background: #17212b;
}

.motion-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.motion-brand h1 {
  font-size: 18px;
}

.motion-brand p {
  margin-top: 2px;
  color: #8fa0b2;
  font-size: 11px;
}

.motion-brand button,
.motion-toolbar button {
  border-color: #425365;
  background: #202d39;
  color: #e8eef5;
}

.motion-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.motion-toolbar button:first-of-type {
  border-color: #397cc2;
  background: #1f6feb;
  color: #ffffff;
}

.motion-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 248px minmax(320px, 1fr) 258px;
  overflow: hidden;
}

.motion-frames-panel,
.motion-inspector,
.motion-canvas-panel {
  min-width: 0;
  min-height: 0;
}

.motion-frames-panel,
.motion-inspector {
  display: flex;
  flex-direction: column;
  background: #17212b;
}

.motion-frames-panel {
  border-right: 1px solid #344353;
}

.motion-inspector {
  border-left: 1px solid #344353;
}

.motion-frames-panel > header,
.motion-inspector > header {
  min-height: 48px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #344353;
}

.motion-frames-panel > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.motion-frames-panel > header > .motion-layer-actions {
  gap: 4px;
}

.motion-frames-panel > header span,
.motion-inspector > header span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #253545;
  color: #9ec5fe;
  font-size: 10px;
}

.motion-frames-panel > header button {
  padding: 5px 8px;
  border-color: #425365;
  background: transparent;
  color: #aab8c6;
  font-size: 10px;
}

.motion-frame-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.motion-frame-card {
  min-width: 0;
  padding: 7px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #344353;
  border-radius: 8px;
  background: #1d2935;
  cursor: pointer;
}

.motion-frame-card.selected {
  border-color: #4d9cf0;
  box-shadow: inset 0 0 0 1px rgba(77, 156, 240, 0.5);
}

.motion-frame-thumbnail {
  grid-row: span 2;
  width: 54px;
  height: 54px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f1f5f9;
}

.motion-frame-thumbnail svg {
  width: 100%;
  height: 100%;
}

.motion-frame-thumbnail .motion-group-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px dashed #7b8fa3;
  border-radius: 7px;
  color: #52677c;
  font-size: 11px;
  font-weight: 700;
}

.motion-frame-card > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.motion-frame-card strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.motion-frame-card span {
  color: #91a2b3;
  font-size: 9px;
}

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

.motion-frame-actions button {
  width: 25px;
  height: 23px;
  padding: 0;
  border-color: #425365;
  background: #17212b;
  color: #b7c4d1;
  font-size: 12px;
}

.motion-canvas-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background-color: #202b36;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.motion-stage-wrap {
  min-height: 0;
  padding: clamp(16px, 4vw, 54px);
  display: grid;
  place-items: center;
  overflow: auto;
}

.motion-stage {
  position: relative;
  width: min(70vh, 100%);
  max-width: 720px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  background: #eef2f7;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.motion-stage-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform-origin: center;
}

.motion-stage-layer svg {
  width: 100%;
  height: 100%;
}

.motion-stage-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 24px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #415265;
  text-align: center;
}

.motion-stage-empty[hidden] {
  display: none;
}

.motion-stage-empty strong {
  color: #17202a;
  font-size: 18px;
}

.motion-stage-empty span {
  max-width: 300px;
  font-size: 12px;
}

.motion-stage-empty button {
  margin-top: 6px;
  border-color: #1f6feb;
  background: #1f6feb;
  color: #ffffff;
}

.motion-playback {
  min-width: 0;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto auto minmax(90px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #344353;
  background: #17212b;
}

.motion-playback button {
  border-color: #425365;
  background: #202d39;
  color: #e8eef5;
}

.motion-playback button:first-child {
  min-width: 68px;
  border-color: #397cc2;
  background: #1f6feb;
}

.motion-playback input[type="range"] {
  accent-color: #4d9cf0;
}

.motion-playback span,
.motion-playback label {
  color: #aab8c6;
  font-size: 10px;
  white-space: nowrap;
}

.motion-playback label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.motion-playback input[type="checkbox"] {
  width: auto;
}

.motion-inspector-fields {
  padding: 12px;
  display: grid;
  gap: 11px;
}

.motion-inspector-fields label {
  display: grid;
  gap: 5px;
}

.motion-inspector-fields label > span {
  color: #91a2b3;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.motion-inspector-fields input,
.motion-inspector-fields select {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #425365;
  border-radius: 6px;
  background: #111923;
  color: #e8eef5;
  font-size: 12px;
}

.motion-inspector-fields input[type="color"] {
  height: 38px;
  padding: 4px;
}

.motion-unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
}

.motion-unit-input input {
  border-radius: 6px 0 0 6px;
}

.motion-unit-input span {
  align-self: stretch;
  display: grid;
  place-items: center;
  border: 1px solid #425365;
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #253545;
  color: #91a2b3;
  font-size: 9px;
}

.motion-help {
  margin: auto 12px 0;
  padding: 10px;
  border: 1px solid #344353;
  border-radius: 7px;
  background: #1d2935;
  color: #91a2b3;
  font-size: 10px;
  line-height: 1.45;
}

.motion-inspector > .error {
  margin: 8px 12px 12px;
  color: #fca5a5;
  font-size: 10px;
}

@media (max-width: 920px) {
  .motion-workspace {
    grid-template-columns: 190px minmax(300px, 1fr);
    grid-template-rows: minmax(280px, 1fr) auto;
    overflow: auto;
  }

  .motion-frames-panel {
    grid-row: 1 / 3;
  }

  .motion-inspector {
    grid-column: 2;
    grid-row: 2;
    max-height: 250px;
    overflow-y: auto;
    border-top: 1px solid #344353;
    border-left: 0;
  }

  .motion-inspector-fields {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .motion-help {
    margin-top: 0;
  }
}

@media (max-width: 700px) {
  .creative-tools-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .motion-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .motion-toolbar {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .motion-workspace {
    grid-template-columns: 122px minmax(260px, 1fr);
  }

  .motion-frame-card {
    grid-template-columns: 1fr;
  }

  .motion-frame-thumbnail {
    grid-row: auto;
    width: 100%;
    height: 70px;
  }

  .motion-frame-actions {
    flex-wrap: wrap;
  }

  .motion-inspector {
    min-width: 260px;
  }

  .motion-inspector-fields {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .motion-playback {
    grid-template-columns: auto auto minmax(70px, 1fr);
  }

  .motion-playback span,
  .motion-playback label {
    display: none;
  }
}

.motion-mode-switch {
  flex: 0 0 auto;
  padding: 3px;
  display: flex;
  gap: 2px;
  border: 1px solid #425365;
  border-radius: 8px;
  background: #111923;
}

.motion-mode-switch button {
  min-width: 78px;
  border: 0;
  background: transparent;
  color: #91a2b3;
}

.motion-mode-switch button.active {
  background: #315f91;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.motion-stage-parts,
.motion-stage-part {
  position: absolute;
  inset: 0;
}

.motion-stage-parts {
  z-index: 2;
}

.motion-stage-part {
  transform-origin: center;
  pointer-events: none;
  touch-action: none;
  will-change: transform, opacity;
}

.motion-stage-graphic {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  transform-origin: center;
  pointer-events: none;
}

.motion-stage-graphic > svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
  pointer-events: none;
}

.motion-stage-group-handle {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: none;
  place-items: center;
  border: 2px dashed #1f6feb;
  border-radius: 8px;
  background: rgba(234, 243, 255, 0.92);
  color: #174f85;
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
}

.motion-stage-part.group.selected > .motion-stage-group-handle {
  display: grid;
}

.motion-stage-part.group.locked > .motion-stage-group-handle {
  cursor: not-allowed;
}

.motion-stage-part svg * {
  pointer-events: visiblePainted;
  cursor: grab;
}

.motion-stage-part.locked svg * {
  cursor: not-allowed;
}

.motion-stage-part.selected > .motion-stage-graphic > svg {
  filter: drop-shadow(0 0 2px #0b5fff) drop-shadow(0 0 1px #ffffff);
}

.motion-dragging,
.motion-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.motion-part-row.muted {
  opacity: 0.55;
}

.motion-part-row {
  padding-left: calc(7px + (var(--motion-depth, 0) * 12px));
}

.motion-part-row.dragging {
  opacity: 0.35;
}

.motion-part-row.parent-drop-target,
.motion-root-drop-zone.parent-drop-target {
  border-color: #1f6feb;
  background: #eaf3ff;
  box-shadow: inset 0 0 0 1px #1f6feb;
}

.motion-root-drop-zone {
  margin: 8px 8px 0;
  padding: 7px 8px;
  border: 1px dashed #526273;
  border-radius: 6px;
  color: #91a2b3;
  font-size: 9px;
  text-align: center;
}

.motion-part-row[style*="--motion-depth: 0"] {
  border-left-color: #526273;
}

.motion-part-row .motion-frame-actions {
  flex-wrap: wrap;
}

.motion-timeline-panel {
  min-width: 0;
  min-height: 190px;
  height: clamp(210px, 29vh, 310px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-top: 1px solid #344353;
  background: #111923;
}

.motion-page[data-mode="design"] .motion-timeline-panel {
  display: none;
}

.motion-page[data-mode="animate"] .motion-stage {
  width: min(48vh, 100%);
}

.motion-timeline-toolbar {
  min-width: 0;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid #344353;
  background: #17212b;
}

.motion-timeline-toolbar button {
  padding: 7px 9px;
  border-color: #425365;
  background: #202d39;
  color: #e8eef5;
  white-space: nowrap;
}

.motion-timeline-toolbar button.primary {
  min-width: 62px;
  border-color: #397cc2;
  background: #1f6feb;
}

.motion-timeline-toolbar input[type="range"] {
  min-width: 110px;
  flex: 1 1 160px;
  accent-color: #4d9cf0;
}

.motion-timeline-toolbar > span,
.motion-timeline-toolbar > label {
  color: #aab8c6;
  font-size: 10px;
  white-space: nowrap;
}

.motion-timeline-toolbar > label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.motion-timeline-toolbar input[type="checkbox"],
.motion-part-toggles input {
  width: auto;
}

.motion-timeline-scroll {
  --timeline-width: 960px;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.motion-timeline-ruler {
  position: sticky;
  top: 0;
  z-index: 4;
  width: var(--timeline-width);
  height: 28px;
  border-bottom: 1px solid #344353;
  background: #17212b;
}

.motion-timeline-ruler::before {
  content: "Time";
  position: absolute;
  left: 10px;
  top: 8px;
  color: #91a2b3;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.motion-timeline-ruler span {
  position: absolute;
  top: 7px;
  color: #8394a5;
  font-size: 9px;
  transform: translateX(-50%);
}

.motion-timeline-ruler span::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 1px;
  height: 7px;
  background: #526273;
}

.motion-timeline-tracks {
  width: var(--timeline-width);
  display: grid;
  align-content: start;
}

.motion-timeline-track {
  height: 36px;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  border-bottom: 1px solid #263441;
}

.motion-timeline-track > button {
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid #344353;
  border-radius: 0;
  padding: 0 8px 0 calc(10px + (var(--motion-depth, 0) * 11px));
  background: #17212b;
  color: #aab8c6;
  font-size: 10px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.motion-timeline-track.selected > button {
  color: #ffffff;
  background: #24415d;
}

.motion-timeline-lane {
  position: relative;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(145, 162, 179, 0.16) calc(10% - 1px),
    rgba(145, 162, 179, 0.16) 10%
  );
}

.motion-keyframe-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid #8dc5ff;
  border-radius: 2px;
  padding: 0;
  background: #4d9cf0;
  transform: translate(-50%, -50%) rotate(45deg);
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.motion-keyframe-marker::before {
  content: "";
  position: absolute;
  inset: -8px;
}

.motion-keyframe-marker.dragging,
.motion-keyframe-dragging .motion-keyframe-marker {
  cursor: grabbing;
}

.motion-keyframe-marker.selected {
  border-color: #ffffff;
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.motion-keyframe-marker[data-easing="gentleSpring"],
.motion-keyframe-marker[data-easing="slowSpring"] {
  border-color: #8a63d2;
  background: #8a63d2;
}

.motion-keyframe-marker[data-easing="bouncy"] {
  border-color: #d97706;
  border-radius: 50%;
  background: #f59e0b;
}

.motion-keyframe-marker.selected {
  border-color: #ffffff;
  background: #f59e0b;
}

.motion-timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 1px;
  background: #ff5d73;
  pointer-events: none;
}

.motion-timeline-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border-top: 8px solid #ff5d73;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
}

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

.motion-transform-grid label {
  min-width: 0;
}

.motion-part-toggles {
  display: flex;
  align-items: center;
  gap: 14px;
}

.motion-part-toggles label {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 5px;
  color: #aab8c6;
  font-size: 11px;
}

.motion-keyframe-readout {
  margin: 0 12px 10px;
  padding: 9px 10px;
  border: 1px solid #315f91;
  border-radius: 7px;
  background: #172f48;
  color: #b9d8fa;
  font-size: 10px;
  line-height: 1.4;
}

.motion-svg-info {
  margin: 0;
  padding: 9px;
  display: grid;
  gap: 5px;
  border: 1px solid #344353;
  border-radius: 7px;
  background: #1d2935;
  font-size: 10px;
}

.motion-svg-info div {
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 7px;
}

.motion-svg-info dt,
.motion-svg-info dd {
  margin: 0;
  min-width: 0;
}

.motion-svg-info dt {
  color: #91a2b3;
}

.motion-svg-info dd {
  overflow: hidden;
  color: #dce7f2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .motion-topbar {
    flex-wrap: wrap;
  }

  .motion-toolbar {
    flex: 1 1 100%;
  }
}

@media (max-width: 920px) {
  .motion-timeline-panel {
    height: 230px;
  }

  .motion-inspector-fields {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .motion-transform-grid {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .motion-mode-switch {
    align-self: flex-start;
  }

  .motion-toolbar {
    flex: 0 0 auto;
  }

  .motion-timeline-panel {
    min-height: 185px;
    height: 210px;
  }

  .motion-inspector-fields {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .motion-transform-grid {
    grid-column: 1 / -1;
  }
}

/* Motion Studio follows the same light visual system as ChatBee. */
.motion-page,
.motion-shell {
  background: #f4f6f8;
  color: #17202a;
}

.motion-shell {
  border-inline: 1px solid #d8dee4;
}

.motion-topbar {
  border-bottom-color: #d8dee4;
  background: #fbfcfd;
}

.motion-brand p,
.motion-playback span,
.motion-playback label {
  color: #5d6b7a;
}

.motion-brand button,
.motion-toolbar button,
.motion-timeline-toolbar button {
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
}

.motion-toolbar button:first-of-type,
.motion-timeline-toolbar button.primary {
  border-color: #1f6feb;
  background: #1f6feb;
  color: #ffffff;
}

.motion-mode-switch {
  border-color: #ccd4dd;
  background: #eef2f7;
}

.motion-mode-switch button {
  color: #5d6b7a;
}

.motion-mode-switch button.active {
  background: #ffffff;
  color: #1f6feb;
  box-shadow: 0 1px 3px rgba(23, 32, 42, 0.16);
}

.motion-frames-panel,
.motion-inspector,
.motion-timeline-panel,
.motion-timeline-toolbar,
.motion-timeline-ruler,
.motion-timeline-track > button {
  background: #fbfcfd;
}

.motion-frames-panel {
  border-right-color: #d8dee4;
}

.motion-inspector {
  border-left-color: #d8dee4;
}

.motion-frames-panel > header,
.motion-inspector > header,
.motion-timeline-panel,
.motion-timeline-toolbar,
.motion-timeline-ruler,
.motion-timeline-track {
  border-color: #d8dee4;
}

.motion-frames-panel > header span,
.motion-inspector > header span {
  background: #eaf3ff;
  color: #1f6feb;
}

.motion-frames-panel > header button {
  border-color: #ccd4dd;
  background: #ffffff;
  color: #5d6b7a;
}

.motion-frame-card {
  border-color: #d8dee4;
  background: #ffffff;
}

.motion-frame-card.selected {
  border-color: #1f6feb;
  background: #f5f9ff;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.35);
}

.motion-frame-card span,
.motion-root-drop-zone {
  color: #5d6b7a;
}

.motion-root-drop-zone {
  border-color: #aab7c4;
  background: #ffffff;
}

.motion-frame-actions button {
  border-color: #ccd4dd;
  background: #f8fafc;
  color: #475569;
}

.motion-canvas-panel {
  background-color: #e8edf3;
  background-image:
    linear-gradient(45deg, rgba(23, 32, 42, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 32, 42, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(23, 32, 42, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(23, 32, 42, 0.035) 75%);
}

.motion-stage {
  border-color: #ccd4dd;
  box-shadow: 0 16px 42px rgba(23, 32, 42, 0.18);
}

.motion-timeline-toolbar > span,
.motion-timeline-toolbar > label,
.motion-timeline-ruler span {
  color: #5d6b7a;
}

.motion-timeline-track > button {
  border-right-color: #d8dee4;
  color: #5d6b7a;
}

.motion-timeline-track.selected > button {
  color: #174f85;
  background: #eaf3ff;
}

.motion-timeline-lane {
  background-color: #ffffff;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(93, 107, 122, 0.13) calc(10% - 1px),
    rgba(93, 107, 122, 0.13) 10%
  );
}

.motion-inspector-fields label > span,
.motion-svg-info dt {
  color: #5d6b7a;
}

.motion-inspector-fields input,
.motion-inspector-fields select {
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
}

.motion-unit-input span {
  border-color: #ccd4dd;
  background: #eef2f7;
  color: #5d6b7a;
}

.motion-keyframe-readout {
  border-color: #9cc5ee;
  background: #eaf3ff;
  color: #174f85;
}

.motion-help,
.motion-svg-info {
  border-color: #d8dee4;
  background: #f8fafc;
  color: #5d6b7a;
}

.motion-svg-info dd {
  color: #17202a;
}

.motion-inspector > .error {
  color: #b42318;
}

.project-header {
  min-height: 58px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #d8dee4;
  background: #ffffff;
}

.project-header h2 {
  font-size: 20px;
}

.project-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.project-header p,
.project-card p,
.project-card small,
.side-panel-project span {
  color: #5d6b7a;
}

.project-create-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 42, 0.36);
  animation: dialog-fade-in 150ms ease-out;
}

.project-create-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(23, 32, 42, 0.24);
  animation: dialog-panel-in 170ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-create-header h2 {
  font-size: 18px;
}

.project-create-header button {
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
}

.project-create-panel label {
  display: grid;
  gap: 6px;
  color: #5d6b7a;
  font-size: 12px;
  font-weight: 700;
}

.project-create-actions {
  display: flex;
  justify-content: flex-end;
}

.project-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
  gap: 12px;
}

.project-card {
  min-height: 154px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 8px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  padding: 13px;
  background: #ffffff;
}

.project-card.active {
  border-color: #1f6feb;
  box-shadow: inset 0 0 0 1px #1f6feb;
}

.project-card.admin-project {
  border-color: #8a63d2;
}

.project-card.admin-project.active {
  border-color: #6f42c1;
  box-shadow: inset 0 0 0 1px #6f42c1;
}

.project-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.project-card p {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.project-card small {
  font-size: 12px;
}

.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.project-card-actions button {
  min-width: 112px;
  white-space: nowrap;
}

.project-delete {
  min-width: 86px;
  border-color: #d0d7de;
  background: #ffffff;
  color: #b42318;
}

.project-empty {
  margin: 0;
  color: #5d6b7a;
}

.project-panel > .error {
  padding: 0 18px 14px;
  background: #f8fafc;
}

.side-panel-project {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d8dee4;
  background: #f8fafc;
}

.side-panel-project div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.side-panel-project strong,
.side-panel-project span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel-project strong {
  font-size: 13px;
}

.side-panel-project span {
  font-size: 12px;
}

.chat-panel {
  position: relative;
  height: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
}

.chat-panel.game-chat {
  display: block;
  isolation: isolate;
  background: #111827;
}

.game-shell .chat-panel.game-chat {
  overflow: visible;
}

.chat-workspace {
  --chat-reading-width: 760px;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.graphtee-workspace-open:not(.game-chat) {
  flex-direction: row;
}

.chat-panel.graphtee-workspace-open:not(.game-chat) > .chat-workspace {
  order: 3;
  height: auto;
  width: auto;
  flex: 1 1 0;
}

.chat-panel:not(.game-chat) > .graphtee-workspace {
  order: 1;
  width: auto;
  height: 100%;
  min-width: 0;
  flex: 0 0 calc(var(--graphtee-divider-position, 50%) - 5px);
  border-right: 1px solid #ccd4dd;
  border-left: 0;
  box-shadow: none;
}

.graphtee-workspace {
  position: relative;
  z-index: 3;
  width: min(58vw, 760px);
  min-width: 420px;
  min-height: 0;
  flex: 0 0 auto;
  display: block;
  overflow: hidden;
  border-left: 1px solid #ccd4dd;
  background: #ffffff;
  box-shadow: -12px 0 34px rgba(30, 49, 72, 0.08);
}

.graphtee-workspace[hidden] {
  display: none;
}

.graphtee-workspace-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 8;
  height: 36px;
  pointer-events: none;
}

.graphtee-workspace-header strong {
  color: #1d2d3f;
  font-size: 12px;
}

.graphtee-workspace-header span,
.graphtee-pointer span {
  min-width: 0;
  overflow: hidden;
  color: #65768a;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-workspace-heading {
  position: absolute;
  top: 4px;
  left: 7px;
  z-index: 2;
  max-width: min(220px, calc(100% - 72px));
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}

.devtee-workspace-heading[hidden] {
  display: none;
}

.devtee-workspace-heading[data-connection="Reconnecting"]::after {
  content: "Reconnecting…";
  padding: 2px 7px;
  border-radius: 999px;
  background: #fdecc8;
  color: #7a4b00;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.devtee-scope-bar {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 12px;
  border-bottom: 1px solid #dce5ee;
  background: #f7fafd;
}

.devtee-scope-bar[hidden] {
  display: none;
}

.devtee-scope-bar-label {
  color: #52657a;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.devtee-workspace-heading strong,
.devtee-workspace-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-scope-control {
  display: inline-flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  pointer-events: auto;
  color: #52657a;
  font-size: 10px;
  font-weight: 650;
}

.devtee-scope-control[hidden] {
  display: none;
}

.devtee-scope-control select {
  min-height: 24px;
  padding: 2px 22px 2px 6px;
  border: 1px solid #c9d5e3;
  border-radius: 6px;
  background: #fff;
  color: #24384d;
  font: inherit;
}

.devtee-scope-control small {
  max-width: 240px;
  overflow: hidden;
  color: #66798d;
  font-size: 9.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: normal;
}

.devtee-scope-control[data-scope="infra"] select {
  border-color: #d59a55;
  background: #fff8ec;
  color: #824b08;
}

.devtee-scope-control[data-scope="infra"] small {
  color: #824b08;
}

.graphtee-workspace-header button {
  min-height: 28px;
  padding: 4px 8px;
  flex: 0 0 auto;
  border-color: #d5dee8;
  background: #ffffff;
  color: #365675;
  font-size: 11px;
  pointer-events: auto;
}

.graphtee-history-button {
  min-height: 36px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-color: #ccd4dd;
  background: #ffffff;
  color: #365675;
  font-size: 11px;
}

.graphtee-history-button span {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e7eef6;
  color: #365675;
  text-align: center;
}

.graphtee-history-button #graphTeeHistoryLabel {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.graphtee-history-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 12;
  width: min(320px, calc(100vw - 24px));
  max-height: min(55vh, 420px);
  padding: 8px;
  overflow: auto;
  border: 1px solid #cfd9e4;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(30, 49, 72, 0.18);
  pointer-events: auto;
}

.graphtee-history-menu[hidden] {
  display: none;
}

.graphtee-history-menu > strong {
  display: block;
  padding: 2px 3px 7px;
}

#graphTeeCloseButton {
  position: absolute;
  top: 4px;
  right: 7px;
  z-index: 2;
}

#graphTeeClearPointerButton {
  position: absolute;
  top: 80px;
  right: 10px;
  z-index: 2;
  min-width: 58px;
  box-shadow: 0 4px 12px rgba(30, 49, 72, 0.12);
}

.graphtee-list {
  min-width: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  border: 0;
  background: transparent;
}

.canvas-file-group {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.canvas-file-group + .canvas-file-group {
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid #e2e8ef;
}

.canvas-file-group-heading {
  padding: 0 3px;
  color: #718297;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.canvas-file-empty {
  margin: 0;
  padding: 7px 4px;
  color: #718297;
  font-size: 11px;
  line-height: 1.4;
}

.graphtee-list-item {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  overflow: hidden;
  border-color: #d5dee8;
  border-radius: 7px;
  background: #ffffff;
  color: #47627e;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-file-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  white-space: normal;
}

.graphtee-history-menu .canvas-file-kind {
  min-width: 53px;
  padding: 3px 5px;
  border-radius: 999px;
  background: #e9eff6;
  color: #385a7c;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.graphtee-history-menu .canvas-file-kind[data-kind="devtee"] {
  background: #ede9fe;
  color: #6246a5;
}

.graphtee-history-menu .canvas-file-details,
.graphtee-history-menu .canvas-file-details strong,
.graphtee-history-menu .canvas-file-details small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graphtee-history-menu .canvas-file-details strong {
  color: inherit;
  font-size: 11px;
}

.graphtee-history-menu .canvas-file-details small {
  margin-top: 1px;
  color: #718297;
  font-size: 9.5px;
}

.graphtee-list-item.selected {
  border-color: #77aee8;
  background: #eaf3fd;
  color: #174f85;
}

.graphtee-stage {
  position: relative;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fbfcfe;
}

.devtee-project-update-hint {
  position: absolute;
  z-index: 30;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  max-width: calc(100% - 24px);
  padding: 9px 13px;
  border: 1px solid #4d91d1;
  border-radius: 999px;
  background: #e9f4ff;
  box-shadow: 0 8px 24px rgba(22, 74, 119, 0.2);
  color: #174f85;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.devtee-project-update-hint:hover {
  background: #d9ebfd;
}

.devtee-project-update-hint:focus-visible {
  outline: 3px solid rgba(77, 145, 209, 0.3);
  outline-offset: 2px;
}

.devtee-project-update-hint:disabled {
  cursor: wait;
  opacity: 0.75;
}

.graphtee-stage .graphtee-card,
.graphtee-stage .graphtee-card.expanded {
  position: relative;
  height: 100%;
  margin: 0;
  grid-template-rows: 36px minmax(0, 1fr) auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.graphtee-stage .graphtee-card-header {
  position: relative;
  min-height: 36px;
  padding: 4px 52px 4px 88px;
  gap: 7px;
}

.graphtee-stage .graphtee-heading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  max-width: 32%;
  transform: translate(-50%, -50%);
  display: block;
  text-align: center;
}

.graphtee-stage .graphtee-heading strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graphtee-stage .graphtee-heading span {
  display: none;
}

.graphtee-stage .graphtee-card-actions {
  position: absolute;
  top: 44px;
  right: 10px;
  z-index: 2;
  width: auto;
  margin: 0;
  padding: 1px;
  flex-wrap: nowrap;
  background: rgba(247, 249, 251, 0.94);
  box-shadow: 0 4px 12px rgba(30, 49, 72, 0.12);
}

.graphtee-stage .graphtee-card-actions button {
  min-height: 26px;
  padding: 3px 7px;
}

.graphtee-stage .graphtee-card-actions button.selected,
.graphtee-stage .graphtee-card-actions button[aria-pressed="true"] {
  background: #dcecff;
  color: #174f85;
}

.graphtee-stage .graphtee-zoom-controls {
  min-height: 26px;
}

.graphtee-stage .graphtee-zoom {
  display: inline-block;
}

.graphtee-stage .graphtee-zoom-controls button {
  min-height: 24px;
}

.graphtee-stage .graphtee-card-actions > button:last-child {
  display: none;
}

.graphtee-stage .graphtee-detail {
  position: static;
  min-height: 30px;
  padding: 5px 9px;
  align-items: baseline;
  flex-direction: row;
  gap: 6px;
  border: 0;
  border-top: 1px solid #dbe3ec;
  border-radius: 0;
  background: #fbfcfe;
  box-shadow: none;
}

.graphtee-stage .graphtee-detail span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graphtee-card.graphtee-editing .graphtee-detail {
  flex-wrap: wrap;
  align-items: center;
}

.graphtee-editor {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 92px auto;
  align-items: end;
  gap: 6px;
}

.graphtee-editor[hidden] {
  display: none;
}

.graphtee-editor > span {
  grid-column: 1 / -1;
  color: #65768a;
  font-size: 10.5px;
}

.graphtee-editor-field {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: #536b83;
  font-size: 9.5px;
  line-height: 1.1;
}

.graphtee-editor-field > span {
  overflow: visible;
  color: inherit;
  font-size: inherit;
  text-overflow: clip;
  white-space: nowrap;
}

.graphtee-editor-field input[type="text"],
.graphtee-editor-field select {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 3px 5px;
  border: 1px solid #cbd7e3;
  border-radius: 5px;
  background: #ffffff;
  color: #213b54;
  font: inherit;
}

.graphtee-editor-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 4px 0 0;
  accent-color: #1f6feb;
}

.graphtee-editor-apply {
  min-height: 26px;
  padding: 3px 8px;
  border-color: #89b8e6;
  background: #edf5fd;
  color: #174f85;
  font-size: 10.5px;
}

.graphtee-editor-secondary {
  min-height: 26px;
  padding: 3px 8px;
  border-color: #d3dce7;
  background: #ffffff;
  color: #536b83;
  font-size: 10.5px;
}

.graphtee-editor.graphtee-style-editor {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 9px;
}

.graphtee-style-section {
  min-width: 0;
  padding: 8px;
  display: grid;
  gap: 7px;
  border: 1px solid #e0e7ee;
  border-radius: 7px;
  background: #ffffff;
}

.graphtee-style-section > strong {
  color: #344e6a;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.graphtee-style-section .graphtee-editor-field {
  grid-template-columns: minmax(0, 1fr) 108px;
  align-items: center;
  gap: 7px;
}

.graphtee-style-section .graphtee-editor-field > span {
  font-size: 10px;
}

.graphtee-color-control,
.graphtee-range-control {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 5px;
}

.graphtee-color-control {
  grid-template-columns: 26px minmax(0, 1fr);
}

.graphtee-color-control input[type="color"] {
  width: 26px;
  height: 26px;
  padding: 2px;
  border: 1px solid #cbd7e3;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
}

.graphtee-color-control input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 3px 5px;
  border: 1px solid #cbd7e3;
  border-radius: 5px;
  background: #ffffff;
  color: #213b54;
  font: inherit;
  text-transform: uppercase;
}

.graphtee-range-control {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.graphtee-range-control input[type="range"] {
  width: 100%;
  min-width: 0;
  margin: 0;
  accent-color: #5c9cf1;
}

.graphtee-range-control output {
  color: #536b83;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.graphtee-editor-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px;
}

.graphtee-editor-actions .graphtee-editor-apply {
  justify-self: stretch;
}

.graphtee-stage .graphtee-card.graphtee-styling {
  grid-template-columns: minmax(0, 1fr) 244px;
  grid-template-rows: 36px minmax(0, 1fr);
}

.graphtee-stage .graphtee-card.graphtee-styling .graphtee-card-header {
  grid-row: 1;
  grid-column: 1 / -1;
}

.graphtee-stage .graphtee-card.graphtee-styling .graphtee-viewport {
  grid-row: 2;
  grid-column: 1;
}

.graphtee-stage .graphtee-card.graphtee-styling .graphtee-detail {
  grid-row: 2;
  grid-column: 2;
  min-height: 0;
  padding: 12px 10px;
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  border-top: 0;
  border-left: 1px solid #dbe3ec;
  background: #f7f9fb;
}

.graphtee-stage .graphtee-card.graphtee-styling .graphtee-detail > strong {
  color: #243b55;
}

.graphtee-stage .graphtee-card.graphtee-styling .graphtee-detail > span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.graphtee-pointer {
  min-width: 0;
  margin-top: 7px;
  padding-top: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.graphtee-pointer span {
  flex: 1 1 auto;
}

.graphtee-resize-handle {
  position: relative;
  z-index: 5;
  width: 10px;
  height: 100%;
  min-width: 10px;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 10px;
  border: 0;
  border-inline: 1px solid #d6dee7;
  border-radius: 0;
  background: #f1f4f7;
  box-shadow: none;
  cursor: col-resize;
  touch-action: none;
}

.graphtee-resize-handle[hidden] {
  display: none;
}

.graphtee-resize-handle span {
  width: 3px;
  height: 42px;
  border-radius: 999px;
  background: #8da0b4;
  transition: height 140ms ease, background-color 140ms ease;
}

.graphtee-resize-handle:hover span,
.graphtee-resize-handle:focus-visible span,
.graphtee-resizing .graphtee-resize-handle span {
  height: 58px;
  background: #1f6feb;
}

.graphtee-resize-handle:focus-visible {
  outline: 2px solid #1f6feb;
  outline-offset: -2px;
}

.chat-panel.graphtee-workspace-open:not(.game-chat) > .graphtee-resize-handle {
  order: 2;
}

.chat-panel.graphtee-resizing,
.chat-panel.graphtee-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.game-chat .graphtee-workspace {
  position: absolute;
  top: 104px;
  right: 384px;
  bottom: 12px;
  left: 226px;
  z-index: 3;
  width: auto;
  min-width: 0;
  border: 1px solid #ccd4dd;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.game-shell .game-chat .graphtee-workspace {
  position: fixed;
}

.game-chat.graphtee-workspace-open .graphtee-workspace {
  top: 62px;
  right: auto;
  bottom: 12px;
  left: 12px;
  width: calc(var(--graphtee-divider-position, 50%) - 17px);
  height: auto;
}

.game-chat .chat-workspace {
  position: absolute;
  top: 62px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: min(360px, calc(100% - 24px));
  min-width: 0;
  border: 1px solid #ccd4dd;
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  transition: opacity 180ms ease, transform 220ms ease;
}

.game-shell .game-chat .chat-workspace {
  position: fixed;
}

.game-chat.graphtee-workspace-open .chat-workspace {
  top: 62px;
  right: 12px;
  bottom: 12px;
  left: calc(var(--graphtee-divider-position, 50%) + 5px);
  width: auto;
  height: auto;
}

.game-chat .graphtee-resize-handle,
.game-shell .game-chat .graphtee-resize-handle {
  position: absolute;
  top: 62px;
  right: auto;
  bottom: 12px;
  left: calc(var(--graphtee-divider-position, 50%) - 5px);
  z-index: 5;
  width: 10px;
  height: auto;
}

.game-shell .game-chat .graphtee-resize-handle {
  position: fixed;
}

.history-bar {
  position: relative;
  z-index: 2;
  min-height: 30px;
  padding: 5px max(14px, calc((100% - var(--chat-reading-width)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d8dee4;
  background: #ffffff;
  transition: background-color 180ms ease;
}

.history-bar.loading {
  background: #f6f9fc;
}

.history-bar div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.history-bar span {
  color: #5d6b7a;
  font-size: 11px;
  line-height: 1.2;
}

.history-bar .context-token-status {
  color: #315f88;
  font-variant-numeric: tabular-nums;
}

.history-bar .context-token-status::before {
  content: "·";
  margin-right: 6px;
  color: #8a98a7;
}

.game-workbench {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #111827;
}

.game-chat .game-workbench {
  position: absolute;
  inset: 0;
}

.game-shell .game-chat .game-workbench {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100lvh;
  contain: layout paint;
}

.game-workbench-header {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  z-index: 1;
  min-height: 34px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #17202a;
  border: 1px solid rgba(204, 212, 221, 0.92);
  border-radius: 10px;
  background: rgba(251, 252, 253, 0.94);
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.16);
  backdrop-filter: blur(14px);
  transform: translateZ(0);
}

.game-workbench-header div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.game-workbench-header .game-preview-heading {
  flex: 1 1 auto;
}

.game-scene-sync-status,
.game-scene-traffic-status,
.game-scene-fps-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid #ccd4dd;
  border-radius: 999px;
  color: #5d6b7a;
  background: #ffffff;
  font: 600 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.game-scene-fps-status[data-state="good"] {
  border-color: #86c9a0;
  color: #176b3a;
  background: #effaf3;
}

.game-scene-fps-status[data-state="okay"] {
  border-color: #d9b85f;
  color: #765500;
  background: #fff9df;
}

.game-scene-fps-status[data-state="low"] {
  border-color: #e7a29c;
  color: #a12b22;
  background: #fff2f0;
}

.game-scene-sync-status[data-state="ready"] {
  border-color: #86c9a0;
  color: #176b3a;
  background: #effaf3;
}

.game-scene-sync-status[data-state="syncing"],
.game-scene-sync-status[data-state="retrying"],
.game-scene-sync-status[data-state="connecting"] {
  border-color: #d9b85f;
  color: #765500;
  background: #fff9df;
}

.game-scene-sync-status[data-state="error"] {
  border-color: #e7a29c;
  color: #a12b22;
  background: #fff2f0;
}

.game-workbench-header .game-preview-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.game-preview-actions button {
  min-width: 54px;
  padding: 5px 9px;
  border-color: #ccd4dd;
  background: #ffffff;
  color: #354252;
  font-size: 11px;
}

.game-preview-actions #gameSceneSaveButton {
  border-color: #1f6feb;
  background: #1f6feb;
  color: #ffffff;
}

.game-preview-actions button:not(:disabled):hover {
  border-color: #9fb0c2;
  background: #f6f9fc;
}

.game-preview-actions #gameSyncDebugButton[aria-expanded="true"] {
  border-color: #1f6feb;
  background: #eaf3ff;
  color: #174f85;
}

.game-preview-actions #gamePlayButton[aria-pressed="true"] {
  border-color: #168348;
  background: #168348;
  color: #ffffff;
}

#gameSyncDebugCount {
  min-width: 16px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #d97706;
  color: #ffffff;
  font: 700 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.game-sync-debug-panel {
  position: absolute;
  top: 58px;
  right: 372px;
  z-index: 4;
  width: min(520px, calc(100% - 404px));
  height: min(56vh, 520px);
  min-width: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ccd4dd;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.97);
  color: #17202a;
  box-shadow: 0 18px 48px rgba(23, 32, 42, 0.24);
  backdrop-filter: blur(14px);
}

.game-sync-debug-panel > header {
  min-height: 42px;
  padding: 7px 9px 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #d8dee4;
  background: #ffffff;
}

.game-sync-debug-panel > header > div:first-child {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.game-sync-debug-panel > header span {
  overflow: hidden;
  color: #5d6b7a;
  font: 500 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-sync-debug-actions {
  display: flex;
  gap: 5px;
}

.game-sync-debug-actions button {
  padding: 4px 7px;
  border-color: #ccd4dd;
  background: #ffffff;
  color: #354252;
  font-size: 10px;
}

.game-sync-debug-log {
  flex: 1 1 auto;
  min-height: 0;
  padding: 7px;
  overflow: auto;
  overscroll-behavior: contain;
}

.game-sync-debug-empty {
  margin: 18px 8px;
  color: #5d6b7a;
  font-size: 12px;
  text-align: center;
}

.game-sync-debug-entry {
  margin-bottom: 6px;
  border: 1px solid #d8dee4;
  border-radius: 7px;
  background: #ffffff;
}

.game-sync-debug-entry summary {
  padding: 7px 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}

.game-sync-debug-entry summary::-webkit-details-marker {
  display: none;
}

.game-sync-debug-direction {
  min-width: 42px;
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #087f6f;
  font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.game-sync-debug-entry[data-direction="received"] .game-sync-debug-direction {
  color: #1f6feb;
}

.game-sync-debug-entry[data-direction="local"] .game-sync-debug-direction {
  color: #a36300;
}

.game-sync-debug-label {
  min-width: 0;
  overflow: hidden;
  font: 600 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-sync-debug-meta {
  color: #6b7887;
  font: 500 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.game-sync-debug-entry pre {
  margin: 0;
  padding: 9px;
  overflow: auto;
  border-top: 1px solid #e4e9ee;
  color: #354252;
  background: #f6f9fc;
  font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.game-tools-panel {
  position: absolute;
  top: 108px;
  left: 12px;
  z-index: 2;
  width: min(240px, calc(100% - 396px));
  min-width: 180px;
  max-height: calc(100% - 120px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(204, 212, 221, 0.94);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
  color: #17202a;
  box-shadow: 0 14px 36px rgba(23, 32, 42, 0.2);
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease, transform 220ms ease;
}

.game-shell .game-tools-panel {
  position: fixed;
}

.game-panel-tabs {
  min-height: 38px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid #d8dee4;
  background: #ffffff;
}

.game-panel-tabs button {
  min-width: 0;
  flex: 1 1 0;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #5d6b7a;
  font-size: 11px;
}

.game-panel-tabs button.selected {
  border-color: #9cc5ee;
  background: #eaf3ff;
  color: #174f85;
}

.game-panel-tabs span {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dcecff;
  color: #174f85;
  font-size: 11px;
  text-align: center;
}

.game-explorer-view {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-data-view {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 7px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.game-explorer-view[hidden],
.game-data-view[hidden] {
  display: none;
}

.game-data-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.game-data-section > header {
  min-height: 32px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border-bottom: 1px solid #e4e9ee;
  background: #fbfcfd;
}

.game-data-section > header strong {
  font-size: 11px;
}

.game-data-section > header span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #e9f8ef;
  color: #176b3a;
  font-size: 9px;
}

.game-data-section > header span.invalid {
  background: #fff0ee;
  color: #a12b22;
}

.game-data-section-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.game-data-section-actions button {
  padding: 3px 6px;
  border-color: #9cc5ee;
  border-radius: 5px;
  background: #f7fbff;
  color: #174f85;
  font-size: 9px;
}

.game-data-section-actions button:disabled {
  opacity: 0.42;
}

.game-data-section dl {
  margin: 0;
  display: grid;
}

.game-data-section dl > div {
  min-width: 0;
  padding: 7px 9px;
  display: grid;
  gap: 2px;
  border-top: 1px solid #edf0f3;
}

.game-data-section dl > div:first-child {
  border-top: 0;
}

.game-data-section dt {
  color: #6b7887;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.game-data-section dd {
  min-width: 0;
  margin: 0;
  color: #354252;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  user-select: text;
}

.game-data-section dd.value-code {
  color: #174f85;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.game-data-section dd.value-valid {
  color: #176b3a;
}

.game-data-section dd.value-invalid {
  color: #a12b22;
}

.game-data-empty {
  padding: 9px;
  color: #6b7887;
  font-size: 10px;
}

.game-object-list {
  min-height: 0;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding: 7px;
  display: grid;
  align-content: start;
  gap: 3px;
}

.game-object-row {
  width: 100%;
  min-width: 0;
  padding: 6px 8px 6px calc(8px + var(--scene-depth, 0) * 16px);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #354252;
  text-align: left;
}

.game-object-row:hover {
  background: #f1f6fb;
}

.game-object-row.selected {
  border-color: #9cc5ee;
  background: #eaf3ff;
  color: #174f85;
}

.game-object-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #dcecff;
  color: #174f85;
  font-size: 11px;
  font-weight: 800;
}

.game-object-icon.type-light {
  background: #fff3c4;
  color: #8a6200;
}

.game-object-icon.type-scene,
.game-object-icon.type-helper {
  background: #e9edf1;
  color: #5d6b7a;
}

.game-object-details {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.game-object-details strong,
.game-object-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-object-details strong {
  font-size: 12px;
}

.game-object-details small {
  color: #6b7887;
  font-size: 9px;
}

.game-object-selection {
  min-height: 30px;
  padding: 7px 10px;
  display: grid;
  gap: 2px;
  border-top: 1px solid #d8dee4;
  color: #765500;
  background: #fffdf5;
  font-size: 10px;
  overflow: hidden;
}

.game-object-selection strong,
.game-object-selection code,
.game-object-selection span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-object-selection code {
  color: #174f85;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: text;
}

.game-object-selection span {
  color: #5d6b7a;
}

.game-project-tools {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #d8dee4;
}

.game-project-tools > header {
  min-height: 34px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-project-tools > header strong {
  font-size: 11px;
}

.game-project-tools > header span {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dcecff;
  color: #174f85;
  font-size: 10px;
  text-align: center;
}

.game-tools-list {
  max-height: min(28vh, 240px);
  overflow-y: auto;
  padding: 7px;
  display: grid;
  gap: 6px;
}

.game-tools-list article {
  min-width: 0;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  border-radius: 7px;
  border: 1px solid #e4e9ee;
  background: #ffffff;
}

.game-tools-list article strong {
  font-size: 12px;
}

.game-tools-list article span,
.game-tools-empty {
  margin: 0;
  color: #5d6b7a;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.game-workbench-header strong,
.game-workbench-header span,
.game-workbench-header output {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-chat .game-workbench-header {
  top: 62px;
}

.panel-overlay-toggle {
  position: absolute;
  top: 72px;
  z-index: 4;
  min-width: 0;
  border-color: #ccd4dd;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.18);
  color: #354252;
  padding: 5px 8px;
  font-size: 11px;
}

.chat-overlay-toggle {
  right: 22px;
}

.tools-overlay-toggle {
  left: 22px;
}

.game-shell .panel-overlay-toggle {
  position: fixed;
}

.game-chat.chat-overlay-hidden .chat-workspace {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
}

.game-chat.tools-overlay-hidden .game-tools-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(-100% - 24px));
}

.game-workbench-header strong {
  font-size: 13px;
}

.game-workbench-header span {
  color: #5d6b7a;
  font-size: 11px;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #111827;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: none;
}

#gameCanvas.camera-moving {
  cursor: grabbing;
}

#gameCanvas.object-dragging {
  cursor: move;
}

.game-workbench.scene-interaction-locked #gameCanvas {
  pointer-events: none;
  cursor: progress;
}

.game-workbench.scene-interaction-locked .game-workbench-header {
  z-index: 3;
}

.game-scene-reconnect-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.38), rgba(15, 23, 42, 0.08) 42%, transparent 70%);
}

.game-scene-reconnect-overlay[hidden] {
  display: none;
}

.game-scene-reconnect-card {
  min-width: 178px;
  padding: 16px 20px 14px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #17202a;
  border: 1px solid #ccd4dd;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 52px rgba(23, 32, 42, 0.24);
  backdrop-filter: blur(10px);
}

.game-scene-reconnect-card > strong {
  margin-top: 5px;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.game-scene-reconnect-card > span:last-child {
  color: #5d6b7a;
  font-size: 10px;
}

.game-scene-reconnect-motion {
  width: 72px;
  height: 72px;
  display: block;
}

.game-camera-hint {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 1;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 5px 9px;
  color: #5d6b7a;
  border: 1px solid rgba(204, 212, 221, 0.9);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(23, 32, 42, 0.12);
  font-size: 10px;
  line-height: 1.3;
  pointer-events: none;
  user-select: none;
}

.game-shell #gameCanvas {
  width: 100vw;
  height: 100lvh;
}

.messages {
  position: relative;
  z-index: 1;
  height: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: #9aa8b6 #edf1f5;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  padding: 14px max(14px, calc((100% - var(--chat-reading-width)) / 2));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.messages.has-live-status {
  padding-bottom: 6px;
}

.game-chat .history-bar {
  border-bottom-color: #d8dee4;
  background: #ffffff;
}

.game-chat .history-bar.loading {
  background: #f6f9fc;
}

.game-chat .messages {
  background: #f8fafc;
}

.game-chat .message {
  border-color: #d8dee4;
  background: #ffffff;
  box-shadow: none;
}

.game-chat .message.user {
  border-color: #9ec5fe;
  background: #edf5ff;
}

.game-chat .message.status {
  background: #ffffff;
}

.messages::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-track {
  background: #edf1f5;
}

.messages::-webkit-scrollbar-thumb {
  border: 2px solid #edf1f5;
  border-radius: 999px;
  background: #9aa8b6;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: #7b8998;
}

.message {
  width: 100%;
  max-width: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  padding: 11px 13px;
  background: #ffffff;
  transform-origin: bottom center;
}

.message-text {
  white-space: pre-wrap;
}

.message.assistant.has-graphtee {
  width: 100%;
  max-width: none;
}

.message.assistant.has-devtee-workflow {
  width: min(100%, 980px);
  max-width: none;
}

.message-devtee-workflow {
  margin-top: 10px;
  white-space: normal;
}

.devtee-open-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #0969da;
  background: #0969da;
  color: #ffffff;
  font: 600 12px/1.4 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.devtee-open-button:hover {
  background: #0858b7;
  border-color: #0858b7;
}

.devtee-runtime-summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #c8d7e8;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #edf5fd;
  color: #174f85;
  font: 650 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.devtee-runtime-summary span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-runtime-summary button {
  min-height: 25px;
  padding: 3px 9px;
  flex: 0 0 auto;
  border-color: #89b8e6;
  background: #ffffff;
  color: #174f85;
  font: 650 10.5px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-runtime-summary[data-status="completed"] {
  border-color: #a7d7bd;
  background: #edf9f2;
  color: #12643b;
}

.devtee-runtime-summary[data-status="invalid"],
.message-devtee-workflow.devtee-error {
  border-color: #e4b6b6;
  background: #fff1f1;
  color: #9f2d2d;
}

.devtee-graph-host > .graphtee-card {
  margin-top: 0;
  border-radius: 0 0 9px 9px;
}

.devtee-editor-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fbfcfe;
}

.devtee-editor-split {
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.devtee-editor-split.source-visible {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.devtee-editor-canvas,
.devtee-editor-graph-host {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.devtee-editor-canvas {
  position: relative;
  border-right: 1px solid #cfd9e4;
}

.devtee-resource-status-panel {
  display: none;
  position: absolute;
  z-index: 12;
  top: 10px;
  right: 10px;
  width: min(300px, calc(100% - 20px));
  overflow: hidden;
  border: 1px solid #c8d7e8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(27, 54, 82, 0.14);
  color: #26435f;
  font: 11px/1.3 ui-sans-serif, system-ui, sans-serif;
  pointer-events: auto;
}

.devtee-resource-status-panel[hidden] {
  display: none;
}

.devtee-resource-status-panel.is-collapsed {
  width: auto;
  max-width: calc(100% - 20px);
}

.devtee-resource-status-toggle {
  padding: 2px 6px;
  border: 1px solid #c8d7e8;
  border-radius: 4px;
  background: #ffffff;
  color: #26435f;
  cursor: pointer;
  font: inherit;
}

.devtee-resource-status-toggle:focus-visible {
  outline: 2px solid #1f6feb;
  outline-offset: 2px;
}

.devtee-resource-status-list[hidden],
.devtee-resource-status-header span[hidden] {
  display: none;
}

.devtee-resource-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-bottom: 1px solid #dbe6f1;
  background: #f4f8fc;
}

.devtee-resource-status-header strong {
  font-weight: 750;
}

.devtee-resource-status-header span {
  color: #60758a;
  font-size: 10px;
  white-space: nowrap;
}

.devtee-resource-status-list {
  max-height: 190px;
  overflow: auto;
  padding: 4px 0;
}

.devtee-resource-status-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 3px 9px;
}

.devtee-resource-status-row:hover {
  background: #f5f9fd;
}

.devtee-resource-status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7c91a5;
}

.devtee-resource-status-row.is-loading .devtee-resource-status-indicator {
  background: #e39a24;
  box-shadow: 0 0 0 3px rgba(227, 154, 36, 0.16);
  animation: devtee-resource-status-pulse 1.1s ease-in-out infinite;
}

.devtee-resource-status-row.is-loaded .devtee-resource-status-indicator {
  background: #2d9b68;
}

.devtee-resource-status-row.is-failed .devtee-resource-status-indicator {
  background: #d65b5b;
}

.devtee-resource-status-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-resource-status-size {
  color: #70869b;
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

@keyframes devtee-resource-status-pulse {
  50% { opacity: 0.45; }
}

.devtee-history-loading-overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.52);
  color: #514664;
  cursor: default;
  font: 700 12px/1.2 ui-sans-serif, system-ui, sans-serif;
  backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.devtee-history-loading-overlay.is-visible { opacity: 1; }
.devtee-history-loading-overlay[aria-hidden="true"] { visibility: hidden; }
.devtee-history-loading-overlay[aria-hidden="false"] { visibility: visible; }

.devtee-history-loading-overlay[hidden] {
  display: none;
}

.devtee-history-loading-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(128, 87, 212, 0.22);
  border-top-color: #8057d4;
  border-radius: 50%;
  animation: devtee-history-loading-spin 700ms linear infinite;
}

@keyframes devtee-history-loading-spin {
  to { transform: rotate(360deg); }
}


.devtee-live-3d-preview {
  position: absolute;
  z-index: 6;
  right: 10px;
  bottom: 10px;
  width: min(360px, calc(100% - 20px));
  height: min(270px, 42%);
  min-height: 170px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #9eb5cd;
  border-radius: 9px;
  background: rgba(245, 249, 253, 0.97);
  box-shadow: 0 7px 22px rgba(27, 54, 82, 0.22);
  pointer-events: auto;
}

/* Enlarged: centred in the canvas at the interactive 3D review's size, over
   the same dimmed backdrop (kept inside the canvas). */
.devtee-live-3d-preview.is-enlarged {
  z-index: 30;
  inset: 0;
  width: min(920px, calc(100% - 2 * clamp(8px, 2vw, 18px)));
  height: min(760px, calc(100% - 2 * clamp(8px, 2vw, 18px)));
  min-height: 0;
  margin: auto;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.devtee-editor-canvas:has(> .devtee-live-3d-preview.is-enlarged)::after {
  content: "";
  position: absolute;
  z-index: 29;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(5px);
}

.devtee-live-3d-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 27px;
  padding: 5px 8px;
  color: #244463;
  font: 11px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-live-3d-tools {
  display: flex;
  flex: none;
  gap: 4px;
  margin-left: auto;
}

.devtee-live-3d-tool,
.devtee-live-3d-restore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #9eb5cd;
  border-radius: 5px;
  background: #fff;
  color: #244463;
  cursor: pointer;
}

.devtee-live-3d-tool {
  width: 22px;
  height: 20px;
  padding: 0;
}

.devtee-live-3d-tool:hover,
.devtee-live-3d-restore:hover {
  background: #eef4fa;
}

/* Minimized: only the restore button shows, in the canvas's bottom-right
   corner. The frame keeps its size, hidden, so the page keeps rendering. */
.devtee-live-3d-restore {
  display: none;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  font: 600 11px/1 ui-sans-serif, system-ui, sans-serif;
}

.devtee-live-3d-preview.is-minimized {
  left: auto;
  width: auto;
  height: auto;
  min-height: 0;
  border-radius: 8px;
}

.devtee-live-3d-preview.is-minimized > header,
.devtee-live-3d-preview.is-minimized > .devtee-live-3d-empty {
  display: none;
}

.devtee-live-3d-preview.is-minimized > .devtee-live-3d-frame {
  position: absolute;
  width: 360px;
  height: 240px;
  visibility: hidden;
  pointer-events: none;
}

.devtee-live-3d-preview.is-minimized > .devtee-live-3d-restore {
  display: inline-flex;
}

.devtee-live-3d-status {
  overflow: hidden;
  color: #71859a;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-live-3d-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #e9eff5;
}

.devtee-live-3d-empty {
  display: grid;
  flex: 1 1 auto;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: #7890a6;
  text-align: center;
  font: 11px/1.4 ui-sans-serif, system-ui, sans-serif;
}

.devtee-execution-controls {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 50%;
  min-height: 30px;
  /* Leaves room on both sides for the top-left Play timer. */
  max-width: calc(100% - 172px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(138, 107, 206, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 16px rgba(46, 31, 83, 0.16);
  transform: translateX(-50%);
}

.devtee-execution-timer {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  min-width: 70px;
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid rgba(138, 107, 206, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 16px rgba(46, 31, 83, 0.16);
  color: #55506a;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.devtee-execution-timer[hidden] {
  display: none;
}

.devtee-execution-timer[data-running="true"] {
  color: #6540ae;
}

.devtee-execution-status {
  min-width: 0;
  max-width: min(260px, 37vw);
  padding: 0 5px;
  overflow: hidden;
  color: #55506a;
  font: 650 10px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-execution-history,
.devtee-execution-code-version,
.devtee-execution-branch {
  min-height: 25px;
  max-width: min(260px, 32vw);
  padding: 3px 24px 3px 7px;
  border: 1px solid rgba(128, 87, 212, 0.28);
  border-radius: 5px;
  background: #faf8ff;
  color: #544273;
  font: 650 10px/1.1 ui-sans-serif, system-ui, sans-serif;
}

.devtee-execution-history {
  width: 112px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-execution-controls[data-reviewing="true"] {
  border-color: rgba(46, 125, 246, 0.48);
  box-shadow: 0 5px 16px rgba(46, 125, 246, 0.14);
}

.devtee-execution-controls[data-debugging="true"] {
  border-color: rgba(219, 132, 22, 0.58);
  box-shadow: 0 5px 16px rgba(219, 132, 22, 0.16);
}

.devtee-execution-controls button {
  min-height: 25px;
  padding: 3px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #544273;
  font: 700 10.5px/1.1 ui-sans-serif, system-ui, sans-serif;
}

.devtee-execution-controls button:hover:not(:disabled),
.devtee-execution-controls button:focus-visible:not(:disabled) {
  background: #f0e9ff;
  outline: none;
}

.devtee-execution-controls .devtee-execution-play {
  background: #8057d4;
  color: #ffffff;
}

.devtee-execution-controls .devtee-execution-continue {
  position: relative;
  min-width: 64px;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: #4f46e5;
  color: #ffffff;
}

.devtee-execution-controls .devtee-execution-continue:hover:not(:disabled),
.devtee-execution-controls .devtee-execution-continue:focus-visible:not(:disabled) {
  background: #4338ca;
  color: #ffffff;
}

.devtee-execution-controls .devtee-execution-continue::after {
  content: attr(data-hint);
  position: absolute;
  z-index: 6;
  top: calc(100% + 6px);
  left: 50%;
  width: max-content;
  max-width: 280px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(36, 30, 54, 0.92);
  color: #ffffff;
  font: 600 10px/1.3 ui-sans-serif, system-ui, sans-serif;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.12s ease;
}

.devtee-execution-controls .devtee-execution-continue:hover::after,
.devtee-execution-controls .devtee-execution-continue:focus-visible::after {
  opacity: 1;
}

.devtee-execution-controls .devtee-execution-edit {
  border: 1px solid rgba(161, 59, 71, 0.3);
  background: #fff2f3;
  color: #963845;
}

.devtee-execution-controls .devtee-execution-save {
  border: 1px solid rgba(128, 87, 212, 0.32);
  background: #f4efff;
  color: #6540ae;
}

.devtee-execution-controls .devtee-execution-save[data-state="saved"] {
  border-color: rgba(45, 141, 92, 0.28);
  background: #eef9f2;
  color: #27784d;
}

.devtee-execution-controls .devtee-execution-commit {
  border: 1px solid rgba(100, 116, 139, 0.32);
  background: #f8fafc;
  color: #475569;
}

.devtee-execution-controls .devtee-execution-commit[data-uncommitted="true"] {
  border-color: rgba(217, 119, 6, 0.45);
  background: #fffbeb;
  color: #b45309;
}

.devtee-execution-controls .devtee-code-repository-button {
  border: 1px solid rgba(109, 76, 178, 0.42);
  background: #eee8ff;
  color: #56329a;
}

.devtee-execution-controls .devtee-code-repository-button[aria-expanded="true"] {
  background: #6f4bb5;
  color: #ffffff;
}

.devtee-execution-controls .devtee-files-toggle {
  border: 1px solid rgba(109, 76, 178, 0.32);
  background: #f8f5ff;
  color: #5b3e9b;
}

.devtee-execution-controls .devtee-files-toggle[aria-expanded="true"] {
  background: #6f4bb5;
  color: #ffffff;
}

.devtee-execution-controls .devtee-runtime-settings-toggle,
.devtee-execution-controls .devtee-node-toolbar-assets {
  border: 1px solid #bba9e8;
  background: #f8f5ff;
  color: #5b3e9b;
}

.devtee-execution-controls .devtee-runtime-settings-toggle[aria-expanded="true"],
.devtee-execution-controls .devtee-node-toolbar-assets[aria-expanded="true"] {
  background: #6f4bb5;
  color: #ffffff;
}

.devtee-execution-controls[data-status="running"] .devtee-execution-status,
.devtee-execution-controls[data-status="pausing"] .devtee-execution-status,
.devtee-execution-controls[data-status="saving"] .devtee-execution-status,
.devtee-execution-controls[data-status="starting"] .devtee-execution-status,
.devtee-execution-controls[data-status="stopping"] .devtee-execution-status {
  color: #6540ae;
}

.devtee-execution-controls[data-status="failed"] {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 5px 18px rgba(220, 38, 38, 0.18);
}

.devtee-execution-controls[data-status="failed"] .devtee-execution-status {
  color: #b91c1c;
  font-weight: 700;
}

.devtee-execution-controls button:disabled {
  cursor: default;
  opacity: 0.48;
}

.devtee-execution-result,
.devtee-execution-console {
  flex: 1 0 100%;
  width: min(440px, calc(100vw - 52px));
  max-height: 150px;
  margin: 2px 4px 3px;
  padding: 8px 9px 7px;
  overflow: auto;
  border-top: 1px solid rgba(138, 107, 206, 0.22);
  color: #413b50;
  font: 500 11px/1.42 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.devtee-execution-result.is-failed {
  border-top: 1px solid rgba(239, 68, 68, 0.45);
  background: #fef2f2;
  color: #991b1b;
  font-weight: 600;
  font-size: 11.5px;
  border-radius: 4px;
}

.devtee-execution-result[hidden],
.devtee-execution-console[hidden] {
  display: none;
}

.devtee-execution-console {
  max-height: min(360px, 48vh);
  border-top-color: rgba(72, 54, 103, 0.34);
  background: #211d2b;
  color: #f4efff;
  text-align: left;
}

.devtee-node-toolbar {
  position: absolute;
  z-index: 5;
  bottom: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 24px);
  padding: 4px;
  border: 1px solid rgba(86, 102, 126, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 7px 20px rgba(35, 48, 74, 0.16);
  transform: translateX(-50%);
}

.devtee-node-toolbar button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
}

.devtee-node-toolbar button svg {
  width: 18px;
  height: 18px;
}

.devtee-node-toolbar button:disabled {
  cursor: default;
  opacity: 0.48;
}

.devtee-node-toolbar button:hover,
.devtee-node-toolbar button:focus-visible {
  outline: none;
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.devtee-node-toolbar-agent {
  border-color: #c7aeff !important;
  background: #f3edff;
  color: #6b3bc2;
}

.devtee-node-toolbar-code {
  border-color: #a8cbff !important;
  background: #eaf3ff;
  color: #1765bf;
}

.devtee-editor-utility-bar .devtee-node-toolbar-tools {
  min-height: 27px;
  padding: 4px 8px;
  border-color: #b8c5d6 !important;
  border-radius: 7px;
  background: #f2f6fa;
  color: #3f536d;
  font: 700 10px/1.1 ui-sans-serif, system-ui, sans-serif;
}

.devtee-runtime-settings-toggle {
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid #bba9e8;
  border-radius: 7px;
  background: rgba(248, 245, 255, 0.96);
  color: #5b3e9b;
  font: 700 10px/1.1 ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 4px 12px rgba(64, 41, 110, 0.12);
}

.devtee-node-toolbar-delete {
  border-color: #f0c4ca !important;
  background: #fff5f6;
  color: #ad4151;
}

.devtee-editor-split:not(.source-visible) .devtee-editor-canvas {
  border-right: 0;
}

.devtee-editor-utility-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 5px;
}

.devtee-source-toggle {
  position: static;
  min-height: 27px;
  padding: 4px 8px;
  border-color: #94b9dc;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(30, 49, 72, 0.14);
  color: #174f85;
  font-size: 10px;
}

@media (max-width: 680px) {
  .devtee-live-3d-preview {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    height: 220px;
    min-height: 150px;
  }

  .devtee-execution-timer {
    top: 8px;
    left: 8px;
    min-width: 64px;
    padding: 0 7px;
  }

  /* Starts right of the timer and wraps into rows below it. */
  .devtee-execution-controls {
    top: 8px;
    right: 8px;
    left: 78px;
    max-width: none;
    justify-content: flex-start;
    transform: none;
  }

  .devtee-execution-status {
    flex: 1 1 100%;
    max-width: none;
  }

  .devtee-execution-history,
  .devtee-execution-code-version,
  .devtee-execution-branch {
    flex: 1 1 126px;
    max-width: none;
  }

  .devtee-execution-controls button {
    flex: 1 1 auto;
    min-width: 44px;
    padding: 4px 6px;
  }

  .devtee-editor-utility-bar {
    top: 96px;
    right: 8px;
    left: 8px;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .devtee-editor-utility-bar button {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .devtee-node-toolbar {
    bottom: 8px;
    gap: 6px;
  }

  /* Touch-sized squares; the toolbar stays one centered row. */
  .devtee-node-toolbar button {
    width: 44px;
    height: 44px;
  }

  .devtee-node-toolbar button svg {
    width: 22px;
    height: 22px;
  }

  /* Overlays that share the bottom edge sit above the 62px toolbar. */
  .devtee-live-3d-preview {
    bottom: 70px;
  }
}

.devtee-editor-source {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #f7f9fc;
}

.devtee-editor-source > header {
  min-height: 58px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #d7e0ea;
  background: #ffffff;
}

.graphtee-workspace[data-mode="devtee"] .devtee-editor-source > header {
  padding-right: 58px;
}

.devtee-editor-source > header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.devtee-editor-source > header strong {
  color: #203c57;
  font-size: 11px;
}

.devtee-editor-source > header span {
  color: #26764c;
  font-size: 10px;
}

.devtee-editor-source > header span[data-valid="false"] {
  color: #aa3434;
}

.devtee-editor-source > header .devtee-file-status[data-state="saving"],
.devtee-editor-source > header .devtee-file-status[data-state="local"] {
  color: #8a5b13;
}

.devtee-editor-source > header .devtee-file-status[data-state="unsaved"] {
  color: #aa3434;
}

.devtee-editor-source > header > div:last-child {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 5px;
}

.devtee-editor-source button {
  min-height: 26px;
  padding: 3px 7px;
  border-color: #c8d5e3;
  background: #ffffff;
  color: #365675;
  font-size: 10px;
}

.devtee-editor-source button:last-child {
  border-color: #86b4e2;
  background: #edf5fd;
  color: #174f85;
}

.devtee-source-input {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  resize: none;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: #101923;
  color: #dfeaf5;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  tab-size: 2;
}

.devtee-source-input:focus {
  box-shadow: inset 0 0 0 2px #5c9cf1;
}

.devtee-source-errors {
  min-height: 0;
  max-height: 86px;
  padding: 7px 9px;
  overflow: auto;
  border-top: 1px solid #d7e0ea;
  background: #fff7f7;
  color: #9f2d2d;
  font-size: 10px;
  line-height: 1.35;
}

.devtee-source-errors:empty {
  display: none;
}

.message-graphtee-reference {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin-top: 9px;
  padding: 8px 10px;
  overflow: hidden;
  border-color: #a9c8e8;
  border-radius: 7px;
  background: #edf5fd;
  color: #174f85;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graphtee-card {
  width: 100%;
  min-width: 0;
  margin-top: 12px;
  display: grid;
  grid-template-rows: auto clamp(320px, 44vw, 420px) auto;
  border: 1px solid #dce3eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 5px 20px rgba(30, 49, 72, 0.07);
  white-space: normal;
  overflow: hidden;
}

.graphtee-card.expanded {
  grid-template-rows: auto clamp(500px, 68vh, 680px) auto;
}

.graphtee-card-header {
  min-width: 0;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e4e9ef;
  background: #ffffff;
}

.graphtee-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.graphtee-card-header strong {
  color: #182536;
  font-size: 13.5px;
  line-height: 1.3;
}

.graphtee-card-header span {
  overflow: hidden;
  color: #66768a;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graphtee-card-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  background: #f7f9fb;
}

.graphtee-card-actions button {
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #315a82;
  font-size: 11px;
}

.graphtee-zoom-controls {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px #d7dfe8;
}

.graphtee-zoom-controls button {
  width: 30px;
  min-height: 28px;
  padding: 3px;
  border: 0;
  border-radius: 0;
  font-size: 16px;
  line-height: 1;
}

.graphtee-zoom {
  min-width: 44px;
  padding: 0 3px;
  border-right: 1px solid #e2e7ed;
  border-left: 1px solid #e2e7ed;
  color: #425d79;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.graphtee-card-actions button:hover {
  background: #eaf2fb;
}

.graphtee-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #fbfcfe;
  outline: none;
  overflow: hidden;
  touch-action: none;
}

.graphtee-viewport:focus-visible {
  box-shadow: inset 0 0 0 2px #1f6feb;
}

.graphtee-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.graphtee-node-decoration-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.graphtee-node-decoration {
  position: absolute;
  display: block;
  pointer-events: none;
  transform: scale(var(--graphtee-node-decoration-scale, 1)) translateZ(0);
  transform-origin: top left;
}

.devtee-version-badge {
  display: inline-block;
  pointer-events: none;
  margin-top: -24px;
  padding: 3px 7px;
  border: 1px solid rgba(180, 83, 9, 0.38);
  border-radius: 999px;
  color: #92400e;
  background: rgba(255, 247, 237, 0.98);
  box-shadow: 0 4px 12px rgba(120, 53, 15, 0.16);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.devtee-version-badge.is-unknown {
  border-color: rgba(71, 85, 105, 0.36);
  color: #475569;
  background: rgba(248, 250, 252, 0.98);
}

.graphtee-node-decoration.devtee-user-input {
  pointer-events: auto;
}

.graphtee-node-decoration.devtee-checkpoint-confirm {
  width: 230px !important;
  height: auto !important;
  pointer-events: auto;
  transform: scale(var(--graphtee-node-decoration-scale, 1))
    translateX(calc(var(--graphtee-node-card-center-offset, 111px) - 50%))
    translateY(calc(var(--graphtee-node-card-bottom-offset, 70px) + 6px));
}

.devtee-checkpoint-confirm {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(124, 58, 237, 0.34);
  border-radius: 10px;
  color: #3f2a66;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.devtee-checkpoint-confirm > strong,
.devtee-checkpoint-confirm > span {
  font-size: 11px;
  line-height: 1.3;
}

.devtee-checkpoint-confirm > button {
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #6d3bc1;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.devtee-checkpoint-confirm > button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* The reviewed node's result uses the same compact box as every card, in the panel's flow. */
.devtee-checkpoint-confirm .devtee-node-attempts {
  position: static;
  width: 100%;
  transform: none;
  box-shadow: none;
}

.devtee-checkpoint-confirm[data-error]::after {
  content: attr(data-error);
  color: #b42318;
  font-size: 10px;
  line-height: 1.3;
}

/* A tool node's code state sits in the card's icon slot; the generate button
   for missing code hangs under the card like other node panels. */
.graphtee-node-decoration.devtee-code-skill {
  overflow: visible;
  pointer-events: auto;
}

.devtee-code-skill-state {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  box-sizing: border-box;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.devtee-code-skill.is-generated .devtee-code-skill-state { color: #fff; background: #16a34a; }
.devtee-code-skill.is-missing .devtee-code-skill-state { color: #9a6700; border: 1px solid rgba(154, 103, 0, 0.45); background: #fffbeb; }

.devtee-code-skill > button,
.devtee-code-skill-detail {
  position: absolute;
  z-index: 1;
  left: var(--graphtee-node-card-center-offset, 103px);
  transform: translateX(-50%);
}

.devtee-code-skill > button { top: calc(var(--graphtee-node-card-bottom-offset, 25px) + 6px); padding: 6px 9px; white-space: nowrap; cursor: pointer; }

.devtee-code-skill-detail {
  top: calc(var(--graphtee-node-card-bottom-offset, 25px) + 40px);
  width: var(--graphtee-node-card-width, 206px);
  color: #173153;
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.graphtee-node-decoration.devtee-asset-input {
  width: 206px !important;
  height: auto !important;
  pointer-events: auto;
  transform: scale(var(--graphtee-node-decoration-scale, 1))
    translateX(calc(var(--graphtee-node-card-center-offset, 111px) - 50%))
    translateY(calc(var(--graphtee-node-card-bottom-offset, 70px) + 6px));
}

.devtee-asset-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.devtee-asset-input input[type="file"] { display: none; }
.devtee-asset-input button { flex: 0 0 auto; padding: 6px 9px; }
.devtee-asset-input span { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.devtee-asset-input progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
  accent-color: #f59e0b;
}
.devtee-asset-input[data-upload-state="failed"] { border-color: rgba(220, 38, 38, 0.5); }
.devtee-asset-input:focus { outline: 2px solid rgba(245, 158, 11, 0.6); outline-offset: 1px; }

.graphtee-node-decoration.devtee-user-input {
  width: 250px !important;
  height: auto !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  transform: scale(var(--graphtee-node-decoration-scale, 1))
    translateX(calc(var(--graphtee-node-card-center-offset, 111px) - 50%))
    translateY(calc(var(--graphtee-node-card-bottom-offset, 70px) + 6px));
  padding: 7px;
  border: 1px solid rgba(31, 111, 235, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.graphtee-node-decoration.devtee-user-input .devtee-user-input-error {
  grid-column: 1 / -1;
  color: #b42318;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.graphtee-node-decoration.devtee-user-input input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 7px 9px;
  border: 1px solid #c7d2e3;
  border-radius: 7px;
  font: inherit;
  color: #172033;
  background: #fff;
}

.graphtee-node-decoration.devtee-user-input input:focus {
  border-color: #1f6feb;
  outline: 2px solid rgba(31, 111, 235, 0.18);
}

.graphtee-node-decoration.devtee-user-input button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #1f6feb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.graphtee-node-decoration.devtee-user-input button:disabled {
  opacity: 0.5;
  cursor: default;
}

.graphtee-node-decoration.devtee-thinking-motion {
  position: absolute;
  width: 25px;
  height: 25px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  overflow-clip-margin: 5px;
}

.graphtee-node-decoration.devtee-thinking-motion .thinking-motion-placeholder {
  inset: 3px;
  border-width: 1.5px;
}

.graphtee-node-decoration.devtee-node-runtime {
  overflow: visible;
}

.devtee-node-finished-at {
  position: absolute;
  top: -30px;
  left: var(--graphtee-node-card-center-offset, 103px);
  width: max-content;
  max-width: var(--graphtee-node-card-width, 206px);
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 3px 7px;
  border: 1px solid rgba(31, 111, 235, 0.2);
  border-radius: 999px;
  color: #52657a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.devtee-start-node {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #16a34a;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.32);
  font-size: 11px;
}

.devtee-disabled-node {
  position: absolute;
  top: calc(var(--graphtee-node-card-bottom-offset, 25px) + 5px);
  left: var(--graphtee-node-card-center-offset, 103px);
  width: var(--graphtee-node-card-width, 206px);
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 5px 7px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 8px;
  color: #64748b;
  background: rgba(241, 245, 249, 0.96);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

/* An uploaded asset's picture is as tall as a result box's thumbnail. */
.devtee-asset-thumbnail-runtime .devtee-node-result {
  padding: 4px;
  overflow: hidden;
  border-color: rgba(245, 158, 11, 0.34);
}

.devtee-asset-thumbnail-runtime .devtee-node-result-images img {
  height: 60px;
  min-height: 0;
}

.graphtee-node-decoration.devtee-node-runtime > .devtee-thinking-motion {
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
}

.devtee-node-result {
  position: absolute;
  top: calc(var(--graphtee-node-card-bottom-offset, 25px) + 6px);
  left: var(--graphtee-node-card-center-offset, 103px);
  width: 206px;
  transform: translateX(-50%);
  max-height: 144px;
  box-sizing: border-box;
  padding: 6px;
  overflow: auto;
  pointer-events: auto;
  border: 1px solid rgba(31, 111, 235, 0.24);
  border-radius: 9px;
  color: #172033;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.14);
}

/* Under a card, top to bottom: try titles, the latest try's thumbnail, and the
   "all tries" button. About 130px tall on every card type. */
.devtee-node-attempts {
  position: absolute;
  top: calc(var(--graphtee-node-card-bottom-offset, 25px) + 6px);
  left: var(--graphtee-node-card-center-offset, 103px);
  display: grid;
  gap: 3px;
  width: 206px;
  box-sizing: border-box;
  padding: 4px;
  transform: translateX(-50%);
  pointer-events: auto;
  border: 1px solid rgba(31, 111, 235, 0.24);
  border-radius: 9px;
  color: #172033;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.14);
}

.devtee-node-attempt-thumb {
  position: relative;
  display: grid;
  height: 60px;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(31, 111, 235, 0.2);
  border-radius: 6px;
  color: inherit;
  background: #edf2f7;
  font: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

.devtee-node-attempt-thumb.is-failed {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(254, 242, 242, 0.98);
}

.devtee-node-attempt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.devtee-node-attempt-thumb-text {
  display: -webkit-box;
  align-self: start;
  padding: 4px 5px 0;
  overflow: hidden;
  color: #334155;
  font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.devtee-node-attempt-thumb.is-failed .devtee-node-attempt-thumb-text {
  color: #991b1b;
}

.devtee-node-attempt-thumb-caption {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  font-size: 9.5px;
  font-weight: 700;
}

.devtee-node-attempt-thumb:focus-visible,
.devtee-node-attempt-row:focus-visible,
.devtee-node-attempt-all:focus-visible {
  outline: 2px solid #1f6feb;
  outline-offset: 1px;
}

/* Two try titles show; more scroll inside this fixed-height list. */
.devtee-node-attempt-list {
  max-height: 40px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.devtee-node-attempt-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 20px;
  padding: 2px 3px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  color: #334155;
  background: transparent;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.devtee-node-attempt-row:hover {
  background: #eef4ff;
}

.devtee-node-attempt-row time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.devtee-node-attempt-row.is-failed,
.devtee-node-attempt-row.is-failed time {
  color: #b91c1c;
}

.devtee-node-attempt-tags {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
  margin-left: auto;
}

.devtee-node-attempt-tag {
  padding: 0 4px;
  border-radius: 3px;
  color: #334155;
  background: #e2e8f0;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  white-space: nowrap;
}

.devtee-node-attempt-tag[data-kind="img"] { color: #1d4ed8; background: #dbeafe; }
.devtee-node-attempt-tag[data-kind="3d"] { color: #6d28d9; background: #ede9fe; }
.devtee-node-attempt-tag[data-kind="text"] { color: #475569; background: #f1f5f9; }
.devtee-node-attempt-tag[data-kind="error"] { color: #b91c1c; background: #fee2e2; }
.devtee-node-attempt-tag[data-kind="video"],
.devtee-node-attempt-tag[data-kind="audio"] { color: #047857; background: #d1fae5; }

.devtee-node-attempt-all {
  padding: 2px 6px;
  border: 1px solid rgba(31, 111, 235, 0.32);
  border-radius: 6px;
  color: #1f4fbf;
  background: #eef4ff;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.devtee-node-attempt-all:hover {
  background: #dbe7ff;
}

.devtee-node-result.is-error {
  border-top: 1px solid rgba(239, 68, 68, 0.35);
}

.devtee-node-error-banner {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(254, 226, 226, 0.92);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #991b1b;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
}

.devtee-node-error-banner strong {
  display: block;
  font-weight: 700;
  font-size: 11.5px;
  margin-bottom: 3px;
  color: #b91c1c;
}

.devtee-node-error-reason {
  font-weight: 600;
  word-break: break-word;
}

.devtee-node-error-diagnostics {
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.9;
  word-break: break-word;
}

/* Whichever card's result box the pointer is on comes to the front, on every card type. */
.graphtee-node-decoration:has(.devtee-node-attempts):hover,
.graphtee-node-decoration:has(.devtee-node-attempts):focus-within {
  z-index: 2;
}

/* A tool card with missing code shows its results first, then "Generate code" below. */
.devtee-code-skill:has(> .devtee-node-attempts) > button { top: calc(var(--graphtee-node-card-bottom-offset, 25px) + 144px); }
.devtee-code-skill:has(> .devtee-node-attempts) > .devtee-code-skill-detail { top: calc(var(--graphtee-node-card-bottom-offset, 25px) + 178px); }

.devtee-node-result-threejs-open {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 5px;
  padding: 6px 8px;
  border: 1px solid rgba(31, 111, 235, 0.32);
  border-radius: 6px;
  color: #0f172a;
  background: #eef4ff;
  font-size: 10.5px;
  font-weight: 700;
  cursor: zoom-in;
}

.devtee-node-result-threejs-open:hover {
  background: #dbe7ff;
}

.devtee-node-result-threejs-open.has-poster {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  background: #edf2f7;
}

.devtee-node-result-threejs-poster {
  display: block;
  width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.devtee-node-result-threejs-open.has-poster > span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
}

.devtee-node-result-threejs-fingerprint {
  width: 64px;
  height: 14px;
  border-radius: 3px;
  opacity: 0.78;
  object-fit: cover;
}

.devtee-node-result-threejs-open:focus-visible {
  outline: 3px solid #1f6feb;
  outline-offset: 2px;
}

.devtee-node-result-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  gap: 5px;
  max-height: 132px;
  overflow: auto;
}

.devtee-node-result-images a,
.devtee-node-result-image-trigger,
.devtee-node-result-images img {
  display: block;
  width: 100%;
}

.devtee-node-result-image-trigger {
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  cursor: zoom-in;
  background: #edf2f7;
}

.devtee-node-result-images img {
  height: auto;
  /* A still-loading thumbnail keeps a visible tile instead of collapsing to a sliver. */
  min-height: 48px;
  border-radius: 6px;
  object-fit: contain;
  background: #edf2f7;
}

.devtee-node-result.devtee-node-result-has-images {
  max-height: 144px;
  overflow: auto;
}

.devtee-image-preview {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: clamp(8px, 2vw, 18px);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(5px);
}

.devtee-image-preview[hidden] {
  display: none;
}

.devtee-image-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(920px, 100%);
  height: min(760px, 100%);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.devtee-image-preview-header {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.devtee-image-preview-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-image-preview-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: #eef2f7;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.devtee-image-preview-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 16px;
  background: #f5f7fa;
}

.devtee-image-preview-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.devtee-three-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef2f7;
}

.devtee-code-tools-panel,
.devtee-assets-panel,
.devtee-files-panel,
.devtee-runtime-settings-panel,
.devtee-repository-panel {
  position: absolute;
  z-index: 8;
  top: 46px;
  left: 10px;
  display: block;
  width: min(680px, calc(100% - 20px));
  max-height: calc(100% - 58px);
}

.devtee-code-tools-panel[hidden],
.devtee-assets-panel[hidden],
.devtee-files-panel[hidden],
.devtee-runtime-settings-panel[hidden],
.devtee-repository-panel[hidden] {
  display: none;
}

.devtee-repository-panel {
  z-index: 12;
  inset: 0;
  width: auto;
  max-height: none;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
}

.devtee-code-tools-card,
.devtee-assets-card,
.devtee-files-card,
.devtee-runtime-settings-card {
  display: flex;
  width: 100%;
  max-height: min(580px, calc(100vh - 180px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.devtee-files-panel {
  left: auto;
  right: 10px;
  width: min(520px, calc(100% - 20px));
}

.devtee-files-card {
  max-height: min(620px, calc(100vh - 180px));
}

.devtee-files-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 6px;
  padding: 9px 12px 9px 15px;
  border-bottom: 1px solid #e2e8f0;
}

.devtee-files-header > div {
  min-width: 0;
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
}

.devtee-files-header strong {
  color: #3e277a;
  font-size: 13px;
}

.devtee-files-header span {
  color: #64748b;
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.devtee-files-header button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #d7dce5;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font: 700 11px/1.1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.devtee-files-header button:hover:not(:disabled),
.devtee-files-header button:focus-visible {
  border-color: #9d85d4;
  background: #f0e9ff;
  outline: none;
}

.devtee-files-close {
  width: 29px;
  padding: 2px !important;
  font-size: 19px !important;
  line-height: 1 !important;
}

.devtee-files-path {
  display: block;
  margin: 9px 12px 4px;
  overflow: hidden;
  color: #64748b;
  font: 600 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-files-list {
  min-height: 72px;
  max-height: 490px;
  overflow: auto;
  padding: 3px 8px 10px;
}

.devtee-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-bottom: 1px solid #eef2f7;
}

.devtee-file-row small {
  flex: 0 0 auto;
  color: #94a3b8;
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.devtee-file-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: #334155;
  font: 650 11px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.devtee-file-row.is-directory .devtee-file-name {
  color: #56329a;
}

.devtee-file-name:hover,
.devtee-file-name:focus-visible {
  border-radius: 5px;
  background: #f0e9ff;
  outline: none;
}

.devtee-files-empty {
  margin: 14px 8px;
  color: #64748b;
  font: 600 11px/1.4 ui-sans-serif, system-ui, sans-serif;
  text-align: center;
}

.devtee-files-empty.is-error {
  color: #a13b47;
}

.devtee-runtime-settings-panel {
  width: min(430px, calc(100% - 20px));
}

.devtee-library-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(920px, calc(100% - 20px));
  max-height: calc(100% - 58px);
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.devtee-library-panel .devtee-code-tools-card,
.devtee-library-panel .devtee-assets-card {
  min-height: 0;
  max-height: none;
}

.devtee-repository-card {
  display: flex;
  width: min(1180px, 100%);
  max-height: min(760px, 100%);
  flex-direction: column;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 76px rgba(15, 23, 42, 0.28);
  color: #172033;
}

.devtee-repository-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.devtee-repository-header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.devtee-repository-header strong {
  color: #3e277a;
  font-size: 14px;
}

.devtee-repository-header span {
  overflow: hidden;
  color: #64748b;
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-repository-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: #eef2f7;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.devtee-repository-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #e8edf3;
  background: #f8fafc;
}

.devtee-repository-toolbar label {
  display: grid;
  min-width: 160px;
  gap: 4px;
  color: #475569;
  font: 700 10px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-repository-toolbar select {
  min-height: 32px;
  min-width: 160px;
  padding: 5px 24px 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #172033;
  font: 600 11px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-repository-toolbar button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #bba9e8;
  border-radius: 7px;
  background: #f4efff;
  color: #5b3e9b;
  font: 700 10px/1.2 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.devtee-repository-toolbar button:hover:not(:disabled),
.devtee-repository-toolbar button:focus-visible,
.devtee-repository-close:focus-visible,
.devtee-repository-graph-button:focus-visible,
.devtee-repository-node-button:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}

.devtee-repository-toolbar button:last-child {
  border-color: #7c5bc4;
  background: #7251bd;
  color: #ffffff;
}

.devtee-repository-changes,
.devtee-repository-diff {
  margin: 0;
  padding: 14px 16px 0;
}

.devtee-repository-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 34%);
  overflow: hidden;
}

.devtee-repository-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.devtee-repository-graph-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  background: #fbfcfe;
}

.devtee-repository-graph-pane > h3 {
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 16px 8px;
  color: #334155;
  font-size: 12px;
}

.devtee-repository-graph {
  position: relative;
  display: grid;
  gap: 0;
  max-height: 300px;
  overflow: auto;
  padding: 8px 16px 14px 0;
  background: #fbfcfe;
}

.devtee-repository-graph-item {
  position: relative;
  display: grid;
  min-height: 58px;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: stretch;
  isolation: isolate;
}

.devtee-repository-graph-item::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(16px + (var(--devtee-graph-lane, 0) * 24px));
  width: 3px;
  background: var(--devtee-graph-color, #2563eb);
}

.devtee-repository-graph-item:first-child::before {
  top: 50%;
}

.devtee-repository-graph-item:last-child::before {
  bottom: 50%;
}

.devtee-repository-graph-item::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: calc(10px + (var(--devtee-graph-lane, 0) * 24px));
  width: 15px;
  height: 15px;
  border: 3px solid var(--devtee-graph-color, #2563eb);
  border-radius: 50%;
  background: #ffffff;
  box-sizing: border-box;
  transform: translateY(-50%);
}

.devtee-repository-graph-button {
  grid-column: 2;
  width: calc(100% - 8px);
  min-height: 44px;
  margin: 7px 0 7px 8px;
  padding: 7px 10px 7px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
  border: 1px solid #d8dee8;
  border-left: 4px solid var(--devtee-graph-color, #2563eb);
  border-radius: 5px;
  background: #ffffff;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.devtee-repository-graph-button:hover {
  border-color: var(--devtee-graph-color, #2563eb);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.devtee-repository-graph-button span,
.devtee-repository-graph-button small {
  grid-column: 2;
  color: var(--devtee-graph-color, #2563eb);
  font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.devtee-repository-graph-button small {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 9px;
}

.devtee-repository-graph-item[data-selected="true"] .devtee-repository-graph-button {
  border-color: var(--devtee-graph-color, #2563eb);
  background: color-mix(in srgb, var(--devtee-graph-color, #2563eb) 9%, #ffffff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--devtee-graph-color, #2563eb) 18%, transparent);
}

.devtee-repository-graph-item[data-current="true"]::after {
  width: 19px;
  height: 19px;
  border-width: 4px;
  box-shadow: 0 0 0 3px #ffffff;
}

.devtee-repository-changes-header,
.devtee-repository-diff-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.devtee-repository-changes-header h3,
.devtee-repository-diff-header h3 {
  margin: 0;
  color: #334155;
  font-size: 12px;
}

.devtee-repository-changes-header span,
.devtee-repository-diff-header > span {
  color: #64748b;
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.devtee-repository-node-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.devtee-repository-node-button {
  min-width: 0;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.devtee-repository-node-button small {
  overflow: hidden;
  color: #64748b;
  font: 600 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-repository-node-button[data-selected="true"] {
  border-color: #ed9c42;
  background: #fff8ed;
  box-shadow: 0 0 0 2px rgba(237, 156, 66, 0.14);
}

.devtee-repository-diff {
  padding-bottom: 18px;
}

.devtee-repository-diff-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}

.devtee-repository-code {
  min-width: 0;
  min-height: 150px;
  max-height: 290px;
  margin: 0;
  overflow: auto;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #101923;
  color: #dfeaf5;
  font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
}

.devtee-repository-code header {
  position: sticky;
  top: 0;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #1d2b3a;
  color: #d8c9ff;
  font: 700 10px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-repository-code code {
  display: block;
  padding: 9px;
  white-space: pre-wrap;
}

.devtee-repository-code-before {
  border-color: #d5c5e9;
}

.devtee-repository-code-after {
  border-color: #b8d9c5;
}

.devtee-repository-empty {
  margin: 9px 0 0;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 680px) {
  .devtee-code-tools-panel,
  .devtee-assets-panel,
  .devtee-runtime-settings-panel {
    top: 150px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100% - 158px);
  }

  .devtee-library-panel {
    grid-template-columns: minmax(0, 1fr);
    width: auto;
    max-height: calc(100% - 158px);
    padding: 8px;
  }

  .devtee-repository-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: none;
    padding: 10px;
  }

  .devtee-repository-card {
    max-height: 100%;
  }

  .devtee-repository-diff-columns {
    grid-template-columns: 1fr;
  }

  .devtee-repository-graph-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .devtee-repository-body {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .devtee-repository-main {
    overflow: visible;
  }

  .devtee-repository-graph-pane {
    order: -1;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    border-left: 0;
  }

  .devtee-repository-graph {
    max-height: 230px;
  }
}

.devtee-code-tools-header,
.devtee-assets-header,
.devtee-runtime-settings-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.devtee-code-tools-header > div,
.devtee-assets-header > div,
.devtee-runtime-settings-header > div {
  display: grid;
  gap: 2px;
}

.devtee-code-tools-header span,
.devtee-assets-header span,
.devtee-runtime-settings-header span {
  color: #64748b;
  font-size: 11px;
}

.devtee-code-tools-close,
.devtee-assets-close,
.devtee-runtime-settings-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: #eef2f7;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.devtee-runtime-settings-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.devtee-runtime-settings-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font: 700 11px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-runtime-settings-form select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 6px 9px;
  font: 500 12px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-runtime-settings-form p {
  margin: 0;
  color: #64748b;
  font-size: 11px;
}

.devtee-runtime-settings-form p[data-editable="false"] {
  color: #a04d35;
}

.devtee-runtime-settings-form > button {
  min-height: 34px;
  border: 1px solid #8061c8;
  border-radius: 8px;
  background: #7251bd;
  color: #fff;
  font-weight: 700;
}

.devtee-code-tools-list,
.devtee-assets-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #f7f9fc;
}

.devtee-assets-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
}

.devtee-code-tools-empty,
.devtee-assets-empty {
  margin: 0;
  padding: 28px 16px;
  color: #64748b;
  text-align: center;
}

.devtee-assets-empty.is-error {
  color: #b42318;
}

.devtee-asset-item {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #fff;
}

.devtee-asset-item[draggable="true"] {
  cursor: grab;
}

.devtee-asset-item.is-dragging {
  opacity: 0.52;
  cursor: grabbing;
}

.devtee-asset-preview {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  color: #1d4ed8;
  background: #eef4ff;
  font: inherit;
  font-size: 28px;
  text-decoration: none;
  cursor: pointer;
}

.devtee-asset-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #f5f7fa;
}

.devtee-asset-details {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.devtee-asset-details strong,
.devtee-asset-details span,
.devtee-asset-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-asset-details span,
.devtee-asset-details small {
  color: #64748b;
}

.devtee-code-tool-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #c9dfd2;
  border-radius: 10px;
  background: #fff;
}

.devtee-code-tool-item[draggable="true"] {
  cursor: grab;
}

.devtee-code-tool-item.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.devtee-editor-graph-host.devtee-code-tool-drop-target {
  outline: 3px solid rgba(46, 125, 246, 0.55);
  outline-offset: -3px;
}

.devtee-code-tool-item[data-status="stale"] {
  border-color: #efd49d;
}

.devtee-code-tool-item > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.devtee-code-tool-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.devtee-code-tool-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-code-tool-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #2e7df6;
  font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.devtee-code-tool-icon[data-kind="transform"] {
  background: #7656d8;
  font-size: 16px;
}

.devtee-code-tool-icon[data-kind="decision"] {
  background: #c57919;
  font-size: 18px;
}

.devtee-code-tool-item > header span {
  color: #27784d;
  font: 700 10px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-code-tool-item[data-status="stale"] > header span {
  color: #9a650f;
}

.devtee-code-tool-item small,
.devtee-code-tool-item time {
  color: #64748b;
  font-size: 10.5px;
}

.devtee-code-tool-item code {
  display: block;
  padding: 6px 8px;
  overflow: hidden;
  border-radius: 6px;
  background: #eef3f8;
  color: #334155;
  font: 500 10.5px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.devtee-node-result-media {
  display: block;
  width: 100%;
  max-height: 92px;
  margin-top: 4px;
}

.devtee-node-result-link {
  display: block;
  padding: 3px 2px;
  overflow: hidden;
  color: #1f6feb;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devtee-node-result pre {
  margin: 0;
  overflow: hidden;
  color: inherit;
  font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* All tries panel: one try per block, its full result laid out at reading size. */
.devtee-tries-stage {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #f5f7fa;
}

.devtee-tries-item {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  scroll-margin-top: 12px;
}

.devtee-tries-item.is-failed {
  border-color: rgba(220, 38, 38, 0.45);
}

.devtee-tries-item.is-focused {
  box-shadow: 0 0 0 2px #1f6feb;
}

.devtee-tries-item > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  color: #0f172a;
  background: #f1f5f9;
  font-size: 12.5px;
}

.devtee-tries-item.is-failed > header {
  color: #991b1b;
  background: rgba(254, 226, 226, 0.98);
}

.devtee-tries-item > header time {
  color: #64748b;
}

.devtee-tries-item .devtee-node-attempt-tag {
  font-size: 10.5px;
  line-height: 17px;
}

.devtee-tries-item .devtee-node-result {
  position: static;
  width: auto;
  max-height: none;
  padding: 12px;
  overflow: visible;
  transform: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.devtee-tries-item .devtee-node-result-images {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: none;
  overflow: visible;
}

.devtee-tries-item .devtee-node-result-threejs-open {
  position: relative;
}

.devtee-tries-item .devtee-node-result-threejs-poster {
  max-height: 320px;
}

.devtee-tries-item .devtee-node-result pre {
  max-height: 360px;
  overflow: auto;
  font-size: 11.5px;
}

.graphtee-viewport canvas:active {
  cursor: grabbing;
}

.graphtee-detail {
  min-width: 0;
  min-height: 44px;
  padding: 9px 13px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  border-top: 1px solid #e4e9ef;
  background: #fbfcfe;
}

.graphtee-detail strong {
  flex: 0 0 auto;
  color: #23466b;
  font-size: 12px;
}

.graphtee-detail span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #66768a;
  font-size: 10.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graphtee-children-toggle {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #b9d4ef;
  border-radius: 6px;
  background: #edf5fd;
  color: #174f85;
  font-size: 10.5px;
  white-space: nowrap;
}

.graphtee-children-toggle:hover {
  background: #dfeefe;
}

.graphtee-error {
  min-height: 110px;
  padding: 20px;
  place-items: center;
  color: #66768a;
  font-size: 12px;
}

.graphtee-error {
  display: grid;
  border-color: #efb2b2;
  background: #fff7f7;
  color: #9b2c2c;
}

.message-file-download {
  min-width: 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid #bfd3e8;
  border-radius: 7px;
  background: #f4f8fc;
  color: #174f85;
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.message-file-download:hover {
  border-color: #6da5dc;
  background: #eaf4ff;
  transform: translateY(-1px);
}

.message-file-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #dcecff;
  color: #1f6feb;
  font-size: 18px;
  font-weight: 700;
}

.message-file-download > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.message-file-download strong {
  overflow: hidden;
  color: #174f85;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-file-download small {
  color: #5d7186;
  font-size: 10px;
}

.message-enter {
  animation: message-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.message.user {
  align-self: flex-end;
  border-color: #9ec5fe;
  background: #edf5ff;
}

.message.assistant {
  align-self: flex-start;
}

.message.status {
  align-self: flex-start;
  color: #5d6b7a;
  background: #ffffff;
}

.message.status.live-status {
  width: 100%;
  max-width: none;
  height: auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-items: start;
  align-content: start;
  gap: 10px;
  min-height: 72px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.thinking-motion-loader {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: block;
  align-self: start;
  contain: layout size style;
  overflow: clip;
  overflow-clip-margin: 12px;
  pointer-events: none;
  user-select: none;
}

.thinking-motion-placeholder {
  position: absolute;
  inset: 7px;
  border: 2px solid #4a4a4a;
  border-top-color: transparent;
  border-radius: 50%;
  animation: thinking-motion-placeholder 700ms linear infinite;
}

.thinking-motion-scene,
.thinking-motion-part {
  position: absolute;
  display: block;
  overflow: visible;
}

.thinking-motion-part {
  inset: 0;
  transform-origin: center;
  will-change: transform, opacity;
}

.thinking-motion-graphic {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  transform: translate(-50%, -50%);
  transform-origin: center;
  overflow: visible;
}

.thinking-motion-graphic > svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.live-status-text {
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  max-height: none;
  min-height: 58px;
  margin-top: 7px;
  display: grid;
  align-content: center;
  align-self: start;
  justify-self: start;
  padding: 11px 13px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  contain: none;
}

.composer {
  min-width: 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 10px max(12px, calc((100% - var(--chat-reading-width)) / 2));
  border-top: 1px solid #d8dee4;
  background: #ffffff;
}

.game-chat .composer {
  border-top-color: #d8dee4;
  background: #ffffff;
}

.composer-input {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: end;
  gap: 8px;
  border: 1px solid #ccd4dd;
  border-radius: 14px;
  padding: 7px;
  background: #ffffff;
}

.composer-input textarea {
  min-width: 0;
  min-height: 34px;
  max-height: 180px;
  border: 0;
  border-radius: 0;
  padding: 7px 0;
  line-height: 1.4;
  resize: none;
  overflow-y: hidden;
}

.composer-input textarea:focus {
  outline: none;
}

.attach-button,
.send-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
}

.attach-button {
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
}

.attach-button span,
.send-button span {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;
  background: linear-gradient(currentColor, currentColor) center 4px / 2px 10px no-repeat;
}

.attach-button span::before,
.attach-button span::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: currentColor;
}

.attach-button span::before {
  top: 7px;
  left: 2px;
  width: 12px;
  height: 2px;
}

.attach-button span::after {
  top: 2px;
  left: 7px;
  width: 2px;
  height: 12px;
}

.send-button {
  background: #17202a;
  border-color: #17202a;
  color: #ffffff;
}

.send-button span::before,
.send-button span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 7px;
  width: 2px;
  height: 8px;
  background: currentColor;
  border-radius: 999px;
  transform-origin: 50% 0;
}

.send-button span::before {
  transform: rotate(45deg);
}

.send-button span::after {
  transform: rotate(-45deg);
}

.command-menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: min(340px, calc(100vw - 56px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ccd4dd;
  border-block: 0;
  border-left: 0;
  border-radius: 0;
  padding: 0;
  background: #ffffff;
  box-shadow: 18px 0 48px rgba(23, 32, 42, 0.2);
  animation: side-panel-in 160ms ease-out;
}

.command-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(23, 32, 42, 0.28);
}

.command-menu-header {
  min-height: 58px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d8dee4;
}

.command-menu-header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.command-menu-header strong {
  font-size: 15px;
}

.command-menu-header span {
  overflow: hidden;
  color: #5d6b7a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-menu-close,
.side-panel-project button {
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
}

.command-menu-items {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.command-menu-items button {
  width: 100%;
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: #17202a;
  text-align: left;
}

.command-menu-items button:hover,
.command-menu-items button:focus-visible {
  background: #edf5ff;
  outline: none;
}

.command-menu-items span {
  font-weight: 700;
}

.command-menu-items small {
  color: #5d6b7a;
  font-size: 12px;
}

.file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-tray {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.attachment-tray[hidden] {
  display: none;
}

.graphtee-selection-tray {
  overflow: visible;
  padding-block: 0 2px;
}

.attachment-preview {
  position: relative;
  flex: 0 0 176px;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid #d8dee4;
  border-radius: 12px;
  padding: 6px 9px 6px 6px;
  background: #f8fafc;
}

.graphtee-selection-preview {
  flex: 0 1 270px;
  width: 270px;
  max-width: calc(100% - 4px);
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  border-radius: 9px;
  padding: 3px 7px 3px 3px;
  border-color: #a9c8ee;
  background: #f4f8fd;
}

.attachment-preview-visual.graphtee-selection-preview-visual {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #dcecff;
  color: #245fa5;
  font-size: 8px;
}

.attachment-preview-visual {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #e8eef5;
  color: #516170;
  font-size: 10px;
  font-weight: 800;
}

.attachment-image-preview-trigger {
  position: relative;
  border: 0;
  padding: 0;
  cursor: zoom-in;
}

.attachment-image-preview-trigger:focus-visible {
  outline: 2px solid #1f6feb;
  outline-offset: 2px;
}

.attachment-preview-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview.is-uploading {
  border-color: #86bdf5;
  background: #f2f8ff;
}

.attachment-preview.is-relaying {
  border-color: #8cb9e6;
  background: #f4f8fd;
}

.attachment-preview.is-relay-saved {
  border-color: #8bcda0;
  background: #f3fbf5;
}

.attachment-preview.has-relay-error {
  border-color: #eaa4a4;
  background: #fff8f8;
}

.attachment-preview.has-relay-error .attachment-preview-details small {
  color: #a13939;
}

.attachment-preview.has-upload-error {
  border-color: #eaa4a4;
  background: #fff8f8;
}

.attachment-preview.has-upload-error .attachment-preview-details small {
  color: #a13939;
}

.attachment-upload-progress {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--attachment-progress-color, #1f6feb);
  box-shadow: 0 1px 3px rgba(23, 32, 42, 0.28);
  pointer-events: none;
}

.attachment-upload-progress[data-state="staged"] {
  --attachment-progress-color: #7656d6;
}

.attachment-upload-progress[data-state="relaying"] {
  --attachment-progress-color: #0c9bb3;
}

.attachment-upload-progress.is-complete {
  --attachment-progress-color: #269454;
}

.attachment-upload-progress.is-failed {
  --attachment-progress-color: #c34545;
}

.attachment-preview-details {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.attachment-preview-details strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.attachment-preview-details small {
  color: #6a7785;
  font-size: 11px;
}

.graphtee-selection-preview .attachment-preview-details {
  gap: 0;
}

.graphtee-selection-preview .attachment-preview-details strong {
  font-size: 11px;
  line-height: 1.2;
}

.graphtee-selection-preview .attachment-preview-details small {
  font-size: 10px;
  line-height: 1.2;
}

.attachment-preview-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #c8d0d9;
  border-radius: 50%;
  padding: 0 0 2px;
  background: #17202a;
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 120ms ease, transform 120ms ease;
}

.graphtee-selection-preview .attachment-preview-remove {
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  padding-bottom: 1px;
  font-size: 15px;
}

.attachment-preview:hover .attachment-preview-remove,
.attachment-preview:focus-within .attachment-preview-remove {
  opacity: 1;
  transform: scale(1);
}

@media (hover: none) {
  .attachment-preview-remove {
    opacity: 1;
    transform: scale(1);
  }
}

.attachment-summary {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #5d6b7a;
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .shell {
    border-inline: 0;
  }

  .messages {
    padding: 10px;
  }

  .messages.has-live-status {
    padding-bottom: 4px;
  }

  .message.status.live-status {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 6px;
    min-height: 56px;
  }

  .thinking-motion-loader {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    overflow-clip-margin: 10px;
  }

  .live-status-text {
    min-height: 50px;
    margin-top: 6px;
    padding: 9px 11px;
    font-size: 16px;
    line-height: 1.45;
  }

  .topbar {
    min-height: 0;
    padding: 6px 8px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .chatbee-icon {
    width: 30px;
    height: 30px;
  }

  .brand-title {
    min-height: 30px;
    align-items: center;
    gap: 5px;
  }

  .brand-title h1 {
    font-size: 17px;
  }

  .topbar p {
    display: block;
    max-width: 190px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .topbar-actions button {
    padding: 7px 10px;
    font-size: 13px;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr);
    flex: 0 0 auto;
    min-height: 58px;
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 12;
  }

  .chat-panel.graphtee-workspace-open:not(.game-chat) > .chat-workspace {
    flex: 1 1 0;
    min-height: 0;
  }

  .composer-input {
    min-height: 48px;
    overflow: visible;
  }

  .attach-button,
  .send-button {
    position: relative;
    z-index: 1;
    flex: 0 0 34px;
  }

  .chat-panel.game-chat {
    display: block;
  }

  .chat-panel.graphtee-workspace-open:not(.game-chat) {
    flex-direction: column;
  }

  .chat-panel.graphtee-workspace-open:not(.game-chat) > .chat-workspace {
    width: 100%;
    height: auto;
  }

  .chat-panel:not(.game-chat) > .graphtee-workspace {
    width: 100%;
    height: auto;
    min-width: 0;
    flex-basis: calc(var(--graphtee-divider-position, 50%) - 5px);
    border-right: 0;
    border-bottom: 1px solid #ccd4dd;
  }

  .graphtee-resize-handle {
    width: 100%;
    height: 10px;
    min-width: 0;
    min-height: 10px;
    border-inline: 0;
    border-block: 1px solid #d6dee7;
    cursor: row-resize;
  }

  .graphtee-resize-handle span {
    width: 42px;
    height: 3px;
  }

  .graphtee-resize-handle:hover span,
  .graphtee-resize-handle:focus-visible span,
  .graphtee-resizing .graphtee-resize-handle span {
    width: 58px;
    height: 3px;
  }

  .chat-panel.graphtee-resizing,
  .chat-panel.graphtee-resizing * {
    cursor: row-resize !important;
  }

  .graphtee-stage .graphtee-card,
  .graphtee-stage .graphtee-card.expanded {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 36px minmax(0, 1fr);
  }

  .graphtee-stage .graphtee-card-header {
    grid-row: 1;
    grid-column: 1 / -1;
  }

  .graphtee-stage .graphtee-viewport {
    grid-row: 2;
    grid-column: 1;
  }

  .graphtee-stage .graphtee-detail {
    display: none;
  }

  .graphtee-editor {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .graphtee-editor-apply {
    width: 100%;
  }

  .game-tools-panel {
    top: 104px;
    left: 8px;
    width: 180px;
    min-width: 0;
    max-height: 42vh;
  }

  .game-tools-list {
    max-height: 15vh;
  }

  .game-object-list {
    max-height: 20vh;
  }

  .game-workbench-header {
    padding-inline: 8px;
  }

  .game-workbench-header > div:first-child span {
    display: none;
  }

  .game-preview-heading > strong,
  .game-scene-sync-status {
    display: none;
  }

  .game-scene-traffic-status,
  .game-scene-fps-status {
    padding-inline: 5px;
    font-size: 9px;
  }

  .game-preview-actions button {
    min-width: 44px;
    padding-inline: 6px;
  }

  .game-sync-debug-panel {
    position: fixed;
    top: 104px;
    right: 8px;
    left: 8px;
    width: auto;
    height: min(58dvh, 520px);
    min-width: 0;
  }

  .game-sync-debug-panel > header {
    align-items: flex-start;
  }

  .game-sync-debug-panel > header > div:first-child {
    display: block;
  }

  .game-sync-debug-panel > header span {
    display: block;
    margin-top: 2px;
  }

  .game-chat .game-workbench {
    position: fixed;
    inset: 0;
  }

  .game-chat .chat-workspace {
    top: auto;
    bottom: 12px;
    left: 12px;
    width: auto;
    height: min(64dvh, 560px);
    max-height: calc(100dvh - 74px);
  }

  .game-chat.graphtee-workspace-open .graphtee-workspace,
  .game-chat.graphtee-workspace-open .chat-workspace {
    right: 12px;
    left: 12px;
    width: auto;
  }

  .game-chat.graphtee-workspace-open .graphtee-workspace {
    top: 62px;
    bottom: auto;
    height: calc(var(--graphtee-divider-position, calc(50% + 25px)) - 67px);
  }

  .game-chat.graphtee-workspace-open .chat-workspace {
    top: calc(var(--graphtee-divider-position, calc(50% + 25px)) + 5px);
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    height: auto;
  }

  .game-chat .graphtee-resize-handle,
  .game-shell .game-chat .graphtee-resize-handle {
    top: calc(var(--graphtee-divider-position, calc(50% + 25px)) - 5px);
    right: 12px;
    bottom: auto;
    left: 12px;
    width: auto;
    height: 10px;
  }

  .game-chat .game-workbench-header {
    top: 62px;
    right: 12px;
  }

  .chat-overlay-toggle {
    top: auto;
    right: 22px;
    bottom: calc(min(64%, 560px) - 42px);
  }

  .tools-overlay-toggle {
    top: 68px;
    left: 10px;
  }

  .project-header,
  .side-panel-project {
    align-items: stretch;
    flex-direction: column;
  }

  .project-header-actions {
    justify-content: stretch;
  }

  .project-header-actions button {
    flex: 1 1 0;
  }

  .side-panel-project button {
    align-self: flex-end;
  }

  .project-create-dialog {
    padding: 12px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .project-card-actions {
    justify-content: stretch;
  }

  .project-card-actions button {
    flex: 1 1 0;
    min-width: 0;
  }
}

.model-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 42, 0.36);
  animation: dialog-fade-in 150ms ease-out;
}

.attachment-image-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 14, 20, 0.76);
  animation: dialog-fade-in 150ms ease-out;
}

.attachment-image-dialog[hidden] {
  display: none;
}

.attachment-image-dialog-panel {
  width: min(1040px, 100%);
  max-height: min(860px, 90vh);
  min-height: 0;
  margin: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #425365;
  border-radius: 12px;
  background: #111820;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56);
  animation: dialog-panel-in 170ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.attachment-image-dialog-header {
  min-width: 0;
  padding: 10px 12px 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #2c3946;
  background: #17212b;
}

.attachment-image-dialog-header h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #e5edf5;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-image-dialog-header button {
  flex: 0 0 auto;
  border-color: #425365;
  background: #202d39;
  color: #e5edf5;
}

.attachment-image-dialog-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: #0b1117;
}

.attachment-image-dialog-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 80px);
  object-fit: contain;
}

.scene-file-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 14, 20, 0.7);
  animation: dialog-fade-in 150ms ease-out;
}

.scene-file-dialog[hidden] {
  display: none;
}

.scene-file-dialog-panel {
  width: min(920px, 100%);
  height: min(760px, 86vh);
  min-height: 300px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #425365;
  border-radius: 10px;
  background: #111820;
  color: #e5edf5;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  animation: dialog-panel-in 170ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.scene-file-dialog-header {
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #2c3946;
  background: #17212b;
}

.scene-file-dialog-header > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.scene-file-dialog-header h2 {
  margin: 0;
  font-size: 15px;
}

.scene-file-dialog-header span {
  overflow: hidden;
  color: #91a2b3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-file-dialog-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.scene-file-dialog-actions button {
  border-color: #425365;
  background: #202d39;
  color: #e5edf5;
}

#gameSceneFileCopyButton {
  border-color: #2f74bb;
  color: #9ec5fe;
}

#gameSceneFilePreview {
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 16px;
  background: #0b1117;
  color: #d7e3ef;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
  user-select: text;
  white-space: pre;
}

@media (max-width: 640px) {
  .scene-file-dialog {
    padding: 8px;
  }

  .scene-file-dialog-panel {
    height: 92vh;
  }

  .scene-file-dialog-header {
    align-items: stretch;
    flex-direction: column;
  }

  .scene-file-dialog-actions button {
    flex: 1 1 0;
  }
}

.model-dialog-panel {
  width: min(420px, 100%);
  max-height: min(520px, 82vh);
  overflow: auto;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(23, 32, 42, 0.24);
  animation: dialog-panel-in 170ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.model-dialog-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #d8dee4;
  background: #ffffff;
}

.model-dialog-header h2 {
  font-size: 18px;
}

.model-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-dialog-refresh,
.model-dialog-close {
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
}

.model-dialog-refresh {
  border-color: #1f6feb;
  color: #1f6feb;
}

.model-choice-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.session-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
}

.model-choice {
  width: 100%;
  display: grid;
  gap: 2px;
  border-color: #ccd4dd;
  background: #ffffff;
  color: #17202a;
  text-align: left;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.model-choice:hover,
.model-choice:focus-visible {
  border-color: #1f6feb;
  background: #edf5ff;
  outline: none;
}

.model-choice.current {
  border-color: #1f6feb;
  background: #edf5ff;
}

.model-choice:not(:disabled):active {
  transform: translateY(1px);
}

.session-rename {
  align-self: stretch;
  padding: 8px 10px;
  border-color: #ccd4dd;
  background: #f6f8fa;
  color: #354252;
  font-size: 12px;
}

.session-rename:hover,
.session-rename:focus-visible {
  border-color: #1f6feb;
  background: #edf5ff;
  color: #1f6feb;
  outline: none;
}

.model-choice span {
  font-weight: 700;
}

.model-choice small,
.model-choice-empty,
.model-dialog-message,
.model-dialog-summary {
  color: #5d6b7a;
  font-size: 12px;
}

.model-choice-empty,
.model-dialog-message {
  margin: 0;
  padding: 8px 2px;
}

.model-dialog-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #17202a;
  font-size: 14px;
}

.model-dialog-summary {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 2px 2px 8px;
}

.model-dialog-summary div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
}

.model-dialog-summary dt,
.model-dialog-summary dd {
  margin: 0;
  min-width: 0;
}

.model-dialog-summary dt {
  color: #5d6b7a;
  font-weight: 700;
}

.model-dialog-summary dd {
  color: #17202a;
  overflow-wrap: anywhere;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes thinking-motion-placeholder {
  to {
    transform: rotate(360deg);
  }
}

@keyframes side-panel-in {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dialog-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes dialog-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .graphtee-card {
    grid-template-rows: auto clamp(300px, 55vh, 420px) auto;
  }

  .graphtee-card.expanded {
    grid-template-rows: auto minmax(430px, 65vh) auto;
  }

  .graphtee-card-header {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 10px;
  }

  .graphtee-card-header span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .graphtee-card-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .graphtee-card-actions button {
    min-height: 32px;
    padding: 5px 8px;
  }

  .graphtee-detail {
    padding: 9px 10px 10px;
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .graphtee-detail span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .graphtee-stage .graphtee-card.graphtee-styling {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 36px minmax(180px, 1fr) minmax(230px, auto);
  }

  .graphtee-stage .graphtee-card.graphtee-styling .graphtee-viewport {
    grid-row: 2;
    grid-column: 1;
  }

  .graphtee-stage .graphtee-card.graphtee-styling .graphtee-detail {
    grid-row: 3;
    grid-column: 1;
    max-height: 42vh;
    border-top: 1px solid #dbe3ec;
    border-left: 0;
  }

}

@media (max-width: 1100px) {
  .devtee-editor-split.source-visible {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 1.15fr) minmax(240px, 0.85fr);
  }

  .devtee-editor-split.source-visible .devtee-editor-canvas {
    border-right: 0;
    border-bottom: 1px solid #cfd9e4;
  }
}

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

/* TypeSafe Jev (#E551BA) live badge and status styling */
:root {
  --jev-color: #E551BA;
  --jev-color-deep: #9d1c78;
  --jev-color-bg: #fdf2fa;
  --jev-color-border: #f3b6e2;
}

.history-bar .jev-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--jev-color-border);
  background: var(--jev-color-bg);
  color: var(--jev-color-deep);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.history-bar .jev-live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jev-color);
  box-shadow: 0 0 0 2px rgba(229, 81, 186, 0.22);
  flex: 0 0 6px;
}

.history-bar .jev-live-badge:hover,
.history-bar .jev-live-badge:focus-visible {
  border-color: var(--jev-color);
  box-shadow: 0 0 0 2px rgba(229, 81, 186, 0.18);
  outline: none;
}

.history-bar .jev-live-badge[data-active="true"] {
  border-color: var(--jev-color);
  background: #fce7f6;
  box-shadow: 0 0 0 2px rgba(229, 81, 186, 0.26);
}

.live-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.message.status.live-status.has-jev-live .live-status-text,
.live-status-primary.is-jev-primary {
  color: var(--jev-color);
  font: inherit;
  font-weight: inherit;
}


.message.status.live-status .live-status-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.devtee-runtime-subagents-section {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed rgba(15, 23, 42, 0.14);
  max-height: 240px;
  overflow-y: auto;
}

.devtee-group-model {
  position: absolute;
  z-index: 14;
  left: 12px;
  bottom: 12px;
  display: grid;
  gap: 8px;
  justify-items: start;
}

.devtee-group-model[hidden],
.devtee-group-model-popover[hidden] {
  display: none;
}

@media (max-width: 680px) {
  .devtee-group-model {
    left: 8px;
    bottom: 70px;
  }
}

.devtee-group-model-button {
  min-height: 34px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 6px 12px;
  font: 700 12px/1.2 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}

.devtee-group-model-popover {
  order: -1;
  display: grid;
  gap: 10px;
  width: min(300px, calc(100vw - 48px));
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
  color: #172033;
  font: 500 12px/1.3 ui-sans-serif, system-ui, sans-serif;
}

.devtee-group-model-popover p {
  margin: 0;
  color: #64748b;
}

.devtee-group-model-popover label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 700;
}

.devtee-group-model-popover select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 6px 9px;
  font: 500 12px/1.2 ui-sans-serif, system-ui, sans-serif;
}

.devtee-group-model-popover > button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font: 700 12px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}
