/* @layer shell — chrome: sidebar, header, status bar, viewport frame. */
@layer shell {
/* ----- Sidebar (CV-08 tree-panel) -----
   The mock's left tree panel is the canonical structure: header `FILES N/N`,
   search input, body with PROJECT / DESIGN SYSTEM / UI CANVASES / RUNTIME
   sections (SKU pill counters), rows with .dir / .sel / .star / .modified
   modifiers. Brand block is gone — `■ MDCC` now lives in the top menubar. */
.sidebar {
  background: var(--u-bg-1);
  border-right: 1px solid var(--u-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-family: var(--u-font-mono);
  font-size: var(--type-xs);
}

.tree-panel-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px var(--u-s-3) 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  color: var(--u-fg-0);
  font-family: var(--u-font-mono);
  border-bottom: 1px solid var(--u-border);
  background: var(--u-bg-2);
  flex: none;
}
.tree-panel-hd .ct {
  color: var(--u-fg-2);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tree-panel-hd .live-dot {
  width: 6px;
  height: 6px;
  background: var(--u-fg-3);
  transition: background var(--dur-panel) var(--ease-out);
  flex: none;
}
.tree-panel-hd .live-dot.connected { background: var(--u-status-success); }

/* Phase 22 — "+ board" composer in the tree header (create a blank brief board). */
.tree-panel-hd .tp-hd-left {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.tp-new-board {
  appearance: none;
  border: 1px solid var(--u-border);
  background: var(--u-bg-0);
  color: var(--u-fg-1);
  font-family: var(--u-font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  padding: 2px 6px;
  cursor: pointer;
  line-height: 1.4;
  transition:
    color var(--dur-flip) var(--ease-out),
    border-color var(--dur-flip) var(--ease-out);
}
.tp-new-board:hover,
.tp-new-board[aria-expanded='true'] {
  color: var(--u-fg-0);
  border-color: var(--u-border-strong);
}
.tp-new-board[aria-expanded='true'] { background: var(--u-bg-1); }
.tp-new-board:focus-visible {
  outline: none;
  border-color: var(--u-border-strong);
  box-shadow: var(--shadow-focus);
}

.tp-new-board-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px var(--u-s-3);
  background: var(--u-bg-1);
  border-bottom: 1px solid var(--u-border-subtle);
  flex: none;
}
.tp-new-board-input {
  flex: 1;
  min-width: 0;
  background: var(--u-bg-0);
  border: 1px solid var(--u-border);
  color: var(--u-fg-0);
  font-size: 11px;
  font-family: var(--u-font-mono);
  outline: none;
  padding: 3px 8px;
  transition: border-color var(--dur-flip) var(--ease-out);
}
.tp-new-board-input::placeholder { color: var(--u-fg-3); }
.tp-new-board-input:focus-visible {
  border-color: var(--u-border-strong);
  box-shadow: var(--shadow-focus);
}
.tp-new-board-go {
  appearance: none;
  flex: none;
  border: 1px solid var(--u-border);
  background: var(--u-bg-0);
  color: var(--u-fg-1);
  font-family: var(--u-font-mono);
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition:
    color var(--dur-flip) var(--ease-out),
    border-color var(--dur-flip) var(--ease-out);
}
.tp-new-board-go:hover:not(:disabled) {
  color: var(--u-fg-0);
  border-color: var(--u-border-strong);
}
.tp-new-board-go:disabled { opacity: 0.45; cursor: default; }
.tp-new-board-err {
  padding: 4px var(--u-s-3) 6px;
  font-size: 10px;
  font-family: var(--u-font-mono);
  color: var(--u-status-error, #e5484d);
  background: var(--u-bg-1);
  border-bottom: 1px solid var(--u-border-subtle);
}

.tree-panel-search {
  padding: 5px var(--u-s-3);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--u-bg-1);
  border-bottom: 1px solid var(--u-border-subtle);
  flex: none;
}
.tree-panel-search svg { color: var(--u-fg-2); flex: none; }
.tree-panel-search input {
  flex: 1;
  background: var(--u-bg-0);
  border: 1px solid var(--u-border);
  color: var(--u-fg-0);
  font-size: 11px;
  outline: none;
  font-family: var(--u-font-mono);
  min-width: 0;
  padding: 3px 8px;
  border-radius: 0;
  transition: border-color var(--dur-flip) var(--ease-out);
}
.tree-panel-search input::placeholder { color: var(--u-fg-3); }
.tree-panel-search input:focus-visible {
  border-color: var(--u-border-strong);
  box-shadow: var(--shadow-focus);
}
.search-clear {
  background: transparent;
  border: 0;
  color: var(--u-fg-3);
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
}
.search-clear:hover { color: var(--u-fg-0); }
.search-kbd {
  font-family: var(--u-font-mono);
  font-size: 10px;
  padding: 1px 5px;
  color: var(--u-fg-3);
  border: 1px solid var(--u-border);
  background: var(--u-bg-2);
  flex: none;
}

.tree-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 var(--u-s-3);
}
.tree-panel-body::-webkit-scrollbar { width: 6px; }
.tree-panel-body::-webkit-scrollbar-thumb { background: var(--u-border); }

.tp-section-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px var(--u-s-3) 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  color: var(--u-fg-1);
  font-family: var(--u-font-mono);
}
.tp-section-hd:not(:first-child) { margin-top: 6px; }
.tp-section-hd > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-section-hd .pill {
  padding: 0 5px;
  background: var(--u-bg-2);
  border: 1px solid var(--u-border);
  font-size: 9px;
  letter-spacing: var(--tracking-sku);
  color: var(--u-fg-2);
  font-family: var(--u-font-mono);
  font-weight: 600;
  flex: none;
}

.tp-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--u-s-3);
  color: var(--u-fg-1);
  font-family: var(--u-font-mono);
  font-size: 11px;
  line-height: 1.55;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
}
.tp-row:hover { background: var(--u-bg-2); color: var(--u-fg-0); }
.tp-row:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  z-index: 1;
  position: relative;
}

