/* TabStudio — dark theme in the style of Visual Studio. All colours are variables so a light theme can be added later. */
:root {
    --bg: #1e1e1e;
    --panel: #252526;
    --panel-2: #2d2d30;
    --border: #3f3f46;
    --border-soft: #333337;
    --text: #d4d4d4;
    --text-dim: #9d9d9d;
    --accent: #007acc;
    --accent-2: #0e639c;
    --title-active: #007acc;
    --title-inactive: #3f3f46;
    --hover: #3e3e42;
    --select: #094771;
    --danger: #f14c4c;
    --ok: #4ec9b0;
    --menu-h: 28px;
    --status-h: 24px;
    font-size: 13px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); overflow: hidden;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { background: var(--panel-2); border: 1px solid var(--border); border-radius: 2px; padding: 2px 8px; cursor: pointer; }
button:hover:not(:disabled) { background: var(--hover); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent-2); border-color: var(--accent); color: #fff; }
input, select { background: #3c3c3c; border: 1px solid var(--border); border-radius: 2px; padding: 2px 6px; min-width: 0; }
input:focus, select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
a { color: #3794ff; }
.placeholder { padding: 16px; color: var(--text-dim); text-align: center; }
.hint { color: var(--text-dim); font-size: 12px; }
.boot { height: 100vh; display: grid; place-items: center; color: var(--text-dim); }
.kind { color: var(--text-dim); font-size: 11px; margin-left: 8px; }
.count { color: var(--text-dim); margin-left: auto; font-size: 12px; }
.spacer { flex: 1; }
.r { text-align: right; }

/* ---------------- login ---------------- */
.login-page { height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #2a2d33, #1b1c1f); }
.login-card { width: 340px; background: var(--panel); border: 1px solid var(--border); padding: 28px; display: grid; gap: 14px; box-shadow: 0 10px 40px #0008; }
.login-brand { font-size: 28px; font-weight: 600; color: #fff; }
.login-sub { color: var(--text-dim); margin-top: -10px; }
.login-brand .brand-mark { font-size: 0.5em; }
/* the brand beside the product's name (sign-in page, title bar, About): "TabStudio" with a small "TabX" */
.brand-mark { font-size: 0.75em; font-weight: 600; color: var(--text-dim); margin-left: 0.5em; letter-spacing: 0.04em; }
.login-card label { display: grid; gap: 4px; color: var(--text-dim); }
.login-card input { padding: 6px 8px; }
.login-card button { background: var(--accent-2); border-color: var(--accent); color: #fff; padding: 8px; }
.login-card a.login-button { display: block; text-align: center; background: var(--accent-2); border: 1px solid var(--accent); color: #fff; padding: 8px; text-decoration: none; }
.choose-list { display: grid; gap: 8px; }
.choose-list button { text-align: left; min-height: 40px; }
.staff-page { height: 100vh; overflow: auto; padding: 18px 24px; background: var(--bg, #1b1c1f); color: var(--text); }
.staff-page h2 { margin: 0 0 12px; }
.staff-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.staff-tabs button.sel { background: var(--accent-2); border-color: var(--accent); color: #fff; }
.staff-table { border-collapse: collapse; width: 100%; max-width: 1100px; }
.staff-table th, .staff-table td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: middle; }
.staff-table td.num { text-align: right; }
.staff-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-actions button { min-height: 32px; }
.staff-form { display: grid; gap: 8px; max-width: 520px; margin: 12px 0; padding: 12px; border: 1px solid var(--border); background: var(--panel); }
.staff-form label { display: grid; gap: 4px; color: var(--text-dim); }
.staff-message { margin: 8px 0; color: var(--text-dim); }
.staff-link input { width: 100%; }
.login-hint { font-size: 11.5px; color: var(--text-dim); }

/* ---------------- shell frame ---------------- */
.shell { display: flex; flex-direction: column; height: 100vh; position: relative; }
.body { flex: 1; display: flex; min-height: 0; }
.region { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: none; background: var(--panel); }
.middle { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }   /* the documents over the bottom dock, between the full-height side docks */
.center { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.bottom-region { flex: none; min-height: 0; border-top: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; background: var(--panel); }
.center > .dock-node, .region > .dock-node, .bottom-region > * { flex: 1; min-height: 0; min-width: 0; }

.splitter { flex: none; background: var(--bg); z-index: 5; }
.splitter.vs { width: 4px; cursor: col-resize; }
.splitter.hs { height: 4px; cursor: row-resize; }
.splitter:hover, body.resizing .splitter:active { background: var(--accent); }
body.resizing { user-select: none; }
body.rs-h { cursor: col-resize; } body.rs-v { cursor: row-resize; }
body.dragging { user-select: none; cursor: grabbing; }

.split { display: flex; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.split.h { flex-direction: row; }
.split.v { flex-direction: column; }
.dock-node { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; }
.dock-node > * { flex: 1; min-width: 0; min-height: 0; }

/* ---------------- menu / status ---------------- */
.menubar { height: var(--menu-h); background: var(--panel-2); display: flex; align-items: stretch; flex: none; border-bottom: 1px solid var(--border-soft); position: relative; z-index: 60; }
.app-name { padding: 0 12px; font-weight: 600; color: #fff; display: flex; align-items: center; }
.menu { position: relative; }
.menu-title { height: 100%; background: none; border: none; border-radius: 0; padding: 0 10px; }
.menu.open .menu-title, .menu-title:hover { background: var(--hover) !important; }
.menu-backdrop { position: fixed; inset: 0; z-index: 70; }
.dropdown, .ctx-menu { position: absolute; top: 100%; left: 0; min-width: 260px; background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 6px 20px #000a; z-index: 80; padding: 3px 0; }
.dropdown button, .ctx-menu button, .dropdown .menu-link { display: flex; width: 100%; text-align: left; background: none; border: none; border-radius: 0; padding: 4px 8px; gap: 6px; }
.dropdown button:hover:not(:disabled), .ctx-menu button:hover:not(:disabled), .dropdown .menu-link:hover { background: var(--select); }
.dropdown .menu-link { color: inherit; text-decoration: none; box-sizing: border-box; }
.dropdown .chk { width: 16px; color: var(--ok); } .dropdown .lbl { flex: 1; } .dropdown .key { color: var(--text-dim); }
.dropdown .sep { height: 1px; background: var(--border); margin: 3px 0; }
.ctx-menu { top: 100%; right: 0; left: auto; min-width: 190px; }
.ctx-menu.right { right: 0; }

.statusbar { height: var(--status-h); background: var(--accent); color: #fff; display: flex; align-items: center; flex: none; font-size: 12px; }
.statusbar .seg { padding: 0 10px; white-space: nowrap; }
.statusbar .seg.grow { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.statusbar .strong { background: #16825d; height: 100%; display: flex; align-items: center; }

/* ---------------- groups ---------------- */
.group { display: flex; flex-direction: column; width: 100%; height: 100%; min-width: 0; min-height: 0; background: var(--panel); border: 1px solid var(--border-soft); position: relative; }
.group .content { flex: 1; min-height: 0; position: relative; }
.pane { position: absolute; inset: 0; overflow: auto; }
.group.doc .content { background: var(--bg); }
.titlebar { display: flex; align-items: center; gap: 2px; height: 24px; flex: none; padding: 0 2px 0 8px; background: var(--title-inactive); color: #ddd; cursor: grab; position: relative; user-select: none; }
.group.active .titlebar { background: var(--title-active); color: #fff; }
.titlebar .title { font-size: 12px; white-space: nowrap; }
.titlebar .latest { margin-left: 14px; font-size: 11.5px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb { background: none; border: none; padding: 0 5px; height: 20px; line-height: 20px; font-size: 11px; border-radius: 2px; color: inherit; }
.tb:hover:not(:disabled) { background: #ffffff30 !important; }
.pin.pinned { transform: rotate(90deg); }

.tabs { display: flex; align-items: stretch; flex: none; background: var(--panel-2); user-select: none; position: relative; }
.tabs.top { border-bottom: 1px solid var(--border); height: 28px; }
.tabs.bottom { border-top: 1px solid var(--border); height: 24px; }
.tab { display: flex; align-items: center; gap: 4px; padding: 0 10px; cursor: pointer; color: var(--text-dim); border-right: 1px solid var(--border-soft); white-space: nowrap; }
.tab:hover { color: #fff; background: var(--hover); }
.tab.sel { background: var(--bg); color: #fff; box-shadow: inset 0 2px 0 var(--accent); }
.tabs.bottom .tab.sel { background: var(--panel); box-shadow: inset 0 -2px 0 var(--accent); }
.tab .tb { height: 16px; line-height: 16px; padding: 0 3px; }
.tabs .overflow { align-self: center; color: var(--text); }

/* ---------------- auto-hide strips and flyout ---------------- */
.strip { flex: none; width: 26px; background: var(--panel-2); display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border: 0 solid var(--border); }
.strip.left { border-right-width: 1px; } .strip.right { border-left-width: 1px; }
.strip-tab { writing-mode: vertical-rl; padding: 8px 4px; cursor: pointer; color: var(--text-dim); font-size: 12px; border: 1px solid var(--border-soft); border-radius: 2px; }
.strip.left .strip-tab { transform: rotate(180deg); }
.strip-tab:hover, .strip-tab.sel { color: #fff; background: var(--hover); }
.flyout-backdrop { position: fixed; inset: 0; z-index: 30; }
.flyout { position: absolute; top: var(--menu-h); bottom: var(--status-h); z-index: 40; box-shadow: 0 0 24px #000c; background: var(--panel); display: flex; }
.flyout.left { left: 26px; } .flyout.right { right: 26px; }

/* ---------------- floating windows ---------------- */
.float-win { position: absolute; z-index: 50; border: 1px solid var(--accent); box-shadow: 0 8px 30px #000b; background: var(--panel); display: flex; min-width: 240px; min-height: 140px; }
.float-win > .group, .float-win > .dock-node { flex: 1; }
.float-resize { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; z-index: 3;
    background: linear-gradient(135deg, transparent 55%, var(--text-dim) 55%, var(--text-dim) 65%, transparent 65%, transparent 75%, var(--text-dim) 75%, var(--text-dim) 85%, transparent 85%); }

/* ---------------- drag overlay and dock guides ---------------- */
#dock-overlay { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
#dock-overlay .preview { position: fixed; background: #007acc55; border: 2px solid #3794ff; }
#dock-overlay .guide { position: fixed; background: #2d2d30ee; border: 1px solid #6a6a6a; border-radius: 3px; display: grid; place-items: center; font-size: 14px; color: #ccc; }
#dock-overlay .guide.hot { background: #007accdd; border-color: #fff; color: #fff; }
#dock-overlay .guide.left::after { content: "◧"; } #dock-overlay .guide.right::after { content: "◨"; }
#dock-overlay .guide.top::after { content: "⬒"; } #dock-overlay .guide.bottom::after { content: "⬓"; }
#dock-overlay .guide.center::after { content: "▣"; }
#dock-overlay .hint { position: fixed; top: 40px; left: 50%; transform: translateX(-50%); background: #000c; padding: 4px 10px; border-radius: 3px; }
.drag-ghost { position: fixed; z-index: 1001; pointer-events: none; background: var(--accent-2); color: #fff; padding: 3px 10px; border-radius: 2px; font-size: 12px; box-shadow: 0 2px 8px #0009; }

/* ---------------- modals ---------------- */
.modal-backdrop { position: fixed; inset: 0; background: #0007; z-index: 200; }
.modal { position: fixed; z-index: 210; top: 18%; left: 50%; transform: translateX(-50%); width: 380px; max-width: 92vw; background: var(--panel); border: 1px solid var(--border); padding: 16px 18px; display: grid; gap: 10px; box-shadow: 0 10px 40px #000c; }
.modal h3 { margin: 0 0 4px; }
.modal label { display: grid; gap: 3px; color: var(--text-dim); }
.modal .buttons { display: flex; gap: 8px; justify-content: flex-end; }
.modal .list { display: grid; max-height: 260px; overflow: auto; border: 1px solid var(--border); }
.modal .row { text-align: left; border: none; border-radius: 0; background: none; padding: 5px 8px; }
.modal .row:hover { background: var(--hover); } .modal .row.sel { background: var(--select); }

/* ---------------- generic pane bits ---------------- */
.pane-toolbar { display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: var(--panel-2); border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; position: sticky; top: 0; z-index: 2; }
.pane-toolbar .search { flex: 1; min-width: 100px; } .pane-toolbar .search.wide { min-width: 200px; }
.inline { display: inline-flex; align-items: center; gap: 5px; color: var(--text-dim); }
.grid-wrap { overflow: auto; height: 100%; }
table.grid { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.grid th { position: sticky; top: 0; background: var(--panel-2); text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; z-index: 1; }
table.grid td { padding: 3px 8px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.grid tbody tr:hover { background: var(--hover); } table.grid tbody tr.sel { background: var(--select); }
table.grid td input, table.grid td select { width: 100%; background: transparent; border-color: transparent; }
table.grid td input:hover, table.grid td select:hover { border-color: var(--border); }
tr.done td { opacity: .55; text-decoration: line-through; }
.act td, .act th { padding: 2px 8px; font-variant-numeric: tabular-nums; } .act { font-family: Consolas, monospace; font-size: 12px; }
.op-insert td:nth-child(3) { color: #4ec9b0; } .op-update td:nth-child(3) { color: #dcdcaa; } .op-delete td:nth-child(3) { color: var(--danger); } .op-login td:nth-child(3) { color: #c586c0; }

/* trees */
.tree { display: flex; flex-direction: column; height: 100%; outline: none; }
.tree-body { flex: 1; overflow: auto; padding: 2px 0; }
.tree .row { display: flex; align-items: center; gap: 4px; height: 22px; padding-right: 8px; cursor: default; white-space: nowrap; }
.tree .row:hover { background: var(--hover); } .tree .row.sel { background: var(--select); } .tree .row.drop { outline: 1px dashed var(--accent); }
.twisty { width: 14px; text-align: center; color: var(--text-dim); font-size: 10px; cursor: pointer; }
.ico { width: 14px; height: 14px; border-radius: 3px; background: #808080; flex: none; display: inline-block; margin-right: 4px; }
.t-project { background: #c586c0; } .t-building { background: #9cdcfe; } .t-system { background: #4ec9b0; }
.t-ahu, .t-fan, .t-vavbox, .t-diffuser, .t-damper { background: #569cd6; } .t-pump, .t-coil, .t-valve, .t-chiller, .t-boiler { background: #4fc1ff; }
.t-report, .t-sheet, .t-section { background: #dcdcaa; } .t-folder { background: #e2c08d; } .t-file { background: #bbb; }
.rename { height: 18px; flex: 1; }

.toolbox { display: flex; flex-direction: column; height: 100%; }
.toolbox .search { margin: 4px; }
.toolbox .tool { padding: 3px 18px; cursor: grab; display: flex; align-items: center; } .toolbox .tool:hover { background: var(--hover); }

.props { padding-bottom: 8px; }
.props-head { padding: 6px 8px; font-weight: 600; background: var(--panel-2); }
.prop-group { padding: 3px 8px; margin-top: 4px; color: var(--text-dim); text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
.prop { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 6px; padding: 2px 8px; }
.prop label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop .num { display: flex; align-items: center; gap: 5px; } .prop .num em { color: var(--text-dim); font-style: normal; font-size: 11px; }
.prop input, .prop select { width: 100%; }

.chat { display: flex; flex-direction: column; height: 100%; position: relative; }
/* a new line from Tabi: the chat window's outline blinks NVIDIA green three times (user 2026-11-17) */
.chat-blink { position: absolute; inset: 0; pointer-events: none; z-index: 5; border-radius: 2px; box-shadow: inset 0 0 0 2px var(--busy-green), inset 0 0 8px var(--busy-glow);
    opacity: 0; animation: chat-blink 0.9s ease-in-out 3; }
@keyframes chat-blink { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-blink { animation: chat-blink 0.9s ease-in-out 1; } }
/* the log scrolls; js/chatscroll.js keeps it at the newest line (unless the person scrolled up); min-height 0 lets it shrink and scroll inside the pane */
.chat-log { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.chat-lines { display: grid; gap: 8px; align-content: start; }
.msg { display: flex; gap: 6px; } .msg.me { justify-content: flex-end; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.bubble { background: var(--panel-2); border: 1px solid var(--border-soft); padding: 5px 8px; border-radius: 6px; max-width: 85%; } .bubble b { font-size: 11px; color: var(--text-dim); }
.msg.me .bubble { background: var(--accent-2); }
.bubble .chat-model { font-size: 11px; color: var(--text-dim); }
/* Tabi's answers with their small markdown (TabiMarkdown): tight paragraphs and lists, code in the editor's font */
.tabi-md p { margin: 0 0 4px; } .tabi-md p:last-child { margin-bottom: 0; } .tabi-md ul, .tabi-md ol { margin: 2px 0 4px; padding-left: 18px; }
.bench-answer { padding: 3px 0; border-top: 1px solid var(--border-soft); white-space: pre-wrap; }
.tabi-md code { font-family: Consolas, "Cascadia Mono", monospace; background: var(--panel); padding: 0 3px; border-radius: 3px; } .tabi-md a { color: var(--accent); }
.chat-input { display: flex; gap: 4px; padding: 6px; border-top: 1px solid var(--border-soft); } .chat-input input { flex: 1; }

.refs, .actions { display: flex; flex-direction: column; height: 100%; }
.actions .grid-wrap { flex: 1; }
.upload-status { padding: 3px 8px; background: #1b3a2a; color: #b5e8c5; font-size: 12px; }
.preview { border-left: 1px solid var(--border); background: #2a2a2a; display: flex; align-items: center; justify-content: center; overflow: auto; min-height: 0; }
.preview iframe { width: 100%; height: 100%; border: 0; } .preview img { max-width: 100%; max-height: 100%; }

.drawings { display: flex; flex-direction: column; height: 100%; }
.canvas-host { flex: 1; position: relative; min-height: 0; background: #1c1c1e; overflow: hidden; }
.canvas-host canvas.cad-overlay { pointer-events: none; z-index: 1; }
.canvas-host canvas.cad-viewcube { inset: 6px 6px auto auto; z-index: 3; cursor: default; touch-action: none; transition: opacity .15s; }
.cad-viewcube-menu { position: fixed; z-index: 200; min-width: 230px; }
.canvas-host canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.canvas-msg { position: absolute; top: 12px; left: 12px; right: 12px; background: #000b; padding: 8px 12px; border-radius: 3px; }

.sheet { display: flex; flex-direction: column; height: 100%; font-size: 12.5px; overflow: auto; background: #1b1b1c; }
.sheet-head { display: flex; position: sticky; top: 0; z-index: 3; width: max-content; }
.sheet-row { display: flex; height: 22px; width: max-content; }
.corner, .rowh { width: 46px; flex: none; background: var(--panel-2); border: 1px solid var(--border-soft); text-align: center; color: var(--text-dim); line-height: 21px; position: sticky; left: 0; z-index: 2; }
.colh { width: 120px; flex: none; background: var(--panel-2); border: 1px solid var(--border-soft); text-align: center; color: var(--text-dim); line-height: 21px; }
.cell { width: 120px; flex: none; border: 1px solid var(--border-soft); border-top: 0; border-left: 0; padding: 0 6px; line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.num { text-align: right; } .sheet-row:first-child .cell { font-weight: 600; background: #252528; }
.sheet-body { width: max-content; }

.summary { padding: 18px 24px; } .summary h2 { margin-top: 0; } .summary h3 { margin: 26px 0 8px; color: var(--text-dim); font-weight: 600; }
.tiles { display: flex; gap: 14px; flex-wrap: wrap; }
.tile { background: var(--panel); border: 1px solid var(--border); padding: 14px 20px; min-width: 150px; }
.tile .n { font-size: 30px; font-weight: 300; color: #fff; } .tile .l { color: var(--text-dim); }
.bar { flex: 1; height: 10px; background: var(--panel-2); } .bar > span { display: block; height: 100%; background: var(--accent); }

#blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; color: #000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

::-webkit-scrollbar { width: 12px; height: 12px; } ::-webkit-scrollbar-thumb { background: #424242; border: 3px solid var(--panel); border-radius: 6px; } ::-webkit-scrollbar-thumb:hover { background: #5a5a5a; }
::-webkit-scrollbar-corner { background: var(--panel); }
th .sort { color: var(--accent); }

/* ---------------- Phase 2: page review ---------------- */
.review { display: flex; flex-direction: column; height: 100%; position: relative; }
.review kbd { font: inherit; font-size: 10px; border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; margin-left: 3px; color: var(--text-dim); }
.review .sep-v, .sep-v { width: 1px; height: 18px; background: var(--border); display: inline-block; }
.badge { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text-dim); }
.ctx { position: fixed; z-index: 310; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 6px 20px #000b; display: grid; min-width: 180px; padding: 3px 0; }
.ctx button { text-align: left; border: 0; border-radius: 0; background: none; padding: 4px 12px; } .ctx button:hover:not(:disabled) { background: var(--hover); }
.ctx .sep { height: 1px; background: var(--border-soft); margin: 3px 0; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.view-toggle button { border: 0; border-radius: 0; background: none; padding: 3px 12px; } .view-toggle button.on { background: var(--accent-2); color: #fff; }
.st { padding: 0 6px; border-radius: 8px; font-size: 11px; background: var(--panel-2); border: 1px solid var(--border-soft); }
.st-Ready { color: #6cc4ff; } .st-Failed { color: var(--danger); } .st-Pending, .st-Cataloguing { color: #dcdcaa; }
.not-cat { color: var(--text-dim); font-style: italic; }
.t-page { background: #8ab4f8; } .t-pdf { background: #e06c6c; }

/* ---------------- Phase 2: drawings ---------------- */
.drawings .crumb { display: inline-flex; gap: 6px; align-items: center; min-width: 160px; }
.drawings .sep-c { color: var(--text-dim); }
.drawings kbd { font: inherit; font-size: 10px; border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; margin-left: 2px; color: var(--text-dim); }
.drawings .count { margin-left: auto; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.canvas-msg { z-index: 2; pointer-events: none; }
.tool.active { background: var(--select); }
.sum-table { margin-top: 6px; max-width: 760px; }

/* ---------------- References panel (left) and page viewer ---------------- */
.rp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.rp-head { display: flex; gap: 4px; padding: 4px; background: var(--panel-2); align-items: center; }
.rp-import { position: relative; border: 1px solid var(--border); border-radius: 3px; padding: 1px 8px; cursor: pointer; }
/* the Library is empty: Upload is where to start (user 2026-11-17 "need more attention to this"), a Tabi-green outline that pulses with the arrow */
.rp-import-hint { border-color: var(--busy-green); color: var(--busy-green); font-weight: 600; animation: rp-import-pulse 1.8s ease-in-out infinite; }
@keyframes rp-import-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--busy-glow); } 50% { box-shadow: 0 0 6px 2px var(--busy-glow); } }
@media (prefers-reduced-motion: reduce) { .rp-import-hint { animation: none; } }
.rp-import input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.view-toggle button.on { border-radius: 0; }
.rp-tools { display: flex; align-items: center; gap: 6px; padding: 3px 4px; flex-wrap: wrap; }
.rp-tools input[type=range] { width: 64px; } .rp-tools .count { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.rp-tools button.on { background: var(--accent-2); }
.rp-filters { display: grid; gap: 3px; padding: 3px 4px; border-bottom: 1px solid var(--border-soft); } .rp-filters select { width: 100%; }
.rp-body { flex: 1; overflow: auto; min-height: 0; outline: none; }
.rp-body:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, var(--tw)); gap: 5px; padding: 5px; justify-content: start; }
.pt { position: relative; aspect-ratio: 1 / 1; background: #2b2b2c; border: 1px solid var(--border-soft); border-top: 3px solid #6a6a6a; cursor: default; display: flex; align-items: center; justify-content: center; overflow: hidden; user-select: none; }
.pt img { max-width: 100%; max-height: 100%; background: #fff; display: block; }
.pt.sel { outline: 2px solid var(--accent); outline-offset: -1px; } .pt.foc { box-shadow: 0 0 0 2px #fff7; }
.pt .no { position: absolute; left: 0; bottom: 0; background: #000b; color: #fff; font-size: 10px; padding: 0 4px; }
.pt .failed { color: var(--danger); font-weight: 700; }
.pr { display: flex; align-items: center; gap: 5px; padding: 2px 6px; white-space: nowrap; cursor: default; user-select: none; }
.pr:hover { background: var(--hover); } .pr.sel { background: var(--select); } .pr.foc { box-shadow: inset 2px 0 0 var(--accent); }
.pr .pn { width: 26px; text-align: right; font-weight: 600; }

.pvw { display: flex; flex-direction: column; height: 100%; outline: none; background: #1e1e1f; }
.pvw-bar { display: flex; align-items: center; gap: 5px; padding: 3px 6px; background: var(--panel-2); border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.pvw-bar .grow { flex: 1; }
.pvw-bar button.on { background: var(--accent-2); color: #fff; }
.pvw-bar kbd { font: inherit; font-size: 10px; border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; color: var(--text-dim); }
.pvw-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; container-type: size; padding: 4px; }
.pvw-page { position: relative; margin: auto; flex: none; background: #fff; box-shadow: 0 2px 12px #000a;
            aspect-ratio: var(--ar); width: calc(min(100cqw - 8px, (100cqh - 8px) * var(--ar)) * var(--z)); }
.pvw-page img { position: absolute; display: block; }
.rp-import { white-space: nowrap; }
.rp-tree .thumb-grid { padding-left: 22px; }
.rp-tree .rp-del { visibility: hidden; margin-left: 4px; border: 0; background: none; color: var(--text-dim, inherit); cursor: pointer; padding: 0 3px; font-size: 12px; }
.rp-tree .row:hover .rp-del { visibility: visible; }
.rp-tree .rp-del:hover { color: #e5534b; }
.modal .primary.danger { background: #c93c37; border-color: #c93c37; }
.rp.pstrip { height: 100%; }

/* thumbnails follow the page shape; landscape sheets no longer sit in a square */
.thumb-grid { align-items: start; }
.pt { aspect-ratio: auto; }
.pt img { width: 100%; height: 100%; object-fit: contain; }

/* thumbnails are pages: they stretch to the strip's width (one wide column by default) on a paper-like sheet */
.pstrip .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(var(--tw), 1fr)); gap: 10px; padding: 8px; }
.pstrip .pt { background: #fff; border: 1px solid #0006; border-top-width: 4px; box-shadow: 0 2px 6px #0008; }
.pstrip .pt img { object-fit: fill; }
.pstrip .pt .no { font-size: 11px; padding: 1px 6px; }

/* References tree rows reuse the Systems tree styling (.tree .row); only state colours are added */
.rp .tree { height: auto; }
.tree .row.file-active .name { color: #fff; font-weight: 600; }
.tree .row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tree .row.page.foc { box-shadow: inset 2px 0 0 var(--accent); }
.tree .row.page .ico.t-page { background: #777; }

/* References tab: resizable / collapsible thumbnails pane */
.rtab { --strip-w: 300px; display: grid; grid-template-columns: var(--strip-w) 8px 1fr; height: 100%; min-height: 0; }
.rtab[data-collapsed] { grid-template-columns: 0 16px 1fr; }
.rtab-strip { min-width: 0; min-height: 0; overflow: hidden; }
.rtab[data-collapsed] .rtab-strip { visibility: hidden; }
.rtab-main { min-width: 0; min-height: 0; }
.modal label.radio { display: flex; gap: 6px; align-items: center; color: var(--text); }
.modal .error { color: #e66; }
.rtab-split { position: relative; background: var(--border-soft); cursor: col-resize; outline: none; touch-action: none; display: flex; align-items: center; justify-content: center; }
.rtab-split:hover, .rtab-split:focus-visible, .rtab-split.dragging { background: var(--accent); }
.rtab[data-collapsed] .rtab-split { cursor: default; }
.rtab-toggle { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 18px; height: 22px; padding: 0; line-height: 1; font-size: 9px;
               border: 1px solid var(--border); border-radius: 3px; background: var(--panel-2); color: var(--text-dim); cursor: pointer; z-index: 2; }
.rtab-toggle:hover { color: #fff; background: var(--accent-2); }

/* Drawings: AutoCAD-style cursor readout */
.coord-readout { position: absolute; left: 8px; bottom: 6px; z-index: 2; pointer-events: none; font: 11px Consolas, monospace; color: #cfd2d6; background: #000a; padding: 1px 6px; border-radius: 2px; }
.coord-readout:empty { display: none; }

/* CAD pane status strip */
.cad-status { display: flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; background: #2b2d30; border-top: 1px solid var(--border); flex: none; font-size: 11px; }
.cad-status .grow { flex: 1; }
.cad-status .coord-readout { position: static; background: none; padding: 0; min-width: 190px; pointer-events: auto; }
.cad-status .coord-readout:empty { display: block; }
.cad-status .coord-readout:empty::before { content: "—"; color: var(--text-dim); }
.cad-status button.mode { height: 18px; padding: 0 7px; font-size: 10px; letter-spacing: .3px; background: transparent; border: 1px solid transparent; color: #8d939a; border-radius: 2px; cursor: pointer; }
.cad-status button.mode:hover { border-color: var(--border); }
.cad-status button.mode.on { background: #1f5fa8; color: #fff; }
.cad-status button.mode.drop { padding: 0 3px; margin-left: -4px; }
.snap-menu { position: absolute; right: 150px; bottom: 28px; z-index: 5; background: #2b2d30; border: 1px solid var(--border); border-radius: 3px; padding: 6px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; box-shadow: 0 4px 14px #0008; }
.snap-menu-title { color: var(--text-dim); font-size: 11px; margin-bottom: 2px; }
.snap-menu label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.drawings { position: relative; }

/* message bar docked at the bottom, above the status strip: latest message, then prompt, input and Enter / Esc buttons (large enough to tap) */
.cad-msgbar { flex: none; background: #232528; border-top: 1px solid var(--border); font: 12px Consolas, monospace; color: #dfe3e8; }
.cad-msgbar .hist { padding: 1px 8px; color: #aab0b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cad-msgbar .hist:empty { display: none; }
.cad-msgbar .line { display: flex; align-items: center; gap: 6px; padding: 3px 8px; }
.cad-msgbar .prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; white-space: pre-wrap; min-width: 0; flex: 0 1 auto; }
.cad-msgbar .cmd-btn.opt { min-width: 0; padding: 0 8px; background: #1f3a5c; border-color: #4da3ff66; }
.cad-msgbar .cmd-btn.opt:hover { background: #26507f; }
.cad-msgbar .cmd-input { pointer-events: auto; flex: 1 1 120px; min-width: 80px; min-height: 28px; background: #ffffff10; border: 1px solid #ffffff22; border-radius: 2px; outline: 0; color: #fff; font: inherit; caret-color: #fff; padding: 0 6px; }
.cad-msgbar .cmd-input:focus { border-color: #4da3ff; }
.cad-msgbar .cmd-btn { pointer-events: auto; min-width: 44px; min-height: 28px; background: #2b2f35; border: 1px solid #ffffff33; border-radius: 2px; color: #dfe3e8; font: inherit; cursor: pointer; touch-action: manipulation; }
.cad-msgbar .cmd-btn:hover { background: #3a4048; }
/* Model and layout tabs, in the status strip */
.cad-tabs-host, .cad-tabs { display: flex; align-items: center; gap: 2px; }
.cad-tabs button { height: 20px; padding: 0 8px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: #8d939a; cursor: pointer; font: inherit; }
.cad-tabs button:hover { color: #dfe3e8; }
.cad-tabs button.on { color: #fff; border-bottom-color: #4a90e2; }
.cad-tabmenu { position: absolute; z-index: 10; display: flex; flex-direction: column; min-width: 140px; padding: 3px 0; background: var(--panel, #2b2f35); border: 1px solid #ffffff33; border-radius: 3px; box-shadow: 0 4px 16px #0008; font: 12px "Segoe UI", sans-serif; }
.cad-tabmenu button { text-align: left; padding: 4px 12px; background: none; border: 0; color: #dfe3e8; cursor: pointer; font: inherit; }
.cad-tabmenu button:hover:not(:disabled) { background: #3a4048; }
.cad-tabmenu button:disabled { color: #ffffff44; cursor: default; }

/* prompt window */
.prompt-backdrop { position: absolute; inset: 0; z-index: 20; }
body:has(.float-win) .prompt-backdrop { position: fixed; z-index: 60; } /* a floating window (the XREF Manager) open: the prompt goes over it, not behind */
.prompt-backdrop { background: #0006; display: flex; align-items: center; justify-content: center; }
.prompt-window { min-width: 320px; max-width: 480px; background: var(--panel, #2b2f35); color: inherit; border: 1px solid var(--border); border-radius: 3px; box-shadow: 0 6px 24px #0008; font-size: 12px; }
.prompt-window h3 { margin: 0; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.prompt-window .body { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; padding: 10px 12px; }
.prompt-window .body input { background: #0003; border: 1px solid var(--border); color: inherit; padding: 2px 6px; border-radius: 2px; }
.prompt-window .body input:disabled { opacity: .45; }
.prompt-window .body label.check { display: flex; align-items: center; gap: 6px; }
.prompt-window, .xm-edit { --xyz-box: 64px; }
.xyz-row { display: flex; align-items: center; gap: 4px; }
.vw-levels { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow-y: auto; }
.xyz-row input { width: var(--xyz-box, 64px); min-width: 0; }
.xyz-lock { background: transparent; border: 1px solid var(--border); color: inherit; padding: 0 4px; border-radius: 2px; cursor: pointer; font-size: 11px; }
.xyz-lock.on { border-color: #1f5fa8; }
.prompt-window .err { grid-column: 1 / -1; color: #ffb4b4; }
.prompt-window .hint { grid-column: 1 / -1; color: var(--text-dim); font-size: 11px; }
.prompt-window .buttons { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); }
.prompt-window .buttons button { background: transparent; border: 1px solid var(--border); color: inherit; padding: 2px 12px; border-radius: 2px; cursor: pointer; }
.prompt-window .buttons button.primary { background: #1f5fa8; border-color: #1f5fa8; color: #fff; }
.cad-status .snap-info { color: #8d939a; margin-left: 12px; font-size: 10px; }
.snap-menu select { margin-top: 2px; }

/* Toolbox draw tools */
.tool-group { padding: 6px 8px 2px; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.tool-btn { display: flex; align-items: center; gap: 8px; width: calc(100% - 8px); margin: 1px 4px; padding: 4px 8px; background: transparent; border: 1px solid transparent; color: inherit; text-align: left; cursor: pointer; border-radius: 2px; }
.tool-btn:hover { background: var(--hover); }
.tool-btn.on { background: #1f5fa8; color: #fff; }
.tool-btn .glyph { width: 16px; text-align: center; }
.tool-btn .alias { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.tool-btn.on .alias { color: #cfe3ff; }
.tool-hint { margin: 8px; color: var(--text-dim); font-size: 11px; line-height: 1.4; }

/* Layer Manager */
.lm { display: flex; flex-direction: column; height: 100%; min-height: 0; font-size: 12px; outline: none; position: relative; }
.lm-hint { margin: 10px; color: var(--text-dim); line-height: 1.5; }
.lm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 4px; border-bottom: 1px solid var(--border); }
.lm-bar button, .lm-menu button { background: transparent; border: 1px solid var(--border); color: inherit; padding: 1px 7px; border-radius: 2px; cursor: pointer; font-size: 11px; }
.lm-bar button:hover:not(:disabled), .lm-menu button:hover:not(:disabled) { background: var(--hover); }
.lm-bar button:disabled, .lm-menu button:disabled { opacity: .4; cursor: default; }
.lm-bar .lm-pop { margin-left: auto; }
.lm-blocked { display: block; padding: 3px 8px; color: #e8b04a; font-size: 11px; }
.lm-msg { padding: 4px 8px; background: #4a2a2a; color: #ffd0d0; border-bottom: 1px solid var(--border); }
.lm-msg a { margin-left: 8px; color: #8ec1ff; cursor: pointer; }
.lm-grid { flex: 1; overflow: auto; min-height: 0; }
.lm-row { display: grid; grid-template-columns: 18px minmax(70px, 1.3fr) 26px 26px 30px 30px 62px minmax(78px, 1fr) minmax(70px, .9fr) 46px minmax(60px, 1fr) 40px 40px; align-items: center; gap: 4px; padding: 1px 4px; border-bottom: 1px solid #ffffff10; min-width: 760px; position: relative; }
.lm-grid.vp .lm-row { grid-template-columns: 18px minmax(70px, 1.3fr) 26px 26px 26px 30px 30px 62px minmax(78px, 1fr) minmax(70px, .9fr) 46px minmax(60px, 1fr) 40px 40px; }
.lm-row.frozen .c-name { color: #7fb4e6; }
.dxf-window { width: min(760px, 94vw); }
.dxf-list { max-height: 40vh; overflow: auto; margin: 6px 0; }
.dxf-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.6fr) auto auto; gap: 6px; align-items: center; padding: 2px 0; border-bottom: 1px solid #ffffff10; }
.dxf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dxf-meta { opacity: .75; font-size: 12px; }
.dxf-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0; }
.dxf-actions .file-btn { position: relative; overflow: hidden; display: inline-block; padding: 3px 8px; border: 1px solid #ffffff30; border-radius: 3px; cursor: pointer; }
.dxf-actions .file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dxf-report { max-height: 22vh; overflow: auto; font-size: 12px; background: #0002; padding: 4px 6px; margin: 4px 0; white-space: pre-wrap; }
.lm-num { width: 40px; }
.lm-row:hover { background: var(--hover); }
.lm-row.sel { background: #1f3a5c; }
.lm-row.off { opacity: .55; }
.lm-row.locked .c-name { font-style: italic; }
.lm-row.drop { box-shadow: inset 0 2px 0 #4a90e2; }
.lm-head { position: sticky; top: 0; z-index: 2; background: var(--panel-2); font-weight: 600; }
.lm-h { cursor: pointer; user-select: none; }
.lm-row .c-count, .lm-row .c-ord { text-align: right; color: var(--text-dim); }
.lm-row .c-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-tog { background: transparent; border: none; color: inherit; cursor: pointer; padding: 0 2px; }
.lm-swatch { width: 14px; height: 14px; border: 1px solid #ffffff55; padding: 0; cursor: pointer; vertical-align: middle; }
.lm-row select, .lm-input { width: 100%; background: var(--panel-2); color: inherit; border: 1px solid var(--border); font-size: 11px; padding: 0 2px; box-sizing: border-box; }
.lm-picker { position: absolute; z-index: 10; left: 0; top: 100%; background: #2b2d30; border: 1px solid var(--border); padding: 6px; box-shadow: 0 4px 14px #0008; width: 250px; }
.lm-pick-title { color: var(--text-dim); font-size: 10px; margin: 2px 0; }
.lm-pick-std, .lm-pick-all { display: flex; flex-wrap: wrap; gap: 1px; }
.lm-pick-all { max-height: 120px; overflow: auto; }
.lm-cell { width: 14px; height: 14px; border: 1px solid #00000066; padding: 0; cursor: pointer; }
.lm-pick-index { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.lm-pick-index input { width: 60px; }
.lm-menu-backdrop { position: fixed; inset: 0; z-index: 20; }
.lm-menu { position: fixed; z-index: 21; background: #2b2d30; border: 1px solid var(--border); display: flex; flex-direction: column; padding: 3px; gap: 2px; min-width: 140px; box-shadow: 0 4px 14px #0008; }
.lm-menu button { text-align: left; border-color: transparent; }
.lm-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 8px; border-top: 1px solid var(--border); color: var(--text-dim); }
.lm-foot input { width: 70px; background: var(--panel-2); color: inherit; border: 1px solid var(--border); }
.lm-window { height: 100vh; background: var(--bg, #1e1f22); color: var(--text, #dfe1e5); }

/* Toolbox current layer */
.cur-layer { display: flex; align-items: center; gap: 6px; padding: 4px 8px; }
.cur-layer select { flex: 1; min-width: 0; background: var(--panel-2); color: inherit; border: 1px solid var(--border); font-size: 12px; }
.cur-layer .lm-swatch { flex: none; }

/* A tool pane in its own window */
.pane-window { height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.pane-window > .pane { flex: 1; min-height: 0; overflow: auto; }

/* ---------------- Tabi: tag chips, filter bar, context menu, status ---------------- */
.chip { display: inline-block; font-size: 10px; line-height: 14px; padding: 0 6px; margin-left: 3px; border-radius: 8px; border: 1px solid var(--accent-2); color: var(--text); white-space: nowrap; vertical-align: middle; }
.chip[style*="--tag"] { border-color: var(--tag); }                                              /* each tag has its own color (TagColors) */
.chip.ok { background: var(--tag, var(--accent-2)); border-color: var(--tag, var(--accent-2)); color: #fff; }          /* accepted: filled */
.chip.sug { background: transparent; }                                                          /* suggested: outlined */
.chip.sug.low { border-style: dashed; opacity: .85; }                                           /* below the confidence threshold: dashed */

.pr .sheet { overflow: hidden; text-overflow: ellipsis; max-width: 38ch; } .pr .sheet b { font-weight: 600; }
.pt .chips { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 0 0 28px; text-align: right; pointer-events: none; }
.pt .chips.general { top: 0; bottom: auto; padding: 2px 0 0 3px; text-align: left; }
.pt .chips.general .chip { margin: 0 3px 2px 0; display: inline-block; }
.pt .chips.level { top: 50%; bottom: auto; padding: 0 0 0 3px; text-align: left; }            /* level tags: middle left */
.pt .chips.level .chip { margin: 0 3px 2px 0; display: inline-block; }
.chip.lvl { border-radius: 2px; }                                                               /* level tags: square corners */
.pt .chips .chip { background: #000b; color: #fff; border-color: var(--tag, #fff6); } .pt .chips .chip.ok { background: var(--tag, var(--accent-2)); }
.tagfilter { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px 4px; border-bottom: 1px solid var(--border-soft); }
.tagfilter .chip { margin: 0; background: transparent; cursor: pointer; font: inherit; font-size: 10px; }
.tagfilter .chip.on { background: var(--tag, var(--accent-2)); color: #fff; }
.tagfilter .chip.clear { border-color: var(--border); color: var(--text-dim); }
.ctx-backdrop { position: fixed; inset: 0; z-index: 40; }
.ctx { position: fixed; z-index: 41; min-width: 220px; background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 4px 14px #000a; padding: 3px 0; }
.ctx button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 4px 14px; cursor: pointer; font: inherit; }
.ctx button:hover { background: var(--accent-2); }
.statusbar a.seg { color: inherit; text-decoration: none; } .statusbar a.seg:hover { text-decoration: underline; }
.statusbar .seg.tabnet { display: inline-flex; align-items: center; height: 100%; }
.statusbar .tn-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: #999; }
.statusbar .tn-dot.up { background: #7bd88f; } .statusbar .tn-dot.down { background: #e06c75; }
.modal.ai-modal, .modal.tn-deploy { width: 560px; max-height: 84vh; overflow: auto; top: 6%; }
.modal .ai-dialog { display: grid; gap: 8px; } .modal .ai-dialog h3, .modal .ai-routing h3 { margin: 0 0 4px; }
.modal .ai-routing { display: grid; gap: 8px; }
.modal .method-choice { display: grid; gap: 4px; }
.modal .method-choice label.radio { display: block; }
.modal label.method { display: block; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; color: var(--text); }
.modal label.method.on { border-color: var(--accent); background: var(--select); }
.modal label.method .dim { display: block; margin-left: 22px; }
.modal details summary { cursor: pointer; }
.modal .paste-script { width: 100%; font: 11px Consolas, monospace; }
.modal .ai-routing label { display: inline-flex; gap: 4px; align-items: center; color: var(--text); margin-right: 10px; }
.modal .ai-dialog > button.primary { justify-self: start; }
.statusbar .seg.tabi-on { color: #7bd88f; } .statusbar .seg.tabi-busy { color: #e5c07b; } .statusbar .seg.tabi-off { color: #e06c75; }
.statusbar .seg.ai-status { display: inline-flex; align-items: center; gap: 4px; } .statusbar .seg.ai-status.busy { color: var(--busy-green); } .statusbar .seg.ai-status .ai-spend { color: #e5c07b; }

/* a page row with Tabi on: the sheet label on the first line, the tag chips on a second line, so a narrow panel does not squeeze them */
.tree .row.page.tabi { height: auto; flex-wrap: wrap; padding-top: 2px; padding-bottom: 2px; row-gap: 1px; }
.tree .row.page.tabi .name { white-space: nowrap; }
.tree .row.page .chiprow { flex: 0 0 100%; padding-left: 20px; line-height: 15px; white-space: normal; }
.tree .row.page .chiprow .chip:first-child { margin-left: 0; }

.msg.tool { padding: 1px 8px; font-size: 11px; opacity: .75; } .msg.tool .toolline { font-style: italic; }
.chat-links { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .chat-links a { font-size: 11px; }
.msg.confirm .card { border: 1px solid var(--border-soft); border-radius: 4px; padding: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; opacity: 1; font-size: 12px; }
/* a member's Tabi flag or pause (R12): a note, not an error */
.acct-note { margin: 6px 0; padding: 4px 6px; border-left: 3px solid #c8a24a; background: rgba(200, 162, 74, 0.08); font-size: 12px; }
/* Tabi's Yes / No (R7): big enough for a finger */
.msg.confirm .confirm-buttons { display: flex; gap: 8px; }
.msg.confirm .confirm-buttons button { min-width: 64px; min-height: 36px; font-size: 13px; }

.chip { font-size: 10px; padding: 0 5px; border-radius: 8px; color: #fff; }
.chip.db { background: #5a6b7d; } .chip.ai { background: #8a4fc7; }

/* routing popover (RoutingEditor in the AI settings) */
.route-role { margin: 4px 0; }
.routing-editor .re-row { display: flex; gap: 8px; align-items: center; padding: 1px 0; font-size: 12px; }
.routing-editor .re-row:not(.on) { opacity: .65; }
.routing-editor .dim, .route-pop .dim { opacity: .65; }
.routing-editor .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #888; }
.routing-editor .dot.online { background: #3fb950; } .routing-editor .dot.busy { background: #d9a334; } .routing-editor .dot.offline { background: #d9534f; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 2px 6px; border-bottom: 1px solid var(--border, #444); position: relative; }
.mini { padding: 0 6px; font-size: 11px; } .mini.on { font-weight: 600; outline: 1px solid var(--accent, #3794ff); }

/* ---- Tabi window header (⚙ then the status; normal states are never coloured as faults) and the AI settings ---- */
.chat-head .gear { font-size: 14px; }
.tabi-state { font-size: 12px; display: inline-flex; align-items: center; }
.tabi-state-ready { color: inherit; } .tabi-state-busy { color: var(--busy-green); } .tabi-state-offline, .tabi-state-off { opacity: .7; }
.ai-line { display: flex; align-items: center; gap: 6px; font-size: 11px; opacity: .8; padding: 2px 6px; flex-wrap: wrap; }
.ai-line-gear { background: none; border: none; color: var(--accent, #3794ff); padding: 2px 4px; font-size: 11px; cursor: pointer; min-height: 22px; }
.ai-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.ai-tabs button.on, .ai-choice.on { font-weight: 600; outline: 1px solid var(--accent, #3794ff); }
.ai-rows { display: grid; gap: 8px; margin: 8px 0; max-height: 55vh; overflow: auto; }
.ai-row { border: 1px solid var(--border-soft, #3a3a3a); border-radius: 4px; padding: 6px 8px; }
.ai-row.focus { border-color: var(--accent, #3794ff); }
.ai-row .dim, .route-role .dim { opacity: .65; }
.ai-row-head { margin-bottom: 4px; }
.ai-field { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 2px 0; font-size: 12px; }
.ai-label { width: 46px; opacity: .7; }
.ai-choice { min-height: 26px; padding: 2px 8px; font-size: 12px; }

/* source chip for TabNet rows */
.chip.net { background: #5a4a9a; }

button.link { background: none; border: 0; padding: 2px 4px; color: #6cb6ff; cursor: pointer; white-space: nowrap; }
button.link:hover { text-decoration: underline; }



/* the confirmation before page images go to Claude */

/* ---- the height bar above the drawing view (heightbar.js) ---- */
.cad-heightbar { flex: none; position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 6px; background: #2a2a2d; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; z-index: 4; }
.cad-heightbar .hb-lbl { color: var(--text-dim); }
.cad-heightbar .hb-sep { width: 1px; height: 18px; background: var(--border); }
.cad-heightbar select { height: 22px; max-width: 220px; }
.cad-heightbar .hb-level { width: 190px; }
.cad-heightbar .hb-preset { width: 200px; }
.cad-heightbar .hb-draw { width: 230px; }
.cad-heightbar .hb-num { display: inline-flex; align-items: stretch; background: #3c3c3c; border: 1px solid var(--border); border-radius: 2px; height: 22px; }
.cad-heightbar .hb-num input { width: 58px; border: none; background: none; text-align: right; padding: 0 4px; }
.cad-heightbar .hb-step { display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.cad-heightbar .hb-step button { flex: 1; padding: 0 3px; font-size: 7px; line-height: 9px; border: none; background: none; color: var(--text-dim); }
.cad-heightbar .hb-step button:hover { color: #fff; background: var(--hover); }
.cad-heightbar .hb-dash { color: var(--text-dim); }
.cad-heightbar .hb-strip { width: 150px; height: 20px; border: 1px solid var(--border); border-radius: 2px; cursor: ew-resize; }
.cad-heightbar .hb-link { padding: 0 5px; height: 22px; opacity: .45; }
.cad-heightbar .hb-link.on { opacity: 1; border-color: var(--ok); }
.cad-heightbar .hb-typed { width: 64px; text-align: right; height: 22px; }
.cad-heightbar .hb-abs { color: var(--text-dim); font-size: 11px; min-width: 70px; }
.cad-heightbar .hb-badge { border-radius: 2px; padding: 1px 6px; font-size: 11px; }
.cad-heightbar .hb-badge.ok { background: #16825d; color: #fff; }
.cad-heightbar .hb-badge.warn { background: #6b5a1c; color: #ffe9a8; }
.cad-heightbar .hb-grow { flex: 1; }
.cad-heightpop { position: absolute; top: 100%; z-index: 90; min-width: 260px; max-width: 420px; background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 6px 20px #000a; padding: 8px; display: grid; gap: 6px; white-space: normal; }
.cad-heightpop.wide { max-width: 640px; min-width: 520px; }
.cad-heightpop.menu { padding: 3px 0; gap: 0; min-width: 240px; }
.cad-heightpop .hp-title { font-weight: 600; color: #fff; }
.cad-heightpop .hp-hint { color: var(--text-dim); font-size: 11px; }
.cad-heightpop .hp-btns { display: flex; justify-content: flex-end; gap: 6px; }
.cad-heightpop .hm-item { padding: 4px 12px; cursor: pointer; }
.cad-heightpop .hm-item:hover { background: var(--select); }
.cad-heightpop .hm-sep { height: 1px; background: var(--border); margin: 3px 0; }
.cad-heightpop .ha-list { max-height: 260px; overflow: auto; border: 1px solid var(--border-soft); }
.cad-heightpop .ha-row { padding: 2px 6px; cursor: pointer; font-size: 11px; border-bottom: 1px solid var(--border-soft); }
.cad-heightpop .ha-row:hover { background: var(--select); }
.cad-heightpop .ha-kind { display: inline-block; min-width: 74px; font-weight: 600; color: var(--warn, #d7ba7d); }
.cad-heightbar-host { flex: none; }

/* ---- the Site Layout pane (SiteLayout.razor) ---- */
.fac-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--panel); }
.fac-empty { padding: 20px; color: var(--text-dim); }
.fac-focusbar { flex-wrap: wrap; }
.fac-focusbar .chip, .fac-pane .chip { border-radius: 10px; padding: 1px 9px; font-size: 11px; }
.fac-pane .chip.on { background: var(--accent-2); border-color: var(--accent); color: #fff; }
.fac-dirty { color: #e8c46a; font-size: 11px; margin-left: 6px; }
.fac-msg { padding: 3px 10px; }
.fac-note { color: var(--ok); font-size: 12px; }
.fac-body { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--fac-left, 300px) 5px minmax(0, 1fr); overflow: hidden; }
.fac-tree { overflow: auto; border-right: 1px solid var(--border-soft); padding: 4px 0; font-size: 12px; }
.fac-tnode { padding: 2px 8px; cursor: pointer; white-space: nowrap; }
.fac-tnode.b { padding-left: 16px; }
.fac-tnode.l { padding-left: 28px; }
.fac-tnode.r { padding-left: 52px; color: #b5cea8; }
.fac-tnode.sel { background: var(--select); }
.fac-tnode:hover { background: var(--hover); }
.fac-main { overflow: auto; min-width: 0; }
.fac-views { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; border-bottom: 1px solid var(--border); }
.fac-views.all .v3d { grid-row: span 2; }
.fac-views.3d, .fac-views.elev, .fac-views.plan { grid-template-columns: 1fr; }
.fac-view { position: relative; border-right: 1px solid var(--border-soft); min-height: 220px; background: #1d1e20; }
.fac-view svg { width: 100%; height: auto; display: block; }
.fac-vt { font-size: 11px; color: var(--text-dim); padding: 3px 6px; display: flex; gap: 8px; align-items: center; }
.fac-orbit button { padding: 0 6px; font-size: 11px; }
.fac-svg .grid { stroke: #2c2e31; }
.fac-svg .ground { stroke: #7a6a50; }
.fac-svg .axis { fill: #6a6f75; font-size: 10px; }
.fac-svg .slab.on { fill: #d4d4d4; } .fac-svg .slab.ghost { fill: #4a4a4a; }
.fac-svg .rslab.on { fill: #d7ba7d; } .fac-svg .rslab.ghost { fill: #5a5240; }
.fac-svg .ceiling { stroke: #4ec9b0; stroke-dasharray: 4 3; } .fac-svg .ceiling.ghost { stroke: #4ec9b044; }
.fac-svg .rceiling { stroke: #4ec9b0; stroke-width: 2; } .fac-svg .rceiling.ghost { stroke: #4ec9b044; }
.fac-svg .void { fill: #1d1e20; stroke: #9cdcfe; stroke-dasharray: 3 2; }
.fac-svg .lname { fill: #bbb; font-size: 10px; } .fac-svg .lname.ghost { fill: #666; }
.fac-svg .bname { fill: #ffd54a; font-size: 11px; }
.fac-svg .foot { stroke: #9d9d9d; fill: #007acc14; } .fac-svg .foot.ghost { stroke: #555; fill: none; }
.fac-svg .origin { fill: none; stroke: #ffd54a; }
.fac-svg .region { fill: #d7ba7d33; stroke: #d7ba7d; }
.fac-svg .region.Ceiling { fill: #4ec9b022; stroke: #4ec9b0; }
.fac-svg .region.Void { fill: #f14c4c22; stroke: #f14c4c; stroke-dasharray: 4 3; }
.fac-svg .region.NoCeiling { fill: #9cdcfe22; stroke: #9cdcfe; }
.fac-svg .region.ghost { opacity: .35; }
.fac-svg .rname { fill: #ddd; font-size: 10px; }
.fac-svg .north { fill: #9d9d9d; }
.fac-svg .look { stroke: #ffd54a; stroke-dasharray: 8 3; }
.fac-svg .plate.on { fill: #3d7fb8; stroke: #9cdcfe; } .fac-svg .plate.ghost { fill: #2c2c2c; stroke: #4a4a4a; }
.fac-svg .side.on { fill: #1e4d75; stroke: #9cdcfe55; } .fac-svg .side.ghost { fill: #262626; stroke: #3a3a3a; }
.fac-edit { padding: 6px 8px; display: grid; gap: 6px; }
.fac-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fac-row label { display: flex; gap: 4px; align-items: center; color: var(--text-dim); }
.fac-row label.grow { flex: 1; } .fac-row label.grow input { flex: 1; }
.fac-pane input.n { width: 70px; text-align: right; }
.fac-pane input.w { width: 260px; }
.fac-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.fac-table th { text-align: left; color: var(--text-dim); font-weight: normal; background: var(--panel-2); padding: 3px 6px; }
.fac-table td { padding: 2px 6px; border-bottom: 1px solid var(--border-soft); }
.fac-table tr.sel td { background: var(--select); }
.fac-table input { width: 100%; min-width: 60px; }
.fac-region-edit { display: grid; gap: 4px; }
.fac-region-edit label { display: grid; gap: 2px; color: var(--text-dim); }
.fac-region-edit textarea { width: 100%; font-family: Consolas, monospace; font-size: 11px; background: #3c3c3c; color: var(--text); border: 1px solid var(--border); }
.fac-modal { min-width: 520px; max-width: 900px; }
.fac-modal.wide { width: 900px; }
.fac-modal label { display: block; margin: 4px 0; }
.fac-steps { display: flex; gap: 4px; margin-bottom: 8px; }
.fac-steps span { flex: 1; padding: 3px 6px; background: var(--panel-2); color: var(--text-dim); font-size: 11px; border-top: 2px solid transparent; }
.fac-steps span.done { color: var(--text); border-top-color: #16825d; }
.fac-steps span.cur { color: #fff; border-top-color: var(--accent); background: var(--select); }
.fac-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #1d1e20; }
.fac-change { border-bottom: 1px solid var(--border-soft); padding: 6px 0; }
.fac-change.undone { opacity: .55; }
.fac-report { white-space: pre-wrap; font-size: 11px; }

/* ---- the Site pane's 3D view (site3d.js) ---- */
.fac3d-host { position: relative; height: 58vh; min-height: 360px; border-bottom: 1px solid var(--border); background: #1b1c1f; overflow: hidden; }
/* the view's element keeps the class fac3d-host, which Blazor rewrites (it took away the fac3d the script adds; 2026-11-14) */
:is(.fac3d, .fac3d-host) canvas.fac3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
:is(.fac3d, .fac3d-host) canvas.fac3d-canvas:active { cursor: grabbing; }
:is(.fac3d, .fac3d-host) canvas.cad-viewcube { position: absolute; top: 6px; right: 6px; z-index: 3; }
:is(.fac3d, .fac3d-host) canvas.fac3d-wheel { position: absolute; left: 12px; bottom: 12px; width: 128px; height: 128px; z-index: 3; cursor: pointer; }
:is(.fac3d, .fac3d-host) .fac3d-bar { position: absolute; top: 6px; left: 6px; z-index: 4; display: flex; gap: 4px; align-items: center; }
:is(.fac3d, .fac3d-host) .fac3d-bar button { font-size: 11px; padding: 1px 8px; background: rgba(45,45,48,0.9); }
:is(.fac3d, .fac3d-host) .fac3d-bar button.on { background: var(--accent-2); border-color: var(--accent); color: #fff; }
:is(.fac3d, .fac3d-host) .fac3d-panel { position: absolute; top: 32px; left: 6px; z-index: 5; background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 6px 20px #000a; padding: 6px 10px; display: grid; gap: 2px; min-width: 230px; font-size: 12px; }
:is(.fac3d, .fac3d-host) .fac3d-panel .hd { color: var(--text-dim); font-size: 10px; text-transform: uppercase; margin-top: 6px; }
:is(.fac3d, .fac3d-host) .fac3d-panel label { display: flex; gap: 6px; align-items: center; cursor: pointer; }

/* XREF Manager (Cad-Xref-Manager-Plan.md section 10) */
.xm { display: flex; flex-direction: column; height: 100%; min-height: 0; font-size: 12px; outline: none; }
.xm .xm-sel, .xm .xm-search, .xm .xm-in { background: var(--panel-2); color: inherit; border: 1px solid var(--border); font-size: 11px; padding: 0 3px; }
.xm .xm-search { width: 110px; }
.xm .xm-in.num { width: 76px; text-align: right; }
.xm .xm-radio { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; margin-right: 6px; }
.xm .xm-note { color: #e8b04a; font-size: 11px; margin-left: 6px; }
.xm-grid { flex: 1; overflow: auto; min-height: 60px; }
.xm-row { display: grid; grid-template-columns: 22px minmax(140px, 2fr) 34px minmax(60px, .8fr) 70px minmax(70px, .8fr) 76px minmax(120px, 1.4fr); gap: 4px; align-items: center; padding: 1px 4px; border-bottom: 1px solid #ffffff10; min-width: 720px; cursor: default; }
.xm-row:hover { background: var(--hover); }
.xm-row.sel { background: #1f3a5c; }
.xm-row.off { opacity: .55; }
.xm-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xm-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.xm-row.unplaced .name { color: var(--text-dim); }
.xm-head { position: sticky; top: 0; z-index: 2; background: var(--panel-2); font-weight: 600; }
.xm-group { padding: 2px 6px; font-weight: 600; border-bottom: 1px solid #ffffff10; background: #ffffff06; display: flex; gap: 8px; align-items: center; }
.xm-group.sub { padding-left: 18px; font-weight: 500; background: transparent; cursor: pointer; }
.xm-group.sel { background: #1f3a5c; }
.xm-dim { color: var(--text-dim); font-weight: 400; font-size: 11px; }
.xm-tag { display: inline-block; padding: 0 4px; margin-right: 3px; border-radius: 2px; background: #ffffff12; font-size: 10px; }
.xm-tag.warn { background: #5a4410; color: #ffd68a; }
.xm-btn { background: transparent; border: 1px solid var(--border); color: inherit; padding: 0 6px; border-radius: 2px; cursor: pointer; font-size: 11px; }
.xm-btn:hover:not(:disabled) { background: var(--hover); }
.xm-btn:disabled { opacity: .4; cursor: default; }
.xm-details { border-top: 1px solid var(--border); padding: 4px 8px; max-height: 45%; overflow: auto; }
.xm-title { margin-bottom: 4px; }
.xm-fields { display: grid; grid-template-columns: 110px 1fr; gap: 3px 8px; align-items: center; }
.xm-fields > label { color: var(--text-dim); }
.xm-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.xm-dup { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 4px; padding: 4px; border: 1px solid var(--border); }

/* ---- Find symbols (SymbolFinder.razor + js/symbolfinder.js): the page on the left (light, as paper), the symbol and what to insert on the right */
.sf-pane { display: flex; height: 100%; min-height: 0; font-size: 12px; }
.sf-view { position: relative; flex: 1; min-width: 0; background: #fff; }
.sf-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; outline: none; }
.sf-busy { position: absolute; left: 8px; top: 8px; background: #ffd; color: #333; border: 1px solid #cc9; padding: 3px 8px; }
.sf-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 6px; background: #0002; border-radius: 3px; }
.sf-bar > div { height: 100%; width: 0; background: #00a3a3; border-radius: 3px; }
.sf-side { flex: 1; min-width: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.sf-source { display: grid; gap: 4px; }
.sf-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.sf-buttons .on { background: var(--accent-2); }
.sf-js .sf-bar { position: static; height: 6px; background: #0004; border-radius: 3px; }
.sf-error { color: #f48771; }
.sf-prompt { background: var(--panel-2); border-left: 3px solid #3794ff; padding: 6px 8px; line-height: 1.4; }
.sf-js { display: flex; flex-direction: column; gap: 4px; }
.sf-status { color: var(--text-dim, #aaa); line-height: 1.4; }
.sf-looks { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-look { border: 2px solid; border-radius: 3px; padding: 3px; background: #fff; color: #333; cursor: pointer; text-align: center; font-size: 11px; opacity: .75; }
.sf-look.sf-on { opacity: 1; box-shadow: 0 0 0 2px #3794ff; }
.sf-prop button { margin-left: 4px; }
.sf-row label { display: inline-flex; align-items: center; gap: 4px; }
.sf-row input[type=number] { width: 48px; }
.sf-help { color: var(--text-dim, #aaa); line-height: 1.5; }
.sf-notes { font-family: Consolas, monospace; font-size: 10px; white-space: pre-wrap; color: var(--text-dim, #999); max-height: 90px; overflow-y: auto; }
.sf-hits { font-family: Consolas, monospace; font-size: 11px; max-height: 160px; overflow-y: auto; }
.sf-hits div { cursor: pointer; white-space: pre; padding: 0 3px; }
.sf-hits div:hover { background: var(--hover); }
.sf-sure { color: #6ccf7f; } .sf-check { color: #e6a23c; } .sf-added { color: #6cb6ff; } .sf-rej { color: #f48771; text-decoration: line-through; }
.sf-muted { color: var(--text-dim, #999); }
.sf-insert { border-top: 1px solid var(--border); padding-top: 6px; display: grid; gap: 6px; }
.sf-insert h4 { margin: 4px 0 0; font-size: 12px; }
.sf-field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 6px; }
.sf-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; max-height: 220px; overflow-y: auto; }
.sf-block { display: grid; justify-items: center; gap: 2px; padding: 3px; background: #fff; color: #222; border: 2px solid transparent; font-size: 10px; overflow: hidden; }
.sf-block span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-block.sf-on { border-color: #3794ff; }
.sf-thumb { width: 56px; height: 56px; }
.sf-place { padding: 4px 8px; font-size: 12px; }
.sf-report { color: var(--text-dim, #aaa); }
.sf-saved { display: flex; align-items: center; gap: 4px; }
.sf-saved span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the simple pane (docs/Detector-Plan.md 5) */
.sf-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.sf-tab { background: none; border: none; border-bottom: 2px solid transparent; color: inherit; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.sf-tab.sf-on { border-bottom-color: #3794ff; font-weight: 600; }
.sf-find { display: flex; flex-direction: column; gap: 8px; }
.sf-name { display: flex; gap: 4px; align-items: center; }
.sf-name input { flex: 1; min-width: 0; }
.sf-save { position: relative; display: flex; }
.sf-caret { padding-left: 4px; padding-right: 4px; }
.sf-menu { position: absolute; right: 0; top: 100%; z-index: 5; display: grid; background: var(--panel-2); border: 1px solid var(--border); min-width: 150px; }
.sf-menu button { background: none; border: none; color: inherit; text-align: left; padding: 5px 10px; cursor: pointer; }
.sf-menu button:hover { background: var(--hover); }
.sf-thr-row input[type=range] { width: 160px; }
.sf-counts { font-size: 13px; }
.sf-checkbar { display: flex; align-items: center; gap: 6px; }
.sf-runon { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sf-runon label { display: inline-flex; align-items: center; gap: 3px; }
.sf-job { display: flex; align-items: center; gap: 6px; color: var(--text-dim, #aaa); }
.sf-job span { flex: 1; }
.sf-insertline { display: flex; align-items: center; gap: 6px; }
.sf-insertline .sf-thumb { width: 28px; height: 28px; background: #fff; color: #222; }
.sf-more > summary { cursor: pointer; color: var(--text-dim, #aaa); }
.sf-more[open] > summary { margin-bottom: 6px; }
.sf-js-more { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.sf-saved.sf-cur span { font-weight: 600; }
.sf-detections { display: flex; flex-direction: column; gap: 8px; }
.sf-grid { border-collapse: collapse; font-size: 11px; }
.sf-grid th, .sf-grid td { border: 1px solid var(--border); padding: 2px 6px; white-space: nowrap; }
.sf-grid th { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.sf-cell { cursor: pointer; text-align: center; }
.sf-cell:hover { outline: 1px solid #3794ff; }
.sf-tocheck { background: #e6a23c33; } .sf-allsure { background: #6ccf7f26; } .sf-placed { color: var(--text-dim, #999); } .sf-none { color: var(--text-dim, #999); }

/* Systems tree (System-Tree-Plan.md): rows of placements; the other placements of the selected item are marked; dimmed rows are not live in the chosen state */
.systree .row .sico { width: 16px; text-align: center; color: var(--text-dim); font-size: 12px; }
.systree .row.sel-other { box-shadow: inset 2px 0 0 var(--accent); }
.systree .row.dead .name { opacity: 0.45; }
.systree .row .nocad { color: var(--text-dim); font-size: 10px; }
.systree .row.also { color: var(--text-dim); font-size: 11px; font-style: italic; cursor: pointer; }   /* ↪ also fed from (System-Tree-Rewrite-Plan 6.2) */
.sp-box { border: 1px solid var(--border, #444); border-radius: 4px; margin: 4px; padding: 6px 8px; background: rgba(118, 185, 0, 0.06); }   /* a systems operation's preview (7.3) */
.sp-box .sp-what { font-weight: 600; margin-bottom: 2px; }
.sp-box .sp-line { font-size: 12px; }
.sp-box .sp-warn { font-size: 12px; color: #ffa94d; }
.sp-box .sp-clash { font-size: 12px; color: #ffa94d; display: block; margin-bottom: 4px; }
.sp-said { font-size: 12px; color: var(--text-dim); margin: 2px 6px; }
.systree .row.k-mediumgroup .name, .systree .row.k-project .name, .syssync .row.k-group .name { font-weight: 600; }
.systree .row.k-group .name, .systree .row.k-states .name { font-style: italic; color: var(--text-dim); }
.systree .pane-toolbar button.on { outline: 1px solid var(--accent); }
.systree .pane-toolbar button.warn { color: #e0a030; }
.systree .pick-hint { padding: 2px 8px; font-size: 11px; color: var(--accent); background: var(--panel-2); }
.syssync .row { height: auto; min-height: 22px; }
.syssync .row .kind { margin-left: 8px; }

.ai-status dd.wrap { white-space: normal; }
.ai-status { display: grid; grid-template-columns: max-content 1fr; gap: 1px 8px; margin: 0; flex: 1 1 240px; min-width: 0; }
.ai-status dt { color: var(--text-dim); }
.ai-status dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #888; flex: none; }
.dot.up, .dot.online { background: #3fb950; } .dot.busy { background: #d9a334; } .dot.down, .dot.offline { background: #d9534f; } .dot.off { background: #555; } .dot.none { background: transparent; border: 1px solid #777; }


/* ---------------- accounts (Library-Plan section 15) ---------------- */
.login-state { color: var(--text); line-height: 1.5; } .login-state code { color: #dcdcaa; }
.login-message { color: #e8b04b; }
.menubar-fill { flex: 1; }
.user-menu .menu-title { color: var(--text-dim); }
.dropdown.right { right: 0; left: auto; }
.modal.wide { width: 760px; max-height: 84vh; overflow: auto; top: 6%; }
.acct-users { display: grid; grid-template-columns: 260px 1fr; gap: 12px; min-height: 320px; }
.acct-list { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border-soft); padding-right: 8px; overflow: auto; max-height: 60vh; }
.acct-list .row { display: grid; text-align: left; } .acct-list .row.dim { opacity: .55; }
.acct-list > .primary { margin-bottom: 6px; justify-self: start; }
.acct-detail { display: grid; gap: 8px; align-content: start; } .acct-detail h4, .acct-section h4 { margin: 0; }
.acct-muted { color: var(--text-dim); font-size: 12px; }
.acct-error { color: #e66; } .acct-ok { color: #4ec9b0; }
.acct-link { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--accent); }
.acct-link > div { grid-column: 1 / -1; } .acct-link input { font: 12px Consolas, monospace; }
.acct-tabs { display: flex; gap: 4px; } .acct-tabs .sel { background: var(--select); }
.modal label.acct-check { display: flex; gap: 6px; align-items: center; color: var(--text); }
.acct-roles { border-collapse: collapse; } .acct-roles td { padding: 3px 8px 3px 0; }
.acct-section { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.acct-secret { font: 16px Consolas, monospace; letter-spacing: 1px; color: #fff; }
.acct-session { font-size: 12px; }
.no-project { height: 100%; display: grid; place-items: center; color: var(--text-dim); text-align: center; gap: 10px; }

.modal .project-row { display: flex; gap: 6px; align-items: center; } .modal .project-row .row { flex: 1; }
.modal button.small, .modal input.small { padding: 2px 6px; font-size: 12px; } .modal button.small.danger { border-color: #c93c37; }

/* alerts (File-Server-Plan section 8) */
.statusbar .seg.alerts { cursor: pointer; color: #e8b04b; font-weight: 600; }
.alerts-list { position: fixed; right: 12px; bottom: 30px; z-index: 300; width: 520px; max-height: 50vh; overflow: auto; background: var(--panel); border: 1px solid var(--border); padding: 10px 12px; box-shadow: 0 10px 40px #000c; }
.alerts-list h4 { margin: 0 0 6px; } .alert-row { padding: 3px 0; border-top: 1px solid var(--border-soft); font-size: 12.5px; }

/* ---------------- the Library window (Library-Plan step 7) ---------------- */
/* the Library, left dock (LibraryPanel): the tree is .rp-tree; messages, settings and the selected item's actions around it */
.lp .rp-head { flex-wrap: wrap; } .lib-fill { flex: 1; }
.lp { overflow: hidden; } .lp .rp-tree { flex: 1 1 0; min-height: 60px; } .lp .lp-detail { flex: none; }   /* the tree scrolls; the selected item's actions always stay in view below it */
.lp-search { margin: 3px 4px; }
.lp .file-btn input { display: none; } .lp .file-btn { cursor: pointer; padding: 1px 6px; border: 1px solid var(--border); border-radius: 3px; }
.lp button.on { background: var(--select); }
.lp .small { padding: 2px 8px; font-size: 12px; } .lp .small.danger { border-color: #c93c37; }
.lp a.btn-link { display: inline-block; border: 1px solid var(--border); border-radius: 3px; text-decoration: none; color: inherit; }
.lib-msg { font-size: 12px; color: var(--text-dim); padding: 2px 6px; } .lib-msg.err { color: #e66; } .lib-msg.ok { color: #4ec9b0; }
.lib-unfinished, .lib-settings { display: grid; gap: 4px; padding: 6px; margin: 2px 4px; border: 1px solid var(--border-soft); }
.lib-settings label { display: flex; gap: 6px; align-items: center; }
.lib-chip { display: inline-flex; gap: 4px; align-items: center; padding: 1px 6px; margin: 2px; border: 1px solid var(--border-soft); border-radius: 3px; font-size: 12px; }
.lp-caption .name { color: var(--text-dim); font-style: italic; }
.lp-detail { border-top: 1px solid var(--border); padding: 5px 6px; display: grid; gap: 4px; background: var(--panel-2); font-size: 12px; max-height: 40%; overflow: auto; }
.lp-detail-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.lp-top-acts { padding: 4px; border-bottom: 1px solid var(--border); background: var(--panel-2); align-items: center; }   /* the selected item's buttons, at the top */
.lp-moving-text { flex: 1; min-width: 0; }
.lp .row.move-target { outline: 1px dashed var(--accent); outline-offset: -1px; }   /* a folder that takes the document being moved */

/* ---- every kind of document (docs/Import-All-Types-Plan.md): the Preview tab, the Library's thumbnails and kinds ---- */
.t-file.k-image, .t-file.k-tiff { background: #8fbc8f; } .t-file.k-word { background: #6c9bd2; } .t-file.k-excel, .t-file.k-csv { background: #5cae7e; }
.t-file.k-powerpoint { background: #e0805f; } .t-file.k-email { background: #b39ddb; } .t-file.k-video { background: #e57373; }
.t-file.k-archive { background: #c8a96a; } .t-file.k-dwg, .t-file.k-dxf { background: #4fc1ff; } .t-file.k-text { background: #9e9e9e; }
.lp-thumb { max-width: 160px; max-height: 120px; border: 1px solid var(--border); background: #fff; justify-self: start; }
.lp-num { width: 64px; }
.pv { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--panel); }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--border); background: var(--panel-2); flex: none; }
.pv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.pv-fill { flex: 1; }
.pv-msg { padding: 16px; color: var(--text-dim); }
.pv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pv-tools { display: flex; align-items: center; gap: 6px; padding: 4px 8px; flex: none; flex-wrap: wrap; }
.pv-tools button { min-width: 36px; min-height: 28px; }
.pv-pic { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; background: #3a3a3a; }
.pv-pic img { display: block; image-orientation: from-image; background: #fff; }
.pv-drawing { align-items: center; }
.pv-drawing { overflow: hidden; position: relative; }
.pv-drawing img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.pv-video { flex: 1; min-height: 0; width: 100%; background: #000; }
.pv-read { flex: 1; min-height: 0; overflow: auto; padding: 12px 24px; line-height: 1.5; max-width: 980px; }
.pv-h { font-weight: 600; margin: 14px 0 6px; } .pv-h1 { font-size: 1.6em; } .pv-h2 { font-size: 1.35em; } .pv-h3 { font-size: 1.15em; }
.pv-slide { margin: 22px 0 8px; padding: 4px 8px; background: var(--panel-2); border-left: 4px solid #e0805f; font-weight: 600; }
.pv-notes { color: var(--text-dim); font-style: italic; margin: 6px 0 12px; white-space: pre-wrap; }
.pv-li { display: flex; gap: 8px; } .pv-bullet { color: var(--text-dim); }
.pv-read p { margin: 6px 0; white-space: pre-wrap; }
.pv-table { border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.pv-table td, .pv-table th { border: 1px solid var(--border); padding: 2px 6px; vertical-align: top; text-align: left; white-space: pre-wrap; }
.pv-cells th { background: var(--panel-2); color: var(--text-dim); font-weight: normal; position: sticky; top: 0; }
.pv-cells tr th:first-child { position: sticky; left: 0; }
.pv-grid { flex: 1; min-height: 0; overflow: auto; padding: 0 8px; }
.pv-sheets { display: flex; gap: 2px; padding: 4px 8px; border-top: 1px solid var(--border); flex: none; overflow-x: auto; }
.pv-sheets button.on { background: var(--accent-2); color: #fff; }
.pv-figure img { max-width: 100%; background: #fff; }
.pv-nopic { display: inline-block; padding: 8px 12px; border: 1px dashed var(--border); color: var(--text-dim); }
.pv-mailhead th { text-align: right; color: var(--text-dim); font-weight: normal; padding-right: 10px; vertical-align: top; }
.pv-attach { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.pv-text { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 8px 12px; font: 12px Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.pv-k { color: #9cdcfe; } .pv-s { color: #ce9178; } .pv-n { color: #b5cea8; } .pv-w { color: #569cd6; } .pv-c { color: #6a9955; }
.lp-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.doc-tag.suggested { border-style: dashed; } .doc-tag.accepted { background: var(--accent-2); color: #fff; } .doc-tag.rejected { text-decoration: line-through; opacity: .6; }
.doc-tag button { padding: 0 4px; margin-left: 2px; }
.pv-pages { flex: 1; min-height: 0; display: flex; }
.pv-strip { flex: none; width: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-right: 1px solid var(--border); background: var(--panel-2); }
.pv-thumb { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; background: transparent; border: 2px solid transparent; }
.pv-thumb.on { border-color: var(--accent); }
.pv-thumb img { max-width: 200px; max-height: 200px; background: #fff; border: 1px solid var(--border); }
.pv-thumb span { font-size: 11px; color: var(--text-dim); }

/* ---------------- detect-trace mode (docs/Detect-Trace-Mode-Plan.md), experimental: finger-sized buttons ---------------- */
.dt-pane { height: 100%; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; background: var(--panel); }
.dt-head { display: flex; align-items: center; gap: 8px; }
.dt-badge { background: #ff9800; color: #000; font-weight: 700; font-size: 10px; padding: 1px 6px; border-radius: 3px; letter-spacing: .5px; }
.dt-stage { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.dt-error { color: #ff8a80; }
.dt-note { opacity: .85; line-height: 1.4; }
.dt-hint { opacity: .6; font-weight: normal; }
.dt-section { margin-top: 6px; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 2px; }
/* Join's tree (user 2026-11-18): lines big enough to tap and drag; the moving line and the unsure ones marked */
.jt-tree { display: flex; flex-direction: column; gap: 1px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 4px; padding: 2px 0; }
.jt-row { display: flex; align-items: center; gap: 8px; min-height: 30px; padding-right: 8px; cursor: grab; user-select: none; }
.jt-row:hover { background: #ffffff10; }
.jt-row .jt-tag { white-space: nowrap; }
.jt-system { font-weight: 600; cursor: default; }
.jt-unsure .jt-tag { color: #ffd43b; }
.jt-moving { background: #1f3a5c; outline: 1px solid #4da3ff; }
.jt-here { margin-left: auto; min-height: 24px; padding: 0 8px; }
.jt-notsure { margin-top: 4px; border-top: 1px dashed var(--border); opacity: .9; cursor: default; }
.dt-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dt-end { justify-content: flex-end; }
.dt-btn { min-height: 32px; min-width: 44px; padding: 0 10px; background: transparent; border: 1px solid var(--border); color: inherit; border-radius: 4px; cursor: pointer; font-size: 12px; }
.dt-btn:hover:not(:disabled) { background: var(--hover); }
.dt-btn:disabled { opacity: .4; cursor: default; }
.dt-btn.dt-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.dt-btn.dt-main { border-color: var(--accent); font-weight: 600; }
.dt-check { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.dt-check input { width: 18px; height: 18px; }
.dt-det { display: flex; align-items: center; gap: 6px; padding: 3px; border: 1px solid var(--border); border-radius: 4px; cursor: grab; }
.dt-det.dt-off { opacity: .55; }
.dt-switch { min-width: 48px; min-height: 32px; border-radius: 16px; border: 1px solid var(--border); background: transparent; color: inherit; cursor: pointer; font-weight: 700; font-size: 11px; }
.dt-switch.dt-on { background: #43a047; border-color: #43a047; color: #fff; }
.dt-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dt-dotbtn { width: 18px; height: 18px; border: 2px solid #fff; box-shadow: 0 0 0 1px #9e9e9e; padding: 0; cursor: pointer; }
.dt-swatches { flex-wrap: wrap; gap: 6px; padding: 4px 0 4px 28px; }
.dt-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #9e9e9e; padding: 0; cursor: pointer; }
.dt-swatch.dt-on { box-shadow: 0 0 0 3px #212121; }
.dt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-counts { opacity: .7; font-variant-numeric: tabular-nums; }
.dt-select, .dt-input { background: var(--bg, #1e1e1e); color: inherit; border: 1px solid var(--border); border-radius: 3px; min-height: 28px; font-size: 12px; }
.dt-num { width: 70px; }
.dt-page { opacity: .8; font-style: italic; }
.dt-swatch { display: inline-block; width: 28px; }
.dt-log { opacity: .8; font-size: 11px; }
.dt-log div { white-space: pre-wrap; }
.dt-why-back { position: fixed; inset: 0; z-index: 900; }
.dt-why { position: fixed; z-index: 901; background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 6px 24px #000c; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.dt-why-title { font-weight: 600; padding: 2px 4px; }
.dt-modal-back { position: fixed; inset: 0; z-index: 950; background: #0008; }
.dt-modal { position: fixed; z-index: 951; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(900px, 96vw); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--accent); padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; }
.dt-modal-title { font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.dt-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dt-view { display: flex; flex-direction: column; gap: 6px; }
.dt-view-title { font-weight: 600; }
.dt-svg { width: 100%; aspect-ratio: 1; background: #fff; border: 1px solid var(--border); }
.dt-hit { cursor: pointer; }
.dt-form { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.dt-form label { display: flex; gap: 6px; align-items: center; }

/* the Library pane as a drop target (files dragged in from the desktop) */
.lp.lp-drop { outline: 2px dashed var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lp .lp-drop-row { background: var(--accent) !important; color: #fff; }
/* files dragged over the window, outside the Library (docs/Drop-Upload-Plan.md 3.3): where they will go, or why not; never takes the pointer */
.drop-overlay { position: fixed; inset: 0; z-index: 9000; pointer-events: none; outline: 3px dashed var(--accent); outline-offset: -6px;
    background: color-mix(in srgb, var(--accent) 6%, transparent); display: flex; align-items: center; justify-content: center; }
.drop-overlay[hidden] { display: none; }
.drop-overlay-text:empty { display: none; }
.drop-overlay-text { background: var(--panel); color: var(--text); border: 1px solid var(--accent); border-radius: 6px; padding: 10px 18px; font-size: 15px; }
.dt-pickbar { position: fixed; z-index: 951; left: 50%; top: 56px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 6px 24px #000c; padding: 6px 10px; display: flex; gap: 10px; align-items: center; font-size: 12px; }
.dt-views.dt-one { grid-template-columns: minmax(0, 280px); }
.dt-add { border: 1px solid var(--accent); border-radius: 4px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.dt-add-title { font-weight: 600; }
.dt-add .dt-views { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dt-add .dt-views.dt-one { grid-template-columns: minmax(0, 140px); }
.dt-add .dt-form { flex-direction: column; align-items: stretch; gap: 4px; }
.dt-add .dt-form details { display: flex; flex-direction: column; gap: 4px; }
.dt-pickhint { background: var(--accent); color: #fff; padding: 4px 8px; border-radius: 3px; font-weight: 600; }
.dt-thumb { width: 28px; height: 28px; flex: none; background: #fff; border: 1px solid var(--border); border-radius: 2px; }
.dt-det.dt-sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dt-blocks { gap: 6px; }
.dt-blockpick { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; min-width: 76px; background: transparent; border: 1px solid var(--border); border-radius: 4px; color: inherit; cursor: pointer; font-size: 11px; }
.dt-blockpick.dt-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.dt-thumb.dt-thumb-big { width: 56px; height: 56px; }
.dt-editable { cursor: zoom-in; }
.dt-editable:hover .dt-svg { outline: 2px solid var(--accent); }
.dt-editor { position: fixed; z-index: 952; left: 8px; top: 8px; visibility: hidden; width: min(520px, 94vw); height: min(600px, 92vh); background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 8px 32px #000d; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.dt-editsvg { flex: 1; width: 100%; min-height: 0; background: #fff; border: 1px solid var(--border); cursor: crosshair; touch-action: none; }
.dt-selbox { position: fixed; z-index: 2000; pointer-events: none; border: 1px solid #1e88e5; background: rgba(30,136,229,0.12); }
.dt-selbox.dt-crossing { border: 1px dashed #43a047; background: rgba(67,160,71,0.12); }
.dt-selbox.dt-removing { border-color: #e53935; background: rgba(229,57,53,0.12); }
.dt-selbox.dt-resetting { border-color: #fb8c00; background: rgba(251,140,0,0.12); }
.dt-btn.dt-danger { border-color: #e53935; color: #ff8a80; }
.dt-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 11px; }
.dt-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dt-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.dt-legend i.dt-cross { width: 10px; height: 10px; background: linear-gradient(45deg, transparent 40%, #ff9800 40%, #ff9800 60%, transparent 60%), linear-gradient(-45deg, transparent 40%, #ff9800 40%, #ff9800 60%, transparent 60%); }
.dt-sure { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
.dt-group { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 3px 4px; border: 1px solid var(--border); border-radius: 3px; cursor: zoom-in; }
.dt-group:hover { border-color: var(--accent); }
.dt-group.dt-nosource { border-style: dashed; }
.dt-sug { display: flex; align-items: center; gap: 8px; padding: 3px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.dt-sug:hover { border-color: var(--accent); }
.dt-sug.dt-sel { border-color: #e040fb; background: color-mix(in srgb, #e040fb 12%, transparent); }
.dt-sug-stats { font-size: 11px; line-height: 1.35; }
.dt-btn.dt-small { min-height: 22px; min-width: 26px; padding: 0 6px; margin-left: 6px; }

/* Detect v0.2 (docs/Air-Map-Plan.md section 7): the tools palette, the detector rows with their threshold sliders */
.tr-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 2px 0 6px; }
.tr-tool { display: flex; align-items: center; gap: 6px; text-align: left; padding: 5px 6px; }
.tr-icon { width: 26px; height: 26px; flex: none; background: #fff; border-radius: 3px; }
.tr-det { display: grid; grid-template-columns: 12px 1fr auto auto auto; gap: 4px; align-items: center; margin: 4px 0; }
.tr-slider { grid-column: 2 / -1; display: flex; align-items: center; gap: 6px; }
.tr-slider input[type=range] { flex: 1; }

/* Detect v0.21 (docs/Detect-V021-Plan.md section 3): the block picker, the detector rows with on/off, the open detector's definition */
.dt-picker { border: 1px solid var(--accent); border-radius: 4px; padding: 6px; display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.dt-picker .dt-input { flex: 1; min-height: 32px; }
.dt-group { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; text-align: left; background: transparent; border: none; border-bottom: 1px solid var(--border); color: inherit; font-weight: 600; cursor: pointer; padding: 0 4px; }
.dt-blockrow { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; width: 100%; min-height: 40px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 4px; color: inherit; cursor: pointer; padding: 2px 6px; }
.dt-blockrow:hover { border-color: var(--accent); background: var(--hover); }
.dt-recent { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dt-recent .dt-blockrow { width: auto; grid-template-columns: 28px auto; }
.dt-detrow { grid-template-columns: auto 12px 28px 1fr auto auto auto; }
.dt-detrow.dt-off { opacity: .55; }
.dt-detrow.dt-open { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 4px; }
.dt-detrow .dt-switch { min-width: 36px; }
.dt-detrow .tr-slider { grid-column: 4 / -1; }
.dt-detname { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; }
.dt-changed { color: #ffb74d; font-weight: 600; }
.dt-prompt { border: 1px solid #ffb74d; border-radius: 4px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }

/* the Learning panel of the detect and trace windows */
.learn-panel { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 4px; }
.learn-table { border-collapse: collapse; font-size: 11px; }
.learn-table th, .learn-table td { padding: 2px 6px; text-align: left; }

/* the drawing map in the Site pane (Site-Drawing-Map-Plan section 3) */
.fac-tnode.map { color: #9cdcfe; }
.map-pane { display: grid; gap: 6px; padding: 6px 8px; }
.map-review td { vertical-align: top; }
.map-review .warn, .map-pane .warn { color: #e5c07b; }
.map-actions button { margin: 0 2px 2px 0; }
.map-edit td { background: var(--hover); }
.map-edit-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.map-thumb { position: relative; width: 360px; }
.map-thumb img { display: block; width: 360px; height: auto; }
.map-thumb-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-thumb-svg line { stroke-width: 6; vector-effect: non-scaling-stroke; }
.map-thumb-svg line.ok { stroke: #4fc1ff; stroke-width: 1.5px; }
.map-thumb-svg line.row { stroke: #c586c0; stroke-width: 1.5px; stroke-dasharray: 4 3; }
.map-thumb-svg line.q { stroke: #e5c07b; stroke-width: 2px; }
.map-thumb-svg text { fill: #4fc1ff; font-size: 40px; font-weight: bold; }
.map-edit-fields { display: grid; gap: 4px; align-content: start; }
.map-lines input.n { width: 44px; margin: 1px; }
.map-plan { background: #1b1b1b; border: 1px solid var(--border-soft); }
.map-plan .grid { stroke: #4fc1ff; stroke-width: 0.6; stroke-dasharray: 6 4; fill: none; }
.map-plan .outline { stroke: #e0e0e0; stroke-width: 2; fill: rgba(255, 255, 255, 0.05); }
.map-plan .opening { stroke: #e0e0e0; stroke-width: 1; fill: #1b1b1b; }
.map-plan .found { stroke: #98c379; stroke-width: 2; stroke-dasharray: 8 4; fill: none; }
.map-plan .tile { stroke-width: 1; fill-opacity: 0.04; }
.map-plan .grid.guess { stroke: #4fc1ff; stroke-opacity: 0.45; stroke-dasharray: 2 4; }
.map-plan .ghost { stroke: #e5c07b; stroke-width: 1.5; stroke-dasharray: 6 4; fill: none; }
.map-plan .underlay { opacity: 0.6; filter: invert(1) hue-rotate(180deg); }
.map-plan .underlay.guess { opacity: 0.35; }
.map-plan .lbl { fill: #d4d4d4; font-size: 11px; pointer-events: none; }
.map-plan .ghost-lbl { fill: #e5c07b; font-style: italic; }
.fac-table tr.map-guess td { color: #e5c07b; }
.map-plan .tile.g0 { stroke: #61afef; fill: #61afef; } .map-plan .tile.g1 { stroke: #e06c75; fill: #e06c75; }
.map-plan .tile.g2 { stroke: #98c379; fill: #98c379; } .map-plan .tile.g3 { stroke: #e5c07b; fill: #e5c07b; }
.map-plan .tile.g4 { stroke: #c678dd; fill: #c678dd; } .map-plan .tile.g5 { stroke: #56b6c2; fill: #56b6c2; }
.map-pick { display: grid; grid-template-columns: 260px 1fr; gap: 8px; max-height: 60vh; }
.map-files, .map-pages { overflow: auto; border: 1px solid var(--border-soft); padding: 4px; }
.map-page { display: block; white-space: nowrap; }
.fac-tnode.lmap { padding-left: 46px; }
.fac-main.with-map .fac3d-host { height: 30vh; min-height: 220px; }
.map-top { flex-wrap: wrap; gap: 6px; }
.map-guide { font-size: 12px; white-space: nowrap; }

/* A page's own grid (Site-Drawing-Map-Plan 21.3, L8): PageGridEditor */
.modal.pg-modal { width: auto; max-width: 98vw; top: 3%; max-height: 94vh; overflow: auto; }
.pg-body { display: flex; gap: 10px; align-items: flex-start; }
.pg-view { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--border); flex: none; }
.pg-view svg { position: absolute; inset: 0; }
.pg-touch { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.pg-line { stroke: #0a84ff; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.pg-line.read { stroke: #1f9d55; }
.pg-line.sel { stroke: #ff6a00; stroke-width: 3px; }
.pg-rubber { stroke-dasharray: 6 4; }
.pg-lbl { fill: #c2185b; font-weight: 600; }
.pg-end, .pg-first { fill: #ff6a00; fill-opacity: .6; stroke: #fff; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.pg-side { width: 280px; display: grid; gap: 8px; }
.pg-card { display: grid; gap: 6px; border: 1px solid var(--border); padding: 8px; }
.pg-nudge { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pg-list tr { cursor: pointer; }
.pg-list tr.sel td { background: var(--sel, #264f78); }

/* Line up (Site-Drawing-Map-Plan 21.3, L1-L4): LineUpView */
.lu-view { background: #1e1e1e; }
.lu-ul image { opacity: .45; filter: invert(1) grayscale(1); }
.lu-pick image { opacity: .9; filter: invert(1) sepia(1) saturate(6) hue-rotate(290deg); }
.lu-grid { stroke: #4fc1ff; stroke-width: 1px; stroke-dasharray: 8 4; vector-effect: non-scaling-stroke; }
.lu-grid.locked { stroke: #e5c07b; }
.lu-lbl { fill: #4fc1ff; }
.lu-cross { fill: none; stroke: #ff6a00; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
tr.lu-ok td { color: #6ccf6c; }
tr.lu-near td { color: #e5c07b; }
tr.lu-off td { color: #f14c4c; }

/* Adjust grid (Site-Drawing-Map-Plan 21.3, L5, G1): AdjustGridView */
.modal.ag-modal { width: 1000px; }
.ag-table th.sort { cursor: pointer; user-select: none; }
.ag-choice { white-space: nowrap; }

/* The site view (Site-Drawing-Map-Plan section 22): SitePlanView; Adjust grid as a panel (F7) */
.fv { display: grid; gap: 6px; }
.fv-prev image { opacity: .3; }
.fv-prev-edge { fill: none; stroke: #e5c07b; stroke-width: 1.5px; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.ag-panel { display: grid; gap: 8px; }
.ag-svg { background: #1e1e1e; }
.ag-before { stroke: #888; stroke-width: 1px; stroke-dasharray: 5 4; fill: none; }
.ag-after { stroke: #ff8c1a; stroke-width: 2px; fill: none; }
.ag-txt { fill: #ff8c1a; font-size: 11px; }
.ag-lbl { fill: #9aa; font-size: 10px; }
.fv-body { flex-wrap: wrap; }
.fv .pane-toolbar { flex-wrap: wrap; }
/* Section 23 (H1): the site view in the top view's place while a level's Drawings is selected */
.fac3d-host.hidden { display: none; }
.fac-main .fv { border-bottom: 1px solid var(--border); padding: 4px; }
.fv-none { padding: 24px; min-height: 120px; }
/* Section 25: sets suggested from the classification; the starting floor */
.map-suggest { border: 1px solid var(--border); padding: 6px; margin: 6px 0; }
.map-start { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--border); margin: 6px 0; }
/* Section 26: a set's pages in the tree, checked for placement, status as a symbol */
.map-page-row { display: flex; align-items: center; gap: 4px; padding-left: 34px; white-space: nowrap; cursor: pointer; user-select: none; }
.map-page-row input { margin: 0; }
.map-sym { width: 14px; text-align: center; }
.map-sym.placed { color: #c586c0; } .map-sym.ok { color: #6ccf6c; } .map-sym.agrees { color: #4fc1ff; }
.map-sym.check { color: #e5c07b; } .map-sym.fail { color: #f14c4c; } .map-sym.wait { color: #888; }
.map-selbar { flex-wrap: wrap; }
.map-detail { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 6px; }
/* Section 28: a set's pages under floor headings in the tree */
.map-floor-row { display: flex; align-items: center; gap: 4px; padding-left: 18px; white-space: nowrap; cursor: pointer; user-select: none; }
.map-floor-row input { margin: 0; }
/* Section 29: the site tree reworked: one even step per depth, fold marks, names cut with … */
.ft .ft-row { display: flex; align-items: center; gap: 4px; padding: 2px 6px; cursor: pointer; white-space: nowrap; user-select: none; min-width: 0; }
.ft .ft-row:hover { background: var(--hover); }
.ft .ft-row.sel { background: var(--select); }
.ft .ft-row input { margin: 0; flex: none; }
.ft .ft-tw { width: 12px; flex: none; text-align: center; color: #888; }
.ft .ft-lb { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.ft .ft-ct { color: #888; font-size: 11px; flex: none; margin-left: 4px; }
.ft .ft-head .ft-lb { font-weight: 600; }
.ft .ft-row.map .ft-lb { color: #9cdcfe; }
.ft .ft-region .ft-lb { color: #b5cea8; }
.ft .ft-d0 { padding-left: 4px; } .ft .ft-d1 { padding-left: 18px; } .ft .ft-d2 { padding-left: 32px; }
.ft .ft-d3 { padding-left: 46px; } .ft .ft-d4 { padding-left: 60px; } .ft .ft-d5 { padding-left: 74px; }
/* Section 30: the drawing big (it fills the space, following the pane); everything else in one column on the right */
.fac-main.split { overflow: hidden; display: flex; flex-direction: column; }
.fac-main.split > .fac-split { flex: 1; min-height: 0; }
.fac-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100%; min-height: 0; }
.fac-split-view { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
/* the view cube on the placing plan (sitecube.js), top right as on the 3D view */
.fac-split-view canvas.cad-viewcube { position: absolute; top: 6px; right: 6px; z-index: 6; cursor: default; touch-action: none; }
.fac-split-view > .fv { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.fv-host { flex: 1; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
.fv-host > .pg-view { position: absolute; inset: 0; border: 0; }
.fac-split-side { overflow: auto; border-left: 1px solid var(--border); padding: 4px; min-width: 0; }
.fac-split-side .fv-side { width: auto; }
.fac-split-side .map-edit-grid { flex-wrap: wrap; }
/* Section 32: the drawing alone in the main area; the tree with the tools under it on the left; suggested sets in the tree */
.fac-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border-soft); }
.fac-left > .fac-tree { flex: 1 1 auto; min-height: 120px; border-right: 0; }
.fac-left.with-tools > .fac-tree { flex: 1 1 45%; }
.fac-left > .fac-tools { flex: 1 1 55%; overflow: auto; border-top: 1px solid var(--border); padding: 4px; min-height: 0; }
.fac-tools .pg-side, .fac-tools .fv-side { width: auto; }
.fac-main.split > .fac-split-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ft .ft-suggest .ft-lb { font-style: italic; }
.fac-side-below { padding: 4px; }
/* Section 33: drawings in the site view as the CAD pane draws them (the colour filter fv-cad; its background) */
.fv .lu-view { background: #212830; }
.fv-sel-edge { fill: none; stroke: #ff00ff; stroke-width: 2px; stroke-dasharray: 8 4; vector-effect: non-scaling-stroke; }
.ft .ft-btn { margin-left: auto; padding: 0 6px; font-size: 11px; line-height: 16px; }
/* Section 37: the Site pane's own drag handles, and nothing in it reaching over the window's resize handles */
.fac-pane { overflow: hidden; }
.fac-split-x { cursor: col-resize; background: var(--border-soft); }
.fac-split-x:hover { background: var(--accent); }
.fac-split-y { flex: none; height: 5px; cursor: row-resize; background: var(--border-soft); }
.fac-split-y:hover { background: var(--accent); }
.fac-split-y.off { display: none; }
.fac-left.with-tools > .fac-tree { flex: 0 0 var(--fac-tree, 45%); }
.fv-host > .pg-view { width: 100% !important; height: 100% !important; }
.fv-host { contain: strict; }
/* Section 38: the drawing list on the left (search and filter bar, boxes); the checked drawings in a pane under the drawing */
.fac-left > .fac-tree { flex: 0 0 var(--fac-tree, 35%); }
.fac-left > .fac-drawings { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dl { display: flex; flex-direction: column; min-height: 0; flex: 1; font-size: 12px; }
.dl-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-bottom: 1px solid var(--border-soft); }
.dl-bar .dl-search { flex: 1 1 100%; }
.dl-bar select { flex: 1 1 40%; min-width: 0; }
.dl-count { padding: 2px 6px; }
.dl-tabi { padding: 3px 6px; border-bottom: 1px solid var(--border-soft); }   /* Tabi asks for a first drawing (none placed yet) */
.dl-list { flex: 1; min-height: 0; overflow: auto; }
.dl-row { display: flex; align-items: center; gap: 4px; padding: 2px 6px; white-space: nowrap; cursor: pointer; }
.dl-row:hover { background: var(--hover); }
.dl-row.on { background: rgba(14, 99, 156, .25); }
/* the drawing selected in the site view: the view's selection colour (.fv-sel-edge), section 46 */
.dl-row.sel { background: rgba(255, 0, 255, .22); box-shadow: inset 3px 0 #ff00ff; }
.fv-side .pg-list tr.sel td { background: rgba(255, 0, 255, .22); }
.fv-side .pg-list tr.sel td:first-child { box-shadow: inset 3px 0 #ff00ff; }
.dl-row input { margin: 0; flex: none; }
.dl-placed { width: 10px; flex: none; color: #6ccf6c; }
/* the hint on the floor to place now (user 2026-11-15: "bigger bolder and flashing", "slower flash", then "the hint mark should be tabi
   green. maybe flashing hint arrow"): a Tabi-green arrow pointing at the drawing, flashing and nudging towards it */
.dl-start { width: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center; animation: dl-hint-flash 1.8s ease-in-out infinite; }
.dl-start:empty { animation: none; }
.dl-start-inline { width: 16px; vertical-align: middle; }
.dl-hint-arrow { width: 15px; height: 15px; fill: var(--busy-green); filter: drop-shadow(0 0 1px var(--busy-glow)); }
@keyframes dl-hint-flash { 0%, 100% { opacity: 0.75; transform: translateX(-1px); } 50% { opacity: 0.15; transform: translateX(3px); } }
.tab-hint { width: 16px; margin-right: 3px; }   /* Tabi's hint arrow on a document tab (the Site tab after classifying) */
@media (prefers-reduced-motion: reduce) { .dl-start { animation: none; } }
.dl-sym { width: 12px; flex: none; text-align: center; color: #888; }
.dl-lb { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.dl-lv { color: #888; font-size: 11px; flex: none; margin-left: auto; padding-left: 4px; }
.fac-main.split > .fac-split-view { flex: 0 0 var(--fac-view, 65%); }
.fac-main.split > .fac-split-y2 { flex: none; height: 5px; cursor: row-resize; background: var(--border-soft); }
.fac-main.split > .fac-split-y2:hover { background: var(--accent); }
.fac-main.split > .fac-under { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 2px 4px; display: flex; flex-direction: column; gap: 2px; }
.fac-under > * { flex: none; min-width: 0; }
/* the limited height under the drawing used for the lines (section 49): no padding or gaps to spare */
.fac-under .fv-side { width: auto; gap: 2px; }
.fac-under .map-pane { padding: 0; gap: 2px; }
.fac-under .pg-card { padding: 4px 6px; }
.fac-under .fac-table th { padding: 1px 4px; }
.map-status { flex-wrap: wrap; gap: 6px; min-height: 0; padding: 1px 0; }
.map-reading { color: #e5c07b; }

/* the site view's lines under the drawing, one per page (section 48) */
.fv-lines td { padding: 2px 2px; white-space: nowrap; vertical-align: middle; }
.fv-lines select { max-width: 112px; }
.fv-lines button { padding: 1px 5px; }
.fv-lines .fv-turn input { width: 48px; }
.fv-lines .fv-gridsrc { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; white-space: nowrap; }
.fv-lines .fv-gridsrc input { width: auto; margin: 0; }
.fv-lines .fv-floor { color: #9cdcfe; margin-left: 4px; }
.fv-lines .fv-st { width: 28px; text-align: center; }
.fv-crop { fill: rgba(255, 170, 0, .06); stroke: #ffaa00; stroke-width: 2px; stroke-dasharray: 6 3; vector-effect: non-scaling-stroke; }
.fv-outline { fill: none; stroke: #4ec9b0; stroke-width: 1.5px; stroke-opacity: .6; vector-effect: non-scaling-stroke; }
.fv-outline.preview { stroke-dasharray: 10 5; stroke-opacity: .9; }
.fv-lines .fv-lname { width: 130px; }
.fv-lines .fv-lz { width: 64px; }
.fv-lines tr.fv-level td { background: rgba(197, 134, 192, .08); }
.fv-group td { background: rgba(255, 255, 255, .06); cursor: pointer; padding: 3px 4px; }
.fv-subgroup td { cursor: pointer; padding: 2px 4px 2px 14px; color: #9cdcfe; }
.fv-outline.edit { fill: rgba(78, 201, 176, .08); stroke-opacity: 1; stroke-width: 2px; }
.fv-handle { fill: #1e1e1e; stroke: #ffffff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.fv-handle.sel { fill: #ff00ff; }
.fv-warn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #e5c07b; padding: 2px 4px; }
.fv-lines tr.fv-pending td { color: var(--fg-dim, #9da5b4); }

/* the site tree in the left dock (section 66) */
.ft-dock { height: 100%; overflow: auto; }
.ft-dock .fac-tree { border-right: 0; height: 100%; }
.fac-left > .fac-drawings { flex: 1 1 auto; min-height: 0; }

/* the tree and the drawing list in the left dock's Site tab; the Site tab is the view alone (section 69) */
.fac-body { grid-template-columns: minmax(0, 1fr); }
.ft-dock { display: flex; flex-direction: column; min-height: 0; }
.ft-dock > .fac-tree { flex: 0 1 auto; max-height: 40%; overflow: auto; border-bottom: 1px solid var(--border); }
.ft-dock > .fac-drawings { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* the Site tab's Show ▾ menu (the site tree's parts, 2026-11-14) */
.fac-show { position: relative; display: inline-block; }
.fac-show-menu { position: absolute; top: 100%; left: 0; z-index: 30; display: flex; flex-direction: column; min-width: 200px; padding: 4px;
    background: #252526; border: 1px solid #3c3c3c; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.fac-show-menu button { text-align: left; white-space: nowrap; }
.fac-show-menu button.sub { padding-left: 18px; }
.fac-show-menu .dim { margin-left: 6px; }
.fac-show-menu > span.dim { padding: 4px 6px; }
.fac-focusbar .chip.sel { outline: 1px solid #ffd54a; }

/* The busy sign (BusyMark.razor, user 2026-11-15): an hourglass in NVIDIA green; the sand runs down, then it turns over. */
:root { --busy-green: #76b900; --busy-glow: rgba(118, 185, 0, 0.65); --busy-turn: 2.4s; }
.busy-mark { display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 15px; margin: 0 4px 0 2px; vertical-align: -2px;
    filter: drop-shadow(0 0 2px var(--busy-glow)); cursor: help; flex: none; }
.busy-mark svg { width: 100%; height: 100%; overflow: visible; }
.busy-mark .busy-frame { fill: none; stroke: var(--busy-green); stroke-width: 1.3; stroke-linecap: round; }
.busy-mark .busy-sand-top, .busy-mark .busy-sand-bottom { fill: var(--busy-green); transform-box: fill-box; transform-origin: 50% 100%; }
.busy-mark .busy-glass { transform-box: view-box; transform-origin: 6px 8px; animation: busy-turn var(--busy-turn) ease-in-out infinite; }
.busy-mark .busy-sand-top { animation: busy-drain var(--busy-turn) linear infinite; }
.busy-mark .busy-sand-bottom { animation: busy-fill var(--busy-turn) linear infinite; }
@keyframes busy-turn { 0%, 78% { transform: rotate(0deg); } 100% { transform: rotate(180deg); } }
@keyframes busy-drain { 0% { transform: scaleY(1); } 75%, 100% { transform: scaleY(0); } }
@keyframes busy-fill { 0% { transform: scaleY(0); } 75%, 100% { transform: scaleY(1); } }
@keyframes busy-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* Reduced motion (Windows animations off, often over Remote Desktop): no turning, a soft pulse so it still says "working". */
@media (prefers-reduced-motion: reduce) {
    .busy-mark .busy-glass, .busy-mark .busy-sand-top, .busy-mark .busy-sand-bottom { animation: none; }
    .busy-mark .busy-sand-bottom { transform: scaleY(0.45); }
    .busy-mark { animation: busy-pulse var(--busy-turn) ease-in-out infinite; }
}

/* the Viewer shows a document's preview over its pages (user 2026-11-15: no Preview tab) */
.rtab-host { position: relative; height: 100%; width: 100%; }
.rtab-preview { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.rtab-preview > .pv { flex: 1; min-height: 0; }
.rtab-back { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.08); }

/* the Site tab with no building yet (user 2026-11-15) */
.fac-nobuilding { display: block; line-height: 1.7; }
.fac-nobuilding ol { margin: 4px 0 6px; padding-left: 22px; }

/* list rows with buttons sized for touch (the admin API keys in the AI settings; AdminApiKeysEditor.razor) */
.syslog { padding: 4px 8px; border-top: 1px solid var(--border-soft); flex: none; }
.syslog-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0 4px 12px; align-items: flex-start; }
.syslog-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.syslog-name { min-width: 220px; }
.syslog button.small { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.usage-span { display: flex; gap: 6px; margin-bottom: 8px; } .usage-span button.sel { font-weight: 600; } .usage-table { border-collapse: collapse; width: 100%; margin-bottom: 8px; } .usage-table th, .usage-table td { padding: 2px 8px; text-align: left; } .usage-table .num { text-align: right; } .usage-table tr.total td { border-top: 1px solid #555; font-weight: 600; } .usage-limit { margin-top: 8px; }

/* Tag map (docs/Tag-Map-Plan.md section 3): its counts step through the drawing; the Why? and type boxes sit in the window */
.tm-top .gear { order: -1; }
.tm-counts { font-size: 12px; gap: 4px; }
.tm-count { background: none; border: none; padding: 2px 0; color: var(--accent); cursor: pointer; text-decoration: underline dotted; min-height: 28px; }
.tm-why { border: 1px solid var(--accent); border-radius: 4px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.tm-status { width: 18px; text-align: center; font-weight: 700; flex: none; }
.tm-sure { color: #69db7c; }
.tm-guessed { color: #ffd43b; }
.tm-countoff { color: #ff922b; }
.tm-nodiffuser { color: #ff8a80; }
.tm-wide { width: 220px; }
.tm-fix { padding-left: 24px; }
.chat .confirm .primary.danger { background: #c93c37; border-color: #c93c37; }   /* the red card: Tabi deletes only after Delete (Tabi-Access-Plan T2) */

/* Tabi's marks in the page viewer (Tabi-Access-Plan A20): the hint-mark standard, a slow-flashing Tabi-green arrow with its number and note */
.pvw-page .tabi-page-mark { position: absolute; transform: translate(-100%, -50%); display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border: 2px solid var(--busy-green); border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; cursor: pointer; z-index: 3; white-space: nowrap; }
.pvw-page .tabi-page-mark .tabi-page-arrow { color: var(--busy-green); animation: dl-hint-flash 1.8s ease-in-out infinite; }
/* the chat's attachments (My view, Window, Selection) and the findings list */
.chat-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 6px 0; }
.tabi-finding { border-left: 3px solid var(--border-soft); padding: 4px 6px; margin: 4px 0; } .tabi-finding.confirmed { border-left-color: var(--busy-green); } .tabi-finding.wrong { opacity: .6; text-decoration: line-through; }
/* Chat mode (docs/Claude-Upgrades-Plan.md part B): the "Claude is working" bar under the menu, and the Tabi pane's connect steps instead of the chat */
.claude-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 3px 8px; border-bottom: 1px solid var(--border-soft); border-left: 3px solid var(--busy-green); background: var(--panel); }
.claude-bar.claude-card { border-left-color: #e0a000; } .claude-bar.claude-undo { border-left-color: var(--border-soft); font-size: 12px; }
.chat:has(.chat-mode-panel) > :is(.chat-log, .chat-input, .chat-attach, .msg) { display: none; }
.chat-mode-panel { padding: 8px; display: grid; gap: 8px; overflow: auto; } .chat-mode-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ai-field input.num { width: 7em; }

/* ---- the View Manager (docs/Cad-View-Manager-Plan.md): the focus chip, its drop-down, the pane's grid, the legend ---- */
.vm-chip { position: relative; display: inline-flex; gap: 2px; align-items: center; }
.vm-chip-main { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-toolbar:has(.vm-drop) { z-index: 50; }   /* the open drop-down over the drawing (its view cube is z-index 3) */
.vm-drop { position: absolute; top: 100%; right: 0; z-index: 60; width: 460px; max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px;
    background: var(--panel, #252526); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.vm-pane { display: flex; flex-direction: column; gap: 6px; padding: 6px; height: 100%; overflow: auto; font-size: 12px; }
.vm-grid { display: flex; flex-direction: column; }
.vm-group { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 600; border-bottom: 1px solid var(--border); padding: 2px 0; cursor: pointer; min-height: 30px; }
.vm-row { display: flex; align-items: center; gap: 4px; min-height: 34px; }
.vm-row .vm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-look { min-width: 34px; min-height: 30px; padding: 0 4px; background: transparent; border: 1px solid var(--border); color: inherit; border-radius: 4px; cursor: pointer; font-size: 11px; }
.vm-look.dt-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vm-look.vm-auto { opacity: .55; }
.vm-colour { width: 30px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: transparent; cursor: pointer; }
.vm-colour:disabled { cursor: default; }
.vm-count { min-width: 44px; min-height: 30px; text-align: right; font-variant-numeric: tabular-nums; background: transparent; border: none; color: inherit; cursor: pointer; opacity: .8; }
.vm-count:hover:not(:disabled) { text-decoration: underline; }
.vm-legend { position: absolute; right: 12px; bottom: 12px; z-index: 5; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 11px;
    background: rgba(20, 24, 28, .85); border: 1px solid var(--border); border-radius: 4px; pointer-events: none; max-height: 40%; overflow: hidden; }
.vm-legend div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
