/* fyzx — 2026 visual system. All color via circadian custom props. */

*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
:root {
  --r: 16px; --r-sm: 11px; --r-pill: 999px;
  --ff: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Berkeley Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  background-color: var(--bg);
}
body {
  font-family: var(--ff);
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05" 1, "ss01" 1, "tnum" 1;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input { font: inherit; color: inherit; }
kbd {
  font-family: var(--mono); font-size: 10px; letter-spacing: .02em;
  padding: 2px 5px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-faint);
}

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

/* ---------- top bar ---------- */
.fz-top {
  height: 52px; flex: none; display: flex; align-items: center; gap: 18px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  z-index: 30;
}
.fz-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fz-logo {
  font-weight: 680; font-size: 17px; letter-spacing: -.03em;
  color: var(--text);
  /* it's a button now (click → the app's modes graph) — keep the wordmark look */
  background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer;
}
.fz-logo::after { content: "·"; margin-left: 12px; color: var(--text-faint); }
.fz-run-name {
  font-size: 13px; color: var(--text-dim); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}

/* run / app switcher */
.fz-run-switch {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 8px 0 10px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); transition: background .14s, border-color .14s;
}
.fz-run-switch:hover, .fz-run-switch.is-open { background: var(--surface-2); border-color: var(--hairline); }
.fz-run-switch svg { width: 15px; height: 15px; opacity: .6; transition: transform .16s; }
.fz-run-switch.is-open svg { transform: rotate(180deg); }
.fz-run-menu {
  position: absolute; top: calc(100% + 8px); left: 36px; z-index: 60;
  width: 290px; padding: 6px; border-radius: var(--r);
  background: var(--elev); border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}
.fz-run-menu-head {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); padding: 6px 10px 7px;
}
.fz-run-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 11px; transition: background .1s;
}
.fz-run-opt:hover { background: var(--surface-2); }
.fz-run-opt.is-active { background: var(--surface-2); }
.fz-run-opt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fz-run-opt-task { font-size: 13px; font-weight: 540; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-run-opt-meta { font-size: 11px; font-family: var(--mono); color: var(--text-faint); }
.fz-run-opt > svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.fz-surface-opt { text-decoration: none; }
.fz-surface-mark {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  font-size: 12px; font-family: var(--mono); color: var(--text-faint);
  border: 1px solid var(--hairline); border-radius: 7px; background: var(--surface-2);
}

.fz-search-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 13px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid transparent;
  color: var(--text-dim); font-size: 13px; min-width: 230px;
  transition: border-color .15s, background .15s;
}
.fz-search-trigger:hover { border-color: var(--accent-ring); background: var(--elev); }
.fz-search-trigger svg { width: 15px; height: 15px; opacity: .7; }
.fz-search-trigger span { flex: 1; text-align: left; }
.fz-search-trigger kbd { margin-left: auto; }

.fz-top-right { display: flex; align-items: center; gap: 14px; flex: none; }

/* Context inventory — the middle of the top bar, and the only place the app
   says what the chat can see. ONE row [user 2026-07-20: "every pixel matters"]:
   it scrolls sideways rather than wrapping, and fades at the right edge so a
   clipped chip reads as "more", not as a rendering bug. Replaced the four run
   counters that used to sit here — those were run state, not context. */
.fz-ctxbar {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent);
}
.fz-ctxbar::-webkit-scrollbar { display: none; }
.fz-ctx-empty { flex: none; font-size: 11.5px; color: var(--text-faint); }
.fz-ctx-sep { flex: none; width: 1px; height: 15px; background: var(--hairline); margin: 0 3px; }
.fz-ctx-chip {
  flex: none; display: flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid transparent;
  font-size: 11.5px; font-weight: 540; color: var(--text-dim);
  white-space: nowrap; max-width: 240px;
  transition: background .14s, border-color .14s, color .14s;
}
.fz-ctx-chip > svg { width: 13px; height: 13px; opacity: .6; flex: none; }
.fz-ctx-chip > span { overflow: hidden; text-overflow: ellipsis; }
.fz-ctx-chip em {
  font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
button.fz-ctx-chip:hover { border-color: var(--accent-ring); color: var(--text); }
/* Could-be-added: same row, dashed and quiet — an offer, not a fact. */
.fz-ctx-chip.is-dim { background: transparent; border: 1px dashed var(--hairline); color: var(--text-faint); }
button.fz-ctx-chip.is-dim:hover { border-style: solid; border-color: var(--accent-ring); color: var(--text-dim); }

/* account / passkey (top-right) — quiet pill like the run switch; the panel
   reuses .fz-run-menu, right-anchored so it stays on screen. */
.fz-auth { position: relative; }
.fz-auth-switch {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 540; color: var(--text-dim);
  transition: background .14s, border-color .14s;
}
.fz-auth-switch:hover, .fz-auth-switch.is-open { background: var(--surface-2); border-color: var(--hairline); }
.fz-auth-switch svg { width: 14px; height: 14px; opacity: .6; }
.fz-auth-menu { left: auto; right: 0; width: 252px; }
.fz-auth-input {
  width: 100%; height: 32px; padding: 0 10px; margin: 2px 0 6px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 13px; color: var(--text);
}
.fz-auth-input:focus { outline: none; border-color: var(--accent-ring); }
.fz-auth-input::placeholder { color: var(--text-faint); }
.fz-auth-id { display: flex; align-items: baseline; gap: 8px; padding: 2px 10px 8px; font-size: 13px; font-weight: 560; color: var(--text); }
.fz-auth-id em { font-style: normal; font-size: 10.5px; font-family: var(--mono); color: var(--text-faint); }
.fz-auth-error { padding: 6px 10px 2px; font-size: 11.5px; line-height: 1.45; color: var(--err); }
.fz-auth-hint { padding: 6px 10px 4px; font-size: 11px; color: var(--text-faint); }

.fz-seg { display: flex; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-pill); padding: 2px; gap: 2px; }
.fz-seg button {
  height: 28px; padding: 0 12px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600;
  letter-spacing: .03em; color: var(--text-faint); font-family: var(--mono);
}
.fz-seg button.is-active { background: var(--elev); color: var(--text); box-shadow: var(--shadow); }