/* Phase 22 — per-row delete affordance. The wrapper is relative so the trash
   button sits at the row's right edge; it reveals on hover / focus-within and
   never shifts the row's layout (the row reserves right padding for it). */
.tp-row-wrap { position: relative; }
.tp-row-wrap > .tp-row { padding-right: 26px; }
.tp-del {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--u-fg-3);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity var(--dur-flip) var(--ease-out),
    color var(--dur-flip) var(--ease-out),
    background var(--dur-flip) var(--ease-out);
}
.tp-row-wrap:hover .tp-del,
.tp-del:focus-visible { opacity: 1; }
.tp-del:hover { color: var(--u-status-error, #e5484d); background: var(--u-bg-3); }
.tp-del:focus-visible {
  opacity: 1;
  outline: none;
  box-shadow: var(--shadow-focus);
}
@media (prefers-reduced-motion: reduce) {
  .tp-del { transition: none; }
}
.tp-row .glyph {
  width: 12px;
  display: inline-block;
  text-align: center;
  color: var(--u-fg-2);
  font-size: 10px;
  flex: none;
}
.tp-row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-row.dir {
  color: var(--u-fg-0);
  font-weight: 600;
}
.tp-row.dir .glyph { color: var(--u-fg-1); }
.tp-row.sel {
  background: var(--u-accent-bg);
  color: var(--u-fg-0);
  border-left-color: var(--u-border-strong);
  font-weight: 600;
}
.tp-row.sel .glyph { color: var(--u-accent); }
.tp-row.modified .name::after {
  content: "●";
  color: var(--u-status-warn);
  margin-left: 6px;
  font-size: 8px;
  vertical-align: middle;
}
.tp-row.star::before {
  content: "★";
  color: var(--u-accent);
  font-size: 9px;
  margin-right: 4px;
  flex: none;
}
.tp-row .badge {
  padding: 0 5px;
  background: var(--u-accent);
  color: var(--u-accent-fg);
  font-size: 9px;
  letter-spacing: var(--tracking-sku);
  font-weight: 700;
  font-family: var(--u-font-mono);
  flex: none;
}
.tp-row.muted,
.tp-row.muted .name {
  color: var(--u-fg-3);
}
.tp-row.muted .glyph { color: var(--u-fg-3); }
.tp-row.muted[aria-disabled="true"] { cursor: default; }
.tp-row.muted[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--u-fg-3);
}
.tp-row[aria-disabled="true"] { cursor: default; }
.tp-empty {
  padding: 4px var(--u-s-3);
  color: var(--u-fg-3);
  font-size: 11px;
  font-style: italic;
}

/* Cheatsheet */
.cheatsheet {
  margin-top: auto;
  padding: var(--u-s-3) var(--u-s-2) var(--u-s-3);
  border-top: 1px solid var(--u-border);
  background: var(--u-bg-1);
}
.cheatsheet > details {
  margin-bottom: 4px;
}
.cheatsheet > details > summary {
  padding: 4px var(--u-s-2);
  font-size: 11px;
  font-weight: 500;
  color: var(--u-fg-1);
  border-radius: var(--u-r-sm);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--u-s-1);
}
.cheatsheet > details > summary::-webkit-details-marker { display: none; }
.cheatsheet > details > summary::before {
  content: "▸";
  color: var(--u-fg-3);
  font-size: 10px;
  width: 12px;
  display: inline-block;
  transition: transform 100ms;
}
.cheatsheet > details[open] > summary::before { transform: rotate(90deg); }
.cheatsheet > details > summary:hover { background: var(--u-bg-hover); }

