:root {
  color-scheme: dark;
  --accent-neon: #00d4ff;
  --accent-neon-hover: #33dfff;
  --accent-neon-active: #00a8cc;
  --accent-neon-glow: rgba(0, 212, 255, 0.16);
  --bg-base: #141418;
  --bg-elevated: #1c1c22;
  --bg-surface: #232329;
  --bg-input: #18181e;
  --border-subtle: #2a2a30;
  --border-strong: #363640;
  --text-primary: #e0e0e0;
  --text-secondary: rgba(255, 255, 255, 0.52);
  --text-muted: rgba(255, 255, 255, 0.28);
  --danger: #ff4d4f;
  --warning: #faad14;
  --success: #52c41a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg-base);
  color: var(--text-primary);
}

::selection {
  background: var(--accent-neon-glow);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: #2a2a30;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #36363e;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-neon);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 82px minmax(0, 1fr);
  background: var(--bg-base);
}

/* The hosted status row is explicit only while visible. This keeps job
   recovery in the document flow without allowing it to create an implicit
   grid row that collapses the editor and preview. */
#hostedSignIn,
#hostedJobs {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  width: min(420px, calc(100% - 36px));
  max-width: calc(100% - 36px);
  margin: 4px 18px;
}

.app-shell:has(#hostedSignIn:not([hidden]), #hostedJobs:not([hidden])) {
  grid-template-rows: 82px auto minmax(0, 1fr);
}

.app-shell:has(#hostedSignIn:not([hidden]), #hostedJobs:not([hidden])) .workspace {
  grid-row: 3;
}

#hostedSignIn {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
}

#hostedJobs {
  width: min(280px, calc(100% - 36px));
  /* This item occupies the auto-sized status row.  A percentage max-height
     is indefinite in that track, so a long retained-job list can size the
     row to the full viewport and collapse the workspace. */
  min-height: 0;
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

#hostedJobs form {
  margin-top: 8px;
}

#hostedJobs summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, auto);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 6px;
  padding: 12px 18px 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-base);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  grid-column: 1;
  grid-row: 1 / 3;
}

.mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent-neon);
  font-weight: 850;
}

.eyebrow {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 3px;
  color: var(--accent-neon);
  font-size: 30px;
  line-height: 1;
  font-weight: 840;
}

h2 {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 720;
}

.status-pill {
  min-width: 56px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.06);
  color: var(--accent-neon);
  font-size: 12px;
  font-weight: 700;
}

