/*
  The Windows editor's look (Themes/Light.xaml and Dark.xaml), as CSS. The theme is set on <html data-theme>.
  WPF colours are #AARRGGBB; CSS wants #RRGGBBAA, so the see-through ones are turned round here.
*/
:root {
    /* One set of sizes for the whole app: text 10 / 11 / 12 / 13 / 14 px, corners small / medium / large. */
    --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px;
}

:root, [data-theme=light] {
    --window: #EEF0F4;
    --panel: #FFFFFF;
    --panel-alt: #F2F4F7;
    --header-band: #E3E7EF;
    --stroke: #D5DAE3;
    --text: #1D212F;
    --muted: #5F6677;
    --section-label: #8A90A0;
    --accent: #6E7D0E;
    --accent-hover: #5C690A;
    --on-accent: #FFFFFF;
    --accent-soft: #EEF3CF;
    --active-nav: #E4EBB8;
    --error: #C62828;
    --warning: #9A7B00;
    --success: #2E7D32;

    --canvas: #E6E9EF;
    --sheet: #FFFFFF;
    --ink: #1D212F;
    --faint-ink: #A3AAB7;
    --frame: #C3C9D3;
    --selection: #8A9C12;
    --front-gear: #3B82C466;
    --rear-gear: #D08A3C66;
    --strip: #7A8796;
    --rack-void: #C9CED7;
    --rail: linear-gradient(to right, #A9B0BA 0%, #E3E7EC 45%, #9CA3AE 100%);
    --rail-hole: #4A505B;
    --post: linear-gradient(to right, #596071 0%, #7C8496 50%, #596071 100%);
    --cap: linear-gradient(to bottom, #7C8496, #596071);
    --foot: #2E333D;
    --faceplate: linear-gradient(to bottom, #FBFCFD 0%, #EDEFF3 50%, #DFE3E9 100%);
    --faceplate-edge: #8E96A4;
    --screw: radial-gradient(circle at 35% 30%, #FFFFFF, #8C93A0);

    /* Plan drawing layers, matching the AutoCAD colours where they read on a light sheet. */
    --l-frame: #1d2330;
    --l-rail: #8a8f98;
    --l-units: #a0a6b0;
    --l-equip: #0e7490;
    --l-hidden: #9aa1ab;
    --l-text: #9a6700;
    --l-label: #15803d;
    --l-door: #a21caf;
    --l-dim: #dc2626;

    /* The on-screen plan view. */
    --plan-floor: #F6F7F9;
    --plan-grid: #EBEDF1;
    --plan-grid-major: #D9DDE4;
    --plan-room: #8C93A3;
    --plan-room-detail: #B4BAC6;
    --plan-room-wall: #4A5160;
    --plan-rack: #FFFFFF;
    --plan-rack-hover: #F3F6E6;
    --plan-rack-edge: #4A5163;
    --plan-post: #2E3442;
    --plan-rail: #A3AAB7;
    --plan-front: #2E3442;
    --plan-tla: #3D6FA8;
    --plan-door: #3D6FA8;
    --plan-door-fill: #3D6FA81A;
    --plan-dim: #7A8193;

    color-scheme: light;
}

[data-theme=dark] {
    --window: #13161E;
    --panel: #1D212F;
    --panel-alt: #282D3E;
    --header-band: #323954;
    --stroke: #373D51;
    --text: #E5E8EF;
    --muted: #868C9D;
    --section-label: #636979;
    --accent: #C4D43B;
    --accent-hover: #D4E255;
    --on-accent: #13161E;
    --accent-soft: #3C4323;
    --active-nav: #3C4323;
    --error: #FF6B6B;
    --warning: #E0C341;
    --success: #7FC97A;

    /* A mid slate, not near-black, so dark equipment (monitors, desk models, black faceplates) stands out from it. */
    --canvas: #2E3442;
    --sheet: #1D212F;
    --ink: #E5E8EF;
    --faint-ink: #4D5468;
    --frame: #3A4052;
    --selection: #C4D43B;
    --front-gear: #4A6FA566;
    --rear-gear: #A5673B66;
    --strip: #8C96A3;
    --rack-void: #0E1016;
    --rail: linear-gradient(to right, #5A606C 0%, #8E95A2 45%, #4C525D 100%);
    --rail-hole: #0B0D12;
    --post: linear-gradient(to right, #232837 0%, #3A4154 50%, #232837 100%);
    --cap: linear-gradient(to bottom, #454C61, #2A3040);
    --foot: #0B0D12;
    --faceplate: linear-gradient(to bottom, #343A4C 0%, #262B3A 50%, #1F2331 100%);
    --faceplate-edge: #5C6479;
    --screw: radial-gradient(circle at 35% 30%, #D7DBE2, #7D8492);

    --l-frame: #e6e8eb;
    --l-rail: #8a8f98;
    --l-units: #5d6470;
    --l-equip: #22d3ee;
    --l-hidden: #6b7280;
    --l-text: #facc15;
    --l-label: #4ade80;
    --l-door: #e879f9;
    --l-dim: #f87171;

    --plan-floor: #161922;
    --plan-grid: #1D212C;
    --plan-grid-major: #272C3A;
    --plan-room: #6E7587;
    --plan-room-detail: #4C5263;
    --plan-room-wall: #A9AFBD;
    --plan-rack: #232836;
    --plan-rack-hover: #2A3021;
    --plan-rack-edge: #8C93A3;
    --plan-post: #A3AAB7;
    --plan-rail: #4D5468;
    --plan-front: #C9CED7;
    --plan-tla: #7FB2E8;
    --plan-door: #7FB2E8;
    --plan-door-fill: #7FB2E81F;
    --plan-dim: #8C93A3;

    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--window);
    color: var(--text);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    font-size: calc(12px * var(--ui-font, 1));
}

#app { height: 100%; }
.loading { padding: 24px; color: var(--muted); font-size: calc(14px * var(--ui-font, 1)); }
.muted { color: var(--muted); }
.small { font-size: calc(11px * var(--ui-font, 1)); }
.strong { font-weight: 600; margin-top: 8px; }
.spaced { margin-top: 8px; }
.pre { white-space: pre-line; }
.success { color: var(--success); }
.error-text { color: var(--error); margin-top: 6px; }

/* ===== Controls ===== */

button, .button {
    font: inherit;
    min-height: 26px;
    padding: 3px 10px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
button:hover:not(:disabled), .button:hover { background: var(--panel-alt); }
button:disabled { opacity: 0.45; cursor: default; }
.button.disabled { opacity: 0.45; pointer-events: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--accent-hover); }
button.link { border: none; background: none; color: var(--accent); padding: 0; min-height: 0; }
.button input[type=file] { display: none; }

input, select {
    font: inherit;
    width: 100%;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
input[type=range] { padding: 0; border: none; background: none; accent-color: var(--accent); min-height: 0; }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--accent); }

.segments {
    display: inline-flex;
    padding: 2px;
    gap: 2px;
    border-radius: var(--radius-md);
    background: var(--panel-alt);
    border: 1px solid var(--stroke);
    flex-wrap: wrap;
}
.segment { border: none; background: transparent; min-height: 22px; padding: 2px 9px; }
.segment.on, .segment.on:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.section-header { font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; color: var(--section-label); margin-bottom: 8px; letter-spacing: 0.02em; }
.tla-badge {
    display: inline-block;
    padding: 0 5px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: calc(11px * var(--ui-font, 1));
    font-weight: 600;
    margin-right: 6px;
}
.button-row { display: flex; flex-wrap: wrap; gap: 6px; }
.button-row.centred { justify-content: center; }

/* ===== Layout ===== */

.app { display: flex; flex-direction: column; height: 100%; }

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--panel);
    border-bottom: 2px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: calc(17px * var(--ui-font, 1)); font-weight: 300; letter-spacing: 0.02em; }
.brand .ink { fill: var(--text); }
.brand .accent { fill: var(--accent); }
.header-right { text-align: right; }
.header-title { font-size: calc(16px * var(--ui-font, 1)); font-weight: 600; }
.header-sub { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }

.command-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: var(--window);
    border-bottom: 1px solid var(--stroke);
}
.commands { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.commands.right { flex-wrap: nowrap; }
.tool { border-color: transparent; background: transparent; }
.tool:hover:not(:disabled) { background: var(--panel); border-color: var(--stroke); }
.tool.glyph { font-size: calc(15px * var(--ui-font, 1)); padding: 0 8px; }
.divider { width: 1px; height: 20px; background: var(--stroke); margin: 0 6px; }
.zoom { width: 140px; }
.zoom-readout { min-width: 40px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

.tabs {
    display: flex;
    gap: 2px;
    padding: 4px 8px 0;
    background: var(--window);
    border-bottom: 1px solid var(--stroke);
    overflow-x: auto;
}
.tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 6px 6px 12px;
    border-radius: var(--radius-sm) 4px 0 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.tab:hover { background: var(--panel-alt); }
.tab.selected { background: var(--active-nav); border-bottom-color: var(--accent); }
.tab-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.dirty { color: var(--accent); font-size: calc(9px * var(--ui-font, 1)); }
.tab-close { border: none; background: transparent; font-size: calc(10px * var(--ui-font, 1)); padding: 0 4px; min-height: 18px; margin-left: 4px; }

.workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr) 340px;
    gap: 10px;
    padding-right: 10px;
}
/* View menu: either side panel can be hidden, and the lineup takes the room. */
.workspace.no-library { grid-template-columns: minmax(0, 1fr) 340px; padding-left: 10px; }
.workspace.no-details { grid-template-columns: 290px minmax(0, 1fr); }
.workspace.no-library.no-details { grid-template-columns: minmax(0, 1fr); }

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px;
    background: var(--panel);
    border-top: 1px solid var(--stroke);
    color: var(--muted);
}
.status-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-status { white-space: nowrap; color: var(--text); }
.live-status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #2fa84f; vertical-align: middle; }
.busy { width: 80px; height: 4px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--accent-soft), var(--accent), var(--accent-soft)); background-size: 200% 100%; animation: busy 1.2s linear infinite; }
@keyframes busy { from { background-position: 200% 0; } to { background-position: 0 0; } }

/* ===== Library ===== */

.library {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 12px 12px;
    background: var(--panel);
    border-right: 1px solid var(--stroke);
}
.search { margin-bottom: 8px; }
.library-list { flex: 1; min-height: 0; overflow-y: auto; }
.library-group { font-weight: 600; color: var(--accent); margin: 12px 0 4px 4px; height: 28px; display: flex; align-items: flex-end; }
.library-item { height: 40px; padding: 3px 6px; border-radius: var(--radius-sm); cursor: grab; margin-bottom: 4px; overflow: hidden; }
.library-item:hover { background: var(--panel-alt); }
.library-item.selected { background: var(--active-nav); }
.library-name { display: flex; align-items: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-name > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.library-summary { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-foot { margin-top: 10px; flex: none; }
.library-foot p { margin: 0 0 10px; }

/* ===== Lineup, and the power strip detail beside it ===== */

.center { display: flex; gap: 10px; min-width: 0; min-height: 0; }
.center > .lineup { flex: 1; min-width: 0; }

.lineup {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 10px 0;
    background: var(--canvas);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.empty-state { margin: auto; text-align: center; padding: 24px; }
.empty-state h2 { font-size: calc(22px * var(--ui-font, 1)); font-weight: 600; margin: 0 0 6px; }
.empty-state > p { margin: 0 0 18px; }
.empty-state .small { margin-top: 14px; }

.header-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding: 7px 14px;
    background: var(--header-band);
    border-bottom: 1px solid var(--stroke);
}
.lineup-name { font-size: calc(14px * var(--ui-font, 1)); font-weight: 600; }
button.lineup-name.link { color: inherit; cursor: pointer; }
button.lineup-name.link:hover { color: var(--accent); text-decoration: underline; }
.pill { background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 2px 9px; border-radius: var(--radius-lg); }

.elevation-scroll, .plan-scroll { flex: 1; min-height: 0; overflow: auto; }
.elevation-scroll { padding: 18px; }
.elevation-content { width: max-content; margin: 0 auto; user-select: none; -webkit-user-select: none; }
/* The UI text size (View > Settings > Text size, --ui-font on <html>) scales menus, panels and dialogs, never the drawings:
   the elevations, sections and plan stay at drawing size and their text stays true to the zoom. */
.elevation-content, .plan-stage { --ui-font: 1; font-size: 12px; }
/* Hover text (js/tips.js): grows with the UI text size, as the browser's own tooltips can't. */
.rb-tip { position: fixed; z-index: 100000; display: none; pointer-events: none; max-width: calc(420px * var(--ui-font, 1));
    padding: calc(4px * var(--ui-font, 1)) calc(8px * var(--ui-font, 1)); background: var(--panel); color: var(--text);
    border: 1px solid var(--stroke); border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    font-size: calc(12px * var(--ui-font, 1)); line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.lineup-row { margin-bottom: 24px; }
.row-title { color: var(--muted); font-weight: 600; margin: 0 0 8px 4px; }
.row-racks { display: flex; align-items: flex-end; }

.plan-scroll { padding: 18px; background: var(--canvas); }
.plan-sheet { width: max-content; margin: 0 auto; user-select: none; -webkit-user-select: none; }
/* Room to scroll past the drawing, a window each way, so zooming about the pointer always keeps that point put (rackBuild.slack). */
.zoom-slack { width: max-content; padding: var(--slack-t, 0px) var(--slack-r, 0px) var(--slack-b, 0px) var(--slack-l, 0px); }
.zoom-slack > .elevation-content, .zoom-slack > .plan-sheet { margin: 0; }
.plan-sheet svg { display: block; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--stroke); }

/* ===== Plan view (on screen; the AutoCAD plan keeps its own linework) ===== */

.plan * { vector-effect: non-scaling-stroke; }
.plan text { font-family: inherit; text-anchor: middle; dominant-baseline: central; }
.plan-floor { fill: var(--plan-floor); }
.plan-grid { fill: none; stroke: var(--plan-grid); stroke-width: 1px; }
.plan-grid.major { stroke: var(--plan-grid-major); }

.plan-rack { cursor: pointer; }
.plan-desk-part { stroke: var(--plan-rack-edge); stroke-width: 1px; vector-effect: non-scaling-stroke; fill: none; }
.plan-desk-part.worktop { fill: #CDBF9F; fill-opacity: 0.55; }
.plan-desk-part.pod { fill: #4A5058; fill-opacity: 0.35; }
.plan-desk-part.pod-face { fill: #1B1E22; fill-opacity: 0.35; }
.plan-desk-part.end-panel { fill: #7A8088; }
.plan-desk-part.rear-top { fill: #3F444A; fill-opacity: 0.25; }
.plan-desk-part.detail { stroke-dasharray: 6 4; }
.plan-rack-body { fill: var(--plan-rack); stroke: var(--plan-rack-edge); stroke-width: 1.5px; }
.plan-rack:hover .plan-rack-body { fill: var(--plan-rack-hover); }
.plan-rack.active .plan-rack-body { fill: var(--accent-soft); stroke: var(--selection); stroke-width: 3px; }
.plan-post { fill: var(--plan-post); stroke: none; }
.plan-rail { stroke: var(--plan-rail); stroke-width: 2px; stroke-dasharray: 6 3; }
.plan-strip polygon { fill: var(--strip, #C0392B); fill-opacity: 0.25; stroke: var(--strip, #C0392B); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.plan-foundation { fill: none; stroke: var(--plan-rack-edge); stroke-width: 1px; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; opacity: 0.7; }
.plan-strip line { stroke: var(--strip, #C0392B); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.plan-front { stroke: var(--plan-front); stroke-width: 4px; stroke-linecap: square; }
.plan-front-marker { fill: var(--plan-front); stroke: none; }
.plan-rack.active .plan-front, .plan-rack.active .plan-front-marker { stroke: var(--selection); }
.plan-rack.active .plan-front-marker { fill: var(--selection); }

.plan-door-swing { fill: var(--plan-door-fill); stroke: none; }
.plan-door-arc { fill: none; stroke: var(--plan-door); stroke-width: 1px; stroke-dasharray: 5 4; }
.plan-door-leaf { stroke: var(--plan-door); stroke-width: 2.5px; stroke-linecap: round; }
.plan-door-letter { fill: var(--plan-door); font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }

.plan-label { fill: var(--text); }
.plan-desk-picture { pointer-events: none; }
.plan-stage { position: relative; }
.plan-stage > svg.plan { display: block; }
/* Monitor arms, over the desk gear and under the monitors on them. */
.plan-stage > svg.plan-arms { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.plan-desk-gear { cursor: grab; overflow: hidden; }
.plan-desk-gear:active { cursor: grabbing; }
.plan-desk-gear.moving { opacity: 0.35; }
.plan-rack-body.desk { fill: transparent; stroke-opacity: 0.6; }
.plan-rack:hover .plan-rack-body.desk { fill: var(--plan-rack-hover); fill-opacity: 0.25; }
.plan-rack.active .plan-rack-body.desk { fill: transparent; }
.plan-label.uid { font-weight: 700; }
.plan-label.tla { font-weight: 600; fill: var(--plan-tla); }
.plan-label.name { fill: var(--muted); font-weight: 500; }
.plan-label.total { fill: var(--muted); font-variant-numeric: tabular-nums; }
.plan-label-rule { stroke: var(--plan-rack-edge); stroke-width: 1px; opacity: 0.5; }

.plan-row-name { fill: var(--section-label); font-weight: 700; letter-spacing: 0.08em; text-anchor: end !important; }
.plan-dim line { stroke: var(--plan-dim); stroke-width: 1px; }
.plan-dim text { fill: var(--plan-dim); font-weight: 600; }
.plan-dim text.start { text-anchor: start; }
.plan-dim-back { fill: var(--plan-floor); }

/* The room from a deck plan, under the racks (RoomBar). Thin and grey so the racks stand out. */
.plan-room { pointer-events: none; }
.plan-room-line { fill: none; stroke: var(--plan-room); stroke-width: 0.75px; stroke-linejoin: round; }
.plan-room-line.detail { stroke: var(--plan-room-detail); stroke-width: 0.6px; }
.plan-room-line.outline { stroke-dasharray: 8 4; }
.plan-room-line.wall { stroke: var(--plan-room-wall); stroke-width: 2px; }
.plan text.plan-room-text { fill: var(--plan-room); text-anchor: start; dominant-baseline: alphabetic; }
.plan text.plan-room-text.name { fill: var(--plan-room-wall); font-weight: 700; letter-spacing: 0.04em; }
.room-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 18px; border-bottom: 1px solid var(--stroke); }
.room-bar .section-header { margin: 0; }
.room-bar select { width: auto; min-width: 180px; }
.room-field { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--ui-font, 1)); }
.room-field input { width: 90px; }

.view3d { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.view3d-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 6px 10px;
    background: var(--panel);
    border-bottom: 1px solid var(--stroke);
}
.view3d-bar .check { margin-top: 0; }
.command-bar .check { margin-top: 0; white-space: nowrap; }
.view3d-sep { width: 1px; align-self: stretch; background: var(--stroke); }
.view3d-stage { flex: 1; min-height: 0; position: relative; display: flex; }
.view3d-host { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; touch-action: none; }
.view3d-rack {
    position: absolute;
    top: 10px;
    right: 10px;
    max-width: min(320px, calc(100% - 20px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--stroke);
    border-left: 3px solid var(--selection);
    background: var(--panel);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.view3d-rack-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.view3d-rack-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view3d-rack-kicker { font-size: calc(10px * var(--ui-font, 1)); letter-spacing: 0.06em; text-transform: uppercase; color: var(--selection); font-weight: 600; }
.view3d-rack-title { font-weight: 600; }
.view3d-rack-sub { font-size: calc(11px * var(--ui-font, 1)); }
.view3d-rack-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.view3d-host canvas { display: block; position: absolute; inset: 0; cursor: grab; outline: none; }
.view3d-host canvas:active { cursor: grabbing; }
.view3d-host.with-cube ~ .view3d-rack { top: 136px; }
/* The view cube (wwwroot/js/viewcube.js), top right as in AutoCAD. */
.view-cube { position: absolute; top: 6px; right: 6px; width: 128px; height: 128px; user-select: none; -webkit-user-select: none; }
.view3d-host .view-cube canvas.view-cube-canvas { position: static; inset: auto; cursor: default; }
.view3d-host .view-cube canvas.view-cube-canvas:active { cursor: grabbing; }
.view-cube-home {
    position: absolute; top: 2px; left: 2px; z-index: 1; width: 24px; height: 24px; padding: 0;
    display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--text);
    background: var(--panel); border: 1px solid var(--stroke); opacity: 0.8; cursor: pointer;
}
.view-cube-home:hover { opacity: 1; border-color: var(--selection); color: var(--selection); }
.view-cube-caret {
    position: absolute; bottom: 2px; right: 2px; z-index: 1; width: 20px; height: 20px; padding: 0;
    display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--text);
    background: var(--panel); border: 1px solid var(--stroke); opacity: 0.8; cursor: pointer;
}
.view-cube-caret:hover, .view-cube-caret.open { opacity: 1; border-color: var(--selection); color: var(--selection); }
.view-cube-menu {
    position: absolute; top: calc(100% + 2px); right: 0; z-index: 5; min-width: 230px; padding: 4px;
    background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.view-cube-menu[hidden] { display: none; }
.view-cube-menu-item {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 26px; padding: 2px 8px;
    border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text); text-align: left; cursor: pointer; white-space: nowrap;
}
.view-cube-menu-item:hover { background: var(--accent-soft); color: var(--accent); }
.view-cube-menu-sep { height: 1px; background: var(--stroke); margin: 4px 0; }
.view-cube-radio { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--muted); display: grid; place-items: center; }
.view-cube-menu-item.on .view-cube-radio { border-color: var(--accent); }
.view-cube-menu-item.on .view-cube-radio::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.view3d-plan-source { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.view3d-help, .view3d-notes { position: absolute; left: 10px; bottom: 8px; pointer-events: none; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--panel); opacity: 0.85; }
.view3d-notes { bottom: auto; top: 52px; }

/* ===== One rack ===== */

.rack {
    padding: 10px 12px 12px;
    margin-right: 4px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}
.rack.active { border-color: var(--accent); background: var(--panel); }
.rack-head { display: flex; gap: 6px; margin-bottom: 8px; }
.rack-titles { flex: 1; min-width: 0; }
.rack-title { font-size: calc(15px * var(--ui-font, 1)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rack-name { font-size: calc(13px * var(--ui-font, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rack-model { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rack-buttons { display: flex; align-items: flex-start; gap: 2px; }
.icon { border-color: transparent; background: transparent; padding: 0 6px; min-height: 22px; color: var(--muted); }
.rack-totals {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}
/* Over or close to the power budget or load rating (racks.budgets) */
.rack-totals.near { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.rack-totals.over { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.budget-icon { margin-right: 4px; }
.totals .over-budget { color: var(--error); font-weight: 600; }

.budgets .budget { margin-top: 10px; }
.budget-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.budget-label { font-weight: 600; }
.budget-track { height: 8px; margin-top: 5px; border-radius: var(--radius-sm); background: var(--panel-alt); border: 1px solid var(--stroke); overflow: hidden; }
.budget-fill { height: 100%; background: var(--success); }
.budget.near .budget-fill { background: var(--warning); }
.budget.over .budget-fill { background: var(--error); }
.budget-note { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); margin-top: 3px; }
.budget.near .budget-note { color: var(--warning); }
.budget.over .budget-note { color: var(--error); font-weight: 600; }

.rack-body { display: grid; width: max-content; }
/* Control desks (broadcast furniture) in the elevations, drawn to scale on the racks' floor */
.desk-body { display: flex; align-items: flex-end; gap: 18px; }
.desk-view { display: block; overflow: visible; }
/* A Meyer Werft rack foundation (RAL 7047) and levelling feet under a rack or held space (RackStand) */
.stand-foundation { fill: #D0D0D0; fill-opacity: 0.55; stroke: var(--plan-rack-edge); stroke-width: 1.2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.stand-foot { fill: var(--foot); stroke: none; }
/* The 70-45-2 buffer's zinc-plated plates and M10 stud. */
.stand-foot-plate, .stand-foot-stud { fill: #B4BAC2; stroke: none; }
.rack-stand { display: block; overflow: visible; }
.rack-feet-real { display: block; overflow: visible; }
.section-stand { display: block; overflow: visible; }
.space-box { fill: var(--plan-rack-hover); fill-opacity: 0.12; stroke: var(--plan-rack-edge); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.desk-part { stroke: var(--plan-rack-edge); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.desk-part.worktop { fill: #CDBF9F; }
.desk-part.pod { fill: #4A5058; }
.desk-part.pod-face { fill: #1B1E22; }
.desk-part.end-panel { fill: #7A8088; }
.desk-part.rear-top { fill: #3F444A; }
.desk-part.leg { fill: #2C2F34; }
.desk-part.rail { fill: #B4BAC2; stroke-width: 0.75px; }
.desk-rail-tick { stroke: #5A6069; stroke-width: 0.75px; vector-effect: non-scaling-stroke; }
.desk-corner-line { stroke: var(--accent, #6b8e23); stroke-width: 1px; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.desk-corner-text { fill: var(--accent, #6b8e23); font-family: inherit; }
.desk-part.detail { fill: none; stroke-dasharray: 6 4; }
/* In the side section the end panel is only outlined, so the worktop, pods and legs behind it show */
.desk-part.outline { fill: none; stroke-dasharray: 6 3; }
.desk-floor { stroke: var(--plan-rack-edge); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.desk-section .section-depth { white-space: nowrap; }
.desk-stage { position: relative; flex: none; }
.desk-stage > .desk-view { position: absolute; left: 0; top: 0; }
.desk-gear { border-radius: var(--radius-sm); }
.desk-face { position: relative; transform-origin: 0 0; }
.desk-gear.loose { border-radius: var(--radius-sm); }
.desk-gear.far { background: transparent !important; border: 1px dashed var(--muted); }
.desk-gear.far .desk-face { opacity: 0.6; }
.desk-arm rect { fill: #8D939B; stroke: #3E434A; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.desk-arm.selected rect { stroke: var(--selection); stroke-width: 2px; }
.desk-stage > .desk-arms-over { pointer-events: none; }
.plan-arm-link { stroke: #8D939B; stroke-linecap: round; }
.plan-arm { fill: #8D939B; stroke: #3E434A; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.desk-gear-side { stroke: var(--plan-rack-edge); stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: pointer; }
.desk-gear-side.error { stroke: var(--error); stroke-width: 2px; }
.desk-gear-side.selected { stroke: var(--selection); stroke-width: 2px; }
.rack-cap { background: var(--cap); border-top: 1px solid var(--faceplate-edge); border-radius: var(--radius-sm) 2px 0 0; }
.rack-plinth {
    background: var(--cap);
    border-top: 1px solid var(--faceplate-edge);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
    padding: 0 22px;
}
.rack-plinth span { height: 3px; margin: 0 3px; border-radius: 1.5px; background: var(--rail-hole); }
.rack-feet { display: flex; justify-content: space-between; padding: 0 4px; height: 7px; }
.rack-feet span { width: 26px; background: var(--foot); border-radius: 0 0 3px 3px; }
.rack-post { background: var(--post); z-index: 1; }
.rack-post.left { border-radius: var(--radius-sm) 0 0 0; }
.rack-post.right { border-radius: 0 2px 0 0; }

.unit-numbers div {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(10px * var(--ui-font, 1));
    color: var(--muted);
    position: relative;
}
.unit-numbers div::after { content: ""; position: absolute; bottom: 0; width: 6px; height: 1px; background: var(--faint-ink); }
.unit-numbers.left div::after { right: 0; }
.unit-numbers.right div::after { left: 0; }

.rail { display: block; background: var(--rail); }
.rail .hole { fill: var(--rail-hole); }
.rail .hole.faint { opacity: 0.35; }

.strip-column { position: relative; background: var(--rack-void); }
.strip {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0;
    background: var(--strip);
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    cursor: move;
}
.strip i { width: 5px; height: 5px; border-radius: 50%; background: var(--sheet); }

.panel { position: relative; overflow: hidden; background: transparent; }
.rack-opening { background: var(--rack-void); }
.empty-unit { position: absolute; left: 4px; right: 4px; border: 1px solid var(--faint-ink); border-radius: var(--radius-sm); pointer-events: none; }
.other-face { position: absolute; border: 1px dashed var(--ink); opacity: 0.35; pointer-events: none; }
.frame-back { position: absolute; background: var(--rack-void); border: 1px solid var(--faceplate-edge); pointer-events: none; }
.frame-slot {
    position: absolute;
    top: 0;
    border-left: 0.5px solid var(--faint-ink);
    border-right: 0.5px solid var(--faint-ink);
    color: var(--muted);
    text-align: center;
    padding-top: 1px;
    line-height: 1;
}
/* A card frame's front with its front slots: the text band stays the faceplate, the slots below are open */
/* A power supply on the back of gear, seen from behind */
.psu-mark { position: absolute; display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 1px solid var(--ink); border-radius: var(--radius-sm); background: var(--faceplate); color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; pointer-events: none; }
.frame-front { position: absolute; bottom: 0; background: var(--rack-void); border: 1px solid var(--faceplate-edge); border-bottom: 0; box-sizing: border-box; pointer-events: none; }
.frame-front .frame-slot { bottom: 0; }
.face-text .centre.row { flex-direction: row; gap: 0.6em; }

.gear {
    position: absolute;
    background: var(--faceplate);
    border: 1px solid var(--faceplate-edge);
    cursor: move;
    color: var(--ink);
    overflow: hidden;
}
.gear.loose { background: var(--front-gear); border-radius: var(--radius-sm); }
.gear.card { border-radius: var(--radius-sm); }
.gear.shelf { background: transparent; border-color: transparent; }
.gear.error, .strip.error { border: 2px solid var(--error); }
.gear.selected, .strip.selected { border: 2px solid var(--selection); }

.shelf-opening { position: absolute; border: 1px dashed var(--faceplate-edge); pointer-events: none; }
.shelf-label { position: absolute; left: 4px; top: 2px; color: var(--muted); font-size: calc(9px * var(--ui-font, 1)); white-space: nowrap; }
.shelf-ear { position: absolute; top: 0; bottom: 0; background: var(--faceplate); border: 1px solid var(--faceplate-edge); pointer-events: none; }
.shelf-lip { position: absolute; left: 0; right: 0; bottom: 0; background: var(--faceplate); border: 1px solid var(--faceplate-edge); box-sizing: border-box; pointer-events: none; }
.shelf-gusset { position: absolute; background: var(--faceplate); border: 1px solid var(--faceplate-edge); box-sizing: border-box; pointer-events: none; }
.shelf-slot { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 999px; background: var(--rail-hole); }

.screw {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 0.8px solid var(--rail-hole);
    background: var(--screw);
    pointer-events: none;
}

.face-text { position: absolute; overflow: hidden; pointer-events: none; line-height: 1.15; }
/* Owner furnished gear: grey at 40% transparency over the face, under its text (as on the sheets and DWG) */
.ofe-shade { position: absolute; inset: 0; background: rgba(128, 128, 128, 0.6); pointer-events: none; }
.ofe-dnc { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.face-text > span { position: absolute; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.face-text .maker { left: 0; top: 0; }
.face-text .model { left: 0; bottom: 0; }
.face-text .corner { right: 0; top: 0; display: flex; flex-direction: column; align-items: flex-end; text-overflow: clip; }
.face-text .centre {
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    color: var(--text);
    line-height: 1.05;
}
.face-text .centre > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.face-text .centre b { font-weight: 600; }
/* A card's TLA and UID run up the card. vertical-rl then a half turn reads bottom to top, with the TLA on the left. */
.face-text .centre.vertical { writing-mode: vertical-rl; transform: rotate(180deg); padding: 3px 0; line-height: 1.1; }
.face-text .centre.vertical > * { max-width: none; max-height: 100%; }
.face-text .panel-text { font-weight: 700; }

.drop-preview { position: absolute; border: 2px solid var(--error); background: #FF525233; border-radius: var(--radius-sm); pointer-events: none; }
.drop-preview.valid { border-color: var(--success); background: #5CC07A33; }
.lasso { position: absolute; border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); pointer-events: none; }
.drop-message {
    margin: 8px auto 0;
    height: 30px;
    font-size: calc(11px * var(--ui-font, 1));
    color: var(--muted);
    text-align: center;
    overflow: hidden;
}

.section { margin-left: 18px; display: grid; grid-template-rows: 10px auto 14px auto; }
.section-cap { background: var(--frame); }
.section-cap.top { border-radius: var(--radius-sm) 3px 0 0; }
.section-cap.bottom { border-radius: 0 0 3px 3px; }
.section-sheet { position: relative; overflow: hidden; background: var(--sheet); border-left: 3px solid var(--frame); border-right: 3px solid var(--frame); }
.section-rail { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--faint-ink); pointer-events: none; }
.section-label { position: absolute; top: 2px; font-size: calc(9px * var(--ui-font, 1)); color: var(--faint-ink); pointer-events: none; }
.section-label.front { left: 6px; }
.section-label.rear { right: 6px; }
.section-depth-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--faint-ink); opacity: 0.8; pointer-events: none; }
.section-depth-mark { position: absolute; bottom: 2px; transform: translateX(-50%); padding: 0 3px; font-size: calc(16px * var(--ui-font, 1)); color: var(--faint-ink); background: var(--sheet); pointer-events: none; z-index: 1; }
.section-item {
    position: absolute;
    border-style: solid;
    border-color: var(--ink);
    background: var(--front-gear);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: calc(10px * var(--ui-font, 1));
    line-height: 1.15;
    padding: 0;
    white-space: nowrap;
}
.section-item.rear { background: var(--rear-gear); }
/* A shelf from the side: open, with its ear, tray and sloping gusset drawn in */
.section-item.shelf { background: transparent; border: none; overflow: visible; }
.section-item.shelf .shelf-side { fill: #DFE3E9; stroke: var(--ink); stroke-width: 1; }
.section-item.shelf .shelf-gusset-side { fill: var(--front-gear); stroke: var(--ink); stroke-width: 1; }
.section-item.shelf.selected .shelf-side, .section-item.shelf.selected .shelf-gusset-side { stroke: var(--selection); stroke-width: 2; }
.section-item.shelf.error .shelf-side, .section-item.shelf.error .shelf-gusset-side { stroke: var(--error); stroke-width: 2; }
.section-item.error { border-color: var(--error); }
.section-item.selected { border-color: var(--selection); }
.section-item span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* Up the item, read bottom to top like an openGear card's TLA */
.section-item span.vertical { writing-mode: vertical-rl; transform: rotate(180deg); max-width: none; max-height: 100%; }
.section-depth { font-size: calc(10px * var(--ui-font, 1)); color: var(--muted); text-align: center; margin: 6px auto 0; }

/* ===== Details ===== */

.details { overflow-y: auto; padding: 10px 0; min-height: 0; }
.card {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}
.card p { margin: 6px 0 0; }
.field { display: block; margin: 6px 0 0; color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); }
.field input, .field select { margin-top: 3px; font-size: calc(12px * var(--ui-font, 1)); }
.field i { font-style: italic; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-pair.narrow-first { grid-template-columns: 100px 1fr; }
.field-trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.dialog-form .field-trio .field, .dialog-form .field-trio .field:first-child { margin-top: 6px; }
.equipment-form input.readonly { opacity: 0.7; }
@media (max-width: 560px) { .field-trio { grid-template-columns: 1fr 1fr; } }
.field-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.totals { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; }
.uuid { font-size: calc(10px * var(--ui-font, 1)); color: var(--muted); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slider-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.slider-row input { flex: 1; }
.swing { width: 40px; text-align: right; }
.card .segments { margin-top: 3px; }
.issue { display: flex; gap: 8px; margin-bottom: 6px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; }
.dot.error { background: var(--error); }
.dot.warning { background: var(--warning); }

/* ===== Menus and dialogs ===== */

.menu-shield { position: fixed; inset: 0; z-index: 20; }
.menu {
    position: fixed;
    z-index: 21;
    min-width: 200px;
    padding: 4px;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.menu-item { display: flex; justify-content: space-between; gap: 24px; width: 100%; border: none; background: transparent; text-align: left; }
.menu-item .gesture { color: var(--muted); }
.menu-separator { height: 1px; background: var(--stroke); margin: 4px 0; }

/* Command-bar dropdowns (File, Equipment Options, Export): drop down under their buttons */
.dropdown-anchor { position: relative; display: inline-flex; }
.dropdown-button .caret { font-size: calc(10px * var(--ui-font, 1)); color: var(--muted); }
.dropdown-button.open, .dropdown-button.open:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.dropdown-button.open .caret { color: var(--accent); }
.dropdown-button.primary .caret, .dropdown-button.primary.open .caret { color: inherit; }
.dropdown-button.primary.open, .dropdown-button.primary.open:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.dropdown-item .count-badge { margin-left: auto; }
.dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 21;
    min-width: 250px;
    padding: 8px 6px 6px;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-top: 2px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.dropdown .section-header { margin: 0 6px 4px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 30px; border: none; background: transparent; text-align: left; }
.dropdown-item > span:first-of-type { flex: 1; }
.dropdown-item svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.dropdown-item:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.dropdown-item svg .fill { fill: var(--accent-soft); stroke: none; }
.dropdown-check { width: 16px; text-align: center; color: var(--accent); font-weight: 700; }
.dropdown-item kbd { font: inherit; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); padding: 0 5px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel-alt); }

.dialog-shield {
    position: fixed;
    inset: 0;
    z-index: 50; /* above full-screen views (.tbd, 40), so their dialogs show */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 18, 0.45);
    padding: 16px;
}
.dialog {
    width: 420px;
    max-width: 100%;
    max-height: 100%;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.dialog.wide { width: 640px; }
.dialog.widest { width: 860px; }
.dialog.frame { width: 1290px; }

/* The rear detail of a card frame: the frame's back drawn large between its rails */
.frame-detail-scroll { overflow-x: auto; }
.frame-detail-rail { width: max-content; margin: 0 auto; padding: 32px 14px 14px; background: var(--rail); border-radius: var(--radius-sm); }
.frame-detail-back { position: relative; background: var(--rack-void); }
.fd-psu { position: absolute; top: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 1px solid var(--faceplate-edge); background: var(--faceplate); color: var(--text); font-weight: 600; font-size: calc(13px * var(--ui-font, 1)); pointer-events: none; }
.fd-psu span { writing-mode: vertical-rl; transform: rotate(180deg); }
.fd-side { display: inline-flex; gap: 0; margin-bottom: 8px; }
.fd-side button { border-radius: 0; }
.fd-side button:first-child { border-radius: var(--radius-sm) 0 0 4px; }
.fd-side button:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.fd-side button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.fd-frame-band { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 10px; background: var(--faceplate); border-bottom: 1px solid var(--faceplate-edge); color: var(--text); box-sizing: border-box; }
.fd-frame-model { position: absolute; left: 8px; font-size: calc(10px * var(--ui-font, 1)); color: var(--muted); white-space: nowrap; }
.fd-frame-ids { display: flex; gap: 12px; align-items: baseline; font-size: calc(15px * var(--ui-font, 1)); }
.fd-frame-ids b { font-size: calc(20px * var(--ui-font, 1)); font-weight: 600; }
.fd-slot { position: absolute; top: 0; border-left: 0.5px solid var(--faint-ink); border-right: 0.5px solid var(--faint-ink); cursor: pointer; }
.fd-slot.selected::after { content: ""; position: absolute; inset: 2px; border: 2px solid var(--selection); border-radius: var(--radius-sm); }
.fd-card {
    position: absolute;
    top: 0;
    background: var(--faceplate);
    border: 1px solid var(--faceplate-edge);
    color: var(--text);
    overflow: hidden;
    cursor: grab;
    user-select: none;
}
.fd-card.selected { border: 2px solid var(--selection); }
.fd-card > * { pointer-events: none; }
/* A card with its picture: slot numbers along the top, the picture, then the TLA and UID along the bottom */
.fd-card.has-image { display: flex; flex-direction: column; }
.fd-image-slot { flex: none; padding: 2px 2px 1px; background: #101318C0; color: #fff; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-card img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.fd-band { flex: none; display: flex; flex-direction: column; align-items: center; padding: 2px; background: #101318C0; color: #fff; font-size: calc(9px * var(--ui-font, 1)); line-height: 1.15; }
.fd-band b { font-size: calc(12px * var(--ui-font, 1)); font-weight: 600; }
.fd-band > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-slot-text { position: absolute; top: 3px; left: 0; right: 0; text-align: center; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; }
.fd-model { position: absolute; bottom: 3px; left: 2px; right: 2px; text-align: center; font-size: calc(8px * var(--ui-font, 1)); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The TLA and UID run up the card, reading bottom to top with the TLA on the left */
.fd-spine {
    position: absolute;
    inset: 18px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1.1;
    white-space: nowrap;
}
.fd-spine > * { max-height: 100%; overflow: hidden; text-overflow: ellipsis; }
.fd-spine b { font-weight: 600; }
.fd-number { position: absolute; top: -26px; display: flex; justify-content: center; pointer-events: none; }
.fd-number span { min-width: 24px; padding: 1px 4px; border-radius: var(--radius-sm); background: #101318E6; color: #fff; font-size: calc(13px * var(--ui-font, 1)); font-weight: 700; text-align: center; }
.fd-fields { display: flex; gap: 10px; margin-top: 12px; }
.fd-fields .field { flex: 1; margin-top: 0; }
.fd-buttons { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.fd-status { margin: 8px 0 0; }
.fd-done { margin-left: auto; }
.dialog-title { font-size: calc(15px * var(--ui-font, 1)); font-weight: 600; margin-bottom: 10px; }
.dialog-text { margin: 0 0 12px; line-height: 1.45; white-space: pre-line; }
/* Export, 3D model: one big button per format, with what it holds under its name. */
.export3d-choices { display: grid; gap: 8px; margin-bottom: 12px; max-width: 520px; }
.export3d-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; height: auto; white-space: normal; }
.export3d-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.dialog-form .field:first-child { margin-top: 0; }
.dialog-form .field-pair .field:first-child { margin-top: 6px; }
.dialog-form .field-pair:first-child .field { margin-top: 0; }
.import-into { border: 1px solid var(--stroke); border-radius: var(--radius-sm); margin: 10px 0 0; padding: 6px 10px 8px; }
.import-into legend { color: var(--muted); font-size: calc(12px * var(--ui-font, 1)); padding: 0 4px; }
.import-into label.check { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 6px; margin: 4px 0 0; color: var(--text); }
.import-into label.check input { width: auto; flex: none; margin: 0; }
.import-into label.check .muted { margin-left: 4px; }
.dialog .segments { margin: 3px 8px 8px 0; }
.dialog-buttons { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 6px; margin-top: 14px; }
.dialog-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.transfer-group { margin: 8px 8px 2px; }
.transfer-start { display: flex; gap: 8px; align-items: center; }
.transfer-start input { width: 70px; }
.transfer-left { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: calc(12px * var(--ui-font, 1)); }
.transfer-left input { background: var(--panel-alt); color: var(--muted); cursor: default; }
.transfer-saved { max-height: 22vh; }
.pick.busy { opacity: 0.6; pointer-events: none; }
.problem { color: var(--error); margin: 8px 0 0; }
.check { display: flex; align-items: center; gap: 6px; margin-top: 4px; }

.lineups { width: 100%; border-collapse: collapse; }
.lineups th, .lineups td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--stroke); }
.lineups th { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.clickable { cursor: pointer; }
.lineups .tick { width: 28px; padding-right: 0; }
.lineups .tick input { margin: 0; cursor: pointer; }
.lineups tr.picked td { background: var(--accent-soft); }
.clickable:hover, .pick:hover { background: var(--panel-alt); }

.pick { padding: 5px 8px; cursor: pointer; border-bottom: 1px solid var(--stroke); }
.pick.selected { background: var(--active-nav); }
.pick-name { font-weight: 600; }
.pick-size { float: right; color: var(--muted); }


/* ===== Plan drawing linework (from the same drawings as the DWG) ===== */

.drawing * { fill: none; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.drawing .text { stroke: none; font-family: Arial, Helvetica, sans-serif; white-space: pre; }
.drawing .fill { stroke: none; }
.l-rack-frame, .l-rack-title { stroke: var(--l-frame); }
.l-rack-rail { stroke: var(--l-rail); }
.l-rack-units { stroke: var(--l-units); }
.l-rack-equip { stroke: var(--l-equip); }
.l-rack-hidden { stroke: var(--l-hidden); stroke-dasharray: 6 4; }
.l-rack-door { stroke: var(--l-door); }
.l-rack-dim { stroke: var(--l-dim); }
.l-rack-label { stroke: var(--l-label); }
.l-rack-text { stroke: var(--l-text); }
.drawing .text.l-rack-frame, .drawing .fill.l-rack-frame, .drawing .text.l-rack-title { fill: var(--l-frame); }
.drawing .text.l-rack-rail, .drawing .fill.l-rack-rail { fill: var(--l-rail); }
.drawing .text.l-rack-units, .drawing .fill.l-rack-units { fill: var(--l-units); }
.drawing .text.l-rack-equip, .drawing .fill.l-rack-equip { fill: var(--l-equip); }
.drawing .text.l-rack-hidden, .drawing .fill.l-rack-hidden { fill: var(--l-hidden); }
.drawing .text.l-rack-door, .drawing .fill.l-rack-door { fill: var(--l-door); }
.drawing .text.l-rack-dim, .drawing .fill.l-rack-dim { fill: var(--l-dim); }
.drawing .text.l-rack-label, .drawing .fill.l-rack-label { fill: var(--l-label); }
.drawing .text.l-rack-text, .drawing .fill.l-rack-text { fill: var(--l-text); }
/* Owner furnished gear: grey, 40% transparent (the opacity is on the polygon itself) */
.drawing .fill.l-rack-ofe { fill: #808080; }

/* ===== Share links and markup ===== */

.count-badge {
    display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 2px; border-radius: var(--radius-lg);
    background: var(--error); color: #fff; font-size: calc(10px * var(--ui-font, 1)); font-weight: 600; line-height: 16px; text-align: center;
}
button.danger { color: var(--error); }
textarea {
    font: inherit; width: 100%; padding: 6px 8px; border: 1px solid var(--stroke); border-radius: var(--radius-sm);
    background: var(--panel); color: var(--text); resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

/* The Share dialog */
.share-new { padding: 10px; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); }
.share-new .button-row { margin-top: 8px; }
.share-links-title { margin-top: 14px; }
.share-link { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--stroke); }
.share-link:last-child { border-bottom: none; }
.share-link.off { opacity: 0.6; }
.share-link.fresh { background: var(--accent-soft); }
.share-link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.share-url { font-family: ui-monospace, Consolas, monospace; font-size: calc(11px * var(--ui-font, 1)); min-height: 24px; }
.share-date input[type=date] { width: auto; }
.share-people textarea, .share-edit textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: calc(12px * var(--ui-font, 1)); }
.share-edit { margin-top: 6px; padding: 8px; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); display: flex; flex-direction: column; gap: 6px; }
.share-edit input[type=date] { width: auto; }
.share-signin { display: flex; gap: 4px; }
.share-signin input { flex: 1; min-width: 0; }
.share-gate { max-width: 420px; margin: 8vh auto; padding: 24px; border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.share-gate h2 { margin: 0; }
.share-gate form { display: flex; flex-direction: column; gap: 8px; }
.share-gate .code-input { font-size: calc(20px * var(--ui-font, 1)); letter-spacing: 6px; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.share-link-buttons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 240px; }
a.button { text-decoration: none; }

/* The board: drawings with markup, and the list beside them */
.board { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 10px;
    background: var(--panel); border-bottom: 1px solid var(--stroke);
}
.board-bar .check { margin-top: 0; }
.board-sep { width: 1px; align-self: stretch; background: var(--stroke); margin: 0 2px; }
.board-fill { flex: 1; }
.swatches { display: inline-flex; gap: 4px; }
.swatch {
    width: 20px; min-height: 20px; height: 20px; padding: 0; border-radius: 50%;
    background: var(--c) !important; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--stroke);
}
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.board-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.board-canvas { min-height: 0; overflow: auto; background: var(--canvas); position: relative; }
.board-canvas.three { display: flex; flex-direction: column; overflow: hidden; }
.board-pick {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    background: var(--panel-alt); border-bottom: 1px solid var(--stroke);
}
.board-pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-elev { background: var(--canvas); }
.markup-surface { position: relative; }
.markup-surface > svg.marks, .draft-host, .draft-host > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
svg.marks { pointer-events: none; overflow: visible; z-index: 2; }
.mark-shape * { fill: none; stroke-width: 2.5px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.mark-shape.on * { stroke-width: 4px; }
.mark-shape.draft * { stroke-dasharray: 6 4; }
.mark-shape.resolved { opacity: 0.4; }
.draft-host { pointer-events: none; z-index: 3; }
.draft-host.drawing-on { pointer-events: auto; cursor: crosshair; touch-action: none; }
.draft-host > svg { overflow: visible; }
.draft-host > svg * { fill: none; stroke-width: 2.5px; vector-effect: non-scaling-stroke; stroke-dasharray: 6 4; }
.pin-anchor { position: absolute; width: 0; height: 0; z-index: 4; }
.pin {
    position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
    min-width: 22px; min-height: 22px; height: 22px; padding: 0 6px; justify-content: center;
    border-radius: var(--radius-lg) 11px 11px 2px; border: 2px solid #fff; background: var(--c); color: #fff;
    font-size: calc(11px * var(--ui-font, 1)); font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); cursor: pointer;
}
.pin:hover:not(:disabled) { background: var(--c); filter: brightness(1.1); }
.pin.on { outline: 3px solid var(--selection); outline-offset: 1px; }
.pin.resolved { opacity: 0.5; }
.pin.draft { display: inline-flex; align-items: center; opacity: 0.85; pointer-events: none; }

.board-list { min-height: 0; overflow-y: auto; padding: 10px; background: var(--panel); border-left: 1px solid var(--stroke); }
.board-empty { margin-top: 0; }
.composer {
    margin-bottom: 14px; padding: 10px; border: 1px solid var(--accent); border-radius: var(--radius-md); background: var(--accent-soft);
    display: flex; flex-direction: column; gap: 6px;
}
.composer-title { font-weight: 600; }
.composer .dialog-buttons { margin-top: 2px; }
.mark { padding: 8px; border: 1px solid var(--stroke); border-radius: var(--radius-md); margin-bottom: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.mark:hover { background: var(--panel-alt); }
.mark.on { border-color: var(--selection); background: var(--panel-alt); }
.mark.resolved { opacity: 0.7; }
.mark-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mark-num {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: var(--radius-lg); background: var(--c); color: #fff; font-size: calc(11px * var(--ui-font, 1)); font-weight: 700;
}
.chip { font-size: calc(10px * var(--ui-font, 1)); font-weight: 600; padding: 1px 7px; border-radius: var(--radius-lg); background: var(--panel-alt); color: var(--muted); border: 1px solid var(--stroke); }
.chip.suggestion { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.mark-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.mark-reply { white-space: pre-wrap; padding: 5px 8px; border-left: 3px solid var(--accent); background: var(--panel-alt); border-radius: 0 4px 4px 0; }
.mark-state { color: var(--success); font-weight: 600; font-size: calc(11px * var(--ui-font, 1)); }
.mark-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; cursor: default; }

/* The editor's markup review, over the whole window */
.review-shield { position: fixed; inset: 0; z-index: 25; background: rgba(10, 12, 18, 0.45); padding: 16px; display: flex; }
.review {
    flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel);
    border: 1px solid var(--stroke); border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.review-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--stroke); }
.review-head .dialog-title { margin: 0; white-space: nowrap; }
.review > .problem { padding: 0 12px 8px; }

/* The share link page */
.viewer-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.viewer-notice { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: var(--accent-soft); color: var(--text); }

@media (max-width: 800px) {
    .board-body { grid-template-columns: 1fr; grid-template-rows: minmax(320px, 1fr) auto; overflow-y: auto; }
    .board-list { border-left: none; border-top: 1px solid var(--stroke); }
    .review-shield { padding: 0; }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 10px 16px;
    background: var(--error);
    color: #fff;
}
#blazor-error-ui .reload, #blazor-error-ui .dismiss { margin-left: 12px; cursor: pointer; color: inherit; }
#blazor-error-ui .error-detail { margin-top: 6px; font: calc(11px * var(--ui-font, 1))/1.35 Consolas, ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; max-height: 30vh; overflow: auto; -webkit-user-select: text; user-select: text; }
#blazor-error-ui .error-detail:empty { display: none; }

/* The editor is made for a desktop; on a narrow screen the side columns fold away under the lineup. */
@media (max-width: 1000px) {
    .workspace, .workspace.no-library, .workspace.no-details { grid-template-columns: 1fr; grid-auto-rows: minmax(300px, auto); overflow-y: auto; padding: 0 10px; }
    .library, .details { border-right: none; }
}

/* Manufacturer 3D model dialog */
.model-file { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.model-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-align { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; border: 0; padding: 0; margin: 8px 0 0; min-width: 0; }
.model-align .field select, .model-align .field input { width: 100%; }
.model-align:disabled { opacity: 0.5; }
.model-info { background: var(--panel-alt); border-radius: var(--radius-md); padding: 8px 10px; margin: 12px 0 0; font-family: Consolas, ui-monospace, monospace; font-size: calc(12px * var(--ui-font, 1)); min-height: 1.4em; }
@media (max-width: 560px) { .model-align { grid-template-columns: 1fr 1fr; } }
.status-bar .build { white-space: nowrap; }

/* ===== Power strip detail: the strip drawn down the left, a label per receptacle ===== */

.strip-detail {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 10px 0;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.sd-head { padding: 10px 14px 10px; background: var(--header-band); border-bottom: 1px solid var(--stroke); }
.sd-head-row { display: flex; align-items: center; justify-content: space-between; }
.sd-head-row .section-header { margin: 0; }
.sd-title { font-size: calc(15px * var(--ui-font, 1)); font-weight: 600; margin-top: 2px; }
.sd-sub { color: var(--text); }
.sd-load { margin-top: 4px; font-weight: 600; color: var(--accent); }
.sd-strips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sd-strips .segment { border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: var(--panel); }
.sd-strips .segment.on, .sd-strips .segment.on:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.sd-gone { padding: 14px; }

.sd-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 14px 18px; background: var(--canvas); }
.sd-strip { --housing: #2B303B; --housing-edge: #12151B; --socket: #0D0F14; --pin: #3D4350; }
[data-theme=dark] .sd-strip { --housing: #3A4050; --housing-edge: #0B0D12; --socket: #0B0D12; --pin: #2B303B; }

/* Every row shares the housing column, so together they draw one long strip. */
.sd-cap, .sd-row, .sd-foot { display: grid; grid-template-columns: 58px 16px minmax(0, 1fr); }
.sd-cap > span, .sd-foot > span, .sd-socket-cell {
    grid-column: 1;
    background: linear-gradient(to right, var(--housing-edge) 0, var(--housing) 3px, var(--housing) 55px, var(--housing-edge) 58px);
}
.sd-cap > span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border-radius: var(--radius-lg) 8px 0 0;
    color: #E5E8EF;
    font-size: calc(9px * var(--ui-font, 1));
    font-weight: 600;
    letter-spacing: 0.04em;
    writing-mode: horizontal-tb;
    overflow: hidden;
    border-bottom: 2px solid var(--accent);
}
.sd-foot > span { height: 34px; border-radius: 0 0 8px 8px; position: relative; }
.sd-foot > span::after {
    /* The mains cord out of the bottom of the strip. */
    content: "";
    position: absolute;
    left: 25px;
    top: 34px;
    width: 8px;
    height: 26px;
    background: var(--housing-edge);
    border-radius: 0 0 3px 3px;
}
.sd-foot { margin-bottom: 30px; }

.sd-row { min-height: 58px; cursor: pointer; }
.sd-socket-cell { position: relative; display: flex; align-items: center; justify-content: center; }
.sd-socket { width: 36px; height: 28px; }
.sd-socket-face { fill: var(--socket); stroke: #555C6B; stroke-width: 1; }
.sd-pin { fill: var(--pin); }
.sd-num {
    position: absolute;
    left: 3px;
    top: 2px;
    font-size: calc(9px * var(--ui-font, 1));
    font-weight: 600;
    color: #C9CED7;
}
.sd-row.used .sd-socket-face { stroke: var(--accent); stroke-width: 2; }
.sd-row.used .sd-pin { fill: #9AA1AB; }
.sd-row.selected .sd-socket-cell { box-shadow: inset 0 0 0 2px var(--selection); }

.sd-lead { align-self: center; height: 0; border-top: 1px dashed var(--faint-ink); }
.sd-row.used .sd-lead { border-top: 2px solid var(--accent); }

.sd-card {
    align-self: center;
    margin: 4px 0;
    padding: 5px 8px;
    min-height: 26px;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.sd-row:not(.used) .sd-card { background: transparent; border-style: dashed; }
.sd-row.selected .sd-card { border: 2px solid var(--selection); padding: 4px 7px; }
.sd-row.drop .sd-card { border: 2px dashed var(--accent); background: var(--accent-soft); padding: 4px 7px; }
.sd-row:hover .sd-card { border-color: var(--muted); }
.sd-line { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.sd-make { display: block; color: var(--text); }
.sd-uid { overflow: hidden; text-overflow: ellipsis; }
.sd-tla { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.sd-spacer { flex: 1; }
.sd-psu {
    flex: none;
    font-size: calc(11px * var(--ui-font, 1));
    font-weight: 700;
    color: var(--on-accent);
    background: var(--accent);
    border-radius: var(--radius-lg);
    padding: 1px 8px;
}
select.sd-psu { width: auto; border: none; min-height: 0; height: 18px; padding: 0 4px; cursor: pointer; color: var(--on-accent); background: var(--accent); }
.sd-empty { color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); }
.sd-types { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.sd-types .link { font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; }
select.sd-type {
    flex: none;
    width: auto;
    min-height: 0;
    height: 18px;
    padding: 0 4px;
    font-size: calc(11px * var(--ui-font, 1));
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}
select.sd-type.c19 { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.sd-unplug { font-size: calc(11px * var(--ui-font, 1)); }

.sd-gear { flex: 0 0 auto; max-height: 34%; display: flex; flex-direction: column; padding: 10px 14px 6px; border-top: 1px solid var(--stroke); }
.sd-gear .section-header { margin-bottom: 4px; }
.sd-gear-list { overflow-y: auto; min-height: 0; }
.sd-gear .pick:hover { background: var(--panel-alt); }
.sd-gear .pick.plugged .pick-name::after { content: " ●"; color: var(--accent); font-size: calc(9px * var(--ui-font, 1)); }

@media (max-width: 1400px) {
    .strip-detail { flex-basis: 340px; }
}

/* ----- Live editing: other engineers' pointers, racks and selected gear (drawn by js/live.js) ----- */
.live-overlay { position: fixed; z-index: 15; pointer-events: none; overflow: hidden; display: none; }
.live-overlay > div { position: absolute; }
.live-rack { border: 2px dashed; border-radius: var(--radius-md); margin: -4px; padding: 2px; box-sizing: content-box; }
.live-item { border: 2px solid; border-radius: var(--radius-sm); box-sizing: border-box; }
.live-item > span { position: absolute; left: -2px; top: -16px; font-size: calc(10px * var(--ui-font, 1)); line-height: 14px; padding: 0 4px; color: #fff; border-radius: var(--radius-sm) 3px 0 0; white-space: nowrap; }
.live-cursor { left: 0; top: 0; transition: transform 120ms linear; }
.live-cursor svg { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }
.live-cursor span { position: absolute; left: 12px; top: 16px; font-size: calc(11px * var(--ui-font, 1)); line-height: 16px; padding: 0 5px; color: #fff; border-radius: var(--radius-sm); white-space: nowrap; }
.live-people { right: 12px; bottom: 10px; display: flex; gap: 4px; }
.live-person { color: #fff; font-size: calc(11px * var(--ui-font, 1)); line-height: 20px; padding: 0 8px; border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.live-person.away { opacity: 0.55; }
.history td.nowrap { white-space: nowrap; }

/* Invite user: the team list */
.team-aside { margin-left: 6px; }
.share-link-buttons select { width: auto; }
.dialog pre.small { white-space: pre-wrap; word-break: break-all; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); }

/* ===== Submit a ticket ===== */

.ticket-dialog { width: 680px; border-top: 3px solid var(--accent); }
.ticket-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 4px; }
.ticket-head .dialog-title { margin-bottom: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-head .segments { margin: 0 0 6px; flex: none; }
.ticket-head .count-badge { margin-left: 4px; }
.ticket-form { display: flex; flex-direction: column; gap: 8px; }
.ticket-row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 8px; color: var(--muted); }
.ticket-label { color: var(--muted); margin-top: 4px; }
.ticket-form textarea { min-height: 110px; }
.ticket-picker { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel-alt); }
.ticket-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.ticket-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 3px 6px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel-alt); font-size: calc(12px * var(--ui-font, 1)); }
.ticket-chip img { width: 28px; height: 20px; object-fit: cover; border-radius: var(--radius-sm); }
.ticket-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-chip button.link { color: var(--muted); }
.ticket-note { margin: 0; }
.ticket-form .dialog-buttons { margin-top: 4px; }
.ticket-form .success, .ticket-form .problem { margin: 0; }
.ticket-yours { font-weight: 600; margin: 10px 0 6px; }
.ticket-table-wrap { max-height: 220px; overflow-y: auto; border-radius: var(--radius-sm); }
.ticket-table-wrap.tall { max-height: 55vh; }
.ticket-table { width: 100%; border-collapse: collapse; font-size: calc(12px * var(--ui-font, 1)); }
.ticket-table th { position: sticky; top: 0; text-align: left; padding: 6px 10px; background: var(--active-nav); font-weight: 600; }
.ticket-table td { padding: 6px 10px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.ticket-table tbody tr { cursor: pointer; }
.ticket-table tbody tr:hover { background: var(--accent-soft); }
.ticket-table tr.fresh { background: var(--accent-soft); }
.ticket-table tr.unread .ticket-subject { font-weight: 600; }
.ticket-table .ticket-subject .muted { font-weight: normal; }
.nowrap { white-space: nowrap; }
.ticket-status { display: inline-block; padding: 1px 9px; border-radius: var(--radius-lg); font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; white-space: nowrap;
    background: color-mix(in srgb, var(--error) 20%, transparent); color: var(--text); }
.ticket-status.s-in_progress { background: color-mix(in srgb, var(--warning) 25%, transparent); }
.ticket-status.s-waiting { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.ticket-status.s-resolved { background: color-mix(in srgb, var(--success) 25%, transparent); }
.ticket-status.s-closed { background: var(--panel-alt); color: var(--muted); }
.ticket-priority.p-low { color: var(--muted); }
.ticket-priority.p-high { color: var(--warning); font-weight: 600; }
.ticket-priority.p-urgent { color: var(--error); font-weight: 600; }
.ticket-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ticket-filter .check { margin: 0; }
.ticket-detail { display: flex; flex-direction: column; gap: 10px; }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--muted); font-size: calc(12px * var(--ui-font, 1)); }
.ticket-admin { display: flex; gap: 10px; }
.ticket-admin .field { flex: 1; margin: 0; }
.ticket-facts { display: grid; grid-template-columns: 80px 1fr; gap: 3px 10px; margin: 0; font-size: calc(12px * var(--ui-font, 1)); }
.ticket-facts dt { color: var(--muted); }
.ticket-facts dd { margin: 0; overflow-wrap: anywhere; }
.ticket-facts a { color: var(--accent); margin-left: 6px; }
.ticket-message { padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); }
.ticket-message.admin { border-left: 3px solid var(--accent); }
.ticket-message-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ticket-message-head .pill { font-size: calc(10px * var(--ui-font, 1)); padding: 0 7px; }
.ticket-body { white-space: pre-wrap; line-height: 1.45; overflow-wrap: anywhere; }
.ticket-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ticket-file { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 120px; height: auto; padding: 4px; background: var(--panel); }
.ticket-file img { width: 110px; height: 72px; object-fit: contain; background: var(--panel-alt); }
.ticket-file-icon { display: flex; align-items: center; justify-content: center; width: 110px; height: 72px; background: var(--panel-alt); color: var(--accent); font-weight: 700; }
.ticket-file-name { max-width: 110px; font-size: calc(11px * var(--ui-font, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-detail .field { margin: 0; }
.ticket-back { margin-right: auto; }
/* The command bar's Submit a ticket button says just "Ticket" when the window is too narrow for the whole bar on one line. */
.label-short { display: none; }
@media (max-width: 1500px) { .label-long { display: none; } .label-short { display: inline; } }
.ticket-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; vertical-align: -3px; }
@media (max-width: 1500px) { .label-short.ticket-icon { display: inline-block; } .ticket-button { padding-left: 6px; padding-right: 6px; } }

/* ===== Equipment approvals ===== */
.pending-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--radius-sm); font-size: calc(10px * var(--ui-font, 1)); font-weight: 600;
    background: color-mix(in srgb, var(--warning) 28%, transparent); color: var(--text); vertical-align: 1px; }
.approvals-dialog { width: 720px; }
.approval-list { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; padding-right: 2px; }
.approval-card { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); }
.approval-card.open { border-color: var(--accent); }
.approval-name { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.approval-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: calc(12px * var(--ui-font, 1)); }
.approval-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.approval-decide { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.approval-decide .field { margin: 0; }
.approval-decide .dialog-buttons { margin-top: 0; }
.approval-picker { display: flex; flex-direction: column; max-height: 200px; overflow-y: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel); }
.approval-option { display: flex; align-items: center; gap: 6px; height: auto; min-height: 28px; padding: 3px 8px; border: none; border-bottom: 1px solid var(--stroke); border-radius: 0; background: transparent; text-align: left; }
.approval-option .muted { margin-left: auto; white-space: nowrap; }
.approval-option.on, .approval-option.on:hover:not(:disabled) { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ticket-table tr.static { cursor: default; }
.ticket-status.a-pending { background: color-mix(in srgb, var(--warning) 25%, transparent); }
.ticket-status.a-approved { background: color-mix(in srgb, var(--success) 25%, transparent); }
.ticket-status.a-merged { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.library-foot .count-badge { margin-left: 4px; }

/* ===== Admin console (feature flags) ===== */
.admin-console { width: 760px; border-top: 3px solid var(--accent); }
.admin-scroll { height: 58vh; overflow-y: auto; padding-right: 2px; }
.admin-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--stroke); margin: 4px 0 8px; }
.admin-tab { border: 1px solid transparent; border-bottom: none; border-radius: var(--radius-md) 6px 0 0; background: transparent; padding: 5px 9px;
    margin-bottom: -1px; color: var(--muted); min-height: 0; }
.admin-tab:hover:not(:disabled) { color: var(--text); background: var(--panel-alt); }
.admin-tab.on, .admin-tab.on:hover:not(:disabled) { color: var(--text); font-weight: 600; background: var(--panel); border-color: var(--stroke);
    box-shadow: inset 0 2px 0 var(--accent); }
.admin-tab.empty { opacity: 0.45; }
.admin-tab-count { margin-left: 3px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); font-weight: 400; }
.admin-search { margin: 0 0 6px auto; width: 200px; }
.admin-none { margin: 4px 2px 8px; }
.admin-tag.admin-group-tag { background: var(--panel-alt); color: var(--muted); font-weight: 400; }
.admin-group { margin: 12px 0 5px; }
.admin-group:first-child { margin-top: 2px; }
.admin-list { max-height: none; overflow: visible; }
.admin-feature { align-items: center; }
.admin-feature.off-feature b { color: var(--muted); }
.admin-summary { color: var(--text); }
.admin-feature.off-feature .admin-summary { color: var(--muted); }
.admin-buttons { max-width: none; flex-wrap: nowrap; align-items: center; gap: 6px; }
.admin-buttons .segments, .admin-people .segments { margin: 0; flex-wrap: nowrap; }
.admin-people-button { white-space: nowrap; }
.admin-people-button.open { border-color: var(--accent); }
.admin-search-gap { margin: 0 0 6px auto; }
.setup-summary { margin: 2px 2px 4px; font-weight: 600; }
.setup-item { align-items: flex-start; gap: 8px; }
.setup-item .share-link-text > div + div { margin-top: 2px; }
.setup-item.setup-done b { color: var(--muted); }
.setup-mark { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: calc(11px * var(--ui-font, 1)); border: 1px solid var(--stroke); color: var(--muted); }
.setup-mark.done { background: var(--success); border-color: var(--success); color: #fff; }
.setup-mark.ready { border-color: var(--accent); color: var(--accent); }
.setup-mark.unknown { border-style: dashed; }
.setup-mark.small-mark { width: 14px; height: 14px; margin: 0 6px 0 0; font-size: calc(9px * var(--ui-font, 1)); }
.setup-ready { color: var(--accent); font-weight: 600; }
.setup-more { padding: 6px 8px; }
.setup-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 3px 10px; padding: 0 8px 8px; }
.setup-migration { display: flex; align-items: center; color: var(--muted); }
.setup-migration.todo { color: var(--text); font-weight: 600; }
.admin-tag { margin-left: 6px; padding: 1px 6px; border-radius: var(--radius-lg); font-size: calc(11px * var(--ui-font, 1)); font-weight: 600;
             background: var(--accent-soft); color: var(--text); vertical-align: 1px; }
.admin-people { background: var(--panel-alt); border-bottom: 1px solid var(--stroke); padding: 4px 10px 6px 22px; }
.admin-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; }
.admin-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-who { max-width: 360px; margin-bottom: 8px; }
.admin-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; vertical-align: -3px; }
.admin-label { margin-left: 4px; }
@media (max-width: 1700px) { .admin-label { display: none; } .admin-button { padding-left: 6px; padding-right: 6px; } }
@media (max-width: 800px) { .admin-feature { flex-direction: column; align-items: stretch; } .admin-buttons { justify-content: flex-start; flex-wrap: wrap; } }

/* Loose gear drawn from its manufacturer's 3D model (Services/GearImages.cs): the picture instead of a face, with
   its TLA on a tag, and only an outline when it's selected or has a problem. */
.gear.modelled { background: transparent !important; border-color: transparent; overflow: visible; }
.gear.modelled.selected { border-color: var(--selection); }
.gear.modelled.error { border-color: var(--error); }
.gear-model { position: absolute; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
/* In dark mode a thin light rim round each modelled picture, so black screens and cases don't melt into the canvas. */
[data-theme=dark] .gear-model { filter: drop-shadow(0 0 0.7px #AEB5C4) drop-shadow(0 0 0.7px #AEB5C4); }
.gear-model-tag {
    position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
    padding: 0 4px; border-radius: var(--radius-sm); background: rgba(20, 22, 28, 0.62); color: #fff;
    font-size: calc(10px * var(--ui-font, 1)); line-height: 14px; white-space: nowrap; pointer-events: none;
}
.desk-gear-model { cursor: pointer; }
.desk-gear-side.outline-only { fill: none; }
.plan-gear-model { position: absolute; inset: 0; pointer-events: none; }
.plan-desk-gear.modelled { overflow: visible; }
/* TLA, UID, maker and model just below modelled gear in the plan */
.plan-gear-caption {
    position: absolute; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 2px 6px; border-radius: var(--radius-sm); background: rgba(20, 22, 28, 0.72); color: #fff;
    line-height: 1.15; white-space: nowrap; pointer-events: none; z-index: 2;
}
.plan-gear-caption b { font-weight: 600; }

/* Checks before export */
.check-badge { display: inline-block; padding: 1px 6px; border-radius: var(--radius-lg); font-size: calc(11px * var(--ui-font, 1)); font-weight: 700; white-space: nowrap; border: 1px solid currentColor; }
.check-badge.error { color: var(--error); }
.check-badge.warning { color: var(--warning); }
.export-checks td { vertical-align: top; }

/* Design checks before issue (DesignChecksDialog) */
.design-filters { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 6px; }
.design-checks .design-heading { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; margin-top: 6px; border: 0; border-bottom: 1px solid var(--stroke); background: none; color: var(--text); font-weight: 600; text-align: left; cursor: pointer; }
.design-checks .design-heading:first-child { margin-top: 0; }
.design-checks .design-heading:hover { background: var(--panel-alt); }
.design-checks .design-fold { width: 12px; color: var(--muted); }
.design-checks .export-checks td:nth-child(2) { color: var(--muted); }

/* Import floor plan (Components/FloorPlanImport.razor) */
.floorplan-dialog { display: flex; flex-direction: column; height: min(860px, 92vh); }
.floorplan-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; margin-top: 8px; }
.floorplan-preview-wrap { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.floorplan-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.floorplan-tools-right { margin-left: auto; display: flex; gap: 4px; }
.floorplan-preview { flex: 1; min-height: 240px; width: 100%; background: #FFFFFF; border: 1px solid var(--stroke); border-radius: var(--radius-sm); touch-action: none; user-select: none; }
.floorplan-preview.mode-pan { cursor: grab; }
.floorplan-preview.mode-room, .floorplan-preview.mode-leaveout, .floorplan-preview.mode-lineup,
.floorplan-preview.mode-label, .floorplan-preview.mode-measure, .floorplan-preview.mode-trace { cursor: crosshair; }
.floorplan-hint { margin-top: 4px; }
.floorplan-side { overflow-y: auto; min-height: 0; padding-right: 4px; }
.floorplan-section { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.floorplan-found { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.floorplan-warning { color: var(--warning, #B5521B); }
.floorplan-claude { margin: 0; padding: 6px 8px; border-left: 3px solid var(--accent); background: var(--panel-alt); border-radius: var(--radius-sm); }
.floorplan-notes { width: 100%; box-sizing: border-box; font: inherit; font-size: calc(12px * var(--ui-font, 1)); resize: vertical; }
.floorplan-layers { align-items: stretch; }
.floorplan-layer { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 112px; align-items: center; gap: 6px; font-size: calc(12px * var(--ui-font, 1)); }
.floorplan-layer .fp-swatch { width: 12px; height: 12px; border-radius: var(--radius-sm); }
.floorplan-layer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floorplan-layer select { font-size: calc(11px * var(--ui-font, 1)); }
.inline-field { display: inline-flex; align-items: center; gap: 4px; }
.inline-field input[type=number] { width: 72px; }
.spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
/* The plan is always drawn black on white, like the paper it came from, in both themes */
.fp-text { fill: #333; font-family: Arial, sans-serif; }
.fp-fade { fill: #FFFFFF; opacity: 0.7; pointer-events: none; }
.fp-margin { fill: none; stroke: #4B8BFF; stroke-width: 1px; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-room { fill: rgba(0, 80, 255, 0.05); stroke: #0050FF; stroke-width: 2px; stroke-dasharray: 8 5; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-leave { fill: rgba(230, 0, 0, 0.12); stroke: #E00000; stroke-width: 1.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-lineup { fill: #00B050; stroke: #FFFFFF; stroke-width: 1.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-lineup-row { stroke: #00B050; stroke-width: 3px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-lineup-front { stroke: #00B050; stroke-width: 2px; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-label { fill: #0050FF; font-family: Arial, sans-serif; font-weight: 700; pointer-events: none; }
.fp-match { fill: none; stroke: #FF8C00; stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-measure { fill: #FF8C00; pointer-events: none; }
.fp-measure-line { stroke: #FF8C00; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.fp-trace { fill: none; stroke: #D62728; stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }

/* ===== Navigation settings (View, Settings): crosshairs and panning ===== */
.nav-cross, .nav-cross * { cursor: crosshair !important; }
.nav-panning, .nav-panning * { cursor: move !important; }
.nav-crosshair { position: fixed; pointer-events: none; overflow: hidden; z-index: 16; }
.nav-crosshair-h, .nav-crosshair-v { position: absolute; background: var(--accent); opacity: 0.8; }
.nav-crosshair-h { height: 1px; }
.nav-crosshair-v { width: 1px; }
.nav-size { display: flex; align-items: center; gap: 6px; }
.nav-size input { flex: 1; min-width: 0; }
.nav-size-readout { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.nav-settings { width: 700px; max-width: calc(100vw - 32px); }
.nav-settings:has(.nav-table th:nth-child(5)) { width: 880px; }
.nav-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: calc(12px * var(--ui-font, 1)); }
.nav-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); padding: 4px 6px; }
.nav-table td { padding: 4px 6px; vertical-align: middle; }
.nav-table td:first-child { color: var(--text); white-space: nowrap; }
.nav-table select { width: 100%; font-size: calc(12px * var(--ui-font, 1)); }
.nav-table tr + tr td { border-top: 1px solid var(--stroke); }
.nav-section-title { margin: 14px 0 2px; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.nav-theme { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.nav-dyn { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.nav-dyn label { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.nav-dyn label.sub { padding-left: 22px; }
.nav-dyn label.off { opacity: .55; }
.nav-hint { margin-top: 10px; }
.nav-defaults { margin-right: auto; }
/* ----- Tape and Dimension tools (Components/MeasureTools.razor, js/measure.js) ----- */
:root, [data-theme=light] {
    --measure-dim: #1F5FA8;
    --measure-dim-back: #FFFFFFE6;
    --measure-tape: #D9480F;
    --measure-tape-back: #FFF4E6F2;
}
[data-theme=dark] {
    --measure-dim: #7FB3F0;
    --measure-dim-back: #1D212FE6;
    --measure-tape: #FF922B;
    --measure-tape-back: #2B2118F2;
}
.measure-tools { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.measure-tools .segment { display: inline-flex; align-items: center; gap: 5px; }
.measure-tools svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.measure-tools .tool.glyph { display: inline-flex; align-items: center; padding: 0 6px; }
.measure-show.off { opacity: 0.6; }
.measure-note { color: var(--warning); font-size: calc(12px * var(--ui-font, 1)); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.measure-layer { position: fixed; z-index: 15; pointer-events: none; overflow: hidden; display: none; }
.measure-layer svg { display: block; overflow: visible; }
.measure-layer .measure-line, .measure-layer .measure-ext, .measure-layer .measure-tick { stroke: var(--measure-dim); fill: none; }
.measure-layer .measure-line { stroke-width: 1.3; }
.measure-layer .measure-ext { stroke-width: 0.9; }
.measure-layer .measure-tick { stroke-width: 1.8; }
.measure-layer .measure-label text { fill: var(--measure-dim); font-weight: 600; font-family: inherit; }
.measure-layer .measure-label-back { fill: var(--measure-dim-back); }
.measure-layer .measure-dim.selected .measure-line, .measure-layer .measure-dim.selected .measure-ext,
.measure-layer .measure-dim.selected .measure-tick { stroke: var(--selection); stroke-width: 2.2; }
.measure-layer .measure-dim.selected .measure-label text { fill: var(--selection); }
.measure-layer .measure-dim.draft { opacity: 0.75; }
.measure-layer .measure-dim.hovered .measure-line, .measure-layer .measure-dim.hovered .measure-tick { stroke-width: 2.2; }
main.lineup:has(.measure-layer.dim-hover) .elevation-scroll *,
main.lineup:has(.measure-layer.dim-hover) .plan-scroll * { cursor: pointer !important; }
.measure-layer .measure-delete { pointer-events: auto; cursor: pointer; }
.measure-layer .measure-delete circle { fill: var(--error); }
.measure-layer .measure-delete path { stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.measure-layer .measure-tape-line { stroke: var(--measure-tape); stroke-width: 1.6; stroke-dasharray: 6 3; fill: none; }
.measure-layer .measure-tape-end { fill: var(--measure-tape); }
.measure-layer .measure-label.tape text { fill: var(--measure-tape); }
.measure-layer .measure-label.tape .measure-label-back { fill: var(--measure-tape-back); stroke: var(--measure-tape); stroke-width: 0.8; }
.measure-layer .measure-snap { fill: none; stroke: var(--muted); stroke-width: 1; }
.measure-layer .measure-snap.on { stroke: var(--measure-tape); stroke-width: 1.6; }
main.lineup:has(.measure-layer.tool-on) .elevation-scroll,
main.lineup:has(.measure-layer.tool-on) .elevation-scroll *,
main.lineup:has(.measure-layer.tool-on) .plan-scroll,
main.lineup:has(.measure-layer.tool-on) .plan-scroll * { cursor: crosshair !important; }
.nav-theme .segments { flex-wrap: nowrap; flex: none; }

/* ===== Sheets: paper layouts with a title block and viewports (Components/SheetsView.razor) ===== */

.sheets { flex: 1; min-height: 0; display: flex; }
.sheets-side { width: 260px; flex: none; overflow: hidden; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--stroke); }
.sheets-pane { flex: none; height: 300px; min-height: 48px; overflow: auto; padding: 10px 12px; }
.sheets-pane[data-pane="1"] { height: 260px; }
.sheets-pane.fill { flex: 1; height: auto; }
.sheets-split { flex: none; height: 7px; cursor: row-resize; background: var(--panel-alt); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); touch-action: none; position: relative; }
.sheets-split::after { content: ""; position: absolute; left: 50%; top: 2px; width: 28px; height: 1px; margin-left: -14px; border-top: 1px solid var(--muted); border-bottom: 1px solid var(--muted); opacity: .6; }
.sheets-split:hover, .sheets-split.dragging { background: var(--accent); }
.sheets-side .section-header { margin-top: 14px; }
.sheets-side .section-header:first-child { margin-top: 0; }
.sheets-pane > .section-header:first-child { margin-top: 0; }
.sheets-side .button-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sheet-list { border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.sheet-list:empty { display: none; }
.sheet-row { display: flex; gap: 8px; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid var(--stroke); }
.sheet-row:last-child { border-bottom: none; }
.sheet-row:hover { background: var(--panel-alt); }
.sheet-row.selected { background: var(--active-nav); }
.sheet-number { font-weight: 600; min-width: 46px; font-variant-numeric: tabular-nums; }
.sheet-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.sheet-fields { display: flex; flex-direction: column; gap: 7px; }
.sheet-fields label:not(.check) { display: flex; flex-direction: column; gap: 3px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.sheet-fields label.check { font-size: calc(12px * var(--ui-font, 1)); margin: 0; }
.sheet-fields .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sheet-fields .button-row { margin-top: 2px; }

.sheets-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheets-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--stroke); background: var(--panel); min-height: 40px; }
.sheets-bar .divider { width: 1px; align-self: stretch; background: var(--stroke); margin: 2px 4px; }
.sheets-add { width: auto; max-width: 260px; }
.sheets-inside { background: var(--accent); color: var(--on-accent); }
.sheets-inside.locked { background: var(--warning); }

.sheets-canvas { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #8b9099; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; cursor: default; }
[data-theme=dark] .sheets-canvas { background: #2b2f37; }
/* The drag under way is a "drag-" class: as a bare class, "pick-box" made the whole canvas the fixed, tinted pick box on every press (the sheet flashed). */
.sheets-canvas.drag-pan-sheet, .sheets-canvas.drag-pan-view { cursor: grabbing; }
.sheets-canvas.drag-move { cursor: move; }
.sheets-canvas.inside { cursor: crosshair; }
.sheets-canvas > .empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; color: #fff; }
.sheets-canvas > .empty-state .muted { color: #e8eaee; max-width: 460px; margin-left: auto; margin-right: auto; }
.sheet-svg { display: block; position: absolute; inset: 0; }
.sheet-paper { fill: #fff; }
.sheet-shadow { fill: rgba(0, 0, 0, 0.35); }
.sheet-dim { fill: rgba(40, 44, 52, 0.28); pointer-events: none; }
.vp-frame { fill: transparent; stroke: #9aa3b2; stroke-width: 1px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.vp-frame.selected { stroke: #2f6fde; stroke-dasharray: none; stroke-width: 1.5px; }
.vp-frame.active { stroke: #2f6fde; stroke-dasharray: none; stroke-width: 3px; }
.vp-frame.locked:not(.selected):not(.active) { stroke: #c08a00; }
.vp-handle { fill: #fff; stroke: #2f6fde; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.vp-handle.title-grip { fill: #2f6fde; cursor: move; }
.temp-dim line { stroke: #2f6fde; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.temp-dim text { fill: #2f6fde; font-family: Arial, Helvetica, sans-serif; }
.temp-dim text.dim-value { cursor: text; text-decoration: underline dotted; }
.temp-dim text.dim-value:hover { fill: #123f99; font-weight: 700; }
.dim-edit { position: absolute; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 3px 6px; background: var(--panel, #fff); border: 1px solid #2f6fde; border-radius: var(--radius-md); box-shadow: 0 4px 12px rgba(0,0,0,.2); transform: translate(-50%, -120%); font-size: calc(12px * var(--ui-font, 1)); }
.dim-edit input { width: 70px; font: inherit; padding: 2px 4px; }
.temp-eq { cursor: pointer; }
.temp-eq rect { fill: #fff; stroke: #2f6fde; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.temp-eq text { fill: #2f6fde; font-family: Arial, Helvetica, sans-serif; font-weight: 700; }
.temp-eq:hover rect { fill: #2f6fde; }
.temp-eq:hover text { fill: #fff; }
.snap-guide { stroke: #e0458b; stroke-width: 1px; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.vp-lock rect, .vp-lock path { fill: none; stroke: #c08a00; stroke-width: 1.4px; }
.vp-lock rect { fill: #fff8e1; }
.cloud-pick { fill: none; stroke: #2f6fde; stroke-width: 1.5px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.cloud-draft { fill: rgba(214, 51, 31, 0.06); stroke: #d6331f; stroke-width: 1px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.sheets-bar .tool.on { background: var(--accent); color: var(--on-accent); }
.vp-pick { fill: rgba(47, 111, 222, 0.14); stroke: #2f6fde; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.vp-missing { fill: #c62828; font-family: Arial, Helvetica, sans-serif; }
.hull-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.hull-checks > span { flex-basis: 100%; }
.hull-checks label.check { color: var(--text); font-size: calc(12px * var(--ui-font, 1)); }
.sheet-fields .triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.sheet-revisions { width: min(1100px, 96vw); max-width: none; }
.sheet-revisions h3 { margin: 0 0 4px; }
.rev-scroll { max-height: 50vh; overflow: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); margin: 10px 0; }
.rev-table { width: 100%; border-collapse: collapse; }
.rev-table th { position: sticky; top: 0; background: var(--panel-alt); font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--stroke); }
.rev-table td { padding: 3px 4px; border-bottom: 1px solid var(--stroke); }
.rev-table tr.selected td { background: var(--active-nav); }
.rev-table input:not([type=checkbox]), .rev-table select { width: 100%; min-width: 70px; }
.rev-table .rev-number { font-weight: 600; text-align: center; width: 60px; }
.rev-table .rev-check { text-align: center; }
.sheet-revisions .button-row { display: flex; gap: 6px; align-items: center; }
/* Changes since a revision was issued (views.sheet-track-changes). Red as the clouds are. */
.track-box { border: 1px solid var(--stroke); border-left: 3px solid #D0312D; border-radius: var(--radius-sm); padding: 6px 8px; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.track-box.full { margin-top: 12px; }
.track-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.track-count { display: flex; gap: 8px; flex-wrap: wrap; }
.track-open { color: #D0312D; font-weight: 600; }
.track-done { color: var(--accent); }
.track-problem { color: #D0312D; }
.track-list { list-style: none; margin: 4px 0; padding: 0; max-height: 34vh; overflow: auto; border-top: 1px solid var(--stroke); }
.track-list li { padding: 4px 2px; border-bottom: 1px solid var(--stroke); display: grid; grid-template-columns: 1fr auto; gap: 0 8px; }
.track-list li > div { grid-column: 1 / -1; }
.track-list li button.link { background: none; border: none; padding: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.track-list li button.link:not(:disabled):hover { text-decoration: underline; }
.track-list .track-state { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.track-list li.open .track-state { color: #D0312D; font-weight: 600; }
.track-list li.clouded .track-state { color: var(--accent); }
.track-was { overflow-wrap: anywhere; }
.track-box .check { display: flex; gap: 6px; align-items: center; }
.sheet-revisions .spacer { flex: 1; }
/* ----- Offline mode ----- */
.dialog-buttons.left { flex-direction: row; flex-wrap: wrap; margin-top: 4px; }
.live-status.offline::before { background: var(--warning); }
.offline-conflicts td { vertical-align: middle; }
.app-update {
    position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 2000;
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-md);
    background: var(--panel); color: var(--text); border: 1px solid var(--stroke);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); font-size: calc(13px * var(--ui-font, 1));
}
.app-update button { min-height: 24px; }
/* The Section panel in the 3D view (Components/SectionTools.razor), top left over the view like Navisworks' Sectioning Tools. */
.section-tools {
    position: absolute; top: 10px; left: 10px; z-index: 4; width: 290px; max-height: calc(100% - 50px); overflow: auto;
    display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px;
    background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-size: calc(12px * var(--ui-font, 1));
}
.section-tools-head { display: flex; align-items: center; gap: 8px; }
.section-tools-head .check { margin: 0 0 0 auto; }
.section-tools-title { font-weight: 600; font-size: calc(13px * var(--ui-font, 1)); }
.section-tabs { align-self: flex-start; }
.section-group { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--stroke); }
.section-group .check { margin-top: 0; }
.section-group-title { font-size: calc(10px * var(--ui-font, 1)); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.section-add { display: flex; flex-direction: column; gap: 4px; }
.section-empty { padding: 4px 0; }
.section-plane { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--stroke); border-radius: var(--radius-md); cursor: pointer; }
.section-plane.picked { border-color: #2f81f7; box-shadow: inset 3px 0 0 #2f81f7; }
.section-plane.off { opacity: 0.6; }
.section-plane-row { display: flex; align-items: center; gap: 6px; }
.section-plane-row select { width: auto; min-width: 0; flex: none; }
.section-plane-row input[type=range] { flex: 1; min-width: 0; }
.section-name { flex: 1; min-width: 0; }
.section-mm { width: 74px; flex: none; }
.section-box-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px 6px; align-items: center; }
.section-box-grid input { min-width: 0; }
.section-note { line-height: 1.35; }
.view3d.sections-open .view3d-notes { left: 312px; }

/* Auto number, the full version (NumberingPanel.razor): fields in use and each one's options, as Spotlight Numbering */
.numbering-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.numbering-row > .field { margin: 0; }
.numbering-row > span.field { align-self: center; min-width: 44px; }
.numbering-settings select { min-width: 200px; }
.numbering-inline { margin-top: 4px; }
.numbering-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; margin-bottom: 10px; }
.numbering-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.numbering-list { border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); min-height: 150px; max-height: 220px; overflow: auto; padding: 3px; display: flex; flex-direction: column; gap: 2px; margin: 3px 0 6px; }
.numbering-item { display: flex; align-items: center; gap: 6px; justify-content: space-between; text-align: left; border: none; background: transparent; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-size: calc(12px * var(--ui-font, 1)); }
.numbering-item:hover { background: var(--accent-soft); }
.numbering-item.on { background: var(--accent); color: var(--on-accent); }
.numbering-item.on .muted { color: var(--on-accent); opacity: .85; }
.numbering-item .icon { padding: 0 4px; min-height: 18px; }
.numbering-item.on .icon { color: var(--on-accent); }
.numbering-options { border: 1px solid var(--stroke); border-radius: var(--radius-md); padding: 6px 10px 10px; }
.numbering-quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.numbering-quad input { width: 100%; box-sizing: border-box; }
.numbering-digits { display: inline-block; margin-left: 10px; }
.numbering-io { display: inline-flex; margin-left: 10px; }
.numbering-digits input { width: 60px; }
.numbering-mode { margin: 8px 0 4px; }
.numbering-step { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 4px; }
.numbering-step input { width: 80px; }
.numbering-preview { margin: 8px 0 0; padding: 6px 8px; background: var(--panel-alt); border-radius: var(--radius-md); max-height: 120px; overflow: auto; }
.numbering-banner { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 8px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent); }
.numbering-banner button { min-height: 22px; padding: 1px 9px; }
@media (max-width: 720px) {
    .numbering-grid, .numbering-lists { grid-template-columns: 1fr; }
    .numbering-quad { grid-template-columns: 1fr 1fr; }
}

/* ===== iPad and touch screens (feature views.touch, js/touch.js sets .touch-ui on <html>) ===== */

/* The drawer tabs only show on an upright iPad (below). */
.drawer-tabs, .drawer-scrim { display: none; }

/* No double-tap zoom or text picking on the controls; fields still select their text. The drawings take every
   finger themselves: one draws a lasso or drags gear, two pinch and pan (js/touch.js). */
.touch-ui, .touch-ui body { touch-action: manipulation; }
.touch-ui body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.touch-ui input, .touch-ui textarea, .touch-ui [contenteditable=true] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.touch-ui .elevation-scroll, .touch-ui .plan-scroll { touch-action: none; }
.touch-ui [draggable=true] { -webkit-user-drag: none; }
.touch-ui .library-item { touch-action: pan-y; }

/* Bigger targets for a finger */
.touch-ui button, .touch-ui .button { min-height: 34px; }
.touch-ui button.link { min-height: 0; padding: 4px 0; }
.touch-ui .tool.glyph { min-width: 34px; justify-content: center; }
.touch-ui .segment { min-height: 32px; padding: 2px 12px; }
.touch-ui input, .touch-ui select { min-height: 34px; }
.touch-ui input[type=checkbox], .touch-ui input[type=radio] { width: 20px; height: 20px; min-height: 0; }
.touch-ui input[type=range] { min-height: 30px; }
.touch-ui .dropdown-item { min-height: 42px; }
.touch-ui .menu-item { min-height: 42px; padding: 6px 12px; }
.touch-ui .menu-item .gesture { display: none; }
.touch-ui .tab { min-height: 36px; }
.touch-ui .tab-close { min-height: 30px; min-width: 30px; font-size: calc(12px * var(--ui-font, 1)); justify-content: center; }
.touch-ui .menu { max-width: calc(100vw - 16px); }

/* A finger's drag: the gear follows it, red where it can't go */
.touch-ghost { pointer-events: none !important; z-index: 1000; opacity: 0.85; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.touch-ghost.no-drop { opacity: 0.5; outline: 2px solid var(--error); }
.touch-dragging, .touch-dragging * { cursor: grabbing !important; }

/* A long press shows a ring as the menu opens */
.touch-ring { position: fixed; z-index: 1000; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 3px solid var(--accent); pointer-events: none; animation: touch-ring 0.45s ease-out forwards; }
@keyframes touch-ring { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.2); opacity: 0; } }

/* Landscape iPads: a little more room for the lineup */
@media (max-width: 1300px) {
    .touch-ui .workspace { grid-template-columns: 250px minmax(0, 1fr) 300px; }
    .touch-ui .workspace.no-library { grid-template-columns: minmax(0, 1fr) 300px; }
    .touch-ui .workspace.no-details { grid-template-columns: 250px minmax(0, 1fr); }
    .touch-ui .workspace.no-library.no-details { grid-template-columns: minmax(0, 1fr); }
}

/* Upright iPads: the lineup gets the whole width, and the Library and Properties slide over it as drawers from the
   tabs at the foot of each side. */
@media (max-width: 1100px) {
    .touch-ui .workspace, .touch-ui .workspace.no-library, .touch-ui .workspace.no-details, .touch-ui .workspace.no-library.no-details {
        position: relative; grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; overflow: hidden; padding: 0 10px;
    }
    .touch-ui .workspace > .library, .touch-ui .workspace > .details {
        position: absolute; top: 0; bottom: 0; z-index: 12; width: min(340px, 85vw);
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease-out, visibility 0.2s; visibility: hidden;
    }
    .touch-ui .workspace > .library { left: 0; transform: translateX(-105%); border-right: 1px solid var(--stroke); }
    .touch-ui .workspace > .details { right: 0; transform: translateX(105%); padding: 10px; background: var(--window); border-left: 1px solid var(--stroke); }
    .touch-ui .workspace.drawer-library > .library, .touch-ui .workspace.drawer-details > .details { transform: none; visibility: visible; }
    .touch-ui .workspace.drawer-library > .drawer-scrim, .touch-ui .workspace.drawer-details > .drawer-scrim {
        display: block; position: absolute; inset: 0; z-index: 11; background: rgba(0, 0, 0, 0.18);
    }
    .touch-ui .drawer-tabs { display: block; }
    .touch-ui .drawer-tab {
        position: absolute; bottom: 14px; left: 20px; z-index: 13; min-height: 40px; padding: 4px 16px; border-radius: 20px;
        background: var(--panel); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); font-weight: 600;
    }
    .touch-ui .drawer-tab.right { left: auto; right: 20px; }
    .touch-ui .drawer-tab.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
    .touch-ui .workspace.drawer-library .drawer-tab:not(.right) { left: calc(min(340px, 85vw) + 12px); }
    .touch-ui .workspace.drawer-details .drawer-tab.right { right: calc(min(340px, 85vw) + 12px); }
    /* While gear is dragged out of the library, the drawer stays out of the way. */
    .touch-dragging .workspace > .library { transform: translateX(-105%); visibility: hidden; }
}

/* ===== Several racks picked (views.pick-several-racks) ===== */

.rack.picked { border-color: var(--accent); background: var(--panel); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-rack.picked .plan-rack-body { fill: var(--accent-soft); stroke: var(--selection); stroke-width: 3px; }
.plan-rack.picked .plan-rack-body.desk { fill: transparent; }
.plan-rack.picked .plan-front, .plan-rack.picked .plan-front-marker { stroke: var(--selection); }
.plan-rack.picked .plan-front-marker { fill: var(--selection); }
/* AutoCAD's selection window: left to right (solid, blue) catches what's wholly inside; right to left (dashed, green) catches what it touches. */
.pick-box { position: fixed; z-index: 40; pointer-events: none; border: 1px solid #2F6FD6; background: rgba(47, 111, 214, 0.12); }
.rack-drop-line { position: fixed; z-index: 40; pointer-events: none; width: 4px; border-radius: var(--radius-sm); background: #2F6FD6; box-shadow: 0 0 0 1px rgba(255,255,255,0.6); }
.rack-drop-line.none { display: none; }
.rack.rack-dragging { opacity: 0.55; }
[data-rack-drag="on"] .rack-head { cursor: grab; }
.pick-box.crossing { border: 1px dashed #2E9B4F; background: rgba(46, 155, 79, 0.12); }
.pick-banner { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 8px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent); }
.pick-banner button { min-height: 22px; padding: 1px 9px; }
.archived-banner { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 8px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--text); border: 1px solid var(--warning); }
.archived-banner b { text-transform: uppercase; letter-spacing: 0.06em; font-size: calc(11px * var(--ui-font, 1)); }
.status-pill.archived, .hub-status.archived { display: inline-block; padding: 0 7px; border-radius: var(--radius-lg); font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--text); border: 1px solid var(--warning); vertical-align: middle; }
.hub-status.active { display: inline-block; padding: 0 7px; border-radius: var(--radius-lg); font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: var(--accent-soft); border: 1px solid var(--accent); vertical-align: middle; }
.picked-racks .picked-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.picked-racks .picked-list .chip { cursor: pointer; font-size: calc(11px * var(--ui-font, 1)); }
.touch-ui .pick-banner button { min-height: 34px; padding: 4px 14px; }

/* ===== CAD-style workspace (feature views.cad-shell): ribbon, Project Browser, palette, command line, status bar ===== */

.cad-shell { --shell-chrome: var(--window); --shell-line: var(--stroke); font-size: calc(12px * var(--ui-font, 1)); }
.cad-shell svg path { vector-effect: non-scaling-stroke; }

/* Title bar with the quick access buttons */
.shell-title { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--stroke); }
.shell-brand { display: flex; align-items: center; gap: 7px; font-size: calc(12px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.06em; padding-right: 8px; }
/* The Clark mark and the module's name, top left in every module (Components/AppBrand.razor). */
.app-brand { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: calc(12px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.06em; color: var(--text); white-space: nowrap; padding-right: 8px; }
.app-mark { width: 20px; height: 20px; overflow: visible; flex: none; }
/* The workspace keeps icon lines thin at any zoom (.cad-shell svg path); the mark's outline must scale with it instead,
   or its 8-unit stroke turns into 8 screen pixels and fills the triangle in. */
.cad-shell .app-mark path { vector-effect: none; }
.app-brand.to-home { cursor: pointer; }
.app-brand.to-home:hover .app-brand-name { color: var(--accent); }
.pdfr-title .app-brand { padding: 0 8px 0 2px; }
.shell-qat { display: flex; gap: 1px; padding-left: 8px; border-left: 1px solid var(--stroke); }
.shell-icon { position: relative; border: none; background: transparent; min-height: 26px; width: 28px; padding: 0; justify-content: center; color: var(--muted); }
.shell-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.shell-icon:hover:not(:disabled) { color: var(--text); }
.shell-icon .count-badge { position: absolute; top: 0; right: -2px; transform: scale(0.85); }
.shell-doc { flex: 1; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-doc b { color: var(--text); font-weight: 600; }
.shell-right { display: flex; align-items: center; gap: 2px; }
.shell-signin { border: none; background: transparent; color: var(--muted); }

/* Ribbon */
.ribbon-tabs { display: flex; align-items: flex-end; gap: 2px; height: calc(28px * var(--ui-font, 1)); padding: 0 8px; background: var(--window); }
.ribbon-tab { border: 1px solid transparent; border-bottom: none; border-radius: var(--radius-md) 5px 0 0; background: transparent; min-height: 25px; padding: 2px 13px; color: var(--muted); font-weight: 500; }
.ribbon-tab:hover:not(:disabled) { background: transparent; color: var(--text); }
.ribbon-tab.on { background: var(--panel); color: var(--text); border-color: var(--stroke); margin-bottom: -1px; position: relative; z-index: 1; }
.ribbon-tab.context { color: #2f8f6a; font-weight: 600; position: relative; }
.ribbon-tab.context::before { content: ""; position: absolute; left: 4px; right: 4px; top: 0; height: 3px; border-radius: var(--radius-sm); background: #2f8f6a; }
[data-theme=dark] .ribbon-tab.context { color: #4fc095; }
[data-theme=dark] .ribbon-tab.context::before { background: #4fc095; }
.ribbon-spacer { flex: 1; }
.ribbon-fold { border: none; background: transparent; color: var(--muted); min-height: 24px; padding: 0 8px; }
.ribbon { display: flex; align-items: stretch; height: calc(92px * var(--ui-font, 1)); padding: 5px 6px 0; background: var(--panel); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); overflow-x: auto; overflow-y: hidden; }
.cad-shell .ribbon-tabs + .ribbon, .cad-shell .ribbon-tabs { position: relative; }
.rp { display: flex; flex-direction: column; padding: 0 6px; border-right: 1px solid var(--stroke); flex: none; }
.rp:last-child { border-right: none; }
.rp.idle .rp-items { opacity: 0.75; }
.rp-items { display: flex; align-items: flex-start; gap: 2px; flex: 1; }
.rp-label { text-align: center; font-size: calc(11px * var(--ui-font, 1)); color: var(--section-label); padding: 2px 0 4px; white-space: nowrap; }
/* At most three small buttons a column: a fourth or fifth starts a new column, so none drops below the ribbon. */
.rp-stack { display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; grid-auto-columns: max-content; gap: 1px 2px; align-content: start; }
.rb-big { flex-direction: column; justify-content: flex-start; gap: 3px; min-width: 52px; max-width: 76px; min-height: 64px; padding: 5px 6px 3px; border: 1px solid transparent; background: transparent; font-size: calc(11px * var(--ui-font, 1)); line-height: 1.15; text-align: center; white-space: normal; }
.rb-big svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rb-small { gap: 6px; min-height: 22px; padding: 1px 8px 1px 5px; border: 1px solid transparent; background: transparent; font-size: calc(11px * var(--ui-font, 1)); white-space: nowrap; justify-content: flex-start; }
.rb-small svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rb-big:hover:not(:disabled), .rb-small:hover:not(:disabled) { background: var(--panel-alt); border-color: var(--stroke); }
.rb-big.on, .rb-small.on, .rb-big.on:hover:not(:disabled), .rb-small.on:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.rb-big .count-badge, .rb-small .count-badge { margin-left: 3px; }
.rp-field { display: flex; align-items: center; gap: 6px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); padding: 1px 4px; }
.rp-field select { min-height: 22px; font-size: calc(11px * var(--ui-font, 1)); padding: 0 4px; width: 92px; }
/* Sheets tab, Views group: Add view… and the sheet zoom (− 66% +), moved up from the strip above the sheet. */
.rb-add-view { min-height: 22px; font-size: calc(11px * var(--ui-font, 1)); padding: 0 4px; width: 150px; margin: 1px 2px; }
.rb-zoom { display: flex; align-items: center; gap: 2px; padding: 0 2px; }
.rb-zoom .rb-small { padding: 1px 8px; font-size: calc(13px * var(--ui-font, 1)); justify-content: center; }
.rb-zoom .zoom-readout { min-width: 40px; text-align: center; font-size: calc(11px * var(--ui-font, 1)); }

/* Left column: Project Browser over the Equipment Library */
.cad-shell .workspace { gap: 0; padding-right: 0; grid-template-columns: 270px minmax(0, 1fr) 310px; }
.cad-shell .workspace.no-library { grid-template-columns: minmax(0, 1fr) 310px; padding-left: 0; }
.cad-shell .workspace.no-details { grid-template-columns: 270px minmax(0, 1fr); }
.cad-shell .workspace.no-library.no-details { grid-template-columns: minmax(0, 1fr); }
.cad-shell .library.shell-left { padding: 0 0 8px; }
.cad-shell .library.shell-left > .section-header { margin: 0 0 8px; padding: 8px 10px 7px; border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); background: var(--window); letter-spacing: 0.08em; }
.cad-shell .library.shell-left > .search, .cad-shell .library.shell-left > .library-list, .cad-shell .library.shell-left > .library-foot { margin-left: 10px; margin-right: 10px; }
.shell-browser { flex: 0 1 auto; max-height: 48%; min-height: 120px; display: flex; flex-direction: column; overflow: hidden; }
.cad-shell .workspace.no-library .shell-browser { max-height: none; }
.library.shell-left:not(:has(.library-list)) .shell-browser { max-height: none; flex: 1; }
.pb-head, .palette-head { display: flex; align-items: center; gap: 7px; height: calc(30px * var(--ui-font, 1)); padding: 0 10px; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label); background: var(--window); border-bottom: 1px solid var(--stroke); flex: none; }
.pb-head svg, .palette-head svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pb-x { margin-left: auto; border: none; background: transparent; min-height: 20px; padding: 0 4px; color: var(--muted); letter-spacing: 0; }
.pb-tree { overflow-y: auto; padding: 4px; flex: 1; min-height: 0; }
.pb-empty { padding: 6px 8px; }
.pb-row { display: flex; align-items: center; gap: 5px; height: 23px; padding-right: 6px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.pb-row:hover { background: var(--panel-alt); }
.pb-row svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pb-row.level0 { padding-left: 2px; font-weight: 600; }
.pb-row.level0.current { color: var(--accent); }
.pb-row.level1 { padding-left: 16px; color: var(--text); }
.pb-row.level1 .pb-twist { width: 12px; }
.pb-row.level2 { padding-left: 42px; }
.pb-row.level2.pb-parent { padding-left: 28px; }
.pb-row.level3 { padding-left: 60px; }
.pb-add { border: none; background: transparent; min-height: 0; padding: 0 4px; font-size: calc(13px * var(--ui-font, 1)); line-height: 1; color: var(--muted); flex: none; }
.pb-row.pb-parent .pb-add { margin-left: auto; }
.pb-row.pb-parent .pb-meta + .pb-add { margin-left: 0; }
.pb-add:hover { color: var(--accent); }
.pb-row.on { background: var(--active-nav); font-weight: 600; }
.pb-row.on svg { stroke: var(--accent); }
.pb-twist { border: none; background: transparent; min-height: 0; width: 14px; padding: 0; font-size: calc(9px * var(--ui-font, 1)); color: var(--section-label); justify-content: center; flex: none; }
.pb-name { overflow: hidden; text-overflow: ellipsis; }
.pb-meta { margin-left: auto; padding-left: 8px; color: var(--section-label); font-size: calc(11px * var(--ui-font, 1)); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pb-close { border: none; background: transparent; min-height: 0; padding: 0 2px; font-size: calc(10px * var(--ui-font, 1)); color: var(--muted); visibility: hidden; }
.pb-row:hover .pb-close { visibility: visible; }

/* Properties palette: grouped two-column rows, as Revit's */
.cad-shell .details { padding: 0; background: var(--panel); border-left: 1px solid var(--stroke); }
.palette-head { position: sticky; top: 0; z-index: 2; }
.palette-type { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--stroke); }
.palette-swatch { width: 30px; height: 36px; flex: none; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: repeating-linear-gradient(var(--panel-alt) 0 5px, var(--stroke) 5px 6px); }
.palette-type-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-type-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-type-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-small { min-height: 22px; padding: 0 8px; font-size: calc(11px * var(--ui-font, 1)); }
.cad-shell .details .card { border: none; border-bottom: 1px solid var(--stroke); border-radius: 0; margin: 0; padding: 0 10px 10px; }
.cad-shell .details .card > .section-header { margin: 0 -10px 4px; padding: 6px 10px; background: var(--window); color: var(--text); font-size: calc(11px * var(--ui-font, 1)); letter-spacing: 0.02em; }
.cad-shell .details label.field { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 4px; }
.cad-shell .details label.field input, .cad-shell .details label.field select { margin-top: 0; }
.cad-shell .details .field-pair { gap: 4px 8px; }
/* Properties: paired fields (TLA/UID, Venue/Purpose, EID/Venue code...) stack one per row
   at full width so long values like ENTF081020 aren't cut off. Button pairs stay side by side. */
.details .field-pair:not(:has(> button)) { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
.cad-shell .details .field-pair:not(:has(> button)) { row-gap: 0; }
.cad-shell .details .field-pair:has(> button) label.field { grid-template-columns: 40px minmax(0, 1fr); }

/* Header band: only the banners and measure layer stay; totals moved to the status bar */
.cad-shell .header-band { padding: 4px 10px; min-height: 0; }
.cad-shell .header-band:not(:has(> *:not(.measure-layer))) { display: none; }
.cad-shell .measure-tools .segments { display: none; }
.cad-shell .center { gap: 0; }
.cad-shell .lineup { margin: 0; border-radius: 0; border-top: none; border-bottom: none; }

/* Command line */
.cmdline { position: relative; background: var(--panel); border-top: 1px solid var(--stroke); font: calc(12px * var(--ui-font, 1))/1.5 "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace; }
.cmd-history { max-height: 3em; overflow-y: auto; padding: 3px 12px 0 38px; color: var(--muted); white-space: pre-wrap; }
.cmdline.tall .cmd-history { max-height: 15em; }
.cmd-row { display: flex; align-items: center; gap: 6px; padding: 2px 10px 4px 6px; cursor: text; }
.cmd-more { border: none; background: transparent; min-height: 20px; width: 24px; padding: 0; color: var(--muted); justify-content: center; }
.cmd-prompt { color: var(--accent); font-weight: 600; white-space: nowrap; }
.cmd-kw { border: none; min-height: 20px; padding: 0 6px; background: rgba(42, 106, 216, 0.12); color: #2a6ad8; border-radius: var(--radius-sm); font: inherit; }
[data-theme=dark] .cmd-kw { background: rgba(91, 155, 255, 0.18); color: #8db8ff; }
.cmd-input { flex: 1; min-width: 80px; border: none; background: transparent; padding: 0; font: inherit; color: var(--text); outline: none; box-shadow: none; }
.cmd-input:focus { outline: none; box-shadow: none; }
.cmd-suggest { position: absolute; left: 36px; bottom: calc(100% - 2px); z-index: 30; width: min(560px, 80vw); background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); padding: 3px; font-family: inherit; }
.cmd-suggest button { display: flex; width: 100%; gap: 10px; align-items: baseline; border: none; background: transparent; justify-content: flex-start; font: inherit; min-height: 24px; }
.cmd-suggest button.on, .cmd-suggest button:hover:not(:disabled) { background: var(--accent-soft); }
.cmd-suggest b { min-width: 96px; text-align: left; }
.cmd-suggest small { color: var(--section-label); min-width: 80px; text-align: left; }
.cmd-suggest span { color: var(--muted); font-family: system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-suggest.all { width: min(760px, 92vw); max-height: min(60vh, 520px); overflow-y: auto; }
.cmd-suggest.all small { min-width: 120px; }
.cmd-list-head { position: sticky; top: -3px; z-index: 1; display: flex; align-items: baseline; gap: 10px; padding: 5px 6px 6px; margin: -3px -3px 3px; background: var(--header-band, var(--panel)); border-bottom: 1px solid var(--stroke); }
.cmd-list-head span { flex: 1; color: var(--muted); font-family: system-ui, sans-serif; }
.cmd-suggest .cmd-list-x { width: auto; flex: none; min-height: 20px; padding: 0 6px; color: var(--muted); }
.cmd-list-none { padding: 8px; color: var(--muted); font-family: system-ui, sans-serif; }

/* Status bar */
.shell-status { display: flex; align-items: stretch; height: calc(26px * var(--ui-font, 1)); background: var(--window); border-top: 1px solid var(--stroke); color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); white-space: nowrap; }
.st-tabs { display: flex; align-items: flex-start; gap: 1px; padding-left: 6px; overflow-x: auto; min-width: 0; max-width: 45%; }
.st-tabs button { border: 1px solid transparent; border-top: none; border-radius: 0 0 4px 4px; background: transparent; min-height: 22px; padding: 0 10px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.st-tabs button.on { background: var(--panel); color: var(--text); font-weight: 600; border-color: var(--stroke); }
.st-tabs .st-add { padding: 0 8px; }
.st-tabs { scrollbar-width: none; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tab-arrows { display: flex; align-items: center; gap: 1px; padding-left: 6px; flex: none; }
.st-tab-arrows button { border: 1px solid transparent; background: transparent; min-height: 20px; min-width: 20px; padding: 0 3px; border-radius: var(--radius-sm); font-size: calc(9px * var(--ui-font, 1)); line-height: 1; color: var(--muted); }
.st-tab-arrows button:hover { border-color: var(--stroke); color: var(--text); background: var(--panel); }
.st-spacer { flex: 1; }
.st-group { display: flex; align-items: center; gap: 3px; padding: 0 8px; border-left: 1px solid var(--stroke); }
.st-coords { font-family: "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace; color: var(--text); min-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.st-toggle { border: 1px solid transparent; background: transparent; min-height: 18px; padding: 0 6px; border-radius: var(--radius-sm); font: 600 calc(10px * var(--ui-font, 1))/1 "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.03em; color: var(--section-label); }
.st-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.st-link { border: none; border-left: 1px solid var(--stroke); border-radius: 0; background: transparent; min-height: 0; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.st-totals { color: var(--text); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.st-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2fa84f; margin-right: 5px; }
.st-dot.dirty { background: var(--warning); }
@media (max-width: 1300px) { .st-totals { display: none; } }

/* 3D view inside the workspace: the ribbon has the bar's buttons; a viewport label and a navigation bar instead */
.view3d.in-shell .vp-label { position: absolute; left: 10px; top: 8px; z-index: 3; font: calc(11px * var(--ui-font, 1)) "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace; color: var(--muted); pointer-events: none; }
.nav-bar3d { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.nav-bar3d.under-cube { top: 150px; transform: none; }
.nav-bar3d button { border: none; background: transparent; width: 28px; min-height: 28px; padding: 0; justify-content: center; color: var(--muted); }
.nav-bar3d button:disabled { opacity: 0.6; cursor: help; }
.nav-bar3d svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.view3d.in-shell .view3d-rack { top: auto; bottom: 12px; }
.cad-shell .library.shell-left > .search { width: calc(100% - 20px); box-sizing: border-box; }
/* Sheets: the sheet list and its buttons are in the Project Browser, the sheet tabs and the ribbon's Sheets tab */
.cad-shell .sheets-pane[data-pane="0"] { display: none; }
.cad-shell .sheets-split[data-split="0"] { display: none; }
/* ===== Drafting view (Components/DraftingView.razor, js/drafting.js): AutoCAD-style 2D drafting ===== */
.drafting { flex: 1; min-height: 0; display: flex; }
.drafting-side { width: 270px; flex: none; overflow: auto; padding: 10px 12px; background: var(--panel); border-right: 1px solid var(--stroke); }
.drafting-side .section-header { margin-top: 16px; }
.drafting-side .section-header:first-child { margin-top: 0; }
.drafting-side .button-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.drafting-name { color: var(--text); flex: 1; }
.drafting-scale { min-width: 0; color: var(--muted); font-weight: 400; font-size: calc(11px * var(--ui-font, 1)); }
.drafting-layers { width: 100%; border-collapse: collapse; font-size: calc(12px * var(--ui-font, 1)); margin-top: 4px; }
.drafting-layers th { font-size: calc(10px * var(--ui-font, 1)); font-weight: 600; color: var(--muted); text-align: left; padding: 2px 3px; }
.drafting-layers td { padding: 2px 3px; border-top: 1px solid var(--stroke); vertical-align: middle; }
.drafting-layers tr.current td { background: var(--accent-soft); }
.drafting-layers input[type=checkbox], .drafting-layers input[type=radio] { margin: 0; }
.drafting-layer-name { width: 100%; min-width: 60px; padding: 2px 4px; font-size: calc(12px * var(--ui-font, 1)); }
.drafting-layer-zero { padding: 0 4px; }
.drafting-color { width: 58px; padding: 1px 2px; font-size: calc(11px * var(--ui-font, 1)); border-left: 12px solid var(--swatch); }

/* Drafting's Properties palette (DraftingPage.razor, views.drafting-properties): AutoCAD's two columns, by group. */
.draft-props { font-size: calc(12px * var(--ui-font, 1)); }
.dp-group-head { display: flex; align-items: center; gap: 5px; width: 100%; padding: 5px 10px; border: 0; border-bottom: 1px solid var(--stroke); border-radius: 0; background: var(--window); color: var(--section-label); font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; cursor: pointer; }
.dp-caret { width: 10px; color: var(--muted); }
.dp-rows { display: grid; grid-template-columns: minmax(80px, 42%) 1fr; }
.dp-row { display: contents; }
.dp-label, .dp-row > .dp-value, .dp-row > .dp-input { border-bottom: 1px solid var(--stroke); min-height: 24px; }
.dp-label { padding: 4px 6px 4px 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--stroke); align-self: stretch; display: flex; align-items: center; }
.dp-value { padding: 4px 6px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; }
.dp-input { width: 100%; min-width: 0; box-sizing: border-box; padding: 2px 6px; font-size: calc(12px * var(--ui-font, 1)); border: 0; border-radius: 0; background: transparent; color: var(--text); }
.dp-input:focus { outline: 1px solid var(--accent); outline-offset: -1px; background: var(--input-bg, var(--window)); }
.dp-input::placeholder { color: var(--muted); }
select.dp-color { border-left: 12px solid var(--swatch); }
.dp-check { margin: 0 6px 0 0; }
.dp-help { padding: 8px 10px; margin: 0; }
.drafting-help { margin-top: 12px; line-height: 1.45; }
.drafting-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drafting-empty { flex: 1; display: flex; background: var(--canvas); }
.drafting-empty .empty-state { max-width: 520px; }
.drafting-ribbon { display: flex; flex-wrap: wrap; gap: 0; padding: 4px 6px 2px; background: var(--panel); border-bottom: 1px solid var(--stroke); }
.drafting-group { display: flex; flex-direction: column; align-items: center; padding: 0 4px; border-right: 1px solid var(--stroke); }
.drafting-group:last-child { border-right: none; }
.drafting-tools { display: flex; flex-wrap: wrap; gap: 1px; align-items: center; min-height: 44px; }
.drafting-group-name { font-size: calc(10px * var(--ui-font, 1)); color: var(--muted); padding: 1px 0 2px; white-space: nowrap; }
.drafting-tool { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 2px; min-width: 40px; border: 1px solid transparent; background: transparent; font-size: calc(10px * var(--ui-font, 1)); line-height: 1.1; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); }
.drafting-tool svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.drafting-tool:hover { background: var(--panel-alt); border-color: var(--stroke); }
.drafting-tool.on { background: var(--active-nav); border-color: var(--accent); }
.drafting-layer-pick { min-width: 110px; max-width: 180px; }
.drafting-canvas { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.dv-canvas { display: block; position: absolute; inset: 0; cursor: none; outline: none; }
.dv-canvas.cross-off { cursor: default; }
.dv-canvas.cross-cursor { cursor: crosshair; }
.dv-canvas.panning { cursor: grabbing; }
.dv-tip { position: absolute; pointer-events: none; padding: 2px 6px; font: calc(11px * var(--ui-font, 1))/1.4 ui-monospace, Menlo, Consolas, monospace; background: rgba(40, 46, 58, .92); color: #f2f4f8; border: 1px solid #5d6577; border-radius: var(--radius-sm); white-space: nowrap; }
.dv-tip[hidden] { display: none; }
.drafting-cmd { flex: none; position: relative; background: var(--panel); border-top: 1px solid var(--stroke); font: calc(12px * var(--ui-font, 1))/1.45 ui-monospace, Menlo, Consolas, monospace; }
.dv-history { max-height: 58px; overflow-y: auto; padding: 3px 8px 0; color: var(--muted); white-space: pre-wrap; }
.dv-history.tall { max-height: 260px; }
.dv-cmdrow { display: flex; align-items: center; gap: 6px; padding: 2px 8px 4px; }
.dv-prompt { flex: none; max-width: 70%; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-input { flex: 1; min-width: 80px; border: none; outline: none; background: transparent; color: var(--text); font: inherit; padding: 2px 0; }
.dv-suggest { position: absolute; left: 8px; bottom: calc(100% + 2px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-sm); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); padding: 2px 0; z-index: 3; }
.dv-suggest[hidden] { display: none; }
.dv-suggest span { padding: 1px 10px; }
.dv-suggest span.first { background: var(--accent-soft); }
.dv-status { display: flex; align-items: center; gap: 2px; padding: 2px 6px; border-top: 1px solid var(--stroke); background: var(--panel-alt); font-family: system-ui, sans-serif; font-size: calc(11px * var(--ui-font, 1)); }
.dv-coords { min-width: 160px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dv-spacer { flex: 1; }
.dv-status button { font: 600 calc(10px * var(--ui-font, 1))/1 system-ui, sans-serif; letter-spacing: .04em; padding: 4px 7px; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: var(--radius-sm); cursor: pointer; }
.dv-status button.on { color: var(--accent); background: var(--active-nav); border-color: var(--accent); }
.dv-osnap-menu { position: absolute; right: 6px; bottom: 28px; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); font-family: system-ui, sans-serif; z-index: 4; }
.dv-osnap-menu[hidden] { display: none; }
.dv-osnap-menu label { display: flex; gap: 6px; align-items: center; }

/* ===== Compact workspace (feature views.compact-workspace), as Fusion and Rhino: one row of grouped tool menus, the
   command line at the top, a floating browser and a history timeline along the bottom ===== */
.compact-bar { display: flex; align-items: center; gap: 4px; height: 50px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--stroke); position: relative; z-index: 40; }
.compact-bar .shell-brand { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-md); background: var(--accent-soft); padding: 0; }
.compact-bar .shell-qat { margin-right: 4px; padding-right: 8px; border-right: 1px solid var(--stroke); }
.compact-bar .shell-doc { flex: 1; min-width: 80px; }
.compact-bar .shell-right { display: flex; align-items: center; gap: 4px; }
.cb-group { position: relative; display: inline-flex; }
.cb-views { height: 30px; padding: 0 10px; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel); font-weight: 600; letter-spacing: 0.04em; font-size: calc(12px * var(--ui-font, 1)); margin-right: 6px; }
.cb-views.open, .cb-views:hover:not(:disabled) { border-color: var(--accent); }
.cb-caret { font-size: calc(9px * var(--ui-font, 1)); color: var(--muted); margin-left: 2px; }
.cb-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 3px 8px 2px; border: none; border-radius: var(--radius-md); background: transparent; color: var(--text); }
.cb-tool:hover, .cb-tool.open { background: var(--accent-soft); }
.cb-icons { display: inline-flex; align-items: center; gap: 3px; }
.cb-icons svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cb-label { font-size: calc(9.5px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label); white-space: nowrap; }
.cb-tool.context .cb-label, .cb-tool.context .cb-icons { color: #2f8f6a; }
[data-theme=dark] .cb-tool.context .cb-label, [data-theme=dark] .cb-tool.context .cb-icons { color: #4fc095; }
.cb-menu, .ribbon.cb-flyout { position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.cb-menu { display: flex; flex-direction: column; min-width: 210px; padding: 4px; }
.cb-menu button { display: flex; align-items: center; gap: 9px; justify-content: flex-start; border: none; background: transparent; min-height: 30px; padding: 0 10px; border-radius: var(--radius-md); font-size: calc(12px * var(--ui-font, 1)); }
.cb-menu button:hover { background: var(--accent-soft); }
.cb-menu button.on { font-weight: 600; color: var(--accent); }
.cb-menu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.ribbon.cb-flyout { width: max-content; max-width: calc(100vw - 40px); padding: 6px 6px 0; }
.cb-scrim { position: fixed; inset: 0; z-index: 35; }
.compact .cmdline { border-top: none; border-bottom: 1px solid var(--stroke); }
.compact .cmd-suggest { top: calc(100% - 2px); bottom: auto; }
.compact .center { position: relative; }
.float-browser { position: absolute; left: 12px; top: 12px; z-index: 20; width: 260px; max-height: calc(100% - 24px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); overflow: hidden; }
.float-browser .pb-tree { overflow: auto; }
/* One slim dark strip like Fusion's, dark in every theme: playback buttons, then an icon per change on a thin track,
   coloured by kind, with a marker after the current change. */
.timeline { --tl-bg: #262a31; --tl-fg: #c9ced6; --tl-dim: #7d8490; --tl-line: #4a505b; --tl-now: #e8eaee;
    position: relative; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 8px;
    background: var(--tl-bg); color: var(--tl-fg); border-top: 1px solid #15181d; box-shadow: inset 0 1px 0 #333842; }
.tl-buttons { display: inline-flex; align-items: center; gap: 0; padding-right: 8px; border-right: 1px solid var(--tl-line); }
.tl-buttons button, .tl-hide { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; min-height: 0; min-width: 0;
    padding: 0; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--tl-fg); cursor: pointer; }
.tl-buttons button:hover:not(:disabled), .tl-hide:hover { background: #3a3f49; color: #fff; }
.tl-buttons button:disabled { color: #555b66; cursor: default; }
.tl-buttons svg { width: 12px; height: 12px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.tl-buttons .tl-play svg { width: 14px; height: 14px; }
.tl-hide { color: var(--tl-dim); }
.tl-hide svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tl-track { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tl-track::-webkit-scrollbar { display: none; }
.tl-empty { color: var(--tl-dim); font-size: calc(11px * var(--ui-font, 1)); }
/* Each change: a 22 px icon over its piece of the track line, with a tick under the icon. */
.tl-step { position: relative; flex: none; width: 24px; height: 28px; padding: 0 0 6px; min-height: 0; border: none; border-radius: 0;
    background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tl-step::before { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--tl-line); }
.tl-step::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 1px; height: 5px; background: var(--tl-line); }
.tl-step svg { width: 18px; height: 18px; border-radius: var(--radius-sm); overflow: visible; }
.tl-step:hover svg { background: #3d434e; box-shadow: 0 0 0 2px #3d434e; }
.tl-glyph { fill: color-mix(in srgb, var(--k) 28%, transparent); stroke: var(--k); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tl-badge { stroke: var(--tl-bg); stroke-width: 1.2; }
.tl-badge.add { fill: #3fb950; }
.tl-badge.remove { fill: #e5534b; }
.tl-badge.move { fill: #8b949e; }
.tl-badge-mark { fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tl-step.undone { opacity: 0.32; }
.tl-step.undone:hover { opacity: 0.7; }
.tl-gear { --k: #4ea1ff; }
.tl-rack { --k: #f0a440; }
.tl-fields { --k: #b8bfca; }
.tl-room { --k: #d8c25a; }
.tl-sheet { --k: #56c58b; }
.tl-draft { --k: #b48cf2; }
.tl-dim { --k: #4cc9c0; }
.tl-other { --k: #9aa3af; }
/* Where you are: a slim handle on the track just after the last change done. */
.tl-marker { position: relative; flex: none; width: 6px; height: 24px; margin: 0 1px; border-radius: var(--radius-sm); background: var(--tl-now);
    box-shadow: 0 0 0 1px #15181d; }
.tl-marker::before { content: ""; position: absolute; left: -2px; top: -1px; border: 5px solid transparent; border-top: 5px solid var(--tl-now); border-bottom: none; }
.tl-count { color: var(--tl-dim); font-size: calc(11px * var(--ui-font, 1)); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 6px; border-left: 1px solid var(--tl-line); }
/* Hover card: what the change was. Fixed so the scrolling track doesn't clip it. */
.tl-tip { position: fixed; z-index: 60; transform: translate(-50%, -100%); max-width: 280px; padding: 6px 9px; border-radius: var(--radius-md); pointer-events: none;
    background: #1b1e23; color: #e6e8ec; border: 1px solid #3a3f49; box-shadow: 0 4px 14px rgba(0,0,0,.45); font-size: calc(12px * var(--ui-font, 1)); line-height: 1.35; }
.tl-tip-head { display: flex; align-items: center; gap: 6px; color: #9aa3af; font-size: calc(11px * var(--ui-font, 1)); text-transform: uppercase; letter-spacing: .04em; }
.tl-tip-dot { width: 8px; height: 8px; border-radius: var(--radius-sm); background: var(--k); }
.tl-tip-what { font-weight: 600; margin: 2px 0; }
.tl-tip-state { color: #9aa3af; }

/* ===== Dockable palettes (feature views.dock-palettes): panels with grips, docked left or right, stacked, tabbed or
   floating; js/dock.js drags them ===== */
.cad-shell .workspace.docked { gap: 0; padding: 0; position: relative; }
.dock { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); }
.dock.left { border-right: 1px solid var(--stroke); }
.dock.right { border-left: 1px solid var(--stroke); }
.dock-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--panel); }
.dock-panel.folded { flex: none; }
.dock-panel.float { position: absolute; z-index: 25; border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.dock-head { display: flex; align-items: stretch; gap: 1px; height: 28px; flex: none; padding-right: 4px; background: var(--window); border-bottom: 1px solid var(--stroke); user-select: none; }
.dock-grip { display: inline-flex; align-items: center; padding: 0 5px 0 7px; color: var(--muted); cursor: grab; font-size: calc(13px * var(--ui-font, 1)); letter-spacing: -2px; touch-action: none; }
.dock-grip:hover { color: var(--accent); }
.dock-tab { border: none; border-radius: 0; background: transparent; padding: 0 8px; min-height: 0; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label); cursor: grab; touch-action: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-tab.on { background: var(--panel); color: var(--text); box-shadow: inset 0 2px 0 var(--accent); }
.dock-tab:not(.on):not(.only):hover { color: var(--text); }
.dock-spacer { flex: 1; }
.dock-btn { border: none; background: transparent; min-height: 0; padding: 0 5px; color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); }
.dock-btn:hover { color: var(--text); }
.dock-body { flex: 1; min-height: 0; display: block; overflow: auto; }
.dock-body[data-palette="library"], .dock-body[data-palette="sheet"], .dock-body[data-palette="drafting"] { display: flex; flex-direction: column; }
.dock-body > .pb-head, .dock-body > .palette-head { display: none; }
.dock-body[data-palette="library"] { overflow-y: auto; padding: 0 0 8px; }
.dock-body[data-palette="library"] > .section-header { display: none; }
.dock-body[data-palette="library"] > .search { margin: 8px 10px; width: calc(100% - 20px); box-sizing: border-box; flex: none; }
.dock-body[data-palette="library"] > .library-list { flex: 1 1 0; min-height: 96px; overflow-y: auto; margin: 0 10px; }
/* Docked, the buttons are a fixed bar at the bottom, with In Drawings (its own scrolling list) above them. Too short
   for all of it, the palette scrolls as a whole: nothing squashes or overlaps. */
.dock-body[data-palette="library"] > .section-header.in-drawings-head { display: flex; flex: none; order: 2; margin: 10px 10px 4px; }
.dock-body[data-palette="library"] > .in-drawings { order: 3; flex: 0 1 auto; max-height: 40%; margin: 0 10px; }
.dock-body[data-palette="library"] > .in-drawings:has(.in-drawings-item) { min-height: 64px; }
.dock-body[data-palette="library"] > .library-foot { order: 4; margin: 8px 10px 0; padding-top: 8px; border-top: 1px solid var(--stroke); }
.cad-shell .dock-body.details { padding: 0; border-left: none; overflow-y: auto; }
.dock-body .sheets-side, .dock-body .drafting-side { width: auto; flex: 1; min-height: 0; border-right: none; }
.dock-split { flex: none; height: 6px; cursor: row-resize; background: var(--window); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); touch-action: none; position: relative; }
.dock-split::after { content: ""; position: absolute; left: 50%; top: 1px; width: 28px; height: 2px; margin-left: -14px; border-top: 1px solid var(--muted); border-bottom: 1px solid var(--muted); opacity: 0.5; }
.dock-split:hover, .dock-split.dragging { background: var(--accent); }
.dock-edge { position: absolute; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 5; touch-action: none; }
.dock.left .dock-edge { right: -4px; }
.dock.right .dock-edge { left: -4px; }
.dock-edge:hover, .dock-edge.dragging { background: var(--accent); opacity: 0.6; }
.dock-corner { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 50%, var(--muted) 50%, var(--muted) 58%, transparent 58%, transparent 70%, var(--muted) 70%, var(--muted) 78%, transparent 78%); opacity: 0.7; }
.dock-ghost { position: fixed; z-index: 1000; pointer-events: none; padding: 4px 10px; border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.dock-hint { position: fixed; z-index: 999; pointer-events: none; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: var(--radius-sm); box-sizing: border-box; }
.dock-hint.before, .dock-hint.after { background: var(--accent); border: none; }
.dock-hint.float { border-style: dashed; }
body.dock-dragging, body.dock-dragging * { cursor: grabbing !important; user-select: none !important; }
.dock-body[data-palette="library"] > .library-foot p { display: none; }
/* ===== Python window and Plugins tab (feature dev.python) ===== */
.py-panel { position: fixed; right: 16px; bottom: 64px; z-index: 60; width: min(720px, calc(100vw - 32px)); height: min(560px, calc(100vh - 200px)); min-width: 360px; min-height: 300px; display: flex; flex-direction: column; background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-top: 3px solid var(--accent); border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0,0,0,.25); resize: both; overflow: hidden; font-size: calc(12px * var(--ui-font, 1)); }
.py-head { cursor: move; touch-action: none; user-select: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; background: var(--header-band); }
.py-head svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.py-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.py-lang { font-size: 0.85em; padding: 0 6px; border: 1px solid var(--stroke); border-radius: var(--radius-lg); color: var(--muted); }
.py-spacer { flex: 1; }
.py-x { border: none; background: none; min-height: 0; padding: 2px 6px; color: var(--muted); }
.py-bar, .py-save, .py-console-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--stroke); }
.py-bar select { max-width: 170px; min-width: 0; flex: 0 1 auto; }
.py-bar select.py-language { max-width: 140px; }
.py-panel button { font-size: calc(12px * var(--ui-font, 1)); }
.py-run { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.py-run:hover:not(:disabled) { background: var(--accent-hover) !important; }
.py-danger { color: var(--error); }
.py-save { background: var(--panel-alt); }
.py-save label { display: flex; align-items: center; gap: 4px; }
.py-save input:not([type=checkbox]) { width: 150px; }
.py-save .py-wide input { width: 220px; }
.py-note { flex-basis: 100%; color: var(--muted); }
.py-code { flex: 3 1 0; min-height: 90px; margin: 0; padding: 8px 10px; border: none; border-bottom: 1px solid var(--stroke); border-radius: 0; resize: none; background: var(--panel); color: var(--text); font: calc(12px * var(--ui-font, 1))/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; white-space: pre; overflow: auto; outline: none; }
.py-console-head { padding: 3px 8px; border-bottom: none; color: var(--section-label); font-size: calc(11px * var(--ui-font, 1)); text-transform: uppercase; letter-spacing: .04em; }
.py-console-head button { text-transform: none; letter-spacing: 0; min-height: 0; padding: 1px 8px; font-size: calc(11px * var(--ui-font, 1)); }
.py-console { flex: 2 1 0; min-height: 60px; overflow: auto; padding: 4px 10px; background: var(--window); font: calc(12px * var(--ui-font, 1))/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.py-console pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; }
.py-console .py-input { color: var(--accent); }
.py-console .py-info { color: var(--muted); font-style: italic; }
.py-console .py-error { color: var(--error); }
.py-console .py-value { color: var(--text); opacity: .85; }
.py-prompt { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--window); border-top: 1px solid var(--stroke); font: calc(12px * var(--ui-font, 1)) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.py-prompt span { color: var(--accent); }
.py-prompt input { flex: 1; border: none; background: transparent; color: var(--text); font: inherit; outline: none; padding: 3px 0; }
/* The Terminal's Scripts list (dev.script-library). */
.py-lib-toggle.on { border-color: var(--accent); color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.py-lib { display: flex; flex-direction: column; max-height: 46%; min-height: 120px; border-bottom: 1px solid var(--stroke); background: var(--panel-alt); }
.py-lib-search { margin: 6px 8px; width: auto; min-width: 0; box-sizing: border-box; }
.py-lib-list { overflow: auto; padding: 0 4px 6px; }
.py-lib-group { padding: 6px 6px 2px; color: var(--section-label); font-size: calc(11px * var(--ui-font, 1)); text-transform: uppercase; letter-spacing: .04em; }
.py-lib-row { display: flex; align-items: stretch; gap: 4px; border-radius: var(--radius-sm, 4px); }
.py-lib-row:hover, .py-lib-row.on { background: var(--hover, rgba(127,127,127,.12)); }
.py-lib-load { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; text-align: left; border: none; background: none; padding: 4px 6px; color: var(--text); }
.py-lib-name { font-weight: 600; }
.py-lib-tag { font-size: 0.85em; padding: 0 6px; border: 1px solid var(--stroke); border-radius: var(--radius-lg); color: var(--muted); }
.py-lib-by { color: var(--muted); font-size: 0.9em; }
.py-lib-desc { flex-basis: 100%; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.py-lib-act { align-self: center; min-height: 0; padding: 2px 8px; }
.py-lib-edit, .py-lib-ask { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-sm, 4px); }
.py-lib-edit label { display: flex; align-items: center; gap: 4px; }
.py-lib-edit input:not([type=checkbox]) { width: 150px; }
.py-lib-edit .py-wide input { width: 220px; }
.py-lib-empty { padding: 8px; color: var(--muted); }
.rb-big.plugin { max-width: 96px; }
.rb-note { color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); padding: 2px 6px; }
.rb-note.wide { max-width: 260px; white-space: normal; align-self: center; }
@media (max-width: 600px) { .py-panel { left: 8px; right: 8px; width: auto; min-width: 0; } }
/* Sheets: annotating a viewport (notes and multileaders). */
/* Editing the plan's symbols and room (SheetsView.PlanEdit.cs). */
.vp-pick.gear-ghost { fill: rgba(47, 111, 222, 0.06); stroke-dasharray: 5 3; }
.plan-box { fill: rgba(47, 111, 222, 0.08); stroke: #2f6fde; stroke-width: 1px; vector-effect: non-scaling-stroke; pointer-events: none; }
.plan-box.crossing { fill: rgba(40, 160, 80, 0.08); stroke: #28a050; stroke-dasharray: 4 3; }
.plan-pick { fill: rgba(47, 111, 222, 0.12); stroke: #2f6fde; stroke-width: 1.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.plan-pick-line { fill: none; stroke: #2f6fde; stroke-width: 3px; stroke-opacity: 0.8; vector-effect: non-scaling-stroke; pointer-events: none; }
.plan-ghost { fill: none; stroke: #8a8f98; stroke-width: 1px; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.plan-edited { fill: none; stroke: #e08a00; stroke-width: 1px; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.sheet-fade { fill: rgba(255, 255, 255, 0.62); pointer-events: none; }
.vp-frame.annotating { stroke: #2f6fde; stroke-dasharray: none; stroke-width: 2px; pointer-events: none; }
.note-draft { stroke: #2f6fde; stroke-width: 1px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.vp-menu { position: absolute; z-index: 5; display: flex; flex-direction: column; min-width: 150px; padding: 4px; background: var(--panel, #fff); border: 1px solid var(--border, #c9ced8); border-radius: var(--radius-md); box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.vp-menu button { text-align: left; border: none; background: none; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; color: inherit; }
.vp-menu button:hover { background: var(--hover, #e8eefb); }
.vp-menu hr { border: none; border-top: 1px solid var(--stroke); margin: 4px 2px; }
.sheets-canvas.drawing { cursor: crosshair; }
.shape-pick { fill: none; stroke: #2f6fde; stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-dasharray: 4 3; pointer-events: none; }
.shape-draft { opacity: 0.7; pointer-events: none; }
.draw-cursor { fill: none; stroke: #2f6fde; stroke-width: 1px; vector-effect: non-scaling-stroke; pointer-events: none; }
.note-edit { position: absolute; z-index: 5; min-height: 1.4em; padding: 0 2px; line-height: 1.45; font-family: Arial, Helvetica, sans-serif; color: #111; background: rgba(255,255,255,.92); border: 1px dashed #2f6fde; outline: none; resize: none; overflow: hidden; }
.note-edit.right { text-align: right; }
.size-pick { display: inline-flex; align-items: center; gap: 4px; }
.size-pick input { width: 72px; }
/* Find (feature views.find): a floating panel, after Vectorworks' Find In Drawing. */
.find-panel { position: fixed; right: 16px; top: 150px; z-index: 60; width: min(680px, calc(100vw - 32px)); height: min(440px, calc(100vh - 200px)); min-width: 360px; min-height: 240px; display: flex; flex-direction: column; background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-top: 3px solid var(--accent); border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0,0,0,.25); resize: both; overflow: hidden; font-size: calc(12px * var(--ui-font, 1)); }
.find-head { cursor: move; touch-action: none; user-select: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; background: var(--header-band); }
.find-head svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.find-spacer { flex: 1; }
.find-x { border: none; background: none; min-height: 0; padding: 2px 6px; color: var(--muted); }
.find-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px 0; }
.find-label { width: 70px; flex: none; color: var(--muted); }
.find-text { flex: 1; min-width: 0; }
.find-case { display: flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; }
.find-panel button { font-size: calc(12px * var(--ui-font, 1)); }
.find-go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.find-go:hover:not(:disabled) { background: var(--accent-hover) !important; }
.find-list { flex: 1; overflow: auto; margin: 8px 10px 0; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel-alt); }
.find-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(130px, 1.3fr) minmax(160px, 2fr); gap: 8px; padding: 4px 8px; cursor: pointer; border-bottom: 1px solid var(--stroke); }
.find-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-row:hover { background: var(--accent-soft); }
.find-row.on { background: var(--accent); color: var(--on-accent); }
.find-cols { position: sticky; top: 0; cursor: default; font-weight: 600; color: var(--muted); background: var(--panel); }
.find-cols:hover { background: var(--panel); }
.find-empty { padding: 10px; color: var(--muted); }
.find-foot { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.find-count { color: var(--muted); }
.find-note { margin-left: 6px; font-style: italic; }
.find-error { padding: 2px 10px 4px; color: var(--error, #c62828); font-size: calc(12px * var(--ui-font, 1)); }
.find-flash { animation: find-flash 1.5s ease-out; }
@keyframes find-flash { 0%, 40% { outline: 3px solid var(--accent); outline-offset: 2px; } 100% { outline: 3px solid transparent; outline-offset: 6px; } }
@media (max-width: 600px) { .find-panel { left: 8px; right: 8px; width: auto; min-width: 0; } }

/* Drafting view in 3D (feature views.drafting-3d): the models' WebGL canvas under the drawing, the view menu, busy. */
.dv-gl { display: block; position: absolute; inset: 0; pointer-events: none; }
.drafting-canvas .dv-canvas { z-index: 1; }
.dv-viewbtn { position: absolute; z-index: 2; top: 6px; left: 8px; padding: 1px 6px; border: none; background: transparent; color: var(--muted); font: calc(12px * var(--ui-font, 1))/1.4 system-ui, sans-serif; cursor: pointer; border-radius: var(--radius-sm); }
.dv-viewbtn:hover { color: var(--text); background: var(--accent-soft, rgba(0, 0, 0, .06)); }
.dv-viewmenu { position: absolute; z-index: 3; top: 28px; left: 8px; display: flex; flex-direction: column; min-width: 150px; max-height: calc(100% - 36px); overflow-y: auto; padding: 4px 0; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.dv-viewmenu[hidden] { display: none; }
.dv-viewmenu button { text-align: left; padding: 4px 12px; border: none; background: transparent; color: var(--text); font: calc(12px * var(--ui-font, 1))/1.4 system-ui, sans-serif; cursor: pointer; }
.dv-viewmenu button:hover { background: var(--accent-soft, rgba(0, 0, 0, .06)); }
.dv-viewmenu-sep { height: 1px; margin: 4px 0; background: var(--stroke); }
/* The view and visual style controls side by side, as AutoCAD's [Top][Shaded with edges] (views.drafting-visual-styles). */
.dv-viewbar { position: absolute; z-index: 2; top: 6px; left: 8px; display: flex; gap: 2px; }
.dv-viewbar .dv-viewbtn { position: static; }
.dv-viewmenu button.on { font-weight: 600; }
.dv-viewmenu button.on::before { content: "✓"; position: absolute; margin-left: -10px; }
.drafting-canvas.dv-busy::after { content: ""; position: absolute; z-index: 4; inset: 0; background: rgba(127, 127, 127, .12); cursor: progress; }

/* Door tags (FD-LH...) and the FF / SF frame diamond in plan */
.plan-door-tag { fill: var(--plan-floor); fill-opacity: 0.9; stroke: var(--plan-door); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.plan-frame-mark path { fill: none; stroke: var(--plan-door); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.plan-frame-mark text { fill: var(--plan-door); font-weight: 700; text-anchor: middle; dominant-baseline: central; }

/* The view cube in the Drafting view (views.drafting-solids): the 3D view's, over the drawing at the top right. */
.drafting-canvas .view-cube.dv-cube { z-index: 3; }
.drafting-canvas .view-cube.dv-cube canvas.view-cube-canvas { position: static; inset: auto; width: 128px; height: 128px; cursor: default; }
.drafting-canvas .view-cube.dv-cube canvas.view-cube-canvas:active { cursor: grabbing; }

/* The schedule editor (views.schedule-editor): a schedule as a spreadsheet. White cells write back to the gear and
   racks; grey ones come from the library. */
.schedule { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--canvas); }
.schedule-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--stroke); }
.schedule-filter { width: 180px; }
.schedule-hint { font-size: calc(12px * var(--ui-font, 1)); flex: 1 1 260px; min-width: 0; }
.schedule-grid { flex: 1; min-height: 0; overflow: auto; outline: none; margin: 10px; border: 1px solid var(--stroke); background: var(--panel); align-self: flex-start; max-width: calc(100% - 20px); }
.schedule-grid:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }
.schedule-grid table { border-collapse: separate; border-spacing: 0; font-size: calc(13px * var(--ui-font, 1)); font-variant-numeric: tabular-nums; user-select: none; }
.schedule-grid col.rownum { width: 44px; }
.schedule-grid th, .schedule-grid td { border-right: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); padding: 3px 8px; height: 24px; box-sizing: border-box; white-space: nowrap; text-align: left; }
.schedule-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--header-band); font-weight: 600; font-size: calc(12px * var(--ui-font, 1)); cursor: pointer; min-width: 70px; }
.schedule-grid thead th.ed { color: var(--text); }
.schedule-grid thead th:not(.ed):not(.corner) { color: var(--muted); }
/* Column letters above the headings, as Excel: a click picks the column. Sorting is the caret at each heading's right. */
.schedule-grid thead tr.letters th { height: 20px; padding: 1px 8px; text-align: center; font-weight: 400; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.schedule-grid thead tr.letters th.hl { color: var(--text); font-weight: 600; }
.schedule-grid thead tr.heads th { top: 20px; }
.schedule-grid thead tr.heads th:not(.corner) { padding-right: 26px; position: sticky; }
.schedule-grid thead th .sort-caret { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); min-width: 0; min-height: 0; width: 18px; height: 18px; padding: 0;
    border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: calc(10px * var(--ui-font, 1)); line-height: 1; cursor: pointer; }
.schedule-grid thead th .sort-caret:hover { border-color: var(--stroke); background: var(--panel); color: var(--text); }
.schedule-grid thead th .sort-caret.on { color: var(--accent); }
.schedule-grid thead th.renaming { padding: 0; }
/* Column and row borders to drag, as Excel: right of each column letter, under each row number. */
.schedule-grid thead tr.letters th.letter { position: sticky; }
.schedule-grid .col-resize { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 4; }
.schedule-grid th.rownum, .schedule-grid thead tr.heads th.corner { position: sticky; }
.schedule-grid .row-resize { position: absolute; left: 0; bottom: -4px; height: 8px; width: 100%; cursor: row-resize; z-index: 4; }
.schedule-grid .col-resize:hover, .schedule-grid .col-resize.dragging { background: linear-gradient(to right, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
.schedule-grid .row-resize:hover, .schedule-grid .row-resize.dragging { background: linear-gradient(to bottom, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
body.schedule-col-resizing, body.schedule-col-resizing * { cursor: col-resize !important; user-select: none; }
body.schedule-row-resizing, body.schedule-row-resizing * { cursor: row-resize !important; user-select: none; }
.schedule-grid th.corner { position: sticky; left: 0; z-index: 3; min-width: 0; }
.schedule-grid tbody th.rownum { position: sticky; left: 0; z-index: 1; background: var(--header-band); color: var(--muted); font-weight: 400; font-size: calc(11px * var(--ui-font, 1)); text-align: right; cursor: default; }
.schedule-grid th.hl { background: var(--active-nav); color: var(--text); }
.schedule-grid td.ed { background: var(--panel); cursor: cell; }
.schedule-grid td.ro { background: var(--panel-alt); color: var(--muted); cursor: default; }
.schedule-grid td.extra, .schedule-grid th.extra { font-style: italic; }
/* Columns left off the sheets by Filter (views.schedule-filters): greyed and struck through. */
.schedule-grid td.hidden-col, .schedule-grid th.hidden-col { opacity: 0.45; }
.schedule-grid th.hidden-col .head-text { text-decoration: line-through; }
.schedule-bar button.filtered { border-color: var(--accent); color: var(--text); }
.schedule-bar button.on { background: var(--accent-soft); border-color: var(--accent); }
/* The picked schedule's tab reads as a picked segment, as everywhere else (white text on the soft colour was unreadable). */
.schedule-bar .segments .segment.on { background: var(--accent); color: var(--on-accent); }
.schedule-filters { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--stroke); font-size: calc(12px * var(--ui-font, 1)); }
.schedule-filters .sf-rules { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 520px; }
.schedule-filters .sf-columns { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; flex: 0 1 auto; }
.schedule-filters .sf-label { font-weight: 600; color: var(--muted); }
.schedule-filters .sf-rule { display: inline-flex; align-items: center; gap: 4px; }
.schedule-filters .sf-rule.off { opacity: 0.55; }
.schedule-filters select, .schedule-filters .sf-text, .schedule-filters .sf-pick { min-height: 26px; padding: 2px 6px; font-size: calc(12px * var(--ui-font, 1)); }
.schedule-filters .sf-text { width: 130px; }
.schedule-filters .sf-values { position: relative; display: inline-block; }
.schedule-filters .sf-list { position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 2px; display: flex; flex-direction: column; gap: 2px; min-width: 180px; max-height: 260px; overflow: auto; padding: 6px 8px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.schedule-filters .sf-list label, .schedule-filters .sf-columns label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.schedule-grid td.right { text-align: right; }
.schedule-grid td.sel { background: var(--accent-soft); }
.schedule-grid td.cur { outline: 2px solid var(--selection); outline-offset: -2px; position: relative; }
.schedule-grid td.fill-host { position: relative; }
.schedule-grid td.fill-target { outline: 2px dashed var(--selection); outline-offset: -2px; }
.schedule-fill { position: absolute; right: 0; bottom: 0; width: 7px; height: 7px; background: var(--selection); border: 1px solid var(--panel); cursor: crosshair; z-index: 3; touch-action: none; }
.schedule-grid td:has(> .schedule-edit) { padding: 0; }
.schedule-edit { width: 100%; min-width: 120px; height: 100%; min-height: 0; border: none; border-radius: 0; padding: 3px 8px; font: inherit; box-shadow: inset 0 0 0 2px var(--accent); }
.schedule-empty { padding: 16px; }
.schedule-foot { display: flex; gap: 16px; padding: 0 12px 8px; font-size: calc(12px * var(--ui-font, 1)); }

/* ----- Spreadsheet view (views.spreadsheet): racks laid out like the rack layout workbooks ----- */
.spreadsheet { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--canvas); }
.ss-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--stroke); }
.ss-zoom-tools { display: inline-flex; align-items: center; gap: 2px; }
.ss-zoom-tools button { min-width: 26px; padding: 2px 6px; }
.ss-zoom-tools .ss-zoom-pct { min-width: 52px; font-variant-numeric: tabular-nums; }
.ss-zoom { width: max-content; }
.ss-hint { font-size: calc(12px * var(--ui-font, 1)); flex: 1 1 260px; min-width: 0; }
.ss-move-tools { display: inline-flex; gap: 4px; }
.ss-message { font-size: calc(12px * var(--ui-font, 1)); color: var(--warning); font-weight: 600; }
.ss-grid { flex: 1; min-height: 0; overflow: auto; outline: none; padding: 10px; }
.ss-grid:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
/* A share link's viewer: the board around it scrolls and zooms, so the grid is just its tables. */
.ss-readonly { display: block; background: transparent; }
.ss-readonly .ss-grid { overflow: visible; padding: 0; }
.ss-readonly .ss-gear, .ss-readonly .ss-head { cursor: default; }
.ss-row-title { font-weight: 600; font-size: calc(12px * var(--ui-font, 1)); color: var(--muted); margin: 8px 0 4px; }
.ss-table { border-collapse: collapse; font-size: calc(12px * var(--ui-font, 1)); font-variant-numeric: tabular-nums; background: var(--panel); color: var(--text); margin-bottom: 16px; table-layout: fixed; }
.ss-table col.c-rownum { width: 36px; }
.ss-table col.c-margin { width: 14px; }
.ss-table col.c-ru { width: 28px; }
.ss-table col.c-lane { width: 31.6667px; }
.ss-table col.c-note { width: 110px; }
.ss-table col.c-space { width: 44px; }
.ss-table th, .ss-table td { border: 1px solid var(--stroke); padding: 0 4px; height: 21px; box-sizing: border-box; text-align: center; vertical-align: middle; overflow: hidden; }
.ss-table thead th { position: sticky; top: -10px; z-index: 2; background: var(--header-band); color: var(--muted); font-weight: 400; font-size: calc(11px * var(--ui-font, 1)); height: 18px; }
.ss-table th.rownum { background: var(--header-band); color: var(--muted); font-weight: 400; font-size: calc(11px * var(--ui-font, 1)); text-align: right; position: sticky; left: -10px; z-index: 1; }
.ss-table thead th.corner { left: -10px; z-index: 3; }
.ss-table td.ss-margin, .ss-table td.ss-off { background: var(--canvas); border-color: transparent; }
/* Each rack is a block with a heavy outline, as in the workbooks. */
.ss-table td.ss-head, .ss-table td.ss-ru.up { border-left: 2px solid var(--text); }
.ss-table td.ss-head { padding: 0; font-weight: 600; cursor: pointer; }
.ss-table tr.ss-head-row:first-of-type td.ss-head, .ss-table tr.ss-head-row:first-of-type td.ss-head-note { border-top: 2px solid var(--text); }
.ss-table td.ss-head-note, .ss-table td.ss-notes { border-right: 2px solid var(--text); }
.ss-table td.ss-head.active { background: var(--accent-soft); }
.ss-table td.ss-head.model { font-weight: 400; color: var(--muted); padding: 0 4px; white-space: nowrap; text-overflow: ellipsis; }
.ss-table td.last, .ss-table td.ss-ru.last { border-bottom: 2px solid var(--text); }
.ss-field { width: 100%; height: 20px; min-height: 0; border: none; border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: center; padding: 0 4px; }
.ss-field::placeholder, .ss-note::placeholder { color: transparent; }
.ss-table td:hover > .ss-field::placeholder, .ss-field:focus::placeholder, .ss-note:hover::placeholder { color: var(--faint-ink); }
.ss-field:focus, .ss-note:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--panel); }
.ss-table td.ss-ru { color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); padding: 0 2px; }
.ss-table td.ss-gear { position: relative; cursor: cell; padding: 0; overflow: visible; }
.ss-table td.ss-gear.filled { background: var(--panel-alt); }
.ss-table td.ss-gear.cur { outline: 2px solid var(--selection); outline-offset: -2px; z-index: 1; }
.ss-cell { display: flex; align-items: stretch; height: 100%; min-height: 20px; }
.ss-item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 1px 4px; line-height: 1.2; overflow: hidden; }
.ss-item + .ss-item { border-left: 1px dashed var(--stroke); }
.ss-item.picked { background: var(--accent-soft); }
.ss-item.blank { color: var(--muted); }
.ss-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-sub, .ss-rider { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-rider { color: var(--text); }
.ss-drop { flex: none; margin-left: auto; width: 18px; min-width: 0; min-height: 0; padding: 0; border: none; border-left: 1px solid var(--stroke); border-radius: 0; background: transparent; color: var(--muted); font-size: calc(10px * var(--ui-font, 1)); visibility: hidden; cursor: pointer; }
.ss-table td.ss-gear:hover .ss-drop, .ss-table td.ss-gear.cur .ss-drop { visibility: visible; }
.ss-drop:hover { background: var(--accent-soft); color: var(--text); }
.ss-table td.ss-notes { padding: 0; vertical-align: middle; }
.spreadsheet:not(.ss-readonly) .ss-table td.ss-notes:has(.ss-note) { cursor: text; }
.spreadsheet:not(.ss-readonly) .ss-table td.ss-notes:has(.ss-note):hover { background: var(--accent-soft); }
.ss-note { cursor: text; }
/* Feature views.spreadsheet-status: gear cells filled with their equipment status colour, dark text on top. */
.ss-table td.ss-gear.ss-status, .ss-table td.ss-gear.ss-status.filled { background: var(--ss-status); color: #111; }
.ss-table td.ss-gear.ss-status .ss-sub, .ss-table td.ss-gear.ss-status .ss-rider { color: #333; }
.ss-table td.ss-gear.ss-status .ss-drop { color: #111; }
.ss-key { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: calc(11px * var(--ui-font, 1)); }
.ss-key-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ss-key-item i { width: 12px; height: 12px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); display: inline-block; }
.status-pick { display: flex; align-items: center; gap: 6px; }
.status-pick select { flex: 1; min-width: 0; }
.status-swatch { width: 16px; height: 16px; flex: none; border: 1px solid var(--stroke); border-radius: var(--radius-sm); display: inline-block; }
.status-swatch.none { background: repeating-linear-gradient(135deg, var(--panel) 0 3px, var(--panel-alt) 3px 6px); }
.ss-note { display: block; width: 100%; height: 20px; min-height: 0; border: none; border-radius: 0; background: transparent; color: inherit; font: inherit; font-size: calc(11px * var(--ui-font, 1)); text-align: center; padding: 0 3px; }
.ss-table td.ss-space-head { background: var(--panel-alt); color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); cursor: pointer; border-left: 2px solid var(--text); border-right: 2px solid var(--text); white-space: nowrap; }
.ss-table td.ss-space-head.active { background: var(--accent-soft); }
.ss-table td.ss-space { background: repeating-linear-gradient(135deg, var(--panel-alt) 0 6px, var(--panel) 6px 12px); border-left: 2px solid var(--text); border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); }
.ss-table td.ss-gear.split { border-left-style: dashed; }
.ss-table td.ss-gear.narrow .ss-item { padding: 1px 2px; }
/* Half and third cells: the label shrinks to fit (js/spreadsheet.js fit()), on one line if it can, else on two; the ▾ floats over the cell so it takes none of its width. */
.ss-table td.ss-gear.narrow .ss-title, .ss-table td.ss-gear.narrow .ss-sub { font-size: calc(11px * var(--ui-font, 1)); text-overflow: clip; word-break: keep-all; overflow-wrap: normal; line-height: 1.1; text-align: center; }
.ss-table td.ss-gear.narrow .ss-drop { position: absolute; right: 0; top: 0; bottom: 0; width: 14px; background: var(--panel); border-left: none; box-shadow: -1px 0 0 var(--stroke); }
.ss-table td.ss-gear.narrow.cur:not(:hover) .ss-drop { visibility: hidden; }
/* Notes for side-by-side gear sit side by side too, so a 1U row stays one row high. */
.ss-table td.ss-notes.several { white-space: nowrap; }
.ss-table td.ss-notes.several .ss-note { display: inline-block; vertical-align: middle; font-size: calc(10px * var(--ui-font, 1)); }
.ss-table td.ss-notes.several .ss-note + .ss-note { border-left: 1px dashed var(--stroke); }
.ss-table td.ss-gear.shelf-part { background: var(--panel-alt); }
.ss-picker.from-right { left: auto; right: -2px; }
.ss-picker { position: absolute; top: 100%; left: -2px; z-index: 20; width: 340px; background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); text-align: left; cursor: default; }
.ss-search { display: block; width: calc(100% - 12px); margin: 6px; }
.ss-picker-head { font-size: calc(11px * var(--ui-font, 1)); padding: 0 8px 4px; }
.ss-options { max-height: 280px; overflow-y: auto; border-top: 1px solid var(--stroke); }
.ss-opt { display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; cursor: pointer; white-space: nowrap; }
.ss-opt b { flex: none; min-width: 78px; }
.ss-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ss-opt-u { flex: none; font-size: calc(11px * var(--ui-font, 1)); }
.ss-opt.hi { background: var(--accent-soft); }
.ss-opt.clear { color: var(--error); border-bottom: 1px solid var(--stroke); }
.ss-opt.none { cursor: default; }
.ss-empty { padding: 16px; }
/* The schedule editor's formatting bar (views.schedule-format) and the schedule's title as printed. */
.schedule-format { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px 10px; background: var(--panel); border-bottom: 1px solid var(--stroke); font-size: calc(12px * var(--ui-font, 1)); }
.schedule-format label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.schedule-format select { min-height: 26px; padding: 2px 6px; font-size: calc(12px * var(--ui-font, 1)); }
.schedule-format .fmt-sep { width: 1px; align-self: stretch; background: var(--stroke); margin: 0 2px; }
.schedule-format .fmt-btn { min-width: 28px; min-height: 26px; padding: 0 6px; font-size: calc(13px * var(--ui-font, 1)); }
.schedule-format .fmt-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.schedule-format .fmt-color { position: relative; width: 28px; height: 26px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; justify-content: center; }
.schedule-format .fmt-color input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; border: none; }
.schedule-format .fmt-swatch { width: 16px; height: 16px; border-radius: var(--radius-sm); border: 1px solid var(--stroke); background-image: linear-gradient(45deg, transparent 45%, var(--error) 45%, var(--error) 55%, transparent 55%); }
.schedule-format .fmt-swatch[style*="#"] { background-image: none; }
.schedule-title { position: sticky; left: 0; display: flex; padding: 4px 10px; box-sizing: border-box; text-align: center; background: var(--panel); border-bottom: 1px solid var(--stroke); }

/* ===== Help and walkthroughs (feature help.guides) ===== */
.help-search { display: flex; flex-direction: column; min-height: 0; font-size: 12px; }
.help-box { display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel); }
.help-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.help-box svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.help-box input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); padding: 6px 0; font-size: 13px; box-shadow: none; }
.help-results { overflow: auto; margin-top: 6px; }
.help-search.inline { position: relative; width: 360px; padding-top: 4px; }
.help-search.inline .help-results { position: absolute; top: 100%; left: 0; width: 460px; max-height: min(420px, 60vh); z-index: 80; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 4px; }
.help-group { padding: 8px 8px 3px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--section-label); }
.help-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title cmds" "cat cat"; gap: 1px 10px; width: 100%; text-align: left; border: none; border-radius: var(--radius-sm); background: none; padding: 5px 8px; min-height: 0; color: var(--text); cursor: pointer; }
.help-row:hover, .help-row.on { background: var(--accent-soft); }
.help-row-title { grid-area: title; font-weight: 600; font-size: 12px; }
.help-row-cmds { grid-area: cmds; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--muted); align-self: center; }
.help-row-cat { grid-area: cat; font-size: 11px; color: var(--muted); }
.help-empty { padding: 10px; color: var(--muted); }
.rp-help .rp-items { align-items: flex-start; }

.help-panel { position: fixed; right: 16px; top: 120px; z-index: 60; width: min(520px, calc(100vw - 32px)); height: min(560px, calc(100vh - 160px)); display: flex; flex-direction: column; background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-top: 3px solid var(--accent); border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); overflow: hidden; }
.help-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--header-band); cursor: move; touch-action: none; user-select: none; }
.help-panel.moved { right: auto; }
.help-panel.dragging, .help-card.dragging { box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.help-head svg, .help-card-head svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.help-sub { color: var(--muted); font-size: 11px; }
.help-spacer { flex: 1; }
.help-x { border: none; background: none; min-height: 0; padding: 2px 6px; color: var(--muted); }
.help-panel .help-search { flex: 1; padding: 10px; }
.help-panel .help-results { flex: 1; }
.help-button { display: inline-flex; align-items: center; gap: 5px; }
.help-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.help-ring { position: fixed; z-index: 2500; pointer-events: none; border: 3px solid var(--accent); border-radius: var(--radius-md); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent); animation: help-pulse 1.4s ease-in-out infinite; transition: left .15s, top .15s, width .15s, height .15s; }
.help-ring.big { border-style: dashed; animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
@keyframes help-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 12%, transparent), 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent); } }
@media (prefers-reduced-motion: reduce) { .help-ring { animation: none; transition: none; } }
.help-card { position: fixed; right: 24px; bottom: 48px; z-index: 2600; width: min(330px, calc(100vw - 32px)); background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-left: 4px solid var(--accent); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(0, 0, 0, .3); font-size: 12px; }
.help-card.placed { right: auto; bottom: auto; }
.help-card-head { display: flex; align-items: center; gap: 6px; padding: 7px 8px 4px 10px; cursor: move; touch-action: none; user-select: none; }
.help-head button, .help-card-head button { cursor: pointer; }
.help-card-head b { font-size: 12px; }
.help-steps { display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.help-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stroke); }
.help-dot.done { background: var(--accent); opacity: .5; }
.help-dot.on { background: var(--accent); }
.help-count { margin-left: 6px; font-size: 11px; color: var(--muted); }
.help-card-text { margin: 8px 10px; line-height: 1.45; }
.help-card-text.then { margin-top: 0; color: var(--muted); font-size: 12px; }
.help-card-hint { margin: 8px 10px 4px; font-weight: 600; line-height: 1.4; }
.help-card-note { margin: 6px 10px 0; color: var(--warning); font-size: 12px; }
.help-card-where { margin: 0 10px 6px; color: var(--muted); font-size: 11px; }
.help-card-foot { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; border-top: 1px solid var(--stroke); }
.help-card-foot button { font-size: 12px; padding: 3px 9px; min-height: 0; }
/* Presentation mode's controls (Editor.Present.cs), along the bottom of the drawing while the pop-out is open. */
main.lineup:has(> .present-bar) { position: relative; }
.present-bar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 18px; background: var(--panel); border: 1px solid var(--stroke); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); color: var(--text); font-size: 12px; white-space: nowrap; }
.present-bar label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.present-bar button { padding: 3px 12px; border-radius: var(--radius-lg); }
.present-dot { width: 8px; height: 8px; border-radius: 50%; background: #d93a3a; box-shadow: 0 0 0 3px rgba(217, 58, 58, 0.2); }
@media (max-width: 640px) { .present-label { display: none; } }
main.lineup:has(.view3d-help) .present-bar { bottom: 46px; }

/* ===== Splash page and dashboard (feature views.home; Components/HomePage.razor, js/splash.js) ===== */
:root { --logo-navy: #28324b; --logo-lime: #c3d601; }
[data-theme=dark] { --logo-navy: #e4e8f0; }

/* the logo intro, after the Forma dashboard's LogoIntro */
.logo-intro-stage { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; perspective: 900px; cursor: pointer; }
.logo-intro-backdrop { position: absolute; inset: 0; background: var(--window); }
.logo-intro-mark { position: relative; width: 168px; height: 168px; transform-style: preserve-3d; opacity: 0; }
.logo-intro-mark .mark-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.logo-intro-mark .mark-layer:last-child { filter: drop-shadow(0 10px 18px rgba(20, 26, 40, 0.25)); }
:root.logo-intro .home-brand { opacity: 0; }
.home-wordmark { transition: clip-path 0.55s cubic-bezier(.3, .7, .2, 1); clip-path: inset(0 -1px 0 0); }
:root.logo-landed .home-wordmark { clip-path: inset(0 100% 0 0); transition: none; }

.brand.to-home, .shell-brand.to-home { cursor: pointer; }
.brand.to-home:hover span { color: var(--accent); }

.home-page { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; background: var(--window); color: var(--text); font-size: calc(13px * var(--ui-font, 1)); }
.home-header { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 2px solid var(--logo-lime); background: var(--panel); flex: none; }
.home-brand { display: flex; align-items: center; gap: 9px; height: 34px; }
.home-mark { width: 34px; height: 34px; overflow: visible; }
.home-wordmark { height: 19px; }
[data-theme=dark] .home-wordmark { filter: brightness(0) invert(0.92); }
.home-product { padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--stroke); font-size: calc(15px * var(--ui-font, 1)); font-weight: 300; letter-spacing: 0.04em; color: var(--muted); }
.home-spacer { flex: 1; }
.home-plain, .home-back { background: none; }
.home-who { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--logo-navy); color: var(--panel); font-weight: 700; font-size: 12px; }

.home-body { flex: 1; min-height: 0; display: flex; }
.home-projects { flex: 0 0 260px; display: flex; flex-direction: column; gap: 8px; padding: 16px 12px; background: var(--panel); border-right: 1px solid var(--stroke); overflow: auto; }
.home-pane-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.home-pane-head h2 { margin: 0; font-size: calc(12px * var(--ui-font, 1)); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label, var(--muted)); }
.home-new { padding: 2px 10px; font-weight: 600; color: var(--accent); }
.home-search { margin: 0 2px; }
/* Find on the home page (views.home-find): a search box in the header with the places found dropped down under it. */
.home-find { position: relative; display: flex; align-items: center; flex: 0 1 340px; min-width: 160px; }
.home-find-icon { position: absolute; left: 9px; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; z-index: 28; }
.home-find-text { width: 100%; padding-left: 30px; position: relative; z-index: 27; }
.home-find-shield { position: fixed; inset: 0; z-index: 26; }
.home-find-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 27; width: min(820px, calc(100vw - 24px)); max-height: min(520px, calc(100vh - 120px)); display: flex; flex-direction: column;
    background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-top: 3px solid var(--accent); border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: calc(12px * var(--ui-font, 1)); }
.home-find-panel button { font-size: calc(12px * var(--ui-font, 1)); }
.home-find-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px 0; }
.home-find-opts .find-case { margin-left: 0; }
.home-find-opts select { width: auto; max-width: 260px; }
.home-find-list { flex: 1; min-height: 60px; overflow: auto; margin: 8px 10px 0; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel-alt); }
.home-find-row { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(100px, 1fr) minmax(120px, 1.3fr) minmax(140px, 1.8fr); gap: 8px; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid var(--stroke); }
.home-find-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-find-row:hover { background: var(--accent-soft); }
.home-find-row.on { background: var(--accent); color: var(--on-accent); }
.home-find-row.find-cols { position: sticky; top: 0; cursor: default; }
.home-find-foot { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
@media (max-width: 700px) {
    .home-find { flex-basis: 200px; }
    .home-find-panel { position: fixed; top: 56px; left: 12px; right: 12px; width: auto; }
    .home-find-row { grid-template-columns: 1fr 1fr; }
    .home-find-row > span:nth-child(3), .home-find-row > span:nth-child(4) { display: none; }
}
.home-project-list { display: flex; flex-direction: column; gap: 2px; }
.home-project { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: var(--radius-md); background: none; text-align: left; color: var(--text); }
.home-project:hover:not(:disabled) { background: var(--panel-alt); }
.home-project.on { background: var(--accent-soft); font-weight: 600; }
.home-project.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: var(--radius-sm); background: var(--accent); }
.home-project .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-project .count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-new-project { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: var(--panel-alt); }
.home-new-project label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; }
.home-new-project textarea { resize: vertical; font: inherit; }
.home-form-buttons { display: flex; justify-content: flex-end; gap: 6px; }
.home-note { margin: auto 4px 0; padding: 8px 10px; border-radius: var(--radius-md); background: var(--panel-alt); color: var(--muted); font-size: 11px; }
.home-error { color: var(--error); font-size: 12px; margin: 0; }

.home-dash { flex: 1; min-width: 0; overflow: auto; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.home-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-hello h1 { margin: 0; font-size: calc(24px * var(--ui-font, 1)); font-weight: 600; }
.home-hello p { margin: 2px 0 0; }
.home-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Project settings menu (views.home-actions-menu): one button beside the project's name, opening to the left */
/* margin-left: auto keeps the button at the right edge (also on My Home, where there is no title, and when it wraps), so
   the menu, which opens leftward from it, stays on screen */
.home-actions-menu { align-self: center; margin-left: auto; }
.home-actions-menu .dropdown-button { display: inline-flex; align-items: center; gap: 6px; }
.home-actions-menu .home-menu-gear { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.home-actions-menu .home-menu-pop { left: auto; right: 0; min-width: min(260px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; }
.home-actions-menu .home-menu-pop .section-header { margin-top: 2px; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.home-tile { display: flex; flex-direction: column; padding: 10px 16px 12px; background: var(--panel); border: 1px solid var(--stroke); border-top: 4px solid var(--tile, var(--accent)); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.home-tile .value { font-size: calc(28px * var(--ui-font, 1)); font-weight: 700; font-variant-numeric: tabular-nums; }
.home-tile .caption { font-weight: 600; }
.home-tile .detail { color: var(--muted); font-size: 12px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.home-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 12px 14px; min-width: 0; }
/* Cards in the scrolling dashboard keep their full height and the dashboard scrolls. Without this a card with
   overflow: hidden (the CAD look) shrank to fit the window and cut off its rows, as the PDFs list did. */
.home-dash > .home-card { flex-shrink: 0; }
.home-card h3 { margin: 0; font-size: calc(14px * var(--ui-font, 1)); }
.home-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.home-welcome p { margin: 6px 0 12px; }
.home-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.home-list > li + li { border-top: 1px solid var(--stroke); }
.home-row { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; white-space: normal; overflow-wrap: anywhere; min-width: 0; padding: 8px 6px; border: none; border-radius: var(--radius-sm); background: none; text-align: left; color: var(--text); }
button.home-row:hover { background: var(--panel-alt); }
.home-row.static { padding: 8px 6px; }
.home-quote { padding-left: 8px; border-left: 3px solid var(--logo-lime); }
.home-activity .home-row { flex-direction: row; align-items: center; gap: 10px; }
.home-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 11px; }
.home-row-text { flex: 1; min-width: 0; }
.home-when { white-space: nowrap; margin-left: 4px; }
.home-placeholder { display: flex; gap: 12px; align-items: flex-start; padding: 6px 2px; }
.home-placeholder svg { flex: none; width: 34px; height: 34px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; opacity: 0.7; }
.home-placeholder p { margin: 0; }
.home-table { width: 100%; border-collapse: collapse; }
.home-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--stroke); }
.home-table td { padding: 7px 6px; border-bottom: 1px solid var(--stroke); }
.home-table tbody tr { cursor: pointer; }
.home-table tbody tr:hover td { background: var(--panel-alt); }
.home-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.home-table .strong { font-weight: 600; }
.home-open-pill { margin-left: 6px; padding: 0 6px; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 600; }

/* ----- The hub (feature views.project-hub): project dropdown, project list and module sidebar ----- */
.hub-switch { position: relative; margin-left: 4px; }
.hub-switch-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 360px; padding: 4px 10px; border: 1px solid transparent; background: none; font-weight: 600; font-size: calc(14px * var(--ui-font, 1)); }
.hub-switch-btn:hover, .hub-switch-btn.open { border-color: var(--stroke); background: var(--panel-alt); }
.hub-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-switch-caret { font-size: 11px; color: var(--muted); transition: transform 0.15s; }
.hub-switch-btn.open .hub-switch-caret { transform: rotate(180deg); }
.hub-switch-shield { position: fixed; inset: 0; z-index: 26; }
.hub-switch-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 27; width: 360px; max-width: calc(100vw - 24px); display: flex; flex-direction: column;
    background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); padding: 12px 0 0; }
.hub-switch-search { margin: 0 12px; width: auto; box-sizing: border-box; }
.hub-switch-tab { margin: 10px 12px 0; padding: 6px 0; text-align: center; font-weight: 600; border-bottom: 2px solid var(--accent); }
.hub-switch-count { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 4px; font-size: calc(14px * var(--ui-font, 1)); }
.hub-switch-list { max-height: min(420px, 60vh); overflow-y: auto; padding: 0 6px 6px; }
.hub-switch-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 8px; border: none; border-radius: var(--radius-md); background: none; text-align: left; color: var(--text); white-space: normal; }
.hub-switch-item:hover { background: var(--panel-alt); }
.hub-switch-item.on { background: var(--accent-soft); }
.hub-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.hub-switch-text b { font-size: calc(13.5px * var(--ui-font, 1)); }
.hub-switch-none { padding: 6px 10px; }
.hub-thumb { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--logo-navy); color: var(--logo-lime); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
.hub-thumb.small { width: 26px; height: 26px; font-size: 11px; border-radius: var(--radius-md); }
.hub-thumb.none { background: var(--panel-alt); color: var(--muted); }

.hub-welcome { flex: none; padding: 18px 28px 0; background: var(--window); }
.hub-welcome h1 { margin: 0; font-size: calc(26px * var(--ui-font, 1)); font-weight: 500; }
.hub-welcome p { margin: 4px 0 0; font-size: calc(15px * var(--ui-font, 1)); }
.hub-tabs { display: flex; gap: 22px; margin-top: 18px; border-bottom: 1px solid var(--stroke); }
.hub-tab { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 2px; color: var(--text); }
.hub-tab.on { border-bottom-color: var(--accent); font-weight: 600; }
.hub-welcome + .home-body .home-dash { padding: 14px 28px 32px; }

.hub-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 28px 20px; }
.hub-list-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-list-search { flex: 0 1 300px; width: auto; }
.hub-list-scroll { flex: 1; min-height: 0; overflow: auto; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); }
.hub-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); padding: 10px 12px; }
.hub-table td { padding: 8px 12px; }
.hub-name { display: flex; align-items: center; gap: 10px; }
.hub-name .hub-thumb { width: 30px; height: 30px; font-size: 11px; border-radius: var(--radius-md); }
.hub-name-text { display: flex; flex-direction: column; min-width: 0; }
.hub-access { display: inline-block; padding: 1px 8px; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.hub-empty { padding: 12px; }
.hub-list-foot { padding: 0 4px; }
.hub-form-wrap { max-width: 460px; }

.hub-side { flex: 0 0 210px; display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; background: var(--panel); border-right: 1px solid var(--stroke); overflow-y: auto; }
.hub-mod { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: none; border-radius: var(--radius-md); background: none; text-align: left; color: var(--text); font-size: calc(13.5px * var(--ui-font, 1)); }
.hub-mod svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; opacity: 0.8; }
.hub-mod:hover { background: var(--panel-alt); }
.hub-mod.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.hub-mod.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: var(--radius-sm); background: var(--accent); }
.hub-side-rule { height: 1px; margin: 8px 6px; background: var(--stroke); }
.hub-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.hub-facts dt { color: var(--muted); font-size: 12px; }
.hub-facts dd { margin: 0; overflow-wrap: anywhere; }
.hub-thumb.pic { background: var(--panel); overflow: hidden; }
.hub-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.hub-details { display: contents; }

/* ===== Project Admin (feature views.project-admin): members, companies, roles, modules ===== */
.hub-module:has(.pa) { padding: 0; }
.pa { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 24px 20px; }
.pa-head { display: flex; align-items: center; gap: 14px; }
.pa-title h1 { margin: 0; font-size: calc(24px * var(--ui-font, 1)); font-weight: 500; }
.pa-title p { margin: 2px 0 0; }
.pa-icon { flex: none; display: inline-flex; width: 40px; height: 40px; border-radius: var(--radius-md); overflow: hidden; }
.pa-icon img { width: 100%; height: 100%; object-fit: cover; }
.pa-icon .hub-thumb { width: 100%; height: 100%; }
.pa-icon.large { width: 96px; height: 96px; border: 1px solid var(--stroke); border-radius: var(--radius-lg); }
.pa-icon.large .hub-thumb { font-size: 28px; border-radius: 0; }
.pa-tabs { margin-top: 2px; }
.pa-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.pa-pad, .pa-intro { margin: 0; max-width: 820px; }
.pa-table th, .pa-table td { white-space: nowrap; }
.pa-table th.pa-mod { white-space: normal; min-width: 76px; max-width: 96px; line-height: 1.2; }
.pa-table td.pa-mod { text-align: left; }
.pa-table tbody tr { cursor: default; }
.pa-table select, .pa-phone { width: auto; min-width: 0; max-width: 170px; padding: 3px 6px; font-size: 12px; }
.pa-table select { min-width: 110px; max-width: 150px; }
.pa-phone { width: 112px; }
.pa-sticky { position: sticky; left: 0; z-index: 2; background: var(--panel); border-right: 1px solid var(--stroke); }
.pa-table thead .pa-sticky { z-index: 3; }
.pa-table tbody tr:hover .pa-sticky { background: var(--panel-alt); }
.pa-person { display: flex; align-items: center; gap: 8px; }
.pa-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #333; font-size: 12px; font-weight: 600; }
.pa-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.pa-from { display: block; margin-left: 36px; }
.pa-clip { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.pa-inherited td { color: var(--muted); }
.pa-status { padding-left: 8px; border-left: 3px solid #7cb342; }
.pa-status.pending { border-left-color: #f0a030; }
.pa-admin { margin-left: 6px; }
.pa-toggle { position: relative; display: inline-block; width: 34px; height: 18px; padding: 0; border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: var(--panel-alt); vertical-align: middle; cursor: pointer; transition: background 0.15s; }
.pa-toggle span { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: left 0.15s, background 0.15s; }
.pa-toggle.on { background: #2f7fd1; border-color: #2f7fd1; }
.pa-toggle.on span { left: 18px; background: #fff; }
.pa-toggle.on.soft { background: #9cc4ec; border-color: #9cc4ec; }
.pa-toggle.locked { cursor: default; }
.pa-toggle:disabled { opacity: 1; }
.pa-toggle:not(.locked):disabled { cursor: default; }
.pa-toggle.locked:not(.on):not(.own) { opacity: 0.6; }
.pa-toggle.own:not(.on) { border: 2px solid #2f7fd1; }
.pa-toggle.own:not(.on) span { top: 1px; left: 1px; background: #2f7fd1; }
.pa-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.pa-key > span { display: inline-flex; align-items: center; gap: 6px; }
.pa-add { max-width: 720px; display: flex; flex-direction: column; gap: 8px; }
.pa-add label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.pa-add textarea { width: 100%; box-sizing: border-box; }
.pa-add-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pa-add p { margin: 0; }
.pa-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pa-chip { padding: 1px 8px; border-radius: var(--radius-lg); font-size: 12px; }
.pa-groups { flex: 0 1 auto; }
.pa-new-company { flex: 0 1 300px; width: auto; }
.pa-rename { display: flex; gap: 6px; }
.pa-row-buttons { text-align: right; }
.pa-icon-row { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pa-icon-buttons { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.hub-stack { display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.hub-project-row { display: flex; gap: 20px; align-items: flex-start; }
.hub-project-icon { flex: none; }
.hub-info-form { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.hub-info-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.hub-info-form input, .hub-info-form textarea { width: 100%; color: var(--text); font-size: 13px; }
.hub-sub { margin: 4px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hub-sub ~ .hub-sub { margin-top: 14px; }
.pa .home-grid { margin-bottom: 12px; }
.hub-soon h3 { margin: 0 0 4px; }

/* ===== Folders down the right of a project's pages (feature views.home-folders) ===== */
/* In the module sidebar, under TLA Database, with Project Admin and Hub Admin kept at the bottom. */
.hub-side.with-folders { flex-basis: 270px; overflow: hidden; }
.hub-side .hub-folders { flex: 1 1 auto; min-height: 60px; padding: 4px 0; background: none; border: none; overflow-y: auto; }
.hub-side .hub-folders-head { padding: 0 4px 0 12px; }
.hub-side .hub-folders-head h2 { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.hub-side .hub-folders-head .home-new { padding: 2px 8px; font-size: 12px; }
.hub-side-bottom { margin-top: auto; }
.hub-side.with-folders > .hub-mod, .hub-side.with-folders > .hub-side-rule { flex: none; }
.hub-folders { flex: 0 0 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 10px; background: var(--panel); border-left: 1px solid var(--stroke); overflow-y: auto; }
.hub-folders-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.hub-folders-head h2 { flex: 1; margin: 0; font-size: calc(14px * var(--ui-font, 1)); font-weight: 600; }
.hub-folders-list { display: flex; flex-direction: column; gap: 2px; }
.hub-folders-empty, .hub-folders-hint { margin: 4px; }
.hub-folder { display: flex; flex-direction: column; border-radius: var(--radius-md); }
.hub-folder.drop > .hub-folder-row { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -2px; }
.hub-folder-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 6px; padding-left: calc(6px + var(--depth, 0) * 4px); border: none; border-radius: var(--radius-md); background: none; text-align: left; color: var(--text); }
.hub-folder-row:hover { background: var(--panel-alt); }
.hub-folder-row[aria-expanded="true"] { font-weight: 600; }
.hub-folder-icon { flex: none; width: 17px; height: 17px; fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.1; stroke-linejoin: round; }
.hub-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-folder-row .count { flex: none; min-width: 20px; padding: 0 6px; border-radius: var(--radius-lg); background: var(--panel-alt); color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; }
.hub-folder-body { display: flex; flex-direction: column; gap: 4px; margin: 0 0 6px 14px; padding-left: 8px; border-left: 1px solid var(--stroke); }
.hub-folder.loose { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--stroke); border-radius: 0; }
.hub-groups { display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.hub-group-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.hub-group-head svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.hub-group-head span { flex: 1; }
.hub-group-add { flex: none; width: 22px; height: 20px; padding: 0; border-radius: var(--radius-sm); line-height: 1; font-size: 14px; }
.hub-group-none { margin: 0 4px 0 24px; }
.hub-drawing { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 5px 8px 5px 24px; border: none; border-radius: var(--radius-md); background: none; text-align: left; color: var(--text); cursor: pointer; }
.hub-drawing:hover { background: var(--panel-alt); }
.hub-drawing[draggable="true"] { cursor: grab; }
.hub-drawing.dragging { opacity: .45; }
.hub-drawing-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hub-folder-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 2px 4px 4px; }
.hub-folder-tools .danger { color: #d9534f; }
.hub-folder-form { display: flex; gap: 6px; padding: 4px; }
.hub-folder-form input { flex: 1; min-width: 0; }

@media (max-width: 900px) {
    .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .home-body { flex-direction: column; overflow: auto; }
    .home-projects { flex: none; border-right: none; border-bottom: 1px solid var(--stroke); max-height: 40vh; }
    .home-dash { overflow: visible; padding: 16px; }
    .home-header { padding: 8px 16px; }
    .home-product { display: none; }
    .hub-side { flex: none; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--stroke); padding: 6px; }
    .hub-mod { width: auto; white-space: nowrap; padding: 7px 10px; }
    .hub-side-rule { width: 1px; height: auto; margin: 4px; }
    .hub-side.with-folders { flex-basis: auto; overflow-x: auto; }
    .hub-side .hub-folders { display: none; }
    .hub-welcome, .hub-list { padding-left: 16px; padding-right: 16px; }
    .hub-switch-btn { max-width: 52vw; }
    .home-header:has(.hub-switch) .home-wordmark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .home-wordmark { transition: none; }
}

/* ----- Title block manager (Components/TitleBlockManager.razor) ----- */
.dialog.tb-manager { width: min(1320px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; overflow: hidden; border-top: 3px solid var(--accent); }
.tb-manager .ticket-head { justify-content: flex-start; }
.tb-head-note { flex: 1; margin-bottom: 6px; }
.tb-close { border: none; background: none; font-size: calc(16px * var(--ui-font, 1)); cursor: pointer; color: var(--text-muted, inherit); margin-bottom: 6px; }
.tb-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr) 270px; gap: 12px; }
.tb-library, .tb-props { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.tb-list { display: flex; flex-direction: column; border: 1px solid var(--stroke); border-radius: var(--radius-sm); max-height: 280px; overflow-y: auto; flex: none; }
.tb-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: none; border-bottom: 1px solid var(--stroke); border-radius: 0; background: none; padding: 6px 8px; cursor: pointer; }
.tb-item:last-child { border-bottom: none; }
.tb-item:hover { background: var(--accent-soft, rgba(0, 0, 0, 0.05)); }
.tb-item.on { background: var(--accent-soft, rgba(0, 0, 0, 0.08)); box-shadow: inset 3px 0 0 var(--accent); }
.tb-item-name { font-weight: 600; }
.tb-item-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tb-tag { font-size: calc(10px * var(--ui-font, 1)); padding: 0 5px; border-radius: var(--radius-lg); border: 1px solid var(--stroke); color: var(--text-muted, inherit); }
.tb-tag.accent { border-color: var(--accent); color: var(--accent); }
.tb-list-buttons { flex-wrap: wrap; }
.tb-use { display: flex; flex-direction: column; gap: 6px; }
.tb-use-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tb-field { display: flex; flex-direction: column; gap: 2px; font-size: calc(12px * var(--ui-font, 1)); }
.tb-field input, .tb-field select, .tb-field textarea { width: 100%; box-sizing: border-box; }
.tb-fields { display: flex; flex-direction: column; gap: 7px; }
.tb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tb-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.tb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tb-tools .tool.on { background: var(--accent); color: var(--on-accent); }
.tb-tools .divider { width: 1px; align-self: stretch; background: var(--stroke); margin: 2px 4px; }
.tb-inline { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--ui-font, 1)); }
.tb-zoom { margin: 0 0 0 auto !important; }
.tb-canvas-wrap { flex: 1; min-height: 0; overflow: auto; background: #8b9099; border-radius: var(--radius-sm); outline: none; padding: 12px; }
[data-theme=dark] .tb-canvas-wrap { background: #2b2f37; }
.tb-canvas-wrap:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.tb-canvas { display: block; min-width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.tb-canvas.tool-line, .tb-canvas.tool-box, .tb-canvas.tool-text, .tb-canvas.tool-field { cursor: crosshair; }
.tb-paper { fill: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35)); }
.tb-grid line { stroke: #e3e7ee; stroke-width: 0.6px; vector-effect: non-scaling-stroke; pointer-events: none; }
.tb-hit { fill: transparent; stroke: transparent; cursor: move; }
.tb-hit.box { fill: none; stroke: transparent; stroke-width: 7px; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.tb-hit.line { stroke: transparent; stroke-width: 8px; vector-effect: non-scaling-stroke; }
.tb-hit:hover { stroke: rgba(47, 111, 222, 0.45); stroke-width: 1px; }
.tb-hit.line:hover, .tb-hit.box:hover { stroke: rgba(47, 111, 222, 0.35); stroke-width: 5px; }
.tb-hit.sel { fill: rgba(47, 111, 222, 0.08); stroke: #2f6fde; stroke-width: 1.2px; stroke-dasharray: 4 2; vector-effect: non-scaling-stroke; }
.tb-hit.line.sel, .tb-hit.box.sel { fill: none; stroke: rgba(47, 111, 222, 0.5); stroke-width: 4px; stroke-dasharray: none; }
.tb-grip { fill: #fff; stroke: #2f6fde; stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: pointer; }
.tb-draft { fill: rgba(47, 111, 222, 0.06); stroke: #2f6fde; stroke-width: 1.2px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.tb-snap { fill: none; stroke: #e0458b; stroke-width: 1.4px; vector-effect: non-scaling-stroke; pointer-events: none; }
.tb-ghost { fill: #9aa3b2; font-family: Arial, Helvetica, sans-serif; font-style: italic; pointer-events: none; }
.tb-status { display: flex; gap: 16px; min-height: 1.4em; }
.tb-logo-preview { border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: #fff; height: 70px; display: flex; align-items: center; justify-content: center; }
.tb-logo-preview img { max-width: 100%; max-height: 64px; }
.tb-note { margin-right: auto; align-self: center; }
.tb-manager .dialog-buttons { flex: none; }
.tb-pick-row { display: flex; align-items: flex-end; gap: 6px; }
.tb-pick-row label { flex: 1; }
/* Projects inside projects, and sharing them (feature views.project-tree) */
.home-project.tree { padding-left: calc(4px + var(--depth, 0) * 14px); gap: 4px; }
.home-caret { flex: none; width: 16px; text-align: center; color: var(--muted); font-size: 11px; border-radius: var(--radius-sm); transition: transform .12s; }
.home-caret.open { transform: rotate(90deg); }
.home-caret:not(.none):hover { color: var(--text); background: var(--panel); }
.home-role { flex: none; font-size: 10px; padding: 0 5px; border-radius: var(--radius-lg); background: var(--panel-alt); color: var(--muted); border: 1px solid var(--stroke); }
.home-lock { flex: none; width: 11px; height: 11px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.project-share-path { margin: -6px 0 10px; }
.project-share-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.project-share-add .muted { margin-top: 4px; }
.share-link.inherited { opacity: .8; }
.project-share-team { display: flex; flex-direction: column; gap: 4px; }
.project-share-settings { margin-top: 12px; border-top: 1px solid var(--stroke); padding-top: 8px; }
.project-share-settings summary { cursor: pointer; font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.home-folder { flex: none; width: 14px; height: 14px; fill: var(--accent-soft); stroke: var(--muted); stroke-width: 1; }
.home-new-drawings { display: flex; flex-wrap: wrap; gap: 6px; }
.home-check { flex: none; width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; color: #fff; background: var(--panel); }
.home-check.on { background: var(--accent); border-color: var(--accent); }
.home-check.none { visibility: hidden; }
.home-move-bar { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--accent); border-radius: var(--radius-lg); background: var(--accent-soft); }
.home-move-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.home-move-bar select { width: 100%; }

/* Title block manager: the whole sheet in Drafting (Components/TitleBlockDrafting.razor) */
.tbd { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--window); color: var(--text); }
.tbd-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--stroke); }
.tbd-head .dialog-title { margin: 0; }
.tbd-spacer { flex: 1; }
.tbd-body { flex: 1; min-height: 0; display: flex; }
.tbd-side { width: 250px; flex: none; overflow-y: auto; padding: 10px 12px; background: var(--panel); border-right: 1px solid var(--stroke); }
.tbd-side .section-header { margin-top: 14px; }
.tbd-side .section-header:first-child { margin-top: 0; }
.tbd-side .button-row { display: flex; gap: 6px; margin-top: 6px; }
.tbd-params { display: flex; flex-direction: column; gap: 1px; max-height: 44vh; overflow-y: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.tbd-param-group { padding: 4px 8px 2px; font-size: calc(10px * var(--ui-font, 1)); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--window); }
.tbd-param { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 8px; border: none; border-radius: 0; background: none; text-align: left; cursor: pointer; font-size: calc(12px * var(--ui-font, 1)); }
.tbd-param:hover { background: var(--accent-soft, rgba(0, 0, 0, .06)); }
.tbd-param.used span:first-child { font-weight: 600; }
.tbd-new { display: flex; gap: 4px; margin-top: 6px; }
.tbd-new input { flex: 1; min-width: 0; }
.tbd-picture { display: inline-block; position: relative; overflow: hidden; }
.tbd-picture input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tbd-main { background: var(--canvas); }
.tbd-props { width: 280px; flex: none; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--stroke); padding: 0 0 10px; }
.tbd-props > .section-header, .tbd-props > p { margin-left: 10px; margin-right: 10px; }
.tbd-props .dp-group-head { cursor: default; }
.tb-sheet-preview { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.tb-sheet-card { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 3 1 360px; cursor: pointer; }
.tb-sheet-card.cover { flex: 1 1 160px; max-width: 260px; }
.tb-sheet-card svg { width: 100%; height: auto; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.tb-sheet-card .muted { color: #f2f4f8; }
.tool.tb-drafting { white-space: nowrap; }
.home-tick-col { width: 22px; padding-right: 0 !important; }
.home-table tr.ticked td { background: var(--accent-soft); }
.home-move-lineups { margin-bottom: 8px; }
.home-move-row { display: flex; gap: 6px; }
.home-move-row select { flex: 1; min-width: 0; }
.home-pane-head { gap: 6px; }
.home-pane-head h2 { flex: 1; }
.home-edit { padding: 2px 10px; font-size: 12px; }
.home-edit.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.home-card-tools { display: flex; align-items: center; gap: 8px; }

/* ----- Saved versions (File, Versions…): the list, and two versions side by side to compare and merge ----- */
.versions-dialog { width: 980px; }
.versions-save .button-row { align-items: center; margin-top: 8px; }
.versions-where { margin-left: 4px; }
.versions-done { color: var(--success); margin: 8px 0 0; }
.versions-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: calc(13px * var(--ui-font, 1)); }
.versions-table th { text-align: left; font-weight: 600; color: var(--section-label); font-size: calc(11px * var(--ui-font, 1)); text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 6px; border-bottom: 1px solid var(--stroke); }
.versions-table td { padding: 6px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.versions-table tr.current td { background: var(--panel-alt); }
.versions-table .tick { width: 24px; }
.versions-actions { white-space: nowrap; text-align: right; }
.versions-actions button { margin-left: 4px; }
.versions-rename { display: flex; gap: 4px; flex-wrap: wrap; }
.versions-rename input { min-width: 0; flex: 1 1 120px; }
.versions-footer { margin-top: 12px; align-items: center; }
.versions-close { margin-left: auto; }

.versions-compare {
    position: fixed;
    inset: 12px;
    z-index: 30;
    display: grid;
    grid-template-rows: auto minmax(160px, 1fr) minmax(140px, auto);
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.versions-compare-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.versions-compare-head .dialog-title { margin: 0; }
.versions-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: calc(12px * var(--ui-font, 1)); }
.versions-legend i { display: inline-block; width: 12px; height: 12px; border: 2px solid; border-radius: var(--radius-sm); margin-left: 6px; }
.versions-legend i.changed { border-color: #D98E04; }
.versions-legend i.added { border-color: #2E8BC9; }
.versions-legend i.picked { border-color: var(--selection); background: color-mix(in srgb, var(--selection) 30%, transparent); }
.versions-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; }
.versions-pane { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--sheet); }
.versions-pane-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--stroke); background: var(--panel-alt); }
.versions-pane-head select { max-width: 60%; }
.versions-picture { flex: 1; min-height: 0; overflow: auto; padding: 6px; }
.versions-picture svg { width: 100%; height: 100%; display: block; }
.version-mark { fill: none !important; stroke-width: 3px !important; }
.version-mark.changed { stroke: #D98E04 !important; }
.version-mark.added { stroke: #2E8BC9 !important; }
.version-mark.picked { stroke: var(--selection) !important; fill: color-mix(in srgb, var(--selection) 18%, transparent) !important; }
.versions-diffs { min-height: 0; max-height: 40vh; overflow: auto; }
.versions-diffs-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; top: 0; background: var(--panel); padding-bottom: 4px; }
.versions-take-all { margin-left: auto; display: flex; gap: 12px; }
.versions-table.diff { margin-top: 4px; }
.versions-table.diff tbody tr { cursor: pointer; }
.versions-table.diff tr.picked td { background: var(--accent-soft); }
.versions-table.diff td.take label { display: flex; gap: 6px; align-items: flex-start; justify-content: flex-start; text-align: left; cursor: pointer; margin: 0; font-weight: inherit; }
.versions-table.diff td.take input { width: auto; min-width: 0; flex: none; margin: 2px 0 0; }
.versions-table.diff td { width: auto; }
.versions-table.diff td.take { width: 28%; }
.versions-table.diff td.take.on { font-weight: 600; }
.versions-table.diff td.take:not(.on) { color: var(--muted); }
.versions-merge { margin-top: 10px; align-items: center; position: sticky; bottom: 0; background: var(--panel); padding-top: 6px; }
@media (max-width: 760px) {
    .versions-panes { grid-template-columns: 1fr; }
    .versions-actions { white-space: normal; }
}
.version-name { margin-left: 4px; }
/* Versions of a Systems or Layouts drawing (Components/DrawingVersionsDialog.razor) */
.drawing-versions { max-height: calc(100vh - 48px); overflow: auto; }
.drawing-versions .versions-keep { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.drawing-versions-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.drawing-versions-pick label { display: flex; align-items: center; gap: 6px; margin: 0; }
.drawing-versions-pick select { width: auto; min-width: 200px; }
.drawing-versions-diffs { max-height: 60vh; }
.drawing-versions .version-note { white-space: pre-line; }

/* ----- TLA Database view on the home page (Components/TlaDatabase.razor, feature views.tla-database) ----- */
.home-plain.on { color: var(--accent); font-weight: 600; }
.tla-db { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 24px 20px; }
.tla-db-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tla-db-head h1 { margin: 0; font-size: calc(22px * var(--ui-font, 1)); font-weight: 600; }
.tla-db-back { background: none; }
.tla-db-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tla-db-search { flex: 1 1 320px; max-width: 520px; width: auto; }
.tla-db-filters select { flex: none; width: auto; min-width: 160px; }
.tla-db-scroll { flex: 1; min-height: 0; overflow: auto; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); }
.tla-db-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); cursor: pointer; user-select: none; white-space: nowrap; padding: 6px; }
.tla-db-table th:hover { color: var(--text); }
.tla-db-table td { padding: 5px 6px; white-space: nowrap; height: 20px; }
.tla-db-table tbody tr { cursor: default; }
.tla-db-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.tla-db-table .tla-db-desc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.tla-db-table td.muted { color: var(--muted); }
.tla-db-empty { padding: 12px 4px; }
@media (max-width: 700px) {
    .tla-db { padding: 12px 16px; }
}

/* ----- Spec sheets: Show data information (Components/SpecSheetViewer.razor, js/specsheet.js) ----- */
.dialog.spec-sheet { width: min(1400px, 100%); height: min(920px, 100%); max-height: none; display: flex; flex-direction: column; overflow: hidden; }
.spec-viewer { position: relative; flex: 1; min-height: 0; display: flex; gap: 12px; }
.spec-side { flex: 0 0 280px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.spec-item { display: flex; flex-direction: column; gap: 2px; }
.spec-tla { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; font-size: 12px; color: var(--muted); }
.spec-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.spec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.spec-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-md); background: none; text-align: left; color: var(--text); }
.spec-row:hover:not(:disabled) { background: var(--panel-alt); border-color: var(--stroke); }
.spec-row:disabled { opacity: 1; cursor: default; }
.spec-label { width: 56px; color: var(--muted); }
.spec-value { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-found { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--accent); }
.spec-found.none { color: var(--muted); }
.spec-swatch { flex: none; width: 12px; height: 12px; border-radius: var(--radius-sm); }
.spec-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--stroke); }
.spec-buttons label.button input[type=file] { display: none; }
.spec-pages { flex: 1; min-width: 0; overflow: auto; padding: 12px; background: var(--panel-alt); border: 1px solid var(--stroke); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.spec-page { position: relative; flex: none; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.spec-page canvas { display: block; }
.spec-page-number { position: absolute; right: 6px; bottom: -2px; transform: translateY(100%); font-size: 10px; color: var(--muted); }
.spec-status { position: absolute; left: calc(280px + 12px); right: 0; top: 40%; text-align: center; color: var(--muted); padding: 0 24px; pointer-events: none; }
.spec-mark { position: absolute; border-radius: var(--radius-sm); mix-blend-mode: multiply; pointer-events: auto; }
.spec-mark.current { outline: 2px solid #111; outline-offset: 1px; }
.spec-model { --spec: #c9a8ff; }
.spec-ru { --spec: #8fe3a5; }
.spec-size { --spec: #8cc8ff; }
.spec-weight { --spec: #ffc074; }
.spec-power { --spec: #ff9a9a; }
.spec-mark, .spec-swatch { background: var(--spec); }
.tla-db-sheet { white-space: nowrap; }
@media (max-width: 800px) {
    .spec-viewer { flex-direction: column; }
    .spec-side { flex: none; max-height: 40%; }
    .spec-status { left: 0; }
}

/* ===== Avatar menu (Components/ProfileMenu.razor, feature views.profile-menu) ===== */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; object-fit: cover; box-sizing: border-box; }
.avatar.initials { background: var(--logo-navy); color: #fff; font-weight: 700; line-height: 1; user-select: none; }
img.avatar { border: 1px solid var(--stroke); background: #fff; }
.profile-menu { position: relative; display: inline-flex; align-items: center; }
.profile-avatar-btn { display: inline-flex; padding: 1px; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.profile-avatar-btn:hover, .profile-avatar-btn[aria-expanded="true"] { border-color: var(--accent); }
.profile-shield { position: fixed; inset: 0; z-index: 28; }
.profile-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 29; width: 280px; max-width: calc(100vw - 24px); padding: 6px 0;
    background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    font-size: calc(13px * var(--ui-font, 1)); text-align: left; }
.profile-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 10px; }
.profile-who { display: flex; flex-direction: column; min-width: 0; }
.profile-who b, .profile-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-who span { font-size: 0.92em; }
.profile-sep { height: 1px; margin: 6px 0; background: var(--stroke); }
.profile-panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 14px; border: none; border-radius: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.profile-panel button:hover, .profile-panel button:focus-visible { background: var(--panel-alt); }
.profile-panel svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.profile-menu.in-topbar, .profile-menu.in-shell { margin-left: 6px; }
.profile-dialog { width: 560px; max-width: calc(100vw - 32px); }
.profile-edit { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.profile-picture { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 150px; text-align: center; }
.profile-picture .button input[type=file] { display: none; }
.profile-fields { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.profile-fields .field input { width: 100%; box-sizing: border-box; }

/* ===== Layouts module (Components/LayoutsView.razor, LayoutsModule.razor) ===== */
.layouts-new { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.layouts-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.layouts-field > span { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.layouts-field input, .layouts-field select { width: 100%; box-sizing: border-box; }
.layouts-check { display: flex; align-items: center; gap: 6px; font-size: calc(12px * var(--ui-font, 1)); }
.layouts-export-format { align-items: flex-start; margin: 2px 0; }
.layouts-export-format input { width: auto; flex: none; margin: 2px 0 0; }
.layouts-export-format > span { flex: 1; text-align: left; line-height: 1.35; }
.layouts-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.layouts-row.end { justify-content: flex-end; }
.layouts-error { color: var(--error); }
.layouts-page { position: fixed; inset: 0; z-index: 26; display: flex; flex-direction: column; background: var(--window); color: var(--text); font-size: calc(13px * var(--ui-font, 1)); outline: none; }
.layouts-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--stroke); background: var(--panel); flex-wrap: wrap; }
.layouts-bar button.on { background: var(--accent-soft); border-color: var(--accent); }
.layouts-back { font-weight: 600; }
.layouts-name { font-size: calc(15px * var(--ui-font, 1)); font-weight: 600; border: 1px solid transparent; background: transparent; color: var(--text); padding: 3px 6px; border-radius: var(--radius-sm); min-width: 120px; max-width: 360px; }
input.layouts-name:hover, input.layouts-name:focus { border-color: var(--stroke); background: var(--window); }
.layouts-pill { font-size: calc(11px * var(--ui-font, 1)); padding: 1px 8px; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--text); }
.layouts-spacer { flex: 1; }
.layouts-sep { width: 1px; height: 20px; background: var(--stroke); margin: 0 4px; }
.layouts-body { flex: 1; display: grid; grid-template-columns: 260px 1fr 300px; min-height: 0; }
.layouts-browser, .layouts-props { background: var(--panel); overflow: auto; padding: 8px; min-height: 0; }
.layouts-browser { border-right: 1px solid var(--stroke); }
.layouts-props { border-left: 1px solid var(--stroke); }
.layouts-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.layouts-panel-head h3 { margin: 0; font-size: calc(12px * var(--ui-font, 1)); text-transform: uppercase; letter-spacing: .04em; color: var(--section-label, var(--muted)); }
.layouts-filter { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.layouts-group { margin: 10px 0 2px; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.layouts-folder { cursor: pointer; padding: 3px 4px; font-weight: 600; user-select: none; border-radius: var(--radius-sm); }
.layouts-folder:hover { background: var(--panel-alt); }
.layouts-caret { display: inline-block; width: 14px; color: var(--muted); }
.layouts-item { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: var(--radius-sm); cursor: pointer; user-select: none; }
.layouts-item:hover { background: var(--panel-alt); }
.layouts-item.picked { background: var(--selection); }
.layouts-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layouts-hint { margin: 2px 4px 6px; }
.layouts-icon { width: 12px; height: 12px; flex: none; border: 1.5px solid var(--muted); border-radius: var(--radius-sm); box-sizing: border-box; }
.layouts-icon.floorplan { border-bottom-width: 4px; }
.layouts-icon.ceilingplan { border-top-width: 4px; }
.layouts-icon.threed { transform: rotate(45deg) scale(.85); }
.layouts-icon.level { border-radius: 0; border-width: 0 0 2px 0; border-style: dashed; height: 8px; }
.layouts-fmt { font-size: calc(9.5px * var(--ui-font, 1)); font-weight: 700; padding: 1px 4px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); flex: none; min-width: 30px; text-align: center; }
.layouts-warn { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--warning); color: #000; font-weight: 700; font-size: 11px; display: grid; place-items: center; }
.layouts-spin { flex: none; display: inline-block; width: 12px; height: 12px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: layouts-spin .8s linear infinite; vertical-align: -2px; }
@keyframes layouts-spin { to { transform: rotate(360deg); } }
.layouts-add-level { display: flex; gap: 4px; margin: 4px 0; }
.layouts-add-level input { min-width: 0; flex: 1; }
.layouts-add-level input[type=number] { width: 80px; flex: none; }
.layouts-view { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--canvas, var(--window)); }
.layouts-host { position: absolute; inset: 0; }
.layouts-host.drop-over { outline: 3px dashed var(--accent); outline-offset: -8px; }
.layouts-canvas { display: block; touch-action: none; }
.layouts-view-title { position: absolute; left: 10px; top: 8px; padding: 4px 10px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--stroke); pointer-events: none; max-width: calc(100% - 40px); }
.layouts-progress { position: absolute; left: 50%; transform: translateX(-50%); bottom: 16px; padding: 6px 12px; border-radius: var(--radius-md); background: var(--panel); border: 1px solid var(--stroke); box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.layouts-progress + .layouts-progress { bottom: 56px; }
/* Manage Links (LayoutsView.Links.cs) */
.layouts-changed { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 8px; max-width: min(720px, calc(100% - 32px)); padding: 6px 8px 6px 12px; border-radius: var(--radius-md); background: var(--panel); border: 1px solid var(--warning); box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.layouts-changed .grow { flex: 1; min-width: 0; }
.layouts-group:has(.layouts-group-btn) { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.layouts-group-btn { padding: 0 6px; min-height: 0; line-height: 18px; font-size: calc(10px * var(--ui-font, 1)); font-weight: 400; text-transform: none; letter-spacing: 0; }
.layouts-manage .dialog-list { max-height: 60vh; }
.layouts-links-table { width: 100%; border-collapse: collapse; font-size: calc(12px * var(--ui-font, 1)); }
.layouts-links-table th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--stroke); }
.layouts-links-table td { padding: 6px 8px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.layouts-venue-head th { position: static; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); color: var(--text); font-weight: 700; padding: 8px 8px 4px; border-bottom: 1px solid var(--stroke); text-align: left; }
.layouts-venue-head th .muted { font-weight: 400; margin-left: 6px; }
.layouts-venue-input { width: 9em; min-width: 0; }
.layouts-tabs.layouts-page-tabs { margin: 0 0 10px; }
.layouts-tabs.layouts-page-tabs button { flex: 0 0 auto; padding: 6px 14px; font-size: calc(13px * var(--ui-font, 1)); }
.layouts-xrefs .home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.layouts-xrefs-tools { display: flex; gap: 6px; }
.layouts-xrefs-tools input { width: 16em; max-width: 50vw; }
.layouts-xref-table { width: 100%; }
.layouts-xref-table td { vertical-align: top; }
.layouts-xref-table td.num { white-space: nowrap; }
.layouts-xref-table .layouts-venue-head th { font-size: calc(13px * var(--ui-font, 1)); padding-top: 14px; }
.layouts-links-actions { white-space: nowrap; text-align: right; }
.layouts-links-actions button { margin-left: 4px; }
.layouts-state { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: calc(11px * var(--ui-font, 1)); white-space: nowrap; border: 1px solid var(--stroke); }
.layouts-state.ok { border-color: var(--accent); color: var(--accent); }
.layouts-state.warn { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 18%, transparent); }
.layouts-state.off, .layouts-state.busy { color: var(--muted); }
.layouts-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; pointer-events: none; }
.layouts-empty h3 { margin: 0 0 6px; }
.layouts-empty p { max-width: 460px; }
.layouts-toast { position: absolute; right: 12px; top: 8px; max-width: 420px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.15); cursor: pointer; }
.layouts-toast.bad { border-color: var(--error); }
.layouts-card { border: 1px solid var(--stroke); border-radius: var(--radius-md); padding: 8px 10px; margin-bottom: 8px; background: var(--window); display: flex; flex-direction: column; gap: 8px; }
.layouts-card-title { font-weight: 600; cursor: default; }
.layouts-card-sub { margin: 8px 0 2px; font-size: 0.85em; font-weight: 600; color: var(--muted, #888); }
details.layouts-card > summary { cursor: pointer; }
.layouts-dl { display: grid; grid-template-columns: minmax(80px, 40%) 1fr; gap: 3px 8px; margin: 0; font-size: calc(12px * var(--ui-font, 1)); }
.layouts-dl dt { color: var(--muted); overflow-wrap: anywhere; }
.layouts-dl dd { margin: 0; overflow-wrap: anywhere; }
.layouts-note { margin: 0; padding: 6px 8px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warning) 18%, transparent); font-size: calc(12px * var(--ui-font, 1)); }
@media (max-width: 900px) {
    .layouts-body { grid-template-columns: 1fr; grid-template-rows: 180px 1fr 220px; }
    .layouts-browser { border-right: none; border-bottom: 1px solid var(--stroke); }
    .layouts-props { border-left: none; border-top: 1px solid var(--stroke); }
}

/* Layouts: issues, pins and view-only links (LayoutsView.Issues.cs). */
.layouts-tabs { display: flex; gap: 2px; margin: -2px 0 8px; border-bottom: 1px solid var(--stroke); }
.layouts-tabs button { flex: 1; border: none; background: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 6px 4px; color: var(--muted); font-weight: 600; font-size: calc(12px * var(--ui-font, 1)); }
.layouts-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.layouts-count { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 4px; border-radius: var(--radius-lg); background: var(--error); color: #fff; font-size: 10px; line-height: 16px; }
.layouts-mini { padding: 2px 8px; }
.layouts-issue { display: flex; align-items: flex-start; gap: 8px; padding: 6px; border-radius: var(--radius-md); cursor: pointer; }
.layouts-issue:hover { background: var(--panel-alt); }
.layouts-issue.picked { background: var(--selection); }
.layouts-issue .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.layouts-issue-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layouts-issue-n, .layouts-pin { --pin: var(--error); display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: var(--radius-lg); background: var(--pin); color: #fff; font-weight: 700; font-size: 11px; flex: none; }
.layouts-issue-n.in_progress, .layouts-pin.in_progress { --pin: #D9822B; }
.layouts-issue-n.resolved, .layouts-pin.resolved { --pin: #2F9E44; }
.layouts-issue-n.closed, .layouts-pin.closed { --pin: #868E96; }
.layouts-pin.draft { --pin: var(--accent); }
.layouts-issue-foot { padding-top: 8px; border-top: 1px solid var(--stroke); margin-top: 8px; }
.layouts-issue-pic { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--stroke); cursor: pointer; display: block; }
.layouts-issue-head { font-weight: 600; font-size: calc(14px * var(--ui-font, 1)); }
.layouts-issue-desc { white-space: pre-wrap; margin: 0; }
.layouts-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.layouts-actions.start { justify-content: flex-start; }
.layouts-comment { border-left: 2px solid var(--stroke); padding-left: 8px; display: flex; flex-direction: column; gap: 2px; white-space: pre-wrap; }
.layouts-card textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.layouts-field textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.layouts-link { width: 100%; box-sizing: border-box; font-size: 11px; }
.layouts-card.off { opacity: .6; }
.layouts-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.layouts-canvas.sketching { cursor: crosshair; }
.layouts-sketch-label { position: absolute; left: 0; top: 0; padding: 2px 6px; border-radius: var(--radius-sm); background: rgba(20, 24, 30, .82); color: #fff; font-size: 11px; white-space: nowrap; pointer-events: none; }
.layouts-sketch-mark { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid #2f7de1; pointer-events: none; }
.layouts-sketch-mark.on { border-radius: 50%; }
.layouts-swatch { width: 12px; height: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); flex: none; }
.layouts-icon.refplane { border-radius: 0; border-width: 0 0 2px 0; border-style: dashed; border-color: #1f9d55; height: 8px; }
.layouts-pin { position: absolute; left: 0; top: 0; margin: -11px 0 0 -11px; border: 2px solid #fff; pointer-events: auto; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); will-change: transform; }
.layouts-pin.picked { outline: 3px solid var(--accent); outline-offset: 1px; z-index: 1; }
.layouts-canvas.placing { cursor: crosshair; }
.layouts-issue.picked .muted { color: inherit; opacity: .75; }

/* Share link viewer: plan, spreadsheet and sheets on the markup board */
.board-sheet-pick { display: inline-flex; align-items: center; gap: 2px; }
.board-sheet-pick select { max-width: 280px; }
.board-paper { background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); line-height: 0; }
.board-paper > svg { display: block; }
.board-empty { padding: 24px; }
.board-plan .markup-surface, .board-spreadsheet .markup-surface, .board-sheets .markup-surface { width: max-content; }
.relayout-choice { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 4px; }
.relayout-choice label.check { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 6px; margin: 2px 0 0; color: var(--text); }
.relayout-choice label.check input { width: auto; flex: none; margin: 0; }
.match-layout { max-width: 520px; }
.match-layout > label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.match-targets { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin: 4px 0 8px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.match-targets label.check { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 6px; margin: 0; color: var(--text); }
.match-targets label.check.muted { color: var(--muted); }
.match-targets label.check input { width: auto; flex: none; margin: 0; }
/* Import PDF / picture onto a sheet (views.sheet-import) */
.dialog.sheet-import { width: 640px; }
.sheet-import-file { display: flex; align-items: center; gap: 10px; margin: 10px 0; cursor: pointer; }
.sheet-import-file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.sheet-import-file .tool { padding: 5px 12px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel-alt); }
.sheet-import-file:focus-within .tool { outline: 2px solid var(--accent); }
.sheet-import-error { color: var(--error); margin: 6px 0; }
.sheet-import-pagebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; }
.sheet-import-pagebar input { width: 80px; }
.sheet-import-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding: 4px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); margin-bottom: 8px; }
.sheet-import-page { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 2px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; color: var(--text); }
.sheet-import-page.on { border-color: var(--accent); }
.sheet-import-page img { max-width: 100%; max-height: 140px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); background: #fff; }
.sheet-import-wait { width: 90px; height: 120px; background: var(--stroke); opacity: 0.4; border-radius: var(--radius-sm); }

/* Depth colours (views.depth-colours): gear tinted green from 400 mm deep, yellow from 600 mm, red from 800 mm.
   A screen aid only: never printed (sheets print from their own SVG, which doesn't carry it), nor exported. */
.depth-tint { position: absolute; inset: 0; pointer-events: none; z-index: 1; mix-blend-mode: normal; }
.depth-tint.green { background: rgba(47, 179, 68, 0.38); box-shadow: inset 0 0 0 2px rgba(47, 179, 68, 0.95); }
.depth-tint.yellow { background: rgba(242, 194, 0, 0.42); box-shadow: inset 0 0 0 2px rgba(222, 176, 0, 0.95); }
.depth-tint.red { background: rgba(224, 49, 49, 0.40); box-shadow: inset 0 0 0 2px rgba(224, 49, 49, 0.95); }
.sheet-depth-tint { pointer-events: none; }
.sheet-depth-tint.green { fill: rgba(47, 179, 68, 0.35); stroke: rgb(47, 179, 68); }
.sheet-depth-tint.yellow { fill: rgba(242, 194, 0, 0.40); stroke: rgb(222, 176, 0); }
.sheet-depth-tint.red { fill: rgba(224, 49, 49, 0.35); stroke: rgb(224, 49, 49); }
@media print { .depth-tint, .sheet-depth-tint { display: none !important; } }
/* Lay out again preview: where the views were (dashed orange) and where they go (blue). */
.preview-was { fill: none; stroke: #e07b00; stroke-width: 1.5px; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.preview-now { fill: rgba(43, 108, 230, 0.06); stroke: #2b6ce6; stroke-width: 1.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.preview-key { display: inline-block; width: 14px; height: 9px; margin: 0 3px 0 6px; vertical-align: middle; }
.preview-key.was { border: 1.5px dashed #e07b00; }
.preview-key.now { border: 1.5px solid #2b6ce6; background: rgba(43, 108, 230, 0.06); }
.pill.relayout-preview { background: #2b6ce6; color: #fff; }
/* Feature views.spreadsheet-fill: several cells picked, and the fill handle at the corner of the block. */
.spreadsheet:not(.ss-readonly) .ss-table td.ss-gear { user-select: none; -webkit-user-select: none; }
.ss-table td.ss-gear.sel { box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--selection) 18%, transparent); outline: 1px solid color-mix(in srgb, var(--selection) 60%, transparent); outline-offset: -1px; }
.ss-table td.ss-gear.sel.cur { outline: 2px solid var(--selection); outline-offset: -2px; }
.ss-table td.ss-gear.fill-target { outline: 2px dashed var(--selection); outline-offset: -2px; z-index: 1; }
.ss-fill { position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; background: var(--selection); border: 1px solid var(--panel); cursor: crosshair; z-index: 3; touch-action: none; }

/* ----- Export CSV: the data in an Excel-style grid to filter before downloading (Components/CsvExportView.razor) ----- */
.dialog.csv-export { width: min(1500px, 100%); height: min(900px, 100%); max-height: none; display: flex; flex-direction: column; overflow: hidden; }
.csvx { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.csvx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.csvx-search { width: 200px; }
.csvx-hint { font-size: calc(12px * var(--ui-font, 1)); }
.csvx button.filtered { border-color: var(--accent); color: var(--accent); }
.csvx-cols-wrap { position: relative; }
.csvx-pop { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); padding: 8px; z-index: 40;
    display: flex; flex-direction: column; gap: 4px; font-size: calc(13px * var(--ui-font, 1)); }
.csvx-cols { position: absolute; top: calc(100% + 4px); left: 0; width: 230px; max-height: 420px; overflow: auto; }
.csvx-pop label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.csvx-pop-row { display: flex; gap: 6px; justify-content: flex-end; padding-top: 4px; }
.csvx-menu { position: fixed; width: 260px; max-height: min(520px, calc(100vh - 24px)); overflow: auto; }
.csvx-item { text-align: left; border: 1px solid transparent; background: none; padding: 4px 6px; border-radius: var(--radius-sm); color: var(--text); }
.csvx-item:hover:not(:disabled) { background: var(--accent-soft); }
.csvx-sep { height: 1px; background: var(--stroke); margin: 4px 0; }
.csvx-op { flex-direction: column; align-items: stretch !important; gap: 2px !important; }
.csvx-op span { color: var(--muted); font-size: calc(12px * var(--ui-font, 1)); }
.csvx-find { width: 100%; box-sizing: border-box; }
.csvx-values { border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 4px 6px; max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.csvx-grid { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--stroke); background: var(--panel); }
.csvx-grid table { border-collapse: separate; border-spacing: 0; font-size: calc(13px * var(--ui-font, 1)); font-variant-numeric: tabular-nums; }
.csvx-grid th, .csvx-grid td { border-right: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); padding: 2px 8px; height: 24px; box-sizing: border-box;
    white-space: nowrap; text-align: left; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.csvx-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--header-band); font-weight: 600; font-size: calc(12px * var(--ui-font, 1));
    cursor: pointer; padding-right: 28px; user-select: none; }
.csvx-grid thead th.sorted .csvx-head, .csvx-grid thead th.filtered .csvx-head { color: var(--accent); }
.csvx-grid th.rownum { position: sticky; left: 0; z-index: 1; background: var(--header-band); color: var(--muted); font-weight: 400; text-align: right; min-width: 44px; padding-right: 8px; }
.csvx-grid thead th.rownum { z-index: 3; }
.csvx-grid tbody tr:hover td { background: var(--accent-soft); }
.csvx-caret { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); min-width: 0; min-height: 0; width: 20px; height: 18px; padding: 0;
    border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel); color: var(--muted); font-size: 11px; line-height: 1; }
.csvx-caret.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.csvx-empty { padding: 16px; }
.csvx-foot { display: flex; align-items: center; gap: 10px; }
.csvx-foot > span:first-child { flex: 1; }
.csvx-file { font-size: calc(12px * var(--ui-font, 1)); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) {
    .csvx-hint, .csvx-file { display: none; }
}

/* ===== PDFs module (feature layouts.pdfs) ===== */
.pdf-list.drop-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.pdf-list-head { display: flex; align-items: center; gap: 8px; }
.pdf-into { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.pdf-into select { max-width: 220px; }
.pdf-list-filter { max-width: 220px; }
.pdf-upload { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--stroke); }
.pdf-upload .grow { flex: 1; }
.pdf-open { display: inline-flex; align-items: center; gap: 8px; color: var(--text) !important; font-weight: 600; text-align: left; }
.pdf-icon { font-size: 9px; font-weight: 700; color: #fff; background: #d6336c; border-radius: var(--radius-sm); padding: 2px 4px; letter-spacing: .5px; }
.pdf-ver { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 0 6px; }
.pdf-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pdf-chip { display: inline-block; font-size: 11px; font-weight: 500; line-height: 16px; padding: 0 6px; margin: 0 4px 2px 0; border-radius: var(--radius-lg); border: 1px solid var(--line, #8884); background: transparent; color: var(--muted, inherit); cursor: pointer; }
.pdf-chip.discipline { color: var(--accent); border-color: var(--accent); }
.pdf-chips .pdf-chip { margin: 0; }
.pdf-sheets-disciplines { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.pdf-sheets-disciplines textarea { width: 100%; font-family: inherit; }
.pdf-note { margin: 6px 4px; }
.pdf-table td.nowrap button { margin-left: 8px; }
.pdf-rename { width: 100%; }

/* ===== PDF viewer laid out like Bluebeam Revu ===== */
.pdfr {
    /* The app's own theme colours (light, dark and the theme presets), so PDFs look like the rest of Rack Build. */
    --r-chrome: var(--window); --r-bar: var(--panel-alt); --r-panel: var(--panel); --r-line: var(--stroke); --r-text: var(--text); --r-muted: var(--muted);
    --r-accent: var(--accent); --r-accent-soft: var(--accent-soft); --r-doc: var(--canvas); --r-hover: var(--header-band); --r-row: var(--panel-alt);
    position: fixed; inset: 0; z-index: 27; display: flex; flex-direction: column; background: var(--r-chrome); color: var(--r-text);
    font-size: calc(12px * var(--ui-font, 1)); line-height: 1.35; user-select: none;
}
.pdfr button, .pdfr input, .pdfr select, .pdfr textarea { font: inherit; color: inherit; }
.pdfr button { background: none; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 2px 6px; cursor: pointer; min-height: 0; }
.pdfr button:hover:not(:disabled) { background: var(--r-hover); }
.pdfr button:disabled { opacity: .4; cursor: default; }
.pdfr button.primary { background: var(--r-accent); color: var(--on-accent); border-color: var(--r-accent); }
.pdfr button.danger { color: #e03131; border-color: #e0313155; }
.pdfr input, .pdfr select, .pdfr textarea { background: var(--r-panel); border: 1px solid var(--r-line); border-radius: var(--radius-sm); padding: 2px 5px; }
.pdfr textarea { user-select: text; resize: vertical; width: 100%; }
.pdfr .muted { color: var(--r-muted); }
.pdfr .grow, .pdfr-grow { flex: 1; min-width: 0; }
.pdfr .num { text-align: right; }
.pdfr .nowrap { white-space: nowrap; }

.pdfr-title { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; background: var(--r-bar); border-bottom: 1px solid var(--r-line); }
.pdfr-back { font-weight: 600; }
.pdfr-doc-icon { font-size: 9px; font-weight: 700; color: #fff; background: #d6336c; border-radius: var(--radius-sm); padding: 2px 4px; }
.pdfr-doc-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.pdfr-pill { font-size: 11px; padding: 1px 8px; border-radius: var(--radius-lg); background: var(--r-accent-soft); }
.pdfr-pill.past { background: #fff3bf; color: #5c3c00; }
.pdfr-version { max-width: 320px; font-size: 12px; padding: 2px 6px; }
.pdfr-latest { font-size: 12px; padding: 2px 8px; }
.pdfr-save { color: var(--r-muted); font-size: 11px; }
.pdfr-save.bad { color: #e03131; }
.pdfr-people { display: flex; gap: 3px; }
.pdfr-avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 11px; padding: 0 !important; background: #868e96; border: 2px solid var(--r-bar) !important; }
.pdfr-avatar.me { background: var(--r-accent); }

.pdfr-menubar { display: flex; align-items: center; height: 24px; padding: 0 4px; background: var(--r-bar); border-bottom: 1px solid var(--r-line); }
.pdfr-menuwrap { position: relative; }
.pdfr-menuhead { padding: 2px 9px !important; border-radius: var(--radius-sm) !important; }
.pdfr-menuhead.on { background: var(--r-accent-soft) !important; }
.pdfr-menu { position: absolute; top: 100%; left: 0; z-index: 40; min-width: 230px; background: var(--r-panel); border: 1px solid var(--r-line); box-shadow: 0 6px 18px rgba(0,0,0,.22); padding: 3px 0; display: flex; flex-direction: column; max-height: 75vh; overflow: auto; }
.pdfr-menu hr { border: none; border-top: 1px solid var(--r-line); margin: 3px 0; }
.pdfr-menuitem { display: flex !important; align-items: center; gap: 8px; text-align: left; border-radius: 0 !important; padding: 4px 14px 4px 8px !important; white-space: nowrap; }
.pdfr-menuitem:hover:not(:disabled) { background: var(--r-accent) !important; color: var(--on-accent); }
.pdfr-menuitem .key { color: var(--r-muted); font-size: 11px; }
.pdfr-menuitem:hover .key { color: var(--on-accent); }
.pdfr-menuitem .tick { width: 14px; }
.pdfr-menu-label { padding: 3px 14px; color: var(--r-muted); font-size: 11px; font-weight: 600; }

.pdfr-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 3px 6px; background: var(--r-bar); border-bottom: 1px solid var(--r-line); }
.pdfr-tgroup { display: inline-flex; align-items: center; gap: 1px; padding: 0 5px; border-right: 1px solid var(--r-line); }
.pdfr-tgroup:last-child { border-right: none; }
.pdfr-tool { width: 28px; height: 26px; padding: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; }
.pdfr-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pdfr-tool.on { background: var(--r-accent-soft) !important; border-color: var(--r-accent) !important; color: var(--r-accent); }
.pdfr-tool[data-tool="cloud"] svg, .pdfr-tool[data-tool="cloudpoly"] svg { stroke: #e03131; }
.pdfr-tool[data-tool="highlight"] svg { stroke: #e0a800; }
.pdfr-tgroup:nth-child(5) .pdfr-tool svg { stroke: #1971c2; }
.pdfr-stamp-pick { width: 22px; padding: 0 !important; border: none !important; background: none !important; }
.pdfr-zoom { width: 58px; text-align: center; }

.pdfr-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 30px 0 1fr 0 30px; }
.pdfr-main.has-left { grid-template-columns: 30px 230px 1fr 0 30px; }
.pdfr-main.has-right { grid-template-columns: 30px 0 1fr 270px 30px; }
.pdfr-main.has-left.has-right { grid-template-columns: 30px 230px 1fr 270px 30px; }
.pdfr-main:not(.has-left) > .pdfr-tabs.left + .pdfr-doc { grid-column: 3; }
.pdfr-tabs { background: var(--r-chrome); display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.pdfr-tabs.left { grid-column: 1; border-right: 1px solid var(--r-line); }
.pdfr-tabs.right { grid-column: 5; border-left: 1px solid var(--r-line); }
.pdfr-sidetab { width: 30px; padding: 6px 0 !important; display: flex !important; flex-direction: column; align-items: center; gap: 4px; border-radius: 0 !important; }
.pdfr-sidetab span { writing-mode: vertical-rl; font-size: 11px; }
.pdfr-tabs.left .pdfr-sidetab span { transform: rotate(180deg); }
.pdfr-sidetab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pdfr-sidetab.on { background: var(--r-panel) !important; color: var(--r-accent); }
.pdfr-panel { background: var(--r-panel); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pdfr-panel.left { grid-column: 2; border-right: 1px solid var(--r-line); }
.pdfr-panel.right { grid-column: 4; border-left: 1px solid var(--r-line); }
.pdfr-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; font-weight: 600; background: var(--r-bar); border-bottom: 1px solid var(--r-line); }
.pdfr-x { padding: 0 6px !important; font-size: 15px; line-height: 1; }
.pdfr-scroll-list { flex: 1; overflow: auto; min-height: 0; }
.pdfr-scroll-list.pad, .pdfr-hint.pad { padding: 8px; }
.pdfr-scroll-list h4 { margin: 12px 0 6px; font-size: 12px; }
.pdfr-hint { color: var(--r-muted); font-size: 11px; margin: 6px 8px; }
.pdfr-row { display: flex !important; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 4px 8px !important; border-radius: 0 !important; }
.pdfr-row.found.on { background: var(--r-accent-soft); }
.pdfr-row.layer label { display: flex; align-items: center; gap: 6px; }
.pdfr-eye { padding: 0 2px !important; }
.pdfr-eye svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.pdfr-eye.off { opacity: .35; }
.pdfr-add-layer { display: flex; gap: 4px; padding: 8px; }
.pdfr-add-layer input { flex: 1; }
.pdfr-search { display: flex; flex-direction: column; gap: 5px; padding: 8px; border-bottom: 1px solid var(--r-line); }
.pdfr-search label { display: flex; align-items: center; gap: 5px; }
.pdfr-thumbs { flex: 1; overflow: auto; padding: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pdfr-thumb { display: flex !important; flex-direction: column; align-items: center; gap: 3px; padding: 4px !important; }
.pdfr-thumb .pic { width: 150px; max-height: 220px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); display: block; overflow: hidden; }
.pdfr-thumb .pic canvas { width: 100%; height: 100%; display: block; }
.pdfr-thumb .n { font-size: 11px; color: var(--r-muted); }
.pdfr-thumb.on .pic { outline: 3px solid var(--r-accent); }
.pdfr-thumb.on .n { color: var(--r-accent); font-weight: 700; }
.pdfr-field { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.pdfr-field > span:first-child { width: 90px; flex: none; color: var(--r-muted); }
.pdfr-field input:not([type=checkbox]):not([type=color]), .pdfr-field select { flex: 1; min-width: 0; }
.pdfr-field.col { flex-direction: column; align-items: stretch; gap: 3px; }
.pdfr-field input[type=color] { width: 44px; height: 22px; padding: 1px; }
.pdfr-props fieldset { border: none; padding: 0; margin: 0; }
.pdfr-props-kind { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.pdfr-buttons { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.pdfr-buttons button { border-color: var(--r-line); }
.pdfr-tools-row { display: flex; gap: 2px; margin: 6px 0; }
.pdfr-totals { width: 100%; border-collapse: collapse; }
.pdfr-totals th, .pdfr-totals td { padding: 3px 4px; border-bottom: 1px solid var(--r-line); text-align: left; }
.pdfr-totals .num { text-align: right; }

.pdfr-doc { grid-column: 3; position: relative; min-width: 0; min-height: 0; background: var(--r-doc); }
.pdfr-host { position: absolute; inset: 0; }
.pdfr-loading { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); background: var(--r-panel); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: 0 4px 14px rgba(0,0,0,.3); display: flex; gap: 8px; align-items: center; }
.pdfr-loading.error { color: #e03131; max-width: 70%; }
.pdfr-scroll { position: absolute; inset: 0; overflow: auto; outline: none; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.pdfr-scroll[data-tool]:not([data-tool="select"]):not([data-tool="pan"]) { touch-action: none; }
.pdfr-sheet { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px; width: max-content; min-width: 100%; box-sizing: border-box; }
.pdfr-page { position: relative; flex: none; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.pdfr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pdfr-detail { position: absolute; display: none; pointer-events: none; }
.pdfr-marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pdfr-marks text { font-family: Helvetica, Arial, sans-serif; white-space: pre; }
.pdfr-marks text.halo { paint-order: stroke; stroke: #fff; stroke-width: 2.5px; stroke-linejoin: round; }
.pdfr-marks .mk.hl { mix-blend-mode: multiply; }
.pdfr-marks .hit { fill: #ffd43b; fill-opacity: .45; mix-blend-mode: multiply; }
.pdfr-marks .hit.on { fill: #ff922b; fill-opacity: .6; }
.pdfr-marks .frame { fill: none; stroke: var(--r-accent); }
.pdfr-marks .grip { fill: #fff; stroke: var(--r-accent); cursor: move; }
.pdfr-marks .window { fill: rgba(31,111,209,.08); stroke: var(--r-accent); stroke-dasharray: 4 3; }
.pdfr-pnum { position: absolute; left: 100%; top: 0; margin-left: 6px; color: #fff; opacity: .55; font-size: 11px; }
.pdfr-peers { position: absolute; inset: 0; pointer-events: none; }
.pdfr-cursor { position: absolute; transition: left .12s linear, top .12s linear; }
.pdfr-cursor span { position: absolute; left: 14px; top: 16px; color: #fff; font-size: 11px; padding: 1px 5px; border-radius: var(--radius-sm); white-space: nowrap; }
.pdfr-editor { position: absolute; z-index: 3; border: 1px dashed var(--r-accent); background: rgba(255,255,255,.95); font-family: Helvetica, Arial, sans-serif; line-height: 1.2; resize: none; box-sizing: border-box; outline: none; user-select: text; }

.pdfr-list { height: 210px; display: flex; flex-direction: column; background: var(--r-panel); border-top: 1px solid var(--r-line); }
.pdfr-list-bar { display: flex; align-items: center; gap: 8px; padding: 3px 8px; background: var(--r-bar); border-bottom: 1px solid var(--r-line); }
.pdfr-list-bar input:not([type=checkbox]) { width: 160px; }
.pdfr-list-bar label { display: flex; align-items: center; gap: 4px; }
.pdfr-list-bar button { border-color: var(--r-line); }
.pdfr-list-table { flex: 1; overflow: auto; }
.pdfr-list-table table { width: 100%; border-collapse: collapse; }
.pdfr-list-table th { position: sticky; top: 0; background: var(--r-bar); text-align: left; font-weight: 600; padding: 3px 6px; border-bottom: 1px solid var(--r-line); border-right: 1px solid var(--r-line); cursor: pointer; white-space: nowrap; }
.pdfr-list-table td { padding: 2px 6px; border-bottom: 1px solid var(--r-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.pdfr-list-table td.comment { white-space: normal; min-width: 180px; }
.pdfr-list-table tbody tr { cursor: default; }
.pdfr-list-table tbody tr:nth-child(even) td { background: var(--r-row); }
.pdfr-list-table tbody tr.picked td { background: var(--r-accent-soft); }
.pdfr-list-table td.twist { width: 46px; cursor: pointer; color: var(--r-muted); }
.pdfr-list-table .swatch { background: var(--sw, #888) !important; display: inline-block; width: 9px; height: 9px; border-radius: var(--radius-sm); margin-right: 4px; vertical-align: middle; }
.pdfr-count { display: inline-block; font-size: 10px; background: var(--r-accent); color: #fff; border-radius: var(--radius-lg); padding: 0 4px; margin-left: 3px; }
.pdfr-status-pick { padding: 0 !important; border: none !important; background: transparent !important; }
.pdfr-list-table tr.replies td { white-space: normal; background: var(--r-panel) !important; padding: 6px; }
.pdfr-reply { margin: 0 0 6px; user-select: text; }
.pdfr-reply-box { display: flex; gap: 6px; }
.pdfr-reply-box input { flex: 1; }

footer.pdfr-status { display: flex; align-items: center; gap: 8px; height: 24px; padding: 0 8px !important; background: var(--r-bar) !important; border-top: 1px solid var(--r-line) !important; font-size: 11px; color: var(--r-muted); }
.pdfr-pagenav { display: inline-flex; align-items: center; gap: 2px; }
.pdfr-pagenav input { width: 42px; text-align: center; padding: 0 2px; }
.pdfr-pagenav button { padding: 0 4px !important; font-size: 10px; }
.pdfr-sep { width: 1px; height: 14px; background: var(--r-line); }
.pdfr-cursor-xy { font-variant-numeric: tabular-nums; }
.pdfr-statusmsg { color: var(--r-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer.pdfr-status button.link { color: var(--r-accent); padding: 0; }

.pdfr-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.pdfr-dialog { background: var(--r-panel); border: 1px solid var(--r-line); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 14px 16px; width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; }
.pdfr-dialog.wide { width: min(620px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; }
.pdfr-dialog h3 { margin: 0; font-size: 14px; }
.pdfr-dialog p { margin: 0; }
.pdfr-dialog label { display: flex; align-items: center; gap: 6px; }
.pdfr-dialog-row { display: flex; gap: 6px; align-items: center; }
.pdfr-dialog-buttons { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }

/* PDF sessions (feature layouts.pdf-sessions) */
.pdfr-modal.under { z-index: 59; }
.pdfr-pill.session { border: 1px solid var(--r-accent); color: var(--r-accent); background: var(--r-accent-soft); cursor: pointer; font-weight: 600; }
.pdfr-pill.session.closed { border-color: var(--r-line); color: var(--r-muted); background: transparent; }
.pdfr-error { color: #c92a2a; font-size: 12px; margin: 4px 8px; }
.pdfr-sub { margin: 12px 0 4px !important; font-size: 12px; }
.pdfr-wide { width: 100%; box-sizing: border-box; margin: 4px 0; }
.pdfr-session .pdfr-dialog-row { margin: 4px 0; }
.pdfr-session .pdfr-dialog-row input, .pdfr-session .pdfr-dialog-row select { min-width: 0; }
.pdfr-session-head { padding: 2px 0 6px; border-bottom: 1px solid var(--r-line); }
.pdfr-session-head .link { font: inherit; padding: 0; color: var(--r-accent); }
.pdfr-row.on { background: var(--r-accent-soft); }
.pdfr-attendee select { width: 112px; flex: none; font-size: 11px; }
.pdfr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--r-line); flex: none; }
.pdfr-dot.on { background: #2f9e44; }
.pdfr-record { max-height: 240px; overflow: auto; border: 1px solid var(--r-line); border-radius: 3px; padding: 4px 6px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.pdfr-record-line { display: grid; grid-template-columns: 76px 1fr; gap: 6px; align-items: baseline; }
.pdfr-record-line:not(.chat) { color: var(--r-muted); }

/* Guest links to PDF sessions (feature layouts.pdf-guests) */
.pdfr-link { border: 1px solid var(--r-line); border-radius: 3px; padding: 4px 6px; margin: 4px 0; font-size: 12px; }
.pdfr-link.off { opacity: 0.55; }
.pdfr-link button.danger { color: #c92a2a; }
.pdfr-link-form { border: 1px solid var(--r-accent); border-radius: 3px; padding: 6px; margin: 4px 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.pdfr-link-form label { display: flex; gap: 6px; align-items: flex-start; }
.pdfr-guests .link { font: inherit; padding: 0; color: var(--r-accent); background: none; border: none; cursor: pointer; }
.review-gate { max-width: 440px; }
.review-gate label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.review-gate input { padding: 7px 9px; font-size: 14px; }
.review-gate .muted { color: var(--muted, #667); font-size: 13px; }
.pdfr-record-line .link { font: inherit; padding: 0; text-align: left; color: inherit; text-decoration: underline dotted; white-space: normal; }
.pdfr-finish-list { max-height: 45vh; overflow: auto; border: 1px solid var(--r-line); }
.pdfr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pdfr-table th { position: sticky; top: 0; background: var(--r-bar); text-align: left; font-weight: 600; }
.pdfr-table th, .pdfr-table td { padding: 3px 6px; border-bottom: 1px solid var(--r-line); }
.pdfr-table .num { text-align: right; }
.pdf-sessions { margin-top: 12px; }
.pdf-session-code { width: 130px; }
.pdf-session-start { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--stroke); }
.pdf-session-start label { display: flex; align-items: center; gap: 8px; }
.pdf-session-pick { display: flex; flex-wrap: wrap; gap: 4px 16px; max-height: 180px; overflow: auto; }
.pdfr-dialog-buttons button { border-color: var(--r-line); padding: 4px 14px; }
.pdfr-keys { border-collapse: collapse; width: 100%; }
.pdfr-keys td { padding: 3px 6px; border-bottom: 1px solid var(--r-line); }
.pdfr-keys kbd { background: var(--r-bar); border: 1px solid var(--r-line); border-radius: var(--radius-sm); padding: 0 4px; font-size: 11px; }
@media (max-width: 900px) {
    .pdfr-main.has-left, .pdfr-main.has-right, .pdfr-main.has-left.has-right { grid-template-columns: 30px 0 1fr 0 30px; }
    .pdfr-panel { position: absolute; top: 0; bottom: 0; width: min(280px, 80vw); z-index: 5; box-shadow: 0 0 20px rgba(0,0,0,.3); }
    .pdfr-main { position: relative; }
    .pdfr-panel.left { left: 30px; }
    .pdfr-panel.right { right: 30px; }
    .pdfr-list { height: 150px; }
}
.pdfr-list-bar select, .pdfr-list-bar input { width: auto; flex: none; }
.pdfr-list-bar strong, .pdfr-list-bar label { white-space: nowrap; }

/* ----- Tickets (feature tickets.module / tickets.pins): the Forma Dashboard's look, Clark navy and lime ----- */
:root, [data-theme=light] {
  --tk-navy: #28334a; --tk-lime: #c1d500; --tk-alert: #D2513D;
  --tk-prio-low: #dcf2d8; --tk-prio-medium: #fff1b8; --tk-prio-high: #f8d3cc;
  --tk-row-hover: #f3f5f9; --tk-selected: #e6ecf7; --tk-head: #f4f6fa;
}
[data-theme=dark] {
  --tk-navy: #8fa2c7; --tk-lime: #c1d500; --tk-alert: #e56b57;
  --tk-prio-low: #23392a; --tk-prio-medium: #3d3720; --tk-prio-high: #452a27;
  --tk-row-hover: #2a2f3a; --tk-selected: #2d3a52; --tk-head: #262a33;
}
.tk-spacer { flex: 1; }
.tk-error { color: var(--error); margin: 6px 0; }
.tk-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.tk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 6px; border-radius: 999px; background: var(--panel-alt); border: 1px solid var(--stroke); white-space: nowrap; font-size: calc(12px * var(--ui-font, 1)); }
.tk-seg { display: inline-flex; border: 1px solid var(--stroke); border-radius: var(--radius-md); overflow: hidden; }
.tk-seg button { border: none; border-radius: 0; background: var(--panel); padding: 4px 12px; }
.tk-seg button.on { background: var(--tk-navy); color: #fff; }
[data-theme=dark] .tk-seg button.on { color: #10131a; }

.tk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tk-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 14px; background: var(--panel); border: 1px solid var(--stroke); border-top: 4px solid var(--tk-navy); border-radius: var(--radius-lg); cursor: pointer; color: var(--text); }
.tk-tile:hover { background: var(--tk-row-hover); }
.tk-tile-value { font-size: calc(26px * var(--ui-font, 1)); font-weight: 700; line-height: 1.1; }
.tk-tile-caption { font-weight: 600; }

.tk-list-card { display: flex; flex-direction: column; gap: 8px; }
.tk-filter-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.tk-filter-line label { display: flex; flex-direction: column; gap: 2px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.tk-filter-line input, .tk-filter-line select { min-width: 130px; }
.tk-filter-line input[data-filter=search] { min-width: 220px; }
.tk-chips-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-check { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
.tk-quick { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--panel); font-size: calc(12px * var(--ui-font, 1)); }
.tk-quick.on { background: var(--tk-lime); border-color: var(--tk-lime); color: #1d212f; }
.tk-live { color: var(--faint-ink); font-size: 10px; }
.tk-live.on { color: #4caf50; }
.tk-count { white-space: nowrap; }

.tk-split { display: flex; gap: 12px; align-items: flex-start; min-height: 300px; }
.tk-list { flex: 1; min-width: 0; }
.tk-table-scroll { overflow: auto; max-height: calc(100vh - 340px); border: 1px solid var(--stroke); border-radius: var(--radius-md); }
.tk-table { width: 100%; border-collapse: collapse; font-size: calc(12px * var(--ui-font, 1)); }
.tk-table th { position: sticky; top: 0; z-index: 1; background: var(--tk-head); text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
.tk-table td { padding: 5px 8px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
.tk-table .num { text-align: right; width: 1%; white-space: nowrap; }
.tk-table tbody tr { cursor: pointer; }
.tk-table tbody tr:hover td { background: var(--tk-row-hover); }
.tk-table tr.tk-prio-low td { background: var(--tk-prio-low); }
.tk-table tr.tk-prio-medium td { background: var(--tk-prio-medium); }
.tk-table tr.tk-prio-high td { background: var(--tk-prio-high); }
.tk-table tr.selected td { background: var(--tk-selected); box-shadow: inset 0 1px 0 var(--tk-navy), inset 0 -1px 0 var(--tk-navy); }
.tk-table tr.tk-group td { background: var(--panel-alt); font-weight: 600; color: var(--tk-navy); }
.tk-title-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-overdue { color: var(--tk-alert); font-weight: 600; }
.tk-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.tk-legend span { display: inline-flex; align-items: center; gap: 4px; }
.tk-legend i { display: inline-block; width: 14px; height: 10px; border-radius: var(--radius-sm); border: 1px solid var(--stroke); }
.tk-legend i.tk-prio-low { background: var(--tk-prio-low); }
.tk-legend i.tk-prio-medium { background: var(--tk-prio-medium); }
.tk-legend i.tk-prio-high { background: var(--tk-prio-high); }

.tk-board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; align-items: flex-start; }
.tk-column { flex: 0 0 210px; background: var(--panel-alt); border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.tk-column-head { display: flex; justify-content: space-between; font-weight: 600; padding: 4px 4px 6px; border-top: 4px solid var(--stroke); border-radius: var(--radius-sm) 4px 0 0; }
.tk-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); padding: 6px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.tk-card[draggable=true] { cursor: grab; }
.tk-card.tk-prio-low { background: var(--tk-prio-low); }
.tk-card.tk-prio-medium { background: var(--tk-prio-medium); }
.tk-card.tk-prio-high { background: var(--tk-prio-high); }
.tk-card.selected { outline: 2px solid var(--tk-navy); }
.tk-card-top, .tk-card-foot { display: flex; justify-content: space-between; gap: 6px; }
.tk-card-title { font-weight: 600; overflow-wrap: anywhere; }

.tk-panel { flex: 0 0 420px; width: 420px; max-width: 100%; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; box-sizing: border-box; }
.tk-panel-head { display: flex; align-items: center; gap: 8px; }
.tk-title { margin: 0; font-size: calc(16px * var(--ui-font, 1)); overflow-wrap: anywhere; }
.tk-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--stroke); flex-wrap: wrap; }
.tk-tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 5px 9px; color: var(--muted); }
.tk-tabs button.on { color: var(--text); border-bottom-color: var(--tk-lime); font-weight: 600; }
.tk-unsaved { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--tk-prio-medium); border: 1px solid var(--stroke); border-radius: var(--radius-md); position: sticky; top: -10px; z-index: 2; }
.tk-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; align-items: start; }
.tk-form > span { font-size: calc(12px * var(--ui-font, 1)); }
.tk-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-row.wide { grid-column: 1 / -1; }
.tk-row input, .tk-row select, .tk-row textarea { width: 100%; box-sizing: border-box; }
.tk-row.dirty input, .tk-row.dirty select, .tk-row.dirty textarea { border-color: var(--tk-lime); box-shadow: 0 0 0 1px var(--tk-lime); }
.tk-name { font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); font-weight: 600; }
.tk-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tk-buttons.left { justify-content: flex-start; }
.tk-sub { margin: 10px 0 4px; font-size: calc(13px * var(--ui-font, 1)); }
.tk-comment { border-left: 3px solid var(--tk-lime); padding: 4px 8px; margin: 6px 0; background: var(--panel-alt); border-radius: 0 4px 4px 0; }
.tk-comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-comment-form { display: flex; flex-direction: column; gap: 6px; }
.tk-comment-form textarea { width: 100%; box-sizing: border-box; }
.tk-comment-form button { align-self: flex-end; }
.tk-danger { border-top: 1px solid var(--stroke); margin-top: 10px; padding-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tk-pin-note { margin: 4px 0; }

.tk-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tk-att { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-thumb { height: 90px; padding: 0; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tk-filetype { font-weight: 700; color: var(--muted); text-transform: uppercase; }
.tk-att-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 10px; padding: 16px; border: 2px dashed var(--stroke); border-radius: var(--radius-lg); cursor: pointer; text-align: center; position: relative; }
.tk-dropzone:hover { border-color: var(--tk-lime); }
.tk-dropzone.busy { opacity: .6; cursor: progress; }
.tk-dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tk-pin-list { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 3px; }
.tk-pin-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-pin-list .link { text-align: left; }
.tk-activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tk-activity li { border-bottom: 1px solid var(--stroke); padding-bottom: 5px; }

.tk-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 18, 26, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tk-modal-box { background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 16px 18px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); box-sizing: border-box; }
.tk-modal-box h3 { margin-top: 0; }
.tk-import-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tk-import-way { border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.tk-import-pick { display: flex; flex-direction: column; gap: 2px; font-size: calc(12px * var(--ui-font, 1)); }
.tk-import-preview { margin-top: 10px; overflow: auto; max-height: 240px; }
.tk-pin-picker { width: min(520px, 100%); }
.tk-pin-search { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.tk-pin-choices { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.tk-pin-choice { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid transparent; background: transparent; padding: 5px 8px; border-radius: var(--radius-md); }
.tk-pin-choice:hover { background: var(--tk-row-hover); border-color: var(--stroke); }
.tk-pin-choice .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-float { position: fixed; right: 16px; top: 90px; z-index: 900; width: 420px; max-width: calc(100vw - 32px); }
.tk-float .tk-panel { width: 100%; max-height: calc(100vh - 120px); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
@media (max-width: 900px) {
  .tk-split { flex-direction: column; }
  .tk-panel { flex-basis: auto; width: 100%; }
  .tk-import-ways, .tk-form { grid-template-columns: 1fr; }
}

/* Ticket pins on rack faces: a teardrop in the ticket's status colour (--pin), point at the spot; UID pins ringed navy. */
.ticket-pin { position: absolute; z-index: 6; width: 20px; height: 20px; margin: -24px 0 0 -10px; padding: 0; border: 1.5px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pin, #F0A030); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ticket-pin > * , .ticket-pin { color: #fff; font: 700 9px/1 Arial, sans-serif; }
.ticket-pin.by-uid { border-color: #28334a; }
button.ticket-pin:hover:not(:disabled), button.ticket-pin:focus, button.ticket-pin:active { background: var(--pin, #F0A030); border-color: #fff; color: #fff; }
button.ticket-pin.by-uid:hover:not(:disabled), button.ticket-pin.by-uid:focus, button.ticket-pin.by-uid:active { border-color: #28334a; }
.ticket-pin:hover { filter: brightness(1.1); transform: rotate(-45deg) scale(1.15); }
.ticket-pin span { transform: rotate(45deg); }
.drafting-canvas-wrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.tk-pin-tool { position: absolute; z-index: 5; right: 10px; top: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--panel); color: var(--text); font-size: calc(12px * var(--ui-font, 1)); }
.tk-pin-tool.on { background: var(--tk-lime); border-color: var(--tk-lime); color: #1d212f; }
.dv-canvas.pin-mode { cursor: copy; }
.tk-package { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: var(--radius-sm); background: var(--tk-navy); color: #fff; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; white-space: nowrap; }
[data-theme=dark] .tk-package { color: #10131a; }
.tk-title-cell.is-sub { padding-left: 22px; color: var(--muted); }
.tk-title-cell.is-sub .tk-package { margin-left: 2px; }
.tk-parent { margin: -2px 0 2px; }
.tk-subs { margin-top: 6px; }
.tk-sub-list { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 4px; }
.tk-sub-row { width: 100%; display: flex; align-items: center; gap: 6px; text-align: left; padding: 5px 8px; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); color: var(--text); cursor: pointer; }
.tk-sub-row:hover { background: var(--tk-row-hover); border-color: var(--tk-navy); }
.tk-sub-row .tk-package { margin-left: 0; }
.tk-add-sub { display: flex; gap: 6px; align-items: center; }
.tk-sub-chip { margin-left: 8px; cursor: pointer; font-weight: 400; }
/* Sheet shapes: colour swatches (Properties and the drawing bar) */
.shape-colour-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shape-colour-row > span:first-child { min-width: 72px; }
.swatches { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.swatches .swatch { background: var(--sw) !important; width: 16px; height: 16px; min-width: 0; padding: 0; border: 1px solid rgba(128,128,128,.6); border-radius: var(--radius-sm); cursor: pointer; }
.swatches .swatch.on { outline: 2px solid var(--accent, #5b7f1a); outline-offset: 1px; }
.swatches input[type=color] { width: 22px; height: 18px; padding: 0; border: none; background: none; cursor: pointer; }
.swatches.compact .swatch { width: 13px; height: 13px; }

/* ----- Change lists between saved versions (File, Versions…, flag lineup.version-changes) ----- */
.versions-changes-toggle { margin-top: 2px; }
.versions-note-fill { margin-top: 4px; }
.versions-table td:nth-child(3) { white-space: nowrap; }
.versions-table tr.versions-changes-row td { background: var(--panel-alt); border-top: none; }
.change-list { font-size: calc(13px * var(--ui-font, 1)); }
.change-list-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.change-list-buttons { margin-left: auto; display: flex; gap: 12px; }
.change-group { margin-top: 6px; }
.change-where { font-weight: 600; color: var(--section-label); font-size: calc(11px * var(--ui-font, 1)); text-transform: uppercase; letter-spacing: 0.04em; }
.change-list ul { list-style: none; margin: 2px 0 0; padding: 0; }
.change-list li.change { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; padding: 2px 0 2px 8px; border-left: 3px solid var(--stroke); margin: 2px 0; }
.change-list li.change.added { border-left-color: #2E9E5B; }
.change-list li.change.removed { border-left-color: #C94A4A; }
.change-list li.change.moved { border-left-color: #2E8BC9; }
.change-list li.change.changed { border-left-color: #D98E04; }
.change-verb { font-weight: 600; min-width: 64px; }
.change-detail { color: var(--muted); }
.change-by { margin-left: auto; }
.versions-diff-mode { margin-bottom: 6px; display: inline-flex; }

/* The version in the status bar (a button that opens Help, About) and the About / What's new dialog. */
.link-button { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.profile-version { margin-left: auto; font-size: 0.9em; }
.about-dialog { width: min(560px, calc(100vw - 32px)); }
.about-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.about-head .dialog-title { margin-bottom: 2px; }
.about-logo { width: 44px; height: 44px; border-radius: var(--radius-lg); flex: none; }
.about-version { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.about-notes { max-height: min(55vh, 460px); overflow: auto; border-top: 1px solid var(--border); padding-top: 4px; }
.about-release h4 { margin: 10px 0 4px; font-size: 1em; }
.about-section { font-weight: 600; font-size: 0.9em; margin-top: 6px; }
.about-release ul { margin: 2px 0 4px; padding-left: 20px; }
.about-release li { margin: 2px 0; line-height: 1.4; }
.about-tip { margin: 10px 0 0; }

/* System block (feature systems.blocks): the port list beside the block it draws, on white paper as it prints. */
.tla-db-block { white-space: nowrap; }
.dialog.system-block { width: min(1180px, 100%); max-height: min(900px, 100%); display: flex; flex-direction: column; }
.sysblk { display: flex; gap: 16px; min-height: 0; flex: 1; }
.sysblk-main { flex: 1 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sysblk-item { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sysblk-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.sysblk-fields label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.sysblk-fields input[type=number] { width: 70px; }
.sysblk-note { flex: 1; min-width: 200px; }
.sysblk-table-wrap { overflow: auto; min-height: 120px; max-height: 46vh; border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.sysblk-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; }
.sysblk-table th { position: sticky; top: 0; background: var(--panel-alt); text-align: left; padding: 4px 6px; font-weight: 600; z-index: 1; }
.sysblk-table td { padding: 2px 4px; border-top: 1px solid var(--stroke); }
.sysblk-table input, .sysblk-table select { width: 100%; min-width: 0; font-size: 12px; }
.sysblk-name { min-width: 100px; text-transform: uppercase; }
.sysblk-table select.sysblk-way { min-width: 64px; }
.sysblk-table select.sysblk-side { min-width: 70px; }
.sysblk-table td.sysblk-signal select { min-width: 110px; }
.sysblk-conn { min-width: 90px; }
.sysblk-signal { display: flex; align-items: center; gap: 4px; }
.sysblk-swatch { flex: none; width: 10px; height: 10px; border-radius: var(--radius-sm); border: 1px solid #0003; }
.sysblk-row-tools { white-space: nowrap; text-align: right; }
.sysblk-add { display: flex; gap: 8px; flex-wrap: wrap; }
.sysblk-paste textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.sysblk-preview { flex: 0 1 420px; min-width: 260px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.sysblk-preview-head { display: flex; justify-content: space-between; align-items: center; }
.sysblk-paper { flex: 1; overflow: auto; background: #fff; border: 1px solid #ccc; border-radius: var(--radius-sm); padding: 12px; display: flex; justify-content: center; align-items: flex-start; }
.sysblk-paper svg { width: 100%; max-width: 380px; height: auto; }
.sys-drawing .l-sys-block, .sys-drawing .l-sys-hatch { stroke: #000; }
.sys-drawing .l-sys-hatch { stroke: #888; }
.sys-drawing .text.l-sys-text, .sys-drawing .text.l-sys-note { fill: #000; }
.sys-drawing .fill.l-sys-port-in { fill: #1e9e3e; }
.sys-drawing .fill.l-sys-port-out { fill: #d62828; }
.sys-drawing .fill.l-sys-port-both { fill: #f08a00; }
@media (max-width: 820px) { .sysblk { flex-direction: column; } .sysblk-preview { flex-basis: auto; } }

/* Systems drawings (SystemsView.razor): the Drafting canvas with pages, library and In Drawings on the left. */
.sysv .tbd-head .layouts-name { min-width: 160px; }
.sysv-side { width: 270px; }
.sysv-list { display: flex; flex-direction: column; gap: 1px; max-height: 26vh; overflow-y: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.sysv-library { max-height: 30vh; }
.sysv-row { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 4px 8px; border: none; border-radius: 0; background: transparent; color: var(--text); text-align: left; font-size: calc(12px * var(--ui-font, 1)); cursor: pointer; }
.sysv-row:hover:not(:disabled) { background: var(--accent-soft); }
.sysv-row .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sysv-indrawing { cursor: default; align-items: center; }
.sysv-indrawing input { flex: 1; min-width: 0; font-size: calc(12px * var(--ui-font, 1)); padding: 2px 4px; }
.sysv-none { padding: 6px 8px; margin: 0; }
.sysv-search { width: 100%; margin-bottom: 4px; }
.sysv-modes { display: inline-flex; border: 1px solid var(--stroke); border-radius: var(--radius-sm); overflow: hidden; }
.sysv-modes button { border: none; border-radius: 0; padding: 4px 12px; background: transparent; color: var(--text); }
.sysv-modes button.active { background: var(--accent); color: var(--on-accent); }
.sysv .drafting-main { position: relative; }
.sysv-sheet-area { position: absolute; inset: 0; z-index: 5; overflow: auto; display: flex; align-items: flex-start; justify-content: flex-start; padding: 16px; background: var(--canvas-bg, #6b6f75); }
.sysv-paper { margin: 0 auto; width: min(100%, calc((100vh - 170px) * 841 / 594)); background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); line-height: 0; }
.sysv-paper.cover { width: min(100%, calc((100vh - 170px) * 594 / 841)); }
.sysv-paper > svg { width: 100%; height: auto; display: block; }
.in-drawings-head { display: flex; align-items: center; justify-content: space-between; flex: none; }
.in-drawings { display: flex; flex-direction: column; gap: 2px; max-height: 30vh; overflow-y: auto; min-height: 0; }
/* Two lines (name, then UID box and drawing): full height always, never shrunk by the list around it. */
.in-drawings-item { height: auto; flex: none; margin-bottom: 0; }
.in-drawings-item.waiting { opacity: .75; cursor: default; }
.in-drawings-item .library-name > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.not-in-library { margin-left: 6px; padding: 0 5px; border-radius: var(--radius-sm); border: 1px solid var(--stroke); color: var(--muted); font-size: calc(10px * var(--ui-font, 1)); font-weight: 500; flex: none; }
.in-drawings-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.in-drawings-row input { width: 130px; font-size: calc(12px * var(--ui-font, 1)); padding: 2px 4px; }
.in-drawings-row .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-drawings-none { padding: 4px 8px; margin: 0; }
.sysv-arr { align-items: center; padding-right: 4px; }
.sysv-cable { display: flex; flex-direction: column; gap: 4px; padding: 0 12px 10px; }
.sysv-cable input { font: inherit; padding: 4px 6px; }
.sysv-arr-place { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; text-align: left; color: var(--text); text-decoration: none; }
.sysv-arr-place .muted { font-size: calc(11px * var(--ui-font, 1)); }
.sysv-arr-form { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.sysv-arr-form input { font-size: calc(12px * var(--ui-font, 1)); padding: 3px 5px; }
.sysv-row.picked { background: var(--accent-soft); font-weight: 600; }
.sysv-trace { display: flex; flex-direction: column; border: 1px solid var(--stroke); border-radius: var(--radius-sm); max-height: 34vh; overflow-y: auto; }
.sysv-trace-stop { flex-direction: column; align-items: flex-start; gap: 0; }
.sysv-trace-hop { padding: 0 8px 2px 18px; }
.sysv-sheets-side { overflow-y: auto; }
.sysv-sheet-actions { display: flex; gap: 6px; margin: 6px 0; }
.sysv-field { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); }
.sysv-field input { font-size: calc(12px * var(--ui-font, 1)); padding: 3px 5px; color: var(--text); }
.sysv-field textarea { font: inherit; font-size: calc(12px * var(--ui-font, 1)); padding: 3px 5px; color: var(--text); resize: vertical; }
.sysv-rev { display: grid; grid-template-columns: 20px 90px 1fr; gap: 4px; align-items: center; margin-bottom: 4px; }
.sysv-rev input { min-width: 0; font-size: calc(12px * var(--ui-font, 1)); padding: 2px 4px; }

/* ===== The iPad app (feature views.ipad-app, js/platform.js) ===== */
/* The Add to Home Screen hint, and "file is ready" when a file took too long for the share sheet to open by itself. */
.platform-bar { position: fixed; left: 50%; bottom: calc(44px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10000; display: flex; align-items: center; gap: 10px; max-width: min(640px, calc(100vw - 32px)); padding: 10px 10px 10px 14px; background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); font-size: calc(13px * var(--ui-font, 1)); line-height: 1.4; }
.platform-bar span { flex: 1; min-width: 0; }
.platform-bar button { flex: none; min-height: 36px; padding: 0 14px; }
.platform-bar .share-glyph { display: inline-block; padding: 0 2px; color: var(--accent); font-weight: 700; }

/* Equipment Builder (feature systems.equipment-builder): SystemPortBuilder.razor, as IO Builder's dialog. */
.sysbld { border: 1px solid var(--stroke); border-radius: var(--radius-md); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-alt); }
.sysbld-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sysbld-head select { font-size: 12px; max-width: 260px; }
.sysbld-preset-name { width: 130px; font-size: 12px; }
.sysbld-grid { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 4px 8px; align-items: center; font-size: 12px; }
.sysbld-col { font-weight: 600; font-size: 11px; color: var(--muted, #888); }
.sysbld-row { font-size: 12px; }
.sysbld-grid input { width: 100%; min-width: 0; font-size: 12px; }
.sysbld-auto { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sysbld-auto input { flex: 1; min-width: 0; }
.sysbld-plus { display: flex; align-items: center; gap: 2px; font-size: 11px; white-space: nowrap; }
.sysbld-plus.on { color: var(--accent, #2a7ae2); font-weight: 600; }
.sysbld-gear.on { color: var(--accent, #2a7ae2); }
.sysbld-fields { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.sysbld-fields > label { display: flex; flex-direction: column; gap: 2px; }
.sysbld-fields input[type=number] { width: 64px; }
.sysbld-fields .sysbld-auto input { width: 70px; }
.sysbld-settings { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; font-size: 12px; border-top: 1px dashed var(--stroke); padding-top: 6px; }
.sysbld-settings > label { display: flex; flex-direction: column; gap: 2px; }
.sysbld-settings input:not([type=checkbox]) { width: 70px; }
.sysbld-settings .sysbld-check { flex-direction: row; align-items: center; gap: 4px; }
.sysblk-pos { width: 44px; }
.sysblk-ticked td { background: color-mix(in srgb, var(--accent, #2a7ae2) 12%, transparent); }
.sysv-lib-head { display: flex; justify-content: space-between; align-items: center; }
.sysv-new-entry { margin: 4px 8px; }
.sysv-has-block { margin-left: auto; opacity: .7; }

/* Systems drawing in the ribbon workspace (feature systems.workspace), as Rack Elevations'. */
.sysv-shell .sysv-side { padding: 0 0 10px; display: flex; flex-direction: column; }
.sysv-shell .sysv-side:not(.sysv-sheets-side) > .sysv-pane > :not(.pb-head):not(.sysv-pb) { margin-left: 12px; margin-right: 12px; }
/* The side's sections are palettes, headed as the Project Browser is (Rack Elevations' Equipment Library palette). */
.sysv-shell .sysv-side:not(.sysv-sheets-side) > .sysv-pane > .section-header, .sysv-docked .sysv-pane > .section-header { display: flex; align-items: center; gap: 7px; margin: 0 0 6px !important; height: calc(30px * var(--ui-font, 1)); padding: 0 10px; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; color: var(--section-label); background: var(--window); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); flex: none; }
.sysv-shell .sysv-side:not(.sysv-sheets-side) > .sysv-pane > .section-header .link, .sysv-docked .sysv-pane > .section-header .link { margin-left: auto; letter-spacing: 0; text-transform: none; }
.sysv-shell .sysv-library { flex: 1 1 auto; min-height: 120px; max-height: 40vh; overflow-y: auto; }
.sysv-shell .tbd-body { min-height: 0; }
.sysv-shell-cmd { flex: none; }
.sysv-shell .sysv-pb { flex: none; max-height: 42%; overflow-y: auto; }
.sysv-shell .pb-row .pb-meta { overflow: hidden; text-overflow: ellipsis; }
.sysv-doc-name { border: 1px solid transparent; background: transparent; font-weight: 600; color: var(--text); text-align: right; min-width: 120px; max-width: 320px; padding: 1px 4px; }
.sysv-doc-name:hover, .sysv-doc-name:focus { border-color: var(--stroke); background: var(--panel-alt); }
.sysv-shell .shell-right { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sysv-props { width: 290px; flex: none; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--stroke); display: flex; flex-direction: column; }
.sysv-props-body { padding: 4px 12px 12px; }
.sysv-props-body .section-header { margin-top: 12px; }
.sysv-gear-props { display: flex; flex-direction: column; gap: 6px; }
.sysv-gear-props button { align-self: flex-start; }
.sysv-shell .sysv-side > .sysv-pane > input.sysv-search { width: auto; }
.sysv-shell .sysv-sheets-side { order: 10; display: block; padding: 10px 12px; border-right: none; border-left: 1px solid var(--stroke); }


/* Racks beside a systems drawing (feature systems.split-racks): Rack Elevations on the left half, the drawing on the right. */
.app.systems-split { width: 50%; }
.tbd.sysv.sysv-split { left: 50%; border-left: 2px solid var(--accent); }
/* Overview and System chain are for looking at, not editing. */
.sysv-mode-note { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 3px 10px; border-radius: var(--radius-lg); background: var(--accent-soft); border: 1px solid var(--accent); font-size: 12px; pointer-events: none; }
.sysv-split .sysv-side:not(.sysv-sheets-side) { width: 230px; }
/* ===== A systems drawing's palettes (feature systems.dock-palettes): the same docking as Rack Elevations' ===== */
.sysv-side > .sysv-pane, .sysv-sheets-side > .sysv-pane { display: contents; }
.tbd-body.sysv-docked { display: grid; position: relative; overflow: hidden; grid-template-rows: minmax(0, 1fr); }
.tbd-body.sysv-docked > .drafting-main { min-width: 0; }
.sysv-docked .dock-body > .sysv-pane { display: flex; flex-direction: column; min-height: 100%; padding: 0 0 8px; box-sizing: border-box; }
.sysv-docked .sysv-pane > :not(.pb-head):not(.sysv-pb):not(.section-header) { margin-left: 10px; margin-right: 10px; }
.sysv-docked .sysv-pane > .pb-head { display: none; }
.sysv-docked .sysv-pane > .section-header:first-child:not(.sysv-lib-head) { display: none; }
.sysv-docked .sysv-pane > .sysv-lib-head { border-top: none; height: auto !important; min-height: 24px; margin-bottom: 0 !important; }
.sysv-docked .sysv-pane > .sysv-lib-head:not(:has(.link)) { display: none; }
.sysv-docked .sysv-lib-title:not(.on) { display: none; }
.sysv-docked .sysv-pane > .sysv-lib-head .link { margin-left: auto; }
.sysv-docked .sysv-pane > input.sysv-search { margin-top: 8px; margin-bottom: 6px; width: auto; box-sizing: border-box; }
.sysv-docked .sysv-pane-library .sysv-library { flex: 1; min-height: 60px; max-height: none; overflow-y: auto; }
.sysv-docked .sysv-pane-browser .sysv-pb { max-height: none; }
.sysv-docked .sysv-pane-sheet { padding: 8px 0; }
.sysv-docked .sysv-pane-sheet > .section-header { margin-top: 12px; }
.sysv-docked .dock-body.details > .sysv-props-body { padding: 4px 12px 12px; }
.sysv-docked .dock-panel.float { z-index: 6; }

/* Systems bridges: Add bridge in the gear card, Link… search (feature systems.bridge-links). */
.sysv-add-bridge { display: flex; gap: 4px; align-items: center; }
.sysv-add-bridge select { flex: 1; min-width: 0; font: inherit; padding: 3px 4px; }
.sysv-link { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border, #444); padding-top: 6px; }
.sysv-link input { font: inherit; padding: 4px 6px; }
.sysv-link .sysv-list { max-height: 240px; overflow: auto; }
.sysv-link > button { align-self: flex-start; }
.sysv-link .segments { align-self: flex-start; }
.sysv-link .small > button, .sysv-bridge .small > button { margin-left: 6px; }

/* Systems schedules over the canvas (feature systems.schedules). */
.sysv-schedule-area { position: absolute; inset: 0; z-index: 6; display: flex; background: var(--canvas); }
.sysv-schedule .schedule-grid td.sysv-sched-cell { padding: 0; }
.sysv-schedule .schedule-grid td.sysv-sched-cell input { width: 100%; box-sizing: border-box; border: 0; background: transparent; color: var(--text); font: inherit; padding: 3px 8px; height: 23px; }
.sysv-schedule .schedule-grid td.sysv-sched-cell input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.sysv-schedule .schedule-bar .segments .segment.on { background: var(--accent); color: var(--on-accent); }
.sysv-row.sysv-draggable { cursor: grab; user-select: none; }
/* ===== Tabs for every open drawing (feature views.drawing-tabs): under the logo on each page ===== */
.drawing-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 4px 10px 0; background: var(--window); border-bottom: 1px solid var(--stroke); overflow-x: auto; flex: none; scrollbar-width: thin; font-size: calc(12px * var(--ui-font, 1)); color: var(--text); font-family: inherit; }
.drawing-tabs .dtab { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border: 1px solid transparent; border-bottom: none; border-radius: var(--radius-md) 5px 0 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; flex: none; max-width: 240px; font: inherit; }
.drawing-tabs .dtab:hover { background: var(--panel); color: var(--text); }
.drawing-tabs .dtab.on { background: var(--panel); color: var(--text); border-color: var(--stroke); box-shadow: inset 0 2px 0 var(--accent); margin-bottom: -1px; height: 29px; }
.drawing-tabs .dtab-home { padding-right: 10px; }
.drawing-tabs .dtab svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
.drawing-tabs .dtab-name { overflow: hidden; text-overflow: ellipsis; }
.drawing-tabs .dtab .dirty { color: var(--accent); font-size: 9px; }
.drawing-tabs .dtab-close { border: none; background: transparent; color: inherit; min-height: 18px; padding: 0 5px; font-size: 10px; border-radius: var(--radius-sm); opacity: 0.55; cursor: pointer; }
.drawing-tabs .dtab-close:hover { opacity: 1; background: var(--hover, rgba(127,127,127,0.18)); }
.pdfr .drawing-tabs { background: var(--r-chrome); border-color: var(--r-line); }
.pdfr .drawing-tabs .dtab.on, .pdfr .drawing-tabs .dtab:hover { background: var(--r-bar); color: var(--r-text); border-color: var(--r-line); }

/* Right-click a drawing in a project's folders (feature views.rename-drawings): Open / Rename */
.hub-drawing-menu { position: fixed; z-index: 60; min-width: 150px; padding: 4px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 6px 20px rgba(0,0,0,0.3); display: flex; flex-direction: column; }
.hub-drawing-menu button { text-align: left; border: none; background: none; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text); }
.hub-drawing-menu button:hover { background: var(--accent-soft); }
.hub-drawing-menu-shield { position: fixed; inset: 0; z-index: 59; }

/* Systems: right-click a block > Go to elevation… (feature systems.go-to). */
.sysv-ctx-shield { z-index: 60; }
.sysv-ctx { z-index: 61; }
.sysv-ctx-head { padding: 4px 12px 2px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); white-space: nowrap; }
.sysv-checks { display: flex; gap: 14px; font-size: calc(12px * var(--ui-font, 1)); }
.sysv-checks label { display: flex; align-items: center; gap: 4px; }
.sysv-colors-group { position: relative; }
.sysv-colors { position: absolute; top: 8px; right: 8px; z-index: 40; display: grid; gap: 4px; padding: 8px; min-width: 190px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 6px 18px rgba(0,0,0,.25); font-size: calc(12px * var(--ui-font, 1)); }
.sysv-colors label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sysv-colors input[type=color] { width: 28px; height: 18px; padding: 0; border: 1px solid var(--stroke); background: none; }
/* Systems drawing View > Grid: the spacing box sized to its group, not over the next one. */
.sysv-grid label.rb-small { display: flex; align-items: center; gap: 6px; width: auto; }
.sysv-grid select { width: 72px; min-width: 0; flex: 0 0 auto; }

/* ===== Quick open (Ctrl+K / ⌘K, Components/QuickOpen.razor) ===== */
.qo-shield { position: fixed; inset: 0; z-index: 2400; background: rgba(0, 0, 0, 0.18); }
.qo { position: fixed; z-index: 2401; top: 12vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); max-height: 70vh;
      display: flex; flex-direction: column; background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-radius: var(--radius-lg);
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28); overflow: hidden; }
.qo-text { margin: 10px; padding: 8px 10px; font-size: calc(14px * var(--ui-font, 1)); border: 1px solid var(--stroke); border-radius: var(--radius-md); background: var(--panel-alt); color: var(--text); }
.qo-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.qo-list { overflow: auto; padding: 0 6px 6px; }
.qo-group { padding: 8px 8px 3px; font-size: calc(10px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--section-label); }
.qo-item { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; padding: 6px 8px; border: none; border-radius: var(--radius-sm); background: none; color: inherit; cursor: pointer; font-size: calc(12px * var(--ui-font, 1)); }
.qo-item.on { background: var(--accent-soft); }
.qo-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qo-detail { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qo-empty { padding: 14px 8px; color: var(--muted); font-size: calc(12px * var(--ui-font, 1)); }
.qo-foot { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-top: 1px solid var(--stroke); color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); background: var(--panel-alt); }
.qo-foot kbd { font: inherit; padding: 0 5px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel); }

/* ----- Layouts laid out like Revit (layouts.revit-ribbon) ----- */
.layouts-page.revit .layouts-bar { flex-wrap: nowrap; padding: 4px 10px; background: var(--window); }
.layouts-qat { display: inline-flex; gap: 2px; padding-left: 6px; border-left: 1px solid var(--stroke); }
.layouts-qat .shell-icon svg { width: 16px; height: 16px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.layouts-ribbon-tabs { flex: none; }
.layouts-ribbon { flex: none; }
.layouts-ribbon-hint { align-self: center; max-width: 340px; margin: 0 10px; white-space: normal; }
.layouts-page.revit .layouts-view-title { top: 8px; }
.layouts-vcb { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 2px; padding: 2px 4px; background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: var(--shadow-sm, 0 1px 3px rgb(0 0 0 / 0.12)); font-size: calc(11px * var(--ui-font, 1)); z-index: 3; }
.layouts-vcb button { min-height: 22px; padding: 1px 4px; border: 1px solid transparent; background: transparent; }
.layouts-vcb button:hover { border-color: var(--stroke); background: var(--panel-alt); }
.layouts-vcb button.on { background: var(--accent-soft); border-color: var(--accent); }
.layouts-vcb svg { width: 15px; height: 15px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.layouts-vcb .vcb-name { font-weight: 600; padding: 0 4px; color: var(--muted); }
.layouts-vcb .vcb-sep { width: 1px; align-self: stretch; background: var(--stroke); margin: 2px 2px; }
.layouts-vcb .vcb-style { display: inline-flex; align-items: center; gap: 3px; }
.layouts-vcb select { min-height: 22px; font-size: inherit; padding: 0 2px; border-color: transparent; background: transparent; }
.layouts-status .st-hint { border-left: none; overflow: hidden; text-overflow: ellipsis; }
.layouts-page.revit .layouts-panel-head { background: var(--window); border-bottom: 1px solid var(--stroke); }
/* Revit's Properties palette: the Type Selector on top, then groups as header bars over label | value rows. */
.rv-typesel { display: flex; align-items: center; gap: 8px; padding: 8px; margin-bottom: 0; border: 1px solid var(--stroke); border-bottom: none; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--window); }
.rv-typesel > svg { width: 34px; height: 34px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; padding: 3px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel); }
.rv-typesel-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rv-typesel-text small { color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); }
.rv-typesel-text select { width: 100%; font-weight: 600; }
.rv-typesel-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; margin-bottom: 8px; border: 1px solid var(--stroke); border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--panel-alt); font-size: calc(11px * var(--ui-font, 1)); }
.rv-typesel-bar button { min-height: 22px; padding: 1px 8px; font-size: inherit; }
.layouts-page.revit .rv-hide { display: none; }
.layouts-page.revit .layouts-props .layouts-card { padding: 0; gap: 0; overflow: hidden; }
.layouts-page.revit .layouts-props .layouts-card-title { padding: 4px 8px; background: var(--panel-alt); border-bottom: 1px solid var(--stroke); font-size: calc(11px * var(--ui-font, 1)); text-transform: none; }
.layouts-page.revit .layouts-props .layouts-card > :not(.layouts-card-title) { margin: 0; padding: 3px 8px; }
.layouts-page.revit .layouts-props .layouts-field { display: grid; grid-template-columns: minmax(90px, 42%) 1fr; align-items: center; gap: 6px; border-bottom: 1px solid color-mix(in srgb, var(--stroke) 55%, transparent); }
.layouts-page.revit .layouts-props .layouts-field > span { font-size: calc(12px * var(--ui-font, 1)); color: var(--text); }
.layouts-page.revit .layouts-props .layouts-field input, .layouts-page.revit .layouts-props .layouts-field select { min-height: 22px; padding: 0 4px; }

/* ----- CAD look (views.cad-look): pre-highlight, selection glow, view label, S box, soft depth and motion ----- */
.cad-look { --hover-ring: color-mix(in srgb, var(--selection) 60%, transparent); --pick-glow: color-mix(in srgb, var(--selection) 28%, transparent); }
/* Rhino / Fusion pre-highlight: what a click would pick lights up under the pointer. */
.cad-look .gear:not(.selected):not(.error):hover,
.cad-look .strip:not(.selected):not(.error):hover,
.cad-look .section-item:not(.selected):hover,
.cad-look .fd-card:not(.selected):hover { box-shadow: 0 0 0 2px var(--hover-ring); z-index: 2; }
.cad-look .gear.selected, .cad-look .strip.selected, .cad-look .fd-card.selected, .cad-look .section-item.selected { box-shadow: 0 0 0 4px var(--pick-glow); z-index: 3; }
.cad-look .rack:not(.active):hover { border-color: var(--hover-ring); }
.cad-look .plan-rack:hover .plan-rack-body { stroke: var(--selection); stroke-width: 1.5; }
.cad-look .desk-gear-side:not(.selected):hover, .cad-look .desk-arm:not(.selected):hover rect { stroke: var(--hover-ring); stroke-width: 2px; }
.cad-look .gear, .cad-look .strip, .cad-look .section-item { transition: box-shadow 90ms ease-out; }
/* Rhino's viewport title, top left of the view: what it is, switched in place. */
.view-label-host { position: relative; height: 0; z-index: 6; }
.view-label { position: absolute; left: 8px; top: 6px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 3px; border: 1px solid var(--stroke); border-radius: var(--radius-md); background: color-mix(in srgb, var(--panel) 90%, transparent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.10); font-size: calc(11px * var(--ui-font, 1)); }
.view-label select { min-height: 20px; padding: 0 2px; border: 1px solid transparent; background: transparent; color: var(--text); font-size: inherit; font-weight: 600; cursor: pointer; }
.view-label select:hover { border-color: var(--stroke); background: var(--panel-alt); }
.view-label select + select { font-weight: 500; border-left: 1px solid var(--stroke); border-radius: 0; }
.view-label-zoom { padding: 0 6px; color: var(--muted); border-left: 1px solid var(--stroke); font-variant-numeric: tabular-nums; }
/* The S shortcut box opens at the pointer. */
.qo.qo-at { top: auto; left: auto; transform: none; width: 380px; max-height: 400px; }
/* Soft depth and short motion on what floats (Fusion, Vectorworks 2025). */
.cad-look .menu, .cad-look .qo, .cad-look .dialog { box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 8px 24px rgb(0 0 0 / 0.16); animation: cad-pop 120ms ease-out; }
.cad-look .py-panel, .cad-look .find-panel { box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 12px 32px rgb(0 0 0 / 0.20); }
.cad-look .dialog-shield { animation: cad-fade 120ms ease-out; backdrop-filter: blur(1.5px); }
.cad-look .rb-big, .cad-look .rb-small, .cad-look .ribbon-tab { transition: background-color 80ms ease-out, border-color 80ms ease-out, color 80ms ease-out; }
.cad-look .ribbon-tab.context.on { box-shadow: inset 0 -2px 0 color-mix(in srgb, #2f8f6a 40%, transparent); }
@keyframes cad-pop { from { opacity: 0; transform: translateY(4px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes cad-fade { from { opacity: 0; } to { opacity: 1; } }
.qo:not(.qo-at) { animation-name: cad-pop-centre; }
@keyframes cad-pop-centre { from { opacity: 0; transform: translateX(-50%) translateY(4px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .cad-look .menu, .cad-look .qo, .cad-look .dialog, .cad-look .dialog-shield { animation: none; } }
.cad-look .vp-label { display: none; }
.view-label select { width: auto; max-width: none; padding-right: 16px; }
.layouts-ribbon .rp-field select { width: 170px; }
/* Layouts sheet set and Batch Export (LayoutsView.Plot.cs, LayoutBatchExport.razor; feature layouts.batch-export) */
.layouts-sheetset .dialog-list { max-height: 40vh; }
.layouts-cell { width: 100%; min-width: 90px; box-sizing: border-box; }
.layouts-cell.wide { min-width: 200px; }
.layouts-sheetset-head { margin: 12px 0 6px; font-size: calc(12px * var(--ui-font, 1)); }
.layouts-sheetset-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.layouts-batch { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.layouts-batch-list { max-height: 50vh; overflow: auto; }
.layouts-batch-list tr.running td { background: var(--accent-soft); }
.layouts-batch-filter { min-width: 220px; }
.layouts-batch-names .button.small { cursor: pointer; }
.layouts-state.bad { border-color: var(--error); color: var(--error); }
.layouts-batch-stage { position: fixed; left: -30000px; top: 0; width: 1600px; height: 1000px; overflow: hidden; pointer-events: none; }
.layouts-batch-stage .layouts-page { position: absolute; }
.layouts-batch-list td:first-child, .layouts-batch-list th:first-child { width: 28px; }
.layouts-sheetset td select { min-width: 70px; }
.layouts-sheetset td:nth-child(3) select { min-width: 210px; }

/* Link from Forma (layouts.forma-link) */
.layouts-forma .layouts-forma-path { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 8px; }
.layouts-forma .layouts-forma-list { max-height: 55vh; min-height: 120px; }
.layouts-forma .layouts-forma-folder { cursor: pointer; }
.layouts-forma .layouts-forma-folder:hover { background: var(--hover, rgba(127, 127, 127, 0.12)); }
.layouts-forma .dialog-buttons .grow { flex: 1; }

/* Export, Elevation picture */
.pic-options { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 8px 0 4px; }
.pic-options label { display: flex; align-items: center; gap: 6px; }

/* SHORTCUTS: your own aliases and keys */
.shortcuts { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; min-width: min(560px, 86vw); }
.shortcuts-head { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.shortcut-row { display: grid; grid-template-columns: 130px 130px 1fr auto; gap: 6px; align-items: center; }
.shortcut-row input { width: 100%; }
.shortcut-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcuts > button { justify-self: start; align-self: flex-start; }
.name-dialog { display: flex; flex-direction: column; gap: 6px; }

/* Dynamic input: where a dragged thing lands, by the pointer */
.dyn-input { position: fixed; z-index: 9000; pointer-events: none; display: none; padding: 3px 7px; border-radius: 4px;
    background: var(--surface, #fff); color: var(--text, #111); border: 1px solid var(--accent, #2b6cb0);
    font: 12px/1.3 var(--font-mono, ui-monospace, Menlo, Consolas, monospace); box-shadow: 0 2px 8px rgba(0,0,0,.18); white-space: nowrap; }

/* Dynamic input at the crosshairs (views.dynamic-commands): what's typed, a command's question and options, by the pointer */
.dyn-cmd { position: fixed; z-index: 9000; pointer-events: none; display: none; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 420px; }
.dyn-cmd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 6px;
    background: var(--panel, #fff); color: var(--text, #111); border: 1px solid var(--accent, #2b6cb0); box-shadow: 0 4px 14px rgba(0,0,0,.18);
    font: calc(12px * var(--ui-font, 1))/1.35 var(--font-mono, ui-monospace, Menlo, Consolas, monospace); }
.dyn-cmd-prompt { color: var(--muted, #555); }
.dyn-cmd-prompt.colon { margin-left: -4px; }
.dyn-cmd-opts { color: var(--accent, #2b6cb0); }
.dyn-cmd-opts .on { background: var(--accent, #2b6cb0); color: var(--on-accent, #fff); border-radius: 3px; padding: 0 3px; }
.dyn-cmd-text { min-width: 1.5em; padding: 0 4px; border-radius: 3px; background: var(--accent-soft, #e0ecf9); color: var(--text, #111); font-weight: 600; white-space: pre; }
.dyn-cmd-text.empty { min-width: 1.5em; }
.dyn-cmd-list { display: flex; flex-direction: column; padding: 3px; border-radius: 6px; background: var(--panel, #fff); border: 1px solid var(--stroke, #ccc);
    box-shadow: 0 4px 14px rgba(0,0,0,.16); font-size: calc(11px * var(--ui-font, 1)); max-width: 420px; }
.dyn-cmd-list > div { display: flex; gap: 8px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; }
.dyn-cmd-list > div.on { background: var(--accent-soft, #e0ecf9); }
.dyn-cmd-name { font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace); font-weight: 600; color: var(--text, #111); }
.dyn-cmd-desc { color: var(--muted, #555); overflow: hidden; text-overflow: ellipsis; }
.dyn-cmd-hint { font-size: calc(10.5px * var(--ui-font, 1)); color: var(--muted, #555); background: var(--panel, #fff); border-radius: 4px; padding: 1px 5px; }

/* Clearance checks in the 3D view (feature views.clearances) */
.clear-list { position: absolute; top: 10px; left: 10px; z-index: 6; width: min(380px, calc(100% - 20px)); max-height: calc(100% - 80px); overflow: auto; background: var(--panel, #fff); border: 1px solid var(--stroke, #ccc); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.clear-head { display: flex; align-items: center; gap: 8px; }
.clear-head .muted { flex: 1; }
.clear-row { text-align: left; border: 0; background: transparent; padding: 4px 6px 4px 20px; border-radius: 4px; position: relative; font-size: 0.9em; cursor: pointer; color: inherit; }
.clear-row:hover { background: var(--hover, rgba(0,0,0,.06)); }
.clear-row::before { content: ""; position: absolute; left: 6px; top: 9px; width: 8px; height: 8px; border-radius: 2px; }
.clear-row.error::before { background: #e53935; }
.clear-row.warning::before { background: #f5a623; }

/* Smart guides while dragging loose gear (feature views.smart-guides) */
.smart-guide { position: absolute; pointer-events: none; z-index: 8; border-left: 1px dashed #e6007e; width: 0 !important; }

/* Category visibility (feature views.category-visibility) */
.gear.cat-grey, .strip.cat-grey { opacity: 0.22; filter: grayscale(1); }
.gear.cat-hidden, .strip.cat-hidden { display: none !important; }
.vis-table { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow: auto; margin: 8px 0; }
.vis-row { display: flex; align-items: center; gap: 12px; padding: 2px 0; border-bottom: 1px solid var(--stroke, #e3e3e3); }
.vis-row .grow { flex: 1; }

/* Custom rack builder (equipment.rack-builder) */
.custom-rack { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 8px 0; }
.custom-rack-fields { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 6px 12px; flex: 1; min-width: 300px; }
.custom-rack-fields label { display: flex; flex-direction: column; font-size: 12px; gap: 2px; }
.custom-rack-fields label.check { flex-direction: row; align-items: center; gap: 6px; }
.custom-rack-preview { max-width: 100%; }
.custom-rack-preview .cr-frame { fill: none; stroke: currentColor; stroke-width: 1.5; }
.custom-rack-preview .cr-units { fill: var(--accent, #3b82f6); fill-opacity: .15; stroke: var(--accent, #3b82f6); }
.custom-rack-preview .cr-rail { stroke: var(--accent, #3b82f6); stroke-width: 2; }
.custom-rack-preview .cr-dim { font-size: 10px; text-anchor: middle; fill: currentColor; }

/* Favourites in the Equipment Library (equipment.favourites) */
.fav-star { border: 0; background: none; padding: 0 4px 0 0; margin: 0; cursor: pointer; color: var(--muted, #888); font-size: 14px; line-height: 1; opacity: 0; }
.library-item:hover .fav-star, .fav-star.on, .fav-star:focus-visible { opacity: 1; }
.fav-star.on { color: #e0a800; }
@media (hover: none) { .fav-star { opacity: .6; } }

/* Eyes in the Project Browser (views.browser-eyes) */
.pb-eye { margin-left: auto; border: 0; background: none; padding: 0 2px; cursor: pointer; color: var(--muted, #888); display: inline-flex; align-items: center; flex: none; }
.pb-eye svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.pb-eye:hover { color: var(--text, inherit); }
.pb-eye.off { color: var(--accent, #3b82f6); }
.pb-row.pb-hidden .pb-name, .layouts-item.pb-hidden .grow { opacity: .5; }
.pb-row .pb-meta + .pb-eye { margin-left: 6px; }
.pb-eye.off svg { stroke: var(--accent, #3b82f6); }
.pb-eye:hover svg { stroke: var(--text); }

/* Excel round trip (export.excel-round-trip) */
.trip-table { max-height: 50vh; overflow: auto; margin: 8px 0; font-size: 12px; }
.trip-row { display: grid; grid-template-columns: 22px 2fr 70px 1fr 1fr; gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--stroke, #e3e3e3); }
.trip-head { font-weight: 600; position: sticky; top: 0; background: var(--panel, #fff); }
.trip-was { color: var(--muted, #888); text-decoration: line-through; }
.trip-now { color: var(--accent, #3b82f6); font-weight: 600; }

/* DWG faceplates (equipment.dwg-faceplates) */
.faceplate-preview { width: 100%; max-width: 640px; border: 1px solid var(--stroke, #ccc); background: #fff; margin: 8px 0; }
.faceplate-preview img { width: 100%; height: 100%; display: block; }
.gear-faceplate { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; background: #fff; }
.face-text.on-faceplate .centre b, .face-text.on-faceplate .centre span { background: rgba(255, 255, 255, .82); color: #111; padding: 0 2px; border-radius: 2px; }

/* API keys (export.read-api) */
.api-urls { font-size: 11px; background: var(--panel-alt, #f4f4f4); padding: 6px 8px; border-radius: 4px; overflow-x: auto; white-space: pre; }
.api-made { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; padding: 8px; border: 1px solid var(--accent, #3b82f6); border-radius: 4px; }
.api-made input { font-family: monospace; width: 100%; }
.api-keys { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.api-key-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--stroke, #e3e3e3); padding: 3px 0; }
.api-key-row .grow { flex: 1; }

/* Compare versions: gear in colour (views.compare-gear) */
.version-gear { stroke-width: 2px !important; fill-opacity: .45 !important; }
.version-gear.added { fill: #2BA84A !important; stroke: #2BA84A !important; }
.version-gear.removed { fill: #D64545 !important; stroke: #D64545 !important; }
.version-gear.moved { fill: #E0A100 !important; stroke: #E0A100 !important; }
.version-gear.changed { fill: #2E8BC9 !important; stroke: #2E8BC9 !important; }
.versions-gear-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
.versions-gear-legend b { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 4px; }
.versions-gear-legend b.added { background: #2BA84A; } .versions-gear-legend b.removed { background: #D64545; }
.versions-gear-legend b.moved { background: #E0A100; } .versions-gear-legend b.changed { background: #2E8BC9; }

/* Comment pins (feature views.comment-pins) */
.comment-pin { position: absolute; z-index: 7; min-width: 20px; height: 20px; margin: -22px 0 0 -10px; padding: 0 5px; border: 1.5px solid #fff; border-radius: 10px 10px 10px 2px; background: #7a4fd0; color: #fff; font: 700 10px/1 Arial, sans-serif; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); cursor: pointer; }
button.comment-pin:hover:not(:disabled), button.comment-pin:focus { background: #6339b8; color: #fff; border-color: #fff; }
.pin-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; min-width: min(520px, 90vw); }
.pin-card { border: 1px solid var(--border, #ccc); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pin-card.focus { border-color: #7a4fd0; box-shadow: 0 0 0 1px #7a4fd0; }
.pin-card.resolved { opacity: .6; }
.pin-head { display: flex; align-items: center; gap: 6px; }
.pin-bubble { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 10px 10px 10px 2px; background: #7a4fd0; color: #fff; font: 700 10px/1 Arial, sans-serif; padding: 0 5px; }
.pin-reply { margin-left: 26px; padding-left: 8px; border-left: 2px solid var(--border, #ccc); }
.sysv-bridge-popup .sysv-link { border-top: none; padding-top: 0; margin-top: 8px; }
.sysv-bridge-popup .sysv-link .sysv-list { max-height: 50vh; }
.sysv-bridge-popup .sysv-link input { font-size: calc(14px * var(--ui-font, 1)); }

/* ----- Family Editor (FamilyEditor.razor, feature layouts.family-editor): laid out as the rest of Layouts (ribbon,
   Project Browser, Properties, View Control Bar, status bar), over whatever opened it ----- */
.fe-page { z-index: 900; }
.fe-view { display: flex; flex-direction: column; }
.fe-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fe-row .grow { flex: 1; min-width: 0; }
.fe-help { margin: 12px 4px 0; }
.fe-page .layouts-item.picked .muted { color: inherit; opacity: .8; }
.layouts-icon.elevation { border-width: 1.5px 1.5px 4px 1.5px; border-radius: 50% 50% 0 0; }
.layouts-icon.family { border-radius: 50%; }
.layouts-icon.schedule { border-width: 1.5px 1.5px 1.5px 4px; }
.fe-canvas { flex: 1; width: 100%; height: 100%; min-height: 0; display: block; background: var(--sheet); color: var(--ink); touch-action: none; user-select: none; }
.fe-canvas.tool-select { cursor: default; }
.fe-canvas:not(.tool-select):not(.fe-iso):not(.fe-elev) { cursor: crosshair; }
.fe-canvas line, .fe-canvas polyline, .fe-canvas polygon, .fe-canvas circle, .fe-canvas path, .fe-canvas rect { fill: none; stroke: currentColor; stroke-width: 1.5; }
.fe-canvas .fe-grid { stroke: var(--plan-grid); stroke-width: 1; }
.fe-canvas .fe-ref { stroke: var(--faint-ink); stroke-dasharray: 6 4; stroke-width: 1; }
.fe-canvas .fe-fill { fill: currentColor; fill-opacity: .35; }
.fe-canvas .fe-g.picked { stroke: var(--selection); stroke-width: 3; }
.fe-canvas .fe-draft { stroke: var(--selection); stroke-dasharray: 4 3; }
.fe-canvas .fe-origin line, .fe-canvas .fe-origin path, .fe-canvas path.fe-origin { stroke: var(--l-dim); stroke-width: 1.5; }
.fe-canvas .fe-snap { stroke: var(--selection); stroke-width: 2; }
.fe-canvas .fe-iso-lines { stroke: var(--ink); }
.fe-canvas .fe-level { stroke: var(--accent); stroke-dasharray: 14 4 2 4; stroke-width: 1; }
.fe-canvas .fe-centre { stroke: var(--l-dim); stroke-dasharray: 10 4 2 4; stroke-width: 1; }
.fe-iso-note { fill: var(--accent); }
.fe-form { border-top: 1px solid var(--stroke); padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.fe-form:first-of-type { border-top: none; }
.fe-form.picked { cursor: default; background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.fe-params { width: 100%; border-collapse: collapse; font-size: calc(11px * var(--ui-font, 1)); }
.fe-params th { text-align: left; color: var(--muted); font-weight: 500; }
.fe-params td { padding: 1px 1px; }
.fe-params input { width: 100%; box-sizing: border-box; min-width: 0; min-height: 22px; padding: 0 4px; }
.fe-params input[type=checkbox] { width: auto; min-height: 0; }
.fe-params .fe-unit { width: 3.5em; }
.fe-param-group td { font-weight: 600; padding-top: 6px; color: var(--section-label, var(--muted)); }
.fe-types-table-wrap { flex: 1; overflow: auto; padding: 8px; }
.fe-types-table { border-collapse: collapse; font-size: calc(12px * var(--ui-font, 1)); background: var(--panel); }
.fe-types-table th, .fe-types-table td { border: 1px solid var(--stroke); padding: 2px 4px; text-align: left; }
.fe-types-table tbody th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.fe-types-table thead th.picked { background: var(--selection); }
.fe-types-table input { width: 9em; box-sizing: border-box; min-height: 22px; }
.fe-types-note { padding: 0 8px 8px; }

/* ----- Families on PDFs (PdfView.Families.cs, js/pdffamilies.js, feature layouts.pdf-families) ----- */
.pdfr-marks .pdff-dev path { fill: none; stroke: #0e7490; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.pdfr-marks .pdff-dev text { fill: #0e7490; font: 600 6px system-ui, sans-serif; text-anchor: middle; }
.pdfr-marks .pdff-dev.picked path { stroke: #c2410c; stroke-width: 2.4; }
.pdfr-marks .pdff-dev.picked text { fill: #c2410c; }
.pdfr-marks .pdff-pt circle, .pdfr-marks .pdff-pt path { fill: none; stroke: #dc2626; stroke-width: 1; }
.pdfr-marks .pdff-pt text { fill: #dc2626; font: 700 8px system-ui, sans-serif; }
.pdfr-scroll.pdff-mode { cursor: crosshair !important; }
.pdff-panel h4 { margin: 10px 0 4px; }
.pdff-link, .pdff-device { border: 1px solid var(--r-line, var(--stroke)); border-radius: 6px; padding: 6px 8px; margin: 6px 0; }
.pdff-point { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.pdff-point label { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; }
.pdff-point input { width: 6.5em; }
.pdff-point button.on, .pdff-type.on { background: var(--accent); color: var(--on-accent); }
.pdff-find { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.pdff-lib { display: flex; flex-direction: column; gap: 2px; max-height: 45vh; overflow: auto; }
.pdff-cat { font-weight: 600; font-size: 11px; margin-top: 6px; color: var(--r-muted, var(--muted)); }
.pdff-type { display: flex; gap: 6px; text-align: left; font-size: 12px; padding: 3px 6px; }
.pdff-type .grow { flex: 1; }
.pdff-placing { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) {
    .fe-window { margin: 0; border-radius: 0; }
    .fe-body { grid-template-columns: 1fr; grid-auto-rows: auto minmax(320px, 1fr) auto; overflow: auto; }
    .fe-types, .fe-props { border: 0; }
}
[data-theme=dark] .fe-message.bad { background: #3a1d1d; }
.fe-tools select, .fe-tools input { width: auto; }

/* Project cable list and its export dialog (feature systems.cable-list). */
.sysv-cable-list td.ro { white-space: nowrap; }
.sysv-cable-list tr.muted td { opacity: .6; }
.sysv-cl-export { position: absolute; z-index: 40; left: 50%; top: 64px; transform: translateX(-50%); width: min(620px, calc(100% - 32px)); max-height: calc(100% - 96px); overflow: auto;
    background: var(--panel); color: var(--text); border: 1px solid var(--stroke); border-radius: var(--radius-md); box-shadow: 0 8px 28px rgba(0,0,0,.25); padding: 14px 16px; }
.sysv-cl-export h3 { margin: 0 0 6px; font-size: 15px; }
.sysv-cl-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.sysv-cl-choices button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; min-height: 96px; white-space: normal; }
.sysv-cl-choices button strong { font-size: 14px; }
.sysv-cl-choices button span { font-size: 12px; opacity: .8; }
.sysv-cl-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; margin: 8px 0; }
.sysv-cl-form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.sysv-cl-form label.check { flex-direction: row; align-items: center; grid-column: 1 / -1; }
.sysv-cl-issues { margin: 8px 0; font-size: 12px; }
.sysv-cl-issues ul { margin: 6px 0 0; padding-left: 18px; max-height: 200px; overflow: auto; }
@media (max-width: 560px) { .sysv-cl-choices { grid-template-columns: 1fr; } }
/* ----- Home refresh (views.home-refresh): the editor's CAD graphite look on the home page, and the overview panels ----- */
.home-cad .home-header { padding: 6px 16px; border-bottom: 1px solid var(--stroke); box-shadow: inset 0 -2px 0 var(--accent); }
.home-cad .home-brand, .home-cad .home-mark { height: 28px; }
.home-cad .home-mark { width: 28px; }
.home-cad .home-wordmark { height: 16px; }
.home-cad .home-product { font-size: calc(12px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label); }
.home-cad .home-projects, .home-cad .hub-side { background: var(--panel); }
.home-cad .home-project, .home-cad .home-row, .home-cad .hub-switch-item { border-radius: var(--radius-sm); }
.home-cad .home-project.on::before { top: 0; bottom: 0; border-radius: 0; }
.home-cad .hub-welcome { padding: 14px 24px 0; }
.home-cad .hub-welcome h1 { font-size: calc(20px * var(--ui-font, 1)); font-weight: 600; }
.home-cad .hub-welcome p { font-size: calc(13px * var(--ui-font, 1)); }
.home-cad .hub-tabs { margin-top: 12px; gap: 0; }
.home-cad .hub-tab { padding: 6px 14px; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label); }
.home-cad .hub-tab.on { color: var(--text); }
.home-cad .home-dash { gap: 12px; padding: 16px 20px 28px; }
.home-cad .home-hello h1 { font-size: calc(20px * var(--ui-font, 1)); }
/* Stat tiles: plain panels with a thin accent tick, as the editor's status readouts. */
.home-cad .home-tiles { gap: 8px; }
.home-cad .home-tile { padding: 8px 12px 9px; border-top: 1px solid var(--stroke); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); box-shadow: none; }
.home-cad .home-tile .value { font-size: calc(22px * var(--ui-font, 1)); font-weight: 600; }
.home-cad .home-tile .caption { font-size: calc(11px * var(--ui-font, 1)); letter-spacing: 0.06em; text-transform: uppercase; color: var(--section-label); }
/* Cards: palettes, with the uppercase heading band across the top. */
.home-cad .home-card { padding: 0 0 6px; border-radius: var(--radius-sm); overflow: hidden; }
.home-cad .home-card > :not(.home-card-head) { margin-left: 10px; margin-right: 10px; }
.home-cad .home-card > .home-table, .home-cad .home-card > .hx-list { margin-left: 0; margin-right: 0; }
.home-cad .home-card-head { align-items: center; min-height: calc(30px * var(--ui-font, 1)); margin: 0 0 4px; padding: 0 10px; background: var(--window); border-bottom: 1px solid var(--stroke); }
.home-cad .home-card h3 { font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label); }
.home-cad .home-card-head .muted.small { font-variant-numeric: tabular-nums; }
.home-cad .home-table th { font-size: calc(10.5px * var(--ui-font, 1)); letter-spacing: 0.06em; text-transform: uppercase; color: var(--section-label); padding: 4px 10px; }
.home-cad .home-table td { padding: 5px 10px; }
.home-cad .home-table tbody tr:hover td, .home-cad button.home-row:hover { background: var(--accent-soft); }
.home-cad .home-list .home-row { padding: 6px 10px; }
.home-cad .home-quote { border-left-color: var(--accent); }
.home-cad .home-who { width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: 11px; }
.home-cad .hub-switch-panel, .home-cad .home-find-panel { border-radius: var(--radius-sm); }
.home-cad .home-welcome { padding-bottom: 12px; }

/* The overview: Recent drawings, Open tickets, Pending approvals. */
.hx-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.hx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hx-list > li + li { border-top: 1px solid var(--stroke); }
.hx-row { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 6px 10px; border: none; border-radius: 0; background: none; color: var(--text); text-align: left; white-space: normal; }
.hx-row:hover { background: var(--accent-soft); }
.hx-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--section-label); stroke-width: 1.3; stroke-linejoin: round; }
.hx-row[data-kind=systems] .hx-icon { stroke: #2f8f6a; }
.hx-row[data-kind=layouts] .hx-icon { stroke: #b7791f; }
.hx-row[data-kind=racks] .hx-icon { stroke: var(--accent); }
.hx-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent); }
.hx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.hx-main b { font-weight: 600; }
.hx-sub { color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); }
.hx-when { flex: none; color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-when.late { color: var(--error); font-weight: 600; }
.hx-empty { margin: 6px 10px; }
.hx-row .tla-badge { flex: none; }
.home-card.hx-card { padding-bottom: 0; }
@media (max-width: 700px) { .hx-overview { grid-template-columns: 1fr; } }
.sysv-schedule.sysv-cable-list .schedule-grid td.sysv-sched-cell input { width: auto; min-width: 0; }
/* Show everywhere (feature equipment.show-everywhere): every place one UID is, by module. */
.ew-box { width: min(620px, 100%); }
.ew-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ew-head h3 { margin: 0; }
.ew-uid { font-family: var(--mono, ui-monospace, monospace); }
.ew-every { display: inline-flex; align-items: center; gap: 6px; font-size: calc(12px * var(--ui-font, 1)); white-space: nowrap; }
.ew-list { display: flex; flex-direction: column; gap: 2px; }
.ew-place .grow { display: flex; flex-direction: column; white-space: normal; }
.ew-place .ew-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-icon { width: 16px; text-align: center; flex: none; opacity: .75; }
.ew-folder { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-none { margin: 2px 0 4px 8px; }
.ew-warn { background: color-mix(in srgb, #e0a800 18%, transparent); border-left: 3px solid #e0a800; padding: 6px 10px; border-radius: 0 4px 4px 0; }
.ew-group .muted { font-weight: normal; }
.ew-details { margin: -2px 0 6px; font-size: calc(12px * var(--ui-font, 1)); }
.layouts-everywhere { margin: 2px 0 6px; align-self: flex-start; }

/* ===== Modern workspace (feature views.modern-ui, Pages/Editor.Modern.cs, js/modern.js) =====
   A lighter look over the CAD workspace that keeps the theme's colours: everything here hangs off html.modern-ui, so
   turning the feature off in the Admin console puts every screen back as it was. Spacing on a 4 / 8 px rhythm. */
html.modern-ui {
    --m-radius: 10px; --m-radius-lg: 12px;
    --m-shadow: 0 6px 20px rgb(15 23 42 / 0.10), 0 1px 3px rgb(15 23 42 / 0.08);
    --m-shadow-lg: 0 18px 48px rgb(15 23 42 / 0.22);
    --m-glass: color-mix(in srgb, var(--panel) 90%, transparent);
    --m-line: color-mix(in srgb, var(--stroke) 70%, transparent);
    --m-dot: color-mix(in srgb, var(--text) 16%, transparent);
    --m-ease: cubic-bezier(.2, .7, .2, 1);
    --font-mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}
html.modern-ui body { font-family: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-feature-settings: "cv11", "ss01"; }

/* --- Ribbon: lighter, smaller icons, no boxed group captions; the fold button also folds it to one line --- */
html.modern-ui .shell-title { border-bottom: 1px solid var(--m-line); }
html.modern-ui .ribbon-tabs { align-items: center; gap: 2px; height: calc(34px * var(--ui-font, 1)); padding: 0 8px; background: var(--panel); }
html.modern-ui .ribbon-tab { border: none; border-radius: 6px; min-height: 26px; padding: 0 10px; margin: 0; transition: background-color .12s, color .12s; }
html.modern-ui .ribbon-tab:hover:not(:disabled) { background: var(--panel-alt); }
html.modern-ui .ribbon-tab.on { background: var(--accent-soft); color: var(--accent); border: none; margin: 0; font-weight: 600; }
html.modern-ui .ribbon-tab.context { color: #2f8f6a; }
html.modern-ui .ribbon-tab.context::before { display: none; }
html.modern-ui .ribbon-tab.context.on { background: color-mix(in srgb, #2f8f6a 14%, transparent); color: #2f8f6a; }
html.modern-ui .ribbon-fold { border-radius: 6px; min-height: 26px; }
html.modern-ui .ribbon-fold:hover { background: var(--panel-alt); color: var(--text); }
html.modern-ui .ribbon { height: calc(70px * var(--ui-font, 1)); padding: 4px 6px; border-top: 1px solid var(--m-line); border-bottom: 1px solid var(--m-line); }
html.modern-ui .rp { padding: 0 6px; border-right: none; position: relative; }
html.modern-ui .rp + .rp::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--m-line); }
html.modern-ui .rp-label { display: none; }
html.modern-ui .rb-big { min-height: 58px; min-width: 50px; padding: 5px 6px 3px; border-radius: 8px; gap: 4px; }
html.modern-ui .rb-big svg { width: 20px; height: 20px; stroke-width: 1.5; }
html.modern-ui .rb-small { border-radius: 6px; min-height: 20px; }
html.modern-ui .rb-small svg { width: 14px; height: 14px; stroke-width: 1.5; }
html.modern-ui .rb-big, html.modern-ui .rb-small { transition: background-color .12s, border-color .12s; }
html.modern-ui .rb-big:hover:not(:disabled), html.modern-ui .rb-small:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }
/* One line: every tool in a row, icon and name for the big ones, icon only for the small ones (the name shows on hover). */
html.modern-ui .ribbon.one-line { height: calc(36px * var(--ui-font, 1)); padding: 3px 6px; align-items: center; }
html.modern-ui .ribbon.one-line .rp { flex-direction: row; align-items: center; }
html.modern-ui .ribbon.one-line .rp + .rp::before { top: 6px; bottom: 6px; }
html.modern-ui .ribbon.one-line .rp-items { align-items: center; flex-wrap: nowrap; }
html.modern-ui .ribbon.one-line .rp-stack { display: flex; gap: 1px; }
html.modern-ui .ribbon.one-line .rb-big { flex-direction: row; min-height: 28px; min-width: 0; max-width: none; padding: 0 8px; gap: 6px; white-space: nowrap; }
html.modern-ui .ribbon.one-line .rb-big svg { width: 16px; height: 16px; }
html.modern-ui .ribbon.one-line .rb-small { min-height: 28px; padding: 0 6px; }
html.modern-ui .ribbon.one-line .rb-small > span { display: none; }
html.modern-ui .ribbon.one-line .rp-field { padding: 0 4px; }

/* --- Panels: rounded, softly shadowed, a little see-through, floating on the drawing's background --- */
html.modern-ui .workspace { gap: 8px; padding: 8px; background: var(--canvas); }
html.modern-ui .workspace.no-library, html.modern-ui .workspace.no-details { padding: 8px; }
html.modern-ui .library, html.modern-ui .details, html.modern-ui .dock { border: 1px solid var(--m-line); border-radius: var(--m-radius-lg); box-shadow: var(--m-shadow); background: var(--m-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; }
html.modern-ui .dock.left, html.modern-ui .dock.right { border: 1px solid var(--m-line); }
html.modern-ui .dock { background: transparent; box-shadow: none; border: none; backdrop-filter: none; -webkit-backdrop-filter: none; gap: 0; }
html.modern-ui .dock.left, html.modern-ui .dock.right { border: none; }
html.modern-ui .dock > .dock-panel:not(.float) { border: 1px solid var(--m-line); border-radius: var(--m-radius-lg); box-shadow: var(--m-shadow); background: var(--m-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
html.modern-ui .dock-panel.float { border-radius: var(--m-radius-lg); box-shadow: var(--m-shadow-lg); }
html.modern-ui .dock-split { height: 8px; background: transparent; border: none; }
html.modern-ui .dock-split::after { top: 3px; opacity: .35; }
html.modern-ui .dock-split:hover, html.modern-ui .dock-split.dragging { background: color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 4px; }
html.modern-ui .dock-head, html.modern-ui .pb-head, html.modern-ui .palette-head { background: transparent; border-bottom: 1px solid var(--m-line); height: calc(34px * var(--ui-font, 1)); }
html.modern-ui .dock-tab, html.modern-ui .pb-head, html.modern-ui .palette-head { text-transform: none; letter-spacing: 0; font-size: calc(12px * var(--ui-font, 1)); color: var(--text); }
html.modern-ui .lineup { margin: 0; border: 1px solid var(--m-line); border-radius: var(--m-radius-lg); }
html.modern-ui .center { position: relative; gap: 8px; }
html.modern-ui .library-item { border-radius: 6px; transition: background-color .12s; }
html.modern-ui .library-item:hover { background: var(--accent-soft); }
html.modern-ui .library-group { color: var(--section-label); font-size: calc(11px * var(--ui-font, 1)); letter-spacing: 0.06em; text-transform: uppercase; }
html.modern-ui .library > .section-header { letter-spacing: 0; text-transform: none; }

/* --- Fields, buttons and dialogs: fewer lines, rounder corners, clear focus --- */
html.modern-ui input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), html.modern-ui select, html.modern-ui textarea { border-radius: 6px; }
html.modern-ui button { border-radius: 6px; }
html.modern-ui :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.modern-ui .dialog { border-radius: 14px; border-color: var(--m-line); box-shadow: var(--m-shadow-lg); padding: 20px; }
html.modern-ui .menu { border-radius: var(--m-radius); box-shadow: var(--m-shadow-lg); }
html.modern-ui .cmdline { background: var(--panel); border-top: 1px solid var(--m-line); font-family: var(--font-mono); }
html.modern-ui .shell-status { background: var(--panel); border-top: 1px solid var(--m-line); }
html.modern-ui .st-toggle { border-radius: 5px; font-family: var(--font-mono); }
html.modern-ui .st-toggle.on { border-color: transparent; color: var(--accent); }

/* --- Quick open (Ctrl+K): roomier, a soft shadow, clear groups --- */
html.modern-ui .qo-shield { background: rgb(15 23 42 / 0.28); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
html.modern-ui .qo { border-radius: 14px; box-shadow: var(--m-shadow-lg); border-color: var(--m-line); width: min(680px, calc(100vw - 32px)); }
html.modern-ui .qo-text { margin: 0; padding: 14px 16px; border: none; border-bottom: 1px solid var(--m-line); border-radius: 0; background: transparent; font-size: calc(16px * var(--ui-font, 1)); }
html.modern-ui .qo-text:focus { box-shadow: none; }
html.modern-ui .qo-list { padding: 6px; }
html.modern-ui .qo-group { padding: 10px 10px 4px; letter-spacing: 0.08em; }
html.modern-ui .qo-item { padding: 8px 10px; border-radius: 8px; }
html.modern-ui .qo-item.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }

/* --- Motion: panels, menus and dialogs fade and lift 4 px in 120 ms; quiet hover and pick states --- */
@keyframes m-lift { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes m-lift-centre { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
html.modern-ui .dialog, html.modern-ui .menu, html.modern-ui .cb-menu, html.modern-ui .dock-panel.float { animation: m-lift .12s var(--m-ease); }
html.modern-ui .qo { animation: m-lift-centre .12s var(--m-ease); }
html.modern-ui .dialog-shield, html.modern-ui .qo-shield { animation: m-fade .12s linear; }
html.modern-ui.cad-look .gear.selected, html.modern-ui .gear.selected { box-shadow: 0 0 0 3px color-mix(in srgb, var(--selection) 30%, transparent); border-radius: 2px; transition: box-shadow .12s; }
@keyframes m-shimmer { from { background-position: -240px 0; } to { background-position: 240px 0; } }
html.modern-ui .skeleton-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 6px; }
html.modern-ui .skeleton { display: block; height: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--panel-alt) 0, var(--header-band) 80px, var(--panel-alt) 160px); background-size: 480px 100%; animation: m-shimmer 1.4s linear infinite; }
html.modern-ui .skeleton.short { width: 40%; height: 8px; }
@media (prefers-reduced-motion: reduce) {
    html.modern-ui *, html.modern-ui *::before, html.modern-ui *::after { animation: none !important; transition: none !important; }
}

/* --- Canvas: a dot grid behind the drawings, and the zoom and face cluster in the corner --- */
html.modern-ui .elevation-scroll, html.modern-ui .plan-scroll { background-color: var(--canvas); background-image: radial-gradient(var(--m-dot) 1px, transparent 1.3px); background-size: 16px 16px; background-attachment: local; }
html.modern-ui.no-dot-grid .elevation-scroll, html.modern-ui.no-dot-grid .plan-scroll { background-image: none; } /* Dot grid off (views.dot-grid-toggle) */
html.modern-ui .view-label { border-radius: var(--m-radius); border-color: var(--m-line); background: var(--m-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--m-shadow); padding: 2px 4px; }
html.modern-ui .view-label .view-label-zoom { display: none; }
html.modern-ui .zoom-cluster { position: absolute; right: 12px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--m-line); border-radius: var(--m-radius); background: var(--m-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--m-shadow); }
html.modern-ui .zoom-cluster button { min-height: 28px; min-width: 28px; padding: 0 8px; border: none; background: transparent; color: var(--text); font-size: calc(11px * var(--ui-font, 1)); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; }
html.modern-ui .zoom-cluster button:first-child, html.modern-ui .zoom-cluster button:nth-child(3) { font-size: calc(15px * var(--ui-font, 1)); padding: 0; }
html.modern-ui .zoom-cluster button:hover { background: var(--accent-soft); }
html.modern-ui .zoom-cluster button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
html.modern-ui .zoom-cluster svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.zoom-cluster-pct { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; font-size: calc(11px * var(--ui-font, 1)); }
.zoom-cluster-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--stroke); }

/* --- The toolbar by the picked gear or rack (placed by js/modern.js) --- */
.ctx-bar { position: absolute; left: 0; top: 0; z-index: 7; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--m-line, var(--stroke)); border-radius: 10px;
    background: var(--m-glass, var(--panel)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 22px rgb(15 23 42 / 0.18);
    opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .12s, transform .12s; white-space: nowrap; }
.ctx-bar.shown { opacity: 1; pointer-events: auto; transform: none; }
.ctx-name { padding: 0 8px 0 6px; margin-right: 2px; border-right: 1px solid var(--stroke); font-weight: 600; color: var(--accent); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ctx-bar button { min-height: 28px; min-width: 28px; padding: 0 8px; border: none; border-radius: 6px; background: transparent; color: var(--text); font-size: calc(11.5px * var(--ui-font, 1)); display: inline-flex; align-items: center; justify-content: center; }
.ctx-bar button:hover { background: var(--accent-soft); }
.ctx-bar button.danger { color: var(--error); }
.ctx-bar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
html.modern-ui .details .section-header, html.modern-ui .dock-body .section-header { background: transparent; border-top: 1px solid var(--m-line); border-bottom: none; text-transform: capitalize; font-variant: all-small-caps; letter-spacing: 0.04em; font-size: calc(13px * var(--ui-font, 1)); color: var(--text); }
/* ===== Schedule builder (feature reports.builder): ReportView.razor ===== */
.report-view .report-name { font-size: calc(13px * var(--ui-font, 1)); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-view .report-confirm { display: inline-flex; align-items: center; gap: 6px; }
.report-view .report-confirm .danger, .report-builder .danger { color: var(--error); }
.report-tables { flex: 1; min-height: 0; overflow: auto; padding: 0 0 20px; }
.report-tables .report-grid { flex: none; overflow: visible; margin: 10px; }
.report-none { padding: 20px; }
.report-problems { margin: 8px 10px 0; padding: 6px 10px; border: 1px solid var(--error); border-radius: var(--radius-sm); color: var(--error); font-size: calc(12px * var(--ui-font, 1)); }
.report-grid table { user-select: text; }
.report-grid caption { caption-side: top; padding: 6px 8px; font-weight: 700; font-size: calc(14px * var(--ui-font, 1)); background: var(--panel); border-bottom: 1px solid var(--stroke); }
.report-grid thead th { cursor: default; color: var(--text) !important; position: static; }
.report-grid tr.rv-head td { font-weight: 700; background: var(--header-band); }
.report-grid tr.rv-foot td, .report-grid tr.rv-total td, .report-grid tr.rv-sum td { font-weight: 700; }
.report-grid tr.rv-total td { border-top: 2px solid var(--text); }
.report-grid tr.rv-sum td.rv-sum-label { text-align: right; }
.report-grid tr.rv-blank td { height: 12px; }
.report-grid tr.rv-jump { cursor: pointer; }
.report-grid tr.rv-jump:hover td { background: var(--accent-soft); }
.report-grid.open, .report-grid.open th, .report-grid.open td { border-color: transparent; }
.report-grid.open caption { border-bottom: 1px solid var(--text); text-align: left; }
.report-grid.open thead th { background: transparent; }
.report-builder { display: flex; flex-direction: column; gap: 8px; max-height: 94vh; }
.report-builder-head { display: grid; grid-template-columns: 1fr 1.4fr 180px; gap: 10px; }
.report-builder-head .field { margin: 0; }
.report-tabs { align-self: flex-start; }
.report-tab-body { min-height: 220px; max-height: 42vh; overflow: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 10px; }
.report-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.report-template { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 10px 12px; height: auto; white-space: normal; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel); }
button.report-template:hover { border-color: var(--accent); background: var(--accent-soft); }
.report-template-lists { color: var(--accent); }
.report-blank { border-style: dashed; }
.report-blank-pick { display: flex; gap: 6px; margin-top: 6px; }
.report-fields { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: start; }
.report-available { display: flex; flex-direction: column; gap: 6px; }
.report-field-list { max-height: 30vh; overflow: auto; border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.report-field-group { padding: 4px 8px 2px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.report-field { display: flex; width: 100%; gap: 6px; align-items: center; justify-content: flex-start; border: none; border-radius: 0; background: transparent; min-height: 24px; padding: 2px 10px; text-align: left; }
.report-field:hover { background: var(--accent-soft); }
.report-field.used span:first-child { font-weight: 600; }
.report-field .report-num { margin-left: auto; color: var(--muted); font-size: calc(11px * var(--ui-font, 1)); }
.report-col-head { font-weight: 600; margin-bottom: 4px; }
.report-col-table { border-collapse: collapse; width: 100%; }
.report-col-table th { text-align: left; font-weight: 600; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); padding: 2px 4px; }
.report-col-table td { padding: 2px 4px; vertical-align: middle; }
.report-col-table select, .report-col-table input:not([type=checkbox]) { width: 100%; min-width: 0; }
.report-col-table .report-heading { min-width: 110px; }
.report-small { width: 54px !important; }
.report-move { white-space: nowrap; }
button.icon { min-width: 24px; min-height: 24px; padding: 0 4px; }
.report-formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-width: 220px; }
.report-formula.bad { border-color: var(--error); box-shadow: 0 0 0 1px var(--error) inset; }
.report-help { margin-top: 10px; font-size: calc(12px * var(--ui-font, 1)); }
.report-help summary { cursor: pointer; color: var(--muted); }
.report-help-list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; }
.report-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.report-row .segments { margin: 0; }
.report-rule { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.report-rule .grow, .report-row .grow { flex: 1 1 200px; min-width: 0; }
.report-fx { font-style: italic; font-weight: 700; color: var(--accent); }
.report-sort-row { border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 4px 8px; margin-bottom: 8px; }
.report-sort-n { width: 56px; color: var(--muted); }
.report-group-opts label.check, .report-builder label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; margin: 0; }
.report-group-opts label.check input, .report-builder label.check input { width: auto; margin: 0; }
.report-totals > input { max-width: 260px; margin: 4px 0 8px; }
.report-format { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.report-format .field { margin: 0; }
.report-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; }
.report-preview { border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 6px; max-height: 30vh; overflow: auto; background: var(--canvas); }
.report-preview-head { display: flex; gap: 10px; align-items: baseline; padding: 0 4px; }
.report-preview .report-grid { margin: 6px 0 0; max-width: 100%; }
.pb-add { margin-left: auto; min-width: 20px; min-height: 18px; height: 18px; padding: 0 5px; line-height: 1; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 700; border-radius: 4px; }
.pb-add:hover { border-color: var(--stroke); color: var(--accent); background: var(--panel); }
.pb-row .pb-add + .pb-meta { margin-left: 6px; }
@media (max-width: 760px) { .report-fields { grid-template-columns: 1fr; } .report-builder-head { grid-template-columns: 1fr; } }
.layouts-report-area { position: absolute; inset: 0; z-index: 6; display: flex; background: var(--canvas, var(--window)); }
.report-rule .report-label { flex: 0 0 230px; }
.report-rule select { flex: 0 1 auto; width: auto; max-width: 220px; }
.report-rule .report-small { flex: none; }

/* ----- App name (views.systems-designer): the Systems Designer logo beside its name in the Home bar ----- */
.home-product { display: inline-flex; align-items: center; gap: 8px; }
.home-app-logo { width: calc(22px * var(--ui-font, 1)); height: calc(22px * var(--ui-font, 1)); flex: none; }
@media (max-width: 700px) { .home-product { display: none; } }
/* Customize Home (feature views.home-customize): the person's own panels on a six-column grid, and the drawer to lay them out. */
.hc-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; }
.hc-slot { grid-column: span var(--hc-span, 3); min-width: 0; display: flex; flex-direction: column; }
.hc-slot > .home-card { flex: 1; }
.hc-empty-home { grid-column: 1 / -1; padding: 12px 14px; }
.hc-editing .hc-slot, .hc-editing .hc-item { outline: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 3px; border-radius: var(--radius-sm); cursor: grab; }
.hc-item { display: flex; flex-direction: column; }
.hc-item > .home-tile { flex: 1; }
.hc-dragging { opacity: 0.45; }
.hc-over { outline: 2px solid var(--accent) !important; background: var(--accent-soft); }
.hc-slot-bar { display: flex; align-items: center; gap: 8px; padding: 3px 6px; margin-bottom: 4px; font-size: calc(11px * var(--ui-font, 1)); color: var(--muted); background: var(--accent-soft); border-radius: var(--radius-sm); }
.hc-slot-bar > span:nth-child(2) { white-space: nowrap; }
.hc-slot[data-size=narrow] .hc-slot-bar > span:nth-child(2) { display: none; }
.hc-slot-bar select { width: auto; margin-left: auto; font-size: inherit; padding: 1px 4px; }
.hc-grip { cursor: grab; color: var(--muted); user-select: none; }
.hc-panel { position: fixed; top: 64px; right: 16px; bottom: 16px; z-index: 26; width: min(360px, calc(100vw - 32px)); overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); }
.hc-head { display: flex; align-items: center; justify-content: space-between; }
.hc-head h3 { margin: 0; }
.hc-panel h4 { margin: 8px 0 2px; font-size: calc(11px * var(--ui-font, 1)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--section-label); }
.hc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.hc-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--window); }
.hc-row.off .hc-show span { color: var(--muted); text-decoration: line-through; }
.hc-show { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.hc-show span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-size { flex: none; width: auto; max-width: 130px; font-size: calc(12px * var(--ui-font, 1)); padding: 1px 4px; }
.hc-steps { flex: none; display: flex; }
.hc-steps .icon-button { padding: 0 5px; min-width: 0; }
.hc-where { border: 1px solid var(--stroke); border-radius: var(--radius-sm); margin: 8px 0 0; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.hc-where label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.hc-where input { width: auto; height: auto; margin: 0; }
.hc-show input { width: auto; margin: 0; }
.home-dash:has(> .hc-panel) { padding-right: 396px; }
.hc-where legend { font-size: calc(12px * var(--ui-font, 1)); color: var(--muted); padding: 0 4px; }
.hc-buttons { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--stroke); }
.hc-spacer { flex: 1; }
@media (max-width: 1000px) { .hc-slot[data-size=narrow] { grid-column: span 3; } .hc-slot[data-size=wide] { grid-column: span 6; } }
@media (max-width: 700px) { .hc-grid { grid-template-columns: 1fr; } .hc-slot { grid-column: 1 / -1 !important; } .home-dash:has(> .hc-panel) { padding-right: 16px; } .hc-panel { top: auto; left: 16px; right: 16px; width: auto; max-height: 70vh; } }

/* Ticket pins on a PDF (feature tickets.forma-import, js/pdftickets.js) */
.pdfr-pages.pdft-placing, .pdft-placing .pdfr-page { cursor: crosshair; }
.pdfr-marks .pdft-pin { cursor: pointer; }
.pdft-panel h4 { margin: 12px 0 6px; }
.pdft-row { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 0; }
.pdft-row .link { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdft-row i, .pdft-choice i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; flex: none; }
.pdft-find { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.pdft-choice { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; gap: 2px; padding: 5px 6px; margin-bottom: 3px; }
.pdft-choice.on { outline: 2px solid var(--accent, #c1d500); }
.pdft-choice small { font-size: 11px; }

/* From Forma Sheets… in PDFs (feature layouts.forma-sheets) */
.tk-modal-box.pdf-sheets { width: min(860px, calc(100vw - 32px)); }
.pdf-sheets-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.pdf-sheets-pick label { display: flex; flex-direction: column; font-size: 12px; gap: 2px; }
.pdf-sheets-list { max-height: 46vh; overflow: auto; margin: 8px 0; }
.pdf-sheets-list select { max-width: 260px; }

/* Import Forma issues: naming company assignees Autodesk gives only as numbers. */
.tk-assignee-names { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: var(--radius-lg); }
.tk-assignee-names p { margin: 0; }
.tk-assignee-names label { display: flex; align-items: center; gap: 8px; }
.tk-assignee-names input { flex: 1; min-width: 0; }
.tk-assignee-id { font-family: ui-monospace, monospace; min-width: 90px; }

/* Tickets: several at once (tickets.bulk-edit). */
.tk-table .tk-pick { width: 26px; text-align: center; padding-left: 4px; padding-right: 0; }
.tk-table tr.tk-ticked td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tk-bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 10px; margin: 4px 0 6px; border: 1px solid var(--accent); border-radius: var(--radius-lg); }
.tk-danger-link { color: var(--danger, #d9534f); }
.tk-bulk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; margin: 8px 0; }
.tk-bulk-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
