  :root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #232733;
    --surface3: #2a2e3a;
    --border: #2e3340;
    --text: #e4e7ef;
    --text-dim: #8890a4;
    /* --accent / --accent-dim / --accent-bright are GONE (2026-08-02). They were the
       pre-shell amber primary; the shell's primary is --bui-teal and amber is now only
       a warning/measure/view-only note (plan §2). Every rule that still asked for them
       was either dead markup or already shadowed by a body.bui-on rule — so a surviving
       var(--accent) could only ever paint the WRONG colour. Do not reintroduce them. */
    --green: #4ade80;
    --green-dim: #4ade8015;
    --blue: #60a5fa;
    --red: #f87171;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  /* No page padding: the shell is a fixed, full-viewport layout. */
  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* Pre-shell mount: js/shell-wire.js moves every node out of it at boot.
     Hidden unconditionally, not behind body.bui-on — it must never paint, or a
     legacy layout flashes before the shell mounts.
     (The old "never give .container overflow:hidden" landmine died with the
     pinned sticky control stack it protected.) */
  #preShell { display: none; }

  /* Install prompt */
  .install-bar {
    display: none; padding: .6rem .8rem;
    background: linear-gradient(135deg, var(--bui-teal-d), var(--bui-panel));
    border: 1px solid var(--bui-teal-b); border-radius: var(--bui-r);
    font-size: .8125rem; color: var(--bui-tx); align-items: center; gap: .7rem;
  }
  .install-bar.show { display: flex; }
  .install-bar .msg { flex: 1; }
  .install-bar .msg strong { color: var(--bui-teal); }
  .btn-install {
    background: var(--bui-teal); color: var(--bui-on-teal); border: none;
    border-radius: var(--bui-r-sm); padding: .45rem .9rem;
    font-family: var(--bui-sans); font-size: .75rem;
    font-weight: 700; cursor: pointer; white-space: nowrap;
  }
  .btn-dismiss { background: none; border: none; color: var(--bui-txm);
    cursor: pointer; font-size: 1.1rem; padding: 0 .25rem; }

  /* Share toast */
  .share-toast {
    position: fixed; left: .5rem; right: .5rem;
    bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
    background: var(--bui-panel3); border: 1px solid var(--bui-line);
    border-left: 3px solid var(--bui-teal); color: var(--bui-tx);
    padding: .55rem .7rem; border-radius: var(--bui-r); text-align: left;
    font-size: .75rem; font-weight: 500; z-index: 9999; line-height: 1.5;
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
  }
  .share-toast.show { opacity: 1; }

  /* Import panel — collapsible */
  .import-panel { overflow: hidden; }
  .import-body-inner { padding: 0; }

  /* Import section grid */
  .import-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface2);
    position: relative;
  }
  .drop-zone.loaded {
    border-color: var(--green);
    border-style: solid;
  }
  /* :hover / .drag-over are painted by body.bui-on .bui-pane .drop-zone — the drop zone
     only ever lives inside the Project sheet pane now. */
  .drop-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
  }
  .drop-zone h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
  .drop-zone p { color: var(--text-dim); font-size: 12px; }
  /* Structure only — the teal fill/border/colour come from the body.bui-on rule.
     Keep the border shorthand here: that rule sets border-COLOR, so dropping the
     width and style would leave it with nothing to colour. */
  .file-name {
    display: inline-block;
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 5px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    margin-top: 8px;
  }

  /* Clear CSV button */

  @media (max-width: 700px) {
    .import-section { grid-template-columns: 1fr; }
  }

  .btn-reset {
    margin-left: auto;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface2);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn-reset:hover { color: var(--text); border-color: var(--text-dim); }
  .legend-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .legend-table th {
    text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-dim); padding: 6px 8px; border-bottom: 1px solid var(--border);
  }
  .legend-table td {
    padding: 8px 8px; border-bottom: 1px solid var(--border); font-size: 13px;
    vertical-align: middle; word-wrap: break-word;
  }
  .legend-table tr:last-child td { border-bottom: none; }
  .legend-table .sym-cell { width: 40px; text-align: center; }
  .legend-table .sym-cell svg { display: block; margin: 0 auto; }
  .legend-table .sym-label { font-weight: 600; color: var(--text); }
  .legend-table .sym-trigger { color: var(--text-dim); font-family: 'DM Mono', monospace; font-size: 12px; }
  /* the matched-trigger <span> is teal via #legendOverlay .legend-table .sym-trigger span */

  /* Symbols & display modal */
  .symmap-format-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px 0; flex-wrap: wrap; }
  .symmap-format-row .symmap-label { font-size: 12px; color: var(--text); font-weight: 600; }
  .symmap-select {
    font-family: 'DM Sans', sans-serif; font-size: 12px;
    background: var(--surface2); color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; padding: 5px 8px; outline: none; cursor: pointer;
  }
  /* :focus and .overridden are painted by the body.bui-on rules — and the focus ring
     HAD to move there: `.symmap-select:focus` is (0,2,0) and lost to the plain
     `body.bui-on .bui-pane .symmap-select` at (0,3,1), so the select had no visible
     focus state at all. A state rule must outrank the base rule that shadows it. */
  .symmap-type { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text); word-break: break-word; }
  .symmap-count { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
  .symmap-empty { padding: 18px 4px; color: var(--text-dim); font-size: 12px; text-align: center; }
  .symmap-section-title {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim);
    margin: 4px 0 8px 0;
  }

  /* Layer list (import panel) */
  .layer-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
  .layer-list:empty { display: none; }
  .layer-blank-btn { margin-top: 10px; width: 100%; padding: 8px; }

  .layer-dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
    flex: none; vertical-align: middle;
  }

  .colmap-preview thead { position: sticky; top: 0; z-index: 2; }
  .colmap-preview th {
    background: var(--surface2); padding: 4px 6px; border: 1px solid var(--border);
    vertical-align: top; min-width: 100px;
  }
  .colmap-preview th .colmap-hdr-name {
    font-size: 10px; color: var(--text-dim); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 4px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .colmap-select {
    width: 100%; font-family: 'DM Sans', sans-serif; font-size: 11px;
    background: var(--bg); color: var(--text); border: 1px solid var(--border);
    border-radius: 4px; padding: 3px 4px; outline: none; cursor: pointer;
  }
  /* :focus is #colmapOverlay .colmap-select:focus — an id rule, always wins. */
  .colmap-select.assigned { border-color: var(--green); color: var(--green); }
  .colmap-select.ignored { border-color: var(--border); color: var(--text-dim); opacity: 0.5; }
  .colmap-preview td {
    padding: 4px 6px; border: 1px solid var(--border);
    font-family: 'DM Mono', monospace; font-size: 11px;
    color: var(--text-dim); max-width: 150px;
    overflow: hidden; text-overflow: ellipsis;
  }
  .colmap-preview tr.colmap-data-row:nth-child(even) td {
    background: var(--surface2);
  }
  .colmap-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px; margin-top: 16px;
  }
  .colmap-footer .colmap-warn {
    flex: 1; font-size: 11px; color: var(--red);
  }
  /* The .colmap-btn family is gone: the mapper's buttons are .bui-btn now and nothing
     emits the class. Same for the .sess-item / .sess-info / .sess-name / .sess-meta /
     .sess-btn / .sess-empty row markup — renderLibrary() in shell-wire.js builds
     .bui-item rows instead. Only the two containers below are still in index.html. */
  .sess-actions {
    display: flex; gap: 8px; margin-bottom: 16px;
  }
  .sess-list { list-style: none; }

  /* Stage edge labels */
  .stage-label {
    position: absolute;
    font-family: var(--bui-sans);
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--bui-txm);
    pointer-events: none;
    z-index: 3;
  }
  /* Offsets clear the plot's own gutters, which renderPlot draws in px against
     the canvas — so these stay px, unlike the type above. */
  .stage-label.top { top: 34px; left: 50%; transform: translateX(50%); }
  .stage-label.bottom { bottom: 44px; left: 50%; transform: translateX(50%); }
  .stage-label.left { left: 58px; top: 50%; transform: translateY(-50%) rotate(-90deg) translateX(-100%); }
  .stage-label.right { right: 34px; top: 50%; transform: translateY(-50%) rotate(90deg) translateX(100%); }

  .tab-panel { display: none; }
  .tab-panel.active { display: flex; }

  /* Walk'n'Chalk panel */
  .walk-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    min-height: 400px;
  }
  .walk-header {
    display: flex;
    align-items: center;
    padding: .45rem .7rem;
    border-bottom: 1px solid var(--bui-line);
    background: var(--bui-panel);
    flex-shrink: 0;
    gap: .7rem;
  }
  .walk-flip-btn {
    font-family: var(--bui-sans);
    font-size: .75rem;
    font-weight: 600;
    color: var(--bui-tx);
    background: var(--bui-panel2);
    border: 1px solid var(--bui-line);
    border-radius: var(--bui-r-sm);
    padding: 0 .7rem;
    min-height: 2rem;
    cursor: pointer;
    transition: all 0.15s;
  }
  .walk-flip-btn:hover { border-color: var(--text-dim); }
  .walk-dir-label {
    flex: 1;
    text-align: center;
    font-family: var(--bui-mono);
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bui-txm);
    letter-spacing: .15em;
  }
  .walk-scroll {
    overflow-y: auto;
    flex: 1;
  }
  .walk-scroll::-webkit-scrollbar { width: 6px; }
  .walk-scroll::-webkit-scrollbar-track { background: transparent; }
  .walk-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  .walk-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--bui-line-soft);
    min-height: 2.25rem;
    -webkit-user-select: none; user-select: none;
  }
  .walk-row:last-child { border-bottom: none; }

  .walk-row.walk-origin .walk-y {
    background: var(--green) !important;
    color: #111;
    font-weight: 800;
  }

  .walk-side {
    flex: 1;
    display: flex;
    align-items: center;
    padding: .25rem .4rem;
    gap: .25rem;
    overflow: hidden;
    flex-wrap: wrap;
  }
  .walk-sr { justify-content: flex-end; }
  .walk-sl { justify-content: flex-start; }

  .walk-y {
    width: 5rem;
    min-width: 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--bui-mono);
    font-size: .875rem;
    font-weight: 700;
    color: var(--bui-tx);
    border-left: 1px solid var(--bui-line);
    border-right: 1px solid var(--bui-line);
    flex-shrink: 0;
    padding: .15rem;
    cursor: pointer;
    transition: background 0.1s;
  }
  .walk-row:nth-child(odd) .walk-y { background: #1a1d2a; }
  .walk-row:nth-child(even) .walk-y { background: #272b3a; }
  .walk-row.walk-expanded .walk-y { background: #363b50 !important; }
  .walk-row.walk-origin.walk-expanded .walk-y { background: var(--green) !important; }
  .walk-y:active { background: #3a3f55 !important; }

  /* Origin mode active button. KEEP THIS RULE. The teal fill comes from
     body.bui-on .walk-flip-btn.origin-active, but that rule does NOT re-declare the
     animation — deleting this one kills the pulse on the armed "Change Origin" button,
     which is the only thing on screen saying the next tap re-references every distance
     on the floor. */
  .walk-flip-btn.origin-active {
    animation: walk-origin-pulse 1s ease-in-out infinite;
  }
  @keyframes walk-origin-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
  }

  /* Collapsed: just names */
  .walk-point-compact {
    font-family: var(--bui-sans);
    font-size: .6875rem;
    font-weight: 600;
    color: var(--bui-tx);
    white-space: nowrap;
    padding: .15rem .3rem;
  }

  /* Expanded: boxed point cards */
  .walk-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--bui-line);
    border-radius: var(--bui-r-sm);
    background: var(--bui-panel);
    padding: .25rem .5rem;
    min-width: 3.25rem;
    gap: .05rem;
  }
  .wp-dist {
    font-family: var(--bui-mono);
    font-size: .625rem;
    color: var(--bui-txm);
    white-space: nowrap;
  }
  .wp-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
  }
  .wp-sym {
    width: 24px;
    height: 24px;
    display: block;
  }

  /* Table panel */
  .table-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    min-height: 400px;
  }
  .table-panel h3 {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
  }
  .table-scroll {
    overflow-y: auto;
    flex: 1;
  }
  .table-scroll::-webkit-scrollbar { width: 6px; }
  .table-scroll::-webkit-scrollbar-track { background: transparent; }
  .table-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
  }
  thead { position: sticky; top: 0; z-index: 2; }
  thead th {
    text-align: center;
    vertical-align: middle;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding: 8px 6px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  thead th.sortable { cursor: pointer; user-select: none; }
  thead th.sortable:hover { color: var(--text); }
  thead th .sort-arrow { font-size: 9px; margin-left: 3px; opacity: 0.5; }
  /* No th.sorted rule: renderTable() marks the sorted header with .on, not .sorted
     (see body.bui-on .bui-dt th.on .sort-arrow). */

  tbody td {
    padding: 8px 6px;
    border-top: 1px solid var(--border);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  tbody tr { transition: background 0.1s; }
  tbody tr:hover { background: var(--surface2); }

  /* Y column is clickable */

  /* Origin row */

  /* Name cell */
  .btn-del-pt {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    background: var(--red); color: #fff; border: none; border-radius: 4px;
    width: 20px; height: 20px; font-size: 11px; line-height: 1;
    cursor: pointer; opacity: 0.7; padding: 0;
  }
  .btn-del-pt:hover { opacity: 1; }
  tbody td.sym-cell {
    padding: 4px 6px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
  }
  tbody td.sym-cell canvas {
    display: block;
    margin: 0 auto;
  }

  /* Negative values */
  .val-neg { color: var(--red); }
  .val-pos { color: var(--green); }

  /* Plot panel */
  .plot-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .plot-panel h3 {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex; align-items: center; gap: 4px;
  }
  .plot-container {
    flex: 1;
    position: relative;
    min-height: 65vh;
  }
  canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
  }

  /* Tooltip */
  .tooltip {
    display: none;
    position: absolute;
    background: var(--bui-panel3);
    border: 1px solid var(--bui-line);
    border-radius: var(--bui-r-sm);
    padding: .5rem .7rem;
    font-size: .75rem;
    color: var(--bui-tx);
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 .25rem 1rem rgba(0,0,0,.4);
  }
  .tooltip .tt-name {
    font-weight: 700;
    margin-bottom: .1rem;
  }
  .tooltip .tt-coords {
    font-family: var(--bui-mono);
    font-size: .6875rem;
    color: var(--bui-txd);
  }

  @media (max-width: 900px) {
    .tooltip { font-size: .8125rem; padding: .6rem .85rem; }
    .tooltip .tt-coords { font-size: .75rem; }
  }

  /* Tablets and touch devices — scaled up for readability */
  @media (pointer: coarse) and (min-width: 601px) {
    thead th { font-size: 13px; padding: 10px 8px; letter-spacing: 0.8px; }
    tbody td { padding: 12px 8px; font-size: 16px; }
    tbody td.sym-cell { width: 44px; min-width: 44px; }

    .walk-row { min-height: 3.25rem; }
    .walk-y { width: 6.25rem; min-width: 6.25rem; font-size: 1.125rem; }
    .walk-point-compact { font-size: 1rem; padding: .25rem .5rem; }
    .walk-point { padding: .5rem .7rem; min-width: 4rem; gap: .1rem; }
    .wp-name { font-size: 16px; }
    .wp-dist { font-size: 14px; }
    .wp-sym { width: 30px; height: 30px; }
  }

  /* Small phone screens — tighter layout */
  @media (max-width: 600px) {
    body { padding: 16px 10px; }
    header { gap: 10px; margin-bottom: 20px; }
    header .logo { height: 40px; width: 40px; }
    header h1 { font-size: 20px; }
    header p { font-size: 11px; }

    table { table-layout: auto; }
    thead th { font-size: 11px; padding: 8px 4px; letter-spacing: 0.5px; }
    tbody td { padding: 10px 5px; font-size: 14px; }
    tbody td.sym-cell { width: 36px; min-width: 36px; padding: 4px 2px; }

    /* Walk'n'Chalk scaled up for mobile */
    .walk-row { min-height: 3rem; }
    .walk-y { width: 5.6rem; min-width: 5.6rem; font-size: 1rem; }
    .walk-point-compact { font-size: .875rem; padding: .2rem .4rem; }
    .walk-point { padding: .4rem .6rem; min-width: 3.75rem; gap: .1rem; }
    .wp-name { font-size: 15px; }
    .wp-dist { font-size: 12px; }
    .wp-sym { width: 28px; }
  }

  /* ===== Display settings: UI size + orientation ===== */

  .disp-section { margin-top: 20px; }
  .disp-section .disp-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-dim); margin-bottom: 8px;
  }
  .disp-seg { display: flex; gap: 6px; }
  .disp-seg button {
    flex: 1; padding: 10px 6px; font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 600; color: var(--text-dim);
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 7px; cursor: pointer; transition: all 0.15s;
  }
  .disp-seg button:hover { color: var(--text); border-color: var(--text-dim); }
  /* .active is painted teal by body.bui-on .bui-pane .disp-seg button.active */
  .disp-scale-row { display: flex; align-items: center; gap: 14px; }
  .disp-scale-row input[type="range"] { flex: 1; height: 26px; }
  .disp-scale-val {
    font-family: 'DM Mono', monospace; font-size: 15px; color: var(--text);
    min-width: 52px; text-align: right;
  }
  .disp-hint { font-size: 11px; color: var(--text-dim); margin-top: 8px; min-height: 15px; line-height: 1.4; }
  .disp-reset { margin-top: 10px; }
  @media (max-width: 600px) { .btn-display-txt { display: none; } }

  /* ══════════════════════════════════════════════════════════════════════
     SHELL BRIDGE — see js/shell-wire.js
     js/shell-wire.js sets body.bui-on, builds the shell into #shellHost and
     MOVES the three tab panels into its view slots. The old chrome (header,
     origin bar, tab bar, project bar) stays in the DOM but hidden: eight
     modules still poke #projectName, #sectionName, #btnUpstageIs,
     #importStatus, #originChip, #btnMeasure, #btnFitMode, #zoomLevel,
     #btnUnitToggle and #btnResetView by id, and deleting them here would mean
     editing all eight in this same commit. They go in the restyle follow-up.
     ══════════════════════════════════════════════════════════════════════ */
  body.bui-on { padding: 0; overflow: hidden; }
  body.bui-on #shellHost { position: fixed; inset: 0; z-index: 1; }

  /* The install bar was a normal-flow child of .container, so the fixed shell
     painted straight over it — the same trap that hid badger-rig's share
     banner. shell-wire.js re-homes it on <body>; this makes it float. */
  body.bui-on .install-bar { position: fixed; left: 8px; right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)); margin: 0; z-index: 300; }

  /* The moved tab panels fill their shell slot instead of the old page grid.
     Every one of these overrides kills a rule that assumed page flow:
     .tab-panel visibility (the shell owns it now), the 75vh/400px panel
     clamps, and .plot-container's 65vh floor — which inside a view that also
     carries a rail and a status bar would push the rail off screen. */
  body.bui-on .tab-panel { display: flex !important; flex: 1 1 auto; min-height: 0; }
  body.bui-on .plot-panel,
  body.bui-on .table-panel,
  body.bui-on .walk-panel {
    flex: 1 1 auto; min-height: 0; max-height: none;
    border: none; border-radius: 0; background: transparent;
  }
  /* Pure chrome, replaced by the shell header / rail / status bar. The walk
     header is NOT hidden — flip and Change Origin are controls, not chrome. */
  body.bui-on .plot-panel > h3,
  body.bui-on .table-panel > h3 { display: none; }
  body.bui-on .plot-container { min-height: 0; }

  /* "N points outside view" used to ride the Fit button's own label, which the
     rail replaces — so the count gets its own corner flag on the plot. Anchored
     to a corner in rem, never to a plotPoints sx/sy, so it needs no
     plotZoomFactor() division. */
  body.bui-on .plot-container > .bui-flag { top: 8px; right: 10px; }

  /* The import panel is the Project ▸ Sources pane now, not a collapsible card:
     drop the card chrome and the collapse clamp, and hide the header that used
     to toggle it (the sheet tab IS the disclosure). */
  body.bui-on .bui-pane .import-panel { overflow: visible; }
  body.bui-on .bui-pane .import-section { grid-template-columns: 1fr; }

  /* Adopted modal sections sit directly in a sheet pane — no modal padding. */
  body.bui-on .bui-pane .disp-section { margin: 0 0 18px; }
  body.bui-on .bui-pane .sess-actions { margin: 0 0 10px; }

  /* ── Point table → .bui-dt (branch ui-shell) ──
     The table styles itself from css/badger-ui.css now. Only what .bui-dt does
     not cover stays here, and only under body.bui-on so the legacy bare table
     rules — which the legend, column-mapper and symbol-map tables still rely on
     — keep working untouched. `table{table-layout:fixed;width:100%}` IS such a
     bare rule and .bui-dt has no property to beat it, so it is overridden by
     hand: fixed layout with min-width:100% forces equal columns and truncates
     the point names. */
  body.bui-on .bui-dt { table-layout: auto; width: auto; }
  body.bui-on .bui-dt th.sym,
  body.bui-on .bui-dt td.sym { width: 44px; min-width: 44px; max-width: 44px; }
  body.bui-on .bui-dt th.sortable { cursor: pointer; user-select: none; }
  body.bui-on .bui-dt th.sortable:hover { color: var(--bui-tx); }
  body.bui-on .bui-dt th .sort-arrow { font-size: 9px; margin-left: 3px; opacity: .45; }
  body.bui-on .bui-dt th.on .sort-arrow { opacity: 1; }
  body.bui-on .bui-dt tbody tr:hover td { background: var(--bui-panel); }
  /* The Y cell is the origin control — it must look like one. */
  body.bui-on .bui-dt td.yv { cursor: pointer; position: relative; }
  body.bui-on .bui-dt td.yv:hover { background: var(--bui-teal-d); }
  body.bui-on .bui-dt td.yv::after {
    content: 'set origin'; position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%); font-family: var(--bui-sans); font-size: 9px;
    color: var(--bui-teal); opacity: 0; transition: opacity .15s;
    text-transform: uppercase; letter-spacing: .5px; pointer-events: none;
  }
  body.bui-on .bui-dt td.yv:hover::after { opacity: .7; }
  /* .btn-del-pt is absolutely positioned; .bui-dt td.id is not a containing block. */
  body.bui-on .bui-dt td.id { position: relative; padding-right: 26px; }
  body.bui-on .btn-del-pt { background: var(--bui-red); color: var(--bui-bg); }

  /* ── Walk view — recoloured, not restructured ──
     The SR | Y | SL layout IS the markout list; it is purpose-built and the
     shell has no component for it. So this is a palette change only: teal for
     the origin line, --bui-* surfaces and rules, and controls that read as the
     shell's buttons. The nth-child banding stays — it is what lets you keep
     your place walking down a long rig with a tape in one hand. */
  body.bui-on .walk-header { background: var(--bui-panel); border-bottom-color: var(--bui-line); }
  body.bui-on .walk-flip-btn {
    background: var(--bui-panel2); border: 1px solid var(--bui-line);
    color: var(--bui-tx); border-radius: var(--bui-r-sm); font-weight: 600;
    min-height: 2rem; padding: 0 .7rem;
  }
  body.bui-on .walk-flip-btn:hover { border-color: var(--bui-teal); color: var(--bui-teal); }
  /* Armed state: tap a Y line to move the origin. The pulse animation on the
     legacy rule is left running — it is the only thing on screen saying the next
     tap will re-reference every distance. */
  body.bui-on .walk-flip-btn.origin-active {
    background: var(--bui-teal); color: var(--bui-on-teal); border-color: var(--bui-teal);
  }
  body.bui-on .walk-dir-label { color: var(--bui-txm); font-family: var(--bui-mono); }
  body.bui-on .walk-row { border-bottom-color: var(--bui-line-soft); }
  body.bui-on .walk-y {
    color: var(--bui-tx); font-family: var(--bui-mono);
    border-left-color: var(--bui-line); border-right-color: var(--bui-line);
  }
  body.bui-on .walk-row:nth-child(odd) .walk-y  { background: var(--bui-panel); }
  body.bui-on .walk-row:nth-child(even) .walk-y { background: var(--bui-panel2); }
  body.bui-on .walk-row.walk-expanded .walk-y   { background: var(--bui-panel3) !important; }
  body.bui-on .walk-row.walk-origin .walk-y,
  body.bui-on .walk-row.walk-origin.walk-expanded .walk-y {
    background: var(--bui-teal) !important; color: var(--bui-on-teal);
  }
  body.bui-on .walk-y:active { background: var(--bui-panel3) !important; }
  /* Zero keeps the neutral text colour: amber is warnings only under this
     palette, and the origin row is already unmistakable. */
  body.bui-on .walk-y.val-neg  { color: var(--bui-red); }
  body.bui-on .walk-y.val-pos  { color: var(--bui-green); }
  body.bui-on .walk-point-compact { color: var(--bui-tx); font-family: var(--bui-sans); }
  body.bui-on .walk-point {
    background: var(--bui-panel); border: 1px solid var(--bui-line);
    border-radius: var(--bui-r-sm);
  }
  body.bui-on .wp-dist { color: var(--bui-txm); font-family: var(--bui-mono); }
  body.bui-on .wp-name { color: var(--bui-tx); font-family: var(--bui-sans); }
  body.bui-on .walk-scroll::-webkit-scrollbar-thumb { background: var(--bui-panel3); }
  body.bui-on .table-scroll::-webkit-scrollbar-thumb { background: var(--bui-panel3); }

  /* ── Sheet panes — adopted legacy markup, restyled in place ──
     The Sessions / Display / Symbols bodies and the import panel were MOVED into
     sheet panes by js/shell-wire.js, ids and listeners intact. Restyling them
     here rather than rewriting their renderers keeps the data half of
     session.js / cloud-session.js / modals.js out of this commit entirely.
     Everything is scoped to body.bui-on .bui-pane, so the legacy modals (legend,
     column mapper, add point) that were NOT adopted keep their own look. */

  /* Sources */
  body.bui-on .layer-list { display: block; gap: 0; margin: 0 0 .6rem; }
  body.bui-on .layer-list .bui-item.layer-hidden .nm { color: var(--bui-txm); }
  body.bui-on .layer-list .layer-del:hover { color: var(--bui-red); }
  body.bui-on .bui-pane .drop-zone {
    border: 1px dashed var(--bui-line); border-radius: var(--bui-r);
    background: var(--bui-panel); padding: 1.2rem .7rem; color: var(--bui-txm);
  }
  body.bui-on .bui-pane .drop-zone:hover,
  body.bui-on .bui-pane .drop-zone.drag-over {
    border-color: var(--bui-teal); background: var(--bui-teal-d);
  }
  body.bui-on .bui-pane .drop-zone.loaded { border-color: var(--bui-green); }
  body.bui-on .bui-pane .drop-zone h3 { color: var(--bui-txd); font-size: .8125rem; font-weight: 600; }
  body.bui-on .bui-pane .drop-zone p { color: var(--bui-txm); font-size: .6875rem; }
  body.bui-on .bui-pane .file-name {
    background: var(--bui-teal-d); border-color: var(--bui-teal-b); color: var(--bui-teal);
    font-family: var(--bui-mono);
    /* padding is re-declared here on purpose: badger-ui.css resets `.bui-sheet * {padding:0}`
       at (0,1,1), which outranks the plain `.file-name` (0,1,0) — so the chip has been
       rendering with no padding at all since it was adopted into the Project sheet. Any
       OTHER legacy block adopted into a pane has the same trap; check its padding. */
    padding: .2rem .55rem;
  }

  /* Library — local and cloud sessions share this markup */
  body.bui-on .bui-pane .sess-actions { margin: 0 0 .5rem; display: flex; gap: .4rem; }
  /* The Library list is .bui-list markup built by renderLibrary(); #sessList is
     just the <ul> it fills, so it only needs the list frame. */
  body.bui-on .bui-pane .sess-list {
    background: var(--bui-panel); border: 1px solid var(--bui-line);
    border-radius: var(--bui-r); overflow: hidden; list-style: none;
  }
  body.bui-on .bui-pane .sess-list .bui-item:last-child { border-bottom: none; }
  body.bui-on .bui-pane .sess-list .bui-tag { flex: 0 0 auto; }
  body.bui-on .bui-pane #wncCloudStatus { font-size: .6875rem; color: var(--bui-txm);
    margin: .5rem 0 0; }
  body.bui-on .bui-pane .lib-del:hover { color: var(--bui-red); }

  /* Display + Account */
  body.bui-on .bui-pane .disp-label {
    display: flex; align-items: center; gap: .45rem; margin: 0 0 .4rem;
    font-size: .6875rem; font-weight: 600; color: var(--bui-txd);
    text-transform: none; letter-spacing: 0;
  }
  body.bui-on .bui-pane .disp-label::before {
    content: ''; width: .75rem; height: 2px; border-radius: 2px;
    background: var(--bui-teal); flex: 0 0 auto;
  }
  body.bui-on .bui-pane .disp-seg {
    display: flex; gap: .25rem; background: var(--bui-panel);
    border: 1px solid var(--bui-line); border-radius: var(--bui-r); padding: .22rem;
  }
  body.bui-on .bui-pane .disp-seg button {
    flex: 1; height: 2rem; border-radius: var(--bui-r-sm); border: none; padding: 0;
    background: transparent; color: var(--bui-txd); font-size: .75rem; font-weight: 600;
  }
  body.bui-on .bui-pane .disp-seg button.active {
    background: var(--bui-teal); color: var(--bui-on-teal); border: none;
  }
  body.bui-on .bui-pane .disp-hint { font-size: .625rem; color: var(--bui-txm); line-height: 1.5; }
  body.bui-on .bui-pane .disp-scale-row input[type="range"] { accent-color: var(--bui-teal); }
  body.bui-on .bui-pane .disp-scale-val { color: var(--bui-teal); font-family: var(--bui-mono); }
  body.bui-on .bui-pane #acctKeyInput {
    background: var(--bui-bg) !important; border: 1px solid var(--bui-line) !important;
    border-radius: var(--bui-r-sm) !important; color: var(--bui-tx) !important;
    font-family: var(--bui-mono) !important; font-size: .8125rem !important;
  }

  /* Symbols */
  body.bui-on .bui-pane .symmap-format-row { margin: 0 0 1rem; }
  body.bui-on .bui-pane .symmap-label { color: var(--bui-txd); font-size: .6875rem; }
  body.bui-on .bui-pane .symmap-select {
    background: var(--bui-bg); border: 1px solid var(--bui-line); color: var(--bui-tx);
    border-radius: var(--bui-r-sm); font-family: var(--bui-sans); font-size: .75rem;
  }
  body.bui-on .bui-pane .symmap-select:focus { border-color: var(--bui-teal); }
  body.bui-on .bui-pane .symmap-select.overridden { border-color: var(--bui-teal); color: var(--bui-teal); }
  body.bui-on .bui-pane .symmap-section-title {
    display: flex; align-items: center; gap: .45rem; margin: 1rem 0 .4rem;
    font-size: .6875rem; font-weight: 600; color: var(--bui-txd);
    text-transform: none; letter-spacing: 0;
  }
  body.bui-on .bui-pane .symmap-section-title::before {
    content: ''; width: .75rem; height: 2px; border-radius: 2px;
    background: var(--bui-teal); flex: 0 0 auto;
  }
  body.bui-on .bui-pane .symmap-type { color: var(--bui-tx); font-family: var(--bui-mono); }
  body.bui-on .bui-pane .symmap-count { color: var(--bui-txm); }
  body.bui-on .bui-pane .symmap-empty { color: var(--bui-txm); }
  body.bui-on .bui-pane .legend-table th { color: var(--bui-txm); border-bottom-color: var(--bui-line); }
  body.bui-on .bui-pane .legend-table td { border-bottom-color: var(--bui-line-soft); color: var(--bui-txd); }

  /* ── Modals on the shared .bui-modal component (css/badger-ui.css) ──
     badger-rig built .bui-modal for exactly this screen and left a note saying so:
     it accepts `.show` as well as `.on` precisely because import-csv.js is a
     diff-and-copy twin across the two apps, which is what lets Walk'n'Chalk adopt
     it with a MARKUP-ONLY change — no JS touched.
     Only what the component does not cover stays here, scoped to each overlay so
     it cannot leak. The old .colmap-overlay / .addpt-overlay / .legend-overlay
     blocks were DELETED rather than left alongside: they set their own fixed
     positioning and panel chrome and would have fought .bui-modal outright. */
  #colmapOverlay .colmap-preview { width: 100%; }
  #colmapOverlay .colmap-preview th,
  #colmapOverlay .colmap-preview td { text-align: left; max-width: 12rem;
    overflow: hidden; text-overflow: ellipsis; }
  #colmapOverlay .colmap-preview th { vertical-align: top; }
  #colmapOverlay .colmap-hdr-name { display: block; font-family: var(--bui-mono);
    color: var(--bui-tx); font-size: .75rem; margin-bottom: .25rem; }
  #colmapOverlay .colmap-select { width: 100%; background: var(--bui-bg);
    border: 1px solid var(--bui-line); border-radius: var(--bui-r-sm);
    color: var(--bui-tx); font: 500 .6875rem var(--bui-sans); padding: .2rem .3rem; }
  #colmapOverlay .colmap-select:focus { outline: none; border-color: var(--bui-teal); }
  #colmapOverlay .colmap-select.assigned { color: var(--bui-teal); border-color: var(--bui-teal); }
  #colmapOverlay .colmap-select.ignored { color: var(--bui-txm); opacity: .6; }
  #colmapOverlay .colmap-data-row td { color: var(--bui-txm); }
  #colmapOverlay #colmapWarn { color: var(--bui-red); }

  /* Add point: a narrow panel — it is three fields, not a table. */
  #addptOverlay .bui-modal-panel { width: min(100%, 22rem); }
  .bui-field-col { display: flex; flex-direction: column; gap: .25rem; }
  .bui-field-col label { font-size: .6875rem; color: var(--bui-txm); }
  .bui-field-col input { height: 2.4rem; background: var(--bui-bg);
    border: 1px solid var(--bui-line); border-radius: var(--bui-r-sm);
    padding: 0 .55rem; font: 500 .875rem var(--bui-mono); color: var(--bui-tx); }
  .bui-field-col input:focus { outline: none; border-color: var(--bui-teal); }
  #addptOverlay .addpt-row { display: flex; gap: .5rem; }
  #addptOverlay .addpt-row > div { flex: 1; min-width: 0; }
  /* The sign flip sits flush against its field — one control, two halves. It is a
     glove-sized target on purpose: it is how you enter a downstage coordinate. */
  #addptOverlay .addpt-input-wrap { display: flex; }
  #addptOverlay .addpt-input-wrap input { border-radius: 0 var(--bui-r-sm) var(--bui-r-sm) 0;
    border-left: none; flex: 1; min-width: 0; }
  #addptOverlay .addpt-sign { height: 2.4rem; padding: 0 .55rem;
    border-radius: var(--bui-r-sm) 0 0 var(--bui-r-sm); box-shadow: none; }

  #legendOverlay .legend-table { width: 100%; border-collapse: collapse; }
  #legendOverlay .legend-table th { color: var(--bui-txm); font-size: .625rem;
    text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--bui-line); }
  #legendOverlay .legend-table td { padding: .4rem .5rem;
    border-bottom: 1px solid var(--bui-line-soft); color: var(--bui-txd); font-size: .75rem; }
  #legendOverlay .legend-table .sym-cell { width: 2.5rem; text-align: center; }
  #legendOverlay .legend-table .sym-label { color: var(--bui-tx); font-weight: 600; }
  #legendOverlay .legend-table .sym-trigger { color: var(--bui-txm);
    font-family: var(--bui-mono); font-size: .6875rem; }
  #legendOverlay .legend-table .sym-trigger span { color: var(--bui-teal); }
  #legendOverlay .bui-note .acc { color: var(--bui-teal); }
