* {
  box-sizing: border-box;
}

/* Introducción de arranque: reutiliza la imagen institucional del escritorio
   y cubre la interfaz durante exactamente tres segundos. */
.startup-splash {
  align-items: center;
  background: #05080e;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 1;
  padding: 16px;
  position: fixed;
  transition: opacity 220ms ease-out;
  z-index: 10000;
}

.startup-splash--leaving {
  opacity: 0;
  pointer-events: none;
}

.startup-splash-art {
  max-width: calc(100vw - 32px);
  position: relative;
  width: min(800px, 100%);
}

.startup-splash-image {
  display: block;
  height: auto;
  max-height: calc(100vh - 32px);
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.startup-splash-loader {
  bottom: 13%;
  color: #102a43;
  display: grid;
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.02em;
  position: absolute;
  text-align: center;
  text-shadow: 0 1px 2px #ffffff;
  width: 100%;
}

.startup-splash-loader-text {
  display: block;
}

.startup-splash-progress {
  background: #d9f8ff4d;
  border: 1px solid #8cecff;
  border-radius: 99px;
  height: 6px;
  justify-self: center;
  overflow: hidden;
  width: min(260px, 65vw);
}

.startup-splash-progress span {
  animation: startup-splash-loading 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, #00d5f5, #b4f7ff, #00a9e8);
  border-radius: inherit;
  display: block;
  height: 100%;
  transform: translateX(-100%);
  width: 65%;
}

@keyframes startup-splash-loading {
  to { transform: translateX(155%); }
}

@media (prefers-reduced-motion: reduce) {
  .startup-splash-progress span { animation: none; transform: translateX(25%); }
}

/* Referencias comunes de ayuda: manuales y glosario Pybricks. */
.help-references { margin-top:28px; padding-top:22px; border-top:1px solid var(--help-border); }
.help-reference-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.help-reference-card { display:grid; gap:7px; min-height:112px; padding:14px; border:1px solid var(--help-border); border-radius:10px; background:var(--help-panel); color:var(--help-ink); text-decoration:none; }
.help-reference-card:hover { border-color:var(--help-accent); box-shadow:0 5px 14px #143a681f; }
.help-reference-card span,.help-reference-card small { color:var(--help-muted); }
.help-reference-card small { font-size:12px; }
.help-glossary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0 0; }
.help-glossary>div { padding:11px 13px; border-left:3px solid var(--help-accent); background:var(--help-panel); }
.help-glossary dt { font-weight:800; }
.help-glossary dd { margin:5px 0 0; color:var(--help-muted); font-size:14px; }
@media (max-width:620px) { .help-reference-grid,.help-glossary { grid-template-columns:1fr; } }

:root {
  --ev3-background: #f4f6f8;
  --ev3-surface: #ffffff;
  --ev3-surface-muted: #f8fafc;
  --ev3-text: #18212f;
  --ev3-text-muted: #314861;
  --ev3-primary: #294c7c;
  --ev3-primary-active: #213858;
  --ev3-success: #2e7d32;
  --ev3-warning: #f57f17;
  --ev3-danger: #b71c1c;
  --ev3-focus: #0d47a1;
  --ev3-border: #c5d2e2;
  --ev3-toolbar: #f8fafc;
  --ev3-toolbar-text: #0f172a;
  --ev3-space-page: 12px;
  --ev3-space-compact: 6px;
  --ev3-space-panel: 10px;
  --ev3-panel-radius: 4px;
  --ev3-canvas-min-height: 300px;
  --ev3-telemetry-min-width: 300px;
  --ev3-brick-min-width: 340px;
  --ev3-editor-min-width: 430px;
  --ev3-simulation-min-width: 700px;
  --ev3-status-strip-height: 30px;
}

html[data-theme="dark"] {
  --ev3-background: #0f1724;
  --ev3-surface: #152238;
  --ev3-surface-muted: #17253a;
  --ev3-text: #dbe5f5;
  --ev3-text-muted: #b8c8da;
  --ev3-primary: #2e5ea3;
  --ev3-primary-active: #3b67a5;
  --ev3-success: #81c784;
  --ev3-warning: #ffcc80;
  --ev3-danger: #ef9a9a;
  --ev3-focus: #90caf9;
  --ev3-border: #2b4a66;
  --ev3-toolbar: #111c2d;
  --ev3-toolbar-text: #e2e8f0;
}

/* Centro de ayuda orientado a tareas. */
.help-center { --help-ink:#102f5b; --help-muted:#4d6481; --help-border:#c5d6eb; --help-panel:#fff; --help-accent:#1459a8; --help-success:#16763f; --help-warning:#a94f09; max-width:1240px; margin:0 auto; padding:clamp(16px,3vw,36px); color:var(--help-ink); }
.contextual-help-link { display:inline-flex; align-items:center; min-height:28px; padding:4px 8px; border:1px solid #8fb3dc; border-radius:5px; color:#124f98; background:#f7fbff; font-size:12px; font-weight:700; text-decoration:none; white-space:nowrap; }.contextual-help-link:hover { background:#e4f0ff; }.contextual-help-link:focus-visible { outline:3px solid #e89620; outline-offset:2px; }html[data-theme="dark"] .contextual-help-link { border-color:#4c719b; background:#193653; color:#b9d8ff; }
.help-hero { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:14px; align-items:center; padding:clamp(20px,4vw,42px); border:1px solid var(--help-border); border-radius:18px; background:linear-gradient(125deg,#e9f3ff,#fff 60%); }
.help-brand { display:grid; place-items:center; width:48px; height:48px; border-radius:12px; background:var(--help-accent); color:#fff; font-size:15px; font-weight:800; text-decoration:none; }
.help-eyebrow { margin:0 0 4px; color:var(--help-accent); font-size:12px; font-weight:800; letter-spacing:.08em; }
.help-hero h1,.help-section-heading h2,.help-list-heading h2 { margin:0; color:var(--help-ink); }
.help-hero p:not(.help-eyebrow) { margin:6px 0 0; color:var(--help-muted); }.help-theme-control { color:var(--help-muted); font-weight:700; }
.help-search-panel { display:grid; grid-template-columns:minmax(180px,.65fr) minmax(0,2fr) minmax(130px,.6fr); gap:12px; align-items:center; margin:20px 0; padding:14px 18px; border:1px solid var(--help-border); border-radius:12px; background:var(--help-panel); }.help-search-panel label { font-weight:700; }.help-search-panel input { min-width:0; padding:10px 12px; border:1px solid #9db8d6; border-radius:8px; font:inherit; }.help-search-panel input:focus-visible,.help-category-nav button:focus-visible,.help-quick-card:focus-visible,.help-primary-action:focus-visible { outline:3px solid #e89620; outline-offset:2px; }.help-search-status { margin:0; color:var(--help-muted); font-size:14px; text-align:right; }
.help-quick-start { padding:20px 0 26px; }.help-section-heading,.help-list-heading { display:flex; justify-content:space-between; gap:16px; align-items:end; }.help-section-heading>a { color:var(--help-accent); font-weight:700; }.help-quick-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:14px; }.help-quick-card { display:grid; gap:8px; min-height:168px; padding:16px; border:1px solid var(--help-border); border-radius:14px; background:var(--help-panel); color:var(--help-ink); text-decoration:none; transition:transform .15s ease,box-shadow .15s ease; }.help-quick-card:hover { transform:translateY(-2px); box-shadow:0 8px 18px #183a6520; }.help-quick-card strong { font-size:16px; }.help-quick-card>span:not(.help-quick-number) { color:var(--help-muted); font-size:14px; line-height:1.4; }.help-quick-card small { margin-top:auto; color:var(--help-accent); font-weight:700; }.help-quick-number { color:var(--help-accent); font-size:12px; font-weight:800; }
.help-workspace { display:grid; grid-template-columns:240px minmax(0,1fr); gap:22px; align-items:start; }.help-sidebar { position:sticky; top:16px; padding:16px; border:1px solid var(--help-border); border-radius:14px; background:var(--help-panel); }.help-sidebar-title { margin:0 0 10px; color:var(--help-muted); font-size:11px; font-weight:800; letter-spacing:.08em; }.help-category-nav { display:grid; gap:4px; }.help-category-nav button { display:flex; justify-content:space-between; width:100%; border:0; border-radius:7px; padding:9px; background:transparent; color:var(--help-ink); font:inherit; text-align:left; cursor:pointer; }.help-category-nav button:hover,.help-category-nav button.is-active { background:#e4f0ff; color:#093f82; font-weight:700; }.help-category-nav span { color:var(--help-muted); }.help-sidebar-callout { margin-top:16px; padding:12px; border-radius:9px; background:#eff6ff; color:var(--help-muted); font-size:13px; }.help-sidebar-callout strong { color:var(--help-ink); }.help-sidebar-callout p { margin:6px 0; }.help-sidebar-callout a { color:var(--help-accent); font-weight:700; }
.help-guide-list { display:grid; gap:16px; }.help-list-heading { margin-bottom:2px; }.help-list-heading>p { max-width:360px; margin:0; color:var(--help-muted); text-align:right; }.help-guide-card { display:grid; grid-template-columns:minmax(210px,.75fr) minmax(190px,.58fr); grid-template-areas:"intro figure" "content content" "outcomes outcomes" "footer footer"; gap:16px; padding:20px; border:1px solid var(--help-border); border-radius:14px; background:var(--help-panel); scroll-margin-top:16px; }.help-guide-intro { grid-area:intro; }.help-guide-meta { display:flex; gap:8px; flex-wrap:wrap; font-size:12px; font-weight:800; color:var(--help-accent); }.help-guide-meta span { padding:3px 7px; border-radius:999px; background:#e7f1ff; }.help-guide-intro h3 { margin:10px 0 6px; color:var(--help-ink); font-size:21px; }.help-guide-intro p { margin:0; color:var(--help-muted); }.help-guide-intro .help-audience { margin-top:10px; font-size:13px; font-weight:700; }.help-guide-figure { grid-area:figure; margin:0; align-self:stretch; }.help-guide-figure img { display:block; width:100%; max-height:190px; object-fit:contain; border:1px solid var(--help-border); border-radius:9px; background:#f7fbff; }.help-guide-content { grid-area:content; display:grid; grid-template-columns:minmax(170px,.7fr) minmax(0,1.5fr); gap:20px; padding-top:4px; }.help-guide-content h4 { margin:0 0 7px; color:var(--help-ink); font-size:14px; }.help-guide-content ul,.help-guide-content ol { margin:0; padding-left:20px; color:var(--help-muted); }.help-guide-content li+li { margin-top:5px; }.help-guide-outcomes { grid-area:outcomes; display:grid; grid-template-columns:1fr 1fr; gap:12px; }.help-guide-outcomes p { margin:0; padding:11px 12px; border-radius:8px; font-size:14px; }.help-result { border-left:4px solid var(--help-success); background:#ecf8ef; color:#155d32; }.help-recovery { border-left:4px solid var(--help-warning); background:#fff5e9; color:#824006; }.help-guide-footer { grid-area:footer; display:flex; justify-content:space-between; align-items:center; gap:12px; padding-top:2px; color:var(--help-muted); font-size:13px; }.help-guide-footer a:not(.help-primary-action) { color:var(--help-accent); }.help-primary-action { display:inline-flex; gap:7px; padding:9px 12px; border-radius:7px; background:var(--help-accent); color:#fff; font-weight:700; text-decoration:none; }.help-empty { margin:0; padding:26px; border:1px dashed var(--help-border); border-radius:12px; color:var(--help-muted); text-align:center; }
html[data-theme="dark"] .help-center { --help-ink:#e6eef9; --help-muted:#b5c8e2; --help-border:#395676; --help-panel:#16283d; --help-accent:#78b6ff; --help-success:#53d27e; --help-warning:#ffc071; }html[data-theme="dark"] .help-hero { background:linear-gradient(125deg,#1a3658,#102034 60%); }html[data-theme="dark"] .help-search-panel input { border-color:#54769b; background:#102034; color:var(--help-ink); }html[data-theme="dark"] .help-quick-card:hover { box-shadow:0 8px 18px #00000070; }html[data-theme="dark"] .help-category-nav button:hover,html[data-theme="dark"] .help-category-nav button.is-active,html[data-theme="dark"] .help-sidebar-callout { background:#1e3d61; color:var(--help-ink); }html[data-theme="dark"] .help-guide-meta span { background:#1e426b; color:#b9d8ff; }html[data-theme="dark"] .help-guide-figure img { background:#102034; }html[data-theme="dark"] .help-result { background:#153d29; color:#c6f8d5; }html[data-theme="dark"] .help-recovery { background:#4a2c13; color:#ffe0ad; }
@media (max-width:900px) { .help-quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.help-workspace { grid-template-columns:1fr; }.help-sidebar { position:static; }.help-category-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }.help-sidebar-callout { display:none; } }@media (max-width:620px) { .help-hero { grid-template-columns:auto minmax(0,1fr); }.help-hero>.help-theme-control { grid-column:1; }.help-hero>select { grid-column:2; width:100%; }.help-search-panel { grid-template-columns:1fr; }.help-search-status { text-align:left; }.help-quick-grid,.help-category-nav,.help-guide-content,.help-guide-outcomes { grid-template-columns:1fr; }.help-guide-card { grid-template-columns:1fr; grid-template-areas:"intro" "figure" "content" "outcomes" "footer"; padding:14px; }.help-guide-footer,.help-section-heading,.help-list-heading { align-items:flex-start; flex-direction:column; }.help-list-heading>p { text-align:left; } }

body {
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  background: var(--ev3-background);
  color: var(--ev3-text);
}

html[data-theme="dark"] body {
  background: var(--ev3-background);
  color: var(--ev3-text);
}

body:has(.app-shell) {
  overflow: hidden;
}

button,
select,
textarea {
  font: inherit;
}

.app-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: #152238;
  color: #fff;
}

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

.toolbar button,
.toolbar a,
.action-link {
  border: 1px solid #8fb3dc;
  background: #f7fbff;
  color: #152238;
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.action-link {
  display: inline-block;
  text-align: center;
  border-color: #93a4b7;
  background: #f8fafc;
}

.hidden {
  display: none !important;
}

.execution-success-toast {
  position: fixed;
  z-index: 1000;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid #2e7d32;
  border-radius: 6px;
  background: #edf8ee;
  color: #174d1a;
  box-shadow: 0 10px 24px rgba(15, 35, 20, 0.22);
  font-weight: 600;
}

.execution-success-toast[hidden] {
  display: none;
}

.execution-success-toast button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
}

html[data-theme="dark"] .execution-success-toast {
  border-color: #66bb6a;
  background: #183b27;
  color: #e1f6e4;
}

.about-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  z-index: 900;
}

.about-dialog {
  position: fixed;
  z-index: 901;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 24px));
  background: #f8fbff;
  border: 1px solid #b8c8da;
  border-radius: 6px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.26);
}

.about-dialog-header,
.about-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.about-dialog-header {
  border-bottom: 1px solid #d9e4ef;
}

.about-dialog-header h3 {
  margin: 0;
  font-size: 16px;
  color: #1d2d44;
}

.about-dialog-text {
  margin: 0;
  padding: 12px;
  background: #f8fbff;
  color: #21344d;
  white-space: pre-wrap;
  font: 500 14px/1.45 "Segoe UI", Arial, sans-serif;
}

.about-groups {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.about-groups[hidden] {
  display: none;
}

.about-group-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid #d9e4ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

.about-group-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
  background: #f3f6fa;
}

.about-group-card h4 {
  margin: 0 0 2px;
  font-size: 13px;
  color: #16304f;
}

.about-group-card p {
  margin: 0;
  font-size: 12px;
  color: #2d425c;
  line-height: 1.35;
}

.about-dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid #d9e4ef;
}

.about-dialog button {
  border: 1px solid #9cb1c8;
  background: #fefefe;
  color: #1b3658;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}

.status-pill {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #d7e8fa;
  color: #102033;
  font-size: 12px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 29vw) 1fr minmax(260px, 24vw);
  gap: 10px;
  padding: 10px;
}

.world-editor-workspace {
  grid-template-columns: minmax(320px, 28vw) 1fr;
}

.left-panel,
.right-panel,
.center-panel {
  min-width: 0;
  min-height: 0;
}

.left-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

select {
  width: 100%;
  min-width: 0;
}

#codeEditor {
  width: 100%;
  min-height: 390px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #b7c3d0;
  border-radius: 6px;
  background: #0d1117;
  color: #e6edf3;
  font-family: Consolas, Menlo, monospace;
  font-size: 14px;
  line-height: 1.45;
}

.center-panel {
  display: flex;
  background: #fff;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  overflow: hidden;
}

#worldCanvas {
  width: 100%;
  height: 100%;
  min-height: 620px;
  display: block;
  background: #ffffff;
}

.card {
  background: #fff;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  padding: 12px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 0;
}

dt {
  color: #5b6878;
}

dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.console {
  min-height: 120px;
  white-space: pre-wrap;
  overflow: auto;
  background: #111827;
  color: #d1d5db;
  border-radius: 6px;
  padding: 10px;
}

.debug-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  background: #fff;
}

