/* ============================================================================
 * Viewer toolbar system (viewbar strip + ribbon) — P0
 * Extends the existing .viewport-toolbar glass bar; every color comes from
 * the --b2-* tokens so theme swaps re-skin it for free.
 * ========================================================================== */

/* ── view strip additions ─────────────────────────────────────────────── */

.viewport-toolbar.viewbar { max-width: calc(100% - 220px); flex-wrap: nowrap; }

.viewport-toolbar-btn.viewbar-btn {
  width: auto !important;
  min-width: 28px;
  padding: 0 5px !important;
  gap: 1px;
}
.viewbar-btn .tb-chevron {
  width: 10px !important;
  height: 10px !important;
  margin-left: -1px;
  opacity: 0.7;
}
.viewbar-btn.is-open {
  background-color: var(--b2-sunken) !important;
  color: var(--b2-ink) !important;
}
.viewbar-btn:disabled {
  opacity: 0.35;
  cursor: default !important;
}
.viewbar-btn:disabled:hover { background-color: transparent !important; }

.viewbar-sep {
  width: 1px;
  height: 16px;
  background: var(--b2-line);
  margin: 0 3px;
  flex: 0 0 auto;
}

.viewbar-status {
  font-size: 11px;
  line-height: 1;
  color: var(--b2-acc-ink);
  background: var(--b2-acc-soft);
  border-radius: 4px;
  padding: 6px 7px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Instructions occupy their own row below the canvas, outside the scrolling
   icon strip. Long messages wrap instead of disappearing behind an ellipsis. */
.viewport-status {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 14px;
  border-top: 1px solid var(--b2-line, #cbd5e1);
  background: var(--b2-surface, #fff);
  color: var(--b2-ink, #1e293b);
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
.viewport-status[hidden] { display: none; }

/* ── popover menu ─────────────────────────────────────────────────────── */

.viewbar-menu {
  position: absolute;
  min-width: 172px;
  background: var(--b2-surface);
  border: 1px solid var(--b2-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 18, 22, 0.10), 0 2px 6px rgba(17, 18, 22, 0.06);
  padding: 4px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.viewbar-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 9px 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--b2-ink-2, #3f4350);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.viewbar-menu-item:hover { background: var(--b2-sunken); color: var(--b2-ink); }
.viewbar-menu-item.is-checked { color: var(--b2-acc-ink); }
.viewbar-menu-check {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}
.viewbar-menu-check svg { width: 13px; height: 13px; stroke-width: 2; }
.viewbar-menu-icon { display: inline-flex; }
.viewbar-menu-icon svg { width: 15px; height: 15px; }
.viewbar-menu-label { flex: 1 1 auto; }

/* ── popover panel (kind:'panel' — live controls, e.g. Brightness) ────── */

.viewbar-panel {
  width: 200px;
  padding: 9px 12px 8px;
  gap: 5px;
  cursor: default;
}
.viewbar-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--b2-ink);
}
.viewbar-panel-value {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--b2-ink-3, #7a7f8c);
}
.viewbar-panel-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}
.viewbar-panel-label { font-size: 11.5px; color: var(--b2-ink-2, #3f4350); }
.viewbar-panel-check {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--b2-ink-2, #3f4350);
  cursor: pointer;
}
.viewbar-panel-check input { margin: 0; accent-color: var(--b2-acc); }
.viewbar-range-wrap { position: relative; padding: 7px 0 6px; }
.viewbar-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 3px;
  margin: 0;
  background: var(--b2-line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.viewbar-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--b2-acc);
  border: 2px solid var(--b2-surface);
  box-shadow: 0 1px 2px rgba(17, 18, 22, 0.15);
  cursor: pointer;
}
.viewbar-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--b2-acc);
  border: 2px solid var(--b2-surface);
  box-shadow: 0 1px 2px rgba(17, 18, 22, 0.15);
  cursor: pointer;
}
.viewbar-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--b2-acc-focus); }
.viewbar-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--b2-acc-focus); }
/* Notch under the track at the default value (positioned by the tool). */
.viewbar-range-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 4px;
  margin-left: -0.5px;
  background: var(--b2-line-strong, #9CA3AF);
  pointer-events: none;
}
.viewbar-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.viewbar-panel-hint { font-size: 10.5px; color: var(--b2-ink-3, #7a7f8c); }
.viewbar-panel-link {
  border: 0;
  background: transparent;
  color: var(--b2-acc-ink);
  font-family: inherit;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
}
.viewbar-panel-link:hover { background: var(--b2-sunken); }
.viewbar-panel-link:disabled { opacity: 0.4; cursor: default; background: transparent; }

/* ── tooltip ──────────────────────────────────────────────────────────── */

.viewbar-tip {
  position: fixed;
  display: none;
  z-index: 3000;
  background: rgba(24, 26, 31, 0.93);
  color: #F4F5F7;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11.5px;
  line-height: 1.35;
  pointer-events: none;
  max-width: 260px;
  box-shadow: 0 3px 10px rgba(17, 18, 22, 0.18);
}
.viewbar-tip-hint { color: rgba(244, 245, 247, 0.62); }

/* ── ribbon (P1 CAD ops; renderer ships in P0, hidden while empty) ──────
 * Single 40px row: the theme locks every panel header (sidebar-header,
 * chat-header, file-tree-title, pdf-header) to a 40px band and the ribbon's
 * bottom border must continue that line across the viewer column. Buttons
 * are horizontal icon+label pills (28px tall, viewbar parity). A column too
 * narrow for the row keeps every label and scrolls it sideways under a thin
 * bar (user 2026-10-20: the 11px bar, then a 4px one, were too thick, and
 * the labels should stay now that the row scrolls; 2026-10-22: the 2px bar
 * that followed was too hard to catch). */

#viewerRibbon {
  display: none;
  align-items: center;
  gap: 2px;
  height: 40px;
  box-sizing: border-box;
  padding: 0 10px;
  background: var(--b2-bg);
  border-bottom: 1px solid var(--b2-line);
  overflow-x: auto;
  overflow-y: hidden;
  flex: 0 0 auto;
  position: relative;
  z-index: 50; /* above the empty-state overlay (z 40) */
}
/* Blink / WebKit size the bar from ::-webkit-scrollbar only while
 * scrollbar-width is unset; Firefox gets its thinnest built-in bar.
 * The bar is an 8px band whose thumb paints 3px of it, and 6px under the
 * pointer or while dragged: the transparent border is still thumb, so the
 * whole band grabs. Blink restyles the thumb for its own :hover / :active
 * only (a #viewerRibbon:hover rule shows only after some later repaint). */
#viewerRibbon::-webkit-scrollbar { height: 8px; }
#viewerRibbon::-webkit-scrollbar-track { background: transparent; }
#viewerRibbon::-webkit-scrollbar-thumb {
  border: solid transparent;
  border-width: 3px 0 2px;
  border-radius: 4px;
  background: var(--b2-line-2, #d1d5db) padding-box;
}
#viewerRibbon::-webkit-scrollbar-thumb:hover { border-width: 1px 0; background-color: var(--b2-line-strong, #9ca3af); }
#viewerRibbon::-webkit-scrollbar-thumb:active { border-width: 1px 0; background-color: var(--b2-ink-3, #7a7f8c); }
#viewerRibbon::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports not selector(::-webkit-scrollbar) {
  #viewerRibbon { scrollbar-width: thin; }
}