/* ---------- body / split ---------- */
.fz-body { flex: 1; display: flex; min-height: 0; }
.fz-left { position: relative; min-width: 0; overflow: hidden; }
.fz-right { min-width: 320px; max-width: 620px; display: flex; }
.fz-split {
  flex: none; width: 11px; margin: 0 -5px; z-index: 20; cursor: col-resize;
  display: flex; align-items: center; justify-content: center;
}
.fz-split span { width: 1px; height: 100%; background: var(--hairline); transition: background .15s, width .15s; }
.fz-split:hover span { background: var(--accent); width: 2px; }

/* ---------- tree canvas ---------- */
.fz-canvas {
  position: absolute; inset: 0; overflow: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in oklch, var(--text) 8%, transparent) 1px, transparent 0);
  background-size: 26px 26px;
  cursor: grab;
  touch-action: none;
}
.fz-canvas:active { cursor: grabbing; }
.fz-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; }

.fz-links { position: absolute; top: 0; left: 0; pointer-events: none; }
/* edges are the agent's output, streaming from parent → child */
.fz-stream-track {
  fill: none; stroke: var(--text-faint); stroke-width: 1;
  opacity: .45; transition: opacity .25s, stroke .25s;
}
.fz-stream-text {
  font-family: var(--mono); font-size: 8px; letter-spacing: .01em;
  fill: var(--text-faint); opacity: .42;
  transition: fill .25s, opacity .25s;
}
.fz-edge.is-active .fz-stream-track { stroke: var(--accent); opacity: .55; }
.fz-edge.is-active .fz-stream-text { fill: var(--accent); opacity: 1; font-weight: 600; }
.fz-edge.is-live .fz-stream-track { stroke: var(--run); opacity: .42; }
.fz-edge.is-live .fz-stream-text { fill: var(--run); opacity: .72; }
.fz-edge.is-dim { opacity: .22; }

/* node = a status dot AT the edge-meeting point, with its label hanging off it.
   Dot carries status color; the word stays neutral & legible. */
.fz-node {
  position: absolute; cursor: pointer; user-select: none;
  transition: opacity .25s;
}
.fz-node:hover { z-index: 6; }
.fz-node.is-sel { z-index: 7; }
.fz-node.is-dim { opacity: .22; }

/* node = its NAME at the anchor where edges terminate. No dot — the name
   itself carries status via color. LR hangs the name to the right of the
   anchor; TB centers it on the anchor (centered hierarchy). */
.fz-lab { position: absolute; display: flex; flex-direction: column; align-items: flex-start; white-space: nowrap; left: 3px; top: 0; transform: translateY(-50%); }
.dir-TB .fz-lab { left: 0; transform: translate(-50%, -50%); align-items: center; text-align: center; }

