/* INTEGRA Plant 3D — CAD workstation theme (dark), ADSN red accents */
:root {
  --red: #d0202a; --red-2: #b30006; --red-dark: #8c0005; --red-soft: rgba(208,32,42,.16); --red-line: rgba(208,32,42,.55);
  --bg0: #15191e; --bg1: #1d2228; --bg2: #252b33; --bg3: #2e3640; --bg4: #39424e;
  --line: #343d48; --line-2: #2a3139;
  --ink: #e3e8ee; --ink-2: #b4bdc8; --ink-3: #7f8a97;
  --sel: rgba(255,179,0,.16); --gold: #ffb300; --blue: #18b8ff; --green: #27d17f;
  --ok: #27d17f; --warn: #f0a400; --err: #ff4d55;
  --font: "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --left-w: 290px; --right-w: 340px; --bottom-h: 210px; --ui: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font: 12.5px/1.35 var(--font); color: var(--ink); background: var(--bg0); }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #3a4450; border-radius: 6px; border: 2px solid var(--bg1); } ::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.pad { padding: 12px; }
#app { display: grid; grid-template-rows: auto auto auto 1fr auto auto auto; height: 100vh; }
/* UI size (View → UI size): chrome is zoomed, the 3D viewport keeps native pixels */
#titlebar, #ribbonTabs, #ribbon, #left, #right, #bottom, #cmdbar, #statusbar, #hud, #toolBanner, .modal, #toasts, .popup, #ctxmenu, #triad { zoom: var(--ui); }
#titlebar { height: 40px; } #ribbonTabs { height: 28px; } #ribbon { min-height: 92px; height: auto; } #statusbar { height: 22px; }
.modal { max-width: calc(96vw / var(--ui)); max-height: calc(92vh / var(--ui)) !important; }
.modal.wide { width: calc(97vw / var(--ui)) !important; height: calc(93vh / var(--ui)) !important; }
.modal.xwide { width: calc(96vw / var(--ui)) !important; height: calc(88vh / var(--ui)) !important; }
kbd { font: 600 10.5px var(--mono); background: var(--bg3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; color: var(--ink); }

/* ---------------- title bar */
#titlebar { background: linear-gradient(90deg, #a5000a 0%, #c0101b 38%, #8e0008 100%); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 0; user-select: none; box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.brandbox { height: 40px; display: flex; align-items: center; padding: 0 12px 0 12px; background: rgba(0,0,0,.12); }
#titlebar .brand { height: 26px; display: block; image-rendering: auto; }
#titlebar .product { display: flex; flex-direction: column; line-height: 1.05; padding-left: 2px; }
#titlebar .product b { letter-spacing: .26em; font-size: 12px; font-weight: 700; }
#titlebar .product span { font-size: 10px; opacity: .8; letter-spacing: .06em; }
.qat { display: flex; gap: 2px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.25); }
.qat button { width: 28px; height: 26px; border: 0; background: none; border-radius: 4px; cursor: pointer; display: grid; place-items: center; }
.qat button:hover { background: rgba(255,255,255,.16); }
.qat svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.project-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 4px; background: rgba(0,0,0,.18); cursor: pointer; font-weight: 600; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-chip:hover { background: rgba(0,0,0,.3); }
.project-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #7dffb5; box-shadow: 0 0 6px #7dffb5; }
.spacer { flex: 1; }
.search { position: relative; }
.search input { width: 360px; border: 1px solid rgba(255,255,255,.22); border-radius: 4px; padding: 5px 10px; background: rgba(0,0,0,.25); color: #fff; outline: none; }
.search input::placeholder { color: rgba(255,255,255,.65); }
.search input:focus { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.5); }
.popup { position: absolute; top: 34px; right: 0; width: 480px; max-height: 420px; overflow: auto; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 60; }
.popup .item { padding: 6px 12px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.popup .item:hover, .popup .item.active { background: var(--bg4); }
.popup .item small { color: var(--ink-3); margin-left: auto; }
.user { white-space: nowrap; font-size: 11.5px; padding: 3px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; cursor: pointer; }

/* ---------------- ribbon */
#ribbonTabs { overflow-x: auto; flex-shrink: 0; display: flex; align-items: flex-end; gap: 0; padding: 0 6px; background: var(--bg1); border-bottom: 1px solid var(--line); }
#ribbonTabs button { border: 0; background: none; padding: 5px 14px; cursor: pointer; color: var(--ink-3); font-weight: 600; font-size: 12px; border-bottom: 2px solid transparent; }
#ribbonTabs button:hover { color: var(--ink); }
#ribbonTabs button.active { color: #fff; border-bottom-color: var(--red); background: var(--bg2); border-radius: 3px 3px 0 0; }
#ribbon { display: flex; gap: 0; padding: 4px 4px 0; background: var(--bg2); border-bottom: 1px solid #0d1013; overflow-x: auto; overflow-y: hidden; }
.rgroup { flex-shrink: 0; display: flex; flex-direction: column; padding: 0 6px; border-right: 1px solid var(--line); }
.rgroup .rbtns { display: flex; gap: 1px; align-items: flex-start; flex: 1; }
.rgroup .rlabel { text-align: center; font-size: 10px; color: var(--ink-3); padding: 1px 0 3px; letter-spacing: .05em; white-space: nowrap; text-transform: uppercase; }
.rbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; max-width: 78px; padding: 5px 4px 3px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; font-size: 11px; line-height: 1.1; text-align: center; color: var(--ink-2); }
.rbtn svg { width: 28px; height: 28px; stroke: #cfd6de; fill: none; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.rbtn svg .acc { stroke: #ff4b55; }
.rbtn svg .fillacc { fill: #ff4b55; stroke: none; }
.rbtn svg .blu { stroke: var(--blue); }
.rbtn:hover { background: var(--bg3); border-color: var(--line); color: #fff; }
.rbtn.on { background: var(--red-soft); border-color: var(--red-line); color: #fff; }
.rbtn.small { flex-direction: row; min-width: 0; max-width: none; gap: 6px; padding: 2px 8px 2px 4px; height: 26px; }
.rbtn.small svg { width: 18px; height: 18px; }
.rcol { display: flex; flex-direction: column; gap: 1px; }
.rstack { display: flex; flex-direction: column; gap: 3px; justify-content: center; padding: 2px; min-width: 160px; }
.rstack label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ink-2); }
.rstack select, .rstack input[type=number], .rstack input[type=text] { font-size: 11.5px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg1); width: 110px; }
.rstack input[type=range] { width: 110px; accent-color: var(--red); }

/* ---------------- workspace */
#workspace { display: grid; grid-template-columns: calc(var(--left-w) * var(--ui)) 3px 1fr 3px calc(var(--right-w) * var(--ui)); min-height: 0; }
.panel { background: var(--bg1); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg2); }
.panel-tabs button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; }
.panel-tabs button.active { color: #fff; border-bottom-color: var(--red); }
.panel-title { padding: 7px 12px; font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--line); background: var(--bg2); }
.panel-body { flex: 1; overflow: auto; min-height: 0; }
.splitter { background: #0d1013; cursor: col-resize; }
.splitter:hover { background: var(--red); }
.filter { padding: 6px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--bg1); z-index: 2; }
.filter input { width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; outline: none; background: var(--bg0); }
.filter input:focus { border-color: var(--red); }