/* Ribbon sits in normal flow at the top of the viewer column — shift the
 * absolute overlays (viewbar, case card, floating DISPLAY rail) below it
 * while it is visible. has-ribbon lives on .trame-viewer-container.
 *
 * The viewbar is LEFT-anchored here (id selector: it must outrank the
 * theme's `.trame-in-content #viewportToolbar { right: 264px }`, which
 * encodes the DISPLAY rail's width and shoved the bar into the rail on
 * narrow columns). Left of the canvas it shares the 12px axis with the
 * ribbon's first group and the op-panel; the max-width reservation keeps
 * it clear of the rail on degenerate columns, scrolling internally instead
 * of overlapping. */
.has-ribbon #viewportToolbar {
  top: 46px !important;
  left: 12px !important;
  right: auto !important;
  max-width: calc(100% - 300px) !important;
  overflow-x: auto;
  scrollbar-width: none;
}
.has-ribbon #viewportToolbar::-webkit-scrollbar { display: none; }
/* Below the viewbar row — the card is left-anchored too (left:16). */
.has-ribbon .vtk-case-card { top: 90px !important; }
/* Resting position only (deliberately NOT !important): the rail's drag
 * handler writes inline top/right which must keep winning. Extra class in
 * the selector outranks the theme's `.trame-in-content .trame-file-list`. */