.fz-cap {
  display: inline-block; max-width: 168px; overflow: hidden; text-overflow: ellipsis;
  vertical-align: middle; letter-spacing: -.006em;
  font-size: 12.5px; font-weight: 540; color: var(--text);
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 7px var(--bg), 0 1px 1px var(--bg);
  transition: color .15s;
}
/* kind → typographic treatment (agents read as headers, tools as code) */
.k-agent .fz-cap { font-size: 13.5px; font-weight: 650; letter-spacing: -.015em; }
.k-tool .fz-cap, .fz-arg { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
.fz-arg { color: var(--text-faint); font-style: normal; font-weight: 400; }
/* status → the name's color */
.s-done .fz-cap { color: var(--text); }
.s-running .fz-cap { color: var(--run); font-weight: 650; }
.s-queued .fz-cap { color: var(--text-faint); }
.s-error .fz-cap { color: var(--err); font-weight: 650; }

/* scale-matched imagery — the real micrograph/photo pinned at this depth */
.fz-thumb {
  width: 34px; height: 34px; object-fit: cover; border-radius: 6px;
  margin-bottom: 3px; border: 1px solid var(--line, rgba(128,128,128,.35));
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.fz-tip-img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 5px; }
.fz-tip-cap { font-family: var(--mono); font-size: 9.5px; line-height: 1.3; color: var(--text-faint); margin-bottom: 7px; }

/* per-node metric line (elapsed · tokens) — the density layer */
.fz-meta {
  font-family: var(--mono); font-size: 9.5px; font-weight: 400; line-height: 1.2;
  color: var(--text-faint); letter-spacing: .01em; margin-top: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 3px var(--bg), 0 0 6px var(--bg);
}
.s-running .fz-meta { color: var(--run); }
.s-error .fz-meta { color: var(--err); }

.fz-node:hover .fz-cap { color: var(--accent); }
.fz-node.is-sel .fz-cap {
  color: var(--accent); font-weight: 720;
  text-decoration: underline; text-decoration-color: var(--accent-ring);
  text-underline-offset: 3px; text-decoration-thickness: 2px;
}

.fz-chevron {
  position: absolute; opacity: 0; left: calc(100% + 6px); top: 50%; margin-top: -8px;
  width: 16px; height: 16px; display: grid; place-items: center;
  border-radius: 50%; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: background .15s, color .15s, border-color .15s, opacity .15s; z-index: 8;
}
.fz-node:hover .fz-chevron { opacity: 1; }
.fz-chevron:hover { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.fz-chevron.is-collapsed { transform: rotate(-90deg); }
.fz-count {
  position: absolute; opacity: 1; left: calc(100% + 6px); top: 50%; margin-top: -8px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--accent-ring);
  transition: opacity .12s; z-index: 7;
}
.fz-node:hover .fz-count { opacity: 0; }

.fz-canvas-hint {
  position: absolute; left: 14px; bottom: 12px; font-size: 11px; color: var(--text-faint);
  background: color-mix(in oklch, var(--surface) 70%, transparent); padding: 5px 12px;
  border-radius: var(--r-pill); pointer-events: none;
  letter-spacing: .01em;
}
.fz-canvas-controls {
  position: absolute; top: 14px; right: 14px; z-index: 20;
  display: flex; align-items: center; gap: 8px;
}

/* Artifacts — the session's outputs, side by side along the bottom of the
   visual (left) pane. The active one is the tree on canvas. */
.fz-artifacts {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px;
  display: flex; gap: 8px; max-width: min(84%, 720px); overflow-x: auto;
  padding: 4px; z-index: 20;
}
.fz-artifact {
  display: flex; align-items: center; gap: 7px; flex: 0 0 auto;
  padding: 5px 12px 5px 6px; border-radius: var(--r-pill); cursor: pointer;
  background: color-mix(in oklch, var(--surface) 82%, transparent);
  border: 1px solid var(--hairline); color: var(--text-dim);
  font-size: 12px; font-weight: 540; transition: border-color .12s, color .12s;
}
.fz-artifact:hover { border-color: var(--border); color: var(--text); }
.fz-artifact.is-active { border-color: var(--accent-ring); color: var(--text); background: var(--accent-soft); }
.fz-artifact img, .fz-artifact-ph {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  background: var(--surface-2); flex: 0 0 auto;
}
.fz-canvas-controls .fz-seg {
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}
.fz-reopen {
  position: absolute; right: 16px; bottom: 16px; width: 46px; height: 46px;
  border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.fz-reopen svg { width: 21px; height: 21px; }

/* ---------- tooltip ---------- */
.fz-tip {
  position: absolute; width: 248px; z-index: 25; pointer-events: none;
  background: color-mix(in oklch, var(--elev) 96%, transparent);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 11px 12px; box-shadow: var(--shadow);
  animation: fz-tip-in .14s ease;
}
@keyframes fz-tip-in { from { opacity: 0; transform: translateY(3px); } }
.fz-tip-head { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.fz-tip-meta { font-size: 11px; color: var(--text-faint); margin: 2px 0 7px 15px; text-transform: lowercase; }
.fz-tip-sum { font-size: 12px; line-height: 1.45; color: var(--text-dim); margin: 0 0 9px; text-wrap: pretty; }
.fz-tip-row { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.fz-tip-row b { color: var(--text-faint); font-weight: 500; }

/* ---------- right panel ---------- */
.fz-panel { display: flex; flex-direction: column; flex: 1; min-width: 0; border-left: 1px solid var(--hairline); background: var(--surface); }
.fz-panel-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fz-panel-head {
  height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid var(--hairline);
}
.fz-icon-btn { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--text-faint); transition: background .15s, color .15s; }
.fz-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.fz-panel-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.fz-mode-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.fz-panel-ctx { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); }
.fz-status { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--text-faint); }
.fz-status.s-done { background: var(--ok); }
.fz-status.s-running { background: var(--run); }
.fz-status.s-queued { background: var(--queued); }
.fz-status.s-error { background: var(--err); }
.fz-panel-ctx .fz-status { width: 6px; height: 6px; }

.fz-panel-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
@keyframes fz-fade { from { opacity: 0; } }

/* chat */
.fz-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.fz-msgs { flex: 1; overflow-y: auto; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 16px; }
.fz-ctx {
  align-self: flex-start; font-size: 11px; font-family: var(--mono); color: var(--text-faint);
  background: var(--surface-2); border: 1px solid transparent; padding: 5px 12px; border-radius: var(--r-pill);
}
.fz-msg.r-user { align-self: flex-end; max-width: 86%; }
.fz-msg.r-ai { align-self: flex-start; max-width: 92%; }
.fz-msg-role { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 4px; font-weight: 600; }
.fz-msg.r-user .fz-msg-role { text-align: right; }
.fz-msg p { margin: 0; font-size: 13.5px; line-height: 1.55; text-wrap: pretty; }
.fz-msg.r-user p { background: var(--accent); color: var(--accent-text); padding: 10px 15px; border-radius: 18px 18px 7px 18px; }
.fz-msg.r-ai p { color: var(--text); }
.fz-msg-model { text-transform: none; letter-spacing: 0; font-weight: 400; }
/* live reasoning stream — dim, mono, bounded; open while streaming, collapsible after */
.fz-think { margin: 0 0 6px; border-left: 2px solid var(--hairline); padding-left: 10px; }
.fz-think summary {
  cursor: pointer; list-style: none; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint); font-weight: 600; user-select: none;
}
.fz-think summary::-webkit-details-marker { display: none; }
.fz-think pre {
  margin: 4px 0 0; max-height: 180px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--text-faint);
}
.fz-compose { flex: none; padding: 12px 14px 14px; border-top: 1px solid var(--hairline); display: flex; gap: 8px; }
.fz-compose input {
  flex: 1; height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid transparent; outline: none; font-size: 13.5px;
  transition: border-color .15s;
}
.fz-compose input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fz-compose button { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; transition: filter .15s; }
.fz-compose button:hover { filter: brightness(1.08); }