.cheatsheet ul, .cheatsheet ol {
  padding: 4px var(--u-s-2) var(--u-s-2) var(--u-s-4);
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}
.cheatsheet li {
  display: flex;
  align-items: baseline;
  gap: var(--u-s-2);
  padding: 2px 0;
}
.cheatsheet li > span {
  color: var(--u-fg-3);
  font-size: 10px;
  margin-left: auto;
  text-align: right;
}
.cheatsheet kbd {
  font-family: var(--u-font-mono);
  font-size: 10px;
  background: var(--u-bg-2);
  border: 1px solid var(--u-border);
  padding: 1px 5px;
  border-radius: var(--u-r-xs);
  color: var(--u-fg-0);
}
.cheatsheet code {
  font-family: var(--u-font-mono);
  font-size: 10px;
  color: var(--u-accent);
  background: var(--u-accent-bg);
  padding: 1px 4px;
  border-radius: var(--u-r-xs);
}
.cheatsheet code i { font-style: normal; color: var(--u-fg-2); }

.cheatsheet ul.cmds li, .cheatsheet ul.files li {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.cheatsheet ul.cmds li > span, .cheatsheet ul.files li > span {
  margin-left: 0;
  text-align: left;
}

/* ----- Main ----- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Menubar — 30 px topbar shared across every canvas view (mirrors CV-08+).
   Brand mark · menu items · spacer · view-state stamp. Replaces the legacy
   action-button .header chrome. Hard-edge ink rule below, mono everywhere. */
.mb {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  height: 30px;
  background: var(--u-bg-2);
  border-bottom: 1px solid var(--u-fg-0);
  font-family: var(--u-font-mono);
  font-size: var(--type-xs);
  flex-shrink: 0;
  position: relative;
  /* `overflow: hidden` is intentionally NOT set on .mb itself — the View
     dropdown is absolutely-positioned at top: 30px (i.e. below the menubar)
     and would be clipped. Right-side overflow (rsidebar narrow) is clamped
     inside .mb-status (overflow: hidden + min-width: 0). */
  min-width: 0;
}
.mb-brand {
  padding: 0 var(--u-s-3);
  border-right: 1px solid var(--u-border);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--u-fg-0);
  font-size: 11px;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
}
.mb-brand .dot {
  width: 8px;
  height: 8px;
  background: var(--u-accent);
  flex: none;
}
.mb-menus {
  display: flex;
  align-items: stretch;
}
.mb-menu {
  padding: 0 12px;
  background: transparent;
  border: 0;
  font-family: var(--u-font-mono);
  font-size: var(--type-xs);
  color: var(--u-fg-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
}
.mb-menu:hover { background: var(--u-bg-3); color: var(--u-fg-0); }
.mb-menu[aria-expanded="true"] {
  background: var(--u-accent);
  color: var(--u-accent-fg);
  font-weight: 600;
}
.mb-menu:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--u-accent); }
.mb-menu:disabled,
.mb-menu[aria-disabled="true"] {
  color: var(--u-fg-3);
  cursor: not-allowed;
}
.mb-menu:disabled:hover,
.mb-menu[aria-disabled="true"]:hover { background: transparent; color: var(--u-fg-3); }