.debug-panel input {
  width: 100%;
  min-width: 0;
  border: 1px solid #aebdcd;
  border-radius: 4px;
  padding: 7px 8px;
}

.debug-state {
  grid-column: 1 / -1;
  color: #475569;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.editor-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  background: #fff;
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.save-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.save-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid #aebdcd;
  border-radius: 4px;
  padding: 7px 8px;
}

.input-suffix {
  align-self: center;
  color: #475569;
  font-size: 13px;
}

.tool-row button,
.save-row button {
  border: 1px solid #93a4b7;
  background: #f8fafc;
  color: #18212f;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.selection-readout {
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 4px;
  background: #eef3f8;
  color: #334155;
  font-size: 13px;
}

.tool-active {
  border-color: #1f8fce !important;
  background: #e8f4fc !important;
}

#importWorldInput {
  width: 100%;
}

.asset-properties {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #d8e0ea;
  font-size: 13px;
}

.led {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #778;
  background: #c9ced6;
  margin-bottom: 10px;
}

.brick-screen {
  min-height: 90px;
  border: 2px solid #667;
  background: #dbe8d4;
  padding: 8px;
  overflow: auto;
}

.brick-screen-canvas {
  display: block;
  width: 100%;
  max-width: 356px;
  aspect-ratio: 178 / 128;
  margin: 0 auto;
  background: #dbe8d4;
  image-rendering: pixelated;
}