/* shell */
.fz-shell { flex: 1; display: flex; flex-direction: column; min-height: 0; background: color-mix(in oklch, var(--bg) 70%, var(--surface)); }
.fz-term { flex: 1; overflow-y: auto; padding: 14px 15px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; }
.fz-term-meta { color: var(--text-faint); }
.fz-term-sep { height: 1px; background: var(--hairline); margin: 8px 0; }
.fz-term-cmd { color: var(--text); margin-top: 4px; }
.fz-term-out { color: var(--text-dim); white-space: pre-wrap; }
.fz-term-ok { color: var(--ok); }
.fz-term-err { color: var(--err); white-space: pre-wrap; }
.fz-prompt { color: var(--accent); font-weight: 700; }
.fz-cmdline { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 15px; border-top: 1px solid var(--hairline); font-family: var(--mono); }
.fz-cmdline input { flex: 1; background: none; border: none; outline: none; font-size: 12.5px; }

/* inspector */
.fz-inspect { flex: 1; overflow-y: auto; padding: 16px; }
.fz-inspect-sum { font-size: 13px; line-height: 1.55; color: var(--text-dim); margin: 0 0 16px; text-wrap: pretty; }
.fz-kv { display: flex; flex-direction: column; }
.fz-kv-row { display: flex; justify-content: space-between; padding: 10px 2px; font-size: 12.5px; border-bottom: 1px solid var(--hairline); }
.fz-kv-row:last-child { border-bottom: none; }
.fz-kv-row span { color: var(--text-faint); font-family: var(--mono); }
.fz-kv-row b { font-weight: 560; font-family: var(--mono); }
.fz-stat-text.s-done { color: var(--ok); } .fz-stat-text.s-running { color: var(--run); }
.fz-stat-text.s-queued { color: var(--text-dim); } .fz-stat-text.s-error { color: var(--err); }
.fz-rel { margin-top: 16px; }
.fz-rel-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 7px; font-weight: 600; }
.fz-rel-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 11px; font-size: 13px; transition: background .12s; margin-bottom: 2px; }
.fz-rel-item:hover { background: var(--surface-2); }
.fz-rel-item em { color: var(--text-faint); font-family: var(--mono); font-style: normal; font-size: 12px; }

/* history */
.fz-history { flex: 1; overflow-y: auto; padding: 12px; }
.fz-hist { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px 11px; border-radius: 11px; transition: background .12s; }
.fz-hist:hover { background: var(--surface-2); }
.fz-hist-time { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.fz-hist-x { font-size: 13px; color: var(--text-dim); }

/* search palette */
.fz-search-scrim {
  position: fixed; inset: 0; z-index: 60; background: color-mix(in oklch, var(--bg) 50%, transparent);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 13vh;
  animation: fz-fade .12s ease;
}
.fz-search {
  width: min(560px, 92vw); background: var(--elev); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
  animation: fz-pop .16s cubic-bezier(.2,.8,.3,1);
}
@keyframes fz-pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.fz-search-bar { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--hairline); }
.fz-search-bar svg { width: 17px; height: 17px; color: var(--text-faint); }
.fz-search-bar input { flex: 1; background: none; border: none; outline: none; font-size: 15px; }
.fz-search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.fz-search-empty { padding: 22px 14px; text-align: center; color: var(--text-faint); font-size: 13px; }
.fz-search-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 11px; border-radius: 11px; transition: background .1s; }
.fz-search-item:hover { background: var(--surface-2); }
.fz-search-label { font-size: 13.5px; font-weight: 500; flex: 1; }
.fz-search-label em { color: var(--text-faint); font-family: var(--mono); font-style: normal; font-size: 12px; }
.fz-search-kind { font-size: 11px; color: var(--text-faint); font-family: var(--mono); }
/* ⌘K is where everything that is not an altitude lives now. */
.fz-cmd-kind { flex: none; width: 54px; font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); }
.fz-search-sep { height: 1px; margin: 7px 6px; background: var(--hairline); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* motion off — kill decorative animation/transition (theme transition kept off too) */
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation-duration: 0s !important; animation-delay: 0s !important;
  transition-duration: 0s !important; transition-delay: 0s !important;
}

