:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e5e7eb;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.app-shell--scene-editor {
  transition: grid-template-columns 180ms ease;
}

.app-shell--scene-editor.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  min-width: 0;
  overflow-y: auto;
  background: #111827;
  color: #f8fafc;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.muted,
.hint {
  color: #64748b;
}

.sidebar .muted {
  color: #94a3b8;
}

.sidebar-brand {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.sidebar-logo {
  display: block;
  width: 100%;
  max-width: 230px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center bottom;
  background: #000;
}

.sidebar-brand .muted {
  font-size: 13px;
}

.sidebar .panel {
  color: #111827;
}

.section-tabs {
  display: grid;
  gap: 8px;
}

.section-tabs button,
.section-tabs a {
  display: block;
  width: 100%;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px 14px;
  background: #1f2937;
  color: #f8fafc;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.section-tabs button.active,
.section-tabs a.active {
  border-color: #38bdf8;
  background: #0f766e;
}

.surface-list,
.scene-list,
.zone-list,
.directory-list {
  display: grid;
  gap: 10px;
}

.new-scene-form,
.task-step-editor,
.task-trigger-editor {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.agent-form,
.agent-command-form {
  display: grid;
  gap: 12px;
}

.surface-list button,
.scene-list button,
.scene-card a,
.ghost-button,
.primary-button,
.toolbar-actions button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.surface-list button {
  background: #1f2937;
  color: #f8fafc;
  border-color: #374151;
}

.surface-status {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  padding: 4px 8px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.surface-status i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.surface-status--online {
  color: #16a34a;
  background: #dcfce7;
}

.surface-list .surface-status--online {
  color: #86efac;
  background: rgba(22, 163, 74, 0.16);
}

.surface-status--warning {
  color: #ca8a04;
  background: #fef9c3;
}

.surface-list .surface-status--warning {
  color: #fde68a;
  background: rgba(202, 138, 4, 0.18);
}

.surface-status--error {
  color: #dc2626;
  background: #fee2e2;
}

.surface-list .surface-status--error {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.18);
}

.surface-status--offline {
  color: #64748b;
  background: #f1f5f9;
}

.preflight-badge--ready,
.preflight-score--ready {
  color: #166534;
  background: #dcfce7;
}

.preflight-badge--warning,
.preflight-score--warning {
  color: #854d0e;
  background: #fef3c7;
}

.preflight-badge--critical,
.preflight-score--critical {
  color: #991b1b;
  background: #fee2e2;
}

.surface-list .surface-status--offline {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
}

.surface-list button.active {
  border-color: #38bdf8;
  background: #0f766e;
}

.scene-list button.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.scene-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: stretch;
}

.scene-card > button:first-child {
  width: 100%;
}

.scene-card.active > button:first-child {
  border-color: #2563eb;
  background: #eff6ff;
}

.scene-card a {
  display: grid;
  place-items: center;
  min-width: 64px;
  text-decoration: none;
}

.scene-duplicate-button,
.scene-remove-button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.scene-remove-button {
  border-color: #fecaca;
  color: #991b1b;
}

.media-library-list {
  display: grid;
  gap: 10px;
}

.media-library-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.media-library-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 64px;
  overflow: hidden;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
  font-size: 14px;
}

.media-library-preview img,
.media-library-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-library-details {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.media-library-details strong,
.media-library-details span,
.media-library-details code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-library-details span {
  color: #64748b;
  font-size: 13px;
}

.media-library-details code {
  color: #475569;
  font-size: 12px;
}

.media-library-details small {
  color: #64748b;
  font-size: 12px;
}

.encoding-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.encoding-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 180ms ease;
}

.media-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.media-card-actions button,
.media-replace-button,
#identifyAgentMachine {
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  cursor: pointer;
}

.media-replace-button input {
  display: none;
}

.media-usage {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
}

.media-usage strong {
  font-size: 12px;
  color: #334155;
}

.media-usage ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.media-usage li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.media-usage li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-usage small,
.media-usage--unused span {
  color: #64748b;
  font-size: 12px;
}

.media-preview-dialog {
  width: min(1100px, calc(100vw - 48px));
  max-width: none;
  height: min(760px, calc(100vh - 48px));
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
}