.menu-bar {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--ev3-border);
  background: var(--ev3-toolbar);
  color: var(--ev3-toolbar-text);
  font-size: 13px;
}

.menu-bar strong {
  font-weight: 500;
}

.menu-bar nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.app-menu {
  gap: 2px;
}

.menu-group {
  position: relative;
}

.menu-trigger,
.menu-dropdown button,
.menu-dropdown a {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ev3-toolbar-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-trigger {
  padding: 3px 8px;
}

.menu-trigger:hover,
.menu-group:hover .menu-trigger,
.menu-group.is-open .menu-trigger {
  background: color-mix(in srgb, var(--ev3-primary) 14%, var(--ev3-toolbar));
}

.menu-dropdown {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  min-width: 190px;
  display: none;
  padding: 4px;
  border: 1px solid var(--ev3-border);
  background: var(--ev3-toolbar);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.menu-group:hover .menu-dropdown,
.menu-group.is-open .menu-dropdown {
  display: block;
}

.menu-dropdown button,
.menu-dropdown a,
.menu-empty {
  padding: 6px 10px;
  white-space: nowrap;
}

.menu-dropdown button:hover,
.menu-dropdown a:hover {
  background: color-mix(in srgb, var(--ev3-primary) 10%, var(--ev3-toolbar));
}

.menu-dropdown button.is-active {
  background: color-mix(in srgb, var(--ev3-primary) 14%, var(--ev3-toolbar));
  color: var(--ev3-primary-active);
  font-weight: 600;
}

.menu-empty {
  display: block;
  color: #64748b;
}

.menu-subgroup {
  border-top: 1px solid #c7d2de;
}

.menu-subtoggle {
  width: 100%;
  text-align: left;
  font-weight: 600;
}

.menu-sublist {
  display: flex;
  flex-direction: column;
}

.menu-sublist button {
  padding-left: 18px;
}

.menu-bar a {
  color: #111827;
  text-decoration: none;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #233d68;
  font-size: 18px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #8ba4c8;
  color: #233d68;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  background: #f7fbff;
}

.sim-workspace {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 36px;
  gap: var(--ev3-space-compact);
  padding: 4px var(--ev3-space-page) 0;
  background: #f5f7fb;
  overflow: hidden;
}

.sim-status-strip {
  display: flex;
  align-items: center;
  gap: 42px;
  padding: 0 2px;
  border-top: 1px solid #d7e0ec;
  background: #f8fbff;
  color: #324968;
  font-size: 12px;
}

.sim-status-strip span:last-child {
  margin-left: auto;
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  background: #35bd57;
}

.sim-main-area {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(620px, 1.18fr) minmax(var(--ev3-editor-min-width), 0.82fr);
  gap: var(--ev3-space-panel);
  overflow: hidden;
}

.sim-left-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) minmax(230px, 0.62fr);
  gap: var(--ev3-space-panel);
  overflow: hidden;
}

.sim-bottom-panels {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(430px, 1.18fr) minmax(var(--ev3-brick-min-width), 0.82fr);
  gap: var(--ev3-space-panel);
  overflow: hidden;
}

.sim-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid #d4dde8;
  border-radius: var(--ev3-panel-radius);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.sim-panel-header {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 11px;
  border-bottom: 1px solid #e3e9f1;
  color: #1d2d44;
}

.sim-panel-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.panel-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.world-name-inline {
  min-width: 0;
  color: #35506f;
  font-size: 12px;
  font-family: Consolas, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-name-inline span {
  font-weight: 600;
  color: #1f3a5a;
}

.map-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-tools button {
  width: 26px;
  height: 24px;
  border: 1px solid #cbd7e6;
  border-radius: 4px;
  background: #f8fbff;
  color: #2d4671;
  cursor: pointer;
  font-size: 12px;
}

#toggleSensorBeamsBtn {
  width: auto;
  min-width: 84px;
  padding: 0 8px;
}

.map-tools button.is-active {
  background: #dbefff;
  border-color: #8fb4de;
}