/* ---------- top: camera / visual input (centered) ---------- */
.fz-top { position: relative; }
.fz-visual { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 7px; z-index: 31; }
.fz-visual-btn {
  display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 16px 0 13px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid transparent;
  color: var(--text-dim); font-size: 13px; font-weight: 500; transition: background .15s, color .15s, border-color .15s;
}
.fz-visual-btn:hover { border-color: var(--hairline); color: var(--text); }
.fz-visual-btn svg { width: 17px; height: 17px; }
.fz-visual-btn.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring); }
.fz-visual-feed {
  width: 240px; height: 116px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--accent-ring);
  display: grid; place-items: center; box-shadow: var(--shadow);
  overflow: hidden;
}
.fz-visual-feed video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.fz-visual-feed span { position: absolute; font-family: var(--mono); font-size: 11px; color: var(--text-faint); letter-spacing: .04em; }

/* ---------- right panel: inspect toggle ---------- */
.fz-inspect-toggle {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 560; color: var(--text-faint);
  border: 1px solid var(--hairline); transition: background .15s, color .15s, border-color .15s;
}
.fz-inspect-toggle svg { width: 15px; height: 15px; }
.fz-inspect-toggle:hover { color: var(--text); background: var(--surface-2); }
.fz-inspect-toggle.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring); }

/* ---------- central bottom dock: voice / text input ---------- */
.fz-dock { flex: none; border-top: 1px solid var(--hairline); background: var(--surface); padding: 14px 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.fz-dock-note { font-size: 11px; color: var(--text-faint); letter-spacing: .01em; }
.fz-dock-inner { width: min(720px, 100%); display: flex; align-items: center; gap: 10px; }
/* The one input says out loud which rung it is aimed at, and teaches the key. */
.fz-dock-aim { flex: none; display: flex; align-items: baseline; gap: 6px; height: 34px; padding: 0 11px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--hairline); transition: border-color .15s; }
.fz-dock-aim:hover { border-color: var(--accent-ring); }
.fz-dock-aim-key { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.fz-dock-aim-name { font-size: 12px; color: var(--text-dim); }
.fz-dock-mic, .fz-dock-send { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; transition: background .15s, color .15s, filter .15s; }
.fz-dock-mic { background: var(--surface-2); color: var(--text-dim); }
.fz-dock-mic:hover { color: var(--text); }
.fz-dock-mic.is-on { background: var(--err); color: #fff; animation: fz-listen 1.4s ease-in-out infinite; }
@keyframes fz-listen { 0%,100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--err) 45%, transparent); } 60% { box-shadow: 0 0 0 7px transparent; } }
.fz-dock-mic svg, .fz-dock-send svg { width: 20px; height: 20px; }
.fz-dock-input {
  flex: 1; height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid transparent; outline: none; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.fz-dock-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fz-dock-send { background: var(--accent); color: var(--accent-text); }
.fz-dock-send:hover { filter: brightness(1.08); }
.fz-dock-input:disabled, .fz-dock-send:disabled { opacity: .55; cursor: default; }
.fz-dock-inner.is-busy { opacity: .9; }

/* ---------- load / empty / error overlay over the tree canvas ---------- */
.fz-load-overlay {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  pointer-events: none; padding: 24px;
  background: color-mix(in oklch, var(--bg) 62%, transparent);
  animation: fz-fade .18s ease;
}
.fz-load-overlay.is-empty { background: transparent; }
.fz-load-card {
  pointer-events: auto; max-width: 380px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 26px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--hairline);
  box-shadow: 0 8px 30px color-mix(in oklch, var(--text) 14%, transparent);
  color: var(--text); font-size: 14px; line-height: 1.5;
}
.fz-load-card b { font-size: 15px; font-weight: 680; }
.fz-load-card span { color: var(--text-dim); }
.fz-load-overlay.is-error .fz-load-card b { color: var(--err); }
.fz-load-hint { font-size: 12.5px; }
.fz-load-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--accent-ring); border-top-color: var(--accent);
  animation: fz-spin .8s linear infinite;
}
@keyframes fz-spin { to { transform: rotate(360deg); } }

/* ============================ v2 workspace ============================ */
.fz-body { padding-right: 46px; }              /* clear the fixed far-right rail */

.fz-ws { display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%;
  border-left: 1px solid var(--hairline); background: var(--surface); }
.fz-ws-head { flex: none; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 8px; border-bottom: 1px solid var(--hairline); }
.fz-ws-ctx { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); font-weight: 540; }
.fz-ws-ctx .fz-status { width: 7px; height: 7px; }
/* The shell's reported cwd (OSC 7) — the language pane's directory context. */
.fz-ws-cwd {
  margin-left: auto; font-family: "Berkeley Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 11px; color: var(--text-faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 45%;
}

/* Input sources — one row directly above the dock, and only while one is on.
   They used to be a resident tool strip inside the right column; every button
   in it already had a live duplicate in the top context bar or the rail. */
