/* ==========================================================================
   micro:bit Panel Lab — estilos (versión limpia)
   ========================================================================== */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1c1f26; --muted: #7a8090; --line: #e6e8ee; --line-strong: #d3d7e0;
  --primary: #2f6fed; --primary-ink: #fff; --accent: #ffcc33; --ok: #22a06b; --warn: #f0a020; --danger: #e5484d; --info: #2f6fed;
  --top-h: 56px; --split: 40%;
  --radius: 16px; --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 6px 20px rgba(20, 24, 40, .06);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 14px; display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
code { background: #eef1f7; padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.muted { color: var(--muted); }
.warn { color: var(--danger); }
[hidden] { display: none !important; }

/* ---------- botones ---------- */
.btn, .mini { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 10px; padding: 7px 13px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; line-height: 1.2; }
.btn:hover, .mini:hover { background: #f3f5f9; }
.btn:active { transform: translateY(1px); }
.btn.ghost { border-color: transparent; background: transparent; color: #3b4150; }
.btn.ghost:hover { background: #eef1f6; }
.btn.primary, .mini.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #245ed6; }
.btn.primary.connected { background: var(--ok); border-color: var(--ok); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1c1f26; }
.btn.run { background: #1f9d61; border-color: #1f9d61; color: #fff; font-weight: 600; }
.btn.run.running { background: var(--danger); border-color: var(--danger); }
.btn.active, .mini.active { background: #e6eeff; border-color: #b9ccff; color: #1d4fc4; }
.mini { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.mini.danger { color: var(--danger); }
button:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 10px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pill { background: #fff3cc; color: #7a5a00; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }

/* ---------- barra superior ---------- */
#topbar { min-height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 6px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; flex-wrap: wrap; overflow: visible; position: relative; z-index: 600; }
#topbar .brand { font-size: 16px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#topbar .brand b { color: var(--primary); }
#project-name { background: transparent; border: 1px solid transparent; color: var(--ink); font: inherit; font-weight: 500; padding: 6px 8px; border-radius: 8px; width: 210px; }
#project-name:hover, #project-name:focus { border-color: var(--line-strong); outline: none; }
.tb-group { display: flex; align-items: center; gap: 6px; }
.tb-group.center { margin-left: 10px; }
.tb-group.right { margin-left: auto; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.55); display: inline-block; vertical-align: middle; margin-right: 2px; }
.dot.on { background: #fff; box-shadow: 0 0 6px #fff; }
#panel-bar .dot { background: #e5484d; } #panel-bar .dot.on { background: #34d399; }

/* menús desplegables */
.menu { position: relative; }
.menu-list { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 240px; z-index: 500; padding: 6px; max-height: 70vh; overflow: auto; }
.tb-group.right .menu-list { left: auto; right: 0; }
.menu.open .menu-list { display: block; }
.menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.menu-list button:hover { background: #f1f4f9; }
.menu-list button.active { background: #e6eeff; }
.menu-list button small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; white-space: normal; }
.menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.menu-list.add-grid { display: none; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 440px; }
.add-grid .add-help { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 400; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; line-height: 1.4; }
.menu.open .menu-list.add-grid { display: grid; }
.add-grid button { text-align: center; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.add-grid button i { font-style: normal; font-size: 22px; }

/* ---------- layout principal ---------- */
#main { flex: 1; display: flex; min-height: 0; position: relative; }
#blocks-pane { width: var(--split); display: flex; flex-direction: column; min-width: 0; background: #fff; }
#splitter { width: 5px; cursor: col-resize; background: var(--line); flex-shrink: 0; }
#splitter:hover { background: #b9ccff; }
#dash-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.pane-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fff; font-weight: 600; flex-shrink: 0; flex-wrap: wrap; min-height: 46px; position: relative; z-index: 400; overflow: visible; }
.pane-head > span:first-child { margin-right: 6px; }
.pane-head .muted { font-weight: 400; font-size: 12px; margin-left: auto; }
#blockly { flex: 1; min-height: 0; }
#mobile-tabs { display: none; }

/* ---------- panel (dashboard) ---------- */
#dash-viewport { flex: 1; position: relative; overflow: hidden; background: #e9ebf0; }
.dash-canvas { position: absolute; transform-origin: top left; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 12px 40px rgba(0,0,0,.12); }
#dash-viewport.edit .dash-canvas::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; background-image: radial-gradient(rgba(0,0,0,.14) 1px, transparent 1.2px); background-size: 20px 20px; }

.widget { position: absolute; z-index: 2; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; user-select: none; border: 1.5px solid transparent; padding: 12px; }
.widget.transparent { background: transparent; box-shadow: none; }
.widget.hidden-widget { display: none; }
#dash-viewport.edit .widget.hidden-widget { display: flex; opacity: .35; }
.widget .w-head { height: 22px; display: flex; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); flex-shrink: 0; gap: 4px; }
.widget.no-title .w-head { display: none; }
.widget .w-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget .w-actions { display: none; gap: 2px; }
.widget .w-actions button { border: 0; background: #eef1f6; border-radius: 5px; cursor: pointer; font-size: 11px; padding: 1px 5px; color: var(--ink); }
.widget .w-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.widget .w-cover, .widget .w-resize { display: none; }
.widget[data-level="warn"] { border-color: var(--warn); }
.widget[data-level="danger"] { border-color: var(--danger); }
.widget[data-level="info"] { border-color: var(--info); }
.widget.transparent[data-level] { border-color: transparent; }
/* edición */
#dash-viewport.edit .widget { cursor: move; }
#dash-viewport.edit .widget .w-cover { display: block; position: absolute; inset: 0; z-index: 5; }
#dash-viewport.edit .widget .w-head { position: relative; z-index: 6; }
#dash-viewport.edit .widget.no-title:hover .w-head, #dash-viewport.edit .widget.no-title.selected .w-head { display: flex; position: absolute; top: 4px; left: 8px; right: 8px; }
#dash-viewport.edit .widget:hover .w-actions, #dash-viewport.edit .widget.selected .w-actions { display: flex; }
#dash-viewport.edit .widget.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.2), var(--shadow); }
#dash-viewport.edit .widget.transparent { outline: 1px dashed rgba(47,111,237,.4); outline-offset: -1px; }
#dash-viewport.edit .widget .w-resize { display: block; position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; cursor: nwse-resize; z-index: 7; border-right: 3px solid var(--primary); border-bottom: 3px solid var(--primary); border-radius: 0 0 4px 0; opacity: .5; }

/* anotaciones (flechas, marcos) */
.widget.annot { padding: 0; overflow: visible; pointer-events: none; }
#dash-viewport.edit .widget.annot { pointer-events: auto; }
.widget.annot .w-body { overflow: visible; }
.annot-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.an-label { font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; font-family: inherit; }
.widget .w-pt { display: none; }
#dash-viewport.edit .widget.annot .w-pt { display: block; position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); z-index: 9; cursor: crosshair; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
#dash-viewport.edit .widget.annot.transparent { outline-color: rgba(47,111,237,.25); }

/* contenidos de widgets */
.v-big { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0; font-weight: 700; line-height: 1; white-space: nowrap; overflow: hidden; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.v-unit { font-size: .4em; color: var(--muted); font-weight: 500; align-self: flex-end; margin: 0 0 .15em .15em; }
.v-msg { text-align: center; font-size: 12px; color: var(--danger); font-weight: 600; min-height: 14px; }
.gauge { flex: 1; width: 100%; min-height: 0; }
.gauge .g-bg { fill: none; stroke: #edf0f5; stroke-width: 14; stroke-linecap: round; }
.gauge .g-fg { fill: none; stroke: #3b82f6; stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.gauge .g-val { font-size: 28px; font-weight: 700; fill: var(--ink); }
.gauge .g-min, .gauge .g-max { font-size: 10px; fill: var(--muted); }
.bar-wrap { flex: 1; position: relative; background: #edf0f5; border-radius: 12px; overflow: hidden; display: flex; align-items: flex-end; }
.bar-wrap.horizontal { align-items: stretch; }
.bar-fill { background: #22c55e; transition: height .3s, width .3s; border-radius: 10px; }
.bar-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; text-shadow: 0 1px 2px rgba(255,255,255,.7); }
.chart { display: block; }
.chart-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); padding: 2px 0; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.led { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.led-dot { border-radius: 50%; transition: background .2s, box-shadow .2s; }
.led-label { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.txt { flex: 1; display: flex; align-items: center; white-space: pre-wrap; line-height: 1.25; padding: 2px 4px; border-radius: 8px; overflow: hidden; }
.txt[style*="text-align: center"] { justify-content: center; }
.txt[style*="text-align: right"] { justify-content: flex-end; }
.btn-widget { flex: 1; border: 0; border-radius: 12px; color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: transform .05s, filter .15s; }
.btn-widget:hover { filter: brightness(1.05); }
.btn-widget:active { transform: scale(.98); }
.slider-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.slider-wrap input { flex: 1; }
.slider-val { font-weight: 700; min-width: 40px; text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }
.switch { flex: 1; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.sw-track { width: 52px; height: 28px; border-radius: 14px; background: #9ca3af; position: relative; transition: background .2s; flex-shrink: 0; }
.sw-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .sw-track .sw-knob { left: 27px; }
.sw-label { font-weight: 600; font-size: 15px; }
.alert-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.al { padding: 6px 10px; border-radius: 8px; font-size: 12px; border-left: 3px solid; background: #f6f7fa; }
.al small { float: right; color: var(--muted); }
.al-danger { border-color: var(--danger); background: #fdf0f0; } .al-warn { border-color: var(--warn); background: #fff7e6; } .al-info { border-color: var(--info); background: #eef3ff; } .al-ok { border-color: var(--ok); background: #eefaf3; }
.clear-alerts { align-self: flex-end; margin-top: 6px; }
.img-widget { width: 100%; height: 100%; display: block; border-radius: 8px; }
.img-empty { margin: auto; text-align: center; font-size: 12px; }
.cam-wrap { flex: 1; position: relative; background: #0f1117; border-radius: 10px; overflow: hidden; min-height: 0; }
.cam-wrap video { width: 100%; height: 100%; object-fit: cover; }
.cam-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; background: rgba(0,0,0,.35); z-index: 6; }
.cam-overlay .cam-hint { color: #fff; font-size: 11px; opacity: .85; text-align: center; padding: 0 8px; }
#dash-viewport.edit .widget .cam-overlay { pointer-events: auto; }
.cam-skeleton { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-audio { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-size: 48px; gap: 4px; }
.cam-audio small { font-size: 12px; }
.cam-preds { padding-top: 6px; font-size: 11px; max-height: 45%; overflow: auto; }
.pred { display: flex; align-items: center; gap: 6px; }
.pred span { width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pred-bar { flex: 1; height: 7px; background: #edf0f5; border-radius: 4px; overflow: hidden; }
.pred-bar i { display: block; height: 100%; background: #a855f7; transition: width .2s; }
.console-log { flex: 1; margin: 0; overflow: auto; background: #141824; color: #9be3b4; font-size: 11px; padding: 8px; border-radius: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; }
.console-send { display: flex; gap: 4px; margin-top: 6px; }
.console-send input { flex: 1; font: inherit; font-size: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.vars-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vars-table td { padding: 4px 4px; border-bottom: 1px solid var(--line); }
.vars-table td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.widget .w-body:has(.vars-table) { overflow: auto; display: block; }

/* ---------- drawers (propiedades / guía) ---------- */
.drawer { width: 0; overflow: hidden; background: #fff; border-left: 1px solid var(--line); transition: width .2s; flex-shrink: 0; display: flex; flex-direction: column; }
.drawer.open { width: 340px; overflow-y: auto; padding: 12px 14px; }
.props-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.props-empty { color: var(--muted); font-size: 13px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 12px; font-weight: 600; color: #3b4150; }
.field input[type=text], .field input[type=number], .field select, .field textarea, .field input:not([type]) { font: inherit; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 9px; width: 100%; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(47,111,237,.3); border-color: var(--primary); }
.field input[type=color] { width: 56px; height: 32px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; }
.field-check label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.field small { font-size: 11px; line-height: 1.4; }
.img-field { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.img-field input[type=text] { flex: 1; min-width: 120px; }
.img-field input[type=file] { font-size: 11px; max-width: 200px; }
.props-geom { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.props-geom label { font-size: 12px; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.props-geom input { width: 100%; font: inherit; padding: 5px; border: 1px solid var(--line-strong); border-radius: 8px; }
.props-actions { display: flex; gap: 6px; }
.rules label { font-size: 12px; font-weight: 600; display: block; }
.rule-row { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px; align-items: center; background: #f6f7fa; padding: 8px; border-radius: 10px; margin: 6px 0; font-size: 12px; }
.rule-row input, .rule-row select { font: inherit; font-size: 12px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 7px; min-width: 0; }
.rule-row input[data-k=message] { grid-column: 1 / 3; }
.rule-row [data-x] { justify-self: end; }
.guide-progress { display: flex; gap: 4px; margin: 8px 0; }
.guide-progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); cursor: pointer; }
.guide-progress i.done { background: #b9ccff; } .guide-progress i.cur { background: var(--primary); }
#guide h3 { margin: 8px 0; font-size: 16px; }
.guide-body { font-size: 13.5px; line-height: 1.55; }
.guide-body ol, .guide-body ul { padding-left: 20px; }
.guide-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
#guide .btn.accent { width: 100%; margin-top: 8px; }
.guide-highlight { outline: 3px solid var(--accent) !important; outline-offset: 3px; border-radius: 10px; }

/* ---------- barra de estado ---------- */
#statusbar { height: 28px; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: #fff; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-shrink: 0; overflow: hidden; white-space: nowrap; }
#statusbar code { background: #f1f3f7; }
#statusbar .right { margin-left: auto; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 40px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 2000; pointer-events: none; }
.toast { background: #1c1f26; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; max-width: 340px; animation: slidein .25s; border-left: 4px solid #64748b; }
.toast.ok { border-color: #34d399; } .toast.warn { border-color: #fbbf24; } .toast.error { border-color: #f87171; } .toast.info { border-color: #60a5fa; }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes slidein { from { transform: translateY(12px); opacity: 0; } }

/* ---------- diálogos ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(720px, 94vw); max-height: 90vh; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(28,31,38,.45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 16px; }
.dlg-body { padding: 16px 18px; overflow: auto; max-height: calc(90vh - 60px); line-height: 1.5; }
.dlg-body h3 { font-size: 14px; margin: 14px 0 6px; }
.dlg-body textarea { width: 100%; font: inherit; font-size: 12px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px; }
.dlg-body textarea.code, pre.code { font-family: ui-monospace, Menlo, Consolas, monospace; background: #141824; color: #e2e8f0; }
pre.code { padding: 12px; border-radius: 10px; font-size: 12px; overflow: auto; max-height: 300px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; font-size: 13px; }
.mc-rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.mc-rows th { text-align: left; font-size: 11px; color: var(--muted); padding: 4px; }
.mc-rows td { padding: 3px 4px; }
.mc-rows input, .mc-rows select { font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 7px; width: 100%; }
.mc-tabs { display: flex; gap: 6px; margin: 10px 0 6px; }

/* ---------- modo panel ---------- */
#panel-bar { display: none; position: absolute; top: 10px; right: 10px; gap: 6px; align-items: center; background: rgba(28,31,38,.85); padding: 6px; border-radius: 12px; z-index: 50; opacity: .3; transition: opacity .2s; backdrop-filter: blur(6px); }
#panel-bar:hover { opacity: 1; }
#panel-bar .btn { background: transparent; border-color: transparent; color: #fff; font-size: 12px; padding: 5px 9px; }
#panel-bar .btn:hover { background: rgba(255,255,255,.12); }
#panel-bar .btn.run { background: #1f9d61; } #panel-bar .btn.run.running { background: var(--danger); }
body.panel-mode #topbar, body.panel-mode #blocks-pane, body.panel-mode #splitter, body.panel-mode #statusbar, body.panel-mode #dash-toolbar, body.panel-mode #mobile-tabs, body.panel-mode .drawer { display: none; }
body.panel-mode #panel-bar, #dash-pane:fullscreen #panel-bar { display: flex; }
body.panel-mode #dash-viewport { background: #14161c; }
body.locked #panel-bar .exit { display: none; }
#dash-pane:fullscreen { background: #000; }
#dash-pane:fullscreen #dash-toolbar { display: none; }

/* ---------- ventana flotante ML - micro:bit ---------- */
.ml-win { position: fixed; z-index: 550; inset: var(--top-h) 0 0 0; display: flex; flex-direction: column; background: #fff; border-top: 1px solid var(--line); overflow: hidden; }
.ml-head { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: #f3f5f9; border-bottom: 1px solid var(--line); user-select: none; flex-shrink: 0; flex-wrap: wrap; }
.ml-title { font-weight: 700; font-size: 13px; }
.ml-hint { color: var(--muted); font-size: 11px; }
.ml-spacer { flex: 1; }
.ml-head a.mini { text-decoration: none; color: var(--ink); }
.ml-head .mini.on { background: #e6eeff; border-color: #b9ccff; }
#ml-frame { flex: 1; border: 0; width: 100%; background: #fff; min-height: 0; }
body.panel-mode .ml-win { inset: 0; }
.steps { counter-reset: s; padding-left: 0; list-style: none; }
.steps li { position: relative; padding: 8px 0 8px 40px; border-bottom: 1px solid var(--line); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; margin: 8px 0 12px; }
.flow span { background: #eef1f6; padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.flow i { color: var(--muted); font-style: normal; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #mobile-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); padding: 6px; gap: 4px; }
  #mobile-tabs button { flex: 1; border: 0; background: #eef1f6; color: #3b4150; padding: 8px; border-radius: 8px; font: inherit; font-weight: 600; }
  #mobile-tabs button.active { background: var(--primary); color: #fff; }
  #blocks-pane, #splitter { display: none; }
  body[data-tab="blocks"] #blocks-pane { display: flex; width: 100%; }
  body[data-tab="blocks"] #dash-pane { display: none; }
  .drawer.open { position: absolute; right: 0; top: 0; bottom: 0; width: min(340px, 90vw); z-index: 100; box-shadow: -4px 0 20px rgba(0,0,0,.2); }
  #project-name { width: 110px; }
  #topbar .brand span { display: none; }
  .menu-list.add-grid { width: min(420px, 92vw); }
}