.trame-viewer-container.has-ribbon .trame-file-list { top: 46px; }
.ribbon-group-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--b2-ink-3, #7a7f8c);
  margin: 0 6px 0 8px;
  flex: 0 0 auto;
  user-select: none;
}
/* First label starts 14px from the panel edge — the same text inset as the
 * EXPLORER header (.file-tree-title padding-left) one seam to the left. */
#viewerRibbon .ribbon-group-label:first-child { margin-left: 4px; }
.ribbon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--b2-ink-2, #3f4350);
  font-family: inherit;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.ribbon-btn:hover { background: var(--b2-sunken); color: var(--b2-ink); }
.ribbon-btn.is-active { background: var(--b2-acc-soft); color: var(--b2-acc-ink); }
.ribbon-btn:disabled { opacity: 0.35; cursor: default; }
.ribbon-btn:disabled:hover { background: transparent; color: var(--b2-ink-2, #3f4350); }
.ribbon-btn-icon { display: inline-flex; flex: 0 0 auto; }
.ribbon-btn-icon svg { width: 16px; height: 16px; display: block; }
/* CREATE tool that will start from the current picks (vertices / edges / faces) */
.ribbon-btn.is-fed .ribbon-btn-icon { position: relative; }
.ribbon-btn.is-fed .ribbon-btn-icon::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--b2-acc);
  border: 1.5px solid var(--b2-bg);
}
.ribbon-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  line-height: 1;
}
.ribbon-btn-label svg { width: 11px; height: 11px; opacity: 0.7; display: block; } /* menu caret */
.ribbon-sep {
  width: 1px;
  height: 20px;
  background: var(--b2-line);
  margin: 0 6px;
  flex: 0 0 auto;
  align-self: center;
}

/* ── in-viewport overlays (box select, measure) ───────────────────────── */

.viewer-marquee {
  position: absolute;
  border: 1.5px dashed var(--b2-acc);
  background: var(--b2-acc-soft);
  z-index: 1150;
  pointer-events: none;
}

.viewer-measure-label {
  position: absolute;
  transform: translate(-50%, -130%);
  background: rgba(24, 26, 31, 0.93);
  color: #F4F5F7;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  z-index: 1150;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(17, 18, 22, 0.18);
}

/* ── op panel (P1 CAD parameter card) ─────────────────────────────────── */

.op-panel {
  position: absolute;
  bottom: 12px;             /* bottom-left is the cards' corner: the ribbon,
                               viewbar and case card own the top, the Display
                               rail the right, the axes gizmo the bottom-right */
  left: 12px;
  width: 268px;
  max-height: calc(100% - 104px);
  box-sizing: border-box;
  z-index: 1090;            /* under the toolbar (1100), over the canvas */
  background: var(--b2-surface);
  border: 1px solid var(--b2-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 18, 22, 0.14), 0 2px 8px rgba(17, 18, 22, 0.08);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--b2-ink-2, #3f4350);
}
.op-panel.is-busy .op-panel-body { opacity: 0.55; }
.op-panel .op-panel-body { overflow-y: auto; min-height: 0; }

/* Drawing tools: same corner, a little wider for the XYZ row and point list. */
.drawing-panel {
  width: min(306px, calc(100% - 24px));
}

/* ── selection card (bottom-left, same slot as the op-panel) ──────────── */

