@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #121519; --bg2: #171b20; --panel: #1c2026; --panel2: #22272e; --line: #2c323a; --line2: #39404a;
  --text: #d9dee4; --muted: #8b95a1; --dim: #66707c; --accent: #3fa9f5; --accent2: #2b8fd8; --sel: #ff7a1a;
  --ok: #37b26c; --danger: #f06060;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --demo-h: 30px; --bar-h: 46px; --status-h: 28px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 13px/1.4 var(--sans); overflow: hidden; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
kbd { font: 11px var(--mono); background: #2a3038; border: 1px solid #3b434d; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: #cfd6de; white-space: nowrap; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Demo-Leiste */
.demobar { flex: 0 0 var(--demo-h); height: var(--demo-h); background: #f5c542; color: #1d1a10; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 12px; font-size: 12.5px; white-space: nowrap; overflow: hidden; z-index: 50; }
.demobar span { overflow: hidden; text-overflow: ellipsis; }
.demobar a { color: #1d1a10; font-weight: 600; text-decoration: underline; flex-shrink: 0; }

/* App-Leiste */
.appbar { flex: 0 0 var(--bar-h); height: var(--bar-h); display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--bg2); border-bottom: 1px solid var(--line); position: relative; z-index: 40; }
.brand { display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.brand-name { font-weight: 600; font-size: 14.5px; letter-spacing: .01em; white-space: nowrap; }
.brand-name b { color: var(--accent); }
.menubar { display: flex; gap: 2px; }
.menu { position: relative; }
.menu-btn { background: none; border: 0; padding: 6px 10px; border-radius: 6px; color: var(--text); }
.menu-btn:hover, .menu.open .menu-btn { background: var(--panel2); }
.menu-pop { display: none; position: absolute; left: 0; top: calc(100% + 4px); min-width: 270px; background: #20252c; border: 1px solid var(--line2); border-radius: 8px; padding: 5px; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.menu.open .menu-pop { display: block; }
.menu-pop button, .menu-pop a { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 20px; background: none; border: 0; padding: 7px 10px; border-radius: 5px; text-align: left; color: var(--text); text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover, .menu-pop button:focus-visible { background: var(--accent2); color: #fff; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line2); margin: 4px 2px; }
.projname { flex: 1 1 auto; display: flex; justify-content: center; min-width: 80px; }
.projname input { width: min(340px, 100%); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; text-align: center; font-weight: 600; color: #eef2f6; }
.projname input:hover { border-color: var(--line2); }
.projname input:focus { border-color: var(--accent); background: var(--bg); outline: none; }
.appbar-right { display: flex; align-items: center; gap: 6px; }
.ib { width: 32px; height: 32px; display: inline-grid; place-items: center; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--text); padding: 0; }
.ib:hover { background: var(--panel2); border-color: var(--line2); }
.ib svg { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); white-space: nowrap; }
.btn:hover { border-color: #4b5562; background: #2a3038; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.danger { color: #ffb4b4; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line2); border-radius: 7px; padding: 2px; }
.seg button { border: 0; background: none; padding: 4px 11px; border-radius: 5px; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.seg button.on { background: var(--panel2); color: #fff; box-shadow: inset 0 0 0 1px var(--line2); }
.mob-only { display: none; }
.toolstrip .mob-tool { display: none; }

.mobile-note { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #1d2b38; color: #cfe5f7; font-size: 12px; border-bottom: 1px solid #284056; }
.mobile-note[hidden] { display: none; }
.mobile-note span { flex: 1; }

/* Arbeitsbereich */
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 236px 58px 1fr 288px; }
.panel { background: var(--panel); border-right: 1px solid var(--line); min-height: 0; overflow: auto; }
.panel.right { border-right: 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 6px 8px; color: var(--muted); font-weight: 600; font-size: 12px; }
.tabs button.on { color: #fff; border-bottom-color: var(--accent); }
.tabpane { padding: 10px; }
.search { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding: 6px 9px; margin-bottom: 8px; }
.lib h4 { margin: 12px 2px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; }
.lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lib-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px 6px; border: 1px solid var(--line); background: var(--panel2); border-radius: 7px; text-align: center; font-size: 11px; color: var(--text); line-height: 1.2; cursor: grab; }
.lib-item:hover { border-color: var(--accent); background: #24303c; }
.lib-item.on { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel) inset; }
.lib-item canvas { width: 60px; height: 44px; background: #f4f3ef; border-radius: 4px; }
.lib-item small { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.hint { color: var(--dim); font-size: 11.5px; margin: 10px 2px; }
.ph { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 8px; font-weight: 600; display: flex; justify-content: space-between; }
.ph-right { text-transform: none; letter-spacing: 0; color: var(--accent); font-family: var(--mono); font-size: 11px; }
.layers { list-style: none; margin: 0 0 16px; padding: 0; }
.layers li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 5px; }
.layers li:hover { background: var(--panel2); }
.layers .sw { width: 12px; height: 12px; border-radius: 3px; }
.layers label { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.layers .cnt { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.eye { background: none; border: 0; color: var(--muted); padding: 2px; width: 24px; height: 22px; border-radius: 4px; }
.eye svg { width: 16px; height: 16px; }
.eye.off { color: #4a525c; }
.tree details { margin-bottom: 4px; }
.tree summary { cursor: pointer; padding: 4px 4px; color: var(--muted); font-weight: 600; font-size: 12px; border-radius: 4px; }
.tree summary:hover { background: var(--panel2); }
.tree button { display: flex; justify-content: space-between; gap: 6px; width: 100%; background: none; border: 0; padding: 4px 8px 4px 18px; border-radius: 4px; text-align: left; color: var(--text); font-size: 12px; }
.tree button:hover { background: var(--panel2); }
.tree button.on { background: rgba(255,122,26,.16); color: #ffc9a3; }
.tree button span:last-child { color: var(--dim); font-family: var(--mono); font-size: 11px; }

/* Werkzeugleiste */
.toolstrip { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 3px; overflow-y: auto; }
.toolstrip button { width: 48px; padding: 6px 0 4px; background: none; border: 1px solid transparent; border-radius: 7px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 9.5px; }
.toolstrip button svg { width: 21px; height: 21px; }
.toolstrip button:hover { color: #fff; background: var(--panel2); }
.toolstrip button.on { color: #fff; background: #23384b; border-color: #2f5878; }
.toolstrip button.on svg { color: var(--accent); }
.toolstrip .sep { width: 30px; height: 1px; background: var(--line2); margin: 5px 0; }

/* Ansichtsbereich */
.viewport { min-width: 0; min-height: 0; display: grid; position: relative; background: #0e1013; }
.viewport[data-view="split"] { grid-template-columns: 1fr 4px 1fr; }
.viewport[data-view="2d"] { grid-template-columns: 1fr 0 0; }
.viewport[data-view="3d"] { grid-template-columns: 0 0 1fr; }
.viewport[data-view="2d"] .pane3d, .viewport[data-view="3d"] .pane2d { visibility: hidden; }
.splitter { background: var(--line); }
.pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.pane2d { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 22px 1fr; }
.ruler-corner { background: #20252c; border-right: 1px solid #3a414a; border-bottom: 1px solid #3a414a; font: 9px var(--mono); color: var(--dim); display: grid; place-items: center; }
.ruler { display: block; }
.ruler.top { grid-column: 2; grid-row: 1; }
.ruler.left { grid-column: 1; grid-row: 2; }
.canvas-wrap { grid-column: 2; grid-row: 2; position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#plan { position: absolute; inset: 0; display: block; touch-action: none; cursor: default; outline: none; }
#plan[data-tool="wall"], #plan[data-tool="room"], #plan[data-tool="measure"], #plan[data-tool="area"], #plan[data-tool="door"], #plan[data-tool="window"], #plan[data-tool="furniture"] { cursor: crosshair; }
#plan[data-tool="pan"], #plan.panning { cursor: grabbing; }
.tool-hint { position: absolute; left: 34px; top: 32px; background: rgba(20,24,29,.88); color: #e6ebf0; padding: 6px 10px; border-radius: 6px; font-size: 12px; pointer-events: none; max-width: calc(100% - 60px); border: 1px solid #333b45; }
.tool-hint:empty { display: none; }
.zoombox { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 2px; background: rgba(28,32,38,.92); border: 1px solid var(--line2); border-radius: 8px; padding: 3px; }
.pane3d canvas { display: block; }
.v3d-tools { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.v3d-tools .btn { background: rgba(28,32,38,.88); backdrop-filter: blur(4px); }
.v3d-label { position: absolute; right: 10px; bottom: 10px; font-size: 11px; color: #3c4652; background: rgba(255,255,255,.7); padding: 3px 8px; border-radius: 5px; pointer-events: none; }
.walk-hud { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(20,24,29,.9); padding: 8px 14px; border-radius: 8px; font-size: 12px; z-index: 3; text-align: center; border: 1px solid #39414b; }
.walk-pad { display: none; }
.pane3d.walking::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; }
.nogl { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 20px; text-align: center; }

/* Eigenschaften */
.psec { padding: 12px; border-bottom: 1px solid var(--line); }
.psec.grow { flex: 1; }
.props { display: grid; grid-template-columns: 92px 1fr; gap: 6px 8px; align-items: center; }
.props .full { grid-column: 1 / -1; }
.props label { color: var(--muted); font-size: 12px; }
.props input[type="text"], .props input[type="number"], .props select { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: 5px; padding: 5px 7px; font-size: 12.5px; min-width: 0; }
.props input:focus, .props select:focus { border-color: var(--accent); outline: none; }
.props .unit { position: relative; }
.props .unit input { padding-right: 30px; }
.props .unit::after { content: attr(data-u); position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 11px; pointer-events: none; }
.props .val { font-family: var(--mono); font-size: 12.5px; color: #fff; }
.props .big { font-size: 19px; font-weight: 600; color: var(--accent); font-family: var(--sans); }
.props .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.props .btns { display: flex; flex-wrap: wrap; gap: 6px; }
.props .empty { color: var(--dim); font-size: 12px; line-height: 1.5; }
.objhead { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px dashed var(--line2); }
.objhead .tag { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,122,26,.14); color: #ffb27a; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.objhead b { font-size: 13px; }
.roomtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.roomtable th { text-align: left; color: var(--dim); font-weight: 600; font-size: 11px; padding: 4px 4px; border-bottom: 1px solid var(--line2); }
.roomtable td { padding: 5px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.roomtable tr:hover td { background: var(--panel2); }
.roomtable tr.on td { color: #ffc9a3; }
.roomtable .num { text-align: right; font-family: var(--mono); }
.roomtable tfoot td { font-weight: 600; color: #fff; border-bottom: 0; cursor: default; }
.roomtable .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chk { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin-top: 10px; cursor: pointer; }

/* Statusleiste */
.statusbar { flex: 0 0 var(--status-h); height: var(--status-h); display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--bg2); border-top: 1px solid var(--line); font: 11px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; }
.statusbar > * { flex-shrink: 0; }
.statusbar > .st-legal { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.st-sep { width: 1px; height: 14px; background: var(--line2); }
.st-grow { flex: 1; }
.st-coord { color: #cfd6de; min-width: 170px; }
.st-toggle { background: none; border: 1px solid var(--line2); border-radius: 4px; padding: 1px 6px; font: 600 10px var(--mono); color: var(--dim); }
.st-toggle.on { color: #0e1a24; background: var(--accent); border-color: var(--accent); }
.st-select { background: var(--bg); border: 1px solid var(--line2); border-radius: 4px; font: 10.5px var(--mono); padding: 0 2px; height: 19px; }
.st-tool { color: #fff; }
.st-typed { color: #0e1a24; background: #f5c542; padding: 0 6px; border-radius: 3px; }
.st-area { color: var(--accent); font-weight: 600; }
.st-legal { font-family: var(--sans); font-size: 11px; }
.st-legal a { color: var(--muted); }
.st-legal a:hover { color: #fff; }

/* Dialoge */
.modal { position: fixed; inset: 0; background: rgba(6,8,10,.66); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #1d2127; border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.modal-card.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 20px; }
.modal-body p { margin: 0 0 10px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.modal-foot .chk { margin: 0 auto 0 4px; }
.help .lead { font-size: 14px; color: #fff; }
.steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 6px; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; background: #171a1f; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.keys h4 { margin: 0 0 8px; color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.keys dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 12px; }
.keys dt { text-align: right; white-space: nowrap; color: var(--muted); }
.keys dd { margin: 0; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.projlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.projlist li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); }
.projlist li > div { flex: 1; min-width: 0; }
.projlist small { color: var(--muted); display: block; }
.projlist .empty { color: var(--muted); border-style: dashed; background: none; }

.toast { position: fixed; left: 50%; bottom: 44px; transform: translate(-50%, 20px); background: #2a3340; color: #fff; padding: 8px 14px; border-radius: 8px; border: 1px solid #3c4a5a; box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: .2s; z-index: 120; font-size: 12.5px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Druckansicht */
.printview { position: fixed; inset: 0; z-index: 110; background: #50565e; overflow: auto; }
.printview[hidden] { display: none; }
.print-toolbar { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.print-page { background: #fff; color: #111; width: min(210mm, calc(100% - 24px)); margin: 20px auto; padding: 14mm 14mm; box-shadow: 0 10px 40px rgba(0,0,0,.4); font-size: 12px; }
.print-page h1 { font-size: 20px; margin: 0 0 2px; }
.print-page .meta { color: #555; margin-bottom: 12px; }
.print-page img { width: 100%; height: auto; border: 1px solid #ddd; }
.print-page table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.print-page th, .print-page td { padding: 6px 8px; border-bottom: 1px solid #ddd; text-align: left; }
.print-page th { background: #f2f4f6; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.print-page .num { text-align: right; font-variant-numeric: tabular-nums; }
.print-page tfoot td { font-weight: 700; border-top: 2px solid #111; }
.print-page .foot { margin-top: 16px; color: #777; font-size: 10.5px; }
@media print {
  body { overflow: visible; background: #fff; display: block; }
  body > *:not(.printview) { display: none !important; }
  .printview { position: static; background: #fff; overflow: visible; }
  .print-toolbar { display: none; }
  .print-page { box-shadow: none; margin: 0; width: auto; padding: 0; }
}

/* Responsiv */
@media (max-width: 1280px) {
  .workspace { grid-template-columns: 210px 58px 1fr 262px; }
  .props { grid-template-columns: 82px 1fr; }
}
@media (max-width: 1060px) {
  .menubar .menu-btn { padding: 6px 7px; }
  .btn.primary span { display: none; }
  .workspace { grid-template-columns: 58px 1fr 250px; }
  .panel.left { display: none; }
  .panel.left.open { display: block; position: fixed; left: 58px; top: calc(var(--demo-h) + var(--bar-h)); bottom: var(--status-h); width: 260px; z-index: 30; box-shadow: 10px 0 30px rgba(0,0,0,.4); }
}
@media (max-width: 820px) {
  :root { --bar-h: 50px; }
  .demobar { font-size: 11px; gap: 8px; justify-content: space-between; }
  .demobar strong { display: none; }
  .menubar { display: none; }
  .menubar.open { display: block; position: fixed; left: 0; right: 0; top: calc(var(--demo-h) + var(--bar-h)); bottom: 0; background: #171b20; z-index: 80; overflow: auto; padding: 10px 14px 30px; }
  .menubar.open .menu { margin-bottom: 8px; }
  .menubar.open .menu-btn { display: block; width: 100%; text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; pointer-events: none; padding: 8px 4px 4px; }
  .menubar.open .menu-pop { display: block; position: static; box-shadow: none; min-width: 0; border-color: var(--line); background: #1d2127; }
  .menubar.open .menu-pop kbd { display: none; }
  .menubar.open .menu-pop button, .menubar.open .menu-pop a { padding: 10px 10px; font-size: 14px; }
  .mob-only { display: inline-grid; }
  .brand-name { display: none; }
  .projname input { font-size: 13px; padding: 5px 4px; }
  .appbar-right .ib[data-cmd] { display: none; }
  .btn.primary { padding: 0 9px; }
  .seg button { padding: 4px 8px; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .toolstrip { grid-row: 2; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 4px 6px; gap: 2px; border-right: 0; border-top: 1px solid var(--line); justify-content: flex-start; }
  .toolstrip button { flex: 0 0 auto; width: 56px; }
  .toolstrip .sep { width: 1px; height: 30px; margin: 0 3px; }
  .viewport { grid-row: 1; }
  .viewport[data-view="split"] { grid-template-columns: 1fr; grid-template-rows: 1fr 4px 1fr; }
  .viewport[data-view="2d"] { grid-template-columns: 1fr; grid-template-rows: 1fr 0 0; }
  .viewport[data-view="3d"] { grid-template-columns: 1fr; grid-template-rows: 0 0 1fr; }
  .panel.right { display: none; }
  .panel.right.open { display: flex; position: fixed; left: 0; right: 0; bottom: var(--status-h); max-height: 58vh; z-index: 30; border-top: 1px solid var(--line2); box-shadow: 0 -10px 30px rgba(0,0,0,.45); border-radius: 12px 12px 0 0; }
  .panel.left.open { left: 0; right: 0; width: auto; top: auto; bottom: var(--status-h); max-height: 58vh; border-radius: 12px 12px 0 0; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .statusbar { gap: 6px; }
  .statusbar .st-toggle, .statusbar .st-select, .statusbar #stScale, .statusbar #stTool, .statusbar .st-sep { display: none; }
  .st-coord { display: none; }
  .st-legal { font-size: 10.5px; }
  .tool-hint { left: 30px; top: 28px; font-size: 11px; }
  .v3d-label { display: none; }
  .v3d-tools .btn span { display: none; }
  .walk-hud { width: calc(100% - 20px); font-size: 11px; }
  .walk-pad { display: grid; grid-template-columns: repeat(4, 44px); gap: 6px; justify-content: center; margin-top: 6px; }
  .walk-pad button { height: 40px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); color: #fff; }
  .keys { grid-template-columns: 1fr; }
  .toolstrip .mob-tool { display: flex; }
  .toolstrip .sep.mob-tool { display: block; }
}
@media (max-width: 420px) {
  .seg button { padding: 4px 6px; font-size: 11px; }
  .st-legal .wa { display: none; }
}