.sim-map-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.sim-map-pane,
.sim-telemetry-pane,
.sim-code-pane,
.sim-brick-pane,
.world-canvas-pane,
.properties-pane {
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.sim-map-pane,
.world-canvas-pane {
  display: grid;
  overflow: auto;
  padding: 10px 12px;
  background:
    linear-gradient(#e7edf5 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, #e7edf5 1px, transparent 1px) 0 0 / 24px 24px,
    #fff;
}

.sim-map-pane #worldCanvas,
.world-canvas-pane #worldCanvas {
  width: min(100%, 980px);
  max-width: 100%;
  height: auto;
  min-height: 0;
  display: block;
  border: 0;
  background: #fff;
  box-shadow: none;
}

.sim-telemetry-pane {
  display: grid;
  grid-template-columns: minmax(220px, 34fr) minmax(220px, 34fr) minmax(190px, 32fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: auto;
  padding: 0;
  background: #fff;
}

.sim-telemetry-pane .sim-panel-header {
  grid-column: 1 / -1;
}

.telemetry-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, auto minmax(64px, 1fr));
  align-items: stretch;
  border-bottom: 1px solid #d8e1ec;
  background: #f7f9fc;
}

.telemetry-summary span,
.telemetry-summary strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 3px 7px;
  border-right: 1px solid #d8e1ec;
  color: #50627b;
  font-size: 11px;
}

.telemetry-summary strong {
  color: #123a69;
  font-size: 12px;
}

/* El texto técnico queda disponible para pruebas, copiado y diagnóstico;
   la etiqueta visible procede del catálogo compartido Web–Tkinter. */
#sessionStatus[data-label],
#telemetryStatus[data-label] {
  color: transparent;
  font-size: 0;
}

#sessionStatus[data-label]::after,
#telemetryStatus[data-label]::after {
  color: var(--ev3-primary);
  content: attr(data-label);
  font-size: 12px;
  font-weight: 700;
}

#sessionStatus[data-status="running"]::after,
#sessionStatus[data-status="started"]::after,
#sessionStatus[data-status="resumed"]::after,
#sessionStatus[data-status="finished"]::after,
#telemetryStatus[data-status="running"]::after,
#telemetryStatus[data-status="started"]::after,
#telemetryStatus[data-status="resumed"]::after,
#telemetryStatus[data-status="finished"]::after { color: var(--ev3-success); }

#sessionStatus[data-status="paused"]::after,
#sessionStatus[data-status="timed_out"]::after,
#telemetryStatus[data-status="paused"]::after,
#telemetryStatus[data-status="timed_out"]::after { color: var(--ev3-warning); }

#sessionStatus[data-status="error"]::after,
#telemetryStatus[data-status="error"]::after { color: var(--ev3-danger); }

html[data-theme="dark"] #sessionStatus[data-status="created"]::after,
html[data-theme="dark"] #sessionStatus[data-status="ready"]::after,
html[data-theme="dark"] #telemetryStatus[data-status="created"]::after,
html[data-theme="dark"] #telemetryStatus[data-status="ready"]::after {
  color: #9ac5ff;
}

.telemetry-summary strong:last-child { border-right: 0; }
.telemetry-summary .is-alert { color: #b42318; }

.mission-result {
  margin: 8px 10px 0;
  padding: 7px 10px;
  border: 1px solid var(--border-color, #9aa4b2);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}

.mission-result-success { color: #16753a; background: #edf9f0; }
.mission-result-failure { color: #a32218; background: #fff2f0; }

.telemetry-section {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 9px 10px;
  margin: 0;
  border-right: 1px solid #e4eaf2;
  border-bottom: 0;
}

.telemetry-section:last-child {
  border-right: 0;
}

.telemetry-section h3 {
  margin: 0 0 8px;
  color: #244977;
  font-size: 12px;
}

.sim-telemetry-pane dl {
  grid-template-columns: minmax(58px, auto) 1fr;
  gap: 7px 8px;
  font-size: 12px;
}

.sim-telemetry-pane dd,
.sim-telemetry-pane #motorsAB,
.sim-telemetry-pane #motorsCD,
.sim-telemetry-pane #sensors {
  color: #1f2f46;
  font-family: Segoe UI, Arial, sans-serif;
}

.sim-telemetry-pane #motorsAB,
.sim-telemetry-pane #motorsCD,
.sim-telemetry-pane #sensors {
  display: grid;
  gap: 7px;
}

.telemetry-card {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #e1e8f0;
  border-radius: 4px;
  background: #fff;
  color: #1f2f46;
  font-size: 12px;
}

.telemetry-card-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: #0f3f75;
  font-weight: 700;
  min-width: 0;
}

.telemetry-card-title span {
  min-width: 0;
}

.telemetry-state {
  flex: 0 0 auto;
  color: #0a7a39;
  font-size: 11px;
}

.sensor-port {
  flex: 0 0 auto;
}

.sensor-type {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-mini-list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  margin: 0;
}

.telemetry-mini-list dt {
  color: #607089;
}

.telemetry-mini-list dd {
  color: #14253c;
  text-align: right;
  overflow-wrap: anywhere;
}

.motor-card {
  padding: 6px 8px;
}

.is-disconnected {
  opacity: 0.78;
}

.motor-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #14253c;
  font-size: 12px;
}

.motor-metrics span {
  white-space: nowrap;
}

.motor-metrics b {
  color: #607089;
  font-weight: 400;
}

.telemetry-empty {
  margin: 0;
  color: #68788f;
  font-size: 12px;
}

.sim-code-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  background: #fff;
}

.sim-code-pane .code-header {
  min-height: 25px;
  padding: 3px 10px;
}

.sim-code-pane .code-header h2 {
  font-size: 12px;
}

.sim-code-pane .code-header select {
  min-height: 28px;
  padding: 2px 6px;
}

.sim-control-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 0;
  border: 0;
  background: transparent;
}

.sim-control-group {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 0;
  border: 0;
  background: transparent;
}

.sim-control-bar label {
  color: #314861;
  font-size: 12px;
}

.sim-control-bar button {
  min-height: 28px;
  border: 1px solid #c5d2e2;
  border-radius: 4px;
  padding: 4px 11px;
  background: #fff;
  color: #213858;
  cursor: pointer;
  font-size: 12px;
}

.sim-control-bar button:disabled,
.sim-code-pane .debug-panel button:disabled,
.sim-code-pane .debug-panel input:disabled,
.sim-control-bar .theta-input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.sim-control-bar .theta-input {
  width: 64px;
  min-height: 27px;
  border: 1px solid #c5d2e2;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
}

.sim-control-bar .robot-location-controls {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid #cfd9e6;
  justify-content: flex-start;
}

.sim-control-bar .run-button {
  background: #294c7c;
  border-color: #294c7c;
  color: #fff;
}

.sim-control-bar .stop-button {
  background: var(--ev3-danger);
  border-color: var(--ev3-danger);
  color: #fff;
}

.sim-control-bar .stop-button:hover {
  background: #8f1515;
  border-color: #8f1515;
  color: #fff;
}

.sim-control-bar .stop-button:focus-visible {
  outline: 2px solid var(--ev3-focus);
  outline-offset: 2px;
}

.sim-control-bar .stop-button:disabled {
  color: #fff;
}

.sim-control-bar .debug-button {
  background: #fff;
  color: #213858;
}

.sim-control-bar .step-button {
  background: #fff;
  color: #213858;
}

.sim-control-bar .continue-button {
  background: #fff;
  color: #213858;
}

.sim-code-pane .debug-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 6px;
  padding: 4px 10px;
  border: 0;
  border-bottom: 1px solid #e3e9f1;
  border-radius: 0;
  background: #fbfdff;
  color: #314861;
  font-size: 12px;
}

.sim-code-pane .debug-state {
  flex: 1 1 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #2d68af;
}

.sim-code-pane .debug-panel button,
.sim-code-pane .debug-panel input {
  min-height: 24px;
  border: 1px solid #c6d3e2;
  border-radius: 4px;
  background: #fff;
  color: #203653;
  padding: 3px 7px;
  font-size: 12px;
}

