:root {
  --workspace-mode-switch-reserve: 246px;
}

/* World Agent: short-drama production studio */
.world-agent-studio {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  overflow: hidden;
  background: #f4f4f5;
  color: #18181b;
}

.world-agent-studio button {
  letter-spacing: 0;
}

.world-agent-studio-topbar {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 68px;
  padding: 0 22px;
  border-bottom: 1px solid #e4e4e7;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.world-agent-studio-project,
.world-agent-studio-actions,
.world-agent-studio-heading-actions,
.world-agent-episode-editor-header {
  display: flex;
  align-items: center;
}

.world-agent-studio-project {
  min-width: 0;
  gap: 11px;
}

.world-agent-studio-project > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.world-agent-studio-project strong,
.world-agent-studio-project span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-studio-project strong {
  color: #18181b;
  font-size: 13px;
  font-weight: 760;
}

.world-agent-studio-project span {
  color: #a1a1aa;
  font-size: 10px;
}

.world-agent-studio-icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #e4e4e7;
  border-radius: 50%;
  background: #ffffff;
  color: #3f3f46;
  cursor: pointer;
}

.world-agent-studio-icon-button:hover,
.world-agent-studio-icon-button:focus-visible {
  border-color: #a1a1aa;
  color: #09090b;
  outline: none;
}

.world-agent-studio-icon-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.world-agent-studio-icon-button.is-danger:not(:disabled):hover,
.world-agent-studio-icon-button.is-danger:not(:disabled):focus-visible {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #dc2626;
}

.world-agent-studio-icon-button .material-symbols-outlined {
  font-size: 18px;
}

.world-agent-studio-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.world-agent-studio-steps button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid #eeeeef;
  border-radius: 20px;
  background: #fafafa;
  color: #52525b;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.world-agent-studio-steps button:hover,
.world-agent-studio-steps button:focus-visible {
  border-color: #d4d4d8;
  color: #18181b;
  outline: none;
}

.world-agent-studio-steps button.is-active {
  border-color: #09090b;
  background: #09090b;
  color: #ffffff;
}

.world-agent-studio-steps button > span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 9px;
}

.world-agent-studio-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 7px;
}

.world-agent-studio-status {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-right: 5px;
  color: #71717a;
  font-size: 10px;
  white-space: nowrap;
}

.world-agent-studio-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px #dcfce7;
}

.world-agent-studio-status.is-running i {
  background: #8b5cf6;
  box-shadow: 0 0 0 3px #ede9fe;
  animation: world-agent-studio-pulse 1.2s ease-in-out infinite;
}

@keyframes world-agent-studio-pulse {
  50% { opacity: 0.35; }
}

.world-agent-studio-main,
.world-agent-studio-view {
  min-width: 0;
  min-height: 0;
}

.world-agent-studio-main {
  position: relative;
  overflow: hidden;
}

.world-agent-studio-view {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: #f4f4f5;
}

.world-agent-studio-view[hidden] {
  display: none !important;
}

.world-agent-studio-page {
  width: min(100%, 1360px);
  min-height: 0;
  margin: 0 auto;
  padding: 44px clamp(28px, 5vw, 76px) 82px;
  overflow: auto;
}

.world-agent-studio-page.is-wide {
  width: min(100%, 1540px);
}

.world-agent-studio-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.world-agent-studio-heading > div:first-child {
  min-width: 0;
}

.world-agent-studio-heading > div:first-child > span,
.world-agent-episode-editor-header > div > span {
  display: block;
  margin-bottom: 5px;
  color: #a1a1aa;
  font-size: 10px;
  font-weight: 650;
}

.world-agent-studio-heading h1 {
  margin: 0;
  color: #09090b;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 780;
}

.world-agent-studio-heading p {
  max-width: 720px;
  margin: 7px 0 0;
  color: #71717a;
  font-size: 11px;
  line-height: 1.7;
}

.world-agent-studio-heading-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.world-agent-studio-primary-button,
.world-agent-studio-secondary-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.world-agent-studio-primary-button {
  border-color: #09090b;
  background: #09090b;
  color: #ffffff;
}

.world-agent-studio-primary-button:hover,
.world-agent-studio-primary-button:focus-visible {
  border-color: #27272a;
  background: #27272a;
  outline: none;
}

.world-agent-studio-secondary-button {
  border-color: #e4e4e7;
  background: #ffffff;
  color: #3f3f46;
}

.world-agent-studio-secondary-button:hover,
.world-agent-studio-secondary-button:focus-visible {
  border-color: #a1a1aa;
  color: #09090b;
  outline: none;
}

.world-agent-studio-primary-button .material-symbols-outlined,
.world-agent-studio-secondary-button .material-symbols-outlined {
  font-size: 17px;
}

.world-agent-script-source {
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
}

.world-agent-script-source-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid #eeeeef;
  background: #f4f4f5;
}

.world-agent-script-source-tabs button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  background: transparent;
  color: #71717a;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.world-agent-script-source-tabs button:hover,
.world-agent-script-source-tabs button:focus-visible,
.world-agent-script-source-tabs button.is-active {
  background: #ffffff;
  color: #18181b;
  outline: none;
}

.world-agent-script-source-tabs .material-symbols-outlined {
  font-size: 17px;
}

.world-agent-studio .world-agent-conversation-host {
  width: 100%;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-panel {
  position: relative;
  inset: auto;
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 0;
  flex-direction: column;
  pointer-events: auto;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-compose {
  position: relative;
  order: 1;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-compose-heading {
  display: none;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-theme-field {
  margin: 0;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-theme-field textarea {
  width: 100%;
  min-height: 230px;
  max-height: 460px;
  padding: 24px 26px 14px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #27272a;
  font-size: 13px;
  line-height: 1.85;
  box-shadow: none;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-theme-field textarea:focus {
  border: 0;
  outline: none;
  box-shadow: inset 0 0 0 2px #d4d4d8;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-compose-actions {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 14px;
  border-top: 1px solid #eeeeef;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-compose-icon-button,
.world-agent-studio .world-agent-conversation-host .canvas-agent-settings-button,
.world-agent-studio .world-agent-compose-option {
  min-height: 34px;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #ffffff;
  color: #52525b;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-compose-icon-button {
  width: 34px;
  height: 34px;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-settings-button,
.world-agent-studio .world-agent-compose-option {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 680;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-settings-button > div {
  display: flex;
  align-items: center;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-settings-button > div > span {
  display: none;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button {
  width: auto;
  min-width: 94px;
  height: 36px;
  flex: 0 0 auto;
  margin-left: auto;
  border-radius: 8px;
  background: #09090b;
  color: #ffffff;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button::before {
  content: "分析剧本";
  margin-right: 3px;
  font-size: 11px;
  font-weight: 740;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button.is-cancel::before {
  content: "停止分析";
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button:hover,
.world-agent-studio .world-agent-conversation-host .canvas-agent-generate-button:focus-visible {
  background: #27272a;
  outline: none;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-popover {
  position: fixed;
  inset: 82px 24px auto auto;
  z-index: 190;
  width: min(620px, calc(100vw - 48px));
  max-height: calc(100vh - 108px);
  overflow: auto;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(24, 24, 27, 0.16);
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-result-summary,
.world-agent-studio .world-agent-conversation-host .canvas-agent-change-summary,
.world-agent-studio .world-agent-conversation-host .canvas-agent-conversation,
.world-agent-studio .world-agent-conversation-host .canvas-agent-execution-status {
  order: 4;
  margin: 16px 20px 0;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-conversation {
  max-height: 320px;
  overflow: auto;
}

.world-agent-script-source-footer {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  border-top: 1px solid #eeeeef;
  color: #a1a1aa;
  font-size: 10px;
}

.world-agent-script-source-footer > span:first-child {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.world-agent-script-source-footer .material-symbols-outlined {
  font-size: 15px;
}

.world-agent-script-analysis {
  margin-top: 26px;
}

.world-agent-studio-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed #d4d4d8;
  border-radius: 8px;
  color: #a1a1aa;
  text-align: center;
}

.world-agent-studio-empty .material-symbols-outlined {
  font-size: 32px;
}

.world-agent-studio-empty strong {
  color: #52525b;
  font-size: 12px;
}

.world-agent-studio-empty span:last-child {
  max-width: 500px;
  font-size: 10px;
  line-height: 1.6;
}

.world-agent-analysis-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e4e4e7;
}

.world-agent-analysis-header h2 {
  margin: 0;
  color: #18181b;
  font-size: 19px;
  font-weight: 760;
}

.world-agent-analysis-header p {
  max-width: 800px;
  margin: 7px 0 0;
  color: #71717a;
  font-size: 11px;
  line-height: 1.75;
}

.world-agent-analysis-header > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 6px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 9px;
  font-weight: 720;
}

.world-agent-analysis-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #e4e4e7;
}

.world-agent-analysis-stats div {
  display: grid;
  gap: 3px;
  padding: 13px 15px;
  background: #ffffff;
}

.world-agent-analysis-stats strong {
  color: #18181b;
  font-size: 17px;
}

.world-agent-analysis-stats span {
  color: #a1a1aa;
  font-size: 9px;
}

.world-agent-analysis-sections {
  display: grid;
  gap: 10px;
}

.world-agent-analysis-section {
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
}

.world-agent-analysis-section summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  color: #27272a;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.world-agent-analysis-section summary span:last-child {
  color: #a1a1aa;
  font-size: 9px;
  font-weight: 600;
}

.world-agent-analysis-section-body {
  padding: 0 16px 16px;
  border-top: 1px solid #f0f0f1;
}

.world-agent-analysis-section-body p,
.world-agent-analysis-section-body li {
  color: #52525b;
  font-size: 11px;
  line-height: 1.8;
}

.world-agent-analysis-section-body p {
  white-space: pre-wrap;
}

.world-agent-analysis-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.world-agent-analysis-list div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #eeeeef;
  border-radius: 7px;
  background: #fafafa;
}

.world-agent-analysis-list strong {
  color: #27272a;
  font-size: 11px;
}

.world-agent-analysis-list span {
  color: #71717a;
  font-size: 10px;
  line-height: 1.6;
}

.world-agent-studio-nextbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 24px;
  border-top: 1px solid #e4e4e7;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 26px rgba(24, 24, 27, 0.05);
  backdrop-filter: blur(12px);
}

.world-agent-studio-nextbar[hidden] {
  display: none !important;
}

.world-agent-studio-nextbar > span {
  color: #71717a;
  font-size: 10px;
}

.world-agent-asset-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 22px;
  border-bottom: 1px solid #e4e4e7;
}

.world-agent-asset-tabs button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #71717a;
  font-size: 11px;
  font-weight: 680;
  cursor: pointer;
}

.world-agent-asset-tabs button:hover,
.world-agent-asset-tabs button:focus-visible,
.world-agent-asset-tabs button.is-active {
  border-bottom-color: #18181b;
  color: #18181b;
  outline: none;
}

.world-agent-asset-tabs .material-symbols-outlined {
  font-size: 17px;
}

.world-agent-asset-tabs b {
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 8px;
  background: #e4e4e7;
  color: #52525b;
  font-size: 8px;
  text-align: center;
}

.world-agent-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.world-agent-asset-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
}

.world-agent-asset-card:hover {
  border-color: #a1a1aa;
  box-shadow: 0 8px 24px rgba(24, 24, 27, 0.06);
}

.world-agent-asset-card-preview {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  background: #eeeeef;
}

.world-agent-asset-card.is-character .world-agent-asset-card-preview {
  aspect-ratio: 3 / 4;
}

.world-agent-asset-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f4f5;
}

.world-agent-asset-card-preview > .material-symbols-outlined {
  color: #a1a1aa;
  font-size: 34px;
}

.world-agent-asset-card-status {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #71717a;
  font-size: 8px;
  font-weight: 720;
}

.world-agent-asset-card-status.is-ready {
  background: #dcfce7;
  color: #15803d;
}

.world-agent-asset-card-status.is-running {
  background: #ede9fe;
  color: #6d28d9;
}

.world-agent-asset-card-body {
  display: grid;
  gap: 6px;
  padding: 13px;
}

.world-agent-asset-card-body strong {
  overflow: hidden;
  color: #27272a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-asset-card-body > span {
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  color: #71717a;
  font-size: 9px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.world-agent-asset-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  gap: 6px;
  margin-top: 5px;
}

.world-agent-asset-card-actions button {
  display: inline-grid;
  min-width: 0;
  height: 32px;
  place-items: center;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #ffffff;
  color: #52525b;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.world-agent-asset-card-actions button:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-color: #18181b;
  background: #18181b;
  color: #ffffff;
}

.world-agent-asset-card-actions button:hover,
.world-agent-asset-card-actions button:focus-visible {
  border-color: #71717a;
  outline: none;
}

.world-agent-asset-card-actions .material-symbols-outlined {
  font-size: 16px;
}

.world-agent-episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

.world-agent-episode-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 10px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
}

.world-agent-episode-card:hover {
  border-color: #a1a1aa;
  box-shadow: 0 8px 24px rgba(24, 24, 27, 0.06);
}

.world-agent-episode-card-preview {
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  border-radius: 7px;
  background: #d4d4d8;
  color: #52525b;
}

.world-agent-episode-card-preview .material-symbols-outlined {
  font-size: 28px;
}

.world-agent-episode-card-body {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 8px;
  padding: 6px 8px 6px 0;
}

.world-agent-episode-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.world-agent-episode-card-labels span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f4f4f5;
  color: #71717a;
  font-size: 8px;
}

.world-agent-episode-card-labels .is-running {
  background: #ede9fe;
  color: #6d28d9;
}

.world-agent-episode-card-body strong {
  color: #18181b;
  font-size: 14px;
}

.world-agent-episode-card-body > span {
  color: #71717a;
  font-size: 10px;
}

.world-agent-episode-card-body button {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  border-radius: 7px;
  background: #f4f4f5;
  color: #27272a;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.world-agent-episode-card-body button:hover,
.world-agent-episode-card-body button:focus-visible {
  background: #e4e4e7;
  outline: none;
}

.world-agent-episode-card-body .material-symbols-outlined {
  font-size: 15px;
}

.world-agent-episode-editor {
  grid-template-rows: 62px minmax(0, 1fr) 142px;
  background: #f4f4f5;
}

.world-agent-episode-editor-header {
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid #e4e4e7;
  background: #ffffff;
}

.world-agent-episode-editor-header > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.world-agent-episode-editor-header > div > span {
  margin: 0;
}

.world-agent-episode-editor-header strong {
  overflow: hidden;
  color: #18181b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-episode-editor-header .world-agent-studio-primary-button {
  margin-left: auto;
}

.world-agent-episode-layout {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 250px minmax(460px, 1fr) minmax(300px, 32vw);
  overflow: hidden;
}

.world-agent-episode-assets,
.world-agent-episode-segments,
.world-agent-episode-preview {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.world-agent-episode-assets {
  border-right: 1px solid #e4e4e7;
  background: #fafafa;
}

.world-agent-episode-assets-heading {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid #eeeeef;
  color: #3f3f46;
  font-size: 10px;
}

.world-agent-episode-assets-heading span {
  color: #a1a1aa;
}

.world-agent-episode-assets-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px;
}

.world-agent-episode-asset {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #ffffff;
  color: #52525b;
  cursor: pointer;
}

.world-agent-episode-asset img,
.world-agent-episode-asset-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  object-fit: contain;
  background: #eeeeef;
}

.world-agent-episode-asset-placeholder .material-symbols-outlined {
  color: #a1a1aa;
  font-size: 22px;
}

.world-agent-episode-asset span:last-child {
  display: block;
  overflow: hidden;
  padding: 7px;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-episode-segments {
  background: #ffffff;
}

.world-agent-episode-segments-list {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.world-agent-segment-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fafafa;
}

.world-agent-segment-card.is-selected {
  border-color: #52525b;
  background: #ffffff;
}

.world-agent-segment-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.world-agent-segment-card-header strong {
  color: #18181b;
  font-size: 14px;
}

.world-agent-segment-card-header span {
  color: #a1a1aa;
  font-size: 9px;
}

.world-agent-segment-card-header button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin-left: auto;
  place-items: center;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #ffffff;
  color: #3f3f46;
  cursor: pointer;
}

.world-agent-segment-card-header button:hover,
.world-agent-segment-card-header button:focus-visible {
  border-color: #71717a;
  outline: none;
}

.world-agent-segment-card-header .material-symbols-outlined {
  font-size: 17px;
}

.world-agent-segment-card-assets {
  display: flex;
  gap: 6px;
}

.world-agent-segment-card-assets span {
  padding: 4px 7px;
  border-radius: 6px;
  background: #eeeeef;
  color: #52525b;
  font-size: 8px;
}

.world-agent-segment-card-copy {
  color: #3f3f46;
  font-size: 11px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.world-agent-segment-shot-list {
  display: grid;
  gap: 7px;
}

.world-agent-segment-shot-list div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 9px;
  padding-top: 8px;
  border-top: 1px solid #eeeeef;
  color: #52525b;
  font-size: 9px;
  line-height: 1.65;
}

.world-agent-segment-shot-list strong {
  color: #18181b;
}

.world-agent-episode-preview {
  display: grid;
  place-items: center;
  padding: 24px;
  border-left: 1px solid #e4e4e7;
  background: #fafafa;
}

.world-agent-episode-preview-stage {
  display: grid;
  width: min(100%, 430px);
  aspect-ratio: 9 / 16;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  background: #e4e4e7;
  color: #71717a;
  text-align: center;
}

.world-agent-episode-preview-stage .material-symbols-outlined {
  font-size: 34px;
}

.world-agent-episode-preview-stage strong {
  color: #3f3f46;
  font-size: 12px;
}

.world-agent-episode-preview-stage span:last-child {
  max-width: 220px;
  font-size: 9px;
  line-height: 1.6;
}

.world-agent-episode-preview-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 7px;
  background: #18181b;
}

.world-agent-episode-timeline {
  min-width: 0;
  overflow: auto hidden;
  border-top: 1px solid #e4e4e7;
  background: #ffffff;
}

.world-agent-episode-timeline-list {
  display: flex;
  min-width: max-content;
  gap: 8px;
  padding: 14px 18px;
}

.world-agent-episode-timeline-item {
  display: grid;
  width: 128px;
  height: 108px;
  flex: 0 0 128px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #fafafa;
  color: #71717a;
  cursor: pointer;
}

.world-agent-episode-timeline-item.is-selected {
  border-color: #18181b;
}

.world-agent-episode-timeline-item > span:first-child {
  display: grid;
  place-items: center;
  background: #eeeeef;
}

.world-agent-episode-timeline-item .material-symbols-outlined {
  font-size: 21px;
}

.world-agent-episode-timeline-item strong {
  overflow: hidden;
  padding: 7px;
  color: #52525b;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-jwj-workspace-mode="world"] .global-workspace-mode-switch {
  top: auto !important;
  right: auto !important;
  bottom: 10px !important;
  left: 10px !important;
  z-index: 210 !important;
  transform: none !important;
}

html[data-jwj-workspace-mode="world"] .global-workspace-mode-switch .workspace-mode-label {
  display: none;
}

@media (max-width: 1100px) {
  .world-agent-studio-topbar {
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    gap: 10px;
    padding: 0 12px;
  }

  .world-agent-studio-status {
    display: none;
  }

  .world-agent-episode-layout {
    grid-template-columns: 210px minmax(420px, 1fr) 300px;
  }
}

@media (max-width: 820px) {
  .world-agent-studio {
    grid-template-rows: 112px minmax(0, 1fr);
  }

  .world-agent-studio-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 54px 48px;
  }

  .world-agent-studio-steps {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .world-agent-studio-steps button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .world-agent-studio-page {
    padding: 28px 16px 84px;
  }

  .world-agent-studio-heading {
    align-items: flex-start;
  }

  .world-agent-analysis-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .world-agent-episodes-grid {
    grid-template-columns: 1fr;
  }

  .world-agent-episode-layout {
    grid-template-columns: 180px minmax(440px, 1fr);
    overflow: auto;
  }

  .world-agent-episode-preview {
    display: none;
  }
}

@media (max-width: 620px) {
  .world-agent-studio-project > div,
  .world-agent-studio-actions #world-agent-new-conversation-button {
    display: none;
  }

  .world-agent-studio-heading {
    display: grid;
  }

  .world-agent-studio-heading-actions {
    flex-wrap: wrap;
  }

  .world-agent-script-source-tabs {
    grid-template-columns: 1fr;
  }

  .world-agent-studio .world-agent-conversation-host .canvas-agent-theme-field textarea {
    min-height: 190px;
  }

  .world-agent-studio .world-agent-conversation-host .canvas-agent-settings-button,
  .world-agent-studio .world-agent-compose-option {
    display: none;
  }

  .world-agent-analysis-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-agent-assets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-agent-episode-card {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
  }

  .world-agent-studio-nextbar {
    justify-content: flex-end;
  }

  .world-agent-studio-nextbar > span {
    display: none;
  }

  .world-agent-episode-editor {
    grid-template-rows: 58px minmax(0, 1fr) 126px;
  }

  .world-agent-episode-layout {
    display: block;
    overflow: auto;
  }

  .world-agent-episode-assets {
    border-right: 0;
  }

  .world-agent-episode-assets-list {
    display: flex;
    overflow: auto;
  }

  .world-agent-episode-asset {
    width: 92px;
    flex: 0 0 92px;
  }
}

.workspace-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: #f2f4f8;
  box-shadow: 0 3px 12px rgba(25, 28, 31, 0.1);
  overflow: hidden;
}

.global-workspace-mode-switch {
  position: fixed;
  top: 7px;
  right: 12px;
  z-index: 180;
  background: rgba(242, 244, 248, 0.97);
  box-shadow: 0 5px 18px rgba(25, 28, 31, 0.12);
  backdrop-filter: blur(12px);
}

.generation-header-actions,
.canvas-library-settings,
.canvas-topbar-actions {
  margin-right: var(--workspace-mode-switch-reserve);
}

#generation-workspace[hidden],
.infinite-canvas-shell[hidden],
.canvas-project-library[hidden],
.canvas-workspace[hidden],
.world-agent-workspace[hidden],
.canvas-project-dialog-backdrop[hidden] {
  display: none !important;
}

.workspace-mode-button {
  display: inline-flex;
  min-width: 0;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: 5px;
  background: transparent;
  color: #505663;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.workspace-mode-button .material-symbols-outlined {
  font-size: 17px;
}

.workspace-mode-button:hover,
.workspace-mode-button:focus-visible {
  color: #191c1f;
  outline: none;
}

.workspace-mode-button.is-active {
  background: #ffffff;
  color: #0058be;
  box-shadow: 0 1px 3px rgba(25, 28, 31, 0.13);
}

.infinite-canvas-shell {
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow: hidden;
  background: #f7f8fb;
  color: #191c1f;
  isolation: isolate;
}

.canvas-workspace,
.canvas-project-library,
.world-agent-workspace {
  position: absolute;
  inset: 0;
}

.world-agent-workspace[hidden] {
  display: none !important;
}

.world-agent-workspace {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  overflow: hidden;
  background: #e9eee9;
  color: #1d2925;
}

.world-agent-topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px 24px;
  border-bottom: 1px solid #cbd6ce;
  background: rgba(248, 251, 248, 0.96);
  box-shadow: 0 4px 18px rgba(28, 47, 37, 0.07);
  backdrop-filter: blur(12px);
}