.media-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

.media-preview-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.media-preview-shell header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.media-preview-shell header button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.media-preview-body {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #0f172a;
}

.media-preview-body img,
.media-preview-body video,
.media-preview-body iframe {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.surface-list span,
.scene-list span {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 28px 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.ghost-button {
  text-decoration: none;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1fr) minmax(300px, 1fr) minmax(320px, 1.1fr) minmax(520px, 1.7fr);
  gap: 16px;
  align-items: start;
}

.editor-grid > * {
  min-width: 0;
}

.editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
  gap: 16px;
  align-items: start;
}

.editor-workspace--surfaces {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
}

.editor-sections {
  min-width: 0;
}

.editor-section {
  display: none;
}

.editor-section.active {
  display: block;
}

.section-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.section-grid--surfaces {
  grid-template-columns: minmax(260px, 360px) minmax(320px, 1fr);
  align-items: start;
}

.section-grid--surfaces .adopt-panel,
.section-grid--surfaces .agent-panel {
  grid-column: 1 / -1;
}

.section-grid--scenes,
.section-grid--zones,
.section-grid--tasks,
.section-grid--media,
.section-grid--preflight,
.section-grid--server {
  grid-template-columns: minmax(320px, 680px);
}

.section-grid--preflight {
  grid-template-columns: minmax(340px, 1fr);
}

.section-grid--server {
  grid-template-columns: minmax(280px, 420px) minmax(360px, 680px);
}