.sim-code-pane .debug-panel label {
  white-space: nowrap;
}

.sim-code-pane .debug-panel #breakpointsInput {
  flex: 0 1 130px;
  min-width: 84px;
}

.sim-code-pane .debug-panel #watchesInput {
  flex: 1 1 220px;
  min-width: 150px;
}

.sim-code-pane .debug-panel .debug-button,
.sim-code-pane .debug-panel .step-button,
.sim-code-pane .debug-panel .continue-button {
  min-width: 64px;
}

.debug-watches {
  border-top: 1px solid #d8e2ee;
  border-bottom: 1px solid #d8e2ee;
  background: #f8fbff;
  padding: 6px 8px;
  font-size: 12px;
  color: #274264;
}

.debug-watches-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.debug-watches-empty {
  color: #516b89;
  font-style: italic;
  padding: 4px 0;
}

.debug-watches-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.debug-watches-table th,
.debug-watches-table td {
  border-top: 1px solid #e1e9f3;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.debug-watches-table th {
  color: #35557a;
  font-weight: 700;
}

.debug-watches-table th:nth-child(1),
.debug-watches-table td:nth-child(1) {
  width: 42%;
}

.debug-watches-table th:nth-child(2),
.debug-watches-table td:nth-child(2) {
  width: 30%;
}

.debug-watches-table th:nth-child(3),
.debug-watches-table td:nth-child(3) {
  width: 28%;
}

.debug-watch-row-error td:nth-child(3) {
  color: #b13131;
}

.robot-start-readout {
  max-width: 320px;
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #d7e1ed;
  border-radius: 4px;
  background: #fbfdff;
  color: #8b5d00;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-editor-shell {
  --editor-font-family: Consolas, Menlo, monospace;
  --editor-font-size: 13px;
  --editor-line-height: 1.45;
  --editor-line-height-px: calc(var(--editor-font-size) * var(--editor-line-height));
  --editor-pad-top: 12px;
  --editor-pad-right: 12px;
  --editor-pad-bottom: 72px;
  --editor-pad-left: 12px;
  position: relative;
  z-index: 4;
  min-height: 0;
  min-height: 280px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  overflow: hidden;
}

.editor-gutter {
  overflow: hidden;
  border-right: 1px solid #e1e8f0;
  background: #f8fafc;
  color: #74849a;
  box-sizing: border-box;
  padding: var(--editor-pad-top) 0 var(--editor-pad-bottom);
  font-family: var(--editor-font-family);
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height-px);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.gutter-line {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  width: 100%;
  height: var(--editor-line-height-px);
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 2px;
  align-items: center;
  line-height: var(--editor-line-height-px);
  padding: 0 5px;
  font: inherit;
  color: inherit;
  text-align: right;
  cursor: pointer;
  box-sizing: border-box;
}

.gutter-line::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.gutter-line.has-breakpoint::before {
  background: #2f66b3;
}

.gutter-line.current-debug-line {
  background: #e8f1ff;
  color: #1d4f91;
}

.syntax-highlight,
.sim-code-pane #codeEditor {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 12px 12px 72px;
  padding: var(--editor-pad-top) var(--editor-pad-right) var(--editor-pad-bottom) var(--editor-pad-left);
  overflow: auto;
  font-family: var(--editor-font-family);
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height-px);
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 4;
}

.syntax-highlight {
  pointer-events: none;
  background: #fff;
  color: #172033;
}

.syntax-line {
  display: block;
  min-height: var(--editor-line-height-px);
  line-height: var(--editor-line-height-px);
  white-space: pre;
}

.syntax-line.current-debug-line {
  background: #e8f1ff;
}

.sim-code-pane #codeEditor {
  position: relative;
  z-index: 2;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: #1b3557;
}

.sim-code-pane #codeEditor::selection {
  background: rgba(56, 139, 253, 0.35);
}

.syntax-kw {
  color: #0b57d0;
  font-weight: 600;
}

.syntax-builtin {
  color: #6f2dbd;
}

.syntax-string {
  color: #b54708;
}

.syntax-comment {
  color: #2f7d32;
  font-style: italic;
}

.syntax-number {
  color: #0f4aa1;
}

.syntax-import {
  color: #0b7285;
}

.syntax-defname {
  color: #8e24aa;
  font-weight: 600;
}

.syntax-classname {
  color: #9a3412;
  font-weight: 600;
}

.syntax-decorator {
  color: #c62828;
}

.syntax-const {
  color: #7b1fa2;
  font-weight: 600;
}

.autocomplete-popup {
  position: absolute;
  z-index: 120;
  left: 54px;
  top: 10px;
  width: min(300px, calc(100% - 60px));
  max-height: min(220px, calc(100% - 16px));
  overflow: auto;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #fefefe;
  color: #16345b;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.28);
  font-family: Consolas, Menlo, monospace;
  font-size: 14px;
}

.autocomplete-item {
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
}

.autocomplete-item:hover {
  background: #e8f1ff;
  color: #16345b;
}

.autocomplete-item.active {
  background: #1e40af;
  color: #ffffff;
}

.sim-code-pane .console {
  min-height: calc((1.35em * 5) + 8px);
  line-height: 1.35;
  max-height: calc((1.35em * 5) + 8px);
  margin: 0;
  border-radius: 0;
  background: #f8fbff;
  color: #28425f;
  border-top: 1px solid #e3e9f1;
  padding: 4px 10px;
}

.sim-code-pane .console:empty {
  display: none;
}

.program-name-strip {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 10px;
  border-top: 1px solid #e3e9f1;
  background: #f4f8fc;
  color: #385273;
  font-size: 12px;
  font-family: Consolas, Menlo, monospace;
}

.program-name-strip .program-current span,
.program-name-strip .save-path-inline span {
  font-weight: 600;
  color: #1f3a5a;
}

.sim-brick-pane {
  overflow: auto;
  background: #fff;
  color: #1f2f46;
}

.brick-card {
  height: 100%;
  padding: 0;
}

.brick-card h2 {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #e3e9f1;
  font-size: 13px;
}

.brick-card h3 {
  margin: 8px 12px 6px;
  color: #244977;
  font-size: 12px;
}

.brick-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #e3e9f1;
  font-size: 12px;
}

.led-row,
.speaker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.led-row .led {
  display: inline-block;
  margin: 0;
}

.sim-brick-pane .brick-screen {
  width: min(260px, calc(100% - 24px));
  height: auto;
  min-height: 0;
  aspect-ratio: 178 / 128;
  margin: 0 auto;
  border: 1px solid #9fb1d0;
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      to bottom,
      #f8fbf5 0,
      #f8fbf5 17px,
      #e5ecd8 18px
    );
  color: #111827;
}

.brick-robot-state {
  margin: 14px 12px;
  border: 1px solid #d8e1ec;
}

.brick-robot-state h3 {
  margin: 0;
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #d8e1ec;
}

.brick-robot-state dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.brick-robot-state dt,
.brick-robot-state dd {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #e3e9f1;
}

.brick-robot-state dt { text-align: center; }
.brick-robot-state dd { text-align: center; font-weight: 700; }

@media (min-height: 940px) {
  .sim-brick-pane .brick-screen {
    width: min(356px, calc(100% - 24px));
  }
}

@media (max-height: 820px) {
  .sim-brick-pane .brick-screen {
    width: min(240px, calc(100% - 24px));
  }
}

.speaker-status {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4f5d72;
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.world-editor-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto minmax(0, auto);
  gap: 6px;
  padding: 6px;
  background: #d8e1e8;
}

.world-editor-toolbar,
.world-size-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  border: 1px solid #a8b5c0;
  background: #edf3f7;
}