.world-agent-topbar .canvas-topbar-actions {
  justify-self: end;
}

.world-agent-topbar-center {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #315345;
}

.world-agent-topbar-center strong {
  color: #1d2925;
  font-size: 14px;
  font-weight: 850;
}

.world-agent-topbar-center span:last-child {
  overflow: hidden;
  max-width: 240px;
  color: #6b7b72;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-topbar-kicker,
.world-agent-eyebrow {
  color: #4d7561;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.world-agent-main {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  padding: 12px;
}

.world-agent-map-column {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(300px, 1fr) 196px;
  gap: 10px;
}

.world-agent-map-toolbar,
.world-agent-timeline-panel,
.world-agent-inspector {
  border: 1px solid #cbd6ce;
  background: rgba(248, 251, 248, 0.94);
  box-shadow: 0 8px 24px rgba(28, 47, 37, 0.07);
}

.world-agent-map-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 10px 14px;
  border-radius: 8px;
}

.world-agent-view-title,
.world-agent-section-heading,
.world-agent-inspector-header {
  min-width: 0;
}

.world-agent-view-title strong,
.world-agent-view-title span:last-child {
  display: block;
}

.world-agent-view-title strong {
  overflow: hidden;
  margin-top: 2px;
  color: #1d2925;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-view-title span:last-child {
  overflow: hidden;
  margin-top: 2px;
  color: #718077;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-map-actions,
.world-agent-timeline-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.world-agent-icon-action {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #cbd6ce;
  border-radius: 6px;
  background: #ffffff;
  color: #4d7561;
  cursor: pointer;
}

.world-agent-icon-action:hover,
.world-agent-icon-action:focus-visible {
  border-color: #4d8566;
  background: #eef8f0;
  color: #1d6140;
  outline: none;
}

.world-agent-icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.world-agent-icon-action .material-symbols-outlined {
  font-size: 16px;
}

.world-agent-filter-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64736a;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.world-agent-filter-field select {
  height: 30px;
  min-width: 126px;
  padding: 0 8px;
  border: 1px solid #cbd6ce;
  border-radius: 6px;
  background: #ffffff;
  color: #34463c;
  font: inherit;
  font-size: 10px;
  outline: none;
}

.world-agent-filter-field select:focus-visible {
  border-color: #4d8566;
  box-shadow: 0 0 0 2px rgba(77, 133, 102, 0.15);
}

.world-agent-map {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #b9cbbd;
  border-radius: 8px;
  background: #dfe9df;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(28, 47, 37, 0.08);
  isolation: isolate;
}

.world-agent-map-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
  filter: saturate(0.78) contrast(0.92);
  pointer-events: none;
}

.world-agent-map-background:not([src]) {
  display: none;
}

.world-agent-map::before,
.world-agent-map::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.world-agent-map::before {
  opacity: 0.34;
  background-image: linear-gradient(#b3c8b8 1px, transparent 1px), linear-gradient(90deg, #b3c8b8 1px, transparent 1px);
  background-size: 54px 54px;
}

.world-agent-map::after {
  border: 18px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(103, 136, 113, 0.18);
}

.world-agent-map-plate {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.world-agent-map-contour {
  position: absolute;
  display: block;
  border: 1px solid rgba(95, 133, 104, 0.24);
  border-radius: 48% 52% 44% 56%;
  transform: rotate(-14deg);
}

.world-agent-map-contour.contour-one {
  top: 14%;
  left: 8%;
  width: 36%;
  height: 34%;
}

.world-agent-map-contour.contour-two {
  right: 9%;
  bottom: 16%;
  width: 44%;
  height: 34%;
  transform: rotate(18deg);
}

.world-agent-map-contour.contour-three {
  top: 28%;
  right: 28%;
  width: 24%;
  height: 24%;
  transform: rotate(3deg);
}

.world-agent-map-compass {
  position: absolute;
  top: 18px;
  right: 20px;
  color: rgba(48, 87, 62, 0.58);
  font-size: 28px;
}

.world-agent-map-scale {
  position: absolute;
  right: 18px;
  bottom: 14px;
  padding: 4px 6px;
  border: 1px solid rgba(87, 118, 96, 0.32);
  border-radius: 4px;
  background: rgba(248, 251, 248, 0.68);
  color: #597263;
  font-size: 9px;
  font-weight: 800;
}

.world-agent-route-layer,
.world-agent-location-layer,
.world-agent-event-layer {
  position: absolute;
  inset: 0;
}

.world-agent-route-layer {
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: auto;
}

.world-agent-route-path {
  fill: none;
  stroke: var(--world-route-color, #4d8566);
  stroke-width: 2.5;
  stroke-dasharray: 8 7;
  opacity: 0.74;
  pointer-events: stroke;
  vector-effect: non-scaling-stroke;
}

.world-agent-route-path.is-selected {
  stroke: #1d6140;
  stroke-width: 4;
  opacity: 1;
}

.world-agent-location-layer {
  z-index: 4;
}

.world-agent-location {
  position: absolute;
  display: flex;
  width: 126px;
  min-height: 48px;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(93, 129, 102, 0.68);
  border-radius: 7px;
  background: rgba(248, 251, 248, 0.94);
  color: #294335;
  box-shadow: 0 6px 14px rgba(38, 68, 49, 0.13);
  cursor: grab;
  transform: translate(-50%, -50%);
  user-select: none;
}

.world-agent-location:hover,
.world-agent-location:focus-visible,
.world-agent-location.is-selected {
  border-color: #1d6140;
  box-shadow: 0 0 0 3px rgba(29, 97, 64, 0.15), 0 8px 18px rgba(38, 68, 49, 0.18);
  outline: none;
}

.world-agent-location.is-dragging {
  cursor: grabbing;
  opacity: 0.82;
}

.world-agent-location-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  background: #d9eee0;
  color: #1d6140;
  font-size: 15px;
}

.world-agent-location-copy {
  display: block;
  min-width: 0;
}

.world-agent-location-copy strong,
.world-agent-location-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-location-copy strong {
  color: #294335;
  font-size: 10px;
  font-weight: 850;
}

.world-agent-location-copy span {
  margin-top: 2px;
  color: #708177;
  font-size: 8px;
}

.world-agent-event-layer {
  z-index: 5;
  pointer-events: auto;
}

.world-agent-character-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.world-agent-character-marker {
  position: absolute;
  display: inline-flex;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #365f91;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(36, 69, 103, 0.24), 0 0 0 2px rgba(54, 95, 145, 0.2);
  cursor: pointer;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.world-agent-character-marker.is-selected,
.world-agent-character-marker:hover,
.world-agent-character-marker:focus-visible {
  background: #244a73;
  box-shadow: 0 0 0 3px rgba(36, 74, 115, 0.22), 0 3px 8px rgba(36, 69, 103, 0.28);
  outline: none;
}

.world-agent-character-marker .material-symbols-outlined {
  font-size: 14px;
}

.world-agent-character-marker-name,
.world-agent-character-marker-state {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  max-width: 110px;
  padding: 3px 5px;
  overflow: hidden;
  border: 1px solid rgba(54, 95, 145, 0.22);
  border-radius: 4px;
  background: rgba(248, 251, 248, 0.94);
  color: #36526f;
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
}

.world-agent-character-marker-state {
  top: calc(100% + 22px);
  max-width: 150px;
  border-color: rgba(180, 102, 56, 0.22);
  color: #8b5e43;
  font-size: 7px;
  font-weight: 700;
}

.world-agent-event-dot {
  position: absolute;
  display: block;
  width: 9px;
  height: 9px;
  border: 2px solid #f8fbf8;
  border-radius: 50%;
  background: #b46638;
  box-shadow: 0 0 0 2px rgba(180, 102, 56, 0.28);
  transform: translate(-50%, -50%);
  padding: 0;
  cursor: pointer;
}

.world-agent-event-dot:hover,
.world-agent-event-dot:focus-visible {
  width: 13px;
  height: 13px;
  border-color: #fff4e8;
  background: #984b24;
  outline: none;
}

.world-agent-event-dot span {
  display: block;
  width: 100%;
  height: 100%;
}

.world-agent-map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  color: #60746a;
  text-align: center;
  pointer-events: none;
}

.world-agent-map-empty[hidden] {
  display: none;
}

.world-agent-map-empty .material-symbols-outlined {
  color: #4d8566;
  font-size: 34px;
}

.world-agent-map-empty strong {
  color: #365844;
  font-size: 14px;
}

.world-agent-map-empty span:last-child {
  max-width: 280px;
  font-size: 10px;
  line-height: 1.55;
}

.world-agent-timeline-panel {
  min-width: 0;
  min-height: 0;
  padding: 11px 13px 12px;
  border-radius: 8px;
}

.world-agent-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.world-agent-section-heading strong {
  display: block;
  margin-top: 2px;
  color: #273e31;
  font-size: 13px;
  font-weight: 850;
}

.world-agent-timeline-tools > span {
  color: #718077;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.world-agent-timeline-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: #718077;
}

.world-agent-timeline-controls > .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 16px;
}

.world-agent-timeline-controls input[type="range"] {
  width: min(360px, 100%);
  height: 4px;
  accent-color: #4d8566;
  cursor: pointer;
}

.world-agent-timeline-controls output {
  min-width: 82px;
  color: #506157;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.world-agent-timeline {
  position: relative;
  height: 122px;
  margin-top: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid #d4ded6;
  border-bottom: 1px solid #d4ded6;
  background: #f2f6f2;
}

.world-agent-timeline-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 2px;
  background: #b46638;
  box-shadow: 0 0 0 2px rgba(180, 102, 56, 0.13);
  pointer-events: none;
}

.world-agent-timeline::before {
  position: absolute;
  inset: 18px 0 18px;
  min-width: 100%;
  background-image: linear-gradient(90deg, rgba(144, 170, 151, 0.22) 1px, transparent 1px);
  background-size: 72px 100%;
  content: "";
  pointer-events: none;
}

.world-agent-timeline-empty {
  display: grid;
  height: 100%;
  place-items: center;
  color: #7a8b80;
  font-size: 10px;
}

.world-agent-timeline-event {
  position: absolute;
  top: 38px;
  display: grid;
  width: 132px;
  min-height: 52px;
  padding: 7px 8px;
  border: 1px solid #d3b08f;
  border-radius: 6px;
  background: #fffaf4;
  color: #5d412c;
  cursor: grab;
  text-align: left;
  touch-action: none;
  transform: translateX(-50%);
}

.world-agent-timeline-event.is-dragging {
  z-index: 3;
  cursor: grabbing;
  opacity: 0.86;
}

.world-agent-timeline-event:hover,
.world-agent-timeline-event:focus-visible,
.world-agent-timeline-event.is-selected {
  border-color: #a65f32;
  box-shadow: 0 0 0 3px rgba(166, 95, 50, 0.13);
  outline: none;
}

.world-agent-timeline-event strong,
.world-agent-timeline-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-timeline-event strong {
  font-size: 9px;
  font-weight: 850;
}

.world-agent-timeline-event span {
  margin-top: 3px;
  color: #8b6b50;
  font-size: 8px;
}

.world-agent-timeline-event::before {
  position: absolute;
  top: -26px;
  left: 50%;
  width: 1px;
  height: 22px;
  background: #c98a5e;
  content: "";
}

.world-agent-inspector {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border-radius: 8px;
}

.world-agent-inspector-empty,
.world-agent-inspector-content {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 20px 16px;
}

.world-agent-inspector-empty {
  min-height: 100%;
  place-content: center;
  justify-items: center;
  color: #75857b;
  text-align: center;
}

.world-agent-inspector-empty .material-symbols-outlined {
  color: #4d8566;
  font-size: 30px;
}

.world-agent-inspector-empty strong {
  color: #365844;
  font-size: 13px;
}

.world-agent-inspector-empty span:last-child {
  font-size: 10px;
  line-height: 1.55;
}

.world-agent-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dce5de;
}

.world-agent-inspector-header h2 {
  margin: 2px 0 0;
  color: #273e31;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.3;
}

.world-agent-inspector-header p {
  margin: 4px 0 0;
  color: #748278;
  font-size: 10px;
  line-height: 1.5;
}

.world-agent-inspector-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.world-agent-inspector-header-actions > .material-symbols-outlined {
  margin-right: 2px;
  color: #4d7561;
  font-size: 22px;
}

.world-agent-icon-action.is-danger:hover,
.world-agent-icon-action.is-danger:focus-visible {
  border-color: #b3261e;
  background: #fff1ef;
  color: #b3261e;
}

.world-agent-editor {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.world-agent-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dce5de;
}

.world-agent-editor-header h2 {
  margin: 3px 0 0;
  color: #273e31;
  font-size: 16px;
  line-height: 1.3;
}

.world-agent-editor-header > .material-symbols-outlined {
  color: #4d8566;
  font-size: 22px;
}

.world-agent-editor-fields {
  display: grid;
  gap: 9px;
}

.world-agent-editor-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.world-agent-editor-field {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.world-agent-editor-field > span {
  color: #5d7163;
  font-size: 9px;
  font-weight: 850;
}

.world-agent-editor-field input,
.world-agent-editor-field select,
.world-agent-editor-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd6ce;
  border-radius: 5px;
  background: #ffffff;
  color: #2c4234;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0;
  outline: none;
}

.world-agent-editor-field input,
.world-agent-editor-field select {
  height: 32px;
  padding: 0 8px;
}

.world-agent-editor-field textarea {
  min-height: 64px;
  padding: 7px 8px;
  resize: vertical;
  line-height: 1.5;
}

.world-agent-editor-field input:focus,
.world-agent-editor-field select:focus,
.world-agent-editor-field textarea:focus {
  border-color: #4d8566;
  box-shadow: 0 0 0 2px rgba(77, 133, 102, 0.14);
}

.world-agent-editor-picker {
  min-width: 0;
  margin: 0;
  padding: 7px 8px 8px;
  border: 1px solid #d4dfd6;
  border-radius: 5px;
}

.world-agent-editor-picker legend {
  padding: 0 3px;
  color: #5d7163;
  font-size: 9px;
  font-weight: 850;
}

.world-agent-editor-picker-options {
  display: grid;
  max-height: 116px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  overflow: auto;
}

.world-agent-editor-picker-options label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: #506157;
  font-size: 9px;
  line-height: 1.35;
}

.world-agent-editor-picker-options input {
  flex: 0 0 auto;
  accent-color: #4d8566;
}

.world-agent-editor-picker-options label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-editor-picker-empty {
  color: #8a978e;
  font-size: 9px;
}

.world-agent-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 3px;
}

.world-agent-secondary-action,
.world-agent-primary-action {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 5px;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.world-agent-secondary-action {
  border: 1px solid #cbd6ce;
  background: #ffffff;
  color: #5d7163;
}

.world-agent-primary-action {
  border: 1px solid #1d6140;
  background: #1d6140;
  color: #ffffff;
}

.world-agent-secondary-action:hover,
.world-agent-secondary-action:focus-visible,
.world-agent-primary-action:hover,
.world-agent-primary-action:focus-visible {
  outline: none;
  filter: brightness(0.96);
}

.world-agent-primary-action .material-symbols-outlined {
  font-size: 15px;
}

.world-agent-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0;
}

.world-agent-inspector-actions .world-agent-primary-action,
.world-agent-inspector-actions .world-agent-secondary-action {
  flex: 1 1 120px;
}

.world-agent-asset-status {
  padding: 8px 9px;
  border: 1px solid #c6dfcc;
  border-radius: 6px;
  background: #f0f9f1;
  color: #50705b;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.5;
}

.world-agent-asset-status.is-error {
  border-color: #efc5c0;
  background: #fff3f1;
  color: #9a3d2c;
}

.world-agent-inspector-block {
  padding: 9px 10px;
  border: 1px solid #dbe5dd;
  border-radius: 6px;
  background: #f6faf6;
}

.world-agent-inspector-block h3 {
  margin: 0 0 5px;
  color: #50705b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.world-agent-inspector-block p,
.world-agent-inspector-block li {
  color: #506157;
  font-size: 10px;
  line-height: 1.6;
}

.world-agent-inspector-block p {
  margin: 0;
  white-space: pre-wrap;
}

.world-agent-inspector-block ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 16px;
}