.fz-sources { width: min(720px, 100%); display: flex; flex-direction: column; gap: 8px; padding-bottom: 4px; }
.fz-source { position: relative; display: flex; flex-direction: column; gap: 6px; }
.fz-source-off { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--hairline); color: var(--text-faint); }
.fz-source-off:hover { color: var(--text); }
.fz-source-off svg { width: 13px; height: 13px; }
.fz-source-link .fz-source-off, .fz-source .fz-source-btn + .fz-source-off { position: static; flex: none; }
.fz-source-video video { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--r-sm); background: #000; }
.fz-source-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px dashed var(--border); color: var(--text-dim); font-size: 12.5px; text-align: left; }
.fz-source-btn:hover:not(:disabled) { border-color: var(--accent-ring); color: var(--text); }
.fz-source-btn:disabled { opacity: .6; cursor: default; }
.fz-source-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 7px; }
.fz-source-link { flex-direction: row; align-items: center; gap: 6px; }
.fz-source-link input { flex: 1; height: 36px; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--hairline); font-size: 13px; }
.fz-source-link input:focus { outline: none; border-color: var(--accent-ring); }
.fz-source-go { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent); color: var(--accent-text, #fff); }
.fz-source-go svg { width: 17px; height: 17px; }
.fz-source-err { font-size: 11.5px; color: var(--err); font-family: var(--mono); }

/* The altitude strip — the ONE strip in this column, and the only navigation
   in it. Rungs are levels, never siblings: what used to be chat|shell|mail here
   is now ⌘K, and what used to be extra meta COLUMNS is now rungs 2..N. */
.fz-levels { flex: none; display: flex; align-items: center; gap: 2px; padding: 7px 8px 0; }
.fz-levels-spacer { flex: 1; }
.fz-level { display: flex; align-items: baseline; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px 8px 0 0;
  font-size: 12.5px; font-weight: 560; color: var(--text-faint); transition: color .14s, background .14s; }
.fz-level:hover { color: var(--text-dim); }
.fz-level.is-active { color: var(--text); background: var(--surface-2); }
.fz-level-n { font-family: var(--mono); font-size: 11px; opacity: .55; }
.fz-level.is-active .fz-level-n { opacity: 1; color: var(--accent); }
.fz-level-add { width: 26px; height: 30px; border-radius: 8px; font-size: 15px; line-height: 1; color: var(--text-faint); }
.fz-level-add:hover { color: var(--text); background: var(--surface-2); }
.fz-ws-view { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface-2); }

/* Rung 0 — the object in the left pane, said in words. */
.fz-ground { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.fz-ground-subject { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.fz-ground-empty { color: var(--text-faint); font-size: 13px; }
.fz-ground-facts { display: flex; flex-direction: column; gap: 7px; margin: 0; }
.fz-ground-facts > div { display: flex; gap: 12px; font-size: 12.5px; }
.fz-ground-facts dt { width: 62px; flex: none; color: var(--text-faint); }
.fz-ground-facts dd { margin: 0; color: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.fz-ground-hint { margin: 0; font-size: 12px; line-height: 1.55; color: var(--text-faint); }
.fz-ground-hint kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--hairline); }

/* chat */
.fz-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fz-ctx-err { color: var(--err); }
.fz-typing { display: flex; gap: 4px; align-items: center; }
.fz-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: fz-blink 1.2s infinite; }
.fz-typing i:nth-child(2) { animation-delay: .2s; } .fz-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes fz-blink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

/* shell terminal — ShellView removed with it (shell tab is the real pty now);
   only the status dot + auth prompt styles survive below. */

/* ---------- far-right rail + slide-overs ---------- */
.fz-rail { position: fixed; top: 52px; right: 0; bottom: 0; width: 46px; z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0;
  background: var(--surface); border-left: 1px solid var(--hairline); }