/* tree */
.tree { padding: 2px 0 20px; user-select: none; }
.tnode { display: flex; align-items: center; gap: 4px; height: 22px; padding-right: 6px; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.tnode:hover { background: var(--bg3); color: var(--ink); }
.tnode.sel { background: var(--sel); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.tnode.group { color: var(--ink-3); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-top: 4px; }
.tnode .tw { width: 14px; text-align: center; color: var(--ink-3); font-size: 9px; flex: none; }
.tnode .ic { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.tnode .ic svg { width: 14px; height: 14px; stroke: var(--ink-3); fill: none; stroke-width: 1.6; }
.tnode .ic.eqi svg { stroke: var(--blue); }
.tnode .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tnode .ct { color: var(--ink-3); font-size: 10.5px; }
.tnode .eye { opacity: 0; border: 0; background: none; cursor: pointer; padding: 0 2px; color: var(--ink-3); font-size: 10px; }
.tnode:hover .eye, .tnode .eye.off { opacity: 1; }
.tnode .eye.off { color: var(--red); }

/* properties */
.prop-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, var(--bg2), var(--bg1)); }
.prop-head .kind { font-size: 10px; letter-spacing: .12em; color: #ff5a63; font-weight: 700; text-transform: uppercase; }
.prop-head .title { font-size: 14px; font-weight: 700; margin-top: 2px; word-break: break-word; color: #fff; }
.prop-head .sub { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.props { width: 100%; border-collapse: collapse; }
.props td { padding: 3px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 12px; }
.props td:first-child { color: var(--ink-3); width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.props td input, .props td textarea, .props td select { width: 100%; border: 1px solid transparent; background: transparent; padding: 2px 4px; border-radius: 3px; font-size: 12px; }
.props td select { background: var(--bg0); border-color: var(--line-2); }
.props td input:hover, .props td textarea:hover { border-color: var(--line); background: var(--bg0); }
.props td input:focus, .props td textarea:focus, .props td select:focus { border-color: var(--red); background: var(--bg0); outline: none; }
.props .sect td { background: var(--bg2); font-weight: 700; color: var(--ink-2); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding-top: 5px; }
.props .noz { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.prop-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
.keys { padding: 4px 12px 12px; color: var(--ink-3); font-size: 11px; display: flex; flex-direction: column; gap: 5px; }

/* buttons */
.btn, .row button, .prop-actions button, .modal button, .mini { border: 1px solid var(--line); background: var(--bg3); padding: 4px 11px; border-radius: 4px; cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.mini { padding: 1px 8px; font-size: 10.5px; }
.btn:hover, .row button:hover, .prop-actions button:hover, .modal button:hover, .mini:hover { border-color: var(--ink-3); background: var(--bg4); }
button.primary { background: var(--red); border-color: var(--red); color: #fff; }
button.primary:hover { background: var(--red-2); border-color: var(--red-2); }
button.danger { color: #ff6b72; }
button.x { border: 0 !important; background: none !important; color: var(--ink-3); cursor: pointer; font-size: 16px; padding: 0 6px !important; }

/* ---------------- viewport */
#viewport { position: relative; min-width: 0; min-height: 0; background: linear-gradient(180deg, #dfe5ec 0%, #f4f6f8 70%, #ffffff 100%); overflow: hidden; }
#viewport.dark { background: radial-gradient(ellipse at 50% 0%, #4a5b70 0%, #2c3744 45%, #161b21 100%); }
#view3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#hud { position: absolute; top: 8px; left: 8px; display: flex; gap: 2px; align-items: center; background: rgba(16,20,25,.72); border: 1px solid rgba(255,255,255,.08); border-radius: 5px; padding: 2px; backdrop-filter: blur(4px); z-index: 4; }
#hud button { border: 0; background: none; color: #8d98a5; font: 700 10.5px var(--font); letter-spacing: .06em; padding: 3px 7px; border-radius: 3px; cursor: pointer; }
#hud button.on { color: #fff; background: rgba(208,32,42,.85); }
#hud button:hover { color: #fff; }
#hud .sep { width: 1px; height: 16px; background: rgba(255,255,255,.12); margin: 0 4px; }
#hud .wp { color: #9aa6b2; font-size: 10.5px; padding: 0 6px; cursor: pointer; }
#hud .wp b { color: #fff; font-family: var(--mono); }
#viewport:not(.dark) #hud { background: rgba(255,255,255,.85); border-color: #ccd3db; }
#toolBanner { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); background: rgba(16,20,25,.86); color: #fff; padding: 5px 6px 5px 14px; border-radius: 16px; display: flex; gap: 10px; align-items: center; font-size: 11.5px; box-shadow: 0 6px 18px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.08); max-width: 70%; z-index: 4; }
#toolBanner button { border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 12px; padding: 2px 10px; cursor: pointer; font-size: 11px; }
#emptyState { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; pointer-events: none; }
#emptyState img { width: 260px; margin: 0 auto 12px; }
#emptyState h2 { margin: 6px 0 2px; font-size: 20px; color: #fff; }
#emptyState p { color: var(--ink-2); max-width: 560px; margin: 0 auto 14px; }
#emptyState .row { display: flex; gap: 8px; justify-content: center; pointer-events: auto; }
#progress { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: 440px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 5; }
#progress .ptext { font-size: 12px; margin-bottom: 6px; }
#progress .bar { height: 6px; background: var(--bg0); border-radius: 3px; overflow: hidden; }
#progress .bar div { height: 100%; width: 0; background: var(--red); transition: width .2s; }
#winsel { position: absolute; border: 1px solid #18b8ff; background: rgba(24,184,255,.12); pointer-events: none; z-index: 6; }
#winsel.crossing { border-style: dashed; border-color: #27d17f; background: rgba(39,209,127,.12); }
#ctxmenu { width: 230px; top: 0; right: auto; padding: 4px 0; }
#ctxmenu .item { padding: 5px 14px; }
#ctxmenu .sep { height: 1px; background: var(--line); margin: 4px 0; }
.viewcube { position: absolute; top: 6px; right: 6px; width: 88px; height: 112px; z-index: 4; }
.viewcube canvas { width: 88px; height: 88px; cursor: pointer; }
.vc-proj { position: absolute; left: 50%; transform: translateX(-50%); top: 90px; font: 600 10px/1 var(--mono, monospace); letter-spacing: .08em; padding: 4px 8px; border-radius: 3px; background: rgba(20,26,34,.82); color: #cfd6de; border: 1px solid rgba(255,255,255,.14); cursor: pointer; }
.vc-proj:hover { border-color: var(--red); color: #fff; }
.vc-home { position: absolute; left: -2px; top: 2px; width: 22px; height: 22px; border: 0; border-radius: 4px; background: rgba(16,20,25,.6); cursor: pointer; display: grid; place-items: center; }
.vc-home svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 1.6; }
#triad { position: absolute; left: 8px; bottom: 6px; width: 80px; height: 80px; pointer-events: none; z-index: 3; }
#triad svg { width: 80px; height: 80px; overflow: visible; }
#triad line { stroke-width: 2.5; stroke-linecap: round; }
#triad .x { stroke: #e5484d; } #triad .y { stroke: #30c46c; } #triad .z { stroke: #3b8cff; }
#triad text { font: 700 10px var(--font); fill: #dfe6ee; text-anchor: middle; dominant-baseline: middle; }
.vlabel { position: absolute; pointer-events: none; background: rgba(16,20,25,.85); color: #fff; font: 600 calc(11px * var(--ui)) var(--font); padding: 2px 7px; border-radius: 9px; white-space: nowrap; transform: translate(-50%, -140%); z-index: 5; border: 1px solid rgba(255,255,255,.12); }
.vlabel.small { font-size: 10px; padding: 1px 6px; background: rgba(16,20,25,.6); color: #cfd8e2; }

/* SVG dimension layer */
.dimlayer { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; overflow: visible; }
.dim line { stroke: #ffd24d; stroke-width: 1.2; }
.dim .ext { stroke-dasharray: 3 3; stroke-width: 0.9; opacity: .8; }
.dim .arr { fill: #ffd24d; }
.dim rect { fill: rgba(16,20,25,.88); rx: 3; stroke: rgba(255,210,77,.6); stroke-width: .8; }
.dim text { fill: #ffe9a8; font: 700 calc(11px * var(--ui)) var(--mono); text-anchor: middle; }
.dim.editable { pointer-events: all; cursor: text; }
.dim.editable rect { stroke: #18b8ff; stroke-width: 1.2; }
.dim.editable:hover rect { fill: #0f3550; }
.dim.clear line { stroke: #7fdcff; } .dim.clear .arr { fill: #7fdcff; } .dim.clear text { fill: #bdeeff; } .dim.clear rect { stroke: rgba(127,220,255,.5); }
.dim.warn line { stroke: #ff7a1a; } .dim.warn .arr { fill: #ff7a1a; } .dim.warn text { fill: #ffd0b0; } .dim.warn rect { stroke: #ff7a1a; }
.dim.tag line { stroke: rgba(255,255,255,.5); } .dim.tag text { fill: #fff; } .dim.tag rect { stroke: rgba(255,255,255,.25); }
.dim-input { position: absolute; transform: translate(-50%, -50%); width: 90px; z-index: 20; font: 700 12px var(--mono); padding: 3px 6px; border: 2px solid #18b8ff; border-radius: 4px; background: #0b1218; color: #fff; outline: none; text-align: center; }

/* ---------------- command line + status */
#cmdbar { background: #0f1317; border-top: 1px solid #000; font-family: var(--mono); font-size: 11.5px; position: relative; }
#cmdHist { height: 44px; overflow: auto; padding: 2px 10px 0; color: #7f8a97; white-space: pre-wrap; }
#cmdHist div.err { color: #ff8a8f; } #cmdHist div.ok { color: #9fe8bf; }
.cmdrow { display: flex; align-items: center; gap: 6px; padding: 2px 8px 3px; position: relative; }
#cmdPrompt { color: #ffcf5a; white-space: nowrap; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
#cmdInput { flex: 1; border: 0; outline: none; background: transparent; color: #fff; padding: 2px 0; font: inherit; }
#cmdAuto { top: auto; bottom: 26px; left: 8px; right: auto; width: 420px; }
#statusbar { display: flex; gap: 16px; align-items: center; padding: 0 10px; font-size: 11px; color: #9aa6b2; background: var(--bg2); border-top: 1px solid var(--line); font-family: var(--mono); white-space: nowrap; overflow: hidden; }
#stMsg { color: #ffe08a; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- bottom panel */
#bottom { background: var(--bg1); border-top: 1px solid var(--line); display: flex; flex-direction: column; height: var(--bottom-h); min-height: 0; }
#bottom.collapsed { height: 27px; }
#bottom.collapsed .bottom-body { display: none; }
#bottom .panel-tabs { align-items: center; }
#bottomToggle { padding: 3px 12px !important; }
.bottom-body { flex: 1; overflow: auto; font-size: 12px; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; text-align: center; }
.badge:empty { display: none; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { position: sticky; top: 0; background: var(--bg2); text-align: left; font-size: 10.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 8px; border-bottom: 1px solid var(--line); z-index: 1; }
table.grid td { padding: 3px 8px; border-bottom: 1px solid var(--line-2); }
table.grid.tight td, table.grid.tight th { padding: 2px 6px; font-size: 11px; }
table.grid.edit td input, table.grid.edit td select { background: var(--bg0); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; font-size: 11px; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--bg3); }
.sev { font-weight: 700; font-size: 10.5px; text-transform: uppercase; }
.sev.error { color: var(--err); } .sev.warning { color: var(--warn); } .sev.ok { color: var(--ok); }
#btab-log { font-family: var(--mono); font-size: 11px; padding: 6px 10px; white-space: pre-wrap; color: var(--ink-2); }

/* ---------------- modals */
.modal-back { position: fixed; inset: 0; background: rgba(5,7,10,.6); display: grid; place-items: center; z-index: 100; }
.modal { background: var(--bg1); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 64px rgba(0,0,0,.6); width: min(720px, 94vw); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { width: min(1560px, 97vw); height: 93vh; }
.modal.xwide { width: min(1320px, 96vw); height: 86vh; }
.modal.mid { width: min(1000px, 94vw); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.modal header h3 { margin: 0; font-size: 14px; color: #fff; }
.modal header .x { margin-left: auto; font-size: 20px; }
.modal .body { padding: 14px 16px; overflow: auto; flex: 1; min-height: 0; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--bg2); }
.form { display: grid; grid-template-columns: 170px 1fr; gap: 7px 12px; align-items: center; }
.form label { color: var(--ink-2); font-size: 12px; }
.form input, .form select, .form textarea { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; width: 100%; outline: none; background: var(--bg0); }
.form input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--red); }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--red); }
.form textarea { min-height: 90px; font-family: var(--font); }
.form .fsect, .fsect { grid-column: 1 / -1; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: #ff5a63; border-bottom: 1px solid var(--line); padding: 8px 0 3px; margin-top: 4px; }
.plist { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.plist .pi { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.plist .pi:last-child { border-bottom: 0; }
.plist .pi:hover { background: var(--bg3); }
.plist .pi.cur { box-shadow: inset 3px 0 0 var(--red); }
.plist .pi b { flex: 1; }
.plist .pi small { color: var(--ink-3); }
.plist svg { stroke: var(--ink-2); fill: none; width: 22px; }
.iso-wrap { display: grid; grid-template-columns: 1fr 320px; height: 100%; min-height: 0; }
.iso-sheet { background: #3a414a; overflow: auto; display: grid; place-items: center; padding: 16px; position: relative; }
.iso-sheet .sheet { background: #fff; box-shadow: 0 6px 30px rgba(0,0,0,.5); }
.iso-sheet .sheet svg { display: block; width: 100%; height: auto; }
.iso-side { border-left: 1px solid var(--line); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.iso-side h4 { margin: 4px 0 2px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.frames { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.frames .fr { border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; cursor: pointer; font-size: 11.5px; background: var(--bg2); }
.frames .fr b { display: block; color: #fff; font-size: 12px; }
.frames .fr.on { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12px; }
.kv span:nth-child(odd) { color: var(--ink-3); }
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack button { text-align: left; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; cursor: pointer; font-size: 11.5px; background: var(--bg2); }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.warnbox { background: rgba(240,164,0,.1); border: 1px solid rgba(240,164,0,.4); color: #ffd27a; padding: 8px 10px; border-radius: 6px; font-size: 12px; }
.okbox { background: rgba(39,209,127,.08); border: 1px solid rgba(39,209,127,.35); color: #9fe8bf; padding: 8px 10px; border-radius: 6px; font-size: 12px; }

/* equipment library & editor */
.lib { display: grid; grid-template-columns: 240px 1fr; height: 100%; min-height: 0; gap: 0; margin: -14px -16px; }
.lib-cats { border-right: 1px solid var(--line); padding: 10px; overflow: auto; display: flex; flex-direction: column; gap: 2px; background: var(--bg2); }
.lib-search { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg0); outline: none; margin-bottom: 8px; }
.lib-search:focus { border-color: var(--red); }
.lib-cat { padding: 7px 10px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; color: var(--ink-2); font-weight: 600; }
.lib-cat span { color: var(--ink-3); font-weight: 400; }
.lib-cat:hover { background: var(--bg3); }
.lib-cat.on { background: var(--red-soft); color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.lib-grid { padding: 14px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; }
.lib-card { border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); cursor: pointer; overflow: hidden; transition: border-color .12s, transform .12s; }
.lib-card:hover { border-color: var(--red); transform: translateY(-1px); }
.lib-card .thumb { height: 150px; background: radial-gradient(ellipse at 50% 20%, #4a5b70, #222a33); display: grid; place-items: center; }
.lib-card .thumb img { max-width: 100%; max-height: 150px; }
.lib-card .nm { font-weight: 700; padding: 8px 10px 2px; color: #fff; }
.lib-card .ds { color: var(--ink-3); font-size: 11px; padding: 0 10px; min-height: 30px; }
.lib-card .tg { color: var(--blue); font-size: 10.5px; padding: 4px 10px 8px; font-family: var(--mono); }
.eq-edit { display: grid; grid-template-columns: 580px 1fr; gap: 16px; height: 100%; min-height: 0; }
.eq-left { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; }
.eq-left canvas { width: 560px; height: 420px; border-radius: 8px; background: radial-gradient(ellipse at 50% 15%, #4a5b70, #1d242c); }
.eq-info { font-size: 11.5px; color: var(--ink-2); }
.eq-right { overflow: auto; min-height: 0; padding-right: 6px; }
.eq-form { grid-template-columns: 200px 1fr; }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 60px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #10151a; color: #fff; padding: 8px 14px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.45); max-width: 460px; font-size: 12px; border-left: 4px solid var(--ok); border: 1px solid #2a323b; border-left-width: 4px; border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }

/* cloud list */
.cloud-item { padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.cloud-item .t { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.cloud-item .t span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-item .m { color: var(--ink-3); font-size: 11px; margin: 2px 0 6px; }
.cloud-item .row { display: flex; gap: 6px; flex-wrap: wrap; }
.cloud-item button { padding: 2px 8px; font-size: 11px; }
.empty-note { padding: 18px 14px; color: var(--ink-3); text-align: center; }
.empty-note button { margin-top: 10px; }

.lib.sup { grid-template-columns: 200px 1fr 460px; }
.sup-detail { border-left: 1px solid var(--line); padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.sup-detail canvas { width: 420px; height: 300px; border-radius: 8px; background: radial-gradient(ellipse at 50% 15%, #4a5b70, #1d242c); }
.lib-card.on { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.vlabel.sk { background: transparent; border: 0; color: #cfeaff; font-size: calc(13px * var(--ui)); transform: translate(0, -50%); }
.vlabel.grid { background: #2a0d10; border: 2px solid #ff5a63; color: #fff; border-radius: 50%; min-width: 26px; text-align: center; transform: translate(-50%, -50%); }

/* HUD command buttons (undo / redo / extents / plan) */
#hud .hcmd { display: inline-flex; align-items: center; gap: 4px; }
#hud .hcmd svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#hud .hcmd:hover { background: var(--bg4); color: #fff; }
/* desktop-application behaviour: no text selection outside fields */
body { user-select: none; -webkit-user-select: none; }
input, textarea, [contenteditable], .selectable, .selectable * { user-select: text; -webkit-user-select: text; }
img, svg { -webkit-user-drag: none; }
#titlebar .product i { font-style: normal; font-weight: 400; letter-spacing: .18em; opacity: .92; }

/* scan recognition review */
.recrow { display: grid; grid-template-columns: 18px 1fr; gap: 2px 6px; padding: 4px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.recrow:hover { background: var(--bg3); }
.recrow .muted { grid-column: 2; font-size: 11px; }
.modal .bar { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.modal .bar > div { height: 100%; background: var(--red); transition: width .2s; }
.sev.ok { background: rgba(39,209,127,.18); color: var(--ok); }

/* AI assistant */
#btab-assistant { display: grid; grid-template-rows: 1fr auto auto; gap: 4px; padding: 6px 10px; }
#btab-assistant.hidden { display: none; }
.ai-log { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.ai-msg { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 3px 6px; border-radius: 4px; white-space: pre-wrap; }
.ai-msg.ai-me { background: var(--bg3); }
.ai-msg b { color: var(--ink-3); font-weight: 600; }
.ai-msg.ai-bot b { color: var(--red); }
.ai-msg.err span { color: var(--err); } .ai-msg.warn span { color: var(--warn); }
.ai-row { display: flex; gap: 6px; } .ai-input { flex: 1; background: var(--bg0); border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; }
.ai-input:focus { outline: none; border-color: var(--red); }
.ai-chips .chip { cursor: pointer; }
.ai-tab { color: #ffb3b7 !important; }
.size-legend { position: absolute; right: 12px; bottom: 12px; background: rgba(16,20,25,.85); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; padding: 6px 10px; font-size: calc(11px * var(--ui)); color: #dfe6ee; z-index: 4; display: grid; gap: 2px; }
.size-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -2px; }

#hud { flex-wrap: wrap; max-width: calc(100% - 210px); }
.ai-row button:not(.primary) { background: var(--bg3); color: var(--ink-2, #c9d1dc); border: 1px solid var(--line); border-radius: 4px; padding: 0 12px; cursor: pointer; }
.ai-row button:not(.primary):hover { border-color: var(--red); color: #fff; }

/* ---------------- P&ID designer */
#pidView { position: absolute; inset: 0; z-index: 6; background: #2a3038; display: flex; flex-direction: column; }
#pidView.hidden, #pidLeft.hidden { display: none; }
.pid-svg { flex: 1; width: 100%; height: 100%; display: block; cursor: default; user-select: none; }
.pid-svg .pid-paper { filter: drop-shadow(0 2px 10px rgba(0,0,0,.45)); }
.pid-svg .pid-item { cursor: pointer; }
.pid-svg .pid-item:hover > * { stroke-opacity: .8; }
.pid-svg .pid-sym:hover rect.hit, .pid-svg .pid-line:hover polyline.hit { fill: rgba(26,127,214,.08); stroke: rgba(26,127,214,.35); }
.pid-svg .pid-grip { cursor: move; }
.pid-bar { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; align-items: center; background: rgba(20,26,34,.9); border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; padding: 4px 6px; zoom: var(--ui); }
.pid-bar button { font: 600 10.5px/1 var(--mono, monospace); letter-spacing: .06em; color: #cfd6de; background: transparent; border: 1px solid transparent; border-radius: 3px; padding: 5px 7px; cursor: pointer; }
.pid-bar button:hover { border-color: var(--red); color: #fff; }
.pid-bar .sep { width: 1px; height: 16px; background: rgba(255,255,255,.15); margin: 0 4px; }
.pid-sheetname { color: #fff; font-weight: 600; font-size: 12px; padding: 0 4px; }
.pid-coords { color: #8d97a3; font: 11px var(--mono, monospace); min-width: 140px; }
#pidWin { position: absolute; border: 1px solid #1a7fd6; background: rgba(26,127,214,.08); pointer-events: none; display: none; }
#pidWin.crossing { border-style: dashed; border-color: #27d17f; background: rgba(39,209,127,.08); }
body.pid-mode #left > .panel-tabs, body.pid-mode #left > .panel-body { display: none !important; }
#pidLeft { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 6px; gap: 6px; }
#pidLeft .row { display: flex; gap: 4px; } #pidLeft .row > * { flex: 1; min-width: 0; } #pidLeft .row > button { flex: 0 0 32px; }
.pid-palette { flex: 1; overflow: auto; min-height: 0; }
.pid-cat { padding: 6px 4px; font-weight: 600; color: var(--ink-2, #c9d1dc); cursor: pointer; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.pid-cat small { color: var(--ink-3, #8d97a3); font-weight: 400; }
.pid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; padding: 6px 0; }
.pid-symcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 3px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; background: #f5f6f8; color: #111; }
.pid-symcard:hover { border-color: var(--red); background: #fff; }
.pid-symcard span { font-size: 9.5px; line-height: 1.15; text-align: center; color: #333; }
.pid-thumb { color: #111; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--bg3); }
.chip.on { background: var(--red); color: #fff; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.learn-card { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 6px; }
.learn-card .pv { background: #f5f6f8; border-radius: 4px; display: grid; place-items: center; height: 60px; color: #111; }
.learn-card .pv svg { max-width: 60px; max-height: 56px; }
.learn-card select, .learn-card input { width: 100%; font-size: 11px; }
.learn-card .conf { font-size: 10px; color: var(--ink-3, #8d97a3); }
.learn-card.off { opacity: .45; }
#pidLeft select, #pidLeft input { background: var(--bg0, #11161c); color: var(--ink, #e7ecf1); border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; }
#pidLeft .row > button { background: var(--bg3); color: #fff; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.lib-card.lib-import .thumb.imp { font-size: 64px; color: #fff; font-weight: 200; }
.lib-card .tg .x { float: right; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }
.lib-card .tg .x:hover { color: var(--red); }
.scope-row { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.scope-row.on { background: rgba(208, 32, 42, .12); }
.scope-row input { width: 110px; }
.scope-row .x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }
.sec-prev { height: 62vh; background: #fff; border-radius: 6px; overflow: hidden; }
#isoBar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 12px;
  background: rgba(208, 32, 42, .95); color: #fff; padding: 6px 8px 6px 14px; border-radius: 6px; font: 600 13px/1 var(--mono, monospace); letter-spacing: .06em; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
#isoBar.hidden { display: none; }
#isoBar button { background: #fff; color: #b30006; border: 0; border-radius: 4px; padding: 6px 12px; font: inherit; cursor: pointer; }
#isoBar button:hover { background: #ffe5e6; }
.lv-block { border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 4px; }
.lv-head .lv-edit, .lv-row .lv-plan { margin-left: 8px; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; font-size: 11px; padding: 1px 7px; cursor: pointer; }
.lv-head .lv-edit:hover, .lv-row .lv-plan:hover { color: #fff; border-color: var(--red); }
.lv-row { cursor: pointer; }
.lv-row.on { background: rgba(90, 160, 224, .14); }
.lv-row.on .nm { color: #fff; font-weight: 600; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; background: #5aa0e0; display: inline-block; margin-right: 8px; flex: none; }
.lv-dot.grade { background: #6bc06b; } .lv-dot.roof { background: #c08a5a; } .lv-dot.rack { background: #e0b100; }
.vlabel.lvl { background: rgba(30, 60, 95, .85); color: #cfe6ff; font-size: 11px; }
.lv-pick { display: flex; justify-content: space-between; width: 100%; padding: 8px 12px; margin-bottom: 4px; }
.lv-pick.on { border-color: var(--red); }
.lv-table input, .lv-table select { font-size: 14px; }

.dim-edit { position: absolute; transform: translate(-50%, -50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.dim-edit .dim-input { position: static; transform: none; pointer-events: auto; }
.dim-hint { font: 600 11px var(--mono); color: #18b8ff; background: rgba(11, 18, 24, .92); padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.vv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-height: 64vh; overflow: auto; }
.vv-filter { width: 100%; }
.vv-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; background: var(--bg2); }
.vv-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.vv-head b { margin-right: auto; letter-spacing: .04em; }
.vv-head button { font-size: 11px; padding: 2px 8px; }
.vv-item { display: flex; align-items: center; gap: 8px; padding: 4px 2px; cursor: pointer; border-radius: 4px; }
.vv-item:hover { background: rgba(255, 255, 255, .04); }
.vv-item input { width: 16px; height: 16px; accent-color: #d0202a; }
.vv-item .ct { margin-left: auto; color: var(--muted); font-size: 12px; }
.vv-item.off span:not(.ct) { color: var(--muted); text-decoration: line-through; }
.vv-empty { padding: 4px 2px; font-size: 12px; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }
/* default controls inside panels (no browser-white buttons / inputs on the dark theme) */
#props button:not(.primary):not(.x), .vis-panel button:not(.primary) { border: 1px solid var(--line); background: var(--bg3); color: var(--ink); padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 11.5px; font-weight: 600; }
#props button.danger { color: #ff6b72; }
#props button:not(.primary):not(.x):hover { background: var(--bg4); border-color: var(--ink-3); }
#props button.primary { padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 11.5px; font-weight: 600; border: 1px solid var(--red); }
#props .scope-row input, #props .prop-actions input, #props .prop-actions select, .vis-panel select { background: var(--bg0); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }
#props .scope-row input[type=number] { width: 76px; }
body.mod-select .dim.editable, body.mod-select .dimlayer * { pointer-events: none !important; }
.rgroup-right { margin-left: auto; border-left: 1px solid var(--line); border-right: 0; }
.quickvis { display: grid; grid-template-columns: auto auto; grid-auto-flow: column; grid-template-rows: repeat(4, auto); gap: 1px 14px; padding: 2px 4px; font-size: 11.5px; }
.quickvis label { display: flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; color: var(--ink-2); }
.quickvis input { margin: 0; accent-color: var(--red); }
.sec-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sec-choice { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sec-choice .form { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
.sec-choice .form label { display: contents; }
table.reg td { white-space: nowrap; } table.reg td button { margin-right: 4px; }
.modal select, .modal input:not([type=checkbox]):not([type=color]):not([type=range]):not([type=radio]), .modal textarea { background: var(--bg0); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }
.modal input[type=date] { color-scheme: dark; }

/* ---- team workspace ---- */
#teamChips { display: flex; gap: 4px; margin-right: 8px; }
.tchip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 10.5px; font-weight: 700; color: #fff; cursor: pointer; border: 2px solid rgba(255,255,255,.75); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.tchip.away { opacity: .45; }
.tchip.sm { width: 20px; height: 20px; font-size: 9px; border-width: 1px; }
.team-ws { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.8); margin-right: 10px; border: 1px solid rgba(255,255,255,.3); padding: 2px 8px; border-radius: 3px; }
.cbadge { display: inline-grid; place-items: center; min-width: 17px; height: 15px; padding: 0 3px; border-radius: 8px; font-size: 9px; font-weight: 700; color: #fff; margin-left: 4px; flex: none; }
.cbadge.mine { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.claimbar { margin: 8px; padding: 8px 10px; border-left: 4px solid var(--gold); background: var(--bg2); border-radius: 3px; font-size: 12px; line-height: 1.45; }
.claimbar.other { background: rgba(255,77,85,.10); }
.claimbar.mine { border-left-color: var(--gold); }
.claimbar.free { border-left-color: var(--line); color: var(--ink-3); }
.claimbar button { margin-left: 8px; font-size: 11px; padding: 2px 8px; }
.teampanel .tp-me { display: flex; align-items: center; gap: 10px; }
.teampanel .tp-me .tchip { width: 36px; height: 36px; font-size: 14px; }
.teampanel .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.teampanel .row input { flex: 1; min-width: 260px; }
.teampanel .urls { display: flex; flex-direction: column; gap: 2px; }
.teampanel .urls code { user-select: all; }
.modal.mid { width: calc(760px); }
.login-back { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #262c35, #111418 70%); }
.login { width: 360px; padding: 34px 34px 22px; background: var(--bg1); border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 6px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login img { height: 34px; align-self: flex-start; margin-bottom: 6px; }
.login h2 { margin: 0; letter-spacing: .22em; font-size: 17px; } .login h2 i { font-style: normal; font-weight: 400; color: var(--ink-2); }
.login-ws { color: var(--ink-3); margin-bottom: 12px; font-size: 12px; letter-spacing: .04em; }
.login label { color: var(--ink-3); font-size: 11.5px; margin-top: 4px; }
.login input:not([type=checkbox]) { padding: 7px 9px; background: var(--bg0); border: 1px solid var(--line); border-radius: 3px; }
.login .chk { display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.login button.primary { margin-top: 10px; padding: 8px; }
.login button.link { background: none; border: none; color: var(--ink-3); cursor: pointer; margin-top: 4px; }
.login-err { color: var(--err); min-height: 16px; font-size: 12px; }
.login-foot { color: var(--ink-3); font-size: 10.5px; text-align: right; margin-top: 8px; }
.scrollx { overflow-x: auto; max-width: 100%; }
details > summary.fsect { list-style: none; }
details > summary.fsect::before { content: "▸ "; } details[open] > summary.fsect::before { content: "▾ "; }

/* Compact viewport controls, independent of the application's readable property font. */
#hud {max-width:calc(100% - 110px);flex-wrap:wrap;width:max-content;gap:1px;padding:2px;top:5px;left:5px;}
#hud button {font-size:10px;letter-spacing:0;padding:2px 5px;line-height:16px;}
#hud svg {width:12px;height:12px;}
#hud .wp {font-size:9px;padding:0 4px;max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#viewport.dark {background:linear-gradient(180deg,#303944,#20262d);}