.world-editor-toolbar {
  align-items: stretch;
  gap: 8px;
}

.world-toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 3px 5px 5px;
  border: 1px solid #b8c5d0;
  background: #f7fafc;
}

.world-toolbar-group legend {
  padding: 0 4px;
  color: #3b5875;
  font-size: 11px;
  font-weight: 700;
}

.world-toolbar-group-simulation {
  margin-left: auto;
}

.world-toolbar-group .action-link,
.world-toolbar-group .contextual-help-link {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  box-sizing: border-box;
  padding: 4px 9px;
  border: 1px solid #8a9bab;
  background: #f8fafc;
  color: #1b4f8a;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.world-editor-toolbar button,
.world-size-bar button,
.world-size-bar input,
.world-editor-toolbar select {
  min-height: 27px;
  border: 1px solid #8a9bab;
  border-radius: 0;
  background: #f8fafc;
  color: #111827;
  padding: 4px 9px;
}

.world-editor-toolbar select {
  width: min(240px, 100%);
}

.toolbar-separator {
  width: 1px;
  align-self: stretch;
  background: #9fb0bf;
  margin: 0 4px;
}

.asset-palette {
  display: grid;
  gap: 10px;
}

.asset-library-pane {
  overflow: auto;
  padding: 10px;
  background: #f4f7fa;
}

.asset-library-pane h2,
.asset-category h3 {
  margin: 0 0 8px;
  color: #294c7c;
}

.asset-library-pane > label,
.library-hint {
  display: block;
  font-size: 13px;
  color: #455a64;
}

.asset-library-pane input {
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 8px;
  padding: 6px;
}

.library-hint { margin: 0 0 10px; }
.asset-category h3 { font-size: 13px; }
.asset-category-items { display: grid; grid-template-columns: 1fr; gap: 4px; }

.asset-tool {
  min-height: 40px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 6px;
  padding: 4px 6px !important;
  font-size: 12px;
  text-align: left;
  font-weight: 600;
  border-color: #8ea0b0 !important;
  background: #fff !important;
}

.asset-tool img {
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

.world-size-bar {
  font-size: 13px;
}

.world-size-bar input[type="number"] {
  width: 56px;
}

.world-name-readout {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 1px solid #8a9bab;
  background: #f8fafc;
  padding: 4px 9px;
  color: #111827;
}

.world-size-presets { display: inline-flex; gap: 3px; }
.world-size-hint { color: #455a64; font-size: 12px; }

.world-canvas-pane { position: relative; }

.empty-world-guide {
  position: absolute;
  top: 42px;
  left: 42px;
  z-index: 2;
  display: grid;
  gap: 5px;
  width: min(360px, calc(100% - 84px));
  padding: 16px;
  border: 1px solid #90a4ae;
  background: rgba(255, 255, 255, .94);
  color: #37474f;
  pointer-events: none;
}

.empty-world-guide strong { color: #0d47a1; font-size: 16px; }

.world-name-readout #worldNameLabel {
  margin-left: 6px;
  font-weight: 600;
}

.world-dirty-indicator {
  margin-left: 8px;
  color: #9b5b00;
  font-size: 11px;
  font-weight: 700;
}

.world-editor-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, .32fr) minmax(480px, 1fr) 300px;
  gap: 6px;
}

.properties-pane {
  overflow: auto;
  padding: 10px;
  background: #f4f7fa;
}

.properties-pane h2 {
  margin: 0 0 10px;
  padding: 7px 8px;
  background: #e3eaf0;
  border-left: 4px solid #44627e;
  font-size: 14px;
}

.properties-pane .selection-readout {
  border-radius: 0;
  background: transparent;
  padding: 2px 0 12px;
  font-weight: 600;
}

.properties-pane .asset-properties {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 5px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.properties-pane .asset-properties dd {
  min-height: 20px;
  padding: 2px 4px;
  border: 1px solid #c7d0da;
  background: #fff;
  text-align: left;
}

.asset-properties-form {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}

.asset-properties-form input,
.asset-properties-form select {
  min-width: 0;
  border: 1px solid #aebdcd;
  padding: 5px 6px;
}

.asset-properties-form button {
  grid-column: 1 / -1;
  min-height: 28px;
  border: 1px solid #8a9bab;
  background: #e8eff5;
  cursor: pointer;
}

.layer-list {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid #c7d0da;
  background: #fff;
}

.layer-row.selected { border-color: #294c7c; background: #e8f1fb; }
.layer-row button { min-width: 0; padding: 4px 5px; font-size: 12px; }
.layer-row button:first-child { text-align: left; }

.world-status-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border: 1px solid #b7c3d0;
  background: #d7e1e7;
  font-size: 13px;
}

.world-status-bar #validationStatus {
  color: #087a21;
}

.world-console {
  min-height: 42px;
  max-height: 86px;
  margin: 0;
  border-radius: 0;
}

.world-editor-toolbar button:focus-visible,
.world-size-bar button:focus-visible,
.asset-tool:focus-visible,
.layer-row button:focus-visible,
.asset-properties-form input:focus-visible,
.asset-properties-form select:focus-visible {
  outline: 3px solid #2d74bc;
  outline-offset: 2px;
}

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

.help {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  line-height: 1.5;
}

.help h1 {
  margin-top: 0;
}

.help-lead {
  color: #475569;
  font-size: 18px;
}

.help-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 22px;
}

.help-nav a {
  border: 1px solid #8fb3dc;
  background: #f7fbff;
  color: #152238;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
}

.help-theme-control {
  align-self: center;
  color: #324968;
  font-size: 14px;
}

.help-nav select[data-theme-select] {
  min-height: 34px;
  border: 1px solid #8fb3dc;
  border-radius: 4px;
  background: #f7fbff;
  color: #152238;
  padding: 6px 10px;
}

.help-section {
  margin: 18px 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #c9d3df;
  border-radius: 6px;
}

.help-section h2 {
  margin-top: 0;
}

.help-tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.tutorial-card {
  border: 1px solid #b8c7d6;
  background: #f8fbff;
  border-radius: 6px;
  padding: 12px;
}

.tutorial-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.tutorial-figure {
  margin: 0 0 10px;
}

.tutorial-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #c6d4e1;
  border-radius: 4px;
  background: #fff;
}

.tutorial-steps {
  margin: 0;
  padding-left: 20px;
}

.tutorial-result,
.tutorial-fallback {
  margin: 10px 0 0;
  padding: 8px;
  border-radius: 4px;
}

.tutorial-result {
  background: #eaf6ed;
  border-left: 3px solid #2f9d57;
}

.tutorial-fallback {
  background: #fff4ea;
  border-left: 3px solid #d17a20;
}

.help code {
  font-family: Consolas, Menlo, monospace;
}

.help pre {
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  background: #111827;
  color: #d1d5db;
  border-radius: 6px;
}

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

.help-grid h3 {
  margin: 0;
  font-size: 15px;
}

.help-dl {
  grid-template-columns: minmax(180px, 0.8fr) 1.2fr;
}

.help-dl dd {
  text-align: left;
}

html[data-theme="dark"] .app-shell {
  background: #0f1724;
}

html[data-theme="dark"] .menu-bar {
  border-bottom-color: #26354b;
  background: #111c2d;
  color: #e2e8f0;
}

html[data-theme="dark"] .menu-bar a,
html[data-theme="dark"] .menu-trigger,
html[data-theme="dark"] .menu-dropdown button,
html[data-theme="dark"] .menu-dropdown a {
  color: #e2e8f0;
}

html[data-theme="dark"] .menu-trigger:hover,
html[data-theme="dark"] .menu-group:hover .menu-trigger,
html[data-theme="dark"] .menu-group.is-open .menu-trigger {
  background: #1f324d;
}

