:root {
  --accent: #1d4f91;
  --accent-2: #0f62c4;
  --accent-light: #cfe3f8;
  --sel: #a9c8ec;
  --bg: #f3f3f3;
  --panel: #fbfbfb;
  --border: #d6d6d6;
  --border-2: #e6e6e6;
  --text: #1b1b1b;
  --muted: #6b6b6b;
  --danger: #c42b1c;
  --ok: #107c10;
  --font: 'Segoe UI', 'Selawik', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.4 var(--font); color: var(--text); background: var(--bg); overflow: hidden; }
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.pad { padding: 16px; }
.mono { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 12px; }
kbd { background: #eee; border: 1px solid #ccc; border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; font-size: 11.5px; }
.loading { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--border); background: #fff; border-radius: 4px; padding: 5px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #f0f0f0; border-color: #c4c4c4; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0b55ad; border-color: #0b55ad; }
.btn-danger { color: var(--danger); }
.btn.sm { padding: 2px 9px; font-size: 12px; }
.btn.wide { width: 100%; justify-content: center; padding: 8px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 3px 5px; border-radius: 4px; color: #444; display: inline-flex; align-items: center; }
.icon-btn:hover:not(:disabled) { background: #e8e8e8; }
.icon-btn:disabled { opacity: .3; }
.input { border: 1px solid var(--border); border-bottom-color: #8a8a8a; border-radius: 4px; padding: 5px 8px; background: #fff; min-width: 0; }
.input:focus { outline: none; border-bottom: 2px solid var(--accent-2); padding-bottom: 4px; }
.input.sm { padding: 2px 6px; font-size: 12px; }
.input.sm:focus { padding-bottom: 1px; }
.input.lg { font-size: 15px; padding: 8px 10px; }
textarea.input { width: 100%; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.chip { display: inline-block; font-size: 11px; background: #eef2f8; color: #33507a; border-radius: 10px; padding: 0 8px; margin-top: 3px; }
.swatch { display: inline-block; width: 26px; height: 11px; border: 1px solid #333; vertical-align: middle; flex: none; }
.swatch.lg { width: 30px; height: 18px; border-radius: 2px; }
.ico { flex: none; }

/* ---------- toasts, modals, menus ---------- */
#toasts { position: fixed; right: 16px; bottom: 36px; display: flex; flex-direction: column; gap: 6px; z-index: 1000; }
.toast { background: #2b2b2b; color: #fff; padding: 8px 14px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: opacity .4s; max-width: 420px; }
.toast-error { background: var(--danger); }
.toast-ok { background: var(--ok); }
.toast.hide { opacity: 0; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); display: grid; place-items: center; z-index: 500; }
.modal { background: #fff; border-radius: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.3); max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 18px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--border-2); }
.modal-body { padding: 14px 18px; overflow: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; background: #f6f6f6; border-top: 1px solid var(--border-2); border-radius: 0 0 8px 8px; }
.modal-footer .btn { min-width: 92px; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .input { width: 100%; }
.ctx-menu { position: fixed; z-index: 900; background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; min-width: 230px; }
.ctx-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 4px; cursor: pointer; position: relative; }
.ctx-item:hover:not(.disabled) { background: #e9eef6; }
.ctx-item.disabled { color: #aaa; cursor: default; }
.ctx-icon { width: 18px; display: inline-flex; }
.ctx-label { flex: 1; }
.ctx-shortcut { color: var(--muted); font-size: 12px; }
.ctx-sep { height: 1px; background: #e2e2e2; margin: 4px 2px; }
.ctx-item > .ctx-menu { display: none; position: absolute; left: 100%; top: -5px; }
.ctx-item.has-sub:hover > .ctx-menu { display: block; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 8px; }
.form-row { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 10px; }
.form-row > label { color: #333; }
.form-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-ctl > .input, .form-ctl > .combo { flex: 1; }
.form-row > .input { width: 100%; }
.form-sub { font-weight: 600; margin-top: 8px; color: #333; border-bottom: 1px solid var(--border-2); padding-bottom: 3px; }
.combo { display: inline-flex; gap: 6px; align-items: center; min-width: 0; }
.combo .input { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.seg-btn { border: 0; background: #fff; padding: 4px 12px; cursor: pointer; border-right: 1px solid var(--border); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.active { background: var(--accent-2); color: #fff; }
.inline { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- grids ---------- */
.grid-wrap { overflow: auto; border: 1px solid var(--border-2); background: #fff; }
.grid-wrap.tall { max-height: 60vh; }
table.grid { border-collapse: collapse; width: 100%; font-size: 12px; background: #fff; }
.grid th { position: sticky; top: 0; background: #f2f2f2; font-weight: 600; text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-2); white-space: nowrap; z-index: 1; }
.grid td { padding: 3px 6px; border-bottom: 1px solid #eee; border-right: 1px solid #f2f2f2; white-space: nowrap; }
.grid tbody tr { cursor: default; }
.grid tbody tr:hover { background: #f3f7fc; }
.grid tr.selected, .grid tr.selected:hover { background: var(--sel); }
.grid td.warn { color: #b25c00; }
.grid td.editable { cursor: cell; }
.grid td.overridden { position: relative; }
.grid td.overridden::before, .overridden-key::before { content: ''; position: absolute; left: 0; top: 0; border-style: solid; border-width: 7px 7px 0 0; border-color: #222 transparent transparent transparent; }
.overridden-key { position: relative; border: 1px solid var(--border); padding: 3px 16px; background: #fff; border-radius: 3px; }
.cell-input { width: 100%; }
.row-actions { text-align: right; white-space: nowrap; }

/* ---------- login ---------- */
.login { height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #1d4f91, #0f2c55); }
.login-card { width: 340px; background: #fff; border-radius: 10px; padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card .input { padding: 8px 10px; }
.login-sub { color: var(--muted); margin: -8px 0 8px; }
.login-err { color: var(--danger); min-height: 18px; }
.brand { font-size: 30px; font-weight: 700; letter-spacing: .5px; }
.brand.big { font-size: 44px; }
.brand-es { color: #1d4f91; }
.brand-wire { color: #2d8be0; }

/* ---------- backstage ---------- */
.backstage { display: flex; height: 100%; }
.bs-rail { width: 196px; background: var(--accent); color: #fff; display: flex; flex-direction: column; padding: 18px 0; flex: none; }
.bs-brand { font-size: 26px; font-weight: 700; padding: 0 20px 22px; }
.bs-brand .brand-es { color: #fff; }
.bs-brand .brand-wire { color: #9fd0ff; }
.bs-link { color: #fff; padding: 9px 20px; font-size: 15px; }
.bs-link:hover { background: rgba(255,255,255,.1); }
.bs-link.active { background: #153b6d; }
.bs-sp { flex: 1; border-bottom: 1px solid rgba(255,255,255,.35); margin: 12px 20px; }
.bs-main { flex: 1; display: flex; flex-direction: column; background: #fff; min-width: 0; }
.bs-top { display: flex; justify-content: space-between; padding: 8px 18px; border-bottom: 1px solid var(--border-2); }
.bs-app { font-weight: 600; }
.bs-user { display: inline-flex; gap: 6px; align-items: center; color: #444; }
.bs-content { flex: 1; overflow: auto; }
.start { padding: 18px 36px; }
.start.narrow { max-width: 900px; }
.start h1, .library h1 { font-weight: 300; font-size: 34px; margin: 6px 0 18px; }
.tiles { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.tile { width: 150px; height: 120px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 13.5px; }
.tile:hover { border-color: var(--accent-2); background: #f5f9ff; }
.tile-ico { color: var(--accent); }
.start-body { display: flex; gap: 20px; }
.start-nav { width: 200px; flex: none; }
.start-main { flex: 1; min-width: 0; }
.search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.search-row .input { flex: 1; }
table.designs td { padding: 6px 8px; }
.design-link { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.card-title { font-size: 16px; font-weight: 600; }

/* ---------- library ---------- */
.library { display: flex; flex-direction: column; height: 100%; padding: 14px 24px 0; }
.lib-top { display: flex; align-items: center; gap: 24px; }
.lib-top h1 { margin: 0; }
.lib-search { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid #888; border-radius: 4px; padding: 0 10px; max-width: 900px; }
.lib-search .input { border: 0; flex: 1; }
.lib-body { flex: 1; display: flex; gap: 0; margin-top: 14px; min-height: 0; border-top: 1px solid var(--border-2); }
.lib-nav { width: 220px; flex: none; overflow: auto; padding: 10px 8px 10px 0; border-right: 1px solid var(--border-2); }
.lib-nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.lib-nav-item span:nth-child(2) { flex: 1; }
.lib-nav-item:hover { background: #f0f0f0; }
.lib-nav-item.active { background: var(--accent-light); }
.lib-nav-sep { height: 1px; background: var(--border-2); margin: 8px 4px; }
.lib-list { flex: 1; overflow: auto; min-width: 0; }
.lib-list-head { display: flex; justify-content: space-between; padding: 10px 14px; font-weight: 600; font-size: 14px; position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--border-2); }
.lib-row { display: flex; gap: 14px; padding: 9px 14px; border-bottom: 1px solid #eee; cursor: pointer; }
.lib-row:hover { background: #f5f8fc; }
.lib-row.selected { background: var(--sel); }
.lib-thumb { width: 56px; height: 48px; border: 1px solid #e3e3e3; border-radius: 4px; display: grid; place-items: center; color: #555; background: #fafafa; flex: none; }
.lib-main { min-width: 0; }
.lib-main b { font-size: 14px; }
.lib-mfr { margin-left: 10px; color: #333; }
.lib-detail { width: 400px; flex: none; overflow: auto; border-left: 1px solid var(--border-2); padding: 12px 16px; }
.lib-detail .form-row { grid-template-columns: 140px 1fr; }
.lib-detail-head { display: flex; align-items: center; gap: 10px; }
.lib-detail-head h3 { margin: 4px 0; }
.lib-actions { display: flex; gap: 8px; margin: 16px 0; }
details summary { cursor: pointer; color: var(--accent-2); margin: 6px 0; }

/* ---------- editor ---------- */
.editor { display: flex; flex-direction: column; height: 100%; }
.ed-top { display: flex; align-items: center; background: var(--accent); color: #fff; height: 34px; flex: none; }
.file-btn { background: #153b6d; color: #fff; border: 0; height: 100%; padding: 0 20px; cursor: pointer; font-weight: 600; }
.file-btn:hover { background: #0f2c55; }
.ed-title { flex: 1; text-align: center; font-size: 13px; }
.doc-name { font-weight: 600; }
.doc-meta { opacity: .8; }
.dirty-dot { color: #ffd23f; margin-left: 8px; }
.ribbon { background: #fff; border-bottom: 1px solid var(--border); flex: none; }
.rb-tabs { display: flex; gap: 2px; padding: 0 8px; background: #fff; }
.rb-tab { border: 0; background: transparent; padding: 6px 14px 4px; cursor: pointer; border-bottom: 2px solid transparent; color: #333; }
.rb-tab:hover { background: #f2f2f2; }
.rb-tab.active { border-bottom-color: var(--accent-2); color: var(--accent-2); font-weight: 600; }
.rb-body { display: flex; padding: 4px 6px 0; min-height: 76px; overflow-x: auto; border-top: 1px solid var(--border-2); background: #fafafa; }
.rb-group { display: flex; flex-direction: column; border-right: 1px solid var(--border-2); padding: 0 6px; }
.rb-items { display: flex; align-items: stretch; gap: 1px; flex: 1; }
.rb-label { text-align: center; color: var(--muted); font-size: 11px; padding: 1px 0 3px; }
.rb-btn { border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 3px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 50px; font-size: 11.5px; color: #222; }
.rb-btn .ico { color: #2c4f7c; }
.rb-btn:hover:not(:disabled) { background: #e9eef6; border-color: #d6e0ee; }
.rb-btn.active { background: var(--accent-light); border-color: #9fc3ea; }
.rb-btn:disabled { opacity: .35; cursor: default; }
.rb-btn.big { min-width: 62px; }
.rb-field { display: flex; align-items: center; padding: 6px 4px; }
.ed-main { flex: 1; display: flex; min-height: 0; }
.side { width: 330px; background: var(--panel); display: flex; flex-direction: column; flex: none; min-height: 0; }
.side.left { border-right: 1px solid var(--border); }
.side.right { width: 290px; border-left: 1px solid var(--border); }
.side-tabs { display: flex; border-bottom: 1px solid var(--border); background: #fff; flex: none; }
.side-tab { flex: 1; border: 0; background: transparent; padding: 7px 4px 5px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 12.5px; white-space: nowrap; }
.side-tab:hover { background: #f2f2f2; }
.side-tab.active { background: var(--accent-2); color: #fff; }
.side-head { padding: 8px 12px; font-weight: 600; border-bottom: 1px solid var(--border); background: #fff; }
.side-body { flex: 1; overflow: auto; min-height: 0; }
.panel-col { display: flex; flex-direction: column; height: 100%; }
.panel-col .grid-wrap { flex: 1; border: 0; border-top: 1px solid var(--border-2); }
.panel-tools { display: flex; gap: 4px; padding: 6px; flex-wrap: wrap; }
.conn-search { display: flex; gap: 6px; align-items: center; padding: 0 6px 6px; }
.conn-search .input { flex: 1; }
.inspect { max-height: 45%; overflow: auto; border-top: 2px solid var(--border); }
.inspect-title { font-weight: 600; padding: 6px 8px; }

.tree { padding: 4px 0; user-select: none; }
.tree-row { display: flex; align-items: center; gap: 4px; padding: 2px 6px; cursor: default; white-space: nowrap; }
.tree-row:hover { background: #eef3f9; }
.tree-row.selected { background: var(--sel); }
.tw { width: 14px; display: inline-flex; justify-content: center; transition: transform .1s; color: #555; }
.tw.open { transform: rotate(90deg); }
.ti { display: inline-flex; color: #2c4f7c; }
.tl { overflow: hidden; text-overflow: ellipsis; }
.tsub { color: var(--muted); overflow: hidden; text-overflow: ellipsis; margin-left: 4px; font-size: 12px; }
.tc { margin-left: auto; color: var(--muted); font-size: 11px; background: #eee; border-radius: 8px; padding: 0 6px; }

.rules-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border-2); }
.rules-head span:first-child { flex: 1; font-weight: 600; }
.rules { overflow: auto; flex: 1; }
.rule { border-bottom: 1px solid var(--border-2); }
.rule-head { display: flex; align-items: center; gap: 6px; padding: 9px 10px; cursor: pointer; background: #fff; }
.rule-head:hover { background: #f4f4f4; }
.rule.open .tw { transform: rotate(90deg); }
.rule-items { background: #fff; }
.rule-item { padding: 3px 10px 3px 34px; cursor: pointer; }
.rule-item:hover { background: #e5ecf6; }
.rules-ok { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px; color: var(--ok); }

.props { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.prop { display: flex; flex-direction: column; gap: 3px; }
.prop-label { font-size: 11.5px; color: var(--muted); }
.prop-hint { font-size: 11px; color: var(--muted); }
.prop-readout { font-size: 12.5px; }
.prop-readout.big { font-size: 14px; font-weight: 600; }
.prop-checks { display: flex; flex-direction: column; gap: 4px; }
.prop-checks.cols { display: grid; grid-template-columns: 1fr 1fr; }
.prop-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.prop-section { font-weight: 600; margin-top: 8px; border-bottom: 1px solid var(--border-2); padding-bottom: 2px; }
.prop-list { display: flex; flex-direction: column; }
.prop-li { display: flex; gap: 8px; align-items: center; padding: 2px 0; font-size: 12px; }
.prop-li .muted { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-pick { display: flex; align-items: center; gap: 6px; }
.part-pick-text { flex: 1; min-width: 0; font-size: 12px; }

.canvas-wrap { flex: 1; position: relative; background: #e7e9ee; overflow: hidden; min-width: 0; }
svg.canvas { width: 100%; height: 100%; display: block; user-select: none; }
svg.canvas[data-tool='bundle'], svg.canvas[data-tool='place'], svg.canvas[data-tool='text'], svg.canvas[data-tool='flag'],
svg.canvas[data-tool='rect'], svg.canvas[data-tool='arrow'], svg.canvas[data-tool='line'], svg.canvas[data-tool='ellipse'] { cursor: crosshair; }
svg.canvas .hit { cursor: pointer; }
svg.canvas .node.sel circle:first-child, svg.canvas .node.hover circle:first-child { stroke: #0f62c4; stroke-width: 2.5; }
svg.canvas .node.sel path:first-child { stroke: #0f62c4; stroke-width: 2.5; }
svg.canvas g.sel > rect:first-of-type, svg.canvas g[data-kind='table'].sel rect { stroke: #0f62c4; }
svg.canvas g[data-kind='table'].sel > rect:first-of-type, svg.canvas g[data-kind='block'].sel > rect:first-child { stroke-width: 2.5; }
svg.canvas g[data-kind='face'].sel > :first-child { stroke: #0f62c4; stroke-width: 2.2; }
svg.canvas g[data-kind='blen'].sel text, svg.canvas g[data-kind='flag'].sel text { fill: #0f62c4; }
svg.canvas .handle { fill: #fff; stroke: #0f62c4; stroke-width: 1.5; cursor: move; }
svg.canvas .guide { stroke: #e0368f; stroke-dasharray: 4 3; }
svg.canvas .rubber { stroke: rgba(15,98,196,.45); stroke-linecap: round; fill: none; }
svg.canvas .marquee { fill: rgba(15,98,196,.08); stroke: #0f62c4; stroke-dasharray: 4 3; }
svg.canvas .ghost circle { fill: rgba(15,98,196,.25); stroke: #0f62c4; }
svg.canvas .ghost text { fill: #0f62c4; font-family: var(--font); }

.statusbar { height: 26px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 10px; background: var(--accent); color: #fff; font-size: 12px; }
.st-sp { flex: 1; }
.st-btn { background: transparent; border: 0; color: #fff; cursor: pointer; padding: 1px 6px; border-radius: 3px; }
.st-btn:hover { background: rgba(255,255,255,.18); }
.st-zoom { min-width: 40px; text-align: center; }

/* ---------- dialogs ---------- */
.picker { display: flex; flex-direction: column; gap: 8px; }
.pick-list { height: 340px; overflow: auto; border: 1px solid var(--border-2); }
.pick-row { padding: 6px 10px; border-bottom: 1px solid #eee; cursor: pointer; }
.pick-row:hover { background: #f3f7fc; }
.pick-row.selected { background: var(--sel); }
.pick-pn { font-weight: 600; }
.pick-generic { display: flex; align-items: center; gap: 10px; padding: 8px; background: #f7f7f7; border-radius: 4px; flex-wrap: wrap; }
.pick-generic > span:first-child { flex: 1; color: var(--muted); }
.cores { display: flex; flex-direction: column; gap: 4px; }
.cores-head, .cores-row { display: grid; grid-template-columns: 24px 170px 110px 1fr 1fr 28px; gap: 6px; align-items: center; }
.cores-head { font-weight: 600; font-size: 12px; color: #444; }
.cores > .btn { align-self: flex-start; }
.form-sub + .cores { margin-top: 4px; }
.list-edit { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: grid; grid-template-columns: 22px 100px 90px 1fr 28px 28px; gap: 6px; align-items: start; }
.list-row.rev, .list-row.head { grid-template-columns: 60px 110px 140px 1fr 28px; }
.list-row.head { font-weight: 600; }
.list-num { padding-top: 4px; text-align: right; }
.list-edit > .btn { align-self: flex-start; }
.len-head { display: flex; justify-content: space-between; gap: 20px; }
.len-head .form-row { grid-template-columns: 330px 140px; }
.len-title { font-size: 15px; margin-bottom: 6px; }
.len-help { max-width: 360px; }
.lengths .grid td, .lengths .grid th { text-align: center; }
.lengths .grid td:first-child, .lengths .grid td:nth-child(2) { text-align: left; }
.history { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; border: 1px solid var(--border-2); }
.hist-row { padding: 5px 10px; border-bottom: 1px solid #eee; cursor: pointer; }
.hist-row:hover { background: #f0f5fb; }
.hist-row.current { font-weight: 600; cursor: default; background: #f7f7f7; }
.report { display: flex; flex-direction: column; gap: 8px; }
.report .side-tabs { justify-content: flex-start; }
.report .side-tab { flex: none; padding: 7px 16px; }
.cov-row { border-bottom: 1px solid var(--border-2); padding: 3px 0; }
.cov-range { display: flex; align-items: center; gap: 4px; font-size: 11.5px; }
.cov-range .input { width: 52px; }
.ed-banner { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #fff4ce; border-bottom: 1px solid #e5d48a; color: #5c4800; flex: none; }
.ed-banner[hidden] { display: none; }
.banner-text { flex: 1; }
.share-chip { margin-left: 10px; border: 1px solid rgba(255,255,255,.6); background: transparent; color: #fff; border-radius: 10px; padding: 0 9px; font-size: 11.5px; cursor: pointer; }
.share-chip.shared { background: rgba(255,255,255,.18); }
.share-chip:disabled { cursor: default; opacity: .8; }
.chip.released { background: #dff6dd; color: #0e6b0e; }
.chip.editing { background: #fff4ce; color: #6b5300; }
.chip.private { background: #eee; color: #555; }
.grid td.wrap { white-space: normal; max-width: 320px; }
.used-in { display: flex; flex-direction: column; gap: 3px; }
.used-in a { display: inline-flex; gap: 6px; align-items: center; }
/* ---------- device editor ---------- */
.device-body { flex: 1; overflow: auto; background: var(--bg); }
.device-page { max-width: 980px; margin: 0 auto; padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.device-page .card { background: #fff; margin: 0; }
.device-head { flex-direction: row !important; gap: 18px; }
.device-head .form { flex: 1; }
.device-swatch { width: 90px; height: 70px; border-radius: 6px; border: 1px solid #3a5f8a; flex: none; }
.conn-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-card-head .sp, .sp { flex: 1; }
.conn-card .grid td { padding: 2px 6px; }
/* ---------- system editor ---------- */
.trace { padding: 4px 10px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 1px; }
.trace-pin { font-weight: 600; color: #1d4f91; }
.list-row.cfg { grid-template-columns: 1fr 28px; }
.tree-row.muted .tl { color: var(--muted); text-decoration: line-through; }
.logo-preview { width: 220px; height: 60px; border: 1px dashed var(--border); display: grid; place-items: center; background: #fff; }
.logo-preview img { max-width: 210px; max-height: 54px; }
.logo-thumb { max-width: 180px; max-height: 44px; border: 1px solid var(--border-2); }
.page-list { display: flex; flex-direction: column; border: 1px solid var(--border-2); border-radius: 4px; }
.page-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--border-2); background: #fff; }
.page-row:last-child { border-bottom: 0; }
.page-row.off .page-name { color: var(--muted); }
.page-row.dragging { opacity: .4; }
.page-row.drop { box-shadow: inset 0 2px 0 var(--accent-2); }
.page-row .grip { cursor: grab; color: #999; letter-spacing: -3px; user-select: none; }
.page-row .page-name { flex: 1; }
.page-row .input.sm { flex: 1; }
.warn-text { color: #b25c00; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--accent-light); border-radius: 4px; margin-bottom: 8px; }
.ruler { position: absolute; z-index: 2; pointer-events: none; }
.ruler.top { left: 0; top: 0; }
.ruler.left { left: 0; top: 0; }
.ruler-corner { position: absolute; left: 0; top: 0; width: 18px; height: 18px; background: #f0f0f0; border: 1px solid #ccc; z-index: 3; }