.world-agent-inspector-link {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #b7d0bd;
  border-radius: 5px;
  background: #eef8f0;
  color: #27633e;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.world-agent-inspector-link:hover,
.world-agent-inspector-link:focus-visible {
  border-color: #4d8566;
  outline: none;
}

.world-agent-inspector-link.is-active {
  border-color: #4d8566;
  background: #dff0e3;
  box-shadow: inset 0 0 0 1px rgba(77, 133, 102, 0.14);
}

.world-agent-asset-index {
  max-height: 168px;
  overflow: auto;
}

.world-agent-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.world-agent-check-summary,
.world-agent-issue-heading {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #50705b;
  font-size: 10px;
  line-height: 1.5;
}

.world-agent-check-summary {
  width: min(260px, 100%);
  padding: 8px 10px;
  border: 1px solid #c6dfcc;
  border-radius: 6px;
  background: #f0f9f1;
  text-align: left;
}

.world-agent-check-summary .material-symbols-outlined,
.world-agent-issue-heading .material-symbols-outlined {
  font-size: 15px;
}

.world-agent-issue-list {
  display: grid;
  width: min(280px, 100%);
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #e1c8b3;
  border-radius: 6px;
  background: #fff8f1;
  text-align: left;
}

.world-agent-issue-heading {
  color: #875631;
}

.world-agent-issue-link {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #73513b;
  font-size: 9px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.world-agent-issue-row,
.world-agent-object-issue {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 4px;
}

.world-agent-issue-row .world-agent-issue-link,
.world-agent-object-issue p {
  min-width: 0;
  flex: 1;
}

.world-agent-issue-fix {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #e1c8b3;
  border-radius: 5px;
  background: #ffffff;
  color: #875631;
  cursor: pointer;
}

.world-agent-issue-fix:hover,
.world-agent-issue-fix:focus-visible {
  border-color: #a65f32;
  background: #fff1e5;
  color: #93461d;
  outline: none;
}

.world-agent-issue-fix .material-symbols-outlined {
  font-size: 14px;
}

.world-agent-object-issue {
  align-items: center;
  padding: 4px 0;
}

.world-agent-object-issue p {
  margin: 0;
}

.world-agent-issue-link:hover,
.world-agent-issue-link:focus-visible {
  color: #93461d;
  outline: none;
}

.world-agent-issue-link .material-symbols-outlined {
  flex: 0 0 14px;
  font-size: 14px;
}

.world-agent-issue-link.is-error {
  color: #9a3d2c;
}

.world-agent-inspector-issues p.is-error {
  color: #9a3d2c;
}

.world-agent-agent-host {
  position: relative;
  z-index: 30;
  min-height: 0;
  padding: 0 12px 12px;
}

.world-agent-agent-host .canvas-agent-panel {
  position: relative;
  bottom: auto;
  left: auto;
  width: min(900px, 100%);
  margin: 0 auto;
  transform: none;
}

.world-agent-agent-host .canvas-agent-popover {
  bottom: calc(100% + 10px);
}

.canvas-agent-conversation {
  display: grid;
  gap: 10px;
  margin: 0 12px 10px;
  padding: 12px;
  border: 1px solid #d8e2da;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(28, 62, 41, 0.08);
}

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

.canvas-agent-conversation-heading > div {
  display: grid;
  gap: 2px;
}

.canvas-agent-conversation-heading strong {
  color: #1d3526;
  font-size: 12px;
}

.canvas-agent-conversation-meta {
  color: #829187;
  font-size: 10px;
}

.canvas-agent-messages {
  display: grid;
  max-height: 260px;
  gap: 8px;
  overflow: auto;
  padding-right: 3px;
}

.canvas-agent-message {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #e1e9e2;
  border-radius: 7px;
  background: #f8fbf8;
}

.canvas-agent-message.is-user {
  border-color: #c9ddeb;
  background: #f4f9fd;
}

.canvas-agent-message.is-system {
  border-color: #e8dfc4;
  background: #fffaf0;
}

.canvas-agent-message-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #587161;
  font-size: 9px;
}

.canvas-agent-message-meta span {
  color: #98a59b;
}

.canvas-agent-message p {
  margin: 0;
  color: #33453a;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.canvas-agent-suggestions,
.canvas-agent-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.canvas-agent-suggestion {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid #bdd4c3;
  border-radius: 5px;
  background: #f1f8f2;
  color: #286140;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.canvas-agent-suggestion:hover,
.canvas-agent-suggestion:focus-visible {
  border-color: #4e8a65;
  background: #e2f1e5;
  outline: none;
}

.canvas-agent-suggestion .material-symbols-outlined {
  font-size: 14px;
}

.canvas-project-library {
  overflow: auto;
  background: #f7f8fb;
}

.canvas-library-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  min-height: 64px;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid #dfe3ea;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.canvas-library-brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 800;
}

.canvas-library-brand img {
  width: 32px;
  height: 32px;
  border: 1px solid #d7dce5;
  border-radius: 7px;
  object-fit: cover;
}

.canvas-library-settings {
  width: 40px;
  height: 40px;
  justify-self: end;
  box-shadow: none;
}

.canvas-project-library-main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.canvas-project-library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.canvas-project-library-heading h1 {
  margin: 0;
  color: #191c1f;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.canvas-project-library-heading p {
  margin: 8px 0 0;
  color: #676d79;
  font-size: 13px;
  line-height: 1.5;
}

.canvas-project-heading-actions,
.canvas-project-empty-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-project-heading-actions .material-symbols-outlined,
.canvas-project-empty-actions .material-symbols-outlined {
  font-size: 18px;
}

.canvas-primary-button,
.canvas-secondary-button,
.canvas-danger-button {
  display: inline-flex;
  min-width: 0;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

#canvas-open-project-button[hidden],
#canvas-empty-open-project-button[hidden] {
  display: none !important;
}

.canvas-primary-button {
  background: #0058be;
  color: #ffffff;
}

.canvas-primary-button:hover,
.canvas-primary-button:focus-visible {
  background: #00499e;
  outline: none;
}

.canvas-primary-button .material-symbols-outlined {
  font-size: 18px;
}

.canvas-secondary-button {
  border-color: #cfd3dc;
  background: #ffffff;
  color: #424754;
}

.canvas-secondary-button:hover,
.canvas-secondary-button:focus-visible {
  border-color: #929aaa;
  background: #f3f5f8;
  outline: none;
}

.canvas-danger-button {
  background: #b3261e;
  color: #ffffff;
}

.canvas-danger-button:hover,
.canvas-danger-button:focus-visible {
  background: #8f1d18;
  outline: none;
}

.canvas-primary-button:disabled,
.canvas-secondary-button:disabled,
.canvas-danger-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.canvas-project-grid[hidden] {
  display: none;
}

.canvas-icon-button.canvas-library-settings {
  width: 40px;
  height: 40px;
  box-shadow: none;
}

.canvas-project-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7dce5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 7px 22px rgba(25, 28, 31, 0.06);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.canvas-project-card:hover,
.canvas-project-card:focus-within {
  border-color: #9ba7b8;
  box-shadow: 0 12px 30px rgba(25, 28, 31, 0.11);
  transform: translateY(-2px);
}

.canvas-project-open {
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.canvas-project-open:focus-visible {
  outline: 3px solid rgba(0, 88, 190, 0.28);
  outline-offset: -3px;
}

.canvas-project-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid #e1e4ea;
  background: #e8ebf0;
}

.canvas-project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-project-preview-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-color: #eef1f5;
  background-image:
    linear-gradient(#dce1e8 1px, transparent 1px),
    linear-gradient(90deg, #dce1e8 1px, transparent 1px);
  background-size: 24px 24px;
  color: #758093;
}

.canvas-project-preview-fallback .material-symbols-outlined {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #cbd1dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 22px;
}

.canvas-project-preview.has-image .canvas-project-preview-fallback {
  display: none;
}

.canvas-project-active-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 6px;
  background: rgba(21, 93, 58, 0.92);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}

.canvas-project-active-badge .material-symbols-outlined {
  font-size: 14px;
}

.canvas-project-card-body {
  min-width: 0;
  padding: 15px 16px 16px;
}

.canvas-project-card-body h2 {
  margin: 0;
  overflow: hidden;
  color: #202329;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-project-updated {
  margin: 5px 0 0;
  color: #757b87;
  font-size: 11px;
  line-height: 1.4;
}

.canvas-project-location {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: #5e6673;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.canvas-project-location .material-symbols-outlined {
  flex: 0 0 auto;
  color: #0058be;
  font-size: 14px;
}

.canvas-project-location span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-project-location.is-warning,
.canvas-project-location.is-warning .material-symbols-outlined {
  color: #9a5b00;
}

.canvas-project-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e4e7ec;
  color: #555c68;
}

.canvas-project-stats span {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
}

.canvas-project-stats span + span {
  border-left: 1px solid #e4e7ec;
}

.canvas-project-stats strong {
  color: #262a31;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.canvas-project-stats small {
  overflow: hidden;
  color: #6f7581;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-project-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.canvas-project-card:hover .canvas-project-card-actions,
.canvas-project-card:focus-within .canvas-project-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.canvas-project-card-action,
.canvas-dialog-icon-button {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(199, 205, 216, 0.92);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  color: #4f5662;
  box-shadow: 0 4px 12px rgba(25, 28, 31, 0.12);
  cursor: pointer;
}

.canvas-project-card-action:hover,
.canvas-project-card-action:focus-visible,
.canvas-dialog-icon-button:hover,
.canvas-dialog-icon-button:focus-visible {
  border-color: #929aaa;
  color: #0058be;
  outline: none;
}

.canvas-project-card-action.is-delete:hover,
.canvas-project-card-action.is-delete:focus-visible {
  color: #b3261e;
}

.canvas-project-card-action .material-symbols-outlined,
.canvas-dialog-icon-button .material-symbols-outlined {
  font-size: 18px;
}

.canvas-project-empty {
  min-height: 390px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 56px 24px;
  border: 1px dashed #c6ccd7;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.canvas-project-empty:not([hidden]) {
  display: flex;
}

.canvas-project-empty > .material-symbols-outlined {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid #cbd4e3;
  border-radius: 8px;
  background: #edf4ff;
  color: #0058be;
  font-size: 27px;
}

.canvas-project-empty h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.canvas-project-empty p {
  max-width: 420px;
  margin: 8px 0 22px;
  color: #676d79;
  font-size: 12px;
  line-height: 1.6;
}

.canvas-project-context {
  display: flex;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 7px;
}

.canvas-back-symbol {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.canvas-current-project {
  display: flex;
  min-width: 0;
  height: 42px;
  max-width: 250px;
  flex-direction: column;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 18px rgba(25, 28, 31, 0.08);
}

.canvas-current-project span {
  color: #737986;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
}

.canvas-current-project strong {
  overflow: hidden;
  color: #202329;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-project-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 480;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 24, 31, 0.42);
  backdrop-filter: blur(5px);
}

.canvas-project-dialog {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid #d4d9e2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(18, 22, 29, 0.24);
}

.canvas-project-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.canvas-project-dialog h2 {
  margin: 0;
  color: #202329;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
}

.canvas-project-dialog label {
  display: block;
  margin-bottom: 7px;
  color: #555c68;
  font-size: 11px;
  font-weight: 800;
}

.canvas-project-dialog input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid #c9cfd9;
  border-radius: 7px;
  background: #f8f9fb;
  color: #191c1f;
  font-size: 14px;
  letter-spacing: 0;
}

.canvas-project-dialog input:focus {
  border-color: #0058be;
  outline: 3px solid rgba(0, 88, 190, 0.14);
}

.canvas-project-dialog-hint {
  margin: -4px 0 0;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.55;
}

.canvas-project-dialog-hint[hidden] {
  display: none;
}

.canvas-project-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.canvas-project-delete-dialog {
  text-align: center;
}

.canvas-delete-dialog-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 8px;
  background: #ffedea;
  color: #b3261e;
}

.canvas-delete-dialog-icon .material-symbols-outlined {
  font-size: 23px;
}

.canvas-project-delete-dialog p {
  margin: 8px 0 0;
  color: #666d79;
  font-size: 12px;
  line-height: 1.6;
}

.canvas-project-delete-dialog .canvas-project-dialog-actions {
  justify-content: center;
}

.infinite-canvas-viewport {
  --canvas-grid-size: 32px;
  --canvas-grid-x: 0px;
  --canvas-grid-y: 0px;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: #f7f8fb;
  background-image:
    linear-gradient(#dfe3ea 1px, transparent 1px),
    linear-gradient(90deg, #dfe3ea 1px, transparent 1px);
  background-position: var(--canvas-grid-x) var(--canvas-grid-y);
  background-size: var(--canvas-grid-size) var(--canvas-grid-size);
  touch-action: none;
  user-select: none;
}

.infinite-canvas-viewport.is-panning {
  cursor: grabbing !important;
}

.infinite-canvas-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 120000px;
  height: 120000px;
  overflow: visible;
  transform-origin: 50% 50%;
}

.infinite-canvas-viewport.is-transforming .infinite-canvas-world {
  will-change: transform;
}

.canvas-connections {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.canvas-connections .canvas-prompt-arrow path {
  fill: #356fa8;
}

.canvas-connections .canvas-image-arrow path {
  fill: #0f8066;
}

.canvas-connections .canvas-video-arrow path {
  fill: #a24f00;
}

.canvas-connection-line,
.canvas-connection-preview,
.canvas-connection-hit {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.canvas-connection-line {
  stroke: #6d7788;
  stroke-width: 2px;
  transition: stroke 120ms ease, stroke-width 120ms ease;
}

.canvas-connection.is-prompt .canvas-connection-line {
  stroke: #356fa8;
}

.canvas-connection.is-image .canvas-connection-line {
  stroke: #0f8066;
}

.canvas-connection.is-video .canvas-connection-line {
  stroke: #a24f00;
}

.canvas-connection.is-result .canvas-connection-line {
  stroke: #9aa2af;
}

.canvas-connection-hit {
  stroke: transparent;
  stroke-width: 18px;
  cursor: pointer;
  pointer-events: stroke;
}

.canvas-connection:hover .canvas-connection-line,
.canvas-connection.is-selected .canvas-connection-line {
  stroke: #0058be;
  stroke-width: 3px;
}

.canvas-connection.is-image:hover .canvas-connection-line,
.canvas-connection.is-image.is-selected .canvas-connection-line {
  stroke: #08745d;
}

.canvas-connection.is-video:hover .canvas-connection-line,
.canvas-connection.is-video.is-selected .canvas-connection-line {
  stroke: #843f00;
}

.canvas-connection.is-selected .canvas-connection-line {
  filter: drop-shadow(0 0 3px rgba(0, 88, 190, 0.28));
  stroke-width: 4px;
}

.canvas-connection-preview {
  stroke: #356fa8;
  stroke-width: 2.5px;
  stroke-dasharray: 7 6;
  opacity: 0;
  pointer-events: none;
}

.canvas-connection-preview.is-image {
  stroke: #0f8066;
}

.canvas-connection-preview.is-video {
  stroke: #a24f00;
}

.canvas-connection-control {
  overflow: visible;
  pointer-events: all;
}

.canvas-connection-disconnect {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 50%;
  background: #b3261e;
  box-shadow: 0 2px 8px rgba(89, 25, 22, 0.24);
  color: #ffffff;
  cursor: pointer;
}

.canvas-connection-disconnect:hover,
.canvas-connection-disconnect:focus-visible {
  background: #8f211a;
  outline: 2px solid rgba(179, 38, 30, 0.25);
  outline-offset: 2px;
}

.canvas-connection-disconnect .material-symbols-outlined {
  font-size: 16px;
  pointer-events: none;
}

.canvas-connection-preview.is-visible {
  opacity: 1;
}

.canvas-topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.canvas-topbar > * {
  pointer-events: auto;
}

.canvas-brand {
  display: inline-flex;
  width: max-content;
  height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 11px 0 7px;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 18px rgba(25, 28, 31, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.canvas-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

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

.canvas-command,
.canvas-icon-button,
.canvas-tool-button,
.canvas-zoom-controls button {
  border: 1px solid #cfd3dc;
  background: rgba(255, 255, 255, 0.96);
  color: #424754;
  box-shadow: 0 5px 18px rgba(25, 28, 31, 0.08);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.canvas-command:hover,
.canvas-command:focus-visible,
.canvas-icon-button:hover,
.canvas-icon-button:focus-visible,
.canvas-tool-button:hover,
.canvas-tool-button:focus-visible,
.canvas-zoom-controls button:hover,
.canvas-zoom-controls button:focus-visible {
  border-color: #9ba3b2;
  background: #ffffff;
  color: #0058be;
  outline: none;
}

.canvas-command {
  display: inline-flex;
  max-width: 220px;
  height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.canvas-command > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-command .material-symbols-outlined,
.canvas-icon-button .material-symbols-outlined,
.canvas-tool-button .material-symbols-outlined {
  font-size: 19px;
}

.canvas-icon-button,
.canvas-tool-button {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.canvas-toolbar {
  position: absolute;
  top: 72px;
  left: 12px;
  z-index: 28;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: rgba(242, 244, 248, 0.96);
  box-shadow: 0 5px 18px rgba(25, 28, 31, 0.08);
}

.canvas-toolbar .canvas-tool-button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.canvas-tool-button:disabled {
  color: #aeb3bd;
  cursor: default;
}

.canvas-toolbar-divider {
  width: 24px;
  height: 1px;
  align-self: center;
  background: #cfd3dc;
}

.canvas-assets-panel[hidden] {
  display: none !important;
}

.canvas-assets-panel {
  position: absolute;
  top: 72px;
  left: 70px;
  z-index: 29;
  display: flex;
  width: min(390px, calc(100vw - 88px));
  max-height: calc(100% - 84px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cfd3dc;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(25, 28, 31, 0.18);
}

.infinite-canvas-viewport.is-asset-drop-target {
  outline: 2px solid rgba(0, 88, 190, 0.48);
  outline-offset: -3px;
}

.canvas-assets-header,
.canvas-asset-section-heading,
.canvas-asset-generator-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.canvas-assets-header {
  min-height: 62px;
  padding: 12px 14px 10px 16px;
  border-bottom: 1px solid #e2e5eb;
}

.canvas-assets-header h2,
.canvas-asset-section-heading h3 {
  margin: 0;
  color: #191c1f;
}

.canvas-assets-header h2 {
  font-size: 18px;
  line-height: 1.2;
}

.canvas-asset-section-heading h3 {
  font-size: 13px;
  line-height: 1.3;
}

.canvas-assets-eyebrow {
  display: block;
  color: #737987;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-transform: uppercase;
}

.canvas-asset-category-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e5eb;
  background: #f8f9fb;
}

.canvas-asset-category-tab {
  display: inline-flex;
  min-width: 0;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #616774;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.canvas-asset-category-tab:hover,
.canvas-asset-category-tab:focus-visible {
  border-color: #cfd3dc;
  background: #ffffff;
  color: #0058be;
  outline: none;
}

.canvas-asset-category-tab.is-active {
  border-color: #c5d8f4;
  background: #ffffff;
  color: #0058be;
  box-shadow: 0 2px 7px rgba(25, 28, 31, 0.08);
}

.canvas-asset-category-tab.is-generating::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0058be;
  animation: canvas-asset-task-pulse 1.1s ease-in-out infinite;
}

.canvas-asset-category-mark {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.canvas-asset-category-mark.is-props {
  border-radius: 3px;
  color: #0058be;
}

.canvas-asset-category-mark.is-scenes {
  border-radius: 50% 50% 3px 3px;
  color: #08745d;
}

.canvas-asset-category-mark.is-characters {
  border-radius: 50%;
  color: #9b5c00;
}

.canvas-asset-category-mark.is-effects {
  transform: rotate(45deg);
  border-radius: 2px;
  color: #7a4c9d;
}

@keyframes canvas-asset-task-pulse {
  0%, 100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.canvas-asset-generator,
.canvas-asset-library-section {
  padding: 14px 16px;
}

.canvas-asset-generator {
  border-bottom: 1px solid #e2e5eb;
  background: #ffffff;
}

.canvas-asset-generator-meta,
.canvas-asset-count {
  color: #737987;
  font-size: 11px;
  font-weight: 600;
}

.canvas-asset-prompt {
  display: block;
  width: 100%;
  min-height: 78px;
  max-height: 160px;
  margin-top: 12px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid #cfd3dc;
  border-radius: 7px;
  background: #fbfcfe;
  color: #292d34;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
}

.canvas-asset-prompt:focus {
  border-color: #0058be;
  background: #ffffff;
  outline: 2px solid rgba(0, 88, 190, 0.12);
}

.canvas-asset-generator-actions {
  margin-top: 10px;
}

.canvas-asset-generator-actions .canvas-primary-button {
  min-width: 86px;
  height: 34px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
}

.canvas-asset-generator-actions .canvas-primary-button .material-symbols-outlined {
  font-size: 16px;
}

.canvas-asset-status {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 6px;
  background: #f1f5fb;
  color: #4f5d70;
  font-size: 11px;
  line-height: 1.45;
}

.canvas-asset-status.is-error {
  background: #fff0ee;
  color: #a32c24;
}

.canvas-asset-library-section {
  min-height: 0;
  overflow: auto;
}

.canvas-asset-library-section > .canvas-asset-section-heading {
  margin-bottom: 11px;
}

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

.canvas-asset-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe3ea;
  border-radius: 7px;
  background: #ffffff;
}

.canvas-asset-card:hover {
  border-color: #b6c8e4;
  box-shadow: 0 5px 15px rgba(25, 28, 31, 0.09);
}

.canvas-asset-card.is-dragging {
  opacity: 0.52;
}

.canvas-asset-card-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eef1f5;
  cursor: pointer;
}

.canvas-asset-card-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-asset-card-body {
  padding: 9px;
}

.canvas-asset-card-title-row,
.canvas-asset-card-prompt-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.canvas-asset-card-title,
.canvas-asset-card-prompt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-asset-card-title {
  min-width: 0;
  flex: 1;
  color: #292d34;
  font-size: 11px;
  font-weight: 800;
}

.canvas-asset-card-rename-button,
.canvas-asset-card-copy-button {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #737987;
  cursor: pointer;
}

.canvas-asset-card-rename-button:hover,
.canvas-asset-card-rename-button:focus-visible,
.canvas-asset-card-copy-button:hover,
.canvas-asset-card-copy-button:focus-visible {
  background: #edf3fb;
  color: #0058be;
  outline: none;
}

.canvas-asset-card-rename-button .material-symbols-outlined,
.canvas-asset-card-copy-button .material-symbols-outlined {
  font-size: 14px;
}

.canvas-asset-card-copy-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.canvas-asset-card-copy-button {
  overflow: hidden;
}

.canvas-asset-rename-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px 26px;
  gap: 3px;
}

.canvas-asset-rename-input {
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  border: 1px solid #8aaed9;
  border-radius: 4px;
  background: #ffffff;
  color: #292d34;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  outline: 2px solid rgba(0, 88, 190, 0.1);
}

.canvas-asset-rename-form button {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 1px solid #cfd3dc;
  border-radius: 4px;
  background: #ffffff;
  color: #5e6572;
  cursor: pointer;
}

.canvas-asset-rename-form button:hover,
.canvas-asset-rename-form button:focus-visible {
  border-color: #8aaed9;
  color: #0058be;
  outline: none;
}

.canvas-asset-rename-form button:disabled,
.canvas-asset-rename-input:disabled {
  cursor: wait;
  opacity: 0.58;
}

.canvas-asset-rename-form .material-symbols-outlined {
  font-size: 14px;
}

.canvas-asset-card-prompt-row {
  margin-top: 4px;
}

.canvas-asset-card-prompt {
  min-width: 0;
  flex: 1;
  color: #737987;
  font-size: 10px;
}

.canvas-asset-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  gap: 5px;
  margin-top: 8px;
}

.canvas-asset-card-actions button {
  display: inline-flex;
  min-width: 0;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid #cfd3dc;
  border-radius: 5px;
  background: #ffffff;
  color: #424754;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.canvas-asset-card-actions [data-asset-place] {
  gap: 3px;
  padding-inline: 5px;
  white-space: nowrap;
}

.canvas-asset-card-actions [data-asset-place] > span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.canvas-asset-card-actions button:hover,
.canvas-asset-card-actions button:focus-visible {
  border-color: #9ba3b2;
  color: #0058be;
  outline: none;
}

.canvas-asset-card-actions button.is-danger:hover,
.canvas-asset-card-actions button.is-danger:focus-visible {
  border-color: #d9a6a1;
  background: #fff1ef;
  color: #a1332a;
}

.canvas-asset-card-actions .material-symbols-outlined {
  font-size: 15px;
}

.canvas-asset-empty {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  border: 1px dashed #cfd3dc;
  border-radius: 7px;
  color: #737987;
  text-align: center;
}

.canvas-asset-empty .material-symbols-outlined {
  color: #9aa2af;
  font-size: 24px;
}

.canvas-asset-empty strong {
  color: #4d5461;
  font-size: 12px;
}

.canvas-asset-empty span:last-child {
  font-size: 10px;
}

.canvas-asset-grid[hidden],
.canvas-asset-empty[hidden],
.canvas-asset-status[hidden] {
  display: none;
}

.canvas-options-panel {
  position: absolute;
  top: 62px;
  right: 60px;
  z-index: 35;
  width: min(370px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(25, 28, 31, 0.16);
}

.canvas-options-section {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.canvas-options-section + .canvas-options-section,
.canvas-options-row + .canvas-options-section,
.canvas-options-section + .canvas-options-row {
  margin-top: 13px;
}

.canvas-options-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
}

.canvas-options-row .canvas-options-section {
  margin-top: 0;
}

.canvas-options-label {
  color: #616774;
  font-size: 11px;
  font-weight: 700;
}

.canvas-select {
  width: 100%;
  height: 36px;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background: #f7f8fb;
  color: #191c1f;
  font-size: 13px;
  font-weight: 600;
}

.canvas-select:focus {
  border-color: #0058be;
  outline: 2px solid rgba(0, 88, 190, 0.14);
}

.canvas-ratio-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.canvas-ratio-button {
  display: flex;
  min-width: 0;
  height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #d8dbe2;
  border-radius: 6px;
  background: #f7f8fb;
  color: #505663;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.canvas-ratio-button:hover,
.canvas-ratio-button:focus-visible {
  border-color: #9ba3b2;
  outline: none;
}

.canvas-ratio-button.is-active {
  border-color: #0058be;
  background: #eaf1ff;
  color: #0058be;
}

.canvas-ratio-button .material-symbols-outlined {
  font-size: 19px;
}

.canvas-ratio-shape {
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.canvas-ratio-shape.is-square {
  width: 18px;
  height: 18px;
}

.canvas-ratio-shape.is-portrait {
  width: 14px;
  height: 20px;
}

.canvas-ratio-shape.is-landscape {
  width: 21px;
  height: 14px;
}

.canvas-ratio-shape.is-wide {
  width: 23px;
  height: 13px;
}

.canvas-ratio-shape.is-tall {
  width: 12px;
  height: 22px;
}

.canvas-stepper,
.canvas-segmented-options {
  display: grid;
  height: 36px;
  overflow: hidden;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background: #f7f8fb;
}

.canvas-stepper {
  grid-template-columns: 32px 1fr 32px;
}

.canvas-stepper button,
.canvas-segmented-options button {
  min-width: 0;
  background: transparent;
  color: #505663;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.canvas-stepper button:hover,
.canvas-stepper button:focus-visible,
.canvas-segmented-options button:hover,
.canvas-segmented-options button:focus-visible {
  background: #eceef2;
  color: #0058be;
  outline: none;
}

.canvas-stepper output {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #cfd3dc;
  border-left: 1px solid #cfd3dc;
  color: #191c1f;
  font-size: 12px;
  font-weight: 700;
}

.canvas-segmented-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.canvas-segmented-options button + button {
  border-left: 1px solid #cfd3dc;
}

.canvas-segmented-options button.is-active {
  background: #eaf1ff;
  color: #0058be;
}

.canvas-zoom-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 28;
  display: grid;
  grid-template-columns: 36px 58px 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 18px rgba(25, 28, 31, 0.08);
}

.canvas-zoom-controls button {
  width: auto;
  height: 34px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.canvas-zoom-controls button + button {
  border-left: 1px solid #d8dbe2;
}

.canvas-node {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 340px;
  border: 1px solid #c9ced8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(25, 28, 31, 0.12);
  color: #191c1f;
  user-select: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.canvas-node.is-dragging {
  cursor: grabbing;
  transition: none;
  will-change: transform;
}

.canvas-node-header,
.canvas-image-frame,
.canvas-loading-body,
.canvas-prompt-footer {
  touch-action: none;
}

.canvas-connection-port {
  --port-color: #6d7788;
  position: absolute;
  top: 50%;
  z-index: 7;
  width: 24px;
  height: 24px;
  padding: 0;
  transform: translateY(-50%);
  border: 2px solid var(--port-color);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 3px 9px rgba(25, 28, 31, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.72);
  cursor: crosshair;
  opacity: 0.82;
  touch-action: none;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.canvas-connection-input {
  left: -13px;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.canvas-connection-input .material-symbols-outlined {
  display: inline-flex;
  width: 13px;
  height: 13px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 13px;
  overflow: hidden;
  pointer-events: none;
  transform: none !important;
}

.canvas-prompt-node .canvas-prompt-input-port {
  --port-color: #356fa8;
  top: 38%;
  color: var(--port-color);
}

.canvas-prompt-node .canvas-image-input-port {
  --port-color: #0f8066;
  top: 72%;
  color: var(--port-color);
}

.canvas-video-node .canvas-prompt-input-port {
  --port-color: #356fa8;
  top: 28%;
  color: var(--port-color);
}

.canvas-video-node .canvas-image-input-port {
  --port-color: #0f8066;
  top: 50%;
  color: var(--port-color);
}

.canvas-video-node .canvas-video-input-port {
  --port-color: #a24f00;
  top: 62%;
  color: var(--port-color);
}

.canvas-connection-output {
  right: -13px;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-color: #ffffff;
  border-radius: 8px;
  background: var(--port-color);
  color: #ffffff;
}

.canvas-connection-output .material-symbols-outlined {
  font-size: 13px;
  pointer-events: none;
}

.canvas-prompt-node .canvas-prompt-output {
  --port-color: #356fa8;
  top: 38%;
}

.canvas-prompt-node .canvas-image-output {
  --port-color: #0f8066;
  top: 72%;
}

.canvas-image-output {
  --port-color: #0f8066;
}

.canvas-video-output {
  --port-color: #a24f00;
}

.canvas-image-node .canvas-image-output {
  top: 50%;
}

.canvas-video-node .canvas-video-output {
  top: 50%;
}

.canvas-connection-output.is-empty {
  opacity: 0.48;
}

.canvas-node:hover .canvas-connection-port,
.canvas-node.is-selected .canvas-connection-port,
.infinite-canvas-viewport.is-connecting .canvas-connection-port {
  opacity: 1;
}

.canvas-connection-port:hover,
.canvas-connection-port:focus-visible {
  border-color: var(--port-color);
  box-shadow: 0 0 0 4px rgba(0, 88, 190, 0.14), 0 5px 12px rgba(25, 28, 31, 0.2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--port-color) 18%, transparent), 0 5px 12px rgba(25, 28, 31, 0.2);
  outline: none;
  transform: translateY(-50%) scale(1.08);
}

.canvas-image-output:hover,
.canvas-image-output:focus-visible {
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 128, 102, 0.15);
}

.canvas-image-input-port:hover,
.canvas-image-input-port:focus-visible {
  border-color: var(--port-color);
  box-shadow: 0 0 0 4px rgba(15, 128, 102, 0.15);
}

.canvas-video-input-port:hover,
.canvas-video-input-port:focus-visible {
  border-color: var(--port-color);
  box-shadow: 0 0 0 4px rgba(162, 79, 0, 0.16);
}

.canvas-video-output:hover,
.canvas-video-output:focus-visible {
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(162, 79, 0, 0.16);
}

.infinite-canvas-viewport.is-connecting .canvas-prompt-input-port {
  border-color: var(--port-color);
}

.infinite-canvas-viewport.is-connecting .canvas-image-input-port {
  border-color: var(--port-color);
}

.infinite-canvas-viewport.is-connecting .canvas-video-input-port {
  border-color: var(--port-color);
}

.canvas-node.is-connection-source {
  border-color: #0058be;
  box-shadow: 0 0 0 2px rgba(0, 88, 190, 0.14), 0 9px 26px rgba(25, 28, 31, 0.14);
}

.canvas-node.is-connection-target {
  border-color: #07883f;
  box-shadow: 0 0 0 3px rgba(7, 136, 63, 0.18), 0 9px 26px rgba(25, 28, 31, 0.14);
}

.canvas-node.is-selected {
  z-index: 4;
  border-color: #0058be;
  box-shadow: 0 0 0 2px rgba(0, 88, 190, 0.17), 0 9px 26px rgba(25, 28, 31, 0.14);
}

.canvas-node-header {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 7px 0 10px;
  border-bottom: 1px solid #e1e4ea;
  background: #f7f8fb;
  border-radius: 7px 7px 0 0;
}

.canvas-node-drag-handle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 7px;
  color: #616774;
  font-size: 11px;
  font-weight: 700;
  cursor: grab;
  touch-action: none;
}

.canvas-node-drag-handle:active {
  cursor: grabbing;
}

.canvas-node-drag-handle .material-symbols-outlined {
  font-size: 17px;
}

.canvas-node-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-node-icon-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
  color: #616774;
  cursor: pointer;
}

.canvas-node-icon-button:hover,
.canvas-node-icon-button:focus-visible {
  background: #e9ebef;
  color: #0058be;
  outline: none;
}

.canvas-node-world-locate-button {
  color: #4d7561;
}

.canvas-node-world-locate-button:hover,
.canvas-node-world-locate-button:focus-visible {
  background: #eaf6ee;
  color: #1d6140;
}

.canvas-node-icon-button .material-symbols-outlined {
  font-size: 17px;
}

.canvas-prompt-body {
  padding: 10px;
}

.canvas-prompt-input {
  display: block;
  width: 100%;
  min-height: 104px;
  max-height: 240px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: #191c1f;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
  outline: none;
  user-select: text;
}

.canvas-prompt-input::placeholder {
  color: #8a909c;
}

.canvas-prompt-input-wrap {
  position: relative;
  min-width: 0;
  z-index: 12;
}

.canvas-prompt-mention-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: -2px;
  left: -2px;
  z-index: 30;
  max-height: 276px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #c8d3e6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(25, 28, 31, 0.2);
  backdrop-filter: blur(10px);
}

.canvas-prompt-mention-menu[hidden] {
  display: none;
}

.canvas-prompt-mention-heading {
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 2px 5px 5px;
  color: #315b8f;
  font-size: 10px;
  font-weight: 800;
}

.canvas-prompt-mention-heading .material-symbols-outlined {
  font-size: 15px;
}

.canvas-prompt-mention-heading small {
  margin-left: auto;
  color: #8993a5;
  font-size: 9px;
  font-weight: 600;
}

.canvas-prompt-mention-option {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #28303b;
  text-align: left;
  cursor: pointer;
}

.canvas-prompt-mention-option:hover,
.canvas-prompt-mention-option:focus-visible,
.canvas-prompt-mention-option.is-active {
  border-color: #b7c9e3;
  background: #edf4ff;
  outline: none;
}

.canvas-prompt-mention-thumb {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid #d3d9e4;
  border-radius: 6px;
  background: #eef1f5;
  object-fit: cover;
}

.canvas-prompt-mention-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.canvas-prompt-mention-content strong,
.canvas-prompt-mention-content small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-prompt-mention-content strong {
  color: #243b5a;
  font-size: 11px;
  font-weight: 800;
}

.canvas-prompt-mention-content small {
  color: #778396;
  font-size: 9px;
  font-weight: 600;
}

.canvas-prompt-mention-action {
  color: #477db9;
  font-size: 17px;
}

.canvas-prompt-mention-empty {
  padding: 12px 8px;
  color: #7d8795;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}


.canvas-prompt-options {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #e1e4ea;
}

.canvas-prompt-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.canvas-prompt-option-label {
  color: #6b717d;
  font-size: 9px;
  font-weight: 700;
}

.canvas-prompt-option-select {
  width: 100%;
  height: 29px;
  min-width: 0;
  padding: 0 20px 0 7px;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background-color: #f7f8fb;
  color: #343941;
  font-size: 10px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.canvas-prompt-option-select:hover,
.canvas-prompt-option-select:focus {
  border-color: #0058be;
  background-color: #ffffff;
}

.canvas-prompt-option-select:disabled {
  border-color: #e1e4ea;
  background-color: #f1f2f5;
  color: #8a909c;
  cursor: default;
}

.canvas-inheritance-strip {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e1e4ea;
}

.canvas-inheritance-label {
  display: inline-flex;
  height: 24px;
  align-items: center;
  gap: 4px;
  color: #616774;
  font-size: 10px;
  font-weight: 700;
}

.canvas-inheritance-label .material-symbols-outlined {
  font-size: 15px;
}

.canvas-inheritance-chip {
  display: inline-flex;
  min-width: 0;
  max-width: 180px;
  height: 24px;
  align-items: center;
  gap: 3px;
  padding: 0 5px 0 7px;
  border: 1px solid #cbd8eb;
  border-radius: 6px;
  background: #edf4ff;
  color: #174f91;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.canvas-inheritance-chip:hover,
.canvas-inheritance-chip:focus-visible {
  border-color: #0058be;
  background: #e2edff;
  outline: none;
}

.canvas-inheritance-chip.is-image {
  border-color: #b8d9cf;
  background: #eaf7f2;
  color: #0b6652;
}

.canvas-inheritance-chip.is-image:hover,
.canvas-inheritance-chip.is-image:focus-visible {
  border-color: #0f8066;
  background: #ddf2ea;
}

.canvas-inheritance-chip.is-video {
  border-color: #e2c39f;
  background: #fff3e3;
  color: #7d3d00;
}

.canvas-inheritance-chip.is-video:hover,
.canvas-inheritance-chip.is-video:focus-visible {
  border-color: #a24f00;
  background: #ffe9cd;
}

.canvas-inheritance-kind-icon {
  opacity: 0.82;
}

.canvas-inheritance-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-inheritance-chip .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 13px;
}

.canvas-reference-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.canvas-reference-item {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background: #eceef2;
}

.canvas-reference-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-reference-use {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.canvas-reference-use:hover,
.canvas-reference-use:focus-visible {
  outline: 2px solid #6f62e8;
  outline-offset: -2px;
  filter: brightness(1.08);
}

.canvas-reference-use img {
  pointer-events: none;
}

.canvas-reference-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(25, 28, 31, 0.82);
  color: #ffffff;
  cursor: pointer;
  z-index: 2;
}

.canvas-reference-remove .material-symbols-outlined {
  font-size: 12px;
}

.canvas-prompt-footer {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border-top: 1px solid #e1e4ea;
}

.canvas-prompt-meta {
  min-width: 0;
  overflow: hidden;
  color: #6b717d;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-generate-button {
  display: inline-flex;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 6px;
  background: #191c1f;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.canvas-generate-button:hover,
.canvas-generate-button:focus-visible {
  background: #0058be;
  outline: none;
}

.canvas-generate-button:disabled {
  background: #aeb3bd;
  cursor: wait;
}

.canvas-generate-button .material-symbols-outlined {
  font-size: 16px;
}

.canvas-image-node {
  width: 360px;
}

.canvas-video-node {
  width: 420px;
}

.canvas-video-body {
  padding: 10px;
}

.canvas-video-prompt {
  min-height: 92px;
}

.canvas-video-options {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 7px;
  margin-top: 9px;
}

.canvas-video-select {
  width: 100%;
  height: 34px;
  min-width: 0;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background: #ffffff;
  color: #34383f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  outline: none;
}

.canvas-video-select:focus {
  border-color: #a24f00;
  box-shadow: 0 0 0 3px rgba(162, 79, 0, 0.12);
}

.canvas-video-results {
  padding: 10px;
  border-top: 1px solid #e1e4ea;
  background: #f7f8fa;
}

.canvas-video-frame {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background: #17191d;
}

.canvas-video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 320px;
  background: #111317;
  object-fit: contain;
}

.canvas-video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c4c7ce;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.canvas-video-empty .material-symbols-outlined {
  font-size: 34px;
}

.canvas-video-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.canvas-video-frame:hover .canvas-video-actions,
.canvas-video-frame:focus-within .canvas-video-actions {
  opacity: 1;
}

.canvas-prompt-results {
  padding: 10px;
  border-top: 1px solid #e1e4ea;
  background: #f7f8fa;
}

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

.canvas-prompt-result-grid.has-1 {
  grid-template-columns: minmax(0, 1fr);
}

.canvas-prompt-result-grid .canvas-image-frame {
  min-height: 0;
  border-radius: 6px;
}

.canvas-prompt-result-grid .canvas-image-frame img {
  height: 148px;
  min-height: 0;
  object-fit: contain;
}

.canvas-prompt-result-grid.has-1 .canvas-image-frame img {
  height: 280px;
}

.canvas-prompt-result-grid .canvas-image-action {
  width: 30px;
  height: 30px;
}

.canvas-inline-status {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid #c9d8e8;
  border-radius: 6px;
  background: #eef5fb;
  color: #315a7d;
}

.canvas-prompt-results > .canvas-inline-status:first-child {
  margin-top: 0;
}

.canvas-inline-status.is-error {
  border-color: #efc4bf;
  background: #fff1ef;
  color: #9c3028;
}

.canvas-inline-status-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 18px;
  line-height: 18px;
  transform-origin: center;
}

.canvas-inline-status.is-loading .canvas-inline-status-icon {
  animation: canvas-loading-turn 1.4s linear infinite;
}

.canvas-video-status-content {
  min-width: 0;
}

.canvas-inline-status-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.canvas-video-status-label {
  color: inherit;
  font-size: 11px;
  line-height: 1.25;
}

.canvas-video-status-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.canvas-video-elapsed {
  flex: none;
  color: #5d6f7f;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.canvas-inline-status.is-error .canvas-video-elapsed {
  color: #9c3028;
}

.canvas-inline-status-text {
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.canvas-inline-status-cancel {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #bdc9d5;
  border-radius: 6px;
  background: #ffffff;
  color: #4e5965;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.canvas-inline-status-cancel:hover,
.canvas-inline-status-cancel:focus-visible {
  border-color: #9c3028;
  color: #9c3028;
  outline: none;
}

.canvas-video-status-progress {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: #d4e1ed;
}

.canvas-video-status-progress > span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: #3478b7;
  animation: canvas-video-progress 1.6s ease-in-out infinite;
}

.canvas-video-status-progress.is-determinate > span {
  transform: none;
  animation: none;
  transition: width 180ms ease;
}

.canvas-inline-status.is-error .canvas-video-status-progress {
  display: none;
}

@keyframes canvas-video-progress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(310%);
  }
}

.canvas-image-frame {
  position: relative;
  display: block;
  width: 100%;
  min-height: 160px;
  overflow: hidden;
  border-radius: 0 0 7px 7px;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #d9dce2 25%, transparent 25%),
    linear-gradient(-45deg, #d9dce2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dce2 75%),
    linear-gradient(-45deg, transparent 75%, #d9dce2 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  cursor: zoom-in;
}

.canvas-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 160px;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
}

.canvas-image-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.canvas-image-frame:hover .canvas-image-actions,
.canvas-image-frame:focus-visible .canvas-image-actions,
.canvas-image-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
}

.canvas-image-action {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: rgba(25, 28, 31, 0.78);
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.canvas-image-action:hover,
.canvas-image-action:focus-visible {
  background: rgba(0, 88, 190, 0.92);
  outline: none;
}

.canvas-image-action .material-symbols-outlined {
  display: block;
  width: 17px;
  overflow: hidden;
  font-size: 17px;
  line-height: 1;
  white-space: nowrap;
}

.canvas-image-asset-menu {
  position: absolute;
  right: 0;
  bottom: 40px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 154px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  background: rgba(25, 28, 31, 0.9);
  box-shadow: 0 8px 20px rgba(25, 28, 31, 0.24);
  backdrop-filter: blur(8px);
}

.canvas-image-asset-menu[hidden] {
  display: none;
}

.canvas-image-asset-menu-item {
  display: inline-flex;
  min-width: 0;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.canvas-image-asset-menu-item:hover,
.canvas-image-asset-menu-item:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  background: #0058be;
  outline: none;
}

.canvas-image-asset-menu-item .canvas-asset-category-mark {
  width: 7px;
  height: 7px;
}

.canvas-image-duration {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(25, 28, 31, 0.76);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
}

.canvas-image-frame:hover .canvas-image-duration,
.canvas-image-frame:focus-visible .canvas-image-duration {
  opacity: 1;
}

.canvas-loading-node {
  width: 320px;
}

.canvas-loading-body {
  display: flex;
  min-height: 154px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}

.canvas-loading-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eaf1ff;
  color: #0058be;
}

.canvas-loading-icon .material-symbols-outlined {
  font-size: 21px;
  animation: canvas-loading-turn 1.4s linear infinite;
}

.canvas-loading-text {
  max-width: 250px;
  color: #505663;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.canvas-loading-cancel {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background: #ffffff;
  color: #505663;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.canvas-loading-cancel:hover,
.canvas-loading-cancel:focus-visible {
  border-color: #9ba3b2;
  color: #b3261e;
  outline: none;
}

.canvas-error-node .canvas-loading-icon {
  background: #ffedea;
  color: #b3261e;
}

.canvas-error-node .canvas-loading-icon .material-symbols-outlined {
  animation: none;
}

@keyframes canvas-loading-turn {
  to {
    transform: rotate(360deg);
  }
}

.settings-backdrop {
  z-index: 500;
}

.image-preview-backdrop {
  z-index: 550;
}

.toast {
  z-index: 600;
}

.canvas-agent-panel[hidden] {
  display: none !important;
}

.canvas-agent-panel {
  position: absolute;
  top: auto;
  bottom: 14px;
  left: 50%;
  z-index: 30;
  display: block;
  width: min(760px, calc(100vw - 144px));
  overflow: visible;
  pointer-events: none;
  transform: translateX(-50%);
}

.canvas-agent-panel > * {
  pointer-events: auto;
}

.canvas-agent-popover[hidden],
.canvas-agent-result-summary[hidden],
.canvas-agent-execution-status[hidden] {
  display: none !important;
}

.canvas-agent-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  left: 0;
  display: flex;
  max-height: min(68vh, 640px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(25, 28, 31, 0.18);
}

.canvas-agent-popover-header,
.canvas-agent-popover-header-actions,
.canvas-agent-status-row,
.canvas-agent-compose-heading,
.canvas-agent-compose-actions,
.canvas-agent-result-summary,
.canvas-agent-result-summary-copy,
.canvas-agent-result-summary-actions {
  display: flex;
  align-items: center;
}

.canvas-agent-popover-header,
.canvas-agent-status-row,
.canvas-agent-compose-actions,
.canvas-agent-result-summary {
  justify-content: space-between;
}

.canvas-agent-popover-header {
  min-height: 58px;
  gap: 12px;
  padding: 10px 12px 9px 16px;
  border-bottom: 1px solid #e2e5eb;
}

.canvas-agent-popover-header h2 {
  margin: 0;
  color: #191c1f;
  letter-spacing: 0;
  font-size: 16px;
  line-height: 1.2;
}

.canvas-agent-popover-header-actions {
  min-width: 0;
  gap: 8px;
}

.canvas-agent-eyebrow {
  display: block;
  color: #667080;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.canvas-agent-settings-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  overflow: auto;
  padding: 16px;
}

.canvas-agent-compose {
  padding: 12px;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 36px rgba(25, 28, 31, 0.18);
}

.canvas-agent-compose-heading {
  min-width: 0;
  gap: 9px;
  padding: 0 2px;
}

.canvas-agent-compose-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #eaf1ff;
  color: #0058be;
  font-size: 17px;
}

.canvas-agent-compose-heading > div {
  min-width: 0;
}

.canvas-agent-compose-heading strong,
.canvas-agent-compose-heading span:not(.canvas-agent-compose-mark) {
  display: block;
}

.canvas-agent-compose-heading strong {
  color: #242930;
  font-size: 12px;
  line-height: 1.35;
}

.canvas-agent-compose-heading span:not(.canvas-agent-compose-mark) {
  overflow: hidden;
  margin-top: 2px;
  color: #737987;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-agent-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.canvas-agent-field > span {
  color: #5e6673;
  font-size: 10px;
  font-weight: 800;
}

.canvas-agent-field input,
.canvas-agent-field select {
  width: 100%;
  border: 1px solid #cfd3dc;
  border-radius: 6px;
  background: #ffffff;
  color: #292d34;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0;
  outline: none;
}

.canvas-agent-field input,
.canvas-agent-field select {
  height: 34px;
  padding: 0 9px;
}

.canvas-agent-field input:focus,
.canvas-agent-field select:focus {
  border-color: #0058be;
  box-shadow: 0 0 0 2px rgba(0, 88, 190, 0.11);
}

.canvas-agent-theme-field {
  display: block;
  margin-top: 8px;
}

.canvas-agent-theme-field textarea {
  width: 100%;
  min-height: 58px;
  max-height: 150px;
  padding: 8px 2px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: #292d34;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0;
  outline: none;
}

.canvas-agent-theme-field textarea::placeholder {
  color: #9aa1ad;
}

.canvas-agent-status {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #d6e2f2;
  border-radius: 6px;
  background: #f3f7fc;
}

.canvas-agent-status.is-error {
  border-color: #efc5c0;
  background: #fff3f1;
  color: #a32c24;
}

.canvas-agent-status.is-canceled {
  border-color: #e3d5b8;
  background: #fff9ec;
  color: #806022;
}

.canvas-agent-status.is-complete {
  border-color: #c7e5d2;
  background: #f1fbf4;
}

.canvas-agent-status-row {
  gap: 12px;
  color: #4f5d70;
  font-size: 10px;
  font-weight: 700;
}

.canvas-agent-status-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.canvas-agent-retry-failed {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  border: 1px solid #a32c24;
  border-radius: 5px;
  background: #ffffff;
  color: #a32c24;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

.canvas-agent-retry-failed[hidden] {
  display: none;
}

.canvas-agent-retry-failed:hover,
.canvas-agent-retry-failed:focus-visible {
  background: #fde8e5;
  outline: none;
}

.canvas-agent-retry-failed .material-symbols-outlined {
  font-size: 14px;
}

.canvas-agent-tasks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.canvas-agent-tasks li {
  display: flex;
  height: 26px;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid #dfe5ed;
  border-radius: 5px;
  background: #ffffff;
  color: #8b93a0;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-agent-task-marker {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  align-items: center;
  justify-content: center;
  color: #a6afbc;
  font-size: 13px;
}

.canvas-agent-tasks li > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-agent-task-retry {
  display: inline-flex;
  height: 20px;
  margin-left: auto;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

.canvas-agent-task-retry:hover,
.canvas-agent-task-retry:focus-visible {
  background: rgba(163, 44, 36, 0.1);
  outline: none;
}

.canvas-agent-task-retry .material-symbols-outlined {
  font-size: 13px;
}

.canvas-agent-tasks li.is-succeeded {
  border-color: #bcdcc8;
  background: #f4fbf6;
  color: #247a48;
}

.canvas-agent-tasks li.is-succeeded .canvas-agent-task-marker {
  color: #247a48;
}

.canvas-agent-tasks li.is-running {
  border-color: #aebed2;
  background: #eef4fb;
  color: #0058be;
  font-weight: 800;
}

.canvas-agent-tasks li.is-running .canvas-agent-task-marker {
  color: #0058be;
}

.canvas-agent-tasks li.is-running .canvas-agent-task-marker {
  animation: canvas-agent-stage-spin 1.2s linear infinite;
}

.canvas-agent-tasks li.is-failed {
  border-color: #efc5c0;
  background: #fff3f1;
  color: #a32c24;
}

.canvas-agent-tasks li.is-failed .canvas-agent-task-marker {
  color: #a32c24;
}

.canvas-agent-tasks li.is-canceled {
  border-color: #e3d5b8;
  background: #fff9ec;
  color: #806022;
}

.canvas-agent-tasks li.is-canceled .canvas-agent-task-marker {
  color: #806022;
}

.canvas-agent-tasks li.is-failed .canvas-agent-task-marker,
.canvas-agent-tasks li.is-canceled .canvas-agent-task-marker {
  animation: none;
}

@keyframes canvas-agent-stage-spin {
  to {
    transform: rotate(360deg);
  }
}

.canvas-agent-progress {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: #dce5f1;
}

.canvas-agent-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #0058be;
  transition: width 180ms ease;
}

.canvas-agent-generate-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #0058be;
  color: #ffffff;
  cursor: pointer;
}

.canvas-agent-generate-button:hover,
.canvas-agent-generate-button:focus-visible {
  background: #004b9f;
  outline: none;
}

.canvas-agent-generate-button.is-cancel {
  background: #b3261e;
}

.canvas-agent-generate-button .material-symbols-outlined {
  font-size: 20px;
}

.canvas-agent-compose-actions {
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid #e7e9ee;
}

.canvas-agent-settings-button {
  display: flex;
  min-width: 0;
  height: 40px;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #555d69;
  cursor: pointer;
  text-align: left;
}

.canvas-agent-settings-button:hover,
.canvas-agent-settings-button:focus-visible,
.canvas-agent-settings-button.is-open {
  background: #f2f4f8;
  color: #0058be;
  outline: none;
}

.canvas-agent-settings-button > .material-symbols-outlined:first-child {
  flex: 0 0 auto;
  font-size: 18px;
}

.canvas-agent-settings-button > div {
  min-width: 0;
  flex: 1;
}

.canvas-agent-settings-button strong,
.canvas-agent-settings-button div span {
  display: block;
}

.canvas-agent-settings-button strong {
  font-size: 10px;
  line-height: 1.3;
}

.canvas-agent-settings-button div span {
  overflow: hidden;
  margin-top: 2px;
  color: #7a818d;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-agent-settings-chevron {
  flex: 0 0 auto;
  font-size: 17px;
  transition: transform 140ms ease;
}

.canvas-agent-settings-button.is-open .canvas-agent-settings-chevron {
  transform: rotate(180deg);
}

.canvas-agent-result-summary {
  gap: 12px;
  margin-bottom: 8px;
  padding: 9px 10px 9px 12px;
  border: 1px solid #cfd3dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(25, 28, 31, 0.14);
}

.canvas-agent-result-summary-copy {
  min-width: 0;
  flex: 1;
  gap: 8px;
}

.canvas-agent-result-summary-copy > .material-symbols-outlined {
  color: #247a48;
  font-size: 20px;
}

.canvas-agent-result-summary-copy > div {
  min-width: 0;
}

.canvas-agent-version-control {
  display: flex;
  min-width: 62px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 3px;
  margin-left: 4px;
}

.canvas-agent-version-control > span {
  color: #7a818d;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.canvas-agent-version-control select {
  height: 24px;
  max-width: 82px;
  padding: 0 5px;
  border: 1px solid #cfd3dc;
  border-radius: 5px;
  background: #ffffff;
  color: #4f5866;
  font: inherit;
  font-size: 9px;
  letter-spacing: 0;
  outline: none;
}

.canvas-agent-version-control select:focus-visible {
  border-color: #0058be;
  box-shadow: 0 0 0 2px rgba(0, 88, 190, 0.11);
}

.canvas-agent-result-summary-copy strong,
.canvas-agent-result-summary-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-agent-result-summary-copy strong {
  color: #292d34;
  font-size: 11px;
}

.canvas-agent-result-summary-copy span {
  margin-top: 2px;
  color: #737987;
  font-size: 9px;
}

.canvas-agent-result-summary-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.canvas-agent-result-summary-actions button {
  height: 34px;
}

.canvas-agent-result-summary-actions .canvas-secondary-button,
.canvas-agent-result-summary-actions .canvas-primary-button {
  gap: 5px;
  padding: 0 10px;
  white-space: nowrap;
}

.canvas-agent-result-summary-actions .material-symbols-outlined {
  font-size: 16px;
}

.canvas-agent-result-summary-actions #canvas-agent-execute.is-running .material-symbols-outlined {
  animation: canvas-agent-stage-spin 1.2s linear infinite;
}

.canvas-agent-change-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 11px;
  border: 1px solid #d3dfeb;
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 8px 22px rgba(25, 28, 31, 0.09);
}

.canvas-agent-change-heading {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.canvas-agent-change-heading > .material-symbols-outlined {
  color: #0058be;
  font-size: 18px;
}

.canvas-agent-change-heading strong,
.canvas-agent-change-heading span:last-child {
  display: block;
}

.canvas-agent-change-heading strong {
  color: #293b50;
  font-size: 11px;
}

.canvas-agent-change-heading span:last-child {
  margin-top: 3px;
  color: #6b7787;
  font-size: 9px;
  line-height: 1.45;
}

.canvas-agent-change-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.canvas-agent-change-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 0 7px;
  border: 1px solid #cbd9e8;
  border-radius: 5px;
  background: #ffffff;
  color: #4a6078;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
}

button.canvas-agent-change-item {
  cursor: pointer;
}

button.canvas-agent-change-item:hover,
button.canvas-agent-change-item:focus-visible {
  border-color: #0058be;
  color: #0058be;
  outline: none;
}

.canvas-agent-change-item .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 14px;
}

.canvas-agent-change-item.is-added {
  border-color: #b9dfc5;
  background: #f4fbf6;
  color: #247a48;
}

.canvas-agent-change-item.is-changed {
  border-color: #bfd5ee;
  background: #f3f8fe;
  color: #0058be;
}

.canvas-agent-change-item.is-removed {
  border-color: #edd0cb;
  background: #fff6f4;
  color: #9a3d2c;
}

.canvas-agent-change-more {
  color: #778493;
  font-size: 9px;
}

.canvas-agent-change-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid #e1e8ef;
  color: #55697d;
  font-size: 9px;
  font-weight: 750;
}

.canvas-agent-change-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.canvas-agent-change-actions .canvas-primary-button,
.canvas-agent-change-actions .canvas-secondary-button {
  min-height: 27px;
  padding: 0 8px;
  font-size: 9px;
}

.canvas-agent-execution-status {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 10px 28px rgba(25, 28, 31, 0.11);
}

.canvas-agent-execution-header,
.canvas-agent-execution-heading,
.canvas-agent-execution-current,
.canvas-agent-execution-decision > div {
  display: flex;
  align-items: center;
}

.canvas-agent-execution-header {
  justify-content: space-between;
  gap: 10px;
}

.canvas-agent-execution-heading {
  min-width: 0;
  gap: 8px;
}

.canvas-agent-execution-heading > .material-symbols-outlined {
  flex: 0 0 auto;
  color: #0058be;
  font-size: 20px;
}

.canvas-agent-execution-heading > div {
  min-width: 0;
}

.canvas-agent-execution-heading strong,
.canvas-agent-execution-heading span,
.canvas-agent-execution-current strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-agent-execution-heading strong {
  color: #292d34;
  font-size: 11px;
}

.canvas-agent-execution-heading div span {
  margin-top: 2px;
  color: #737987;
  font-size: 9px;
}

.canvas-agent-execution-progress {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 3px;
  background: #dce5f1;
}

.canvas-agent-execution-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #0058be;
  transition: width 180ms ease;
}

.canvas-agent-execution-current {
  min-width: 0;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: #68707d;
  font-size: 9px;
}

.canvas-agent-execution-current strong {
  min-width: 0;
  color: #343941;
  font-size: 10px;
  text-align: right;
}

.canvas-agent-execution-decision {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #ead1cf;
}

.canvas-agent-execution-decision > span {
  display: block;
  color: #a32c24;
  font-size: 9px;
  line-height: 1.45;
}

.canvas-agent-execution-decision > div {
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.canvas-agent-execution-decision button {
  height: 30px;
  gap: 4px;
  padding: 0 9px;
  white-space: nowrap;
}

.canvas-agent-execution-decision .material-symbols-outlined {
  font-size: 15px;
}

.canvas-agent-execution-status.is-error {
  border-color: #dfb7b3;
  background: #fff9f8;
}

.canvas-agent-execution-status.is-error .canvas-agent-execution-heading > .material-symbols-outlined {
  color: #b3261e;
}

.canvas-agent-execution-status.is-canceled {
  border-color: #dfd1af;
  background: #fffaf0;
}

.canvas-agent-execution-status.is-complete {
  border-color: #b8d8c2;
  background: #f7fcf8;
}

.canvas-agent-execution-status.is-complete .canvas-agent-execution-heading > .material-symbols-outlined,
.canvas-agent-execution-status.is-complete .canvas-agent-execution-current strong {
  color: #247a48;
}

.canvas-agent-execution-status.is-complete .canvas-agent-execution-progress > span {
  background: #247a48;
}

.canvas-agent-result-scroll {
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}

.canvas-agent-plan-meta {
  flex: 0 0 auto;
  color: #68707d;
  font-size: 9px;
  font-weight: 700;
}

.canvas-agent-logline {
  margin: 14px 0 0;
  color: #343941;
  font-size: 12px;
  line-height: 1.6;
}

.canvas-agent-plan-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.canvas-agent-plan-stat {
  min-width: 0;
  padding: 8px 5px;
  border: 1px solid #e0e4ea;
  border-radius: 6px;
  background: #f8f9fb;
  text-align: center;
}

.canvas-agent-plan-stat strong,
.canvas-agent-plan-stat span {
  display: block;
}

.canvas-agent-plan-stat strong {
  color: #242930;
  font-size: 14px;
  line-height: 1.2;
}

.canvas-agent-plan-stat span {
  margin-top: 3px;
  overflow: hidden;
  color: #737987;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-agent-plan-sections {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.canvas-agent-plan-section {
  border: 1px solid #dfe3ea;
  border-radius: 7px;
  background: #ffffff;
}

.canvas-agent-plan-section summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  color: #343941;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}

.canvas-agent-plan-section summary::-webkit-details-marker {
  display: none;
}

.canvas-agent-plan-section summary span:last-child {
  color: #737987;
  font-size: 9px;
}

.canvas-agent-plan-section-body {
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border-top: 1px solid #e5e8ed;
  color: #4e5561;
  font-size: 10px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.canvas-agent-plan-list {
  display: grid;
  gap: 6px;
}

.canvas-agent-plan-list-item {
  padding: 8px;
  border-radius: 6px;
  background: #f7f8fa;
}

.canvas-agent-plan-list-item strong {
  display: block;
  margin-bottom: 3px;
  color: #292d34;
  font-size: 10px;
}

.canvas-document-node {
  border-color: #b9c8dc;
}

.canvas-document-node .canvas-node-header {
  background: #eef4fb;
}

.canvas-document-body {
  padding: 12px;
}

.canvas-document-content {
  display: block;
  width: 100%;
  min-height: 150px;
  max-height: 360px;
  padding: 0;
  resize: vertical;
  border: 0;
  background: transparent;
  color: #343941;
  font: inherit;
  font-size: 11px;
  line-height: 1.65;
  letter-spacing: 0;
  outline: none;
  user-select: text;
}

.canvas-document-meta {
  padding: 8px 12px;
  border-top: 1px solid #e2e5eb;
  color: #68707d;
  font-size: 9px;
  font-weight: 700;
}

.canvas-document-node .canvas-prompt-output {
  --port-color: #356fa8;
  top: 50%;
}

@media (max-width: 1100px) {
  :root {
    --workspace-mode-switch-reserve: 108px;
  }

  .global-workspace-mode-switch .workspace-mode-button {
    width: 30px;
    padding: 0;
  }

  .global-workspace-mode-switch .workspace-mode-label {
    display: none;
  }
}

@media (max-width: 760px) {

  #generation-workspace .generation-top-options {
    gap: 4px;
  }

  #generation-workspace #image-model-control .option-trigger {
    max-width: 104px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .canvas-library-topbar {
    grid-template-columns: minmax(90px, 1fr) auto;
    gap: 10px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .canvas-project-library-main {
    width: calc(100% - 32px);
    padding-top: 34px;
  }

  .canvas-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .canvas-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .canvas-current-project {
    max-width: 150px;
  }

  .canvas-brand {
    width: 42px;
    padding: 0 6px;
  }

  .canvas-brand span {
    display: none;
  }

  .canvas-options-button {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .canvas-options-button > span:last-child {
    display: none;
  }

  .canvas-options-panel {
    right: 12px;
  }

  .canvas-assets-panel {
    left: 60px;
    width: min(360px, calc(100vw - 72px));
  }

  .canvas-agent-panel {
    bottom: 56px;
    width: min(620px, calc(100vw - 80px));
  }

  .world-agent-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .world-agent-topbar-center {
    display: none;
  }

  .world-agent-main {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .world-agent-map-column {
    grid-template-rows: auto minmax(360px, 58vh) 196px;
  }

  .world-agent-inspector {
    min-height: 280px;
  }

  .world-agent-agent-host {
    padding-right: 8px;
    padding-left: 8px;
  }

  .world-agent-agent-host .canvas-agent-panel {
    width: 100%;
  }

  .canvas-agent-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .canvas-agent-tasks li {
    font-size: 8px;
  }

  .canvas-toolbar {
    top: 66px;
  }
}

/* World Agent: Jimeng-inspired conversation workspace */
.world-agent-dream {
  display: block;
  overflow: hidden;
  background: #f5f6f8;
  color: #17191d;
}

.world-agent-dream .world-agent-topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 76px;
  z-index: 35;
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 22px;
  border: 0;
  background: rgba(245, 246, 248, 0.92);
  backdrop-filter: blur(14px);
}

.world-agent-dream .world-agent-topbar-center {
  display: none;
}

.world-agent-dream .canvas-project-context {
  min-width: 0;
}

.world-agent-dream .canvas-current-project {
  display: none;
}

.world-agent-dream .world-agent-topbar .canvas-icon-button {
  border-color: #e3e5e8;
  background: rgba(255, 255, 255, 0.9);
}

.world-agent-dream-layout,
.world-agent-workspace.is-context-collapsed .world-agent-dream-layout {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  overflow: hidden;
  background: #f5f6f8;
}

.world-agent-dream .world-agent-agent-sidebar {
  position: relative;
  z-index: 40;
  display: flex;
  padding: 20px 10px 14px;
  border-right: 1px solid #e8eaed;
  background: #fafbfc;
}

.world-agent-dream .world-agent-agent-sidebar-brand {
  justify-content: center;
  min-height: 38px;
  padding: 0 0 32px;
}

.world-agent-dream .world-agent-agent-sidebar-brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

.world-agent-dream .world-agent-new-conversation-button {
  width: 44px;
  height: 40px;
  min-height: 40px;
  margin: 0 auto 18px;
  padding: 0;
  border-color: #d7ebef;
  background: #effafb;
  color: #1395a1;
  box-shadow: none;
}

.world-agent-dream .world-agent-new-conversation-button:hover,
.world-agent-dream .world-agent-new-conversation-button:focus-visible {
  background: #def5f7;
  color: #0b7882;
}

.world-agent-dream .world-agent-new-conversation-button > span:last-child {
  display: none;
}

.world-agent-dream .world-agent-agent-nav {
  gap: 12px;
}

.world-agent-dream .world-agent-agent-nav button,
.world-agent-dream .world-agent-sidebar-canvas-button,
.world-agent-dream .world-agent-agent-sidebar-footer button {
  display: grid;
  width: 54px;
  min-height: 50px;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 7px 2px 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #33383e;
  font: inherit;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.world-agent-dream .world-agent-sidebar-canvas-button {
  margin-top: 12px;
}

.world-agent-dream .world-agent-agent-nav button:hover,
.world-agent-dream .world-agent-agent-nav button:focus-visible,
.world-agent-dream .world-agent-agent-nav button.is-active,
.world-agent-dream .world-agent-sidebar-canvas-button:hover,
.world-agent-dream .world-agent-sidebar-canvas-button:focus-visible,
.world-agent-dream .world-agent-agent-sidebar-footer button:hover,
.world-agent-dream .world-agent-agent-sidebar-footer button:focus-visible {
  border: 0;
  background: #eef0f2;
  color: #111315;
  outline: none;
}

.world-agent-dream .world-agent-agent-nav .material-symbols-outlined,
.world-agent-dream .world-agent-sidebar-canvas-button .material-symbols-outlined,
.world-agent-dream .world-agent-agent-sidebar-footer .material-symbols-outlined {
  font-size: 20px;
}

.world-agent-dream .world-agent-agent-nav-count {
  position: absolute;
  transform: translate(14px, -4px);
  min-width: 14px;
  padding: 1px 4px;
  border: 1px solid #ffffff;
  background: #18a9b5;
  color: #ffffff;
  font-size: 8px;
}

.world-agent-dream .world-agent-agent-sidebar-footer {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 0;
}

.world-agent-dream .world-agent-agent-sidebar-footer button span:last-child {
  display: none;
}

.world-agent-dream .world-agent-chat-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  background: #f5f6f8;
}

.world-agent-dream .world-agent-chat-header {
  position: relative;
  z-index: 36;
  min-height: 64px;
  padding: 0 22px 0 64px;
  border: 0;
  background: transparent;
}

.world-agent-dream .world-agent-chat-heading {
  margin-left: 6px;
}

.world-agent-dream .world-agent-chat-heading > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.world-agent-dream .world-agent-chat-heading strong {
  max-width: 360px;
  overflow: hidden;
  color: #24272b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-dream .world-agent-chat-heading > div > span:first-child {
  color: #969ba2;
  font-size: 10px;
}

.world-agent-dream .world-agent-chat-header-actions {
  margin-left: auto;
  gap: 5px;
}

.world-agent-dream .world-agent-chat-status {
  margin-right: 7px;
}

.world-agent-dream .world-agent-chat-icon-button {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.world-agent-dream .world-agent-chat-scroll {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  padding: max(60px, 9vh) clamp(20px, 7vw, 110px) 34px;
}

.world-agent-dream .world-agent-agent-welcome {
  width: min(100%, 1000px);
  max-width: none;
  margin: 0 auto 30px;
}

.world-agent-dream .world-agent-agent-welcome h1 {
  color: #17191d;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
}

.world-agent-dream .world-agent-agent-welcome h1 span {
  color: #11a7b4;
}

.world-agent-dream .world-agent-agent-welcome p {
  max-width: 680px;
  margin-top: 10px;
  color: #8a9098;
  font-size: 12px;
}

.world-agent-dream .world-agent-conversation-host {
  width: min(100%, 1000px);
  margin: 0 auto;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-panel {
  display: flex;
  flex-direction: column;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-compose {
  order: 1;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid #e0e3e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(28, 34, 40, 0.05);
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-compose-heading {
  display: none;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-theme-field {
  margin: 0;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-theme-field textarea {
  min-height: 118px;
  max-height: 260px;
  padding: 18px 20px 10px;
  resize: none;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.65;
  box-shadow: none;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-theme-field textarea:focus {
  border: 0;
  box-shadow: none;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-compose:focus-within {
  border-color: #b9dfe3;
  box-shadow: 0 0 0 3px rgba(17, 167, 180, 0.08);
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-compose-actions {
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
  padding: 10px 14px 13px;
  border: 0;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-settings-button,
.world-agent-dream .world-agent-compose-option {
  display: inline-flex;
  width: auto;
  min-height: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #edf0f2;
  border-radius: 6px;
  background: #ffffff;
  color: #4d535a;
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-settings-button:hover,
.world-agent-dream .world-agent-conversation-host .canvas-agent-settings-button:focus-visible,
.world-agent-dream .world-agent-compose-option:hover,
.world-agent-dream .world-agent-compose-option:focus-visible {
  border-color: #d6e9eb;
  background: #f4fbfc;
  color: #0a858f;
  outline: none;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-settings-button > .material-symbols-outlined,
.world-agent-dream .world-agent-compose-option .material-symbols-outlined {
  font-size: 15px;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-settings-button > div {
  display: flex;
  align-items: center;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-settings-button strong {
  font-size: 10px;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-settings-button div span {
  display: none;
}

.world-agent-dream .canvas-agent-settings-chevron {
  font-size: 15px;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-generate-button {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  margin-left: auto;
  background: #d9dcdf;
  color: #ffffff;
}

.world-agent-dream.has-composer-input .world-agent-conversation-host .canvas-agent-generate-button,
.world-agent-dream .world-agent-conversation-host .canvas-agent-generate-button.is-cancel {
  background: #17a8b4;
}

.world-agent-dream.has-composer-input .world-agent-conversation-host .canvas-agent-generate-button:hover,
.world-agent-dream.has-composer-input .world-agent-conversation-host .canvas-agent-generate-button:focus-visible {
  background: #0c8d98;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-popover {
  right: 0;
  bottom: calc(100% + 9px);
  left: 0;
  z-index: 10;
  border-color: #e1e4e7;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(20, 25, 30, 0.14);
}

.world-agent-skill-showcase {
  display: grid;
  width: min(100%, 1000px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 38px auto 0;
}

.world-agent-skill-showcase button {
  display: flex;
  min-width: 0;
  min-height: 70px;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid #eceef1;
  border-radius: 8px;
  background: #ffffff;
  color: #22262b;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.world-agent-skill-showcase button:hover,
.world-agent-skill-showcase button:focus-visible {
  border-color: #cce5e8;
  background: #fbfefe;
  box-shadow: 0 6px 16px rgba(34, 55, 60, 0.05);
  outline: none;
}

.world-agent-skill-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  font-size: 20px;
}

.world-agent-skill-icon.is-world { background: #1ca6b3; }
.world-agent-skill-icon.is-scene { background: #4f79c8; }
.world-agent-skill-icon.is-shot { background: #8658ad; }
.world-agent-skill-icon.is-check { background: #c87a3e; }

.world-agent-skill-showcase button > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.world-agent-skill-showcase strong,
.world-agent-skill-showcase small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-skill-showcase strong {
  font-size: 11px;
}

.world-agent-skill-showcase small {
  color: #8b9199;
  font-size: 9px;
}

.world-agent-dream .world-agent-chat-quick-actions {
  width: min(100%, 1000px);
  max-width: none;
  padding: 8px 20px 14px;
}

.world-agent-dream:not(.is-conversation) .world-agent-chat-quick-actions {
  display: none;
}

.world-agent-dream.is-conversation .world-agent-chat-scroll {
  padding-top: 24px;
}

.world-agent-dream.is-conversation .world-agent-skill-showcase {
  display: none;
}

.world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-conversation { order: 1; }
.world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-result-summary { order: 2; }
.world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-change-summary { order: 3; }
.world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-execution-status { order: 4; }
.world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-compose {
  position: sticky;
  bottom: 0;
  z-index: 8;
  order: 10;
  margin-top: 24px;
}

.world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-theme-field textarea {
  min-height: 72px;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-conversation {
  margin: 0;
  padding: 0;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-conversation-heading {
  display: none;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-messages {
  gap: 18px;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-message {
  max-width: min(80%, 720px);
  padding: 13px 15px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
}

.world-agent-dream .world-agent-conversation-host .canvas-agent-message.is-user {
  background: #eaf8f9;
}

.world-agent-context-scrim {
  position: absolute;
  inset: 0;
  z-index: 44;
  border: 0;
  background: rgba(24, 28, 32, 0.18);
  cursor: default;
}

.world-agent-dream .world-agent-context-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  width: min(380px, calc(100vw - 76px));
  border-left: 1px solid #e1e4e7;
  background: #fafbfc;
  box-shadow: -16px 0 40px rgba(26, 31, 36, 0.12);
  transform: translateX(0);
  transition: transform 180ms ease;
}

.world-agent-dream.is-context-collapsed .world-agent-context-panel {
  display: grid;
  pointer-events: none;
  transform: translateX(100%);
}

.world-agent-dream.is-context-collapsed .world-agent-context-scrim {
  display: none;
}

.world-agent-dream .world-agent-context-header {
  padding-top: 20px;
}

@media (max-width: 980px) {
  .world-agent-skill-showcase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .world-agent-dream-layout,
  .world-agent-workspace.is-context-collapsed .world-agent-dream-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .world-agent-dream .world-agent-agent-sidebar {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    min-height: 58px;
    flex-direction: row;
    justify-content: center;
    padding: 4px 8px;
    border-top: 1px solid #e5e7ea;
    border-right: 0;
  }

  .world-agent-dream .world-agent-agent-sidebar-brand,
  .world-agent-dream .world-agent-new-conversation-button,
  .world-agent-dream .world-agent-sidebar-canvas-button,
  .world-agent-dream .world-agent-agent-sidebar-footer {
    display: none;
  }

  .world-agent-dream .world-agent-agent-nav {
    display: flex;
    width: 100%;
    justify-content: space-around;
    gap: 2px;
  }

  .world-agent-dream .world-agent-agent-nav button {
    width: 72px;
    min-height: 48px;
  }

  .world-agent-dream .world-agent-topbar {
    left: 0;
    padding: 8px 12px;
  }

  .world-agent-dream .world-agent-chat-stage {
    padding-bottom: 58px;
  }

  .world-agent-dream .world-agent-chat-header {
    padding: 0 10px 0 48px;
  }

  .world-agent-dream .world-agent-chat-status,
  .world-agent-dream #world-agent-clear-chat-button,
  .world-agent-dream #world-agent-chat-settings-button {
    display: none;
  }

  .world-agent-dream .world-agent-chat-scroll {
    padding: 44px 14px 24px;
  }

  .world-agent-dream .world-agent-agent-welcome h1 {
    font-size: 23px;
  }

  .world-agent-skill-showcase {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .world-agent-dream .world-agent-conversation-host .canvas-agent-compose-actions {
    flex-wrap: wrap;
  }

  .world-agent-dream .world-agent-compose-option {
    display: none;
  }

  .world-agent-dream .world-agent-context-panel {
    width: min(360px, 92vw);
  }
}

/* World Agent conversation-first workspace */
.world-agent-agent-main {
  display: grid;
  min-height: 0;
  grid-template-columns: 224px minmax(0, 1fr) 310px;
  overflow: hidden;
  background: #f5f6f8;
}

.world-agent-workspace.is-context-collapsed .world-agent-agent-main {
  grid-template-columns: 224px minmax(0, 1fr);
}

.world-agent-workspace.is-context-collapsed .world-agent-context-panel {
  display: none;
}

.world-agent-agent-sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 22px 14px 14px;
  border-right: 1px solid #e1e3e8;
  background: #eef0f3;
}

.world-agent-agent-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px 20px;
}

.world-agent-agent-sidebar-brand > div {
  display: grid;
  gap: 3px;
}

.world-agent-agent-sidebar-brand strong {
  color: #17191d;
  font-size: 15px;
  font-weight: 850;
}

.world-agent-agent-orb {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #cfd5df;
  border-radius: 10px;
  background: #ffffff;
  color: #3168d8;
  font-size: 19px;
  box-shadow: 0 3px 10px rgba(36, 47, 70, 0.08);
}

.world-agent-new-conversation-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 4px 18px;
  border: 1px solid #1858c9;
  border-radius: 7px;
  background: #2168df;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(33, 104, 223, 0.18);
}

.world-agent-new-conversation-button:hover,
.world-agent-new-conversation-button:focus-visible {
  background: #1756c2;
  outline: none;
}

.world-agent-new-conversation-button .material-symbols-outlined {
  font-size: 17px;
}

.world-agent-agent-nav {
  display: grid;
  gap: 3px;
}

.world-agent-agent-nav button,
.world-agent-agent-sidebar-footer button,
.world-agent-agent-history > button {
  display: flex;
  width: 100%;
  min-height: 35px;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #59616e;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.world-agent-agent-nav button:hover,
.world-agent-agent-nav button:focus-visible,
.world-agent-agent-nav button.is-active,
.world-agent-agent-sidebar-footer button:hover,
.world-agent-agent-sidebar-footer button:focus-visible,
.world-agent-agent-history > button:hover,
.world-agent-agent-history > button:focus-visible,
.world-agent-agent-history > button.is-current {
  border-color: #d9dee7;
  background: #ffffff;
  color: #1f2c42;
  outline: none;
}

.world-agent-agent-nav .material-symbols-outlined,
.world-agent-agent-sidebar-footer .material-symbols-outlined,
.world-agent-agent-history > button > .material-symbols-outlined {
  font-size: 17px;
}

.world-agent-agent-nav-count {
  min-width: 19px;
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 10px;
  background: #e3e8f1;
  color: #6e7786;
  font-size: 9px;
  text-align: center;
}

.world-agent-agent-sidebar-divider {
  height: 1px;
  margin: 16px 8px 14px;
  background: #dfe2e7;
}

.world-agent-agent-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 7px;
  color: #9097a3;
  font-size: 10px;
  font-weight: 800;
}

.world-agent-agent-history-heading button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #7d8591;
  cursor: pointer;
}

.world-agent-agent-history-heading button:hover,
.world-agent-agent-history-heading button:focus-visible {
  background: #ffffff;
  outline: none;
}

.world-agent-agent-history {
  display: grid;
  gap: 4px;
}

.world-agent-agent-history > button {
  min-height: 46px;
}

.world-agent-agent-history-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.world-agent-agent-history-copy strong,
.world-agent-agent-history-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-agent-history-copy strong {
  color: inherit;
  font-size: 10px;
}

.world-agent-agent-history-copy span {
  color: #8b939f;
  font-size: 9px;
  font-weight: 600;
}

.world-agent-agent-history-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4baf78;
}

.world-agent-agent-sidebar-footer {
  display: grid;
  gap: 3px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #dfe2e7;
}

.world-agent-chat-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 62px minmax(0, 1fr) auto;
  background: #ffffff;
}

.world-agent-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid #eceef2;
  background: rgba(255, 255, 255, 0.96);
}

.world-agent-chat-heading,
.world-agent-chat-header-actions,
.world-agent-chat-status {
  display: flex;
  align-items: center;
}

.world-agent-chat-heading {
  min-width: 0;
  gap: 9px;
}

.world-agent-chat-heading > .material-symbols-outlined {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #eef3ff;
  color: #2d66d1;
  font-size: 17px;
}

.world-agent-chat-heading > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.world-agent-chat-heading strong {
  color: #1b1e24;
  font-size: 13px;
  font-weight: 850;
}

.world-agent-chat-heading span {
  overflow: hidden;
  color: #9097a3;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-chat-header-actions {
  gap: 12px;
}

.world-agent-chat-status {
  gap: 5px;
  color: #738091;
  font-size: 10px;
  font-weight: 700;
}

.world-agent-chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #54b67c;
}

.world-agent-chat-status.is-running .world-agent-chat-status-dot {
  background: #e4a127;
  box-shadow: 0 0 0 4px rgba(228, 161, 39, 0.13);
}

.world-agent-chat-icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #737c89;
  cursor: pointer;
}

.world-agent-chat-icon-button:hover,
.world-agent-chat-icon-button:focus-visible {
  border-color: #dfe3eb;
  background: #f7f8fa;
  color: #1f2c42;
  outline: none;
}

.world-agent-chat-scroll {
  min-height: 0;
  overflow: auto;
  padding: 34px clamp(18px, 5vw, 74px) 24px;
  scroll-behavior: smooth;
}

.world-agent-agent-welcome {
  display: grid;
  max-width: 680px;
  justify-items: center;
  margin: 30px auto 26px;
  text-align: center;
}

.world-agent-agent-welcome-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid #d8e1f3;
  border-radius: 15px;
  background: #f2f6ff;
  color: #2d66d1;
  box-shadow: 0 8px 18px rgba(45, 102, 209, 0.1);
}

.world-agent-agent-welcome-icon .material-symbols-outlined {
  font-size: 24px;
}

.world-agent-agent-welcome h1 {
  margin: 0;
  color: #1b1e24;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 850;
  letter-spacing: 0;
}

.world-agent-agent-welcome p {
  max-width: 560px;
  margin: 12px 0 0;
  color: #78818e;
  font-size: 12px;
  line-height: 1.7;
}

.world-agent-agent-prompt-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 26px;
}

.world-agent-agent-prompt-grid button {
  display: grid;
  min-height: 72px;
  justify-items: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1e5ec;
  border-radius: 7px;
  background: #fbfcfd;
  color: #4e5868;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.world-agent-agent-prompt-grid button:hover,
.world-agent-agent-prompt-grid button:focus-visible {
  border-color: #a9c0ed;
  background: #f4f7ff;
  color: #2458b6;
  outline: none;
}

.world-agent-agent-prompt-grid .material-symbols-outlined {
  color: #527bd2;
  font-size: 18px;
}

.world-agent-conversation-host {
  min-width: 0;
}

.world-agent-conversation-host .canvas-agent-panel {
  position: relative;
  inset: auto;
  display: grid;
  width: 100%;
  transform: none;
  pointer-events: auto;
}

.world-agent-conversation-host .canvas-agent-panel > * {
  pointer-events: auto;
}

.world-agent-conversation-host .canvas-agent-compose {
  order: 10;
  margin-top: 22px;
  padding: 14px 0 0;
  border-top: 1px solid #eceef2;
  background: #ffffff;
}

.world-agent-conversation-host .canvas-agent-compose-heading {
  display: none;
}

.world-agent-conversation-host .canvas-agent-theme-field textarea {
  min-height: 108px;
  max-height: 220px;
  padding: 15px 16px;
  border-color: #d9dee7;
  border-radius: 9px;
  background: #ffffff;
  color: #252a33;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 5px 18px rgba(27, 38, 55, 0.06);
}

.world-agent-conversation-host .canvas-agent-theme-field textarea:focus {
  border-color: #7da2e9;
  box-shadow: 0 0 0 3px rgba(67, 117, 213, 0.12);
}

.world-agent-conversation-host .canvas-agent-compose-actions {
  gap: 8px;
  margin-top: 8px;
}

.world-agent-conversation-host .canvas-agent-settings-button {
  min-height: 34px;
  border-color: #e1e5ec;
  border-radius: 6px;
  background: #fafbfc;
}

.world-agent-conversation-host .canvas-agent-generate-button {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 50%;
  background: #2168df;
}

.world-agent-conversation-host .canvas-agent-conversation {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.world-agent-conversation-host .canvas-agent-conversation-heading {
  margin-bottom: 12px;
}

.world-agent-conversation-host .canvas-agent-messages {
  max-height: none;
  gap: 14px;
  overflow: visible;
}

.world-agent-conversation-host .canvas-agent-message {
  max-width: 82%;
  padding: 12px 14px;
  border-color: #e6e9ee;
  border-radius: 9px;
  background: #f7f8fa;
}

.world-agent-conversation-host .canvas-agent-message.is-user {
  justify-self: end;
  border-color: #cbdcfb;
  background: #eff5ff;
}

.world-agent-conversation-host .canvas-agent-message p {
  font-size: 12px;
  line-height: 1.65;
}

.world-agent-conversation-host .canvas-agent-result-summary {
  margin: 14px 0;
  border: 1px solid #dce5f7;
  border-radius: 8px;
  background: #f6f9ff;
}

.world-agent-conversation-host .canvas-agent-result {
  position: relative;
  inset: auto;
  order: 5;
  max-height: none;
  margin: 14px 0;
  border-color: #dde3ec;
  border-radius: 8px;
  box-shadow: none;
}

.world-agent-conversation-host .canvas-agent-change-summary,
.world-agent-conversation-host .canvas-agent-execution-status {
  margin: 12px 0;
}

.world-agent-chat-quick-actions {
  display: flex;
  max-width: 840px;
  align-items: center;
  gap: 7px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 74px) 12px;
}

.world-agent-chat-quick-actions button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #e1e5ec;
  border-radius: 5px;
  background: #fbfcfd;
  color: #667182;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.world-agent-chat-quick-actions button:hover,
.world-agent-chat-quick-actions button:focus-visible {
  border-color: #a9c0ed;
  background: #f4f7ff;
  color: #2458b6;
  outline: none;
}

.world-agent-chat-quick-actions .material-symbols-outlined {
  font-size: 15px;
}

.world-agent-context-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-left: 1px solid #e1e3e8;
  background: #f8f9fb;
}

.world-agent-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 19px 17px 12px;
}

.world-agent-context-header > div {
  display: grid;
  gap: 3px;
}

.world-agent-context-header strong {
  color: #1e2632;
  font-size: 13px;
  font-weight: 850;
}

.world-agent-context-tabs {
  display: flex;
  gap: 2px;
  padding: 0 14px 10px;
  border-bottom: 1px solid #e4e7ed;
}

.world-agent-context-tabs button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8a929f;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.world-agent-context-tabs button:hover,
.world-agent-context-tabs button:focus-visible,
.world-agent-context-tabs button.is-active {
  background: #ffffff;
  color: #2d66d1;
  outline: none;
}

.world-agent-context-body {
  min-height: 0;
  overflow: auto;
  padding: 15px;
}

.world-agent-context-overview {
  display: grid;
  gap: 13px;
}

.world-agent-context-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.world-agent-context-title-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.world-agent-context-title-row strong {
  overflow: hidden;
  color: #263142;
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-agent-context-revision {
  padding: 3px 6px;
  border: 1px solid #dce2ec;
  border-radius: 4px;
  background: #ffffff;
  color: #8a929f;
  font-size: 9px;
  font-weight: 800;
}

.world-agent-context-overview > p {
  margin: 0;
  color: #737d8b;
  font-size: 11px;
  line-height: 1.65;
}

.world-agent-context-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #e1e5eb;
  border-radius: 7px;
  background: #ffffff;
}

.world-agent-context-stats > div {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-right: 1px solid #edf0f3;
}

.world-agent-context-stats > div:last-child {
  border-right: 0;
}

.world-agent-context-stats strong {
  color: #2d66d1;
  font-size: 16px;
  font-weight: 850;
}

.world-agent-context-stats span {
  color: #8a929f;
  font-size: 9px;
  font-weight: 700;
}

.world-agent-context-locks {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid #e2e6ec;
  border-radius: 7px;
  background: #ffffff;
}

.world-agent-context-locks > div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7e8795;
  font-size: 10px;
}

.world-agent-context-locks .material-symbols-outlined {
  color: #7292d0;
  font-size: 15px;
}

.world-agent-context-locks strong {
  margin-left: auto;
  color: #4c5666;
  font-size: 10px;
  font-weight: 800;
}

.world-agent-context-primary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #c6d5f3;
  border-radius: 6px;
  background: #f2f6ff;
  color: #2c61c1;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.world-agent-context-primary:hover,
.world-agent-context-primary:focus-visible {
  border-color: #8eade5;
  background: #eaf0ff;
  outline: none;
}

.world-agent-context-primary .material-symbols-outlined {
  font-size: 16px;
}

.world-agent-context-tab-panel {
  display: grid;
  min-height: 0;
  gap: 8px;
}

.world-agent-context-node-list {
  display: grid;
  min-height: 160px;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e1e5eb;
  border-radius: 7px;
  background: #ffffff;
  color: #8a929f;
  font-size: 10px;
  line-height: 1.5;
}

.world-agent-context-node-list button,
.world-agent-context-timeline-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #e5e8ed;
  border-radius: 6px;
  background: #fbfcfd;
  color: #596574;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.world-agent-context-node-list button:hover,
.world-agent-context-node-list button:focus-visible,
.world-agent-context-timeline-list button:hover,
.world-agent-context-timeline-list button:focus-visible {
  border-color: #aac0ea;
  background: #f3f7ff;
  outline: none;
}

.world-agent-context-node-list button strong,
.world-agent-context-timeline-list button strong {
  color: #28364b;
  font-size: 10px;
}

.world-agent-context-node-list button span,
.world-agent-context-timeline-list button span {
  color: #87909d;
  font-size: 9px;
}

.world-agent-context-note {
  margin: 0;
  color: #8a929f;
  font-size: 10px;
  line-height: 1.5;
}

.world-agent-context-timeline-list {
  display: grid;
  min-height: 120px;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e1e5eb;
  border-radius: 7px;
  background: #ffffff;
  color: #8a929f;
  font-size: 10px;
  line-height: 1.5;
}

.world-agent-context-footer {
  display: flex;
  gap: 7px;
  padding: 11px 14px 14px;
  border-top: 1px solid #e4e7ed;
}

.world-agent-context-footer button {
  display: inline-flex;
  min-height: 32px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #e0e4ea;
  border-radius: 5px;
  background: #ffffff;
  color: #667182;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.world-agent-context-footer button:hover,
.world-agent-context-footer button:focus-visible {
  border-color: #a9c0ed;
  color: #2458b6;
  outline: none;
}

.world-agent-context-footer .material-symbols-outlined {
  font-size: 15px;
}

@media (max-width: 1120px) {
  .world-agent-agent-main {
    grid-template-columns: 190px minmax(0, 1fr) 270px;
  }

  .world-agent-agent-prompt-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .world-agent-agent-main {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .world-agent-agent-sidebar {
    display: none;
  }

  .world-agent-context-panel {
    min-height: 310px;
    border-top: 1px solid #e1e3e8;
    border-left: 0;
  }

  .world-agent-chat-stage {
    min-height: 620px;
  }

  .world-agent-chat-header {
    padding: 0 16px;
  }

  .world-agent-chat-scroll {
    padding-right: 16px;
    padding-left: 16px;
  }

  .world-agent-chat-quick-actions {
    flex-wrap: wrap;
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* Scene lanes live inside the World Agent map frame. The map remains the
   continuous center surface while the script-derived scene cards sit on top
   of its two inner edges. */
html[data-jwj-workspace-mode="world"] .world-agent-map-column {
  isolation: isolate;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail {
  position: absolute;
  top: 76px;
  bottom: 188px;
  z-index: 9;
  display: flex;
  width: 184px;
  min-height: 0;
  flex-direction: column;
  padding: 10px;
  border: 1px solid rgba(217, 236, 226, 0.24);
  border-radius: 10px;
  background: rgba(20, 48, 46, 0.76);
  box-shadow: 0 12px 30px rgba(7, 25, 24, 0.2);
  color: #edf7f1;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-left {
  left: 12px;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-right {
  right: 12px;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(217, 236, 226, 0.16);
  color: #a9d8c8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-header strong {
  color: #eaf7f1;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  margin-top: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(214, 238, 226, 0.2);
  border-radius: 7px;
  background: rgba(239, 250, 244, 0.08);
  color: #eef8f3;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card:hover,
html[data-jwj-workspace-mode="world"] .world-agent-scene-card:focus-visible {
  border-color: rgba(131, 224, 193, 0.78);
  background: rgba(88, 170, 144, 0.24);
  outline: none;
  transform: translateY(-1px);
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card.is-selected {
  border-color: #98e3c8;
  background: rgba(76, 164, 136, 0.3);
  box-shadow: 0 0 0 2px rgba(152, 227, 200, 0.15);
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-media {
  position: relative;
  display: grid;
  width: 58px;
  height: 68px;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(124, 188, 165, 0.3), rgba(28, 66, 61, 0.95));
  color: #b7e6d3;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-media.has-image {
  background: #244a44;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.04);
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-media img:not([hidden]) + .world-agent-scene-card-placeholder {
  display: none;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-placeholder {
  font-size: 22px;
  opacity: 0.8;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-index {
  position: absolute;
  right: 4px;
  bottom: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(8, 26, 25, 0.72);
  color: #dff7ea;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 3px;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy strong,
html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy span,
html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy strong {
  color: #f4fbf7;
  font-size: 11px;
  font-weight: 800;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy span {
  color: #9fd1bd;
  font-size: 9px;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy small {
  color: #c4ddd2;
  font-size: 9px;
  line-height: 1.35;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-empty {
  display: grid;
  min-height: 90px;
  place-items: center;
  gap: 5px;
  color: #8db9a8;
  font-size: 10px;
  text-align: center;
}

html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-empty .material-symbols-outlined {
  font-size: 22px;
}

@media (max-width: 1120px) {
  html[data-jwj-workspace-mode="world"] .world-agent-scene-rail {
    width: 156px;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-scene-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  html[data-jwj-workspace-mode="world"] .world-agent-scene-card-media {
    width: 48px;
    height: 58px;
  }
}

@media (max-width: 760px) {
  html[data-jwj-workspace-mode="world"] .world-agent-scene-rail {
    top: 64px;
    bottom: 164px;
    width: 132px;
    padding: 7px;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-left {
    left: 7px;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-scene-rail-right {
    right: 7px;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-scene-card {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-scene-card-media {
    width: 100%;
    height: 48px;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-scene-card-copy small {
    display: none;
  }
}

@media (max-width: 420px) {
  :root {
    --workspace-mode-switch-reserve: 102px;
  }

  .global-workspace-mode-switch {
    top: 6px;
    right: 8px;
    padding: 2px;
  }

  .global-workspace-mode-switch .workspace-mode-button {
    width: 28px;
    height: 28px;
  }

  #generation-workspace #image-model-control .option-trigger {
    max-width: 92px;
  }

  .canvas-library-topbar {
    min-height: 56px;
    grid-template-columns: minmax(40px, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }

  .canvas-library-brand {
    width: 40px;
  }

  .canvas-library-brand span {
    display: none;
  }

  .canvas-library-brand img {
    width: 30px;
    height: 30px;
  }

  .canvas-library-settings {
    width: 38px;
    height: 38px;
  }

  .canvas-project-library-main {
    width: calc(100% - 24px);
    padding: 28px 0 40px;
  }

  .canvas-project-library-heading {
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
  }

  .canvas-project-library-heading h1 {
    font-size: 21px;
  }

  .canvas-project-library-heading p {
    display: none;
  }

  .canvas-project-library-heading .canvas-primary-button {
    padding: 0 11px;
  }

  .canvas-project-heading-actions {
    gap: 6px;
  }

  .canvas-project-heading-actions .canvas-secondary-button span:last-child {
    display: none;
  }

  .canvas-project-heading-actions .canvas-secondary-button {
    width: 38px;
    padding: 0;
  }

  .canvas-project-empty-actions {
    flex-direction: column-reverse;
    width: min(260px, 100%);
  }

  .canvas-project-empty-actions > button {
    width: 100%;
  }

  .canvas-project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .canvas-project-card-actions {
    opacity: 1;
    transform: none;
  }

  .canvas-project-empty {
    min-height: 340px;
    padding: 40px 20px;
  }

  .canvas-project-dialog-backdrop {
    align-items: end;
    padding: 8px;
  }

  .canvas-project-dialog {
    padding: 18px;
  }

  .world-agent-main {
    padding: 8px;
  }

  .world-agent-map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .world-agent-map-actions {
    width: 100%;
    justify-content: space-between;
  }

  .world-agent-map-actions .world-agent-filter-field {
    flex: 1;
  }

  .world-agent-map-actions select {
    min-width: 0;
    flex: 1;
  }

  .world-agent-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .world-agent-timeline-tools {
    width: 100%;
    justify-content: space-between;
  }

  .canvas-topbar {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .canvas-brand,
  .canvas-icon-button,
  .canvas-command {
    height: 38px;
  }

  .canvas-current-project {
    width: 72px;
    height: 38px;
    padding: 0 7px;
  }

  .canvas-current-project span {
    display: none;
  }

  .canvas-current-project strong {
    font-size: 10px;
  }

  .canvas-brand,
  .canvas-icon-button,
  .canvas-options-button {
    width: 38px;
  }

  .canvas-brand img {
    width: 26px;
    height: 26px;
  }

  .canvas-toolbar {
    top: 58px;
    left: 8px;
  }

  .canvas-assets-panel {
    top: 58px;
    left: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100% - 70px);
  }

  .canvas-agent-panel {
    top: auto;
    right: 8px;
    bottom: 52px;
    left: 8px;
    width: auto;
    transform: none;
  }

  .canvas-agent-popover {
    max-height: calc(100vh - 190px);
  }

  .canvas-agent-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .canvas-agent-result-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .canvas-agent-result-summary-actions {
    width: 100%;
    justify-content: stretch;
  }

  .canvas-agent-result-summary-actions .canvas-secondary-button,
  .canvas-agent-result-summary-actions .canvas-primary-button {
    flex: 1;
  }

  .canvas-agent-execution-decision > div {
    align-items: stretch;
    flex-direction: column;
  }

  .canvas-agent-execution-decision button {
    justify-content: center;
  }

  .canvas-agent-version-control {
    align-self: flex-start;
  }

  .canvas-agent-compose-heading span:not(.canvas-agent-compose-mark) {
    display: none;
  }

  .canvas-options-panel {
    top: 54px;
    right: 8px;
    width: calc(100vw - 16px);
  }

  .canvas-ratio-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-options-row {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .canvas-zoom-controls {
    right: 8px;
    bottom: 8px;
  }
}

/* World Agent reference layout: structure rail + map canvas + inspector rail
   with a full-width multi-track timeline anchored to the map column. */
.world-agent-workspace {
  grid-template-rows: 72px minmax(0, 1fr);
  background: #152d2d;
  color: #f4f7f4;
}

.world-agent-topbar {
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid #d6dadd;
  background: #f7f8f7;
  box-shadow: none;
}

.world-agent-topbar-center {
  color: #152d2d;
}

.world-agent-topbar-center strong {
  color: #101817;
  font-size: 19px;
}

.world-agent-topbar-kicker {
  display: none;
}

.world-agent-main {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 340px;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #152d2d;
}

.world-agent-structure {
  position: relative;
  z-index: 20;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(191, 222, 211, 0.18);
  background: #152d2d;
  color: #ecf4f0;
}

.world-agent-structure-header {
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(191, 222, 211, 0.18);
}

.world-agent-structure-header strong {
  font-size: 18px;
  font-weight: 850;
}

.world-agent-structure-actions {
  display: flex;
  gap: 8px;
}

.world-agent-structure-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b8cec7;
  cursor: pointer;
}

.world-agent-structure-icon:hover,
.world-agent-structure-icon:focus-visible {
  background: rgba(116, 183, 162, 0.16);
  color: #ffffff;
  outline: none;
}

.world-agent-structure-searchbar {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 7px;
  margin: 10px 14px 0;
  padding: 0 9px;
  border: 1px solid rgba(191, 222, 211, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #9bb1aa;
}

.world-agent-structure-searchbar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f1f6f3;
  font: inherit;
  font-size: 13px;
}

.world-agent-structure-searchbar input::placeholder {
  color: #78948a;
}

.world-agent-structure-searchbar button {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9bb1aa;
  cursor: pointer;
}

.world-agent-structure-searchbar button:hover,
.world-agent-structure-searchbar button:focus-visible {
  background: rgba(116, 183, 162, 0.16);
  color: #ffffff;
  outline: none;
}

.world-agent-structure-scroll {
  height: calc(100% - 76px);
  overflow: auto;
  padding: 12px 14px 24px;
  scrollbar-width: thin;
}

.world-agent-structure-group {
  padding: 9px 0 13px;
  border-bottom: 1px solid rgba(191, 222, 211, 0.16);
}

.world-agent-structure-heading,
.world-agent-structure-subitems button {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #d7e5df;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.world-agent-structure-heading {
  min-height: 42px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 15px;
}

.world-agent-structure-heading > .material-symbols-outlined:first-child {
  color: #b8cec7;
  font-size: 22px;
}

.world-agent-structure-heading strong {
  flex: 1;
  font-weight: 800;
}

.world-agent-structure-count,
.world-agent-structure-subitems button span:last-child {
  color: #9bb1aa;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.world-agent-structure-chevron {
  color: #78948a;
  font-size: 18px;
}

.world-agent-structure-heading:hover,
.world-agent-structure-heading:focus-visible,
.world-agent-structure-heading.is-active {
  background: rgba(116, 183, 162, 0.16);
  color: #ffffff;
  outline: none;
}

.world-agent-structure-heading.is-active > .material-symbols-outlined:first-child {
  color: #7fc5b1;
}

.world-agent-structure-subitems {
  display: grid;
  gap: 2px;
  padding: 5px 0 0 35px;
}

.world-agent-structure-subitems button {
  justify-content: space-between;
  min-height: 31px;
  padding: 0 9px;
  color: #a9c0b8;
  font-size: 12px;
}

.world-agent-structure-subitems button:hover,
.world-agent-structure-subitems button:focus-visible {
  color: #ffffff;
  outline: none;
}

.world-agent-map-column {
  position: relative;
  display: block;
  width: auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #cdd8d2;
}

.world-agent-map {
  position: absolute;
  inset: 0 0 206px;
  z-index: 1;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #c9d5cf;
}

.world-agent-map-background {
  opacity: 0.92;
  filter: saturate(0.9) contrast(0.96);
}

.world-agent-map-toolbar {
  position: absolute;
  top: 18px;
  right: auto;
  left: 18px;
  z-index: 12;
  min-height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.world-agent-view-title {
  display: none;
}

.world-agent-map-actions {
  gap: 0;
  padding: 0;
  border: 1px solid rgba(40, 62, 57, 0.18);
  border-radius: 9px;
  background: rgba(250, 252, 250, 0.92);
  box-shadow: 0 8px 22px rgba(21, 45, 45, 0.14);
  overflow: hidden;
}

.world-agent-map-actions .world-agent-filter-field {
  height: 46px;
  padding: 0 13px;
  color: #28443c;
  font-size: 12px;
}

.world-agent-map-actions .world-agent-filter-field > span {
  display: none;
}

.world-agent-map-actions .world-agent-filter-field select {
  min-width: 125px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.world-agent-map-actions .world-agent-icon-action,
.world-agent-map-actions .canvas-icon-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-left: 1px solid #d7dfdc;
  border-radius: 0;
  background: transparent;
  color: #28443c;
}

.world-agent-map-actions .world-agent-icon-action:hover,
.world-agent-map-actions .world-agent-icon-action:focus-visible,
.world-agent-map-actions .canvas-icon-button:hover,
.world-agent-map-actions .canvas-icon-button:focus-visible {
  background: #e4f0eb;
  color: #1c6a55;
  outline: none;
}

.world-agent-map-actions #world-agent-inspector-toggle {
  display: none;
}

.world-agent-timeline-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 14;
  height: 206px;
  padding: 16px 22px 18px;
  border: 0;
  border-top: 1px solid rgba(191, 222, 211, 0.18);
  border-radius: 0;
  background: #152d2d;
  box-shadow: none;
  color: #f1f6f3;
  backdrop-filter: none;
}

.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
  height: 206px;
  background: #152d2d;
}

.world-agent-timeline-panel .world-agent-section-heading {
  min-height: 34px;
}

.world-agent-timeline-panel .world-agent-eyebrow,
.world-agent-timeline-panel .world-agent-section-heading strong,
.world-agent-timeline-tools > span {
  color: #d7e5df;
}

.world-agent-timeline-panel .world-agent-section-heading strong {
  font-size: 16px;
}

.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-controls {
  display: flex;
}

.world-agent-map-column.is-timeline-collapsed .world-agent-timeline {
  display: block;
}

.world-agent-timeline-tools > .world-agent-filter-field,
.world-agent-timeline-tools > #world-agent-add-plot-line-button,
.world-agent-timeline-tools > #world-agent-edit-plot-line-button {
  display: none;
}

.world-agent-timeline-controls {
  display: flex;
  margin-top: 10px;
  color: #a9c0b8;
}

.world-agent-timeline-controls input[type="range"] {
  accent-color: #73c6b3;
}

.world-agent-timeline-controls output {
  color: #d7e5df;
}

.world-agent-timeline {
  height: 122px;
  margin-top: 10px;
  border: 0;
  border-top: 1px solid rgba(191, 222, 211, 0.2);
  border-bottom: 1px solid rgba(191, 222, 211, 0.2);
  background: repeating-linear-gradient(90deg, transparent 0, transparent 108px, rgba(191, 222, 211, 0.08) 109px, transparent 110px), #152d2d;
}

.world-agent-timeline::before {
  inset: 0;
  background-image: linear-gradient(180deg, transparent 32%, rgba(191, 222, 211, 0.18) 33%, transparent 34%, transparent 65%, rgba(191, 222, 211, 0.18) 66%, transparent 67%);
  background-size: 100% 100%;
}

.world-agent-timeline-cursor {
  background: #81d3bd;
  box-shadow: 0 0 0 2px rgba(129, 211, 189, 0.18);
}

.world-agent-timeline-event {
  top: 43px;
  width: 148px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #70c5b1;
  border-radius: 18px;
  background: rgba(34, 72, 67, 0.86);
  color: #e5f6ef;
}

.world-agent-timeline-event span {
  color: #a9d8cb;
}

.world-agent-timeline-event:hover,
.world-agent-timeline-event:focus-visible,
.world-agent-timeline-event.is-selected {
  border-color: #b7f1df;
  background: #2f776c;
  box-shadow: 0 0 0 3px rgba(129, 211, 189, 0.18);
}

.world-agent-timeline-event::before {
  top: -28px;
  height: 24px;
  background: #70c5b1;
}

.world-agent-inspector {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  z-index: 20;
  width: auto;
  max-height: none;
  border: 0;
  border-left: 1px solid rgba(191, 222, 211, 0.18);
  border-radius: 0;
  background: #152d2d;
  box-shadow: none;
  color: #edf5f1;
  backdrop-filter: none;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

.world-agent-workspace:not(.is-inspector-open) .world-agent-inspector,
.world-agent-inspector.is-empty {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

.world-agent-inspector-empty,
.world-agent-inspector-content {
  padding: 18px 22px 30px;
}

.world-agent-inspector-header {
  border-bottom-color: rgba(191, 222, 211, 0.18);
}

.world-agent-inspector-header h2,
.world-agent-inspector-header p,
.world-agent-inspector-empty strong {
  color: #edf5f1;
}

.world-agent-inspector-header p,
.world-agent-inspector-empty span:last-child {
  color: #a9c0b8;
}

.world-agent-inspector-block {
  border-color: rgba(191, 222, 211, 0.18);
  border-radius: 6px;
  background: rgba(231, 244, 238, 0.06);
}

.world-agent-inspector-block h3 {
  color: #82cdb8;
}

.world-agent-inspector-block p,
.world-agent-inspector-block li {
  color: #c6d8d1;
}

.world-agent-inspector-link {
  border-color: rgba(129, 211, 189, 0.42);
  background: rgba(129, 211, 189, 0.1);
  color: #c7ece0;
}

.world-agent-agent-host {
  right: calc(340px + 18px);
  bottom: 222px;
  left: 250px;
  z-index: 35;
  width: auto;
  max-height: min(38vh, 390px);
  transform: none;
}

.world-agent-agent-host .canvas-agent-panel {
  max-height: min(38vh, 390px);
}

@media (max-width: 1100px) {
  .world-agent-main {
    grid-template-columns: 210px minmax(0, 1fr) 300px;
  }

  .world-agent-agent-host {
    right: 318px;
    left: 210px;
  }
}

@media (max-width: 760px) {
  .world-agent-topbar {
    min-height: 60px;
    padding: 8px 12px;
  }

  .world-agent-workspace {
    grid-template-rows: 60px minmax(0, 1fr);
  }

  .world-agent-topbar-center strong {
    font-size: 15px;
  }

  .world-agent-main {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .world-agent-structure {
    display: none;
  }

  .world-agent-map-column {
    min-height: calc(100vh - 60px);
  }

  .world-agent-map {
    inset: 0 0 180px;
  }

  .world-agent-timeline-panel,
  .world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
    height: 180px;
    padding: 12px;
  }

  .world-agent-inspector {
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 190px;
    left: 10px;
    z-index: 30;
    width: auto;
    border: 1px solid rgba(191, 222, 211, 0.2);
    border-radius: 10px;
  }

  .world-agent-agent-host {
    right: 10px;
    bottom: 194px;
    left: 10px;
    max-height: min(40vh, 360px);
  }
}

@media (max-width: 340px) {
  #generation-workspace #image-model-control {
    display: none;
  }

  .canvas-current-project {
    display: none;
  }
}

@media (hover: none) {
  .canvas-project-card-actions {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .canvas-loading-icon .material-symbols-outlined {
    animation-duration: 3s;
  }

  .canvas-agent-tasks li.is-running .canvas-agent-task-marker {
    animation: none;
  }

  .canvas-asset-category-tab.is-generating::after {
    animation: none;
    opacity: 1;
  }

  .canvas-node,
  .canvas-image-actions,
  .workspace-mode-button {
    transition: none;
  }
}

/* World Agent: keep the map as the primary work surface. Supporting views sit
   on top of it as lightweight rails/drawers so the map remains visible while
   editing and navigating the story world. */
.world-agent-workspace {
  grid-template-rows: 56px minmax(0, 1fr);
  background: #dfe9df;
}

.world-agent-topbar {
  min-height: 56px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.world-agent-main {
  position: relative;
  display: block;
  min-height: 0;
  padding: 12px 14px 14px;
  overflow: hidden;
}

.world-agent-map-column {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.world-agent-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 12px 32px rgba(28, 47, 37, 0.12);
}

.world-agent-map-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  z-index: 12;
  min-height: 56px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(248, 251, 248, 0.82);
  box-shadow: 0 8px 22px rgba(28, 47, 37, 0.1);
  backdrop-filter: blur(14px);
}

.world-agent-view-title strong {
  font-size: 15px;
}

.world-agent-view-title span:last-child {
  font-size: 10px;
}

.world-agent-map-actions {
  flex: 0 0 auto;
}

.world-agent-map-actions .world-agent-icon-action,
.world-agent-map-actions .canvas-icon-button {
  background: rgba(255, 255, 255, 0.86);
}

.world-agent-timeline-panel {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 13;
  height: 108px;
  padding: 10px 13px 10px;
  border-radius: 12px;
  background: rgba(248, 251, 248, 0.9);
  box-shadow: 0 10px 26px rgba(28, 47, 37, 0.1);
  backdrop-filter: blur(14px);
  transition: height 180ms ease, background-color 180ms ease;
}

.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
  height: 48px;
  background: rgba(248, 251, 248, 0.82);
}

.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-controls,
.world-agent-map-column.is-timeline-collapsed .world-agent-timeline {
  display: none;
}

.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-tools > .world-agent-filter-field,
.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-tools > #world-agent-add-plot-line-button,
.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-tools > #world-agent-edit-plot-line-button {
  display: none;
}

.world-agent-timeline-tools {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.world-agent-timeline {
  height: 58px;
  margin-top: 6px;
  border-radius: 7px;
}

.world-agent-timeline-event {
  top: 24px;
  min-height: 42px;
}

.world-agent-timeline-event::before {
  top: -17px;
  height: 14px;
}

.world-agent-inspector {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 136px;
  z-index: 24;
  width: min(360px, calc(100vw - 28px));
  max-height: none;
  border-radius: 12px;
  background: rgba(248, 251, 248, 0.96);
  box-shadow: 0 14px 32px rgba(28, 47, 37, 0.16);
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.world-agent-workspace:not(.is-inspector-open) .world-agent-inspector,
.world-agent-inspector.is-empty {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
}

.world-agent-workspace.is-inspector-open .world-agent-inspector {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.world-agent-agent-host {
  position: absolute;
  right: 14px;
  bottom: 126px;
  left: 50%;
  z-index: 30;
  width: min(900px, calc(100% - 28px));
  max-height: min(42vh, 420px);
  padding: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.world-agent-agent-host .canvas-agent-panel {
  max-height: min(42vh, 420px);
  overflow: auto;
  pointer-events: auto;
}

@media (max-width: 760px) {
  .world-agent-main {
    padding: 8px;
  }

  .world-agent-map-toolbar {
    top: 8px;
    right: 8px;
    left: 8px;
    align-items: center;
    min-height: 52px;
    padding: 8px 10px;
  }

  .world-agent-map-actions {
    max-width: 52%;
    overflow-x: auto;
  }

  .world-agent-timeline-panel {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .world-agent-inspector {
    top: 8px;
    right: 8px;
    bottom: 72px;
    width: min(360px, calc(100vw - 16px));
  }

  .world-agent-agent-host {
    right: 8px;
    bottom: 114px;
    left: 8px;
    width: auto;
    max-height: min(48vh, 420px);
    transform: none;
  }

  .world-agent-agent-host .canvas-agent-panel {
    max-height: min(48vh, 420px);
  }
}

@media (max-width: 420px) {
  .world-agent-map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .world-agent-map-actions {
    width: 100%;
    max-width: none;
  }

  .world-agent-view-title span:last-child {
    max-width: 70vw;
  }

  .world-agent-timeline-panel {
    height: 102px;
  }

  .world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
    height: 44px;
  }
}

/* Final reference-layout precedence. Keep this block last so the reference
   structure wins over earlier map-first experiments. */
.world-agent-workspace {
  grid-template-rows: 72px minmax(0, 1fr) !important;
  background: #152d2d !important;
}

.world-agent-topbar {
  min-height: 72px !important;
  background: #f7f8f7 !important;
  box-shadow: none !important;
}

.world-agent-main {
  display: grid !important;
  grid-template-columns: 250px minmax(0, 1fr) 340px !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #152d2d !important;
}

.world-agent-structure {
  display: block !important;
  position: relative !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-right: 1px solid rgba(191, 222, 211, 0.18) !important;
  background: #152d2d !important;
}

.world-agent-map-column {
  position: relative !important;
  display: block !important;
  width: auto !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #cdd8d2 !important;
}

.world-agent-map {
  position: absolute !important;
  inset: 0 0 206px !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.world-agent-map-toolbar {
  top: 18px !important;
  right: auto !important;
  left: 18px !important;
  min-height: 50px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.world-agent-view-title {
  display: none !important;
}

.world-agent-map-actions {
  gap: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(40, 62, 57, 0.18) !important;
  border-radius: 9px !important;
  background: rgba(250, 252, 250, 0.92) !important;
  box-shadow: 0 8px 22px rgba(21, 45, 45, 0.14) !important;
  overflow: hidden !important;
}

.world-agent-map-actions .world-agent-filter-field > span {
  display: none !important;
}

.world-agent-map-actions .world-agent-icon-action,
.world-agent-map-actions .canvas-icon-button {
  width: 46px !important;
  height: 46px !important;
  border: 0 !important;
  border-left: 1px solid #d7dfdc !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.world-agent-map-actions #world-agent-inspector-toggle {
  display: none !important;
}

.world-agent-timeline-panel,
.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 14 !important;
  display: block !important;
  height: 206px !important;
  padding: 16px 22px 18px !important;
  border: 0 !important;
  border-top: 1px solid rgba(191, 222, 211, 0.18) !important;
  border-radius: 0 !important;
  background: #152d2d !important;
  box-shadow: none !important;
  color: #f1f6f3 !important;
  backdrop-filter: none !important;
}

.world-agent-map-column.is-timeline-collapsed .world-agent-timeline-controls,
.world-agent-map-column.is-timeline-collapsed .world-agent-timeline {
  display: block !important;
}

.world-agent-timeline {
  height: 122px !important;
  margin-top: 10px !important;
  border: 0 !important;
  border-top: 1px solid rgba(191, 222, 211, 0.2) !important;
  border-bottom: 1px solid rgba(191, 222, 211, 0.2) !important;
  background: #152d2d !important;
}

.world-agent-inspector {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 20 !important;
  width: auto !important;
  max-height: none !important;
  border: 0 !important;
  border-left: 1px solid rgba(191, 222, 211, 0.18) !important;
  border-radius: 0 !important;
  background: #152d2d !important;
  box-shadow: none !important;
  color: #edf5f1 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

.world-agent-workspace:not(.is-inspector-open) .world-agent-inspector,
.world-agent-inspector.is-empty {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

.world-agent-agent-host {
  right: 358px !important;
  bottom: 222px !important;
  left: 268px !important;
  width: auto !important;
  max-height: min(38vh, 390px) !important;
  transform: none !important;
}

@media (max-width: 760px) {
  .world-agent-workspace {
    grid-template-rows: 60px minmax(0, 1fr) !important;
  }

  .world-agent-main {
    grid-template-columns: 1fr !important;
    overflow: auto !important;
  }

  .world-agent-structure {
    display: none !important;
  }

  .world-agent-map-column {
    min-height: calc(100vh - 60px) !important;
  }

  .world-agent-map {
    inset: 0 0 180px !important;
  }

  .world-agent-timeline-panel,
  .world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
    height: 180px !important;
    padding: 12px !important;
  }

  .world-agent-inspector {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    bottom: 190px !important;
    left: 10px !important;
    width: auto !important;
    border: 1px solid rgba(191, 222, 211, 0.2) !important;
    border-radius: 10px !important;
  }

  .world-agent-agent-host {
    right: 10px !important;
    bottom: 194px !important;
    left: 10px !important;
  }
}

/* Keep the workspace switcher out of each mode's control rail. Generation
   keeps its original top-right placement; project-based workspaces get a
   centered switcher so their settings and action buttons stay reachable. */
html[data-jwj-workspace-mode="canvas"] .global-workspace-mode-switch,
html[data-jwj-workspace-mode="world"] .global-workspace-mode-switch,
html[data-jwj-workspace-mode="sequence"] .global-workspace-mode-switch {
  right: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

html[data-jwj-workspace-mode="canvas"] .canvas-library-settings,
html[data-jwj-workspace-mode="canvas"] .canvas-topbar-actions,
html[data-jwj-workspace-mode="world"] .canvas-library-settings,
html[data-jwj-workspace-mode="world"] .world-agent-topbar .canvas-topbar-actions {
  margin-right: 0;
}

html[data-jwj-workspace-mode="sequence"] .sequence-topbar {
  padding-right: 22px;
}

/* World Agent workflow polish: keep the map visible while the supporting
   rails stay dense, legible, and easy to scan. */
html[data-jwj-workspace-mode="world"] .world-agent-structure-header {
  height: 64px !important;
  padding: 0 18px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-structure-header strong {
  font-size: 16px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-structure-scroll {
  height: calc(100% - 64px) !important;
  padding: 8px 10px 18px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-structure-group {
  padding: 6px 0 9px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-structure-heading {
  min-height: 38px !important;
  padding: 0 8px !important;
  font-size: 13px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-structure-subitems {
  gap: 1px !important;
  padding-top: 3px !important;
  padding-left: 32px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-structure-subitems button {
  min-height: 28px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-map-background {
  opacity: 0.68 !important;
  filter: saturate(0.9) contrast(1.04) brightness(1.06) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-map::after {
  border: 0 !important;
  background: rgba(247, 252, 248, 0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-map-toolbar {
  top: 14px !important;
  left: 14px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-map-actions {
  border-radius: 8px !important;
  box-shadow: 0 6px 18px rgba(21, 45, 45, 0.16) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-map-actions .world-agent-icon-action,
html[data-jwj-workspace-mode="world"] .world-agent-map-actions .canvas-icon-button {
  width: 42px !important;
  height: 42px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-map-actions .world-agent-filter-field {
  height: 42px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-timeline-panel,
html[data-jwj-workspace-mode="world"] .world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
  height: 174px !important;
  padding: 12px 18px 14px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-timeline-panel .world-agent-section-heading {
  min-height: 28px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-timeline-panel .world-agent-section-heading strong {
  font-size: 14px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-timeline {
  height: 92px !important;
  margin-top: 7px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-inspector-content,
html[data-jwj-workspace-mode="world"] .world-agent-inspector-empty {
  padding: 14px 16px 22px !important;
  gap: 8px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-inspector-header {
  position: sticky !important;
  top: -14px !important;
  z-index: 2 !important;
  margin: -14px 0 0 !important;
  padding: 14px 0 10px !important;
  background: #152d2d !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-inspector-block {
  padding: 9px 10px !important;
  border-radius: 7px !important;
  background: rgba(231, 244, 238, 0.075) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-inspector-block p,
html[data-jwj-workspace-mode="world"] .world-agent-inspector-block li {
  font-size: 10px !important;
  line-height: 1.55 !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-agent-host {
  right: 358px !important;
  bottom: 190px !important;
  left: 268px !important;
  max-height: min(31vh, 330px) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-agent-host .canvas-agent-panel {
  width: min(760px, 100%) !important;
  max-height: min(31vh, 330px) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-agent-host .canvas-agent-compose {
  padding: 9px 12px !important;
  border-radius: 9px !important;
  box-shadow: 0 10px 24px rgba(21, 45, 45, 0.2) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-agent-host .canvas-agent-theme-field {
  margin-top: 5px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-agent-host .canvas-agent-theme-field textarea {
  min-height: 48px !important;
  max-height: 86px !important;
  font-size: 12px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-agent-host .canvas-agent-result-summary {
  min-height: 58px !important;
  padding: 8px 10px !important;
  border-radius: 9px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-agent-host .canvas-agent-popover {
  max-height: min(54vh, 520px) !important;
  border-radius: 9px !important;
}

@media (max-width: 1100px) {
  html[data-jwj-workspace-mode="world"] .world-agent-agent-host {
    right: 318px !important;
    left: 228px !important;
  }
}

@media (max-width: 760px) {
  html[data-jwj-workspace-mode="world"] .world-agent-timeline-panel,
  html[data-jwj-workspace-mode="world"] .world-agent-map-column.is-timeline-collapsed .world-agent-timeline-panel {
    height: 152px !important;
    padding: 10px 12px 12px !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-timeline {
    height: 76px !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-agent-host {
    right: 8px !important;
    bottom: 166px !important;
    left: 8px !important;
    max-height: min(36vh, 300px) !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-agent-host .canvas-agent-panel {
    max-height: min(36vh, 300px) !important;
  }
}

/* World Agent final shell: the legacy map workspace still has several late
   high-priority rules above. Keep the new conversation experience authoritative. */
html[data-jwj-workspace-mode="world"] .world-agent-workspace.world-agent-dream {
  display: block !important;
  overflow: hidden !important;
  background: #f5f6f8 !important;
  color: #17191d !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-compose {
  position: relative !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-compose-icon-button {
  display: inline-grid !important;
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 32px !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid #edf0f2 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #66707c !important;
  cursor: pointer !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-compose-icon-button:hover,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-compose-icon-button:focus-visible {
  border-color: #cfe7e9 !important;
  background: #f2fbfc !important;
  color: #0c8d98 !important;
  outline: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-compose-icon-button .material-symbols-outlined {
  font-size: 17px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-field {
  display: flex !important;
  grid-column: 1 / -1 !important;
  min-height: 52px !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border: 1px solid #e3e8eb !important;
  border-radius: 7px !important;
  background: #f8fafb !important;
  cursor: pointer !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-copy {
  display: grid !important;
  min-width: 0 !important;
  flex: 1 !important;
  gap: 2px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-copy strong {
  color: #252a2f !important;
  font-size: 12px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-copy small {
  overflow: hidden !important;
  color: #707981 !important;
  font-size: 10px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-field input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-toggle-track {
  display: flex !important;
  width: 36px !important;
  height: 20px !important;
  flex: 0 0 36px !important;
  align-items: center !important;
  padding: 2px !important;
  border-radius: 10px !important;
  background: #b9c0c5 !important;
  transition: background 160ms ease !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-toggle-track > span {
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(26, 36, 40, 0.28) !important;
  transition: transform 160ms ease !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-field input:checked + .canvas-agent-toggle-track {
  background: #159ca7 !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-field input:checked + .canvas-agent-toggle-track > span {
  transform: translateX(16px) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-field input:focus-visible + .canvas-agent-toggle-track {
  outline: 2px solid rgba(21, 156, 167, 0.35) !important;
  outline-offset: 2px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-auto-execute-field:has(input:disabled) {
  opacity: 0.52 !important;
  cursor: not-allowed !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream #canvas-agent-start-production {
  min-width: 108px !important;
  background: #159ca7 !important;
  border-color: #159ca7 !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream #canvas-agent-start-production:hover:not(:disabled),
html[data-jwj-workspace-mode="world"] .world-agent-dream #canvas-agent-start-production:focus-visible:not(:disabled) {
  background: #0b828c !important;
  border-color: #0b828c !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream #canvas-agent-start-production.is-running .material-symbols-outlined {
  animation: canvas-agent-stage-spin 1.2s linear infinite !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-reference-tray {
  display: flex !important;
  min-height: 0 !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 8px 12px 0 !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-reference-chip {
  display: inline-flex !important;
  min-width: 0 !important;
  max-width: 210px !important;
  height: 30px !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 0 7px 0 4px !important;
  border: 1px solid #dce9eb !important;
  border-radius: 6px !important;
  background: #f8fdfd !important;
  color: #4d6268 !important;
  font: inherit !important;
  font-size: 10px !important;
  cursor: pointer !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-reference-chip:hover,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-reference-chip:focus-visible {
  border-color: #9fd3d7 !important;
  color: #0b7e88 !important;
  outline: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-reference-chip img {
  width: 22px !important;
  height: 22px !important;
  border-radius: 4px !important;
  object-fit: cover !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-reference-chip > span:nth-child(2) {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-reference-chip .material-symbols-outlined:last-child {
  font-size: 14px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu {
  position: absolute !important;
  right: 12px !important;
  bottom: 58px !important;
  left: 12px !important;
  z-index: 32 !important;
  display: grid !important;
  max-height: min(340px, 45vh) !important;
  gap: 3px !important;
  overflow: auto !important;
  padding: 7px !important;
  border: 1px solid #e0e5e8 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 18px 42px rgba(20, 25, 30, 0.16) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu[hidden],
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu[hidden] {
  display: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu button,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu button {
  display: flex !important;
  min-height: 44px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 8px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #4d565f !important;
  font: inherit !important;
  text-align: left !important;
  cursor: pointer !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu button:hover,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu button:focus-visible,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu button.is-selected,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu button:hover,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu button:focus-visible {
  background: #f1fafb !important;
  color: #087d87 !important;
  outline: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu button > .material-symbols-outlined,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu button > .material-symbols-outlined {
  font-size: 18px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu button > span:nth-child(2),
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu button > span:nth-child(2) {
  display: grid !important;
  min-width: 0 !important;
  gap: 2px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu strong,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu strong {
  font-size: 10px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu small,
html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu small {
  overflow: hidden !important;
  color: #8b959c !important;
  font-size: 9px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-menu-check {
  margin-left: auto !important;
  font-size: 15px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-menu-empty {
  margin: 4px 6px !important;
  color: #8b959c !important;
  font-size: 10px !important;
}

@media (max-width: 700px) {
  html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-skill-menu,
  html[data-jwj-workspace-mode="world"] .world-agent-dream .canvas-agent-subject-menu {
    right: 12px !important;
    bottom: 54px !important;
    left: 12px !important;
    max-height: min(300px, 42vh) !important;
  }
}

html[data-jwj-workspace-mode="world"] .world-agent-workspace.world-agent-dream[hidden] {
  display: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream [hidden] {
  display: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-topbar {
  position: absolute !important;
  inset: 0 0 auto 76px !important;
  min-height: 64px !important;
  padding: 10px 22px !important;
  border: 0 !important;
  background: rgba(245, 246, 248, 0.92) !important;
  box-shadow: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-agent-main,
html[data-jwj-workspace-mode="world"] .world-agent-dream.is-context-collapsed .world-agent-agent-main {
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  grid-template-columns: 76px minmax(0, 1fr) !important;
  overflow: hidden !important;
  background: #f5f6f8 !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-agent-sidebar {
  position: relative !important;
  z-index: 40 !important;
  display: flex !important;
  width: 76px !important;
  padding: 20px 10px 14px !important;
  border-right: 1px solid #e8eaed !important;
  background: #fafbfc !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-chat-stage {
  display: grid !important;
  min-width: 0 !important;
  min-height: 0 !important;
  grid-template-rows: 64px minmax(0, 1fr) auto !important;
  overflow: hidden !important;
  background: #f5f6f8 !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-context-panel {
  position: absolute !important;
  inset: 0 0 0 auto !important;
  z-index: 45 !important;
  display: grid !important;
  width: min(380px, calc(100vw - 76px)) !important;
  min-height: 0 !important;
  border: 0 !important;
  border-left: 1px solid #e1e4e7 !important;
  background: #fafbfc !important;
  box-shadow: -16px 0 40px rgba(26, 31, 36, 0.12) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream.is-context-collapsed .world-agent-context-panel {
  display: grid !important;
  pointer-events: none !important;
  transform: translateX(100%) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-conversation-host .canvas-agent-compose {
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #e0e3e7 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 5px 18px rgba(28, 34, 40, 0.05) !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-conversation-host .canvas-agent-theme-field textarea {
  min-height: 118px !important;
  padding: 18px 20px 10px !important;
  border: 0 !important;
  border-radius: 8px 8px 0 0 !important;
  box-shadow: none !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream #canvas-agent-settings-popover {
  position: fixed !important;
  inset: 72px 24px auto auto !important;
  z-index: 190 !important;
  width: min(560px, calc(100vw - 124px)) !important;
  max-height: calc(100vh - 96px) !important;
  overflow: auto !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-compose {
  position: sticky !important;
  bottom: 0 !important;
  margin-top: 24px !important;
}

html[data-jwj-workspace-mode="world"] .world-agent-dream.is-conversation .world-agent-conversation-host .canvas-agent-theme-field textarea {
  min-height: 72px !important;
}

@media (max-width: 700px) {
  html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-topbar {
    inset: 0 0 auto 0 !important;
    min-height: 58px !important;
    padding: 8px 12px !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-agent-main,
  html[data-jwj-workspace-mode="world"] .world-agent-dream.is-context-collapsed .world-agent-agent-main {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-agent-sidebar {
    position: absolute !important;
    inset: auto 0 0 0 !important;
    z-index: 48 !important;
    display: flex !important;
    width: auto !important;
    min-height: 58px !important;
    flex-direction: row !important;
    padding: 4px 8px !important;
    border: 0 !important;
    border-top: 1px solid #e5e7ea !important;
    background: rgba(250, 251, 252, 0.98) !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-chat-stage {
    min-height: 0 !important;
    padding-bottom: 58px !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-chat-heading {
    display: none !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-compose-option {
    display: inline-flex !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-dream .world-agent-context-panel {
    width: min(360px, 92vw) !important;
  }

  html[data-jwj-workspace-mode="world"] .world-agent-dream #canvas-agent-settings-popover {
    inset: 66px 12px auto 12px !important;
    width: auto !important;
    max-height: calc(100vh - 136px) !important;
  }
}

/* Final studio overrides live after the legacy World Agent rules. */
.world-agent-workspace.world-agent-studio {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  overflow: hidden;
  background: #f4f4f5;
  color: #18181b;
}

.world-agent-studio .world-agent-conversation-host .canvas-agent-result-summary,
.world-agent-studio .world-agent-conversation-host .canvas-agent-conversation {
  display: none !important;
}

.world-agent-episode-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

@media (max-width: 820px) {
  .world-agent-workspace.world-agent-studio {
    grid-template-rows: 112px minmax(0, 1fr);
  }
}