.mb-spacer { flex: 1; min-width: 0; }
.mb-status {
  padding: 0 var(--u-s-3);
  display: flex;
  align-items: center;
  gap: var(--u-s-3);
  color: var(--u-fg-2);
  font-size: 10px;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  border-left: 1px solid var(--u-border);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 1;
}
.mb-status > * { flex: none; }
.mb-status > .file { flex: 0 1 auto; min-width: 0; }
.mb-status .cv-stamp {
  background: var(--u-fg-0);
  color: var(--u-bg-0);
  padding: 2px 6px;
  font-weight: 700;
  font-size: 10px;
}
.mb-status .file {
  color: var(--u-fg-1);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-status .file b { color: var(--u-fg-0); font-weight: 700; }
.mb-status .sep {
  width: 1px;
  height: 14px;
  background: var(--u-border);
  display: inline-block;
  flex: none;
}
.mb-status b { color: var(--u-fg-0); font-weight: 700; }
.mb-status .ok { color: var(--u-status-success); }
.mb-status .warn { color: var(--u-accent); }
.mb-status .accent-dot {
  color: var(--u-accent);
  font-size: 8px;
}

/* Dropdown panel — opens below a menu item. Hard-edge + offset shadow,
   no blur. */
.mb-dropdown {
  position: absolute;
  top: 30px;
  background: var(--u-bg-2);
  border: 1px solid var(--u-fg-0);
  min-width: 240px;
  padding: 4px 0;
  z-index: 100;
  font-family: var(--u-font-mono);
  font-size: var(--type-xs);
  box-shadow: 4px 4px 0 var(--u-fg-0);
}
.mb-dd-hd {
  padding: 4px 12px 2px;
  font-size: 9px;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  color: var(--u-fg-2);
  font-weight: 600;
}
.mb-dd-item {
  padding: 5px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  color: var(--u-fg-0);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: var(--u-font-mono);
  font-size: var(--type-xs);
}
.mb-dd-item:hover { background: var(--u-bg-3); }
.mb-dd-item.active { color: var(--u-accent); }
.mb-dd-item[aria-disabled="true"] { color: var(--u-fg-3); cursor: not-allowed; }
.mb-dd-item[aria-disabled="true"]:hover { background: transparent; }
.mb-dd-item .lbl { display: inline-flex; align-items: center; gap: 6px; }
.mb-dd-item .check {
  color: var(--u-accent);
  width: 12px;
  display: inline-block;
  text-align: left;
}
.mb-dd-item .shortcut {
  color: var(--u-fg-2);
  font-family: var(--u-font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-wide);
  flex: none;
}
.mb-dd-item .phase-tag {
  color: var(--u-fg-3);
  font-size: 9px;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
}
.mb-dd-sep { height: 1px; background: var(--u-border); margin: 4px 0; }

.header {
  display: flex;
  align-items: center;
  gap: var(--u-s-3);
  padding: var(--u-s-2) var(--u-s-3);
  background: var(--u-bg-1);
  border-bottom: 1px solid var(--u-border);
  min-height: var(--u-header-h);
  font-family: var(--u-font-mono);
}

/* Tabs — mono labels, hairline active-underline, no pills.
   Stack the underline on the active tab via an inset bottom shadow so the
   shared bottom hairline from .header still reads as one continuous line. */
.tabs {
  display: flex;
  gap: 0;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  align-self: stretch;
  margin: calc(var(--u-s-2) * -1) calc(var(--u-s-3) * -1);
  padding: 0;
}
.tabs::-webkit-scrollbar { height: 0; }

.tab {
  display: flex;
  align-items: center;
  gap: var(--u-s-2);
  padding: var(--u-s-2) var(--u-s-3);
  background: var(--u-bg-1);
  border: 0;
  border-right: 1px solid var(--u-border-subtle);
  border-radius: 0;
  font-size: var(--type-xs);
  font-family: var(--u-font-mono);
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  white-space: nowrap;
  max-width: 240px;
  color: var(--u-fg-2);
  position: relative;
  transition: color var(--dur-flip) var(--ease-out),
              background var(--dur-flip) var(--ease-out);
}
.tab:hover { color: var(--u-fg-0); background: var(--u-bg-2); }
.tab.active {
  background: var(--u-bg-0);
  color: var(--u-fg-0);
  font-weight: 700;
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--u-accent);
}
.tab:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  z-index: 2;
}
.tab .name {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.tab .close {
  color: var(--u-fg-3);
  cursor: pointer;
  padding: 0 4px;
  border-radius: var(--u-r-xs);
  line-height: 1;
  font-size: 14px;
  background: transparent;
  border: 0;
  font-family: inherit;
}
.tab .close:hover {
  background: var(--u-bg-3);
  color: var(--u-fg-0);
}

.actions {
  display: flex;
  gap: var(--u-s-1);
  align-items: center;
}
/* Project DS — ghost chrome buttons. Transparent base, 1 px hairline,
   hover bumps surface + ink contrast (no fill in chrome). */
.actions button, .actions a {
  position: relative;
  background: transparent;
  color: var(--u-fg-1);
  border: 1px solid var(--u-border);
  padding: 4px var(--u-s-3);
  font-size: var(--type-xs);
  line-height: 1.2;
  border-radius: var(--u-r-sm);
  cursor: pointer;
  font-family: var(--u-font-mono);
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--dur-flip) var(--ease-out),
              background var(--dur-flip) var(--ease-out),
              border-color var(--dur-flip) var(--ease-out);
}
.actions button:hover, .actions a:hover {
  background: var(--u-bg-2);
  color: var(--u-fg-0);
  border-color: var(--u-border-strong);
}
.actions button:focus-visible, .actions a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  z-index: 1;
}
.actions a.icon-only {
  border-color: transparent;
  color: var(--u-fg-2);
}
.actions a.icon-only:hover {
  color: var(--u-fg-0);
  background: var(--u-bg-2);
  border-color: var(--u-border);
}
.theme-toggle-label {
  text-transform: lowercase;
}

