:root {
  --bg: #f6f7f5; --panel: #ffffff; --ink: #1d2421; --muted: #5d6863; --line: #dfe3e0;
  --accent: #2f6f5e; --accent-ink: #ffffff; --accent-soft: #e4efeb; --danger: #a33a2c;
  --radius: 8px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --head: 48px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917; --panel: #1c2320; --ink: #e5ebe8; --muted: #9aa6a0; --line: #2c3532;
    --accent: #5fb39b; --accent-ink: #0d1412; --accent-soft: #23332d; --danger: #e07a6a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); }
.boot { padding: 2rem; color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
a { color: var(--accent); }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 15px; margin: 18px 0 8px; }
h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* frame */
.top { height: var(--head); display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.brand i { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); display: inline-block; }
.top .grow { flex: 1; }
.top .who { color: var(--muted); font-size: 12px; }
.ws { display: grid; grid-template-columns: var(--nav-w, 210px) 5px minmax(0, 1fr) 5px var(--detail-w, 520px); height: calc(100vh - var(--head)); }
.ws > * { min-height: 0; overflow: auto; }
.views { background: var(--panel); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.views .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 4px; }
.views button.view { all: unset; cursor: pointer; padding: 7px 10px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.views button.view:hover { background: var(--accent-soft); }
.views button.view.on { background: var(--accent); color: var(--accent-ink); }
.views button.view:focus-visible { outline: 2px solid var(--accent); }
.views .add { margin-top: 8px; }
.list { padding: 16px 18px 40px; }
.detail { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-height: 74px; }
.tile .t { color: var(--muted); font-size: 12px; }
.tile .v { font-size: 22px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.tile.wide { grid-column: span 2; }
.bars { display: grid; gap: 3px; margin-top: 6px; }
.bars button { all: unset; cursor: pointer; display: grid; grid-template-columns: minmax(60px, 40%) 1fr auto; gap: 8px; align-items: center; font-size: 12px; border-radius: 4px; padding: 1px 2px; }
.bars button:hover { background: var(--accent-soft); }
.bars button:focus-visible { outline: 2px solid var(--accent); }
.bars .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 8px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bars .n { color: var(--muted); font-variant-numeric: tabular-nums; }

/* search mask */
.mask { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: end; }
.mask label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); flex: 1 1 150px; }
.mask label.text { flex: 2 1 220px; }
.mask .range { display: flex; gap: 4px; }
.mask .range input { flex: 1; min-width: 0; }
.mask .go { display: flex; gap: 6px; }

/* folders */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -4px 0 12px; font-size: 13px; }
.crumbs .crumb { all: unset; cursor: pointer; color: var(--accent); padding: 2px 4px; border-radius: 4px; }
.crumbs .crumb:last-of-type { color: var(--ink); font-weight: 600; }
.crumbs .crumb:hover { background: var(--accent-soft); }
.crumbs .crumb:focus-visible { outline: 2px solid var(--accent); }
.crumbs .sep { color: var(--muted); }
.folders { display: grid; gap: 2px; margin-top: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
.folder { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; }
.folder:hover { background: var(--accent-soft); }
.folder:focus-visible { outline: 2px solid var(--accent); }
.folder .fname { flex: 1; }
.folder.none .fname { color: var(--muted); font-style: italic; }
.folder .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.ficon.dir { width: 18px; height: 13px; min-width: 0; padding: 0; border-radius: 2px 3px 3px 3px; background: #c9a24a; position: relative; margin-top: 2px; }
.ficon.dir::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 4px; background: #c9a24a; border-radius: 2px 2px 0 0; }
.rowline .lvl { flex: 0 0 52px; }

/* list */
.tablewrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); white-space: nowrap; }
th button.sort { all: unset; cursor: pointer; }
th button.sort:focus-visible { outline: 2px solid var(--accent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--accent-soft); }
tbody tr.sel td { background: var(--accent-soft); }
tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
td .name { display: flex; align-items: flex-start; gap: 4px; }
.twisty { all: unset; cursor: pointer; width: 18px; flex: 0 0 18px; text-align: center; color: var(--muted); border-radius: 4px; line-height: 20px; }
.twisty:hover { background: var(--line); color: var(--ink); }
.twisty:focus-visible { outline: 2px solid var(--accent); }
.twisty.none { cursor: default; }
tr.filerow td { padding: 4px 10px 4px 34px; font-size: 13px; background: var(--bg); }
tr.filerow .fname { display: inline-flex; align-items: center; gap: 8px; }
.ficon { display: inline-block; min-width: 34px; text-align: center; font: 600 10px/16px var(--font); text-transform: uppercase; border-radius: 3px; padding: 0 4px; color: #fff; background: #6b7a74; }
.ficon.pdf { background: #b5473a; }
.ficon.img { background: #7a5ea8; }
.ficon.doc { background: #2f5f9e; }
.ficon.sheet { background: #2f7d4f; }
.ficon.slides { background: #b8692b; }
.ficon.model { background: #3d7f86; }
.fc { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; white-space: nowrap; }
.tag { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); font-size: 12px; margin: 1px 4px 1px 0; }
.count { color: var(--muted); font-size: 12px; margin: 8px 2px; }
.empty { color: var(--muted); padding: 18px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.err { color: var(--danger); margin: 8px 0; white-space: pre-wrap; }
.ok { color: var(--accent); margin: 8px 0; }

/* detail pane */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 8px 12px 0; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.tabs button { all: unset; cursor: pointer; padding: 7px 12px; border-radius: 6px 6px 0 0; color: var(--muted); border: 1px solid transparent; border-bottom: none; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); background: var(--panel); border-color: var(--line); font-weight: 600; }
.tabs button:disabled { opacity: .4; cursor: default; }
.tabs button:focus-visible { outline: 2px solid var(--accent); }
.pane { padding: 14px 16px 40px; flex: 1; }
.pane .head { margin-bottom: 12px; }
.pane .head .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fields { display: grid; gap: 10px; }
.fields label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.fields label b { color: var(--danger); font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink); font-size: 14px; }
.checks label { display: flex; align-items: center; gap: 5px; color: var(--ink); font-size: 14px; white-space: nowrap; }
.files { display: grid; gap: 4px; margin: 4px 0 8px; }
.file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.new { border-style: dashed; }
.save { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.save .grow { flex: 1; }
.preview { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.preview .pick { display: flex; gap: 8px; align-items: center; }
.preview .pick select { flex: 1; }
.preview .stage { flex: 1; min-height: 60vh; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: auto; }
.preview .stage iframe { width: 100%; height: 100%; min-height: 60vh; border: 0; background: #fff; }
.preview .stage img { max-width: 100%; max-height: 75vh; }
.preview .stage pre { align-self: stretch; margin: 0; padding: 12px; white-space: pre-wrap; word-break: break-word; font: 12.5px/1.5 var(--mono); width: 100%; }
.history { display: grid; gap: 4px; }
.history button { all: unset; cursor: pointer; padding: 6px 8px; border-radius: 6px; display: flex; justify-content: space-between; gap: 8px; }
.history button:hover, .history button.on { background: var(--accent-soft); }
.note { background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }

/* view editor */
.rows { display: grid; gap: 6px; }
.rowline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rowline > * { flex: 1 1 110px; }
.rowline > button { flex: 0 0 auto; }

/* controls */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--danger); }
button.link { border: none; background: none; color: var(--accent); padding: 0; }
button.icon { padding: 2px 8px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; width: 100%; }
input[type=checkbox] { width: auto; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* sign-in */
.login { max-width: 420px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.login form { display: grid; gap: 12px; margin-top: 16px; }
.login small { color: var(--muted); }

@media (max-width: 1100px) {
  .ws { grid-template-columns: var(--nav-w, 180px) minmax(0, 1fr); height: auto; }
  .ws > * { overflow: visible; }
  .split { display: none; }
  .detail { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .ws, .ws.collapsed { grid-template-columns: minmax(0, 1fr); }
  .views { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .views .label { display: none; }
  .list { padding: 12px; }
  .tile.wide { grid-column: auto; }
}
.pane form > button + .fields { margin-top: 12px; }

/* paged preview with layers and signatures (D15) */
.views button.view.tosign { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; font-weight: 600; }
.views button.view.on .badge { background: var(--accent-ink); color: var(--accent); }
.pagedhost { height: calc(100vh - var(--head) - 112px); min-height: 420px; display: flex; }
.paged { flex: 1; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); }
.ptools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ptools .grow { flex: 1; }
.ptools .tool { padding: 3px 8px; font-size: 12px; }
.ptools .tool.on, .pside button.on:not(.lname) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.swatches { display: inline-flex; gap: 3px; margin: 0 4px; }
.sw { width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.sw.on { box-shadow: 0 0 0 2px var(--ink); }
.pbody { flex: 1; display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; }
.pside { border-right: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 4px 10px 20px; font-size: 13px; }
.pside h3 { margin: 12px 0 6px; display: flex; align-items: center; gap: 6px; }
.pside h3 .n { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.pside h3 input { margin: 0; }
.pside .row { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.pside .row.wrap { flex-wrap: wrap; margin-top: 8px; }
.pside .block { width: 100%; margin-bottom: 8px; }
.pl { display: flex; flex-wrap: wrap; gap: 3px; }
.pl button { padding: 2px 0; min-width: 30px; font-size: 12px; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.pl .dots { display: flex; gap: 2px; }
.pl .dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.pl .dm { background: #d13438; }
.pl .df { background: #2b6cd4; }
.lrow { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.lrow input { margin: 0; }
.lmain { flex: 1; min-width: 0; display: grid; }
.lname { all: unset; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; padding: 0 3px; }
.lname.on { font-weight: 650; color: var(--accent); }
.lname.on::before { content: "✎ "; }
.lname:focus-visible { outline: 2px solid var(--accent); }
.frow { display: grid; gap: 4px; padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.frow.mine { background: var(--accent-soft); margin: 0 -10px; padding: 6px 10px 8px; }
.frow .fk { all: unset; cursor: pointer; font-weight: 600; font-size: 12px; }
.frow .fk:focus-visible { outline: 2px solid var(--accent); }
.frow select, .frow input { font-size: 12px; padding: 3px 6px; }
.frow .st { font-size: 11.5px; color: var(--muted); }
.frow .st.ok { color: var(--accent); }
.frow .st.warn { color: var(--danger); }
.pages-wrap { position: relative; min-height: 0; display: flex; flex-direction: column; }
.ppages { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 60vh; outline: none; }
.ppages .pad { padding: 20px; }
.page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); flex: 0 0 auto; }
.page.failed::after { content: "This page could not be shown."; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #a33a2c; }
.page img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.page .pno { position: absolute; right: -2px; bottom: -18px; font-size: 11px; color: var(--muted); }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.overlay.drawing { pointer-events: all; cursor: crosshair; touch-action: none; }
.overlay .hl { opacity: .38; mix-blend-mode: multiply; }
.overlay .temp { opacity: .7; }
.overlay g:not(.active) > .mark { opacity: .92; }
.notebox { width: 100%; height: 100%; overflow: hidden; background: #fff6bf; color: #1d2421; border-left: 3px solid; font: 9px/1.3 var(--font); padding: 2px 4px; box-sizing: border-box; white-space: pre-wrap; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.fld { pointer-events: all; cursor: pointer; }
.fld .box { fill: rgba(43,108,212,.08); stroke: #2b6cd4; stroke-width: .8; stroke-dasharray: 3 2; }
.fld.mine .box { fill: rgba(255,212,0,.28); stroke: #c47b00; stroke-width: 1.2; }
.fld.now .box { stroke: #d13438; stroke-width: 2; animation: pulse 1.2s ease-in-out infinite; }
.fld.signed .box { fill: none; stroke: none; }
.fld.signed { cursor: default; }
.fld:focus { outline: none; }
.fld:focus-visible .box { stroke: #d13438; stroke-width: 2; }
.tempfield { fill: rgba(43,108,212,.15); stroke: #2b6cd4; stroke-width: 1; stroke-dasharray: 3 2; }
@keyframes pulse { 50% { stroke-opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .fld.now .box { animation: none; } }
.fieldbox { font: 600 7.5px/1.2 var(--font); color: #2b6cd4; padding: 2px 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fld.mine .fieldbox { color: #8a5600; }
.fieldbox.caption { color: #5d6863; font-weight: 500; font-size: 6.5px; padding: 1px 0; }
.fieldbox.datev { color: #1a3a8f; font: 9px/1.2 var(--font); padding: 2px 3px; }
.pguide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: #fff3c4; color: #3d2f00; border-bottom: 1px solid #e6d27a; font-size: 13px; }
.pguide[hidden] { display: none; }
.pguide .grow { flex: 1; }
.pguide .step { font-weight: 700; }
.pguide button.link { color: #3d2f00; text-decoration: underline; }
.notepop { position: absolute; z-index: 3; width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.notepop .row { display: flex; gap: 6px; margin-top: 6px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.mbox { background: var(--panel); border-radius: 12px; padding: 18px; width: min(580px, 100%); display: grid; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.mbox h2 { margin: 0; }
.mbox p { margin: 0; }
.mbox .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mbox .grow { flex: 1; }
.padwrap { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; justify-self: center; max-width: 100%; }
.padc { display: block; touch-action: none; cursor: crosshair; max-width: 100%; height: auto; }
.padline { position: absolute; left: 20px; right: 20px; bottom: 34px; border-bottom: 1px solid #c9d0cc; pointer-events: none; }
@media (max-width: 1100px) {
  .ppages { max-height: 85vh; }
  .widebtn { display: none; }
}
@media (max-width: 700px) {
  .pbody { grid-template-columns: minmax(0, 1fr); }
  .pside { border-right: none; border-bottom: 1px solid var(--line); max-height: 40vh; }
}

/* resizable panes, view symbols, columns and column filters */
.split { background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat; cursor: col-resize; position: relative; overflow: visible !important; touch-action: none; }
.split::after { content: ""; position: absolute; inset: 0 -4px; }
.split:hover, .split:focus-visible, .ws.resizing .split:active { background: var(--accent); outline: none; }
thead th:first-child, tbody tr:not(.filerow) td:first-child { min-width: 190px; }
.ws.resizing { user-select: none; cursor: col-resize; }
.ws.resizing iframe, .ws.resizing .ppages { pointer-events: none; }
.views { border-right: none; }
.detail { border-left: none; }
.ico { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.views button.view { display: flex; align-items: center; gap: 9px; }
.views button.view .vname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.views button.view.tosign { font-weight: 600; margin-bottom: 6px; }
.vhead { display: flex; align-items: center; justify-content: space-between; padding: 0 0 2px; }
.vhead .label { padding-left: 10px; }
.collapse { all: unset; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 6px; font-size: 15px; line-height: 20px; }
.collapse:hover { background: var(--accent-soft); color: var(--ink); }
.collapse:focus-visible { outline: 2px solid var(--accent); }
.ws.collapsed .views { padding: 10px 6px; align-items: center; }
.ws.collapsed .vhead { justify-content: center; width: 100%; }
.ws.collapsed .views button.view { padding: 9px; justify-content: center; position: relative; overflow: visible; }
.ws.collapsed .views .badge { position: absolute; top: 0; right: -4px; font-size: 10px; padding: 0 5px; line-height: 15px; }
.ws.collapsed .views .add { padding: 4px 10px; }
.vtitle { display: flex; align-items: center; gap: 8px; }
.vtitle .ico { width: 20px; height: 20px; color: var(--accent); }
.icongrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; margin-top: 4px; }
.icongrid button { padding: 6px; display: flex; justify-content: center; }
.icongrid button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.listtools { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.listtools .count { margin: 0; }
.listtools .grow { flex: 1; }
.colwrap { position: relative; }
.colpop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: 10px 12px; display: grid; gap: 4px; min-width: 220px; max-height: 60vh; overflow: auto; }
.colpop label { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.colpop .link { justify-self: start; margin-top: 6px; }
th .thc { display: flex; align-items: center; gap: 4px; }
th.num .thc { justify-content: flex-end; }
th .ftools { display: inline-flex; gap: 1px; margin-left: auto; }
th.num .ftools { margin-left: 4px; }
.fbtn { all: unset; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 4px; color: var(--muted); }
.fbtn .ico { width: 14px; height: 14px; flex-basis: 14px; }
.fbtn:hover { background: var(--line); color: var(--ink); }
.fbtn:focus-visible { outline: 2px solid var(--accent); }
.fbtn.on { color: var(--accent); }
.fbtn.on .ico { fill: var(--accent-soft); }
.fbtn:disabled { opacity: .35; cursor: default; background: none; }
th.filtered { color: var(--accent); }
th .fwrap { margin-top: 4px; font-weight: 400; }
th .fwrap input, th .fwrap select { font-size: 12px; padding: 3px 6px; min-width: 90px; }
.frange { display: flex; gap: 3px; }
.frange input { min-width: 0; width: 50%; }
th .fwrap input[type=date] { min-width: 105px; }
tbody tr.none td { cursor: default; padding: 16px 10px; background: var(--panel); }
@media (max-width: 700px) { .collapse { display: none; } }

/* 3D model preview (D16) */
.m3 .pbody { grid-template-columns: 220px minmax(0, 1fr); }
.m3side { border-right: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 4px 10px 20px; font-size: 13px; }
.m3side h3 { margin: 12px 0 6px; display: flex; align-items: center; gap: 6px; }
.m3side h3 .n { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.m3side .lname { cursor: default; }
.m3stage { position: relative; min-height: 0; min-width: 0; }
.glc { display: block; width: 100%; height: 100%; min-height: 320px; touch-action: none; cursor: grab; outline: none; }
.glc:active { cursor: grabbing; }
.glc:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.m3status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; white-space: pre-line; text-align: center; }
.m3info { position: absolute; left: 10px; bottom: 10px; max-width: min(340px, calc(100% - 20px)); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18); display: grid; gap: 2px; font-size: 13px; }
.m3info[hidden], .m3status[hidden] { display: none; }
.m3info code { font-size: 11px; }
.m3info .link { justify-self: start; margin-top: 4px; padding: 0; border: none; background: none; color: var(--accent); cursor: pointer; }
.fsw { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.tchk { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.tchk input { margin: 0; }
.warnc { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.clash { display: flex; justify-content: space-between; gap: 6px; width: 100%; text-align: left; font-size: 12px; padding: 3px 6px; border-left: 3px solid var(--danger); }
.clash.on { background: var(--accent-soft); }
.clashnote { color: var(--danger); }
.m3side .ok { color: var(--accent); }
@media (max-width: 700px) {
  .m3 .pbody { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(320px, 1fr); }
  .m3side { border-right: none; border-bottom: 1px solid var(--line); max-height: 35vh; }
}

/* intelligent drawings (D17) */
.dhost { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; background: #f4f5f4; }
.dhost:active { cursor: grabbing; }
.dhost:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.dhost svg { display: block; width: 100%; height: 100%; }
.dhost [data-tag] { cursor: pointer; }
.dhost [data-tag]:hover path, .dhost [data-tag]:hover polyline, .dhost [data-tag]:hover circle, .dhost [data-tag]:hover rect:not(.op-halo) { stroke: #2b6cd4; }
.dhost .op-sel path, .dhost .op-sel polyline:not([stroke-opacity="0"]), .dhost .op-sel circle, .dhost .op-sel rect:not(.op-halo) { stroke: #d97a00; }
.dhost .op-sel text { fill: #b35f00; }
.dhost .op-halo { fill: #ffc400; fill-opacity: 0.18; stroke: #e8a300; stroke-width: 0.8; stroke-dasharray: 3 1.5; }
.dwg .m3stage { position: relative; flex: 1; min-height: 0; }
.dsheet { max-width: 60%; font-size: 12px; padding: 3px 6px; }
.attrs { border-collapse: collapse; margin-top: 4px; font-size: 12px; }
.attrs th { text-align: left; font-weight: 500; color: var(--muted); padding: 1px 10px 1px 0; white-space: nowrap; vertical-align: top; }
.attrs td { padding: 1px 0; }
.m3info { max-height: calc(100% - 20px); overflow: auto; }

/* the plant workspace (D17) */
body.ws-open { overflow: hidden; }
.ws-overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.ws-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ws-bar .grow { flex: 1; }
.ws-bar .tool { padding: 3px 8px; font-size: 12px; }
.ws-title { font-size: 15px; }
.ws-sel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: 12px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; line-height: 20px; font-size: 12px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.off { color: var(--muted); }
.ws-area { flex: 1; min-height: 0; display: flex; padding: 4px; }
.ws-area > * { flex: 1; min-width: 0; min-height: 0; }
.wss { display: flex; min-width: 0; min-height: 0; width: 100%; height: 100%; }
.wss.row { flex-direction: row; }
.wss.col { flex-direction: column; }
.wscell { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; }
.wscell > * { flex: 1; min-width: 0; min-height: 0; }
.wsx { flex: 0 0 6px; cursor: col-resize; position: relative; touch-action: none; }
.wss.col > .wsx { cursor: row-resize; }
.wsx::after { content: ""; position: absolute; inset: 0; margin: auto; background: var(--line); border-radius: 2px; }
.wss.row > .wsx::after { width: 2px; }
.wss.col > .wsx::after { height: 2px; }
.wsx:hover::after, .wsx:focus-visible::after { background: var(--accent); }
.wsx:focus-visible { outline: none; }
.ws-overlay.resizing, .ws-overlay.resizing * { user-select: none; }
.ws-overlay.resizing canvas, .ws-overlay.resizing .dhost { pointer-events: none; }
.wsp { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; margin: 2px; }
.wsh { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 10px; border-bottom: 1px solid var(--line); background: var(--bg); cursor: grab; user-select: none; }
.wsh .grow { flex: 1; }
.wsh .icon { padding: 0 6px; min-width: 24px; line-height: 20px; }
.wsbody { flex: 1; min-height: 0; display: flex; position: relative; }
.wsbody > * { flex: 1; min-width: 0; }
.wsfill { height: auto; min-height: 0; }
.wsfill .paged { border: none; border-radius: 0; }
.wsfill .m3 .pbody { grid-template-columns: 200px minmax(0, 1fr); }
.wsdrop { position: absolute; z-index: 5; background: var(--accent); opacity: 0.25; pointer-events: none; border-radius: 4px; }
.wsdrop.center { inset: 24px 0 0 0; }
.wsdrop.left { left: 0; top: 24px; bottom: 0; width: 50%; }
.wsdrop.right { right: 0; top: 24px; bottom: 0; width: 50%; }
.wsdrop.top { left: 0; right: 0; top: 24px; height: 50%; }
.wsdrop.bottom { left: 0; right: 0; bottom: 0; height: 50%; }
.ws-overlay.dragging canvas, .ws-overlay.dragging .dhost { pointer-events: none; }
.wsplants { display: grid; gap: 4px; padding: 8px; align-content: start; overflow: auto; }
.wsplant { display: grid; gap: 2px; text-align: left; padding: 6px 8px; }
.wsplant.on { border-color: var(--accent); background: var(--accent-soft); }
.wsmenu { position: fixed; z-index: 60; width: 260px; display: grid; gap: 4px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.wsmenu button { text-align: left; }
.pad { padding: 16px; }
.wsfill .glc { min-height: 0; }
@media (max-width: 700px) {
  .wsfill .m3 .pbody { grid-template-columns: minmax(0, 1fr); }
}
.ws-bar select.tool { width: auto; }
.wsfill .m3info { max-height: 55%; }

.login .wide { width: 100%; }
.login details { margin-top: 16px; }
.login details form { margin-top: 8px; display: grid; gap: 10px; }
.login textarea { width: 100%; box-sizing: border-box; font: inherit; margin: 8px 0; }