html[data-theme="dark"] .menu-dropdown {
  border-color: #355178;
  background: #17253a;
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.55);
}

html[data-theme="dark"] .menu-dropdown button:hover,
html[data-theme="dark"] .menu-dropdown a:hover {
  background: #264265;
}

html[data-theme="dark"] .menu-dropdown button.is-active {
  background: #2f4f78;
  color: #f8fbff;
}

html[data-theme="dark"] .menu-empty {
  color: #9eb4d0;
}

html[data-theme="dark"] .menu-subgroup {
  border-top-color: #2f4666;
}

html[data-theme="dark"] .app-brand,
html[data-theme="dark"] .brand-mark {
  color: #d7e6ff;
}

html[data-theme="dark"] .brand-mark {
  border-color: #5a7aa3;
  background: #17253a;
}

html[data-theme="dark"] .sim-workspace {
  background: #0f1724;
}

html[data-theme="dark"] .sim-status-strip {
  border-top-color: #26354b;
  background: #111c2d;
  color: #bfd0e6;
}

html[data-theme="dark"] .sim-panel,
html[data-theme="dark"] .world-canvas-pane,
html[data-theme="dark"] .properties-pane,
html[data-theme="dark"] .help-section,
html[data-theme="dark"] .card,
html[data-theme="dark"] .center-panel {
  border-color: #2a3e5a;
  background: #152235;
  color: #dbe5f5;
}

html[data-theme="dark"] .sim-panel-header,
html[data-theme="dark"] .brick-card h2,
html[data-theme="dark"] .brick-status-row,
html[data-theme="dark"] .brick-robot-state,
html[data-theme="dark"] .brick-robot-state h3,
html[data-theme="dark"] .sim-code-pane .debug-panel,
html[data-theme="dark"] .program-name-strip {
  border-color: #2a3e5a;
  background: #16263a;
  color: #c7d8ee;
}

html[data-theme="dark"] .brick-robot-state dt,
html[data-theme="dark"] .brick-robot-state dd {
  border-color: #2a3e5a;
  color: #dbe5f5;
}

html[data-theme="dark"] .world-name-inline,
html[data-theme="dark"] .sim-control-bar label,
html[data-theme="dark"] .debug-state,
html[data-theme="dark"] .program-name-strip .program-current span,
html[data-theme="dark"] .program-name-strip .save-path-inline span {
  color: #a8bfdc;
}

html[data-theme="dark"] .sim-map-pane,
html[data-theme="dark"] .world-canvas-pane {
  background:
    linear-gradient(#213149 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, #213149 1px, transparent 1px) 0 0 / 24px 24px,
    #0f1724;
}

html[data-theme="dark"] .sim-map-pane #worldCanvas,
html[data-theme="dark"] .world-canvas-pane #worldCanvas {
  background: #0f1724;
}

html[data-theme="dark"] .world-editor-shell,
html[data-theme="dark"] .world-editor-toolbar,
html[data-theme="dark"] .world-size-bar,
html[data-theme="dark"] .world-status-bar {
  border-color: #2a3e5a;
  background: #111c2d;
  color: #dbe5f5;
}

html[data-theme="dark"] .world-toolbar-group {
  border-color: #355178;
  background: #16263a;
}

html[data-theme="dark"] .world-toolbar-group legend,
html[data-theme="dark"] .world-toolbar-group .action-link,
html[data-theme="dark"] .world-toolbar-group .contextual-help-link {
  color: #c7d8ee;
}

html[data-theme="dark"] .world-toolbar-group .action-link,
html[data-theme="dark"] .world-toolbar-group .contextual-help-link {
  border-color: #3d5b82;
  background: #16263a;
}

html[data-theme="dark"] button,
html[data-theme="dark"] select,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea {
  border-color: #3d5b82;
  background: #16263a;
  color: #e4ecf9;
}

html[data-theme="dark"] .sim-control-bar button,
html[data-theme="dark"] .map-tools button,
html[data-theme="dark"] .world-editor-toolbar button,
html[data-theme="dark"] .world-size-bar button {
  background: #1d2f49;
  color: #e4ecf9;
}

html[data-theme="dark"] .map-tools button.is-active {
  background: #2b4a66;
  border-color: #4f7aa1;
  color: #eaf4ff;
}

html[data-theme="dark"] .sim-control-bar .run-button {
  background: #2e5ea3;
  border-color: #2e5ea3;
}

html[data-theme="dark"] .sim-control-bar .stop-button,
html[data-theme="dark"] .sim-control-bar .stop-button:hover {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

html[data-theme="dark"] .sim-control-bar .robot-location-controls {
  border-left-color: #2a3e5a;
}

html[data-theme="dark"] .telemetry-section,
html[data-theme="dark"] .telemetry-card,
html[data-theme="dark"] .telemetry-summary,
html[data-theme="dark"] .world-status-bar,
html[data-theme="dark"] .world-editor-toolbar,
html[data-theme="dark"] .world-size-bar,
html[data-theme="dark"] .properties-pane h2,
html[data-theme="dark"] .properties-pane .asset-properties dd,
html[data-theme="dark"] .asset-properties-form button {
  border-color: #2a3e5a;
  background: #18293f;
  color: #dbe5f5;
}

html[data-theme="dark"] .telemetry-state {
  color: #4dd082;
}

html[data-theme="dark"] .telemetry-summary strong {
  color: #e6eefb;
}

html[data-theme="dark"] .telemetry-summary .is-alert {
  color: #ffaaa1;
}

html[data-theme="dark"] .mission-result-success {
  color: #6fe49b;
  background: #173a2a;
  border-color: #347a55;
}

html[data-theme="dark"] .mission-result-failure {
  color: #ffaaa1;
  background: #482323;
  border-color: #90514c;
}

html[data-theme="dark"] .sim-telemetry-pane dd,
html[data-theme="dark"] .sim-telemetry-pane #motorsAB,
html[data-theme="dark"] .sim-telemetry-pane #motorsCD,
html[data-theme="dark"] .sim-telemetry-pane #sensors,
html[data-theme="dark"] .telemetry-mini-list dd,
html[data-theme="dark"] .motor-metrics,
html[data-theme="dark"] .sensor-type {
  color: #e6eefb;
}

html[data-theme="dark"] .telemetry-mini-list dt,
html[data-theme="dark"] .motor-metrics b {
  color: #a8bfdc;
}

html[data-theme="dark"] .selection-readout,
html[data-theme="dark"] .robot-start-readout,
html[data-theme="dark"] .world-name-readout {
  border-color: #2f4769;
  background: #17283d;
  color: #b8cce6;
}

html[data-theme="dark"] .sim-code-pane #codeEditor {
  caret-color: #c9dcff;
}

html[data-theme="dark"] .editor-gutter {
  border-right-color: #2a3e5a;
  background: #111c2d;
  color: #88a3c6;
}

html[data-theme="dark"] .gutter-line.current-debug-line,
html[data-theme="dark"] .syntax-line.current-debug-line {
  background: #2a3f5f;
}

html[data-theme="dark"] .syntax-highlight {
  background: #152235;
  color: #dde8fa;
}

html[data-theme="dark"] .syntax-kw {
  color: #7bb7ff;
}

html[data-theme="dark"] .syntax-builtin {
  color: #c0a2ff;
}

html[data-theme="dark"] .syntax-string {
  color: #ffb86b;
}

html[data-theme="dark"] .syntax-comment {
  color: #79c98a;
}

html[data-theme="dark"] .syntax-number {
  color: #8fc0ff;
}

html[data-theme="dark"] .syntax-import {
  color: #6fd7ea;
}