.topbar-metrics {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.toolbar {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
}

.authoring-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.usage-bar {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.reasoning-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.reasoning-control select {
  min-width: 90px;
  max-width: 150px;
  height: 30px;
  padding: 4px 26px 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
}

#authoringModel {
  min-width: 118px;
}

.usage-heading,
.usage-stat {
  padding: 6px 8px;
}

.usage-heading {
  color: var(--text-muted);
  font-weight: 750;
  text-transform: uppercase;
}

.usage-stat {
  border-left: 1px solid var(--border-subtle);
}

.usage-stat strong {
  color: var(--text-primary);
  font-weight: 800;
}

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

.review-button.approved {
  border-color: rgba(93, 207, 125, 0.65);
  background: rgba(93, 207, 125, 0.12);
  color: #8ee7a7;
}

.view-toggle,
.view-selector {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}

.view-selector {
  padding: 0 8px;
  height: 34px;
  overflow: visible;
}

.view-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.view-selector select {
  width: auto;
  min-width: 132px;
  height: 26px;
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 760;
}

.view-toggle-button {
  height: 34px;
  min-width: 74px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.view-toggle-button:last-child {
  border-right: 0;
}

.view-toggle-button.active {
  background: var(--accent-neon);
  color: #000;
}

.button,
.text-button,
.tab {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.button {
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 720;
}

.button:hover,
.text-button:hover,
.tab:hover {
  color: var(--accent-neon);
  border-color: var(--accent-neon);
  background: #282830;
}

.button.primary {
  background: var(--accent-neon);
  border-color: var(--accent-neon);
  color: #000;
}

.button.primary:hover {
  background: var(--accent-neon-hover);
  color: #000;
}

.button.danger {
  border-color: rgba(255, 77, 79, 0.55);
  color: #ff8b8d;
}

.button.danger:hover {
  border-color: var(--danger);
  background: rgba(255, 77, 79, 0.12);
  color: #ffd4d5;
}

.button.compact {
  height: 32px;
  padding: 0 10px;
}

.button.wide {
  width: 100%;
}

.text-button {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 720;
}

.workspace {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--conversation-height, 260px);
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.object-pane,
.code-pane,
.preview-pane,
.conversation-pane {
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.object-pane {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  overflow: auto;
}

.object-pane > * {
  flex-shrink: 0;
}

.code-pane {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
}

.failed-candidate-panel {
  max-height: min(42%, 320px);
  overflow: auto;
  border: 1px solid rgba(255, 77, 79, 0.45);
  border-radius: 7px;
  background: var(--bg-surface);
}

.failed-candidate-panel[hidden] {
  display: none;
}

.failed-candidate-panel summary {
  padding: 8px 10px;
  color: #ffb0b2;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.failed-candidate-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 0 10px 8px;
}

.failed-candidate-toolbar label {
  width: min(210px, 45%);
}

.failed-candidate-status {
  padding-bottom: 8px;
  color: var(--text-secondary);
  font-size: 11px;
}

.failed-candidate-source {
  max-height: 190px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  white-space: pre;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.failed-candidate-blockers {
  padding: 8px 10px;
  color: #ffb0b2;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.pane-head,
.preview-head {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.path-row,
.form-grid,
.settings-row {
  display: grid;
  gap: 10px;
}

.path-row {
  grid-template-columns: 1fr;
}

.form-grid {
  grid-template-columns: 1fr 1fr;
}

.settings-row {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.settings-row .button {
  width: 100%;
}

label {
  display: grid;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 8px 10px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-neon);
  box-shadow: 0 0 0 3px var(--accent-neon-glow);
}

select {
  appearance: none;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.source-editor {
  min-height: 0;
  height: 100%;
  resize: none;
  border-color: #202028;
  background: #0f1115;
  color: #dce6e8;
  font: 13px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
}

.preview-pane {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  position: relative;
  padding: 10px;
  overflow: hidden;
}

.preview-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.preview-pane.has-parameters .preview-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 38%);
}

.preview-canvas {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
}

.preview-view-selector {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  background: rgba(28, 28, 34, 0.94);
  backdrop-filter: blur(8px);
}

.glb-drop-zone {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(0, 212, 255, 0.24);
  border-radius: 8px;
  background: rgba(15, 17, 21, 0.86);
}

.glb-drop-message {
  display: block;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glb-drop-zone.drag-over {
  border-color: var(--accent-neon);
  background: rgba(0, 212, 255, 0.12);
}

body.glb-drag-active .glb-drop-zone {
  z-index: 6;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 2px dashed var(--accent-neon);
  background: rgba(15, 17, 21, 0.86);
}

body.glb-drag-active .glb-drop-zone .text-button {
  pointer-events: none;
}

body.glb-drag-active .glb-drop-message {
  display: block;
}

.object-fields,
.file-settings,
.knowledge-settings,
.advanced-settings,
.knowledge-card,
.authoring-decision-card,
.working-object-review,
.parameters-card,
.mep-network-card,
.glb-card,
.glb-transform-card,
.glb-lod-card {
  margin: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #18181e;
}

.object-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.object-identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(74px, 0.34fr) 32px;
  gap: 8px;
  align-items: end;
}

.object-details-extra {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.object-details-extra[hidden] {
  display: none;
}

.icon-button {
  width: 32px;
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  font-weight: 780;
}

.icon-button:hover {
  color: var(--accent-neon);
  border-color: var(--accent-neon);
  background: #282830;
}

.details-toggle[aria-expanded="true"] {
  color: var(--accent-neon);
  transform: rotate(90deg);
}

.knowledge-card {
  padding: 0;
}

.knowledge-card summary {
  cursor: pointer;
  padding: 10px;
}

.knowledge-card summary::marker {
  color: var(--text-secondary);
}

.knowledge-card[open] summary::marker {
  color: var(--accent-neon);
}

.authoring-decision-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-color: rgba(0, 212, 255, 0.34);
}

.authoring-decision-card[hidden] {
  display: none;
}

.working-object-review {
  display: grid;
  gap: 9px;
  padding: 11px;
  border-color: rgba(91, 192, 190, 0.42);
  background: linear-gradient(180deg, rgba(91, 192, 190, 0.08), rgba(24, 24, 30, 0.96));
}

.working-object-review[hidden] {
  display: none;
}

.working-object-review-head,
.working-object-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.working-object-status {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 780;
}

.working-object-revision {
  max-width: 104px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.working-object-summary,
.working-object-warning-list,
.working-object-history {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.working-object-warnings summary,
.working-object-history summary {
  cursor: pointer;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 720;
}

.working-object-warning {
  margin-top: 7px;
  padding: 7px 8px;
  border-left: 2px solid var(--warning);
  border-radius: 4px;
  background: rgba(255, 193, 7, 0.06);
}

.working-object-warning code {
  color: var(--warning);
}

.working-object-comment-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.working-object-comment {
  width: 100%;
  resize: vertical;
}

.working-object-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.working-object-history ol,
.working-object-history-list {
  margin: 7px 0 0;
  padding-left: 20px;
}

.authoring-decision-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.authoring-decision-route {
  padding: 2px 7px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 999px;
  color: var(--accent-neon);
  font-size: 10px;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.authoring-decision-spec {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.authoring-decision-metrics,
.authoring-decision-reason {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.mep-network-card {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.glb-card,
.glb-transform-card,
.glb-lod-card {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.glb-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.glb-card[hidden],
.mep-network-card[hidden],
.glb-transform-card[hidden],
.glb-lod-card[hidden] {
  display: none;
}

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

.glb-transform-grid label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.glb-transform-grid input {
  width: 100%;
  min-height: 32px;
  margin-top: 4px;
  padding: 6px 8px;
}

.glb-card-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.glb-card-name {
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glb-card-stats {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.glb-lod-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.glb-lod-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.model-optimisation {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.model-tool-header {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.model-package-status {
  color: var(--success);
  font-size: 11px;
  font-weight: 780;
}

.model-package-status.over-limit {
  color: var(--danger);
}

.model-tool-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--border-subtle);
}

.model-tool-tab {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text-secondary);
  background: var(--bg-input);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.model-tool-tab:last-child {
  border-right: 0;
}

.model-tool-tab.active {
  color: var(--accent-neon);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--accent-neon);
}

.model-tool-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.model-tool-panel[hidden] {
  display: none;
}

.model-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--border-subtle);
}

.model-metric {
  min-width: 0;
  padding: 7px;
  background: var(--bg-surface);
}

.model-metric span,
.model-metric strong {
  display: block;
  overflow-wrap: anywhere;
}

.model-metric span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 720;
}

.model-metric strong {
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 820;
}

.texture-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.model-inspection-row {
  display: grid;
  gap: 6px;
}

.model-control-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 780;
}

.inspection-segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.inspection-button {
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text-secondary);
  background: var(--bg-input);
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
}

.inspection-button:last-child {
  border-right: 0;
}

.inspection-button.active {
  color: #000;
  background: var(--accent-neon);
}

.model-tool-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.model-action {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  white-space: normal;
  line-height: 1.2;
}

.model-operation-status {
  min-height: 30px;
  padding: 7px 8px;
  border-left: 3px solid var(--accent-neon);
  color: var(--text-secondary);
  background: rgba(0, 212, 255, 0.05);
  font-size: 11px;
  line-height: 1.35;
}

.texture-preview-summary {
  color: var(--text-muted);
  font-size: 10px;
  text-align: right;
}

.texture-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.texture-preview-item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}

.texture-preview-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #101014;
}

.texture-preview-item figcaption {
  overflow: hidden;
  padding: 5px 6px;
  color: var(--text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.texture-preview-unavailable {
  grid-column: 1 / -1;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.texture-controls {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.texture-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 0.55fr);
  gap: 8px;
  align-items: end;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-input);
}

.segmented-control label {
  display: grid;
  place-items: center;
  height: 32px;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.segmented-control label:last-child {
  border-right: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control label:has(input:checked) {
  color: #000;
  background: var(--accent-neon);
}

.texture-format-label,
.texture-quality-label,
.texture-preserve-label {
  font-size: 11px;
  font-weight: 760;
}

.texture-format-label select {
  min-height: 32px;
  margin-top: 4px;
  padding: 5px 8px;
}

.texture-quality-label {
  gap: 4px;
}

.texture-quality-label span {
  display: flex;
  justify-content: space-between;
}

.texture-quality-label input {
  padding: 0;
}

.texture-preserve-label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.texture-preserve-label input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent-neon);
}

.texture-report {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(0, 212, 255, 0.24);
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.06);
}

.texture-report[hidden] {
  display: none;
}

.texture-report-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 820;
}

.texture-report-meta {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-line;
}

.texture-report-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.glb-lod-list {
  display: grid;
  gap: 7px;
}

.glb-lod-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}

.glb-lod-row.active {
  border-color: rgba(0, 212, 255, 0.42);
  background: rgba(0, 212, 255, 0.07);
}

.glb-lod-row.registry {
  box-shadow: inset 3px 0 0 var(--success);
}

.glb-lod-preview-choice {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.glb-lod-preview-choice:hover .glb-lod-title,
.glb-lod-preview-choice:focus-visible .glb-lod-title {
  color: var(--accent-neon);
}

.glb-lod-preview-choice:focus-visible {
  outline: 2px solid var(--accent-neon);
  outline-offset: 4px;
}

.glb-lod-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.glb-lod-meta {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.glb-lod-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.glb-lod-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(82, 196, 26, 0.28);
  border-radius: 999px;
  color: var(--success);
  background: rgba(82, 196, 26, 0.08);
  font-size: 11px;
  font-weight: 760;
}

.glb-lod-badge.pending {
  border-color: rgba(250, 173, 20, 0.32);
  color: var(--warning);
  background: rgba(250, 173, 20, 0.08);
}

.parameters-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.preview-parameters-card {
  min-width: 0;
  min-height: 0;
  width: auto;
  max-height: 100%;
  overflow: auto;
  border: 1px solid rgba(0, 212, 255, 0.34);
  border-radius: 8px;
  background: var(--bg-surface);
}

.parameters-card[hidden] {
  display: none;
}

.knowledge-card-title,
.parameters-card-title {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.knowledge-summary {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.4;
  padding: 0 10px 10px;
}

.parameter-group {
  display: grid;
  gap: 8px;
}

.parameter-group + .parameter-group {
  margin-top: 6px;
}

.parameter-group-title {
  color: var(--accent-neon);
  font-size: 12px;
  font-weight: 760;
}

.parameter-section {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-surface);
}

.parameter-section summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--accent-neon);
  font-size: 12px;
  font-weight: 760;
}

.parameter-section-body {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
  background: #18181e;
}

.parameter-field {
  display: grid;
  gap: 5px;
}

.parameter-field label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.parameter-field input,
.parameter-field select {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.parameter-color-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.parameter-color-row input[type="color"] {
  height: 30px;
  min-height: 30px;
  padding: 2px;
}

.object-fields summary,
.file-settings summary,
.knowledge-settings summary,
.advanced-settings summary {
  cursor: pointer;
  padding: 9px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.object-fields .form-grid,
.file-settings .path-row,
.knowledge-settings .settings-row,
.knowledge-settings .split-lists,
.advanced-settings .form-grid {
  padding: 0 10px 10px;
}

.object-file-list {
  padding: 0 10px 10px;
}

.object-file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.object-file-summary strong {
  color: var(--text-primary);
}

.object-file-table {
  display: grid;
  gap: 6px;
}

.object-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #121318;
}

.object-file-path {
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.object-file-kind,
.object-file-empty {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.object-file-size {
  color: var(--accent-neon);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.source-spec-card {
  margin: 0 10px 10px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #101217;
}

.source-spec-header,
.source-spec-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-spec-header {
  justify-content: space-between;
}

.source-spec-header strong {
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 12px;
}

.source-spec-summary,
.source-spec-review {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.source-spec-review {
  margin-top: 8px;
}

.source-spec-preview {
  max-height: 360px;
  margin: 10px 0 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: #090b0f;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre;
}

.full {
  grid-column: 1 / -1;
}

.switch-row {
  display: flex;
  gap: 18px;
  margin: 0;
  flex-wrap: wrap;
}

.object-pane .switch-row {
  display: grid;
  gap: 8px;
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.switch-row input {
  width: auto;
  accent-color: var(--accent-neon);
}

.issue-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.pill {
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.pill.error {
  color: var(--danger);
  background: rgba(255, 77, 79, 0.08);
  border-color: rgba(255, 77, 79, 0.28);
}

.pill.warning {
  color: var(--warning);
  background: rgba(250, 173, 20, 0.08);
  border-color: rgba(250, 173, 20, 0.28);
}

.pill.ok {
  color: var(--success);
  background: rgba(82, 196, 26, 0.08);
  border-color: rgba(82, 196, 26, 0.24);
}

.issues {
  display: grid;
  gap: 8px;
}

.issue {
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--bg-surface);
  cursor: pointer;
}

.issue.error {
  border-left-color: var(--danger);
}

.issue.warning {
  border-left-color: var(--warning);
}

.issue.suggestion {
  border-left-color: var(--accent-neon);
}

.issue-title {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 820;
}

.hidden-control {
  display: none !important;
}

.assistant-reply,
.draft-output {
  min-height: 180px;
  max-height: 300px;
  overflow: auto;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #0f1115;
  color: #dce6e8;
  white-space: pre-wrap;
  font: 12px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.conversation-pane {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: 10px minmax(96px, 1fr) minmax(0, auto) auto;
  gap: 10px;
  padding: 12px;
  background: var(--bg-input);
  overflow: hidden;
}

.conversation-resize-handle {
  align-self: start;
  height: 10px;
  margin: -8px 0 -4px;
  cursor: ns-resize;
  border-radius: 999px;
  background: linear-gradient(to right, transparent, rgba(0, 212, 255, 0.55), transparent);
  opacity: 0.55;
  touch-action: none;
}

.conversation-resize-handle:hover,
.conversation-resize-handle.dragging {
  opacity: 1;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 96px;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.chat-message {
  max-width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 8px;
  background: #18181e;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-message.answer {
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 8px 10px;
  border-color: rgba(0, 212, 255, 0.28);
  background: #15171d;
}

.chat-message.progress {
  border-color: rgba(255, 255, 255, 0.08);
  background: #15161b;
  color: var(--text-secondary);
}

.chat-message.user {
  align-self: flex-start;
  border-color: rgba(0, 212, 255, 0.45);
  background: rgba(0, 107, 140, 0.22);
  color: #c7f4ff;
}

.chat-message.mob {
  align-self: flex-start;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.chat-input-row textarea {
  height: 92px;
  min-height: 92px;
  resize: none;
  border-color: var(--accent-neon);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-neon) 55%, transparent);
}

.chat-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 6px;
  align-self: end;
  width: min(330px, 28vw);
  min-width: 290px;
  height: 92px;
}

.chat-actions .button {
  height: auto;
  min-height: 0;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  line-height: 1.1;
  white-space: nowrap;
}

.clarification-panel {
  display: grid;
  gap: 10px;
  max-height: min(220px, 32vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 8px;
  background: #171920;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.clarification-panel[hidden] {
  display: none;
}

.clarification-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.clarification-kicker {
  color: var(--accent-neon);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.clarification-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
}

.clarification-summary,
.clarification-questions {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.clarification-questions {
  display: grid;
  gap: 6px;
}

.clarification-question {
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #14161c;
  color: var(--text-primary);
}

.clarification-contract-status {
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.clarification-contract-status[data-state='ready'] {
  border-color: rgba(69, 214, 151, 0.45);
  color: #8de7bd;
}

.clarification-contract-status[data-state='blocked'] {
  border-color: rgba(255, 114, 114, 0.5);
  color: #ffaaaa;
}

.clarification-exact-target {
  color: var(--text-secondary);
  font-size: 12px;
}

.clarification-exact-target pre {
  margin: 8px 0 0;
  padding: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #111319;
  color: var(--text-primary);
  white-space: pre-wrap;
}

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

.clarification-grid label {
  display: grid;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.clarification-grid input,
.clarification-grid select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 0 9px;
}

.clarification-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.assistant-response {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
}

.field-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.assistant-response .assistant-reply {
  min-height: 104px;
  max-height: 126px;
  margin: 0;
}

.split-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.object-pane .path-row,
.object-pane .form-grid,
.object-pane .settings-row,
.object-pane .split-lists {
  grid-template-columns: 1fr;
}

.context-list,
.graphics-list {
  display: grid;
  gap: 8px;
}

.context-item {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-surface);
}

.context-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 820;
}

.context-path {
  margin: 3px 0;
  color: var(--text-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.context-preview {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.graphic {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px;
  background: var(--bg-surface);
}

.graphic img {
  width: 76px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: #101016;
}

.graphic-name {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.view-actions,
.viewport-config {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.viewport-config {
  grid-template-columns: 1fr auto auto;
  align-items: end;
}

.viewer-frame {
  grid-area: 1 / 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #0f1115;
}

.button:disabled,
.text-button:disabled,
.icon-button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.registry-variant-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 212, 255, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.055), rgba(24, 24, 30, 0.96));
  white-space: normal;
}

.registry-variant-card[hidden] {
  display: none;
}

.registry-variant-heading,
.registry-base-actions,
.registry-catalogue-meta,
.registry-selection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.registry-base-identity,
.registry-selection-identity {
  margin-top: 3px;
  color: var(--accent-neon);
  font: 700 12px/1.35 "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

.registry-source-admission,
.registry-variant-action-status,
.registry-variant-provenance,
.registry-gate-blockers {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.registry-source-admission[data-state="passed"] {
  color: #9ee67c;
}

.registry-source-admission[data-state="blocked"],
.registry-gate-blockers strong {
  color: #ffb0b1;
}

.registry-receipt-details,
.registry-gate {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(15, 17, 21, 0.72);
}

.registry-receipt-details summary {
  cursor: pointer;
  padding: 9px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 760;
}

.registry-receipt-summary {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
  padding: 0 10px 10px;
  font-size: 11px;
}

.registry-receipt-summary dt {
  color: var(--text-muted);
}

.registry-receipt-summary dd {
  min-width: 0;
  margin: 0;
  color: var(--text-secondary);
  font-family: "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

.registry-receipt-files {
  display: grid;
  gap: 6px;
  max-height: 190px;
  padding: 0 10px 10px;
  overflow: auto;
}

.registry-receipt-file {
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 10px;
}

.registry-receipt-file code,
.registry-receipt-path {
  overflow-wrap: anywhere;
}

.registry-receipt-path {
  color: var(--text-primary);
  font: 700 11px/1.35 "SFMono-Regular", Consolas, monospace;
}

.registry-receipt-empty {
  color: var(--text-muted);
  font-size: 11px;
}

.registry-target-section {
  display: grid;
  gap: 9px;
}

.registry-target-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 780;
}

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

.registry-target-specification textarea {
  min-height: 96px;
  font: 11px/1.45 "SFMono-Regular", Consolas, monospace;
}

.registry-change-contract {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.registry-change-contract legend {
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 740;
}

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

.registry-change-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 10px;
}

.registry-change-grid input {
  width: auto;
  flex: 0 0 auto;
}

.registry-gate {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.registry-gate-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.registry-gate-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  padding: 6px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-input);
  font-size: 10px;
}

.registry-gate-item strong,
.registry-gate-item small {
  display: block;
}

.registry-gate-item small {
  margin-top: 2px;
  color: var(--text-muted);
  line-height: 1.35;
}

.registry-gate-indicator {
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.registry-gate-item.passed .registry-gate-indicator {
  background: var(--success);
}

.registry-gate-item.blocked .registry-gate-indicator {
  background: var(--danger);
}

.registry-gate-item.stale .registry-gate-indicator {
  background: var(--warning);
}

.registry-gate-state {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.registry-gate-passed {
  color: #9ee67c;
}

.registry-objects-dialog {
  width: min(720px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: -24px 0 58px rgba(0, 0, 0, 0.46);
}

.registry-objects-dialog::backdrop {
  background: rgba(4, 5, 7, 0.7);
  backdrop-filter: blur(2px);
}

.registry-drawer-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow: hidden;
}

.registry-drawer-shell > :not(.registry-object-list) {
  flex: 0 0 auto;
}

#registryCataloguePaging {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#registryCataloguePaging[hidden] {
  display: none;
}

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

.registry-drawer-header h2 {
  margin-top: 3px;
  color: var(--accent-neon);
  font-size: 22px;
}

.registry-dialog-close {
  font-size: 20px;
}

.registry-catalogue-locked {
  padding: 10px;
  border: 1px solid rgba(250, 173, 20, 0.45);
  border-radius: 8px;
  background: rgba(250, 173, 20, 0.08);
  color: #ffd782;
  font-size: 12px;
  line-height: 1.4;
}

.registry-catalogue-locked[hidden],
.registry-first-actions[hidden],
.registry-selection-card[hidden] {
  display: none;
}

.registry-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(120px, 1fr) minmax(105px, 0.7fr) minmax(120px, 0.85fr) auto;
  gap: 8px;
  align-items: end;
}

.registry-search-form input,
.registry-search-form select {
  min-height: 34px;
}

.registry-catalogue-meta {
  color: var(--text-secondary);
  font-size: 11px;
}

.registry-object-list {
  min-height: 0;
  flex: 1 1 180px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-base);
}

.registry-object-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

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

.registry-object-row:hover,
.registry-object-row.selected {
  background: rgba(0, 212, 255, 0.07);
}

.registry-object-row.selected {
  box-shadow: inset 3px 0 var(--accent-neon);
}

.registry-object-main,
.registry-object-badges {
  display: flex;
  gap: 6px;
}

.registry-object-main {
  min-width: 0;
  flex-direction: column;
}

.registry-object-main strong {
  color: var(--accent-neon);
  font: 700 12px/1.35 "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

.registry-object-main span {
  color: var(--text-secondary);
  font-size: 11px;
}

.registry-object-badges {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.registry-object-status,
.registry-admission-badge {
  padding: 3px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 780;
  white-space: nowrap;
}

.registry-admission-badge.passed {
  border-color: rgba(82, 196, 26, 0.48);
  color: #9ee67c;
}

.registry-admission-badge.blocked {
  border-color: rgba(255, 77, 79, 0.44);
  color: #ffb0b1;
}

.registry-object-empty {
  display: grid;
  min-height: 178px;
  place-items: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.registry-first-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(250, 173, 20, 0.4);
  border-radius: 8px;
  background: rgba(250, 173, 20, 0.07);
}

.registry-first-actions p {
  margin: 0;
  color: #ffd782;
  font-size: 11px;
  line-height: 1.4;
}

.registry-first-actions > div {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.registry-selection-card {
  padding: 12px;
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.055);
}

.registry-selection-card > div {
  min-width: 0;
}

.registry-selection-name {
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 740;
}

.glb-drop-zone.registry-locked {
  border-color: var(--border-subtle);
  opacity: 0.62;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
    grid-template-rows: minmax(340px, 1fr) minmax(320px, 1fr) var(--conversation-height, 280px);
    overflow: auto;
  }

  .object-pane {
    grid-column: 1;
    grid-row: 1 / -1;
  }

  .code-pane,
  .preview-pane {
    grid-column: 2;
  }

  .code-pane {
    grid-row: 1;
  }

  .preview-pane {
    grid-row: 2;
  }

  .conversation-pane {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .path-row,
  .settings-row,
  .viewport-config,
  .split-lists,
  .registry-search-form {
    grid-template-columns: 1fr;
  }

  .registry-search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .registry-search-query,
  .registry-search-form .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell:has(#hostedSignIn:not([hidden]), #hostedJobs:not([hidden])) {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  #hostedSignIn,
  #hostedJobs {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    justify-self: center;
    margin: 4px 12px;
  }

  #hostedJobs {
    max-height: 35vh;
  }

  .topbar {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-items: stretch;
  }

  .topbar-metrics {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .brand,
  .toolbar {
    grid-column: 1;
    grid-row: auto;
  }

  h1 {
    font-size: 26px;
  }

  .workspace {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, auto) minmax(360px, auto) minmax(360px, auto) minmax(var(--conversation-height, 260px), auto);
  }

  .object-pane,
  .code-pane,
  .preview-pane,
  .conversation-pane {
    grid-column: 1;
    grid-row: auto;
  }

  .preview-pane.has-parameters .preview-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(260px, 1fr) minmax(180px, 0.7fr);
  }

  .chat-input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-actions {
    min-width: 0;
    width: 100%;
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-actions .button {
    height: 30px;
  }

  .clarification-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar .button {
    flex: 1 1 90px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .registry-objects-dialog {
    width: 100vw;
  }

  .registry-drawer-shell {
    padding: 12px;
  }

  .registry-search-form,
  .registry-target-grid,
  .registry-change-grid {
    grid-template-columns: 1fr;
  }

  .registry-object-row,
  .registry-first-actions,
  .registry-selection-card {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .registry-object-badges {
    justify-content: flex-start;
  }
}