.fz-rail-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-faint); transition: background .14s, color .14s; }
.fz-rail-btn:hover { background: var(--surface-2); color: var(--text); }
.fz-rail-btn.is-active { background: var(--accent); color: var(--accent-text, #fff); }
.fz-rail-btn svg { width: 19px; height: 19px; }

/* app menu bar (the surfaces) */
.fz-rail-apps { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.fz-rail-app {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-faint); text-decoration: none; border: 1px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.fz-rail-app:hover { background: var(--surface-2); color: var(--text); }
.fz-rail-app.is-here { background: var(--surface-2); color: var(--text); border-color: var(--accent-ring); }
.fz-rail-mark { font-family: var(--mono); font-size: 12px; line-height: 1; letter-spacing: -.02em; }
.fz-rail-sep { width: 22px; height: 1px; background: var(--hairline); margin: 6px 0; flex: none; }

/* ---------- terminal surface (right pane) ---------- */
.fz-surface-app { display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; border-left: 1px solid var(--hairline); background: var(--surface); }
.fz-xterm { flex: 1; min-height: 0; position: relative; background: #0b0b0d; padding: 8px 6px 6px 10px; overflow: hidden; }
.fz-xterm .xterm { height: 100%; }
.fz-xterm-status { position: absolute; left: 12px; bottom: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); pointer-events: none; }
.fz-term-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-faint); }
.fz-term-dot.s-connected { background: var(--ok); }
.fz-term-dot.s-connecting { background: var(--queued); }
.fz-term-dot.s-disconnected, .fz-term-dot.s-error { background: var(--err); }
/* terminal splitter — stacked panes, one session each, draggable dividers */
.fz-term-split { display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; }
.fz-term-pane { display: flex; min-height: 0; overflow: hidden; }
.fz-term-pane .fz-surface-app { height: 100%; }
.fz-term-pane .fz-ws-cwd { margin-left: 0; }        /* the actions take the right edge instead */
.fz-term-split .fz-ws-head { height: 34px; }        /* four 46px headers would eat the pane */
.fz-term-acts { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.fz-term-divider {
  flex: none; height: 11px; margin: -5px 0; z-index: 20; cursor: row-resize;
  display: flex; align-items: center; justify-content: center;
}
.fz-term-divider span { height: 1px; width: 100%; background: var(--hairline); transition: background .15s, height .15s; }
.fz-term-divider:hover span { background: var(--accent); height: 2px; }

.fz-term-auth { flex: none; padding: 12px 14px; border-top: 1px solid var(--hairline); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.fz-term-auth-msg { font-size: 12px; color: var(--text-dim); }
.fz-term-auth-row { display: flex; gap: 6px; }
.fz-term-auth-row input { flex: 1; height: 34px; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--hairline); font-size: 13px; font-family: var(--mono); }
.fz-term-auth-row input:focus { outline: none; border-color: var(--accent-ring); }

.fz-slide { position: fixed; top: 52px; right: 46px; bottom: 0; width: 330px; z-index: 45;
  display: flex; flex-direction: column; background: var(--elev); border-left: 1px solid var(--hairline); box-shadow: var(--shadow);
  animation: fz-slidein .18s ease; }
@keyframes fz-slidein { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.fz-slide-head { flex: none; height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 16px; border-bottom: 1px solid var(--hairline); font-size: 13px; font-weight: 600; }
.fz-slide-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.fz-slide-empty { padding: 22px 12px; text-align: center; font-size: 12.5px; color: var(--text-faint); }
.fz-slide-add { display: flex; gap: 6px; padding: 4px 4px 8px; }
.fz-slide-add input { flex: 1; height: 36px; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--hairline); font-size: 13px; }
.fz-slide-add input:focus { outline: none; border-color: var(--accent-ring); }
.fz-slide-add button { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent); color: var(--accent-text, #fff); }
.fz-slide-add button svg { width: 17px; height: 17px; }
.fz-slide-item { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: var(--r-sm); text-decoration: none; color: inherit; text-align: left; width: 100%; }
.fz-slide-item + .fz-slide-item { }
.fz-slide-btn:hover, .fz-slide-link:hover { background: var(--surface-2); }
.fz-slide-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fz-slide-item-title { font-size: 13px; font-weight: 540; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-slide-item-meta { font-size: 11px; font-family: var(--mono); color: var(--text-faint); }

/* ---------- subject hero (in-world, anchored to the root node) ---------- */
.fz-world-subject {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.dir-LR .fz-world-subject { transform: translate(-100%, -50%); }
.fz-world-subject-name { font-size: 13px; color: var(--text-dim); letter-spacing: -.01em; }
.fz-world-subject img {
  width: 132px; height: 132px; object-fit: contain;
  filter: drop-shadow(0 8px 22px color-mix(in oklch, var(--text) 22%, transparent));
  animation: fz-subject-in .32s ease;
}
@keyframes fz-subject-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; } }
.fz-qty {
  position: absolute; left: 14px; bottom: 40px; z-index: 20;
  height: 28px; padding: 0 13px; border-radius: var(--r-pill); font-size: 11.5px; letter-spacing: .01em;
  color: var(--text-faint); background: color-mix(in oklch, var(--surface) 70%, transparent);
  border: 1px solid transparent; transition: color .14s, background .14s, border-color .14s;
}
.fz-qty:hover { color: var(--text-dim); border-color: var(--hairline); }
.fz-qty.is-on { color: var(--accent); background: var(--surface); border-color: var(--accent-ring); box-shadow: var(--shadow); }
/* ---------- email mode (chat-ladder rung 1) ---------- */
.fz-mail { display: flex; flex-direction: column; gap: 14px; padding: 14px; overflow-y: auto; height: 100%; }
.fz-mail-compose { display: flex; flex-direction: column; gap: 8px; }
.fz-mail-compose input, .fz-mail-compose textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--ff); font-size: 13px; resize: vertical;
}
.fz-mail-compose input:focus, .fz-mail-compose textarea:focus { outline: none; border-color: var(--accent-ring); }
.fz-mail-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.fz-mail-notice { font-size: 12px; color: var(--text-dim); }
.fz-mail-notice.is-ok { color: var(--accent); }
.fz-mail-notice.is-err { color: #c0524d; }
.fz-mail-send {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-ring); font-size: 13px; font-weight: 600;
}
.fz-mail-send:disabled { opacity: .45; }
.fz-mail-send svg { width: 15px; height: 15px; }
.fz-mail-inbox { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.fz-mail-inbox-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .05em;
}
.fz-mail-item { padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.fz-mail-item-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-dim); }
.fz-mail-item-top b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fz-mail-item-top span { flex-shrink: 0; font-size: 11px; color: var(--text-faint); }
.fz-mail-item-subj { font-size: 13px; color: var(--text); margin-top: 2px; }
.fz-mail-empty { font-size: 13px; color: var(--text-faint); padding: 8px 2px; }
.fz-mail-setup { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-dim); }
.fz-mail-setup b { color: var(--text); }
.fz-mail-setup code {
  display: block; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; overflow-x: auto; white-space: nowrap;
}

/* ---------- DIFFUZOOM: the descent (web/DIFFUZOOM.md) ----------
   The pane is a single frame plus a rung rail. Every mark that says an image is
   ESTIMATED is ACHROMATIC on purpose: colourised electron micrographs are an
   established publishing convention meaning "real image, prettified", so a
   tinted badge would read as *photograph, tidied up* to the one audience that
   matters. Dashed border + burned footer, no chroma. Real anchors are
   undecorated — a science app owes evidence that. */