html[data-theme="dark"] .syntax-defname {
  color: #db9cff;
}

html[data-theme="dark"] .syntax-classname {
  color: #ffb37a;
}

html[data-theme="dark"] .syntax-decorator {
  color: #ff8f8f;
}

html[data-theme="dark"] .syntax-const {
  color: #d2a6ff;
}

html[data-theme="dark"] .autocomplete-popup {
  border-color: #4d79b5;
  background: #1a2c45;
  color: #e3edff;
  box-shadow: 0 14px 28px rgba(2, 8, 23, 0.6);
}

html[data-theme="dark"] .autocomplete-item:hover {
  background: #2b4366;
  color: #f5f9ff;
}

html[data-theme="dark"] .autocomplete-item.active {
  background: #3b67a5;
}

html[data-theme="dark"] .sim-code-pane .console,
html[data-theme="dark"] .world-console {
  border-color: #2a3e5a;
  background: #0f1a2b;
  color: #b9cee8;
}

html[data-theme="dark"] .sim-brick-pane .brick-screen,
html[data-theme="dark"] .brick-screen {
  border-color: #4a6489;
  background:
    repeating-linear-gradient(
      to bottom,
      #d5dec9 0,
      #d5dec9 17px,
      #bdcab1 18px
    );
  color: #0f172a;
}

html[data-theme="dark"] .about-dialog {
  border-color: #385172;
  background: #1a2c45;
}

html[data-theme="dark"] .about-dialog-header,
html[data-theme="dark"] .about-dialog-footer {
  border-color: #2a3e5a;
}

html[data-theme="dark"] .about-dialog-header h3,
html[data-theme="dark"] .about-dialog-text {
  color: #dbe5f5;
  background: #1a2c45;
}

html[data-theme="dark"] .about-group-card {
  background: #11233d;
  border-color: #29466d;
}

html[data-theme="dark"] .about-group-card img {
  background: #0c1a2e;
}

html[data-theme="dark"] .about-group-card h4 {
  color: #d6e7ff;
}

html[data-theme="dark"] .about-group-card p {
  color: #b8cae6;
}

html[data-theme="dark"] .help {
  color: #dbe5f5;
}

html[data-theme="dark"] .help-lead {
  color: #a8bfdc;
}

html[data-theme="dark"] .help-nav a,
html[data-theme="dark"] .help-nav select[data-theme-select] {
  border-color: #3e5d85;
  background: #1a2c45;
  color: #dbe5f5;
}

html[data-theme="dark"] .tutorial-card {
  border-color: #2f4769;
  background: #17283d;
}

html[data-theme="dark"] .tutorial-figure img {
  border-color: #3a5477;
  background: #1a2c45;
}

/* La composición de dos columnas requiere 620 + 430 px, más espacios y
   bordes. A 1024 px el editor se salía del viewport antes de que el diseño
   responsivo entrara en acción. */
@media (max-width: 1120px) {
  body:has(.app-shell) {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .menu-bar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
  }

  .menu-bar nav,
  .app-menu {
    width: 100%;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .help-tutorial-grid {
    grid-template-columns: 1fr;
  }

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

  .sim-workspace {
    height: auto;
    grid-template-rows: auto auto;
    overflow: visible;
    overflow-x: hidden;
    padding: 4px 8px 8px;
  }

  .sim-main-area,
  .sim-left-column,
  .sim-bottom-panels,
  .sim-code-pane {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow: visible;
    width: 100%;
  }

  .sim-map-panel {
    min-height: 340px;
  }

  .sim-code-pane {
    min-height: 460px;
  }

  .sim-control-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .sim-control-bar .robot-location-controls {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    justify-content: flex-start;
  }

  .robot-start-readout {
    max-width: none;
    flex: 1 1 220px;
  }

  .sim-status-strip {
    gap: 16px;
    flex-wrap: wrap;
    min-height: 36px;
  }

  .sim-status-strip span:last-child {
    margin-left: 0;
  }

  .sim-code-pane .debug-panel #breakpointsInput,
  .sim-code-pane .debug-panel #watchesInput {
    flex: 1 1 220px;
    min-width: 0;
  }

  .world-editor-main {
    grid-template-columns: 1fr;
  }

  .world-toolbar-group-simulation {
    margin-left: 0;
  }

  .properties-pane {
    min-height: 180px;
  }

  .sim-map-pane #worldCanvas {
    min-height: 0;
  }

  .help-grid,
  .help-dl {
    grid-template-columns: 1fr;
  }

  .help-dl dd {
    margin-bottom: 10px;
  }
}

@media (max-width: 640px) {
  .execution-success-toast {
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
  }
  .menu-bar {
    font-size: 12px;
  }

  .menu-trigger {
    padding: 5px 7px;
  }

  .sim-workspace {
    padding: 4px 6px 8px;
    gap: 8px;
  }

  .sim-control-bar,
  .sim-control-group {
    gap: 6px;
  }

  .sim-control-bar .run-controls button {
    flex: 1 1 calc(50% - 6px);
  }

  .sim-control-bar .robot-location-controls {
    border-left: 0;
    margin-left: 0;
    padding-left: 0;
    width: 100%;
  }

  .robot-start-readout {
    flex: 1 1 100%;
    max-width: none;
  }

  .sim-code-pane .debug-panel label {
    flex: 1 1 100%;
  }

  .sim-code-pane .debug-panel #breakpointsInput,
  .sim-code-pane .debug-panel #watchesInput {
    flex: 1 1 100%;
    min-width: 0;
  }

  .sim-code-pane .code-header {
    gap: 6px;
    flex-wrap: wrap;
  }

  .program-name-strip {
    gap: 6px;
    font-size: 11px;
  }

  .sim-map-panel {
    min-height: 300px;
  }

  .sim-map-pane,
  .world-canvas-pane {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .world-editor-toolbar,
  .world-toolbar-group {
    width: 100%;
    box-sizing: border-box;
  }

  .world-toolbar-group {
    flex-wrap: wrap;
  }

  .sim-map-pane #worldCanvas {
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .panel-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .map-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .map-tools button,
  #toggleSensorBeamsBtn {
    flex: 0 0 auto;
  }

  .sim-code-pane {
    min-height: 380px;
  }

  .sim-telemetry-pane {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .telemetry-section {
    border-right: 0;
    border-bottom: 1px solid #e4eaf2;
  }

  .telemetry-section:last-child {
    border-bottom: 0;
  }

  .sim-brick-pane .brick-screen {
    width: min(260px, calc(100% - 24px));
  }

  .world-editor-toolbar,
  .world-size-bar {
    gap: 5px;
    padding: 5px;
  }

  .world-size-bar input[type="number"] {
    width: 52px;
  }

  .world-status-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* En portátiles conserva las tres zonas del editor; solo se apilan en móvil. */
@media (min-width: 901px) and (max-width: 1120px) {
  .world-editor-main {
    grid-template-columns: minmax(150px, 0.26fr) minmax(420px, 1fr) minmax(220px, 0.35fr);
  }

  .asset-library-pane,
  .properties-pane {
    min-height: 0;
  }

  .world-editor-shell.is-library-collapsed .world-editor-main {
    grid-template-columns: minmax(420px, 1fr) minmax(220px, 0.35fr);
  }

  .world-editor-shell.is-inspector-collapsed .world-editor-main {
    grid-template-columns: minmax(150px, 0.26fr) minmax(420px, 1fr);
  }

  .world-editor-shell.is-library-collapsed.is-inspector-collapsed .world-editor-main {
    grid-template-columns: minmax(420px, 1fr);
  }

  .world-editor-shell.is-library-collapsed .asset-library-pane,
  .world-editor-shell.is-inspector-collapsed .properties-pane {
    display: none;
  }
}