.section-grid--zones {
  grid-template-columns: minmax(280px, 420px) minmax(360px, 680px);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.preflight-panel {
  align-content: start;
}

.preflight-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

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

.preflight-actions button,
.preflight-issue button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.preflight-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.preflight-summary article,
.preflight-zone,
.preflight-issue {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.preflight-summary article {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.preflight-summary article strong {
  font-size: 24px;
  line-height: 1.05;
}

.preflight-summary article span {
  color: #64748b;
  font-size: 13px;
}

.preflight-summary .preflight-score {
  grid-column: 1 / -1;
  border-color: currentColor;
}

.preflight-summary .preflight-score strong {
  font-size: 18px;
}

.preflight-zone-list,
.preflight-issue-list {
  display: grid;
  gap: 10px;
}

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

.preflight-issue {
  grid-template-columns: auto minmax(0, 1fr);
}

.preflight-zone--ready {
  border-color: #bbf7d0;
}

.preflight-zone--warning {
  border-color: #fde68a;
}

.preflight-zone--critical {
  border-color: #fecaca;
}

.preflight-zone strong,
.preflight-issue strong {
  display: block;
  overflow-wrap: anywhere;
}

.preflight-zone span,
.preflight-issue span {
  color: #64748b;
  font-size: 13px;
}

.preflight-badge {
  display: inline-grid;
  place-items: center;
  min-width: 74px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.panel label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #475569;
}

.panel input,
.panel select,
.panel textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  color: #111827;
  background: #fff;
  resize: vertical;
}

.primary-button {
  width: 100%;
  text-align: center;
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.add-asset-menu {
  position: relative;
}

.add-asset-menu summary {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  list-style: none;
}

.add-asset-menu summary::-webkit-details-marker {
  display: none;
}

.add-asset-menu[open] summary {
  border-color: #2563eb;
}

.add-asset-menu > div {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  min-width: 280px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.add-asset-menu button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #111827;
  cursor: pointer;
}

.primary-button:disabled,
.toolbar-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.canvas-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.preview-column {
  position: sticky;
  top: 0;
  align-self: start;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

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

.toolbar-actions button {
  padding: 10px 12px;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px 6px 12px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.zoom-control select {
  width: auto;
  min-width: 88px;
  border: 0;
  padding: 4px;
  background: transparent;
  color: #111827;
  font-weight: 700;
}

.upload-button {
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.toolbar-actions .ghost-button {
  display: grid;
  place-items: center;
  padding: 10px 12px;
}

.toolbar-actions button:last-child {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.preview-panel {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #020617;
  min-height: 280px;
  aspect-ratio: 16 / 9;
}

.preview-stage {
  position: relative;
  width: 1920px;
  height: 1080px;
  transform: scale(0.37);
  transform-origin: top left;
}

.scene-item {
  position: absolute;
}

.editable-stage > .scene-item {
  cursor: pointer;
  outline: 3px solid transparent;
  outline-offset: 4px;
}

.editable-stage > .scene-item:hover {
  outline-color: rgba(14, 165, 233, 0.7);
}

.editable-stage > .scene-item.selected {
  outline-color: #f59e0b;
}

.resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.28);
  z-index: 10;
}

.resize-nw {
  top: -8px;
  left: -8px;
  cursor: nwse-resize;
}

.resize-ne {
  top: -8px;
  right: -8px;
  cursor: nesw-resize;
}

.resize-sw {
  bottom: -8px;
  left: -8px;
  cursor: nesw-resize;
}

.resize-se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.alignment-guide {
  position: absolute;
  z-index: 999;
  pointer-events: none;
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.alignment-guide--vertical {
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
}

.alignment-guide--horizontal {
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-1px);
}

.scene-text,
.scene-clock {
  line-height: 1.08;
  user-select: none;
}

.editable-stage > .scene-text.editing-text {
  cursor: text;
  outline-color: #22c55e;
  user-select: text;
  caret-color: currentColor;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}

.scene-box {
  border-radius: 8px;
}

.scene-webpage iframe {
  grid-area: 1 / 1;
  display: block;
}

.scene-pdf iframe {
  grid-area: 1 / 1;
  display: block;
}

.pdf-controls {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: center;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  margin: 12px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.94);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  color: #111827;
  font-size: 14px;
  pointer-events: auto;
}

.pdf-controls button {
  min-width: 76px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.pdf-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.pdf-controls input {
  width: 72px;
  padding: 7px 8px;
}

.webpage-notice {
  grid-area: 1 / 1;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f8fafc;
  color: #334155;
  text-align: center;
  font-size: 24px;
}

.inspector-panel {
  position: sticky;
  top: 16px;
}

.item-form {
  display: grid;
  gap: 12px;
}

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


.text-style-section {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.checkbox-label {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
}

.checkbox-label input {
  width: auto;
}

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

.layers-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.media-pool-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

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

.layers-heading span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 13px;
}

.layer-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.layer-actions button {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
}

.layer-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.layers-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 470px);
  overflow: auto;
  padding-right: 2px;
}

.layers-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.media-pool-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.media-pool-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.media-pool-list button.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.media-pool-list span {
  color: #64748b;
  font-size: 12px;
}

.media-pool-section > button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.playlist-list {
  display: grid;
  gap: 10px;
}

.playlist-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.playlist-row__header {
  display: grid;
  gap: 2px;
}

.playlist-row__header span {
  color: #64748b;
  font-size: 12px;
}

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

.playlist-row__actions button,
#playlistAddMedia {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
}

.playlist-row__actions button:disabled,
#playlistAddMedia:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.layers-list button.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.layers-list span {
  color: #64748b;
  font-size: 12px;
}

.danger-button {
  width: 100%;
  border: 1px solid #dc2626;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  cursor: pointer;
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.server-panel {
  align-content: start;
}

.server-status,
.server-command {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.publish-control {
  display: grid;
  gap: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.publish-control h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.publish-control .hint {
  margin: 0;
}

.server-status dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.server-status div {
  display: grid;
  gap: 2px;
}

.server-status dt,
.server-command span {
  color: #64748b;
  font-size: 12px;
}

.server-status dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.server-command {
  display: grid;
  gap: 6px;
}

.server-command code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.task-step-list,
.task-trigger-list,
.zone-list,
.zone-linked-list,
.showfile-list {
  display: grid;
  gap: 8px;
}

.task-step,
.zone-row,
.zone-linked-row,
.showfile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.task-step strong,
.task-step span,
.zone-row strong,
.zone-row span,
.zone-linked-row strong,
.zone-linked-row span,
.showfile-row strong,
.showfile-row span {
  display: block;
}

.task-step span,
.zone-row span,
.zone-linked-row span,
.showfile-row span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.task-step button,
.zone-row button,
.zone-linked-row button,
.zone-linked-row a,
.showfile-row button,
.task-step-editor button,
.task-trigger-editor button,
#createShowVersion,
#createShowPackage {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.zone-linked-row a {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.zone-row button {
  border-color: #fecaca;
  color: #991b1b;
}

.zone-linked-section {
  display: grid;
  gap: 10px;
}

.showfile-form {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.agent-status {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.agent-warning {
  margin: 10px 0 0;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px;
  background: #fffbeb;
  color: #854d0e;
  font-size: 13px;
}

.surface-health {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.surface-health h3 {
  margin: 0;
  color: #111827;
  font-size: 16px;
}

.agent-status dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.agent-status div {
  display: grid;
  gap: 2px;
}

.agent-status dt {
  color: #64748b;
  font-size: 12px;
}

.agent-status dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.agent-command-log {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.agent-command-log h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
}

.agent-command-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.agent-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: start;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.agent-command strong,
.agent-command span,
.agent-command p {
  overflow-wrap: anywhere;
}

.agent-command span,
.agent-command p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
}

.agent-command p {
  grid-column: 1 / -1;
}

.agent-command-status {
  border-radius: 999px;
  padding: 3px 7px;
  background: #e2e8f0;
  color: #334155 !important;
  font-weight: 700;
  text-transform: capitalize;
}

.agent-command--completed .agent-command-status {
  background: #dcfce7;
  color: #166534 !important;
}

.agent-command--failed .agent-command-status {
  background: #fee2e2;
  color: #991b1b !important;
}

.agent-command--queued .agent-command-status,
.agent-command--sent .agent-command-status {
  background: #dbeafe;
  color: #1d4ed8 !important;
}

.hint code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.scene-editor-shell {
  height: 100vh;
  overflow: hidden;
  padding: 24px;
  min-width: 0;
}

.app-shell--scene-editor .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  transition:
    padding 180ms ease,
    opacity 180ms ease,
    visibility 180ms ease;
}

.app-shell--scene-editor.sidebar-collapsed .sidebar {
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scene-editor-topbar {
  margin-bottom: 16px;
}

#toggleSidebar[aria-pressed="true"] {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: #2563eb;
  text-decoration: none;
}

.scene-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(280px, 320px);
  gap: 16px;
  align-items: start;
  height: calc(100vh - 112px);
  min-height: 0;
}

.scene-properties,
.scene-editor-grid .inspector-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rollup-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.rollup-section + .rollup-section {
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.rollup-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 4px 0;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.rollup-section summary::-webkit-details-marker {
  display: none;
}

.rollup-section summary::after {
  content: "Show";
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 9px;
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.rollup-section[open] summary::after {
  content: "Hide";
}

.rollup-section summary span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.scene-workspace {
  min-width: 0;
  min-height: 0;
}

.canvas-scroll {
  display: flex;
  place-items: center;
  align-items: center;
  justify-content: center;
  overflow: auto;
  height: calc(100vh - 112px);
  min-height: 0;
  max-height: calc(100vh - 112px);
  border: 1px solid #111827;
  border-radius: 8px;
  background: #000;
  padding: 16px;
}

.canvas-scroll.manual-zoom {
  align-items: flex-start;
  justify-content: flex-start;
}

.stage-fit {
  position: relative;
  flex: 0 0 auto;
  overflow: visible;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 18px 44px rgba(0, 0, 0, 0.55);
}

.editable-stage {
  background: #fff;
}

.directory {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px;
}

.directory-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  margin-top: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.directory-card a {
  color: #2563eb;
}

.directory-card code,
.hint code {
  display: block;
  overflow: auto;
  padding: 10px;
  border-radius: 6px;
  background: #f1f5f9;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell,
  .editor-grid,
  .editor-workspace,
  .section-grid,
  .scene-editor-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .workspace,
  .sidebar,
  .scene-editor-shell {
    height: auto;
    overflow: visible;
  }

  .preview-column {
    position: static;
  }

  .preview-stage {
    transform: scale(0.28);
  }
}

.media-import-status {
  min-height: 20px;
  margin: 0;
}