.dz { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.dz-head {
  flex: none; display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px;
  border-bottom: 1px solid var(--hairline); background: var(--surface);
}
.dz-exit {
  height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--text-dim); font-size: 12px;
}
.dz-exit:hover { color: var(--text); border-color: var(--border); }
.dz-title { font-size: 13px; color: var(--text-dim); }
.dz-title b { color: var(--text); font-weight: 620; }
.dz-readout { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-left: auto; }
.dz-readout b { color: var(--text); font-weight: 600; }
.dz-count { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.dz-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; gap: 8px; }
.dz-frame {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border);
}
.dz-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #0b0b0c; }
.dz-canvas { flex: 1; min-height: 0; width: 100%; touch-action: none; cursor: grab; }
.dz-frame-mol { background: var(--surface-2); }
/* An estimated frame never appears without its border and its footer. */
.dz-frame-est { border: 4px dashed rgba(150,150,150,.75); }
.dz-foot {
  flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px; font-size: 11.5px; color: var(--text-dim);
  background: var(--surface); border-top: 1px solid var(--hairline);
}
.dz-foot-est { background: #1a1a1b; color: #d8d8d8; border-top: 1px solid #2c2c2e; }
.dz-foot-est a, .dz-foot-est .dz-dim { color: #a9a9ac; }
.dz-foot a { color: inherit; text-decoration: underline; text-decoration-style: dotted; }
.dz-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.dz-tag.t-real { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.dz-tag.t-est { background: #d8d8d8; color: #17171a; }
.dz-tag.t-render { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.dz-dim { color: var(--text-faint); }
.dz-warn { color: var(--err); }
.dz-loading { padding: 14px; font-size: 12px; color: var(--text-faint); font-family: var(--mono); }
.dz-also { flex: none; font-size: 11px; color: var(--text-faint); }

.dz-card {
  flex: 1; min-height: 0; overflow: auto; padding: 18px;
  border-radius: var(--r-sm); background: var(--surface-2);
  border: 1px dashed var(--border); font-size: 13px; color: var(--text-dim);
}
.dz-card b { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }
.dz-card p { margin: 0 0 8px; }
.dz-card ul { margin: 0; padding-left: 18px; }
.dz-card li { margin-bottom: 4px; }
.dz-card-unavail { border-color: var(--err); }
.dz-spec { margin-top: 10px; }
.dz-spec pre {
  max-height: 220px; overflow: auto; font-family: var(--mono); font-size: 10.5px;
  background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 8px;
}
.dz-neighbours { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dz-neighbours button {
  height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--hairline);
  font-size: 11.5px; color: var(--text-dim);
}
.dz-neighbours button:hover { color: var(--text); border-color: var(--border); }

.dz-rail { flex: none; display: flex; gap: 2px; padding: 0 14px 6px; overflow-x: auto; }
.dz-rung {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px; border-radius: 6px; font-family: var(--mono); font-size: 9.5px;
  color: var(--text-faint); background: none; border: 1px solid transparent;
}
.dz-rung i { display: block; width: 100%; height: 5px; border-radius: 2px; background: var(--border); }
.dz-rung.k-photo i { background: var(--ok); }
.dz-rung.k-estimated i { background: #b9b9bd; }
.dz-rung.k-unavailable i { background: var(--err); }
.dz-rung.k-molecule i { background: var(--accent); }
.dz-rung.is-refused i { background: repeating-linear-gradient(45deg, var(--border) 0 3px, transparent 3px 6px); }
.dz-rung.is-at { color: var(--text); border-color: var(--border); background: var(--surface-2); }
.dz-hint { flex: none; padding: 0 14px 10px; font-size: 11px; color: var(--text-faint); }

/* ---------- result card: what just happened, where you are looking ----------
   Fed by the `result` event on the ui-live channel, rendered straight from the
   payload (no refetch, no reload) [user 2026-07-25]. */
.fz-result {
  position: absolute; left: 14px; bottom: 14px; z-index: 24; width: min(420px, calc(100% - 28px));
  display: flex; flex-direction: column; gap: 7px; padding: 11px 12px;
  border-radius: var(--r-sm); background: var(--elev); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 12.5px; color: var(--text-dim);
}
.fz-result.s-unavailable { border-color: var(--err); }
.fz-result-head { display: flex; align-items: center; gap: 8px; }
.fz-result-kind { font-weight: 640; color: var(--text); }
.fz-result-status {
  font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--text-faint); margin-right: auto;
}
.fz-result.s-unavailable .fz-result-status { color: var(--err); border-color: var(--err); }
.fz-result-sum { color: var(--text); }
.fz-result-img { width: 100%; max-height: 180px; object-fit: contain; border-radius: var(--r-sm); background: #0b0b0c; }
.fz-result-why { margin: 0; padding-left: 16px; font-size: 11.5px; color: var(--text-faint); }
.fz-result-out {
  margin: 0; max-height: 120px; overflow: auto; font-family: var(--mono); font-size: 10.5px;
  color: var(--text-faint); background: var(--bg); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 7px;
}
.fz-result-open {
  align-self: flex-start; height: 26px; padding: 0 11px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-ring);
  font-size: 12px; font-weight: 600;
}