/* Viewport — 24 px paper-grid surface (CV-01 idle infinite canvas).
   The grid signals "this is the canvas plane" in the empty state; once an
   iframe mounts it covers the bg with its own --u-bg-0 fill. Hairlines use
   --u-border-subtle so the texture reads as ink-on-paper in light and as
   soft phosphor-on-dark in dark. */
.viewport {
  flex: 1;
  position: relative;
  background-color: var(--u-bg-1);
  background-image:
    linear-gradient(var(--u-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--u-border-subtle) 1px, transparent 1px);
  background-size: 24px 24px;
}
/* Direct-child only — avoids matching preview iframes nested inside .system-view */
.viewport > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: var(--u-bg-0);
}
.viewport > iframe.active { display: block; }

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--u-fg-3);
  flex-direction: column;
  gap: var(--u-s-4);
  padding: 48px;
  text-align: center;
}
.empty-state .big {
  font-family: var(--u-font-display);
  font-size: 18px;
  color: var(--u-fg-1);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.empty-state .small {
  font-size: 12px;
  max-width: 480px;
  line-height: 1.6;
}
.empty-state .small kbd {
  font-family: var(--u-font-mono);
  background: var(--u-bg-2);
  border: 1px solid var(--u-border);
  padding: 1px 6px;
  border-radius: var(--u-r-xs);
  font-size: 11px;
  color: var(--u-fg-1);
}
.empty-state .small code {
  font-family: var(--u-font-mono);
  font-size: 11px;
  background: var(--u-bg-2);
  padding: 1px 4px;
  border-radius: var(--u-r-xs);
  color: var(--u-accent);
}

/* Status bar — named slots separated by 1 px hairlines.
   Slot order: active path · selected element · open comments · live · spacer · theme.
   Hairlines render as inset right borders on each slot (no extra DOM). */
.statusbar {
  font-family: var(--u-font-mono);
  font-size: 10px;
  color: var(--u-fg-2);
  letter-spacing: var(--tracking-wide);
  padding: 0;
  background: var(--u-bg-1);
  border-top: 1px solid var(--u-border);
  display: flex;
  align-items: stretch;
  height: var(--u-status-h);
  /* Defensive clamp — `.sb-selected` shows the selected element's selector
     which can be very long (deep CSS selectors). Combined with .main's
     minmax(0, 1fr) grid clamp this keeps the chrome inside the viewport. */
  min-width: 0;
  overflow: hidden;
}
.sb-slot {
  display: inline-flex;
  align-items: center;
  gap: var(--u-s-2);
  padding: 0 var(--u-s-3);
  border-right: 1px solid var(--u-border-subtle);
  min-width: 0;
}
.sb-key {
  color: var(--u-fg-3);
  text-transform: uppercase;
  letter-spacing: var(--tracking-sku);
}
.sb-active {
  flex: 0 1 auto;
  min-width: 0;
}
.sb-active .sb-file {
  color: var(--u-fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}
.sb-selected {
  flex: 1 1 auto;
  min-width: 0;
}
.sb-selected .sb-dot {
  color: var(--u-accent);
}
.sb-selected .sb-sel-text {
  color: var(--u-fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.sb-clear-sel {
  background: transparent;
  color: var(--u-fg-2);
  border: 1px solid var(--u-border);
  border-radius: var(--u-r-xs);
  padding: 1px 6px;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  cursor: pointer;
}
.sb-clear-sel:hover {
  color: var(--u-fg-0);
  background: var(--u-bg-2);
  border-color: var(--u-border-strong);
}
.sb-unread .sb-count {
  font-family: var(--u-font-mono);
  font-size: 10px;
  color: var(--u-fg-0);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 0 5px;
  background: var(--u-bg-2);
  border: 1px solid var(--u-border);
}
/* Note (Phase 3.5 T16): canvas-state slots (ARTBOARDS / ZOOM) live in the
   .mb-status section of the top menubar now, mirroring CV-01/CV-08. The
   statusbar keeps only chrome-state: ACTIVE / SELECTED / COMMENTS / LIVE / THEME. */
.sb-live-dot {
  width: 7px; height: 7px;
  background: var(--u-fg-3);
  border-radius: 50%;
  flex: none;
}
.sb-live-dot.connected {
  background: var(--u-status-error);
}
.sb-live .sb-key { color: var(--u-fg-1); }
/* DDR-060 / 9.1-D — linked-but-0-syncable indicator. Warn dot (heads-up, not
   error), DS-tokened, hover the label for the full reason via the title attr. */
.sb-sync { cursor: help; }
.sb-sync-dot {
  width: 7px; height: 7px;
  background: var(--u-status-warn);
  border-radius: 50%;
  flex: none;
}
.sb-sync .sb-key { color: var(--u-fg-2); }
.sb-spacer {
  flex: 1 0 auto;
  border-right: 1px solid var(--u-border-subtle);
}
.sb-theme {
  border-right: 0;
  padding: 0 var(--u-s-2);
}
.sb-theme .theme-toggle {
  background: transparent;
  border: 0;
  color: var(--u-fg-2);
  font-family: var(--u-font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  padding: 2px var(--u-s-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.sb-theme .theme-toggle:hover { color: var(--u-fg-0); background: var(--u-bg-2); }
.sb-theme .theme-toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.theme-toggle-label { color: inherit; }

.filter-no-match {
  display: none !important;
}

/* Wordmark — empty-state watermark, top-left of viewport.
   Mirrors CV-01 .wm: 40 px display glyph + SKU-tracked sub-line.
   Sits above the paper-grid via absolute positioning; iframes mount
   on top with their own opaque bg and cover this naturally. */
.wm {
  position: absolute;
  top: var(--u-s-4);
  left: var(--u-s-5);
  font-family: var(--u-font-display);
  font-weight: 700;
  line-height: 1;
  color: var(--u-fg-0);
  pointer-events: none;
  z-index: 1;
  user-select: none;
}
.wm-glyph {
  font-size: 40px;
  letter-spacing: var(--tracking-tight);
  display: block;
}
.wm-sub {
  font-size: var(--type-xs);
  letter-spacing: var(--tracking-sku);
  text-transform: uppercase;
  color: var(--u-fg-2);
  font-weight: 500;
  margin-top: var(--u-s-2);
  display: flex;
  gap: var(--u-s-3);
  align-items: center;
}
.wm-sub b {
  color: var(--u-accent);
  font-weight: 700;
}
.wm-sep {
  color: var(--u-fg-3);
}

/* Selection halo — accent 2 px outline + 4 corner ticks around the
   active iframe when an element is selected. Mirrors CV-02 .sel-halo.
   Outlines the iframe frame (the artboard), not the inner element —
   element-level overlay is Phase 4 territory. */
.sel-halo {
  position: absolute;
  inset: 0;
  border: 2px solid var(--u-accent);
  pointer-events: none;
  z-index: 5;
}
.sel-halo::before,
.sel-halo::after,
.sel-halo > i::before,
.sel-halo > i::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--u-accent);
}
.sel-halo::before { top: -3px; left: -3px; }
.sel-halo::after  { top: -3px; right: -3px; }
.sel-halo > i::before { bottom: -3px; left: -3px; }
.sel-halo > i::after  { bottom: -3px; right: -3px; }
}