.sel-panel {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 268px;
  max-height: calc(100% - 104px);
  box-sizing: border-box;
  z-index: 1085;            /* under an open op-panel (1090) */
  background: var(--b2-surface);
  border: 1px solid var(--b2-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 18, 22, 0.14), 0 2px 8px rgba(17, 18, 22, 0.08);
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--b2-ink-2, #3f4350);
}
.sel-panel[hidden] { display: none; }
.sel-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sel-panel-title { font-size: 12.5px; font-weight: 600; color: var(--b2-ink); }
.sel-panel-list { display: flex; flex-direction: column; gap: 1px; max-height: 150px; overflow-y: auto; min-height: 0; }
.sel-panel-row { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 5px; }
.sel-panel-row:hover { background: var(--b2-sunken); }
.sel-panel-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; background: var(--b2-acc); }
.sel-panel-row.kind-face .sel-panel-dot { background: #F59E0B; }
.sel-panel-row.kind-edge .sel-panel-dot { background: #F97316; height: 3px; border-radius: 1px; }
.sel-panel-row.kind-point .sel-panel-dot { background: #F97316; border-radius: 50%; }
.sel-panel-row.kind-body .sel-panel-dot { background: #6C9BD9; }
.sel-panel-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--b2-ink); }
.sel-panel-rm {
  border: 0;
  background: transparent;
  color: var(--b2-ink-3, #7a7f8c);
  font-size: 15px;
  line-height: 1;
  padding: 0 3px;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
}
.sel-panel-row:hover .sel-panel-rm, .sel-panel-rm:focus-visible { opacity: 1; }
.sel-panel-rm:hover { color: var(--b2-ink); background: var(--b2-line); }
.sel-panel-rm.is-delete { opacity: 1; display: inline-flex; padding: 1px 3px; }
.sel-panel-rm.is-delete svg { width: 13px; height: 13px; display: block; }
.sel-panel-rm.is-delete:hover { color: #B91C1C; background: rgba(220, 38, 38, 0.10); }
.sel-panel-rm:disabled { opacity: .4; cursor: default; }
.sel-panel-ask { display: flex; gap: 6px; align-items: center; padding-top: 4px; border-top: 1px solid var(--b2-line); }
.sel-panel-ask .op-panel-input { flex: 1 1 auto; }
.drawing-panel [hidden] { display: none !important; }
.drawing-hint { margin: 4px 0; font-size: 11px; line-height: 1.5; color: var(--b2-ink-3, #7a7f8c); }
.drawing-coordinates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.drawing-coordinates label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; }
.drawing-coordinates input { width: 100%; min-width: 0; box-sizing: border-box; }
.drawing-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.drawing-points { display: flex; flex-direction: column; gap: 2px; max-height: 160px; overflow-y: auto; }
.drawing-point-row { display: flex; gap: 4px; }
.drawing-point, .drawing-remove {
  border: 0; border-radius: 4px; background: var(--b2-sunken); color: var(--b2-ink);
  cursor: pointer; padding: 5px 7px; font-size: 11px;
}
.drawing-point { flex: 1; text-align: left; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.drawing-point.is-active { background: var(--b2-acc-soft); color: var(--b2-acc-ink); }
.drawing-remove { width: 26px; flex: none; }
.drawing-point:hover, .drawing-remove:hover { color: var(--b2-acc-ink); }

.op-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--b2-ink);
}
.op-panel-x {
  border: 0;
  background: transparent;
  color: var(--b2-ink-3, #7a7f8c);
  font-size: 17px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 4px;
}
.op-panel-x:hover { color: var(--b2-ink); background: var(--b2-sunken); }

.op-panel-body { display: flex; flex-direction: column; gap: 6px; }

.op-panel-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}
.op-panel-label { font-size: 11.5px; color: var(--b2-ink-3, #7a7f8c); }
.op-panel-input {
  width: 100%;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--b2-line);
  border-radius: 6px;
  background: var(--b2-surface);
  color: var(--b2-ink);
  font-family: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.op-panel-input:focus { outline: none; border-color: var(--b2-acc); }
.op-panel-unit { font-size: 10.5px; color: var(--b2-ink-3, #7a7f8c); }

.op-panel-status {
  min-height: 15px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--b2-ink-3, #7a7f8c);
  white-space: pre-line;      /* check results are one line per file */
  max-height: 180px;
  overflow-y: auto;
}
.op-panel-status.is-error { color: var(--b2-err, #DC2626); }
.op-panel-status.is-ok { color: var(--b2-acc-ink); }

.op-panel-foot { display: flex; justify-content: flex-end; gap: 6px; }
.op-panel-btn {
  padding: 5px 12px;
  border: 1px solid var(--b2-line);
  border-radius: 6px;
  background: var(--b2-surface);
  color: var(--b2-ink-2, #3f4350);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.op-panel-btn:hover { background: var(--b2-sunken); color: var(--b2-ink); }
.op-panel-btn:disabled { opacity: 0.5; cursor: default; }
.op-panel-btn-primary {
  background: var(--b2-acc);
  border-color: var(--b2-acc);
  color: #fff;
}
.op-panel-btn-primary:hover { background: var(--b2-acc); color: #fff; filter: brightness(0.94); }

/* ── constructions popover (op list) ──────────────────────────────────── */

.op-list { width: 300px; max-height: 320px; overflow-y: auto; }
.op-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--b2-ink-3, #7a7f8c);
  padding: 4px 8px 3px;
}
.op-list-head > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.op-list-head > span.is-error { color: var(--b2-err, #DC2626); }
.op-list-head .op-list-undo { text-transform: none; letter-spacing: normal; }
.op-list-empty { padding: 8px; font-size: 11.5px; color: var(--b2-ink-3, #7a7f8c); }
.op-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
}
.op-list-row:hover { background: var(--b2-sunken); }
.op-list-text { flex: 1 1 auto; min-width: 0; }
.op-list-name {
  font-size: 12px;
  color: var(--b2-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.op-list-detail {
  font-size: 11px;
  color: var(--b2-ink-3, #7a7f8c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.op-list-detail.is-error { color: var(--b2-err, #DC2626); }
/* Dependents warning — long text, must be readable: wrap instead of clip. */
.op-list-detail.is-warn {
  color: var(--b2-warn, #B45309);
  white-space: normal;
}
.op-list-undo { flex: 0 0 auto; padding: 3px 9px; font-size: 11.5px; }

/* History: undone ops stay listed (greyed) with a Restore action. */
.op-list-sep {
  padding: 6px 8px 2px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--b2-ink-3, #7a7f8c);
  border-top: 1px solid var(--b2-line, #e3e5ea);
  margin-top: 4px;
}
.op-list-row.is-tomb .op-list-text { opacity: 0.55; }
.op-list-restored {
  flex: 0 0 auto;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--b2-ink-3, #7a7f8c);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 7px;
}
/* Non-watertight derive warning (derive-time topology audit). */
.op-list-name .op-list-openbody {
  margin-left: 6px;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--b2-warn, #B45309);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 6px;
  vertical-align: 1px;
}
/* Agent-recorded construction marker (scripts/journal_op.py lane). */
.op-list-name .op-list-agent {
  margin-left: 6px;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--b2-accent, #2563EB);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 6px;
  vertical-align: 1px;
}

/* ── commit toast (one-click regret window) ───────────────────────────── */

.op-toast {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100% - 32px));
  padding: 8px 8px 8px 14px;
  background: var(--b2-surface);
  border: 1px solid var(--b2-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 18, 22, 0.10), 0 2px 6px rgba(17, 18, 22, 0.06);
  font-size: 12px;
  color: var(--b2-ink);
}
.op-toast-text { min-width: 0; }
.op-toast-undo { flex: 0 0 auto; padding: 3px 10px; font-size: 11.5px; }
.op-toast-close {
  flex: 0 0 auto;
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px 5px;
  font-size: 14px;
  line-height: 1;
  color: var(--b2-ink-3, #7a7f8c);
}
.op-toast-close:hover { color: var(--b2-ink); }

/* ── superseded badge (scene tree) ────────────────────────────────────── */

/* A derive op replaced this upload for simulation purposes — mark, don't
 * hide: the file stays listed and re-showable, the badge carries intent. */
#sceneTree .scene-count.scene-superseded {
  flex: 0 0 auto;
  color: var(--b2-warn, #B45309);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ── lineage fold (scene tree) ────────────────────────────────────────── */

/* Derive chains collapse to their head; superseded ancestors live in this
 * quiet History group — present when needed, invisible when not. */
#sceneTree .scene-lineage-row {
  opacity: 0.62;
}
#sceneTree .scene-lineage-row:hover { opacity: 1; }
#sceneTree .scene-lineage-row .scene-lineage-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .ribbon-btn, .viewbar-menu-item { transition: none; }
}

.op-list-open-drawing { cursor: pointer; }
.op-list-open-drawing:hover .op-list-name { color: var(--b2-acc-ink, #225fad); }
.op-list-open-drawing:focus-visible { outline: 2px solid var(--b2-acc, #2a78d6); outline-offset: 2px; }
