  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #21262d;                   /* hover/raised surface */
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --text-secondary: #8b949e;  /* alias for --text-muted; legacy var name still in use */
    /* Muted slate-blue per the Omnara look — the previous #58a6ff was a
       full-saturation github-blue that made every pill / "+ New session"
       button / IN GROUP CHAT label / active-state badge in the sidebar
       read as a bright spotlight. The new value is the same hue family
       but desaturated and one step darker so it still reads as "the
       accent" without dominating the page. */
    --accent: #6e8caf;
    --green: #3fb950;
    --orange: #d29922;
    --purple: #bc8cff;
    --orch-chip-text: #d8beff;
    --red: #f85149;
    --cyan: #39d2c0;
    --cb-bg: #0b1016;
    --cb-head-bg: rgba(255,255,255,0.035);
    --cb-border: #26313f;
    --cb-text: #d6deeb;
    --cb-muted: #9aa7b5;
    --accent-contrast: #ffffff;     /* readable text/icon color on var(--accent) */
    /* Engine identity colors must contrast with the current theme surfaces. */
    --engine-claude: #f09a78;
    --engine-codex: #3dd68c;
    --engine-gemini: #c084fc;
    --engine-cursor: #f08a6b;
    --engine-antigravity: #f2cc60;
    --engine-hermes: #2dd4bf;
    --engine-kimi: #7dd3fc;
    --engine-copilot: #56d364;
    --engine-grok: #f472b6;
    --engine-copilotchat: #818cf8;
    --engine-devin: #8b5cf6;
    --engine-opencode: #fb923c;
    --status-rail-width: 260px;
    /* Inter primary, system stack fallback. Inter is loaded from Google Fonts
       in index.html with `display=swap`, so the system font paints first and
       Inter takes over once it's fetched. The Omnara-style geometric look
       (Linear, Notion, Vercel) comes from Inter — apply it everywhere, not
       just in the standalone PWA window. */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  }
  :root[data-theme="light"] {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --surface-2: #eaeef2;
    --border: #d0d7de;
    --text: #1f2328;
    --text-muted: #57606a;
    --text-secondary: #57606a;
    --accent: #0969da;
    --green: #1a7f37;
    --orange: #9a6700;
    --purple: #8250df;
    --orch-chip-text: #6639a6;
    --red: #cf222e;
    --cyan: #0e7490;
    --engine-claude: #a34221;
    --engine-codex: #096b3b;
    --engine-gemini: #7541b0;
    --engine-cursor: #a63c1b;
    --engine-antigravity: #805b00;
    --engine-hermes: #0b7165;
    --engine-kimi: #096789;
    --engine-copilot: #236e2b;
    --engine-grok: #a12868;
    --engine-copilotchat: #454eb0;
    --engine-devin: #6c3bd1;
    --engine-opencode: #a34b00;
  }
  :root[data-font="mono"] {
    --font-ui: 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: var(--font-ui);
    /* Inter-specific OpenType features. These are no-ops for the system
       fallback stack but make Inter look the way it's supposed to —
       contextual alternates, kerning, ligatures, and the stylistic set
       that gives the round dotted-circle 'i' and tighter letter shapes. */
    font-feature-settings: "kern", "liga", "calt", "ss01";
    /* Inter at 13–15px reads slightly looser than SF Pro; pull it in
       by half a hair to match the Omnara-style density. */
    letter-spacing: -0.005em;
    background: var(--bg); color: var(--text);
    /* `--app-vh` is set from `visualViewport.height` on touch devices so the
       fixed app shell tracks the *visual* viewport — when the iOS keyboard
       opens, the shell shrinks and the bottom composer stays visible above
       it. Desktop and non-touch devices never set the var and fall back to
       `100vh`. */
    display: flex; height: var(--app-vh, 100vh); overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern", "liga", "calt";
  }
  /* Keyboard-nav focus ring — only shown when focusing via keyboard */
  body.hide-gh-issues .is-github-issue {
    display: none !important;
  }
  [hidden] {
    display: none !important;
  }
  :focus { outline: none; }
  button:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible,
  .kanban-card:focus-visible,
  .conv-item:focus-visible,
  .tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Sidebar */
  .sidebar {
    width: 380px; min-width: 240px; max-width: calc(100vw - 200px);
    background: var(--surface);
    display: flex; flex-direction: column; overflow: hidden;
    flex-shrink: 0;
    container-type: inline-size; container-name: sidebar;
  }
  .sidebar-resizer {
    width: 6px; cursor: col-resize; flex-shrink: 0;
    background: var(--border);
    transition: background 0.15s;
    position: relative;
  }
  .sidebar-resizer:hover,
  .sidebar-resizer.dragging {
    background: var(--accent);
  }
  .sidebar-resizer::before {
    content: ''; position: absolute;
    left: -4px; right: -4px; top: 0; bottom: 0;
  }
  body.resizing { cursor: col-resize; user-select: none; }
  body.resizing * { pointer-events: none; }
  /* Conversation-list collapse (CCC-132). The « button beside the divider hides
     the whole list/sidebar so the reader gets full width; a floating »
     restore button brings it back. Desktop only — on mobile the list IS the
     screen (handled by the mobile @media block), so these rules are scoped to
     wide viewports. */
  .conv-list-collapse-btn {
    flex: 0 0 auto;
    width: 30px; height: 30px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-muted); font-size: 15px; line-height: 1; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .conv-list-collapse-btn:hover { background: var(--surface-2, rgba(255,255,255,0.04)); color: var(--text); border-color: var(--accent); }
  .conv-list-restore {
    display: none;
    /* The CCC app-rail (static/app-rail.js) is `position:fixed; left:0;
       z-index:1000` and shifts normal-flow content over via
       `body{padding-left:var(--ccc-rail-w)}` — but this button is
       fixed-positioned so it never inherits that padding, and its old
       z-index:950 lost to the rail's 1000. It rendered directly under the
       rail: invisible and unclickable, with the sidebar stuck collapsed and
       no way back (CCC-918 follow-up). Offset past the rail and outrank it. */
    position: fixed; top: 12px; left: calc(var(--ccc-rail-w, 76px) + 8px); z-index: 1001;
    width: 28px; height: 40px; padding: 0;
    align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 0 8px 8px 0;
    color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer;
    box-shadow: 1px 0 6px rgba(0,0,0,0.25);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .conv-list-restore:hover { background: var(--surface-2, rgba(255,255,255,0.06)); color: var(--text); border-color: var(--accent); }
  @media (min-width: 1201px) {
    body.conv-list-collapsed .sidebar,
    body.conv-list-collapsed .sidebar-resizer { display: none !important; }
    body.conv-list-collapsed .conv-list-restore { display: inline-flex; }
  }
  /* On mobile the conv list is full-screen; never hide it via this toggle,
     and hide both affordances (the mobile back/forward nav owns that flow).
     Must be the exact complement of the block above (1201px vs 1200px) —
     a gap between the two thresholds let a collapsed sidebar (hidden by
     the block above) land in a width range where the restore button was
     ALSO force-hidden by this block, with no affordance left to reopen it
     (CCC-918). */
  @media (max-width: 1200px) {
    .conv-list-collapse-btn, .conv-list-restore { display: none !important; }
  }
  .sidebar-header {
    padding: 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
  }
  .sidebar-header .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
  .sidebar-header-brand {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 2px; min-width: 0;
  }
  .sidebar-header-brand .sh-title-row {
    display: flex; align-items: center; gap: 8px;
    min-width: 0;
  }
  .sidebar-header-brand .sh-app-icon {
    width: 26px; height: 26px;
    border-radius: 6px;
    flex-shrink: 0;
    display: block;
  }
  .sidebar-header-brand .sh-title-link {
    color: inherit; text-decoration: none;
    line-height: 1.2;
  }
  .sidebar-header-brand .sh-version {
    font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
    color: var(--text-muted);
    line-height: 1.2;
  }
  .sidebar-header-brand .sh-version:empty { display: none; }
  /* Paper-plane share affordance. Pushed to the right edge of the title
     row (margin-left: auto) rather than sitting tight against the version
     number, so it reads as a header-level action, not part of the title. */
  .sidebar-header-brand .sh-share-btn,
  .sidebar-header-brand .sh-discord-btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0;
    background: transparent; border: 0; border-radius: 6px;
    color: var(--text-muted); cursor: pointer; text-decoration: none;
    opacity: 0.65; transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
  }
  .sidebar-header-brand .sh-share-btn {
    margin-left: auto;
  }
  .sidebar-header-brand .sh-discord-btn {
    margin-left: 2px;
  }
  .sidebar-header-brand .sh-share-btn:hover,
  .sidebar-header-brand .sh-discord-btn:hover {
    opacity: 1; color: var(--text); background: rgba(255, 255, 255, 0.07);
  }
  .sidebar-header-brand .sh-meta-row {
    font-size: 10px; font-weight: 400; line-height: 1.25;
    color: var(--text-muted);
  }
  .sidebar-header-brand .sh-meta-sep { opacity: 0.55; margin: 0 2px; }
  .sidebar-header-brand .sh-check-updates {
    color: var(--text-muted); text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.2);
    text-underline-offset: 2px;
  }
  .sidebar-header-brand .sh-check-updates:hover { color: var(--text); }
  .sidebar-header-brand .sh-check-updates.checking { opacity: 0.6; pointer-events: none; }
  .sidebar-header-brand .sh-repo-link {
    font-size: 10px; font-weight: 400; line-height: 1.25;
    color: var(--text-muted); text-decoration: none;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    letter-spacing: 0.1px;
  }
  .sidebar-header-brand .sh-repo-link:hover {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.2);
    text-underline-offset: 2px;
  }
  .log-list { overflow-y: auto; padding: 8px; flex: 0 1 auto; max-height: 50vh; }

  /* Tool filters */
  .tool-filters {
    border-top: 1px solid var(--border); padding: 10px 12px;
    overflow-y: auto; min-height: 0; flex-shrink: 0;
  }
  .tool-filters-header {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .tool-filters-header .toggle-all {
    font-size: 10px; cursor: pointer; color: var(--accent);
    font-weight: 400; text-transform: none;
  }
  .tool-filters-header .toggle-all:hover { text-decoration: underline; }
  .tool-filter-item {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 0; font-size: 12px; cursor: pointer;
  }
  .tool-filter-item input { accent-color: var(--orange); cursor: pointer; }
  .tool-filter-item .tool-label { color: var(--text); }
  .tool-filter-item .tool-count { color: var(--text-muted); font-size: 10px; margin-left: auto; }

  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

  /* Vercel deploy status — compact pill in the global topbar. The "not
     configured" / state details live in the pill's title attribute (hover
     tooltip) so the conversation sidebar stays focused on conversations. */
  .deploy-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted); display: inline-block;
  }
  .deploy-dot.ready { background: var(--green); }
  .deploy-dot.error { background: var(--red); }
  .deploy-dot.building { background: #FBCA04; animation: pulse 2s infinite; }
  .sh-btn-deploy {
    display: inline-flex; align-items: center; gap: 5px;
    text-decoration: none;
  }
  .sh-btn-deploy .deploy-label {
    font-size: 11px; color: var(--text-muted);
  }
  .sh-btn-deploy:hover .deploy-label { color: var(--text); }

  .log-item {
    padding: 10px 12px; border-radius: 6px; cursor: pointer;
    margin-bottom: 4px; transition: background 0.15s;
  }
  .log-item:hover { background: var(--surface-2); }
  .log-item.active { background: var(--surface-2); border-left: 3px solid var(--accent); }
  .log-item .issue { font-weight: 600; color: var(--accent); font-size: 14px; }
  .log-item .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

  /* Main */
  /* min-width: 0 lets the main column shrink below its content's intrinsic
     width — without it, the toolbar's non-wrapping buttons set a floor that
     prevents the sidebar resizer from making the conversation pane narrow. */
  .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
  .conv-pane.has-conv-bg {
    --orch-chip-text: #d8beff;
    --bg: var(--conv-bg);
    --surface: var(--conv-surface);
    --surface-2: var(--conv-surface-2);
    --border: var(--conv-border);
    --text: var(--conv-text);
    --text-muted: var(--conv-text-muted);
    --text-secondary: var(--conv-text-muted);
    --accent: var(--conv-accent);
    background: var(--conv-bg);
    color: var(--conv-text);
  }
  .conv-pane.has-conv-bg.conv-bg-light {
    --orch-chip-text: #6639a6;
    --conv-user-bubble-bg: #dceaff;
    --conv-peer-bg: #e0f2e5;
  }
  .conv-pane.has-conv-bg .conversations-view {
    background: var(--conv-bg);
  }
  .toolbar {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
    background: var(--surface); font-size: 13px;
    min-width: 0; overflow: hidden;
  }
  /* #1 — Collapse the conv toolbar to zero height when JS marks it
     `.is-empty`. Toggled by an observer that watches for visible
     children; cleaner and more reliable than a :has() selector that
     doesn't pick up dynamic display:none toggles. */
  .toolbar.is-empty {
    padding: 0 !important; border-bottom: none !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden;
  }
  /* Subagent transcripts are read-only: no composer, no input chrome
     (CCC-113 — embedded task lanes showed a second input box). */
  body.subagent-readonly .conv-input-bar,
  body.subagent-readonly .conv-input-context,
  body.subagent-readonly .conv-input-hint {
    display: none !important;
  }
  body.conversation-popout .sidebar,
  body.conversation-popout #sidebarResizer,
  body.conversation-popout #kanbanLayout,
  body.conversation-popout .pwa-install-banner {
    display: none !important;
  }
  /* ── Flow popout ─────────────────────────────────────────────────
     Same idea as conversation-popout but the surface is the Flow
     board: hide the conv pane, hide every chrome strip, let the
     sidebar fill the viewport, and inside the sidebar keep only the
     flow board visible. */
  body.flow-popout {
    overflow: hidden;
  }
  body.flow-popout .main,
  body.flow-popout #sidebarResizer,
  body.flow-popout .pwa-install-banner,
  body.flow-popout .ccc-topbar,
  body.flow-popout .font-size-controls,
  body.flow-popout #mobileBackBtn,
  body.flow-popout .toolbar,
  body.flow-popout .attention-panel,
  body.flow-popout #notifBanner,
  body.flow-popout .conv-search-bar,
  body.flow-popout #convSearchWrap,
  body.flow-popout #convSearch,
  body.flow-popout #convList,
  body.flow-popout #kanbanBoard,
  body.flow-popout .coord-toolbar,
  body.flow-popout #repoBar,
  body.flow-popout .new-session-panel,
  body.flow-popout .sidebar > .sidebar-header,
  body.flow-popout .sidebar > .sidebar-tabs,
  body.flow-popout .conv-list-panel > *:not(#flowBoard) {
    display: none !important;
  }
  body.flow-popout .sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: 100vh !important;
  }
  body.flow-popout .conv-list-panel {
    width: 100% !important;
    height: 100% !important;
    flex: 1 1 auto !important;
  }
  body.flow-popout #flowBoard {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    height: 100% !important;
    flex: 1 1 auto !important;
  }
  /* Reader-on-right mode: when the toolbar toggle is on, un-hide the
     main pane and split the popout 60/40 (sidebar/flow on the left,
     conv reader on the right). Clicking a node in the flow board
     mounts that conversation into the right pane through the normal
     selectConversation path. */
  body.flow-popout.flow-popout-reader {
    display: flex !important;
    flex-direction: row;
  }
  body.flow-popout.flow-popout-reader .main {
    display: flex !important;
    /* CSS custom prop drives the split: --flow-reader-width persists in
       localStorage, default 40vw. The resizer below mutates it. */
    flex: 0 0 var(--flow-reader-width, 40vw) !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    height: 100vh !important;
    width: auto !important;
    min-width: 280px;
    border-left: 1px solid var(--border);
  }
  body.flow-popout.flow-popout-reader .sidebar {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    height: 100vh !important;
    min-width: 320px;
  }
  /* Draggable resizer between flow board (left) and conv reader (right).
     Six-pixel-wide column with a hover highlight; cursor:col-resize on
     hover so the affordance is obvious. */
  .flow-reader-resizer {
    flex: 0 0 6px;
    background: var(--border);
    cursor: col-resize;
    user-select: none;
    transition: background 0.12s ease-out;
  }
  .flow-reader-resizer:hover,
  .flow-reader-resizer.is-dragging { background: var(--accent); }
  body:not(.flow-popout-reader) .flow-reader-resizer { display: none; }
  body.conversation-popout .main {
    display: flex !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    transition: none !important;
    z-index: auto !important;
    width: 100vw;
    height: 100vh;
    flex: 1 1 auto;
  }
  body.conversation-popout .toolbar {
    display: none !important;
  }
  /* An app's agent pane (embed=app): one conversation and a composer. The
     session title, CI progress, process pills and side-panel button belong
     to the dashboard, not to someone using an app. */
  body.ccc-app-embed [data-local-ci-host],
  body.ccc-app-embed #convToolbar,
  body.ccc-app-embed .conv-pane-header,
  body.ccc-app-embed .popout-side-panel-btn {
    display: none !important;
  }
  body.conversation-popout .ccc-topbar,
  body.conversation-popout .font-size-controls,
  body.conversation-popout #mobileBackBtn,
  body.conversation-popout .conv-pane-drop-overlay {
    display: none !important;
  }
  body.conversation-popout #convSplit {
    min-height: 0;
    height: 100%;
  }
  body.conversation-popout .conversations-view {
    padding-left: 24px;
    padding-right: 24px;
  }
  /* Floating Annotate button (CCC-166). Hidden everywhere by default — the
     main dashboard uses the topbar Annotate button — and revealed only in a
     conversation popout, where that topbar is hidden. Styled to match the
     .annotation-link pill but anchored bottom-left so it does not collide
     with the bottom-right TTS FAB or the composer. */
  .annotation-fab { display: none; }
  body.conversation-popout .annotation-fab {
    display: inline-flex; align-items: center; gap: 4px;
    position: fixed; left: 16px; bottom: 16px; z-index: 9000;
    padding: 6px 12px;
    background: var(--panel, #161b22); color: var(--text-muted);
    border: 1px solid rgba(57,210,192,0.35); border-radius: 999px;
    font-size: 12px; font-family: inherit; cursor: pointer;
    letter-spacing: 0.2px; white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    transition: background 0.12s ease-out, color 0.12s ease-out, border-color 0.12s ease-out;
  }
  body.conversation-popout .annotation-fab:hover,
  body.conversation-popout .annotation-fab.active {
    background: rgba(57,210,192,0.16);
    border-color: rgba(57,210,192,0.55);
    color: var(--text);
  }
  /* Popouts can inherit a collapsed rail preference from the dashboard. The
     standard edge chevron is intentionally compact there, but this focused
     reader needs an explicit, discoverable way to restore its side panel. */
  .popout-side-panel-btn { display: none; }
  body.conversation-popout.status-rail-collapsed #popoutSidePanelBtn,
  body.popout-rail-forced #popoutSidePanelBtn {
    display: inline-flex;
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(57,210,192,0.55);
    border-radius: 999px;
    background: var(--panel, #161b22);
    color: var(--text);
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    cursor: pointer;
    font: 600 12px/1 inherit;
  }
  body.conversation-popout.status-rail-collapsed #popoutSidePanelBtn:hover,
  body.conversation-popout.status-rail-collapsed #popoutSidePanelBtn:focus-visible,
  body.popout-rail-forced #popoutSidePanelBtn:hover,
  body.popout-rail-forced #popoutSidePanelBtn:focus-visible {
    background: rgba(57,210,192,0.16);
    outline: none;
  }
  /* ── Group-chat popout ───────────────────────────────────────────
     Same idea as conversation-popout: hide every chrome strip and the
     sidebar, let the .main pane (which hosts #conversationsView, where
     the group-chat reader mounts) fill the window. The reader keeps its
     own input row + TTS/mic controls. */
  body.groupchat-popout .sidebar,
  body.groupchat-popout #sidebarResizer,
  body.groupchat-popout #kanbanLayout,
  body.groupchat-popout .pwa-install-banner,
  body.groupchat-popout .ccc-topbar,
  body.groupchat-popout .font-size-controls,
  body.groupchat-popout #mobileBackBtn,
  body.groupchat-popout .toolbar,
  body.groupchat-popout .conv-pane-drop-overlay,
  body.groupchat-popout .conv-pane > .conv-pane-header {
    display: none !important;
  }
  body.groupchat-popout .main {
    display: flex !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    transition: none !important;
    z-index: auto !important;
    width: 100vw;
    height: 100vh;
    flex: 1 1 auto;
  }
  body.groupchat-popout #convSplit {
    min-height: 0;
    height: 100%;
  }
  /* #2 — Mobile-back button: only show on narrow viewports. The button
     is captured into the rail's _railSet, but we don't want it visually
     leaking into desktop. Hide unless the viewport is mobile-narrow. */
  .mobile-back-btn,
  #mobileBackBtn { display: none !important; }
  /* Threshold matches the JS _mobileMQ (950px) — covers every phone
     in portrait AND landscape so the back button is reachable from
     the conv pane on any phone orientation. */
  @media (max-width: 1200px) {
    .mobile-back-btn,
    #mobileBackBtn { display: inline-flex !important; }
  }
  .toolbar label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-muted); }
  .toolbar input[type="checkbox"] { accent-color: var(--accent); }
  .toolbar .status { margin-left: auto; color: var(--text-muted); }
  .toolbar .resume-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 6px; cursor: pointer;
    background: rgba(57, 210, 192, 0.12); color: var(--cyan);
    border: 1px solid rgba(57, 210, 192, 0.3);
    font-size: 12px; font-weight: 600; font-family: inherit;
    transition: background 0.15s, transform 0.1s;
  }
  .toolbar .resume-btn:hover { background: rgba(57, 210, 192, 0.2); }
  .toolbar .resume-btn:active { transform: scale(0.97); }
  .toolbar .resume-btn.copied {
    background: rgba(63, 185, 80, 0.2); color: var(--green);
    border-color: rgba(63, 185, 80, 0.4);
  }
  .toolbar .resume-btn.stale {
    background: rgba(210, 153, 34, 0.12); color: var(--orange);
    border-color: rgba(210, 153, 34, 0.35);
  }
  .toolbar .resume-btn.stale:hover { background: rgba(210, 153, 34, 0.2); }
  .toolbar .resume-btn.stale.copied {
    background: rgba(63, 185, 80, 0.2); color: var(--green);
    border-color: rgba(63, 185, 80, 0.4);
  }
  .toolbar .resume-btn .resume-icon { font-size: 10px; }
  .toolbar .jump-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 6px; cursor: pointer;
    background: rgba(188, 140, 255, 0.12); color: var(--purple);
    border: 1px solid rgba(188, 140, 255, 0.35);
    font-size: 12px; font-weight: 600; font-family: inherit;
    transition: background 0.15s, transform 0.1s;
  }
  .toolbar .jump-btn:hover { background: rgba(188, 140, 255, 0.22); }
  .toolbar .jump-btn:active { transform: scale(0.97); }
  .toolbar .jump-btn.pulsing {
    animation: pulse 2s infinite;
  }
  .toolbar .jump-btn .jump-icon { font-size: 13px; line-height: 1; }
  .launch-split {
    display: inline-flex; align-items: stretch;
    position: relative;
  }
  .toolbar .launch-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 6px; cursor: pointer;
    background: rgba(88, 166, 255, 0.12); color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.35);
    font-size: 12px; font-weight: 600; font-family: inherit;
    transition: background 0.15s, transform 0.1s;
  }
  .toolbar .launch-btn:hover { background: rgba(88, 166, 255, 0.22); }
  .toolbar .launch-btn:active { transform: scale(0.97); }
  .toolbar .launch-btn.launching { opacity: 0.6; }
  .toolbar .launch-btn.opening { opacity: 0.6; }
  .toolbar .launch-split .launch-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .launch-choice-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 5px 8px; margin-left: -1px;
    border-radius: 0 6px 6px 0; cursor: pointer;
    background: rgba(88, 166, 255, 0.12); color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.35);
    font-size: 11px; font-weight: 700; font-family: inherit;
    line-height: 1;
    transition: background 0.15s, transform 0.1s;
  }
  .launch-choice-btn:hover { background: rgba(88, 166, 255, 0.22); }
  .launch-choice-menu {
    display: none;
    position: absolute; left: 0; top: calc(100% + 4px);
    min-width: 170px; padding: 6px 0;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    z-index: 60;
  }
  .launch-choice-menu.open { display: block; }
  .launch-choice-menu.opens-up {
    top: auto;
    bottom: calc(100% + 4px);
  }
  .launch-choice-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; padding: 7px 12px;
    background: transparent; border: none; border-radius: 0;
    color: var(--text); cursor: pointer;
    font-size: 13px; font-family: inherit; text-align: left;
    white-space: nowrap;
  }
  .launch-choice-item:hover { background: var(--surface-2); }
  .launch-choice-item:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.58;
  }
  .launch-choice-item:disabled:hover { background: transparent; }
  .launch-choice-hint {
    color: var(--text-muted);
    font-size: 11px;
  }
  /* Close & announce — full ship+broadcast flow. Lives in convToolbar so
     it's available without the user having to scroll up to the sticky
     "Original ask" header. */
  .toolbar .announce-btn-conv {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 6px; cursor: pointer;
    background: var(--purple); color: #fff;
    border: 1px solid var(--purple);
    font-size: 12px; font-weight: 600; font-family: inherit;
    transition: opacity 0.15s, transform 0.1s;
  }
  .toolbar .announce-btn-conv:hover { opacity: 0.9; }
  .toolbar .announce-btn-conv:active { transform: scale(0.97); }
  .toolbar .announce-btn-conv:disabled { opacity: 0.6; cursor: default; }
  /* "⋯" overflow menu on the right side of the conv toolbar — currently
     surfaces "Move to repo…" but designed to grow other per-session
     actions later. */
  .conv-overflow-wrap { position: relative; }
  .conv-overflow-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); font-size: 16px; line-height: 1;
    padding: 2px 9px; border-radius: 4px; cursor: pointer;
    margin-left: 6px;
  }
  .conv-overflow-btn:hover { color: var(--text); background: var(--surface-2); }
  .conv-overflow-menu {
    display: none;
    position: absolute; right: 0; top: calc(100% + 4px);
    background: var(--surface);
    border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    min-width: 220px; max-width: 320px;
    z-index: 50;
    padding: 6px 0;
  }
  .conv-overflow-menu.open { display: block; }
  .conv-overflow-menu .com-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    padding: 4px 12px;
  }
  .conv-overflow-menu .com-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 7px 12px;
    background: transparent; border: none; cursor: pointer;
    font-family: inherit; font-size: 13px; color: var(--text);
    text-align: left;
  }
  .conv-overflow-menu .com-item:hover { background: var(--surface-2); }
  .conv-overflow-menu .com-item.com-current {
    color: var(--text-muted); cursor: default;
  }
  .conv-overflow-menu .com-item.com-current:hover { background: transparent; }
  .conv-overflow-menu .com-divider {
    height: 1px; background: var(--border); margin: 6px 0;
  }
  .conv-overflow-menu .com-repo-path {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 11px; color: var(--text-muted); margin-left: auto;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 180px;
  }
  .content {
    flex: 1; overflow-y: auto; padding: 16px 20px;
    scroll-behavior: smooth;
  }
  .empty-state {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); font-size: 15px;
  }

  /* Events */
  /* CCC-51: condensed vertical rhythm — less dead space between turns so more
     of the conversation fits on one screen. */
  .event { margin-bottom: 7px; padding: 7px 14px; border-radius: 6px; border-left: 3px solid transparent; }

  .event.system {
    background: rgba(56, 139, 253, 0.08); border-left-color: var(--accent);
    font-size: 13px; color: var(--text-muted);
  }
  .event.system.send-failure {
    background: rgba(248, 81, 73, 0.1); border-left-color: var(--red);
    color: var(--text);
  }
  .event.system .label { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 11px; }
  .event.system.send-failure .label { color: var(--red); }
  /* Compaction boundary line — hoverable "?" invites the tooltip that
     explains what compaction is (CCC-70). */
  .system-compact-text { cursor: help; }
  .system-compact-help {
    display: inline-flex; align-items: center; justify-content: center;
    width: 13px; height: 13px; border-radius: 50%;
    border: 1px solid var(--border);
    font-size: 9px; line-height: 1;
    color: var(--text-muted); opacity: 0.7;
    vertical-align: middle; margin-left: 2px;
  }
  .event.system.system-hermes {
    background: rgba(45, 212, 191, 0.08);
    border-left-color: #2dd4bf;
  }
  .event.system.system-hermes .label {
    color: #2dd4bf;
  }
  /* Failed turn — the upstream API call errored (bad model id, out of usage,
     rate limit, ...). These exist only as Hermes request_dump files, so this
     red block is the sole place the failure surfaces in the transcript. */
  .event.system.system-hermes.hermes-failed-turn {
    display: block;
    background: rgba(248, 81, 73, 0.1);
    border-left-color: var(--red);
  }
  .event.system.system-hermes.hermes-failed-turn .label { color: var(--red); }
  .hermes-failed-meta {
    margin-left: 6px;
    font-size: 11px;
    color: var(--text-muted);
  }
  .hermes-failed-detail {
    margin-top: 4px;
    color: var(--text);
    font-size: 12px;
    opacity: 0.92;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .hermes-failed-reqid {
    margin-top: 4px;
    font-family: var(--mono, ui-monospace, monospace);
    font-size: 11px;
    color: var(--text-muted);
    user-select: all;
    word-break: break-all;
  }
  /* Turn-summary banner — at-a-glance session health at the top. */
  .event.system.hermes-turn-summary.has-failures { border-left-color: var(--red); }
  .hermes-turn-summary .hts-platform { text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.85; }
  .hermes-turn-summary .hts-ok { color: #2dd4bf; }
  .hermes-turn-summary .hts-failed { color: var(--red); font-weight: 600; }
  .hermes-turn-summary .hts-model { opacity: 0.7; }
  /* Distilled decision line above a structured (JSON-mode) assistant reply. */
  .assistant-decision {
    margin: 2px 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: #2dd4bf;
    word-break: break-word;
  }
  /* Injected system-prompt panel — collapsed by default via <details>. The
     summary reads like the other compact system rows; the expanded body is a
     scrollable, monospace, read-only dump of what Hermes primed the session
     with. */
  .event.system.system-hermes-prompt { display: block; }
  .hermes-sysprompt-summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
  }
  .hermes-sysprompt-summary::-webkit-details-marker { display: none; }
  .hermes-sysprompt-details[open] .hermes-sysprompt-summary {
    margin-bottom: 8px;
  }
  .hermes-sysprompt-body {
    margin: 0;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 6px;
    padding: 10px 12px;
  }

  .event.assistant { background: rgba(188, 140, 255, 0.06); border-left-color: var(--purple); }
  /* Fusion (devin-cli) lanes: the lead keeps the default assistant look;
     sidekick turns get a teal edge + chip so handoffs read at a glance. */
  .event.assistant.event-actor-sidekick {
    border-left-color: var(--accent, #58a6ff);
    background: rgba(88, 166, 255, 0.07);
  }
  .actor-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 1px;
  }
  .actor-chip.actor-sidekick {
    color: var(--accent, #58a6ff);
    background: rgba(88, 166, 255, 0.14);
    border: 1px solid rgba(88, 166, 255, 0.35);
  }
  .actor-chip.actor-lead {
    color: var(--purple, #bc8cff);
    background: rgba(188, 140, 255, 0.10);
    border: 1px solid rgba(188, 140, 255, 0.25);
  }
  /* In the conversations popout the base assistant row is borderless and
     heavily padded (24px top — tuned for sparse Claude prose turns). Fusion
     lanes get explicit edge colors, a whisper of tint, and roughly half the
     vertical padding since devin emits an event per tool call. The conv-bg
     (stitch) override uses !important at higher specificity, so the
     has-conv-bg variants below carry !important to stay visible there too. */
  .conversations-view .event.assistant.event-actor-lead,
  .conv-pane.has-conv-bg .conversations-view .event.assistant.event-actor-lead {
    border-left: 3px solid var(--purple) !important;
    background: rgba(188, 140, 255, 0.045) !important;
    padding: 12px 0 3px 14px !important;
    margin-bottom: 4px !important;
  }
  .conversations-view .event.assistant.event-actor-sidekick,
  .conv-pane.has-conv-bg .conversations-view .event.assistant.event-actor-sidekick {
    border-left: 3px solid var(--accent, #58a6ff) !important;
    background: rgba(88, 166, 255, 0.05) !important;
    padding: 12px 0 3px 14px !important;
    margin-bottom: 4px !important;
  }
  /* Role-accented inline emphasis: lead highlights read purple, sidekick
     highlights keep the blue accent — the prose itself stays neutral. */
  .event-actor-lead .assistant-text .md-code,
  .event-actor-lead .assistant-text a { color: var(--purple); }
  .event-actor-sidekick .assistant-text .md-code,
  .event-actor-sidekick .assistant-text a { color: var(--accent); }
  /* Fold the per-turn meta lines onto one row inside the dense lanes. */
  .event-actor-lead .event-token-chips.cache-adjusted,
  .event-actor-sidekick .event-token-chips.cache-adjusted { display: inline-block; margin-right: 12px; }
  .event-actor-lead .event-model-meta,
  .event-actor-sidekick .event-model-meta { display: inline-block; }
  /* Lead→sidekick handoff brief: collapsed card, not a full user bubble. */
  .devin-handoff-card {
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-left: 3px solid var(--accent, #58a6ff);
    border-radius: 6px;
    background: rgba(88, 166, 255, 0.06);
    padding: 6px 10px;
  }
  .devin-handoff-card summary {
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 8px;
    list-style: none;
    min-width: 0;
  }
  .devin-handoff-card summary::-webkit-details-marker { display: none; }
  .devin-handoff-card .devin-handoff-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent, #58a6ff);
  }
  .devin-handoff-card .devin-handoff-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .devin-handoff-card .devin-handoff-body {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text);
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  /* A loaded skill's rules (isMeta user row surfaced by the server with
     ev.skill). Same collapsed-card treatment as the Devin handoff. */
  .skill-loaded-card {
    border: 1px solid rgba(163, 113, 247, 0.35);
    border-left: 3px solid #a371f7;
    border-radius: 6px;
    background: rgba(163, 113, 247, 0.06);
    padding: 6px 10px;
  }
  .skill-loaded-card summary {
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 8px;
    list-style: none;
    min-width: 0;
  }
  .skill-loaded-card summary::-webkit-details-marker { display: none; }
  .skill-loaded-card .skill-loaded-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a371f7;
  }
  .skill-loaded-card .skill-loaded-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    font-family: var(--mono, monospace);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .skill-loaded-card .skill-loaded-body {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text);
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .conversations-view .event.user_text.skill-loaded-event,
  .conv-pane.has-conv-bg[data-conv-bg] .conversations-view .event.user_text.skill-loaded-event {
    margin-left: 0 !important;
    margin-right: auto !important;
    max-width: none !important;
    width: auto !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    clip-path: none !important;
  }
  /* The handoff arrives as a user_text event but it isn't the operator's
     bubble — flatten the chat styling and let the card carry the look.
     Stitch's user_text override is !important at (0,6,0), so the
     has-conv-bg variant needs !important at (0,7,0) to win. */
  .conversations-view .event.user_text.devin-handoff-event,
  .conv-pane.has-conv-bg[data-conv-bg] .conversations-view .event.user_text.devin-handoff-event {
    margin-left: 0 !important;
    margin-right: auto !important;
    max-width: none !important;
    width: auto !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    clip-path: none !important;
    padding: 4px 0 !important;
  }
  .conversations-view .event.user_text.devin-handoff-event .user-msg,
  .conv-pane.has-conv-bg[data-conv-bg] .conversations-view .event.user_text.devin-handoff-event .user-msg {
    margin-top: 0 !important;
    color: var(--text) !important;
  }
  /* Stitch appends a cyan >_ prompt to every user bubble — noise on a card. */
  .conversations-view .event.user_text.devin-handoff-event .user-msg::after,
  .conv-pane.has-conv-bg[data-conv-bg] .conversations-view .event.user_text.devin-handoff-event .user-msg::after {
    content: none !important;
  }
  .event.tool_result { display: none; } /* hide tool results - they're noise */
  .event.attachment {
    background: rgba(56, 139, 253, 0.05);
    border-left-color: var(--accent, #58a6ff);
    font-size: 13px;
    color: var(--text-muted);
  }
  .event.attachment .label {
    color: var(--accent, #58a6ff);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
  }
  .hook-attachment-summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    user-select: none;
    min-width: 0;
  }
  .hook-attachment-summary::-webkit-details-marker { display: none; }
  .hook-attachment-summary .hook-arrow {
    display: inline-block;
    font-size: 9px;
    transition: transform 0.15s ease;
    color: var(--text-muted);
    flex-shrink: 0;
  }
  .hook-attachment-details[open] .hook-arrow {
    transform: rotate(90deg);
  }
  .hook-attachment-details[open] .hook-attachment-summary {
    margin-bottom: 8px;
  }
  .hook-attachment-badge {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface-2, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    color: var(--text);
    flex-shrink: 0;
  }
  .hook-attachment-preview {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
  }
  .hook-attachment-body {
    margin: 0;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg, rgba(0, 0, 0, 0.2));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    padding: 8px 10px;
  }
  /* Bare no-op acknowledgments ("No response requested.") — filler replies to
     harness resume nudges. Hidden: zero signal, clutters the transcript. */
  .event.assistant.is-noop-ack { display: none; }

  /* CCC-199: once the "No response for Xm" bar is up, a generic
     "Thinking…/Generating…" card beside it contradicts it. The bar owns the
     message; a card naming a real in-flight item (.in-flight) stays. */
  :has(> .conv-silent-bar) > .conv-live-tool-inline.is-generating:not(.in-flight),
  :has(> .conv-silent-bar) > .conv-live-tool-inline.optimistic.is-thinking { display: none; }

  /* End-of-session outcome banner: tells the user what happened when a
     session ended badly (error) or just stopped mid-action with no answer. */
  .conv-outcome-banner {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 8px 0 14px; padding: 11px 14px; border-radius: 6px;
    border-left: 3px solid var(--text-muted);
    background: rgba(139, 148, 158, 0.1); font-size: 13px; color: var(--text);
  }
  .conv-outcome-banner.conv-outcome-error {
    border-left-color: var(--red); background: rgba(248, 81, 73, 0.1);
  }
  .conv-outcome-banner.conv-outcome-incomplete {
    border-left-color: var(--orange, #d29922); background: rgba(210, 153, 34, 0.1);
  }
  .conv-outcome-banner .cob-icon { font-size: 15px; line-height: 1.3; flex: 0 0 auto; }
  .conv-outcome-banner.conv-outcome-error .cob-icon { color: var(--red); }
  .conv-outcome-banner.conv-outcome-incomplete .cob-icon { color: var(--orange, #d29922); }
  .conv-outcome-banner .cob-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
  .conv-outcome-banner .cob-detail { color: var(--text-muted); font-size: 12px; word-break: break-word; }
  .conv-outcome-banner .cob-wake-btn {
    flex: 0 0 auto; align-self: center;
    border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent);
    background: rgba(57, 210, 192, 0.10); color: var(--cyan);
    border-radius: 4px; padding: 5px 9px;
    font-size: 12px; font-weight: 700; line-height: 1.1;
    cursor: pointer; white-space: nowrap;
  }
  .conv-outcome-banner .cob-wake-btn:hover:not(:disabled) {
    background: rgba(57, 210, 192, 0.16);
    border-color: color-mix(in srgb, var(--cyan) 70%, transparent);
  }
  .conv-outcome-banner .cob-wake-btn:disabled {
    cursor: default; opacity: 0.65;
  }

  .event.user_text.pending {
    font-style: italic; opacity: 0.62; position: relative;
  }
  .event.user_text.pending .label::after {
    content: ' · sending…'; font-style: normal; font-weight: 400;
    color: var(--text-muted); text-transform: none; letter-spacing: 0;
    font-size: 10px; margin-left: 4px;
  }
  /* Durable server-queue rows: the message is stored and waits for the
     engine's running turn to end. Not "sending", not lost. */
  .event.user_text.pending.server-queued .label::after {
    content: ' · queued';
  }
  .event.user_text.pending.server-queued[data-queued-reason] .user-msg::after {
    content: attr(data-queued-reason);
    display: block; margin-top: 4px; font-size: 11px; font-style: normal;
    color: var(--text-muted);
  }
  .event.user_text.pending .pending-send-cancel {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; min-width: 22px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: rgba(148, 158, 168, 0.16); color: var(--text-muted);
    font-size: 12px; line-height: 1; cursor: pointer; opacity: 0.75;
  }
  .event.user_text.pending .pending-send-cancel:hover,
  .event.user_text.pending .pending-send-cancel:active {
    opacity: 1; background: rgba(210, 90, 90, 0.22); color: var(--red, #d25a5a);
  }
  .event.user_text.pending .user-message-copy {
    position: absolute; top: 4px; right: 30px;
    width: 22px; height: 22px; min-width: 22px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: rgba(148, 158, 168, 0.16); color: var(--text-muted);
    font-size: 11px; line-height: 1; cursor: pointer; opacity: 0.75;
  }
  .event.user_text.pending .user-message-copy:hover,
  .event.user_text.pending .user-message-copy.copied {
    opacity: 1; background: rgba(63, 185, 80, 0.18); color: var(--green);
  }
  /* Pending echo that timed out — agent never acknowledged it.
     Surface a "not acknowledged + re-send" notice instead of silently
     vanishing the user's typed text. */
  .event.user_text.not-acknowledged {
    background: rgba(210, 153, 34, 0.08);
    border-left-color: var(--orange, #d29922);
    opacity: 0.95;
  }
  .event.user_text.not-acknowledged .label::after {
    content: ' · not detected';
    font-style: normal; font-weight: 400;
    color: var(--orange, #d29922); text-transform: none; letter-spacing: 0;
    font-size: 10px; margin-left: 4px;
  }
  .event.user_text.not-acknowledged .not-ack-note {
    margin-top: 8px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-muted);
  }
  .event.user_text.not-acknowledged .not-ack-label {
    color: var(--orange, #d29922);
  }
  .event.user_text.not-acknowledged .not-ack-retry {
    border: 1px solid var(--orange, #d29922);
    background: transparent;
    color: var(--orange, #d29922);
    padding: 2px 10px;
    border-radius: 4px;
    font: inherit; font-size: 11px;
    cursor: pointer;
  }
  .event.user_text.not-acknowledged .not-ack-retry:hover {
    background: rgba(210, 153, 34, 0.12);
  }
  .event.user_text.not-acknowledged .not-ack-repo-path {
    display: flex; align-items: center; gap: 6px; flex: 1 1 100%;
  }
  .event.user_text.not-acknowledged .not-ack-repo-path input {
    min-width: 0; flex: 1 1 180px; padding: 3px 6px;
    color: var(--text); background: var(--surface); border: 1px solid var(--border);
    border-radius: 4px; font: inherit; font-size: 11px;
  }
  .event.user_text.not-acknowledged .not-ack-dismiss {
    border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 14px; line-height: 1;
    padding: 0 4px;
  }
  .event.user_text.not-acknowledged .not-ack-dismiss:hover {
    color: var(--text);
  }
  /* Server *queued* this send (session busy / headless mid-tool). Calm,
     persistent "parked, will deliver" state — distinct from the red
     not-acknowledged failure. */
  .event.user_text.send-queued {
    background: rgba(210, 153, 34, 0.08);
    border-left-color: var(--orange, #d29922);
    opacity: 0.95;
  }
  .event.user_text.send-queued .label::after {
    content: ' · queued';
    font-style: normal; font-weight: 400;
    color: var(--orange, #d29922); text-transform: none; letter-spacing: 0;
    font-size: 10px; margin-left: 4px;
  }
  .event.user_text.send-queued .send-queued-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(210, 153, 34, 0.25);
    font-size: 11px;
    color: var(--text-muted);
  }
  .event.user_text.send-queued .send-queued-icon {
    flex-shrink: 0;
    font-size: 12px;
  }
  .event.user_text.send-queued .send-queued-text {
    flex: 1;
  }
  .event.user_text.send-queued .send-queued-cancel,
  .event.user_text.send-queued .send-queued-steer,
  .event.user_text.send-queued .user-message-copy,
  .queued-steer-tray .send-queued-steer,
  .queued-steer-tray .user-message-copy {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid rgba(210, 153, 34, 0.4);
    color: var(--orange, #d29922);
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
  }
  .event.user_text.send-queued .send-queued-cancel:hover,
  .event.user_text.send-queued .send-queued-steer:hover,
  .event.user_text.send-queued .user-message-copy:hover,
  .event.user_text.send-queued .user-message-copy.copied,
  .queued-steer-tray .send-queued-steer:hover,
  .queued-steer-tray .user-message-copy:hover,
  .queued-steer-tray .user-message-copy.copied {
    opacity: 1;
    background: rgba(210, 153, 34, 0.12);
  }
  /* State 2: delivered to the session, awaiting Claude. Calm + NOT italic
     (italic = the ambiguous "sending…/maybe lost" state) — a quiet green
     "delivered" so a safely-delivered message no longer looks at-risk. */
  .event.user_text.send-delivered {
    font-style: normal; opacity: 1;
    background: rgba(63, 185, 80, 0.06); border-left-color: var(--green);
  }
  .event.user_text.send-delivered .label::after {
    content: ' · delivered';
    font-style: normal; font-weight: 400;
    color: var(--green); text-transform: none; letter-spacing: 0;
    font-size: 10px; margin-left: 4px;
  }
  .event.user_text.send-delivered .send-delivered-note {
    margin-top: 6px; font-size: 11px; color: var(--text-muted);
  }
  .event.user_text {
    background: rgba(63, 185, 80, 0.08); border-left-color: var(--green);
  }
  .event.user_text .label { color: var(--green); font-weight: 600; font-size: 11px; text-transform: uppercase; }
  .event.user_text .user-msg { margin-top: 6px; white-space: pre-wrap; font-size: 15px; }
  /* "[Request interrupted by user]" — a transcript line Claude writes itself
     when a turn is cut off. Styled as a system/interrupt marker, NOT a green
     user bubble: the human did not type those words, and a quietly-ended turn
     otherwise reads as a clean finish. */
  .event.user_text.session-interrupted-event {
    background: color-mix(in srgb, var(--orange, #d29922) 10%, transparent);
    border-left-color: var(--orange, #d29922);
  }
  .event.user_text.session-interrupted-event .label { color: var(--orange, #d29922); }
  .session-interrupted-msg { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
  .session-interrupted-title {
    font-size: 14px; font-weight: 600; color: var(--orange, #d29922);
  }
  .session-interrupted-sub { font-size: 12px; color: var(--text-muted); }
  /* Queued work has its own space above the composer. Each message gets a
     full-width body and a separate action row, including at phone widths. */
  .queued-steer-tray {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    min-width: 0;
    gap: 8px;
    max-height: min(38vh, 360px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 12px;
    border-top: 1px solid color-mix(in srgb, var(--orange, #d29922) 28%, transparent);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  }
  .conv-pane > .queued-steer-tray { grid-area: queued; order: 3; }
  .queued-steer-tray .event {
    position: relative;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 10px;
    font-size: 12px;
  }
  .queued-steer-tray .event.user_text {
    background: rgba(63, 185, 80, 0.045);
    border-left-color: color-mix(in srgb, var(--green) 65%, transparent);
    font-style: normal;
    opacity: 1;
  }
  .queued-steer-tray .event .label,
  .queued-steer-tray .event .msg-ts { display: none; }
  /* Sent by another session, WatchTower or a service, not typed in the
     composer: a purple frame and a "From:" line so it never reads as the
     user's own words. */
  .queued-steer-tray .event.user_text.queued-external {
    background: color-mix(in srgb, var(--purple) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--purple) 55%, transparent);
    border-left: 3px solid var(--purple);
  }
  .queued-steer-tray .queued-from {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
  }
  .queued-steer-tray .queued-from-label {
    font-weight: 600;
    color: var(--purple);
  }
  .queued-steer-tray .queued-from-name {
    font-weight: 600;
    color: var(--text);
  }
  .queued-steer-tray a.queued-from-name:hover { text-decoration: underline; }
  .queued-steer-tray .queued-from-meta { opacity: 0.8; }
  .queued-steer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
  }
  .queued-steer-actions[hidden], .queued-steer-all-btn[hidden] { display: none; }
  .queued-steer-tray .event.user_text .queued-steer-actions > button {
    position: static;
    inset: auto;
    transform: none;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 12px;
  }
  .queued-steer-tray .send-queued-steer {
    position: static;
    opacity: 1;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-color: var(--orange, #d29922);
    background: var(--orange, #d29922);
    color: #1c1405;
  }
  .queued-steer-tray .send-queued-steer:hover {
    background: #f0b93a;
    border-color: #f0b93a;
    color: #1c1405;
  }
  .queued-steer-tray .user-message-copy {
    position: static;
    opacity: 1;
    border-color: color-mix(in srgb, var(--text-muted) 45%, transparent);
    color: var(--text-muted);
  }
  .queued-steer-tray .user-message-copy:hover,
  .queued-steer-tray .user-message-copy.copied {
    color: var(--green);
    border-color: color-mix(in srgb, var(--green) 55%, transparent);
    background: rgba(63, 185, 80, 0.12);
  }
  .queued-steer-tray .cancel-queued-message {
    position: static;
    flex-shrink: 0;
    padding: 4px 8px;
    border: 1px solid color-mix(in srgb, var(--text-muted) 45%, transparent);
    border-radius: 3px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
  }
  .queued-steer-tray .cancel-queued-message:hover {
    background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  }
  .queued-steer-tray .cancel-queued-message:disabled,
  .queued-steer-tray .send-queued-steer:disabled { cursor: default; opacity: 0.45; }
  .queued-steer-tray .event .user-msg {
    margin-top: 0;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  /* One row: icon, truncating reason text, then the action buttons — not a
     text row stacked over a button row. Full reason is on the title tooltip. */
  .queued-steer-tray .send-queued-note {
    flex-wrap: nowrap;
  }
  .queued-steer-tray .send-queued-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .queued-steer-tray .send-queued-note .queued-steer-actions {
    margin-top: 0;
  }
  .conversations-view .event.user_text.is-queued-steer-duplicate { display: none; }
  /* One action for the whole tray: every queued message delivered as a single
     turn, instead of one interrupt-and-resend round per message. */
  .queued-steer-all-bar {
    position: sticky;
    top: -8px;
    z-index: 1;
    flex: 0 0 auto;
    background: color-mix(in srgb, var(--surface) 88%, var(--bg));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px 2px;
  }
  .queued-steer-all-hint {
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .queued-steer-all-btn {
    flex-shrink: 0;
    padding: 3px 12px;
    border: 1px solid var(--orange, #d29922);
    border-radius: 3px;
    background: color-mix(in srgb, var(--orange, #d29922) 22%, transparent);
    color: #f0b93a;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .queued-steer-all-btn:hover {
    background: var(--orange, #d29922);
    color: #1c1405;
  }
  .queued-steer-all-btn:disabled { cursor: default; opacity: 0.45; }
  /* Clicked Steer, POST still in flight. Italic is this transcript's existing
     "in flight, not yet acknowledged" vocabulary (see .pending); the row is
     already in the conversation so the click reads as instant, and it either
     firms up to delivered or drops back into the tray. */
  .event.user_text.steering-optimistic {
    font-style: italic;
    opacity: 0.85;
    background: rgba(210, 153, 34, 0.06);
    border-left-color: color-mix(in srgb, var(--orange, #d29922) 70%, transparent);
  }
  .event.user_text.steering-optimistic > .pending-send-cancel,
  .event.user_text.steering-optimistic > .user-message-copy {
    display: none;
  }
  .event.user_text.steering-optimistic .label::after {
    content: ' · steering…';
    font-style: normal; font-weight: 400;
    color: var(--orange, #d29922); text-transform: none; letter-spacing: 0;
    font-size: 10px; margin-left: 4px;
  }
  .queued-steer-tray .msg-image {
    width: 44px;
    height: 32px;
    margin: 3px 4px 0 0;
    object-fit: cover;
    vertical-align: middle;
    border-radius: 3px;
  }
  .task-notification-card {
    display: grid;
    gap: 6px;
    white-space: normal;
    color: var(--text);
    font-family: var(--font-ui);
  }
  .task-notification-card .tn-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    /* CCC-188: keep the "TASK NOTIFICATION" label on one line. When the compact
       in-conversation card lays the kicker + summary out as a baseline-aligned
       flex row, a kicker that wrapped to two lines could overlap the summary
       text below it ("what's that"). A short label should never wrap. */
    white-space: nowrap;
  }
  .task-notification-card .tn-kind {
    color: var(--orange);
    font-weight: 700;
    text-transform: none;
  }
  .task-notification-card .tn-summary {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
  }
  .task-notification-card .tn-event {
    padding-left: 10px;
    border-left: 2px solid rgba(210, 153, 34, 0.45);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
  }
  .task-notification-card .tn-meta {
    color: var(--text-muted);
    font-size: 11px;
  }
  .task-notification-card .tn-meta code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--accent);
    background: rgba(110, 118, 129, 0.16);
    border-radius: 4px;
    padding: 1px 5px;
  }
  .msg-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(480px, 100%);
    max-height: 360px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 6px 0;
    object-fit: contain;
    cursor: zoom-in;
  }
  /* CCC-50: inline image rendered under a Read/Write/Edit tool-call. Indented
     to line up past the "-> Read" arrow; capped smaller than a pasted image
     since it's secondary to the tool line. */
  .tool-inline-image { margin: 2px 0 8px 22px; }
  .tool-inline-image .msg-image { max-width: min(360px, 100%); max-height: 260px; margin: 0; }
  .img-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 16, 0.94);
    display: none;
    flex-direction: column;
    z-index: 9999;
    cursor: zoom-out;
  }
  .img-lightbox.open { display: flex; }
  .img-lightbox-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: rgba(13, 17, 23, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    cursor: default;
    flex-shrink: 0;
  }
  .img-lightbox-back,
  .img-lightbox-full,
  .img-lightbox-download,
  .img-lightbox-zoom button,
  .img-lightbox-close {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #f0f6fc;
    font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding: 9px 14px;
    min-height: 36px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .img-lightbox-back:hover,
  .img-lightbox-full:hover,
  .img-lightbox-download:hover,
  .img-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
  }
  .img-lightbox-full[hidden] { display: none; }
  .img-lightbox-zoom {
    display: flex; justify-content: center; gap: 8px; padding: 8px 12px;
    background: rgba(13, 17, 23, 0.92); cursor: default; flex-shrink: 0;
  }
  .img-lightbox-zoom[hidden] { display: none; }
  .img-lightbox-zoom button { min-width: 44px; min-height: 44px; }
  .img-lightbox-zoom button:disabled { opacity: 0.45; cursor: default; }
  .img-lightbox-zoom button:focus-visible { outline: 2px solid #58a6ff; outline-offset: 2px; }
  .img-lightbox-title {
    flex: 1;
    min-width: 0;
    color: #c9d1d9;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  .img-lightbox-stage {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .img-lightbox img {
    max-width: 95vw;
    max-height: calc(100dvh - 84px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    object-fit: contain;
  }
  .img-lightbox-stage.is-image {
    box-sizing: border-box; align-items: flex-start; justify-content: flex-start; cursor: default;
  }
  .img-lightbox-stage.is-image img {
    max-width: none; max-height: none; flex: none; margin: auto; border-radius: 0;
  }
  .img-lightbox-video {
    max-width: 95vw;
    max-height: calc(100dvh - 84px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    background: #000;
    cursor: default;
  }
  .img-lightbox-frame {
    width: min(96vw, 1200px);
    height: calc(100dvh - 84px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    cursor: default;
  }

  .event.result {
    background: rgba(57, 210, 192, 0.08); border-left-color: var(--cyan);
    font-size: 12px;
  }
  .event.result .label { color: var(--cyan); font-weight: 600; text-transform: uppercase; font-size: 11px; }
  .result-copy-agent-answer {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin: 0 6px; padding: 0;
    vertical-align: middle; border-radius: 4px;
    border: 1px solid rgba(57, 210, 192, 0.22);
    background: transparent; color: var(--text-muted);
    font-size: 11px; line-height: 1; cursor: pointer; opacity: 0.72;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
  }
  .result-copy-agent-answer:hover {
    opacity: 1; color: var(--text);
    border-color: rgba(57, 210, 192, 0.55);
    background: rgba(57, 210, 192, 0.08);
  }
  .result-copy-agent-answer.copied {
    opacity: 1; color: var(--green);
    border-color: rgba(63,185,80,0.5);
    background: rgba(63,185,80,0.08);
  }
  .result-copy-agent-answer.speaking {
    opacity: 1; color: var(--accent);
    border-color: var(--accent);
  }
  .result-copy-agent-answer.speaking.paused { color: var(--text-muted); opacity: 0.7; }
  .event.result .stats { margin-top: 4px; }
  .event.result .stats span { margin-right: 16px; }
  /* Error / exhaustion results: a turn that stopped because of a token /
     subscription limit (or other error) must read as a stop, not "Done". */
  .event.result.result-error { background: rgba(248, 81, 73, 0.1); border-left-color: var(--red); }
  .event.result.result-error .label,
  .conversations-view .event.result.result-error .label { color: var(--red); }
  .event.result.result-exhausted { background: rgba(210, 153, 34, 0.12); border-left-color: var(--orange, #d29922); }
  .event.result.result-exhausted .label,
  .conversations-view .event.result.result-exhausted .label { color: var(--orange, #d29922); }
  .event.result.result-silent,
  .conversations-view .event.result.result-silent { background: rgba(139, 148, 158, 0.08); border-left-color: var(--text-muted); }
  .event.result.result-silent .label,
  .conversations-view .event.result.result-silent .label { color: var(--text-muted); }
  .event.result.result-silent .result-error-detail,
  .conversations-view .event.result.result-silent .result-error-detail { color: var(--text-muted); }
  .event.result .result-error-detail { margin-top: 4px; color: var(--text); font-size: 12px; opacity: 0.92; }

  .tool-call {
    display: flex; align-items: flex-start; gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0; font-size: 14px;
  }
  .tool-call.acp-needs-approval {
    border-left: 2px solid var(--orange, #f08a6b);
    padding-left: 8px;
  }
  .acp-perm-options {
    display: inline-flex; gap: 6px; flex-wrap: wrap;
    margin-left: 4px;
  }
  .acp-perm-opt {
    font: inherit; font-size: 12px; font-weight: 600;
    padding: 2px 10px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface-2, transparent); color: var(--text);
  }
  .acp-perm-opt:hover { border-color: var(--accent); color: var(--accent); }
  .acp-perm-opt.is-submitting { opacity: 0.55; pointer-events: none; }
  .acp-perm-options.is-answered { opacity: 0.45; pointer-events: none; }
  .tool-call .arrow { color: var(--orange); font-weight: bold; }
  /* CCC-408: an expanded tool row points its arrow down. */
  .tool-call .arrow { display: inline-block; }
  .tool-call.cc-open > .arrow,
  .tool-call:has(> details.tool-command-disclosure[open]) > .arrow { transform: rotate(90deg); }
  .tool-call .tool-source {
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 18px;
    background: var(--surface-2);
    white-space: nowrap;
  }
  .tool-call .tool-name { color: var(--orange); font-weight: 600; }
  .tool-call.tool-call-ok .tool-name::after {
    content: ' ok';
    color: var(--green);
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
  }
  .tool-call .tool-detail {
    color: var(--text-muted); font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    flex: 1 1 280px;
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .tool-call.tool-command .tool-detail {
    color: var(--text);
  }
  .tool-call.tool-command.has-command-disclosure .tool-detail {
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.45;
  }
  .tool-command-disclosure {
    flex: 1 0 100%;
    margin: 4px 0 2px 20px;
    min-width: 0;
    color: var(--text-muted);
  }
  .tool-command-disclosure summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    user-select: none;
  }
  .tool-command-disclosure summary:hover { color: var(--text); }
  .tool-command-kind {
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 16px;
    background: var(--surface-2);
  }
  .tool-command-disclosure pre {
    margin: 6px 0 0;
    padding: 8px 10px;
    max-height: 360px;
    overflow: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .tool-call.tool-file .tool-detail {
    color: var(--text);
  }
  .tool-edit-body { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
  .tool-edit-multi-item { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
  .tool-edit-section { display: flex; flex-direction: column; gap: 2px; }
  .tool-edit-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 3px 3px 0 0; width: fit-content;
  }
  .tool-edit-old .tool-edit-label { background: rgba(255,80,80,0.18); color: #f87171; }
  .tool-edit-new .tool-edit-label { background: rgba(60,200,100,0.18); color: #4ade80; }
  .tool-edit-old pre {
    margin: 0; padding: 7px 10px; max-height: 260px; overflow: auto;
    background: rgba(255,80,80,0.07); border: 1px solid rgba(255,80,80,0.22);
    border-radius: 0 4px 4px 4px;
    color: var(--text); font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  }
  .tool-edit-new pre {
    margin: 0; padding: 7px 10px; max-height: 260px; overflow: auto;
    background: rgba(60,200,100,0.07); border: 1px solid rgba(60,200,100,0.22);
    border-radius: 0 4px 4px 4px;
    color: var(--text); font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  }
  .tool-edit-truncated { font-size: 11px; color: var(--text-muted); padding: 3px 0; }
  .hide-tools .tool-call { display: none !important; }
  .hide-tools .event.tool-only { display: none !important; }

  /* AskUserQuestion is a prompt directed AT the user, not a side-effect
     tool. Keep it visible even when the reader's "hide tools" toggle is
     on, and stack each question (the array can carry up to 4) as its own
     callout block with header + question + bulleted options. */
  .tool-call.ask-user-question { align-items: flex-start; }
  .hide-tools .tool-call.ask-user-question { display: flex !important; }
  .hide-tools .event.tool-only:has(.tool-call.ask-user-question) { display: block !important; }
  .tool-call.ask-user-question .ask-user-block {
    flex-basis: 100%;
    margin: 4px 0 0 0;
    padding: 8px 10px;
    border-left: 3px solid var(--accent, var(--orange));
    background: var(--surface-2);
    border-radius: 4px;
  }
  /* While the live answerable question card is showing, hide the inline
     transcript copy of that same pending question so it isn't shown twice.
     !important overrides the hide-tools force-visible rule for ask-user
     tool calls. Restored (class removed) when the card closes. */
  .conversations-view .is-live-question-dup,
  .conversations-view .tool-call.is-live-question-dup,
  .hide-tools .tool-call.ask-user-question.is-live-question-dup { display: none !important; }
  .tool-call.ask-user-question .ask-user-block + .ask-user-block {
    margin-top: 6px;
  }
  .tool-call.ask-user-question .ask-user-header {
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
  }
  .tool-call.ask-user-question .ask-user-question-text {
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
  }
  .tool-call.ask-user-question .ask-user-options {
    margin: 6px 0 0 20px;
    padding: 0;
    list-style: disc;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
  }
  .tool-call.ask-user-question .ask-user-options li {
    margin: 0 0 3px 0;
  }
  .tool-call.ask-user-question .ask-user-option-label {
    color: var(--text);
    font-weight: 500;
  }
  .tool-call.ask-user-question .ask-user-option-desc {
    color: var(--text-muted);
  }
  /* CCC-161: clickable transcript options (single-question asks) so the user
     can answer from the transcript when the relay card doesn't mount. */
  .tool-call.ask-user-question .ask-user-options.is-pickable { list-style: none; margin-left: 0; }
  .tool-call.ask-user-question .ask-user-options.is-pickable li { margin: 0 0 5px 0; }
  .tool-call.ask-user-question .ask-user-option-pick {
    display: block; width: 100%; text-align: left; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 10px; color: var(--text);
    font: inherit; transition: border-color 0.12s ease, background 0.12s ease;
  }
  .tool-call.ask-user-question .ask-user-option-pick:hover {
    border-color: var(--accent, #58a6ff);
    background: color-mix(in srgb, var(--accent, #58a6ff) 10%, var(--surface-2));
  }
  .tool-call.ask-user-question .ask-user-option-pick:active { transform: translateY(1px); }
  .tool-call.ask-user-question .ask-user-option-pick.is-submitting { opacity: 0.6; pointer-events: none; }
  a.path-link { color: var(--accent); text-decoration: underline dotted; cursor: pointer; }
  a.path-link:hover { text-decoration: underline; }
  .conv-sticky-header .tools-toggle {
    position: absolute; top: 10px; right: 12px;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); font-size: 11px; padding: 3px 8px;
    border-radius: 4px; cursor: pointer;
  }
  .conv-sticky-header .tools-toggle:hover { color: var(--text); background: var(--surface-2); }
  .conv-sticky-header .tools-toggle.active { color: var(--accent); border-color: rgba(88,166,255,0.4); }

  .conv-sticky-header .conv-sticky-header__close {
    position: absolute; top: 10px; right: 10px;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    color: var(--text-muted); font-size: 16px; cursor: pointer;
    line-height: 1; padding: 0;
    opacity: 0.6; z-index: 10;
  }
  .conv-sticky-header .conv-sticky-header__close:hover { opacity: 1; color: var(--red); }
  /* Pop out — pinned to the pane's own top bar, left of the × close.
     Deliberately NOT in the status rail: the rail collapses, this must not
     (it kept getting re-filed as "pop-out button disappeared"). */
  .conv-sticky-header .conv-sticky-header__popout {
    position: absolute; top: 8px; right: 34px;
    display: inline-flex; align-items: center; gap: 4px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted); font-size: 11px; cursor: pointer;
    line-height: 1; padding: 3px 7px;
    z-index: 10;
  }
  .conv-sticky-header .conv-sticky-header__popout:hover {
    color: var(--text); border-color: var(--text-muted);
  }

  /* RTL support — `unicode-bidi: plaintext` lets each block (paragraph,
     blockquote, code block) detect its own direction from its first
     strong directional character (Hebrew/Arabic flips to RTL, Latin
     stays LTR). `text-align: start` aligns each block to its own
     reading edge so mixed-language conversations land correctly
     without per-message tagging. Code blocks override back to LTR so
     code stays readable. */
  .assistant-text,
  .assistant-text > *,
  .user-msg,
  .gc-message-body,
  .gc-chat-doc {
    unicode-bidi: plaintext;
    text-align: start;
  }
  .assistant-text pre,
  .assistant-text code,
  .user-msg pre,
  .user-msg code {
    unicode-bidi: normal;
    direction: ltr;
    text-align: left;
  }

  .assistant-text {
    font-size: 15px; padding: 2px 0;
    line-height: 1.45;
  }
  /* <session-state> block — a compact decision aid. The action (or completed
     work when no action remains) is dominant; the rationale stays secondary. */
  .session-state-block {
    margin: 6px 0;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #64748b;
    --ssb-label: #93c5fd;
    --ssb-score: #fcd34d;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
  }
  :root[data-theme="light"] .session-state-block {
    --ssb-label: #075985;
    --ssb-score: #854d0e;
  }
  .session-state-block .ssb-score { color: var(--ssb-score); font-weight: 700; font-variant-numeric: tabular-nums; }
  .session-state-block .ssb-completion > summary { cursor: pointer; color: var(--text); }
  .session-state-block .ssb-row { margin: 0; }
  .session-state-block .ssb-key {
    display: inline-block; margin-right: 6px;
    color: var(--ssb-label);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .session-state-block .ssb-primary {
    color: var(--text);
    font-size: 14px;
  }
  .session-state-block .ssb-next .ssb-key { color: var(--ssb-score); }
  .session-state-block .ssb-done .ssb-key { color: var(--ssb-label); }
  .session-state-block .ssb-reason {
    margin-top: 2px;
    font-size: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .session-state-block .ssb-actions {
    display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: baseline;
  }
  .session-state-block .ssb-action {
    display: inline-flex; align-items: center;
    padding: 0 8px; border-radius: 5px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
    color: var(--text); font: inherit; font-size: 12px;
    text-decoration: none; cursor: pointer;
    max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .session-state-block .ssb-action:hover { background: rgba(245, 158, 11, 0.18); }
  .session-state-block .ssb-action:disabled { opacity: 0.5; cursor: default; }
  .session-state-block .ssb-act-copy { border-color: var(--border); background: transparent; }
  .session-state-block .ssb-act-say { border-color: rgba(245, 158, 11, 0.8); background: rgba(245, 158, 11, 0.16); font-weight: 600; }
  .md-table {
    border-collapse: collapse; margin: 8px 0; font-size: 13px;
    border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
  }
  .md-table th, .md-table td {
    padding: 6px 10px; border: 1px solid var(--border);
    text-align: left; vertical-align: top;
  }
  .md-table th { background: var(--surface); font-weight: 600; color: var(--text); }
  .md-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
  /* CCC-47: collapsed /context tables. Summary is a quiet one-liner; the
     table inside keeps its normal styling once expanded. */
  details.ctx-usage-details { margin: 6px 0; }
  details.ctx-usage-details > summary {
    cursor: pointer; list-style: none;
    font-size: 12px; color: var(--text-muted);
    padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
    display: inline-flex; align-items: center; gap: 6px; user-select: none;
  }
  details.ctx-usage-details > summary::-webkit-details-marker { display: none; }
  details.ctx-usage-details > summary::before { content: '▸'; font-size: 10px; }
  details.ctx-usage-details[open] > summary::before { content: '▾'; }
  details.ctx-usage-details > summary:hover { color: var(--text); border-color: var(--accent, #58a6ff); }
  /* CCC-1174: a Devin compactor context checkpoint is bookkeeping, not a
     reply — keep its collapsed row quieter and dashed-bordered. */
  details.devin-context-summary > summary {
    border-style: dashed; opacity: 0.85;
  }
  details.devin-context-summary > summary::after {
    content: 'auto-checkpoint'; font-size: 10px; opacity: 0.7;
  }
  .md-code {
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    background: rgba(110,118,129,0.2); padding: 1px 5px;
    border-radius: 3px; font-size: 0.9em;
    color: var(--cyan);
  }
  .md-h {
    margin: 9px 0 5px; font-weight: 600;
    color: var(--text);
  }
  h1.md-h { font-size: 20px; }
  h2.md-h { font-size: 17px; }
  h3.md-h { font-size: 15px; }
  .assistant-text a { color: var(--accent); }

  /* Fenced code blocks (```lang ... ```). Rounded container with a tiny
     header strip for language label + copy button. Long lines wrap inside
     the transcript so code blocks do not become a second horizontal scroll
     surface while the user is trying to scroll the conversation. */
  .cb-wrap {
    margin: 8px 0; border-radius: 8px; overflow: hidden;
    background: var(--cb-bg); border: 1px solid var(--cb-border);
  }
  .cb-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 10px; background: var(--cb-head-bg);
    border-bottom: 1px solid var(--cb-border);
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 11px; color: var(--cb-muted);
  }
  .cb-lang { letter-spacing: 0.04em; }
  .cb-lang.cb-lang-plain { opacity: 0.55; }
  .cb-copy {
    background: transparent; border: 1px solid var(--cb-border);
    color: var(--cb-muted); font-family: inherit;
    font-size: 10px; padding: 2px 8px; border-radius: 4px;
    cursor: pointer; opacity: 0.6;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  }
  .cb-copy:hover { opacity: 1; color: var(--cb-text); border-color: var(--cb-muted); }
  .cb-copy.copied { color: var(--green); border-color: rgba(63,185,80,0.5); opacity: 1; }
  pre.cb {
    margin: 0; padding: 12px 14px;
    /* overflow-x:clip (not hidden) so we clip without creating a scroll
       container. overflow-x:hidden implicitly forces overflow-y to auto,
       making pre.cb a scroll container whose internal coordinate system
       diverges from the visual layout — this caused text-selection to land
       one or two rows off from where the user clicked. clip clips identically
       but does NOT create a scroll container, so hit-testing stays correct. */
    overflow-x: clip;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 13px; line-height: 1.5; color: var(--cb-text);
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
    tab-size: 2;
  }
  pre.cb code { background: transparent; padding: 0; font: inherit; color: inherit; }
  /* Mermaid diagram block — same chrome as a regular code block, but
     the body holds an SVG once the lib lands. The pre fallback below
     uses pre.cb styling so an unrendered block still looks correct. */
  .mermaid-block {
    margin: 8px 0; border-radius: 8px; overflow: hidden;
    background: var(--cb-bg); border: 1px solid var(--cb-border);
  }
  .mermaid-block .cb-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 10px; background: var(--cb-head-bg);
    border-bottom: 1px solid var(--cb-border);
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 11px; color: var(--cb-muted);
  }
  .mermaid-block pre.mermaid-source {
    margin: 0; padding: 12px 14px;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 13px; line-height: 1.5; color: var(--cb-text);
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  }
  .mermaid-block .mermaid-svg {
    padding: 12px 14px;
    overflow-x: auto;
    text-align: center;
    background: var(--surface);
  }
  .mermaid-block .mermaid-svg svg { max-width: 100%; height: auto; }
  .mermaid-block .mermaid-error {
    padding: 8px 14px;
    font-size: 12px;
    color: var(--red);
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--red) 8%, transparent);
  }
  .tok-comment  { color: #768390; font-style: italic; }
  .tok-string   { color: #a5d6ff; }
  .tok-keyword  { color: #ff7b72; }
  .tok-number   { color: #79c0ff; }
  .tok-type     { color: #ffa657; }
  .tok-function { color: #d2a8ff; }
  .tok-variable { color: #ffa657; }
  .tok-key      { color: #7ee787; }

  .thinking-block {
    font-size: 12px; color: var(--text-muted); padding: 4px 8px;
    border-left: 2px solid var(--border); margin: 4px 0;
    font-style: italic;
  }
  .thinking-toggle {
    cursor: pointer; font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; font-weight: 600;
    user-select: none;
  }
  .thinking-toggle:hover { color: var(--text); }
  .t-body { white-space: pre-wrap; max-height: 400px; overflow-y: auto; }
  /* Long thinking starts clamped to a two-line teaser; click unfolds it. */
  .t-body.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: none;
    cursor: pointer;
  }
  /* Signature-only: reasoning text not persisted; show compact non-expandable marker. */
  .thinking-block-silent .thinking-toggle { cursor: default; opacity: 0.6; }
  .thinking-block-silent .thinking-toggle:hover { color: var(--text-muted); }
  /* CCC-454: inline hint explaining why a silent thought has no body. */
  .thinking-silent-note { font-size: 11px; opacity: 0.55; }
  .event.assistant.is-silent-thinking-only { display: none !important; }

  .thinking-run-source { display: none !important; }
  .event.assistant.thinking-run-event > :not(.thinking-run) { display: none !important; }
  .event.assistant.thinking-run-event:not(:has(> .thinking-run)) { display: none !important; }
  .thinking-run > .thinking-toggle {
    display: block; background: none; border: 0; padding: 0;
    font: inherit; font-size: 11px; font-weight: 600; text-align: start; min-height: 28px;
  }
  .thinking-run > .thinking-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .thinking-run-preview {
    line-height: 1.5; height: 3em; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
  }
  .thinking-run > [hidden] { display: none !important; }
  .thinking-run { cursor: pointer; }
  .activity-run { display: none; }
  body:not(.conv-compact):not([data-conv-view="verbose"]) .conversations-view .activity-run {
    display: block; margin: 6px 0; padding: 0 10px;
  }
  body:not(.conv-compact):not([data-conv-view="verbose"]) .conversations-view .activity-run-source:not(.activity-run-open) { display: none !important; }
  body:not(.conv-compact):not([data-conv-view="verbose"]) .event.assistant:has(> .activity-run-source):not(:has(> .activity-run, > .activity-run-open, > .assistant-text)) { display: none !important; }
  body:not(.conv-compact):not([data-conv-view="verbose"]) .event.assistant.thinking-run-event:not(:has(> .thinking-run)):has(> .activity-run) { display: block !important; }
  body:not(.conv-compact):not([data-conv-view="verbose"]) .event.assistant.thinking-run-event > .activity-run { display: block !important; }
  .activity-run-toggle {
    display: block; min-height: 28px; padding: 0; border: 0; background: transparent;
    color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  }
  .activity-run-toggle::before { content: '\25B8'; margin-inline-end: 6px; }
  .activity-run.is-expanded > .activity-run-toggle::before { content: '\25BE'; }
  .activity-run-toggle:hover { color: var(--text); }
  .activity-run-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .activity-run.has-error > .activity-run-toggle { color: var(--red); }
  .activity-run-preview {
    height: 3em; line-height: 1.5; overflow: hidden; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    color: var(--text-secondary);
  }
  @media (pointer: coarse) { .activity-run-toggle { min-height: 44px; } }
  /* Expanded shows the whole thought, not a nested 400px scroller. */
  .thinking-run > .t-body { overflow-wrap: anywhere; max-height: none; }
  @media (pointer: coarse) {
    .thinking-run > .thinking-toggle { min-height: 44px; }
  }

  /* ACP plan card (kimi TodoList whole-plan replace) — kimi-web TodoCard look. */
  .plan-card {
    font-size: 12px; margin: 4px 0; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 6px;
    background: rgba(139,148,158,0.06); max-width: 640px;
  }
  .plan-row { padding: 1px 0; color: var(--text); }
  .plan-row .plan-glyph { display: inline-block; width: 14px; color: var(--text-muted); }
  .plan-row.is-done { color: var(--text-muted); text-decoration: line-through; }
  .plan-row.is-active .plan-glyph { color: var(--green); }

  /* Codex single-renderer merge, slice 3: turn-level diff block (kind:'diff'),
     distinct from the existing per-apply_patch tool-call rows. */
  .turn-diff-card {
    font-size: 12px; margin: 4px 0; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 6px;
    background: rgba(139,148,158,0.06); max-width: 720px;
  }
  .turn-diff-card-head { font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
  .turn-diff-file { margin: 4px 0; }
  .turn-diff-file-head { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono, monospace); font-size: 11.5px; }
  .turn-diff-file-badge {
    font-size: 10px; text-transform: uppercase; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 4px; padding: 0 4px;
  }
  pre.turn-diff {
    margin: 4px 0 0; padding: 6px 8px; overflow-x: auto; max-height: 320px; overflow-y: auto;
    background: rgba(0,0,0,0.15); border-radius: 4px;
    font-family: var(--font-mono, monospace); font-size: 11.5px; line-height: 1.4;
  }
  pre.turn-diff .diff-line { display: block; white-space: pre; }
  pre.turn-diff .diff-hunk { color: var(--text-muted); }
  pre.turn-diff .diff-add { color: var(--green); background: rgba(63,185,80,0.08); }
  pre.turn-diff .diff-delete { color: var(--red, #f85149); background: rgba(248,81,73,0.08); }

  /* Generated-image block (kind:'image_generation'). */
  .image-gen-card {
    font-size: 12px; margin: 4px 0; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 6px;
    background: rgba(139,148,158,0.06); max-width: 640px;
  }
  .image-gen-card-head { font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
  .image-gen-status { font-size: 10px; text-transform: uppercase; color: var(--text-muted); }
  .image-gen-prompt { margin-top: 4px; color: var(--text); white-space: pre-wrap; }
  .image-gen-media { margin-top: 6px; }
  .image-gen-media img { max-width: 100%; border-radius: 6px; display: block; }
  /* CCC-275: images returned inside a tool output (tool-result-images). */
  /* CCC-286: quarter-size thumbnails (half width, half height), several per
     row; click or (+) enlarges in the media lightbox. */
  .tool-result-images .image-gen-media { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
  .tool-result-image { position: relative; margin: 0; flex: 0 1 auto; min-width: 0; max-width: calc(50% - 4px); }
  .tool-result-image img { max-height: 260px; max-width: 100%; width: auto; margin: 0; }
  .tool-result-image-zoom {
    position: absolute; top: 6px; right: 6px; z-index: 1;
    width: 24px; height: 24px; padding: 0; border-radius: 50%;
    border: 1px solid var(--border); background: rgba(0, 0, 0, 0.6); color: #fff;
    font-size: 16px; line-height: 22px; text-align: center; cursor: zoom-in;
  }
  .tool-result-image-zoom:hover { background: rgba(0, 0, 0, 0.85); }
  .tool-result-image.is-missing .tool-result-image-zoom { display: none; }
  .tool-result-image figcaption { margin-top: 3px; font-size: 11px; color: var(--text-muted); }
  .tool-result-image figcaption a { color: inherit; }
  .tool-result-image .tool-result-image-missing { display: none; }
  .tool-result-image.is-missing img { display: none; }
  .tool-result-image.is-missing .tool-result-image-missing { display: inline; }

  /* Media belongs to the conversation, with an independent vertical flow. */
  .conversations-view { container-type: inline-size; }
  .kimi-turn:has(> .conversation-media-rail) { display: flow-root; }
  .conversation-media-rail { display: flex; flex-direction: column; gap: 0; }
  .conversation-media-rail > .image-gen-card { margin: 0; max-width: none; min-width: 0; }
  .conversation-media-rail .tool-result-image { flex: 1 1 100%; max-width: 100%; }
  .conversation-media-rail .tool-result-image img { width: 100%; object-fit: contain; }
  @container (min-width: 720px) {
    .kimi-turn > .conversation-media-rail {
      float: right; width: 36%; margin: 0 0 0 16px;
    }
    .kimi-turn:has(> .conversation-media-rail) > :not(.conversation-media-rail) {
      max-width: calc(64% - 16px);
    }
  }
  @container (max-width: 719px) {
    .kimi-turn:has(> .conversation-media-rail) { display: flex; flex-direction: column; }
    .kimi-turn > .conversation-media-rail { order: 1; margin-top: 8px; }
  }

  /* Inline `codex_request` card: approval/question/permission/elicitation,
     rendered in the transcript instead of only in the live strip. */
  .codex-request-card {
    font-size: 12px; margin: 6px 0; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    background: rgba(210,153,34,0.08); max-width: 640px;
  }
  .codex-request-card.is-resolved { opacity: 0.55; }
  .codex-request-card.is-submitting { pointer-events: none; opacity: 0.75; }
  .codex-request-title { font-weight: 600; margin-bottom: 4px; }
  .codex-request-reason { color: var(--text-muted); margin-bottom: 6px; white-space: pre-wrap; }
  .codex-request-command {
    margin: 4px 0; padding: 6px 8px; overflow-x: auto;
    background: rgba(0,0,0,0.15); border-radius: 4px;
    font-family: var(--font-mono, monospace); font-size: 11.5px;
  }
  .codex-request-row { display: flex; gap: 6px; margin: 2px 0; }
  .codex-request-row strong { color: var(--text-muted); font-weight: 500; }
  .codex-request-question { margin: 4px 0; }
  .codex-request-q-header { font-weight: 600; }
  .codex-request-q-text { color: var(--text); margin: 2px 0; }
  .codex-request-q-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .codex-request-permissions { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
  .codex-request-perm { display: flex; align-items: center; gap: 6px; }
  .codex-request-link { display: inline-block; margin: 4px 0; }
  .codex-request-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
  .codex-request-free-text {
    flex: 1 1 auto; min-width: 120px; padding: 3px 6px;
    border: 1px solid var(--border); border-radius: 4px;
    background: var(--bg); color: var(--text); font-size: 12px;
  }
  .codex-request-btn {
    padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-secondary, transparent); color: var(--text);
    font-size: 12px; cursor: pointer;
  }
  .codex-request-btn:hover { border-color: var(--text-muted); }
  .codex-request-btn.is-primary { border-color: var(--green); color: var(--green); }
  .codex-request-btn.is-negative { border-color: var(--red, #f85149); color: var(--red, #f85149); }

  /* ── Web-UI conversation parity, scoped to webui panes (kimi + codex) ────
     Palette + layout mirror apps/kimi-web (ChatPane.vue dark theme, style.css
     tokens). Everything is gated on .conv-pane.is-webui-session so Claude and
     other engine panes keep the shared legacy styles. */
  .conv-pane.is-webui-session {
    --kw-bg: #0d1117; --kw-surface: #161b22; --kw-raised: #1c2128; --kw-sunken: #0d1117;
    --kw-line: #2d333b; --kw-text: #c9cdd4; --kw-muted: #9aa0a8; --kw-faint: #6b7280;
    --kw-accent: #58a6ff; --kw-accent-hover: #79b8ff;
    --kw-accent-soft: rgba(88,166,255,0.14); --kw-accent-bd: rgba(88,166,255,0.28);
    --kw-success: #3fb950; --kw-success-soft: rgba(63,185,80,0.14);
    --kw-danger: #f85149; --kw-danger-soft: rgba(248,81,73,0.14);
    --kw-warning: #d29922;
  }
  /* Light conversation backgrounds: the dark palette above leaves pale text
     on a pale page. Follow the colours derived from the chosen background. */
  .conv-pane.is-webui-session.conv-bg-light {
    --kw-bg: var(--conv-bg); --kw-surface: var(--conv-surface); --kw-raised: var(--conv-surface-2); --kw-sunken: var(--conv-surface);
    --kw-line: var(--conv-border); --kw-text: var(--conv-text); --kw-muted: var(--conv-text-muted); --kw-faint: var(--conv-text-muted);
    --kw-accent: var(--conv-accent); --kw-accent-hover: var(--conv-accent);
    --kw-accent-soft: var(--conv-user-bubble-bg, var(--conv-user-bg)); --kw-accent-bd: rgba(36,90,154,0.28);
    --kw-success: #1a7f37; --kw-success-soft: rgba(26,127,55,0.12);
    --kw-danger: #cf222e; --kw-danger-soft: rgba(207,34,46,0.10);
    --kw-warning: #9a6700;
  }

  /* Let rendered turns use the complete reader column. The pane itself
     supplies the horizontal padding, so a second centered 760px column
     would strand available space whenever a user widens the pane. */
  .conv-pane.is-webui-session .conversations-view { padding: 22px 20px 26px; }
  .conv-pane.is-webui-session .conversations-view > .kimi-turn,
  .conv-pane.is-webui-session .conversations-view > .event.user_text,
  .conv-pane.is-webui-session .conversations-view > .event.result,
  .conv-pane.is-webui-session .conversations-view > .stream-bubble,
  .conv-pane.is-webui-session .conversations-view > .conv-live-tool-inline {
    width: 100%;
  }
  /* Turn gaps: 16px before a user turn, 10px before an assistant turn. */
  .conv-pane.is-webui-session .conversations-view > .kimi-turn { margin-top: 10px; margin-bottom: 0; }
  .conv-pane.is-webui-session .conversations-view > .event.user_text { margin-top: 16px; margin-bottom: 0; }
  .conv-pane.is-webui-session .conversations-view > .event.result { margin-top: 10px; margin-bottom: 0; }
  .conv-pane.is-webui-session .conversations-view > .kimi-turn:first-child,
  .conv-pane.is-webui-session .conversations-view > .event.user_text:first-child,
  .conv-pane.is-webui-session .conversations-view > .event.result:first-child { margin-top: 0; }
  /* Block gap inside a turn: 10px. */
  .conv-pane.is-webui-session .kimi-turn > * + * { margin-top: 10px; }
  .conv-pane.is-webui-session .kimi-turn { color: var(--kw-text); font-size: 15px; }
  /* Per-event hidden dedupe markers (kimi turns merge events). */
  .conv-pane.is-webui-session .kimi-marker { display: none !important; }
  /* Control-XML-only user messages render nothing (dedupe anchor only). */
  .conv-pane.is-webui-session .event.user_text.kimi-xml-only { display: none !important; }

  /* Kimi answer metadata row (CCC-755): turn number, timestamp, speak/copy —
     the parity Claude turns get from .assistant-message-actions, reused here
     since kimi merges into .kimi-turn and has no visible per-event container. */
  .conv-pane.is-webui-session .kimi-answer-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 11px; opacity: 0.6;
  }
  .conv-pane.is-webui-session .kimi-answer-meta:hover { opacity: 0.9; }
  .conv-pane.is-webui-session .kimi-answer-meta .line-num,
  .conv-pane.is-webui-session .kimi-answer-meta .msg-ts { float: none; margin-right: 0; }
  /* CCC-845: .msg-ts's own opacity:0.4 (base rule) was compounding with this
     row's opacity:0.6, landing the timestamp at ~0.24 — unreadably dim. The
     row wrapper already carries the dimming (and brightens on hover), so the
     timestamp itself should render at full opacity within it. */
  .conv-pane.is-webui-session .kimi-answer-meta .msg-ts { opacity: 1; }
  .conv-pane.is-webui-session .kimi-answer-meta .assistant-message-actions {
    float: none; position: static; display: inline-flex; align-items: center; gap: 2px;
  }
  .conv-pane.is-webui-session .kimi-answer-meta .assistant-message-action {
    width: 18px; height: 18px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 4px;
    background: transparent; color: var(--text-muted);
    font-size: 11px; line-height: 1;
    cursor: pointer;
  }
  .conv-pane.is-webui-session .kimi-answer-meta .assistant-message-action:hover {
    background: rgba(255,255,255,0.06); color: var(--text);
  }
  .conv-pane.is-webui-session .kimi-answer-meta .assistant-message-action.copied { color: var(--green); }
  /* CCC-929: per-turn token chip on the kimi meta row, right-aligned like the
     merged chip on a .tool-call line (app.css ~2078) since this row is its
     own flex container rather than a tool-call. */
  .conv-pane.is-webui-session .kimi-answer-meta .event-token-chips.is-merged {
    margin: 0 0 0 auto; align-self: center; white-space: nowrap;
  }
  /* CCC-933: the cache-adjusted chip's text ("Cached-adjusted tokens this
     turn: 778,583") is long enough to overflow the column when the raw
     in/cached/out chip already ate most of the row's width — drop it to its
     own wrapped line instead of running off the right edge. */
  .conv-pane.is-webui-session .kimi-answer-meta .event-token-chips.cache-adjusted.is-merged {
    flex-basis: 100%; white-space: normal; word-break: break-word;
  }
  .conv-pane.is-webui-session .kimi-answer-meta .assistant-message-action.speaking { color: var(--accent); }
  .conv-pane.is-webui-session .kimi-answer-meta .assistant-message-action.speaking.paused { color: var(--text-muted); opacity: 0.7; }

  /* User turn — right-aligned soft-blue bubble (kimi-web .u-bub). The event
     div is a full-width transparent flex container; the bubble carries the
     style. Must fully undo CCC's aurora .event.user_text bubble (fit-content
     width, gradient, border, glow). */
  .conv-pane.is-webui-session .event.user_text {
    background: none; border: none; box-shadow: none;
    width: 100%; max-width: none;
    padding: 0; border-radius: 0;
    display: flex; flex-direction: column; align-items: flex-end;
  }
  .conv-pane.is-webui-session .event.user_text .label,
  .conv-pane.is-webui-session .event.user_text .line-num,
  .conv-pane.is-webui-session .event.user_text .msg-ts,
  .conv-pane.is-webui-session .event.user_text .event-model-meta { display: none; }
  .conv-pane.is-webui-session .event.user_text .user-msg {
    align-self: flex-end;
    max-width: 78%;
    margin: 0;
    background: var(--kw-accent-soft);
    border: 1px solid var(--kw-accent-bd);
    color: var(--kw-text);
    border-radius: 16px 16px 6px 16px;
    padding: 11px 15px;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  /* Pending / queued echo states keep readable without the green chrome. */
  .conv-pane.is-webui-session .event.user_text.pending,
  .conv-pane.is-webui-session .event.user_text.not-acknowledged { font-style: italic; }

  /* A queue card uses the available panel width, even when this engine's
     transcript normally right-aligns blue bubbles at 78% width. */
  .conv-pane.is-webui-session .queued-steer-tray .event.user_text {
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-style: normal;
  }
  .conv-pane.is-webui-session .queued-steer-tray .event.user_text .user-msg {
    align-self: stretch;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 0;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
  }

  /* Assistant text: plain left-aligned, no bubble/background/role label. */
  .conv-pane.is-webui-session .kimi-turn .assistant-text {
    font-size: 15px; line-height: 1.6; color: var(--kw-text); padding: 0;
  }

  /* Result footer — small muted line under the turn (kimi-web turn meta). */
  .conv-pane.is-webui-session .event.result {
    background: none; border-left: none; padding: 0 4px; border-radius: 0;
    font-size: 12px; color: var(--kw-faint);
  }
  .conv-pane.is-webui-session .event.result .label,
  .conv-pane.is-webui-session .event.result .line-num,
  .conv-pane.is-webui-session .event.result .msg-ts { display: none; }
  .conv-pane.is-webui-session .event.result .stats { margin-top: 0; display: flex; gap: 16px; flex-wrap: wrap; }
  .conv-pane.is-webui-session .event.result .stats span { margin-right: 0; }
  .conv-pane.is-webui-session .event.result.result-error {
    background: var(--kw-danger-soft); border-left: 3px solid var(--kw-danger);
    border-radius: 6px; padding: 7px 14px; color: var(--kw-text);
  }
  .conv-pane.is-webui-session .event.result.result-error .label { display: inline; color: var(--kw-danger); }
  .conv-pane.is-webui-session .event.result.kimi-result-empty { display: none; }

  /* ── ToolGroup card (kimi-web ToolGroup.vue) ── */
  .conv-pane.is-webui-session .kimi-tool-group {
    background: var(--kw-surface); border: 1px solid var(--kw-line);
    border-radius: 8px; overflow: hidden;
  }
  .conv-pane.is-webui-session .kimi-tool-group-head {
    display: flex; align-items: center; gap: 8px;
    height: 32px; padding: 0 11px;
    font-size: 13px; color: var(--kw-muted);
    cursor: pointer; user-select: none;
  }
  .conv-pane.is-webui-session .kimi-tool-group-head:hover { background: var(--kw-sunken); color: var(--kw-text); }
  .conv-pane.is-webui-session .kimi-tg-ic { color: var(--kw-faint); flex: none; display: inline-flex; }
  .conv-pane.is-webui-session .kimi-tg-title { font-weight: 500; color: var(--kw-text); }
  .conv-pane.is-webui-session .kimi-tg-meta { color: var(--kw-faint); }
  .conv-pane.is-webui-session .kimi-tg-car {
    margin-left: auto; color: var(--kw-faint); flex: none; display: inline-flex;
    transition: transform 0.15s ease;
  }
  .conv-pane.is-webui-session .kimi-tool-group:not(.collapsed) .kimi-tg-car { transform: rotate(90deg); }
  .conv-pane.is-webui-session .kimi-tool-group.collapsed .kimi-tool-group-body { display: none; }
  .conv-pane.is-webui-session .kimi-tg-dot {
    width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--kw-faint);
  }
  .conv-pane.is-webui-session .kimi-tool-group[data-kimi-group-state="running"] .kimi-tg-dot {
    background: var(--kw-accent); animation: kimiPulse 1.2s ease-in-out infinite;
  }
  .conv-pane.is-webui-session .kimi-tool-group[data-kimi-group-state="failed"] .kimi-tg-dot { background: var(--kw-danger); }
  .conv-pane.is-webui-session .kimi-tool-group[data-kimi-group-state="done"] .kimi-tg-dot { background: var(--kw-success); }
  /* Rows inside a group: flat, separated by a top hairline only. */
  .conv-pane.is-webui-session .kimi-tool-group .kimi-tool { border: none; border-radius: 0; }
  .conv-pane.is-webui-session .kimi-tool-group .kimi-tool + .kimi-tool { border-top: 1px solid var(--kw-line); }

  /* ── Tool rows (kimi-web ToolRow.vue) ── */
  .conv-pane.is-webui-session .kimi-tool {
    background: var(--kw-surface); border: 1px solid var(--kw-line);
    border-radius: 8px; overflow: hidden;
  }
  .conv-pane.is-webui-session .kimi-tool-head {
    display: flex; align-items: center; gap: 8px;
    min-height: 30px; padding: 0 11px;
    font-family: var(--font-mono, 'SF Mono', SFMono-Regular, Consolas, monospace);
    font-size: 13px; color: var(--kw-text);
  }
  .conv-pane.is-webui-session .kimi-tool-head[onclick] { cursor: pointer; }
  .conv-pane.is-webui-session .kimi-tool-head:hover,
  .conv-pane.is-webui-session .kimi-tool.open .kimi-tool-head { background: var(--kw-sunken); }
  .conv-pane.is-webui-session .kimi-tool.err .kimi-tool-head { background: rgba(248,81,73,0.06); }
  .conv-pane.is-webui-session .kimi-tool.err .kimi-tool-head:hover { background: rgba(248,81,73,0.1); }
  .conv-pane.is-webui-session .kimi-tool-glyph {
    display: inline-flex; align-items: center; color: var(--kw-faint); flex: none;
  }
  .conv-pane.is-webui-session .kimi-tool-name { font-weight: 500; flex: none; }
  .conv-pane.is-webui-session .kimi-tool-arg {
    color: var(--kw-muted); font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
  }
  .conv-pane.is-webui-session .kimi-tool-rt {
    margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none;
  }
  .conv-pane.is-webui-session .kimi-tool-status { display: inline-flex; align-items: center; flex: none; }
  .conv-pane.is-webui-session .kimi-tool-status.ok { color: var(--kw-success); }
  .conv-pane.is-webui-session .kimi-tool-status.error { color: var(--kw-danger); }
  .conv-pane.is-webui-session .kimi-pulse-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--kw-accent); display: inline-block;
    animation: kimiPulse 1.2s ease-in-out infinite;
  }
  @keyframes kimiPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
  .conv-pane.is-webui-session .kimi-tool-car {
    flex: none; color: var(--kw-faint); display: inline-flex; transition: transform 0.15s ease;
  }
  .conv-pane.is-webui-session .kimi-tool.open .kimi-tool-car { transform: rotate(90deg); }
  .conv-pane.is-webui-session .kimi-tool-peek {
    display: block; padding: 0 12px 7px 30px;
    font-family: var(--font-mono, 'SF Mono', SFMono-Regular, Consolas, monospace);
    font-size: 12px; line-height: 1.5; color: var(--kw-muted);
    white-space: pre-wrap; word-break: break-word;
  }
  .conv-pane.is-webui-session .kimi-tool-peek-more {
    display: block; color: var(--kw-faint); font-style: italic;
  }
  .conv-pane.is-webui-session .kimi-tool.open .kimi-tool-peek { display: none; }
  .conv-pane.is-webui-session .kimi-tool-body { display: none; }
  .conv-pane.is-webui-session .kimi-tool.open .kimi-tool-body { display: block; }
  .conv-pane.is-webui-session .kimi-tool-body-pad {
    padding: 8px 12px 12px;
    background: var(--kw-sunken); border-top: 1px solid var(--kw-line);
    font-family: var(--font-mono, 'SF Mono', SFMono-Regular, Consolas, monospace);
    font-size: 13px; line-height: 1.65; color: var(--kw-text);
    white-space: pre-wrap; word-break: break-word;
  }
  .conv-pane.is-webui-session .kimi-tool-io { margin: 0 0 8px; white-space: pre-wrap; word-break: break-word; }
  .conv-pane.is-webui-session .kimi-tool-io.is-output { color: var(--kw-muted); margin-bottom: 0; }
  .conv-pane.is-webui-session .kimi-tool .acp-perm-options { display: flex; gap: 8px; flex-wrap: wrap; font-family: inherit; }

  /* ── Edit diffs (kimi-web DiffLines.vue) ── */
  .conv-pane.is-webui-session .kimi-diff {
    font-family: var(--font-mono, 'SF Mono', SFMono-Regular, Consolas, monospace);
    font-size: 13px; line-height: 1.5; margin: 0 0 8px;
  }
  .conv-pane.is-webui-session .kimi-diff-path { color: var(--kw-muted); margin-bottom: 4px; }
  .conv-pane.is-webui-session .kimi-diff-row { display: flex; align-items: flex-start; white-space: pre-wrap; word-break: break-word; }
  .conv-pane.is-webui-session .kimi-diff-sign {
    flex: none; width: 16px; text-align: center; color: var(--kw-muted); user-select: none;
  }
  .conv-pane.is-webui-session .kimi-diff-row.add {
    background: var(--kw-success-soft); box-shadow: inset 2px 0 0 var(--kw-success);
  }
  .conv-pane.is-webui-session .kimi-diff-row.add .kimi-diff-sign { color: var(--kw-success); }
  .conv-pane.is-webui-session .kimi-diff-row.del {
    background: var(--kw-danger-soft); box-shadow: inset 2px 0 0 var(--kw-danger);
  }
  .conv-pane.is-webui-session .kimi-diff-row.del .kimi-diff-sign { color: var(--kw-danger); }

  /* ── Todo/plan checklist (CCC-940): readable rows instead of raw JSON args ── */
  .conv-pane.is-webui-session .kimi-todo-list { display: flex; flex-direction: column; gap: 4px; margin: 0 0 4px; }
  .conv-pane.is-webui-session .kimi-todo-row {
    display: flex; align-items: flex-start; gap: 8px;
    font-family: var(--font-sans, inherit); font-size: 13px; line-height: 1.5; color: var(--kw-text);
  }
  .conv-pane.is-webui-session .kimi-todo-mark {
    flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--kw-success);
  }
  .conv-pane.is-webui-session .kimi-todo-row.done .kimi-todo-title { color: var(--kw-muted); text-decoration: line-through; }
  .conv-pane.is-webui-session .kimi-todo-row.active .kimi-todo-title { font-weight: 600; }

  /* ── Thinking (kimi-web ThinkingBlock.vue): no label header; teaser = last
     paragraph (faint), click toggles the full text inline. ── */
  .conv-pane.is-webui-session .kimi-thinking .kimi-thinking-teaser,
  .conv-pane.is-webui-session .kimi-thinking .kimi-thinking-full {
    margin: 0; font-size: 14px; line-height: 1.7;
    white-space: pre-wrap; word-break: break-word;
  }
  .conv-pane.is-webui-session .kimi-thinking { cursor: pointer; }
  .conv-pane.is-webui-session .kimi-thinking.is-single { cursor: default; }
  .conv-pane.is-webui-session .kimi-thinking-teaser { color: var(--kw-faint); }
  .conv-pane.is-webui-session .kimi-thinking:hover .kimi-thinking-teaser { color: var(--kw-text); }
  .conv-pane.is-webui-session .kimi-thinking-full { display: none; color: var(--kw-muted); }
  .conv-pane.is-webui-session .kimi-thinking.open .kimi-thinking-teaser { display: none; }
  .conv-pane.is-webui-session .kimi-thinking.open .kimi-thinking-full,
  .conv-pane.is-webui-session .kimi-thinking.is-single .kimi-thinking-full { display: block; }

  /* Live thinking window in the stream bubble: tail of the text, 5 lines max,
     pinned to the bottom (JS keeps scrollTop at scrollHeight). */
  .conv-pane.is-webui-session .stream-block-thinking {
    margin: 0; font-size: 14px; line-height: 1.7; color: var(--kw-muted);
    font-style: normal; opacity: 1;
    white-space: pre-wrap; word-break: break-word;
    max-height: calc(1.7 * 1em * 5); overflow-y: auto;
  }

  /* ── Plan / TodoCard (kimi-web TodoCard.vue) ── */
  .conv-pane.is-webui-session .plan-card {
    border: none; background: none; padding: 0; margin: 0; max-width: none;
    font-size: 14px; display: flex; flex-direction: column; gap: 1px;
  }
  .conv-pane.is-webui-session .plan-row {
    display: flex; align-items: center; gap: 7px; padding: 4px 0; color: var(--kw-text);
  }
  .conv-pane.is-webui-session .plan-row .plan-glyph { width: auto; color: var(--kw-faint); flex: none; }
  .conv-pane.is-webui-session .plan-row.is-active { color: var(--kw-accent); font-weight: 500; }
  .conv-pane.is-webui-session .plan-row.is-active .plan-glyph { color: var(--kw-accent); }
  .conv-pane.is-webui-session .plan-row.is-done { color: var(--kw-faint); text-decoration: line-through; }
  .conv-pane.is-webui-session .plan-row.is-done .plan-glyph { color: var(--kw-success); text-decoration: none; }

  /* Stream bubble in webui panes: plain column, no bubble chrome. */
  .conv-pane.is-webui-session .stream-bubble {
    background: none; border: none; border-left: none; padding: 0; border-radius: 0;
  }
  .conv-pane.is-webui-session .stream-bubble-header { display: none; }
  .conv-pane.is-webui-session .stream-bubble .assistant-text {
    font-size: 15px; line-height: 1.6; color: var(--kw-text); padding: 0;
  }
  .conv-pane.is-webui-session .stream-bubble-blocks { gap: 10px; }
  .conv-pane.is-webui-session .kimi-stream-tool { display: block; padding: 0; align-self: stretch; }

  /* Moon-phases waiting spinner (kimi-web MoonSpinner.vue): 8 frames, 120ms. */
  .kimi-moon {
    display: inline-block; position: relative; width: 18px; height: 18px;
    font-size: 18px; line-height: 1; user-select: none; flex: none;
  }
  .kimi-moon > span {
    position: absolute; inset: 0; display: block; text-align: center; opacity: 0;
    animation: kimiMoon 960ms steps(1, end) infinite;
    animation-delay: var(--kmd, 0ms);
  }
  @keyframes kimiMoon { 0%, 12.49% { opacity: 1; } 12.5%, 100% { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) {
    .kimi-moon > span { animation: none; opacity: 0; }
    .kimi-moon > span:nth-child(4) { opacity: 1; }
  }

  /* Tool-call group header: aggregate status color cue (legacy kimi branch of
     updateToolGroupLabel — unused by the kimi turn renderer, kept for the
     shared "Ran N commands" groups if one ever lands in a webui pane). */
  .conv-pane.is-webui-session .tool-call-group[data-kimi-group-state="error"] .tcg-label { color: var(--red, #f85149); }
  .conv-pane.is-webui-session .tool-call-group[data-kimi-group-state="running"] .tcg-label { color: var(--green); }

  /* "Hide tool calls" toggle covers kimi rows/groups too — but never hide a
     row carrying an ACP permission prompt (its buttons are the only way to
     answer). */
  .conv-pane.is-webui-session .conversations-view.hide-tools .kimi-turn > .kimi-tool,
  .conv-pane.is-webui-session .conversations-view.hide-tools .kimi-turn > .kimi-tool-group { display: none !important; }
  .conv-pane.is-webui-session .conversations-view.hide-tools .kimi-turn > .kimi-tool.acp-needs-approval,
  .conv-pane.is-webui-session .conversations-view.hide-tools .kimi-turn > .kimi-tool-group:has(.acp-needs-approval) { display: block !important; }

  /* Expanded composer (kimi-web maximize-input parity): Enter inserts
     newlines, Ctrl+Enter sends; collapses back after send/clear. */
  .conv-input-bar.is-composer-expanded .conv-input-row-top textarea {
    min-height: 30vh !important;
    max-height: 70vh !important;
  }

  /* Editing the folder path on a phone: hide the composer and model strip so
     the folder row and its suggestions have the room above the keyboard. */
  .conv-pane.is-cwd-editing > .conv-input-bar,
  .conv-pane.is-cwd-editing > .conv-model-picker-strip { display: none !important; }

  /* Context ring (kimi-web ContextRing parity) inside the usage pill. */
  .ctx-ring { vertical-align: -2.5px; margin-right: 4px; }
  .ctx-ring .ctx-ring-bg { fill: none; stroke: var(--border); stroke-width: 2.4; }
  .ctx-ring .ctx-ring-fg {
    fill: none; stroke: var(--green); stroke-width: 2.4;
    stroke-linecap: round; transition: stroke-dashoffset 0.4s ease;
  }
  .ctx-ring.is-warm .ctx-ring-fg { stroke: var(--yellow, #d29922); }
  .ctx-ring.is-hot .ctx-ring-fg { stroke: var(--red, #f85149); }

  /* Engines settings section — 'Add Kimi engine' guided setup. */
  .kimi-setup-control { display: flex; align-items: center; gap: 8px; }
  .kimi-setup-version { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--text-muted); }
  .kimi-setup-steps { line-height: 1.55; }
  .kimi-setup-steps code { background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
  .kimi-setup-steps a { color: var(--accent); }
  .kimi-setup-links { display: flex; gap: 8px; }
  .kimi-setup-links a.settings-action-btn { text-decoration: none; }

  /* Per-turn token chips — rendered under an assistant event when the
   * source engine exposes per-turn token usage (currently only Antigravity,
   * via GetCascadeTrajectory). Mirrors the `11.2k in | 2.6k out | 1.0k
   * thinking` line Antigravity prints in its own UI. Quiet by design so it
   * doesn't compete with the message text. */
  .event-token-chips {
    margin: 1px 0 0;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.65;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-variant-numeric: tabular-nums;
    cursor: help;
  }
  /* A missing cache read is a cost and latency signal, not quiet metadata. */
  .event-token-chips.cache-miss {
    margin-top: 5px;
    color: #ff7b72;
    opacity: 1;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.025em;
  }
  /* Cache-adjusted per-turn total (CCC-930) — the real cost-weighted number,
     called out bright so it isn't lost among the quiet raw in/cached/out chip. */
  .event-token-chips.cache-adjusted {
    margin-top: 3px;
    color: #79c0ff;
    opacity: 1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
  }
  .event-model-meta {
    margin: 3px 0 0;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.68;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Merged into the trailing tool-call line (CCC-30): sits at the right edge
     of the flex row instead of floating as its own line below the turn. */
  .tool-call .event-token-chips.is-merged {
    margin: 0 0 0 auto;
    align-self: center;
    white-space: nowrap;
  }

  .line-num { font-size: 10px; color: var(--text-muted); opacity: 0.5; float: right; }
  .msg-ts { font-size: 10px; color: var(--text-muted); opacity: 0.4; float: right; margin-right: 8px; font-variant-numeric: tabular-nums; }

  /* Tabs */
  .tab-bar {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    background: var(--surface); padding: 0 16px;
  }
  .tab {
    padding: 10px 16px; font-size: 13px; font-weight: 500;
    color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
  }
  .tab:hover { color: var(--text); }
  .tab.active { color: var(--text); border-bottom-color: var(--accent); }
  .tab .badge {
    display: inline-block; background: var(--accent); color: var(--accent-contrast);
    font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
    margin-left: 6px; vertical-align: middle;
  }

  /* Issues dashboard */
  .issues-view { flex: 1; overflow-y: auto; padding: 16px 20px; }
  .issues-view.hidden { display: none; }
  .issue-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 6px; margin-bottom: 6px;
    background: var(--surface); border: 1px solid var(--border);
    transition: border-color 0.15s;
  }
  .issue-row:hover { border-color: var(--text-muted); }
  .issue-row .issue-num {
    font-weight: 600; color: var(--accent); font-size: 13px;
    min-width: 44px; cursor: pointer;
  }
  .issue-row .issue-num:hover { text-decoration: underline; }
  .issue-row .issue-title { flex: 1; font-size: 13px; }
  .issue-row .issue-labels { display: flex; gap: 4px; flex-wrap: wrap; }
  .issue-label {
    font-size: 10px; padding: 2px 6px; border-radius: 10px;
    font-weight: 600; white-space: nowrap;
  }
  .issue-label.claude-fix { background: #0E8A16; color: #fff; }
  .issue-label.claude-in-progress { background: #FBCA04; color: #000; }
  .issue-label.claude-failed { background: #D93F0B; color: #fff; }
  .issue-label.other { background: var(--border); color: var(--text-muted); }

  .issue-status {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    padding: 3px 8px; border-radius: 4px; white-space: nowrap;
  }
  .issue-status.in_progress { background: rgba(251, 202, 4, 0.15); color: #FBCA04; animation: pulse 2s infinite; }
  .issue-status.queued { background: rgba(14, 138, 22, 0.15); color: var(--green); }
  .issue-status.failed { background: rgba(248, 81, 73, 0.15); color: var(--red); }
  .issue-status.open { background: rgba(139, 148, 158, 0.1); color: var(--text-muted); }
  .issue-status.closed { background: rgba(188, 140, 255, 0.1); color: var(--purple); }

  .issue-actions { display: flex; gap: 6px; }
  .issue-action-btn {
    font-size: 11px; padding: 3px 8px; border-radius: 4px;
    border: 1px solid var(--border); cursor: pointer;
    background: transparent; color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
  }
  .issue-action-btn:hover { background: var(--border); color: var(--text); }
  .issue-action-btn.fix { color: var(--green); border-color: rgba(63, 185, 80, 0.3); }
  .issue-action-btn.fix:hover { background: rgba(63, 185, 80, 0.15); }
  .issue-action-btn.spawn-fix-btn { color: var(--accent); border-color: rgba(88, 166, 255, 0.3); }
  .issue-action-btn.spawn-fix-btn:hover { background: rgba(88, 166, 255, 0.15); }
  .issue-action-btn.log { color: var(--accent); border-color: rgba(88, 166, 255, 0.3); }
  .issue-action-btn.log:hover { background: rgba(88, 166, 255, 0.15); }
  .issue-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

  .issue-summary {
    margin: 4px 0 0 56px; padding: 8px 12px;
    background: var(--bg); border-radius: 4px;
    font-size: 12px; color: var(--text-muted); line-height: 1.5;
    white-space: pre-wrap; max-height: 150px; overflow-y: auto;
    display: none;
  }
  .issue-summary.visible { display: block; }

  .issues-section-header {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    color: var(--text-muted); padding: 12px 0 6px; margin-top: 8px;
    border-bottom: 1px solid var(--border);
  }
  .issues-section-header:first-child { margin-top: 0; }

  /* Conversation split layout */
  .conv-split {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column; /* unsplit = single child fills the column */
  }
  .conv-split[data-orientation="vertical"] { flex-direction: row; }
  .conv-split[data-orientation="horizontal"] { flex-direction: column; }
  .conv-pane {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    position: relative; /* drop overlay anchor */
  }
  /* Place the input bar ABOVE the status-context strip in top mode (the
     status with branch/cost/model is reference info, the input is the
     primary action). Right-rail mode uses CSS Grid which does its own
     ordering — `order` is ignored there, so this rule is harmless in
     both modes. DOM order kept the historical "context above input"
     layout for back-compat with anything that queried by index. */
  .conv-pane > .conv-goal-strip         { order: 0; }
  .conv-pane > .conv-input-context.is-new-session { order: 1; }
  .conv-pane > .conv-model-picker-strip { order: 2; }
  .conv-pane > .conv-input-bar          { order: 3; }
  .conv-pane > .conv-input-context      { order: 4; }
  .conv-pane > .conv-input-hint         { order: 5; }
  .conv-pane.is-codex-session {
    box-shadow: inset 4px 0 0 rgba(88, 166, 255, 0.72);
  }
  .conv-pane.is-cursor-session {
    box-shadow: inset 4px 0 0 rgba(226, 104, 64, 0.72);
  }
  .conv-pane.is-antigravity-session {
    box-shadow: inset 4px 0 0 rgba(242, 204, 96, 0.72);
  }
  .conv-pane.is-hermes-session {
    box-shadow: inset 4px 0 0 rgba(45, 212, 191, 0.72);
  }
  .conv-pane-header {
    display: none;            /* shown when a pane has title chrome */
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 5px 8px 5px 12px;
    border-bottom: 1px solid var(--border, #2a2a2a);
    background: color-mix(in srgb, var(--surface) 82%, var(--bg));
  }
  /* Desktop conversation chrome: session identity, the latest user message,
     and an icon-only pop-out action live outside the transcript scroller.
     This replaces the large sticky transcript card, which read as a floating
     message and could cover the conversation. */
  .conv-pane.has-last-user-message > .conv-pane-header {
    display: flex;
  }
  /* CCC-172: the header shows the session name only. The latest-ask span
     stays in the DOM (its has-last-user-message class still gates header
     visibility) but never renders. */
  .conv-pane-last-user-message { display: none !important; }
  .conv-pane-titlebar {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .conv-pane-titlebar .conv-pane-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .conv-pane-ticket {
    flex: 0 0 auto;
    max-width: 40%;
    min-height: 28px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font: 600 12px/1.2 var(--font-mono, monospace);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  .conv-pane-ticket[hidden] { display: none; }
  .conv-pane-ticket:hover { border-color: var(--text-muted); }
  .conv-pane-ticket:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (pointer: coarse) {
    .conv-pane-ticket { min-width: 44px; min-height: 44px; }
  }
  /* CCC-213: name + "(short id)". flex-wrap pushes the id onto a second
     line (clipped by the 1-line height) whenever the name alone fills the
     row, so the id shows only when there's room and never squeezes it. */
  .conv-pane-title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 6px;
    min-width: 0;
    font-size: 12px;
    line-height: 1.3;
    max-height: 1lh;
    overflow: hidden;
  }
  .conv-pane-title-wrap > .conv-pane-title { flex: 0 1 auto; }
  .conv-pane-title-wrap:has(> .conv-pane-title.is-expanded) { max-height: none; }
  .conv-pane-session-id {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-weight: 400;
    white-space: nowrap;
    cursor: copy;
  }
  .conv-pane-session-id[hidden] { display: none; }
  .conv-pane-session-id code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
  .conv-pane-session-id:hover { color: var(--text); }
  .conv-pane-session-id.copied { color: var(--green); }
  /* CCC-129: desktop headers lead with the session name, like the phone
     toolbar title. */
  @media (min-width: 1201px) {
    .conv-pane-titlebar { flex: 1 1 auto; }
    .conv-pane-titlebar :is(.conv-pane-title, .conv-pane-title-wrap) {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.3;
    }
  }
  /* CCC-149: a single desktop conversation gets the phone's clean session
     header: the sidebar row's avatar and the session name, nothing else.
     Split panes and popouts keep the engine/repo chip and latest message
     so side-by-side panes stay distinguishable. */
  .conv-pane-avatar { display: none; }
  @media (min-width: 1201px) {
    body:not(.conversation-popout) .conv-split:not([data-orientation="vertical"]):not([data-orientation="horizontal"]) .conv-pane-header {
      min-height: 52px;
      padding: 7px 10px 7px 14px;
    }
    body:not(.conversation-popout) .conv-split:not([data-orientation="vertical"]):not([data-orientation="horizontal"]) .conv-pane-titlebar { gap: 12px; }
    body:not(.conversation-popout) .conv-split:not([data-orientation="vertical"]):not([data-orientation="horizontal"]) .conv-pane-avatar:not(:empty) {
      display: inline-flex;
      flex: 0 0 auto;
    }
    body:not(.conversation-popout) .conv-split:not([data-orientation="vertical"]):not([data-orientation="horizontal"]) :is(.conv-pane-category, .conv-pane-last-user-message) {
      display: none;
    }
    body:not(.conversation-popout) .conv-split:not([data-orientation="vertical"]):not([data-orientation="horizontal"]) .conv-pane-titlebar :is(.conv-pane-title, .conv-pane-title-wrap) {
      font-size: 19px;
      line-height: 1.25;
      white-space: nowrap;
    }
    .conv-pane-avatar .wa-av {
      position: relative;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
      box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.18), inset 0 2px 4px rgba(255, 255, 255, 0.25);
    }
    .conv-pane-avatar .wa-face {
      font-size: 22px;
      line-height: 1;
      filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
      font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    }
  }
  .conv-pane-popout {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
  }
  .conv-pane-popout:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  }
  .conv-pane-popout:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
  }
  .conv-pane-popout svg { display: block; }
  body.conversation-popout .conv-pane-popout { display: none; }
  .conv-pane-split-next {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
  }
  .conv-pane-split-next:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  }
  .conv-pane-split-next:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
  }
  .conv-pane-split-next svg { display: block; }
  body.conversation-popout .conv-pane-split-next { display: none; }
  /* Only the single main pane can hand itself off into a fresh split —
     once #convSplit actually holds an orientation (two panes exist), the
     action is either redundant or ambiguous, so hide it everywhere. */
  #convSplit[data-orientation]:not([data-orientation=""]) .conv-pane-split-next {
    display: none;
  }
  /* CCC-154: session ⋮ menu, desktop single-pane header only (phones use
     the toolbar ⋮ menu; split panes/popouts keep their compact header). */
  .conv-pane-session-wrap { display: none; position: relative; flex: 0 0 auto; }
  @media (min-width: 1201px) {
    body:not(.conversation-popout) .conv-split:not([data-orientation="vertical"]):not([data-orientation="horizontal"]) .conv-pane-session-wrap {
      display: inline-flex;
    }
  }
  .conv-pane-session-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
  }
  .conv-pane-session-btn:hover,
  .conv-pane-session-btn[aria-expanded="true"] {
    color: var(--text);
    border-color: var(--text-muted);
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  }
  .conv-pane-session-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .conv-pane-session-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    display: grid;
    gap: 2px;
    min-width: 200px;
    max-width: 360px;
    padding: 4px;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 6px;
    background: var(--surface, #161b22);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  }
  .conv-pane-session-menu[hidden],
  .conv-pane-session-menu [hidden] { display: none; }
  .conv-pane-session-menu [data-role="menu-session-info"]:not([hidden]) {
    display: grid;
    gap: 2px;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid var(--border, #2a2a2a);
  }
  .conv-pane-session-menu .conv-pane-more-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .conv-pane-session-meta { color: var(--text-muted); font-size: 11px; margin-left: 4px; }
  @media (min-width: 1201px) {
    .conversations-view .conv-sticky-header { display: none !important; }
  }
  @media (max-width: 1200px) {
    body:not(.conversation-popout) .conv-pane.has-last-user-message > .conv-pane-header {
      display: none;
    }
  }
  /* The transport pill (Kimi ACP / Codex app-server) is the only entry point
     to bridge recovery, and the rule directly above hides its home -- the
     per-pane header -- on any phone-width pane that has a conversation in it.
     That left a stuck ACP bridge unrecoverable on mobile. Mirror the pill into
     the toolbar breadcrumb, and show it only at the widths where the per-pane
     copy is gone, so desktop does not render the same pill twice. */
  #cccBreadcrumb .ccc-breadcrumb-proc { display: none; }
  @media (max-width: 1200px) {
    #cccBreadcrumb .ccc-breadcrumb-proc:not(:empty) {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex: 0 0 auto;
    }
  }
  /* In single-pane mode the active-pane breadcrumb is mirrored into the
     global toolbar (#cccBreadcrumb), so keep the per-pane header hidden
     to give the sticky "original ask" the slot below the toolbar. In
     split mode each pane still shows its own header so the user can
     tell the two panes apart at a glance. */
  body.conversation-popout .conv-pane > .conv-pane-header,
  .conv-split[data-orientation="vertical"] .conv-pane-header,
  .conv-split[data-orientation="horizontal"] .conv-pane-header,
  body:not(.conversation-popout) .conv-split[data-orientation="vertical"] .conv-pane.has-last-user-message > .conv-pane-header,
  body:not(.conversation-popout) .conv-split[data-orientation="horizontal"] .conv-pane.has-last-user-message > .conv-pane-header {
    display: flex;
  }
  /* Toolbar breadcrumb — same look as the per-pane header but inline
     with the global topbar actions. Hidden by default; updatePaneHeader
     reveals it when the active pane has a row to describe. */
  .ccc-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    min-width: 0; max-width: 72%;
    /* Claim the empty left side of the toolbar. #convStatus (margin-left:auto)
       used to shove the breadcrumb into the right half, leaving the left
       blank while category/title truncated to "claud…"/"U…". order:-1 puts
       the breadcrumb first so that auto-margin pushes the OTHER slots right
       instead, and the wider cap lets the crammed data breathe. */
    order: -1;
    margin-right: auto;
    padding: 2px 8px;
    overflow: hidden;
  }
  .ccc-breadcrumb[hidden] { display: none; }
  .ccc-breadcrumb .ccc-breadcrumb-category {
    flex: 0 1 auto; max-width: 220px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 2px 7px;
    border: 1px solid var(--border); border-radius: 4px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--bg) 70%, var(--surface));
    font-size: 11px; line-height: 1.2;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  }
  .ccc-breadcrumb .ccc-breadcrumb-title {
    min-width: 0; flex: 1 1 auto;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text);
    font-size: 12px; font-weight: 650;
  }
  .ccc-breadcrumb .ccc-breadcrumb-size {
    flex: 0 0 auto;
    padding: 2px 6px;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    color: var(--text-muted, var(--text-2));
    background: color-mix(in srgb, var(--text) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .ccc-breadcrumb .ccc-breadcrumb-popout {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    padding: 0;
    color: var(--text-muted, var(--text-2));
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
  }
  .ccc-breadcrumb .ccc-breadcrumb-popout:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--text) 8%, transparent);
    border-color: color-mix(in srgb, var(--text) 25%, transparent);
  }
  .ccc-breadcrumb .ccc-breadcrumb-popout:focus-visible {
    outline: 2px solid var(--accent, #5b8def);
    outline-offset: 1px;
  }
  .ccc-breadcrumb .ccc-breadcrumb-popout svg { display: block; }
  /* Process-presence indicator (headless / terminal pills + freshness). */
  .ccc-breadcrumb .ccc-breadcrumb-proc,
  .conv-pane-proc {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .conv-pane-proc:empty { display: none; }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill {
    display: inline-flex; align-items: center; gap: 5px;
    height: 20px; padding: 0 8px;
    font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.02em;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
    white-space: nowrap;
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill[data-bridge-recovery] {
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.05s;
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill[data-bridge-recovery]:hover {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill[data-bridge-recovery]:active {
    transform: translateY(1px);
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
  }
  /* On — a live process exists. */
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill.is-on {
    color: var(--ok, #3fb950);
    background: color-mix(in srgb, var(--ok, #3fb950) 12%, transparent);
    border-color: color-mix(in srgb, var(--ok, #3fb950) 35%, transparent);
  }
  /* Streaming — the headless pill while CCC live-tails its stdout as
     stream-json. Teal so it reads distinctly from the plain-green on-state. */
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill.is-streaming {
    color: var(--accent-teal, #2bb6a6);
    background: color-mix(in srgb, var(--accent-teal, #2bb6a6) 14%, transparent);
    border-color: color-mix(in srgb, var(--accent-teal, #2bb6a6) 40%, transparent);
  }
  /* Off — no such process. Muted, dot hollow. */
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill.is-off {
    color: var(--text-muted, var(--text-2));
    background: transparent;
    border-color: color-mix(in srgb, var(--text) 12%, transparent);
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill.is-off .ccc-proc-dot {
    background: transparent;
    box-shadow: inset 0 0 0 1px currentColor;
  }
  /* Stale — headless alive but another writer advanced the transcript. */
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill.is-stale {
    color: var(--warn, #d29922);
    background: color-mix(in srgb, var(--warn, #d29922) 14%, transparent);
    border-color: color-mix(in srgb, var(--warn, #d29922) 40%, transparent);
  }
  /* Waking — a resume was just sent; the process is spawning but the next
     liveness poll hasn't caught it yet. Amber so it never flashes a false
     "no process" during the ~1-2s window. Dot softly pulses (opacity only —
     compositor-cheap, unlike box-shadow). */
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill.is-waking {
    color: var(--warn, #d29922);
    background: color-mix(in srgb, var(--warn, #d29922) 10%, transparent);
    border-color: color-mix(in srgb, var(--warn, #d29922) 30%, transparent);
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-pill.is-waking .ccc-proc-dot {
    animation: ccc-proc-wake-pulse 1s ease-in-out infinite;
  }
  @keyframes ccc-proc-wake-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-checked {
    flex: 0 0 auto;
    font-size: 10px;
    color: var(--text-muted, var(--text-2));
    white-space: nowrap;
  }
  #cccBreadcrumb .ccc-proc-checked { display: none; }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-refresh {
    flex: 0 0 auto;
    margin-left: 2px;
    padding: 0;
    width: 18px; height: 18px; line-height: 18px;
    border: none; border-radius: 4px;
    background: transparent;
    color: var(--text-muted, var(--text-2));
    font-size: 12px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-refresh:hover {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
  }
  :is(.ccc-breadcrumb, .conv-pane-proc) .ccc-proc-refresh.is-spinning {
    animation: ccc-compact-spin 0.6s linear infinite;
    color: var(--accent);
  }
  .conv-pane-titlebar {
    min-width: 0;
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .conv-pane-category {
    flex: 0 1 auto;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--bg) 70%, var(--surface));
    font-size: 11px;
    line-height: 1.2;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  }
  .conv-pane-category:empty { display: none; }
  /* Engine icon inside the category chip (CCC-475) — replaces the engine
     word in split-mode titlebars. Colors ride the shared engine selectors
     next to .conv-session-icon. Inline-block (not flex on the chip) so
     text-only chips keep their ellipsis behavior. */
  .conv-pane-cat-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 36px;
    height: 16px;
    vertical-align: -2px;
  }
  .conv-pane-cat-icon svg {
    display: block;
    width: 13px;
    height: 13px;
  }
  .conv-pane-cat-label { margin-left: 5px; }
  .conv-pane-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
  }
  /* CCC-1172: the header's two asks are truncated by ellipsis; role=button
     (set only while they carry text) signals the click-to-expand affordance,
     and .is-expanded lets the whole string wrap inline. */
  .conv-pane-title[role="button"],
  .conv-pane-last-user-message[role="button"] { cursor: pointer; }
  .conv-pane-title:focus-visible,
  .conv-pane-last-user-message:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-radius: 3px;
  }
  .conv-pane-title.is-expanded,
  .conv-pane-last-user-message.is-expanded {
    white-space: normal;
    text-overflow: clip;
  }
  /* JSONL transcript size badge next to the pane title. Helps the user
     correlate slow first-paint with conversation size. */
  .conv-pane-size {
    flex: 0 0 auto;
    margin-left: 8px;
    padding: 2px 6px;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    color: var(--text-muted, var(--text-2));
    background: color-mix(in srgb, var(--text) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .conv-split[data-orientation="vertical"] .conv-pane.is-active,
  .conv-split[data-orientation="horizontal"] .conv-pane.is-active {
    box-shadow: inset 0 0 0 1px var(--accent, #4ea1ff);
  }
  .conv-split[data-orientation="vertical"] .conv-pane.is-active.is-codex-session,
  .conv-split[data-orientation="horizontal"] .conv-pane.is-active.is-codex-session {
    box-shadow:
      inset 0 0 0 1px rgba(88, 166, 255, 0.72),
      inset 4px 0 0 rgba(88, 166, 255, 0.88);
  }
  .conv-split[data-orientation="vertical"] .conv-pane.is-active.is-cursor-session,
  .conv-split[data-orientation="horizontal"] .conv-pane.is-active.is-cursor-session {
    box-shadow:
      inset 0 0 0 1px rgba(226, 104, 64, 0.72),
      inset 4px 0 0 rgba(226, 104, 64, 0.86);
  }
  .conv-split[data-orientation="vertical"] .conv-pane.is-active.is-antigravity-session,
  .conv-split[data-orientation="horizontal"] .conv-pane.is-active.is-antigravity-session {
    box-shadow:
      inset 0 0 0 1px rgba(242, 204, 96, 0.72),
      inset 4px 0 0 rgba(242, 204, 96, 0.86);
  }
  .conv-split[data-orientation="vertical"] .conv-pane.is-active.is-hermes-session,
  .conv-split[data-orientation="horizontal"] .conv-pane.is-active.is-hermes-session {
    box-shadow:
      inset 0 0 0 1px rgba(45, 212, 191, 0.72),
      inset 4px 0 0 rgba(45, 212, 191, 0.86);
  }
  /* CCC-129: in a split, the focused pane's header wears the same purple
     as the focused sidebar row; the unfocused pane's header carries a blue
     rail matching its .conv-item.in-other-pane row, so each list row maps
     to its pane at a glance. */
  .conv-split[data-orientation="vertical"] .conv-pane.is-active > .conv-pane-header,
  .conv-split[data-orientation="horizontal"] .conv-pane.is-active > .conv-pane-header {
    background: color-mix(in srgb, var(--purple) 20%, var(--surface));
    border-bottom-color: var(--purple);
    box-shadow: inset 4px 0 0 var(--purple);
  }
  .conv-split[data-orientation="vertical"] .conv-pane:not(.is-active) > .conv-pane-header,
  .conv-split[data-orientation="horizontal"] .conv-pane:not(.is-active) > .conv-pane-header {
    box-shadow: inset 4px 0 0 color-mix(in srgb, #58a6ff 70%, transparent);
  }
  .conv-pane-close {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
  }
  .conv-pane-close:hover { color: var(--text, #eee); background: var(--bg-hover, rgba(255,255,255,0.06)); }
  /* Per-pane header actions ride the header visibility gate, so they only
     appear in split mode / popouts. Keep the header compact: Annotate is a
     direct icon and less-frequent recording controls share an overflow menu. */
  .conv-pane-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
  }
  .conv-pane-action {
    background: transparent;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 4px;
    color: var(--text-muted, #999);
    cursor: pointer;
    font-size: 11px;
    line-height: 1.2;
    padding: 3px 7px;
    white-space: nowrap;
  }
  .conv-pane-action:hover { color: var(--text, #eee); background: var(--bg-hover, rgba(255,255,255,0.06)); }
  /* CCC-1156: per-pane annotate is a split-view affordance — it only exists so
     the user can pick WHICH pane's session to annotate. Single-pane mode uses
     the global annotate entry points instead. #convSplit carries
     data-orientation="vertical|horizontal" only while 2+ panes are mounted. */
  #convSplit[data-orientation=""] [data-role="pane-annotate"] { display: none; }
  .conv-pane-icon-action,
  .conv-pane-more-trigger {
    width: 27px;
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    font-size: 16px;
  }
  .conv-pane-more { position: relative; }
  .conv-pane-more-trigger { list-style: none; }
  .conv-pane-more-trigger::-webkit-details-marker { display: none; }
  .conv-pane-more-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 174px;
    padding: 4px;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 6px;
    background: var(--surface, #161b22);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  }
  .conv-pane-more[open] .conv-pane-more-menu { display: grid; gap: 2px; }
  .conv-pane-more-item {
    border: 0;
    border-radius: 4px;
    padding: 6px 8px;
    color: var(--text, #eee);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    text-align: left;
  }
  .conv-pane-more-item:hover { background: var(--bg-hover, rgba(255,255,255,0.06)); }
  /* Per-pane Verbose toggle (CCC-475) — same pressed treatment as the rail
     topbar's .verbose-toggle-btn. */
  .conv-pane-action[aria-pressed="true"] {
    background: rgba(88,166,255,0.18);
    color: var(--text);
    border-color: rgba(88,166,255,0.45);
  }
  .conv-pane-more-item[aria-checked="true"] {
    color: var(--text);
    background: rgba(88,166,255,0.18);
  }
  /* Visual-only "Clear" (CCC-474): everything rendered at or below the
     watermark is hidden for a clean recording surface; the transcript on
     disk is untouched and full history returns on the next (re)select. */
  .conversations-view .ccc-video-cleared { display: none !important; }
  .conversations-view.is-video-cleared .conv-sticky-header { display: none !important; }

  .conv-split-divider {
    flex: 0 0 4px;
    background: var(--border, #2a2a2a);
    cursor: col-resize;
    transition: background 0.1s ease;
  }
  .conv-split-divider:hover { background: var(--accent, #4ea1ff); }
  .conv-split[data-orientation="horizontal"] .conv-split-divider {
    cursor: row-resize;
  }

  .conv-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface, #161b22);
    color: var(--text, #eee);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1000;
  }
  .conv-toast.visible { opacity: 1; }

  .error-report-btn {
    flex: 0 0 auto;
    margin-inline-start: 8px;
    padding: 4px 8px;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    white-space: normal;
  }
  .error-report-btn:hover { background: var(--surface-2); }
  .error-report-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .op-toast { flex-wrap: wrap; width: max-content; box-sizing: border-box; max-width: min(520px, calc(100vw - 24px)) !important; }
  .op-toast > span { flex-basis: 100% !important; }
  .op-toast .error-report-btn { margin-inline-start: 0; }
  .conv-live-tool-inline.is-error { flex-wrap: wrap; }
  .conv-live-tool-inline.is-error .cl-tool { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  #bugReportModal { z-index: 10002; }
  @media (max-width: 600px) {
    .error-report-btn { min-height: 44px; }
  }

  .conv-pane-drop-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    display: none;
  }
  .conv-pane-drop-overlay.active { display: block; }
  .conv-pane-drop-overlay .drop-zone {
    position: absolute;
    pointer-events: auto;
    border: 1px dashed var(--accent, #4ea1ff);
    background: rgba(78, 161, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent, #4ea1ff);
    font-size: 12px;
    font-weight: 500;
    transition: background 0.08s ease;
  }
  .conv-pane-drop-overlay .drop-zone.right  { right: 0; top: 0; bottom: 0; width: 22%; }
  .conv-pane-drop-overlay .drop-zone.bottom { left: 0; right: 0; bottom: 0; height: 22%; }
  .conv-pane-drop-overlay .drop-zone.over   { background: rgba(78, 161, 255, 0.18); }
  /* Replace zone: full-pane target, only shown when split is already full (is-replace). */
  .conv-pane-drop-overlay .drop-zone.replace { inset: 0; width: auto; height: auto; display: none; }
  .conv-pane-drop-overlay.is-replace .drop-zone.right,
  .conv-pane-drop-overlay.is-replace .drop-zone.bottom { display: none; }
  .conv-pane-drop-overlay.is-replace .drop-zone.replace { display: flex; }
  /* Suppress overlay below 900px viewport (split is unsupported there). */
  @media (max-width: 900px) {
    .conv-pane-drop-overlay { display: none !important; }
  }

  .conv-scroll-end-btn,
  .conv-scroll-last-btn,
  .conv-scroll-next-btn,
  .conv-scroll-segment-btn {
    position: absolute;
    right: 20px;
    bottom: 96px;
    z-index: 12;
    height: 32px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.14s ease, transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  }
  .conv-scroll-end-btn.visible,
  .conv-scroll-last-btn.visible,
  .conv-scroll-next-btn.visible,
  .conv-scroll-segment-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .conv-scroll-end-btn:hover,
  .conv-scroll-last-btn:hover,
  .conv-scroll-next-btn:hover,
  .conv-scroll-segment-btn:hover {
    border-color: var(--accent);
    background: var(--surface-2);
  }
  .conv-scroll-end-btn svg,
  .conv-scroll-last-btn svg,
  .conv-scroll-next-btn svg,
  .conv-scroll-segment-btn svg { flex: none; }
  .conv-scroll-end-btn span,
  .conv-scroll-last-btn span,
  .conv-scroll-next-btn span,
  .conv-scroll-segment-btn span {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
  }

  /* Big floating "read aloud" button: reads the assistant turn on screen. */
  .conv-scroll-speak-btn {
    position: absolute;
    right: 20px;
    bottom: 190px;
    z-index: 12;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.14s ease, transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  }
  .conv-scroll-speak-btn.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .conv-scroll-speak-btn:hover { border-color: var(--accent); background: var(--surface-2); }
  .conv-scroll-speak-btn.speaking { border-color: var(--accent, var(--cyan)); color: var(--accent, var(--cyan)); }
  .conv-scroll-speak-btn.speaking.paused { opacity: 0.8; }
  /* Blue identifies the current clip arriving live; the outer ring continues
     to show ready/processing coverage for the whole turn. */
  .conv-scroll-speak-btn.tts-streaming {
    color: #93c5fd;
    border-color: #60a5fa;
    background: #14345b;
    box-shadow: 0 0 0 2px #60a5fa40, 0 8px 24px rgba(0,0,0,0.35);
  }
  .conv-scroll-speak-btn.tts-streaming::after {
    content: 'LIVE';
    position: absolute;
    top: -12px;
    right: -7px;
    padding: 2px 5px;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    background: #2563eb;
    color: #fff;
    font: 700 9px/1.2 system-ui, sans-serif;
    letter-spacing: 0.5px;
    pointer-events: none;
  }
  /* Progress ring around the floating speaker, the round version of the
     composer Speak bar. Idle: amber/green arc = share of the on-screen turn's
     audio sent to processing and ready. Reading: accent = read, green =
     ready, amber = processing, dim = not sent yet. */
  .conv-scroll-speak-btn::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  }
  .conv-scroll-speak-btn.speaking::before {
    display: block;
    background: conic-gradient(
      var(--accent, var(--cyan)) calc(var(--tts-play, 0) * 1turn),
      color-mix(in srgb, var(--text, #c9d1d9) 14%, transparent) 0);
  }

  .speaker-tools { position: absolute; width: 84px; height: 84px; z-index: 13; pointer-events: none; }
  .speaker-tools[hidden] { display: none; }
  .speaker-rate-dial { width: 84px; height: 84px; overflow: visible; touch-action: none; pointer-events: none; }
  .speaker-rate-track { fill: none; stroke: var(--border, #43545a); stroke-width: 2; }
  .speaker-rate-hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: grab; }
  .speaker-rate-dial:focus-visible { outline: 2px solid var(--accent, #00cdd6); border-radius: 50%; }
  .speaker-rate-arc { fill: none; stroke: #38bdf8; stroke-width: 3; stroke-linecap: round; pointer-events: none; }
  .speaker-rate-thumb { fill: #38bdf8; stroke: var(--surface, #171d23); stroke-width: 1.5; pointer-events: none; }
  .speaker-tools.is-adjusting .speaker-rate-arc { stroke-width: 5; }
  .speaker-tools.is-adjusting .speaker-rate-thumb { r: 5; fill: #7dd3fc; }
  .speaker-tools.is-adjusting .speaker-rate-hit { cursor: grabbing; }
  .speaker-dock { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 2px 4px; border: 1px solid var(--border, #43545a); border-radius: 12px; background: var(--surface, #161b22); box-shadow: 0 2px 8px rgba(0,0,0,.4); pointer-events: auto; }
  .speaker-rate-value { min-width: 34px; padding: 0 4px; text-align: center; color: var(--text, #c9d1d9); font: 600 11px/20px ui-monospace, monospace; }
  .speaker-next-sentence, .speaker-voice-switch { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text, #c9d1d9); font: 18px/1 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
  .speaker-voice-switch { font-size: 13px; }
  .speaker-next-sentence:hover, .speaker-voice-switch:hover { color: var(--accent, #00cdd6); background: color-mix(in srgb, var(--accent, #00cdd6) 15%, transparent); }
  .speaker-next-sentence:disabled { opacity: 0.35; cursor: default; }
  .speaker-voice-name { position: absolute; bottom: 88px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 0 8px; border-radius: 8px; background: var(--surface, #161b22); color: var(--text, #c9d1d9); font: 600 11px/20px ui-monospace, monospace; }
  .speaker-voice-name[hidden] { display: none; }
  .conv-pane:has(.conv-scroll-speak-btn) .tts-rate-control { display: none; }

  /* Seam marker between two CCC continuation segments in the merged
     conversation view: messages above came from the earlier session,
     messages below are the session that continued from it. */
  .event.conv-session-boundary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 12px;
  }
  .conv-session-boundary .csb-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--border);
  }
  .conv-session-boundary .csb-label {
    flex: 0 1 auto;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
  }
  .event.conv-session-boundary {
    margin: 32px 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .conv-session-boundary .csb-label {
    color: var(--text);
    font-weight: 600;
    border-color: var(--accent);
  }
  .conv-session-boundary .csb-cfg {
    flex: 0 0 auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface-2);
  }
  .conv-session-boundary .csb-cfg.is-changed {
    color: var(--text);
    border-color: var(--accent);
    font-weight: 600;
  }
  .conv-session-boundary .csb-label:hover {
    color: var(--text);
    border-color: var(--accent);
  }
  .conv-session-boundary .csb-jump {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px dashed var(--border);
    background: none;
  }
  .conv-session-boundary .csb-jump:hover {
    color: var(--text);
    border-color: var(--accent);
  }

  /* Bottom-left "Live refresh" pill: shows when setInterval callbacks
     are firing normally, hides when the user is typing (matching the
     global setInterval mute in app.js). Gives a small but constant
     reassurance that the auto-refresh isn't permanently disabled. */
  .live-refresh-cluster {
    /* Sits above the sidebar footer (~42px: 30px btn + 6px*2 pad) so the
       Active-Group-chat pill no longer covers the footer CPU/health meter
       (#cccHealth) at bottom-left. */
    position: fixed; left: 10px; bottom: 48px;
    display: inline-flex; align-items: center; gap: 6px;
    z-index: 100;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  }
  .live-refresh-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-muted, #8b949e);
    font-size: 10px; line-height: 1;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    pointer-events: auto;
    user-select: none;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    backdrop-filter: blur(4px);
  }
  .live-refresh-pill .live-refresh-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green, #4ade80);
    box-shadow: 0 0 4px var(--green, #4ade80);
    animation: live-refresh-pulse 1.6s ease-in-out infinite;
  }
  @keyframes live-refresh-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50%      { opacity: 1.0;  transform: scale(1.0); }
  }
  /* Superseded by the footer poller/health strip (#pollerWrap): it shows
     per-poller liveness AND CCC self-health inline in the footer, gated the
     same "muted while typing" way. This fixed pill floated over that strip's
     bottom-left corner and hid it, so it's removed. The cluster stays for the
     Active-Group-chat alert below. */
  #liveRefreshPill { display: none; }
  .active-group-chat-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(153, 27, 27, 0.92);
    color: #fff;
    font-size: 10px; font-weight: 700; line-height: 1;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.85);
    box-shadow: 0 0 0 1px rgba(127, 29, 29, 0.22), 0 4px 12px rgba(127, 29, 29, 0.22);
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(4px);
  }
  .active-group-chat-pill[hidden] {
    display: none;
  }
  .active-group-chat-pill:hover {
    background: rgba(185, 28, 28, 0.96);
  }
  .active-group-chat-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fecaca;
    box-shadow: 0 0 6px rgba(254, 202, 202, 0.9);
  }
  /* Hide the pill whenever a text input is focused — that's exactly
     when setInterval callbacks are muted in app.js. body.has-text-focus
     is kept in sync by focusin/focusout in app.js. (This used to be
     body:has(textarea:focus); Blink folds every :has() rule into one
     shared invalidation set and re-fires it on the anchor for any DOM
     mutation under it, so a body-anchored :has() re-styled ~500 sidebar
     badges on every forced layout read during a session open.) */
  body.has-text-focus .live-refresh-cluster {
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
  }

  /* Conversations view */
  .conversations-view {
    flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 20px 16px; position: relative;
    /* min-width:0 lets the flex child shrink below its content's
       intrinsic width so long URLs / unbreakable tokens in a child can
       wrap instead of forcing a horizontal scrollbar on the pane. The
       overflow-x:hidden is the safety net — code blocks have their own
       inner scroll, so clipping the pane doesn't lose any content. */
    min-width: 0;
    /* min-height:0 is the flex-column counterpart: without it a flex item
       defaults to min-height:auto and refuses to shrink below its content's
       intrinsic height, so a very tall transcript makes THIS scroller grow
       to full content height instead of scrolling internally. The pane then
       balloons past the viewport and the mobile toolbar (with the Back
       button) scrolls off the top — content-dependent, so only some
       sessions hit it. The status-pos-right grid path already sets this
       (~min-height:0 rule below); this covers the base flex path too. */
    min-height: 0;
    /* Isolate transcript layout/paint from siblings so streaming
       updates inside it don't force reflow on the composer below.
       Was visible as typing hitches while sessions streamed or the
       1s live-tool ticker re-rendered the inline status pill. */
    contain: layout style;
  }
  /* CCC-1033: centered "LAST WRITTEN: Ng ago" row below the transcript.
     Empty text (no conversation open, or row has no modified/mtime) collapses
     it via :empty rather than a JS-toggled hidden class, so it never has to be
     kept in sync with the conv-switch code path. */
  .conv-last-written {
    text-align: center; padding: 2px 0 4px; font-size: 11px;
    color: var(--text-muted); opacity: 0.65; flex-shrink: 0;
  }
  .conv-last-written:empty { display: none; }
  .conv-sticky-header {
    /* Sits at top:0 of conversations-view (its scroll container). The
       :has() rule below pushes it to top:30px when the live-tool strip
       is also stuck above it, so they don't overlap. No negative margins
       — those caused the top half to render above the scroll origin
       (clipped by overflow:hidden) and made absolute children appear to
       hide behind .toolbar. */
    position: sticky; top: 0; z-index: 5;
    padding: 12px 12px 12px; margin: 0 -12px 8px;
    background: #10151c;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 8px rgba(0,0,0,0.45);
    display: flex; flex-direction: column;
    box-sizing: border-box;
  }
  /* The dismiss button sets the semantic `hidden` state. Keep it stronger
     than the mobile right-rail fallback's `display:block !important`, or the
     Original ask panel cannot actually be dismissed at that breakpoint. */
  body.status-pos-right .conv-sticky-header[hidden],
  .conv-sticky-header[hidden] { display: none !important; }
  .conv-sticky-header .user-msg {
    font-size: 14px; color: var(--text); line-height: 1.4;
    font-weight: 700;
    flex: 1 1 auto; min-height: 0;
  }
  .conv-sticky-header .label { color: var(--green); font-weight: 600; font-size: 11px; text-transform: uppercase; margin-bottom: 4px; }
  .conv-sticky-header__resize-handle {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 10px; cursor: ns-resize;
    display: flex; align-items: center; justify-content: center;
    z-index: 6; touch-action: none; user-select: none;
    background: transparent;
    transition: background 0.12s;
  }
  .conv-sticky-header__resize-handle::before {
    content: ''; display: block;
    width: 40px; height: 3px; border-radius: 2px;
    background: rgba(139,148,158,0.45);
    transition: background 0.12s, width 0.12s;
  }
  .conv-sticky-header__resize-handle:hover::before,
  .conv-sticky-header__resize-handle.is-dragging::before {
    background: var(--accent);
    width: 60px;
  }
  .conv-sticky-header__resize-handle:hover,
  .conv-sticky-header__resize-handle.is-dragging {
    background: rgba(88,166,255,0.08);
  }
  /* Expand chevron — small tab anchored at the bottom-center of the
     sticky header. Click toggles `.is-expanded`, which grows the panel
     from its default 170px to half the viewport height for a closer
     read of the asks + activity. State is ephemeral (per-conversation,
     resets on conv switch). */
  .conv-sticky-header__collapse {
    position: absolute; left: 50%; transform: translateX(-50%);
    bottom: -10px;
    width: 32px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: #10151c;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    color: var(--text-muted);
    font-size: 11px; font-family: inherit;
    cursor: pointer; padding: 0; line-height: 1;
    z-index: 7;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
  }
  .conv-sticky-header__collapse:hover {
    color: var(--accent);
    border-color: rgba(88,166,255,0.4);
    background: #141b25;
  }
  .conv-pane.has-conv-bg .conv-sticky-header,
  .conv-pane.has-conv-bg .conv-sticky-header__collapse {
    background: var(--conv-surface);
    box-shadow: 0 4px 10px var(--conv-shadow);
  }
  .conv-pane.has-conv-bg .conv-sticky-header .csh-row {
    background: var(--conv-surface-2);
    border-color: var(--conv-border);
    color: var(--conv-text);
  }
  .conv-pane.has-conv-bg .conv-sticky-header .csh-col-ask {
    border-right-color: var(--conv-border);
  }
  .conv-pane.has-conv-bg .conv-sticky-header .csh-col-ask > .csh-ask-earlier {
    border-top-color: var(--conv-border);
  }
  .conv-pane.has-conv-bg .conv-sticky-header .csh-col-ask .ask-first,
  .conv-pane.has-conv-bg .conv-sticky-header .csh-col-ask .earlier-first {
    color: var(--conv-text);
  }
  .conv-pane.has-conv-bg .conv-sticky-header .csh-col-ask .ask-rest {
    color: var(--conv-text-muted);
    opacity: 1;
  }
  .conv-pane.has-conv-bg .conv-sticky-header__collapse:hover {
    background: var(--conv-surface-2);
  }
  .conv-sticky-header__collapse-icon { display: inline-block; line-height: 1; }
  /* When expanded, the unified panel grows to half the viewport height.
     The fixed-height rule in `.csh-row` is overridden here. */
  .conv-sticky-header.is-expanded .csh-row {
    height: 50vh;
  }
  .conversations-view .event { margin-bottom: 4px; padding: 6px 12px; border-radius: 6px; border-left: 3px solid transparent; }
  /* Assistant rows — Claude-Desktop-style clean prose. No background fill,
     no left border, subtle metadata so the eye lands on the prose itself. */
  .conversations-view .event.assistant { background: transparent; border: none; padding: 24px 0 4px; margin-bottom: 8px; position: relative; }
  /* Meta (line number + timestamp) used to float:right, eating the first
     line's width so the paragraph wrapped short. Lift it out of the text
     flow entirely — overlaid top-right, only visible on hover — so prose
     gets the full column width. */
  .conversations-view .event.assistant .line-num,
  .conversations-view .event.assistant .msg-ts {
    opacity: 0.58; font-size: 12px; line-height: 1.35; float: none;
    position: absolute; top: 2px;
    transition: opacity 0.12s;
    background: var(--bg);
    padding: 0 3px; border-radius: 3px;
    pointer-events: none;
  }
  /* line-num is width-bounded ("L" + ≤5 digits ≈ 42px) so it anchors the
     right edge; the timestamp sits left of it. The old layout reversed
     them with a fixed 76px gap, and any stamp wider than that ("84
     minutes ago", "Yesterday · 14:30") overlapped the L badge (CCC-106). */
  .conversations-view .event.assistant .line-num { right: 0; }
  .conversations-view .event.assistant .msg-ts { right: 104px; }
  .conversations-view .event.assistant .assistant-message-actions {
    opacity: 0.46; font-size: 10px; float: none;
    position: absolute; top: 2px; right: 56px;
    display: inline-flex; align-items: center; gap: 2px;
    transition: opacity 0.12s;
    background: var(--bg);
    padding: 0 2px; border-radius: 4px;
  }
  .conversations-view .event.assistant .assistant-message-action {
    width: 18px; height: 18px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 4px;
    background: transparent; color: var(--text-muted);
    font-size: 11px; line-height: 1;
    cursor: pointer;
  }
  .conversations-view .event.assistant .assistant-message-action:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
  }
  .conversations-view .event.assistant .assistant-message-action.copied { color: var(--green); }
  .conversations-view .event.assistant .assistant-message-action.speaking { color: var(--accent); }
  .conversations-view .event.assistant .assistant-message-action.speaking.paused { color: var(--text-muted); opacity: 0.7; }
  .conversations-view .event.assistant:hover .line-num,
  .conversations-view .event.assistant:hover .msg-ts,
  .conversations-view .event.assistant:hover .assistant-message-actions,
  .conversations-view .event.assistant:focus-within .assistant-message-actions { opacity: 0.7; }
  .conversations-view .event.assistant .assistant-text,
  .conversations-view .stream-bubble .assistant-text {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
  }
  .conversations-view .whatsapp-bridge-sender {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 6px;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(139, 148, 158, 0.24);
    background: rgba(13, 17, 23, 0.24);
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .peer-sender {
    display: inline-flex; align-items: center; gap: 4px;
    margin-right: 8px; padding: 1px 7px; border-radius: 999px;
    font-size: 11px; line-height: 16px; vertical-align: middle;
    background: color-mix(in srgb, var(--accent, #4c8bf5) 14%, transparent);
    color: var(--accent, #4c8bf5);
  }
  .peer-sender-mode { opacity: 0.65; font-size: 10px; }
  /* Narrow screens: a 999px pill with nowrap-less flex children collapsed into
     a tall blob of one-word-per-line text. Let the chip wrap as a normal
     inline-block row of labels and keep its type small regardless of the
     bubble's font theme. */
  .peer-sender {
    display: inline-flex; flex-wrap: wrap; max-width: 100%; box-sizing: border-box;
    border-radius: 10px; font-style: normal; font-size: 11px; line-height: 16px;
    column-gap: 6px;
  }
  .peer-sender > * { white-space: nowrap; font-size: inherit; font-style: normal; }
  .peer-sender-mode { font-size: 10px; }
  .peer-sender-name { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  /* Cross-session (UDS peer) delivery gets its own green tint so it reads
     distinctly from a normal chat turn -- e.g. the WatchTower reconciler's
     release instruction, or any other Claude-to-Claude peer message.
     Keep the tint quiet and the report body upright for sustained reading. */
  .conversations-view .event.user_text.peer-message,
  .conv-pane.has-conv-bg .conversations-view .event.user_text.peer-message {
    display: block;
    width: fit-content;
    max-width: min(85%, 76ch);
    margin-left: auto;
    margin-right: 0;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--green) 28%, transparent);
    border-radius: 12px;
    background: var(--conv-peer-bg, color-mix(in srgb, var(--green) 6%, transparent));
    box-shadow: none;
  }
  .conversations-view .event.user_text.peer-message .user-msg,
  .conv-pane.has-conv-bg .conversations-view .event.user_text.peer-message .user-msg {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    border-radius: 0;
    color: var(--conv-text, var(--text));
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
  }
  .conversations-view .event.user_text.peer-message.has-user-steer .user-msg { padding-right: 0; }
  .event.user_text.peer-message .peer-sender { margin-bottom: 8px; }
  .event.user_text.peer-message.has-user-steer .peer-sender { max-width: calc(100% - 44px); }
  .event.user_text.peer-message .peer-sender-mode { white-space: normal; overflow-wrap: anywhere; }
  /* Structured reports share one reading layout across conversation engines. */
  .event.user_text.peer-message .peer-structured { white-space: normal; line-height: 1.65; max-width: 72ch; font-style: normal; font-weight: 400; }
  .peer-report-preview { cursor: pointer; min-height: 44px; overflow-wrap: anywhere; line-height: 1.6; }
  .peer-report-preview:focus-visible { outline: 2px solid var(--accent, #4c8bf5); outline-offset: 3px; border-radius: 4px; }
  .peer-report-summary { display: block; margin: 4px 0; }
  .peer-report-expand { display: block; font-size: 0.86em; color: var(--conv-accent, var(--accent)); text-decoration: underline; text-underline-offset: 3px; }
  .peer-report[open] > .peer-report-preview { margin-bottom: 12px; }
  .peer-report-body { overflow-wrap: anywhere; }
  .peer-structured .peer-para { margin: 0 0 8px; }
  .peer-structured .peer-section { margin: 0 0 14px; }
  .peer-structured .peer-section:last-child,
  .peer-structured .peer-section > .peer-para:last-child { margin-bottom: 0; }
  .peer-structured .peer-section-label { display: block; margin-bottom: 4px; font-size: 0.86em; font-weight: 500; }
  .peer-structured .peer-section-label + .peer-para { display: block; }
  .peer-structured .peer-section-label + .peer-para + .peer-para { margin-top: 8px; }
  .peer-structured .peer-list { margin: 4px 0 0; padding-left: 20px; list-style: disc; }
  .peer-structured .peer-list li { margin: 6px 0; overflow-wrap: anywhere; }
  .peer-structured .peer-files { font-size: 0.88em; }
  .peer-structured .peer-file-ref { font-size: 0.88em; overflow-wrap: anywhere; }
  .peer-structured .peer-files .peer-file-ref { font-size: inherit; }
  .peer-structured strong { font-weight: 500; }
  .peer-image-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
  .peer-image-gallery figure { flex: 0 1 240px; min-width: 0; max-width: 100%; margin: 0; }
  .peer-image-gallery img.msg-image { width: 100%; max-height: 180px; object-fit: contain; }
  .peer-image-gallery figcaption { font-size: 12px; overflow-wrap: anywhere; }
  .event.system.peer-held .system-compact-text { opacity: 0.7; }
  .event.system.peer-held .peer-held-preview { font-style: italic; }
  /* User bubble — Claude-Desktop-style chat bubble. No label, no left
     border, rounded corners, constrained width, subtle blue tint. */
  .conversations-view .event.user_text {
    /* Aurora bubble (CCC-116): blue→violet gradient fill under a luminous
       gradient hairline (two-layer background-clip trick), plus a faint
       cool glow. Distinctive without shouting — the text stays plain. */
    background:
      linear-gradient(135deg, rgba(88, 166, 255, 0.16), rgba(163, 113, 247, 0.10) 65%, rgba(57, 210, 192, 0.08)) padding-box,
      linear-gradient(135deg, rgba(88, 166, 255, 0.50), rgba(163, 113, 247, 0.30) 70%, rgba(57, 210, 192, 0.25)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 2px 14px rgba(88, 166, 255, 0.07);
    /* Chat-style: right-aligned bubble with a tucked corner (CCC-116). */
    border-radius: 14px 14px 4px 14px;
    padding: 8px 14px;
    max-width: 85%;
    margin-left: auto;
    margin-right: 0;
    width: fit-content;
    position: relative;
  }
  .conversations-view .event.user_text .label { display: none; }
  .conversations-view .event.user_text .line-num,
  .conversations-view .event.user_text .msg-ts { display: none; }
  .conversations-view .event.user_text .user-msg {
    margin-top: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 15.5px;
    line-height: 1.6;
    /* Regular weight + normal text color — the tinted bubble carries the
       "this is you" signal; bold accent text read as shouting (CCC-116). */
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    font-weight: 410;
  }
  .codex-ambient-context {
    margin: 0 0 8px;
    min-width: min(420px, 100%);
    border: 1px solid rgba(57, 210, 192, 0.28);
    border-radius: 8px;
    background: rgba(57, 210, 192, 0.06);
    color: var(--text-muted);
    font-size: 12px;
  }
  .codex-ambient-context summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    cursor: pointer;
    list-style: none;
  }
  .codex-ambient-context summary::-webkit-details-marker { display: none; }
  .codex-ambient-context summary::before { content: '▸'; color: var(--cyan); }
  .codex-ambient-context[open] summary::before { content: '▾'; }
  .codex-ambient-context__label { color: var(--text); font-weight: 600; }
  .codex-ambient-context__source {
    margin-left: auto;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
  }
  .codex-ambient-context__body {
    max-height: 260px;
    margin: 0;
    padding: 0 9px 9px;
    overflow: auto;
    white-space: pre-wrap;
    color: var(--text-muted);
    font: 12px/1.5 var(--font-mono);
  }
  .conversations-view .event.user_text.has-user-steer .user-msg {
    padding-right: 44px;
  }
  .user-message-steer {
    position: absolute;
    top: 5px;
    right: 7px;
    height: 21px;
    padding: 0 7px;
    border-radius: 4px;
    border: 1px solid rgba(88,166,255,0.32);
    background: rgba(13,17,23,0.22);
    color: var(--text-muted);
    font: 700 10px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    cursor: pointer;
    opacity: 0.72;
  }
  .user-message-steer:hover,
  .user-message-steer:focus-visible {
    opacity: 1;
    color: var(--text);
    background: rgba(88,166,255,0.16);
    outline: none;
  }
  .user-message-steer:disabled {
    opacity: 0.65;
    cursor: default;
  }
  .conv-pane.has-conv-bg .conversations-view .event.user_text {
    background: var(--conv-user-bubble-bg, var(--conv-user-bg));
  }
  /* WebUI engines paint the inner message; tinting its full-width wrapper
     would make a right-aligned bubble appear to stretch across the reader. */
  .conv-pane.has-conv-bg.is-webui-session .conversations-view .event.user_text:not(.peer-message) {
    background: none;
  }
  .conv-pane.has-conv-bg .conversations-view .event.user_text .user-msg {
    color: var(--conv-user-text);
  }
  /* Background-task notifications are status pings, not agent content — keep
     them to one quiet line so readers focus on what the agent actually said.
     Strip the box, mute it, drop the prominence; full detail (event, task id)
     stays available on hover via the card's title tooltip. */
  .conversations-view .event.user_text.task-notification-event {
    max-width: 92%;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 1px 0;
    margin: 1px 0;
    /* Status pings are not the human speaking — keep them left-flowing,
       not in the right-aligned user-bubble lane. */
    margin-left: 0;
    width: auto;
    opacity: 0.62;
  }
  .conversations-view .event.user_text.task-notification-event::before {
    color: var(--text-muted);
    opacity: 0.55;
  }
  .conversations-view .event.user_text.task-notification-event .label { display: none; }
  .conversations-view .event.user_text .task-notification-card {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1px 6px;
    white-space: normal;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 11.5px;
    line-height: 1.4;
  }
  .event.user_text.task-notification-event .task-notification-card .tn-kicker {
    font-size: 9px; letter-spacing: 0.3px; opacity: 0.7;
  }
  .event.user_text.task-notification-event .task-notification-card .tn-summary {
    font-size: 11.5px; font-weight: 500; color: var(--text-2);
  }
  .event.user_text.task-notification-event .task-notification-card .tn-event {
    padding-left: 0; border-left: 0; font-size: 11.5px;
  }
  .event.user_text.task-notification-event .task-notification-card .tn-event::before { content: "· "; }
  /* Task id is noise for a one-line ping — keep it in the data-raw-text/title,
     not on screen. The "↗ agent transcript" button surfaces on row hover so
     the subagent's full transcript stays one click away (CCC-112). */
  .event.user_text.task-notification-event .task-notification-card .tn-meta { display: none; }
  .event.user_text.task-notification-event:hover .task-notification-card .tn-meta { display: block; }
  .event.user_text.task-notification-event:hover .task-notification-card .tn-meta > span { display: none; }
  .tn-view-transcript {
    background: none; border: 1px solid var(--border); border-radius: 999px;
    color: var(--accent); font-size: 10.5px; padding: 1px 8px; cursor: pointer;
    margin-left: 6px;
  }
  .tn-view-transcript:hover { background: rgba(88,166,255,0.12); }
  /* Subagent lane (CCC-112): an embedded conversation popout inside the
     per-Task tab — fills the pane below the tab strip. */
  .conv-subagent-lane { height: 100%; min-height: 400px; }
  .conv-subagent-frame {
    width: 100%; height: 100%; min-height: 400px;
    border: none; background: var(--bg);
  }
  /* The first user message is pinned in the sticky header as "Original ask".
     Hide its in-conversation chat bubble so the same text isn't shown twice
     (sticky + bubble) when no scrolling has occurred yet. */
  .conversations-view .event.user_text.is-pinned-in-sticky { display: none; }
  /* In right-rail mode the original ask moves to the side rail, so there's no
     duplication risk — show the first user message as a regular chat bubble. */
  body.status-pos-right .conversations-view .event.user_text.is-pinned-in-sticky { display: block; }
  /* Style the shown original-ask bubble differently from regular user messages:
     full-width, left-aligned, smaller/quieter — it's context, not a chat turn. */
  body.status-pos-right .conversations-view .event.user_text.is-pinned-in-sticky {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    border-radius: 6px;
    background:
      linear-gradient(135deg, rgba(88, 166, 255, 0.07), rgba(163, 113, 247, 0.04)) padding-box,
      linear-gradient(135deg, rgba(88, 166, 255, 0.20), rgba(163, 113, 247, 0.12)) border-box;
    box-shadow: none;
    border-color: rgba(88, 166, 255, 0.18);
  }
  body.status-pos-right .conversations-view .event.user_text.is-pinned-in-sticky .user-msg {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
  }
  /* First sentence stays at normal size and color; rest is smaller/muted. */
  body.status-pos-right .conversations-view .event.user_text.is-pinned-in-sticky .user-msg .ask-first {
    font-size: 14px;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
    white-space: pre-wrap;
  }
  body.status-pos-right .conversations-view .event.user_text.is-pinned-in-sticky .user-msg .ask-rest {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
    opacity: 0.85;
    white-space: pre-wrap;
  }
  /* Later user messages mirrored into the sticky header's "Earlier ask" slot
     must keep their layout space. Removing them with display:none changes
     scrollHeight mid-scroll and makes the transcript jump under the cursor. */
  .conversations-view .event.user_text.is-dynamic-pinned-in-sticky {
    visibility: hidden;
    pointer-events: none;
  }
  .conversations-view .event.user_text.conv-user-jump-target {
    display: block !important;
    visibility: visible;
    pointer-events: auto;
  }
  /* Pictures belong in the transcript even when the ask is mirrored in a
     summary slot. Keep the full bubble visible so prose cannot clip an
     inline image or an attachment below it. */
  .conversations-view .event.user_text:is(.is-pinned-in-sticky, .is-dynamic-pinned-in-sticky):has(img) {
    visibility: visible;
    pointer-events: auto;
  }
  .conversations-view .event.user_text.is-pinned-in-sticky:has(img) {
    display: block !important;
  }
  /* Mirroring an ask must preserve the engine's layout. Switching a flex
     image bubble to block changes its height and fights scroll anchoring. */
  .conv-pane.is-webui-session .event.user_text.is-pinned-in-sticky:not(.peer-message):has(img) {
    display: flex !important;
  }
  .conversations-view .event.user_text:has(img) .user-msg {
    max-height: none !important;
    overflow: visible !important;
  }
  .conversations-view .event.tool_result { display: none; }
  /* Tool-call group — fused "Ran N commands ▾" container. */
  .conversations-view .tool-call-group {
    margin: 2px 0 4px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
  }
  /* When the conversation has a custom background, the solid surface fill AND
     the border on the tool-call group stand out — drop both so the group
     blends fully into the background. */
  .conv-pane.has-conv-bg .conversations-view .tool-call-group {
    background: transparent;
    border: none;
  }
  .conversations-view .tool-call-group-header {
    cursor: pointer; user-select: none;
    padding: 4px 10px;
    font-size: 13px; color: var(--text-muted);
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  }
  .conversations-view .tool-call-group-header:hover { background: var(--surface-2); border-radius: 6px; }
  .conversations-view .tool-call-group-header .tcg-arrow {
    display: inline-block; transition: transform 0.15s; font-size: 10px; color: var(--orange);
  }
  .conversations-view .tool-call-group-header .tcg-label {
    flex: 1 1 240px; min-width: 0; white-space: normal; overflow-wrap: anywhere;
  }
  /* CCC-501: a short hint of what the command actually returned, right of the
     label — "Completed git status" alone gave no sense of the outcome. */
  .conversations-view .tool-call-group-header .tcg-result {
    flex: 1 1 240px; min-width: 0;
    white-space: normal; overflow-wrap: anywhere; opacity: 0.6; font-size: 12px; font-style: italic;
  }
  .conversations-view .tool-call-group-header .tcg-result:empty { display: none; }
  /* A closed disclosure previews the command and result; expanding it
     retains the full text. Long ticket bodies must not fill the header. */
  .conversations-view .tool-call-group.collapsed .tool-call-group-header :is(.tcg-label, .tcg-result):not(:empty) {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden;
  }
  /* Real time + line number, right-aligned — a run of collapsed "▶ Completed
     X" rows previously carried neither (only a hidden debug-mode ::before),
     reading as anonymous noise with no way to tell when/where each happened. */
  .conversations-view .tool-call-group-header .tcg-meta {
    margin-left: auto; flex-shrink: 0;
    display: flex; align-items: center; gap: 6px;
  }
  .conversations-view .tool-call-group-header .tcg-meta .msg-ts,
  .conversations-view .tool-call-group-header .tcg-meta .line-num {
    float: none; position: static; opacity: 0.5; font-size: 11px;
  }
  .conversations-view .tool-call-group:not(.collapsed) .tool-call-group-header .tcg-arrow { transform: rotate(90deg); }
  .conversations-view .tool-call-group.collapsed .tool-call-group-body { display: none; }
  .conversations-view .tool-call-group-body { padding: 3px 10px 6px; border-top: 1px solid var(--border); }
  /* Sticky-header unified panel — Ask | Activity inside a single bordered
     box. Fixed height; each column scrolls independently if its content
     overflows. Saves the inner padding/border that two side-by-side
     panels used to spend. */
  .conv-sticky-header .csh-row {
    display: flex; gap: 0; align-items: stretch;
    flex: 0 0 auto;
    height: 170px;
    background: #161c25;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .conv-sticky-header .csh-col {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 12px;
    box-sizing: border-box;
    min-height: 0;
  }
  .conv-sticky-header .csh-col-ask {
    flex: 5 1 0; min-width: 0; min-height: 0;
    display: flex; flex-direction: column; gap: 0;
    overflow: hidden;
    border-right: 1px solid var(--border);
  }
  /* Both ask sub-blocks are permanent slots — original on top, earlier
     on bottom. Each takes half the column height and scrolls internally
     if its body overflows; labels stay pinned at the top of each slot. */
  .conv-sticky-header .csh-ask-original,
  .conv-sticky-header .csh-ask-earlier {
    flex: 1 1 0;
    min-height: 0;
    display: flex; flex-direction: column;
  }
  .conv-sticky-header .csh-ask-original > .label,
  .conv-sticky-header .csh-ask-earlier > .label { flex: 0 0 auto; }
  .conv-sticky-header .csh-ask-original > .user-msg,
  .conv-sticky-header .csh-ask-earlier > .user-msg {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
  }
  /* Earlier-ask sub-block — separator + orange label so it reads as a
     distinct slot from the original. The dashed separator only applies
     when stacked inside .csh-col-ask; when promoted to the activity
     column (no session activity to show) it sits flush like a peer
     panel, no top divider. */
  .conv-sticky-header .csh-col-ask > .csh-ask-earlier {
    border-top: 1px dashed var(--border);
    padding-top: 6px;
    margin-top: 6px;
  }
  .conv-sticky-header .csh-ask-earlier .label { color: var(--orange); }
  .conv-sticky-header .csh-col-activity {
    flex: 5 1 0; min-width: 0; min-height: 0;
    display: flex; flex-direction: column;
    padding: 8px 12px;
    overflow-y: auto;
  }
  /* Original ask: first sentence at default size, rest small + grey,
     always wraps (no horizontal scroll). Each ask body scrolls inside its
     fixed-height slot so long summaries do not clip under the sticky header. */
  .conv-sticky-header .csh-col-ask .user-msg {
    white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
    max-height: none; overflow-x: hidden; overflow-y: auto;
  }
  .conv-sticky-header .csh-col-ask .ask-first,
  .conv-sticky-header .csh-col-ask .earlier-first {
    display: block;
    color: var(--accent);
    font-size: 14px;
    line-height: 1.45;
  }
  .conv-sticky-header .csh-col-ask .ask-rest {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.85;
  }
  /* Hide inline images in the sticky-header ask/earlier preview — they
     used to render at up to 220px tall inside a 170px row, blowing out
     the preview and burying the actual prose. The full conversation
     view still shows them; this is just the at-a-glance summary slot.
     A small marker is left in their place so the user knows there was
     an attachment without the layout cost. */
  .conv-sticky-header .csh-col-ask .msg-image { display: none; }
  .conv-sticky-header .csh-col-ask .msg-image::after { content: none; }
  .conv-sticky-header .csh-col-ask .user-msg .msg-image + .msg-image,
  .conv-sticky-header .csh-col-ask .user-msg br + .msg-image { display: none; }
  .conv-sticky-header .csh-col-ask .user-msg:has(.msg-image)::before {
    content: '📎 image attached';
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(139,148,158,0.12);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
  }
  /* Workspace context strip — keep usage and model on one line beside
     the composer, letting the workspace path yield space first. */
  .conv-input-context {
    display: none;
    align-items: center; gap: 10px 12px;
    /* Long paths ellipsify and retain their full value in the tooltip. */
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 12px; color: var(--text-muted);
    background: transparent;
    border-top: 1px solid var(--border);
    /* Container query host — children query against the strip's own
       inline-size so the progressive-drop rules below fire based on
       actual rendered width (split panes, narrow windows). Without
       container-type the @container conv-ctx rules never match and the
       model pill gets pushed off the right edge on mobile (CCC-1200). */
    container-type: inline-size;
    container-name: conv-ctx;
  }
  .conv-input-context > * {
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .conv-input-context .wp-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
  }
  /* Clip the beginning of long paths so the repo name stays visible.
     The inner LTR isolate preserves path punctuation and reading order. */
  .conv-input-context .wp-path {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: rtl;
    text-align: left;
    cursor: pointer;
  }
  .conv-input-context .wp-path:hover {
    color: var(--text);
    text-decoration: underline;
  }
  /* Progressive drop-out as the strip narrows so the model pill
     (rightmost, most-valued slot) stops getting clipped. Original
     thresholds (700 / 580) were too low — at 720px the screenshot
     still hid cost+model because total intrinsic width was already
     past viewport, but the strip was wide enough that SHARED CLONE
     was still rendering and the cotenants block (when present)
     hadn't dropped. Raised thresholds so trims kick in sooner and
     the rightmost items survive.
       <= 900px: hide the "⚠ N other sessions here" warning (low-
                 priority; still visible on the sidebar row + tooltip
                 on the kind pill).
       <= 800px: hide the SHARED CLONE / WORKTREE kind chip and
                 the "in sync" status (always nice-to-have, not
                 load-bearing).
       Below that: path keeps ellipsifying via the wp-path rule above. */
  @container conv-ctx (max-width: 900px) {
    .conv-input-context .wp-cotenants { display: none; }
  }
  @container conv-ctx (max-width: 800px) {
    .conv-input-context .wp-kind,
    .conv-input-context .wp-sync { display: none; }
  }
  @container conv-ctx (max-width: 750px) {
    .conv-input-context .wp-antigravity-tokens { display: none; }
    /* "peak XXk" is secondary to the live Xk / XXk pill: drop it well
       before the pill itself (≤550px) so a narrow pane never shows the
       peak without the current count (CCC-217). */
    .conv-input-context .wp-usage-peak { display: none; }
  }
  @container conv-ctx (max-width: 650px) {
    .conv-input-context .wp-cost-pill { display: none; }
  }
  /* And cap the path so it actively ellipsifies in narrow panes
     instead of waiting for the layout to overflow. ch units scale
     with the font so this holds across font-size changes. */
  @container conv-ctx (max-width: 800px) {
    .conv-input-context .wp-row {
      flex: 1 1 0;
    }
    .conv-input-context .wp-path { max-width: 28ch; }
    .conv-input-context .wp-row > .wp-branch,
    .conv-input-context .wp-icon,
    .conv-input-context .wp-even { display: none; }
    .conv-input-context .wp-usage {
      flex: 0 1 auto;
      min-width: 0;
      margin-left: 0;
    }
    .conv-input-context .wp-usage > * { flex-shrink: 0; }
    .conv-input-context .wp-usage > .wp-model-pill {
      flex-shrink: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
  @container conv-ctx (max-width: 600px) {
    .conv-input-context .wp-path { max-width: 18ch; }
  }
  @container conv-ctx (max-width: 450px) {
    .conv-input-context .wp-usage > .wp-handover-toggle,
    .conv-input-context .wp-usage-pct { display: none; }
  }
  .conv-input-context.visible { display: flex; }
  .conv-input-context .wp-icon { opacity: 0.7; font-size: 11px; }
  .conv-input-context .wp-worktree-icon {
    color: var(--accent); font-size: 13px; line-height: 1;
  }
  .conv-input-context .wp-branch {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 13px; color: var(--accent);
    background: rgba(88,166,255,0.10); padding: 2px 7px; border-radius: 3px;
    word-break: break-all; overflow-wrap: anywhere;
    max-width: 25ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
  }
  .conv-input-context .wp-base { color: var(--text-muted); }
  .conv-input-context .wp-arrow { opacity: 0.4; }
  .conv-input-context .wp-kind {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 2px 7px; border-radius: 3px; font-weight: 600;
  }
  .conv-input-context .wp-kind-worktree { color: var(--accent); background: rgba(88,166,255,0.10); }
  .conv-input-context .wp-kind-clone { color: var(--orange); background: rgba(210,153,34,0.10); }
  /* CCC-128: the "cwd missing" chip is an actionable button (set folder). */
  .conv-input-context button.wp-set-cwd {
    cursor: pointer; border: 1px solid rgba(210,153,34,0.45);
    color: var(--orange); background: rgba(210,153,34,0.10);
    text-transform: none; letter-spacing: 0; font-family: inherit;
  }
  .conv-input-context button.wp-set-cwd:hover {
    background: rgba(210,153,34,0.20); border-color: var(--orange);
  }
  /* Usage pill — sits at the right end of the input-context row. The
     wp-usage wrapper is a flex item with margin-left:auto so the pill
     hugs the right edge regardless of how much workspace info renders. */
  .conv-input-context .wp-usage {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 11px;
  }
  .conv-input-context .wp-usage-pill {
    padding: 2px 7px; border-radius: 3px; font-weight: 600;
    color: var(--text-muted); background: rgba(139,148,158,0.10);
  }
  .conv-input-context .wp-quality-pill {
    padding: 2px 7px; border-radius: 3px; font-weight: 700;
    color: var(--text-muted); background: rgba(139,148,158,0.08);
    cursor: help;
  }
  .conv-input-context .wp-quality-good { color: var(--green); background: rgba(63,185,80,0.12); }
  .conv-input-context .wp-quality-fair { color: var(--text-muted); background: rgba(139,148,158,0.10); }
  .conv-input-context .wp-quality-warn { color: var(--orange); background: rgba(210,153,34,0.12); }
  .conv-input-context .wp-quality-poor { color: var(--red); background: rgba(248,81,73,0.14); }
  .conv-input-context .wp-usage-pill.wp-usage-warm { color: var(--orange); background: rgba(210,153,34,0.12); }
  .conv-input-context .wp-usage-pill.wp-usage-hot  { color: var(--red);    background: rgba(248,81,73,0.14); }
  .conv-input-context .wp-usage-pill.wp-usage-missing { color: var(--text-muted); background: rgba(139,148,158,0.10); }
  .conv-input-context .wp-spawn-ctx-badge { color: var(--accent); background: rgba(88,166,255,0.10); cursor: help; }
  .conv-input-context .wp-usage-clickable { cursor: pointer; user-select: none; }
  .conv-input-context .wp-usage-clickable:hover { filter: brightness(1.2); }
  .conv-input-context .wp-usage-pct { opacity: 0.7; font-weight: 400; }
  .conv-input-context .wp-usage-peak { color: var(--text-muted); font-size: 10px; opacity: 0.7; }
  .conv-input-context .wp-cost-pill {
    padding: 2px 7px; border-radius: 3px; font-weight: 600;
    color: var(--text-muted); background: rgba(139,148,158,0.06);
    cursor: help;
  }
  /* Antigravity-only running totals — mirrors the `11.2k in | 2.6k out |
   * 1.0k thinking` line Antigravity prints in its own chat header. Quiet
   * monospace so it visually pairs with the wp-model-pill next to it. */
  .conv-input-context .wp-antigravity-tokens {
    padding: 2px 7px; border-radius: 3px; font-weight: 600;
    color: var(--text-muted); background: rgba(139,148,158,0.06);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 10px;
    cursor: help;
  }
  /* Model badge — shown next to the context/cost pills so you can tell
   * which model produced the latest turn. The 1M sub-pill lights up
   * when a turn provably exceeded 200k tokens (only possible on the 1M
   * beta variant, since the model name doesn't carry the variant). */
  .conv-input-context .wp-model-pill {
    padding: 2px 7px; border-radius: 3px; font-weight: 600;
    color: var(--text-muted); background: rgba(88,166,255,0.10);
    cursor: pointer;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 10px;
    border: none;
  }
  .conv-input-context .wp-model-pill:hover { background: rgba(88,166,255,0.18); }
  .conv-input-context .wp-model-pill.is-static {
    cursor: default;
    display: inline-flex;
    align-items: center;
  }
  .conv-input-context .wp-model-pill.is-static:hover { background: rgba(88,166,255,0.10); }
  .conv-input-context .wp-model-1m {
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 2px;
    background: var(--accent, #58a6ff);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
  }
  /* "→ next" chip — shown when an override is queued (Codex/Gemini, or
     dormant Claude). The override applies on the next ask/resume. */
  .conv-input-context .wp-model-pending {
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 2px;
    background: rgba(218,165,32,0.18);
    color: #d6a13b;
    font-size: 9px;
    font-weight: 700;
  }
  /* Auto handover toggle — status-bar pill, deliberately more explicit than
     the other pills here: a labeled ON/OFF text + dot rather than an icon,
     since a subtle color-only state (like wp-model-pill's hover tint) isn't
     enough for a persistent on/off setting someone needs to read at a glance. */
  .conv-input-context .wp-handover-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: 3px; font-weight: 700;
    font-size: 10px; cursor: pointer; border: 1px solid transparent;
    font-family: inherit;
  }
  .conv-input-context .wp-handover-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  }
  .conv-input-context .wp-handover-toggle.is-off {
    color: var(--text-muted); background: rgba(139,148,158,0.06);
    border-color: rgba(139,148,158,0.18);
  }
  .conv-input-context .wp-handover-toggle.is-off .wp-handover-dot { background: var(--text-muted); }
  .conv-input-context .wp-handover-toggle.is-off:hover { background: rgba(139,148,158,0.14); }
  .conv-input-context .wp-handover-toggle.is-on {
    color: #ffa640; background: rgba(255,166,64,0.16);
    border-color: rgba(255,166,64,0.45);
  }
  .conv-input-context .wp-handover-toggle.is-on .wp-handover-dot { background: #ffa640; }
  .conv-input-context .wp-handover-toggle.is-on:hover { background: rgba(255,166,64,0.24); }
  /* Click registered, commit debounced -- dim so rapid re-clicks don't read
     as N separate confirmed changes before the settle timer fires. */
  .conv-input-context .wp-handover-toggle.is-pending { opacity: 0.55; }
  .conv-input-context .wp-model-effort {
    margin-left: 4px;
    color: var(--text-muted);
    opacity: 0.72;
    font-size: 9px;
    font-weight: 700;
  }
  /* "default" is the engine's own level, not one CCC picked. Dimmer and
     non-bold so it reads as inherited rather than as a deliberate choice. */
  .conv-input-context .wp-model-effort.is-default {
    opacity: 0.45;
    font-weight: 600;
  }
  .conv-input-context .wp-model-chevron { opacity: 0.45; font-size: 8px; vertical-align: middle; }
  /* Model picker popover — anchored under the wp-model-pill button. */
  .model-picker-pop {
    position: fixed; z-index: 9000;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px;
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    display: none; flex-direction: column; gap: 2px;
    font-size: 13px;
  }
  .model-picker-pop.open { display: flex; }
  .model-picker-pop .mp-header {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    padding: 4px 6px;
  }
  .model-picker-pop .mp-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 4px;
    background: transparent; border: none; color: var(--text);
    cursor: pointer; text-align: left; font-family: inherit; font-size: 13px;
    width: 100%;
  }
  .model-picker-pop .mp-row:hover { background: var(--surface-2); }
  .model-picker-pop .mp-row:disabled,
  .model-picker-pop .mp-row.disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .model-picker-pop .mp-row:disabled:hover,
  .model-picker-pop .mp-row.disabled:hover {
    background: transparent;
  }
  .model-picker-pop .mp-row.active {
    color: var(--accent); background: rgba(88,166,255,0.10); font-weight: 600;
  }
  .model-picker-pop .mp-model-copy {
    display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px;
  }
  .model-picker-pop .mp-model-name,
  .model-picker-pop .mp-model-meta { overflow: hidden; text-overflow: ellipsis; }
  .model-picker-pop .mp-model-meta {
    color: var(--text-muted); font-size: 9px; font-weight: 400; white-space: nowrap;
  }
  .model-picker-pop .mp-entitlement {
    margin-left: auto; padding: 1px 5px; border-radius: 3px;
    font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  }
  .model-picker-pop .mp-entitlement.free {
    background: rgba(46,160,67,0.16); color: var(--success, #3fb950);
  }
  .model-picker-pop .mp-entitlement.blocked {
    background: rgba(219,109,40,0.16); color: var(--warning, #d97706);
  }
  .model-picker-pop .mp-1m-toggle {
    margin-left: auto; font-size: 10px;
    padding: 1px 6px; border-radius: 3px;
    background: rgba(88,166,255,0.10); color: var(--text-muted);
    cursor: pointer; user-select: none;
  }
  .model-picker-pop .mp-1m-toggle.on {
    background: var(--accent); color: #fff;
  }
  .model-picker-pop .mp-1m-toggle.disabled {
    opacity: 0.35; cursor: not-allowed;
  }
  .model-picker-pop .mp-divider {
    height: 1px; background: var(--border); margin: 4px 2px;
  }
  .model-picker-pop .mp-other {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px;
  }
  .model-picker-pop .mp-other input {
    flex: 1; min-width: 0;
    padding: 4px 6px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 3px; color: var(--text); font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
  }
  .model-picker-pop .mp-other button {
    padding: 4px 10px;
    background: var(--accent); color: #fff;
    border: none; border-radius: 3px; cursor: pointer;
    font-size: 12px; font-weight: 600;
  }
  .model-picker-pop .mp-reset {
    color: var(--text-muted); font-size: 12px;
  }
  .model-picker-pop .mp-reset:hover { color: var(--text); }
  .model-picker-pop .mp-status {
    padding: 4px 8px; font-size: 11px; color: var(--text-muted);
  }
  .model-picker-pop .mp-status.ok { color: var(--green); }
  .model-picker-pop .mp-status.err { color: var(--red); }

  /* Claude `/model` menu — replicates Claude Code's native picker. */
  .model-picker-pop.mp-claude {
    min-width: 340px; padding: 6px; gap: 1px;
    font-size: 14px;
  }
  .model-picker-pop.mp-claude .mp-header {
    display: flex; align-items: center; justify-content: space-between;
    text-transform: none; letter-spacing: 0; font-weight: 400;
    font-size: 14px; color: var(--text-muted);
    padding: 6px 10px 8px;
  }
  .model-picker-pop.mp-claude .mp-keys { display: flex; gap: 4px; }
  .model-picker-pop.mp-claude .mp-keys kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 4px;
    border: 1px solid var(--border); border-radius: 5px;
    background: var(--surface-2); color: var(--text-muted);
    font-family: inherit; font-size: 12px; line-height: 1;
  }
  .model-picker-pop.mp-claude .mp-row {
    gap: 0; padding: 7px 10px; border-radius: 6px;
    font-size: 14px; font-weight: 400;
  }
  .model-picker-pop.mp-claude .mp-row.active { background: transparent; color: var(--text); font-weight: 400; }
  .model-picker-pop.mp-claude .mp-row:hover { background: var(--surface-2); }
  .model-picker-pop.mp-claude .mp-name { color: var(--text); }
  .model-picker-pop.mp-claude .mp-default-tag,
  .model-picker-pop.mp-claude .mp-legacy { color: var(--text-muted); }
  .model-picker-pop.mp-claude .mp-legacy { margin-left: 6px; }
  .model-picker-pop.mp-claude .mp-check {
    margin-left: auto; width: 18px; text-align: center; color: var(--text);
  }
  .model-picker-pop.mp-claude .mp-default-row .mp-check { margin-left: auto; }
  .model-picker-pop.mp-claude .mp-num {
    width: 20px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums;
  }
  /* Default row has no trailing number, so its check sits at the far right. */
  .model-picker-pop.mp-claude .mp-section {
    padding: 6px 10px 2px; font-size: 14px; color: var(--text-muted);
  }
  .model-picker-pop.mp-claude .mp-fast-row { padding-top: 4px; }
  .model-picker-pop.mp-claude .mp-switch {
    margin-left: auto; position: relative;
    width: 34px; height: 18px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    transition: background 0.15s;
  }
  .model-picker-pop.mp-claude .mp-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--text-muted); transition: transform 0.15s, background 0.15s;
  }
  .model-picker-pop.mp-claude .mp-switch.on { background: var(--accent); border-color: var(--accent); }
  .model-picker-pop.mp-claude .mp-switch.on::after { transform: translateX(16px); background: #fff; }
  .model-picker-pop.mp-claude .mp-divider { margin: 5px 4px; }
  .conv-input-context .wp-ahead { color: var(--green); }
  .conv-input-context .wp-behind { color: var(--orange); }
  .conv-input-context .wp-even { color: var(--text-muted); opacity: 0.6; }
  .conv-input-context .wp-cotenants { color: var(--red); margin-left: auto; font-weight: 500; }
  .conv-input-context.hide-cotenants .wp-cotenants { display: none; }

  /* Plan usage popover */
  .plan-usage-pop {
    position: fixed; z-index: 9000;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px;
    min-width: 280px;
    max-height: 380px; overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    display: none; flex-direction: column; gap: 10px;
    font-size: 13px;
    color: var(--text);
  }
  .plan-usage-pop.open { display: flex; }
  .plan-usage-pop .pu-title-row {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 13px;
  }
  .plan-usage-pop .pu-title-row-right {
    color: var(--text-muted); font-size: 12px; font-weight: normal;
  }
  .plan-usage-pop .pu-progress-bg {
    height: 6px; background: var(--surface-2, #333); border-radius: 3px;
    overflow: hidden; width: 100%;
  }
  .plan-usage-pop .pu-progress-fill {
    height: 100%; background: var(--accent, #58a6ff); width: 0%;
    border-radius: 3px;
  }
  .plan-usage-pop .pu-divider {
    height: 1px; background: var(--border); margin: 4px 0;
  }
  .plan-usage-pop .pu-header {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
  }
  .plan-usage-pop .pu-limit-row {
    display: flex; flex-direction: column; gap: 4px;
  }
  .plan-usage-pop .pu-limit-label-row {
    display: flex; justify-content: space-between; font-size: 12px;
  }
  .plan-usage-pop .pu-limit-label {
    font-weight: 500;
  }
  .plan-usage-pop .pu-limit-val {
    color: var(--text-muted);
  }
  .plan-usage-pop .pu-error {
    color: var(--red); font-size: 12px; text-align: center; padding: 4px;
  }
  .plan-usage-pop .pu-loading {
    color: var(--text-muted); font-size: 12px; text-align: center; padding: 8px;
  }

  /* Spawn cwd picker — appears in the context strip ONLY when in
   * new-session mode (currentConversation === '__new__'). Replaces the
   * passive workspace pill the strip shows for an existing session.
   * Without this, the user can't tell where the new session will land
   * from the All-repos folder filter. */
  .conv-input-context .spawn-cwd-row {
    display: none;
    align-items: center; gap: 6px;
    font-size: 12px;
  }
  .conv-input-context.is-new-session {
    position: relative;
    z-index: 80;
    overflow: visible;
  }
  .conv-input-context.visible.is-new-session {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "chips chips"
      "cwd worktree"
      "account account";
    align-items: center;
    gap: 7px 12px;
    white-space: normal;
  }
  .conv-input-context.is-new-session .spawn-cwd-row {
    display: inline-flex;
    grid-area: cwd;
    justify-self: stretch;
    overflow: visible;
    width: 100%;
    min-width: 0;
  }
  .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-combo {
    flex: 1 1 auto;
    min-width: 0;
  }
  .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-picker {
    flex: 1 1 0;
    width: 0;
    max-width: none;
    min-width: 0;
    padding: 9px 12px;
    font-size: 14px;
  }
  .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-menu-btn,
  .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-browse-btn {
    flex: 0 0 auto;
    width: 36px;
    height: auto;
    min-height: 38px;
    font-size: 14px;
  }
  .conv-input-context .new-session-object-context {
    position: relative;
    z-index: 130;
    display: none;
    align-items: center;
    gap: 6px;
    grid-area: object;
    min-width: 0;
    overflow: visible;
  }
  .conv-input-context.is-new-session .new-session-object-context {
    display: inline-flex;
  }
  .conv-input-context.visible.is-new-session {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "object object"
      "chips chips"
      "cwd worktree"
      "account account";
  }
  .nso-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .nso-combo {
    position: relative;
    z-index: 130;
    display: inline-flex;
    align-items: stretch;
    min-width: min(360px, 100%);
    max-width: 520px;
    flex: 0 1 420px;
  }
  .nso-picker {
    flex: 1 1 auto;
    min-width: 0;
    height: 28px;
    padding: 3px 32px 3px 9px;
    border: 1px solid color-mix(in srgb, var(--accent, #58a6ff) 45%, var(--border) 55%);
    border-radius: 6px;
    background: rgba(88,166,255,0.10);
    color: var(--accent, #58a6ff);
    font-size: 12px;
    font-weight: 650;
    outline: none;
  }
  .nso-picker:focus {
    border-color: var(--accent, #58a6ff);
    box-shadow: 0 0 0 2px rgba(88,166,255,0.14);
  }
  .nso-menu-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 28px;
    height: 26px;
    border: 0;
    border-left: 1px solid rgba(88,166,255,0.22);
    border-radius: 0 5px 5px 0;
    background: transparent;
    color: var(--accent, #58a6ff);
    cursor: pointer;
  }
  .nso-menu {
    display: none;
    position: absolute;
    z-index: 120;
    top: calc(100% + 5px);
    left: 0;
    width: min(520px, 86vw);
    max-height: min(320px, 44vh);
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(0,0,0,0.38);
  }
  .nso-menu.open {
    display: grid;
    gap: 2px;
  }
  .nso-option {
    display: grid;
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 7px 9px 7px calc(9px + var(--object-depth, 0) * 18px);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
  }
  .nso-option:hover,
  .nso-option.is-active {
    background: rgba(88,166,255,0.12);
  }
  .nso-option.is-selected .nso-option-title::after {
    content: " selected";
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .nso-option-title,
  .nso-option-path {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nso-option-title {
    font-size: 12px;
    font-weight: 650;
  }
  .nso-option-path,
  .nso-empty {
    color: var(--text-muted);
    font-size: 11px;
  }
  .nso-create {
    border-top: 1px solid rgba(139,148,158,0.16);
    margin-top: 2px;
  }
  .nso-empty {
    padding: 10px;
  }
  .nso-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent, #58a6ff) 45%, var(--border) 55%);
    background: rgba(88,166,255,0.12);
    color: var(--accent, #58a6ff);
    font-size: 12px;
    font-weight: 650;
  }
  .conv-input-context .spawn-cwd-quick-chips {
    display: none;
    align-items: center;
    gap: 5px;
    flex: 1 1 100%;
    flex-wrap: wrap;
    min-width: 0;
    overflow: visible;
  }
  .conv-input-context.is-new-session .spawn-cwd-quick-chips {
    display: flex;
    grid-area: chips;
    max-width: none;
  }
  .conv-input-context .spawn-cwd-chip-label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .conv-input-context .spawn-cwd-chip-group-label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .conv-input-context .spawn-cwd-chip-group-label:first-child {
    margin-left: 0;
  }
  .conv-input-context .spawn-cwd-chip {
    display: inline-flex;
    align-items: center;
    max-width: min(260px, 100%);
    min-width: 0;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(139,148,158,0.08);
    color: var(--text-muted);
    font: 600 11px/1.2 ui-monospace, SFMono-Regular, "SF Mono", monospace;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .conv-input-context .spawn-cwd-chip:not(.active):hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: rgba(139,148,158,0.12);
  }
  .conv-input-context .spawn-cwd-chip.active {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
    background: rgba(88,166,255,0.16);
  }
  /* Repo auto-guess chips beside the folder picker (new-session only). */
  .smart-repo-status {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 30px; height: 30px; padding: 4px;
    border: 1px solid var(--border); border-radius: 6px;
    background: transparent; color: var(--text-muted); cursor: pointer;
  }
  .smart-repo-status[hidden] { display: none; }
  .smart-repo-status.is-enabled {
    color: var(--green, #3fb950); border-color: transparent; cursor: default;
  }
  .smart-repo-status:not(.is-enabled):hover { color: var(--text); border-color: var(--text-muted); }
  .smart-repo-status:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .conv-input-context .spawn-cwd-guess-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
  }
  .conv-input-context .spawn-cwd-guess-chip[hidden] { display: none; }
  .conv-input-context .spawn-cwd-guess-btn {
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(139,148,158,0.08);
    color: var(--accent);
    font: 600 11px/1.2 ui-monospace, SFMono-Regular, "SF Mono", monospace;
    cursor: pointer;
  }
  .conv-input-context .spawn-cwd-guess-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    background: rgba(88,166,255,0.10);
  }
  /* Worktree toggle, sibling to spawn-cwd-row. Same visibility gating: only
     shown when the strip is in new-session mode. Matches the 🌿 toggle in
     the kanban-toolbar new-session modal so both spawn paths look the same. */
  .conv-input-context .spawn-worktree-row {
    display: none;
    align-items: center; gap: 4px;
    font-size: 12px; color: var(--text);
    cursor: pointer; user-select: none;
  }
  .conv-input-context.is-new-session .spawn-worktree-row {
    display: inline-flex;
    grid-area: worktree;
    justify-self: end;
  }
  .conv-input-context .spawn-worktree-row input[type="checkbox"] { margin: 0; cursor: pointer; }
  /* Hide the regular workspace + usage pills in new-session mode —
     they reflect a live session's state and have nothing to say about
     a not-yet-spawned session. The strip stays visible because the
     spawn-cwd-row needs to render. */
  .conv-input-context.is-new-session .wp-row,
  .conv-input-context.is-new-session .wp-usage { display: none; }
  .conv-input-context .spawn-cwd-row .spawn-cwd-label {
    color: var(--text-muted); text-transform: uppercase;
    font-size: 10px; letter-spacing: 0.05em; font-weight: 600;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-combo {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    overflow: visible;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-picker {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px 0 0 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    max-width: 360px;
    min-width: 220px;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-picker:hover { border-color: var(--accent); }
  .conv-input-context .spawn-cwd-row .spawn-cwd-picker:focus { outline: none; border-color: var(--accent); }
  .conv-input-context .spawn-cwd-row .spawn-cwd-picker:focus + .spawn-cwd-menu-btn {
    border-color: var(--accent);
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-menu-btn,
  .conv-input-context .spawn-cwd-row .spawn-cwd-browse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0;
    cursor: pointer;
    font-size: 11px;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-browse-btn {
    width: 30px;
    border-radius: 0 4px 4px 0;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-menu-btn:hover,
  .conv-input-context .spawn-cwd-row .spawn-cwd-menu-btn[aria-expanded="true"],
  .conv-input-context .spawn-cwd-row .spawn-cwd-browse-btn:hover {
    color: var(--text);
    border-color: var(--accent);
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-browse-btn:disabled {
    opacity: 0.55;
    cursor: wait;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-menu {
    display: none;
    position: absolute;
    z-index: 1200;
    top: auto;
    bottom: calc(100% + 6px);
    left: 0;
    width: min(560px, calc(100vw - 80px));
    max-height: min(520px, 70vh);
    overflow: auto;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-menu.open { display: grid; gap: 2px; }
  .conv-input-context .spawn-cwd-row .spawn-cwd-option {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 7px 9px;
    text-align: left;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-option:hover,
  .conv-input-context .spawn-cwd-row .spawn-cwd-option:focus {
    outline: none;
    background: var(--surface-2);
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-option-label {
    font-size: 12px;
    font-weight: 600;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-option-path {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conv-input-context .spawn-cwd-row .spawn-cwd-menu-empty {
    padding: 9px;
    color: var(--text-muted);
    font-size: 12px;
  }
  @media (max-width: 720px) {
    /* Keep the recent-folder chips on phones: one swipeable row. */
    .conv-input-context.is-new-session .spawn-cwd-quick-chips {
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .conv-input-context.is-new-session .spawn-cwd-quick-chips > * {
      flex: 0 0 auto;
    }
    /* overflow:hidden gives the strip min-height 0, so the keyboard squeezed
       the folder picker row to a sliver. Never shrink it; bigger touch targets. */
    .conv-pane > .conv-input-context.is-new-session { flex-shrink: 0; }
    .conv-input-context.is-new-session .spawn-cwd-quick-chips { gap: 8px; padding-bottom: 2px; }
    .conv-input-context.is-new-session .spawn-cwd-chip {
      max-width: 70vw;
      padding: 7px 13px;
      font-size: 14px;
    }
    .conv-input-context.is-new-session .spawn-cwd-chip-group-label { font-size: 12px; }
    .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-picker {
      padding: 12px 14px;
      font-size: 16px;
    }
    .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-menu-btn,
    .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-browse-btn {
      width: 44px;
    }
  }
  .conv-input-context .wp-path {
    margin-left: auto;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 12px; color: var(--text-muted); opacity: 0.7;
    word-break: break-all; overflow-wrap: anywhere;
  }
  .conv-input-context .wp-cotenants ~ .wp-path { margin-left: 8px; }
  .conv-input-context.hide-cotenants .wp-cotenants ~ .wp-path { margin-left: auto; }
  .conv-input-context .wp-eff-divider {
    flex: 0 0 100%;
    height: 1px;
    background: var(--border);
    opacity: 0.5;
    margin: 4px 0 2px;
  }
  .conv-input-context .wp-eff-tag {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 2px 7px; border-radius: 3px; font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border: 1px dashed var(--border);
  }
  .conv-input-context .wp-worktrees {
    font-size: 12px; padding: 2px 7px; border-radius: 3px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: pre;
    font-family: inherit;
    appearance: none;
    transition: filter 0.12s ease-out, background 0.12s ease-out;
  }
  .conv-input-context .wp-worktrees:hover { filter: brightness(1.25); background: rgba(255,255,255,0.07); }
  .conv-input-context .wp-worktrees:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .conv-input-context .wp-worktrees-agent {
    color: var(--orange);
    background: rgba(210,153,34,0.10);
    border-color: rgba(210,153,34,0.30);
  }
  .conv-input-context .wp-worktrees-agent:hover { background: rgba(210,153,34,0.16); }

  /* ── Worktrees modal ─────────────────────────────────────────
     Opens when the user clicks the 🌿 worktrees pill in the input-
     context strip. Lists each sibling worktree (path · branch · tag)
     in a scrollable, copyable form. Reuses .upd-overlay/.upd-dialog
     shells. */
  .wt-summary {
    font-size: 12px; color: var(--text-muted);
    display: flex; gap: 10px; flex-wrap: wrap;
  }
  .wt-summary strong { color: var(--text); font-weight: 600; }
  .wt-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 50vh; overflow-y: auto;
    padding: 2px;
  }
  .wt-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px; align-items: center;
    padding: 8px 10px; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border);
    font-size: 12px;
  }
  .wt-row-agent { border-color: rgba(210,153,34,0.30); }
  .wt-row-path {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    color: var(--text); word-break: break-all; overflow-wrap: anywhere;
    min-width: 0;
  }
  .wt-row-branch {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .wt-row-branch .wt-icon { opacity: 0.6; margin-right: 3px; }
  .wt-tag {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 2px 6px; border-radius: 3px; font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    white-space: nowrap;
  }
  .wt-tag-agent { color: var(--orange); background: rgba(210,153,34,0.10); border-color: rgba(210,153,34,0.30); }
  .wt-tag-locked { color: var(--accent); background: rgba(88,166,255,0.10); border-color: rgba(88,166,255,0.30); }
  .wt-tag-detached { color: var(--red); background: rgba(248,81,73,0.10); border-color: rgba(248,81,73,0.30); }
  .wt-tag-dirty { color: var(--orange); background: rgba(210,153,34,0.10); border-color: rgba(210,153,34,0.30); }
  .wt-tag-who {
    font-family: inherit; cursor: pointer;
    color: var(--accent); background: rgba(88,166,255,0.10); border-color: rgba(88,166,255,0.30);
  }
  .wt-tag-who:hover { background: rgba(88,166,255,0.18); }
  .wt-tag-who:disabled { cursor: default; opacity: 0.6; }
  .wt-tag-pr {
    color: #a371f7; background: rgba(163,113,247,0.10);
    border-color: rgba(163,113,247,0.30);
    text-decoration: none;
  }
  .wt-tag-pr:hover { background: rgba(163,113,247,0.18); }
  .wt-tag-pr-draft { opacity: 0.7; }
  .wt-row-dirty { border-left: 3px solid var(--orange); }
  .wt-empty {
    padding: 16px; text-align: center; color: var(--text-muted);
    font-size: 13px;
  }
  .wt-lock-reason {
    grid-column: 1 / -1;
    font-size: 11px; color: var(--text-muted);
    font-style: italic;
    padding-top: 2px;
  }
  /* "PRs without a worktree" section appended below the worktree list
     in the topbar modal. Same row visual language as the worktree rows
     so the eye groups them, but with a faint heading separator. */
  .wt-section-heading {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); font-weight: 600;
    padding: 10px 2px 4px; border-top: 1px solid var(--border);
    margin-top: 4px;
  }
  .wt-pr-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px; align-items: center;
    padding: 8px 10px; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border);
    font-size: 12px;
  }
  .wt-pr-num {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    color: #a371f7; font-weight: 600;
    text-decoration: none;
  }
  .wt-pr-num:hover { text-decoration: underline; }
  .wt-pr-title {
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .wt-pr-branch {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    color: var(--text-muted); font-size: 11px;
    white-space: nowrap;
  }

  /* ── Live badge + streaming bubble ─────────────────────────────
     Shown when CCC is tailing a spawn log for the active session.
     The badge sits next to the Launch/Jump buttons; the bubble
     anchors at the bottom of the conv view and renders block-level
     events as they land. Both disappear when the headless agent
     finishes the turn (`result` event in stream-json) or the user
     switches conversations. */
  .live-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(63,185,80,0.10);
    border: 1px solid rgba(63,185,80,0.35);
    color: var(--green, #3fb950);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    white-space: nowrap;
  }
  .live-badge-dot {
    position: relative;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green, #3fb950);
  }
  /* GPU-composited ring (transform+opacity) — see .conv-live-dot::after. */
  .live-badge-dot::after {
    content: ''; position: absolute; inset: 0;
    border-radius: 50%;
    background: rgba(63,185,80,0.55);
    animation: live-pulse 1.4s ease-out infinite;
    will-change: transform, opacity;
    pointer-events: none;
  }
  @keyframes live-pulse {
    0%   { transform: scale(1);   opacity: 0.55; }
    70%  { transform: scale(3);   opacity: 0; }
    100% { transform: scale(3);   opacity: 0; }
  }
  .stream-bubble {
    margin: 8px -13px; padding: 10px 12px;
    border-radius: 8px;
    background: rgba(63,185,80,0.04);
    border: 1px dashed rgba(63,185,80,0.3);
    color: var(--text);
    word-break: break-word;
  }
  .stream-bubble-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--green, #3fb950);
    margin-bottom: 6px; opacity: 0.85;
  }
  .stream-bubble-blocks { display: flex; flex-direction: column; gap: 8px; }
  /* CCC-875: the header ("streaming"/"subagent") flashes on and off many
   * times per turn if shown before any block has landed — spawn events can
   * arrive well before the first visible text/tool block. Hide it until the
   * bubble actually has content. */
  .stream-bubble:not(.stream-bubble-has-content) .stream-bubble-header {
    display: none;
  }
  /* OPS-1351: a bubble created by a thinking-only/empty spawn event rendered
   * as an empty dashed box that popped in and out, shifting the transcript by
   * a row each time. Keep the whole bubble out of layout until it has content. */
  .stream-bubble:not(.stream-bubble-has-content) {
    display: none;
  }
  .stream-block-text { white-space: normal; }
  .stream-block-tool {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 12px; color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 4px; padding: 3px 8px;
    align-self: flex-start;
  }
  .stream-block-tool .stream-tool-name { color: var(--accent); font-weight: 600; }
  .stream-block-thinking {
    font-size: 11px; color: var(--text-muted);
    font-style: italic; opacity: 0.7;
  }
  .stream-bubble-settled {
    border-style: solid;
    opacity: 0.8;
    transition: opacity 0.4s ease-out;
  }
  /* Subagent (Task tool) variant. Visually nested under the parent's
   * stream — different border tint (purple), left indent, smaller
   * footprint — so the user can tell at a glance "this is a subagent
   * doing work" vs the parent agent's main turn. Without this they all
   * look identical and the conv reads as one frantic stream-of-
   * consciousness. */
  .stream-bubble-subagent {
    margin-left: 16px;
    margin-right: -13px;
    background: rgba(165,127,238,0.05);
    border-color: rgba(165,127,238,0.35);
    border-left-width: 3px;
    border-left-style: solid;
  }
  .stream-bubble-subagent .stream-bubble-header {
    color: var(--purple, #a57fee);
  }
  .stream-bubble-subagent .live-badge-dot {
    background: var(--purple, #a57fee);
  }
  /* Per-Task subagent tab strip. Lives above .conversations-view inside
   * each .conv-pane. Only shown when at least one subagent tab exists.
   * Master tab is always present once the strip appears. */
  .conv-tab-strip {
    display: flex; flex-direction: row; flex-wrap: wrap;
    gap: 4px; padding: 6px 12px 0; margin: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary, transparent);
    font-size: 12px;
  }
  .conv-tab-strip[hidden] { display: none; }
  .conv-tab {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
    max-width: 200px;
    user-select: none;
  }
  .conv-tab:hover { color: var(--text); background: rgba(255,255,255,0.06); }
  .conv-tab.is-active {
    color: var(--text);
    background: var(--bg, #0d1117);
    border-color: var(--accent, #58a6ff);
    border-bottom-color: var(--bg, #0d1117);
    margin-bottom: -1px;
  }
  .conv-tab[data-tab^="task-"].is-active {
    border-color: var(--purple, #a57fee);
    color: var(--purple, #a57fee);
  }
  .conv-tab.is-completed .conv-tab-label::after {
    content: ' ✓';
    color: var(--green, #3fb950);
    opacity: 0.8;
  }
  .conv-tab-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 160px;
  }
  .conv-tab-close {
    display: inline-block;
    margin-left: 2px;
    padding: 0 4px;
    opacity: 0.4;
    border-radius: 3px;
    cursor: pointer;
  }
  .conv-tab[data-tab="master"] .conv-tab-close { display: none; }
  .conv-tab-close:hover { opacity: 1; background: rgba(255,255,255,0.1); }
  /* Live dot — sits to the left of the per-row timestamp on .conv-item
   * rows whose session is currently live (sidecar marker exists). Distinct
   * from the live-tool pill in the title row; this just signals "this row
   * is being actively polled, its state can change in real time" so the
   * user knows where the freshness comes from. */
  .conv-live-dot {
    display: inline-block;
    position: relative;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent, #58a6ff);
    margin-right: 4px;
    flex-shrink: 0;
    vertical-align: middle;
  }
  /* Sonar-ping ring. transform+opacity is compositor-cheap in Chrome, but
     WKWebView still CPU-paints N of these every frame and the GPU process
     sits at 60-80%. Keep the static 7px dot on every live row; pulse only
     the open (list-selected) one. */
  .conv-live-dot::after {
    content: none;
    animation: none;
  }
  .conv-item.list-selected .conv-live-dot::after {
    content: ''; position: absolute; inset: 0;
    border-radius: 50%;
    background: rgba(88,166,255,0.55);
    animation: ccc-live-dot-pulse 2.4s ease-out infinite;
    will-change: transform, opacity;
    pointer-events: none;
  }
  @keyframes ccc-live-dot-pulse {
    0%   { transform: scale(1);    opacity: 0.55; }
    70%  { transform: scale(2.7);  opacity: 0; }
    100% { transform: scale(2.7);  opacity: 0; }
  }

  /* Per-event stream-vs-JSONL ordering stamps (`[S …]` = stdout stream,
     `[J …]` = JSONL tail). Diagnostic only — they cost a full line of
     vertical space per event, so they are OFF by default and only render
     when `ccc-debug-ts` is set on <body> (toggle from devtools:
     document.body.classList.add('ccc-debug-ts')). */
  body.ccc-debug-ts .stream-block-tool[data-render-ts]::before,
  body.ccc-debug-ts .stream-block-thinking[data-render-ts]::before {
    content: '[S ' attr(data-render-ts) ']';
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 10px; color: var(--accent); opacity: 0.75;
    margin-right: 6px;
  }
  body.ccc-debug-ts .conversations-view .event[data-render-ts]::before {
    content: '[J ' attr(data-render-ts) ']';
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 10px; color: var(--text-muted); opacity: 0.75;
    margin-right: 6px; display: inline-block;
  }
  body.ccc-debug-ts .tool-call-group-header[data-render-ts]::before {
    content: '[J ' attr(data-render-ts) ']';
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 10px; color: var(--text-muted); opacity: 0.75;
    margin-right: 6px;
  }
  .stream-bubble-settled .stream-bubble-header span:last-child::after {
    content: ' · settled';
    opacity: 0.7;
  }
  .stream-bubble-settled .live-badge-dot { animation: none; opacity: 0.5; }
  /* CCC-155: a stalled stream (headless went unresponsive mid-stream) — stop
     the pulsing dot and flag it so a stuck bubble doesn't read as "streaming". */
  .stream-bubble-stalled { border-style: solid; opacity: 0.75; }
  .stream-bubble-stalled .live-badge-dot {
    animation: none; opacity: 0.6; background: var(--yellow, #d29922);
  }
  .stream-bubble-stalled .stream-bubble-header { color: var(--yellow, #d29922); }
  .stream-bubble-stalled .stream-bubble-header span:last-child::after {
    content: ' · stalled (headless not responding)';
    opacity: 0.85;
  }
  .conv-sticky-header .csh-col-activity .session-timeline {
    margin-top: 0;
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    overflow: visible;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
  }
  /* When the timeline has no events, drop it out of the flex flow so a
     promoted Earlier-ask block sitting next to it gets the full column
     height and renders top-aligned (instead of being pushed into the
     bottom half by the empty timeline's `flex: 1 1 auto`). */
  .csh-col-activity .session-timeline:empty {
    display: none;
  }
  .conv-sticky-header .csh-col-activity .session-timeline .stl-body {
    min-height: 0; flex: 1 1 auto;
  }
  /* Session-activity timeline — chronological commit / push / PR strip
     in the right column of the sticky header. */
  .session-timeline {
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 12px;
  }
  .session-timeline .stl-header {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 6px;
  }
  .session-timeline .stl-title { font-weight: 600; }
  .session-timeline .stl-counter { font-weight: 400; opacity: 0.7; }
  .session-timeline .stl-toggle {
    margin-left: auto; background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; padding: 2px 6px; font-size: 11px; border-radius: 3px;
  }
  .session-timeline .stl-toggle:hover { background: var(--surface-2); color: var(--text); }
  .session-timeline.collapsed .stl-body { display: none; }
  .session-timeline .stl-body {
    display: flex; flex-direction: column; gap: 2px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  }
  .session-timeline .stl-empty {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
    opacity: 0.75;
  }
  .session-timeline .stl-row {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 4px; border-radius: 4px;
  }
  .session-timeline .stl-row:hover { background: var(--surface-2); }
  .session-timeline .stl-turn {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 10px; color: var(--text-muted);
    background: var(--bg); padding: 1px 6px; border-radius: 3px;
    min-width: 36px; text-align: center;
  }
  .session-timeline .stl-icon { font-size: 11px; opacity: 0.85; min-width: 12px; text-align: center; }
  .session-timeline .stl-commit .stl-icon { color: var(--green); }
  .session-timeline .stl-push   .stl-icon { color: var(--accent); }
  .session-timeline .stl-pr     .stl-icon { color: var(--purple); }
  .session-timeline .stl-failed .stl-icon { color: var(--red); }
  .session-timeline .stl-text { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  .session-timeline .stl-text code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 11px; background: var(--bg); padding: 1px 4px; border-radius: 2px;
    color: var(--orange);
  }
  .session-timeline .stl-gap {
    color: var(--text-muted); font-size: 10px; opacity: 0.6;
    padding-left: 14px;
  }
  .session-timeline .stl-gap.stl-final { font-style: italic; }

  /* Inline tool_result output preview, attached under .tool-call */
  .tool-result-output {
    margin: 4px 0 0 18px;
    padding: 6px 10px;
    background: var(--bg);
    border-left: 2px solid var(--border);
    border-radius: 0 4px 4px 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-muted);
    white-space: pre-wrap;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    max-height: 200px;
    overflow-y: auto;
  }
  .tool-result-output::before {
    content: attr(data-result-label);
    display: block;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 650;
    color: var(--text);
  }
  /* A tool can fail while the agent recovers (for example, grep no-match).
     Keep that visible, but reserve red for unrecovered session/CCC failures. */
  .tool-result-output.is-error { border-left-color: var(--orange); color: var(--orange); }
  .tool-result-output.is-error::before { color: var(--orange); }
  /* CCC-46: relayed answer confirmation — a success, shown green not red. */
  .tool-result-output.is-answer-confirm { border-left-color: var(--green); color: var(--green); }
  .tool-result-output.is-answer-confirm::before { color: var(--green); }
  /* CCC-500: long results get clipped by the fixed max-height with only a
     faint scrollbar as a hint — an explicit toggle to see everything. */
  .tool-result-output.is-expanded { max-height: none; }
  .tool-result-expand-toggle {
    display: block;
    margin: 4px 0 0 18px;
    padding: 3px 8px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    font-size: 11px;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
  }
  .tool-result-expand-toggle:hover { background: var(--bg-hover, rgba(255,255,255,0.06)); }
  .tool-result-code-preview {
    margin: 6px 0 4px 18px;
    max-width: min(100%, 980px);
    background: var(--bg);
  }
  .tool-result-code-preview .tool-result-code-title {
    display: flex; align-items: center; gap: 8px; justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--text-muted);
  }
  .tool-result-code-preview .tool-result-code-title code {
    color: var(--cyan);
    background: transparent;
    padding: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tool-result-code-preview pre.cb {
    max-height: 360px;
    overflow-y: auto;
  }
  .conversations-view .tool-call-group-body .event { margin: 4px 0; padding: 2px 0; background: transparent; border: none; }
  .conversations-view .tool-call-group-body .event .line-num,
  .conversations-view .tool-call-group-body .event .msg-ts { display: none; }
  /* When the user has "Hide tools" toggled on (which normally hides
     every .event.tool-only and .tool-call), still show them inside an
     expanded group — the whole point of expanding is to see them. */
  .hide-tools .conversations-view .tool-call-group-body .event.tool-only,
  .conversations-view.hide-tools .tool-call-group-body .event.tool-only { display: block !important; }
  .hide-tools .conversations-view .tool-call-group-body .tool-call,
  .conversations-view.hide-tools .tool-call-group-body .tool-call { display: block !important; }
  .conversations-view .event.result { background: rgba(57, 210, 192, 0.08); border-left-color: var(--cyan); font-size: 12px; }
  .conversations-view .event.result .label { color: var(--cyan); font-weight: 600; text-transform: uppercase; font-size: 11px; }
  .conversations-view .result-copy-agent-answer { width: 17px; height: 17px; font-size: 10px; }
  .conversations-view .event.result .stats { margin-top: 4px; }
  .conversations-view .event.result .stats span { margin-right: 16px; }
  .font-size-controls {
    display: flex; gap: 2px; align-items: center;
  }
  .font-size-btn {
    width: 28px; height: 28px;
    border-radius: 4px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
  }
  .font-size-btn:hover { color: var(--text); background: var(--surface-2); }
  .conv-item {
    --conv-dot-col: 36px;
    --conv-time-col: 43px;
    --conv-icon-left: 10px;
    --conv-content-left: calc(var(--conv-icon-left) + var(--conv-dot-col) + 8px);
    /* Bumped vertical padding (4 → 6) and tightened the row left/right
       (10 → 12) for the Omnara-style breathing room — rows feel less
       cramped without losing scannable density. */
    padding: 6px 12px 6px var(--conv-content-left); border-radius: 6px; cursor: pointer;
    margin-bottom: 2px; transition: background 0.06s ease;
    border-left: 3px solid transparent;
    position: relative;
  }
  /* --conv-content-left was previously ALSO applied as .conv-main-row's own
     padding-left (removed below), so this gutter was double-counted and a
     per-cost-tier override was added to shrink the visible gap. Measured
     live: the icon's own fixed-width box (--conv-icon-left + --conv-dot-col)
     always extends further than any cost-glyph text, in every tier — so
     once the double-application is gone, the single default formula above
     already gives the right gap for every tier and no override is needed. */
  .conv-item:hover { background: var(--surface-2); }
  .conv-item.active { background: color-mix(in srgb, var(--purple) 12%, var(--surface-2)); border-left-color: var(--purple); }
  /* CCC-129: the session open in the other (unfocused) split pane. */
  .conv-item.in-other-pane { background: color-mix(in srgb, #58a6ff 11%, var(--surface-2)); border-left-color: #58a6ff; }
  /* Orchestration family of the selected session: root teal, lanes purple.
     Uses the row's existing 3px border-left, so nothing moves. */
  .conv-item.is-orch-root { border-left-color: #39c5cf; }
  .conv-item.is-orch-lane { border-left-color: color-mix(in srgb, #a371f7 60%, transparent); }
  .conv-item.is-orch-lane.active { border-left-color: var(--purple); }
  .conv-orch-lanes-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(57, 197, 207, 0.95);
    background: rgba(57, 197, 207, 0.12);
    border: 1px solid rgba(57, 197, 207, 0.35);
    border-radius: 3px;
    letter-spacing: 0.03em;
    vertical-align: middle;
    white-space: nowrap;
  }
  /* Completion cue. Pulses for as long as the class is on (JS removes it after
     ~6s) rather than running a single 1.8s fade — a one-shot animation restarts
     from zero on every sidebar re-render, which either swallowed the cue or
     replayed it as a flicker. A pulse is re-render-safe and reads as "look
     here" from across the room, which is the whole point of pairing it with
     the beep. */
  .conv-item.conv-item-completion-glow,
  .kanban-card.conv-item-completion-glow {
    position: relative;
  }
  .conv-item.conv-item-completion-glow::after,
  .kanban-card.conv-item-completion-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: rgba(57, 210, 192, 0.22);
    box-shadow: inset 0 0 0 1px rgba(57, 210, 192, 0.7), 0 0 14px rgba(57, 210, 192, 0.28);
    animation: conv-completion-glow 1.1s ease-in-out infinite;
    will-change: opacity;
  }
  @keyframes conv-completion-glow {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .conv-item.conv-item-completion-glow::after,
    .kanban-card.conv-item-completion-glow::after {
      animation: none;
      opacity: 0.85;
    }
  }
  .conv-item.is-history-match { border-left-color: rgba(120, 168, 255, 0.5); }
  .conv-repeat-group {
    margin: 1px 0;
  }
  .conv-repeat-group-header {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    box-sizing: border-box;
  }
  .conv-repeat-group-header:hover {
    background: var(--surface-2);
  }
  .conv-repeat-group-toggle {
    min-width: 0;
    flex: 1 1 auto;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px 6px var(--conv-content-left);
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    box-sizing: border-box;
  }
  .conv-repeat-group-toggle:focus-visible,
  .conv-repeat-group-archive:focus-visible,
  .conv-repeat-group-trash:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--accent);
  }
  .conv-repeat-group-archive,
  .conv-repeat-group-trash {
    flex: 0 0 auto;
    margin: 4px 8px 4px 4px;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
  }
  .conv-repeat-group-archive:hover,
  .conv-repeat-group-trash:hover {
    border-color: var(--accent);
    color: var(--text);
  }
  .conv-repeat-group-arrow {
    width: 14px;
    flex: 0 0 14px;
    margin-left: calc(-1 * var(--conv-dot-col) - 2px);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1;
    text-align: center;
  }
  .conv-repeat-group-title {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }
  .conv-repeat-group-toggle > .conv-session-icon {
    position: relative;
    flex: 0 0 34px;
    width: 34px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    opacity: 0.88;
    pointer-events: none;
  }
  .conv-repeat-group-toggle > .conv-session-icon.conv-idea-avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    justify-content: center;
    opacity: 1;
  }
  .conv-repeat-group-toggle:hover > .conv-session-icon,
  .conv-repeat-group-toggle:focus-visible > .conv-session-icon {
    opacity: 1;
  }
  .conv-repeat-group-count {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 1px 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
  }
  /* Context span across the folded rows, next to the age span. Muted: it
     summarises what is hidden, it is not a per-row reading. */
  .conv-repeat-group-ctx {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
  }
  .conv-repeat-group-rel {
    flex: 0 0 auto;
    min-width: 34px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .conv-repeat-group-body {
    margin-left: 12px;
    border-left: 1px solid var(--border);
  }
  .conv-repeat-group.is-collapsed .conv-repeat-group-body {
    display: none;
  }
  .conv-history-badge {
    display: inline-block; margin-left: 6px; padding: 1px 5px;
    font-size: 9px; font-weight: 500; line-height: 1.4;
    color: rgba(120, 168, 255, 0.95);
    background: rgba(120, 168, 255, 0.12);
    border: 1px solid rgba(120, 168, 255, 0.35);
    border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em;
    vertical-align: middle;
  }
  .conv-history-snippet {
    margin: 2px 0 4px 14px; padding: 4px 8px;
    font-size: 11px; line-height: 1.4;
    color: var(--muted); background: rgba(255,255,255,0.025);
    border-left: 2px solid rgba(120, 168, 255, 0.25);
    border-radius: 0 4px 4px 0;
    white-space: pre-wrap; word-break: break-word;
    overflow: hidden; max-height: 3.5em;
  }
  .conv-history-snippet mark {
    background: rgba(255, 213, 100, 0.3); color: var(--text);
    padding: 0 2px; border-radius: 2px;
  }
  .conv-history-snippet.is-search-result {
    max-height: 9.8em;
  }
  /* Worktree-origin badge: shown when a session came from a sibling
     worktree dir (e.g. claude-command-center-wt-gemini). */
  .conv-wt-badge {
    display: inline-block; margin-left: 0; padding: 1px 5px;
    font-size: 9px; font-weight: 500; line-height: 1.4;
    color: rgba(100, 210, 180, 0.9);
    background: rgba(100, 210, 180, 0.10);
    border: 1px solid rgba(100, 210, 180, 0.30);
    border-radius: 3px; letter-spacing: 0.03em;
    vertical-align: middle;
    max-width: 120px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Orchestration badge: this row spawned N child sessions (lanes). */
  .conv-orch-badge {
    display: inline-block; margin-left: 6px; padding: 1px 5px;
    font-size: 9px; font-weight: 500; line-height: 1.4;
    color: rgba(190, 140, 255, 0.95);
    background: rgba(190, 140, 255, 0.12);
    border: 1px solid rgba(190, 140, 255, 0.35);
    border-radius: 3px; letter-spacing: 0.03em;
    vertical-align: middle;
  }
  .conv-qc-badge {
    display: inline-flex; align-items: center; flex: 0 0 auto;
    margin-right: 4px; padding: 1px 4px; line-height: 1.4;
    border-radius: 3px; font-size: 10px; font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    position: relative; z-index: 6;
    white-space: nowrap;
  }
  .conv-qc-badge.is-good {
    color: var(--green);
    background: rgba(63, 185, 80, 0.16);
  }
  .conv-qc-badge.is-warn {
    color: #FBCA04;
    background: rgba(251, 202, 4, 0.15);
  }
  .conv-qc-badge.is-bad {
    color: var(--red);
    background: rgba(248, 81, 73, 0.16);
  }
  /* Context-window % — sits in .conv-branch-slot just left of wt-/branch. */
  .conv-pct-badge {
    display: inline-flex; align-items: center; flex: 0 0 auto;
    font-size: 10px; opacity: 0.85; font-weight: 600;
    padding: 1px 4px; line-height: 1.4;
    background: var(--surface-2); border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--accent);
    /* Sit above the hover .conv-row-actions overlay (z-index 5) so the
       click-to-compact badge, which renders just left of the elapsed time,
       stays clickable while the row is hovered instead of being masked by the
       pin/archive action bar. (CCC-295) */
    position: relative;
    z-index: 6;
  }
  .conv-lifetime-tokens {
    display: inline-flex; align-items: center; flex: 0 0 auto;
    margin-right: 4px; padding: 1px 4px; line-height: 1.4;
    border-radius: 3px; font-size: 10px; font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: rgba(139, 148, 158, 0.95);
    background: rgba(139, 148, 158, 0.12);
    white-space: nowrap;
  }
  .conv-pct-badge.is-warn {
    color: #FBCA04;
    background: rgba(251, 202, 4, 0.15);
  }
  .conv-pct-badge.is-danger {
    color: var(--red);
    background: rgba(248, 81, 73, 0.16);
  }
  /* Click → /compact confirm. cursor:pointer + a faint hover lift make the
     badge feel like a button without changing its resting visual weight. */
  .conv-pct-badge.is-actionable {
    cursor: pointer;
    user-select: none;
    transition: filter 0.12s ease-out, transform 0.12s ease-out, opacity 0.12s ease-out;
  }
  .conv-pct-badge.is-actionable:hover { filter: brightness(1.15); opacity: 1; }
  .conv-pct-badge.is-actionable:active { transform: translateY(0.5px); }
  .conv-pct-badge.is-actionable:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
  }
  /* Semantic match — slightly different hue + label to make it visible
     when results came via the vector path (vs lexical BM25). */
  .conv-history-badge.is-semantic {
    color: rgba(180, 140, 255, 0.95);
    background: rgba(180, 140, 255, 0.14);
    border-color: rgba(180, 140, 255, 0.40);
  }
  .conv-history-badge.is-recall {
    color: rgba(100, 210, 180, 0.95);
    background: rgba(100, 210, 180, 0.12);
    border-color: rgba(100, 210, 180, 0.38);
  }
  .conv-item.is-history-match.is-semantic-match {
    border-left-color: rgba(180, 140, 255, 0.55);
  }
  .conv-item.is-history-match.is-recall-match {
    border-left-color: rgba(100, 210, 180, 0.55);
  }
  /* Topbar history-index status pill. */
  .hi-status-pill {
    display: inline-flex; align-items: center; gap: 4px;
    cursor: pointer; user-select: none;
  }
  .hi-status-pill .hi-pill-icon { opacity: 0.85; }
  .hi-status-pill .hi-pill-sem { color: rgba(180,140,255,0.9); font-size: 10px; }
  .hi-status-pill.is-indexing .hi-pill-icon { animation: hi-spin 1.4s linear infinite; }
  .hi-status-pill.is-stale { color: rgba(255, 180, 100, 0.95); }
  @keyframes hi-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
  /* OOBE prompt — inline ribbon under convSearch the first time the user
     types a query while no index exists. Single CTA, dismissible. */
  .hi-oobe {
    margin: 6px 0; padding: 8px 10px;
    font-size: 11px; line-height: 1.45;
    color: var(--text);
    background: rgba(120, 168, 255, 0.08);
    border: 1px solid rgba(120, 168, 255, 0.25);
    border-radius: 6px;
  }
  .hi-oobe .hi-oobe-title {
    font-weight: 600; margin-bottom: 4px;
  }
  .hi-oobe .hi-oobe-actions {
    display: flex; gap: 6px; margin-top: 6px;
  }
  .hi-oobe button {
    padding: 4px 10px; font-size: 11px; border-radius: 4px;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); cursor: pointer;
  }
  .hi-oobe button.primary {
    background: rgba(120, 168, 255, 0.18);
    border-color: rgba(120, 168, 255, 0.45);
  }
  .hi-oobe button:hover { filter: brightness(1.15); }
  .hi-oobe .hi-oobe-retention {
    display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; cursor: pointer;
  }
  .hi-oobe .hi-oobe-retention input { margin-top: 2px; }
  .hi-oobe .hi-oobe-muted { color: var(--text-dim, #8b949e); }
  .conv-item .conv-title-row {
    display: flex;
    min-width: 0;
  }
  .conv-item .conv-main-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .conv-summary-toggle {
    flex: 0 0 auto;
    width: 18px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
  }
  .conv-summary-toggle:hover,
  .conv-summary-toggle:focus-visible {
    color: var(--accent, #58a6ff);
    background: rgba(88,166,255,0.10);
    outline: none;
  }
  .conv-row-actions .conv-summary-toggle {
    width: 20px;
    height: 18px;
  }
  /* Row-end slot — Omnara-style. Holds the time at rest, swaps to action
     buttons (merge / start / archive) on hover. The two share the same
     screen real estate via `position: absolute` on the actions, so the
     row stays narrow and there's no layout shift between hover states. */
  .conv-item .conv-row-end {
    position: relative;
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 44px;     /* fits rel time at rest, and quick trash + kebab on hover */
    min-height: 18px;    /* matches action-button height for clean swap */
    background: inherit;
  }
  .conv-item .conv-row-actions {
    position: absolute;
    /* Hover actions replace the time chip inside the right edge slot. */
    top: 50%; right: 0;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.06s ease;
    /* Solid hover bg + soft fade-out on the left edge so the actions
       fully mask the branch badge / context chips when the overlay
       extends past .conv-row-end's 36px min-width — without this the
       branch pill (e.g. "main") sat ON TOP of the merge button and
       intercepted the click. background: inherit alone wasn't enough
       because the chips have their own non-transparent backgrounds. */
    background: var(--surface-2);
    padding: 2px 4px;
    border-radius: 4px;
    box-shadow: -8px 0 10px -2px var(--surface-2);
    z-index: 5;
  }
  .conv-item .conv-row-actions:empty { display: none; }
  .conv-item .conv-row-hover-slot {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.06s ease;
    z-index: 3;
  }
  /* The row-end hover slot (trash + kebab, over the timestamp) shows on any
     row hover — it never overlaps the title, so the row is still one clean
     click target. Title chrome (meta overlay, pencil, grip) stays quiet on
     unselected rows and appears once the row is selected. */
  .conv-item:hover .conv-row-hover-slot,
  .conv-item:focus-within .conv-row-hover-slot {
    opacity: 1;
    pointer-events: auto;
  }
  .conv-item.is-actions-open .conv-row-hover-slot {
    opacity: 0;
    pointer-events: none;
  }
  .conv-item .conv-row-hover-slot .conv-trash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 18px;
    border: none;
    background: transparent;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1;
    color: var(--text-muted);
    opacity: 0.75;
    transition: opacity 0.06s ease, color 0.1s ease, background 0.1s ease;
  }
  .conv-item .conv-row-hover-slot .conv-trash-btn:hover,
  .conv-item .conv-row-hover-slot .conv-trash-btn:focus-visible {
    opacity: 1;
    color: var(--red);
    background: rgba(248,81,73,0.12);
  }
  .conv-item .conv-row-hover-slot .conv-trash-btn.is-restore:hover {
    color: var(--accent);
    background: rgba(88,166,255,0.12);
  }
  /* Three-state row-end swap (CCC-783): at rest, the time shows. On hover
     (or focus-within for keyboard users), the time fades out and the hover slot
     (trash can + 2-dot kebab) fades in. Clicking the kebab (`.is-actions-open`) swaps again to
     the actions bar itself — only one of the three is ever visible. */
  .conv-item .conv-kebab-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 20px;
    height: 18px;
    border: none;
    background: transparent;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    flex: 0 0 auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.06s ease, background 0.1s ease;
  }
  .conv-item .conv-row-hover-slot .conv-kebab-btn {
    opacity: 1;
    pointer-events: auto;
  }
  .conv-item .conv-kebab-btn:hover,
  .conv-item .conv-kebab-btn:focus-visible {
    background: rgba(255,255,255,0.08);
  }
  .conv-item .conv-kebab-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
  }
  .conv-item:hover .conv-row-end > .conv-kebab-btn,
  .conv-item:focus-within .conv-row-end > .conv-kebab-btn,
  .conv-item:hover .conv-row-end .conv-kebab-btn,
  .conv-item:focus-within .conv-row-end .conv-kebab-btn {
    opacity: 1;
    pointer-events: auto;
  }
  /* Kebab menu: a normal dropdown, not an overlay on the row. JS sets
     --ca-top / --ca-right from the kebab's rect (flips above near the
     viewport bottom); each icon button gets its title as a text label. */
  .conv-item.is-actions-open .conv-row-actions:not(:empty) {
    opacity: 1;
    pointer-events: auto;
    position: fixed;
    top: var(--ca-top, 0);
    right: var(--ca-right, 0);
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
    min-width: 190px;
    max-width: 280px;
    padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    z-index: 60;
  }
  .conv-item.is-actions-open .conv-row-actions > button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    height: 28px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 13px;
    opacity: 1;
    pointer-events: auto;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .conv-item.is-actions-open .conv-row-actions > button::after {
    content: attr(title);
    font-size: 12px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .conv-item.is-actions-open .conv-row-actions > button:hover,
  .conv-item.is-actions-open .conv-row-actions > button:focus-visible {
    background: var(--surface);
  }
  .conv-item.is-pinned:not(:hover):not(:focus-within):not(.is-actions-open) .conv-row-actions:not(:empty) {
    opacity: 1;
    pointer-events: auto;
    background: transparent;
  }
  .conv-item.is-pinned:not(:hover):not(:focus-within):not(.is-actions-open) .conv-row-actions > :not(.conv-pin-btn) {
    opacity: 0;
    pointer-events: none;
  }
  .conv-item .conv-row-end > .conv-rel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    flex: 0 0 auto;            /* override the column-width flex from the base rule */
    transition: opacity 0.06s ease;
  }
  .conv-item:hover .conv-row-end > .conv-rel,
  .conv-item:focus-within .conv-row-end > .conv-rel,
  .conv-item.is-actions-open .conv-row-end > .conv-rel {
    opacity: 0;
    pointer-events: none;
  }
  .conv-item.is-pinned:not(:hover):not(:focus-within):not(.is-actions-open) .conv-row-end > .conv-rel {
    opacity: 0;
  }
  /* CCC-449: with several buttons the hover action bar extends left past the
     36px row-end slot and lands on the context-% badge, which punches through
     the bar (z-index 6, CCC-295) — archive icon and % chip rendered on top of
     each other. The main-row badge now fades out like the time chip whenever
     the action bar is actually visible; a duplicate % badge rendered as the
     first item inside the action bar keeps click-to-/compact reachable while
     it's showing (that copy is nested inside .conv-row-actions, so the
     direct-child selectors below don't touch it).
     CCC-961: the bar is only visible via `.is-actions-open` (kebab click) or,
     for pinned rows, on hover/focus (CCC-...pinned rule above) — NOT on plain
     `:hover` for a regular row. The old `:hover` selector faded the main
     badge before anything replaced it, so on a bare hover the absolutely-
     positioned .conv-hover-meta-row (UID chip, right-aligned) showed through
     in the gap where the % used to be. Scope the fade to when the bar is
     actually shown, so the badge (z-index 6) keeps winning over the meta-row
     overlay (z-index 2) during plain hover. */
  .conv-item.is-actions-open .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-pct-badge,
  .conv-item.is-actions-open .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-qc-badge,
  .conv-item.is-actions-open .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-evergreen-inline-badges .conv-pct-badge,
  .conv-item.is-actions-open .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-evergreen-inline-badges .conv-qc-badge,
  .conv-item.is-pinned:hover .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-pct-badge,
  .conv-item.is-pinned:hover .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-qc-badge,
  .conv-item.is-pinned:hover .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-evergreen-inline-badges .conv-pct-badge,
  .conv-item.is-pinned:hover .conv-main-row:has(.conv-row-actions:not(:empty)) > .conv-evergreen-inline-badges .conv-qc-badge {
    opacity: 0;
    pointer-events: none;
  }
  .conv-item .conv-qc-badge { transition: opacity 0.06s ease; }
  .conv-item .conv-row-meta { transition: opacity 0.06s ease; }
  .conv-item .conv-row-end > .conv-rel {
    flex: 0 0 auto;            /* override the column-width flex from the base rule */
    transition: opacity 0.06s ease;
  }
  .conv-item .conv-branch-slot { transition: opacity 0.06s ease; }
  .conv-item .conv-session-icon {
    position: absolute;
    left: var(--conv-icon-left);
    top: 50%;
    transform: translateY(-50%);
    width: var(--conv-dot-col);
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 2px;
    flex: 0 0 var(--conv-dot-col);
    vertical-align: middle;
    opacity: 0.88;
    pointer-events: none;
    z-index: 1;
  }
  .conv-item:hover .conv-session-icon,
  .conv-item:focus-within .conv-session-icon {
    opacity: 1;
  }
  .conv-item .conv-title {
    /* Omnara-style: slightly larger and looser line-height than the old
       13/1.2, weight stays at 400 — the difference reads as "designed
       breathing room" rather than "denser is better". */
    font-size: 14.5px; font-weight: 400; color: var(--text);
    line-height: 1.4; flex: 1 1 auto; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    word-break: keep-all;
    letter-spacing: -0.005em;
  }
  .wrap-titles .conv-item .conv-title,
  .wrap-titles.compact-rows .conv-item .conv-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  /* Folder/object group headers title their row with .conv-folder-group-chip,
     not .conv-item .conv-title — Wrap needs its own rule to reach them.
     Stay inline-flex here (not -webkit-box): -webkit-box drops `gap` and
     stacks the ::before swatch above the text instead of beside it, losing
     the pill treatment non-wrap mode has (CCC-999). */
  .wrap-titles .conv-folder-group-chip {
    white-space: normal;
    display: inline-flex;
    align-items: flex-start;
    overflow: hidden;
  }
  .conv-item .conv-empty-session-chip {
    flex: 0 0 auto;
    margin-left: 5px;
    padding: 1px 4px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.25;
  }
  /* Fast custom tooltip (JS-driven, body-mounted) for truncated titles —
     replaces the native title= attribute's fixed ~500ms OS delay. */
  /* .ccc-tip rules removed with the truncated-title hover tooltip. */
  /* Stacked-region labels in the by-objects view: "Current sessions" /
     "Project tree" headers that separate the live triage list from the
     object hierarchy. */
  .conv-objects-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .conv-objects-section-label:first-child { padding-top: 4px; }
  .conv-objects-section-sub {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 10.5px;
    color: var(--faint, var(--text-muted));
    opacity: 0.8;
  }
  .conv-current-object-group + .conv-current-object-group {
    margin-top: 3px;
  }
  .conv-current-object-group.is-drop-target {
    background: rgba(88,166,255,0.10);
    outline: 1px dashed var(--accent);
    outline-offset: -2px;
  }
  .conv-current-object-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 17px;
    margin: 3px 8px 1px;
    padding: 1px 6px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  }
  .conv-current-object-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conv-current-object-count {
    margin-left: auto;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--faint, var(--text-muted));
  }
  #convList.objects-scroll-split {
    overflow-y: hidden !important;
    display: flex;
    flex-direction: column;
  }
  #convList.objects-scroll-split .conv-inprogress-section,
  #convList.objects-scroll-split .conv-inprogress-list {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  #convList.objects-scroll-split .conv-inprogress-toolbar,
  #convList.objects-scroll-split .conv-tab-bar,
  #convList.objects-scroll-split .conv-repo-search-section,
  #convList.objects-scroll-split .conv-id-search-section,
  #convList.objects-scroll-split .conv-openask-section {
    flex: 0 0 auto;
  }
  /* Accordion header (CCC-397): mirrors Triggered Workers below — a
     clickable pill above the scroll box, collapsing it away in place. */
  .conv-current-sessions-header {
    margin: 0 2px 0 0;
    border: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: rgba(139, 148, 158, 0.08);
    cursor: pointer;
    user-select: none;
  }
  .conv-current-sessions-header.is-collapsed {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-radius: 8px;
  }
  .conv-current-sessions-scroll.is-collapsed { display: none; }
  .conv-current-sessions-scroll {
    --current-session-row-h: 20px;
    --current-session-label-h: 18px;
    --current-sessions-visible-rows: 8;
    flex: 0 0 var(--current-sessions-panel-h, clamp(
      calc(var(--current-session-label-h) + (var(--current-session-row-h) * var(--current-sessions-visible-rows))),
      34vh,
      420px
    ));
    min-height: 0;
    max-height: var(--current-sessions-panel-h, clamp(
      calc(var(--current-session-label-h) + (var(--current-session-row-h) * var(--current-sessions-visible-rows))),
      34vh,
      420px
    ));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: rgba(139, 148, 158, 0.07);
  }
  .conv-current-sessions-scroll .conv-objects-section-label {
    height: var(--current-session-label-h);
    min-height: var(--current-session-label-h);
    box-sizing: border-box;
    padding-top: 2px;
    padding-bottom: 0;
    line-height: 14px;
  }
  .conv-current-sessions-scroll .conv-item {
    min-height: var(--current-session-row-h);
    padding: 0 8px;
    margin-bottom: 0;
    border-radius: 6px;
  }
  /* A long timestamp gap is a new keyboard work session. Give that existing
     boundary a full-width rule here: the generic, low-opacity divider was
     easy to miss inside this compact panel. */
  .conv-current-sessions-scroll .conv-gap-separator {
    margin: 9px 8px 7px;
    padding-top: 5px;
    border-top: 1px solid color-mix(in srgb, var(--border) 78%, var(--text-muted));
    opacity: 0.88;
  }
  .conv-current-sessions-scroll .conv-item:hover {
    background: rgba(255, 255, 255, 0.045);
  }
  .conv-item.is-current-child-row,
  .conv-current-sessions-scroll .conv-item.is-current-child-row,
  .conv-archived-list .conv-item.is-current-child-row {
    --current-child-indent: calc(var(--current-child-depth, 1) * 14px);
    --conv-icon-left: calc(10px + var(--current-child-indent));
    border-left-color: rgba(154, 173, 194, 0.24);
    /* Nested lanes read as subordinate rows: tighter padding + a smaller
       title so a cluster of children doesn't take the same vertical
       footprint as full sessions. */
    padding-top: 2px;
    padding-bottom: 2px;
  }
  /* Slim the icon column to match: a small engine glyph, no $$$ tier text —
     the cost signal is a whole-session concern the parent row carries. */
  .conv-item.is-current-child-row .conv-session-icon .conv-session-svg {
    width: 12px;
    height: 12px;
  }
  .conv-item.is-current-child-row .session-tier-cost { display: none; }
  /* The spacing/rowstyle presets (roomy/airy padding, large-bright 16px
     titles) and the dense table all pin padding/font/line-height with
     !important at id-level specificity — a nested lane must stay slim under
     every preset, so its sizing is !important too, anchored on #convList +
     .conv-subagent-cluster to win those selectors. (Dense keeps its own,
     even slimmer, values by virtue of coming later at equal specificity.) */
  #convList .conv-subagent-cluster .conv-item.is-current-child-row {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
  #convList .conv-subagent-cluster .conv-item.is-current-child-row .conv-title {
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    /* Large Bright (the default preset since bcbb3cc9) pins weight 500 and a
       bright colour with !important, which made child rows read bold. */
    font-weight: 450 !important;
    color: var(--text-secondary) !important;
  }
  :root:not([data-theme="light"]) #convList .conv-subagent-cluster .conv-item.is-current-child-row .conv-title {
    color: color-mix(in srgb, #f0f4fb 65%, transparent) !important;
  }
  .conv-current-sessions-scroll .conv-item .conv-title-row,
  .conv-current-sessions-scroll .conv-item .conv-main-row {
    min-height: var(--current-session-row-h);
    width: 100%;
  }
  .conv-current-sessions-scroll .conv-item.is-current-child-row .conv-title-row,
  .conv-current-sessions-scroll .conv-item.is-current-child-row .conv-main-row {
    min-height: 20px;
  }
  .conv-current-sessions-scroll .conv-item .conv-title {
    color: var(--text);
    font-weight: 650;
    letter-spacing: 0;
  }
  :root:not([data-theme="light"]) .conv-current-sessions-scroll .conv-item .conv-title {
    color: #f0f4fb;
  }
  .conv-item.is-current-child-row .conv-title,
  .conv-current-sessions-scroll .conv-item.is-current-child-row .conv-title,
  .conv-archived-list .conv-item.is-current-child-row .conv-title {
    font-size: 12.5px;
    font-weight: 450;
    font-style: italic;
    color: var(--text-secondary);
    /* One line only — a nested lane never gets the wrap-titles 2-line
       clamp, or it stops reading as the slim subordinate row. */
    white-space: nowrap;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  :root:not([data-theme="light"]) .conv-item.is-current-child-row .conv-title,
  :root:not([data-theme="light"]) .conv-current-sessions-scroll .conv-item.is-current-child-row .conv-title,
  :root:not([data-theme="light"]) .conv-archived-list .conv-item.is-current-child-row .conv-title {
    color: color-mix(in srgb, #f0f4fb 65%, transparent);
  }
  /* Parent session + compact descendant presentation. New clusters stay
     collapsed; the body is toggled in place so live polling never jumps the
     sidebar or exposes a wall of completed subagent rows. */
  .conv-subagent-cluster { position: relative; }
  .conv-subagent-cluster-body { display: none; }
  .conv-subagent-cluster.is-expanded > .conv-subagent-cluster-body {
    display: block;
    /* Tree rail: shift the lane block right of the parent and run a guide
       line down its left edge, so nested children read as children rather
       than full-width sibling cards. */
    margin-left: 10px;
    padding-left: 8px;
    border-left: 1px solid rgba(154, 173, 194, 0.18);
  }
  .conv-subagent-cluster-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    min-width: 58px;
    max-width: 148px;
    padding: 1px 5px;
    border: 1px solid rgba(139, 148, 158, 0.18);
    border-radius: 999px;
    background: rgba(139, 148, 158, 0.08);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    cursor: pointer;
  }
  .conv-subagent-cluster-toggle:hover,
  .conv-subagent-cluster-toggle:focus-visible {
    color: var(--text);
    background: rgba(139, 148, 158, 0.16);
    border-color: rgba(139, 148, 158, 0.30);
    outline: none;
  }
  .conv-subagent-cluster-toggle.conv-orch-lanes-chip {
    min-width: unset;
    max-width: unset;
    color: rgba(57, 197, 207, 0.95);
    background: rgba(57, 197, 207, 0.12);
    border: 1px solid rgba(57, 197, 207, 0.35);
    border-radius: 3px;
    font-size: 9px;
    font-weight: 500;
  }
  .conv-subagent-cluster-toggle.conv-orch-lanes-chip.is-static {
    cursor: default;
  }
  .conv-subagent-cluster-toggle.conv-orch-lanes-chip.is-collapsible:hover,
  .conv-subagent-cluster-toggle.conv-orch-lanes-chip.is-collapsible:focus-visible {
    color: #fff;
    background: rgba(57, 197, 207, 0.24);
    border-color: rgba(57, 197, 207, 0.55);
  }
  .conv-subagent-collapse-footer {
    display: flex;
    justify-content: flex-end;
    padding: 2px 10px 4px 28px;
  }
  .conv-subagent-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border: 1px solid rgba(139, 148, 158, 0.18);
    border-radius: 3px;
    background: rgba(139, 148, 158, 0.08);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
  }
  .conv-subagent-collapse-btn:hover {
    color: var(--text);
    background: rgba(139, 148, 158, 0.16);
    border-color: rgba(139, 148, 158, 0.30);
  }
  .conv-subagent-cluster-arrow { flex: 0 0 auto; opacity: 0.7; }
  .conv-subagent-cluster-summary {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .conv-item.is-subagent-compact {
    min-height: 20px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .conv-item.is-subagent-compact .conv-title-row,
  .conv-item.is-subagent-compact .conv-main-row { min-height: 20px; }
  .conv-item.is-subagent-compact .conv-hover-extras,
  .conv-item.is-subagent-compact .conv-goal-icon-only,
  .conv-item.is-subagent-compact .conv-qc-badge,
  .conv-item.is-subagent-compact .conv-pct-badge { display: none !important; }
  .conv-item.is-subagent-bridge { opacity: 0.62; }
  .conv-subagent-completed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 5px 30px;
  }
  .conv-subagent-completed-label {
    flex: 0 0 auto;
    color: var(--text-muted);
    opacity: 0.58;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .conv-subagent-completed-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 190px;
    padding: 1px 6px;
    border: 1px solid rgba(139, 148, 158, 0.14);
    border-radius: 999px;
    background: rgba(139, 148, 158, 0.07);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.45;
    cursor: pointer;
  }
  .conv-subagent-completed-chip:hover,
  .conv-subagent-completed-chip:focus-visible {
    color: var(--text);
    background: rgba(88, 166, 255, 0.10);
    border-color: rgba(88, 166, 255, 0.25);
    outline: none;
  }
  .conv-subagent-completed-check { color: var(--green); opacity: 0.75; }
  .conv-subagent-completed-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conv-subagent-completed-age { flex: 0 0 auto; opacity: 0.55; font-size: 9.5px; }
  /* Current-sessions panel: meta row is the always-visible "second row".
     The brief (.conv-outcome) is hidden until the disclosure chevron opens it.
     ask/summary/history stay hidden in this panel (they belong to the reader). */
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-extras { display: contents; }
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-meta-row {
    display: flex;
    /* Hover reveals more metadata, but the current-session card must retain
       the same vertical footprint. Keep it to the existing meta line and
       clip horizontally rather than wrapping IDs/chips onto new lines. */
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    overflow: hidden;
  }
  /* Chips in the meta row are always visible here (no hover gating). */
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-meta-row .conv-meta-inline,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-meta-row .conv-branch-slot,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-meta-row .conv-object-chip,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-meta-row .conv-folder-chip,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-meta-row .conv-repo-pin { display: inline-flex; }
  /* The brief: hidden by default, revealed when the row is expanded. */
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-outcome { display: none; }
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item.is-brief-open .conv-outcome { display: block; }
  /* last-message preview / summary detail / history snippet do not belong in this panel. */
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-extras > .conv-last,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-extras > .conv-session-summary-detail,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item .conv-hover-extras > .conv-history-snippet { display: none; }
  /* Disclosure chevron styling. */
  .conv-brief-chevron {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--text-dim, #8b949e);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    padding: 0 2px;
    margin: 0;
  }
  .conv-brief-chevron:hover { color: var(--text, #e6edf3); }
  /* Hover extras wrapper. display:contents by default → transparent in every
     list/mode, so layout is identical to before everywhere except where we
     explicitly show it in the current-sessions panel above. */
  .conv-item .conv-hover-extras { display: contents; }
  .conv-current-sessions-scroll.is-search-results .conv-item {
    min-height: 0;
    padding: 8px 10px;
  }
  .conv-objects-splitter {
    flex: 0 0 10px;
    min-height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    touch-action: none;
    user-select: none;
    color: var(--text-muted);
  }
  .conv-objects-splitter::before {
    content: '';
    width: min(72px, 42%);
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 42%, transparent);
  }
  .conv-objects-splitter:hover::before,
  .conv-objects-splitter.is-dragging::before {
    height: 3px;
    background: var(--accent);
  }
  /* No drag handle when the section above has nothing to give up (CCC-397
     follow-up): a collapsed Current Sessions has no height to redistribute.
     A collapsed Project Tree below does NOT hide it (CCC-438) — Current
     Sessions still resizes against whatever expanded section is further
     down (e.g. Triggered Workers), so the handle stays live/connecting. */
  .conv-current-sessions-scroll.is-collapsed + .conv-objects-splitter {
    display: none;
  }
  body.objects-splitter-resizing {
    cursor: row-resize;
    user-select: none;
  }
  body.objects-splitter-resizing * {
    cursor: row-resize !important;
    user-select: none !important;
  }
  /* Same pill treatment as Current sessions / Triggered Workers (CCC-397
     follow-up) — this header used to be its own bigger/bolder flush-divider
     style, which read as a different UI pattern from its two siblings. */
  .conv-project-tree-header {
    flex: 0 0 auto;
    margin: 6px 2px 0 0;
    border: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: rgba(139, 148, 158, 0.08);
    cursor: pointer;
    user-select: none;
  }
  .conv-project-tree-header.is-collapsed {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-radius: 8px;
  }
  /* Accordion collapse (CCC-397): same fold-away behavior as Current
     sessions / Triggered Workers, applied to the Project tree section. */
  .conv-project-tree-scroll.is-collapsed { display: none; }
  /* ============================================================
     Project tree — pixel-match to Codex's .tree / .tree-item mock.
     Exact values lifted from the reference HTML: 30px rows, padding
     0 8px, a 1px left rail rgba(154,173,194,0.18), 18px indent per
     level, teal active accent. Scoped so by-folder groups are untouched.
     The one intended diff from the static mock: a per-level collapse
     chevron stays (we want expand/collapse at every level).
     ============================================================ */
  .conv-project-tree-scroll {
    min-height: 0;
    max-height: clamp(180px, 48vh, 680px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: rgba(139, 148, 158, 0.05);
  }
  /* Whichever of the 3 stacked sections is the LAST one currently expanded
     stretches to claim any leftover vertical space (CCC-397 follow-up) —
     JS-toggled (_updateSidebarFillSection) since it depends on which of the
     three sections is collapsed, not a fixed "Project tree always grows"
     rule (that left a dead gap below Triggered Workers whenever Project
     tree was the one collapsed). */
  #convList.objects-scroll-split .conv-section-fill {
    flex: 1 1 auto !important;
    max-height: none !important;
  }
  .conv-evergreen-agents-header {
    flex: 0 0 auto;
    margin: 6px 2px 0 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
    border-left: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-right: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-radius: 8px 8px 0 0;
    background: rgba(139, 148, 158, 0.08);
    cursor: pointer;
    user-select: none;
  }
  /* Collapsed: fold the agent list away and close off the header's bottom edge
     so it reads as a self-contained pill (CCC-282). Shared chevron styling
     across all three accordion headers (CCC-397). */
  .conv-current-sessions-header .conv-section-collapse-chevron,
  .conv-project-tree-header .conv-section-collapse-chevron,
  .conv-evergreen-agents-header .conv-section-collapse-chevron {
    font-size: 9px;
    line-height: 1;
    opacity: 0.7;
    margin-right: -2px;
  }
  .conv-evergreen-agents-header.is-collapsed {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-radius: 8px;
  }
  .conv-evergreen-agents-scroll.is-collapsed {
    display: none;
  }
  .evergreen-log-btn {
    margin-left: auto; flex-shrink: 0;
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 1px 6px; border-radius: 999px;
    background: rgba(88,166,255,0.12); color: var(--accent, #58a6ff);
    border: 1px solid rgba(88,166,255,0.20);
    cursor: pointer; white-space: nowrap;
  }
  .evergreen-log-btn:hover { background: rgba(88,166,255,0.22); }
  .conv-evergreen-agents-splitter {
    flex: 0 0 10px;
    min-height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    touch-action: none;
    user-select: none;
    color: var(--text-muted);
  }
  .conv-evergreen-agents-splitter::before {
    content: '';
    width: min(72px, 42%);
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 42%, transparent);
  }
  .conv-evergreen-agents-splitter:hover::before,
  .conv-evergreen-agents-splitter.is-dragging::before {
    height: 3px;
    background: var(--accent);
  }
  /* No drag handle when the section above has nothing to give up (CCC-397
     follow-up) — mirrors the objects-splitter rule above. A collapsed
     Evergreen Agents header below does NOT hide it (CCC-438): Project Tree
     still resizes against space further down. */
  .conv-project-tree-scroll.is-collapsed + .conv-evergreen-agents-splitter {
    display: none;
  }
  body.evergreen-splitter-resizing {
    cursor: row-resize;
    user-select: none;
  }
  body.evergreen-splitter-resizing * {
    cursor: row-resize !important;
    user-select: none !important;
  }
  .conv-evergreen-agents-scroll {
    flex: 0 0 auto;
    max-height: var(--evergreen-agents-panel-h, clamp(96px, 18vh, 240px));
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 4px 4px 4px 0;
    border: 1px solid color-mix(in srgb, var(--border) 48%, transparent);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: rgba(139, 148, 158, 0.06);
  }
  /* Evergreen section: per-queue group = a compact health header above that
     queue's worker session rows. Header borrows the queue-health-strip idiom
     (name · depth · workers · drain · state) but sits inline in the sidebar. */
  .conv-evergreen-queue-group { margin: 0 0 2px; }
  .conv-evergreen-queue-header {
    display: flex; align-items: center; gap: 5px;
    padding: 3px 6px 3px 7px; margin-top: 2px;
    font-size: 11px; line-height: 1.3;
    color: var(--text-muted);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
    cursor: pointer; user-select: none;
  }
  .conv-evergreen-queue-header:hover { background: rgba(139,148,158,0.07); }
  .conv-evergreen-queue-header .ceq-name {
    font-weight: 700; color: var(--text);
    text-transform: uppercase; letter-spacing: 0.03em;
    flex-shrink: 0;
  }
  .conv-evergreen-queue-header .ceq-meta {
    display: inline-flex; align-items: center; gap: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
  }
  .conv-evergreen-queue-header .ceq-sep { opacity: 0.45; }
  .conv-evergreen-queue-header .ceq-drain.is-on { color: var(--green, #3fb950); }
  .conv-evergreen-queue-header .ceq-drain.is-off { opacity: 0.7; }
  .conv-evergreen-queue-header .ceq-state {
    margin-left: auto; flex-shrink: 0;
    font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    padding: 1px 6px; border-radius: 999px;
  }
  /* Active work in flight — blue, distinct from the calm green of "Ready". */
  .conv-evergreen-queue-header .ceq-state.is-draining {
    background: rgba(47,129,247,0.16); color: var(--blue, #2f81f7);
  }
  /* Idle / drained — calm positive green, distinct from active "Draining". */
  .conv-evergreen-queue-header .ceq-state.is-ready {
    background: rgba(63,185,80,0.15); color: var(--green, #3fb950);
  }
  .conv-evergreen-queue-header .ceq-state.is-backlog {
    background: rgba(139,148,158,0.16); color: var(--text-muted);
  }
  .conv-evergreen-queue-header .ceq-state.is-waiting {
    background: rgba(210,153,34,0.16); color: var(--yellow, #d29922);
  }
  .conv-evergreen-queue-header .ceq-state.is-stuck {
    background: rgba(248,81,73,0.18); color: var(--red, #f85149);
  }
  .conv-evergreen-queue-header .ceq-add-btn {
    margin-left: auto; flex-shrink: 0;
    padding: 1px 6px; border-radius: 4px;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-muted); font-size: 14px; line-height: 1; cursor: pointer;
    opacity: 0; transition: opacity 0.12s;
  }
  .conv-evergreen-queue-header:hover .ceq-add-btn { opacity: 1; }
  .conv-evergreen-queue-header .ceq-add-btn:hover {
    background: rgba(139,148,158,0.15); color: var(--text);
  }
  /* Fallback worker row — shown when a live worker's cloud session_id isn't in
     the loaded conversation list (ephemeral / cross-project / not yet
     discovered). Minimal: a dot, the worker id, and its queue. */
  .conv-evergreen-worker-fallback {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 6px 3px 9px;
    font-size: 11.5px; line-height: 1.3;
    color: var(--text-muted);
  }
  .conv-evergreen-worker-fallback .cewf-dot {
    color: var(--green, #3fb950); font-size: 8px; flex-shrink: 0;
  }
  .conv-evergreen-worker-fallback .cewf-id {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--mono, ui-monospace, monospace);
  }
  .conv-evergreen-worker-fallback .cewf-queue {
    margin-left: auto; flex-shrink: 0; opacity: 0.7;
    text-transform: uppercase; letter-spacing: 0.03em; font-size: 9.5px;
  }
  .conv-project-tree { padding-left: 7px; }
  .conv-project-tree .conv-folder-group { margin: 0; }
  /* Kill the default group vertical rail — we use a per-row border-left
     instead (Codex draws the rail on each .tree-item). */
  .conv-project-tree .conv-folder-group::before { display: none; }
  .conv-project-tree .conv-folder-group.is-nested {
    border-left: 0;
    margin-left: calc(var(--obj-depth, 1) * 18px);
  }

  /* ----- Object header row (Codex `.tree-item` with <strong>) ----- */
  .conv-project-tree .conv-folder-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 8px;
    margin: 0;
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(154, 173, 194, 0.18);
    border-radius: 0;
  }
  .conv-project-tree .conv-folder-group-arrow {
    order: -1;
    width: 14px; height: 14px;
    font-size: 10px;
    opacity: 0.55;
    flex: 0 0 auto;
  }
  .conv-project-tree .conv-folder-group-chip {
    flex: 1 1 auto;
    min-width: 0;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
  }
  /* Strip the colored hue chip box — Codex labels are bare bold text. */
  .conv-project-tree .conv-folder-group-chip,
  .conv-project-tree .conv-folder-object-title-text {
    background: none;
    border: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }
  /* No "› " rename prefix and no horizontal tree connectors — the per-row
     border-left is the only rail (matches Codex's clean vertical line). */
  .conv-project-tree .conv-title::before { display: none; }
  .conv-project-tree .conv-item::before,
  .conv-project-tree .conv-folder-group .conv-item.is-grouped-row::before { display: none; }
  .conv-project-tree .conv-folder-group-count {
    margin-left: auto;
    order: 90;
    min-width: 24px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(154, 173, 194, 0.14);
    color: var(--text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }
  /* Header chrome (status / objective / action cluster) hidden at rest;
     actions reveal on hover so editing stays reachable. */
  .conv-project-tree .conv-object-meta,
  .conv-project-tree .conv-folder-object-actions { display: none; }
  .conv-project-tree .conv-folder-group-header:hover .conv-folder-object-actions {
    display: inline-flex;
    order: 91;
  }
  /* ----- Child session rows (Codex `.tree-item.indent`) ----- */
  .conv-project-tree .conv-item {
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 0 8px;
    margin: 0 0 0 18px;
    border: 0;
    border-left: 1px solid rgba(154, 173, 194, 0.18);
    border-radius: 0;
  }
  .conv-project-tree .conv-item .conv-title-row,
  .conv-project-tree .conv-item .conv-main-row {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
  }
  .conv-project-tree .conv-item .conv-main-row { padding-left: 0; }
  .conv-project-tree .conv-item .conv-title {
    font-size: 13px;
    font-weight: 400;
    color: #9aa8b7; /* Codex --muted: child names sit quieter than headers */
  }
  /* Names only at rest: hide the drag handle + trailing ask/outcome/summary
     blocks and every inline chip/badge beside the title; right-edge actions
     reveal on hover. */
  .conv-project-tree .conv-item > :not(.conv-title-row) { display: none; }
  .conv-project-tree .conv-item .conv-main-row > :not(.conv-title):not(.conv-title-input) { display: none; }
  .conv-project-tree .conv-item .conv-title-input {
    min-width: 0;
    height: 24px;
    padding: 2px 6px;
    font-size: 13px;
    font-weight: 400;
  }
  .conv-project-tree .conv-item:hover .conv-main-row > .conv-row-end { display: inline-flex; }

  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row {
    align-items: stretch;
    min-height: 44px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-main-row {
    gap: 6px;
    min-height: 18px;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--text);
    letter-spacing: 0;
  }
  :root:not([data-theme="light"]) .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-title {
    color: #f0f4fb;
  }
  .conv-evergreen-meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
  }
  .conv-evergreen-meta-row > .conv-ux-fix-progress,
  .conv-evergreen-meta-row > .conv-goal,
  .conv-evergreen-meta-row > .conv-evergreen-state,
  .conv-evergreen-meta-row > .conv-row-meta,
  .conv-evergreen-meta-row > .conv-qc-badge,
  .conv-evergreen-meta-row > .conv-pct-badge,
  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-main-row > .conv-row-end {
    display: inline-flex;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-row-meta:empty {
    display: none;
  }
  .conv-evergreen-meta-row > .conv-goal {
    max-width: 180px;
    margin-left: 0;
  }
  /* Single-line evergreen variant (TRIGGERED WORKERS worker rows): name + state
     pill + quality score + context % + last-active time all on ONE line. The
     badges (same markup as the default meta row) sit inline just left of the
     time slot; the name ellipsizes to make room. */
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line {
    min-height: 26px;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-main-row {
    gap: 6px;
    min-height: 18px;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-main-row > .conv-evergreen-inline-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 0;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-evergreen-inline-badges > .conv-ux-fix-progress,
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-evergreen-inline-badges > .conv-goal,
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-evergreen-inline-badges > .conv-evergreen-state,
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-evergreen-inline-badges > .conv-row-meta,
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-evergreen-inline-badges > .conv-qc-badge,
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-evergreen-inline-badges > .conv-pct-badge {
    display: inline-flex;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-evergreen-inline-badges > .conv-row-meta:empty {
    display: none;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-single-line .conv-goal {
    max-width: 140px;
  }
  /* De-dup an active evergreen row. The compact main row already shows the goal
     chip (evergreenGoalHtml) and the WIP/idle state pill (.conv-evergreen-state),
     so suppress the copies the shared hover-meta row and the generic activity
     signal add when the row is selected — that double render read as "messy"
     (two FIX… chips, two WIP badges side by side). (CCC-277) */
  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-hover-meta-row .conv-goal {
    display: none;
  }
  .conv-evergreen-agents-tree .conv-item.is-evergreen-agent-row .conv-row-meta .conv-signal.activity-working {
    display: none;
  }
  .conv-evergreen-state {
    flex: 0 0 auto;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
  }
  .conv-evergreen-state.is-wip {
    background: rgba(251,202,4,0.15);
    color: #FBCA04;
  }
  .conv-evergreen-state.is-waiting {
    background: rgba(56,189,248,0.14);
    color: #38bdf8;
  }
  .conv-evergreen-state.is-idle {
    background: rgba(139,148,158,0.12);
    color: var(--text-muted);
  }

  /* Active child — Codex's teal rail + faint teal wash, title brightens. */
  .conv-project-tree .conv-item.active {
    border-left-color: #3de0c6;
    background: rgba(61, 224, 198, 0.08);
  }
  .conv-project-tree .conv-item.active .conv-title { color: var(--text); }

  /* ----- Draft/task rows: plain text at rest, play/delete on hover. ----- */
  .conv-project-tree .conv-draft-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    margin: 0 0 0 18px;
    border-left: 1px solid rgba(154, 173, 194, 0.18);
    padding: 0 8px;
  }
  .conv-project-tree .conv-folder-group[data-object-drop-zone] > .conv-draft-row {
    padding-left: 29px;
  }
  .conv-project-tree .conv-draft-row[data-draft-id] {
    cursor: pointer;
  }
  .conv-project-tree .conv-draft-row[draggable="true"] {
    cursor: grab;
  }
  .conv-project-tree .conv-draft-row.dragging {
    opacity: 0.55;
  }
  .conv-project-tree .conv-draft-row .conv-draft-dot,
  .conv-project-tree .conv-draft-row .conv-draft-delete { display: none; }
  .conv-project-tree .conv-draft-row .conv-draft-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.78;
  }
  .conv-project-tree .conv-draft-row:hover .conv-draft-delete { display: inline-flex; }
  .conv-project-tree .conv-draft-input {
    border: 0; background: transparent; padding: 0;
    flex: 0 1 auto;
    width: min(calc(var(--draft-title-ch, 16) * 1ch + 18px), 100%);
    max-width: calc(100% - 28px);
    font-size: 13px; color: var(--text-muted);
    cursor: text;
  }
  .conv-item .conv-ux-fix-progress {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    border: 1px solid rgba(210, 153, 34, 0.35);
    background: rgba(210, 153, 34, 0.11);
    color: var(--orange);
    font-size: 10.5px;
    line-height: 1;
    font-weight: 650;
    letter-spacing: 0;
    white-space: nowrap;
    gap: 4px;
  }
  .conv-item .conv-ux-fix-ref {
    font-weight: 500; opacity: 0.75; font-size: 10px;
  }
  .conv-item .conv-row-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: end;
    flex: 0 0 auto;
    min-width: 0;
  }
  .conv-item .conv-meta-inline {
    font-size: 10px; color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px;
    flex: 0 0 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-align: right;
  }
  .conv-item .conv-hover-meta-row {
    display: none;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    max-width: calc(100% - var(--conv-content-left) - 70px);
    margin: 4px 48px 0 var(--conv-content-left);
    color: color-mix(in srgb, var(--text) 74%, var(--text-muted));
    font-size: 11px;
    line-height: 1.45;
    overflow: hidden;
    opacity: 1;
  }
  .conv-item .conv-hover-meta-row > * {
    min-width: 0;
    flex: 0 1 auto;
  }
  .conv-item .conv-hover-meta-row .conv-folder-chip {
    width: auto;
    max-width: 126px;
    height: 20px;
    padding: 2px 7px;
    border-radius: 4px;
    background: hsla(var(--chip-hue), 60%, 50%, 0.18);
    border-color: hsla(var(--chip-hue), 55%, 50%, 0.35);
    color: hsl(var(--chip-hue), 55%, 65%);
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-align: left;
  }
  .conv-item .conv-hover-meta-row .conv-object-chip {
    height: 20px;
    max-width: 180px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    border: 1px solid rgba(188,140,255,0.32);
    background: rgba(188,140,255,0.12);
    color: var(--purple, #bc8cff);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  button.conv-object-chip {
    font: inherit;
    cursor: pointer;
  }
  .conv-item .conv-hover-meta-row .conv-session-origin-chip {
    height: 20px;
    max-width: 180px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(139,148,158,0.28);
    border-radius: 4px;
    background: rgba(139,148,158,0.10);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
  }
  .conv-item .conv-hover-meta-row .conv-session-origin-chip.is-parent {
    border-color: rgba(188,140,255,0.30);
    background: rgba(188,140,255,0.10);
    color: var(--purple, #bc8cff);
  }
  /* Clickable only when a resolvable parent id was wired up (data-parent-sid) —
     an origin chip with no known parent (CCC/user/unknown) stays inert. */
  .conv-item .conv-hover-meta-row .conv-session-origin-chip[data-parent-sid] {
    cursor: pointer;
  }
  .conv-item .conv-hover-meta-row .conv-session-origin-chip[data-parent-sid]:hover {
    border-color: var(--accent, #58a6ff);
    background: rgba(88,166,255,0.20);
  }
  .conv-item .conv-hover-meta-row .conv-session-origin-chip.is-ccc {
    border-color: rgba(88,166,255,0.28);
    background: rgba(88,166,255,0.10);
    color: var(--accent, #58a6ff);
  }
  .conv-item .conv-hover-meta-row .conv-session-origin-chip.is-unknown {
    border-color: rgba(210,153,34,0.30);
    background: rgba(210,153,34,0.10);
    color: var(--orange, #d29922);
  }
  /* CCC-467: the per-row empty "+" object chip was removed; assigning an
     object now happens from the RHS rail (#statusRailAddObjectBtn). */
  .conv-item .conv-hover-meta-row .conv-sidebar-session-id-chip,
  .ccc-breadcrumb .conv-sidebar-session-id-chip {
    height: 20px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139,148,158,0.28);
    border-radius: 4px;
    background: rgba(139,148,158,0.12);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .conv-item .conv-hover-meta-row .conv-sidebar-session-id-chip code,
  .ccc-breadcrumb .conv-sidebar-session-id-chip code {
    font: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }
  .conv-item .conv-hover-meta-row .conv-sidebar-session-id-chip:hover,
  .ccc-breadcrumb .conv-sidebar-session-id-chip:hover {
    border-color: rgba(139,148,158,0.42);
    color: var(--text);
    background: rgba(139,148,158,0.18);
  }
  .conv-item .conv-hover-meta-row .conv-sidebar-session-id-chip.copied,
  .ccc-breadcrumb .conv-sidebar-session-id-chip.copied {
    border-color: rgba(63,185,80,0.45);
    color: var(--green);
    background: rgba(63,185,80,0.14);
  }
  .conv-item .conv-hover-meta-row .branch-badge,
  .conv-item .conv-hover-meta-row .conv-wt-badge,
  .conv-item .conv-hover-meta-row .conv-pct-badge,
  .conv-item .conv-hover-meta-row .conv-qc-badge,
  .conv-item .conv-hover-meta-row .conv-repo-pin,
  .conv-item .conv-hover-meta-row .conv-goal {
    font-size: 11px;
    line-height: 1.35;
  }
  .conv-item .conv-hover-meta-row .conv-goal .conv-goal-icon { font-size: 10px; }
  .conv-item .conv-hover-meta-row .conv-meta-inline,
  .conv-item .conv-hover-meta-row .conv-branch-slot {
    justify-content: flex-start;
    text-align: left;
  }
  .conv-item .conv-hover-meta-row .conv-goal {
    margin-left: 0;
    max-width: 180px;
  }
  .conv-item .conv-status-slot,
  .conv-item .conv-branch-slot,
  .conv-item .conv-engine-slot {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
  }
  .conv-item .conv-status-slot {
    min-width: max-content;
    overflow: visible;
  }
  .conv-item .conv-branch-slot,
  .conv-item .conv-engine-slot {
    overflow: hidden;
    gap: 4px;
  }
  .conv-item .conv-status-slot { justify-content: flex-end; }
  .conv-item .conv-branch-slot { justify-content: flex-end; }
  .conv-item .conv-engine-slot { justify-content: flex-end; }
  .conv-item .conv-status-slot:empty,
  .conv-item .conv-branch-slot:empty,
  .conv-item .conv-engine-slot:empty { display: none; }
  .conv-item .conv-status-slot .conv-live-tool { max-width: 160px; }
  .conv-item .conv-meta-inline,
  .conv-item .conv-branch-slot,
  .conv-item .conv-object-chip,
  .conv-item .conv-folder-chip,
  .conv-item .conv-repo-pin { display: none; }
  /* Brief reveals when the row is selected/active — the full metadata line
     wraps under the title and the row grows to two lines. */
  .conv-item.active .conv-hover-meta-row { display: flex; }
  .conv-item.active .conv-hover-meta-row .conv-meta-inline,
  .conv-item.active .conv-hover-meta-row .conv-branch-slot,
  .conv-item.active .conv-hover-meta-row .conv-object-chip,
  .conv-item.active .conv-hover-meta-row .conv-folder-chip,
  .conv-item.active .conv-hover-meta-row .conv-repo-pin { display: inline-flex; }
  .conv-item.active .conv-hover-meta-row .conv-meta-inline .sep { display: inline-flex; }
  /* Current-sessions rows already surface the full meta row by default; the
     generic one-line hover treatment above would shrink them back to a single
     line and cause a visible height flicker. Keep them in normal two-line flow
     while hovered. (CCC-843) */
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item:hover .conv-hover-meta-row {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    margin: 4px 48px 0 var(--conv-content-left);
    max-width: calc(100% - var(--conv-content-left) - 70px);
    justify-content: flex-start;
    background: transparent;
    padding-left: 0;
    z-index: auto;
  }
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item:hover .conv-hover-meta-row .conv-meta-inline,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item:hover .conv-hover-meta-row .conv-branch-slot,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item:hover .conv-hover-meta-row .conv-object-chip,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item:hover .conv-hover-meta-row .conv-folder-chip,
  .conv-current-sessions-scroll:not(.is-search-results) .conv-item:hover .conv-hover-meta-row .conv-repo-pin { display: inline-flex; }
  .conv-item .conv-meta-inline .sep { opacity: 0.4; }
  .conv-item .conv-rel {
    /* Time chip — bumped 10 → 11.5px for legibility (Omnara's looks
       around this size); tabular-nums keeps the column visually aligned
       across "9m" / "13h" / "2d" / "1w" without monospace font. */
    font-size: 11.5px; color: var(--text-muted);
    flex: 0 0 var(--conv-time-col);
    min-width: 0;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.75;
  }
  /* Date-gap separator — slim labelled rule between cards whose
     modified-times are far apart. Visual cue that you're crossing a
     work session boundary in the list. */
  .conv-gap-separator {
    display: flex; align-items: center; gap: 8px;
    margin: 14px 6px 8px;
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    opacity: 0.55;
  }
  .conv-gap-line {
    flex: 1 1 auto; height: 1px; background: var(--border);
  }
  .compact-rows .conv-gap-separator { margin: 8px 6px 4px; }
  /* Inline twin of .kanban-live-tool — fits in the row's title line so
     "what is the agent doing right now" is visible at a glance even in
     compact-rows mode. Same yellow→blue tint pattern as kanban: yellow
     for "last completed", blue for "currently in flight". */
  .conv-item .conv-live-tool {
    display: inline-flex; align-items: center; gap: 4px;
    flex: 0 1 auto; min-width: 0;
    max-width: 160px;
    font-size: 10px;
    color: #FBCA04;
    background: rgba(251,202,4,0.10);
    border-left: 2px solid rgba(251,202,4,0.6);
    padding: 1px 4px; border-radius: 3px;
    white-space: nowrap;
    animation: none;
  }
  .conv-item .conv-live-tool .conv-live-name {
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }
  .conv-item .conv-live-tool .conv-live-file { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
  .conv-item .conv-live-tool .conv-live-file.is-command {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  }
  .conv-item .conv-live-tool.in-flight {
    color: #58a6ff;
    background: rgba(88,166,255,0.10);
    border-left-color: rgba(88,166,255,0.6);
    animation: none;
  }
  .conv-item .conv-live-tool.is-question {
    color: #58a6ff;
    background: rgba(88,166,255,0.12);
    border-left-color: rgba(88,166,255,0.7);
  }
  .conv-item .conv-live-tool.stale {
    color: var(--red);
    background: rgba(248,81,73,0.12);
    border-left-color: rgba(248,81,73,0.65);
    animation: none;
  }
  /* Compact rows — toggle on the conv list. Forces every card to a
     single line: truncate the title with ellipsis and hide the ask
     preview. Meta + signals stay so you can still scan state. The
     selector targets `.compact-rows` directly so the rule fires whether
     the parent is `.log-list`, `.conv-list`, or any other wrapper. */
  .compact-rows .conv-item {
    padding: 4px 10px 4px var(--conv-content-left);
    margin-bottom: 0;
  }
  .compact-rows .conv-item .conv-title {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    word-break: keep-all;
    line-height: 1.2;
  }
  .compact-rows .conv-item .conv-last { display: none; }
  .compact-rows .conv-item .conv-title-row {
    gap: 0;
  }
  /* Row diet (de-crowding). Compact = title + time + status only. The two
     biggest crowders — the session-outcome line (DID / next step) and the
     meta chip cluster (size / branch / tokens) — are hidden at rest; the
     full row is one hover/expand away in Comfortable. Reversible: it's a
     pure display toggle on #convList, no render change. */
  .compact-rows .conv-item .conv-outcome { display: none; }
  /* Compact hides the secondary chips (size, branch, tokens) but KEEPS the
     live status slot — the blinking bash/WIP/edit indicator stays visible so
     you can still see what a session is doing at a glance. */
  .compact-rows .conv-item .conv-row-meta .conv-meta-inline,
  .compact-rows .conv-item .conv-row-meta .conv-branch-slot { display: none; }
  .compact-rows .conv-item.active .conv-hover-meta-row { display: flex; }
  /* Compact also drops the terminal git-state badges (pushed / committed /
     read-only) — they're status-at-rest, not live activity. The
     blinking WIP / waiting / live-tool signals stay. */
  .compact-rows .conv-item .conv-signal.pushed,
  .compact-rows .conv-item .conv-signal.uncommitted,
  .compact-rows .conv-item .conv-signal.pr-open,
  .compact-rows .conv-item .conv-signal.pr-merged,
  .compact-rows .conv-item .conv-signal.pr-closed,
  .compact-rows .conv-item .conv-signal.committed,
  .compact-rows .conv-item .conv-signal.read-only { display: none; }
  .conv-folder-group .conv-item.is-grouped-row {
    /* Parity with "by time" rows — same vertical padding (6px) and same
       border-radius (6px). The original tightening (4px / 4px) made the
       by-project view feel cramped vs. by-time. The folder header still
       provides visual grouping; the rows themselves should feel identical
       between modes. Keep the tree-line indicator below so the project
       hierarchy is still legible. */
    border-radius: 6px;
  }
  .conv-folder-group[data-object-drop-zone] > .conv-item.is-grouped-row {
    padding-left: var(--conv-content-left);
  }
  /* Tree tick stubs removed with the vertical spine — see
     .conv-folder-group:not(.collapsed) note in the sidebar section. */
  /* Keep min-width: 0 on the inline meta so the right-side chip cluster
     can shrink/wrap inside the narrower grouped-row width without forcing
     horizontal overflow. Everything else inherits the same .conv-main-row /
     .conv-title styling as the by-time view. */
  .conv-folder-group .conv-item.is-grouped-row .conv-meta-inline {
    min-width: 0;
  }
  .conv-folder-group .conv-item.is-grouped-row .conv-status-slot,
  .conv-folder-group .conv-item.is-grouped-row .conv-branch-slot,
  .conv-folder-group .conv-item.is-grouped-row .conv-engine-slot {
    flex: 0 0 auto;
  }
  /* CCC-775: the leading engine+cost icon (.conv-session-icon) is fixed-width
     chrome reserved via --conv-content-left, not information the title's own
     truncation can reclaim — yield it so a narrow row spends its width on the
     session name. 780px was too generous: that's wider than most users' daily
     sidebar width, so the icon was disappearing at normal, comfortable sizes
     instead of only in genuinely tight rows (user report, CCC-775 follow-up).
     460px sits below every other tier in this cascade — the icon now only
     goes at widths already too narrow for the OTHER meta chips too. */
  @container sidebar (max-width: 460px) {
    .conv-item .conv-session-icon {
      display: none;
    }
    .conv-item {
      --conv-content-left: var(--conv-icon-left);
    }
  }
  @container sidebar (max-width: 760px) {
    .conv-item .conv-meta-inline {
      display: none;
    }
    .conv-item .conv-row-meta {
      grid-template-columns: max-content max-content 12px;
    }
  }
  /* Secondary counts yield to the title in narrow rows. Keep the parent
     session's lanes disclosure visible: it controls child-row visibility. */
  @container sidebar (max-width: 740px) {
    .conv-item .conv-signal.subagents,
    .conv-item .conv-signal.workflows { display: none; } /* ccc-724: agent counts yield before the conversation title */
  }
  @container sidebar (max-width: 700px) {
    .conv-item .conv-signal-sub-flight { display: none; } /* ccc-724: running indicators yield after agent counts */
  }
  @container sidebar (max-width: 660px) {
    .conv-item .conv-live-tool,
    .conv-item .conv-signal.codex-stuck,
    .conv-item .conv-signal.pkood-stuck,
    .conv-item .conv-signal.activity-working { display: none; } /* ccc-724: stale and working state yield after running indicators */
  }
  @container sidebar (max-width: 620px) {
    .conv-item .conv-lifetime-tokens,
    .conv-item .conv-row-size { display: none; } /* ccc-724: token and size-like metrics yield last */
  }
  @container sidebar (max-width: 640px) {
    .conv-item .conv-engine-slot {
      display: none !important;
    }
    .conv-item .conv-row-meta {
      grid-template-columns: max-content max-content;
    }
  }
  @container sidebar (max-width: 560px) {
    .conv-item .conv-branch-slot {
      display: none !important;
    }
    .conv-item .conv-row-meta {
      grid-template-columns: max-content;
    }
  }
  @container sidebar (max-width: 500px) {
    .conv-folder-chip {
      max-width: 73px;
    }
  }
  /* CCC-1193: in a really narrow list the context-% badge and the time chip
     eat ~80px of a ~250px row, wrapping titles to two clipped lines. Both
     yield to the title here. Context fill still shows through the row's
     ctx-* tint and the action-bar copy of the % badge keeps /compact
     reachable. The hover kebab/trash overlay now sits over the title, so it
     gets a solid backing. */
  @container sidebar (max-width: 400px) {
    /* Inline next-step rows put these on their own second line, so they fit. */
    .conv-item .conv-main-row:not(.has-inline-step) > .conv-pct-badge,
    .conv-item .conv-main-row:not(.has-inline-step) > .conv-row-end > .conv-rel {
      display: none;
    }
    .conv-item .conv-main-row:not(.has-inline-step) > .conv-row-end,
    .conv-item.is-archived-row .conv-main-row:not(.has-inline-step) > .conv-row-end {
      min-width: 0;
    }
    .conv-item .conv-row-hover-slot {
      background: var(--surface-2);
      border-radius: 4px;
      box-shadow: -8px 0 10px -2px var(--surface-2);
    }
  }
  /* CCC-1229: on touch the selected row's sticky :hover keeps the trash +
     kebab overlay up, and absolutely positioned it covered the lanes chip,
     so a parent's lanes couldn't be collapsed. Put the slot in flow there so
     the row end grows and pushes the chip left instead of sitting on it. */
  @media (hover: none) {
    .conv-item.active .conv-row-hover-slot,
    .conv-item:focus-within .conv-row-hover-slot {
      position: static;
      transform: none;
    }
    .conv-item.is-actions-open .conv-row-hover-slot {
      display: none;
    }
  }
  .conv-item .conv-title.untitled {
    font-weight: 500; color: var(--text-muted); font-style: italic;
  }
  .conv-item .conv-title.user-renamed { color: inherit; }
  .conv-item .conv-title.user-renamed::before { content: none; }
  /* CCC-842: auto-titling only fires from the session's Stop hook (after its
     first turn ends), so a still-live session showing its raw first message
     hasn't reached that point yet — this pulses an hourglass instead of
     leaving the raw text looking permanently stuck. Cleared the moment a
     real title lands (see the titlePending computation in app.js). */
  .conv-item .conv-title.title-pending::before {
    content: "⏳ ";
    display: inline-block;
    animation: conv-title-pending-pulse 1.4s ease-in-out infinite;
  }
  @keyframes conv-title-pending-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
  }
  .conv-item .conv-edit-btn {
    opacity: 0; font-size: 13px; cursor: pointer;
    background: none; border: none; color: var(--text-muted);
    padding: 2px 2px; border-radius: 3px; flex-shrink: 0;
    margin-right: -2px;  /* pull title closer than the row's gap */
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    transform: scaleX(-1);  /* mirror so the pencil tip points back at the title */
  }
  .conv-item.active:hover .conv-edit-btn { opacity: 0.7; }
  .conv-item .conv-edit-btn:hover { opacity: 1; color: var(--accent); background: rgba(88,166,255,0.12); }
  .conv-item .conv-pin-btn,
  .conv-item .conv-wake-btn,
  .conv-item .conv-elevate-object-btn,
  .conv-item .conv-attach-subsession-btn,
  .conv-item .conv-archive-btn,
  .conv-item .conv-trash-btn,
  .conv-item .conv-lane-btn {
    opacity: 0; font-size: 13px; cursor: pointer;
    background: none; border: none; color: var(--text-muted);
    padding: 2px 4px; border-radius: 3px; flex-shrink: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
  }
  .conv-item:hover .conv-pin-btn,
  .conv-item.active .conv-pin-btn,
  .conv-item .conv-pin-btn:focus-visible,
  .conv-item:hover .conv-wake-btn,
  .conv-item.active .conv-wake-btn,
  .conv-item .conv-wake-btn:focus-visible,
  .conv-item:hover .conv-elevate-object-btn,
  .conv-item.active .conv-elevate-object-btn,
  .conv-item .conv-elevate-object-btn:focus-visible,
  .conv-item:hover .conv-attach-subsession-btn,
  .conv-item.active .conv-attach-subsession-btn,
  .conv-item .conv-attach-subsession-btn:focus-visible,
  .conv-item:hover .conv-archive-btn,
  .conv-item.active .conv-archive-btn,
  .conv-item .conv-archive-btn:focus-visible,
  .conv-item:hover .conv-trash-btn,
  .conv-item.active .conv-trash-btn,
  .conv-item .conv-trash-btn:focus-visible,
  .conv-item:hover .conv-lane-btn,
  .conv-item.active .conv-lane-btn,
  .conv-item .conv-lane-btn:focus-visible { opacity: 0.7; }
  .conv-item .conv-pin-btn:hover { opacity: 1; color: var(--accent); background: rgba(88,166,255,0.12); }
  .conv-item .conv-lane-btn:hover { opacity: 1; color: var(--purple, #bc8cff); background: rgba(188,140,255,0.12); }
  .conv-item .conv-lane-btn.is-workers { color: var(--purple, #bc8cff); }
  .conv-item .conv-wake-btn:hover { opacity: 1; color: var(--red); background: rgba(248,81,73,0.12); }
  .conv-item .conv-elevate-object-btn:hover { opacity: 1; color: var(--green); background: rgba(63,185,80,0.12); }
  .conv-item .conv-attach-subsession-btn:hover { opacity: 1; color: var(--purple, #bc8cff); background: rgba(188,140,255,0.12); }
  .conv-item .conv-attach-subsession-btn.is-detach { color: var(--purple, #bc8cff); }
  .conv-item .conv-attach-subsession-btn.is-detach:hover { color: var(--red); background: rgba(248,81,73,0.12); }
  .conv-item .conv-wake-btn:disabled { cursor: progress; opacity: 0.55; }
  .conv-item .conv-pin-btn.is-unpin { color: var(--accent); }
  .conv-item.is-pinned:not(:hover):not(:focus-within) .conv-pin-btn.is-unpin { opacity: 0.9; }
  .conv-item .conv-pin-btn .conv-pin-glyph { position: relative; display: inline-block; line-height: 1; }
  .conv-item .conv-pin-btn.is-unpin:hover { background: rgba(248,81,73,0.12); }
  .conv-item .conv-pin-btn.is-unpin .conv-pin-glyph::before,
  .conv-item .conv-pin-btn.is-unpin .conv-pin-glyph::after {
    content: '';
    position: absolute;
    left: -3px; right: -3px; top: 50%;
    border-top: 1.5px solid var(--red);
    opacity: 0;
    transition: opacity 0.12s ease;
  }
  .conv-item .conv-pin-btn.is-unpin .conv-pin-glyph::before { transform: translateY(-50%) rotate(45deg); }
  .conv-item .conv-pin-btn.is-unpin .conv-pin-glyph::after { transform: translateY(-50%) rotate(-45deg); }
  .conv-item .conv-pin-btn.is-unpin:hover .conv-pin-glyph::before,
  .conv-item .conv-pin-btn.is-unpin:hover .conv-pin-glyph::after,
  .conv-item .conv-pin-btn.is-unpin:focus-visible .conv-pin-glyph::before,
  .conv-item .conv-pin-btn.is-unpin:focus-visible .conv-pin-glyph::after {
    opacity: 1;
  }
  .conv-item .conv-archive-btn:hover { opacity: 1; color: var(--orange); background: rgba(255,166,87,0.12); }
  .conv-item .conv-archive-btn.is-pending {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    color: var(--orange);
    cursor: progress;
    font-size: 0;
  }
  .conv-item .conv-archive-btn.is-pending::after {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ccc-spin 0.7s linear infinite;
  }
  .conv-item .conv-trash-btn:hover { opacity: 1; color: var(--red); background: rgba(248,81,73,0.12); }
  .conv-item .conv-trash-btn.is-pending {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    color: var(--red);
    cursor: progress;
    font-size: 0;
  }
  .conv-item .conv-trash-btn.is-pending::after {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ccc-spin 0.7s linear infinite;
  }
  .conv-item .conv-trash-btn.is-restore:hover { color: var(--accent); background: rgba(88,166,255,0.12); }
  .conv-item .conv-archive-btn.is-restore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 1;
    color: var(--accent);
    background: rgba(88,166,255,0.10);
    border: 1px solid rgba(88,166,255,0.38);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
  }
  .conv-item .conv-archive-btn.is-restore:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
  }
  .conv-item.is-archived-row .conv-row-end { min-width: 76px; }
  .conv-item .conv-merge-btn {
    opacity: 0; font-size: 13px; cursor: pointer;
    background: none; border: none; color: var(--text-muted);
    padding: 2px 4px; border-radius: 3px; flex-shrink: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
  }
  .conv-item:hover .conv-merge-btn,
  .conv-item.active .conv-merge-btn,
  .conv-item .conv-merge-btn:focus-visible { opacity: 0.7; }
  .conv-item .conv-merge-btn:hover { opacity: 1; color: var(--green); background: rgba(63,185,80,0.12); }
  .conv-item .conv-merge-btn:disabled { cursor: progress; opacity: 0.5; }
  /* Backlog row action buttons stay icon-sized: this column is cramped, and
     the titles need every character they can get. */
  .conv-item .conv-start-btn {
    opacity: 0;
    width: 22px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; cursor: pointer;
    padding: 0; border-radius: 3px; flex-shrink: 0;
    border: 1px solid rgba(63,185,80,0.3);
    background: rgba(63,185,80,0.1); color: var(--green);
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
  }
  .conv-item:hover .conv-start-btn,
  .conv-item.active .conv-start-btn,
  .conv-item .conv-start-btn:focus-visible { opacity: 0.9; }
  .conv-item .conv-start-btn:hover { background: rgba(63,185,80,0.2); border-color: rgba(63,185,80,0.55); }
  .conv-item .conv-start-btn:disabled { cursor: progress; opacity: 0.6; }
  .conv-item .conv-archive-btn.is-close {
    opacity: 0; font-size: 12px; font-weight: 600;
    width: 22px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border-radius: 3px;
    border: 1px solid var(--border); background: transparent;
  }
  .conv-item:hover .conv-archive-btn.is-close,
  .conv-item.active .conv-archive-btn.is-close,
  .conv-item .conv-archive-btn.is-close:focus-visible { opacity: 0.7; }
  .conv-item .conv-archive-btn.is-close:hover { opacity: 1; color: var(--orange); background: rgba(255,166,87,0.12); border-color: rgba(255,166,87,0.4); }
  .conv-item .conv-title-input {
    flex: 1; font-size: 15px; font-weight: 600; color: var(--text);
    background: var(--bg); border: 1px solid var(--accent);
    border-radius: 4px; padding: 4px 6px; outline: none;
    font-family: inherit;
  }
  /* Shown while a rename is being saved (write-through to the .jsonl can take
     a beat over the network). The input dims and a spinner sits beside it. */
  .conv-item .conv-title-input.is-saving { opacity: 0.55; }
  .conv-item .conv-rename-spinner {
    flex: 0 0 auto; width: 14px; height: 14px; margin-left: 6px;
    border: 2px solid rgba(88,166,255,0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ccc-spin 0.7s linear infinite;
  }
  .conv-item .conv-last {
    font-size: 14px; color: var(--text-muted); margin: 4px 0 0 0;
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .conv-item .conv-last .label { color: var(--text-muted); opacity: 0.7; margin-right: 4px; }
  /* GOAL-1 outcome line — the session's own DID self-report. */
  .conv-item .conv-outcome {
    font-size: 14px; margin: 6px 0 0 0; line-height: 1.42;
    display: block;
    padding: 8px 10px;
    border-left: 2px solid rgba(63,185,80,0.42);
    border-radius: 4px;
    background: rgba(63,185,80,0.085);
    overflow: visible;
    white-space: normal;
  }
  .conv-item .conv-outcome-did {
    color: var(--text); opacity: 0.96;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  /* Next-step variant: one label carries the row's state (WORKING /
     NEXT / NEEDS YOU / LATEST) in front of the text; the box tint
     follows it. */
  .conv-item .conv-outcome.is-next-step { padding: 7px 9px; }
  .conv-item .conv-outcome.is-next { border-left-color: rgba(63,185,80,0.5); background: rgba(63,185,80,0.07); }
  .conv-item .conv-outcome.is-ready { display: flex; align-items: center; border-left-color: var(--text-muted); background: rgba(139,148,158,0.05); }
  .conv-item .conv-outcome.is-ready .conv-outcome-step { flex: 1; }
  .conv-item .conv-outcome.is-ready .conv-outcome-step,
  .conv-item .conv-outcome.is-ready .conv-outcome-step::before { color: var(--text-muted); font-weight: 400; }
  .conv-item .conv-ready-archive {
    opacity: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--text-muted);
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    font: 400 12px/1.2 system-ui, sans-serif;
    cursor: pointer;
    flex-shrink: 0;
  }
  .conv-item .conv-ready-archive:hover { opacity: 1; }
  .conv-item .conv-outcome.is-needs-you { border-left-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.08); }
  .conv-item .conv-outcome.is-working { border-left-color: rgba(88,166,255,0.5); background: rgba(88,166,255,0.06); }
  .conv-item .conv-outcome.is-latest { border-left-color: rgba(139,148,158,0.4); background: rgba(139,148,158,0.06); }
  .conv-item .conv-outcome-step {
    color: var(--text); opacity: 0.96;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .conv-item .conv-outcome-step::before {
    content: attr(data-label);
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    padding: 0 4px;
    border-radius: 3px;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: 1px;
  }
  .conv-item .conv-outcome.is-next .conv-outcome-step::before { color: var(--green, #3fb950); }
  .conv-item .conv-outcome.is-needs-you .conv-outcome-step::before { color: #f59e0b; }
  .conv-item .conv-outcome.is-working .conv-outcome-step::before { color: var(--accent, #58a6ff); }
  .conv-item .conv-outcome.is-latest .conv-outcome-step::before { color: var(--text-muted); }
  .conv-item .conv-outcome.is-working .conv-outcome-step,
  .conv-item .conv-outcome.is-latest .conv-outcome-step { color: var(--text-muted); }
  /* Inline next step: sits right of the title; the badges and time after
     .conv-row-break drop to a second line. Only where the brief is visible
     (the existing .conv-outcome rules hide it everywhere else). */
  .conv-item .conv-row-break { display: none; }
  .conv-item .conv-outcome.is-inline { flex: 1 1 0; min-width: 0; margin: 0; }
  :is(.conv-item:not(.compact-rows *, #convList.workers-dense *, .conv-current-sessions-scroll:not(.is-search-results) *),
      .conv-current-sessions-scroll:not(.is-search-results) .conv-item.is-brief-open) .conv-main-row.has-inline-step {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 6px;
  }
  :is(.conv-item:not(.compact-rows *, #convList.workers-dense *, .conv-current-sessions-scroll:not(.is-search-results) *),
      .conv-current-sessions-scroll:not(.is-search-results) .conv-item.is-brief-open) .conv-main-row.has-inline-step > :is(.conv-title, .conv-title-stack) {
    flex: 0 1 38%;
  }
  .conv-item .conv-title-stack { flex: 1 1 auto; min-width: 0; }
  .conv-item .conv-title-stack > .conv-idea-line { margin: 4px 0 0; }
  :is(.conv-item:not(.compact-rows *, #convList.workers-dense *, .conv-current-sessions-scroll:not(.is-search-results) *),
      .conv-current-sessions-scroll:not(.is-search-results) .conv-item.is-brief-open) .conv-main-row.has-inline-step > .conv-row-break {
    display: block; flex-basis: 100%; height: 0;
  }
  /* Context % reads with the time, at the right end of the badge line. */
  :is(.conv-item:not(.compact-rows *, #convList.workers-dense *, .conv-current-sessions-scroll:not(.is-search-results) *),
      .conv-current-sessions-scroll:not(.is-search-results) .conv-item.is-brief-open) .conv-main-row.has-inline-step > .conv-pct-badge {
    margin-left: auto;
  }
  :is(.conv-item:not(.compact-rows *, #convList.workers-dense *, .conv-current-sessions-scroll:not(.is-search-results) *),
      .conv-current-sessions-scroll:not(.is-search-results) .conv-item.is-brief-open) .conv-main-row.has-inline-step > .conv-pct-badge + .conv-row-end {
    margin-left: 6px;
  }
  .conv-item .conv-outcome-next {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 4px;
    color: var(--text-muted); opacity: 0.75;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .conv-session-summary-detail {
    margin: 4px 0 0 29px;
    padding: 7px 9px;
    border-left: 2px solid rgba(88,166,255,0.28);
    border-radius: 4px;
    background: rgba(88,166,255,0.055);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .conv-session-summary-detail strong {
    color: var(--text);
    font-weight: 650;
  }
  .compact-rows .conv-item .conv-outcome { display: none; }
  .conv-item .meta {
    font-size: 13px; color: var(--text-muted); margin-top: 4px;
    display: flex; align-items: center; gap: 6px;
  }
  .conv-item .meta .sep { opacity: 0.4; }
  .conv-item .branch-badge {
    display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px;
    background: rgba(188, 140, 255, 0.15); color: var(--purple);
    flex-shrink: 0;
    line-height: 1.1;
    max-width: 82px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Worktree-flavoured branch pill — orange palette + 🌿 leaf so
     the row can be scanned at a glance for "is this session editing in
     a worktree?". Same shape as the default badge. */
  .conv-item .branch-badge.is-worktree {
    background: rgba(210, 153, 34, 0.15);
    color: var(--orange, #d29922);
  }
  /* Archived section header at the bottom of the sidebar list. The
     button is the entire row; click toggles the .collapsed class on
     the parent .conv-archived-section, which hides .conv-archived-list
     via the rule below. Caret rotates without an animation — keep it
     boring, the section is supposed to be quiet. */
  #convList .conv-archived-section,
  #convList .conv-ghissues-section,
  #convList .conv-repo-search-section,
  #convList .conv-readytomerge-section,
  #convList .conv-needsyou-section,
  #convList .conv-openask-section,
  #convList .conv-inprogress-section { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 6px; }
  /* The first section in the list (whichever it is — typically GH Issues,
   * but the next section takes the spot if earlier ones are empty) loses
   * its divider so the list doesn't start with an empty stripe. */
  #convList > .conv-ghissues-section:first-child,
  #convList > .conv-repo-search-section:first-child,
  #convList > .conv-readytomerge-section:first-child,
  #convList > .conv-needsyou-section:first-child,
  #convList > .conv-openask-section:first-child,
  #convList > .conv-inprogress-section:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
  #convList .conv-inprogress-section { margin-top: 0; border-top: 0; padding-top: 0; }
  #convList .conv-inprogress-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 8px;
    /* Keep the controls (expand/collapse all, by project/time, Details,
       window) reachable while scrolling a long list — pin just below the
       also-sticky .conv-tab-bar (--conv-tab-bar-h, measured in JS by
       _updateConvTabBarHeightVar) so the two don't stack at the same top:0
       and have the tab bar's higher z-index hide the toolbar (CCC-994). */
    position: sticky;
    top: var(--conv-tab-bar-h, 0px);
    z-index: 6;
    background: var(--surface);
  }
  #convList .conv-inprogress-toolbar .conv-inprogress-tools {
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  #convList .conv-archived-section > .conv-archived-tools {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin-left: 0;
    padding: 6px 8px;
    min-height: 36px;
    box-sizing: border-box;
    position: sticky;
    top: var(--conv-tab-bar-h, 0px);
    z-index: 6;
    background: var(--surface);
  }
  /* Reserve the longer Collapse all label, including when this slot is
     empty, so grouping/label changes never move the filter controls. */
  #convList .conv-archived-tools-left {
    display: flex;
    align-items: center;
    flex: 0 0 82px;
    min-width: 82px;
    white-space: nowrap;
  }
  #convList .conv-archived-tools-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 0;
    min-width: 0;
    gap: 6px;
    /* Use the toolbar width before adding a line, so every filter remains
       reachable without a hidden horizontal scroll area. */
    flex-wrap: wrap;
    overflow: visible;
  }
  /* Keep the engine popup outside the toolbar while it is open. */
  #convList .conv-archived-tools-right.has-engine-filter-open { overflow: visible; }
  #convList .conv-archived-tools-right > * {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  /* CCC-1158: on narrow sidebars the right-hand pill stack wrapped into ~4
     rows. Grouping/density are view settings — below the breakpoint they fold
     into a ⋮ overflow menu so the toolbar stays one row. */
  /* CCC-283: the ⋮ is always shown -- it also holds the engine filter and the
     Table view toggle at every width. The grouping/density copies inside it
     only show once their inline originals fold away (container query below). */
  #convList .conv-archived-overflow { display: inline-flex; align-items: center; position: relative; }
  #convList .conv-archived-overflow-menu > [data-role="archived-grouping-toggle"],
  #convList .conv-archived-overflow-menu > [data-role="wrap-toggle"],
  #convList .conv-archived-overflow-menu > [data-role="details-toggle"],
  #convList .conv-archived-overflow-menu > [data-role="session-density-toggle"] { display: none; }
  /* Engine filter as an always-open row of buttons inside the menu. */
  #convList .conv-archived-engine-filter.is-menu-row { position: static; }
  #convList .conv-archived-engine-filter.is-menu-row .conv-archived-engine-options {
    position: static;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
  }
  #convList .conv-menu-check-opt {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 3px 8px;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 4px;
    background: transparent;
    color: var(--text, #eee);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
  }
  #convList .conv-menu-check-opt:hover { background: var(--bg-hover, rgba(255,255,255,0.06)); }
  #convList .conv-menu-check-opt .conv-check {
    display: inline-flex;
    width: 14px;
    justify-content: center;
    color: var(--green, #3fb950);
    font-weight: 700;
  }
  #convList .conv-archived-overflow-trigger {
    list-style: none;
    cursor: pointer;
    user-select: none;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 4px;
    color: var(--text-muted, #999);
    padding: 1px 8px;
    font-size: 12px;
    line-height: 1.4;
  }
  #convList .conv-archived-overflow-trigger::-webkit-details-marker { display: none; }
  #convList .conv-archived-overflow-trigger:hover {
    color: var(--text, #eee);
    background: var(--bg-hover, rgba(255,255,255,0.06));
  }
  #convList .conv-archived-overflow-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    /* CCC-1207: size to the widest pill row (by project/time/cost is wider
       than 150px) instead of letting it spill past the box, where #convList's
       overflow clipped the last options. Cap at the sidebar width so it
       grows leftward from the ⋮ and never crosses the sidebar edge. */
    width: max-content;
    min-width: 150px;
    max-width: calc(100cqi - 16px);
    box-sizing: border-box;
    padding: 6px;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 6px;
    background: var(--surface, #161b22);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  }
  #convList .conv-archived-overflow[open] .conv-archived-overflow-menu { display: grid; gap: 6px; }
  #convList .conv-archived-overflow-menu > * { max-width: 100%; flex-wrap: wrap; }
  /* Flipped by JS when the list has no room below the ⋮ (CCC-1207). */
  #convList .conv-archived-overflow.opens-up .conv-archived-overflow-menu { top: auto; bottom: calc(100% + 4px); }
  @container sidebar (max-width: 600px) {
    #convList .conv-archived-tools-right > [data-role="archived-grouping-toggle"],
    #convList .conv-archived-tools-right > [data-role="wrap-toggle"],
    #convList .conv-archived-tools-right > [data-role="details-toggle"],
    #convList .conv-archived-tools-right > [data-role="session-density-toggle"] {
      display: none;
    }
    #convList .conv-archived-overflow-menu > [data-role="archived-grouping-toggle"],
    #convList .conv-archived-overflow-menu > [data-role="wrap-toggle"],
    #convList .conv-archived-overflow-menu > [data-role="details-toggle"],
    #convList .conv-archived-overflow-menu > [data-role="session-density-toggle"] { display: inline-flex; }
  }
  #convList .conv-inprogress-list > .conv-item {
    padding-left: 8px;
  }
  #convList .conv-repo-search-header {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px 14px; color: var(--text-muted);
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  }
  #convList .conv-repo-search-label { color: var(--cyan); }
  /* CCC-61: ID-match box — distinct accent so a UUID search result reads as a
     dedicated, one-click box rather than a repo-match. */
  #convList .conv-id-search-section {
    border-left: 2px solid var(--accent, #58a6ff);
    border-radius: 4px;
    background: color-mix(in srgb, var(--accent, #58a6ff) 7%, transparent);
  }
  #convList > .conv-id-search-section:first-child { margin-top: 0; border-top: 0; padding-top: 4px; }
  #convList .conv-id-search-section .conv-repo-search-label { color: var(--accent, #58a6ff); }
  #convList .conv-repo-search-name {
    color: var(--text); text-transform: none; letter-spacing: 0;
    font-weight: 600; font-size: 13px;
  }
  #convList .conv-repo-search-hint {
    margin-left: auto; font-size: 11px; color: var(--text-muted);
    text-transform: none; letter-spacing: 0; font-weight: 500;
  }
  #convList .conv-repo-search-list .conv-item.is-history-match { border-left: 2px solid var(--cyan); }
  /* Ready-to-merge label gets a subtle green tint so the bucket reads as
   * "action required" at a glance, separate from the muted neutrality of
   * the other section labels. */
  #convList .conv-readytomerge-label { color: var(--green); }
  #convList .conv-readytomerge-count {
    background: rgba(63,185,80,0.12); border-color: rgba(63,185,80,0.35);
    color: var(--green);
  }
  #convList .conv-archived-header,
  #convList .conv-ghissues-header,
  #convList .conv-readytomerge-header,
  #convList .conv-needsyou-header,
  #convList .conv-openask-header,
  #convList .conv-inprogress-header {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; background: transparent; border: 0; cursor: pointer;
    color: var(--text-muted); font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.5px; font-weight: 600;
  }
  #convList .conv-archived-header:hover,
  #convList .conv-ghissues-header:hover,
  #convList .conv-readytomerge-header:hover,
  #convList .conv-needsyou-header:hover,
  #convList .conv-openask-header:hover,
  #convList .conv-inprogress-header:hover { color: var(--text); }
  #convList .conv-archived-arrow,
  #convList .conv-ghissues-arrow,
  #convList .conv-readytomerge-arrow,
  #convList .conv-needsyou-arrow,
  #convList .conv-openask-arrow,
  #convList .conv-inprogress-arrow { font-size: 11px; opacity: 0.7; }
  #convList .conv-archived-count,
  #convList .conv-ghissues-count,
  #convList .conv-readytomerge-count,
  #convList .conv-needsyou-count,
  #convList .conv-openask-count,
  #convList .conv-inprogress-count {
    margin-left: auto;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; padding: 1px 8px; font-size: 11px;
    color: var(--text-muted); font-weight: 600;
  }
  /* CCC-178: "why is this here?" info glyph on the action-section headers. */
  #convList .conv-needsyou-info,
  #convList .conv-openask-info {
    margin-left: 6px; font-size: 12px; line-height: 1;
    color: var(--text-muted); opacity: 0.7; cursor: help; flex: 0 0 auto;
  }
  #convList .conv-needsyou-info:hover,
  #convList .conv-openask-info:hover { opacity: 1; color: var(--text); }
  #convList .conv-archived-section.collapsed .conv-archived-list,
  #convList .conv-ghissues-section.collapsed .conv-ghissues-list,
  #convList .conv-readytomerge-section.collapsed .conv-readytomerge-list,
  #convList .conv-needsyou-section.collapsed .conv-needsyou-list,
  #convList .conv-openask-section.collapsed .conv-openask-list,
  #convList .conv-inprogress-section.collapsed .conv-inprogress-list { display: none; }
  /* "Needs you" = Claude is blocked on the human right now (question /
   * permission). Orange/amber accent — the strongest "act now" signal in the
   * list. "Open ask" = a session that ENDED still waiting on the human; purple
   * accent so it reads as a question left unanswered, distinct from the live
   * urgency of Needs-you. Both mirror the Ready-to-merge tint treatment. */
  #convList .conv-needsyou-label { color: var(--orange); }
  #convList .conv-needsyou-count {
    background: color-mix(in srgb, var(--orange) 12%, transparent);
    border-color: color-mix(in srgb, var(--orange) 35%, transparent);
    color: var(--orange);
  }
  /* CCC-468: Trash — archived rows demoted out of the All tab's main flow
   * into a collapsed section at the very bottom. Mirrors the sibling section
   * header treatment; rows render dimmed so an expanded Trash still reads
   * as "the discard pile", not more inbox. */
  #convList .conv-trash-section {
    margin-top: 12px;
    border-top: 1px solid var(--border);
  }
  #convList .conv-trash-header {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; background: transparent; border: 0; cursor: pointer;
    color: var(--text-muted); font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.5px; font-weight: 600;
  }
  #convList .conv-trash-header:hover { color: var(--text); }
  #convList .conv-trash-arrow { font-size: 11px; opacity: 0.7; }
  #convList .conv-trash-count {
    margin-left: auto;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; padding: 1px 8px; font-size: 11px;
    color: var(--text-muted); font-weight: 600;
  }
  #convList .conv-trash-section.collapsed .conv-trash-list { display: none; }
  #convList .conv-trash-list .conv-item { opacity: 0.72; }
  #convList .conv-trash-list .conv-item:hover { opacity: 1; }
  /* CCC-182: blinking in-row "needs you" marker. The "Needs you" SECTION was
   * removed (waiting rows kept jumping in/out of it); a waiting session now
   * stays put in its project group and blinks this orange dot instead. */
  .conv-item .conv-needs-you {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    margin-right: 4px;
    font-size: 11px; line-height: 1;
    color: var(--orange);
    animation: none;
  }
  @media (prefers-reduced-motion: reduce) {
    .conv-item .conv-needs-you { animation: none; }
  }
  /* design_handoff_sidebar_session_list (2c): small working-state dot,
     additive next to .conv-needs-you — teal pulse instead of amber, and
     never both at once (JS suppresses this one when needs-you is set). */
  .conv-item .conv-working-dot {
    flex: 0 0 auto;
    position: relative;
    width: 6px; height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    /* Teal per the design handoff's state palette — kept literal rather
       than a theme var; the handoff explicitly calls out state colors
       (needs-you amber, working teal) as meaning-carrying and exempt from
       the blue-gray palette substitution applied elsewhere. */
    background: #39d2c0;
  }
  .conv-item .conv-working-dot::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 50%;
    background: rgba(57,210,192,0.55);
    animation: ccc-working-dot-pulse 1.8s ease-in-out infinite;
    will-change: transform, opacity;
    pointer-events: none;
  }
  /* Status changes must not steal title width or move its wrap point.
     Paint both mutually exclusive markers in the existing left gutter. */
  #convList:not(.workers-dense) .conv-item .conv-main-row > .conv-working-dot,
  #convList:not(.workers-dense) .conv-item .conv-main-row > .conv-needs-you {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    margin: 0;
  }
  @keyframes ccc-working-dot-pulse {
    0%, 100% { transform: scale(1);   opacity: 0.55; }
    50%      { transform: scale(2.2); opacity: 0.15; }
  }
  @media (prefers-reduced-motion: reduce) {
    .conv-item .conv-working-dot::after { animation: none; opacity: 0.3; }
  }
  /* WIP elapsed timer in the status slot — how long the current turn has
     been running ("12s", "3m 4s"). Same yellow family as .activity-working
     (they usually sit adjacent: "WIP  12s") but calmer, and static — the
     chip's text itself is the live signal, no pulse needed. */
  .conv-item .conv-signal.conv-working-age {
    background: rgba(251,202,4,0.10);
    color: #FBCA04;
    font-variant-numeric: tabular-nums;
    animation: none;
  }
  #convList .conv-openask-label { color: var(--purple); }
  #convList .conv-openask-count {
    background: color-mix(in srgb, var(--purple) 12%, transparent);
    border-color: color-mix(in srgb, var(--purple) 35%, transparent);
    color: var(--purple);
  }
  .conv-item .live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green); animation: none;
    display: inline-block; flex-shrink: 0;
  }
  .conv-session-icon {
    transition: opacity 0.15s;
  }
  .conv-session-icon,
  .conv-pane-cat-icon {
    overflow: visible;
    isolation: isolate;
  }
  .conv-session-icon .conv-session-svg,
  .conv-pane-cat-icon .conv-session-svg {
    position: relative;
    z-index: 2;
    transition: opacity 0.15s;
  }
  .conv-item:hover .conv-session-icon .conv-session-svg,
  .conv-item:focus-within .conv-session-icon .conv-session-svg,
  .conv-pane-cat-icon:hover .conv-session-svg {
    opacity: 1;
  }

  .session-tier-cost {
    position: absolute;
    left: 18px;
    top: 50%;
    display: block;
    color: currentColor;
    font: 900 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -1px;
    white-space: nowrap;
    transform: translateY(-50%);
    opacity: 0.78;
    text-shadow: none;
    z-index: 5;
  }
  .session-tier-cost i {
    display: inline;
    font-style: normal;
  }

  /* Activity is deliberately independent of process liveness. Only active
     turn execution fills and pulses this dot; idle/ended/waiting stays hollow. */
  .session-activity-dot {
    position: absolute;
    left: -4px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border: 1px solid #657180;
    border-radius: 50%;
    background: transparent;
    z-index: 5;
  }
  .is-working .session-activity-dot {
    border-color: #49dc88;
    background: #49dc88;
    box-shadow: 0 0 4px rgba(73, 220, 136, 0.72);
    animation: none;
  }
  .is-not-working .session-activity-dot {
    border-color: #657180;
    background: transparent;
    box-shadow: none;
  }
  @keyframes ccc-activity-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.42; }
  }
  @media (prefers-reduced-motion: reduce) {
    .is-working .session-activity-dot { animation: none; }
  }
  .conv-session-icon.claude,
  .conv-pane-cat-icon.claude,
  .conv-avatar-model.claude {
    color: var(--engine-claude);
    --icon-shadow-color: rgba(240, 154, 120, 0.45);
  }
  .conv-session-icon.codex,
  .conv-pane-cat-icon.codex,
  .conv-avatar-model.codex {
    color: var(--engine-codex);
    --icon-shadow-color: rgba(61, 214, 140, 0.45);
  }
  .conv-session-icon.gemini,
  .conv-pane-cat-icon.gemini,
  .conv-avatar-model.gemini {
    color: var(--engine-gemini);
    --icon-shadow-color: rgba(192, 132, 252, 0.45);
  }
  .conv-session-icon.cursor,
  .conv-pane-cat-icon.cursor,
  .conv-avatar-model.cursor {
    color: var(--engine-cursor);
    --icon-shadow-color: rgba(226, 104, 64, 0.45);
  }
  .conv-session-icon.antigravity,
  .conv-pane-cat-icon.antigravity,
  .conv-avatar-model.antigravity {
    color: var(--engine-antigravity);
    --icon-shadow-color: rgba(242, 204, 96, 0.42);
  }
  .conv-session-icon.hermes,
  .conv-pane-cat-icon.hermes,
  .conv-avatar-model.hermes {
    color: var(--engine-hermes);
    --icon-shadow-color: rgba(45, 212, 191, 0.42);
  }
  .conv-session-icon.kimi,
  .conv-pane-cat-icon.kimi,
  .conv-avatar-model.kimi {
    color: var(--engine-kimi);
    --icon-shadow-color: rgba(125, 211, 252, 0.42);
  }
  .conv-session-icon.copilot,
  .conv-pane-cat-icon.copilot,
  .conv-avatar-model.copilot {
    color: var(--engine-copilot);
    --icon-shadow-color: rgba(86, 211, 100, 0.42);
  }
  .conv-session-icon.grok,
  .conv-pane-cat-icon.grok,
  .conv-avatar-model.grok {
    color: var(--engine-grok);
    --icon-shadow-color: rgba(244, 114, 182, 0.42);
  }
  .conv-session-icon.copilotchat,
  .conv-pane-cat-icon.copilotchat,
  .conv-avatar-model.copilotchat {
    color: var(--engine-copilotchat);
    --icon-shadow-color: rgba(129, 140, 248, 0.42);
  }
  .conv-session-icon.devin,
  .conv-pane-cat-icon.devin,
  .conv-avatar-model.devin {
    color: var(--engine-devin);
    --icon-shadow-color: rgba(139, 92, 246, 0.42);
  }
  .conv-session-icon.opencode,
  .conv-pane-cat-icon.opencode,
  .conv-avatar-model.opencode {
    color: var(--engine-opencode);
    --icon-shadow-color: rgba(251, 146, 60, 0.42);
  }
  /* Unified session cost palette */
  :is(.conv-session-icon, .conv-pane-cat-icon).cost-premium .session-tier-cost {
    color: #d6b94a;
  }
  :is(.conv-session-icon, .conv-pane-cat-icon).cost-premium .conv-session-svg {
    opacity: 1;
    filter: brightness(1.35) saturate(1.15);
  }
  :is(.conv-session-icon, .conv-pane-cat-icon).cost-high .session-tier-cost {
    color: #c88f42;
  }
  :is(.conv-session-icon, .conv-pane-cat-icon).cost-high .conv-session-svg {
    opacity: 0.86;
    filter: brightness(1.1) saturate(1.05);
  }
  :is(.conv-session-icon, .conv-pane-cat-icon).cost-medium .session-tier-cost {
    color: #5f91b5;
  }
  :is(.conv-session-icon, .conv-pane-cat-icon).cost-medium .conv-session-svg {
    opacity: 0.68;
    filter: brightness(0.95) saturate(0.9);
  }
  :is(.conv-session-icon, .conv-pane-cat-icon).cost-low .conv-session-svg {
    opacity: 0.48;
    filter: brightness(0.8) saturate(0.72);
  }
  /* Light-mode engine identity must not fade or brighten away with cost. */
  :root[data-theme="light"] :is(.conv-session-icon, .conv-pane-cat-icon)[class*="cost-"] .conv-session-svg {
    opacity: 1;
    filter: none;
  }
  /* End unified session cost palette */
  .conv-session-icon.pkood {
    color: #58a6ff;
    --icon-shadow-color: rgba(88, 166, 255, 0.45);
  }
  .conv-session-icon.backlog {
    color: #8b949e;
    --icon-shadow-color: rgba(139, 148, 158, 0.25);
  }
  .conv-session-icon.github-pr {
    color: #bc8cff;
    --icon-shadow-color: rgba(188, 140, 255, 0.4);
  }
  .conv-session-icon svg {
    width: 13px;
    height: 13px;
    display: block;
  }
  .conv-signal {
    font-size: 10px; padding: 1px 5px; border-radius: 3px;
    font-weight: 600; white-space: nowrap; flex: 0 0 auto;
    line-height: 1.1;
  }
  .conv-signal.stage { background: rgba(188,140,255,0.15); color: var(--purple); }
  .conv-signal.committed { background: rgba(63,185,80,0.15); color: var(--green); }
  .conv-signal.pushed { background: rgba(57,210,192,0.15); color: var(--cyan); }
  /* "uncommitted" — `git status --porcelain` against the effective worktree.
   * Outranks committed/pushed/PR on a worktree row because it means there
   * are unstaged changes since the last recorded commit. */
  .conv-signal.uncommitted {
    background: rgba(240,136,62,0.18); color: #F0883E;
  }
  .conv-signal.pr-open    { background: rgba(57,210,192,0.15); color: var(--cyan); }
  .conv-signal.pr-merged  { background: rgba(163,113,247,0.18); color: #c4a8ff; }
  .conv-signal.pr-closed  { background: rgba(139,148,158,0.15); color: var(--text-muted); }
  .conv-signal.pr-note { background: rgba(251,202,4,0.15); color: #FBCA04; }
  .conv-signal.pr-note-danger { background: rgba(248,81,73,0.16); color: var(--red); }
  .conv-signal.activity-working { background: rgba(251,202,4,0.15); color: #FBCA04; animation: none; }
  /* Distinct from .activity-working — cyan, no pulse. Surfaces "agent
     has stopped and is blocked on the user" (QUESTION, APPROVE?,
     WAITING). Previously these all rendered as yellow pulsing WIP and
     read as "the agent is still doing something", which was the
     conflation the user kept hitting. */
  .conv-signal.activity-waiting {
    background: rgba(56,189,248,0.14);
    color: #38bdf8;
    border: 1px solid rgba(56,189,248,0.35);
    font-weight: 700;
  }
  .conv-signal.activity-waiting { background: rgba(88,166,255,0.1); color: var(--accent); }
  .conv-signal.activity-idle { background: rgba(139,148,158,0.08); color: var(--text-muted); }
  .conv-signal.activity-blocked { background: rgba(248,81,73,0.15); color: var(--red); animation: pulse 2s infinite; }
  .conv-signal.spawn-failed { background: rgba(248,81,73,0.15); color: var(--red); }
  .conv-signal.pkood-running { background: rgba(63,185,80,0.15); color: var(--green); }
  .conv-signal.pkood-idle { background: rgba(88,166,255,0.1); color: var(--accent); }
  .conv-signal.read-only { background: rgba(139,148,158,0.12); color: var(--text-muted); }
  .conv-signal.pkood-blocked { background: rgba(248,81,73,0.15); color: var(--red); animation: pulse 2s infinite; }
  .conv-signal.pkood-stuck { background: rgba(248,81,73,0.25); color: var(--red); font-weight: 700; }
  .conv-signal.codex-stuck { background: rgba(248,81,73,0.20); color: var(--red); font-weight: 700; }
  /* Codex cloud (dot/aeon) thread: transcript lives in OpenAI's cloud;
     sky accent reads "remote" against the muted lifecycle chips. */
  .conv-signal.codex-cloud {
    background: rgba(56,189,248,0.14);
    color: #38bdf8;
    border: 1px solid rgba(56,189,248,0.30);
    font-weight: 600;
  }
  /* Muted "turn finished recently" chip (kimi/codex rows) — calm end state,
   * deliberately quieter than the committed/pushed greens so it reads as
   * lifecycle info, not a git signal. */
  .conv-signal.done { background: rgba(63,185,80,0.10); color: var(--text-muted); }
  .conv-signal.hermes-platform {
    background: rgba(45, 212, 191, 0.14);
    color: #5eead4;
  }
  .conv-signal.hermes-model {
    background: rgba(139,148,158,0.12);
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .conv-signal.hermes-lineage {
    background: rgba(45, 212, 191, 0.10);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.25);
  }
  /* Profile-worker chip — a session from a profile's own state.db
     (e.g. an "example-worker" agent), not a plain gateway chat. */
  .conv-signal.hermes-profile {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.30);
    font-weight: 600;
  }
  /* Agentic Hermes session (LLM used tools) — stands out so the
     interesting sessions are scannable against plain chat rows. */
  .conv-signal.hermes-agent {
    background: rgba(139, 87, 215, 0.14);
    color: #bd93f7;
    border: 1px solid rgba(139, 87, 215, 0.28);
    font-weight: 600;
  }
  /* Plain Hermes conversation (no tool calls) — muted so it reads as
     low-signal and is easy to skip. */
  .conv-signal.hermes-chat {
    background: rgba(139, 148, 158, 0.10);
    color: var(--text-muted);
  }
  /* "#N" issue-link chip on sidebar rows tied to a GH issue. Muted on
   * purpose — it's an identifier, not a state — so it doesn't compete
   * with the lifecycle chip (committed/pushed/PR/uncommitted) on the
   * same row. */
  .conv-signal.gh-link { background: rgba(139,148,158,0.12); color: var(--text-muted); font-weight: 600; }
  /* Subagent chip — "🤖 N" surfaces Claude Code Task spawns. In-flight
     variant adds a small "▶ N" suffix and a soft pulse so a session
     fanning out work right now is visually distinct from one that just
     has historic spawns. */
  .conv-signal.subagents {
    background: rgba(139, 87, 215, 0.12);
    color: #bd93f7;
    border: 1px solid rgba(139, 87, 215, 0.25);
    font-weight: 600;
  }
  .conv-signal.subagents.in-flight { animation: pulse 2s infinite; }
  /* Workflow chip — "⚙ N" surfaces Workflow tool runs. Same visual family
     as the subagent chip; the in-flight variant pulses while any run is
     still executing. */
  .conv-signal.workflows {
    background: rgba(87, 139, 215, 0.12);
    color: #7aa2e3;
    border: 1px solid rgba(87, 139, 215, 0.25);
    font-weight: 600;
  }
  .conv-signal.workflows.in-flight { animation: pulse 2s infinite; }
  .conv-signal-sub-flight {
    margin-left: 4px;
    opacity: 0.9;
    font-weight: 700;
  }
  /* Calmer "linked GH issue carries claude-in-progress label" chip — no
     yellow, no pulse. Pure reference info, not a liveness signal. */
  .conv-signal.gh-in-progress {
    background: rgba(139,148,158,0.10);
    color: var(--text-muted);
    border: 1px solid color-mix(in srgb, var(--text-muted) 30%, transparent);
    font-weight: 500;
  }
  .conv-item .source-badge.pkood { background: rgba(210,153,34,0.2); color: var(--orange); }
  .conv-item .source-badge.codex { background: rgba(88,166,255,0.18); color: #79c0ff; }
  .conv-item .source-badge.gemini { background: rgba(122,162,255,0.16); color: #9bb7ff; }
  .conv-item .source-badge.cursor { background: rgba(226,104,64,0.16); color: #f08a6b; }
  .conv-item .source-badge.antigravity { background: rgba(242,204,96,0.14); color: #f2cc60; }
  .conv-item .source-badge.hermes { background: rgba(45,212,191,0.14); color: #5eead4; }
  .conv-item .source-badge.kimi { background: rgba(125,211,252,0.14); color: #7dd3fc; }
  .conv-item .source-badge.copilot { background: rgba(86,211,100,0.14); color: #56d364; }
  .conv-item .source-badge.grok { background: rgba(244,114,182,0.14); color: #f472b6; }
  .conv-item .source-badge.copilotchat { background: rgba(129,140,248,0.14); color: #818cf8; }
  .conv-item .source-badge.devin { background: rgba(139,92,246,0.14); color: #a78bfa; }
  .conv-item .source-badge.opencode { background: rgba(251,146,60,0.14); color: #fb923c; }
  .pkood-tail-output {
    white-space: pre-wrap; word-break: break-word; font-family: 'SF Mono',SFMono-Regular,Consolas,monospace;
    font-size: 13px; line-height: 1.5; padding: 16px 20px; color: var(--text);
  }
  .pkood-kill-btn {
    padding: 4px 10px; font-size: 12px; border-radius: 6px; border: 1px solid var(--red);
    background: rgba(248,81,73,0.1); color: var(--red); cursor: pointer; font-weight: 600;
  }
  .pkood-kill-btn:hover { background: rgba(248,81,73,0.25); }
  .pkood-toggle-label {
    font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none;
  }
  .pkood-toggle-label input { margin: 0; cursor: pointer; }

  /* Inject input box — Omnara-style single rounded card. The whole row
     reads as one panel: rounded border, soft focus-within ring, no
     inner-input border. Mirrors `.cpi-wrap` (kanban variant) so the two
     surfaces feel consistent. */
  .conv-input-bar {
    display: none; /* shown via JS when live */
    position: relative;
    padding: 10px 20px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .conv-input-bar.visible {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border: 1px solid var(--border); border-radius: 14px;
    margin: 6px 14px 10px; padding: 12px 14px 12px 14px;
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    border-top: 1px solid var(--border);
  }
  /* devin-cli session whose lock is held by a foreign host (Devin Desktop /
     Next, a sibling CCC): the composer still accepts queued sends — they
     drain when the other client lets go — but the bar reads "managed
     externally" instead of fully live. */
  .conv-input-bar.visible.is-externally-managed {
    border-style: dashed;
    opacity: 0.62;
  }
  .conv-input-bar.visible.is-externally-managed textarea {
    color: var(--text-muted);
  }
  /* Conversation replay: simulate the human actually typing their reply
     into the real composer, then sending it (CCC-495) — same treatment as
     the group-chat reply box. */
  .conv-input-bar.visible:has(textarea.gc-replay-typing) {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(110,140,175,0.16);
  }
  .conv-input-bar .send-btn.gc-replay-send-flash {
    transform: scale(0.85);
    box-shadow: 0 0 0 4px rgba(110,140,175,0.35);
  }
  .conv-input-row-top {
    display: flex;
    align-items: flex-end;
    width: 100%;
  }
  .conv-input-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    margin-top: 4px;
    gap: 12px;
  }
  .conv-input-selectors {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .conv-announced-from {
    display: none;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(139,148,158,0.08);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }
  .conv-announced-from.visible { display: inline-flex; }
  .conv-announced-from:focus-within {
    border-color: var(--accent);
    background: rgba(88,166,255,0.10);
    color: var(--text);
  }
  .conv-announced-from span {
    flex: 0 0 auto;
  }
  .conv-input-bar .conv-announced-from-input {
    flex: 0 1 96px;
    min-width: 0;
    width: 96px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent !important;
    color: var(--text);
    -webkit-text-fill-color: currentColor;
    caret-color: currentColor;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
  }
  .conv-input-bar .conv-announced-from-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
  }
  .conv-input-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .conv-goal-strip[hidden] { display: none !important; }
  .conv-goal-strip {
    display: flex; align-items: center; gap: 8px;
    min-width: 0; min-height: 28px;
    margin: 6px 14px -2px; padding: 7px 12px;
    border: 1px solid var(--border); border-radius: 14px 14px 8px 8px;
    background: color-mix(in srgb, var(--bg) 88%, var(--surface));
    color: var(--text-muted);
    font-size: 13px; line-height: 1.3;
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  }
  .conv-goal-strip-icon {
    flex: 0 0 auto; width: 18px; text-align: center;
    color: currentColor; opacity: 0.9;
  }
  .conv-goal-strip-state {
    flex: 0 0 auto; color: var(--text);
    font-weight: 650; white-space: nowrap;
  }
  .conv-goal-strip-objective {
    flex: 1 1 auto;
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conv-goal-strip-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .conv-goal-action {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    padding: 2px 6px;
    font: inherit;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
  }
  .conv-goal-action:hover,
  .conv-goal-action:focus-visible {
    color: var(--text);
    border-color: color-mix(in srgb, currentColor 28%, transparent);
    background: color-mix(in srgb, currentColor 9%, transparent);
    outline: none;
  }
  .conv-goal-action:disabled {
    cursor: default;
    opacity: 0.65;
  }
  .conv-goal-action.is-clear {
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
  }
  .conv-goal-strip.is-active { color: var(--green, #3fb950); }
  .conv-goal-strip.is-paused { color: var(--orange, #d29922); }
  .conv-goal-strip.is-blocked { color: var(--red, #f85149); }
  .conv-goal-strip.is-complete { color: var(--text-muted); }
  .conv-goal-strip.is-active .conv-goal-strip-state,
  .conv-goal-strip.is-paused .conv-goal-strip-state,
  .conv-goal-strip.is-blocked .conv-goal-strip-state {
    color: currentColor;
  }
  .conv-input-bar.visible:has(+ .conv-input-hint + .conv-input-context.visible) {
    margin-bottom: 0;
    border-bottom-color: transparent;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .conv-input-bar.visible + .conv-input-hint + .conv-input-context.visible {
    margin: 0 14px 2px;
    padding: 0 14px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 14px 14px;
  }
  .conv-input-bar.visible:focus-within + .conv-input-hint + .conv-input-context.visible {
    border-color: var(--accent);
    box-shadow: 0 3px 0 0 rgba(110,140,175,0.16);
  }
  .conv-input-bar.visible:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(110,140,175,0.16);
  }
  .conv-input-bar input,
  .conv-input-bar textarea {
    flex: 1; padding: 6px 4px;
    border: none; outline: none;
    -webkit-appearance: none;
    appearance: none;
    /* WKWebView can expose the native macOS textarea backing through a
       transparent control; paint the composer background explicitly. */
    background: var(--bg) !important;
    background-color: var(--bg) !important;
    background-image: none !important;
    box-shadow: none;
    /* Brighter than --text (#c9d1d9) so the prompt has the same legibility
       as Claude Desktop's input. Light-mode override below keeps it dark. */
    color: #f0f6fc;
    /* Force a visible caret. The previous `caret-color: var(--accent)`
       failed in .conv-pane.has-conv-bg, where --accent is remapped to
       --conv-accent (the palette's accent), which can land close to the
       bg color and render the caret invisible. The textarea text color
       (`color` above, or --conv-text in has-conv-bg) is by definition
       picked to read against the background, so matching the caret to
       it guarantees contrast — and `-webkit-text-fill-color` keeps WKWeb
       View from quietly hiding the caret over a transparent bg. */
    -webkit-text-fill-color: currentColor;
    caret-color: currentColor;
    /* Let the Unicode bidi algorithm choose each prompt paragraph's base
       direction. This keeps English left-to-right while Hebrew, Arabic, and
       other RTL prompts begin at the right edge. */
    unicode-bidi: plaintext;
    font-size: 15px; font-weight: 500; font-family: inherit;
  }
  /* Keep composer sizing in JS. WebKit/WKWebView can paint native textarea
     internals over the placeholder when native field sizing is used. */
  .conv-input-bar textarea { max-height: 240px; }
  /* Belt-and-braces accent caret on focus — also helps in WKWebView
     where the default ~1px caret over the dark bar can be lost. */
  .conv-input-bar input:focus,
  .conv-input-bar textarea:focus {
    caret-color: var(--accent);
  }
  .conv-input-bar textarea {
    /* Single-row by default; autosize JS grows the height as the user
       types. Cap at ~10 rows then scroll internally. `resize: none` hides
       the OS resize-handle (the grip in the bottom-right corner). */
    line-height: 1.5;
    resize: none;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    min-height: 24px;
    max-height: 240px;
  }
  .conv-input-bar textarea::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
  /* Native-app typing on mobile. iOS Safari/WKWebView auto-zooms the page
     whenever a focused input renders below 16px. Some embedded webviews
     report a fine pointer even on a phone, so key this safeguard to either
     touch input OR the same narrow viewport used by the mobile layout.
     Desktop keeps the denser 15px composer at full width. */
  @media (pointer: coarse), (max-width: 1200px) {
    .conv-input-bar input,
    .conv-input-bar textarea,
    #cpInput {
      font-size: 16px;
    }
    .conv-input-bar {
      padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
    .conv-panel-input {
      padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
  }
  /* CCC-1233: the same zoom hits every other field (sidebar Search zoomed in
     with no way back). On touch/phone widths no text field may render below
     16px; !important beats the many later per-field 11-13px rules. */
  @media (pointer: coarse), (hover: none), (max-width: 600px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
    textarea,
    select,
    [contenteditable="true"] {
      font-size: 16px !important;
    }
  }
  .conv-pane.has-conv-bg .conv-input-bar input,
  .conv-pane.has-conv-bg .conv-input-bar textarea {
    color: var(--conv-text);
  }
  :root[data-theme="light"] .conv-input-bar input,
  :root[data-theme="light"] .conv-input-bar textarea { color: #1f2328; }
  :root[data-theme="light"] .conv-pane.has-conv-bg .conv-input-bar input,
  :root[data-theme="light"] .conv-pane.has-conv-bg .conv-input-bar textarea { color: var(--conv-text); }
  .conv-input-bar input::placeholder,
  .conv-input-bar textarea::placeholder { color: var(--text-muted); opacity: 0.6; font-weight: 400; }
  .conv-input-bar input.is-readonly,
  .conv-input-bar textarea.is-readonly {
    cursor: default;
    color: var(--text-muted);
  }
  .conv-input-bar input.is-readonly::placeholder,
  .conv-input-bar textarea.is-readonly::placeholder { opacity: 0.9; }
  .slash-command-menu {
    position: fixed;
    z-index: 10000;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(0,0,0,0.38);
  }
  .slash-command-item {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
  }
  .slash-command-item:hover,
  .slash-command-item.selected {
    background: var(--surface-2);
    border-color: rgba(88,166,255,0.35);
  }
  .slash-command-item.disabled {
    cursor: default;
    opacity: 0.72;
  }
  .slash-command-item.disabled .slash-command-name {
    color: var(--text-muted);
  }
  .slash-command-name {
    color: var(--accent);
    font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
  }
  .slash-command-desc {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
  }
  /* Bar uses align-items:center for single-line; flip to flex-end so the
     send button stays anchored to the bottom row when the textarea grows. */
  /* Bottom row uses flex alignment instead */
  .conv-input-bar .send-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid transparent; cursor: pointer;
    background: var(--accent); color: #fff;
    line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: opacity 0.15s, transform 0.05s;
  }
  .conv-input-bar .send-btn:hover { opacity: 0.9; }
  .conv-input-bar .send-btn:active { transform: translateY(1px); }
  .conv-input-bar .send-btn:disabled {
    background: transparent; color: var(--text-muted);
    border-color: var(--border); cursor: not-allowed; opacity: 0.5;
  }
  .conv-input-bar .send-btn svg { display: block; }
  /* Mobile: the primary Send button is the rightmost control and a bigger tap
     target — it sat second-to-last (left of Submit+) and was the same 32px as
     every secondary icon, easy to miss/mis-tap with a thumb. order pushes it
     past Submit+; no DOM reorder so desktop and send logic are untouched. */
  @media (max-width: 1200px) {
    .conv-input-bar .conv-input-buttons .send-btn {
      order: 99;
      width: 44px; height: 44px;
    }
    .conv-input-bar .conv-input-buttons .send-btn svg { width: 22px; height: 22px; }
  }
  /* Mobile space reclaim in the conversation header (CCC mobile screenshot).
     The conv view wasted ~half the viewport on header chrome. */
  @media (max-width: 1200px) {
    /* #3 — agent/subagent tabs scroll on ONE horizontal line instead of
       stacking into a tall vertical pile (each tab was claiming its own row). */
    .conv-tab-strip {
      flex-wrap: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .conv-tab-strip::-webkit-scrollbar { display: none; }
    .conv-tab { flex: 0 0 auto; }
    /* #1 — the toolbar wrapped into ~4 rows (title / meta chips / status pills
       / Back+Today). Tighten the 16px gap + padding, and keep the engine/status
       detail on one scrollable line instead of letting it claim a full row. */
    #convToolbar {
      gap: 8px;
      row-gap: 6px;
      padding: 8px 12px;
    }
    #convToolbar #convStatus {
      font-size: 11px;
      white-space: nowrap;
      overflow-x: auto;
      max-width: 100%;
      scrollbar-width: none;
    }
    #convToolbar #convStatus::-webkit-scrollbar { display: none; }

    /* ── Goal #1: collapse the metadata chip row ──────────────────────────
       The breadcrumb wrapped onto its own tall row carrying low-value chips
       (the "claude" engine chip + the "15.1MB" size chip). On a phone neither
       earns its vertical cost. Hide just those two decorations — KEEP the
       title, the popout, and the merged process pill (rendered into
       #convStatus) so the user still sees session name + one status pill.
       Decoration-only display:none — nothing interactive is removed. */
    #cccBreadcrumb.ccc-breadcrumb .ccc-breadcrumb-category,
    #cccBreadcrumb.ccc-breadcrumb .ccc-breadcrumb-size {
      display: none;
    }
    /* Let the title claim the freed width instead of truncating to "Disc…". */
    #cccBreadcrumb.ccc-breadcrumb {
      max-width: 100%;
      padding: 1px 4px;
      gap: 6px;
    }
    #cccBreadcrumb.ccc-breadcrumb .ccc-breadcrumb-title {
      font-size: 13px;
    }

    /* ── Goal #2: compact the Back / COO / Today / bug nav ────────────────
       These three topbar buttons (.bug-link covers Today, the injected COO
       button which mirrors Today's class, and Report-a-bug) each carried a
       text label that ate horizontal room and forced wrapping. Drop the
       label text (decoration only — the glyph + title/aria-label remain) and
       give every button a >=32px tap target so they read as a tidy icon row.
       Nothing is display:none'd on an interactive element. */
    #cccTopbar .bug-link .sh-action-label {
      display: none;
    }
    #cccTopbar .bug-link {
      margin-left: 4px;
      padding: 0;
      min-width: 34px;
      min-height: 34px;
      justify-content: center;
      font-size: 16px;
      gap: 0;
    }
    /* Shrink the in-toolbar Back button to match (keep it clearly tappable). */
    #convToolbar .mobile-back-btn,
    #convToolbar #mobileBackBtn {
      padding: 5px 10px;
      min-height: 32px;
      font-size: 12px;
    }
  }

  /* ── Goal #3: stop the sticky "original ask" card from overlapping ────────
     .conv-sticky-header is position:sticky at top:0 of .conversations-view —
     on a phone its 170px .csh-row floated over the first messages. Cap the
     panel height hard and let the ask body scroll internally so the message
     stream always starts below it, never behind it. Tighten padding/font to
     reclaim more of the viewport for actual content. Collapsed default;
     the user can still tap the chevron to expand to 50vh. */
  @media (max-width: 1200px) {
    .conv-sticky-header {
      padding: 8px 12px 8px;
      margin-bottom: 6px;
    }
    .conv-sticky-header .csh-row {
      height: 96px;
    }
    .conv-sticky-header.is-expanded .csh-row {
      height: 42vh;
    }
    .conv-sticky-header .csh-col {
      padding: 6px 9px;
    }
    .conv-sticky-header .user-msg {
      font-size: 12.5px;
      line-height: 1.32;
    }
    .conv-sticky-header .label {
      font-size: 10px;
      margin-bottom: 2px;
    }
  }

  /* ── Goal #4: fold the bottom chrome (composer context strip) ─────────────
     .conv-input-context carries the cwd path + the calc/cost usage line below
     the composer. On a phone it spent a full row on a label-heavy strip.
     Tighten padding/font and let it sit on one compact scrollable row.
     The composer buttons (send/mic/etc.) are untouched here. */
  @media (max-width: 1200px) {
    .conv-input-context {
      gap: 6px 8px;
      padding: 4px 10px;
      font-size: 11px;
    }
    .conv-input-context .wp-usage-peak {
      display: none;
    }
    /* New-session spawn-cwd row keeps its picker; only trim its padding. The
       row is display:none outside new-session mode (base rule), so no
       non-essential cwd chrome shows for an existing session anyway. */
    .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-picker {
      padding: 7px 10px;
      font-size: 13px;
    }
    /* On a phone the two-column new-session strip squishes the folder path
       so only the first few directories show. Stack object/chips/cwd/worktree
       vertically and let the folder input fill the full width. */
    .conv-input-context.visible.is-new-session {
      grid-template-columns: 1fr;
      grid-template-areas:
        "object"
        "chips"
        "cwd"
        "worktree"
        "account";
    }
    .conv-input-context.is-new-session .new-session-object-context,
    .conv-input-context.is-new-session .nso-combo,
    .conv-input-context.is-new-session .spawn-cwd-row,
    .conv-input-context.is-new-session .spawn-cwd-combo {
      width: 100%;
      max-width: none;
    }
    .conv-input-context.is-new-session .nso-combo { display: flex; }
    .conv-input-context.is-new-session .spawn-cwd-picker {
      width: auto;
      flex: 1 1 auto;
      min-width: 0;
      max-width: none;
      box-sizing: border-box;
    }
    .conv-input-context.is-new-session .spawn-worktree-row {
      justify-self: start;
    }
    /* CCC-1231: with the keyboard up the pane is ~half height, and the
       folder + model rows above the composer can't shrink, so the composer's
       bottom row (send) was pushed under the keyboard. Let those rows scroll
       in whatever room is left; the composer keeps its full height. */
    .conv-pane > .conv-input-context.is-new-session,
    .conv-pane:has(> .conv-input-context.is-new-session) > .conv-model-picker-strip {
      flex-shrink: 1;
      min-height: 0;
      overflow-y: auto;
    }
    .conv-pane:has(> .conv-input-context.is-new-session) > .conv-input-bar {
      flex-shrink: 0;
    }
    /* The overflow-y:auto above clips the upward-opening folder menu to the
       strip, hiding most suggestions. position:fixed escapes that clip. */
    .conv-input-context.is-new-session .spawn-cwd-row .spawn-cwd-menu {
      position: fixed;
      top: 72px;
      bottom: auto;
      left: 10px;
      right: 10px;
      width: auto;
      max-height: 45vh;
    }
  }

  /* New session on a phone: engine / model / effort were squeezed to ~70px
     each beside the send cluster and unreadable. Give them their own
     full-width row above the buttons, each select sharing the width. */
  @media (max-width: 1200px) {
    .conv-input-bar.is-new-session-launch .conv-input-row-bottom {
      flex-wrap: wrap;
      overflow: visible;
    }
    .conv-input-bar.is-new-session-launch .conv-input-selectors {
      flex: 1 1 100%;
      order: -1;
      overflow: visible;
    }
    .conv-input-bar.is-new-session-launch .conv-input-selectors > select {
      flex: 1 1 0;
      min-width: 0;
      max-width: none;
    }
  }

  /* Actions menu (⋯) is touch-only; desktop keeps the + attach button. */
  .conv-actions-group { display: none; position: relative; flex-shrink: 0; }
  .conv-actions-btn {
    width: 40px; height: 40px; border-radius: 999px; padding: 0;
    border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .conv-actions-menu {
    position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 200;
    min-width: 220px; padding: 4px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  }
  .conv-actions-item {
    display: block; width: 100%; text-align: left; padding: 12px 12px;
    font-size: 15px; color: var(--text); background: transparent;
    border: none; border-radius: 6px; cursor: pointer;
  }
  .conv-actions-item:active { background: var(--surface); }
  @media (pointer: coarse) {
    .conv-input-bar .conv-actions-group { display: inline-flex; }
    .conv-input-bar .attach-btn,
    .conv-input-bar .conv-send-caret,
    #convToolbar .compact-btn.in-header,
    .conv-input-bar .compact-btn { display: none !important; }
    /* overflow:hidden on the bottom row (phone width guard) clips the ⋯ and
       send menus that open upward; the selectors scroll on their own. */
    .conv-input-bar .conv-input-row-bottom { overflow: visible !important; }
    /* Nothing to continue from before the first message. */
    .conv-input-bar.is-new-session-launch .conv-actions-item[data-act="continue"] { display: none; }
    .conv-input-bar .send-btn { -webkit-touch-callout: none; user-select: none; }
    /* Keep the composer short enough that the button row (Send) stays on
       screen with the keyboard up: one swipeable row of small thumbnails and a
       capped textarea, instead of a tall attachment box + long prompt. */
    .conv-input-bar .paste-thumb-strip {
      flex-wrap: nowrap; overflow-x: auto; max-height: 76px;
    }
    .conv-input-bar .paste-thumb { flex: 0 0 auto; width: 56px; height: 56px; }
    .conv-input-bar textarea { max-height: calc(var(--app-vh, 100vh) * 0.16) !important; }
    .conv-input-context .spawn-cwd-picker { font-size: 13px; }
    /* While typing (keyboard up) the bar must fit above the keyboard so the
       Send row stays reachable: drop the engine/model/effort row and shrink
       the attachment thumbnails. They return when the textarea loses focus. */
    .conv-input-bar:has(textarea:focus) .conv-input-selectors { display: none !important; }
    .conv-input-bar:has(textarea:focus) .paste-thumb-strip { max-height: 48px; padding: 3px 6px; }
    .conv-input-bar:has(textarea:focus) .paste-thumb { width: 38px; height: 38px; }
    .conv-input-bar:has(textarea:focus) textarea { max-height: calc(var(--app-vh, 100vh) * 0.12) !important; }
  }

  /* Narrow or app-embedded composer: same + menu as touch. app.js
     (_initConvActionsMenu) sets .actions-in-menu on the composer when it is
     under ~600px wide or framed inside an app (body.ccc-app-embed), so Esc,
     Compact and Steer move into the + menu and the input, mic and Send stay. */
  .conv-input-bar.actions-in-menu .conv-actions-group { display: inline-flex; }
  .conv-input-bar.actions-in-menu .attach-btn,
  .conv-input-bar.actions-in-menu .conv-send-caret,
  .conv-input-bar.actions-in-menu .compact-btn,
  .conv-input-bar.actions-in-menu .steer-btn,
  .conv-input-bar.actions-in-menu #convEscBtn { display: none !important; }
  .conv-input-bar.actions-in-menu .conv-input-row-bottom { overflow: visible !important; }
  .conv-input-bar.is-new-session-launch.actions-in-menu .conv-actions-item[data-act="continue"] { display: none; }

  /* ── Goal #5: tighten message + status row vertical rhythm ────────────────
     More message fits per screen once the inter-event margins shrink. */
  @media (max-width: 1200px) {
    .conversations-view .event {
      margin-bottom: 2px;
      padding: 4px 10px;
    }
    .conversations-view .event.assistant {
      margin-bottom: 6px;
    }
  }

  /* ── Phone-specific (portrait) extra squeeze ──────────────────────────────
     Below 600px every pixel counts; push the sticky ask even smaller and
     drop the topbar gaps further. Still mobile-only, still no base changes. */
  /* Kill the keyboard-hint line (dormant · ⏎ send) — no hardware Enter on a
     phone; it just steals a row above the composer. CCC-868: gated on
     pointer:coarse (not just max-width:1200px) — any desktop window
     narrower than 1200px was losing the send/newline hint even though it
     has a real Enter key. */
  @media (max-width: 1200px) and (pointer: coarse) {
    .conv-input-hint { display: none !important; }
  }
  @media (max-width: 600px) {
    .conv-sticky-header .csh-row {
      height: 78px;
    }
    #cccTopbar .bug-link {
      min-width: 32px;
      min-height: 32px;
      margin-left: 2px;
    }
    .conv-input-context {
      padding: 3px 8px;
    }
  }
  /* ── Mobile conv-reader header → ONE tidy row (user request) ──────────────
     Collapse the reader header to a single row:  ‹  Title…  ○status ↻
     Hide the popout (no popout windows on a phone), COO + Today (they belong in
     the conversation-LIST top bar, not the reader), the engine/repo chip, the
     size, and the HH:MM:SS time. Back keeps only its arrow. id-specificity
     (#cccBreadcrumb…) overrides the earlier full-width title rule so the title
     shares the row and ellipsizes. Mobile-only — no base/desktop rule touched. */
  @media (max-width: 1200px) {
    #convToolbar { flex-wrap: nowrap; align-items: center; }
    #convToolbar .font-size-controls { display: none !important; }
    #convToolbar .mobile-back-btn {
      order: -100;
      padding: 4px 8px;
      flex: 0 0 34px;
      width: 34px;
      min-width: 34px;
      justify-content: center;
    }
    #convToolbar .mobile-back-btn .mb-label { display: none; }
    #cccBreadcrumb.ccc-breadcrumb {
      order: -2; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap;
    }
    #cccBreadcrumb.ccc-breadcrumb .ccc-breadcrumb-title {
      order: 0; flex: 1 1 auto; width: auto; min-width: 0;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      font-size: 14px;
    }
    #cccBreadcrumb .ccc-breadcrumb-category,
    #cccBreadcrumb .ccc-breadcrumb-size,
    #cccBreadcrumb .ccc-breadcrumb-popout,
    #cccBreadcrumb .ccc-proc-checked { display: none !important; }
    #cccTopbar #todayToggleBtn { display: none !important; }
    #cccBreadcrumb .ccc-breadcrumb-proc { order: 1; flex: 0 0 auto; }
    /* The "last ask" sticky uses full width with fewer boxes — drop the card
       border / radius / box background and the inner divider. */
    .conv-sticky-header .csh-row {
      border: none; border-radius: 0; background: transparent;
    }
    .conv-sticky-header .csh-col-ask { border-right: none; }
    .conv-sticky-header .csh-col { padding: 4px 0; }
    /* Refresh: keep ONE — the page-reload FAB stays floating on the
       conversation view (its default bottom-right). Just drop the redundant
       status-pill refresh in the header. */
    #cccBreadcrumb .ccc-proc-refresh { display: none !important; }
    /* Compact button lifted into the header (user request) — small icon, sits
       after the status pill; its base .visible toggle controls show/hide. */
    #convToolbar .compact-btn.in-header {
      order: 2; flex: 0 0 auto;
      width: 30px; height: 30px; padding: 0;
    }
  }

  /* ── Mobile composer: stacked layout, full-width textarea ────────────────────
     Textarea gets its own full-width row; the button cluster (esc/tts/mic/
     compact/send — 5+ buttons, ~230px+) sits on its own full-width row below.
     A row layout (textarea left, buttons right) was tried first but on a
     375-390px phone the button cluster alone ate more than half the bar,
     leaving the textarea a sliver too narrow to type into (CCC-406). Stacking
     matches what is-new-session-launch already did for the same reason (its
     wider engine+model selectors made the row-layout squeeze even worse) —
     applying it unconditionally means every mobile composer state behaves
     the same way instead of two divergent layouts.
     TTS returned to inline position — the FAB overlapped the goal strip × (CCC mobile). */
  @media (max-width: 1200px) {
    .conv-input-bar { position: relative; }
    .conv-input-bar.visible {
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      padding: 8px 10px;
      margin: 4px 8px 6px;
    }
    .conv-input-row-top,
    .conv-input-row-bottom { flex: 1 1 auto; min-width: 0; width: 100%; }
    .conv-input-bar textarea { min-height: 44px; max-height: 120px; }
    .conv-announced-from span { display: none; }
    .conv-input-bar .conv-announced-from-input { width: 74px; flex-basis: 74px; }
    /* TTS back inline — the FAB position overlapped the goal strip × button
       (both ended up right: 12px above the input bar). Inline is safe: the
       button row already has room for it beside mic + send. */
    .conv-input-bar .tts-btn {
      position: static;
      bottom: auto; right: auto; z-index: auto;
      width: 32px; height: 32px;
      border-radius: 50%;
      background: transparent;
      border: 1px solid var(--border);
      box-shadow: none;
      -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    /* Spawn selectors (engine / model / effort) can be wider than a phone
       viewport together, especially with a model like "K2.8 Preview". Keep them
       on one horizontal row and scroll internally so the send/mic/tts button
       cluster on the right never gets pushed off-screen. */
    .conv-input-row-bottom {
      min-width: 0;
      overflow: hidden;
    }
    .conv-input-selectors {
      flex: 1 1 0%;
      min-width: 0;
      flex-wrap: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }
    .conv-input-selectors::-webkit-scrollbar { display: none; }
    .conv-input-selectors > * {
      flex-shrink: 0;
    }
    .conv-input-buttons {
      flex-shrink: 0;
      min-width: 0;
      margin-left: 0;
    }
    /* Cap the width of spawn selects on narrow phones so the button cluster
       on the right never gets pushed off-screen. Native selects size to their
       widest option, which for models like "K2.7 Coding Highspeed" is far
       wider than the selected label that fits on a phone. */
    .conv-input-bar select.engine-select {
      max-width: 72px;
    }
    .conv-input-bar select.model-select {
      max-width: 112px;
    }
    .conv-input-bar select.effort-select,
    .conv-input-bar select#convInputIssueAction {
      max-width: 96px;
    }
    /* iOS Safari auto-zooms focused inputs below 16px. The inline style on the
       spawn selects sets 12px for desktop density; force 16px on mobile so the
       viewport doesn't zoom when the user taps a selector. */
    .conv-input-bar select.engine-select,
    .conv-input-bar select.model-select,
    .conv-input-bar select.effort-select,
    .conv-input-bar select#convInputIssueAction {
      font-size: 16px !important;
    }
    /* Submit+ is a desktop "phone-style" feature; on an actual phone the
       regular compose flow IS the phone experience — hide it to slim the row. */
    .conv-input-bar .submit-plus-btn { display: none !important; }
  }

  /* Keep core session details on narrow screens too. The container
     rules above reflow workspace and usage into separate rows instead of
     hiding the path, context count, or model. */
  @media (max-width: 1200px) {
    .conv-input-context .wp-quality-pill { display: none; }
  }

  /* ── Mobile: sidebar-footer poller strip doesn't clip ──────────────────────
     #pollerWrap (CPU/build/err health + models pill + throughput pill +
     trigger toggle, app.js _initPollerStrip) is `flex:1 1 auto; min-width:0`
     inside the nowrap `.sidebar-footer`, so the outer layout can compress its
     box far below its children's combined intrinsic width. The children are
     all `flex:0 0 auto` (refuse to shrink) and the wrap has no overflow
     rule, so on a ~375-390px phone the overflowing pills paint straight past
     the wrap's right edge and on top of the settings gear button next to it.
     Scroll instead of overflowing — same fix #pollerStrip already uses for
     the nested trigger-chip list.
     DOM order leads with #cccHealth (CPU/build/err — dev diagnostics), which
     ate the visible width and pushed the models/throughput pills — the ones
     users actually tap — into the scrolled-off, no-scrollbar-hint tail.
     Reorder visually (not in the DOM, so desktop keeps health leading) so
     models + throughput are the pills visible without swiping; health and
     the trigger toggle become the swipeable overflow instead. */
  @media (max-width: 1200px) {
    #pollerWrap {
      overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
      flex-wrap: nowrap;
    }
    #pollerWrap::-webkit-scrollbar { display: none; }
    #cccAdvisorPill { order: 1; }
    #cccThroughputPill { order: 2; }
    #cccHealth { order: 3; }
    #pollerToggle { order: 4; }
    #pollerStrip { order: 5; }
  }

  /* ── Mobile: sticky original-ask solid background ─────────────────────────
     .conv-sticky-header is position:sticky; its default semi-transparent
     background lets scrolled message content bleed through on small screens,
     creating an "overlay" illusion. Solid bg on mobile. */
  @media (max-width: 1200px) {
    .conv-sticky-header {
      background: var(--bg, #0d1117) !important;
    }
  }

  /* ── Mobile: larger tap target on subagent tab × ─────────────────────────
     The close × on a background-task tab is ~12px × 20px — too small on a
     phone. Expand to a comfortable 28px square without changing the glyph. */
  @media (max-width: 1200px) {
    .conv-tab-close {
      min-width: 28px;
      min-height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
    }
  }

  /* Submit+ — phone-mode send (teal/green to read as "talk", distinct from
     the accent send button next to it). */
  .conv-input-bar .submit-plus-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid rgba(63,185,80,0.42); cursor: pointer;
    background: rgba(63,185,80,0.14); color: var(--green);
    line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar .submit-plus-btn:hover {
    background: rgba(63,185,80,0.22); border-color: rgba(63,185,80,0.70);
  }
  .conv-input-bar .submit-plus-btn:active { transform: translateY(1px); }
  .conv-input-bar .submit-plus-btn:disabled {
    background: transparent; color: var(--text-muted);
    border-color: var(--border); cursor: not-allowed; opacity: 0.5;
  }
  .conv-input-bar .submit-plus-btn svg { display: block; }
  .conv-input-bar .steer-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid rgba(210,153,34,0.42); cursor: pointer;
    background: rgba(210,153,34,0.12); color: var(--orange);
    line-height: 1; padding: 0;
    display: none; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar .steer-btn.visible { display: inline-flex; }
  .conv-input-bar .steer-btn:hover {
    background: rgba(210,153,34,0.20);
    border-color: rgba(210,153,34,0.70);
  }
  .conv-input-bar .steer-btn:active { transform: translateY(1px); }
  .conv-input-bar .steer-btn:disabled {
    background: transparent; color: var(--text-muted);
    border-color: var(--border); cursor: not-allowed; opacity: 0.5;
  }
  .conv-input-bar .steer-btn svg { display: block; }
  /* Compact button — mirrors the steer button's pill shape but in a neutral
     accent so it reads as "context maintenance" rather than "interrupt". */
  .conv-input-bar .compact-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid rgba(88,166,255,0.42); cursor: pointer;
    background: rgba(88,166,255,0.12); color: var(--accent);
    line-height: 1; padding: 0;
    display: none; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar .compact-btn.visible { display: inline-flex; }
  .conv-input-bar .compact-btn:hover {
    background: rgba(88,166,255,0.20);
    border-color: rgba(88,166,255,0.70);
  }
  .conv-input-bar .compact-btn:active { transform: translateY(1px); }
  .conv-input-bar .compact-btn:disabled {
    background: transparent; color: var(--text-muted);
    border-color: var(--border); cursor: not-allowed; opacity: 0.5;
  }
  .conv-input-bar .compact-btn svg { display: block; }
  /* Send (queue if busy) — promoted out of the send caret menu to its own
     pill (cyan, distinct from steer's orange/compact's blue/phone-mode's
     green) since it's a one-click action people reach for often. */
  .conv-input-bar .send-queue-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid rgba(57,210,192,0.42); cursor: pointer;
    background: rgba(57,210,192,0.12); color: var(--cyan);
    line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar .send-queue-btn:hover {
    background: rgba(57,210,192,0.20);
    border-color: rgba(57,210,192,0.70);
  }
  .conv-input-bar .send-queue-btn:active { transform: translateY(1px); }
  .conv-input-bar .send-queue-btn:disabled {
    background: transparent; color: var(--text-muted);
    border-color: var(--border); cursor: not-allowed; opacity: 0.5;
  }
  .conv-input-bar .send-queue-btn svg { display: block; }
  .conv-input-bar .continue-new-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
    background: transparent; color: var(--text-muted);
    line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar.is-new-session-launch .continue-new-btn { display: none; }
  .conv-input-bar .continue-new-btn:hover {
    background: var(--surface-2); color: var(--text); border-color: var(--text-muted);
  }
  .conv-input-bar .continue-new-btn:active { transform: translateY(1px); }
  .conv-input-bar .continue-new-btn svg { display: block; }
  /* CCC-776: Send + its two alternate modes (continue-new, Submit+) collapsed
     from three always-on toolbar buttons into one caret dropdown, so the
     title/textarea above keeps the width the extra buttons used to eat.
     Mirrors the #localhostCaret/#localhostMenu pattern. */
  .conv-input-bar .conv-send-group {
    position: relative; display: inline-flex; align-items: center;
    flex-shrink: 0;
  }
  .conv-input-bar .conv-send-caret {
    width: 28px; height: 32px; flex-shrink: 0;
    border-radius: 4px; border: none; cursor: pointer;
    background: transparent; color: var(--text-muted);
    padding: 0; font-size: 20px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
  }
  .conv-input-bar .conv-send-caret:hover,
  .conv-input-bar .conv-send-caret[aria-expanded="true"] {
    background: var(--surface-2); color: var(--text);
  }
  .conv-input-bar .conv-send-menu {
    position: absolute; bottom: calc(100% + 8px); right: 0;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 4px;
    min-width: 200px; z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  }
  /* Menu items reuse .continue-new-btn/.submit-plus-btn for their existing
     click handlers and accent colors, but read as a plain labeled row here
     instead of a bordered pill icon button — reset every pill-button trait
     (border, fixed size, pill radius) the base rule set for the toolbar. */
  .conv-send-menu .conv-send-menu-item {
    width: 100%; height: auto;
    border: none; border-radius: 6px;
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; font-size: 12.5px; text-align: left;
    background: transparent;
  }
  .conv-send-menu .conv-send-menu-item + .conv-send-menu-item {
    margin-top: 1px;
  }
  .conv-send-menu .conv-send-menu-item svg { flex-shrink: 0; opacity: 0.9; }
  .conv-send-menu .conv-send-menu-item span { white-space: nowrap; }
  .conv-send-menu .continue-new-btn:hover,
  .conv-send-menu .continue-new-btn:active { background: var(--surface-3, rgba(255,255,255,0.06)); border: none; }
  .conv-send-menu .submit-plus-btn:hover,
  .conv-send-menu .submit-plus-btn:active { background: rgba(63,185,80,0.16); border: none; }
  /* CCC-923: auto-compact size + token-sitter toggle only make sense before
     a session exists — hidden once a real session is attached. */
  .conv-send-menu .new-session-only { display: none; }
  .conv-input-bar.is-new-session-launch .conv-send-menu .new-session-only { display: flex; }
  .conv-send-menu #convSendAutoCompactRow { flex-direction: column; align-items: flex-start; gap: 5px; cursor: default; }
  .conv-send-menu #convSendAutoCompactRow label { color: var(--text-muted); white-space: normal; }
  .conv-send-menu #convSendAutoCompactK {
    width: 100%; background: var(--surface-1, rgba(0,0,0,0.2));
    border: 1px solid var(--border); border-radius: 5px; color: var(--text);
    font-size: 12.5px; padding: 4px 7px;
  }
  .conv-send-menu #convSendTokenSitterRow { cursor: pointer; }
  .conv-send-menu #convSendTokenSitterRow input[type="checkbox"] { flex-shrink: 0; }
  /* Codex app-server indicator — a subtle pill in the input hint row. */
  .conv-input-hint .codex-appsrv {
    display: none; align-items: center; gap: 4px;
    margin-left: 8px; padding: 1px 7px; border-radius: 999px;
    font-size: 11px; line-height: 1.5; font-weight: 600;
    border: 1px solid var(--border); color: var(--text-muted);
    background: var(--surface-2);
  }
  .conv-input-hint .codex-appsrv.visible { display: inline-flex; }
  .conv-input-hint .codex-appsrv .dot {
    width: 6px; height: 6px; border-radius: 999px; background: var(--text-muted);
  }
  .conv-input-hint .codex-appsrv.live {
    color: var(--green); border-color: rgba(63,185,80,0.42);
    background: rgba(63,185,80,0.10);
  }
  .conv-input-hint .codex-appsrv.live .dot { background: var(--green); }
  /* No Speak button in the composer at any width: the floating speaker over
     the transcript reads the on-screen turn (and keyboard shortcuts still
     read the last message). Class, not id: split panes clone the composer. */
  .conv-input-bar .tts-btn { display: none !important; }
  .conv-input-bar .tts-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
    background: transparent; color: var(--text-muted);
    line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar .tts-btn:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .conv-input-bar .tts-btn:active { transform: translateY(1px); }
  .conv-input-bar .tts-btn.speaking {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
    box-shadow:
      inset 0 2px 6px rgba(0,0,0,0.28),
      0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
    transform: translateY(1px);
  }
  .conv-input-bar .mic-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
    background: transparent; color: var(--text-muted);
    line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar .mic-btn:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .conv-input-bar .mic-btn:active { transform: translateY(1px); }
  .conv-input-bar .mic-btn.recording {
    color: #fff;
    border-color: var(--red);
    background: var(--red);
    box-shadow:
      inset 0 2px 6px rgba(0,0,0,0.28),
      0 0 0 2px color-mix(in srgb, var(--red) 22%, transparent);
    transform: translateY(1px);
    animation: ccc-mic-pulse 1.5s infinite;
  }
  .conv-input-bar .mic-btn svg { display: block; }
  .conv-input-bar .mic-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .conv-input-bar .attach-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
    background: transparent; color: var(--text-muted);
    line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .conv-input-bar .attach-btn:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .conv-input-bar .attach-btn:active { transform: translateY(1px); }
  .conv-input-bar .attach-btn svg { display: block; }
  /* Larger touch target on phones (44px is the generally-cited minimum
     comfortable tap size) since this is a primary mobile-only entry point,
     not just a desktop convenience. Declared after the base rule above (and
     the .tts-btn/.mic-btn mobile block earlier in this file, which this
     would otherwise lose to under equal-specificity/later-wins cascade
     ordering) so it actually applies at narrow widths. */
  @media (max-width: 1200px) {
    .conv-input-bar .attach-btn {
      width: 40px; height: 40px;
    }
  }

  @keyframes ccc-mic-pulse {
    0% {
      box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.28),
        0 0 0 0px color-mix(in srgb, var(--red) 40%, transparent);
    }
    70% {
      box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.28),
        0 0 0 6px color-mix(in srgb, var(--red) 0%, transparent);
    }
    100% {
      box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.28),
        0 0 0 0px color-mix(in srgb, var(--red) 0%, transparent);
    }
  }
  /* Live TTS rate knob — shown only while playback is active. The
     range input is intentionally narrow so it slots into the input
     bar without crowding the send buttons. */
  .tts-rate-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
  }
  .tts-rate-control[hidden] { display: none; }
  /* − / + rate buttons (replaced the drag slider). */
  .tts-rate-control .tts-rate-btn {
    width: 20px; height: 20px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 5px;
    background: var(--surface-2); color: var(--text);
    font-size: 14px; line-height: 1; cursor: pointer;
    user-select: none;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
  }
  .tts-rate-control .tts-rate-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
  .tts-rate-control .tts-rate-btn:active { transform: translateY(1px); }
  .tts-rate-control .tts-rate-btn:disabled {
    opacity: 0.4; cursor: not-allowed; background: transparent; color: var(--text-muted);
  }
  .tts-rate-control .tts-rate-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 44px;
    text-align: center;
    user-select: none;
  }
  /* ── Floating TTS playback control ────────────────────────────────
     Fixed top-right pill that appears while a read is playing for a
     conversation the user has navigated away from. Pause/resume + stop
     so playback stays under control once it's decoupled from the
     focused pane. z-index sits above the transcript but below modals
     and lightboxes (9999), and it's nudged left of the very corner so
     it never sits under the window controls / scrollbar gutter. */
  .tts-floating-control {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px 5px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border) 55%);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
    box-shadow: 0 6px 20px rgba(0,0,0,0.32), 0 0 0 1px rgba(0,0,0,0.12);
    color: var(--text);
    font-size: 12px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: ttsFcIn 0.16s ease-out;
  }
  .tts-floating-control[hidden] { display: none; }
  @keyframes ttsFcIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .tts-floating-control .tts-fc-icon {
    display: inline-flex;
    color: var(--accent);
  }
  /* Pulse the speaker icon while actively reading; hold steady when paused. */
  .tts-floating-control:not(.is-paused) .tts-fc-icon {
    animation: ttsFcPulse 1.4s ease-in-out infinite;
  }
  @keyframes ttsFcPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
  }
  .tts-floating-control .tts-fc-label {
    font-weight: 600;
    letter-spacing: 0.01em;
    user-select: none;
    min-width: 52px;
  }
  .tts-floating-control .tts-fc-caption {
    font-size: 0.8em;
    opacity: 0.75;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
    transition: opacity 0.1s;
  }
  .tts-floating-control .tts-fc-caption:empty { display: none; }
  .tts-floating-control .tts-fc-btn {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  }
  .tts-floating-control .tts-fc-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border) 50%);
  }
  .tts-floating-control .tts-fc-btn:active { transform: translateY(1px); }
  .tts-floating-control .tts-fc-stop:hover {
    color: var(--red, #e5484d);
    border-color: color-mix(in srgb, var(--red, #e5484d) 60%, var(--border) 40%);
  }
  /* Toggle button shows pause OR play depending on state. */
  .tts-floating-control .tts-fc-toggle .tts-fc-play-icon { display: none; }
  .tts-floating-control .tts-fc-toggle .tts-fc-pause-icon { display: block; }
  .tts-floating-control.is-paused .tts-fc-toggle .tts-fc-play-icon { display: block; }
  .tts-floating-control.is-paused .tts-fc-toggle .tts-fc-pause-icon { display: none; }
  /* ── Topbar TTS control ────────────────────────────────────────────
     Compact inline control in the global topbar; mirrors play/pause/stop
     state regardless of which conversation is focused. Hidden when idle. */
  .tts-topbar-control {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px 3px 8px;
    border-radius: 4px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border) 55%);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface) 90%);
    color: var(--text);
    font-size: 11px;
    white-space: nowrap;
    vertical-align: middle;
  }
  .tts-topbar-control[hidden] { display: none; }
  .tts-topbar-icon {
    display: inline-flex;
    color: var(--accent);
  }
  .tts-topbar-control:not(.is-paused) .tts-topbar-icon {
    animation: ttsFcPulse 1.4s ease-in-out infinite;
  }
  .tts-topbar-label {
    font-weight: 600;
    letter-spacing: 0.01em;
    user-select: none;
    min-width: 48px;
  }
  .tts-topbar-btn {
    width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .tts-topbar-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border) 50%);
  }
  .tts-topbar-stop:hover {
    color: var(--red, #e5484d);
    border-color: color-mix(in srgb, var(--red, #e5484d) 60%, var(--border) 40%);
  }
  .tts-topbar-toggle .tts-topbar-play-icon { display: none; }
  .tts-topbar-toggle .tts-topbar-pause-icon { display: block; }
  .tts-topbar-control.is-paused .tts-topbar-toggle .tts-topbar-play-icon { display: block; }
  .tts-topbar-control.is-paused .tts-topbar-toggle .tts-topbar-pause-icon { display: none; }
  /* ── Compact-resume card ──────────────────────────────────────────
     The user_text following a /compact run is a multi-page wall of
     prose Claude wrote to "remember" the prior conversation. Wrap it
     in a collapsible card so the active chat isn't drowned by it.   */
  .compact-resume-card {
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border) 65%);
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 5%, var(--surface) 95%);
    padding: 0;
    margin: 4px 0;
    overflow: hidden;
  }
  .compact-resume-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 0; border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--text);
    font-size: 12px; font-weight: 600; text-align: left;
    cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  .compact-resume-toggle:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
  }
  .compact-resume-icon {
    color: var(--accent); font-size: 11px;
    display: inline-block; width: 12px;
  }
  .compact-resume-label { flex: 1; color: var(--accent); }
  .compact-resume-hint {
    font-size: 10px; font-weight: 400;
    color: var(--text-muted, var(--text-2));
    text-transform: none; letter-spacing: 0;
  }
  .compact-resume-intro {
    padding: 10px 14px;
    font-size: 13px; line-height: 1.5;
    color: var(--text-2, var(--text));
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  }
  .compact-resume-card[data-collapsed="1"] .compact-resume-body { display: none; }
  .compact-resume-body {
    padding: 12px 14px 14px;
    font-size: 13px; line-height: 1.55;
    max-height: 460px; overflow-y: auto;
  }
  .compact-resume-body h1,
  .compact-resume-body h2,
  .compact-resume-body h3 {
    font-size: 13px; font-weight: 700;
    margin: 10px 0 4px;
  }

  /* ── /compact lifecycle card ──────────────────────────────────────
     One card owns the whole compaction: mounted on the keystroke, ticks a
     live clock while the engine summarizes, and lands on the before/after
     numbers with the resume summary nested inside it. */
  .compact-run-card {
    margin: 12px 0;
    padding: 12px 14px 13px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border) 66%);
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 10%, var(--surface) 90%),
        color-mix(in srgb, var(--accent) 4%, var(--surface) 96%));
    font-size: 13px; line-height: 1.5; color: var(--text);
    animation: ccc-compact-card-in 220ms ease-out;
  }
  @keyframes ccc-compact-card-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
  }
  /* The absorbed resume summary renders INSIDE the card; its standalone
     event row stays in the DOM (jsonl-line dedupe anchors on it) but hidden,
     so there is exactly one visible artefact per compaction. */
  .event.compact-resume-event.compact-absorbed-by-run { display: none; }

  .compact-run-head {
    display: flex; align-items: center; gap: 9px;
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--accent);
  }
  .compact-run-title { flex: 1; }
  .compact-run-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 600; letter-spacing: 0;
    color: color-mix(in srgb, var(--text) 60%, transparent);
  }
  .compact-run-glyph { display: inline-flex; width: 15px; justify-content: center; }
  .compact-run-spinner {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-top-color: var(--accent);
    animation: ccc-compact-spin 0.9s linear infinite;
  }
  @keyframes ccc-compact-spin { to { transform: rotate(360deg); } }

  /* Named stages, so "what is it doing right now" is answerable at a glance. */
  .compact-run-steps {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
    margin: 9px 0 2px;
    font-size: 12px;
  }
  .compact-run-step {
    display: inline-flex; align-items: center; gap: 5px;
    color: color-mix(in srgb, var(--text) 42%, transparent);
    transition: color 180ms ease;
  }
  .compact-run-step-mark { display: inline-flex; width: 11px; justify-content: center; }
  .compact-run-step.is-done { color: color-mix(in srgb, var(--text) 62%, transparent); }
  .compact-run-step.is-done .compact-run-step-mark { color: var(--green, #4ade80); }
  .compact-run-step.is-active { color: var(--text); font-weight: 600; }
  .compact-run-step-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    animation: ccc-compact-pulse 1.25s ease-in-out infinite;
  }
  @keyframes ccc-compact-pulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.7); }
  }

  /* Estimated progress. Eases toward but never reaches 100% while working —
     it paces the wait, it does not claim to know the finish time. */
  .compact-run-bar {
    position: relative; overflow: hidden;
    height: 4px; margin: 10px 0 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
  }
  .compact-run-bar-fill {
    display: block; height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg,
      color-mix(in srgb, var(--accent) 55%, transparent), var(--accent));
    transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .compact-run-bar::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent,
      color-mix(in srgb, var(--accent) 45%, transparent), transparent);
    transform: translateX(-100%);
    animation: ccc-compact-shimmer 1.9s ease-in-out infinite;
  }
  @keyframes ccc-compact-shimmer { to { transform: translateX(100%); } }

  /* The payoff line: what the context was, what it is now, what that bought. */
  .compact-run-result {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
    margin: 10px 0 2px;
    font-size: 14px;
    animation: ccc-compact-result-in 320ms ease-out;
  }
  @keyframes ccc-compact-result-in {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: none; }
  }
  .compact-run-result b { font-variant-numeric: tabular-nums; color: var(--text); }
  .compact-run-arrow { color: var(--accent); }
  .compact-run-freed { color: var(--green, #4ade80); font-weight: 600; }
  .compact-run-pct { font-weight: 500; opacity: 0.85; }
  .compact-run-took,
  .compact-run-sep { color: color-mix(in srgb, var(--text) 48%, transparent); font-size: 13px; }

  .compact-run-note { margin-top: 8px; }
  .compact-run-note b { font-variant-numeric: tabular-nums; }
  .compact-run-quiet,
  .compact-run-heartbeat,
  .compact-run-backup {
    color: color-mix(in srgb, var(--text) 58%, transparent);
  }
  .compact-run-heartbeat, .compact-run-backup { margin-top: 6px; font-size: 12px; }
  .compact-run-elapsed { font-variant-numeric: tabular-nums; }
  .compact-run-slownote {
    margin-top: 8px; padding: 7px 9px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    font-size: 12px;
  }
  .compact-run-retry {
    display: inline-block; margin-left: 8px;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    background: transparent; color: var(--accent);
    font-size: 12px; font-weight: 600; cursor: pointer;
  }
  .compact-run-retry:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

  .compact-run-card[data-stage="done"] {
    border-color: color-mix(in srgb, var(--green, #4ade80) 32%, var(--border) 68%);
  }
  .compact-run-card[data-stage="done"] .compact-run-head,
  .compact-run-card[data-stage="done"] .compact-run-glyph { color: var(--green, #4ade80); }
  .compact-run-card[data-stage="failed"] {
    border-color: color-mix(in srgb, var(--red, #f87171) 40%, var(--border) 60%);
    background: color-mix(in srgb, var(--red, #f87171) 6%, var(--surface) 94%);
  }
  .compact-run-card[data-stage="failed"] .compact-run-head,
  .compact-run-card[data-stage="failed"] .compact-run-glyph { color: var(--red, #f87171); }
  .compact-run-card[data-stage="unconfirmed"] {
    border-color: color-mix(in srgb, var(--amber, #fbbf24) 40%, var(--border) 60%);
  }
  .compact-run-card[data-stage="unconfirmed"] .compact-run-head,
  .compact-run-card[data-stage="unconfirmed"] .compact-run-glyph { color: var(--amber, #fbbf24); }
  .compact-run-card.is-slow[data-stage="working"] {
    border-color: color-mix(in srgb, var(--amber, #fbbf24) 40%, var(--border) 60%);
  }
  /* Rows folded into a record card stay in the DOM (jsonl-line dedupe and
     scroll anchoring both key off them) but stop rendering as siblings. */
  .event.compact-record-hidden { display: none; }
  .compact-run-card.is-record { animation: none; }

  .compact-run-summary { margin-top: 10px; }
  .compact-run-summary .compact-resume-card { margin: 0; }

  @media (prefers-reduced-motion: reduce) {
    .compact-run-card,
    .compact-run-result { animation: none; }
    .compact-run-bar::after,
    .compact-run-step-dot { animation: none; }
    .compact-run-bar-fill { transition: none; }
  }

  /* Legacy compact-in-progress banner (kept for any path still using it). */
  .compact-in-progress-banner {
    display: flex; align-items: center; gap: 10px;
    margin: 10px 0;
    padding: 10px 12px;
    border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border) 50%);
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 7%, var(--surface) 93%);
    font-size: 13px; line-height: 1.45;
    color: var(--text);
  }
  .compact-banner-text strong { color: var(--accent); margin-right: 4px; }
  .compact-banner-heartbeat {
    display: inline; color: color-mix(in srgb, var(--text) 70%, transparent);
  }
  .compact-banner-elapsed { font-variant-numeric: tabular-nums; }
  /* Stall hint stays hidden until the banner has outrun the usual window. */
  .compact-banner-slow-note { display: none; color: var(--text); }
  .compact-in-progress-banner.is-slow .compact-banner-slow-note { display: inline; }
  .compact-in-progress-banner.is-slow { border-style: solid; }
  .compact-banner-spinner {
    flex: 0 0 auto;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-top-color: var(--accent);
    animation: ccc-compact-spin 0.9s linear infinite;
  }
  @keyframes ccc-compact-spin {
    to { transform: rotate(360deg); }
  }

  .conv-input-bar .tts-btn.speaking.paused {
    /* Paused but still active — calmer color so the button reads as
       "click to resume" instead of "still speaking". */
    background: color-mix(in srgb, var(--accent) 35%, transparent);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.20);
  }
  .conv-input-bar .tts-btn.failed {
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 55%, transparent);
  }
  .conv-input-bar .tts-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .conv-input-bar .tts-btn svg { display: block; }
  /* Demoted Esc — borderless ghost so it stops competing visually with
     the send button. Same hover/state cues, just less prominent at rest. */
  .conv-input-bar .esc-btn {
    height: 28px; padding: 0 8px; flex-shrink: 0;
    border-radius: 6px; border: 1px solid transparent; cursor: pointer;
    background: transparent; color: var(--text-muted);
    font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .conv-input-bar .esc-btn:hover { background: var(--surface-2); color: var(--text); }
  .conv-input-bar .esc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .conv-input-bar .esc-btn.sent { background: var(--accent); color: #fff; border-color: var(--accent); }
  .conv-input-bar .esc-btn.failed { color: #f85149; border-color: #f85149; }
  /* Tty label — moved out of the input row into a muted footer underneath
     the card so it doesn't take horizontal space on the input row. */
  .conv-input-hint {
    display: flex; align-items: center; gap: 10px;
    padding: 2px 22px 6px;
    margin-top: 0;
    font-size: 10px; color: var(--text-muted); opacity: 0.6;
  }
  .conv-input-hint:not(:has(.codex-appsrv.visible, .tty-label:not(:empty))) { display: none; }
  .conv-input-hint .tty-label {
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  }
  /* Legacy in-row tty-label kept for any hidden code paths that still query
     it; the new footer span is what's actually visible. */
  .conv-input-bar > .tty-label {
    font-size: 10px; color: var(--text-muted); opacity: 0.6;
    white-space: nowrap;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    flex: 0 0 auto;
  }
  .conv-item.dragging {
    opacity: 0.4; transform: scale(0.98);
  }
  .conv-item.drop-above {
    box-shadow: inset 0 2px 0 0 var(--accent);
  }
  .conv-item.drop-below {
    box-shadow: inset 0 -2px 0 0 var(--accent);
  }
  /* Drop-onto attach (CCC-1155): the dragged row becomes a sub-session of the
     highlighted row — a whole-row outline, not an insert line. */
  .conv-item.drop-attach {
    background: rgba(88, 166, 255, 0.10);
    box-shadow: inset 0 0 0 1.5px var(--accent);
    border-radius: 6px;
  }
  /* Drag-to-pin: highlight the destination folder group header while the
     dragged row hovers over it. */
  .conv-folder-group-header.drop-target {
    background: rgba(88, 166, 255, 0.12);
    box-shadow: inset 0 0 0 1px var(--accent);
    border-radius: 4px;
  }
  /* Pin indicator on rows whose repo bucket the user overrode. The
     button doubles as the unpin affordance. */
  .conv-repo-pin {
    display: inline-flex;
    align-items: center;
    height: 17px;
    background: rgba(88, 166, 255, 0.10);
    border: 1px dashed rgba(88, 166, 255, 0.42);
    border-radius: 4px;
    cursor: pointer;
    padding: 0 5px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--accent, #58a6ff);
    opacity: 0.82;
  }
  .conv-repo-pin:hover { opacity: 1; background: rgba(88, 166, 255, 0.18); }
  .conv-item.is-repo-pinned .conv-folder-chip {
    outline: 1px dashed var(--accent); outline-offset: 1px;
  }
  .conv-item .drag-handle {
    display: none;
    position: absolute; left: 2px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted); opacity: 0.5;
    font-size: 14px; cursor: grab; user-select: none;
  }
  .conv-item { position: relative; }
  .conv-item.active:hover .drag-handle { display: block; }
  .conv-item.dragging .drag-handle { cursor: grabbing; }

  /* Current-goal chip (codex /goal). Reads like a soft second column after
     the title — truncates with ellipsis so it never pushes the row wider. */
  .conv-item .conv-goal {
    display: inline-flex; align-items: center; gap: 3px;
    margin-left: 8px; min-width: 0; max-width: 240px;
    font-size: 10px; line-height: 1.4;
    color: var(--text-muted);
    vertical-align: middle;
  }
  .conv-item .conv-goal .conv-goal-icon {
    flex: 0 0 auto; font-size: 9px; opacity: 0.8;
  }
  .conv-item .conv-goal .conv-goal-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
  }
  .conv-item .conv-goal.is-active { color: var(--green, #3fb950); }
  .conv-item .conv-goal.is-paused { color: var(--orange, #d29922); }
  .conv-item .conv-goal.is-blocked { color: var(--red, #f85149); }
  .conv-item .conv-goal.is-complete { color: var(--text-muted); opacity: 0.75; }
  .conv-item .conv-goal-icon-only {
    flex: 0 0 auto;
    margin-left: 6px;
    color: var(--green, #3fb950);
    font-size: 12px;
    line-height: 1;
  }
  .conv-item .conv-goal-icon-only.is-paused,
  .conv-item .conv-goal-icon-only.is-blocked { color: var(--orange, #d29922); }
  .conv-item .conv-goal-icon-only.is-complete { color: var(--text-muted); opacity: 0.75; }
  .conv-item.active .conv-hover-meta-row .conv-goal { opacity: 1; }

  .conv-list-panel {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
    border-top: 1px solid var(--border);
  }
  /* Conversation list header with search + refresh */
  .conv-list-header {
    display: flex; gap: 6px; align-items: center;
    padding: 8px 12px 0;
  }
  .search-wrap { position: relative; }
  .conv-list-header .search-wrap { flex: 1; }
  .conv-search-input {
    width: 100%;
    padding: 6px 30px 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
    outline: none;
  }
  .conv-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
  }
  .search-wrap.has-value .conv-search-clear { display: flex; }
  .conv-search-status {
    margin: 6px 12px 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 213, 100, 0.58);
    border-radius: 6px;
    background: rgba(255, 213, 100, 0.16);
    color: #ffd564;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: pre-line;
    font-variant-numeric: tabular-nums;
    animation: convSearchPulse 0.85s ease-in-out infinite alternate;
  }
  @keyframes convSearchPulse {
    from { opacity: 0.72; }
    to { opacity: 1; }
  }

  /* Today's projects tray (CCC-141). Sits below the search input and above the
     conversation list. Lightweight session tray, NOT Flow board state. */
  .today-toggle-btn[aria-pressed="true"] {
    background: rgba(88,166,255,0.18);
    color: var(--text);
    border-color: rgba(88,166,255,0.45);
  }
  .today-tray {
    margin: 6px 12px 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    flex: 0 0 auto;
  }
  .today-tray.drop-target {
    border-color: rgba(88,166,255,0.6);
    background: rgba(88,166,255,0.08);
  }
  .today-tray-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
  }
  .today-tray-title {
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
    text-transform: uppercase; color: var(--text-muted);
  }
  .today-clear-btn {
    border: 0; background: transparent; color: var(--text-muted);
    font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 4px;
    font-family: inherit;
  }
  .today-clear-btn:hover { background: var(--surface-2); color: var(--text); }
  .today-tray-body {
    display: flex; flex-wrap: wrap; gap: 6px;
  }
  .today-empty {
    font-size: 11px; color: var(--text-muted); padding: 2px 0;
  }
  .today-chip {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 100%;
    padding: 4px 6px 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    cursor: pointer;
    font-size: 12px;
  }
  .today-chip:hover { background: var(--surface-2); border-color: rgba(88,166,255,0.4); }
  .today-chip .today-chip-dot {
    width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto;
    background: var(--text-muted);
  }
  .today-chip.is-live .today-chip-dot { background: #3fb950; }
  .today-chip .today-chip-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 140px;
  }
  .today-chip-remove {
    border: 0; background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px;
    border-radius: 999px;
  }
  .today-chip-remove:hover { color: var(--text); background: var(--surface-2); }
  .conv-search-clear:hover,
  .conv-search-clear:focus-visible {
    background: var(--surface-2);
    color: var(--text);
  }
  .conv-refresh-btn {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 4px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 14px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, transform 0.4s;
  }
  .conv-refresh-btn:hover { color: var(--text); background: var(--surface-2); }
  .conv-refresh-btn.spinning { transform: rotate(360deg); }
  .conv-sort-btn {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 4px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 14px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
  }
  .conv-sort-btn:hover { color: var(--text); background: var(--surface-2); }
  .conv-sort-btn.active { color: var(--accent); border-color: rgba(88,166,255,0.4); }
  .conv-archive-toggle {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 4px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 14px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
  }
  .conv-archive-toggle:hover { color: var(--text); background: var(--surface-2); }
  .conv-archive-toggle.active { color: var(--orange); border-color: rgba(255,166,87,0.4); }

  .conv-item .source-badge {
    display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px;
    background: rgba(210, 153, 34, 0.15); color: var(--orange);
    font-weight: 600; white-space: nowrap; flex-shrink: 0;
  }
  .source-badge svg {
    width: 100%; height: 100%; display: block;
  }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 14px; height: 14px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 7px; border: 3px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; }

  /* ── Kanban board (vertical stacked columns in sidebar) ── */
  /* Sizing comes from .sh-btn (padding-based) so the " Board" label fits;
     keep the flex centering so the ☷ glyph + text line up. */
  .conv-kanban-toggle {
    flex-shrink: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    transition: background 0.15s, color 0.15s;
  }
  .conv-kanban-toggle.active { color: var(--accent); border-color: rgba(88,166,255,0.4); }
  .conv-kanban-toggle.is-flow { color: var(--cyan); border-color: rgba(57,210,192,0.45); }

  .kanban-board {
    display: flex; gap: 12px; padding: 8px;
    flex: 1; min-height: 0; overflow-x: auto;
  }

  .flow-board {
    flex: 1; min-height: 0; overflow: auto;
    padding: 0; background: var(--bg);
    position: relative; overscroll-behavior: contain;
  }
  body.flow-expanded { overflow: hidden; }
  .flow-board.is-expanded {
    position: fixed; inset: 0; z-index: 9990;
    width: 100vw; height: 100vh; max-width: none;
    display: block !important;
    background: var(--bg);
  }
  .flow-toolbar {
    /* Sticky on BOTH axes: the toolbar lives inside .flow-board, which pans
       via scrollLeft/scrollTop. With only top:0 it stayed put vertically but
       slid sideways on horizontal pan/resize — the left buttons (search,
       + Session…) got cut off the viewport (CCC-135). left:0 pins it to the
       viewport's left so it always spans the visible width. */
    position: sticky; top: 0; left: 0; z-index: 4;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 8px; border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .flow-toolbar-spacer { flex: 1 1 auto; min-width: 8px; }
  /* Conversation search inside the flow toolbar — mirrors the main
     sidebar's #convSearch so users can filter the flow board without
     flipping back to the dashboard. */
  .flow-toolbar-search {
    flex: 0 0 auto;
    width: 200px;
    min-width: 140px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    line-height: 1;
    outline: none;
  }
  .flow-toolbar-search::placeholder { color: var(--text-muted); }
  .flow-toolbar-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(88,166,255,0.35);
  }
  .flow-toolbar-divider {
    width: 1px; align-self: stretch;
    background: var(--border);
    margin: 4px 8px;
    flex: 0 0 auto;
  }
  .flow-toolbar-btn {
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); color: var(--text);
    font-size: 12px; line-height: 1; padding: 6px 10px;
    cursor: pointer;
  }
  .flow-toolbar-btn:hover { background: var(--surface-2); }
  .flow-toolbar-btn.active {
    color: var(--accent);
    border-color: rgba(88,166,255,0.44);
    background: rgba(88,166,255,0.12);
  }
  .flow-toolbar-btn.is-recording {
    color: var(--red);
    border-color: rgba(248,81,73,0.45);
    background: rgba(248,81,73,0.12);
  }
  .flow-toolbar-group {
    display: inline-flex; align-items: center; gap: 4px;
    flex: 0 0 auto;
  }
  .flow-icon-btn {
    width: 30px; height: 28px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .flow-icon-btn svg {
    width: 15px; height: 15px; display: block;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .flow-zoom-controls { display: inline-flex; align-items: center; gap: 4px; }
  .flow-zoom-value {
    min-width: 48px; padding-left: 8px; padding-right: 8px;
    font-variant-numeric: tabular-nums; color: var(--text-muted);
  }
  .flow-empty-state {
    margin: 12px; padding: 18px 12px; text-align: center;
    color: var(--text-muted); font-size: 12px;
    border: 1px dashed var(--border); border-radius: 6px;
    background: var(--surface);
  }
  .flow-canvas {
    position: relative; box-sizing: border-box;
    --flow-zoom: 1;
    --flow-grid-size: 32px;
    --flow-pad-x: 0px;
    --flow-pad-y: 0px;
    background:
      linear-gradient(var(--border) 1px, transparent 1px),
      linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: var(--flow-grid-size) var(--flow-grid-size);
    background-position:
      calc(var(--flow-pad-x) - 1px) calc(var(--flow-pad-y) - 1px);
  }
  .flow-world {
    position: absolute; left: 0; top: 0;
    transform-origin: 0 0;
  }
  .flow-links {
    position: absolute; inset: 0; overflow: visible;
    pointer-events: none; z-index: 0;
  }
  /* Edges are now grouped <g class="flow-edge"> with two paths:
       - .flow-edge-hit: wide, transparent, captures clicks/drags
       - .flow-edge-line: thin, visible
     The selected edge swaps to a thicker orange line, and during a
     reparent drag the ghost line follows the cursor while the live
     edge dims. */
  .flow-edge .flow-edge-line {
    fill: none; stroke: var(--flow-edge-color, rgba(88,166,255,0.38));
    stroke-width: 1.6; stroke-linecap: round;
    pointer-events: none;
    transition: stroke 0.12s, stroke-width 0.12s;
  }
  .flow-edge .flow-edge-hit {
    fill: none; stroke: transparent;
    stroke-width: 14; stroke-linecap: round;
    pointer-events: stroke; cursor: pointer;
  }
  .flow-edge:hover .flow-edge-line { stroke: rgba(88,166,255,0.65); }
  .flow-edge.is-selected .flow-edge-line {
    stroke: var(--orange);
    stroke-width: 2.4;
  }
  .flow-edge-line.is-dragging {
    stroke: var(--orange);
    stroke-width: 2.4;
    stroke-dasharray: 6 4;
    pointer-events: none;
  }
  .flow-node.is-drop-target {
    border-color: var(--orange) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 35%, transparent),
                0 12px 28px rgba(0,0,0,0.28);
  }
  .flow-node {
    position: absolute; z-index: 1; width: 260px;
    --flow-accent: var(--accent);
    --flow-accent-soft: rgba(88,166,255,0.10);
    --flow-accent-line: rgba(88,166,255,0.38);
    min-height: 72px; box-sizing: border-box;
    border: 1px solid var(--border); border-left: 4px solid var(--accent);
    border-radius: 6px; background: var(--surface);
    padding: 10px 12px; cursor: grab; user-select: none; touch-action: none;
    box-shadow: 0 8px 18px rgba(0,0,0,0.16);
  }
  .flow-node:hover { border-color: var(--text-muted); }
  .flow-node.dragging {
    cursor: grabbing; opacity: 0.92; z-index: 3;
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  }
  .flow-node.selected {
    outline: 2px solid rgba(88,166,255,0.72);
    outline-offset: 3px;
  }
  .flow-node.flow-drop-target {
    outline: 2px dashed var(--green); outline-offset: 3px;
  }
  .flow-node.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88,166,255,0.22), 0 8px 18px rgba(0,0,0,0.16);
  }
  .flow-selection-box {
    position: absolute; z-index: 4; pointer-events: none;
    border: 1px solid rgba(88,166,255,0.72);
    background: rgba(88,166,255,0.14);
    border-radius: 3px;
  }
  .flow-node-repo {
    width: 240px;
  }
  .flow-node-object {
    width: 260px;
  }
  .flow-node-work-item {
    border-left-color: var(--flow-accent);
    background: linear-gradient(var(--flow-accent-soft), var(--flow-accent-soft)), var(--surface);
  }
  .flow-node-work-item .flow-node-kicker { color: var(--flow-accent); }
  .flow-node-session:not(.is-archived) {
    background: linear-gradient(var(--flow-accent-soft), var(--flow-accent-soft)), var(--surface);
  }
  /* Group chat — distinct cyan accent so users can scan the board and
     pick out the coordination nodes without reading the kicker label. */
  .flow-node-group-chat {
    width: 240px; border-left-color: var(--cyan, #39d2c0);
    background: linear-gradient(rgba(57,210,192,0.10), rgba(57,210,192,0.10)), var(--surface);
  }
  .flow-node-group-chat .flow-node-kicker { color: var(--cyan, #39d2c0); }
  .flow-node-draft {
    border-left-color: var(--green);
    background: linear-gradient(rgba(63,185,80,0.12), rgba(63,185,80,0.12)), var(--surface);
    padding-bottom: 42px;
  }
  .flow-node-add-session {
    position: absolute; right: 8px; top: 7px;
    width: 22px; height: 22px; border-radius: 4px;
    border: 1px solid rgba(88,166,255,0.32);
    background: rgba(88,166,255,0.10);
    color: var(--accent); cursor: pointer; line-height: 1;
    font-size: 15px; font-weight: 700;
  }
  .flow-node-add-session:hover {
    background: rgba(88,166,255,0.20);
    border-color: rgba(88,166,255,0.58);
  }
  .flow-node-object .flow-node-add-session { right: 34px; }
  .flow-node-collapse {
    position: absolute; right: 34px; top: 7px;
    width: 22px; height: 22px; border-radius: 4px;
    border: 1px solid rgba(139,148,158,0.28);
    background: rgba(139,148,158,0.10);
    color: var(--text-muted); cursor: pointer; line-height: 1;
    font-size: 12px; font-weight: 700;
  }
  .flow-node-collapse:hover {
    color: var(--text);
    background: rgba(139,148,158,0.18);
    border-color: rgba(139,148,158,0.48);
  }
  .flow-node-object .flow-node-collapse { right: 60px; }
  .flow-node-archive {
    position: absolute; right: 8px; top: 7px;
    width: 22px; height: 22px; border-radius: 4px;
    border: 1px solid rgba(139,148,158,0.24);
    background: rgba(139,148,158,0.08);
    color: var(--text-muted); cursor: pointer; line-height: 1;
    font-size: 12px; opacity: 0;
  }
  .flow-node:hover .flow-node-archive,
  .flow-node .flow-node-archive:focus-visible { opacity: 0.85; }
  .flow-node-archive:hover {
    opacity: 1; color: var(--orange);
    border-color: rgba(255,166,87,0.42);
    background: rgba(255,166,87,0.12);
  }
  .flow-node-flowpin {
    position: absolute; right: 36px; top: 7px;
    width: 22px; height: 22px; border-radius: 4px;
    border: 1px solid rgba(139,148,158,0.24);
    background: rgba(139,148,158,0.08);
    color: var(--text-muted); cursor: pointer; line-height: 1;
    font-size: 12px; opacity: 0;
  }
  .flow-node:hover .flow-node-flowpin,
  .flow-node .flow-node-flowpin:focus-visible,
  .flow-node-flowpin.is-pinned { opacity: 0.95; }
  .flow-node-flowpin:hover {
    opacity: 1; color: var(--accent);
    border-color: rgba(88,166,255,0.42);
    background: rgba(88,166,255,0.12);
  }
  .flow-node-flowpin.is-pinned {
    color: var(--accent);
    border-color: rgba(88,166,255,0.5);
    background: rgba(88,166,255,0.18);
  }
  .flow-node-delete {
    position: absolute; right: 8px; top: 7px;
    width: 20px; height: 20px; border-radius: 4px;
    border: 1px solid transparent; background: transparent;
    color: var(--text-muted); cursor: pointer; line-height: 1;
    font-size: 15px; opacity: 0;
  }
  .flow-node:hover .flow-node-delete { opacity: 0.8; }
  .flow-node-delete:hover {
    color: var(--red); border-color: rgba(248,81,73,0.35);
    background: rgba(248,81,73,0.10);
  }
  .flow-node-session.is-working,
  .flow-node-session.is-live { border-left-color: var(--green); }
  .flow-node-session.is-waiting { border-left-color: #f2cc60; }
  .flow-node-session.is-review { border-left-color: var(--cyan); }
  .flow-node-session.is-testing { border-left-color: var(--orange); }
  .flow-node-session.is-attention { border-left-color: var(--red); }
  .flow-node-session.is-icebox { border-left-color: var(--purple); }
  .flow-node-session.is-verified { border-left-color: var(--green); }
  .flow-node-session.is-pushed,
  .flow-node-session.is-committed { border-left-color: var(--cyan); }
  .flow-node-session.is-uncommitted { border-left-color: var(--orange); }
  .flow-node-session.is-failed { border-left-color: var(--red); }
  .flow-node-session.is-read-only,
  .flow-node-session.is-idle { border-left-color: var(--accent); }
  .flow-node-chips {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 6px;
  }
  .flow-chip {
    display: inline-flex; align-items: center;
    font-size: 10px; line-height: 1; letter-spacing: 0.02em;
    padding: 3px 6px; border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2, var(--text));
    white-space: nowrap;
  }
  .flow-chip.working {
    background: rgba(242, 204, 96, 0.18);
    color: #f2cc60; border-color: rgba(242, 204, 96, 0.45);
    animation: ccc-flow-chip-pulse 1.6s ease-in-out infinite;
  }
  .flow-chip.waiting {
    background: rgba(80, 200, 220, 0.15);
    color: var(--cyan); border-color: rgba(80, 200, 220, 0.4);
  }
  .flow-chip.uncommitted { color: var(--orange); border-color: rgba(255, 165, 0, 0.45); }
  .flow-chip.pushed      { color: var(--cyan);   border-color: rgba(80, 200, 220, 0.4); }
  .flow-chip.committed   { color: var(--cyan);   border-color: rgba(80, 200, 220, 0.4); }
  .flow-chip.pr-open     { color: var(--cyan);   border-color: rgba(80, 200, 220, 0.4); }
  .flow-chip.pr-merged   { color: var(--purple); border-color: rgba(168, 102, 232, 0.45); }
  .flow-chip.pr-closed   { color: var(--text-2); }
  .flow-chip.counter     { color: var(--text-2); }
  .flow-chip.working.steady { animation: none; }
  .flow-chip.stuck   { background: rgba(230, 160, 60, 0.16); color: #e0a83c; border-color: rgba(230, 160, 60, 0.45); }
  .flow-chip.idle    { color: var(--text-2); }
  .flow-chip.offline { background: rgba(220, 80, 80, 0.15); color: #e06c6c; border-color: rgba(220, 80, 80, 0.45); }
  .conv-codex-state {
    /* Overall status follows the latest message in normal transcript flow. */
    position: relative; margin-top: 10px; margin-bottom: 10px;
    display: flex; width: fit-content; margin-left: auto; margin-right: 12px;
    align-items: center; gap: 6px;
    font-size: 11px; line-height: 1; padding: 4px 10px;
    border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text-2);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  }
  .conv-codex-state .ccs-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  .conv-codex-state.state-working { color: var(--text); }
  .conv-codex-state.state-working .ccs-dot {
    background: var(--orange);
    animation: ccc-flow-chip-pulse 1.6s ease-in-out infinite;
  }
  .conv-codex-state.state-working.steady .ccs-dot { animation: none; }
  .conv-codex-state.state-stuck   { color: #e0a83c; }
  /* Stuck pill carries the "why" reason on its own wrapped line so the badge
     answers "do we know why it was stuck?" without a hover. */
  .conv-codex-state.state-stuck { flex-wrap: wrap; max-width: min(360px, 78%); }
  .conv-codex-state .ccs-reason {
    flex-basis: 100%; margin-top: 2px;
    font-size: 10.5px; font-weight: 400; line-height: 1.35;
    color: var(--text-2); white-space: normal;
  }
  /* Elapsed WIP time inside the state pill ("Working · 12s"). */
  .conv-codex-state .ccs-age {
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
  }
  .conv-codex-state .ccs-age::before {
    content: '· ';
    opacity: 0.6;
  }
  .conv-codex-state.state-working .ccs-age { opacity: 1; }
  /* One-click wake: a stuck/idle pill becomes a button that nudges GPT. */
  .conv-codex-state.is-wakeable { cursor: pointer; }
  .conv-codex-state.is-wakeable:hover { border-color: currentColor; filter: brightness(1.12); }
  .conv-codex-state.is-wakeable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .conv-codex-state .ccs-wake { margin-left: 2px; font-size: 12px; opacity: 0.85; }
  .conv-codex-state.is-waking { opacity: 0.7; }
  .conv-codex-state.is-waking .ccs-wake { animation: ccc-spin 0.8s linear infinite; }
  @keyframes ccc-spin { to { transform: rotate(360deg); } }
  .conv-codex-state.state-idle    { color: var(--text-2); }
  .conv-codex-state.state-offline { color: #e06c6c; }
  @keyframes ccc-flow-chip-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
  }
  /* Archived sessions: muted colors + check badge.
     IMPORTANT: keep the node fully opaque so connector lines (z-index 0)
     stay hidden BEHIND the node. Using opacity on the node lets the lines
     bleed through, which reads as "lines are in front of sessions". */
  .flow-node-session.is-archived {
    border-left-color: var(--green) !important;
    background: color-mix(in srgb, var(--surface) 80%, var(--green) 20%);
    color: color-mix(in srgb, var(--text) 70%, transparent);
  }
  .flow-node-session.is-archived .flow-node-title,
  .flow-node-session.is-archived .flow-node-meta,
  .flow-node-session.is-archived .flow-node-kicker {
    color: color-mix(in srgb, var(--text) 72%, transparent);
  }
  .flow-node-session.is-archived::before {
    content: "\2713";
    position: absolute;
    top: 6px; right: 8px;
    width: 16px; height: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    color: var(--green);
    background: var(--surface);
    border: 1px solid var(--green);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
  }
  .flow-node-session.is-worktree::after {
    content: 'worktree'; position: absolute; right: 34px; top: 8px;
    font-size: 10px; font-weight: 700; color: var(--orange);
    background: rgba(210,153,34,0.14); border: 1px solid rgba(210,153,34,0.32);
    border-radius: 4px; padding: 1px 5px;
  }
  .flow-node-draft .flow-node-delete {
    opacity: 0.65;
  }
  .flow-draft-input {
    width: 100%; box-sizing: border-box;
    border: 1px solid var(--border); border-radius: 4px;
    background: var(--bg); color: var(--text);
    font: inherit; font-size: 13px; line-height: 1.3;
    padding: 7px 8px; outline: none;
  }
  .flow-draft-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88,166,255,0.16);
  }
  .flow-draft-play {
    position: absolute; right: 10px; bottom: 9px;
    width: 28px; height: 26px; border-radius: 5px;
    border: 1px solid rgba(63,185,80,0.42);
    background: rgba(63,185,80,0.14);
    color: var(--green); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1;
  }
  .flow-draft-play:hover {
    background: rgba(63,185,80,0.24);
    border-color: rgba(63,185,80,0.65);
  }
  .flow-node-kicker {
    color: var(--text-muted); font-size: 10px; font-weight: 700;
    line-height: 1.2; text-transform: uppercase; letter-spacing: 0;
    margin-bottom: 5px; padding-right: 66px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .flow-node-repo .flow-node-kicker { padding-right: 66px; }
  .flow-node-object .flow-node-kicker { padding-right: 92px; }
  .flow-node-title {
    color: var(--text); font-size: 13px; font-weight: 600;
    line-height: 1.3; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .flow-node-meta {
    margin-top: 6px; color: var(--text-muted); font-size: 11px;
    line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* Inverse-scale node text so it stays readable when the canvas is
     zoomed out. .flow-world applies transform: scale(--flow-zoom) to
     EVERYTHING — text would shrink linearly with zoom and become
     unreadable below ~70%. Counter that: compute font-size as
     base/zoom so the on-screen pixel size stays near the base. Capped
     at the original size when zoom>=1 (no need to inflate). Capped at
     a max of 2× so very-low zooms don't make text comically huge.
     Only applies to .flow-node-title / .flow-node-meta — kicker
     stays small because it's a label, not body content. */
  .flow-canvas .flow-node-title {
    font-size: clamp(13px, calc(13px / var(--flow-zoom, 1)), 26px);
  }
  .flow-canvas .flow-node-meta {
    font-size: clamp(11px, calc(11px / var(--flow-zoom, 1)), 22px);
  }
  .flow-canvas .flow-node-kicker {
    font-size: clamp(10px, calc(10px / var(--flow-zoom, 1)), 18px);
  }
  .flow-workitem-chips {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 7px;
  }
  .flow-workitem-chip {
    display: inline-flex; align-items: center;
    max-width: 100%;
    border: 1px solid color-mix(in srgb, var(--flow-accent) 45%, var(--border));
    border-radius: 4px;
    background: color-mix(in srgb, var(--flow-accent) 14%, transparent);
    color: var(--text);
    font-size: 10px; font-weight: 650; line-height: 1;
    padding: 3px 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .flow-workitem-chip.status { color: var(--flow-accent); }
  .flow-workitem-goal {
    margin-top: 7px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .flow-inspector {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
  }
  .flow-inspector-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .flow-inspector-kicker {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 5px;
  }
  .flow-inspector-header h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
  }
  .flow-inspector-subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .flow-inspector-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }
  .flow-inspector-chip {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
  }
  .flow-inspector-chip.status {
    color: var(--accent);
    border-color: rgba(88,166,255,0.38);
    background: rgba(88,166,255,0.10);
  }
  .flow-inspector-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .flow-inspector-tab,
  .flow-inspector-btn {
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
    line-height: 1;
    padding: 6px 9px;
    cursor: pointer;
  }
  .flow-inspector-tab:hover,
  .flow-inspector-btn:hover { background: var(--surface-2); }
  .flow-inspector-tab.active {
    color: var(--accent);
    border-color: rgba(88,166,255,0.44);
    background: rgba(88,166,255,0.12);
  }
  .flow-inspector-status {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 12px;
  }
  .flow-inspector-status.ok { color: var(--green); }
  .flow-inspector-status.error { color: var(--red); }
  .flow-inspector-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 22px 26px 32px;
  }
  .flow-inspector-rendered {
    max-width: 860px;
    line-height: 1.58;
  }
  .flow-inspector-editor {
    width: min(100%, 920px);
    min-height: calc(100vh - 260px);
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    padding: 14px 16px;
    font: 13px/1.55 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    outline: none;
    resize: vertical;
  }
  .flow-inspector-editor:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88,166,255,0.16);
  }
  .kanban-column {
    min-width: 260px; flex: 1;
    display: flex; flex-direction: column; min-height: 0;
  }
  .kanban-board-split .kanban-column { min-width: 280px; }
  /* Subtle per-column background tints */
  .kanban-column { border-radius: 8px; padding: 4px; transition: background 0.2s; }
  /* Cards pick up a matching tint on top of their default surface */
  .kanban-column.backlog  .kanban-card { background: linear-gradient(rgba(139,148,158,0.10), rgba(139,148,158,0.10)), var(--surface); }
  .kanban-column.needs-attention .kanban-card { background: linear-gradient(rgba(248,81,73,0.16), rgba(248,81,73,0.16)), var(--surface); }
  .kanban-org-header {
    font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--text-muted); padding: 6px 4px 2px; margin-top: 4px;
    border-top: 1px solid var(--border);
  }
  .kanban-cards > .kanban-org-header:first-child { border-top: 0; margin-top: 0; padding-top: 2px; }
  .kanban-column.icebox   .kanban-card { background: linear-gradient(rgba(188,140,255,0.14), rgba(188,140,255,0.14)), var(--surface); }
  .kanban-column.working  .kanban-card { background: linear-gradient(rgba(210,153,34,0.16), rgba(210,153,34,0.16)), var(--surface); }
  .kanban-column.review   .kanban-card { background: linear-gradient(rgba(57,210,192,0.14), rgba(57,210,192,0.14)), var(--surface); }
  .kanban-column.testing  .kanban-card { background: linear-gradient(rgba(251,202,4,0.14), rgba(251,202,4,0.14)), var(--surface); }
  .kanban-column.verified .kanban-card { background: linear-gradient(rgba(63,185,80,0.16), rgba(63,185,80,0.16)), var(--surface); }
  .kanban-column.archived .kanban-card { background: linear-gradient(rgba(139,148,158,0.04), rgba(139,148,158,0.04)), var(--surface); }
  .kanban-column-header { cursor: grab; }
  .kanban-column-header.dragging-header { opacity: 0.5; }
  .kanban-column-header.drop-target-header { background: rgba(88,166,255,0.18); outline: 1px dashed var(--accent); }
  .kanban-column-header {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px; cursor: pointer; user-select: none;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    color: var(--text-muted); border-radius: 4px;
    transition: background 0.15s;
  }
  .kanban-column-header:hover { background: var(--surface-2); }
  .kanban-column-header .arrow { font-size: 10px; transition: transform 0.2s; }
  .kanban-column-header.collapsed .arrow { transform: rotate(-90deg); }
  .kanban-column-header .count {
    font-size: 10px; padding: 1px 6px; border-radius: 10px;
    background: var(--border); color: var(--text-muted);
    font-weight: 700;
  }
  /* Column-specific header colors */
  .kanban-column.blocked .kanban-column-header { color: var(--red); }
  .kanban-column.blocked .count { background: rgba(248,81,73,0.2); color: var(--red); }
  .kanban-column.working .kanban-column-header { color: #FBCA04; }
  .kanban-column.working .count { background: rgba(251,202,4,0.2); color: #FBCA04; }
  .kanban-column.needs-attention .kanban-column-header { color: var(--red); }
  .kanban-column.needs-attention .count { background: rgba(248,81,73,0.2); color: var(--red); }
  .kanban-column.waiting .kanban-column-header { color: var(--accent); }
  .kanban-column.waiting .count { background: rgba(88,166,255,0.15); color: var(--accent); }
  .kanban-column.idle .kanban-column-header { color: var(--text-muted); }
  .kanban-column.icebox   .kanban-column-header { color: var(--purple); }
  .kanban-column.icebox   .count { background: rgba(188,140,255,0.2); color: var(--purple); }
  .kanban-column.coding .kanban-column-header { color: var(--orange); }
  .kanban-column.coding .count { background: rgba(210,153,34,0.2); color: var(--orange); }
  .kanban-column.review .kanban-column-header { color: var(--cyan); }
  .kanban-column.review .count { background: rgba(57,210,192,0.2); color: var(--cyan); }
  .kanban-column.backlog .kanban-column-header { color: var(--text-muted); }
  .kanban-column.backlog .count { background: rgba(139,148,158,0.15); color: var(--text-muted); }
  .kanban-column.testing .kanban-column-header { color: #FBCA04; }
  .kanban-column.testing .count { background: rgba(251,202,4,0.2); color: #FBCA04; }
  .kanban-column.archived .kanban-column-header { color: var(--text-muted); opacity: 0.6; }
  .kanban-column.archived .count { background: rgba(139,148,158,0.1); color: var(--text-muted); }
  .kanban-column.verified .kanban-column-header { color: var(--green); }
  .kanban-column.verified .count { background: rgba(63,185,80,0.2); color: var(--green); }

  /* Animated glow on Working column cards. The glow lives on a pseudo-element
     with a STATIC box-shadow; only its opacity animates, which WebKit
     composites on the GPU. Animating box-shadow/border-color directly (the
     old keyframe) forced a CPU repaint every frame per active card. */
  @keyframes working-glow {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 1; }
  }
  .kanban-card.truly-active {
    position: relative;
    border: 1px solid rgba(251,202,4,0.7) !important;
  }
  .kanban-card.truly-active::after {
    content: ''; position: absolute; inset: -1px;
    border-radius: inherit;
    box-shadow: 0 0 18px rgba(251,202,4,0.55);
    animation: working-glow 1.6s ease-in-out infinite;
    will-change: opacity;
    pointer-events: none;
  }
  /* Pending (optimistic placeholder while /api/sessions/spawn is in flight)
     and recently-born (the real session that replaced it, or any session
     that first appeared during a live poll) share one shimmer style so the
     visual state is continuous across the swap. Only the iteration count
     differs: pending shimmers forever until the placeholder is replaced;
     recently-born stops itself after ~28s via the bounded count. */
  .kanban-card.pending-spawn,
  .kanban-card.recently-born:not(.pending-spawn) {
    border: 1px dashed rgba(88,166,255,0.6) !important;
    background: linear-gradient(90deg, var(--surface) 0%, rgba(88,166,255,0.08) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: pending-shimmer 1.4s linear infinite;
    position: relative;
  }
  .kanban-card.recently-born:not(.pending-spawn) {
    /* Bounded iteration count — shimmer stops itself after ~28s and the
       `.recently-born` class comes off on the next render via isRecentlyBorn. */
    animation-iteration-count: 20;
  }
  .kanban-card.pending-spawn .kanban-card-title::after {
    content: ' · spawning...';
    font-weight: 400; color: var(--accent); font-size: 11px;
  }
  .kanban-card.spawn-failed {
    border: 1px dashed rgba(248, 81, 73, 0.6) !important;
    background: rgba(248, 81, 73, 0.08);
  }
  .kanban-card.spawn-failed .kanban-card-title::after {
    content: ' · failed';
    font-weight: 400; color: var(--red); font-size: 11px;
  }
  @keyframes pending-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .kanban-cards {
    padding: 4px 0; overflow-y: auto; flex: 1; min-height: 0;
  }
  .kanban-column.collapsed .kanban-cards { display: none; }
  .kanban-column.collapsed { flex: 0; min-width: auto; }

  .kanban-card {
    padding: 10px 12px; margin-bottom: 6px; border-radius: 6px;
    background: var(--surface); border: 1px solid var(--border);
    cursor: pointer;
    /* Soft transitions so column/state changes feel continuous rather than
       snap-to. .just-moved handles the big flash when a card actually changes
       column; these cover the subtler per-field shifts. */
    transition: border-color 0.15s, background-color 0.25s, box-shadow 0.25s;
  }
  /* Fade-in when a card appears for the first time (placeholder swap, a new
     session showing up mid-session, or a freshly-loaded board). Paired with
     the JS that only stamps this class on inserts, not re-renders. */
  @keyframes card-enter {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .kanban-card.card-enter { animation: card-enter 0.22s ease-out; }
  .kanban-card:hover { border-color: var(--text-muted); }
  .kanban-card.active { border-color: var(--accent); }
  .kanban-card .kanban-card-title {
    font-size: 13px; font-weight: 500; color: var(--text);
    line-height: 1.35; word-break: break-word;
    /* No right-padding — titles fill the full card width. The action-icon
       cluster is opacity:0 by default and only fades in on :hover, so a
       permanent gutter for it wasted card real estate. On hover the icons
       float over the title's right edge with their own bg, which reads as
       a normal floating-button pattern (Notion / GitHub / etc.). */
    padding-right: 0;
  }
  /* State badges (GH #NNN, open/closed, needs-attention, Desktop) live on
     their own row above the title so the title can use the full card width. */
  .kanban-card .kanban-card-badges {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 4px 0; margin-bottom: 4px;
    padding-right: 0;
  }
  .kanban-card .kanban-card-desc {
    font-size: 12px; color: var(--text-muted);
    line-height: 1.4; margin-top: 4px; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* See `.conv-item .conv-title.user-renamed` above — same reasoning,
     applied to the kanban-card view so the two surfaces stay consistent. */
  .kanban-card .kanban-card-title.user-renamed { color: inherit; }
  .kanban-card .kanban-card-actions {
    display: flex; gap: 4px; position: absolute; top: 6px; right: 6px; opacity: 0;
    transition: opacity 0.15s;
  }
  .kanban-card { position: relative; cursor: grab; }
  .kanban-card.dragging { opacity: 0.4; cursor: grabbing; }
  .kanban-card.selected {
    box-shadow: 0 0 0 2px var(--accent) !important;
    background: rgba(88,166,255,0.08) !important;
  }
  .kanban-column.drag-over { background: rgba(88,166,255,0.08); outline: 2px dashed var(--accent); outline-offset: -2px; }
  .kanban-card.drop-link-target { outline: 2px dashed var(--green); outline-offset: 2px; }
  @keyframes cardJustMoved {
    0%   { box-shadow: 0 0 0 0 rgba(88,166,255,0.0); background-color: rgba(88,166,255,0.28); }
    40%  { box-shadow: 0 0 18px 4px rgba(88,166,255,0.55); background-color: rgba(88,166,255,0.18); }
    100% { box-shadow: 0 0 0 0 rgba(88,166,255,0.0); background-color: inherit; }
  }
  .kanban-card.just-moved { animation: cardJustMoved 2.2s ease-out; }
  /* Spawning feedback on a backlog card while a new session is being created. */
  .kanban-card.spawning {
    pointer-events: none;
    opacity: 0.55;
    animation: spawnPulse 1.4s ease-in-out infinite;
    position: relative;
  }
  .kanban-card.spawning::after {
    content: 'Spawning…';
    position: absolute; top: 8px; right: 10px;
    font-size: 11px; font-weight: 600;
    color: var(--accent);
    background: rgba(88,166,255,0.15);
    border: 1px solid rgba(88,166,255,0.4);
    border-radius: 4px;
    padding: 2px 8px;
    letter-spacing: 0.3px;
  }
  @keyframes spawnPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.85; }
  }
  .kanban-card:hover .kanban-card-actions { opacity: 1; }
  .kanban-card .kanban-action-btn {
    width: 22px; height: 22px; border-radius: 3px; border: none;
    background: var(--bg); color: var(--text-muted); cursor: pointer;
    font-size: 12px; display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s;
  }
  .kanban-card .kanban-action-btn:hover { color: var(--text); background: var(--border); }
  .kanban-card .kanban-action-btn.is-wake { color: var(--red); }
  .kanban-card .kanban-action-btn.is-wake:hover { background: rgba(248,81,73,0.12); }
  .kanban-card .kanban-card-meta {
    font-size: 11px; color: var(--text-muted); margin-top: 3px;
  }
  .kanban-card .kanban-card-interacted {
    font-size: 10px; color: var(--text-muted); opacity: 0.7;
    margin-top: 2px; font-style: italic;
  }
  .kanban-card .kanban-card-stage {
    display: inline-block; margin-top: 4px;
    font-size: 10px; padding: 1px 6px; border-radius: 3px;
    font-weight: 600;
  }
  .kanban-card .kanban-card-stage.stage { background: rgba(188,140,255,0.15); color: var(--purple); }
  .kanban-card .kanban-card-stage.committed { background: rgba(63,185,80,0.15); color: var(--green); }
  .kanban-card .kanban-card-stage.testing { background: rgba(251,202,4,0.15); color: #FBCA04; }
  .kanban-card .kanban-card-stage.read-only { background: rgba(139,148,158,0.12); color: var(--text-muted); margin-left: 4px; }
  .kanban-issue-badge {
    display: inline-block; font-size: 11px; padding: 1px 6px;
    border-radius: 3px; margin-right: 6px; font-weight: 600;
    background: rgba(63,185,80,0.18); color: var(--green);
    vertical-align: middle; letter-spacing: 0.3px;
  }
  /* Inline GH-issue reference inside a title — used when the AI title
     preserves a "#NNN" but the card itself isn't linked to a GH issue
     in metadata. Subtler than the badge; just gives the number signal. */
  .kanban-issue-ref {
    color: var(--green);
    font-weight: 600;
    font-size: 0.95em;
    white-space: nowrap;
  }
  .kanban-gh-state {
    display: inline-block; font-size: 10px; padding: 1px 6px;
    border-radius: 3px; margin-right: 6px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle;
  }
  .kanban-gh-state.gh-open {
    background: rgba(63,185,80,0.18); color: var(--green);
  }
  .kanban-gh-state.gh-closed {
    background: rgba(188,140,255,0.18); color: var(--purple);
  }
  .kanban-gh-wip {
    display: inline-block; font-size: 10px; padding: 1px 6px;
    border-radius: 3px; margin-right: 6px; font-weight: 700;
    background: rgba(251,202,4,0.22); color: #FBCA04;
    text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle;
  }
  .kanban-desktop-badge {
    display: inline-block; font-size: 10px; padding: 1px 6px;
    border-radius: 3px; margin-right: 6px; font-weight: 700;
    background: rgba(188,140,255,0.18); color: var(--purple);
    text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle;
  }
  .kanban-na-chip {
    display: inline-block; font-size: 10px; padding: 1px 6px;
    border-radius: 3px; margin-right: 6px; font-weight: 700;
    background: rgba(248,81,73,0.2); color: var(--red);
    text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle;
  }
  /* Needs-approval badge — Notification hook signal. Sits above the title
     on cards parked in the Waiting column. Pulses gently to draw the eye. */
  .kanban-needs-approval-badge {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700;
    padding: 4px 8px; margin-bottom: 6px;
    border-radius: 4px;
    background: rgba(88,166,255,0.18); color: var(--accent);
    border: 1px solid rgba(88,166,255,0.35);
    animation: kanban-needs-approval-pulse 2s ease-in-out infinite;
  }
  .kanban-needs-approval-icon { font-size: 13px; line-height: 1; }
  .kanban-needs-approval-label { text-transform: uppercase; letter-spacing: 0.5px; }
  .kanban-needs-approval-msg {
    font-weight: 400; font-size: 10px; opacity: 0.85;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
  }
  .kanban-needs-approval-badge.is-question {
    color: #58a6ff;
    background: rgba(88,166,255,0.14);
    border-color: rgba(88,166,255,0.35);
  }
  @keyframes kanban-needs-approval-pulse {
    0%, 100% { background: rgba(88,166,255,0.18); }
    50%      { background: rgba(88,166,255,0.32); }
  }
  /* The GH #NNN badge on backlog cards is also a click target (opens the
     issue on GitHub). Show that affordance. */
  .kanban-card.backlog-card .kanban-issue-badge[data-action="view-issue"] {
    cursor: pointer;
  }
  .kanban-card.backlog-card .kanban-issue-badge[data-action="view-issue"]:hover {
    background: rgba(63,185,80,0.32);
  }
  .kanban-card .kanban-card-stage.pushed { background: rgba(57,210,192,0.15); color: var(--cyan); }
  .kanban-show-all {
    padding: 6px 12px; font-size: 11px; color: var(--accent);
    cursor: pointer; text-align: center;
  }
  .kanban-show-all:hover { text-decoration: underline; }

  /* ── Split Kanban Layout (Tasks 6-9) ── */
  #kanbanLayout {
    /* Topbar was merged into #convToolbar (no longer a separate fixed row),
       so the body has no padding-top — kanban can take the full viewport. */
    display: none; height: 100vh; overflow: hidden;
  }
  #kanbanLayout.active { display: flex; }
  body.kanban-split .sidebar { display: none !important; }
  body.kanban-split #sidebarResizer { display: none !important; }
  body.kanban-split .main { display: none !important; }

  .kanban-panel {
    flex: 3; display: flex; flex-direction: column;
    background: var(--surface); overflow: hidden; min-width: 400px;
    border-right: 1px solid var(--border);
  }
  .kanban-panel-toolbar {
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    background: var(--surface);
  }
  .kanban-panel-toolbar input[type="text"] {
    padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 12px; outline: none;
  }
  .kanban-panel-toolbar .kpt-search { width: 180px; }
  .kanban-panel-toolbar .kpt-new-session { flex: 0 1 260px; min-width: 120px; }
  .hide-descs .kanban-card-desc { display: none !important; }
  .kanban-panel-toolbar button {
    padding: 5px 10px; font-size: 12px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    cursor: pointer; white-space: nowrap;
  }
  .kanban-panel-toolbar button:hover { background: var(--surface-2); }
  .kanban-panel-toolbar button.active { color: var(--accent); border-color: rgba(88,166,255,0.4); }
  .kanban-panel-toolbar .kpt-label {
    font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; cursor: pointer;
  }
  .kanban-panel .kanban-board-split {
    display: flex; gap: 12px; padding: 12px;
    flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden;
  }
  .nsm-overlay { position: fixed; inset: 0; z-index: 9999; display: flex;
    align-items: center; justify-content: center; }
  .nsm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px); }
  .nsm-dialog { position: relative; width: min(900px, 80vw);
    max-height: 85vh; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
  .nsm-header { display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
  .nsm-header span:first-child { font-size: 16px; color: var(--text); font-weight: 600; }
  .nsm-hint { font-size: 11px; }
  #nsmBody { font-size: 15px; padding: 14px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px; color: var(--text);
    outline: none; min-height: 320px; resize: vertical; font-family: inherit;
    line-height: 1.5; }
  #nsmBody:focus { border-color: var(--accent); }
  .nsm-actions { display: flex; gap: 8px; align-items: center; }
  .nsm-pkood { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; cursor: pointer; }
  .nsm-btn { padding: 8px 16px; font-size: 13px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    cursor: pointer; }
  .nsm-btn:hover { background: var(--surface-2); }
  .nsm-primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
  .nsm-primary:hover { opacity: 0.9; background: var(--accent); }
  .nsm-primary:disabled { opacity: 0.5; cursor: not-allowed; }

  /* Template gallery — card grid rendered above the prompt textarea when
     the modal opens with an empty body. Driven by static/templates.json.
     Cards are buttons (keyboard-focusable, click-to-fill). */
  .nsm-gallery {
    display: grid; gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    max-height: 220px; overflow-y: auto;
    padding: 2px;
  }
  .nsm-gallery-card {
    text-align: left; cursor: pointer;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 4px;
    transition: border-color 0.12s, background 0.12s;
    font-family: inherit;
  }
  .nsm-gallery-card:hover { border-color: var(--accent); background: var(--surface-2); }
  .nsm-gallery-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .nsm-gallery-card.is-selected { border-color: var(--accent); background: var(--surface-2); }
  .nsm-gallery-card-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
  .nsm-gallery-card-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
  .nsm-gallery-card-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
  .nsm-gallery-chip {
    font-size: 10px; color: var(--text-muted);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 3px; padding: 1px 6px;
  }
  .nsm-gallery-chip.is-wt { color: var(--green); }
  .new-session-template-wrap {
    width: min(760px, 100%);
    margin-top: 18px;
    text-align: left;
  }
  .new-session-template-title {
    margin: 0 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .inline-new-session-templates {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    max-height: none;
  }

  /* --- Files-from-conversation (pill + modal) ----------------------- */
  /* Pill lives inside the sticky header's fixed-height activity column; only
     rendered when count > 0. Keeping it inside .csh-row avoids changing the
     sticky header's outer height after the async files request resolves. */
  .ffc-pill {
    display: none !important;
  }
  .conv-sticky-header .csh-col-activity > .ffc-pill {
    flex: 0 0 auto;
    align-self: flex-start;
  }
  .ffc-pill:hover { border-color: var(--accent, #58a6ff); color: var(--accent, #58a6ff); }
  .ffc-pill[hidden] { display: none !important; }
  .ffc-pill-count { opacity: 0.7; }

  /* Modal — modeled on .nsm- pattern. */
  .ffc-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
  }
  .ffc-overlay[hidden] { display: none !important; }
  .ffc-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  }
  .ffc-dialog {
    position: relative;
    background: var(--surface, #0d1117);
    border: 1px solid var(--border, #30363d);
    border-radius: 8px;
    width: min(640px, 92vw);
    max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 16px 64px rgba(0,0,0,0.5);
  }
  .ffc-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #30363d);
  }
  .ffc-title { font-size: 14px; font-weight: 600; color: var(--text, #c9d1d9); }
  .ffc-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted, #8b949e); font-size: 18px; line-height: 1;
    padding: 4px 8px; border-radius: 4px;
  }
  .ffc-close:hover { background: var(--surface-2, #161b22); color: var(--text, #c9d1d9); }
  .ffc-body {
    overflow-y: auto; padding: 8px 16px 16px;
  }
  .ffc-section { margin-top: 12px; }
  .ffc-section:first-child { margin-top: 0; }
  .ffc-section-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted, #8b949e); margin-bottom: 6px;
  }
  .ffc-row {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 10px; border-radius: 6px;
    cursor: pointer;
  }
  .ffc-row:hover { background: var(--surface-2, #161b22); }
  .ffc-row-label {
    display: flex; align-items: center; gap: 8px;
    color: var(--text, #c9d1d9); font-size: 13px;
  }
  .ffc-row-icon { width: 18px; text-align: center; }
  .ffc-row-target {
    color: var(--text-muted, #8b949e); font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
    cursor: copy;
  }
  .ffc-row-target:hover { color: var(--text, #c9d1d9); }
  .ffc-row-toast {
    color: #f85149; font-size: 11px; margin-top: 2px;
  }
  .ffc-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border, #30363d);
    color: var(--text-muted, #8b949e); font-size: 11px;
  }
  .ffc-empty {
    color: var(--text-muted, #8b949e); padding: 16px; text-align: center;
  }

  /* ── In-app update pill + modal ──────────────────────────────────
     Subtle "Update available" pill that appears in the topbar when
     the local __version__ is behind GitHub's latest release tag.
     Clicking the pill opens the .upd-overlay modal. */
  .upd-pill {
    display: none; align-items: center; gap: 6px;
    padding: 3px 10px; margin-left: 8px;
    background: rgba(88,166,255,0.12); color: var(--accent);
    border: 1px solid rgba(88,166,255,0.35); border-radius: 999px;
    font-size: 11px; font-weight: 600; cursor: pointer;
    letter-spacing: 0.2px; white-space: nowrap;
    transition: background 0.12s ease-out;
  }
  .upd-pill.visible { display: inline-flex; }
  .upd-pill:hover { background: rgba(88,166,255,0.22); }
  /* Danger variant — inject circuit breaker trips. Same shape as the update
     pill but red, so a runaway-inject block reads as urgent, not routine. */
  .upd-pill-danger {
    background: rgba(248,81,73,0.14); color: #f85149;
    border-color: rgba(248,81,73,0.45);
  }
  .upd-pill-danger:hover { background: rgba(248,81,73,0.24); }
  .upd-pill-danger .upd-pill-dot { background: #f85149; box-shadow: 0 0 0 0 rgba(248,81,73,0.4); }
  .upd-pill .upd-pill-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 0 rgba(88,166,255,0.4);
    animation: upd-arrive 700ms ease-out 2;
  }
  @keyframes upd-arrive {
    0%   { transform: scale(0.75); opacity: 0.55; }
    70%  { transform: scale(1.35); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .upd-pill .upd-pill-dot { animation: none; }
  }
  .upd-overlay { position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center; }
  .upd-overlay.open { display: flex; }
  .upd-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px); }
  .upd-dialog { position: relative; width: min(500px, 92vw);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 20px;
    display: flex; flex-direction: column; gap: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
  .upd-title { font-size: 16px; font-weight: 600; color: var(--text); }
  .upd-versions { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
  .upd-versions strong { color: var(--text); font-weight: 600; }
  .upd-compare-link { font-size: 12px; color: var(--accent); text-decoration: none; }
  .upd-compare-link:hover { text-decoration: underline; }
  .upd-warning { font-size: 11px; color: var(--text-muted);
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 8px 10px; line-height: 1.5; }
  .upd-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
  .upd-btn { padding: 8px 16px; font-size: 13px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    cursor: pointer; font-family: inherit; }
  .upd-btn:hover { background: var(--surface-2); }
  .upd-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .upd-btn.is-saving { cursor: wait; position: relative; color: transparent; }
  .upd-btn.is-saving::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 12px; height: 12px; margin: -6px 0 0 -6px;
    border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
    border-top-color: #fff; border-radius: 50%;
    animation: fq-scope-spin 0.7s linear infinite;
  }
  .upd-primary { background: var(--accent); color: #fff;
    border-color: var(--accent); font-weight: 600; }
  .upd-primary:hover { opacity: 0.9; background: var(--accent); }
  .upd-error { font-size: 12px; color: var(--red);
    background: rgba(248,81,73,0.1); border: 1px solid rgba(248,81,73,0.3);
    border-radius: 6px; padding: 8px 10px; display: none;
    white-space: pre-wrap; word-break: break-word; }
  .upd-error.visible { display: block; }

  /* ── Agent config access (static/config-consent.js) ─────── */
  .cfgc-dialog { width: min(760px, 94vw); max-height: 88vh; overflow: hidden; }
  .cfgc-intro { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }
  .cfgc-intro code, .cfgc-files code { font-size: 11px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
  .cfgc-body { overflow-y: auto; min-height: 0; flex: 1 1 auto;
    display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
  .cfgc-sec-title { font-size: 12px; font-weight: 600; color: var(--text);
    text-transform: uppercase; letter-spacing: 0.4px; }
  .cfgc-sec-note { font-size: 12px; color: var(--text-muted); margin: 2px 0 6px; }
  .cfgc-section { display: flex; flex-direction: column; gap: 8px; }
  .cfgc-item { border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); padding: 10px 12px;
    display: flex; flex-direction: column; gap: 6px; }
  .cfgc-item.cfgc-focus { border-color: var(--accent); }
  .cfgc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .cfgc-name { font-size: 13px; font-weight: 600; color: var(--text); }
  .cfgc-badge { font-size: 10px; padding: 1px 7px; border-radius: 9px;
    border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
  .cfgc-badge-new, .cfgc-badge-changed { color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
  .cfgc-badge-on { color: #3fb950; border-color: rgba(63,185,80,0.45); }
  .cfgc-choices { margin-left: auto; display: inline-flex; gap: 12px; }
  .cfgc-choice { font-size: 12px; color: var(--text); display: inline-flex;
    align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
  .cfgc-summary, .cfgc-depends, .cfgc-note, .cfgc-muted { font-size: 12px;
    line-height: 1.5; color: var(--text-muted); }
  .cfgc-depends strong { color: var(--text); font-weight: 600; }
  .cfgc-note { color: var(--text); }
  .cfgc-files { display: flex; flex-wrap: wrap; gap: 4px; }
  .cfgc-err { font-size: 12px; color: var(--red); }
  .cfgc-details summary { font-size: 12px; color: var(--accent); cursor: pointer; }
  .cfgc-diff { margin: 6px 0 0; max-height: 260px; overflow: auto;
    font-size: 11px; line-height: 1.45; padding: 8px; border-radius: 6px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-muted); white-space: pre; }
  .cfgc-d-add { color: #3fb950; }
  .cfgc-d-del { color: #f85149; }
  .cfgc-d-hunk { color: var(--accent); }
  .cfgc-d-file { color: var(--text); font-weight: 600; }
  .cfgc-brief { font-size: 13px; color: var(--text); line-height: 1.55; }
  .cfgc-compact { width: min(440px, 94vw); }
  .cfgc-compact .cfgc-intro, .cfgc-compact .cfgc-body, .cfgc-compact .cfgc-revoke-all { display: none; }
  .cfgc-dialog:not(.cfgc-compact) .cfgc-brief { display: none; }
  .cfgc-details-btn { margin-right: auto; background: none; border-color: transparent;
    color: var(--accent); padding-left: 0; }
  .cfgc-actions { align-items: center; flex-wrap: wrap; }
  .cfgc-spacer { flex: 1 1 auto; }
  .cfgc-revoke-all { color: #f85149; }

  /* ── Share Command Center modal ─────── */
  .share-ccc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .share-ccc-row { display: flex; gap: 8px; }
  .share-ccc-btn { flex: 1 1 0; display: flex; align-items: center;
    justify-content: center; gap: 6px; text-decoration: none; }

  /* ── Update-modal "What's in this update" promo section ─────── */
  .upd-promo { border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; background: var(--bg); }
  .upd-promo-heading { font-size: 12px; font-weight: 600; color: var(--text);
    margin-bottom: 8px; }
  .upd-promo-item { display: flex; align-items: baseline; gap: 8px;
    font-size: 12px; padding: 4px 0; }
  .upd-promo-item .promo-tag { font-size: 10px; padding: 1px 7px;
    border-radius: 9px; background: rgba(88,166,255,0.12);
    color: var(--accent); white-space: nowrap; }
  .upd-promo-item .promo-title { color: var(--text); font-weight: 600; }
  .upd-promo-item .promo-date { color: var(--text-muted); margin-left: auto;
    font-size: 11px; white-space: nowrap; }
  .upd-promo-more { margin-top: 8px; font-size: 12px; color: var(--accent);
    background: none; border: none; padding: 0; cursor: pointer;
    font-family: inherit; }
  .upd-promo-more:hover { text-decoration: underline; }

  /* ── System status modal ──────────────────────────────────────
     Settings → Maintenance → System status. Reuses the .upd-* shell. */
  #sysModal { z-index: 10001;  /* opened from inside Settings (9999) — must paint above it */
  }
  /* 680px, not 560: four service rows each carry a started line, a busy
     line, an explainer and a Restart button, and the WatchTower row inlines
     the queue list. The old width wrapped every head row. */
  .sys-dialog { width: min(680px, 94vw); max-height: 84vh; overflow-y: auto; }
  .sys-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 20px;
  }
  .sys-tab {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  }
  .sys-tab:hover {
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.05);
  }
  .sys-tab.active {
    background-color: var(--surface-2, #30363d);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  /* ── System Health Panel ────────────────────────────────────── */
  .sh-sec-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .6;
    margin-bottom: 8px;
    margin-top: 18px;
    color: var(--text);
  }
  .sh-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
  }
  .sh-row span {
    font-size: 12px;
    font-weight: 500;
  }
  .sh-bar {
    flex: 1 1 auto;
    height: 10px;
    border-radius: 5px;
    background: rgba(127, 127, 127, 0.18);
    overflow: hidden;
  }
  .sh-bar-fill {
    height: 100%;
    border-radius: 5px;
    background: var(--green, #2ea44f);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sh-ok { color: var(--green, #2ea44f); }
  .sh-warn { color: var(--orange, #db7812); }
  .sh-crit { color: var(--red, #d73a49); }
  .sh-fill-ok { background: var(--green, #2ea44f); }
  .sh-fill-warn { background: var(--orange, #db7812); }
  .sh-fill-crit { background: var(--red, #d73a49); }

  /* Sessions and Process Row Cards */
  .sh-sess {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .sh-sess:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
  }
  .sh-cwd { font-weight: 600; }
  .sh-sesscol {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
  }
  .sh-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46ch;
    color: var(--text);
  }
  .sh-name[data-open] { cursor: pointer; }
  .sh-name[data-open]:hover {
    color: var(--accent, #58a6ff);
    text-decoration: underline;
  }
  .sh-repo {
    font-size: 10.5px;
    font-weight: 600;
    opacity: .85;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
  }
  .sh-def {
    font-size: 12px;
    opacity: .75;
    line-height: 1.55;
    margin: 4px 0 12px;
    color: var(--text-muted);
  }
  .sh-def b { opacity: .95; color: var(--text); }
  .sh-meta {
    opacity: .75;
    font-size: 11.5px;
    color: var(--text-muted);
  }
  .sh-spacer { flex: 1 1 auto; }

  /* Pill Badges */
  .sh-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
  }
  .sh-badge.sh-ok {
    background: rgba(46, 164, 79, 0.12);
    color: var(--green, #2ea44f);
    border-color: rgba(46, 164, 79, 0.2);
  }
  .sh-badge.sh-warn {
    background: rgba(219, 120, 18, 0.12);
    color: var(--orange, #db7812);
    border-color: rgba(219, 120, 18, 0.2);
  }

  /* Reap & Quit Buttons */
  .sh-btn {
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font: 600 11px/1 ui-monospace, Menlo, monospace;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  }
  .sh-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
  }
  .sh-btn-danger {
    border-color: rgba(215, 58, 73, 0.4);
    color: var(--red, #d73a49);
  }
  .sh-btn-danger:hover {
    background: rgba(215, 58, 73, 0.15);
    border-color: var(--red, #d73a49);
    color: var(--text-primary);
  }

  /* ── System Processes (Audit & Killness Score) ───────────────────── */
  .sys-dialog.is-wide {
    width: min(880px, 95vw);
  }
  .sys-proc-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  }
  .sys-proc-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .sys-proc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .sys-proc-search {
    flex: 1;
    min-width: 220px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    color: var(--text);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: inherit;
  }
  .sys-proc-search:focus {
    outline: none;
    border-color: var(--accent, #ffd266);
  }
  .sys-proc-filter-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
  }
  .sys-proc-bulk-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .sys-proc-filter-pill {
    background: transparent;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    color: var(--text-muted);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }
  .sys-proc-filter-pill:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
  }
  .sys-proc-filter-pill.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
  }
  .sys-proc-filter-count {
    opacity: 0.7;
    font-size: 10.5px;
  }
  .sys-proc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .sys-proc-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
    border-radius: 8px;
    padding: 10px 12px;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .sys-proc-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
  }
  .sys-proc-card.score-critical {
    border-left: 3px solid #ff4d4d;
    background: rgba(255, 77, 77, 0.03);
  }
  .sys-proc-card.score-warn {
    border-left: 3px solid #f1c40f;
    background: rgba(241, 196, 15, 0.02);
  }
  .sys-proc-card.score-mod {
    border-left: 3px solid #3498db;
  }
  .sys-proc-card.score-low {
    border-left: 3px solid rgba(255, 255, 255, 0.15);
  }
  .sys-proc-score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 6px 4px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    text-align: center;
  }
  .sys-proc-score-num {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .score-critical .sys-proc-score-num { color: #ff5252; }
  .score-warn .sys-proc-score-num { color: #ffd266; }
  .score-mod .sys-proc-score-num { color: #64b5f6; }
  .score-low .sys-proc-score-num { color: var(--text-muted); }
  .sys-proc-score-denom {
    font-size: 9.5px;
    opacity: 0.5;
  }
  .sys-proc-risk-tag {
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 3px;
    text-transform: uppercase;
  }
  .score-critical .sys-proc-risk-tag { color: #ff5252; }
  .score-warn .sys-proc-risk-tag { color: #ffd266; }
  .score-mod .sys-proc-risk-tag { color: #64b5f6; }
  .score-low .sys-proc-risk-tag { color: var(--text-muted); }
  .sys-proc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .sys-proc-cmd-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .sys-proc-cmd-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }
  .sys-proc-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
  }
  .sys-proc-tag.tag-danger {
    background: rgba(255, 77, 77, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 77, 77, 0.3);
  }
  .sys-proc-tag.tag-warn {
    background: rgba(241, 196, 15, 0.15);
    color: #ffd266;
    border: 1px solid rgba(241, 196, 15, 0.3);
  }
  .sys-proc-tag.tag-subtle {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sys-proc-tag.tag-shield {
    background: rgba(88, 166, 255, 0.10);
    color: #8fc1ff;
    border: 1px solid rgba(88, 166, 255, 0.25);
    font-weight: 500;
  }
  .sys-proc-cmd-text {
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .sys-proc-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
  }
  .sys-proc-path-line {
    font-size: 10.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
  }
  .sys-proc-path-label {
    opacity: 0.6;
    margin-right: 4px;
  }
  .sys-proc-action {
    display: flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
  }
  .sys-proc-select {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
  }
  .sys-proc-select input {
    accent-color: var(--accent-color);
    cursor: pointer;
  }

  .sys-section { border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; background: var(--bg); }
  .sys-name { font-size: 13px; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
  .sys-state { font-size: 11px; font-weight: 500; padding: 1px 8px;
    border-radius: 10px; background: var(--surface-2); color: var(--text-muted);
    white-space: nowrap; }
  .sys-state.on { color: var(--green, #3fb950); background: rgba(63,185,80,0.12); }
  .sys-state.off { color: var(--red); background: rgba(248,81,73,0.12); }
  .sys-state.is-busy { color: var(--orange); background: rgba(210,153,34,0.14); }
  .sys-desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
  .sys-desc .sys-live { color: var(--text); font-weight: 600; }
  .sys-wedged { font-size: 12px; }

  /* Header: title on the left, one-line rollup verdict on the right, so the
     answer to "is anything wrong" is readable before you read any row. */
  .sys-head { display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; }
  .sys-rollup { --sys-cur: var(--text-muted);
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--sys-cur) 34%, transparent);
    background: color-mix(in srgb, var(--sys-cur) 10%, var(--bg)); }
  .sys-rollup.is-green { --sys-cur: var(--green); }
  .sys-rollup.is-yellow { --sys-cur: var(--orange); }
  .sys-rollup.is-red { --sys-cur: var(--red); }
  .sys-rollup.is-unknown { --sys-cur: var(--text-muted); }
  .sys-rollup-led { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%;
    background: var(--sys-cur);
    box-shadow: 0 0 6px color-mix(in srgb, var(--sys-cur) 70%, transparent); }
  .sys-rollup-text { font-size: 11px; font-weight: 700;
    color: color-mix(in srgb, var(--sys-cur) 78%, var(--text)); }

  /* Exactly one live region for the whole panel. Three live rows on a 5s
     poll would be unusable with a screen reader. */
  .sys-live-region { position: absolute; width: 1px; height: 1px; margin: -1px;
    padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    border: 0; }

  /* Service rows. The left border repeats the LED colour so the row reads at
     a glance without relying on an 9px dot alone. */
  .sys-svc { --svc-cur: var(--text-muted);
    border-left: 3px solid var(--svc-cur); }
  .sys-svc.is-online { --svc-cur: var(--green); }
  .sys-svc.is-degraded { --svc-cur: var(--orange); }
  .sys-svc.is-offline { --svc-cur: var(--red); }
  .sys-svc.is-idle,
  .sys-svc.is-checking { --svc-cur: var(--text-muted); }
  .sys-svc-head { display: flex; align-items: center; gap: 8px; }
  .sys-svc-head .sys-name { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
  .sys-svc-led { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%;
    background: var(--svc-cur);
    box-shadow: 0 0 6px color-mix(in srgb, var(--svc-cur) 70%, transparent); }
  .sys-svc-restart { font-size: 12px; padding: 4px 12px; flex: 0 0 auto; }
  .sys-svc-started { margin-top: 6px; font-size: 11px; color: var(--text-muted); }
  /* The emphasis line: what a restart would actually cost right now. */
  .sys-svc-busy { margin-top: 3px; font-size: 12px; color: var(--text);
    line-height: 1.55; }
  .sys-svc .sys-desc { margin-top: 5px; }
  /* Prose weight at rest: three rows of explainer is ~1000px of text nobody
     reads twice. The explainer appears the moment a row stops being online,
     which is when someone actually needs to know what the service does. The
     row name keeps it as a title for hover, so it is never truly gone. */
  .sys-svc.is-online .sys-desc { display: none; }
  /* Ops facts the backend already returns: pid, version, port, and the
     crash-loop count. One 11px line turns a friendly panel into a usable one. */
  .sys-svc-meta { margin-top: 5px; font-size: 11px; color: var(--text-muted);
    font-variant-numeric: tabular-nums; }
  .sys-svc-meta:empty { display: none; }
  .sys-svc-meta .sys-meta-warn { color: var(--orange); font-weight: 600; }
  .sys-svc.is-restarting { opacity: 0.92; }
  .sys-svc-result { margin-top: 8px; font-size: 12px; border-radius: 6px;
    padding: 6px 9px; background: var(--surface-2); color: var(--text-muted); }
  .sys-svc-result.is-busy { color: var(--text); }
  .sys-svc-result.is-ok { color: var(--green, #3fb950);
    background: rgba(63,185,80,0.12); }
  .sys-svc-result.is-error { color: var(--red);
    background: rgba(248,81,73,0.12); }
  /* Undo, for the armed dashboard restart. A cheap action does not deserve a
     confirm dialog, but it does deserve a way out now that it is two clicks
     from an always-visible header chip. */
  .sys-svc-result .sys-undo-btn,
  .sys-svc-result .sys-now-btn { margin-left: 8px; padding: 2px 9px;
    border: 1px solid color-mix(in srgb, var(--text) 32%, transparent);
    border-radius: 999px; background: transparent; color: inherit;
    font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
  .sys-svc-result .sys-undo-btn:hover,
  .sys-svc-result .sys-undo-btn:focus-visible,
  .sys-svc-result .sys-now-btn:hover,
  .sys-svc-result .sys-now-btn:focus-visible {
    border-color: var(--accent); color: var(--accent); outline: none; }

  /* Spawned processes: a dynamic-length list, not a fixed service row, so
     it gets its own light structure instead of reusing .sys-svc's LED/
     online states (there's no "degraded" concept for a plain process
     list — a row is either running, or it isn't in the list). */
  .sys-spawned-list { display: flex; flex-direction: column; gap: 5px;
    margin-top: 6px; max-height: 200px; overflow-y: auto; }
  .sys-spawned-empty { padding: 8px 4px; font-size: 12px;
    color: var(--text-muted); text-align: center; }
  .sys-spawned-row { display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 7px; background: var(--surface-2);
    font-size: 12px; }
  .sys-spawned-dot { width: 7px; height: 7px; border-radius: 50%;
    background: var(--green, #3fb950); flex: 0 0 auto; }
  /* Orange = prewarm (bounded pool, will auto-kill); red = about to. */
  .sys-spawned-row.is-prewarm .sys-spawned-dot { background: var(--orange); }
  .sys-spawned-row.is-expiring .sys-spawned-dot { background: var(--red);
    animation: sscBlink 1.1s ease-in-out infinite; }
  .sys-spawned-main { flex: 1 1 auto; min-width: 0; display: flex;
    flex-direction: column; gap: 1px; }
  .sys-spawned-name { color: var(--text); font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sys-spawned-meta { color: var(--text-muted); font-size: 11px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sys-spawned-ttl { flex: 0 0 auto; font-size: 11px; font-weight: 600;
    color: var(--text-muted); font-variant-numeric: tabular-nums;
    white-space: nowrap; }
  .sys-spawned-row.is-prewarm .sys-spawned-ttl { color: var(--orange); }
  .sys-spawned-row.is-expiring .sys-spawned-ttl { color: var(--red); }

  .sys-keepalive-note { margin: 2px 0 0; font-size: 11px;
    color: var(--text-muted); line-height: 1.5; }

  /* Codex app-server: a worker subprocess, so it is a sub-row of the worker
     card rather than a fourth peer service. */
  .sys-subrow { margin: 9px 0 0 10px; padding: 6px 9px;
    border-left: 2px solid var(--border); border-radius: 0 6px 6px 0;
    background: var(--surface-2);
    display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
  .sys-subrow-led { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%;
    background: var(--text-muted); align-self: center; }
  .sys-subrow.is-online .sys-subrow-led { background: var(--green); }
  .sys-subrow.is-degraded .sys-subrow-led { background: var(--orange); }
  .sys-subrow.is-offline .sys-subrow-led { background: var(--red); }
  .sys-subrow-name { font-size: 12px; font-weight: 600; color: var(--text);
    display: inline-flex; align-items: center; gap: 6px; }
  .sys-subrow-meta { flex: 1 1 200px; min-width: 0; font-size: 11px;
    color: var(--text-muted); line-height: 1.5; }

  /* Skeleton: never show a resting verdict before a payload lands. */
  .sys-svc.is-checking .sys-svc-started,
  .sys-svc.is-checking .sys-svc-busy { opacity: 0.55; }
  .sys-svc.is-checking .sys-svc-led { animation: sscBlink 1.1s ease-in-out infinite; }
  @keyframes sscBlink { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.9; } }

  .sys-wedged-details { font-size: 12px; color: var(--text-muted); }
  .sys-wedged-details > summary { cursor: pointer; user-select: none;
    padding: 2px 0; }
  .sys-wedged-details > summary:hover { color: var(--text); }
  .sys-wedged-details .sys-wedged { margin-top: 6px; }

  /* ── Spawn stats (debug) ──────────────────────────────────────
     Collapsed by default so it never competes with the transcript;
     the summary alone answers "how long did this take". */
  .spawn-stats { margin: 0 0 10px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--bg); font-size: 12px; }
  .spawn-stats-summary { cursor: pointer; padding: 7px 10px;
    color: var(--text-muted); list-style: none; user-select: none; }
  .spawn-stats-summary::-webkit-details-marker { display: none; }
  .spawn-stats-summary strong { color: var(--text); }
  .spawn-stats-summary:hover { color: var(--text); }
  .spawn-stats-sub { opacity: 0.75; }
  .spawn-stats-copy { float: right; margin-left: 8px;
    background: transparent; border: 1px solid transparent; border-radius: 5px;
    color: var(--text-muted); font-size: 12px; line-height: 1; padding: 3px 5px;
    cursor: pointer; }
  .spawn-stats-copy:hover { color: var(--text); background: rgba(255, 255, 255, 0.06);
    border-color: var(--border); }
  .spawn-stats-body { padding: 4px 10px 9px; border-top: 1px solid var(--border); }
  .spawn-stat-row { display: flex; justify-content: space-between; gap: 12px;
    padding: 2px 0; }
  .spawn-stat-label { color: var(--text-muted); }
  .spawn-stat-val { color: var(--text); font-variant-numeric: tabular-nums; }
  /* Optimistic echo: the prompt is real, the "waiting" note is the hedge. */
  .optimistic-echo-note { margin-top: 8px; font-size: 12px;
    color: var(--text-muted); font-style: italic; }
  /* Saved-copy preview (CCC-143): the pane shows the last-seen transcript
     from IndexedDB until the fresh fetch replaces it. Sticky so it stays in
     view after the open scrolls to the bottom. */
  .conv-cache-preview { position: sticky; top: 0; z-index: 3; width: fit-content;
    margin: 0 auto 6px; padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; color: var(--text-muted);
    background: var(--bg-secondary, rgba(128,128,128,0.12));
    border: 1px solid var(--border); }
  .conv-cache-preview[data-state="failed"] { color: var(--yellow, #d29922);
    border-color: currentColor; }

  .spawn-stats-note { margin-top: 7px; padding-top: 6px;
    border-top: 1px solid var(--border); color: var(--text-muted);
    font-size: 11px; line-height: 1.5; }

  /* Restart controls. Sits below the per-service sections and above the
     dialog's Close row, so the reading order is state -> what to do. */
  .sys-restart { border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; background: var(--bg); display: flex;
    flex-direction: column; gap: 8px; }
  .sys-restart-label { font-size: 13px; font-weight: 600; color: var(--text); }
  .sys-restart-btns { display: flex; flex-wrap: wrap; gap: 8px; }
  .sys-restart-btn { font-size: 12px; padding: 5px 12px; }
  .sys-restart-hint { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
  .sys-restart-hint code { font-size: 11px; }
  .sys-restart-status { font-size: 12px; border-radius: 6px; padding: 6px 9px;
    background: var(--surface-2); color: var(--text-muted); }
  /* sysRestartSay(..., 'busy') has always been called; the rule was missing. */
  .sys-restart-status.is-busy { color: var(--text); }
  .sys-restart-status.is-ok { color: var(--green, #3fb950);
    background: rgba(63,185,80,0.12); }
  .sys-restart-status.is-error { color: var(--red);
    background: rgba(248,81,73,0.12); }

  /* ── CCC Cloud (relay) section, injected into the Network access modal ── */
  .cloud-relay-section { border-top: 1px solid var(--border, rgba(255,255,255,0.1));
    margin-top: 14px; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
  .cloud-relay-title { font-weight: 600; font-size: 13px; }
  .cloud-relay-copy { font-size: 12px; color: var(--text-muted); }
  .cloud-relay-status { font-size: 12.5px; margin: 4px 0; }
  .cloud-relay-pair, .cloud-relay-confirm, .cloud-relay-paired {
    display: flex; flex-direction: column; gap: 2px; }
  .cloud-relay-actions { display: flex; gap: 8px; margin-top: 10px; }
  .cloud-relay-error { font-size: 12px; color: var(--red);
    background: rgba(248,81,73,0.1); border: 1px solid rgba(248,81,73,0.3);
    border-radius: 6px; padding: 6px 9px; display: none; margin-top: 6px;
    white-space: pre-wrap; word-break: break-word; }

  /* ── Car Mode modal ─────────────────────────────────────────
     Reuses the .upd-* shell; these add the capability banner + the
     cost / graceful-degradation callouts. */
  .car-mode-banner { font-size: 12px; border-radius: 6px; padding: 8px 10px;
    line-height: 1.5; border: 1px solid var(--border); background: var(--bg); }
  .car-mode-banner.ok { color: var(--text);
    background: rgba(63,185,80,0.10); border-color: rgba(63,185,80,0.30); }
  .car-mode-banner.warn { color: var(--text);
    background: rgba(210,153,34,0.10); border-color: rgba(210,153,34,0.30); }
  .car-mode-banner.running { color: var(--text);
    background: rgba(88,166,255,0.10); border-color: rgba(88,166,255,0.30); }
  .car-mode-cost, .car-mode-degrade { font-size: 12px; color: var(--text-muted);
    line-height: 1.5; border-radius: 6px; padding: 8px 10px;
    background: var(--bg); border: 1px solid var(--border); }
  .car-mode-cost strong, .car-mode-degrade strong { color: var(--text); }

  /* ── Voice mode (Codex realtime) ────────────────────────────
     Topbar mic button, the floating voice panel, and the settings
     modal banner. The panel is a fixed card (not .upd-overlay) so the
     user can keep using the board while it is live. */
  .voice-mode-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; margin-left: 8px;
    background: transparent; color: var(--text-muted);
    border: 1px solid transparent; border-radius: 999px;
    font-size: 11px; font-family: inherit; cursor: pointer;
    letter-spacing: 0.2px; white-space: nowrap;
  }
  .voice-mode-btn:hover { color: var(--text); border-color: var(--border); }
  .voice-mode-btn.live { color: #f85149; border-color: rgba(248,81,73,0.4); }
  .voice-live-dot { width: 7px; height: 7px; border-radius: 50%;
    background: #f85149; animation: voice-dot-pulse 1.6s ease-out infinite; }
  @keyframes voice-dot-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(248,81,73,0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(248,81,73,0); }
    100% { box-shadow: 0 0 0 0 rgba(248,81,73,0); }
  }
  @media (prefers-reduced-motion: reduce) {
    .voice-live-dot { animation: none; }
  }
  .voice-panel { position: fixed; right: 16px; bottom: 16px; z-index: 9500;
    width: min(380px, 92vw); max-height: min(560px, 80vh);
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
  .voice-panel[hidden] { display: none; }
  /* Collapsed: just the header bar (state, timer, mute, end, expand). */
  .voice-panel.collapsed { width: auto; max-width: calc(100vw - 24px); }
  .voice-panel.collapsed > :not(.voice-panel-head):not(audio) { display: none !important; }
  .voice-panel.collapsed .voice-panel-head { border-bottom: 0; }
  .voice-panel.collapsed .voice-state-pill { max-width: 46vw; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .voice-panel.collapsed #voicePanelCollapseBtn svg { transform: rotate(180deg); }
  .voice-mobile-btn { display: none; }
  .voice-button-options {
    position: fixed; z-index: 9600; width: min(260px, calc(100vw - 24px));
    box-sizing: border-box; padding: 12px; border-radius: 10px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
  }
  .voice-button-options[hidden] { display: none; }
  .voice-button-options .upd-btn { width: 100%; min-height: 44px; }
  .voice-button-options p { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
  body.hide-voice-mobile-btn .voice-mobile-btn:not(.live) { display: none !important; }
  @media (max-width: 1200px) {
    .voice-mobile-btn {
      position: fixed; right: max(16px, env(safe-area-inset-right, 0px));
      bottom: calc(160px + env(safe-area-inset-bottom, 0px)); z-index: 9400;
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      min-height: 56px; padding: 0 18px; border-radius: 999px;
      background: #238636; border: 1px solid #2ea043; color: #fff;
      font: 700 14px var(--font-sans, sans-serif); cursor: pointer;
      box-shadow: 0 4px 18px rgba(0,0,0,0.35);
      touch-action: none; user-select: none;
    }
    body.has-mobile-bottom-nav .voice-panel {
      bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
    .voice-mobile-btn.live { background: #1a6330; }
    .voice-mobile-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
    body.voice-panel-open .voice-mobile-btn,
    body.hide-voice-mobile-btn .voice-mobile-btn:not(.live) { display: none !important; }
    .voice-panel {
      right: max(12px, env(safe-area-inset-right, 0px));
      bottom: calc(16px + env(safe-area-inset-bottom, 0px));
      width: calc(100vw - 24px); max-width: 380px;
      max-height: calc(100dvh - 120px - env(safe-area-inset-bottom, 0px));
    }
    body .voice-panel-btn { width: 44px; height: 44px; }
  }
  /* Settings → Layout → "Floating call button" off: hide it unless a call is live. */
  body.voice-call-btn-off .voice-mobile-btn:not(.live) { display: none; }
  .voice-panel-head { display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .voice-state-pill { font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
    padding: 2px 9px; border-radius: 999px; text-transform: uppercase;
    color: var(--text-muted); border: 1px solid var(--border); }
  .voice-state-pill.connecting { color: #d29922; border-color: rgba(210,153,34,0.4); }
  .voice-state-pill.listening { color: #3fb950; border-color: rgba(63,185,80,0.4); }
  .voice-state-pill.thinking { color: #58a6ff; border-color: rgba(88,166,255,0.4); }
  .voice-state-pill.speaking { color: #a371f7; border-color: rgba(163,113,247,0.4); }
  .voice-state-pill.error, .voice-state-pill.ended { color: #f85149; border-color: rgba(248,81,73,0.4); }
  .voice-elapsed { font-size: 12px; font-variant-numeric: tabular-nums;
    color: var(--text-muted); flex: 1; }
  .voice-panel-head-btns { display: inline-flex; gap: 4px; }
  .voice-panel-btn { display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0; border-radius: 6px;
    background: transparent; color: var(--text-muted);
    border: 1px solid transparent; cursor: pointer; }
  .voice-panel-btn:hover { color: var(--text); border-color: var(--border); }
  .voice-panel-btn.muted { color: #d29922; border-color: rgba(210,153,34,0.4); }
  .voice-panel-stop:hover { color: #f85149; border-color: rgba(248,81,73,0.4); }
  .voice-error { margin: 8px 12px 0; font-size: 12px; color: #f85149;
    background: rgba(248,81,73,0.08); border: 1px solid rgba(248,81,73,0.3);
    border-radius: 6px; padding: 7px 9px; line-height: 1.5; }
  .voice-transcript { flex: 1; overflow-y: auto; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
  .voice-msg { font-size: 13px; line-height: 1.5; }
  .voice-msg-role { display: block; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
  .voice-msg.user .voice-msg-role { color: #58a6ff; }
  .voice-msg.assistant .voice-msg-role { color: #a371f7; }
  .voice-msg.system { color: var(--text-muted); font-size: 12px; font-style: italic; }
  .voice-msg .voice-msg-streaming::after { content: "…"; color: var(--text-muted); }
  .voice-actions { display: flex; flex-direction: column; gap: 8px;
    padding: 0 12px; }
  .voice-action-card { border: 1px solid rgba(210,153,34,0.4); border-radius: 8px;
    background: rgba(210,153,34,0.06); padding: 8px 10px; font-size: 12px; }
  .voice-action-card .voice-action-summary { color: var(--text); line-height: 1.5; }
  .voice-action-card .voice-action-kind { display: block; font-size: 10px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
    color: #d29922; margin-bottom: 3px; }
  .voice-action-btns { display: flex; gap: 8px; margin-top: 8px; }
  .voice-action-btns .upd-btn { font-size: 12px; padding: 3px 12px; }
  .voice-panel-foot { padding: 10px 12px; border-top: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 8px; }
  .voice-text-form { display: flex; gap: 6px; width: 100%; }
  .voice-text-form[hidden] { display: none; }
  .voice-text-form .bug-input { flex: 1; min-width: 0; }
  .voice-call-btn.upd-btn { display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; min-width: 140px; padding: 10px 24px; border-radius: 999px;
    background: #238636; border-color: #2ea043; color: #fff; font-weight: 700;
    letter-spacing: 0.5px; }
  .voice-call-btn.upd-btn:hover { background: #2ea043; border-color: #3fb950; }
  .voice-call-btn.upd-btn.is-live { background: #b62324; border-color: #da3633; }
  .voice-call-btn.upd-btn.is-live:hover { background: #da3633; }
  .voice-call-btn.is-live .voice-call-icon { transform: rotate(135deg); }
  .voice-call-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
  .voice-setup-banner { font-size: 12px; border-radius: 6px; padding: 8px 10px;
    line-height: 1.5; border: 1px solid rgba(210,153,34,0.3);
    color: var(--text); background: rgba(210,153,34,0.10); }
  /* ── Bug-report link + modal ─────────────────────────────────
     Subtle "Report a bug" link in the topbar. Opens a modal that
     reuses the .upd-overlay / .upd-dialog / .upd-btn shells. */
  .bug-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; margin-left: 8px;
    background: transparent; color: var(--text-muted);
    border: 1px solid transparent; border-radius: 999px;
    font-size: 11px; font-family: inherit; cursor: pointer;
    letter-spacing: 0.2px; white-space: nowrap;
    transition: background 0.12s ease-out, color 0.12s ease-out;
  }
  .bug-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
  /* Client inbox (Report a bug / issue inbox) — colorize the leading flag
     glyph so it reads as a live, accented affordance instead of muted gray.
     Only the icon is tinted; the label stays in the muted action-link tone.
     Orange is this codebase's established "report / attention" accent
     (conv-outcome banners, exhausted results). CCC-36. */
  .bug-link > span[aria-hidden="true"] {
    color: var(--orange);
    transition: color 0.12s ease-out;
  }
  .bug-link:hover > span[aria-hidden="true"] {
    color: var(--orange);
    filter: brightness(1.15);
  }
  .annotation-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; margin-left: 4px;
    background: transparent; color: var(--text-muted);
    border: 1px solid transparent; border-radius: 999px;
    font-size: 11px; font-family: inherit; cursor: pointer;
    letter-spacing: 0.2px; white-space: nowrap;
    transition: background 0.12s ease-out, color 0.12s ease-out, border-color 0.12s ease-out;
  }
  .annotation-link:hover,
  .annotation-link.active {
    background: rgba(57,210,192,0.12);
    border-color: rgba(57,210,192,0.35);
    color: var(--text);
  }
  .bug-input { width: 100%; box-sizing: border-box;
    padding: 7px 10px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text); font-family: inherit; font-size: 13px;
    outline: none; }
  .bug-input:focus { border-color: var(--accent); }
  .bug-textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
  .bug-label { font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 6px; display: block; }
  .bug-meta { font-size: 11px; color: var(--text-muted);
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 8px 10px; line-height: 1.5;
    word-break: break-all; }
  .bug-meta code { font-family: 'SF Mono',SFMono-Regular,Consolas,monospace;
    font-size: 10.5px; color: var(--text); }
  .bug-success { font-size: 12px; color: var(--green, #3fb950);
    background: rgba(63,185,80,0.1); border: 1px solid rgba(63,185,80,0.3);
    border-radius: 6px; padding: 8px 10px; display: none; }
  .bug-success.visible { display: block; }
  .bug-fallback {
    font-size: 12px; color: var(--text-muted);
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 8px 10px; display: none;
    white-space: pre-wrap; word-break: break-word;
    max-height: 180px; overflow: auto;
    font-family: 'SF Mono',SFMono-Regular,Consolas,monospace;
  }
  .bug-fallback.visible { display: block; }
  .bug-shot-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .bug-shot-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 6px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border);
    font-family: inherit; font-size: 12px; cursor: pointer;
    transition: background 0.12s ease-out, border-color 0.12s ease-out;
  }
  .bug-shot-btn:hover { background: rgba(255,255,255,0.04); border-color: var(--accent); }
  .bug-shot-btn:disabled { opacity: 0.6; cursor: progress; }
  .bug-shot-btn .bug-shot-ico {
    display: inline-block; width: 12px; height: 12px;
    border: 1.5px solid currentColor; border-radius: 2px;
    position: relative;
  }
  .bug-shot-btn .bug-shot-ico::after {
    content: ""; position: absolute;
    top: 1.5px; left: 3px; right: 3px; height: 1.5px;
    background: currentColor; border-radius: 1px;
  }
  .bug-shot-help {
    font-size: 10.5px; color: var(--text-muted);
    margin-top: 6px; line-height: 1.45;
  }
  .bug-shot-preview {
    margin-top: 8px; display: none;
    border: 1px solid var(--border); border-radius: 6px;
    padding: 8px; background: var(--bg);
  }
  .bug-shot-preview.visible { display: block; }
  .bug-shot-preview img {
    display: block; max-width: 100%; max-height: 200px;
    border-radius: 4px; margin: 0 auto 8px;
    background: rgba(0,0,0,0.2);
  }
  .bug-shot-preview-actions {
    display: flex; justify-content: flex-end; gap: 6px;
  }
  .bug-privacy-note {
    font-size: 11px; color: var(--text-muted); line-height: 1.5;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 8px 10px;
  }
  .bug-auto-banner {
    font-size: 12px; color: var(--text); line-height: 1.5;
    background: rgba(210,153,34,0.12); border: 1px solid rgba(210,153,34,0.4);
    border-radius: 6px; padding: 8px 10px;
  }
  .bug-auto-optout {
    display: flex; align-items: center; gap: 6px;
    margin-top: 8px; font-size: 11px; color: var(--text-muted);
    cursor: pointer;
  }
  .bug-field-row { display: flex; gap: 10px; }
  .bug-field-row > div { flex: 1; min-width: 0; }
  .bug-dest-group { display: flex; flex-direction: column; gap: 8px; }
  .bug-dest-option {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
    cursor: pointer; transition: border-color 0.12s ease-out, background 0.12s ease-out;
  }
  .bug-dest-option:hover { background: rgba(255,255,255,0.03); }
  .bug-dest-option input[type="radio"] { margin-top: 2px; accent-color: var(--accent); }
  .bug-dest-option:has(input[type="radio"]:checked) {
    border-color: var(--accent); background: rgba(57,210,192,0.06);
  }
  .bug-dest-text { display: flex; flex-direction: column; gap: 2px; }
  .bug-dest-title { font-size: 12.5px; color: var(--text); }
  .bug-dest-sub { font-size: 11px; color: var(--text-muted); line-height: 1.45; }
  .bug-diag-toggle {
    display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
    font-size: 12.5px; color: var(--text);
  }
  .bug-diag-toggle input { margin-top: 2px; accent-color: var(--accent); }
  .bug-diag-toggle > span { display: flex; flex-direction: column; gap: 2px; }
  .bug-preview-details > summary { cursor: pointer; }
  .bug-preview-details[open] > summary { margin-bottom: 6px; }
  .bug-preview {
    width: 100%; box-sizing: border-box;
    min-height: 150px; max-height: 260px; resize: vertical;
    font-family: 'SF Mono',SFMono-Regular,Consolas,monospace;
    font-size: 11px; line-height: 1.45; white-space: pre;
    color: var(--text-muted); cursor: text;
  }

  /* ── Page annotation overlay ────────────────────────────────── */
  .ann-overlay {
    position: fixed; inset: 0; z-index: 10020;
    cursor: crosshair; background: rgba(13,17,23,0.08);
    user-select: none;
    touch-action: none;
  }
  .ann-overlay.ann-capturing {
    opacity: 0;
  }
  .ann-hud {
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 8px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); font-size: 12px; font-weight: 600;
    box-shadow: 0 10px 28px rgba(0,0,0,0.34);
    cursor: default;
  }
  .ann-hud-close,
  .ann-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text-muted); font: inherit; cursor: pointer;
  }
  .ann-hud-close:hover,
  .ann-icon-btn:hover { color: var(--text); background: var(--surface-2); }
  .ann-selection {
    position: fixed; pointer-events: none;
    border: 2px solid var(--cyan);
    background: rgba(57,210,192,0.12);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.25) inset;
  }
  .ann-hover-label {
    position: fixed; z-index: 10021; pointer-events: none;
    max-width: 280px; padding: 4px 7px; border-radius: 6px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); font-size: 11px;
    font-family: 'SF Mono',SFMono-Regular,Consolas,monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  }
  .ann-editor {
    position: fixed; z-index: 10021;
    display: flex; flex-direction: column; gap: 9px;
    padding: 12px; border-radius: 8px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 18px 48px rgba(0,0,0,0.5);
    cursor: default;
    max-height: calc(100vh - 24px); overflow-y: auto;
  }
  .ann-editor-title {
    font-size: 13px; font-weight: 700; color: var(--text);
  }
  .ann-editor-note {
    width: 100%; min-height: 96px; resize: vertical;
    padding: 8px 9px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text); font: 13px/1.45 var(--font-ui);
  }
  .ann-editor-note:focus { border-color: var(--cyan); }
  .ann-editor-meta,
  .ann-editor-shot-hint,
  .ann-note-meta,
  .ann-note-url,
  .ann-note-path {
    font-size: 11px; color: var(--text-muted);
    overflow-wrap: anywhere;
  }
  .ann-editor-shot-preview {
    display: flex; align-items: center; justify-content: center;
    max-height: 150px; overflow: hidden;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg);
  }
  .ann-editor-shot-preview[hidden] { display: none !important; }
  .ann-editor-shot-preview img {
    display: block; width: 100%; max-height: 150px;
    object-fit: contain;
  }
  .ann-editor-error {
    font-size: 12px; color: var(--red);
    background: rgba(248,81,73,0.1);
    border: 1px solid rgba(248,81,73,0.28);
    border-radius: 6px; padding: 7px 8px;
  }
  .ann-editor-actions {
    display: flex; justify-content: flex-end; gap: 7px;
    flex-wrap: wrap;
  }
  .ann-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 30px; padding: 6px 10px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text); font: 12px var(--font-ui); cursor: pointer;
    white-space: nowrap;
  }
  .ann-btn:hover { background: var(--surface-2); }
  .ann-btn:disabled { opacity: 0.6; cursor: progress; }
  .ann-primary {
    background: var(--cyan); border-color: var(--cyan);
    color: #061b1a; font-weight: 700;
  }
  .ann-primary:hover { background: var(--cyan); opacity: 0.9; }
  .ann-queue-btn {
    flex: 1 1 100%;
  }
  /* Pre-submit preview for the UX-fixes queue (see annShowUxFixesPreview). */
  .ann-ux-preview-modal {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55); padding: 20px;
  }
  .ann-ux-preview-card {
    width: min(720px, 96vw); max-height: 90vh; overflow: auto;
    display: flex; flex-direction: column; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  }
  .ann-ux-preview-title { font: 700 14px var(--font-ui); color: var(--text); }
  .ann-ux-preview-label { font: 600 11px var(--font-ui); color: var(--text-muted); }
  .ann-ux-preview-shot { display: flex; flex-direction: column; gap: 6px; }
  .ann-ux-preview-thumb {
    max-width: 100%; max-height: 220px; align-self: flex-start;
    border: 1px solid var(--border); border-radius: 6px;
  }
  .ann-ux-ok { font: 600 12px var(--font-ui); color: var(--green); }
  .ann-ux-warn {
    font: 600 12px var(--font-ui); color: var(--orange);
    line-height: 1.4;
  }
  .ann-ux-preview-text {
    width: 100%; box-sizing: border-box; resize: vertical;
    font: 12px var(--font-mono, ui-monospace, monospace);
    color: var(--text); background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px; padding: 8px;
    white-space: pre-wrap;
  }
  .ann-ux-preview-actions {
    display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  }
  .ann-gh-title {
    width: 100%; box-sizing: border-box;
    font: 13px var(--font-ui); color: var(--text); background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px;
  }
  .ann-gh-status {
    font: 12px var(--font-ui); color: var(--orange); line-height: 1.4;
  }
  .ann-gh-status a { color: var(--accent, var(--blue)); }
  .uxq-detail-meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 10px;
    margin: 0;
    font: 12px var(--font-ui);
    color: var(--text-muted);
  }
  .uxq-detail-meta dt {
    font-weight: 700;
    color: var(--text-muted);
  }
  .uxq-detail-meta dd {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
  }
  .ann-notes-dialog {
    width: min(760px, 94vw);
    max-height: min(720px, 88vh);
  }
  .ann-screen-dialog {
    width: min(640px, 94vw);
    max-height: min(760px, 90vh);
  }
  .ann-screen-preview {
    display: block; max-width: 100%; max-height: 320px;
    object-fit: contain; border: 1px solid var(--border);
    border-radius: 6px; background: var(--bg);
  }
  .ann-notes-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  .ann-notes-list {
    display: flex; flex-direction: column; gap: 8px;
    overflow: auto; max-height: 62vh; padding-right: 2px;
  }
  .ann-notes-empty {
    border: 1px dashed var(--border); border-radius: 8px;
    padding: 18px; color: var(--text-muted); font-size: 13px;
    text-align: center; background: var(--bg);
  }
  .ann-notes-empty.error { color: var(--red); border-color: rgba(248,81,73,0.35); }
  .ann-note-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
    align-items: start; padding: 10px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg);
  }
  .ann-note-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .ann-note-actions {
    display: flex; flex-direction: column; gap: 6px;
    align-items: stretch;
  }
  .ann-note-text {
    color: var(--text); font-size: 13px; line-height: 1.45;
    white-space: pre-wrap; overflow-wrap: anywhere;
  }
  .ann-note-shot {
    display: flex; flex-direction: column; gap: 5px;
    margin-top: 4px;
  }
  .ann-note-shot img {
    display: block; max-width: min(420px, 100%); max-height: 220px;
    object-fit: contain; border: 1px solid var(--border);
    border-radius: 6px; background: var(--surface);
  }
  .ann-note-url,
  .ann-note-path {
    font-family: 'SF Mono',SFMono-Regular,Consolas,monospace;
  }
  @media (max-width: 640px) {
    .ann-note-row { grid-template-columns: minmax(0, 1fr); }
    .ann-note-actions {
      flex-direction: row; flex-wrap: wrap; justify-content: flex-start;
    }
  }

  /* Backlog column — no longer sticky, scrolls with the rest */
  /* Reuse kanban column/card styles in split mode */
  .kanban-board-split .kanban-column,
  .kanban-board-split .kanban-column-header,
  .kanban-board-split .kanban-cards,
  .kanban-board-split .kanban-card,
  .kanban-board-split .kanban-card-title,
  .kanban-board-split .kanban-card-meta,
  .kanban-board-split .kanban-card-stage,
  .kanban-board-split .kanban-card-actions,
  .kanban-board-split .kanban-action-btn,
  .kanban-board-split .kanban-show-all {
    /* Inherited from main kanban styles above */
  }

  .split-resizer {
    width: 6px; cursor: col-resize; background: var(--border);
    flex-shrink: 0; transition: background 0.15s;
  }
  .split-resizer:hover { background: var(--accent); }
  .split-resizer.dragging { background: var(--accent); }

  .conv-panel {
    flex: none; width: 680px;
    display: flex; flex-direction: column;
    position: relative;
    overflow: hidden; min-width: 40px;
    /* Container query scope so the toolbar can squeeze buttons / hide the
       session UUID when the user drags this pane narrow. */
    container-type: inline-size; container-name: convpane;
  }
  .conv-panel-toolbar {
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    background: var(--surface); display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap;
  }
  /* Squeeze toolbar contents as the conv-pane narrows. UUID is the first to
     go (least useful when space is tight, copyable from the session anyway);
     then buttons drop padding so more fit on one row before wrapping. */
  @container convpane (max-width: 520px) {
    .conv-panel-toolbar .cpt-session-id { display: none; }
  }
  @container convpane (max-width: 380px) {
    .conv-panel-toolbar { padding: 8px 10px; gap: 4px; }
    .conv-panel-toolbar button { padding: 4px 6px; font-size: 11px; }
    /* Hide the font-size A-/A+ controls — least useful when squeezed. */
    .conv-panel-toolbar #cpFontMinus,
    .conv-panel-toolbar #cpFontPlus { display: none; }
  }
  @container convpane (max-width: 260px) {
    /* At very narrow widths, drop the live "live" badge and launch menu
       label area. Keep only the essentials (Jump / Launch / Kill / Close). */
    .conv-panel-toolbar #cpLiveBadge,
    .conv-panel-toolbar .cp-launch-split .launch-choice-btn { display: none !important; }
    .conv-panel-toolbar { padding: 6px 8px; }
    .conv-panel-view { padding: 12px 12px; }
  }
  .conv-panel-toolbar button {
    padding: 5px 10px; font-size: 12px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    cursor: pointer; white-space: nowrap;
  }
  .conv-panel-toolbar button:hover { background: var(--surface-2); }
  .conv-panel-toolbar .cp-launch-split {
    display: inline-flex;
    position: relative;
  }
  .conv-panel-toolbar .cp-launch-split #cpLaunchBtn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .conv-panel-toolbar .cp-launch-split .launch-choice-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 5px 7px;
  }
  .conv-panel-toolbar .launch-choice-menu .launch-choice-item {
    width: 100%;
    border: none;
    border-radius: 0;
    padding: 7px 12px;
    background: transparent;
    color: var(--text);
  }
  .conv-panel-toolbar .launch-choice-menu .launch-choice-item:hover {
    background: var(--surface-2);
  }
  .conv-panel-toolbar .launch-choice-menu .launch-choice-item:disabled:hover {
    background: transparent;
  }
  .conv-panel-toolbar .cpt-session-id {
    font-size: 11px; color: var(--text-muted); font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    opacity: 0.6; cursor: pointer; user-select: all; margin-left: auto;
  }
  #convSessionId.copied,
  .conv-panel-toolbar .cpt-session-id.copied { color: var(--green); opacity: 1; }
  .conv-panel-view {
    flex: 1; overflow-y: auto; padding: 16px 20px;
  }
  .conv-panel-view .empty-state {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); font-size: 14px;
  }
  /* ── Conversation-pane input (Claude-Desktop-style) ──
     Pill container wraps the textarea + send button; focus-within gives a
     subtle ring. Textarea auto-resizes up to a cap (see cpInputAutoResize).
     The tty label sits below as a muted footer so the input itself is the
     visual anchor. */
  .conv-panel-input {
    display: none; padding: 10px 14px 12px; border-top: 1px solid var(--border);
    background: var(--surface); flex-direction: column; gap: 4px;
  }
  .conv-panel-input.visible { display: flex; }
  .cpi-wrap {
    display: flex; align-items: flex-end; gap: 6px;
    padding: 10px 10px 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border); border-radius: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .cpi-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,166,255,0.14);
  }
  .conv-panel-input textarea {
    flex: 1; min-height: 22px; max-height: 160px;
    border: none; outline: none; resize: none;
    background: transparent; color: var(--text);
    font-family: inherit; font-size: 14px; line-height: 1.5;
    padding: 0; overflow-y: auto;
  }
  .conv-panel-input textarea::placeholder { color: var(--text-muted); opacity: 0.6; }
  .conv-panel-input textarea.is-readonly {
    cursor: default;
    color: var(--text-muted);
  }
  .conv-panel-input textarea.is-readonly::placeholder { opacity: 0.9; }
  .conv-panel-input .cpi-send {
    flex: none; width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: 10px;
    background: var(--accent); color: #fff; cursor: pointer;
    transition: opacity 0.15s, transform 0.05s;
  }
  .conv-panel-input .cpi-send:hover:not(:disabled) { opacity: 0.9; }
  .conv-panel-input .cpi-send:active:not(:disabled) { transform: translateY(1px); }
  .conv-panel-input .cpi-send:disabled {
    background: transparent; color: var(--text-muted);
    border-color: var(--border); cursor: not-allowed; opacity: 0.5;
  }
  .conv-panel-input .cpi-send svg { display: block; }
  .conv-panel-input .cpi-hint {
    font-size: 10px; color: var(--text-muted); opacity: 0.6;
    padding: 0 6px; display: flex; gap: 10px; align-items: center;
  }
  .conv-panel-input .cpi-hint .tty-label {
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  }
  .conv-panel-input .cpi-hint .cpi-enter-hint { margin-left: auto; }
  .conv-panel-input .cpi-hint kbd {
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 3px; padding: 0 4px; font-size: 10px;
  }

  /* ── Task 7: Inline input on waiting cards ── */
  .kanban-inline-input {
    display: flex; gap: 4px; margin-top: 6px; align-items: center;
  }
  .kanban-inline-input input {
    flex: 1; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 11px; outline: none;
    min-width: 0;
  }
  .kanban-inline-input input:focus { border-color: var(--accent); }
  .kanban-inline-input button {
    padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); cursor: pointer; font-size: 11px;
    white-space: nowrap;
  }
  .kanban-inline-input button:hover { background: var(--surface-2); }

  /* ── Task 8: Approve/Deny buttons ── */
  .kanban-tool-info {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* Live "what is Claude doing right now" badge on Working cards */
  .kanban-live-tool {
    font-size: 11px; margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: #FBCA04;
    background: rgba(251,202,4,0.10);
    border-left: 2px solid rgba(251,202,4,0.6);
    padding: 3px 6px; border-radius: 3px;
    animation: pulse 2s infinite;
  }
  .kanban-live-tool .kanban-live-name { font-weight: 600; }
  .kanban-live-tool .kanban-live-file { color: var(--text-muted); }
  .kanban-live-tool .kanban-live-file.is-command {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  }
  .kanban-live-tool .kanban-live-age { color: var(--text-muted); font-size: 10px; margin-left: 4px; }
  /* In-flight: tool is actively running right now (PreToolUse marker) */
  .kanban-live-tool.in-flight {
    color: #58a6ff;
    background: rgba(88,166,255,0.10);
    border-left-color: rgba(88,166,255,0.6);
    animation: pulse 1.2s infinite;
  }
  .kanban-live-tool.stale {
    color: var(--red);
    background: rgba(248,81,73,0.12);
    border-left-color: rgba(248,81,73,0.65);
    animation: none;
  }
  /* Live "what's running" strip in the conversation detail pane.
     Background layers the yellow/blue tint over an opaque `--bg` so
     conversation events scrolling underneath the sticky strip stay hidden
     instead of bleeding through (an 8% rgba alone is essentially see-through). */
  .conv-live-tool-strip {
    display: flex; align-items: flex-start; gap: 8px;
    flex-wrap: wrap;
    padding: 6px 12px; font-size: 12px;
    color: #FBCA04;
    background: linear-gradient(rgba(251,202,4,0.08), rgba(251,202,4,0.08)), var(--bg);
    border-bottom: 1px solid rgba(251,202,4,0.25);
    position: sticky; top: 0; z-index: 9;
  }
  .conv-live-tool-strip .cl-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: #FBCA04; box-shadow: 0 0 6px rgba(251,202,4,0.7);
    animation: pulse 1.4s infinite;
    flex: 0 0 8px;
  }
  .conv-live-tool-strip .cl-tool { font-weight: 600; }
  .conv-live-tool-strip .cl-file { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .conv-live-tool-strip .cl-file.is-command {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    flex: 1 1 320px;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .conv-live-tool-strip .cl-age { color: var(--text-muted); font-size: 11px; margin-left: auto; flex: 0 0 auto; }
  .conv-live-tool-strip.in-flight {
    color: #58a6ff;
    background: linear-gradient(rgba(88,166,255,0.08), rgba(88,166,255,0.08)), var(--bg);
    border-bottom-color: rgba(88,166,255,0.30);
  }
  .conv-live-tool-strip.in-flight .cl-pulse {
    background: #58a6ff; box-shadow: 0 0 6px rgba(88,166,255,0.7);
    animation: pulse 1.0s infinite;
  }
  .conv-live-tool-strip.is-question {
    color: #58a6ff;
    background: linear-gradient(rgba(88,166,255,0.10), rgba(88,166,255,0.10)), var(--bg);
    border-bottom-color: rgba(88,166,255,0.35);
  }
  .conv-live-tool-strip.is-question .cl-pulse {
    background: #58a6ff; box-shadow: 0 0 6px rgba(88,166,255,0.7);
  }
  /* Inline twin of the sticky strip — appended after the last rendered
     event so the user can see "agent is still working" without having
     to scroll up to the sticky strip. Shows whenever the strip shows;
     hidden the moment status flips back to idle. */
  .conv-live-tool-inline {
    display: flex; align-items: flex-start; gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px; margin: 12px 0;
    font-size: 12px; color: #FBCA04;
    background: linear-gradient(rgba(251,202,4,0.10), rgba(251,202,4,0.10)), var(--bg);
    border: 1px solid rgba(251,202,4,0.30);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
  }
  .conv-live-tool-inline .cl-hint {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
    opacity: 0.85;
  }
  .conv-live-tool-inline.is-expanded .cl-file {
    overflow: visible;
    white-space: normal;
    text-overflow: unset;
    word-break: break-all;
  }
  .conv-live-tool-inline.in-flight {
    color: #58a6ff;
    background: linear-gradient(rgba(88,166,255,0.10), rgba(88,166,255,0.10)), var(--bg);
    border-color: rgba(88,166,255,0.35);
  }
  .conv-live-tool-inline.is-stale-no-process {
    color: var(--text-muted);
    background: linear-gradient(rgba(139,148,158,0.10), rgba(139,148,158,0.10)), var(--bg);
    border-color: rgba(139,148,158,0.32);
    cursor: default;
  }
  .conv-live-tool-inline.is-stale-no-process .cl-pulse {
    background: var(--text-muted);
    box-shadow: none;
    animation: none;
  }
  /* Wake-status banners (headless resume lifecycle). A queued/resuming status
     stays calm; a hard resume failure gets a distinct persistent error look
     (mirrors is-stale-no-process but in the red channel). */
  .conv-live-tool-inline.is-wake-status { cursor: default; }
  .conv-live-tool-inline.is-error {
    color: #f85149;
    background: linear-gradient(rgba(248,81,73,0.10), rgba(248,81,73,0.10)), var(--bg);
    border-color: rgba(248,81,73,0.40);
    cursor: default;
  }
  .conv-live-tool-inline.is-error .cl-pulse {
    background: #f85149;
    box-shadow: none;
    animation: none;
  }
  /* Persistent stuck-mid-turn card (kimi webui panes): the turn looks
   * unfinished but the wire has had no output past the stale threshold.
   * Warning channel, no pulse — it replaces the "Working…" moon. */
  .conv-live-tool-inline.is-stuck {
    color: #F0883E;
    background: linear-gradient(rgba(240,136,62,0.12), rgba(240,136,62,0.12)), var(--bg);
    border-color: rgba(240,136,62,0.45);
  }
  .conv-live-tool-inline.is-stuck .cl-stuck-icon { flex: 0 0 auto; }
  .conv-live-tool-inline.is-stuck .cl-file { color: inherit; opacity: 0.75; }
  .conv-live-tool-inline.is-stuck .cl-stuck-wake {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 2px 10px;
    font: inherit;
    font-size: 12px;
    color: inherit;
    background: rgba(240, 136, 62, 0.16);
    border: 1px solid rgba(240, 136, 62, 0.55);
    border-radius: 6px;
    cursor: pointer;
  }
  .conv-live-tool-inline.is-stuck .cl-stuck-wake:hover:not(:disabled) {
    background: rgba(240, 136, 62, 0.3);
  }
  .conv-live-tool-inline.is-stuck .cl-stuck-wake:disabled { opacity: 0.7; cursor: default; }
  .conv-live-tool-inline .cl-dismiss {
    margin-left: auto;
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.65;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
  }
  .conv-live-tool-inline .cl-cancel {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 2px 8px;
    color: inherit;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 5px;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
  }
  .conv-live-tool-inline .cl-cancel:hover:not(:disabled) { background: rgba(251, 202, 4, 0.16); }
  .conv-live-tool-inline .cl-cancel:disabled { cursor: default; opacity: 0.65; }
  /* Live Codex wake progress. Fast, healthy stages collapse to checkmarks;
     only the current action speaks. The diagnostic readout appears after a
     stage lingers for a second or the server reports a warning. */
  .conv-live-tool-inline.wake-breakdown {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    color: var(--text-muted);
    background: linear-gradient(rgba(139,148,158,0.08), rgba(139,148,158,0.08)), var(--bg);
    border-color: rgba(139,148,158,0.28);
    cursor: default;
  }
  .wake-breakdown .wb-stages {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .wake-breakdown .wb-stage {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px;
    opacity: 0.55;
  }
  .wake-breakdown .wb-stage.is-done { opacity: 1; color: #3fb950; }
  .wake-breakdown .wb-stage.is-current { opacity: 1; color: #58a6ff; }
  .wake-breakdown .wb-stage.is-done .wb-label { display: none; }
  .wake-breakdown .wb-stage .wb-label { color: inherit; }
  .wake-breakdown .wb-icon {
    flex: 0 0 auto;
    width: 12px; height: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; line-height: 1;
  }
  .wake-breakdown .wb-check { color: #3fb950; }
  .wake-breakdown .wb-dot::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.5;
  }
  .wake-breakdown .wb-spin {
    border: 2px solid rgba(88,166,255,0.30);
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: wb-spin-rot 0.7s linear infinite;
  }
  @keyframes wb-spin-rot { to { transform: rotate(360deg); } }
  .wake-breakdown .wb-readout {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    padding-top: 2px;
    border-top: 1px solid rgba(139,148,158,0.18);
  }
  .wake-breakdown .wb-readout.is-amber { color: #d29922; }
  .wake-breakdown .wb-readout.is-red { color: #f85149; font-weight: 600; }
  .conv-live-tool-inline .cl-dismiss:hover { opacity: 1; }
  .conv-live-tool-inline.is-question {
    color: #58a6ff;
    background: linear-gradient(rgba(88,166,255,0.12), rgba(88,166,255,0.12)), var(--bg);
    border-color: rgba(88,166,255,0.4);
    cursor: default;
  }
  .conv-live-tool-inline .cl-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: #FBCA04; box-shadow: 0 0 6px rgba(251,202,4,0.7);
    animation: pulse 1.4s infinite;
    flex: 0 0 8px;
  }
  .conv-live-tool-inline.in-flight .cl-pulse {
    background: #58a6ff; box-shadow: 0 0 6px rgba(88,166,255,0.7);
    animation: pulse 1.0s infinite;
  }
  .conv-live-tool-inline .cl-tool { font-weight: 600; }
  .conv-live-tool-inline .cl-file { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .conv-live-tool-inline .cl-file.is-command {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    flex: 1 1 320px;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .conv-live-tool-inline:not(.is-expanded) .cl-file.is-command {
    display: none;
  }
  .conv-live-tool-inline.is-expanded .cl-file.is-command {
    display: block;
    flex: 1 1 100%;
    max-height: 7.5em;
    margin-left: 16px;
    overflow: auto;
  }
  .conv-live-tool-inline .cl-age { color: var(--text-muted); font-size: 11px; margin-left: auto; flex: 0 0 auto; }
  .conv-live-tool-inline .cl-approval-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .conv-live-tool-inline .cl-approval-btn {
    border: 1px solid color-mix(in srgb, #58a6ff 55%, var(--border) 45%);
    background: color-mix(in srgb, #58a6ff 10%, transparent 90%);
    color: #9ecbff;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
  }
  .conv-live-tool-inline .cl-approval-btn:hover { background: color-mix(in srgb, #58a6ff 18%, transparent 82%); }
  .conv-live-tool-inline .cl-approval-btn:disabled { opacity: 0.55; cursor: default; }
  .conv-live-tool-inline .cl-approval-btn.is-negative {
    border-color: color-mix(in srgb, #f85149 48%, var(--border) 52%);
    background: color-mix(in srgb, #f85149 8%, transparent 92%);
    color: #ffb3ad;
  }
  /* Non-actionable hint shown when a Claude permission prompt can't be answered
     from CCC (Linux/headless host has no keystroke route) — point at the terminal. */
  .conv-live-tool-inline .cl-approval-note {
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted, #8b949e);
    white-space: nowrap;
    font-style: italic;
  }
  /* Grab-back escape hatch shown in the approval strip when the approval is
     owned externally and can't be answered from CCC. Match the approval-button
     sizing so the dead-end always has one styled, actionable control. */
  .conv-live-tool-inline .ccs-grab-back {
    border: 1px solid color-mix(in srgb, #6ea8fe 55%, var(--border) 45%);
    background: transparent;
    color: #6ea8fe;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
  }
  .conv-live-tool-inline .ccs-grab-back:hover { background: color-mix(in srgb, #6ea8fe 14%, transparent 86%); }
  .conv-live-tool-inline .ccs-grab-back:disabled,
  .conv-live-tool-inline .ccs-grab-back.is-busy { opacity: 0.55; cursor: default; }
  @media (max-width: 700px) {
    .conv-live-tool-inline {
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      padding: 6px 8px;
      margin: 8px 0;
      font-size: 11.5px;
    }
    .conv-live-tool-inline .cl-approval-actions {
      flex: 1 1 100%;
      justify-content: flex-end;
      flex-wrap: wrap;
    }
    .conv-live-tool-inline .cl-pulse {
      width: 7px;
      height: 7px;
      flex-basis: 7px;
    }
    .conv-live-tool-inline .cl-tool {
      white-space: nowrap;
      min-width: 0;
    }
    .conv-live-tool-inline .cl-age {
      font-size: 10.5px;
      margin-left: auto;
      white-space: nowrap;
    }
    .conv-live-tool-inline.is-expanded {
      flex-wrap: wrap;
      align-items: flex-start;
    }
    .conv-live-tool-inline.is-expanded .cl-file.is-command {
      max-height: 5.2em;
      margin-left: 13px;
      font-size: 11px;
    }
  }
  .cl-agy-wake-btn {
    flex-shrink: 0;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border) 45%);
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s, opacity 0.15s;
  }
  .cl-agy-wake-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent 88%); }
  .cl-agy-wake-btn:disabled { opacity: 0.5; cursor: default; }
  .conv-live-tool-inline.is-generating {
    color: var(--text-muted); background: rgba(139,148,158,0.08); border-color: rgba(139,148,158,0.20);
  }
  .conv-live-tool-inline.is-generating .cl-pulse {
    background: var(--text-muted); box-shadow: none; animation: pulse 1.6s infinite;
  }
  .conv-live-tool-inline.is-done {
    color: var(--green, #3fb950); background: rgba(63,185,80,0.08); border-color: rgba(63,185,80,0.25);
  }
  .conv-live-tool-inline.is-done .cl-done-check { font-size: 11px; font-weight: 700; margin-right: 2px; }
  .conv-live-tool-strip .cl-question-detail,
  .conv-live-tool-inline .cl-question-detail {
    flex: 1 1 calc(100% - 16px);
    min-width: 0;
    margin: 2px 0 0 16px;
    padding: 8px 10px;
    border-left: 3px solid rgba(88,166,255,0.55);
    border-radius: 4px;
    background: rgba(88,166,255,0.08);
    color: var(--text);
  }
  .conv-live-tool-strip .cl-question-header,
  .conv-live-tool-inline .cl-question-header {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 3px;
    letter-spacing: 0.02em;
  }
  .conv-live-tool-strip .cl-question-preamble,
  .conv-live-tool-inline .cl-question-preamble {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .conv-live-tool-strip .cl-question-text,
  .conv-live-tool-inline .cl-question-text {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .conv-live-tool-strip .cl-question-options,
  .conv-live-tool-inline .cl-question-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 7px 0 0;
    padding: 0;
  }
  .conv-live-tool-strip .cl-question-options li,
  .conv-live-tool-inline .cl-question-options li {
    display: block;
    min-width: 0;
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid rgba(88,166,255,0.28);
    border-radius: 5px;
    background: rgba(88,166,255,0.08);
    color: var(--text);
    font-size: 13px;
    line-height: 1.3;
  }
  .conv-live-tool-strip .cl-question-option-btn,
  .conv-live-tool-inline .cl-question-option-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .conv-live-tool-strip .cl-question-option-btn:hover .cl-question-option-label,
  .conv-live-tool-inline .cl-question-option-btn:hover .cl-question-option-label,
  .conv-live-tool-strip .cl-question-option-btn:focus-visible .cl-question-option-label,
  .conv-live-tool-inline .cl-question-option-btn:focus-visible .cl-question-option-label {
    color: var(--accent);
  }
  .conv-live-tool-strip .cl-question-option-btn:focus-visible,
  .conv-live-tool-inline .cl-question-option-btn:focus-visible {
    outline: 2px solid rgba(88,166,255,0.55);
    outline-offset: 3px;
    border-radius: 4px;
  }
  .conv-live-tool-strip .cl-question-option-btn.is-submitting,
  .conv-live-tool-inline .cl-question-option-btn.is-submitting {
    cursor: progress;
    opacity: 0.72;
  }
  .conv-live-tool-strip .cl-question-options li.is-utility,
  .conv-live-tool-inline .cl-question-options li.is-utility {
    border-style: dashed;
    background: rgba(139,148,158,0.08);
  }
  .conv-live-tool-strip .cl-question-option-label,
  .conv-live-tool-inline .cl-question-option-label {
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  .conv-live-tool-strip .cl-question-option-desc,
  .conv-live-tool-inline .cl-question-option-desc {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  /* When the live-tool strip is present above the sticky header, push the
     header down so they don't both stick at y=0 and overlap.
     `top: 24px` deliberately *underlaps* the strip's bottom edge by a few
     pixels — the strip is z-index 9 and opaque, so its lower border paints
     over the header's top, while guaranteeing no transparent gap exposes
     the conversation events scrolling underneath. (Strip height varies
     with the user-agent's default line-height for 12px text, ~26-32px.) */
  .conversations-view:has(.conv-live-tool-strip) .conv-sticky-header {
    top: var(--live-strip-offset, 24px);
  }

  /* ── Inline relayed-question card ─────────────────────────────────
     Renders inside `.conversations-view` so it inherits the conv pane's
     font stack (no separate modal typography). Pinned via position:
     sticky to stay in view as the user scrolls through the surrounding
     conversation. Replaces the old .ccc-question-modal overlay; classes
     reused from the .cl-question-* visual language. */
  .ccc-inline-question {
    /* CCC-46: flow inline at the END of the transcript (where the question was
       actually asked) instead of sticky-overlaying the conversation. The user
       called the sticky overlay "blocking the conversation" — now it reads as
       the last item in the thread and you scroll to it like any other turn. */
    position: relative; z-index: 1;
    margin: 18px 12px 12px;
    padding: 14px 16px;
    border: 1px solid rgba(88, 166, 255, 0.45);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 92%, rgba(88,166,255,0.16));
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
    /* Inherit conv pane font stack — no modal-specific typography. */
    font: inherit;
    color: var(--text);
  }
  .ccc-inline-question .ccc-iq-title {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
  }
  /* CCC-46: the lead-in context the question is about. Muted, slightly
     indented, capped so a long preamble doesn't dominate the card. */
  .ccc-inline-question .ccc-iq-context {
    font-size: 12.5px; line-height: 1.5;
    color: var(--text-muted);
    white-space: pre-wrap;
    max-height: 22vh; overflow-y: auto;
    margin-bottom: 12px; padding: 8px 10px;
    border-left: 2px solid rgba(88,166,255,0.4);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    border-radius: 4px;
  }
  .ccc-inline-question .ccc-q-blocks {
    display: flex; flex-direction: column; gap: 14px;
  }
  .ccc-inline-question .ccc-q-block {
    padding: 10px 12px;
    border-left: 3px solid rgba(88,166,255,0.55);
    border-radius: 4px;
    background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  }
  /* CCC-46: header (the option-group label, e.g. "Apartment") vs the question
     line — give them hierarchy instead of two identical stacked lines. */
  .ccc-inline-question .cl-question-header {
    display: block; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-muted); margin-bottom: 3px;
  }
  .ccc-inline-question .cl-question-text {
    display: block; font-weight: 600; color: var(--text);
    margin-bottom: 2px;
  }
  .ccc-inline-question .ccc-q-multi-hint {
    color: var(--text-muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.4px;
    margin: 4px 0 2px;
  }
  .ccc-inline-question .ccc-q-options { margin-top: 8px; }
  /* CCC-46: option rows — label on its own line (bold), description beneath it
     (muted). Without block layout the two spans render inline and glue together
     ("2 roomsSmallest — cheapest…"). Mirrors the live-strip option styling. */
  .ccc-inline-question .cl-question-options {
    list-style: none; padding: 0; margin: 8px 0 0;
    display: flex; flex-direction: column; gap: 6px;
  }
  .ccc-inline-question .cl-question-options li {
    padding: 0;
    border: 1px solid var(--border); border-radius: 6px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    transition: border-color 0.12s ease-out, background 0.12s ease-out;
  }
  .ccc-inline-question .cl-question-options li:hover {
    border-color: rgba(88,166,255,0.55);
    background: rgba(88,166,255,0.14);
  }
  .ccc-inline-question .cl-question-option-btn {
    display: block; width: 100%; text-align: left;
    padding: 8px 11px; border: 0; background: transparent;
    color: inherit; font: inherit; cursor: pointer;
  }
  .ccc-inline-question .cl-question-option-label {
    display: block; font-weight: 600; color: var(--text);
    overflow-wrap: anywhere;
  }
  .ccc-inline-question .cl-question-option-desc {
    display: block; margin-top: 2px;
    color: var(--text-muted); font-size: 12.5px; line-height: 1.4;
    overflow-wrap: anywhere;
  }
  /* CCC-46: per-option `preview` (richer block). Hidden until the option is
     selected, so the list stays scannable; matches the native picker, which
     reveals the preview on focus. */
  .ccc-inline-question .cl-question-option-preview {
    display: none; margin-top: 7px; padding: 7px 9px;
    border-left: 2px solid rgba(88,166,255,0.45);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    color: var(--text-muted); font-size: 12px; line-height: 1.45;
    white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 3px;
  }
  .ccc-inline-question .ccc-q-option.is-selected .cl-question-option-preview {
    display: block;
  }
  .ccc-inline-question .ccc-q-option.is-selected {
    outline: 2px solid var(--accent); outline-offset: 1px;
    border-radius: 4px;
  }
  .ccc-inline-question .ccc-q-option.is-selected .cl-question-option-label {
    color: var(--accent);
  }
  .ccc-inline-question .ccc-q-custom {
    display: block; width: 100%; box-sizing: border-box;
    margin-top: 9px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font: inherit;
  }
  .ccc-inline-question .ccc-q-custom:focus {
    outline: none;
    border-color: var(--accent);
  }
  .ccc-inline-question .ccc-q-error {
    display: none;
    margin-top: 10px;
    color: var(--red);
    font-size: 12px;
  }
  .ccc-inline-question .ccc-q-error.visible { display: block; }
  .ccc-inline-question .ccc-q-actions {
    display: flex; gap: 8px; align-items: center;
    margin-top: 14px;
  }
  .ccc-inline-question .ccc-q-dismiss,
  .ccc-inline-question .ccc-q-send {
    padding: 6px 14px;
    border-radius: 5px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
  }
  .ccc-inline-question .ccc-q-dismiss {
    margin-right: auto;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
  }
  .ccc-inline-question .ccc-q-dismiss:hover {
    color: var(--text);
    background: var(--surface-2);
  }
  .ccc-inline-question .ccc-q-send {
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    font-weight: 600;
  }
  .ccc-inline-question .ccc-q-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .ccc-inline-question .ccc-q-send:hover:not(:disabled) {
    filter: brightness(1.08);
  }

  .kanban-approve-deny {
    display: flex; gap: 4px; margin-top: 4px;
  }
  .kanban-approve {
    padding: 3px 10px; border-radius: 4px; border: 1px solid rgba(63,185,80,0.4);
    background: rgba(63,185,80,0.1); color: var(--green); cursor: pointer;
    font-size: 11px; font-weight: 600;
  }
  .kanban-approve:hover { background: rgba(63,185,80,0.25); }
  .kanban-deny {
    padding: 3px 10px; border-radius: 4px; border: 1px solid rgba(248,81,73,0.4);
    background: rgba(248,81,73,0.1); color: var(--red); cursor: pointer;
    font-size: 11px; font-weight: 600;
  }
  .kanban-deny:hover { background: rgba(248,81,73,0.25); }

  /* ── Task 9: Review card actions ── */
  .kanban-review-info {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
  }
  .kanban-review-actions {
    display: flex; gap: 4px; margin-top: 4px;
  }
  .kanban-review-actions button {
    padding: 3px 10px; border-radius: 4px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); cursor: pointer;
    font-size: 11px;
  }
  .kanban-review-actions button:hover { background: var(--surface-2); }
  .kanban-sendback {
    color: var(--accent) !important; border-color: rgba(88,166,255,0.4) !important;
  }
  .kanban-archive-btn {
    color: var(--text-muted) !important;
  }
  .kanban-verify-btn {
    color: var(--green) !important; border-color: rgba(63,185,80,0.4) !important;
    background: rgba(63,185,80,0.1) !important; font-weight: 600 !important;
  }
  .kanban-verify-btn:hover { background: rgba(63,185,80,0.2) !important; }

  /* ── Mobile MVP (≤ 768px) ─────────────────────────────────────────
     Two overlay patterns:
       - Classic layout: tapping a card slides `.main` in from the right
         over the full-width sidebar. `.mobile-back-btn` slides it out.
       - Kanban-split: tapping a card slides `.conv-panel` up from the
         bottom over the full-width board. cpCloseBtn slides it down.
     Both toggled via body classes (`mobile-show-main`, `mobile-conv-open`).
  */
  .mobile-back-btn { display: none; }

  /* Reload button anchored to the bottom-right of the kanban panel itself,
     so it's in reach whether the conv-panel is open, closed, or resized, and
     doesn't float over the conv pane. */
  .kanban-panel { position: relative; }
  .kanban-reload-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 50;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(13,17,23,0.85);
    border: 1px solid var(--border);
    color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; line-height: 1; cursor: pointer;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    font-family: inherit;
    opacity: 0.55;
    transition: opacity 0.15s, background 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }
  .kanban-reload-btn:hover { opacity: 1; background: var(--surface); }
  .kanban-reload-btn:active { background: var(--accent); color: #fff; }

  /* ── Layout-agnostic top bar (repo picker + setup banner) ──────────────
   * position:fixed so it floats above BOTH list and kanban-split modes.
   * Body is display:flex (row) — embedding it in flow would make it
   * stretch full-height. The fixed positioning sidesteps that.
   * Side-nav (52px, also fixed) sits to the left, so we offset accordingly.
   * Body padding-top below makes room for the topbar. */
  /* The .ccc-topbar lives inside the main toolbar (#convToolbar) — it was
     originally a separate fixed-position row above the sidebar/main, but
     was merged into the toolbar to recover ~33px of vertical space.
     `margin-left: auto` on the wrapper (set inline in HTML) pushes it to
     the right side of the toolbar. */
  .ccc-topbar {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px;
    box-sizing: border-box;
  }
  body { box-sizing: border-box; }

  /* Folder chip rendered inside .conv-title-row for archive entries (and
   * later for any row that wants to surface its source folder). The hue is
   * set inline via --chip-hue from a stable hash of the folder label, so
   * the same folder always gets the same color. Translucent fill so it
   * reads on both light and dark themes. */
  .conv-folder-chip {
    --chip-hue: 0;
    flex-shrink: 0;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    background: hsla(var(--chip-hue), 60%, 50%, 0.18);
    color: hsl(var(--chip-hue), 55%, 65%);
    border: 1px solid hsla(var(--chip-hue), 55%, 50%, 0.35);
    /* Fixed width so the column reads as a clean stack instead of a
       ragged-right edge. Long folder names ellipsize; the full name is
       still recoverable via the title-attribute tooltip the renderer
       emits on every chip. */
    width: 90px; max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    text-align: center;
  }
  /* Muted palette — flipped on by `body.chips-muted` (toggled from the
     sidebar header). All chromatic chips and pills collapse to a uniform
     neutral so the column reads as visual rhythm instead of a rainbow.
     This was previously auto-applied in standalone (PWA) mode with
     `!important`; moved here so it's a manual toggle that works in both
     browser and PWA contexts. */
  body.chips-muted .conv-folder-chip,
  body.chips-muted .conv-folder-group-chip,
  body.chips-muted .conv-item .conv-signal,
  body.chips-muted .conv-item .branch-badge,
  body.chips-muted .conv-item .branch-badge.is-worktree,
  body.chips-muted .conv-item .wt-tag,
  body.chips-muted .kanban-card .kanban-card-stage {
    background: var(--surface-2) !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
  }
  /* The group header's own repo/project label is the section title for
     everything under it — keep it full-brightness even in muted ("no
     colors") mode so it still reads as a heading, not another dim chip. */
  body.chips-muted .conv-folder-group-chip {
    color: var(--text) !important;
    font-weight: 700 !important;
  }
  body.chips-muted .conv-folder-group-header {
    border-left-color: rgba(139,148,158,0.45) !important;
  }
  /* CCC-467: in muted ("no colors") mode the meta-row chips lose their frame
     entirely — no border, no fill — and shrink a touch, so the folder / object
     / session-id chips read as quiet inline metadata rather than boxed pills. */
  body.chips-muted .conv-item .conv-hover-meta-row .conv-folder-chip,
  body.chips-muted .conv-item .conv-hover-meta-row .conv-object-chip,
  body.chips-muted .conv-item .conv-hover-meta-row .conv-sidebar-session-id-chip {
    border-color: transparent !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    font-size: 10px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }
  body.chips-muted .conv-item .conv-hover-meta-row .conv-sidebar-session-id-chip:hover,
  body.chips-muted .conv-item .conv-hover-meta-row .conv-object-chip:hover {
    background: rgba(139,148,158,0.10) !important;
    color: var(--text) !important;
  }
  body.chips-level .conv-folder-group[data-object-drop-zone] > .conv-folder-group-header {
    --chip-hue: var(--level-chip-hue, 190) !important;
  }
  .conv-folder-group[data-object-drop-zone^="object:"][data-object-depth="0"] > .conv-folder-group-header .conv-folder-object-title-text {
    text-transform: uppercase;
  }
  .conv-folder-chip.is-orphan {
    opacity: 0.55;
    font-style: italic;
  }
  /* Folder group header + divider used by the In Progress section in
   * multi-repo mode. Every project, including a one-session project, renders
   * through this structure so the list has one consistent visual hierarchy. */
  .conv-folder-group {
    --folder-tree-x: 17px;
    --folder-tree-color: rgba(139,148,158,0.26);
    position: relative;
  }
  /* design_handoff_sidebar_session_list (2c): the vertical tree spine that
     used to connect a lane's rows is gone. With hairline lane headers the
     grouping is already legible from the header boundary + indentation, and
     the rail added a second, louder grouping signal. Its horizontal tick
     stubs on .is-grouped-row are removed with it. */
  /* GOAL-5 object hierarchy — a group nested under another object indents by
     its depth and carries a guide rail so the day reads as a tree. Depth comes
     from a --obj-depth inline var set in _renderObjGroup. */
  .conv-folder-group.is-nested {
    margin-left: calc(var(--obj-depth, 1) * 18px);
    border-left: 1px solid var(--folder-tree-color);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  .conv-folder-group-header {
    --chip-hue: 0;
    --conv-dot-col: 16px;
    --conv-time-col: 43px;
    display: grid;
    grid-template-columns: var(--conv-dot-col) var(--conv-time-col) auto auto minmax(0, 1fr);
    column-gap: 3px;
    align-items: center;
    padding: 3px 10px 3px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    margin-top: 3px;
    /* design_handoff_sidebar_session_list (2c): hairline sticky lane header.
       The old hue-tinted band (colored fill + top/left borders) read as
       visual weight the design calls "chip/bar treatment" and asks to
       remove — cluster identity now lives in the small swatch on
       .conv-folder-group-chip (::before) instead of a colored band, and the
       boundary between lanes is one quiet hairline. Sticky + opaque so rows
       scrolling under it don't show through. */
    border-top: none;
    border-bottom: 1px solid var(--border);
    /* Must match the sidebar's own background (--surface), not --bg: sticky
       needs an opaque fill, and --bg is darker than the sidebar so it read
       as a black band sitting on top of the list. */
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .conv-folder-group-header:first-child { margin-top: 0; }
  .conv-folder-group-header:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  /* Muted ("no colors") mode: same hairline treatment, no hue at all. */
  body.chips-muted .conv-folder-group-header {
    background: var(--surface) !important;
    border-bottom-color: var(--border) !important;
  }
  /* GOAL-1 object status + immediate-objective line. Under the header; stays
     visible when the group is collapsed (it is not a .conv-item). */
  /* Object header carries an inline status + objective on the name row.
     Switch just those headers to flex so the meta flows after the name and
     the objective takes the slack; non-object headers keep their grid. */
  .conv-folder-group-header:has(.conv-object-meta) {
    display: flex; align-items: center; gap: 6px;
  }
  .conv-folder-group-header:has(.conv-object-meta) .conv-folder-group-chip {
    flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .conv-object-meta {
    display: inline-flex; align-items: baseline; gap: 8px;
    flex: 1 1 auto; min-width: 0;
    font-size: 12px; line-height: 1.3;
  }
  .conv-object-status {
    flex: 0 0 auto; font: inherit; font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.02em; text-transform: uppercase;
    padding: 1px 7px; border-radius: 999px; border: 1px solid transparent;
    cursor: pointer; background: rgba(139,148,158,0.14); color: var(--text-muted);
  }
  .conv-object-status:hover { filter: brightness(1.15); }
  .conv-object-status.is-none {
    background: transparent; border-style: dashed;
    border-color: rgba(139,148,158,0.4); opacity: 0.7; text-transform: none;
  }
  .conv-object-status.is-active  { background: rgba(63,185,80,0.18);  color: #3fb950; }
  .conv-object-status.is-waiting { background: rgba(210,153,34,0.18); color: #d29922; }
  .conv-object-status.is-blocked { background: rgba(248,81,73,0.18);  color: #f85149; }
  .conv-object-status.is-done    { background: rgba(139,148,158,0.14); color: var(--text-muted); }
  .conv-object-objective {
    flex: 1 1 auto; min-width: 0; font: inherit; font-size: 12px; text-align: left;
    background: none; border: none; cursor: text; padding: 0;
    color: var(--text); opacity: 0.9;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .conv-object-objective:hover { text-decoration: underline; text-underline-offset: 2px; }
  .conv-object-objective.is-empty { color: var(--text-muted); opacity: 0.55; }
  /* GOAL-2 — sessionless task rows (draft-sessions) under an object. */
  .conv-draft-row {
    display: flex; align-items: center; gap: 6px;
    padding: 2px 10px 2px 30px;
  }
  .conv-draft-dot { color: var(--text-muted); opacity: 0.5; font-size: 12px; flex: 0 0 auto; }
  .conv-draft-input {
    flex: 1 1 auto; min-width: 0;
    background: rgba(139,148,158,0.06);
    border: 1px solid rgba(139,148,158,0.18); border-radius: 4px;
    color: var(--text); font: inherit; font-size: 13px;
    padding: 2px 7px;
  }
  .conv-draft-input::placeholder { color: var(--text-muted); opacity: 0.6; }
  .conv-draft-input:focus { outline: none; border-color: var(--accent, #58a6ff); background: rgba(88,166,255,0.06); }
  .conv-draft-play, .conv-draft-delete {
    flex: 0 0 auto; cursor: pointer; border: none; background: none;
    color: var(--text-muted); font-size: 12px; line-height: 1;
    padding: 3px 5px; border-radius: 4px;
  }
  .conv-draft-play:hover { color: var(--accent, #3fb950); background: rgba(63,185,80,0.12); }
  .conv-draft-delete:hover { color: #f85149; background: rgba(248,81,73,0.12); }
  /* Separator before a standalone (ungrouped) session that follows a group */
  .conv-folder-group + .conv-item,
  .conv-item + .conv-folder-group {
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid rgba(139,148,158,0.12);
  }
  .conv-folder-group-arrow {
    grid-column: 1;
    width: var(--conv-dot-col);
    min-width: var(--conv-dot-col);
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    text-align: center;
    /* CCC-93: was 10px — too small to hit/see now that it's the only
       collapse affordance on object headers. */
    font-size: 18px;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
  }
  .conv-folder-group-arrow:hover { opacity: 1; color: var(--accent, #58a6ff); }
  .conv-folder-group-header[data-object-drop] {
    grid-template-columns: var(--conv-dot-col) minmax(0, auto) auto minmax(0, 1fr) auto auto;
  }
  .conv-folder-group-header[data-object-drop] .conv-folder-group-arrow {
    grid-column: 6;
    justify-self: end;
    width: auto;
    min-width: 26px;
  }
  /* design_handoff_sidebar_session_list (2c): the repo name is quiet text,
     not a colored pill — project identity moves to a small swatch square
     (::before) ahead of the name, matching the mock's "swatch, not chip"
     treatment. body.chips-level below still wants the old pill look when
     the user explicitly opts into it, so that override is untouched. */
  .conv-folder-group-chip {
    grid-column: 2 / 4;
    justify-self: start;
    min-width: 0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: hsl(var(--chip-hue), 45%, 55%, 0.14);
    color: var(--text);
    border: 1px solid hsl(var(--chip-hue), 45%, 55%, 0.28);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .conv-folder-group-chip::before {
    content: '';
    flex: 0 0 auto;
    width: 7px; height: 7px;
    border-radius: 2px;
    background: hsl(var(--chip-hue), 55%, 55%);
  }
  /* Object headers reuse this chip for a task/goal title, which has no repo
     identity color behind it — no swatch there. */
  .conv-folder-group-chip[data-role="object-title"]::before { display: none; }
  .conv-folder-group-header[data-object-drop] .conv-folder-group-chip {
    grid-column: 2;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    line-height: 1.28;
  }
  .conv-folder-group-header[data-object-drop]:has(.conv-object-meta) .conv-folder-group-chip {
    max-width: none;
  }
  .conv-folder-object-title-text {
    white-space: nowrap;
  }
  .conv-folder-object-number {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    margin-right: 2px;
  }
  .conv-folder-group-chip[data-role="object-title"] { cursor: pointer; }
  .conv-folder-group-header[data-object-drop] .conv-folder-group-count {
    grid-column: 3;
  }
  .conv-folder-group-header[data-object-drop] .conv-folder-group-chip.is-renaming {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: none;
    overflow: visible;
  }
  .conv-folder-object-title-input {
    width: min(220px, 100%);
    min-width: 80px;
    padding: 1px 7px;
    border-radius: 3px;
    border: 1px solid var(--accent, #58a6ff);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    outline: none;
  }
  .conv-folder-object-title-actions {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }
  .conv-folder-object-title-action {
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.25;
    color: var(--text-muted);
    background: rgba(139,148,158,0.12);
    border: 1px solid rgba(139,148,158,0.30);
    border-radius: 3px;
    cursor: pointer;
  }
  .conv-folder-object-title-action:hover,
  .conv-folder-object-title-action:focus-visible {
    color: var(--text);
    background: rgba(88,166,255,0.16);
    border-color: rgba(88,166,255,0.45);
    outline: none;
  }
  .conv-folder-group-chip.is-orphan { opacity: 0.55; font-style: italic; }
  /* Cluster gap: clusters read as separate blocks, not one long ribbon. */
  .conv-folder-group + .conv-folder-group {
    margin-top: 14px;
    padding-top: 6px;
  }
  .conv-folder-group-count {
    grid-column: 4;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
  }
  .conv-folder-group-live-badge {
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(63,185,80,0.16);
    color: var(--green);
  }
  .conv-folder-group-live-badge.has-attention {
    background: rgba(248,81,73,0.18);
    color: var(--red);
  }
  .conv-folder-object-actions {
    grid-column: 5;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-out;
  }
  .conv-folder-group-header:hover .conv-folder-object-actions,
  .conv-folder-group-header:focus-within .conv-folder-object-actions {
    opacity: 1;
    pointer-events: auto;
  }
  .conv-folder-object-rename-btn,
  .conv-folder-object-add-object-btn,
  .conv-folder-object-playpause-btn,
  .conv-folder-object-archive-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    padding: 0;
    font-size: 12px;
    line-height: 1;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
  }
  .conv-folder-object-rename-icon {
    display: block;
    width: 13px;
    height: 13px;
  }
  .conv-folder-object-rename-btn:hover,
  .conv-folder-object-rename-btn:focus-visible {
    color: var(--text);
    background: transparent;
    border-color: transparent;
    outline: none;
  }
  .conv-folder-object-playpause-btn:hover,
  .conv-folder-object-playpause-btn:focus-visible,
  .conv-folder-object-add-object-btn:hover,
  .conv-folder-object-add-object-btn:focus-visible,
  .conv-folder-object-archive-btn:hover,
  .conv-folder-object-archive-btn:focus-visible {
    color: var(--text);
    background: rgba(88,166,255,0.16);
    border-color: rgba(88,166,255,0.45);
    outline: none;
  }
  /* Repository actions share the flexible last header column. */
  .conv-folder-repo-actions {
    grid-column: 5;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    /* design_handoff_sidebar_session_list (2c): "Push all" / "+" reveal on
       lane hover instead of sitting on the header permanently — the ship
       status text (dirty/clean) stays visible so a scan of the list still
       shows which repos have uncommitted work without hovering. */
    opacity: 0;
    transition: opacity 0.1s ease-out;
  }
  .conv-folder-group-header:hover .conv-folder-repo-actions,
  .conv-folder-group-header:focus-within .conv-folder-repo-actions {
    opacity: 1;
  }
  .conv-folder-new-session-btn {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(139,148,158,0.30);
    border-radius: 3px;
    color: var(--text-muted);
    background: rgba(139,148,158,0.10);
    font: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
  }
  .conv-folder-new-session-btn:hover,
  .conv-folder-new-session-btn:focus-visible {
    background: rgba(88,166,255,0.18);
    border-color: rgba(88,166,255,0.45);
    color: var(--text);
    outline: none;
  }
  /* "Push all" ship control — lives alongside the new-session action. */
  .conv-folder-ship {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .conv-folder-ship-status {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    color: var(--text-muted);
  }
  .conv-folder-ship-status.has-log { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
  .conv-folder-ship-status.is-dirty { color: #d29922; }
  .conv-folder-ship-status.is-clean { color: var(--text-muted); opacity: 0.7; }
  .conv-folder-ship-status.is-ok { color: #3fb950; }
  .conv-folder-ship-status.is-error { color: #f85149; }
  .conv-folder-ship-status.is-busy { color: #58a6ff; }
  .conv-folder-ship-btn {
    flex: none;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(139,148,158,0.10);
    border: 1px solid rgba(139,148,158,0.30);
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
  }
  .conv-folder-group-header:hover .conv-folder-ship-btn,
  .conv-folder-ship-btn:focus-visible { opacity: 1; }
  .conv-archived-section .conv-folder-ship-btn { opacity: 0.72; }
  .conv-folder-ship-btn:hover:not(:disabled) {
    background: rgba(88,166,255,0.18);
    color: var(--text);
    border-color: rgba(88,166,255,0.45);
  }
  .conv-folder-ship-btn:disabled { cursor: default; opacity: 0.45; }

  /* Live "Push all" log feed — takes over the Needs-Your-Attention panel */
  .ship-log {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  }
  .ship-log-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    flex: none;
  }
  .ship-log-title { font-weight: 600; font-size: 12px; color: var(--text); }
  .ship-log-phase {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .ship-log-phase.is-busy { color: #58a6ff; background: rgba(88,166,255,0.14); }
  .ship-log-phase.is-ok { color: #3fb950; background: rgba(63,185,80,0.14); }
  .ship-log-phase.is-error { color: #f85149; background: rgba(248,81,73,0.14); }
  .ship-log-dismiss {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
  }
  .ship-log-dismiss:hover { color: var(--text); border-color: var(--text-muted); }
  .ship-log-spin {
    flex: none;
    width: 11px;
    height: 11px;
    border: 2px solid rgba(88,166,255,0.30);
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: ship-log-spin 0.7s linear infinite;
  }
  @keyframes ship-log-spin { to { transform: rotate(360deg); } }
  .ship-log-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px;
    font-size: 11.5px;
    line-height: 1.5;
    background: rgba(0,0,0,0.18);
  }
  .ship-log-line { display: flex; gap: 8px; white-space: pre-wrap; word-break: break-word; }
  .ship-log-ts { flex: none; color: var(--text-muted); opacity: 0.6; }
  .ship-log-txt { flex: 1 1 auto; color: var(--text); }
  .ship-log-line.warn .ship-log-txt { color: #d29922; }
  .ship-log-line.error .ship-log-txt { color: #f85149; }
  .ship-log-line.ok .ship-log-txt { color: #3fb950; }
  .ship-waiting-summary {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(88,166,255,0.08);
  }
  .ship-waiting-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
    overflow: hidden;
  }
  .ship-waiting-label {
    flex: none;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .ship-waiting-names {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
  }
  .ship-waiting-done {
    flex: none;
    color: #3fb950;
    font-size: 10px;
  }
  .ship-continue-btn {
    flex: none;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(88,166,255,0.45);
    background: rgba(88,166,255,0.12);
    color: #58a6ff;
  }
  .ship-continue-btn:hover:not(:disabled) {
    background: rgba(88,166,255,0.20);
    color: var(--text);
  }
  .ship-continue-btn:disabled { opacity: 0.45; cursor: default; }
  /* Approve/Reject action rows (build 3) */
  .ship-actions {
    flex: none;
    border-bottom: 1px solid var(--border);
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 38%;
    overflow-y: auto;
  }
  .ship-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: rgba(139,148,158,0.05);
  }
  .ship-verdict {
    flex: none;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 3px;
    align-self: center;
  }
  .ship-verdict.v-commit { color: #3fb950; background: rgba(63,185,80,0.15); }
  .ship-verdict.v-restore { color: #58a6ff; background: rgba(88,166,255,0.15); }
  .ship-verdict.v-drop { color: #d29922; background: rgba(210,153,34,0.15); }
  .ship-verdict.v-leave, .ship-verdict.v-review { color: var(--text-muted); background: rgba(139,148,158,0.15); }
  .ship-action-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .ship-action-label { font-size: 12px; font-weight: 600; color: var(--text); }
  .ship-action-detail { font-size: 10.5px; color: var(--text-muted); }
  .ship-action-btns { flex: none; display: flex; gap: 6px; }
  .ship-act-approve, .ship-act-reject {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
  }
  .ship-act-approve { color: #3fb950; border-color: rgba(63,185,80,0.45); }
  .ship-act-approve:hover:not(:disabled) { background: rgba(63,185,80,0.16); color: #56d364; }
  .ship-act-reject:hover:not(:disabled) { background: rgba(139,148,158,0.14); color: var(--text); }
  .ship-act-approve:disabled, .ship-act-reject:disabled { opacity: 0.4; cursor: default; }
  #convList#convList .conv-folder-group.collapsed > :not(.conv-folder-group-header),
  #convList#convList .conv-folder-group.sessions-collapsed > :not(.conv-folder-group-header),
  #convList#convList .conv-folder-group.collapsed > .conv-item,
  #convList#convList .conv-folder-group.collapsed > .conv-subagent-cluster,
  #convList#convList .conv-folder-group.collapsed > .conv-repeat-group,
  #convList#convList .conv-folder-group.collapsed > .conv-gap-separator,
  #convList#convList .conv-folder-group.collapsed > .conv-draft-row,
  #convList#convList .conv-folder-group.collapsed > .conv-object-empty-hint,
  #convList#convList .conv-folder-group.collapsed > .conv-ghissues-more,
  #convList#convList .conv-folder-group.collapsed > .conv-nya-row-block,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-item,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-subagent-cluster,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-repeat-group,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-gap-separator,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-draft-row,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-object-empty-hint,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-ghissues-more,
  #convList#convList .conv-folder-group.sessions-collapsed > .conv-nya-row-block { display: none !important; }
  #convList#convList .conv-folder-group.is-subtree-hidden { display: none !important; }
  .conv-ghissues-more {
    display: flex;
    padding: 2px 10px 3px calc(10px + var(--conv-dot-col, 9px) + var(--conv-time-col, 43px) + 6px);
  }
  .conv-ghissues-more-btn {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1.25;
    padding: 2px 0;
  }
  .conv-ghissues-more-btn:hover { color: var(--cyan); text-decoration: underline; }
  .conv-folder-group-divider {
    padding: 12px 12px 4px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border);
    margin-top: 6px;
  }
  /* In Progress section's by-project / by-time toggle. Lives inside the
   * section header next to the count, only shown when there are folder
   * chips (i.e. multi-repo mode). Each opt is a span (not a button) to
   * avoid nested-button HTML; clicks are stopPropagation'd so they don't
   * collapse the section. */
  .conv-grouping-toggle {
    display: inline-flex;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
  }
  .conv-grouping-toggle .grouping-opt {
    padding: 1px 7px;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
  }
  .conv-grouping-toggle .grouping-opt:hover:not(.is-active) {
    background: var(--surface-2);
    color: var(--text);
  }
  .conv-grouping-toggle .grouping-opt.is-active {
    background: var(--accent);
    color: #fff;
  }
  .conv-inprogress-tools,
  .conv-ghissues-tools,
  .conv-archived-tools {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }
  .conv-inprogress-tools .conv-grouping-toggle,
  .conv-ghissues-tools .conv-grouping-toggle,
  .conv-archived-tools .conv-grouping-toggle { margin-left: 0; }
  .conv-archived-engine-filter {
    display: inline-flex;
    align-items: stretch;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: visible;
  }
  .conv-archived-engine-trigger {
    width: 24px;
    height: 22px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.66;
  }
  .conv-archived-engine-trigger.is-filtered {
    opacity: 1;
    background: color-mix(in srgb, currentColor 14%, transparent);
    box-shadow: inset 0 0 0 1px currentColor;
    border-radius: 3px;
  }
  .conv-archived-engine-trigger:hover {
    background: var(--surface-2);
    opacity: 1;
  }
  .conv-archived-engine-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }
  .conv-archived-engine-trigger .conv-session-svg {
    width: 13px;
    height: 13px;
    display: block;
  }
  /* Hover/click opens a popup rather than widening the toolbar and moving
     the controls under the pointer. It opens rightward from its trigger so
     options remain reachable when the toolbar puts that trigger at the
     narrow rail's left edge. */
  .conv-archived-engine-options {
    display: inline-flex;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: max-content;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1;
    transition: opacity 0.15s ease;
  }
  .conv-archived-engine-filter.is-expanded .conv-archived-engine-options {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
  .conv-archived-engine-btn {
    width: 24px;
    height: 22px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    opacity: 0.66;
  }
  .conv-archived-engine-btn:last-child { border-right: 0; }
  .conv-archived-engine-btn:hover {
    background: var(--surface-2);
    opacity: 1;
  }
  .conv-archived-engine-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }
  .conv-archived-engine-btn .conv-session-svg {
    width: 13px;
    height: 13px;
    display: block;
  }
  .conv-archived-engine-trigger.is-filtered.claude,
  .conv-archived-engine-btn.claude { color: var(--engine-claude); }
  .conv-archived-engine-trigger.is-filtered.codex,
  .conv-archived-engine-btn.codex { color: var(--engine-codex); }
  .conv-archived-engine-trigger.is-filtered.kimi,
  .conv-archived-engine-btn.kimi { color: var(--engine-kimi); }
  .conv-archived-engine-trigger.is-filtered.devin,
  .conv-archived-engine-btn.devin { color: var(--engine-devin); }
  .conv-archived-engine-trigger.is-filtered.antigravity,
  .conv-archived-engine-btn.antigravity { color: var(--engine-antigravity); }
  .conv-archived-engine-trigger.is-filtered.grok,
  .conv-archived-engine-btn.grok { color: var(--engine-grok); }
  .conv-archived-engine-btn.is-active {
    background: color-mix(in srgb, currentColor 18%, transparent);
    box-shadow: inset 0 0 0 1px currentColor;
    opacity: 1;
  }
  .conv-objects-expand-all .grouping-opt {
    padding-left: 6px;
    padding-right: 6px;
  }
  /* Expand-all / collapse-all chip on the Archived header. Same visual
     weight as a grouping-opt so it reads as a sibling control, with a
     subtle border so the click target is obvious. */
  .conv-archived-expandall {
    font-size: 10.5px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    user-select: none;
    line-height: 1.3;
  }
  .conv-archived-expandall:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--text-muted);
  }
  /* Footer affordance when In Progress is hiding sessions outside the
     1d/7d window. Quiet by default — appears only when something is
     being filtered out, and surfaces the cardinality so the user knows
     the section isn't broken (rows didn't "disappear", they got filtered).
     The "show All" CTA at the end is the click target, but the whole
     row is clickable for big-target ergonomics. */
  .conv-inprogress-window-footer {
    margin-top: 6px;
    padding: 6px 12px;
    font-size: 11.5px;
    color: var(--text-muted);
    background: rgba(139,148,158,0.05);
    border-top: 1px dashed var(--border);
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    user-select: none;
    text-align: center;
    transition: background 0.12s, color 0.12s;
  }
  .conv-inprogress-window-footer:hover {
    background: rgba(139,148,158,0.10);
    color: var(--text);
  }
  .conv-inprogress-window-footer-cta {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
  }
  .conv-inprogress-window-footer:hover .conv-inprogress-window-footer-cta {
    text-decoration-style: solid;
  }
  .conv-ghissues-refresh {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
  }
  .conv-ghissues-refresh:hover,
  .conv-ghissues-refresh:focus-visible {
    background: var(--surface-2);
    color: var(--accent);
  }
  .conv-ghissues-refresh.is-spinning {
    color: var(--accent);
    animation: ccc-spin 0.8s linear infinite;
  }
  .archive-empty-state {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
  }
  .sidebar-pagination { line-height: 1.5; }
  .sidebar-pagination .conv-window-btn {
    min-height: 36px;
    margin-bottom: 8px;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
  }
  .sidebar-pagination .conv-window-btn:hover { border-color: var(--accent); }
  .sidebar-pagination .conv-window-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  /* Explanatory archive placeholder (pre-checklist boot wait). */
  .archive-loading-placeholder .alp-title {
    font-weight: 600; color: var(--text); margin-bottom: 6px;
  }
  .archive-loading-placeholder .alp-detail {
    font-size: 11px; line-height: 1.5; color: var(--text-muted);
    max-width: 280px; margin: 0 auto;
  }

  /* ── Full-page loading overlay ──────────────────────────────────────────
   * Shown on initial load and during repo-switch. Covers everything so the
   * user sees a clear "we're working" signal instead of staring at an empty
   * dark page wondering if the app is broken. Fades out once the first
   * /api/sessions response renders. */
  .ccc-loading-overlay {
    position: fixed; inset: 0; z-index: 100001;
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px;
    transition: opacity 0.25s ease-out;
    pointer-events: all;
  }
  .ccc-loading-overlay.fade-out { opacity: 0; pointer-events: none; }
  .ccc-loading-overlay.gone { display: none; }
  /* The dashboard can finish loading behind an independently ready app. */
  html.ccc-mobile-app-open #cccLoadingOverlay { display: none; }
  .ccc-loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(88,166,255,0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ccc-spin 0.8s linear infinite;
  }
  @keyframes ccc-spin { to { transform: rotate(360deg); } }
  .ccc-loading-label {
    color: var(--text-muted); font-size: 13px; letter-spacing: 0.3px;
    text-align: center; max-width: 440px; line-height: 1.4;
  }
  .ccc-loading-label strong { color: var(--text); font-weight: 600; }
  .ccc-loading-detail {
    font-size: 11px; color: var(--text-muted); opacity: 0.6;
    margin-top: 2px;
  }
  .ccc-loading-breakdown {
    margin-top: 12px;
    display: grid;
    gap: 5px;
    min-width: min(380px, calc(100vw - 48px));
    text-align: left;
  }
  .ccc-loading-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
  }
  .ccc-loading-row-label {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ccc-loading-row-detail {
    min-width: 0;
    opacity: 0.72;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ccc-loading-count {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    opacity: 0.82;
  }
  .ccc-loading-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    background: var(--border);
  }
  .ccc-loading-row[data-state="running"] .ccc-loading-status { background: var(--accent); }
  .ccc-loading-row[data-state="done"] .ccc-loading-status { background: var(--green); }
  .ccc-loading-row[data-state="error"] .ccc-loading-status { background: var(--red); }
  .ccc-topbar-label {
    align-self: center;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.5px; font-weight: 600;
  }
  /* Generic action button in the layout-agnostic topbar (Titles, View …).
     Matches the size of the repo picker so the row reads as one strip. */
  .ccc-topbar .topbar-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 8px; border-radius: 4px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font-size: 11px; cursor: pointer; white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
  }
  .ccc-topbar .topbar-btn:hover { background: var(--surface-2); }
  .ccc-topbar .topbar-btn.active { color: var(--accent); border-color: rgba(88,166,255,0.4); }
  /* Subagent-worktree alert dot. Triggered when superpowers / orchestration
     skills have spawned locked agent worktrees (worktrees_agent_count > 0
     from /api/repo/worktrees). Pulls attention to the topbar Worktrees
     button without each session row repeating the count. */
  .ccc-topbar .topbar-btn.has-agent-worktrees { position: relative; }
  .ccc-topbar .topbar-btn.has-agent-worktrees::after {
    content: ''; position: absolute; top: 2px; right: 2px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--orange, #d29922);
    box-shadow: 0 0 0 1.5px var(--bg);
  }
  /* Right-aligned action cluster on the sidebar's title row. Keep this
     focused on navigation state: all-repos, repo picker, and board view. */
  .sidebar-header-actions {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto; flex-wrap: wrap; row-gap: 4px;
    justify-content: flex-end;
  }
  .sidebar-header-actions .sh-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); font-size: 11px; font-family: inherit;
    padding: 3px 8px; border-radius: 4px; cursor: pointer; line-height: 1.4;
  }
  .sidebar-header-actions .sh-btn:hover { background: var(--surface-2); color: var(--text); }
  .sidebar-header-actions .sh-btn.active { color: var(--accent); border-color: rgba(88,166,255,0.4); }
  .sidebar-header-actions .bug-link {
    margin-left: 0;
    border: 1px solid var(--border); border-radius: 4px;
    padding: 3px 8px; font-size: 11px; line-height: 1.4;
  }
  .sidebar-header-actions .bug-link:hover { background: var(--surface-2); color: var(--text); }
  .sh-refresh-wrap {
    position: relative; display: inline-flex; align-items: stretch;
  }
  .sh-refresh-wrap .sh-btn { margin: 0; }
  .sh-refresh-wrap .sh-refresh-btn {
    border-top-right-radius: 0; border-bottom-right-radius: 0;
    border-right: none;
    padding: 3px 7px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .sh-refresh-wrap .sh-refresh-btn svg {
    display: block;
    transform-origin: 50% 50%;
  }
  .sh-refresh-wrap .sh-refresh-caret {
    border-top-left-radius: 0; border-bottom-left-radius: 0;
    padding-left: 4px; padding-right: 4px;
    font-size: 9px;
  }
  .sh-refresh-wrap.spinning .sh-refresh-btn svg {
    animation: sh-refresh-spin 0.6s linear;
  }
  @keyframes sh-refresh-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
  .sh-refresh-menu {
    position: absolute; top: calc(100% + 4px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; padding: 4px;
    min-width: 160px; z-index: 200;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  }
  .sh-refresh-menu-item {
    display: block; width: 100%; text-align: left;
    background: transparent; border: none; color: var(--text);
    padding: 6px 10px; font-size: 12px; border-radius: 4px;
    cursor: pointer; font-family: inherit; line-height: 1.3;
  }
  .sh-refresh-menu-item:hover { background: var(--surface-2); }
  .sh-refresh-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }
  /* CCC-172: localhost pill dropdown — mirrors the refresh caret/menu. */
  .localhost-wrap { position: relative; display: inline-flex; align-items: stretch; }
  .localhost-wrap #localhostPill { border-top-right-radius: 0; border-bottom-right-radius: 0; }
  .localhost-wrap .localhost-caret {
    border-top-left-radius: 0; border-bottom-left-radius: 0;
    border-left: none;
    padding: 0 5px; font-size: 9px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .localhost-menu {
    position: absolute; top: calc(100% + 4px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; padding: 4px;
    min-width: 170px; z-index: 200;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  }
  .localhost-menu-item {
    display: block; width: 100%; text-align: left;
    background: transparent; border: none; color: var(--text);
    padding: 6px 10px; font-size: 12px; border-radius: 4px;
    cursor: pointer; font-family: inherit; line-height: 1.3;
  }
  .localhost-menu-item:hover { background: var(--surface-2); }
  .localhost-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }
  #convList .conv-ghissues-tools + .conv-ghissues-count { margin-left: 0; }
  .ccc-setup-banner {
    flex: 1; display: none; align-items: center;
    padding: 0 10px; border-left: 1px solid var(--border);
    font-size: 11px; line-height: 1.3; min-width: 0;
    overflow: hidden;
  }
  .ccc-setup-banner.has-issues { display: flex; }
  .ccc-setup-banner.is-ok { color: var(--text-muted); opacity: 0.8; }
  .ccc-setup-banner-rows { display: flex; gap: 14px; flex-wrap: wrap; }
  .ccc-setup-row { display: flex; align-items: center; gap: 4px; }
  .ccc-setup-row .icon { font-weight: 700; }
  .ccc-setup-row.ok .icon { color: var(--green); }
  .ccc-setup-row.warn .icon { color: var(--orange); }
  .ccc-setup-row.error .icon { color: var(--red); }

  /* ── Attention panel (bottom-mounted, opens upward on demand) ───────────
   * Lives BELOW the kanban so the kanban gets the prime real estate by
   * default. Collapsed by default — the user expands it when they want
   * to triage. The drag handle is on TOP of the panel; dragging up grows
   * the panel (and shrinks the kanban above). */
  .attention-panel {
    flex: 0 0 auto;
    max-height: 25vh;
    padding: 6px 12px 8px;
    background: linear-gradient(rgba(248,81,73,0.04), rgba(248,81,73,0.04)), var(--surface);
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: relative;
    box-sizing: border-box;
  }
  .attention-panel[style*="height"] { max-height: none; }
  /* Collapsed = fully hidden now that the NYA header is gone. The panel only
     appears when the Push-all ship-log feed un-collapses it. */
  .attention-panel.collapsed { display: none; }
  .attention-resize-handle {
    position: absolute; left: 0; right: 0; top: 0;
    height: 10px; cursor: ns-resize;
    display: flex; align-items: center; justify-content: center;
    z-index: 6; touch-action: none; user-select: none;
    background: transparent;
    transition: background 0.12s;
  }
  .attention-resize-handle::before {
    content: ''; display: block;
    width: 40px; height: 3px; border-radius: 2px;
    background: rgba(139,148,158,0.45);
    transition: background 0.12s, width 0.12s;
  }
  .attention-resize-handle:hover::before,
  .attention-resize-handle.is-dragging::before {
    background: var(--accent);
    width: 60px;
  }
  .attention-resize-handle:hover,
  .attention-resize-handle.is-dragging {
    background: rgba(88,166,255,0.08);
  }
  .attention-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    color: var(--text-muted); letter-spacing: 0.5px;
    padding: 4px 0; position: sticky; top: 0;
    background: var(--surface);
  }
  .att-count {
    background: rgba(248,81,73,0.18); color: var(--red);
    font-size: 10px; padding: 1px 7px; border-radius: 10px; font-weight: 700;
  }
  .att-count:empty { display: none; }
  .att-toggle {
    margin-left: auto; background: transparent; border: none; color: var(--text-muted);
    font-size: 12px; cursor: pointer; padding: 2px 6px;
  }
  .attention-panel.collapsed .att-toggle { transform: rotate(-90deg); }

  /* ── Files panel / right-rail queue list ──────────────────────────── */
  .files-panel {
    flex: 0 0 auto;
    max-height: 35vh;
    padding: 6px 12px 8px;
    background: linear-gradient(rgba(88,166,255,0.03), rgba(88,166,255,0.03)), var(--surface);
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: relative;
    box-sizing: border-box;
  }
  body.status-pos-right .status-rail-pane > .files-panel {
    flex: 0 0 auto;
    height: auto !important;
    max-height: none;
    min-height: 0;
    padding: 8px 12px 10px;
    border-top: none;
    background: transparent;
  }
  body.status-pos-right .status-rail-pane > .files-queue-panel {
    flex: 1 1 auto;
  }
  .shared-queue-host-rail {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
  }
  body.status-pos-right .shared-queue-host-rail > .files-queue-panel {
    flex: 1 1 auto;
    min-width: 0;
    height: auto !important;
    max-height: none;
    min-height: 0;
    /* CCC-976: a touch more breathing room above the Queue tab's header row. */
    padding: 14px 12px 10px;
    border-top: none;
    background: transparent;
  }
  body.status-pos-right .status-rail-pane > .files-panel .files-resize-handle {
    display: none;
  }
  .files-panel[style*="height"] { max-height: none; }
  .files-panel.collapsed { max-height: 32px; height: 32px !important; overflow: hidden; padding-top: 0; padding-bottom: 0; }
  .files-panel.collapsed .files-list { display: none; }
  .files-panel.collapsed .files-resize-handle { display: none; }
  .files-panel.collapsed .files-header { cursor: pointer; }
  .files-panel.collapsed:hover { background: linear-gradient(rgba(88,166,255,0.06), rgba(88,166,255,0.06)), var(--surface); }

  .files-resize-handle {
    position: absolute; left: 0; right: 0; top: 0;
    height: 10px; cursor: ns-resize;
    display: flex; align-items: center; justify-content: center;
    z-index: 6; touch-action: none; user-select: none;
    background: transparent;
    transition: background 0.12s;
  }
  .files-resize-handle::before {
    content: ''; display: block;
    width: 40px; height: 3px; border-radius: 2px;
    background: rgba(139,148,158,0.45);
    transition: background 0.12s, width 0.12s;
  }
  .files-resize-handle:hover::before,
  .files-resize-handle.is-dragging::before {
    background: var(--accent);
    width: 60px;
  }
  .files-resize-handle:hover,
  .files-resize-handle.is-dragging {
    background: rgba(88,166,255,0.08);
  }

  .files-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    color: var(--text-muted); letter-spacing: 0.5px;
    padding: 4px 0; position: sticky; top: 0;
    background: var(--surface);
  }
  .files-queue-panel .files-header { flex-wrap: wrap; gap: 4px; }
  .files-count {
    background: rgba(88,166,255,0.18); color: var(--accent, #58a6ff);
    font-size: 10px; padding: 1px 7px; border-radius: 10px; font-weight: 700;
  }
  .files-count:empty { display: none; }
  /* ── Queue picker redesign ────────────────────────────────────────────
     Replaces the native <select> with a trigger pill + anchored card
     (desktop) / bottom sheet (mobile). See design handoff for the spec.
     All hex values are verbatim from the handoff; CCC tokens are NOT
     substituted because none of the palette below matches an existing
     token exactly (the handoff forbids "close" substitutions). */
  .files-queue-panel { position: relative; }
  /* Field row: QUEUE label + trigger + add/more + ALL/OPEN. No wrap — the
     trigger truncates, not the controls. */
  .files-queue-panel .fq-field-row {
    flex-wrap: nowrap; gap: 8px; padding: 11px 14px 10px;
    align-items: center;
  }
  .fq-field-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; font-weight: 500; color: #6e7681;
    letter-spacing: 0.06em; flex: 0 0 auto;
    text-transform: none; /* already uppercase in markup */
  }
  /* Trigger pill — the main field-row element. flex 1 so it takes the row.
     overflow: hidden so a very long queue name can't push the row wider than
     the panel (which would spill past the rail edge and stack onto rows below). */
  .fq-trigger {
    flex: 1 1 auto; display: flex; align-items: center; gap: 9px;
    padding: 6px 10px; background: #161b22; border: 1px solid #2b323b;
    border-radius: 6px; cursor: pointer; min-width: 0; overflow: hidden;
    position: relative; z-index: 51; /* sits above the picker scrim */
    transition: border-color .12s, background .12s;
  }
  .fq-trigger:hover { border-color: #3f4854; background: #1c2129; }
  .fq-trigger.is-open { border-color: #39d2c0; background: #1c2129; }
  .fq-trigger.is-loading { opacity: 0.7; cursor: wait; }
  .fq-trigger:focus-visible { outline: none; border-color: #39d2c0; }
  /* Live dot (pulsing) on the trigger — only when the queue has a runner. */
  .fq-qp-live {
    flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%;
    background: #39d2c0; animation: qPulse 2s ease-in-out infinite;
  }
  .fq-qp-live-spacer { flex: 0 0 6px; width: 6px; }
  .fq-trigger .fq-qp-trig-name {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px; font-weight: 600; color: #e6edf3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    /* The selected queue's name is the point of the pill: it never yields
       space to the repo or the status cluster, and only a very long name
       truncates, at its own cap (CCC-176). */
    flex: 0 0 auto; max-width: 45%;
  }
  .fq-trigger .fq-qp-trig-subs {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11.5px; color: #7d8590; white-space: nowrap; flex: 0 1 auto;
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer; border-radius: 3px; padding: 0 3px;
  }
  .fq-trigger .fq-qp-trig-subs:hover { background: #21262d; color: #c9d1d9; }
  .fq-trigger .fq-qp-trig-subs.is-nosubs {
    color: #39d2c0; background: rgba(57, 210, 192, 0.12);
  }
  .fq-gh-chip {
    display: inline-flex; align-items: center; flex: 0 0 auto;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9px; font-weight: 600; color: #b48af5;
    background: #251a3a; border: 1px solid #34265a; border-radius: 3px;
    padding: 0 4px; line-height: 1.5;
  }
  .fq-gh { color: #b48af5; }
  .fq-trigger .fq-qp-trig-repo {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; color: #565e68; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1 1 0; /* basis 0: takes only leftover room, truncates first */
  }
  .fq-trigger .fq-qp-drain {
    font-size: 9px; flex: 0 0 auto; line-height: 1;
  }
  .fq-qp-drain.is-on { color: #3fb950; }
  .fq-qp-drain.is-off { color: #3f4854; }
  .fq-trigger .fq-qp-trig-needs {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px; font-weight: 600; color: #e5695c;
    white-space: nowrap; flex: 0 0 auto;
  }
  .fq-trigger .fq-qp-trig-open {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px; color: #7d8590; white-space: nowrap; flex: 0 0 auto;
  }
  .fq-trigger .fq-qp-trig-right {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
    flex: 0 1 auto; min-width: 0; /* shrinks via the sub-queue chip */
  }
  .fq-trigger .fq-qp-chev { font-size: 10px; color: #6e7681; flex: 0 0 auto; }
  .fq-trigger.is-open .fq-qp-chev { color: #8b949e; }
  .fq-scope-busy { display: none; width: 10px; height: 10px; flex: 0 0 10px; }
  .fq-scope-busy.is-loading {
    display: inline-block;
    border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: fq-scope-spin 0.7s linear infinite;
  }
  @keyframes fq-scope-spin { to { transform: rotate(360deg); } }
  @keyframes qPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(57,210,192,.5); opacity: 1; }
    50%      { box-shadow: 0 0 0 4px rgba(57,210,192,0); opacity: .6; }
  }
  @media (prefers-reduced-motion: reduce) {
    .fq-qp-live, .fq-working-dot.pulse { animation: none; }
  }
  /* Recent queue work shares the live ticket cache with Working now. */
  .fq-recent-work {
    flex: 0 0 auto; min-width: 0; padding: 8px 14px;
    background: #0f1319; border-bottom: 1px solid #21262d;
  }
  .fq-recent-work > summary { cursor: pointer; color: #b1bac4; font-size: 11px; font-weight: 600; }
  .fq-recent-work > summary > span { color: #8b949e; font-weight: 400; margin-left: 6px; }
  .fq-recent-rows { display: grid; gap: 6px; max-height: 230px; overflow-y: auto; margin-top: 8px; }
  .fq-recent-row {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    min-width: 0; width: 100%; padding: 8px; text-align: left; font: inherit;
    background: #12181f; border: 1px solid #232b34; border-radius: 6px; cursor: pointer;
  }
  .fq-recent-row:hover { border-color: #3f4854; }
  .fq-recent-row:focus-visible { outline: 2px solid #58a6ff; outline-offset: -2px; }
  .fq-recent-title { font-size: 12px; color: #d5dde5; overflow-wrap: anywhere; }
  .fq-recent-ref { color: #8b949e; font-family: 'JetBrains Mono', ui-monospace, monospace; }
  .fq-recent-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: #8b949e; font-size: 10.5px; overflow-wrap: anywhere; }
  .fq-recent-state { color: #d29922; }
  .fq-recent-state.is-resolved { color: #39d2c0; }
  .fq-recent-resolved { display: none; color: #8b949e; white-space: nowrap; }
  .fq-recent-time { color: #8b949e; font-size: 10px; overflow-wrap: anywhere; }
  .fq-recent-summary { color: #b1bac4; font-size: 11px; white-space: pre-line; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .fq-recent-details { font-size: 10px; color: #58a6ff; }
  .fq-recent-empty { color: #8b949e; font-size: 11px; padding: 6px 0; }
  #queuePanel.fq-mobile .fq-recent-rows { max-height: 190px; }
  /* ── Workers lane activity block (CCC-1061) ────────────────────────────
     WORKING NOW and the recently-worked list moved out of the Queues panel
     and into the Workers tab. They keep their .fq-* classes (same renderers,
     same markup) and only override what the narrower, already-scrolling
     sidebar column needs. */
  .conv-workers-activity { display: block; margin: 0 0 9px; }
  .conv-workers-activity .fq-working-strip,
  .conv-workers-activity .fq-recent-work {
    padding-left: 10px; padding-right: 10px;
    background: #0c1014; border: 1px solid #1b222b; border-radius: 8px;
  }
  .conv-workers-activity .fq-working-strip { margin-bottom: 6px; }
  /* Queue health: one wrapping line of chips below WORKING NOW, above the
     recently-worked list. Counts first (is anything draining), alarms only
     when there is one — a strip that shows a green "all clear" chip every
     day stops being read. */
  .wa-health {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
    padding: 0 2px 7px;
  }
  .wa-health:empty { display: none; }
  .wa-chip {
    display: inline-flex; align-items: baseline; gap: 4px;
    padding: 2px 7px; border-radius: 999px; cursor: default;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; letter-spacing: .01em;
    border: 1px solid #232b34; background: #12181f; color: #8b949e;
  }
  .wa-chip b { font-weight: 600; color: #b1bac4; }
  .wa-chip.is-warn { border-color: #4a3a12; background: #1d1707; color: #d29922; }
  .wa-chip.is-warn b { color: #e3b341; }
  .wa-chip.is-bad { border-color: #5c2626; background: #1f1010; color: #f0776c; }
  .wa-chip.is-bad b { color: #ff9f97; }
  /* History is secondary to live sessions, even when expanded. */
  .conv-workers-activity .fq-recent-rows { max-height: 220px; gap: 0; }
  .conv-workers-activity .fq-recent-work {
    background: transparent; border: 0; border-bottom: 1px solid var(--border);
    border-radius: 0; padding: 8px 10px;
  }
  .conv-workers-activity .fq-recent-work > summary { color: var(--text); font-size: 12px; }
  .conv-workers-activity .fq-recent-work > summary > span { color: var(--text-muted); }
  .conv-workers-activity .fq-recent-work > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .conv-workers-activity .fq-recent-row.is-brief {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
    padding: 9px 0; border: 0; border-bottom: 1px solid var(--border);
    border-radius: 0; background: transparent;
  }
  .conv-workers-activity .fq-recent-row:hover { background: var(--surface-2); }
  .conv-workers-activity .fq-recent-title { color: var(--text); }
  .conv-workers-activity .fq-recent-ref,
  .conv-workers-activity .fq-recent-meta,
  .conv-workers-activity .fq-recent-resolved { color: var(--text-muted); }
  .conv-workers-activity .fq-recent-row.is-brief .fq-recent-meta { gap: 8px; }
  .conv-workers-activity .fq-recent-state { color: var(--text-muted); }
  .conv-workers-activity .fq-recent-state.is-resolved { color: var(--text-muted); }
  @media (max-width: 480px) {
    .conv-workers-activity .fq-recent-row.is-brief { grid-template-columns: minmax(0, 1fr); }
  }
  /* Three pieces of per-card chrome cost more than they pay for in this
     column, so the detailed tier drops them: the absolute timestamp (still in
     the tooltip, and the relative one is what you scan), the "Full details"
     line (the whole card is already the click target), and the third line of
     a long title. Together they take a card from ~129px to ~98px, which is
     what lets all ten rows fit without a scroll fold. */
  .conv-workers-activity .fq-recent-abs,
  .conv-workers-activity .fq-recent-details { display: none; }
  .conv-workers-activity .fq-recent-row.is-detailed .fq-recent-title {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  }
  /* Worker id is the least useful of the three trailing fields at this width;
     queue and elapsed answer "where" and "how long", which is the question. */
  .conv-workers-activity .fq-working-worker,
  .conv-workers-activity .fq-working-worker-age { display: none; }
  /* The ticket ref already names its queue; dropping the repeat leaves the
     title room next to the claim chips (CCC-1242). Idle rows keep it. */
  .conv-workers-activity .fq-working-row.has-ref .fq-working-queue { display: none; }
  /* Too narrow for title and chips on one line: chips drop to a second line
     under the title, so only rows holding extra claims grow. Desktop rows
     only; the stacked is-mobile row already has its own meta line, and a
     zero flex-basis there collapses the title to nothing. */
  .conv-workers-activity .fq-working-row:not(.is-mobile) { flex-wrap: wrap; row-gap: 3px; }
  .conv-workers-activity .fq-working-row:not(.is-mobile) .fq-working-title { flex: 1 1 0; }
  .conv-workers-activity .fq-working-row:not(.is-mobile) .fq-working-chips { order: 10; flex: 1 0 100%; margin-left: 0; padding-left: 2px; }
  /* Stacked row: chips sit on the meta line after "queue · age". */
  .fq-working-row.is-mobile .fq-working-chips { vertical-align: middle; }
  /* A ticket reference is the durable identity in this narrow Workers strip;
     let its natural width win and truncate the title instead. */
  .conv-workers-activity .fq-working-id {
    flex: 0 0 auto;
    overflow: visible;
    text-overflow: clip;
  }
  /* Top-3 detailed, the rest brief. The brief tier drops the body, timestamp
     and "Full details" affordance down to a single title line, so ten rows
     cost about what three used to and the session feed below stays reachable.
     Nothing is lost: the brief rows carry their body in the title tooltip and
     still open the full ticket on click. */
  .fq-recent-row.is-brief {
    flex-direction: row; align-items: baseline; gap: 8px; padding: 4px 8px;
  }
  .fq-recent-row.is-brief .fq-recent-summary,
  .fq-recent-row.is-brief .fq-recent-time,
  .fq-recent-row.is-brief .fq-recent-details { display: none; }
  .fq-recent-row.is-brief .fq-recent-title {
    flex: 1 1 auto; min-width: 0; font-size: 11.5px; overflow-wrap: normal;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .fq-recent-row.is-brief .fq-recent-meta {
    flex: 0 0 auto; gap: 8px; font-size: 10px; flex-wrap: nowrap;
  }
  .fq-recent-row.is-brief .fq-recent-meta > span:not(.fq-recent-state) { display: none; }
  .fq-recent-row.is-brief .fq-recent-resolved { display: inline; }
  /* One hairline marks where the detailed tier ends, so the size change reads
     as a deliberate tier and not as rows that failed to load. */
  .fq-recent-row.is-detailed + .fq-recent-row.is-brief {
    margin-top: 3px; padding-top: 7px; border-top: 1px solid #1b222b;
  }
  /* ── WORKING NOW strip ──────────────────────────────────────────────── */
  .fq-working-strip {
    flex: 0 0 auto; padding: 8px 14px 11px;
    background: #0f1319; border-top: 1px solid #171d24; border-bottom: 1px solid #21262d;
  }
  .fq-working-head {
    display: flex; align-items: center; gap: 9px; padding-bottom: 7px;
  }
  .fq-working-head.is-only { padding-bottom: 0; }
  .fq-working-dot {
    flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%;
    background: #39d2c0; animation: qPulse 2s ease-in-out infinite;
  }
  .fq-working-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; font-weight: 600; color: #8b949e;
    letter-spacing: 0.07em;
  }
  .fq-working-summary {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; color: #4b535d;
  }
  .fq-working-rows { display: flex; flex-direction: column; gap: 5px; }
  .fq-working-row {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 8px; background: #12181f; border: 1px solid #232b34;
    border-radius: 6px; cursor: pointer; min-width: 0;
    transition: border-color .12s;
  }
  .fq-working-row:hover { border-color: #3f4854; }
  .fq-working-id {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px; color: #6e7681; flex: 0 0 40px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* CCC-1035: engine glyph + $-tier (shared .conv-session-icon markup) laid
     inline in the flex row. The conv-list positions the icon absolutely, so
     give it a relative box here for the absolute tier/activity children. */
  .fq-working-engine {
    position: relative; display: inline-flex; align-items: center;
    flex: 0 0 36px; height: 16px; margin-left: 2px;
  }
  .fq-working-engine .conv-session-icon {
    position: relative; display: inline-flex; align-items: center;
    justify-content: flex-start; width: 36px; height: 16px; padding-left: 2px;
  }
  .fq-working-engine .conv-session-svg { display: block; width: 13px; height: 13px; }
  .fq-working-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12.5px; color: #d5dde5; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1 1 auto;
  }
  .fq-working-right {
    display: flex; align-items: center; gap: 9px; flex: 0 0 auto;
    margin-left: auto;
  }
  /* CCC-1050: one-click worker kill. Hidden until the row is hovered so the
     strip stays quiet; the button itself never triggers the row's
     ticket-open click (the JS handler stopPropagation()s). */
  .fq-worker-kill {
    flex: 0 0 auto;
    width: 18px; height: 18px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border-radius: 4px; cursor: pointer;
    border: 1px solid #3f4854; background: #1c242e; color: #f85149;
    font-size: 10px; opacity: 0; transition: opacity .12s;
  }
  .fq-working-row:hover .fq-worker-kill { opacity: 1; }
  .fq-worker-kill:hover { background: rgba(248,81,73,0.16); border-color: #f85149; }
  .fq-worker-kill:disabled { opacity: .5; cursor: progress; }
  /* CCC-1148: jump to the worker's CCC session. Same hover-reveal contract
     as the kill button; neutral accent since it navigates rather than
     destroys. */
  .fq-worker-session {
    flex: 0 0 auto;
    width: 18px; height: 18px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border-radius: 4px; cursor: pointer;
    border: 1px solid #3f4854; background: #1c242e; color: #7d8590;
    font-size: 10px; opacity: 0; transition: opacity .12s;
    text-decoration: none;
  }
  .fq-working-row:hover .fq-worker-session { opacity: 1; }
  .fq-worker-session:hover { color: #58a6ff; border-color: #58a6ff; }
  .fq-working-queue {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; color: #7d8590; white-space: nowrap;
  }
  .fq-working-worker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; color: #39d2c0; white-space: nowrap;
  }
  .fq-working-elapsed {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; color: #565e68; white-space: nowrap;
  }
  /* CCC-1242: worker process age, kept apart from the ticket's claim age. */
  .fq-working-worker-age {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; color: #454c55; white-space: nowrap;
  }
  /* CCC-1242: the worker's other claims (parked on needs_input, or extra
     live ones) ride as chips so the strip stays one row per worker. */
  .fq-working-chips { display: inline-flex; gap: 4px; flex: 0 0 auto; margin-left: 6px; }
  .fq-working-chip {
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; line-height: 1;
    padding: 2px 5px; border-radius: 4px; cursor: pointer; white-space: nowrap;
    border: 1px solid #3f4854; background: #1c242e; color: #7d8590;
  }
  .fq-working-chip.is-needs-input { border-color: rgba(210,153,34,0.5); color: #d29922; }
  .fq-working-chip:hover { border-color: #58a6ff; color: #58a6ff; }
  /* ── Ticket filter row ──────────────────────────────────────────────── */
  .fq-ticket-filter-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 8px 8px;
  }
  .fq-ticket-filter-row .fq-status-filter,
  .fq-ticket-filter-row .fq-type-filter { flex: 0 0 auto; }
  /* Status (All/Open) and type (All/Bugs/Features) read as one filter bar
     (CCC-1038). Spacing is tight enough that both groups share a line at the
     default 260px status rail; the search box takes the remaining width and
     wraps to its own line when there isn't room. */
  .fq-ticket-filter-row .fq-filter-btn { padding: 1px 5px; letter-spacing: 0; }
  .fq-ticket-filter-row .fq-search-input { flex-basis: 120px; }
  .fq-ticket-filter-row .fq-search-input {
    flex: 1 1 auto; min-width: 0; padding: 5px 10px;
    background: #0b0f14; border: 1px solid #21262d; border-radius: 5px;
    font-size: 12px; color: #c9d1d9;
  }
  .fq-ticket-filter-row .fq-search-input:focus { border-color: #39d2c0; outline: none; }
  .fq-ticket-filter-row .fq-search-input::placeholder { color: #565e68; }
  /* ── Picker overlay (desktop anchored card) ─────────────────────────── */
  .fq-qp {
    position: absolute; inset: 0; z-index: 50;
    display: none; pointer-events: none;
  }
  #queuePanel.fq-picker-open .fq-qp { display: block; pointer-events: auto; }
  .fq-qp-backdrop {
    position: absolute; left: 0; right: 0; bottom: 0;
    top: var(--fq-qp-top, 132px); background: rgba(8,9,12,.62);
    z-index: 50;
  }
  .fq-qp-card {
    position: absolute; left: 12px; right: 12px;
    top: calc(var(--fq-qp-top, 132px) + 12px);
    max-height: 660px; z-index: 52;
    background: #11161d; border: 1px solid #333b45; border-radius: 9px;
    box-shadow: 0 18px 44px rgba(0,0,0,.6);
    display: flex; flex-direction: column; overflow: hidden;
  }
  .fq-qp-filter {
    flex: 0 0 auto; padding: 10px 12px; border-bottom: 1px solid #21262d;
  }
  .fq-qp-filter-input {
    width: 100%; box-sizing: border-box; padding: 7px 10px;
    background: #0b0f14; border: 1px solid #2b323b; border-radius: 6px;
    font-size: 13px; color: #e6edf3; outline: none;
  }
  .fq-qp-filter-input:focus { border-color: #39d2c0; }
  .fq-qp-filter-input::placeholder { color: #565e68; }
  .fq-qp-results {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 0 6px;
  }
  .fq-qp-group { }
  .fq-qp-group-head {
    display: flex; align-items: baseline; gap: 7px; padding: 9px 13px 5px;
  }
  .fq-qp-group-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; font-weight: 600; letter-spacing: 0.09em;
  }
  .fq-qp-group-count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; color: #4b535d;
  }
  .fq-qp-row {
    display: flex; align-items: center; gap: 8px; padding: 5px 13px;
    cursor: pointer; border-left: 2px solid transparent;
  }
  .fq-qp-row:hover, .fq-qp-row.is-hl {
    background: #191f27; border-left-color: #3f4854;
  }
  .fq-qp-tree {
    width: 15px; text-align: right; font-size: 10px; color: #3f4854;
    flex: 0 0 auto;
  }
  .fq-qp-row-live {
    flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%;
    background: #39d2c0; /* static — no pulse on row dots */
  }
  .fq-qp-row-name {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12.5px; font-weight: 500; color: #d5dde5;
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .fq-qp-row-subs {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 10.5px; color: #565e68; flex: 0 0 auto; white-space: nowrap;
  }
  .fq-qp-row-repo {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; color: #565e68; white-space: nowrap; flex: 0 0 auto;
  }
  .fq-qp-row-right {
    margin-left: auto; display: flex; align-items: center; gap: 9px;
    flex: 0 0 auto;
  }
  .fq-qp-needs {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; font-weight: 600; color: #f0a79c;
    background: #3a1d18; border-radius: 3px; padding: 1px 6px;
    white-space: nowrap;
  }
  .fq-qp-open {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px; color: #7d8590; width: 26px; text-align: right;
    flex: 0 0 26px; white-space: nowrap;
  }
  .fq-qp-last {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px; color: #565e68; width: 32px; text-align: right;
    flex: 0 0 32px; white-space: nowrap;
  }
  .fq-qp-row-drain {
    width: 9px; text-align: center; font-size: 9px; flex: 0 0 9px;
  }
  .fq-qp-row-drain.is-on { color: #3fb950; }
  .fq-qp-row-drain.is-off { color: #3f4854; }
  .fq-qp-row.is-ticket .fq-qp-row-name { color: #d5dde5; }
  .fq-qp-footer {
    flex: 0 0 auto; display: flex; align-items: center; gap: 14px;
    padding: 8px 13px; border-top: 1px solid #21262d; background: #0d1117;
  }
  .fq-qp-hint {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; color: #565e68;
  }
  .fq-qp-esc {
    margin-left: auto; background: transparent; border: 0; cursor: pointer;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px; color: #6e7681; padding: 2px 6px;
  }
  .fq-qp-esc:hover { color: #e6edf3; }
  /* ── Mobile treatment (panel ≤ 620px) ─────────────────────────────────
     Trigger becomes a two-line 44pt tap target; WORKING NOW collapses to
     a header-only summary; picker becomes a bottom sheet. Triggered by
     the fq-mobile class on #queuePanel (set by _uxqPickerSyncMobile). */
  #queuePanel.fq-mobile .fq-field-row { padding: 6px 14px 12px; flex-wrap: nowrap; }
  #queuePanel.fq-mobile .fq-trigger {
    min-height: 44px; box-sizing: border-box; padding: 8px 12px;
    border-radius: 9px; gap: 9px; flex-wrap: wrap; align-content: center;
    overflow: visible; /* mobile wraps to 2 lines — must not clip */
  }
  #queuePanel.fq-mobile .fq-qp-live {
    flex: 0 0 7px; width: 7px; height: 7px;
  }
  #queuePanel.fq-mobile .fq-qp-trig-name {
    font-size: 14px; font-weight: 600;
  }
  /* Mobile trigger second line: gh chip + repo + drain + counts, all on
     one row that truncates via min-width:0 + ellipsis. */
  #queuePanel.fq-mobile .fq-qp-trig-repo { flex: 1 1 auto; min-width: 0; }
  /* The full status cluster used to stay at max-content width, so adding a
     family filter could push its chevron out of the narrow status rail.
     Give it a bounded second row and allow its compact controls to wrap. */
  #queuePanel.fq-mobile .fq-qp-trig-right {
    gap: 6px; flex: 1 1 100%; min-width: 0; flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* WORKING NOW mobile: collapsed to a header-only summary by default (the
     rows duplicate the ticket list right below and eat the whole screen —
     CCC-1019); tap the head to expand. */
  #queuePanel.fq-mobile .fq-working-strip { padding: 9px 14px 11px; }
  #queuePanel.fq-mobile .fq-working-head { padding-bottom: 8px; cursor: pointer; }
  #queuePanel.fq-mobile .fq-working-strip.is-collapsed .fq-working-head { padding-bottom: 0; }
  #queuePanel.fq-mobile .fq-working-strip.is-collapsed .fq-working-rows { display: none; }
  .fq-working-chevron { display: none; }
  #queuePanel.fq-mobile .fq-working-chevron {
    display: inline-block; margin-left: auto; color: #6e7681;
    transition: transform .15s ease;
  }
  #queuePanel.fq-mobile .fq-working-strip.is-collapsed .fq-working-chevron {
    transform: rotate(-90deg);
  }
  #queuePanel.fq-mobile .fq-working-rows { gap: 6px; }
  #queuePanel.fq-mobile .fq-working-row {
    min-height: 38px; padding: 6px 9px; border-radius: 7px; gap: 6px;
    flex-wrap: nowrap;
  }
  #queuePanel.fq-mobile .fq-working-id {
    flex: 0 0 auto; font-size: 11px;
    overflow: visible; text-overflow: clip;
  }
  /* Keyed on the row's own .is-mobile class, not #queuePanel, so the same
     rows in the Workers tab (.conv-workers-activity) get them too: without
     the min-width:0 body the title spilled past the card (CCC-1237). A phone
     row has room to wrap the title rather than truncate it. */
  .fq-working-row.is-mobile .fq-working-body {
    display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto;
  }
  .fq-working-row.is-mobile .fq-working-title {
    font-size: 12.5px; white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  }
  .fq-working-row.is-mobile .fq-working-meta {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; color: #565e68;
  }
  /* CCC-1242: ref over engine icon, so the title gets the width back. */
  .fq-working-row.is-mobile { position: relative; align-items: flex-start; }
  .fq-working-row.is-mobile .fq-working-lead {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex: 0 0 auto;
  }
  .fq-working-row.is-mobile .fq-working-dot { align-self: center; }
  /* The ticket ref is the row's identity, the engine glyph a detail: ref
     reads brighter, glyph steps back (CCC-1242). */
  .fq-working-row .fq-working-id { color: #c9d1d9; font-weight: 600; }
  .fq-working-row.is-mobile .fq-working-engine { opacity: .7; transform: scale(.85); transform-origin: left center; }
  /* The Workers lane can open before the Queues panel. Its phone layout
     must not depend on that panel's measured .fq-mobile state. */
  @media (max-width: 700px) {
    .fq-working-head { flex-wrap: wrap; row-gap: 4px; }
    .fq-working-summary { flex: 1 0 100%; padding-left: 15px; color: #8b949e; }
    .fq-working-strip .fq-working-row.is-mobile {
      display: grid; grid-template-columns: minmax(0, 1fr) 6px;
      gap: 5px 8px; padding: 10px; min-height: 44px;
    }
    .fq-working-row.is-mobile .fq-working-lead {
      grid-column: 1; flex-direction: row; align-items: center; gap: 8px;
      min-width: 0;
    }
    .fq-working-row.is-mobile .fq-working-id {
      flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis;
    }
    .fq-working-row.is-mobile .fq-working-body { grid-column: 1 / -1; gap: 5px; }
    .fq-working-row.is-mobile .fq-working-title { font-size: 13px; line-height: 1.4; }
    .fq-working-row.is-mobile .fq-working-meta {
      display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
      color: #8b949e; line-height: 1.5;
    }
    .fq-working-row.is-mobile .fq-working-chips { margin-left: 0; flex-wrap: wrap; }
    .fq-working-row.is-mobile > .fq-working-dot { grid-column: 2; grid-row: 1; }
  }
  .fq-working-role {
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 9.5px; line-height: 1;
    padding: 2px 4px; border-radius: 3px; white-space: nowrap; flex: 0 0 auto;
    color: #a371f7; border: 1px solid rgba(163,113,247,0.45); text-transform: lowercase;
  }
  .fq-working-idle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 2px 2px 0; }
  .fq-working-idle-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; color: #565e68; margin-right: 2px;
  }
  .fq-working-idle-chip {
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; line-height: 1;
    padding: 2px 5px; border-radius: 4px; color: #7d8590; border: 1px solid #2d3540;
  }
  /* The session/kill buttons take no layout space: they float over the
     title's top-right corner on hover. Hidden, they must not eat taps meant
     for the row, so pointer-events follow visibility (CCC-1229 lesson:
     invisible overlays swallow clicks). */
  .fq-working-row.is-mobile .fq-working-actions {
    position: absolute; top: 5px; right: 6px; display: flex; gap: 4px;
    padding: 2px; border-radius: 6px; pointer-events: none;
  }
  @media (hover: hover) {
    .fq-working-row.is-mobile:hover .fq-working-actions {
      pointer-events: auto; background: #12181f; box-shadow: 0 0 0 1px #232b34;
    }
  }
  @media (hover: none) {
    .fq-working-row.is-mobile .fq-working-actions { display: none; }
  }
  #queuePanel.fq-mobile .fq-working-row .fq-working-dot-static {
    flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%;
    background: #39d2c0; margin-left: auto;
  }
  /* Mobile ticket filter row: larger chips. */
  /* Big touch targets only where there is a finger (phones/tablets). The
     260px desktop status rail is also width-"mobile" (.fq-mobile), but a
     mouse doesn't need 11px padding — and with status + type filters on
     one row (CCC-1038) the big buttons wrapped into three stacked lines. */
  @media (pointer: coarse) {
    #queuePanel.fq-mobile .fq-ticket-filter-row { gap: 7px; padding: 10px 14px; }
    #queuePanel.fq-mobile .fq-ticket-filter-row .fq-filter-btn {
      font-size: 11.5px; padding: 5px 11px; border-radius: 5px;
    }
    /* CCC-60: the queue header (label, filters, status strip, chips) used to
       take ~60% of a phone screen and leave ~4 ticket rows. Reclaim the
       height: drop the redundant "Queue" label, tighten paddings, and keep
       the status strip's chips on one horizontally-scrollable line. */
    #queuePanel.fq-mobile .fq-field-label { display: none; }
    #queuePanel.fq-mobile .fq-field-row { padding: 4px 10px 6px; }
    #queuePanel.fq-mobile .fq-ticket-filter-row { gap: 5px; padding: 4px 10px; }
    #queuePanel.fq-mobile .fq-ticket-filter-row .fq-filter-btn { padding: 4px 9px; }
    #queuePanel.fq-mobile .fq-ticket-filter-row .fq-search-input { padding: 4px 8px; }
    #queuePanel.fq-mobile .fq-status-strip {
      flex-wrap: nowrap; gap: 6px; padding: 4px 10px;
      overflow-x: auto; scrollbar-width: none;
    }
    #queuePanel.fq-mobile .fq-status-strip::-webkit-scrollbar { display: none; }
    #queuePanel.fq-mobile .fq-status-strip > * { flex-shrink: 0; }
    #queuePanel.fq-mobile .fq-status-strip .fq-health-config {
      width: 28px; height: 28px; font-size: 18px;
    }
  }
  /* Mobile picker: bottom sheet, not anchored card. */
  #queuePanel.fq-mobile.fq-picker-open .fq-qp { display: flex; flex-direction: column; }
  #queuePanel.fq-mobile .fq-qp-backdrop {
    top: 0; background: rgba(6,7,10,.6);
  }
  #queuePanel.fq-mobile .fq-qp-card {
    position: absolute; left: 0; right: 0; top: 26px; bottom: 0;
    max-height: none; border-radius: 14px 14px 0 0;
    border-top: 1px solid #333b45; border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 -14px 40px rgba(0,0,0,.55);
  }
  #queuePanel.fq-mobile .fq-qp-filter { padding: 6px 13px 10px; }
  #queuePanel.fq-mobile .fq-qp-filter-input {
    min-height: 40px; padding: 9px 12px; border-radius: 8px; font-size: 14px;
  }
  #queuePanel.fq-mobile .fq-qp-group-head { padding: 10px 15px 5px; }
  #queuePanel.fq-mobile .fq-qp-row {
    min-height: 46px; padding: 8px 15px; gap: 9px;
    border-top: 1px solid #171d24; border-left: 0;
  }
  #queuePanel.fq-mobile .fq-qp-row:hover, #queuePanel.fq-mobile .fq-qp-row.is-hl {
    background: #191f27; border-left: 0;
  }
  #queuePanel.fq-mobile .fq-qp-tree { width: 14px; font-size: 11px; }
  #queuePanel.fq-mobile .fq-qp-row-live { flex: 0 0 6px; width: 6px; height: 6px; }
  /* Mobile picker row: two-line layout. The .fq-qp-row-body wraps name+meta. */
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-row-body {
    display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto;
  }
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-row-line1 {
    display: flex; align-items: center; gap: 6px; min-width: 0;
  }
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-row-line2 {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px; color: #565e68;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-row-name {
    font-size: 13px; font-weight: 500;
  }
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-needs {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
  }
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-row-drain {
    width: 10px; font-size: 10px;
  }
  /* Mobile: hide the desktop-only meta columns (open/last) — replaced by
     the single meta line. */
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-open,
  #queuePanel.fq-mobile .fq-qp-row .fq-qp-last { display: none; }
  /* Mobile: hide the desktop-only working row right group — replaced by
     the two-line body + static dot. */
  #queuePanel.fq-mobile .fq-working-row .fq-working-right { display: none; }
  /* Status filter toggle (All | Open) — segmented control in the Queue header. */
  .fq-filter {
    display: inline-flex; border: 1px solid var(--border); border-radius: 4px;
    overflow: hidden; flex-shrink: 0;
  }
  .fq-filter-btn {
    background: transparent; color: var(--text-muted); border: 0; cursor: pointer;
    font-size: 10px; font-weight: 600; padding: 1px 6px; line-height: 1.6;
    text-transform: uppercase; letter-spacing: 0.02em;
  }
  .fq-filter-btn + .fq-filter-btn { border-left: 1px solid var(--border); }
  .fq-filter-btn:hover { color: var(--text); }
  .fq-filter-btn.is-active { background: var(--accent); color: #fff; }
  .fq-ticket-filter-row > .fq-filter:first-of-type { margin-left: -4px; }
  .fq-wrap-toggle {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 4px; cursor: pointer; font-size: 10px; font-weight: 700;
    padding: 1px 6px; line-height: 1.6; text-transform: uppercase;
    letter-spacing: 0.02em; flex-shrink: 0;
  }
  .fq-wrap-toggle:hover { color: var(--text); border-color: var(--accent); }
  .fq-wrap-toggle.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .fq-more-wrap { position: relative; flex: 0 0 auto; }
  .fq-more-btn {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 4px; cursor: pointer; font-size: 17px; font-weight: 700;
    line-height: 1; padding: 1px 7px 4px;
  }
  .fq-more-btn:hover, .fq-more-btn[aria-expanded="true"] { color: var(--text); border-color: var(--accent); }
  .fq-more-menu {
    display: none; position: fixed; min-width: 148px; padding: 4px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45); z-index: 60;
  }
  .fq-more-menu.open { display: grid; gap: 2px; }
  .fq-more-menu button {
    width: 100%; box-sizing: border-box; border: 0; border-radius: 4px;
    background: transparent; color: var(--text); cursor: pointer; font: inherit;
    font-size: 12px; font-weight: 600; line-height: 1.3; padding: 6px 8px;
    text-align: left; text-transform: none; letter-spacing: normal;
  }
  .fq-more-menu button:hover { background: var(--surface-hover); color: var(--text); }
  .fq-more-menu .fq-wrap-toggle.is-active { background: var(--accent); color: #fff; }
  .fq-search-input {
    box-sizing: border-box; flex: 1 1 80px; min-width: 80px; max-width: none; margin-left: 0;
    background: transparent; color: var(--text);
    border: 1px solid var(--border); border-radius: 4px;
    padding: 3px 8px; font-size: 11px;
  }
  .fq-search-input:focus {
    border-color: var(--accent); outline: none;
    background: var(--surface-hover);
  }
  .files-search-input {
    background: transparent; color: var(--text);
    border: 1px solid var(--border); border-radius: 4px;
    padding: 2px 6px; font-size: 11px;
    width: 90px;
    margin-left: auto;
    display: none; /* hidden by default, shown when expanded */
  }
  .files-search-input:focus {
    border-color: var(--accent); outline: none;
    background: var(--surface-hover);
  }
  .files-panel:not(.collapsed) .files-search-input { display: block; }
  .files-toggle {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 12px; cursor: pointer; padding: 2px 6px;
  }
  .files-panel.collapsed .files-toggle { transform: rotate(-90deg); }
  /* Add-to-queue button in the panel header (CCC-145). Matches .files-toggle
     but reads as an action — bigger glyph, accent on hover. */
  .files-queue-add {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 15px; line-height: 1; cursor: pointer; padding: 2px 6px;
    font-weight: 600;
  }
  .files-queue-add:hover { color: var(--accent); }

  /* Import-doc button (W51 plan-to-fleet). Reads as a small secondary action
     next to the queue add glyph; hidden until the wt-import probe reports it. */
  .files-queue-import {
    background: transparent; border: 1px solid var(--border); color: var(--text-muted);
    font-size: 11px; line-height: 1; cursor: pointer; padding: 3px 7px;
    border-radius: 5px; font-weight: 600; white-space: nowrap;
  }
  .files-queue-import:hover { color: var(--accent); border-color: var(--accent); }
  .files-queue-import[hidden] { display: none; }
  .fq-more-menu .files-queue-import[hidden] { display: none; }

  .files-list {
    display: flex; flex-direction: column; gap: 6px;
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding-top: 4px;
  }

  .sidebar-file-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 6px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s ease;
  }
  .sidebar-file-row:hover {
    background: var(--surface-2, #161b22);
  }
  .sidebar-file-thumb {
    width: 32px; height: 32px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--surface-3, #21262d);
    border: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sidebar-file-icon-placeholder {
    width: 32px; height: 32px;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-3, #21262d);
    border: 1px solid var(--border);
    font-size: 16px;
    flex-shrink: 0;
  }
  .sidebar-file-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
  }
  .sidebar-file-name {
    color: var(--text, #c9d1d9); font-size: 12px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sidebar-file-path {
    color: var(--text-muted, #8b949e); font-size: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: copy;
  }
  .sidebar-file-path:hover {
    color: var(--text, #c9d1d9);
  }

  /* Status Rail File Viewer */
  #statusRail.file-viewer-active > :not(#statusRailResizer):not(#statusRailFileViewer) {
    display: none !important;
  }
  #statusRail.file-viewer-active #statusRailFileViewer {
    display: flex !important;
  }

  .status-rail-file-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    background: var(--bg);
  }
  .file-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 12px;
  }
  .file-viewer-title-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
  }
  .file-viewer-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #8b949e);
    font-weight: 600;
  }
  .file-viewer-filename {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #c9d1d9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .file-viewer-close {
    background: transparent;
    border: none;
    color: var(--text-muted, #8b949e);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
  }
  .file-viewer-close:hover {
    background: var(--surface-2, #161b22);
    color: var(--text, #c9d1d9);
  }
  .file-viewer-open-external {
    display: inline-flex; align-items: center; gap: 4px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted, #8b949e);
    font-size: 11px; line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .file-viewer-open-external:hover {
    background: var(--surface-2, #161b22);
    color: var(--text, #c9d1d9);
    border-color: rgba(255,255,255,0.18);
  }
  .file-viewer-open-external:disabled { opacity: 0.5; pointer-events: none; }
  .file-viewer-open-external svg { display: block; }
  /* Refresh button — square icon-only sibling of the Open button. */
  .file-viewer-refresh {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted, #8b949e);
    padding: 4px; border-radius: 4px; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .file-viewer-refresh:hover {
    background: var(--surface-2, #161b22);
    color: var(--text, #c9d1d9);
    border-color: rgba(255,255,255,0.18);
  }
  .file-viewer-refresh:disabled { opacity: 0.5; pointer-events: none; }
  .file-viewer-refresh svg { display: block; }
  .file-viewer-refresh.is-spinning svg { animation: fvr-spin 0.7s linear infinite; }
  @keyframes fvr-spin { to { transform: rotate(360deg); } }
  .file-viewer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text, #c9d1d9);
    min-height: 0;
  }
  .file-viewer-body.markdown-body {
    word-break: break-word;
  }
  .file-viewer-body.markdown-body pre {
    background: var(--surface-2, #161b22);
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
  }
  .file-viewer-body.markdown-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    background: var(--surface-2, #161b22);
    padding: 2px 4px;
    border-radius: 4px;
  }
  .file-viewer-body.markdown-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
  }
  .sidebar-file-toast {
    color: #f85149; font-size: 10px; margin-top: 1px;
  }
  .attention-list {
    display: flex; flex-direction: column; gap: 6px;
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
  }
  .attention-row {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
    padding: 8px 10px; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border);
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
    align-items: start;
  }
  .attention-row:hover { border-color: var(--accent); background: var(--surface-2); }
  .attention-row .att-kind {
    grid-column: 2; grid-row: 1; justify-self: end;
    font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
  }
  .attention-row .att-kind.k-pending_tool         { background: rgba(248,81,73,0.22); color: var(--red); }
  .attention-row .att-kind.k-sidecar_waiting      { background: rgba(210,153,34,0.22); color: var(--orange); }
  .attention-row .att-kind.k-pushed_open          { background: rgba(57,210,192,0.22); color: var(--cyan); }
  .attention-row .att-kind.k-uncommitted_edits    { background: rgba(210,153,34,0.22); color: var(--orange); }
  .attention-row .att-kind.k-committed_not_pushed { background: rgba(57,210,192,0.18); color: var(--cyan); }
  .attention-row .att-kind.k-needs_attention_label{ background: rgba(248,81,73,0.18); color: var(--red); }
  .attention-row .att-kind.k-open_backlog         { background: rgba(139,148,158,0.18); color: var(--text-muted); }
  .attention-row .att-col-debug {
    grid-column: 2; grid-row: 2; justify-self: end;
    font-size: 10px; color: var(--text-muted);
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    background: rgba(139,148,158,0.12); padding: 1px 6px; border-radius: 3px;
    white-space: nowrap;
  }
  .attention-row .att-name {
    grid-column: 1; grid-row: 1;
    font-size: 13px; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .attention-row .att-sid {
    display: inline-block; margin-right: 6px;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    background: rgba(139,148,158,0.12); padding: 1px 5px; border-radius: 3px;
    cursor: pointer; user-select: all; vertical-align: middle;
  }
  .attention-row .att-sid:hover { background: rgba(88,166,255,0.18); color: var(--accent); }
  .attention-row .att-sid.copied { background: rgba(63,185,80,0.22); color: var(--green); }
  /* CCC-48: recency chip — quiet, so it informs without competing with the name. */
  .attention-row .att-age {
    display: inline-block; vertical-align: middle;
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    background: rgba(139,148,158,0.10); padding: 1px 5px; border-radius: 3px;
  }
  .attention-row .att-where {
    grid-column: 1 / span 2; grid-row: 2;
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.4px;
  }
  .attention-row .att-repo {
    display: inline-block; vertical-align: middle;
    font-size: 10px; font-weight: 600; color: var(--accent);
    background: rgba(88,166,255,0.10); padding: 1px 5px; border-radius: 3px;
    margin-right: 2px;
  }
  .attention-row .att-question {
    grid-column: 1 / span 2; grid-row: 6;
    font-size: 12px; color: var(--text); line-height: 1.4;
    font-style: italic; opacity: 0.92;
  }
  .attention-row .att-did,
  .attention-row .att-insight {
    grid-column: 1 / span 2;
    font-size: 12px; color: var(--text-muted); line-height: 1.35;
  }
  .attention-row .att-did    { grid-row: 3; }
  .attention-row .att-insight{ grid-row: 4; color: var(--purple); opacity: 0.85; }
  .attention-row .att-verify-btn {
    grid-column: 2; grid-row: 5; justify-self: end;
    font-size: 10px; font-weight: 700; padding: 3px 10px;
    background: rgba(63,185,80,0.12); color: var(--green);
    border: 1px solid rgba(63,185,80,0.4); border-radius: 4px;
    cursor: pointer; transition: background 0.12s, transform 0.08s;
    text-transform: uppercase; letter-spacing: 0.4px;
  }
  .attention-row .att-verify-btn:hover { background: rgba(63,185,80,0.22); }
  .attention-row .att-verify-btn:active { transform: scale(0.96); }
  .attention-row .att-verify-btn:disabled { opacity: 0.5; cursor: wait; }
  .attention-row .att-next {
    grid-column: 1 / span 2; grid-row: 5;
    font-size: 12px; color: var(--accent); font-weight: 600; line-height: 1.35;
  }
  .attention-row .att-next::before { content: '→ '; opacity: 0.7; }
  .attention-empty { padding: 10px; font-size: 12px; color: var(--text-muted); text-align: center; }
  /* Inline NYA block under an In-progress row (the "Details" toggle). Reuses
     the attention-panel .att-* children but lays them out as a simple indented
     stack — distinct from the panel's two-column grid. The left accent border
     ties the block visually to the row it sits under. */
  .conv-nya-detail {
    display: flex; flex-direction: column; gap: 8px;
    margin: -2px 0 8px 26px; padding: 9px 12px;
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
    background: var(--surface-2);
  }
  .conv-nya-detail.is-collapsed { display: none; }
  .conv-nya-detail .att-kind {
    align-self: flex-start;
    font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
    background: rgba(139,148,158,0.18); color: var(--text-muted);
  }
  .conv-nya-detail .att-kind.k-pending_tool         { background: rgba(248,81,73,0.22); color: var(--red); }
  .conv-nya-detail .att-kind.k-sidecar_waiting      { background: rgba(210,153,34,0.22); color: var(--orange); }
  .conv-nya-detail .att-kind.k-pushed_open          { background: rgba(57,210,192,0.22); color: var(--cyan); }
  .conv-nya-detail .att-kind.k-uncommitted_edits    { background: rgba(210,153,34,0.22); color: var(--orange); }
  .conv-nya-detail .att-kind.k-committed_not_pushed { background: rgba(57,210,192,0.18); color: var(--cyan); }
  .conv-nya-detail .att-kind.k-needs_attention_label{ background: rgba(248,81,73,0.18); color: var(--red); }
  .conv-nya-detail .att-kind.k-open_backlog         { background: rgba(139,148,158,0.18); color: var(--text-muted); }
  .conv-nya-detail .att-where {
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.4px;
    margin-bottom: -2px;
  }
  /* The three actionable paragraphs — larger than before for readability. */
  .conv-nya-detail .att-did,
  .conv-nya-detail .att-insight { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
  .conv-nya-detail .att-insight { color: var(--purple); opacity: 0.85; }
  .conv-nya-detail .att-next { font-size: 13px; color: var(--accent); font-weight: 600; line-height: 1.45; }
  .conv-nya-detail .att-next::before { content: '→ '; opacity: 0.7; }
  /* Per-row collapse chevron — first item on the title line, left of the
     track checkbox, so the right-side hover-action overlay never covers it. */
  .conv-nya-chevron {
    flex: 0 0 auto; align-self: center;
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box; width: 16px; height: 16px; margin-right: 2px;
    padding: 0; border: none; border-radius: 3px;
    background: transparent; cursor: pointer;
    color: var(--text-muted); font-size: 10px; line-height: 1; opacity: 0.65;
  }
  .conv-nya-chevron:hover { color: var(--accent); background: rgba(88,166,255,0.12); opacity: 1; }
  /* Invisible same-width placeholder so rows without attention data keep their
     title aligned with rows that have a real chevron. */
  .conv-nya-chevron-spacer { visibility: hidden; pointer-events: none; cursor: default; }
  /* The Details toggle in the In-progress header — matches the grouping toggles. */
  .conv-nya-toggle .grouping-opt.is-active { color: var(--accent); }
  /* Mobile / narrow-tablet layout: sidebar fills the viewport, main
     pane is a slide-in overlay toggled by tapping a conv row → back
     button. 1200px threshold matches the JS _mobileMQ (temp breakpoint for testing) so iPhone
     landscape (up to ~932px) also gets the single-column treatment. */
  @media (max-width: 1200px) {
    body {
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
    }

    /* --- Classic (sidebar + main) --- */
    .sidebar {
      width: 100% !important; min-width: 0 !important; max-width: none !important;
    }
    .sidebar-resizer { display: none !important; }

    body:not(.kanban-split) .main {
      /* Follow the visual viewport while the software keyboard is open.
         iOS can pan the visual viewport down without moving the layout
         viewport; a fixed inset:0 pane then leaves its toolbar (and Back)
         above the visible frame. app.js keeps both vars in sync. */
      position: fixed;
      top: calc(var(--app-vv-top, 0px) + env(safe-area-inset-top, 0px)); right: 0; bottom: auto; left: 0;
      height: calc(var(--app-vh, 100vh) - env(safe-area-inset-top, 0px));
      z-index: 800; background: var(--bg);
      transform: translateX(100%); transition: transform 0.2s ease-out;
    }
    /* While off-canvas (incl. mid slide-out animation) .main must not eat
       taps destined for what is underneath — e.g. the simple-mode bottom
       nav during the 0.2s transform transition after returning home. */
    body:not(.kanban-split):not(.mobile-show-main) .main {
      pointer-events: none;
    }
    body:not(.kanban-split).mobile-show-main .main {
      transform: translateX(0);
    }
    /* The full-width session list (~16k elements) stays under the opaque
       reader while a conversation is open. Skip its style and layout work
       there: every forced recalc in the reader (Load earlier, scroll
       buttons) re-styled it too. `hidden` keeps its rendering state and
       scroll position, so Back shows it at once. The hide waits for the
       0.2s slide-in to finish; showing it again on Back is immediate. */
    body:not(.kanban-split).mobile-show-main .sidebar {
      content-visibility: hidden;
      transition: content-visibility 0s linear 0.25s allow-discrete;
    }

    /* Mobile bottom navigation sets the rail width to zero. Windows that
       explicitly keep desktop chrome still leave room for the rail. */
    body:not(.kanban-split) .main {
      left: var(--ccc-rail-w, 76px);
    }

    .mobile-back-btn {
      display: inline-flex !important;
      align-items: center; gap: 4px;
      background: transparent; border: none; color: var(--accent);
      font-size: 14px; padding: 8px 12px; cursor: pointer;
      font-family: inherit;
    }
    .mobile-back-btn:active { opacity: 0.6; }

    /* ── Narrow-viewport Actions menu (⋮), shared by every mode ──
       Was ccc-simple-mode-gated (simple.css); relocated here since it now
       backs the unified topbar in Advanced mode too — one menu, not a
       per-mode copy. Simple-only rows are filtered by [data-simple-only]
       in simple.css, not by a second copy of this block. */
    /* #convToolbar-qualified so this beats the unconditional
       .mobile-actions-wrap{display:none} base rule later in this file —
       same specificity, later source order would otherwise win. */
    #convToolbar .mobile-actions-wrap { display: inline-flex; margin-left: 8px; order: 100; }
    /* The ⋮ menu carries the Codex handover on phones. */
    #convToolbar #codexHandoverBtn { display: none !important; }
    /* Root cause of the dropdown rendering "behind the conversation":
       .toolbar (base rule, line ~314) sets `overflow: hidden`. The dropdown
       (.mobile-actions-menu) is absolutely positioned relative to
       .mobile-actions-wrap, which lives INSIDE #convToolbar's box — once the
       menu extends past the toolbar's own (short) height via `top: 100%`,
       #convToolbar's overflow:hidden clips it to invisible. Reproduced on a
       real iPhone; did not show up via getBoundingClientRect()/
       elementFromPoint() checks in desktop Chrome, which report the menu's
       unclipped geometry regardless of what's actually painted. Not fixed
       by loosening #convToolbar's overflow — that risks the toolbar's own
       nowrap button row spilling into horizontal scroll. Fixed instead in
       app.js: the menu switches to `position: fixed` with a JS-computed
       top/right on open, so it's laid out against the viewport and is not
       subject to any ancestor's overflow clipping at all. */
    button.mobile-actions-btn {
      display: inline-flex;
      align-items: center;
      font-family: inherit;
      cursor: pointer;
      border: 1px solid var(--border);
      background: var(--surface-2, var(--surface));
      color: var(--text);
      border-radius: 7px;
      font-size: 12.5px;
      font-weight: 600;
      padding: 6px 14px;
      min-height: 32px;
    }
    button.mobile-actions-btn[aria-expanded="true"] {
      background: rgba(63,185,80,0.12);
      border-color: var(--green);
      color: var(--green);
    }
    .mobile-actions-menu {
      /* position:fixed on purpose — see the root-cause comment above
         #convToolbar's .mobile-actions-wrap rule. top/right are set inline
         by JS (_wireSimpleActionsMenu) from the button's own rect each time
         the menu opens, since fixed positioning is viewport-relative. */
      position: fixed;
      z-index: 40;
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 220px;
      max-width: calc(100vw - 16px);
      padding: 8px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }
    .mobile-actions-menu[hidden] { display: none; }
    button.mobile-actions-item {
      display: block;
      width: 100%;
      text-align: left;
      font-family: inherit;
      cursor: pointer;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text);
      border-radius: 7px;
      font-size: 13px;
      padding: 10px 12px;
      min-height: 44px;
    }
    button.mobile-actions-item:hover,
    button.mobile-actions-item:focus-visible {
      background: var(--surface-2, var(--surface));
    }
    .mobile-actions-row { display: flex; gap: 4px; }
    .mobile-actions-row > button.mobile-actions-item {
      flex: 1 1 0;
      width: auto;
      text-align: center;
      font-weight: 600;
    }
    .mobile-actions-info[hidden],
    .mobile-actions-info-item[hidden] { display: none; }
    .mobile-actions-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-top: 4px;
      padding-top: 6px;
      border-top: 1px solid var(--border);
    }
    button.mobile-actions-info-item {
      display: flex;
      gap: 8px;
      align-items: baseline;
      width: 100%;
      min-width: 0;
      text-align: left;
      font-family: inherit;
      cursor: pointer;
      border: 0;
      background: transparent;
      color: var(--text-muted, var(--text));
      border-radius: 7px;
      font-size: 12px;
      padding: 6px 12px;
    }
    button.mobile-actions-info-item:hover,
    button.mobile-actions-info-item:focus-visible {
      background: var(--surface-2, var(--surface));
    }
    .mobile-actions-info-label { flex: none; min-width: 4.5em; opacity: 0.7; }
    .mobile-actions-info-value {
      min-width: 0;
      font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
      overflow-wrap: anywhere;
    }

    /* The injection-health banner is `position: fixed; top: 0; z-index: 10000`.
       Desktop gets one line over a topbar with slack; a phone wraps the same
       copy to ~5 lines of red that lands squarely on #convToolbar, which is
       where the mobile Back button lives. Back stayed hit-testable but was
       invisible under the banner, so "I click Back and get stuck" was really
       "I cannot see Back". Push the app down by the banner's measured height
       instead of letting it overlay, and clamp the copy to two lines so a list
       of session ids can never eat a fifth of the screen (Details still shows
       the full list). */
    body.has-injection-banner .sidebar {
      padding-top: var(--injection-banner-h, 0px);
      box-sizing: border-box;
    }
    body.has-injection-banner:not(.kanban-split) .main {
      top: calc(var(--app-vv-top, 0px) + env(safe-area-inset-top, 0px) + var(--injection-banner-h, 0px));
      height: calc(var(--app-vh, 100vh) - env(safe-area-inset-top, 0px) - var(--injection-banner-h, 0px));
    }
    .injection-health-banner {
      align-items: flex-start;
      gap: 8px;
      padding: 8px 10px;
      font-size: 12px;
    }
    .injection-health-banner__text {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      min-width: 0;
    }

    /* One scroll surface, not three portholes.
       Desktop splits the sidebar into stacked accordion panels, each its own
       scroller with `overscroll-behavior: contain`. That reads fine in a
       900px-tall column; on a phone the panels collapse to slits. Measured on
       a 390x844 viewport: Current sessions 286px tall over 9286px of content,
       Project tree 134px over 12975px, Triggered workers 16px over 813px —
       and `contain` stops the scroll from ever chaining out, while body,
       .sidebar and #convList are all `overflow: hidden`. So a drag anywhere in
       the list is captured by a 134px window with 97 screens of content in it
       and the page itself cannot move: the "I get stuck very quickly" report.
       On mobile, hand the scrolling to #convList and let the sections size to
       their content. */
    /* `.objects-scroll-split` is the class that pins #convList to
       `overflow-y: hidden !important` on desktop, so match its specificity. */
    #convList,
    #convList.objects-scroll-split {
      overflow-y: auto !important;
      /* clip (not hidden): hidden still creates a horizontal scroll
         offset, which is the "UI drift" on a sideways finger pan.
         clip forbids that offset. */
      overflow-x: clip;
      overscroll-behavior-y: contain;
      overscroll-behavior-x: none;
      touch-action: pan-y;
      -webkit-overflow-scrolling: touch;
    }
    .conv-inprogress-section,
    .conv-inprogress-list {
      flex: 0 0 auto !important;
      min-height: auto !important;
    }
    /* One scroller over ~23000px of rows means the browser lays out and paints
       every row, not just the 668px on screen. Let it skip the offscreen ones.
       `auto` in contain-intrinsic-size makes each row remember its real
       measured height once rendered, so the scrollbar and scroll anchoring
       stay honest instead of snapping to a guessed placeholder size. */
    #convList .conv-item {
      content-visibility: auto;
      contain-intrinsic-size: auto 44px;
    }
    /* Every poll rebuilds the list via innerHTML, so each row is a fresh
       element back at its 44px placeholder. As those rows get laid out at
       their real height, Chrome's scroll anchoring moved scrollTop by
       hundreds of px after the render had already restored it, and the rAF
       restore snapped it back a frame later: the list visibly jumped for
       ~130ms (CCC-1217). The render paths own scroll restoration here. */
    #convList { overflow-anchor: none; }

    /* With #convList scrolling, the tab bar and the list toolbar are both
       `position: sticky; top: 0` and land on top of each other. Keep the tabs
       pinned (they are the primary navigation) and let the toolbar scroll
       away on true phone widths only — two stacked sticky bars would eat
       ~80px of an 844px-tall phone screen. On tablet/narrow-desktop widths
       (701-1200px) there's headroom for both, so the toolbar (Collapse all,
       Now/1d/7d/All, by project/by time, Wrap, Details) stays frozen at the
       top while the list scrolls underneath it (CCC-994).
       Phone Advanced hides the tab bar (bottom nav owns Coding/Workers),
       so the filter row is the only chrome and stays sticky — see
       body.has-mobile-bottom-nav rules later in this file. */
    #convList > .conv-tab-bar { z-index: 7; }
    @media (max-width: 700px) {
      #convList .conv-inprogress-toolbar { position: static; }
    }
    .conv-current-sessions-scroll,
    .conv-project-tree-scroll,
    .conv-evergreen-agents-scroll,
    #convList.objects-scroll-split .conv-section-fill {
      flex: 0 0 auto !important;
      max-height: none !important;
      overflow-y: visible !important;
      overscroll-behavior: auto;
    }

    /* Hide non-essential controls in classic main toolbar */
    .toolbar .font-size-controls { display: none !important; }
    #convSessionId { display: none !important; }

    /* Phone-sized toolbar: trim the topbar down to back-btn + breadcrumb
       + pop-out so all of it fits on one row instead of wrapping into
       a second row. Update / Bug-report / Annotate / Screen / Notes /
       Worktrees / Stats / Terminal / Vercel / localhost / context-rail
       toggles are all desktop conveniences — surface them via the
       breadcrumb's right click or a menu in a future iteration.       */
    #updPill,
    #bugReportLink,
    #annotationStartBtn,
    #annotationScreenBtn,
    #annotationNotesBtn,
    #kptWorktreesBtn,
    #statsBtn,
    #termToggleBtn,
    #deployPill,
    #localhostPill,
    #statusToggle,
    #statusPosTop,
    #statusPosRight {
      display: none !important;
    }
    .ccc-breadcrumb {
      max-width: none !important;
      min-width: 0;
      flex: 1 1 auto;
      /* Let the chips wrap to a second line so the title always has room
         on the first. Without this, the proc-pill cluster (often wider
         than the whole phone screen) steals all the width and squeezes
         the title to 0px off-screen. */
      flex-wrap: wrap;
      row-gap: 4px;
    }
    /* The open session's title is the most important thing on the conv
       screen — make it the dominant, full-width first line and legible.
       (Previously it rendered after the category + UX + proc chips and got
       pushed to 0px width / off-screen on a 390px viewport.) */
    .ccc-breadcrumb .ccc-breadcrumb-title {
      order: -1;
      flex: 1 1 100%;
      min-width: 0;
      font-size: 15px;
      font-weight: 700;
      line-height: 1.25;
    }
    .ccc-breadcrumb .ccc-breadcrumb-category {
      order: 0;
      max-width: 96px;
    }
    /* Secondary chips share the second line and yield to the title. */
    .ccc-breadcrumb .ccc-breadcrumb-ux,
    .ccc-breadcrumb .ccc-breadcrumb-size { order: 1; }
    .ccc-breadcrumb .ccc-breadcrumb-proc {
      order: 2;
      min-width: 0;
      flex: 0 1 auto;
      overflow: hidden;
    }
    .ccc-breadcrumb .ccc-breadcrumb-popout { order: 3; }
    /* Push the breadcrumb + pop-out tightly to the left of the toolbar
       so they live with the back button on one row. */
    .ccc-topbar { margin-left: 8px !important; gap: 6px !important; }

    /* Controls that don't make sense on phones */
    .sh-btn-deploy { display: none !important; }

    /* Floating speaker + rate dial: 56/84px is desktop-sized and eats phone
       width; shrink both proportionally. */
    .conv-scroll-speak-btn { width: 40px; height: 40px; right: 14px; font-size: 17px; }
    .speaker-tools { width: 56px; height: 56px; }
    .speaker-rate-dial { width: 56px; height: 56px; }
    .speaker-dock { top: 44px; }
    .speaker-rate-value { min-width: 30px; font-size: 10px; line-height: 18px; }
    .speaker-next-sentence, .speaker-voice-switch { width: 18px; height: 18px; font-size: 14px; }
    .speaker-voice-switch { font-size: 11px; }
    .speaker-voice-name { bottom: 60px; }

    /* --- Kanban-split --- */
    #kanbanLayout.active { flex-direction: column; }
    .kanban-panel {
      flex: 1 !important; width: 100% !important; min-width: 0 !important;
      border-right: none;
    }
    .split-resizer { display: none !important; }

    .conv-panel {
      position: fixed !important;
      top: calc(var(--app-vv-top, 0px) + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: auto;
      /* Use the dynamic viewport so the panel resizes with iOS Safari's
         URL bar and on-screen keyboard — otherwise the input bar slides
         off-screen and the user can't see "Send to terminal…". */
      height: calc(var(--app-vh, 100vh) - env(safe-area-inset-top, 0px));
      padding-bottom: env(safe-area-inset-bottom);
      box-sizing: border-box;
      z-index: 900;
      width: 100% !important; min-width: 0 !important;
      background: var(--bg);
      transform: translateY(100%); transition: transform 0.2s ease-out;
      display: flex !important;
    }
    body.mobile-conv-open .conv-panel { transform: translateY(0); }

    /* Compact kanban-split toolbar: keep search + Run + close (back), drop the rest */
    .kanban-panel-toolbar {
      padding: 8px; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .kanban-panel-toolbar .kpt-search {
      width: 120px !important; min-width: 100px; flex-shrink: 1;
    }
    .kanban-panel-toolbar .kpt-new-session,
    .kanban-panel-toolbar #kptRunBtn,
    .kanban-panel-toolbar #kptRecentBtn,
    .kanban-panel-toolbar #kptToolbarEngineSelect,
    .kanban-panel-toolbar #kptToolbarEngineSelectCustom,
    .kanban-panel-toolbar #kptGitOnlyToggle,
    .kanban-panel-toolbar #kptDescToggle,
    .kanban-panel-toolbar .kpt-label,
    .kanban-panel-toolbar #kptListViewBtn,
    .kanban-panel-toolbar #kptOpenConvBtn,
    .kanban-panel-toolbar #kptReloadPageBtn,
    .kanban-panel-toolbar #kptDeployStatus { display: none !important; }

    /* Narrower board gutter + magnetic center-snap on horizontal swipe */
    .kanban-board-split {
      padding: 8px 4px !important;
      gap: 8px !important;
      scroll-snap-type: x mandatory;
      scroll-padding: 0 50%;
    }
    .kanban-board-split .kanban-column {
      min-width: 300px !important; width: 300px !important;
      scroll-snap-align: center;
      scroll-snap-stop: always;
    }

    /* Show more of the outcome on phones — summaries often need 5–7 lines */
    .kanban-card .kanban-card-desc {
      -webkit-line-clamp: 8 !important;
    }
    /* The "Hide desc" button is a desktop power-user toggle. On mobile the
       summary IS the card — always show it regardless of that setting. */
    body.hide-descs .kanban-card .kanban-card-desc {
      display: -webkit-box !important;
    }
    /* Tighter card padding on mobile so the description gets more real estate */
    .kanban-card { padding: 8px 10px !important; }

    /* Conv-panel toolbar controls */
    #cpFontMinus, #cpFontPlus { display: none !important; }
    .conv-panel-toolbar .cpt-session-id { display: none !important; }
    /* Jump/Launch only affect the host's Terminal.app — useless when the UI is
       viewed from a remote/mobile context. Hide to avoid the "clicked, nothing
       happened" UX. */
    #cpJumpBtn, #cpLaunchSplit,
    #jumpBtnConv, #launchWrapConv,
    .toolbar .resume-btn { display: none !important; }

    /* Kill iOS double-tap-to-click on cards (hover states triggered first tap) */
    .kanban-card {
      touch-action: manipulation;
      -webkit-tap-highlight-color: rgba(88,166,255,0.15);
    }
    /* Card action buttons: always visible on touch, pinned bottom-right so they
       sit next to the stage chip instead of covering the title. */
    .kanban-card .kanban-card-actions {
      opacity: 1 !important;
      top: auto !important;
      left: auto !important;
      bottom: 4px !important;
      right: 4px !important;
    }

    /* The unified sticky panel handles its own scroll per column —
       no per-message cap needed on mobile. */

    /* Mobile-specific conversation list item spacing and tap targets */
    .conv-item {
      padding-top: 12px !important;
      padding-bottom: 12px !important;
      margin-bottom: 6px !important;
      position: relative;
      touch-action: pan-y;
      transition: transform 0.12s ease, background-color 0.08s ease;
      -webkit-tap-highlight-color: rgba(188, 140, 255, 0.15);
    }
    .compact-rows .conv-item {
      padding-top: 8px !important;
      padding-bottom: 8px !important;
      margin-bottom: 4px !important;
    }
    /* Immediate tap visual feedback on mobile */
    .conv-item:active,
    .conv-item.mobile-active-tap {
      background-color: var(--surface-2) !important;
      opacity: 0.85;
    }
    .conv-item.mobile-tapped {
      background-color: var(--surface-2) !important;
      border-left-color: var(--purple) !important;
      opacity: 0.95;
    }
  }

  /* ── Phone header tidy-up (≤600px) ─────────────────────────────────
     The compact desktop header squeezes the brand into whatever width the
     icon-button row leaves, truncating "Command Center" to "Co…" and
     clipping the subtitle onto a second line. On phones, give the brand
     the full header width, hide the subtitle and version text (identity
     is carried by the title alone; the version is still reachable via
     "what's new"), and overlay the icon actions top-right so the badges
     and last-updated rows span the full width. The refresh caret (server
     restart) and chip-color toggle are desktop-grade controls — hidden
     here to keep the overlaid action row narrow enough for the title. */
  @media (max-width: 600px) {
    .sidebar-header {
      position: relative;
      flex-wrap: wrap !important;
      padding-right: 10px;
    }
    .sidebar-header-brand { flex: 1 1 100%; }
    .sidebar-header-actions {
      position: absolute;
      top: 8px;
      right: 10px;
    }
    .sidebar-header-actions .sh-refresh-caret,
    .sidebar-header-actions #chipsColorToggle { display: none !important; }
    .sidebar-header-brand .sh-title-row {
      /* Keep the title clear of the overlaid action buttons. */
      padding-right: 104px;
    }
    .sidebar-header-brand .sh-title-link { flex: 0 1 auto; }
    .sidebar-header-brand .sh-title-sub,
    .sidebar-header-brand .sh-version { display: none; }
    /* The chip stays LED + STATUS + verdict + count. The subject word is not
       dropped here: "attention 3" on its own could be about anything on the
       page, and "STATUS" is only ~40px. The verdict is what truncates. */
    .sh-service-badges { flex-wrap: nowrap; }
    .sh-service-badges .sh-status-chip { flex: 0 1 auto; min-width: 0; }
    .sh-service-badges .ssc-word { flex: 0 0 auto; }
    .sh-service-badges .ssc-verdict {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  /* Prominent "+ New session" / "+ New Group chat" pair — sits in the slot
     the Vercel deploy panel used to occupy (just below the sidebar header).
     The deploy indicator now lives in the global topbar, freeing this slot
     for the primary CTAs. The two buttons share the row 50/50. */
  .new-session-panel {
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }
  .new-session-primary-row,
  .new-session-secondary-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .new-session-primary-row {
    flex: 1 1 auto;
  }
  .new-session-secondary-row {
    flex: 0 1 auto;
  }
  .new-session-primary-row #sidebarNewBtn {
    flex: 0 1 136px;
  }
  .new-session-primary-row #sidebarNewTicketBtn {
    flex: 0 0 auto;
  }
  .new-session-primary-row .search-wrap {
    flex: 1 1 96px;
    min-width: 48px;
  }
  .new-session-secondary-row #sidebarNewGroupChatBtn {
    flex: 0 1 172px;
  }
  .new-session-secondary-row .new-session-icon-btn {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 14px;
  }
  .new-session-btn {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 8px 10px; border-radius: 6px;
    background: rgba(88, 166, 255, 0.10);
    border: 1px solid rgba(88, 166, 255, 0.35);
    color: var(--accent);
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; line-height: 1.2;
    transition: background 0.12s, border-color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .new-session-btn:hover { background: rgba(88, 166, 255, 0.18); border-color: rgba(88, 166, 255, 0.55); }
  .new-session-btn .plus { font-weight: 700; }
  /* Secondary action (group chat) — same shape, muted palette so it
     doesn't compete visually with the primary "+ New session" CTA. */
  .new-session-btn-secondary {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
  }
  .new-session-btn-secondary:hover {
    background: var(--surface);
    border-color: var(--text-muted);
    color: var(--text);
  }

  /* Sidebar footer strip — appearance + settings (Claude-Desktop pattern) */
  .sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 6px 8px;
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0;
  }
  .sidebar-footer-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-muted); cursor: pointer; font-family: inherit;
    transition: background 0.12s, color 0.12s;
  }
  .sidebar-footer-btn:hover { background: var(--surface-2); color: var(--text); }
  .sidebar-footer-btn svg { width: 16px; height: 16px; display: block; }
  .sidebar-footer-spacer { flex: 1; }
  .sidebar-footer-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
  }
  .sidebar-footer-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    padding: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: 500 11px/1.2 var(--font-ui);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
  }
  .sidebar-footer-tool:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .sidebar-footer-tool:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    color: var(--text);
  }
  .sidebar-footer-tool svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
  }
  @media (pointer: coarse) {
    .sidebar-footer-tool { min-height: 44px; }
  }
  /* Active-coordinations pill — bottom-left of the sidebar footer. Same
     visual rhythm as the rest of the footer but with a brighter accent
     so the "you have N chats waiting" signal is easy to spot. Hidden
     entirely when there are zero active chats. */
  .sidebar-footer-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font: 500 11.5px inherit;
    padding: 4px 9px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sidebar-footer-pill:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  .bg-runs-panel {
    position: absolute; left: 0; bottom: 100%; margin-bottom: 6px; z-index: 50;
    min-width: 280px; max-width: 360px; padding: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; font-size: 11.5px; color: var(--text);
  }
  .bg-runs-panel[hidden] { display: none; }
  .bg-runs-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
  .bg-runs-help { opacity: .75; font-size: 11px; line-height: 1.4; padding: 0 0 6px; max-width: 320px; }
  .bg-runs-row.is-alert { color: var(--danger, #e5534b); font-weight: 600; }
  #bgRunsBtn { max-width: 290px; }
  #bgRunsBtn.is-pressure-busy { color: var(--warning, #d29922); }
  #bgRunsBtn.is-pressure-saturated { color: var(--danger, #e5534b); }
  .bg-runs-meta { opacity: .7; white-space: nowrap; }
  .conv-bg-palette {
    display: grid;
    grid-template-columns: repeat(13, 14px);
    grid-auto-rows: 14px;
    gap: 3px;
    align-items: center;
  }
  .conv-bg-palette:empty { display: none; }
  /* Row-style picker — sits to the LEFT of the background palette in the
     rail's bottom bar. Each swatch is a 3-line mini glyph whose bar
     brightness / thickness / gap previews the variant it applies. */
  .conv-rowstyle-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, 16px);
    grid-auto-rows: 16px;
    max-width: 111px;
    gap: 3px;
    align-items: center;
  }
  .conv-rowstyle-palette:empty { display: none; }
  .conv-rowstyle-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    border: 1px solid color-mix(in srgb, var(--text-muted) 40%, transparent);
    background:
      repeating-linear-gradient(
        to bottom,
        currentColor 0 var(--rs-h, 2px),
        transparent var(--rs-h, 2px) calc(var(--rs-h, 2px) + var(--rs-gap, 2px))
      ) no-repeat 50% 50% / 9px calc((var(--rs-h, 2px) + var(--rs-gap, 2px)) * 3 - var(--rs-gap, 2px));
    color: color-mix(in srgb, var(--text) calc(var(--rs-op, 70) * 1%), transparent);
  }
  /* Typeface variants preview as an "Aa" set in the font they apply, not as
     bars — a bar glyph can't show a typeface. */
  .conv-rowstyle-swatch.is-font {
    background: none;
    font-size: 9px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: color-mix(in srgb, var(--text) 85%, transparent);
  }
  .conv-rowstyle-swatch:hover { border-color: var(--text); }
  .conv-rowstyle-swatch.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  /* Delineation swatches preview the actual treatment instead of the
     generic bars glyph, so the three options read apart at a glance. */
  .conv-rowstyle-swatch.is-delineation-divider {
    background:
      linear-gradient(currentColor, currentColor) 50% 50% / 10px 1px no-repeat,
      linear-gradient(currentColor, currentColor) 50% 4px / 8px 3px no-repeat,
      linear-gradient(currentColor, currentColor) 50% 11px / 8px 3px no-repeat;
  }
  .conv-rowstyle-swatch.is-delineation-zebra {
    background: repeating-linear-gradient(
      to bottom,
      color-mix(in srgb, currentColor 55%, transparent) 0 4px,
      transparent 4px 8px
    ) no-repeat 50% 50% / 12px 12px;
  }
  .conv-rowstyle-swatch.is-delineation-cards {
    background: none;
  }
  .conv-rowstyle-swatch.is-delineation-cards::before,
  .conv-rowstyle-swatch.is-delineation-cards::after {
    content: '';
    display: block;
    width: 10px;
    height: 3px;
    margin: 2px auto;
    border: 1px solid currentColor;
    border-radius: 2px;
  }

  /* ---- Row style variants (applied on <html data-conv-rowstyle>) ---- */
  /* --rs-hi is the "toward maximum contrast" pole: white on dark themes,
     black on light ones, so a "brighter name" variant reads the same way in
     both. !important because the Active/current-session lists already pin
     .conv-title colour+weight at a higher specificity. */
  :root { --rs-hi: #ffffff; }
  :root[data-theme="light"] { --rs-hi: #000000; }
  /* Row spacing is an independent 3-step radio (data-rows-spacing on
     #convList), not a data-conv-rowstyle option — see CONV_ROWSTYLE_SPACING.
     It only touches spacing, orthogonal to whatever font/color preset is
     active and to the Comfortable toggle (which only shows/hides the
     outcome card via .compact-rows, defined earlier in this file). 'cozy'
     is the base spacing already baked into .conv-item, so it needs no rule
     here — only 'roomy' (a middle ground) and 'airy' (max) override it. */
  #convList[data-rows-spacing="roomy"] .conv-item {
    padding-top: 8px !important; padding-bottom: 8px !important; margin-bottom: 3px !important;
  }
  #convList[data-rows-spacing="roomy"] .conv-item .conv-title { line-height: 1.55 !important; }
  #convList[data-rows-spacing="airy"] .conv-item {
    padding-top: 10px !important; padding-bottom: 10px !important; margin-bottom: 4px !important;
  }
  #convList[data-rows-spacing="airy"] .conv-item .conv-title { line-height: 1.75 !important; }
  html[data-conv-rowstyle="large-bright"] .conv-item {
    padding-top: 7px !important; padding-bottom: 7px !important;
  }
  html[data-conv-rowstyle="large-bright"] .conv-item .conv-title {
    font-size: 16px !important; line-height: 1.45 !important;
    color: color-mix(in srgb, var(--text) 20%, var(--rs-hi)) !important;
    font-weight: 500 !important;
  }

  /* ---- Typeface variant ---- */
  /* Rounded XL: the "bright" color+weight formula on top of its own
     typeface, one notch larger than the old base Rounded's 15.5px. */
  /* ---- Row delineation trial (data-row-delineation on #convList) ----
     The list read as a wall of same-weight sentences with no per-row
     boundary — three candidate treatments to compare live, radio (one at
     a time). Independent of font/color, spacing, and Details. */
  #convList[data-row-delineation="divider"] .conv-item {
    border-bottom: 1px solid color-mix(in srgb, var(--text) 9%, transparent) !important;
  }
  #convList[data-row-delineation="divider"] .conv-item:last-child {
    border-bottom: none !important;
  }
  #convList[data-row-delineation="zebra"] .conv-item:nth-of-type(even) {
    background: color-mix(in srgb, var(--text) 4%, transparent) !important;
  }
  #convList[data-row-delineation="cards"] .conv-item {
    background: color-mix(in srgb, var(--text) 3.5%, transparent) !important;
    border: 1px solid color-mix(in srgb, var(--text) 8%, transparent) !important;
    border-radius: 8px !important;
    margin: 0 4px 4px !important;
  }
  #convList[data-row-delineation="cards"] .conv-item.active {
    background: color-mix(in srgb, var(--purple) 12%, var(--surface-2)) !important;
  }
  #convList[data-row-delineation="cards"] .conv-item.in-other-pane {
    background: color-mix(in srgb, #58a6ff 11%, var(--surface-2)) !important;
  }
  html[data-conv-rowstyle="rounded-xl"] .conv-item .conv-title {
    font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", "Nunito", system-ui, sans-serif !important;
    letter-spacing: 0 !important;
    color: color-mix(in srgb, var(--text) 20%, var(--rs-hi)) !important;
    font-weight: 500 !important;
    font-size: 16.5px !important;
  }
  .conv-bg-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--text-muted) 50%, transparent);
    background: var(--swatch-color);
    cursor: pointer;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  }
  .conv-bg-swatch:hover {
    transform: scale(1.12);
    border-color: var(--text);
  }
  .conv-bg-swatch.active {
    border-color: var(--accent);
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,0.18),
      0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  }

  /* Generic dropdown popover (used by appearance + settings menus) */
  .desktop-popover {
    position: absolute; z-index: 200;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    display: none; flex-direction: column; gap: 2px;
  }
  .desktop-popover.open { display: flex; }
  .desktop-popover .pop-section-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    padding: 6px 8px 2px;
  }
  .desktop-popover .pop-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 4px;
    background: transparent; border: none; color: var(--text);
    font-size: 13px; cursor: pointer; text-align: left; font-family: inherit;
    width: 100%;
    text-decoration: none;
  }
  .desktop-popover .pop-item:hover { background: var(--surface-2); }
  .desktop-popover .pop-item.active { color: var(--accent); background: rgba(88,166,255,0.10); }
  .desktop-popover .pop-item .pop-check {
    width: 12px; color: var(--accent); font-weight: 700;
  }
  .desktop-popover .pop-item .pop-icon {
    width: 14px; height: 14px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted);
  }
  .desktop-popover .pop-divider {
    height: 1px; background: var(--border); margin: 4px 2px;
  }
  .desktop-popover .pop-submenu { position: relative; }
  .desktop-popover .pop-submenu summary { list-style: none; }
  .desktop-popover .pop-submenu summary::-webkit-details-marker { display: none; }
  .desktop-popover .pop-submenu .pop-chevron {
    margin-left: auto;
    color: var(--text-muted);
  }
  .desktop-popover .pop-submenu[open] .pop-chevron { transform: rotate(90deg); }
  .desktop-popover .pop-submenu-panel {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 4px 22px;
    padding-left: 6px;
    border-left: 1px solid var(--border);
  }
  .desktop-popover .pop-submenu[open] .pop-submenu-panel { display: flex; }

  /* ── Selection annotate: "+" trigger, inline note popover, and the
     persistent highlight + callout it produces in the transcript ── */
  .ccc-annotation-trigger {
    position: fixed;
    z-index: 250;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  }
  .ccc-annotation-trigger:hover { filter: brightness(1.1); }

  .ccc-annotation-popover {
    position: fixed;
    z-index: 250;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    width: 240px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  .ccc-annotation-popover-input {
    width: 100%;
    resize: none;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
  }

  .ccc-annotation-mark {
    background: rgba(255, 196, 0, 0.28);
    border-bottom: 2px solid #ffc400;
    border-radius: 2px;
  }

  .ccc-annotation-note {
    margin: 6px 0;
    padding: 6px 10px;
    background: rgba(255, 196, 0, 0.12);
    border-left: 3px solid #ffc400;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }
  .ccc-annotation-note-text { flex: 1; white-space: pre-wrap; }
  .ccc-annotation-note-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
  }
  .ccc-annotation-note-delete:hover { color: var(--text); }

  /* ── Cmd+K search modal (shares nsm-* visual language) ──
     A scrollable list of sessions filtered live by display_name /
     first_message. ↑/↓ to move, Enter to select, Esc to close. */
  .cmdk-overlay { position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: flex-start; justify-content: center;
    padding-top: 12vh; }
  .cmdk-overlay.open { display: flex; }
  .cmdk-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px); }
  .cmdk-dialog {
    position: relative; width: min(620px, 92vw);
    max-height: 70vh; background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
    display: flex; flex-direction: column; overflow: hidden;
  }
  .cmdk-input-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
  }
  .cmdk-input-wrap .cmdk-search-icon {
    width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0;
  }
  #cmdkInput {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); font-size: 15px; font-family: inherit;
  }
  #cmdkInput::placeholder { color: var(--text-muted); }
  .cmdk-hint {
    font-size: 10px; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 4px;
    padding: 1px 5px; font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    flex-shrink: 0;
  }
  #cmdkList {
    overflow-y: auto; padding: 6px; flex: 1; min-height: 60px;
  }
  .cmdk-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 10px; border-radius: 6px;
    cursor: pointer; user-select: none;
    border: 1px solid transparent;
  }
  .cmdk-item:hover { background: var(--surface-2); }
  .cmdk-item.selected {
    background: var(--surface-2);
    border-color: var(--accent);
  }
  .cmdk-item .cmdk-title {
    font-size: 13px; color: var(--text); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cmdk-item .cmdk-meta {
    font-size: 11px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cmdk-empty {
    padding: 24px; text-align: center; color: var(--text-muted);
    font-size: 13px;
  }
  .cmdk-footer {
    display: flex; gap: 12px; align-items: center;
    padding: 6px 14px; border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-muted);
  }
  .cmdk-footer .cmdk-hint { background: var(--bg); }

  /* Unified conversation-pane toggle button (used in both kanban-panel and
     conv-panel toolbars). Same glyph in both places so the user always
     recognises it as "show/hide the chat pane". */
  .panel-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    padding: 0 !important;
    color: var(--text-muted);
  }
  .panel-toggle-btn svg { width: 16px; height: 16px; display: block; }
  .panel-toggle-btn:hover { color: var(--text); }

  /* ── Usage stats overlay ─────────────────────────────────────
     Triggered from the "Stats" button in the topbar. Reuses the
     .upd-overlay backdrop pattern but with a wider dialog so the
     8-card grid + 7×24 heatmap fit comfortably. */
  .stats-dialog { position: relative; width: min(900px, 94vw);
    max-height: 90vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px;
    display: flex; flex-direction: column; gap: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
  .stats-header { display: flex; align-items: center; gap: 6px; }
  .stats-tab {
    padding: 6px 14px; border-radius: 8px; font-size: 13px;
    border: 1px solid transparent; background: transparent;
    color: var(--text-muted); cursor: pointer; font-family: inherit;
  }
  .stats-tab:hover { color: var(--text); }
  .stats-tab.active {
    background: var(--surface-2); color: var(--text);
    border-color: var(--border);
  }
  .stats-range { margin-left: auto; display: flex; gap: 4px; }
  .stats-range button {
    padding: 4px 10px; border-radius: 6px; font-size: 12px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-muted); cursor: pointer; font-family: inherit;
  }
  .stats-range button:hover { color: var(--text); }
  .stats-range button.active {
    background: var(--surface-2); border-color: var(--border);
    color: var(--text);
  }
  .stats-close {
    margin-left: 6px; width: 28px; height: 28px;
    border-radius: 6px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer;
    font-size: 16px; line-height: 1; padding: 0;
  }
  .stats-close:hover { background: var(--surface-2); color: var(--text); }

  .stats-cards {
    display: grid; gap: 10px;
    grid-template-columns: repeat(4, 1fr);
  }
  @media (max-width: 720px) {
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
  }
  .stats-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px;
    display: flex; flex-direction: column; gap: 4px;
    min-height: 64px;
  }
  .stats-card .label { font-size: 11px; color: var(--text-muted); }
  .stats-card .value { font-size: 22px; font-weight: 700; color: var(--text); }
  .stats-card .value.muted { font-weight: 600; font-size: 16px; }

  .stats-heatmap-wrap { padding: 4px 0; }
  .stats-heatmap {
    display: grid; gap: 3px;
    grid-template-columns: repeat(24, 1fr);
    grid-auto-rows: 1fr;
  }
  .stats-heatmap-cell {
    aspect-ratio: 1; border-radius: 3px;
    background: var(--surface-2);
  }
  .stats-heatmap-cell.lvl-0 { background: var(--surface-2); opacity: 0.55; }
  .stats-heatmap-cell.lvl-1 { background: rgba(96, 137, 230, 0.45); }
  .stats-heatmap-cell.lvl-2 { background: rgba(96, 137, 230, 0.65); }
  .stats-heatmap-cell.lvl-3 { background: rgba(96, 137, 230, 0.85); }
  .stats-heatmap-cell.lvl-4 { background: rgba(96, 137, 230, 1.0); }

  .stats-comparison {
    font-size: 13px; color: var(--text-muted);
    padding-top: 4px;
  }
  .stats-loading { font-size: 13px; color: var(--text-muted); }
  .stats-models-list {
    display: flex; flex-direction: column; gap: 8px;
    padding: 4px 2px;
  }
  .stats-models-row {
    display: grid; grid-template-columns: 140px 1fr 80px;
    align-items: center; gap: 12px; font-size: 13px;
  }
  .stats-models-row .name { color: var(--text); font-weight: 600; }
  .stats-models-row .bar {
    height: 8px; border-radius: 4px; background: var(--surface-2);
    overflow: hidden; position: relative;
  }
  .stats-models-row .bar-fill {
    position: absolute; inset: 0 auto 0 0;
    background: rgba(96, 137, 230, 0.85);
  }
  .stats-models-row .pct { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }

  /* ======================================================================
     History search — right-side drawer + click-through detail pane.
     Read-only window onto ~/.claude-index/index.db. Class prefix: .hsd-
     ====================================================================== */
  .hsd-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0, 0, 0, 0.42);
    display: flex; justify-content: flex-end;
    opacity: 0; pointer-events: none;
    transition: opacity 160ms ease;
  }
  .hsd-overlay[data-open="1"] { opacity: 1; pointer-events: auto; }
  .hsd-overlay[hidden] { display: none !important; }

  .hsd-drawer {
    width: min(820px, 96vw); height: 100vh;
    background: var(--bg, #0f1115);
    color: var(--text, #e6e6e6);
    border-left: 1px solid var(--border, #2a2d33);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.45);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 220ms cubic-bezier(.2,.7,.2,1);
  }
  .hsd-overlay[data-open="1"] .hsd-drawer { transform: translateX(0); }

  .hsd-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, #2a2d33);
  }
  .hsd-header h2 { margin: 0; font-size: 15px; font-weight: 600; }
  .hsd-close {
    background: transparent; color: var(--text-muted, #9aa0aa);
    border: none; font-size: 22px; cursor: pointer; line-height: 1;
    padding: 4px 8px;
  }
  .hsd-close:hover { color: var(--text, #fff); }

  .hsd-controls { padding: 12px 18px 8px; }
  .hsd-input {
    width: 100%; padding: 9px 12px; box-sizing: border-box;
    background: var(--surface, #1a1d23); color: var(--text, #e6e6e6);
    border: 1px solid var(--border, #2a2d33); border-radius: 6px;
    font-size: 14px;
  }
  .hsd-input:focus { outline: none; border-color: var(--accent, #4ea1ff); }
  .hsd-filters {
    display: flex; align-items: center; gap: 12px; margin-top: 8px;
    font-size: 12px; color: var(--text-muted, #9aa0aa);
  }
  .hsd-since {
    background: var(--surface, #1a1d23); color: var(--text, #e6e6e6);
    border: 1px solid var(--border, #2a2d33); border-radius: 4px;
    padding: 4px 6px; font-size: 12px;
  }
  .hsd-repo-only { display: flex; align-items: center; gap: 6px; cursor: pointer; }
  .hsd-status { min-height: 16px; font-size: 11px; color: var(--text-muted, #9aa0aa); margin-top: 4px; }
  .hsd-status.is-error { color: #e07a7a; }

  .hsd-body {
    flex: 1; min-height: 0;
    display: grid; grid-template-columns: minmax(280px, 42%) 1fr;
    gap: 1px; background: var(--border, #2a2d33);
  }
  .hsd-results {
    margin: 0; padding: 0; list-style: none;
    background: var(--bg, #0f1115);
    overflow-y: auto;
  }
  .hsd-result {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border, #2a2d33);
    cursor: pointer;
    font-size: 12px;
  }
  .hsd-result:hover { background: var(--surface, #1a1d23); }
  .hsd-result.is-selected { background: var(--surface-2, #20232a); border-left: 2px solid var(--accent, #4ea1ff); padding-left: 12px; }
  .hsd-result-meta {
    display: flex; gap: 10px; font-size: 11px; color: var(--text-muted, #9aa0aa);
    margin-bottom: 4px; align-items: baseline;
  }
  .hsd-result-meta .role { font-weight: 600; color: var(--text, #e6e6e6); }
  .hsd-result-meta .ts { font-variant-numeric: tabular-nums; }
  .hsd-source-badge {
    padding: 1px 5px;
    border: 1px solid rgba(120, 168, 255, 0.35);
    border-radius: 3px;
    color: rgba(120, 168, 255, 0.95);
    background: rgba(120, 168, 255, 0.12);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
  }
  .hsd-source-badge.is-semantic {
    color: rgba(180, 140, 255, 0.95);
    background: rgba(180, 140, 255, 0.14);
    border-color: rgba(180, 140, 255, 0.40);
  }
  .hsd-result-cwd {
    font-size: 11px; color: var(--text-muted, #9aa0aa);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    direction: rtl; text-align: left;
  }
  .hsd-result-snippet {
    font-size: 12px; line-height: 1.45; margin-top: 4px;
    color: var(--text, #e6e6e6);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .hsd-result-snippet mark {
    background: rgba(255, 209, 102, 0.32); color: inherit;
    padding: 0 2px; border-radius: 2px;
  }

  .hsd-detail {
    background: var(--bg, #0f1115);
    overflow-y: auto;
    padding: 14px 18px;
    font-size: 13px; line-height: 1.5;
  }
  .hsd-detail-empty {
    color: var(--text-muted, #9aa0aa); font-style: italic; margin-top: 12px;
  }
  .hsd-detail-meta {
    display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px;
    font-size: 11px; color: var(--text-muted, #9aa0aa);
    padding-bottom: 10px; margin-bottom: 10px;
    border-bottom: 1px solid var(--border, #2a2d33);
  }
  .hsd-detail-meta dt { color: var(--text-muted, #9aa0aa); }
  .hsd-detail-meta dd { margin: 0; color: var(--text, #e6e6e6); word-break: break-all; }
  .hsd-detail-content {
    white-space: pre-wrap; word-break: break-word;
    font-family: inherit;
  }

  .hsd-empty-state {
    padding: 30px 18px; text-align: center;
    color: var(--text-muted, #9aa0aa); font-size: 13px;
  }

  @media (max-width: 720px) {
    .hsd-body { grid-template-columns: 1fr; grid-template-rows: 50% 50%; }
  }

/* ── Multi-session coordination ─────────────────────────────────────── */
.conv-item.list-selected { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.conv-item.active.list-selected { border-left-color: var(--purple); }
.coord-toolbar { display:none; position:sticky; bottom:0; z-index:20; background:var(--surface); border-top:1px solid var(--border); padding:8px 12px; gap:8px; align-items:center; font-size:12px; color:var(--text-muted); flex-shrink:0; }
.coord-toolbar.visible { display:flex; }
.coord-toolbar .coord-count { flex:1; }
.coord-toolbar .coord-btn { padding:4px 10px; font-size:12px; background:var(--accent); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.coord-toolbar .coord-btn.coord-trash-btn { background:var(--red); }
.coord-toolbar .coord-btn.coord-trash-btn:hover { background:color-mix(in srgb, var(--red) 85%, #fff); }
.coord-toolbar .coord-clear-btn { padding:4px 8px; font-size:13px; background:transparent; border:1px solid var(--border); color:var(--text-muted); border-radius:4px; cursor:pointer; line-height:1; }
.log-list.is-drag-selecting { cursor:crosshair; user-select:none; }
.coord-modal-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:1000; align-items:center; justify-content:center; }
.coord-modal-backdrop.visible { display:flex; }
.coord-modal { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:20px; width:420px; max-width:calc(100vw - 32px); box-shadow:0 8px 32px rgba(0,0,0,0.5); display:flex; flex-direction:column; gap:14px; }
.coord-modal h3 { margin:0; font-size:14px; font-weight:600; color:var(--text); }
.coord-modal label { font-size:12px; color:var(--text-muted); display:block; margin-bottom:4px; }
.coord-modal input[type="text"] { width:100%; box-sizing:border-box; padding:6px 8px; background:var(--bg); border:1px solid var(--border); border-radius:4px; color:var(--text); font-size:13px; }
.coord-modal .mode-row { display:flex; gap:16px; font-size:13px; }
.coord-modal .mode-hint { font-size:11px; color:var(--text-muted); margin-top:2px; }
.coord-modal .participants-list { display:flex; flex-direction:column; gap:6px; max-height:160px; overflow-y:auto; }
.coord-modal .participant-row { display:flex; align-items:center; gap:8px; font-size:12px; }
.coord-modal .participant-row .p-name { font-weight:500; color:var(--text); }
.coord-modal .participant-row .p-cwd { color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:200px; }
.coord-modal .modal-footer { display:flex; justify-content:flex-end; gap:8px; margin-top:4px; }
.coord-modal .modal-cancel { padding:6px 14px; background:transparent; border:1px solid var(--border); color:var(--text-muted); border-radius:4px; cursor:pointer; font-size:13px; }
.coord-modal .modal-start { padding:6px 14px; background:var(--accent); color:#fff; border:none; border-radius:4px; cursor:pointer; font-size:13px; font-weight:500; }
.coord-modal .modal-error { font-size:12px; color:var(--red); display:none; }
.coord-modal .modal-error.visible { display:block; }
/* Engine bridge recovery — opened from the transport pill. */
.bridge-recovery-backdrop {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.55);
  z-index:1000; align-items:center; justify-content:center; padding:16px;
  box-sizing:border-box;
}
.bridge-recovery-backdrop.visible { display:flex; }
.bridge-recovery-modal {
  background:var(--surface); border:1px solid var(--border); border-radius:10px;
  padding:18px; width:440px; max-width:100%; max-height:calc(100dvh - 32px);
  overflow:auto; box-shadow:0 8px 32px rgba(0,0,0,0.5);
  display:flex; flex-direction:column; gap:13px; box-sizing:border-box;
}
.bridge-recovery-heading { display:flex; align-items:flex-start; gap:12px; }
.bridge-recovery-heading > div { flex:1; min-width:0; }
.bridge-recovery-modal h3 { margin:0; font-size:15px; color:var(--text); }
.bridge-recovery-subtitle { margin-top:3px; font-size:12px; color:var(--text-muted); }
.bridge-recovery-close {
  border:0; background:transparent; color:var(--text-muted); cursor:pointer;
  font-size:22px; line-height:1; padding:0 2px;
}
.bridge-recovery-status {
  padding:10px 11px; border:1px solid var(--border); border-radius:7px;
  background:var(--bg); color:var(--text-muted); font-size:12px; line-height:1.45;
}
.bridge-recovery-status.is-safe {
  border-color:rgba(63,185,80,0.42); background:rgba(63,185,80,0.08);
  color:var(--green);
}
.bridge-recovery-status.is-blocked {
  border-color:rgba(248,81,73,0.48); background:rgba(248,81,73,0.09);
  color:var(--red);
}
.bridge-recovery-queue {
  margin:0; padding:9px; border:1px solid var(--border); border-radius:7px;
  display:flex; flex-direction:column; gap:6px; min-width:0;
}
.bridge-recovery-queue legend { padding:0 5px; color:var(--text-muted); font-size:11px; }
.bridge-recovery-message {
  display:flex; gap:8px; align-items:flex-start; padding:8px;
  border:1px solid transparent; border-radius:6px; cursor:pointer;
}
.bridge-recovery-message:hover { background:var(--surface-2); }
.bridge-recovery-message:has(input:checked) {
  border-color:rgba(88,166,255,0.45); background:rgba(88,166,255,0.08);
}
.bridge-recovery-message input { margin-top:2px; }
.bridge-recovery-message-text {
  min-width:0; color:var(--text); font-size:12px; line-height:1.35;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:3;
  -webkit-box-orient:vertical; white-space:pre-wrap;
}
.bridge-recovery-empty, .bridge-recovery-note {
  color:var(--text-muted); font-size:11px; line-height:1.4;
}
.bridge-recovery-modal .modal-error { display:none; color:var(--red); font-size:12px; }
.bridge-recovery-modal .modal-error.visible { display:block; }
.bridge-recovery-modal .modal-footer {
  display:flex; justify-content:flex-end; gap:8px; margin-top:2px;
}
.bridge-recovery-modal .modal-cancel,
.bridge-recovery-modal .modal-start {
  padding:7px 13px; border-radius:5px; cursor:pointer; font-size:13px;
}
.bridge-recovery-modal .modal-cancel {
  background:transparent; border:1px solid var(--border); color:var(--text-muted);
}
.bridge-recovery-modal .modal-start {
  border:0; background:var(--accent); color:#fff; font-weight:600;
}
.bridge-recovery-modal .modal-start:disabled { opacity:0.5; cursor:not-allowed; }
@media (max-width: 720px) {
  .bridge-recovery-backdrop { padding:10px; align-items:flex-end; }
  .bridge-recovery-modal { width:100%; max-height:calc(100dvh - 20px); }
  .bridge-recovery-modal .modal-cancel,
  .bridge-recovery-modal .modal-start { padding:10px 14px; }
}
/* In-browser folder picker — fallback when no native GUI chooser exists
   (headless Linux). Reuses the coord-modal visual language. */
.folder-picker-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:1000; align-items:center; justify-content:center; padding:16px; box-sizing:border-box; }
.folder-picker-backdrop.visible { display:flex; }
.folder-picker { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:20px; width:480px; max-width:100%; max-height:calc(100vh - 32px); box-shadow:0 8px 32px rgba(0,0,0,0.5); display:flex; flex-direction:column; gap:12px; box-sizing:border-box; }
.folder-picker h3 { margin:0; font-size:14px; font-weight:600; color:var(--text); }
.folder-picker .fp-note { font-size:11px; color:var(--text-muted); }
.folder-picker .fp-path-row { display:flex; gap:6px; }
.folder-picker .fp-up-btn { padding:6px 10px; background:var(--surface-2); border:1px solid var(--border); color:var(--text); border-radius:4px; cursor:pointer; font-size:13px; line-height:1; flex-shrink:0; }
.folder-picker .fp-up-btn:hover { background:var(--border); }
.folder-picker .fp-up-btn:disabled { opacity:0.4; cursor:default; }
.folder-picker input[type="text"] { flex:1; box-sizing:border-box; padding:6px 8px; background:var(--bg); border:1px solid var(--border); border-radius:4px; color:var(--text); font-size:13px; font-family:monospace; }
.folder-picker .fp-list { display:flex; flex-direction:column; max-height:280px; min-height:120px; overflow-y:auto; border:1px solid var(--border); border-radius:4px; background:var(--bg); }
.folder-picker .fp-item { flex:0 0 auto; padding:6px 10px; font-size:13px; color:var(--text); cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.folder-picker .fp-item:hover, .folder-picker .fp-item.active { background:var(--surface-2); }
.folder-picker .fp-empty { padding:14px 10px; font-size:12px; color:var(--text-muted); text-align:center; }
.folder-picker .modal-footer { display:flex; justify-content:flex-end; gap:8px; margin-top:4px; }
.folder-picker .modal-cancel { padding:6px 14px; background:transparent; border:1px solid var(--border); color:var(--text-muted); border-radius:4px; cursor:pointer; font-size:13px; }
.folder-picker .modal-start { padding:6px 14px; background:var(--accent); color:#fff; border:none; border-radius:4px; cursor:pointer; font-size:13px; font-weight:500; }
.folder-picker .modal-error { font-size:12px; color:var(--red); display:none; }
.folder-picker .modal-error.visible { display:block; }
/* Phone: near-full-width sheet, bigger touch targets, list sized to viewport. */
@media (max-width: 720px) {
  .folder-picker-backdrop { padding:10px; }
  .folder-picker { padding:14px; width:100%; max-height:calc(100dvh - 20px); }
  .folder-picker .fp-note { font-size:12px; }
  .folder-picker .fp-list { max-height:42vh; }
  .folder-picker .fp-item { padding:10px 12px; font-size:14px; }
  .folder-picker .fp-up-btn { padding:8px 12px; }
  .folder-picker .modal-cancel, .folder-picker .modal-start { padding:10px 16px; }
}
.gc-reader { display:flex; flex-direction:column; height:100%; overflow:hidden; position:relative; }
.gc-reader-header { display:flex; align-items:center; gap:8px; padding:10px 14px; border-bottom:1px solid var(--border); flex-shrink:0; }
.gc-reader-header .gc-topic { font-weight:600; font-size:13px; color:var(--text); flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gc-reader-header .gc-mode-badge { font-size:11px; padding:2px 6px; border-radius:10px; background:var(--surface-2); color:var(--text-muted); flex-shrink:0; }
.gc-reader-header .gc-close { background:var(--surface-2); border:1px solid var(--border); color:var(--text); cursor:pointer; font-size:12px; font-weight:500; padding:3px 10px; border-radius:4px; flex-shrink:0; }
.gc-reader-header .gc-close:hover { background:var(--border); }
.gc-reader-sticky-meta {
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.gc-reader-sticky-meta .csh-col {
  flex: 1;
  min-width: 0;
}
.gc-reader-sticky-meta .label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}
.gc-reader-sticky-meta .original-label {
  color: var(--green);
}
.gc-reader-sticky-meta .last-label {
  color: var(--orange);
}
.gc-reader-sticky-meta .speaker-name {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gc-reader-body { flex:1; overflow-y:auto; padding:14px 20px 16px; font-size:16px; line-height:1.6; color:var(--text); }
.gc-reader-body .gc-poll-error { color:var(--red); font-size:12px; padding:6px 0; }
.gc-chat-preamble {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.gc-chat-preamble .md-h { margin-top: 0; font-size: 16px; color: var(--text); }
.gc-chat-preamble ul { margin: 6px 0 0 18px; }
.gc-message {
  margin: 0 0 18px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  max-width: 72%;
}
/* Chat-style alignment — each speaker stays on its own side so the
   conversation reads like a group thread, not a flat log.
   ALL THE WAY LEFT / ALL THE WAY RIGHT — cards flush with the
   transcript edges. Human always right (iMessage convention).
   Agents cycle through three accent colors but only two sides
   (left, right) so the visual rhythm is two distinct columns.
   System messages stretch full-width. */
.gc-message[data-speaker-side="left"],
.gc-message[data-speaker-side="left-1"],
.gc-message[data-speaker-side="left-2"] {
  margin-left: 0 !important;
  margin-right: auto !important;
}
.gc-message[data-speaker-side="right"],
.gc-message[data-speaker-side="right-agent"],
.gc-message[data-speaker-side="right-1"] {
  margin-left: auto !important;
  margin-right: 0 !important;
}
.gc-message[data-speaker-side="center"] {
  margin-left: auto;
  margin-right: auto;
}
.gc-message[data-speaker-side="full"] {
  max-width: 100%;
}
/* Per-speaker color tinting — keyed off data-speaker-color so multiple
   agents on the same side stay visually distinguishable. */
.gc-message[data-speaker-color="green"] .gc-message-meta {
  background: color-mix(in srgb, var(--green) 14%, var(--surface) 86%);
  border-bottom-color: color-mix(in srgb, var(--green) 30%, transparent);
}
.gc-message[data-speaker-color="green"] .gc-message-speaker { color: var(--green); }
.gc-message[data-speaker-color="accent"] .gc-message-meta {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  border-bottom-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.gc-message[data-speaker-color="accent"] .gc-message-speaker { color: var(--accent); }
.gc-message[data-speaker-color="purple"] .gc-message-meta {
  background: color-mix(in srgb, var(--purple) 12%, var(--surface) 88%);
  border-bottom-color: color-mix(in srgb, var(--purple) 28%, transparent);
}
.gc-message[data-speaker-color="purple"] .gc-message-speaker { color: var(--purple); }
.gc-message[data-speaker-color="orange"] .gc-message-meta {
  background: color-mix(in srgb, var(--orange) 12%, var(--surface) 88%);
  border-bottom-color: color-mix(in srgb, var(--orange) 28%, transparent);
}
.gc-message[data-speaker-color="orange"] .gc-message-speaker { color: var(--orange); }
.gc-message[data-speaker-color="cyan"] .gc-message-meta {
  background: color-mix(in srgb, var(--cyan) 12%, var(--surface) 88%);
  border-bottom-color: color-mix(in srgb, var(--cyan) 28%, transparent);
}
.gc-message[data-speaker-color="cyan"] .gc-message-speaker { color: var(--cyan); }
.gc-message[data-speaker-color="red"] .gc-message-meta {
  background: color-mix(in srgb, var(--red) 10%, var(--surface) 90%);
  border-bottom-color: color-mix(in srgb, var(--red) 25%, transparent);
}
.gc-message[data-speaker-color="red"] .gc-message-speaker { color: var(--red); }
.gc-message[data-speaker-color="yellow"] .gc-message-meta {
  background: color-mix(in srgb, var(--yellow, #d4a72c) 14%, var(--surface) 86%);
  border-bottom-color: color-mix(in srgb, var(--yellow, #d4a72c) 30%, transparent);
}
.gc-message[data-speaker-color="yellow"] .gc-message-speaker { color: var(--yellow, #d4a72c); }
/* Speaker meta is now a full-width header bar with a tinted background,
   so each message reads as a clearly-bounded card and the boundary
   between messages is obvious at a glance. */
.gc-message-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.gc-message-speaker {
  color: var(--accent);
  font-weight: 700;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gc-message-time {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  opacity: 0.72;
  flex: 0 0 auto;
}
/* Body sits below the header bar with comfortable padding so the
   message reads as a clear card, not a header floating over text. */
.gc-message-body {
  padding: 10px 12px 12px;
}
/* System messages get a quieter header tint so the lifecycle log
   doesn't look as loud as actual participant posts. */
.gc-message.gc-system .gc-message-meta {
  background: color-mix(in srgb, var(--text-muted) 14%, var(--surface) 86%);
  border-bottom-color: color-mix(in srgb, var(--text-muted) 28%, transparent);
}
.conversations-view .gc-message-body.assistant-text {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
}
/* Browser default p margin is 1em top + bottom (~16px). With line-height 1.6
   that makes a single-paragraph message ~58px tall — reads as empty padding
   and triggers "is this broken?" reactions. Tighten paragraph spacing inside
   the chat body so short messages hug their speaker meta. Also drop the
   first/last-child margins entirely so the body box snaps to the content. */
.gc-message-body p { margin: 4px 0; }
.gc-message-body p:first-child { margin-top: 0; }
.gc-message-body p:last-child { margin-bottom: 0; }
.gc-message-body > :first-child { margin-top: 0; }
.gc-message-body > :last-child { margin-bottom: 0; }
.gc-message-empty { color: var(--text-muted); }
/* Group-chat reader input — matches the convo `.conv-input-bar` shape:
   single rounded card, soft focus-within ring, no inner-input border,
   round arrow send button. Textarea autosizes from 1 row up to ~10. */
.gc-reader-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  margin: 6px 14px 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg);
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gc-reader-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110,140,175,0.16);
}
.gc-reader-input-row textarea,
.gc-reader-input-row input {
  flex: 1;
  padding: 6px 4px;
  border: none; outline: none;
  background: transparent;
  color: #f0f6fc;
  font-size: 14px; font-weight: 500; font-family: inherit;
  line-height: 1.5;
  resize: none;
  overflow-y: auto;
  min-height: 24px;
  max-height: 240px;
}
:root[data-theme="light"] .gc-reader-input-row textarea,
:root[data-theme="light"] .gc-reader-input-row input { color: #1f2328; }
.gc-reader-input-row textarea::placeholder,
.gc-reader-input-row input::placeholder {
  color: var(--text-muted); opacity: 0.6; font-weight: 400;
}
.gc-reader-input-row .gc-send-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: #fff; cursor: pointer;
  line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, transform 0.05s;
  font-size: 0;
}
.gc-reader-input-row .gc-send-btn:hover { opacity: 0.9; }
.gc-reader-input-row .gc-send-btn:active { transform: translateY(1px); }
/* Replay: simulate the human actually typing their reply, then sending it
   (CCC-495) — a glowing border while text fills in, a quick flash on the
   send button the instant it "submits" into the transcript. */
.gc-reader-input-row:has(textarea.gc-replay-typing) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110,140,175,0.16);
}
.gc-reader-input-row .gc-send-btn.gc-replay-send-flash {
  transform: scale(0.85);
  box-shadow: 0 0 0 4px rgba(110,140,175,0.35);
}
.gc-reader-input-row .tts-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
  background: transparent; color: var(--text-muted);
  line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}
.gc-reader-input-row .tts-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.gc-reader-input-row .tts-btn:active { transform: translateY(1px); }
.gc-reader-input-row .tts-btn.speaking {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.28),
    0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translateY(1px);
}
.gc-reader-input-row .tts-btn.failed {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 55%, transparent);
}
.gc-reader-input-row .tts-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.gc-reader-input-row .mic-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
  background: transparent; color: var(--text-muted);
  line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}
.gc-reader-input-row .mic-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.gc-reader-input-row .mic-btn:active { transform: translateY(1px); }
.gc-reader-input-row .mic-btn.recording {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.28),
    0 0 0 2px color-mix(in srgb, var(--red) 22%, transparent);
  transform: translateY(1px);
  animation: ccc-mic-pulse 1.5s infinite;
}
.gc-reader-input-row .mic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.gc-reader-input-row button svg { display: block; }

/* In Group Chat section — sessions currently in an active coordination */
#convList .conv-ingroupchat-section { margin-top: 0; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
#convList .conv-ingroupchat-header {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  cursor: pointer; user-select: none;
}
#convList .conv-ingroupchat-header:hover { background: rgba(139,148,158,0.08); }
#convList .conv-ingroupchat-arrow {
  display: inline-block; font-size: 9px; opacity: 0.7; flex-shrink: 0;
  width: 10px; text-align: center;
}
/* Collapsed state hides the list while keeping the header (and its count
   badge) visible so the user can re-expand from the same affordance.
   Drop the bottom padding too so the header reads as a single bar. */
#convList .conv-ingroupchat-section.collapsed .conv-ingroupchat-list {
  display: none;
}
#convList .conv-ingroupchat-section.collapsed { padding-bottom: 0; }
#convList .conv-ingroupchat-icon { font-size: 13px; }
#convList .conv-ingroupchat-label { color: var(--accent); }
#convList .conv-ingroupchat-topic { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
#convList .conv-ingroupchat-count {
  margin-left: auto; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 8px; font-size: 11px;
  color: var(--text-muted); font-weight: 600; flex-shrink: 0;
}

/* In Group Chat rows — one row per chat (active or recently closed). */
#convList .conv-ingroupchat-list { display: flex; flex-direction: column; }
#convList .conv-ingroupchat-row {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  /* Match session title alignment while keeping the chat marker in the
     same left rail as the session's engine/model icons. */
  padding: 5px 14px 5px 63px; cursor: pointer; font-size: 12px;
  color: var(--text);
  border-left: 3px solid transparent;
  border-radius: 6px;
}
#convList .conv-ingroupchat-row.active {
  background: var(--surface-2);
  border-left-color: var(--purple);
}
#convList .conv-ingroupchat-row:hover { background: var(--row-hover, rgba(255,255,255,0.04)); }
#convList .conv-ingroupchat-row-icon {
  position: absolute; left: 12px;
  font-size: 12px; flex-shrink: 0; opacity: 0.85;
}
/* Collapse chevron (CCC-489) — hides the participant list + waiting hint. */
#convList .conv-ingroupchat-collapse-btn {
  position: absolute; left: 36px;
  background: none; border: none; cursor: pointer;
  font-size: 10px; padding: 2px; opacity: 0.55;
  color: var(--text-muted); flex-shrink: 0;
  width: 14px; text-align: center;
  border-radius: 3px;
}
#convList .conv-ingroupchat-collapse-btn:hover { opacity: 1; color: var(--text); }
#convList .conv-ingroupchat-collapse-spacer { cursor: default; }
#convList .conv-ingroupchat-chat.is-collapsed .conv-ingroupchat-row-waiting,
#convList .conv-ingroupchat-chat.is-collapsed .conv-ingroupchat-participants {
  display: none;
}
#convList .conv-ingroupchat-row-topic {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#convList .conv-ingroupchat-row-closed {
  opacity: 0.55;
  filter: saturate(0.7);
}
#convList .conv-ingroupchat-row-closed .conv-ingroupchat-row-topic { color: var(--text-muted); }
#convList .conv-ingroupchat-status-pill {
  font-size: 10px; padding: 1px 5px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); text-transform: lowercase;
  letter-spacing: 0.3px; flex-shrink: 0;
}
#convList .conv-ingroupchat-partcount {
  font-size: 10px; padding: 1px 5px; border-radius: 8px;
  background: transparent; color: var(--text-muted);
  flex-shrink: 0;
}
#convList .conv-ingroupchat-archive-btn,
#convList .conv-ingroupchat-rename-btn,
#convList .conv-ingroupchat-clear-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 2px 4px; opacity: 0;
  color: var(--text-muted); flex-shrink: 0;
  border-radius: 3px;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
#convList .conv-ingroupchat-row:hover .conv-ingroupchat-archive-btn,
#convList .conv-ingroupchat-row:hover .conv-ingroupchat-rename-btn,
#convList .conv-ingroupchat-row:hover .conv-ingroupchat-clear-btn { opacity: 0.7; }
#convList .conv-ingroupchat-rename-btn:hover,
#convList .conv-ingroupchat-clear-btn:hover { opacity: 1; }
#convList .conv-ingroupchat-archive-btn:hover {
  opacity: 1; color: var(--orange); background: rgba(255,166,87,0.12);
}

/* Enable/disable knob. Hover-reveal like its siblings, but stays visible when
   the chat is disabled so the row carries an obvious "click to re-enable". */
#convList .conv-ingroupchat-pause-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; padding: 2px 4px; opacity: 0;
  color: var(--text-muted); flex-shrink: 0;
  border-radius: 3px;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
#convList .conv-ingroupchat-row:hover .conv-ingroupchat-pause-btn { opacity: 0.7; }
#convList .conv-ingroupchat-pause-btn:hover {
  opacity: 1; color: var(--red); background: rgba(248,81,73,0.12);
}
#convList .conv-ingroupchat-pause-btn.is-paused {
  opacity: 0.95; color: var(--green);
}
#convList .conv-ingroupchat-pause-btn.is-paused:hover {
  opacity: 1; color: var(--green); background: rgba(63,185,80,0.14);
}
/* Disabled chats: dim the row and badge it, distinct from a closed chat. */
#convList .conv-ingroupchat-row-paused { opacity: 0.6; }
#convList .conv-ingroupchat-status-pill.is-paused {
  background: rgba(248,81,73,0.12); border-color: rgba(248,81,73,0.5);
  color: var(--red);
}

/* "+" affordance on the section header — create an empty chat. */
#convList .conv-ingroupchat-new-btn {
  margin-left: auto; background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  width: 18px; height: 18px; line-height: 16px; padding: 0;
  border-radius: 4px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
#convList .conv-ingroupchat-new-btn:hover {
  background: rgba(88, 166, 255, 0.12); color: var(--accent); border-color: rgba(88, 166, 255, 0.4);
}

/* Drop-target highlight while dragging a session row over a chat row. */
#convList .conv-ingroupchat-row.gc-drop-target {
  outline: 2px dashed var(--accent); outline-offset: -3px;
  background: rgba(88, 166, 255, 0.08);
}

/* Inline group-chat list: sits at the TOP of the In Progress section
   (instead of a standalone section above it). A subtle bottom rule
   visually divides the chat rows from the underlying session rows so
   the eye can still see them as a distinct cluster. */
#convList .conv-ingroupchat-list--inline {
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

/* Drop-target highlight on the open group-chat reader pane — drag any
   conv-list session row onto the reader to add it as a participant.
   Mirror the sidebar row highlight. */
#gcReader.gc-drop-target {
  outline: 2px dashed var(--accent); outline-offset: -4px;
  background: rgba(88, 166, 255, 0.05);
}
.gc-nudge-notice {
  color: var(--accent, #58a6ff); font-size: 11.5px; font-style: italic;
  opacity: 0.75; padding: 4px 14px 8px; user-select: none;
}

/* Per-message receipt chips — CCC-62 */
.gc-message-receipts {
  display: flex; gap: 3px; margin-top: 5px; flex-wrap: wrap;
}
.gc-receipt-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 8px; font-weight: 700; letter-spacing: -0.5px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; cursor: default;
}
.gc-receipt-avatar.is-responded {
  background: var(--accent, #58a6ff); color: #fff; opacity: 0.85;
}
.gc-receipt-avatar.is-quiet {
  background: rgba(139,148,158,0.18); color: var(--text-muted); opacity: 0.5;
}

/* Per-message alert line — CCC-109: who was pinged after this message, when. */
.gc-message-alerts {
  display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}
.gc-alert-chip {
  font-size: 11px; color: var(--text-muted);
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.22);
  border-radius: 999px; padding: 1px 8px;
  cursor: default; white-space: nowrap;
}
.gc-alert-chip strong { color: var(--text); font-weight: 600; }

/* "↓ New posts" pill — fresh content landed while scrolled up (CCC-110). */
.gc-new-posts-pill {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 86px; z-index: 30;
  background: var(--accent, #58a6ff); color: #fff;
  border: none; border-radius: 999px;
  font: 600 12px inherit; padding: 6px 14px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.gc-new-posts-pill:hover { filter: brightness(1.1); }

/* Empty section: collapse the bottom padding so the lone header reads
   as a single bar rather than a half-empty container. */
#convList .conv-ingroupchat-section.is-empty { padding-bottom: 0; }

/* Indented participant list under each chat row. */
#convList .conv-ingroupchat-participants {
  display: flex; flex-direction: column;
  padding: 2px 14px 6px 28px;  /* hanging indent under the 💬 icon */
  gap: 1px;
}
#convList .conv-ingroupchat-participant {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 6px; cursor: pointer;
  font-size: 11px; color: var(--text-muted);
  border-radius: 3px;
  transition: background 0.1s ease, color 0.1s ease;
}
#convList .conv-ingroupchat-participant:hover {
  background: rgba(88, 166, 255, 0.08); color: var(--text);
}
#convList .conv-ingroupchat-participant-bullet {
  opacity: 0.5; flex-shrink: 0;
}
#convList .conv-ingroupchat-participant-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1 1 auto; min-width: 0;
}
#convList .conv-ingroupchat-participant-hash {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 10px; opacity: 0.55;
  flex-shrink: 0; padding: 0 4px;
}
#convList .conv-ingroupchat-participant-when {
  font-size: 10px; opacity: 0.6; flex-shrink: 0;
  white-space: nowrap;
}
#convList .conv-ingroupchat-waiting-chip {
  font-size: 10px; padding: 0 5px; border-radius: 8px;
  background: rgba(88, 166, 255, 0.14);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.35);
  flex-shrink: 0; line-height: 14px;
}
#convList .conv-ingroupchat-row-when {
  font-size: 10px; opacity: 0.55; flex-shrink: 0;
  white-space: nowrap;
}
#convList .conv-ingroupchat-row-waiting {
  padding: 1px 14px 5px 28px;
  font-size: 11px; color: var(--text-muted); opacity: 0.95;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#convList .conv-ingroupchat-participant-remove {
  background: transparent; border: none; cursor: pointer;
  font-size: 14px; line-height: 1;
  color: var(--text-muted); flex-shrink: 0;
  padding: 0 4px; opacity: 0;
  transition: opacity 0.1s ease, color 0.1s ease;
}
#convList .conv-ingroupchat-participant:hover .conv-ingroupchat-participant-remove {
  opacity: 0.65;
}
#convList .conv-ingroupchat-participant-remove:hover {
  opacity: 1; color: var(--red);
}
#convList .conv-ingroupchat-chat-closed .conv-ingroupchat-participant {
  opacity: 0.55;
}

/* "IN GROUP CHAT" badge on participating rows in the main list. */
.conv-signal.in-group-chat {
  background: rgba(88, 166, 255, 0.14);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.35);
  font-weight: 600; letter-spacing: 0.3px;
}
.conv-signal.in-group-chat.is-icon-only {
  padding: 1px 4px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

/* Archived group chat rows — interleaved with regular archived sessions. */
#convList .conv-item-archived-gc {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px; cursor: pointer; font-size: 12px;
  color: var(--text-muted);
}
#convList .conv-item-archived-gc:hover { background: var(--row-hover, rgba(255,255,255,0.04)); }
#convList .archive-row-gc-icon { font-size: 12px; flex-shrink: 0; opacity: 0.85; }
#convList .archive-row-gc-topic {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#convList .archive-row-gc-partcount {
  font-size: 10px; padding: 1px 5px; border-radius: 8px;
  background: transparent; color: var(--text-muted);
  flex-shrink: 0;
}
#convList .conv-archived-gc-unarchive-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 2px 4px; opacity: 0;
  color: var(--text-muted); flex-shrink: 0;
  border-radius: 3px;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
#convList .conv-item-archived-gc:hover .conv-archived-gc-unarchive-btn { opacity: 0.7; }
#convList .conv-archived-gc-unarchive-btn:hover {
  opacity: 1; color: var(--accent); background: rgba(88,166,255,0.12);
}
#convList .conv-archived-gc-unarchive-btn[data-role="archived-gc-trash"]:hover,
#convList .conv-ingroupchat-archive-btn[data-role="ingroupchat-trash"]:hover {
  color: var(--red); background: rgba(248,81,73,0.12);
}

/* ---------------------------------------------------------------------------
   Standalone-mode polish (PWA "Add to Dock" / "Install app")
   ---------------------------------------------------------------------------
   Only applies when CCC is launched in its own window via the PWA install
   path. Goal: close the visual gap with native dashboards (Omnara et al.)
   without changing the in-browser UX one pixel. Three deliberate moves:

     1) Color restraint — demote chromatic workspace badges to a neutral
        surface tone in standalone mode. The accent (purple/coral active
        state) remains so the eye still has one place to land.
     2) Type rhythm — slightly tighter tabular-nums for timestamps, a touch
        more line-height in conversation titles for breathing room.
     (Row-padding bump was tried and reverted — the dense layout is
     deliberate and any vertical breathing on conv rows felt too spacious.)

   Everything is additive, scoped under @media (display-mode: standalone).
   Browser users see the unchanged dense-but-information-rich layout they
   already rely on. PWA users get the calmer, focused feel.
   -------------------------------------------------------------------------- */

@media (display-mode: standalone), (display-mode: window-controls-overlay), (display-mode: minimal-ui) {
  /* Chip muting moved out of standalone-only and gated on the explicit
     `body.chips-muted` toggle (sidebar header). Standalone mode no longer
     auto-mutes — the user controls it. The chip toggle's own rules at
     ~line 3443+ handle `.conv-folder-chip`. The other pills below stay
     scoped to standalone-only so the in-row status pills, branch pills,
     etc. still pick up the calmer treatment when the PWA window is open
     — except when chips-muted is OFF, where they keep their colors.
     Bottom line: opt-in via the toggle, no `!important`. */

  /* Sidebar header — let it breathe a touch more so the app title doesn't
     sit right against the live-dot. */
  .sidebar-header {
    padding-top: 18px;
    padding-bottom: 18px;
    letter-spacing: 0.01em;
  }

  /* Subtle: thinner border between sidebar and main pane. Native apps
     usually use a 1px hairline at lower contrast. */
  .sidebar {
    border-right: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  }

  /* Installed windows use the same responsive navigation as the browser. */
  body.has-mobile-bottom-nav .ccc-side-nav { display: none !important; }
  body.has-mobile-bottom-nav { padding-left: 0 !important; }
  body.has-side-nav #termPanel { left: 0 !important; }

  /* Resize handle — visually killed entirely. The slight bg step between
     the sidebar (`--surface` #161b22) and the main pane (`--bg` #0d1117)
     is the divider you perceive; no separate gray bar is needed. We keep
     the element at width:1px (not 0) so it still occupies a layout slot
     in the flex row, and the existing ::before in the base rule extends
     the drag hit area by 4px on each side — so dragging continues to
     work invisibly across a 9px target zone. Hover affordance: the bar
     fades in subtly so the user can find the grab point. */
  .sidebar-resizer {
    width: 1px;
    background: transparent;
  }
  .sidebar-resizer:hover,
  .sidebar-resizer.dragging {
    background: color-mix(in srgb, var(--accent) 50%, transparent);
  }

  /* Hide scrollbars throughout — keep the scrolling behaviour, just make
     the chrome invisible. Trackpad / wheel / keyboard scrolling all still
     work; only the visible track + thumb go away. WebKit (Safari, Chrome)
     uses ::-webkit-scrollbar; Firefox uses scrollbar-width.

     Targets the four scroll containers we have:
       #convList                 → sidebar conversation list
       .conversations-view       → main pane transcript
       .log-list, .tool-filters  → secondary sidebar panes (stats, filters)
     plus a generic *-overflow:auto safety net so any newly-added scroller
     gets the same treatment without us hunting for it. */
  #convList,
  .conversations-view,
  .log-list,
  .tool-filters,
  .sidebar [style*="overflow"],
  .main [style*="overflow"] {
    scrollbar-width: none;
  }
  #convList::-webkit-scrollbar,
  .conversations-view::-webkit-scrollbar,
  .log-list::-webkit-scrollbar,
  .tool-filters::-webkit-scrollbar,
  .sidebar [style*="overflow"]::-webkit-scrollbar,
  .main [style*="overflow"]::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  /* Topbar gets a thin draggable region hint when the platform supports
     window-controls-overlay. Pure visual cue — the actual draggability
     comes from the platform when WCO is active. No-op elsewhere. */
  @supports (-webkit-app-region: drag) {
    body { -webkit-app-region: no-drag; }
    .sidebar-header,
    .topbar { -webkit-app-region: drag; }
    .sidebar-header *,
    .topbar button,
    .topbar input,
    .topbar a { -webkit-app-region: no-drag; }
  }
}

/* ---------------------------------------------------------------------------
   Conversation pane typography — universal (browser + standalone)
   ---------------------------------------------------------------------------
   Targets the rendered assistant message body (`.assistant-text`). Goal: the
   Omnara-style Inter look applied to whatever the model writes — bigger
   structural headers, bolder <strong>, italic blockquotes with a hairline
   left rule, comfortable list spacing, capped reading width. Mirrors what
   Inter as `--font-ui` already buys us in the surrounding chrome.
   -------------------------------------------------------------------------- */
.assistant-text {
  font-size: 15px;
  line-height: 1.6;
  /* No max-width cap — when the user widens the conversation pane they want
     the text to use it. Earlier I clamped to 72ch for "comfortable reading
     width", but in a 1400px-wide pane that strands ~700px of empty space on
     the right. Trust the user's pane sizing instead. */
}
/* Headers — boosted sizes + bigger top margin so they break visually
   from the preceding paragraph. The previous values (22/18/15) were too
   subtle: at 15px body the h2 jump felt like emphasis, not structure.
   Now h1=28, h2=22, h3=17 with `font-weight: 800` so Inter's heavy weight
   actually carries. The pseudo-header (model emits `**Title**` on its own
   line) is treated as h3-equivalent so it stays one rung below explicit
   `##` headers. */
.assistant-text h1.md-h { font-size: 28px; font-weight: 800; margin: 24px 0 10px; letter-spacing: -0.02em; }
.assistant-text h2.md-h { font-size: 22px; font-weight: 800; margin: 22px 0 8px;  letter-spacing: -0.015em; }
.assistant-text h3.md-h { font-size: 17px; font-weight: 700; margin: 18px 0 6px;  letter-spacing: -0.01em; }
.assistant-text h3.md-h-pseudo { font-size: 16px; font-weight: 700; margin: 16px 0 4px; }
.assistant-text strong { font-weight: 700; color: var(--text); }
.assistant-text ol,
.assistant-text ul {
  /* Logical (not padding-left): dir="auto" flips these to RTL for
     Hebrew-heavy replies (common on the Kimi engine) — a physical
     left-padding stranded the bullet indent on the wrong side while the
     text right-aligned, producing a torn-looking list (CCC-919). */
  padding-inline-start: 26px;
  margin: 8px 0;
}
.assistant-text ol {
  list-style-type: decimal;
}
.assistant-text ul {
  list-style-type: disc;
}
.assistant-text ol li,
.assistant-text ul li { margin: 6px 0; }
/* ---------------------------------------------------------------------------
   Archive-loading stages
   ---------------------------------------------------------------------------
   Replaces the bare "Loading archive…" placeholder with a vertical stage
   list during /api/conversations/all. Each stage has a glyph (○ pending,
   ● running, ✓ done, ! error, – skipped) plus a label and optional detail.
   Polled at ~250ms; once the archive renders real rows the stages get
   wiped by the regular renderer.
   -------------------------------------------------------------------------- */
.archive-loading-stages {
  padding: 18px 16px;
  font-size: 13px;
  color: var(--text);
}
.archive-loading-stages .als-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 10px 22px;
}
.archive-loading-stages .als-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: baseline;
  gap: 0 8px;
  padding: 5px 0;
}
.archive-loading-stages .als-glyph {
  font-size: 13px; line-height: 1.2;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
}
.archive-loading-stages .als-pending { color: var(--text-muted); opacity: 0.5; }
.archive-loading-stages .als-running {
  color: var(--accent);
  /* Soft pulse so the running stage reads as live without a spinner GIF. */
  animation: als-pulse 1s ease-in-out infinite;
}
@keyframes als-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.archive-loading-stages .als-done    { color: var(--green); }
.archive-loading-stages .als-error   { color: var(--orange); }
.archive-loading-stages .als-skipped { color: var(--text-muted); opacity: 0.6; }
.archive-loading-stages .als-label   { color: var(--text); }
.archive-loading-stages .als-state-pending .als-label,
.archive-loading-stages .als-state-skipped .als-label {
  color: var(--text-muted);
}
.archive-loading-stages .als-count {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
  font-size: 12px; color: var(--text-muted);
}
.archive-loading-stages .als-detail {
  grid-column: 2 / 4;
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
  /* Pin the content box so the pill is the same 22px tall as q2's, whose
     font resolves to a 14px line box. `normal` differs between the two
     stacks and left this 2px taller. */
  line-height: 14px;
}

/* ---------------------------------------------------------------------------
   Status-position: right rail
   ---------------------------------------------------------------------------
   Default layout keeps the sticky-header (Original ask + Earlier ask +
   Session activity) as a horizontal panel at the top of the conv pane.
   When `body.status-pos-right` is set, the conv-pane re-flows into a
   2-column CSS grid: main content on the left, a resizable status rail on
   the right. JS (`_applyStatusRailLayout`) moves `.csh-ask-original` and
   `.csh-col-activity` from inside the sticky into the rail; the sticky
   header's `.csh-row` collapses to just `.csh-ask-earlier` at the top.

   Body class is restored before paint by the inline script in index.html
   so there's no first-paint flash. */
/* The right rail is conditional. In TOP mode (default) it's removed
   entirely — no rail column eats horizontal space. In RIGHT mode the
   conv-pane re-flows into a 2-column grid and the rail is visible.
   Important for mobile + narrow windows where 260px is a real cost.

   Status row order in right-rail mode: header → conversation → INPUT BAR
   → status row → keyboard hint. Input reads as the primary action; the
   status (worktree / context / cost / model) is reference info underneath. */
body.status-pos-right .conv-pane.has-status-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--status-rail-width, 260px);
  grid-template-rows: auto 1fr auto auto auto auto auto auto;
  grid-template-areas:
    "header  rail"
    "conv    rail"
    "goal    rail"
    "model   rail"
    "queued rail"
    "input   rail"
    "context rail"
    "hint    rail";
  min-height: 0;
}
body.status-pos-right .conv-pane.has-status-rail.has-new-session-context {
  grid-template-areas:
    "header  rail"
    "conv    rail"
    "context rail"
    "goal    rail"
    "model   rail"
    "queued rail"
    "input   rail"
    "hint    rail";
}
body.status-pos-right .conv-pane.has-status-rail > .conv-pane-header   { grid-area: header;  min-width: 0; }
body.status-pos-right .conv-pane.has-status-rail > .conversations-view { grid-area: conv;    min-width: 0; min-height: 0; }
body.status-pos-right .conv-pane.has-status-rail > .conv-goal-strip    { grid-area: goal;    min-width: 0; }
body.status-pos-right .conv-pane.has-status-rail > .conv-model-picker-strip { grid-area: model; min-width: 0; }
body.status-pos-right .conv-pane.has-status-rail > .conv-input-bar     { grid-area: input;   min-width: 0; }
body.status-pos-right .conv-pane.has-status-rail > .conv-input-hint    { grid-area: hint;    min-width: 0; }
body.status-pos-right .conv-pane.has-status-rail > .conv-input-context { grid-area: context; min-width: 0; }
body.status-pos-right .conv-pane.has-status-rail > .status-rail {
  grid-area: rail;
  display: flex; flex-direction: column;
  position: relative;
  border-left: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
  overflow: hidden;
  min-height: 0;
}
.status-rail-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.status-rail-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 6px 0 10px;
}
.status-rail-annotate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.status-rail-annotate:hover,
.status-rail-annotate:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}
.ccc-no-annotate #statusRailAnnotateBtn {
  display: none !important;
}
.status-rail-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.status-rail-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.status-rail-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.status-rail-title-rest {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.85;
}
.status-rail-title-rename-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
}
.status-rail-title-rename-btn:hover,
.status-rail-title-rename-btn:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  outline: none;
}
.status-rail-title-rename-icon {
  display: block;
  width: 12px;
  height: 12px;
}
.status-rail-activity-log-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  font-size: 11px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.status-rail-activity-log-btn:hover,
.status-rail-activity-log-btn:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  outline: none;
}
.status-rail-title-input {
  width: 100%;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 4px;
  outline: none;
}
/* CCC-177: the same input renames from the pane header's session name. */
.conv-pane-title .status-rail-title-input {
  min-width: 24ch;
}
/* Transcript size (CCC-475) — session metadata, moved here from the pane
   titlebar. Filled by updatePaneHeader for the active pane. */
.status-rail-size {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
}
/* Subscription allocation and weekly quota for the selected conversation. */
.status-rail-tokens {
  margin-top: 8px;
}

/* Codex diagnostics panel (Metadata rail): how a codex session is driven,
   fallback reasons, ephemeral storage, desktop competition, live verdict. */
.codex-diag {
  margin: 8px 0 4px;
  font-size: 11px;
  line-height: 1.45;
}
.codex-diag-head {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.codex-diag-verdict {
  border-left: 3px solid var(--border);
  padding: 5px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  background: var(--surface);
}
.codex-diag-sev-ok { border-left-color: var(--green); }
.codex-diag-sev-info { border-left-color: var(--accent); }
.codex-diag-sev-warn { border-left-color: var(--orange); background: rgba(210, 153, 34, 0.08); }
.codex-diag-sev-error { border-left-color: var(--red); background: rgba(248, 81, 73, 0.08); }
.codex-diag-headline { font-weight: 600; color: var(--text); }
.codex-diag-detail { color: var(--text-muted); margin-top: 2px; }
.codex-diag-group {
  border-top: 1px solid var(--border);
  padding: 5px 0 4px;
}
.codex-diag-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.codex-diag-row {
  display: flex;
  gap: 6px;
  padding: 1px 0;
}
.codex-diag-key {
  flex: 0 0 108px;
  color: var(--text-muted);
}
.codex-diag-val { flex: 1; min-width: 0; word-break: break-word; }
.codex-diag-muted { color: var(--text-muted); }
.codex-diag-path {
  color: var(--accent);
  cursor: pointer;
  word-break: break-all;
}
.codex-diag-path:hover { text-decoration: underline; }
.codex-diag-code {
  display: inline-block;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  word-break: break-all;
}
.codex-diag-note {
  margin-top: 4px;
  padding: 4px 6px;
  border-left: 3px solid var(--orange);
  background: rgba(210, 153, 34, 0.08);
  border-radius: 3px;
  color: var(--text);
}
.codex-diag-proc .ccc-proc-dot { display: inline-block; }
.codex-diag-events {
  border-top: 1px solid var(--border);
  padding: 5px 0 4px;
}
.codex-diag-events summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.codex-diag-event {
  padding: 1px 0;
  color: var(--text-muted);
  word-break: break-word;
}
.codex-diag-event-ts {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  color: var(--text-muted);
}
.codex-diag-more summary { color: var(--text-muted); cursor: pointer; }
.status-rail-tokens .rail-api-price {
  margin-top: 5px;
}
.status-rail-tokens .rail-cost-details {
  display: none;
  padding-top: 10px;
}
.status-rail-tokens.is-expanded .rail-cost-details {
  display: block;
}
.status-rail-tokens .rail-cost-details-toggle {
  margin-top: 8px;
  padding: 2px 6px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
.status-rail-tokens .rail-cost-details-toggle:hover,
.status-rail-tokens .rail-cost-details-toggle:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  outline: none;
}
.status-rail-tokens .rail-quota-formula {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-muted);
}
.status-rail-tokens .rail-tokens-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.status-rail-tokens .rail-cost-headline {
  font-size: 30px;
  white-space: nowrap;
}

/* Hidden by default to keep the summary compact; it is disclosed together
   with the detailed calculation by the explicit button. */
.status-rail-tokens .rail-tokens-label {
  display: none;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
}
.status-rail-tokens.is-expanded .rail-tokens-label {
  display: block;
}
/* Per-turn cache-adjusted token columns (last 30 billed turns), newest on
   the right. Built by _railTurnGraphHtml(); bars are flex children with a
   percent height, so the strip scales to the visible max with no axis. */
.status-rail-tokens .rail-turn-graph {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
  margin-top: 8px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--border);
}
.status-rail-tokens .rail-turn-bar {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 10px;
  border-radius: 2px 2px 0 0;
  background: color-mix(in srgb, var(--accent, #6ea8fe) 55%, var(--surface));
  transition: height 180ms ease-out;
}
.status-rail-tokens .rail-turn-bar:hover {
  background: var(--accent, #6ea8fe);
}
.status-rail-tokens .rail-turn-bar.is-latest {
  background: var(--accent, #6ea8fe);
}
.status-rail-tokens .rail-turn-graph-caption {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.status-rail-tokens .rail-tokens-cache {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.status-rail-tokens .rail-usage-caption,
.status-rail-tokens .rail-usage-breakdown {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.status-rail-tokens .rail-usage-row {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.status-rail-tokens .rail-usage-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}
.status-rail-tokens .rail-usage-detail {
  margin-top: 3px;
  font-size: 10px;
}
.status-rail-tokens .rail-usage-total {
  margin-top: 7px;
  color: var(--text);
  font-weight: 600;
}
.status-rail-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 74%, var(--bg));
}
.status-rail-tab {
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}
.status-rail-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}
.status-rail-tab.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.status-rail-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.status-rail-pane {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.status-rail-pane.is-active {
  display: flex;
  flex-direction: column;
}
.status-rail-empty {
  display: none;
  margin: 12px;
  padding: 14px 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  justify-content: center;
  text-align: center;
}
/* Status-rail Subagents panel — lists Task tool spawns for the active
   conv with status + (optional) subagent_type. Hidden by JS when the
   session has no spawns. Sits between rail-actions and the file viewer
   so it doesn't compete with the palette pinned to the bottom. */
.subagents-panel {
  border-top: 1px solid var(--border);
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.subagents-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.subagents-count {
  font-weight: 500;
  color: var(--text);
  background: rgba(139, 87, 215, 0.12);
  border: 1px solid rgba(139, 87, 215, 0.25);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}
.subagents-list { display: flex; flex-direction: column; gap: 4px; }
.subagent-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  line-height: 1.3;
  min-width: 0;
}
.subagent-row.is-in-flight {
  border-color: rgba(139, 87, 215, 0.45);
  background: rgba(139, 87, 215, 0.06);
}
.subagent-status {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 700;
  width: 12px;
  text-align: center;
}
.subagent-row.is-in-flight .subagent-status {
  color: #bd93f7;
  animation: pulse 2s infinite;
}
.subagent-row.is-done .subagent-status { color: var(--green); }
/* Workflow runs inside the Subagents rail panel. Agent rows are buttons
   (click opens the read-only transcript popout), so reset button chrome and
   reuse the subagent-row layout. */
.workflow-run {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.workflow-run-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  min-width: 0;
}
.workflow-run-id {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.workflow-run-count { flex: 0 0 auto; }
.workflow-run.is-running .workflow-run-header .subagent-status {
  color: #bd93f7;
  animation: pulse 2s infinite;
}
.workflow-run.is-done .workflow-run-header .subagent-status { color: var(--green); }
.workflow-run.is-failed .workflow-run-header .subagent-status { color: var(--red, #ff5555); }
.workflow-run.is-interrupted .workflow-run-header .subagent-status { color: var(--yellow, #f1fa8c); }
button.subagent-row.wf-agent {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
button.subagent-row.wf-agent:hover { border-color: rgba(139, 87, 215, 0.45); }
.subagent-row.is-running {
  border-color: rgba(139, 87, 215, 0.45);
  background: rgba(139, 87, 215, 0.06);
}
.subagent-row.is-running .subagent-status {
  color: #bd93f7;
  animation: pulse 2s infinite;
}
.subagent-row.is-failed .subagent-status { color: var(--red, #ff5555); }
.subagent-row.is-interrupted .subagent-status { color: var(--yellow, #f1fa8c); }
.subagent-desc {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subagent-type {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Pin the bg-palette to the very bottom of the rail (whichever rail-
   visible body mode is active). margin-top: auto in a flex column pushes
   the item past anything that doesn't have its own auto margin —
   reliable even when files-panel / file-viewer are hidden and there's no
   sticky-meta to anchor against. */
.status-rail .rail-bottom-tools {
  margin-top: auto !important;
  margin-bottom: 12px;
  padding: 10px 12px 0;
  border-top: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.status-rail .rail-font-stepper { display: flex; gap: 4px; }
.status-rail .rail-font-stepper .font-size-btn { width: 28px; height: 24px; font-size: 12px; }
.status-rail .conv-bg-palette {
  justify-self: end;
  justify-content: end;
}
/* Default (top mode): rail completely hidden. JS also moves its children
   back to their original toolbar slots in this mode so no functionality
   is lost. */
.status-rail { display: none; }
.status-rail-resizer {
  position: absolute;
  left: -9px; top: 0; bottom: 0;
  width: 18px;
  cursor: col-resize;
  touch-action: none;
  z-index: 4;
  background: transparent;
}
.status-rail-resizer::before {
  content: '';
  position: absolute;
  left: 7px; top: 50%;
  width: 4px; height: 44px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 55%, transparent);
  opacity: 0.55;
  transition: background 0.12s, opacity 0.12s;
}
.status-rail-resizer:hover::before,
.status-rail-resizer.dragging::before {
  background: var(--accent);
  opacity: 0.95;
}
  /* Quick-close X — lives in the topbar next to the Annotate button, so it
     gets the same visible button chrome (CCC-450: the borderless half-opacity
     glyph read as missing once Annotate moved in beside it). */
  .status-rail-close {
    flex: 0 0 auto;
    margin: 0;
    width: 22px; height: 22px;
    display: none;
    align-items: center; justify-content: center;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 15px; line-height: 1;
    cursor: pointer;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
}
body.status-pos-right:not(.status-rail-collapsed) .status-rail-close {
  display: inline-flex;
}
.status-rail-close:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  opacity: 1;
}
.status-rail-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.rail-actions #annotationStartBtn {
  display: none !important;
}
body.status-rail-resizing {
  cursor: col-resize;
  user-select: none;
}
body.status-rail-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
.status-rail-restore {
  display: none;
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 58px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 7px 0 0 7px;
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
  color: var(--text-muted);
  cursor: pointer;
  z-index: 5;
  box-shadow: -4px 0 14px rgba(0,0,0,0.18);
}
.status-rail-restore:hover {
  color: var(--accent);
  background: var(--surface-2);
}
body.status-pos-right.status-rail-collapsed .conv-pane.has-status-rail {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "header"
    "conv"
    "goal"
    "model"
    "queued"
    "input"
    "hint"
    "context";
}
body.status-pos-right.status-rail-collapsed .conv-pane.has-status-rail.has-new-session-context {
  grid-template-areas:
    "header"
    "conv"
    "context"
    "goal"
    "model"
    "queued"
    "input"
    "hint";
}
body.status-pos-right.status-rail-collapsed .conv-pane.has-status-rail > .status-rail {
  display: none;
}
body.status-pos-right.status-rail-collapsed .conv-pane.has-status-rail > .status-rail-restore {
  display: inline-flex;
}
/* When the rail-restore chevron is visible it sits absolutely positioned
   over the right edge of the pane (26px wide). Without this padding it
   covers the rightmost item of the input-context strip — usually the
   model pill — which made the model name "superseded by other stuff"
   per a user annotation. Reserve enough room (chevron width + breathing
   room) so the model pill stays clickable. */
body.status-pos-right.status-rail-collapsed .conv-pane.has-status-rail > .conv-input-context {
  padding-right: 40px;
}

/* Rail-actions row at the top of the rail — vertical stack of session-
   level buttons. Buttons are re-parented here at boot from `.ccc-topbar`
   and the conv toolbar; their original styles were scoped to those
   parents (e.g. `.toolbar .launch-btn`, `.ccc-topbar .topbar-btn`) so
   they pick up no styling once moved. We re-declare the look here. */
.rail-actions {
  display: flex; flex-flow: row wrap;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.rail-actions:empty { display: none; }
.rail-actions > *,
.rail-actions .launch-btn,
.rail-actions .launch-choice-btn,
.rail-actions .topbar-btn,
.rail-actions .upd-pill,
.rail-actions .bug-link,
.rail-actions .annotation-link,
.rail-actions .announce-btn-conv {
  display: inline-flex; align-items: center; justify-content: flex-start;
  width: auto;
  flex: 0 1 auto;
  margin: 0;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 11px; font-weight: 500; font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.rail-actions > *:hover { background: var(--surface-2); }
/* Connection-type chip is its own pill (ccc-proc-pill already has a border/
   background per state) — drop the generic button chrome so it doesn't
   render as a bordered box around a bordered pill. */
.rail-actions .status-rail-conn-proc {
  padding: 0;
  border: none;
  background: none;
  cursor: default;
}
.rail-actions .status-rail-conn-proc:hover { background: none; }
/* Launch-split is two adjacent buttons; keep them visually joined. */
.rail-actions .launch-split { display: flex; gap: 0; padding: 0; border: none; }
.rail-actions .launch-split .launch-btn { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1 1 auto; }
.rail-actions .launch-split .launch-choice-btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; padding: 6px 8px; flex: 0 0 auto; width: auto; }
/* Same joined-pair treatment for the localhost pill + its caret — the wrap
   span otherwise inherited the generic `.rail-actions > *` chrome, drawing a
   redundant border/padding box around the already-bordered pill (CCC-966). */
.rail-actions .localhost-wrap { padding: 0; border: none; }
.rail-actions #cccBreadcrumb,
.rail-actions #convStatus {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
}
.rail-actions #cccBreadcrumb {
  padding: 6px 8px;
}
/* The rail header already mirrors the active session title, so the breadcrumb
   copy in the rail keeps only category/process/popout and drops the repeat. */
.rail-actions #cccBreadcrumb .ccc-breadcrumb-title {
  display: none;
}
.rail-actions #convStatus {
  color: var(--text-muted);
}
/* CCC-965: #convStatus is usually empty (see the JS comment at its capture
   site) but still inherited the generic `.rail-actions > *` border/padding
   chrome, rendering as a redundant full-width empty divider bar. */
.rail-actions #convStatus:empty {
  display: none;
}
/* The deploy pill is an <a>; keep the deploy-dot color cue. */
.rail-actions #deployPill .deploy-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); flex: 0 0 auto;
}
/* Override default selectable text-cursor on conv-overflow / font controls
   so the row reads as one button per row. */
.rail-actions .conv-overflow-wrap,
.rail-actions .font-size-controls { padding: 0; border: none; gap: 4px; }
.rail-actions .conv-overflow-wrap > .conv-overflow-btn,
.rail-actions .font-size-controls > .font-size-btn {
  flex: 1 1 auto; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text); font-size: 12px;
  cursor: pointer;
}
.rail-actions .font-size-controls { display: flex; }
/* CCC-970: the "Session <id> 📋" pill's full label made it too wide to
   share a row with the launch/status/localhost buttons above it, so it
   always wrapped onto its own line alone. Drop the "SESSION" text and
   tighten the padding/gap here only — the pane titlebar copy of this same
   markup (setCopyableSessionId) keeps its label. */
.rail-actions #convSessionId {
  padding: 4px 6px;
  gap: 4px;
}
.rail-actions #convSessionId .sid-label {
  display: none;
}

/* Top-left alerts strip — sits in the sidebar header next to the title.
   Hosts always-visible app-level signals (Update pill primarily).
   Compacted to icon-only by default so the title row stays single-line.
   The alerts collapse to a small bullet with the version on hover/title. */
.sidebar-top-alerts {
  display: flex; align-items: center; gap: 6px;
  margin: 0 6px;
  flex: 0 1 auto; min-width: 0;
}
.sidebar-top-alerts:empty { display: none; }
.sidebar-top-alerts > * {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(110,140,175,0.12);
  border: 1px solid rgba(110,140,175,0.35);
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* #7 — Compact sidebar header. The action buttons remain in the title bar,
   but their visible labels collapse to icons and the brand text is clamped
   to two non-wrapping lines. This keeps the app chrome under control even
   when the update pill or all header controls are visible. */
.sidebar-header {
  flex-wrap: nowrap !important;
  min-height: 0;
  padding: 8px 10px;
  gap: 8px;
  letter-spacing: 0;
}
.sidebar-header-brand {
  flex: 1 1 0;
  min-width: 0;
  gap: 1px;
}
.sidebar-header-brand .sh-title-row {
  width: 100%;
  gap: 6px;
}
.sidebar-header-brand .sh-app-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}
.sidebar-header-brand .sh-title-link,
.sidebar-header-brand .sh-meta-row {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-header-brand .sh-title-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  color: inherit;
  background: none;
  text-shadow: none;
}
.sidebar-header-brand .sh-title-main,
.sidebar-header-brand .sh-title-sub {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-background-clip: text;
  background-clip: text;
}
.sidebar-header-brand .sh-title-main {
  font-size: 17px;
  font-weight: 750;
  line-height: 1.05;
  color: transparent;
  background-image: linear-gradient(90deg, #f0f6fc 0%, #58a6ff 42%, #bc8cff 74%, #3fb950 100%);
  text-shadow: 0 0 18px rgba(88,166,255,0.22);
}
.sidebar-header-brand .sh-title-sub {
  font-size: 10px;
  font-weight: 650;
  line-height: 1.15;
  color: transparent;
  background-image: linear-gradient(90deg, #8b949e 0%, #58a6ff 44%, #d299ff 100%);
  text-shadow: 0 0 12px rgba(188,140,255,0.18);
}
.sidebar-header-brand .sh-version {
  flex: 0 0 auto;
  font-size: 11px;
}
.sidebar-header-brand .sh-meta-row {
  display: block;
  width: 100%;
}
.sidebar-header-brand .sh-repo-link {
  display: none;
}

/* ── WatchTower sentinel badge ─────────────────────────────────────────
   Live queue-health beacon: a small radar dial that sweeps while WatchTower
   is watching, plus a notification-style count that only appears when a
   queue needs attention. Fixed dark-glass palette (not theme-driven) to
   match the treatment already used by .sh-title-main/.sh-title-sub. */
.sidebar-header-brand {
  position: relative;
}
.sh-service-badges {
  /* Hidden, not deleted (see the comment above this element in index.html):
     the header shows identity only now, the rollup verdict rides the "..."
     button's alert dot instead. display:none (not the `hidden` attribute)
     so the opening tag stays `<div class="sh-service-badges">`, which
     test_whats_new_notice_static.py uses as a text-slice boundary. */
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 3px 0 1px;
}

/* ── SERVER STATUS chip ────────────────────────────────────────────────
   The one always-present health control in the header. Unlike the two
   badges it replaced, this uses design tokens rather than the fixed
   dark-glass palette: those badges were defensible as decorative accents,
   a primary control has to stay legible in the light theme too. */
.sh-status-chip {
  --ssc-cur: var(--text-muted);
  display: inline-flex;
  align-items: center;
  /* The sidebar header gives the brand column whatever the action buttons do
     not take, which is ~144px at the default width. The chip must fit that on
     ONE line: an unbreakable pill slides underneath the absolutely-positioned
     actions and swallows their clicks, and a wrapped pill is the largest,
     ugliest thing in the brand column. So nothing wraps, and the verdict is
     the one part allowed to shrink (with an ellipsis) if a locale or a font
     makes it wider than the budget below. */
  flex-wrap: nowrap;
  max-width: 100%;
  min-width: 0;
  gap: 5px;
  margin: 3px 0 1px;
  padding: 3px 8px 3px 6px;
  border: 1px solid color-mix(in srgb, var(--ssc-cur) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ssc-cur) 11%, var(--surface));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}
.sh-status-chip.is-green { --ssc-cur: var(--green); }
.sh-status-chip.is-yellow { --ssc-cur: var(--orange); }
.sh-status-chip.is-red { --ssc-cur: var(--red); }
.sh-status-chip.is-unknown { --ssc-cur: var(--text-muted); }
.sh-status-chip:hover,
.sh-status-chip:focus-visible {
  border-color: color-mix(in srgb, var(--ssc-cur) 72%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ssc-cur) 14%, transparent);
  outline: none;
}
.sh-status-chip:active { transform: scale(0.97); }
.ssc-led {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ssc-cur);
  box-shadow: 0 0 6px color-mix(in srgb, var(--ssc-cur) 70%, transparent);
}
/* The subject. Never hidden, at any width: "attention 3" on its own could be
   about anything on the page. Tracking is tight because the whole chip has a
   ~144px budget. */
.ssc-word {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--text-muted);
}
/* Mixed toward --text rather than the raw accent so it clears 4.5:1 on both
   themes (--orange on --surface is the tight one in the light theme). */
.ssc-verdict {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--ssc-cur) 60%, var(--text));
}
.sh-status-chip.is-unknown .ssc-verdict { opacity: 0.75; }
.ssc-count {
  flex: 0 0 auto;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ssc-cur);
  color: var(--bg);
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
}
/* The only animation on the chip, and only when the worker is the thing that
   died. That was the old worker badge's real job: be noticeable from across
   the room. Everything quieter than that stays static. */
.sh-status-chip.is-critical .ssc-led { animation: sscPulse 2.4s ease-in-out infinite; }
@keyframes sscPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

.sh-wt-badge {
  --wt-cur: #35e7cf;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 2px 8px 2px 6px;
  border: 1px solid rgba(53, 231, 207, 0.28);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(15, 32, 34, 0.9), rgba(8, 20, 22, 0.9));
  color: #9fd8d1;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.sh-wt-badge:not(.is-inline):hover,
.sh-wt-badge:not(.is-inline):focus-visible {
  border-color: rgba(53, 231, 207, 0.6);
  box-shadow: 0 0 0 3px rgba(53, 231, 207, 0.1);
  outline: none;
}
.sh-wt-badge:not(.is-inline):active { transform: scale(0.97); }
.sh-wt-badge.is-alert { --wt-cur: #ffb443; border-color: rgba(255, 180, 67, 0.4); }
.sh-wt-badge.is-alert:not(.is-inline):hover,
.sh-wt-badge.is-alert:not(.is-inline):focus-visible {
  border-color: rgba(255, 180, 67, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 180, 67, 0.12);
}
.sh-wt-badge .wt-beacon svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 3px var(--wt-cur));
}
.sh-wt-badge .wt-ring { stroke: var(--wt-cur); opacity: 0.35; }
.sh-wt-badge .wt-sweep {
  transform-origin: 16px 16px;
}
.sh-wt-badge .wt-sweep path { fill: var(--wt-cur); opacity: 0.55; }
.sh-wt-badge .wt-core {
  fill: var(--wt-cur);
  transform-origin: 16px 16px;
}
/* No idle animation — CPU-free while just sitting in the sidebar. A poll
   lands at most every 20s (see refresh() in app.js), so .is-ticking plays
   one short sweep+pulse per poll instead of looping forever. */
.sh-wt-badge.is-ticking .wt-sweep { animation: wtSweep 0.7s ease-out; }
.sh-wt-badge.is-ticking .wt-core { animation: wtPulse 0.7s ease-out; }
.sh-wt-badge .wt-word {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background-image: linear-gradient(90deg, #7dfbe8 0%, #35e7cf 55%, #4fb8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sh-wt-badge.is-alert .wt-word {
  background-image: linear-gradient(90deg, #ffe2ad 0%, #ffb443 60%, #ff8a5c 100%);
}
.sh-wt-badge .wt-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ffb443;
  color: #241300;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  animation: wtCountIn 0.22s ease-out;
}

.sh-worker-badge {
  --worker-cur: #53d18b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px 2px 7px;
  border: 1px solid color-mix(in srgb, var(--worker-cur) 34%, transparent);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(24, 29, 38, 0.94), rgba(13, 17, 24, 0.94));
  color: #d9e3f0;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.sh-worker-badge:not(.is-inline):hover,
.sh-worker-badge:not(.is-inline):focus-visible {
  border-color: color-mix(in srgb, var(--worker-cur) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--worker-cur) 12%, transparent);
  outline: none;
}
.sh-worker-badge:not(.is-inline):active { transform: scale(0.97); }
.sh-worker-badge.is-checking { --worker-cur: #7d8998; }
.sh-worker-badge.is-offline { --worker-cur: #ff6b6b; }
.sh-worker-badge.is-paused,
.sh-worker-badge.is-update,
.sh-worker-badge.is-uncertain { --worker-cur: #ffb443; }
.worker-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--worker-cur);
  box-shadow: 0 0 5px color-mix(in srgb, var(--worker-cur) 75%, transparent);
}
.worker-word {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--worker-cur) 62%, #fff);
}
.worker-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--worker-cur);
  color: #10151b;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
}
@keyframes wtSweep { to { transform: rotate(360deg); } }
@keyframes wtPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.28); opacity: 0.6; }
}
@keyframes wtCountIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sh-wt-badge .wt-sweep,
  .sh-wt-badge .wt-core,
  .sh-wt-badge .wt-count,
  .sh-status-chip.is-critical .ssc-led { animation: none !important; }
  .sys-svc.is-checking .sys-svc-led { animation: none !important; opacity: 0.6; }
}

/* The WatchTower beacon now lives inside the System status panel next to its
   row's LED and state pill. It is no longer a button, so drop the affordance
   that promises a click, but keep pointer events so its title still shows on
   hover. (#cccWorkerBadge is hidden there; these rules cover it anyway so a
   future unhide cannot reintroduce the dark-glass-on-white bug.) */
.sh-wt-badge.is-inline,
.sh-worker-badge.is-inline {
  cursor: default;
}
.sh-wt-badge.is-inline[hidden],
.sh-worker-badge.is-inline[hidden] { display: none; }
/* Both badges hardcode a dark-glass palette. That was fine as a header accent
   over a dark sidebar; inside a light-theme modal card it renders as a dark
   blob in the head of the row. Light theme is a first-class theme here. */
:root[data-theme="light"] .sh-wt-badge.is-inline,
:root[data-theme="light"] .sh-worker-badge.is-inline {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--text) 16%, transparent);
  box-shadow: none;
  color: var(--text);
}
:root[data-theme="light"] .sh-wt-badge.is-inline .wt-word,
:root[data-theme="light"] .sh-worker-badge.is-inline .worker-word {
  color: var(--text-muted);
}
:root[data-theme="light"] .sh-wt-badge.is-inline .wt-ring {
  stroke: color-mix(in srgb, var(--text) 28%, transparent);
}
:root[data-theme="light"] .sh-wt-badge.is-inline .wt-core,
:root[data-theme="light"] .sh-wt-badge.is-inline .wt-sweep path {
  fill: var(--accent);
}
:root[data-theme="light"] .sh-wt-badge.is-inline.is-alert .wt-core,
:root[data-theme="light"] .sh-wt-badge.is-inline.is-alert .wt-sweep path {
  fill: var(--orange);
}

.wt-pop {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  z-index: 40;
  width: 258px;
  padding: 12px;
  border: 1px solid rgba(53, 231, 207, 0.25);
  border-radius: 12px;
  background: linear-gradient(180deg, #0e1a1c 0%, #0a1416 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.3);
  animation: wtPopIn 0.14s ease-out;
}
.wt-pop[hidden] { display: none; }
/* Inline variant: the queue list now sits inside the WatchTower row of the
   System status panel. Everything the popover needed to float (absolute
   positioning, a fixed width, a shadow, an entry animation, a positioned
   ancestor) is wrong there, but every child class is unchanged so ~100 lines
   of working CSS below keep applying. */
.wt-pop.is-inline {
  position: static;
  width: auto;
  margin-top: 8px;
  z-index: auto;
  box-shadow: none;
  animation: none;
  border-color: color-mix(in srgb, var(--svc-cur) 26%, transparent);
  background: var(--bg);
}
.wt-pop.is-inline .wt-pop-list { max-height: 132px; }
/* The dark-glass text colours below are unreadable on a light --bg, and only
   the inline variant ever renders on one. */
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-title { color: var(--text); }
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-sub,
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-empty,
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-row .wt-pop-depth {
  color: var(--text-muted);
}
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-row {
  background: var(--surface-2);
}
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-row .wt-pop-q {
  color: var(--text);
}
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-row.is-stuck .wt-pop-q {
  color: var(--orange);
}
:root[data-theme="light"] .wt-pop.is-inline .wt-pop-cta { color: var(--accent); }
@keyframes wtPopIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.wt-pop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.wt-pop-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #7dfbe8;
}
.wt-pop-sub {
  font-size: 10px;
  color: #6f9c97;
}
.wt-pop-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 168px;
  overflow-y: auto;
}
.wt-pop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
}
.wt-pop-row .wt-pop-q {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cfeeea;
  font-weight: 600;
}
.wt-pop-row .wt-pop-depth { color: #6f9c97; font-size: 10px; flex: 0 0 auto; }
.wt-pop-row.is-stuck { background: rgba(255, 180, 67, 0.1); }
.wt-pop-row.is-stuck .wt-pop-q { color: #ffd9a0; }
.wt-pop-row .wt-pop-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #35e7cf;
  flex: 0 0 auto;
}
.wt-pop-row.is-stuck .wt-pop-dot { background: #ffb443; }
.wt-pop-empty {
  padding: 10px 4px;
  color: #6f9c97;
  font-size: 11px;
  text-align: center;
}
.wt-pop-cta {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 7px 0;
  border: 1px solid rgba(53, 231, 207, 0.3);
  border-radius: 8px;
  background: rgba(53, 231, 207, 0.08);
  color: #7dfbe8;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.wt-pop-cta:hover, .wt-pop-cta:focus-visible {
  background: rgba(53, 231, 207, 0.16);
  border-color: rgba(53, 231, 207, 0.55);
  outline: none;
}
/* Debug-only affordance (released workers) -- deliberately quieter than the
   teal primary CTA above so it doesn't compete for attention at rest. */
.wt-pop-cta.is-quiet {
  background: transparent;
  border-color: color-mix(in srgb, var(--text-muted) 30%, transparent);
  color: var(--text-muted);
  font-weight: 600;
}
.wt-pop-cta.is-quiet:hover, .wt-pop-cta.is-quiet:focus-visible {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  border-color: color-mix(in srgb, var(--text-muted) 50%, transparent);
  color: var(--text);
  outline: none;
}
.wt-pop-released-list { margin-top: 6px; max-height: 132px; }
.wt-pop-released-list .wt-pop-row .wt-pop-dot { background: var(--text-muted); }

/* Momentary highlight when the popover's CTA scrolls the real queue panel
   into view — confirms "this is what I meant" without a jarring jump. */
.wt-panel-flash {
  animation: wtPanelFlash 1.2s ease-out;
}
@keyframes wtPanelFlash {
  0% { box-shadow: 0 0 0 2px rgba(53, 231, 207, 0.65), 0 0 22px rgba(53, 231, 207, 0.35); }
  100% { box-shadow: 0 0 0 2px rgba(53, 231, 207, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .wt-panel-flash { animation: none; outline: 2px solid rgba(53, 231, 207, 0.65); }
}

.sidebar-header-actions {
  flex-wrap: nowrap !important;
  flex-shrink: 0;
  gap: 4px;
}
/* CCC-761: refresh/history/board/chip-color and New-Group-chat/live/manage
   are secondary next to "New session" -- collapsed by default, revealed by
   #sidebarMoreBtn ("..."). Kept as simple show/hide (not a floating menu) so
   every button keeps its existing id and click handler unchanged. */
.sh-more-collapsed {
  display: none !important;
}
/* Screen-reader-only: keeps a node in the a11y tree while removing it from
   the layout (used by the STATUS chip, whose verdict is carried by the LED
   colour visually and by this text for assistive tech). */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}

/* ── Sidebar "..." dropdown ── */
.sh-more-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.sh-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: min(200px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  overflow-y: auto;
  padding: 5px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 300;
}
.sh-more-menu[hidden] { display: none; }
.sh-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sh-more-item:hover { background: var(--surface-2); }
/* Service rollup LED, mirrored from the (now hidden) STATUS chip. */
.sh-more-led {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.sh-more-led.is-green  { background: #4ade80; }
.sh-more-led.is-yellow { background: #e0b341; }
.sh-more-led.is-red    { background: #e5534b; }
.sh-more-divider {
  height: 1px;
  margin: 5px 0;
  background: var(--border);
}
.sh-more-info {
  padding: 5px 12px 2px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.3;
}
.sh-more-btn {
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim, #999);
  cursor: pointer;
}
.sh-more-btn:hover,
.sh-more-btn[aria-expanded="true"] {
  background: var(--hover-bg, rgba(255,255,255,0.08));
  color: var(--text, #eee);
}
.sidebar-header-actions .sh-btn,
.sidebar-header-actions .bug-link {
  position: relative;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sidebar-header-actions .sh-btn::after,
.sidebar-header-actions .bug-link::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  z-index: 10030;
  max-width: 240px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-2px);
  transition: opacity 0.08s ease 0.35s, transform 0.08s ease 0.35s;
}
.sidebar-header-actions .sh-btn:hover::after,
.sidebar-header-actions .sh-btn:focus-visible::after,
.sidebar-header-actions .bug-link:hover::after,
.sidebar-header-actions .bug-link:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.sidebar-header-actions .sh-action-label {
  display: none;
}
.sidebar-header-actions .sh-refresh-wrap {
  height: 30px;
}
.sidebar-header-actions .sh-refresh-wrap .sh-refresh-btn {
  width: 30px;
  min-width: 30px;
}
.sidebar-header-actions .sh-refresh-wrap .sh-refresh-caret {
  width: 22px;
  min-width: 22px;
}

/* #5 — Session ID styling in the rail. Renders as
   "Session 2f1b1e0e 📋" — a labeled, scannable affordance. */
#convSessionId {
  display: flex !important; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  font-family: inherit;
}
#convSessionId:hover { background: var(--surface-2); }
#convSessionId .sid-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  font-size: 10px;
  opacity: 0.7;
}
#convSessionId .sid-short {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  color: var(--text);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
}
#convSessionId .sid-copy {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.55;
}
#convSessionId:hover .sid-copy { opacity: 0.9; }

/* #10 — Rail visual structure. Add a 1px hairline between the compact
   metadata blocks so the tab reads as organized session data. */
.status-rail-pane > .csh-ask-original {
  border-bottom: 1px solid var(--border) !important;
}
.status-rail-pane > .rail-actions {
  border-top: none;
}

/* Settings-menu slot — items moved from the toolbar into the gear popover
   (Terminal toggle, History indexing pill, Worktrees, Stats, Report a bug,
   font A-/A+). Force the existing buttons into the .pop-item visual
   shape so they read as menu items, not loose buttons. */
.settings-menu-slot {
  display: flex; flex-direction: column;
  gap: 0;
}
.settings-menu-slot:empty { display: none; }
.settings-menu-slot > *,
.settings-menu-slot > a,
.settings-menu-slot > button,
.settings-menu-slot > .topbar-btn,
.settings-menu-slot > .bug-link,
.settings-menu-slot > .annotation-link,
.settings-menu-slot > .upd-pill,
.settings-menu-slot > .hi-status-pill {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px; font-weight: 500; font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.settings-menu-slot > *:hover { background: var(--surface-2); }
/* #11 — Force inner spans (icon + label inside .upd-pill, .hi-status-pill,
   etc.) to inherit the menu-item text color so the items don't carry
   leftover blue/orange/etc. from their original toolbar styling. */
.settings-menu-slot > * > * {
  color: inherit !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}
/* Font A-/A+ are two side-by-side buttons; let them share a row. */
.settings-menu-slot > .font-size-controls {
  display: flex; gap: 6px; padding: 4px 12px;
}
.settings-menu-slot > .font-size-controls .font-size-btn {
  flex: 1 1 0; padding: 6px 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); cursor: pointer;
  font-family: inherit; font-size: 12px;
}
.settings-menu-slot > .font-size-controls .font-size-btn:hover {
  background: var(--surface-2);
}

/* Sidebar global-actions — hosts buttons that aren't conversation-scoped
   (History indexing pill, Stats, Report a bug, Worktrees). Same re-style
   logic as rail-actions: the original scoped styles don't reach here. */
.sidebar-global-actions {
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-global-actions:empty { display: none; padding: 0; border-top: none; }
.sidebar-global-actions > *,
.sidebar-global-actions .topbar-btn,
.sidebar-global-actions .bug-link,
.sidebar-global-actions .annotation-link {
  display: inline-flex; align-items: center; justify-content: flex-start;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px; font-weight: 500; font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sidebar-global-actions > *:hover { background: var(--surface-2); }
.sidebar-global-actions #historyStatusPill[style*="display:none"] { display: none !important; }

/* When `.csh-ask-original` and `.csh-col-activity` are mounted inside the
   rail, drop the borders/flex sizing they had inside `.csh-row` (they
   were sized to share a horizontal panel). In the rail they're stacked,
   each taking its own height, separated by a hairline divider. */
body.status-pos-right .status-rail .status-rail-pane > .csh-ask-original,
body.status-pos-right .status-rail .status-rail-pane > .csh-col-activity {
  flex: 0 0 auto;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  background: transparent;
  display: flex; flex-direction: column;
}
body.status-pos-right .status-rail .status-rail-pane > .csh-col-activity {
  flex: 1 1 auto;        /* activity feed gets the remaining vertical space */
  min-height: 0;
  overflow-y: auto;
  border-bottom: none;
}
body.status-pos-right .status-rail-pane[data-rail-pane="metadata"] {
  overflow-y: hidden;
}
body.status-pos-right .status-rail-pane[data-rail-pane="files"] {
  overflow-y: hidden;
}
body.status-pos-right .status-rail-pane[data-rail-pane="files"] > .files-panel {
  flex: 1 1 auto;
  min-height: 0;
}
body.status-pos-right .status-rail-pane[data-rail-pane="files"] .files-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
body.status-pos-right .status-rail-pane[data-rail-pane="metadata"] > .csh-col-activity {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
body.status-pos-right .status-rail .status-rail-pane[data-rail-pane="metadata"] > .csh-col-activity {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
body.status-pos-right .status-rail .status-rail-pane > .csh-ask-original .user-msg {
  max-height: 30vh;       /* original ask scrolls inside the rail too */
  overflow-y: auto;
}

/* Mirror the in-sticky styling rules onto the rail so original-ask keeps
   its uppercase-green label, accent-blue body color, and the small/grey
   continuation. The base rules (lines 739, 743, 925-946) are scoped under
   `.conv-sticky-header`, which doesn't match once the node has been moved
   into the rail. Re-declare with `.status-rail` parent.

   Visual goal: the boxed "ORIGINAL ASK / is main clean?" look (Image 10),
   not the unstyled text-only render (Image 11). */
.status-rail .csh-ask-original > .label {
  color: var(--green); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.status-rail .csh-ask-original .user-msg {
  font-size: 14px; color: var(--text); line-height: 1.4;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.status-rail .csh-ask-original .ask-first {
  display: block; color: var(--accent); font-size: 14px; line-height: 1.45;
}
.status-rail .csh-ask-original .ask-rest {
  display: block; margin-top: 6px;
  color: var(--text-muted); font-size: 12px; line-height: 1.5; opacity: 0.85;
}
.status-rail .csh-ask-original .msg-image {
  max-width: 100%;
  max-height: 240px;
  margin-top: 8px;
}

/* Earlier-ask label: hide it everywhere — the user said "just show the
   earlier ask, no need to announce it". The orange "EARLIER ASK" header
   was decorative; the message itself carries the meaning. Applies in
   both top mode (sticky panel) and right-rail mode. */
.csh-ask-earlier > .label { display: none; }

/* When the original-ask and activity are pulled out of `.csh-row`, the
   sticky header's `.csh-col-ask` no longer needs to share width with an
   activity column — let the row collapse to just the earlier-ask slot.
   The bordered frame stays so earlier-ask reads as a panel at the top.
   Padding is added so the earlier-ask body breathes inside the box and
   doesn't sit flush against the close button at top-right. */
body.status-pos-right .conv-sticky-header .csh-row {
  height: auto;
  min-height: 0;
  padding: 4px 0;
}
body.status-pos-right .conv-sticky-header .csh-col-ask {
  border-right: none;
  flex: 1 1 auto;
  padding: 6px 118px 6px 12px;  /* right padding clears Pop out + × buttons */
}
/* The dashed top-divider on `.csh-ask-earlier` is only relevant when
   stacked under `.csh-ask-original`. With the original gone, drop it.
   And override the inherited `flex: 1 1 0`: in top mode the parent
   `.csh-row` is 170px so `flex: 1 1 0` resolves to half that; in
   right-rail mode the row is auto-height so the same flex resolves to
   ZERO and the earlier-ask paints with height 0 — invisible. Switch to
   `flex: 0 0 auto` so it sizes to its content. */
body.status-pos-right .conv-sticky-header .csh-col-ask > .csh-ask-earlier {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  flex: 0 0 auto;
  min-height: 0;
}
/* The earlier-ask body is the actual text container. In top mode its
   parent had a fixed height so the body could `flex: 1 1 auto`; in
   right-rail mode there's no fixed height to flex against, so let the
   body be auto-height too. Cap at 5 lines with an ellipsis — earlier-ask
   is a quick-reference cue, not the place to read the full prompt. */
body.status-pos-right .conv-sticky-header .csh-ask-earlier > .user-msg {
  flex: 0 0 auto;
  overflow: hidden;
}
body.status-pos-right .conv-sticky-header .csh-ask-earlier .earlier-first {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Issue-view layout — when an issue row is selected, the conv-input-context
   strip (workspace pill / branch / cost / model) is irrelevant: the issue
   isn't a session, you're not editing a working tree. Hide it. The issue
   title + GH link + close-action buttons are moved into the right rail by
   JS, and the rail's "Original ask" slot is replaced with an issue-header. */
body.is-issue-view .conv-input-context { display: none !important; }

/* Issue header in the rail — replaces the regular "Original ask" panel
   when viewing an issue. Same shape as `.csh-ask-original`, but with
   issue-specific styling for the #N badge and the GitHub link. */
.status-rail .csh-ask-original.is-issue-header .label { color: var(--orange); }
.status-rail .csh-ask-original.is-issue-header .ask-first {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.status-rail .csh-ask-original.is-issue-header .issue-num {
  color: var(--text-muted);
  font-weight: 400;
}
.status-rail .csh-ask-original.is-issue-header .ask-rest {
  color: var(--accent) !important;
  font-style: normal;
  text-decoration: none;
  margin-top: 8px;
  font-size: 12px;
  opacity: 1;
}
.status-rail .csh-ask-original.is-issue-header .ask-rest:hover {
  text-decoration: underline;
}

/* CCC-785: worker-session variant — "Original ask" replaced with the most
   recently claimed/closed ticket, plus a collapsible list of every ticket
   this session has handled. Same shape as `.csh-ask-original`. */
.csh-ask-original.is-worker-summary .ux-ticket-ref {
  display: inline-block;
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(88,166,255,0.12);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 2px;
}
.csh-ask-original.is-worker-summary .csh-tickets-handled {
  margin-top: 8px;
  font-size: 11.5px;
}
.csh-ask-original.is-worker-summary .csh-tickets-handled summary {
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}
.csh-ask-original.is-worker-summary .csh-tickets-handled ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
}
.csh-ask-original.is-worker-summary .csh-tickets-handled li {
  padding: 3px 0;
  color: var(--text-muted);
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.csh-ask-original.is-worker-summary .csh-tickets-handled li:first-child {
  border-top: none;
}

/* Issue close-action buttons inside the rail. They were styled inline
   with green/grey ghost-button look; in the rail context we want them to
   read as a stacked group of actions, not loose buttons. Override the
   inline styles so they take the full rail width and align as a vertical
   stack like the other rail-actions buttons. */
#railActions #issueCloseActions {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}
#railActions #issueCloseActions button {
  width: 100% !important;
  padding: 7px 10px !important;
  text-align: left !important;
  justify-content: flex-start !important;
  font-size: 12px !important;
}
#railActions #issueCloseActions [data-close-status] {
  font-size: 11px;
  margin-top: 4px;
}

/* #6 — Cap the sticky-header height in right-rail mode. Was reaching
   ~96px; tighten to 60px max with internal scrolling, recovering vertical
   space for the conversation. The 5-line earlier-ask clamp still applies;
   on shorter ask text the panel collapses to fit content. */
body.status-pos-right .conv-sticky-header { max-height: 60px; }
body.status-pos-right .conv-sticky-header .csh-row { padding: 0; }
body.status-pos-right .conv-sticky-header .csh-col-ask {
  padding: 4px 118px 4px 12px;  /* clears Pop out + × at top-right */
}

/* In right-rail mode the original-ask and activity are in the side rail,
   but the sticky top bar STAYS on the conversation pane: it carries the
   last/earlier ask (seeded by _railSeedLastAsk — the bar is never empty)
   and hosts the Pop out button, which must survive a collapsed rail.
   This supersedes CCC-332, which hid the sticky entirely; per later user
   direction the pane keeps its own top bar. Only a genuinely empty bar
   (no user message at all) collapses.
   The main convToolbar is still hidden: all its controls (launch, announce,
   breadcrumb, live badge) were moved into the rail by _applyToolbarRailLayout;
   the bar itself should not occupy vertical space. */
body.status-pos-right .conv-sticky-header.is-earlier-empty,
body.status-pos-right #convToolbar {
  display: none !important;
}
/* On mobile the right-rail doesn't exist; restore #convToolbar so the mobile
   back button (which lives there when there are no subagent tabs) is visible. */
@media (max-width: 1200px) {
  body.status-pos-right #convToolbar {
    display: flex !important;
  }
}

/* ---------------------------------------------------------------------------
   PWA install banner
   ---------------------------------------------------------------------------
   Surfaced as a dismissible toast in the bottom-right when the page is
   running in a tab (not standalone). Per-platform copy + an Install
   button on Chrome/Edge wired to a stashed `beforeinstallprompt` event.
   -------------------------------------------------------------------------- */
.pwa-install-banner {
  position: fixed;
  bottom: 18px; right: 18px;
  width: 340px; max-width: calc(100vw - 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 36px 14px 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  z-index: 9999;
  font-size: 13px;
  color: var(--text);
  animation: pwa-slide-up 0.35s ease-out;
}
@keyframes pwa-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.pwa-install-banner__close {
  position: absolute; top: 6px; right: 8px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.pwa-install-banner__close:hover { color: var(--text); }
.pwa-install-banner__title {
  font-weight: 700; font-size: 14px; margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.pwa-install-banner__body {
  color: var(--text-muted); line-height: 1.5; font-size: 12.5px;
}
.pwa-install-banner__body strong {
  color: var(--text); font-weight: 600;
}
.pwa-install-banner__body kbd {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px; font-size: 11px;
  color: var(--text);
}
.pwa-install-banner__actions {
  margin-top: 10px;
  display: flex; gap: 8px; align-items: center;
}
.pwa-install-banner__cta {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 7px 16px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.pwa-install-banner__cta:hover { opacity: 0.9; }

/* Global delivery-health banner (P0c) -- see index.html for why this is
   deliberately page-global rather than scoped to the affected session. Top
   of viewport, above everything, unmissable but not modal. */
.injection-health-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: #7a1f1f;
  color: #fff;
  font-size: 12.5px;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  animation: injection-health-slide-down 0.25s ease-out;
}
@media (prefers-color-scheme: light) {
  .injection-health-banner { background: #c0392b; }
}
:root[data-theme="light"] .injection-health-banner { background: #c0392b; }
:root[data-theme="dark"] .injection-health-banner { background: #7a1f1f; }
@keyframes injection-health-slide-down {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
.injection-health-banner__icon { font-size: 15px; flex: 0 0 auto; }
.injection-health-banner__text { flex: 1 1 auto; line-height: 1.4; }
.injection-health-banner__dismiss {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.injection-health-banner__dismiss:hover { background: rgba(255,255,255,0.25); }
.injection-health-banner__dismiss[hidden] { display: none; }
.injection-health-banner__details {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.injection-health-banner__details:hover { background: rgba(255,255,255,0.15); }
.injection-health-banner__details[aria-expanded="true"] { background: rgba(255,255,255,0.25); }
/* Dispatch-paused banner: same fixed-top pattern as injection-health, amber
   instead of red -- a paused queue is a warning, not a failure. Stacks below
   the injection banner when both are up at once. */
.drain-paused-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: #7a5a1f;
  color: #fff;
  font-size: 12.5px;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  animation: injection-health-slide-down 0.25s ease-out;
}
@media (prefers-color-scheme: light) {
  .drain-paused-banner { background: #b7791f; }
}
:root[data-theme="light"] .drain-paused-banner { background: #b7791f; }
:root[data-theme="dark"] .drain-paused-banner { background: #7a5a1f; }
#injectionHealthBanner:not([hidden]) ~ .drain-paused-banner { top: 39px; }
.drain-paused-banner__icon { font-size: 15px; flex: 0 0 auto; }
.drain-paused-banner__text { flex: 1 1 auto; line-height: 1.4; }
.drain-paused-banner__resume {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.drain-paused-banner__resume:hover { background: rgba(255,255,255,0.25); }
.drain-paused-banner__resume:disabled { opacity: 0.6; cursor: default; }
.drain-paused-banner__details {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.drain-paused-banner__details:hover { background: rgba(255,255,255,0.15); }
.injection-health-banner-details {
  position: fixed;
  /* 39px is the desktop one-line banner height. On a narrow viewport the copy
     wraps and the banner grows, so follow its measured height (published by
     syncBannerOffset in index.html) rather than sliding in behind it. */
  top: var(--injection-banner-h, 39px); left: 0; right: 0;
  z-index: 9999;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface, #161b22);
  color: var(--text, #e6edf3);
  border-bottom: 1px solid rgba(139,148,158,0.3);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  font-size: 12px;
  padding: 8px 16px 12px;
}
.injection-health-details__group-label {
  margin: 8px 0 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8b949e);
}
.injection-health-details__group-label:first-child { margin-top: 2px; }
.injection-health-details__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-top: 1px solid rgba(139,148,158,0.12);
}
.injection-health-details__row:first-of-type,
.injection-health-details__group-label + .injection-health-details__row {
  border-top: none;
}
.injection-health-details__sid {
  flex: 0 0 auto;
  background: rgba(139,148,158,0.14);
  border: 1px solid rgba(139,148,158,0.3);
  color: var(--text, #e6edf3);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-family: var(--mono-font, monospace);
  cursor: pointer;
}
.injection-health-details__sid:hover { background: rgba(139,148,158,0.24); }
.injection-health-details__meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-muted, #8b949e);
}
.injection-health-details__ack {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid rgba(139,148,158,0.3);
  color: var(--text-muted, #8b949e);
  border-radius: 4px;
  width: 20px; height: 20px;
  line-height: 1;
  cursor: pointer;
  font-size: 13px;
}
.injection-health-details__ack:hover { color: var(--red, #f85149); border-color: var(--red, #f85149); }
.injection-health-details__lost-row {
  padding: 6px 0;
  border-top: 1px solid rgba(139,148,158,0.12);
}
.injection-health-details__lost-row:first-of-type,
.injection-health-details__group-label + .injection-health-details__lost-row {
  border-top: none;
}
.injection-health-details__lost-row .injection-health-details__row {
  border-top: none;
  padding: 0 0 4px;
}
.injection-health-details__engine {
  flex: 0 0 auto;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted, #8b949e);
  border: 1px solid rgba(139,148,158,0.3);
  border-radius: 3px;
  padding: 1px 5px;
}
.injection-health-details__preview {
  padding: 2px 0 4px;
  color: var(--text, #e6edf3);
  opacity: 0.85;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.injection-health-details__explain {
  color: var(--text-muted, #8b949e);
  line-height: 1.4;
}

/* Quote blocks — italic with a hairline left rule, à la Omnara: the italic
   reads as "this is the quoted source", and the rule signals structure
   without dominating. Text stays at the normal `--text` color (Omnara
   doesn't dim quotes either — the italic alone carries the signal). */
.assistant-text blockquote {
  margin: 10px 0;
  padding-block: 4px;
  padding-inline: 14px 0;
  border-inline-start: 2px solid var(--border);
  color: var(--text);
  font-style: italic;
}
/* Inner paragraphs (multi-paragraph blockquotes are rendered as
   <blockquote><p>…</p><p>…</p></blockquote>): tight margins so the
   paragraph break reads as a small gap, not a full line of empty space. */
.assistant-text blockquote p {
  margin: 0 0 8px 0;
}
.assistant-text blockquote p:last-child {
  margin-bottom: 0;
}

/* Star-on-GitHub nudge. Low-contrast horizontal strip pinned above the
   toolbar, same visual language the retired opt-in telemetry bar used.
   app.js shows it only after three distinct days of use. */
.star-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  background: var(--bg-secondary, rgba(0, 0, 0, 0.05));
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
  flex-wrap: wrap;
}
.star-nudge[hidden] { display: none !important; }
.star-nudge__text { flex: 1 1 auto; min-width: 0; }
.star-nudge__text strong { color: var(--text); font-weight: 600; }
.star-nudge__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.star-nudge__btn {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s;
}
.star-nudge__btn:hover { background: var(--border); }
.star-nudge__btn--primary {
  background: var(--accent, #d97757);
  border-color: var(--accent, #d97757);
  color: #fff;
  font-weight: 600;
}
.star-nudge__btn--primary:hover { opacity: 0.9; background: var(--accent, #d97757); }
.star-nudge__link-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.star-nudge__link-btn:hover { color: var(--text); }

/* Custom select dropdown styling */
.custom-select-container {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.custom-select-trigger {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background-color 0.15s;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
  height: 24px;
  line-height: 1;
}
.custom-select-trigger:hover {
  border-color: var(--accent, var(--text-muted));
  background: var(--surface, rgba(255, 255, 255, 0.02));
}
.custom-select-trigger-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.custom-select-trigger-icon {
  display: inline-flex;
  align-items: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.custom-select-trigger-icon svg,
.custom-select-option-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.custom-select-trigger-icon.claude,
.custom-select-option-icon.claude {
  color: #e28767;
}
.custom-select-trigger-icon.codex,
.custom-select-option-icon.codex {
  color: #3dd68c;
}
.custom-select-trigger-icon.gemini,
.custom-select-option-icon.gemini {
  color: #c084fc;
}
.custom-select-trigger-icon.antigravity,
.custom-select-option-icon.antigravity {
  color: #f2cc60;
}
.custom-select-trigger-label {
  display: inline-block;
}
.custom-select-arrow {
  margin-left: 2px;
  font-size: 9px;
  opacity: 0.6;
  display: inline-block;
  transform: translateY(0.5px);
}
.custom-select-menu {
  position: absolute;
  z-index: 1000;
  display: none;
  background: var(--surface, var(--bg));
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  min-width: 140px;
  padding: 4px;
  box-sizing: border-box;
  flex-direction: column;
  gap: 2px;
}
.custom-select-container.open .custom-select-menu {
  display: flex;
}

/* Placement rules based on element location */
.conv-input-bar .custom-select-container .custom-select-menu {
  bottom: calc(100% + 4px);
  right: 0;
}
.kanban-panel-toolbar .custom-select-container .custom-select-menu {
  top: calc(100% + 4px);
  right: 0;
}
.nsm-actions .custom-select-container .custom-select-menu {
  bottom: calc(100% + 4px);
  left: 0;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.15s, color 0.15s;
  user-select: none;
  color: var(--text-muted);
}
.custom-select-option:hover {
  background: var(--surface-2, rgba(255, 255, 255, 0.05));
  color: var(--text);
}
.custom-select-option.selected {
  color: var(--text);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.02);
}
.custom-select-option-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.custom-select-option-label {
  flex-grow: 1;
  text-align: left;
}
.custom-select-option-check {
  color: var(--green, #3dd68c);
  font-weight: bold;
  font-size: 11px;
  margin-left: 4px;
}
.custom-select-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* TTS Word Highlighting */
::highlight(tts-highlight) {
  color: #eab308;
  background-color: transparent;
}

/* In-conversation Cmd+F (CSS Highlight API — never steals focus) */
::highlight(chat-find) {
  background-color: rgba(178, 102, 255, 0.35);
  color: inherit;
}
::highlight(chat-find-active) {
  background-color: rgba(178, 102, 255, 0.85);
  color: inherit;
}

/* ── What's New Link ── */
.sidebar-header-brand .sh-whats-new-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 2px;
}
.sidebar-header-brand .sh-whats-new-link:hover {
  color: var(--text);
}

/* ── Non-blocking What's New version notice ── */
.whats-new-notice {
  display: none;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(217, 119, 87, 0.35);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(217, 119, 87, 0.1);
  font-size: 9px;
  line-height: 1;
}
.whats-new-notice.visible {
  display: inline-flex;
}
.whats-new-notice-open,
.whats-new-notice-dismiss {
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--orange, #d97757);
  font: inherit;
  cursor: pointer;
}
.whats-new-notice-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  font-weight: 650;
}
.whats-new-notice-dismiss {
  min-width: 24px;
  align-self: stretch;
  padding: 0 4px;
  border-left: 1px solid rgba(217, 119, 87, 0.25);
  font-size: 13px;
  line-height: 1;
}
.whats-new-notice-open:hover,
.whats-new-notice-dismiss:hover {
  background: rgba(217, 119, 87, 0.14);
  color: var(--text);
}
.whats-new-notice-open:focus-visible,
.whats-new-notice-dismiss:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.whats-new-notice-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange, #d97757);
  box-shadow: 0 0 6px rgba(217, 119, 87, 0.75);
}

/* ── What's New Modal Drawer & Dialog ── */
.whats-new-dialog {
  position: relative;
  width: min(820px, 94vw);
  height: min(540px, 80vh);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: whats-new-slide-in 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes whats-new-slide-in {
  0% { transform: translateY(12px) scale(0.985); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.whats-new-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  padding: 0;
  transition: color 0.12s ease-out;
}
.whats-new-close:hover {
  color: var(--text);
}

.whats-new-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.whats-new-sidebar {
  width: 230px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.whats-new-brand {
  padding: 18px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.whats-new-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange, #d97757);
  box-shadow: 0 0 8px var(--orange, #d97757);
  animation: whats-new-glow 2s infinite ease-in-out;
}

@keyframes whats-new-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px var(--orange, #d97757); }
  50% { transform: scale(1.15); box-shadow: 0 0 12px var(--orange, #d97757); }
}

.whats-new-menu {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 4px;
}

.whats-new-menu-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s ease-out, color 0.12s ease-out;
  text-align: left;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: inherit;
}
.whats-new-menu-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.whats-new-menu-item.active {
  background: rgba(217, 119, 87, 0.08);
  color: var(--orange, #d97757);
}
.whats-new-menu-item.active .menu-item-title {
  color: var(--orange, #d97757);
}
.whats-new-menu-item .menu-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.whats-new-menu-item .menu-item-date {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--mono, monospace);
}

.whats-new-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  animation: whats-new-fade 0.15s ease-out;
}

@keyframes whats-new-fade {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.whats-new-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.whats-new-pill {
  font-family: var(--mono, monospace);
  font-size: 9px;
  color: var(--orange, #d97757);
  background: rgba(217, 119, 87, 0.12);
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid rgba(217, 119, 87, 0.25);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.whats-new-feature-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.2px;
}

.whats-new-feature-date {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono, monospace);
}

.whats-new-feature-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}
.whats-new-feature-desc p {
  margin: 0 0 10px 0;
}
.whats-new-feature-desc p:last-child {
  margin-bottom: 0;
}
.whats-new-feature-desc strong {
  color: var(--text);
}

/* ── High Fidelity Visual Mockups ── */
.whats-new-preview-box {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 18px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

/* Mockup 1: Antigravity Engine */
.mockup-agy-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mockup-agy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.mockup-agy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.mockup-agy-logo {
  background: linear-gradient(135deg, #f59e0b, #d97757);
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}
.mockup-agy-status {
  font-size: 11px;
  color: var(--green, #3dd68c);
  display: flex;
  align-items: center;
  gap: 4px;
}
.mockup-agy-pulse {
  width: 6px;
  height: 6px;
  background: var(--green, #3dd68c);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green, #3dd68c);
}
.mockup-agy-code {
  font-family: var(--mono, monospace);
  font-size: 11px;
  line-height: 1.5;
  color: #a6accd;
  padding: 8px 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  border-left: 3px solid var(--orange, #d97757);
}

/* Mockup 2: Flow View */
.mockup-flow-canvas {
  height: 130px;
  background: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 12px 12px;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px dashed rgba(255,255,255,0.1);
}
.mockup-flow-node {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.mockup-flow-node.root {
  left: 20px;
  top: 45px;
  border-color: var(--orange, #d97757);
}
.mockup-flow-node.child-a {
  left: 180px;
  top: 15px;
  border-color: var(--accent);
}
.mockup-flow-node.child-b {
  left: 180px;
  top: 75px;
}
.mockup-flow-node .node-title {
  font-weight: 600;
  color: var(--text);
}
.mockup-flow-node .node-meta {
  font-size: 9px;
  color: var(--text-muted);
}
.mockup-flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Mockup 3: Page Annotations */
.mockup-browser {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}
.mockup-browser-bar {
  background: var(--surface-2, rgba(255,255,255,0.04));
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mockup-browser-dots {
  display: flex;
  gap: 4px;
}
.mockup-browser-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.mockup-browser-address {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono, monospace);
}
.mockup-browser-viewport {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 80px;
  position: relative;
  justify-content: center;
}
.mockup-browser-element {
  border: 1px dashed var(--orange, #d97757);
  padding: 8px;
  border-radius: 4px;
  font-size: 11px;
  text-align: center;
  position: relative;
  background: rgba(217, 119, 87, 0.05);
}
.mockup-browser-element-label {
  position: absolute;
  top: -7px;
  left: 6px;
  background: var(--orange, #d97757);
  color: #fff;
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 2px;
  font-family: var(--mono, monospace);
  font-weight: 600;
}
.mockup-browser-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  left: 60%;
  top: 65%;
  pointer-events: none;
}

/* Mockup 4: Group Chats */
.mockup-chat-room {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mockup-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.mockup-chat-room-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.mockup-chat-participants {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.mockup-chat-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.mockup-chat-avatar.cl { background: #6366f1; }
.mockup-chat-avatar.cx { background: #3b82f6; }
.mockup-chat-avatar.ag { background: #f59e0b; }
.mockup-chat-message-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mockup-chat-message {
  display: flex;
  gap: 8px;
  font-size: 11px;
  /* Pin the content box so the pill is the same 22px tall as q2's, whose
     font resolves to a 14px line box. `normal` differs between the two
     stacks and left this 2px taller. */
  line-height: 14px;
}
.mockup-chat-message .msg-sender {
  font-weight: 600;
  width: 45px;
  flex-shrink: 0;
}
.mockup-chat-message .msg-text {
  color: var(--text-muted);
}
.mockup-chat-typing {
  font-size: 9px;
  color: var(--text-dim, rgba(255,255,255,0.3));
  margin-top: 2px;
}

/* Mockup 5: Pinned Rows */
.mockup-pinning-sidebar {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.mockup-pinning-header {
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--orange, #d97757);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.mockup-pinning-row {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.mockup-pinning-row:last-child {
  border-bottom: none;
}
.mockup-pinning-name {
  font-weight: 500;
  color: var(--text);
}
.mockup-pinning-icon {
  color: var(--orange, #d97757);
  font-size: 10px;
}

/* Footer layout & sizing */
.whats-new-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--bg);
}
.whats-new-footer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.whats-new-changelog-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.whats-new-changelog-link:hover {
  text-decoration: underline;
}

/* --- Group Chat Orchestrator & Mentions --- */

.gc-orchestrator-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg-secondary);
}

.gco-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gco-title {
  font-weight: 600;
  color: var(--fg-primary);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.gco-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: baseline;
}

.gco-label {
  color: var(--fg-muted);
  white-space: nowrap;
}

.gco-val {
  font-weight: 500;
  color: var(--fg-primary);
  min-width: 0;
  overflow-wrap: anywhere;
}

.gco-time {
  cursor: help;
  border-bottom: 1px dotted var(--border-light);
}

/* Active-work section — surfaces what's burning CPU/tokens + a kill switch. */
.gco-active-section { gap: 7px; }
.gco-active-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; line-height: 1.35;
}
.gco-active-status.is-active { color: var(--green, #3fb950); }
.gco-active-status.is-paused { color: var(--red, #f85149); }
.gco-active-status.is-idle   { color: var(--fg-muted); }
.gco-active-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--green, #3fb950);
  box-shadow: 0 0 5px var(--green, #3fb950);
  animation: live-refresh-pulse 1.6s ease-in-out infinite;
}
.gco-power-btn {
  margin-top: 4px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 5px 11px; border-radius: 6px;
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gco-power-btn.gco-stop {
  color: #fff; background: rgba(185,28,28,0.92);
  border-color: rgba(248,113,113,0.85);
}
.gco-power-btn.gco-stop:hover { background: rgba(220,38,38,0.96); }
.gco-power-btn.gco-enable {
  color: var(--green, #3fb950); background: transparent;
  border-color: rgba(63,185,80,0.55);
}
.gco-power-btn.gco-enable:hover { background: rgba(63,185,80,0.14); }

/* Click-to-select identifiers (chat ID, chat file path) in the orchestrator
   panel — `user-select: all` highlights the whole value with a single click
   so the user can Cmd-C without dragging across hyphens. */
.gco-copy {
  user-select: all;
  -webkit-user-select: all;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}

/* Lifecycle entries — "system: removed X", "system: pinged …". Render at
   smaller size + muted color so they don't compete with real conversation.
   .gc-system applies to whole gc-message rows when the speaker IS "system";
   .gc-system-note applies to inline blockquote lines (the orchestrator
   often appends pings as a > _system: …_ trailer to the prior message). */
.gc-message.gc-system {
  opacity: 0.62;
}
.gc-message-number {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
/* Ping messages: the user wants every orchestrator ping visible, so don't
   bury these in the muted lifecycle log — full opacity + a 📨 marker. */
.gc-message.gc-system.gc-system-ping-msg {
  opacity: 1;
}
.gc-message.gc-system-ping-msg .gc-message-speaker::before {
  content: "📨 ";
}
.gc-message.gc-system-ping-msg .gc-message-body {
  color: var(--text-2);
}
.gc-message.gc-system .gc-message-body,
.gc-message.gc-system .gc-message-speaker {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
}
.gc-message.gc-system .gc-message-body p { margin: 2px 0; }

.gc-message-body blockquote.gc-system-note,
.gc-message-body div.gc-system-note {
  border-left: 2px solid var(--border-light);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  font-style: normal;
  margin: 2px 0;
  padding: 2px 0 2px 10px;
  opacity: 0.85;
}
.gc-message-body blockquote.gc-system-note em,
.gc-message-body div.gc-system-note em { font-style: normal; }
/* Pings (orchestrator nudging an agent) are the system events the user
   actually wants to track — lift them out of the muted strip with an accent
   border, a 📨 marker, and full opacity so every ping is visible in the chat. */
.gc-message-body blockquote.gc-system-ping,
.gc-message-body div.gc-system-ping {
  border-left-color: var(--accent);
  color: var(--text-2);
  opacity: 1;
}
.gc-message-body blockquote.gc-system-ping::before,
.gc-message-body div.gc-system-ping::before {
  content: "📨 ";
}
/* Collapse the gap when several system notes stack — group reads as one
   muted strip of orchestrator activity rather than separate items. */
.gc-message-body div.gc-system-note + div.gc-system-note,
.gc-message-body blockquote.gc-system-note + blockquote.gc-system-note {
  margin-top: 0;
  border-top: 0;
}

/* Hide the PWA install nudge while the user is reading or composing in a
   group chat — it sits bottom-right and was overlapping .gc-reader-input-row
   plus the bottom of .gc-orchestrator-panel. The dismissal-persist key in
   index.html now keeps it down for ~5 years once closed, so the auto-hide
   here just covers the "not yet dismissed" case. */
body.has-gc-reader .pwa-install-banner {
  display: none !important;
}

.gco-part-card {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
/* Pasted-image thumbnails strip — sits above the input so the user
   sees a preview of every image they pasted, with a small × to drop
   one from the message. Cleared automatically when the input goes
   empty (post-send). */
.paste-thumb-strip {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 6px 8px;
  margin: 0 0 4px 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface) 94%);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 6px;
}
.paste-thumb {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.paste-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.paste-thumb.paste-thumb-pending img {
  opacity: 0.55;
  animation: ccc-thumb-pulse 1.2s ease-in-out infinite;
}
@keyframes ccc-thumb-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.95; }
}
.paste-thumb-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: 0; border-radius: 50%;
  font-size: 13px; line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.paste-thumb:hover .paste-thumb-remove,
.paste-thumb-remove:focus-visible { opacity: 1; }

/* Non-image attachment chip (PDF, log, zip, ...) — same strip as the pasted-
   image thumbnails, but a filename pill instead of a thumbnail since there's
   nothing to preview. */
.paste-thumb.paste-thumb-file {
  width: auto; height: 32px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 22px 0 8px;
  border-radius: 999px;
  max-width: 160px;
}
.paste-thumb-file-name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.paste-thumb-file .paste-thumb-remove {
  position: absolute;
  top: 50%; right: 4px;
  transform: translateY(-50%);
  opacity: 1;
  background: transparent;
  color: var(--text-muted);
}
.paste-thumb-file:hover .paste-thumb-remove { color: var(--text); }

/* @ autocomplete menu for the group-chat input box. */
.gc-mention-menu {
  position: fixed;
  z-index: 9998;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  min-width: 200px;
}
.gc-mention-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 0; border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.gc-mention-item:hover,
.gc-mention-item.selected {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.gc-mention-item-name { font-weight: 600; }
.gc-mention-item-id {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted, var(--text-2));
}

.gco-nudge-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 4px;
  cursor: pointer;
}
.gco-nudge-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.gco-nudge-btn:disabled {
  opacity: 0.55; cursor: default;
}

.gco-part-name {
  font-weight: 600;
  color: var(--fg-primary);
}

.gco-part-id {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 400;
}

.gco-part-stat {
  font-size: 12px;
}

.gco-part-snippet {
  font-size: 11px;
  color: var(--fg-muted);
  font-style: italic;
  margin-top: 2px;
  background: var(--bg-page);
  padding: 4px;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-mention {
  background-color: #00b0ff22;
  color: #00b0ff;
  border: 1px solid #00b0ff55;
  border-radius: 12px;
  padding: 1px 6px;
  font-weight: 500;
  font-size: 0.95em;
  white-space: nowrap;
}

/* Onboarding Premium Wizard Styles */
.onb-dialog {
  position: relative;
  width: min(650px, 94vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  z-index: 10000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.onb-hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(59, 130, 246, 0.05) 50%, transparent 100%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.onb-steps-container {
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.onb-step {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: onb-fade-in 0.3s ease-out forwards;
}

.onb-step-active {
  display: flex;
}

@keyframes onb-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.onb-welcome-icon {
  font-size: 48px;
  align-self: center;
  margin-bottom: 8px;
  animation: onb-bounce 2s infinite ease-in-out;
}

@keyframes onb-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.onb-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 0;
  letter-spacing: -0.5px;
}

.onb-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
  max-width: 540px;
  align-self: center;
  margin: 0 0 10px 0;
}

.onb-features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}

@media(min-width: 480px) {
  .onb-features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.onb-feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color 0.2s, background-color 0.2s;
}

.onb-feat-icon {
  font-size: 20px;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 8px;
  padding: 6px;
  line-height: 1;
}

.onb-feature-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text);
}

.onb-feature-card p {
  font-size: 12px;
  margin: 0;
  color: var(--text-muted);
  /* Pin the content box so the pill is the same 22px tall as q2's, whose
     font resolves to a 14px line box. `normal` differs between the two
     stacks and left this 2px taller. */
  line-height: 14px;
}

/* CLI Checker Step */
.onb-cli-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.onb-cli-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  gap: 12px;
}

.onb-cli-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.onb-cli-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--surface-2);
}

.onb-cli-details h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.onb-cli-details p {
  font-size: 11px;
  margin: 2px 0 0 0;
  color: var(--text-muted);
}

.onb-cli-status-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.onb-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.onb-badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.onb-badge-orange {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.onb-badge-gray {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.25);
}

.onb-setup-action {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
}

.onb-setup-action:hover {
  background: rgba(255,255,255,0.05);
  text-decoration: underline;
}

.onb-login-panel {
  flex: 1 0 100%;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onb-login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.onb-login-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.onb-login-command {
  margin-top: 2px;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.onb-login-cancel,
.onb-login-send,
.onb-login-hint-action {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
  text-decoration: none;
}

.onb-login-cancel:hover,
.onb-login-send:hover,
.onb-login-hint-action:hover {
  border-color: var(--accent);
}

.onb-login-cancel:disabled,
.onb-login-send:disabled {
  cursor: default;
  opacity: 0.55;
  border-color: var(--border);
}

.onb-login-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.onb-login-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0;
}

.onb-login-output {
  margin: 0;
  min-height: 120px;
  max-height: 210px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #05070a;
  color: #d7dde8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.onb-login-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.onb-login-input {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.onb-login-input:focus {
  outline: none;
  border-color: var(--accent);
}

.onb-cli-footer-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
  /* Pin the content box so the pill is the same 22px tall as q2's, whose
     font resolves to a 14px line box. `normal` differs between the two
     stacks and left this 2px taller. */
  line-height: 14px;
}

/* First Session Step */
.onb-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onb-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.onb-select {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.onb-select:focus {
  border-color: var(--accent);
}

.onb-prompts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media(min-width: 480px) {
  .onb-prompts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.onb-prompt-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  text-align: left;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.onb-prompt-chip:hover {
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

.onb-prompt-chip.active {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
  color: var(--text);
  font-weight: 500;
}

.onb-textarea {
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  outline: none;
  font-family: inherit;
  margin-top: 6px;
  animation: onb-fade-in 0.2s ease-out;
}

.onb-textarea:focus {
  border-color: var(--accent);
}

/* Footer & Navigation */
.onb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.onb-dots {
  display: flex;
  gap: 6px;
}

.onb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.onb-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

.onb-actions {
  display: flex;
  gap: 8px;
}

/* Onboarding arrow helper */
.onb-arrow-highlight {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  animation: onb-arrow-float 2s infinite ease-in-out;
}

@keyframes onb-arrow-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.onb-arrow-bubble {
  position: relative;
  background: #1a0d2e;
  border: 2px solid #b266ff;
  border-radius: 12px;
  padding: 16px;
  width: 280px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  pointer-events: auto;
}

.onb-arrow-tip {
  position: absolute;
  left: -10px;
  top: 30px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #b266ff;
}

.onb-arrow-tip::after {
  content: '';
  position: absolute;
  left: 2px;
  top: -8px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #1a0d2e;
}

.onb-arrow-content h4 {
  margin: 0 0 6px 0;
  color: #e9d5ff;
  font-size: 14px;
  font-weight: 600;
}

.onb-arrow-content p {
  margin: 0 0 10px 0;
  color: var(--text-muted);
  font-size: 12px;
  /* Pin the content box so the pill is the same 22px tall as q2's, whose
     font resolves to a 14px line box. `normal` differs between the two
     stacks and left this 2px taller. */
  line-height: 14px;
}

.onb-arrow-close-btn {
  background: #5e2ea8;
  color: #fff;
  border: 1px solid #b266ff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.onb-arrow-close-btn:hover {
  background: #733bb8;
}

/* ── New-session chooser (CCC-82) ─────────────────────────────────────
   Front-and-center folder choice in the "Start a new session" empty
   state: existing repo chips on the left, new-project mini-form on the
   right. The bottom-bar CWD picker remains as the power path. */
.ns-choice-grid {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  margin: 10px 0 4px; width: 100%; max-width: 720px;
}
.ns-choice-card {
  flex: 1 1 280px; max-width: 350px; text-align: left;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.ns-choice-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ns-repo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ns-repo-chip {
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 12px; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ns-repo-chip:hover { border-color: var(--accent, #58a6ff); color: var(--accent, #58a6ff); }
.ns-repo-chip.is-current {
  border-color: var(--accent, #58a6ff);
  background: rgba(88,166,255,0.12); color: var(--accent, #58a6ff);
}
.ns-input {
  width: 100%; padding: 6px 9px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 13px; outline: none;
}
.ns-input:focus { border-color: var(--accent, #58a6ff); }
.ns-create-btn {
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--accent, #58a6ff);
  background: rgba(88,166,255,0.14); color: var(--accent, #58a6ff);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.ns-create-btn:disabled { opacity: 0.45; cursor: default; }
.ns-create-btn:not(:disabled):hover { background: rgba(88,166,255,0.22); }
.ns-muted { font-size: 11.5px; color: var(--text-muted); }
.ns-repo-suggestions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: min(560px, 100%);
  margin: 2px 0 0;
}
.ns-repo-suggestions[hidden] { display: none; }
.ns-repo-suggestions .ns-repo-chips {
  justify-content: center;
}

/* UX-fixes worker badge in the toolbar breadcrumb (CCC-90). */
.ccc-breadcrumb-ux {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid rgba(188,140,255,0.5);
  background: rgba(188,140,255,0.12);
  color: var(--purple, #bc8cff);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* "Spawned by" / "Continued from" chip in the toolbar breadcrumb (CCC-1026) —
   always-visible answer to "who spawned this session", instead of only being
   discoverable by hovering the sidebar row. */
.ccc-breadcrumb-spawned-by {
  display: inline-flex; align-items: center; flex-shrink: 1;
  max-width: 180px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(139,148,158,0.28);
  background: rgba(139,148,158,0.10);
  color: var(--text-muted);
  font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.ccc-breadcrumb-spawned-by.is-parent {
  border-color: rgba(188,140,255,0.30);
  background: rgba(188,140,255,0.10);
  color: var(--purple, #bc8cff);
}
.ccc-breadcrumb-spawned-by.is-successor {
  border-color: rgba(88,166,255,0.35);
  background: rgba(88,166,255,0.12);
  color: var(--accent, #58a6ff);
}
.ccc-breadcrumb-spawned-by:hover {
  border-color: var(--accent, #58a6ff);
  background: rgba(88,166,255,0.20);
}

/* By-objects group header as a drop target (CCC-88). */
.conv-folder-group.is-drop-target,
.conv-folder-group-header.is-drop-target,
.conv-evergreen-agents-header.is-drop-target,
.conv-evergreen-agents-scroll.is-drop-target {
  outline: 2px dashed var(--accent, #58a6ff);
  outline-offset: -2px;
  background: rgba(88,166,255,0.10);
}

/* New-session stage: quiet onboarding. The bottom composer is the primary
   launch surface, so the center of the pane teaches context without competing
   with the input. */
.ns-stage {
  min-height: min(42vh, 340px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(32px, 8vh, 84px) 20px 20px;
  box-sizing: border-box;
}
.ns-stage-quiet .ns-hero-quiet {
  animation: nsHeroIn 0.18s ease-out;
  opacity: 0.92;
}
@keyframes nsHeroIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ns-stage-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.ns-stage-subtitle,
.ns-stage-help {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 560px;
}
.ns-new-project-details {
  width: min(460px, 92vw);
  margin-top: 4px;
}
.ns-new-project-details > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
}
.ns-new-project-details[open] > summary {
  color: var(--accent, #58a6ff);
}
.ns-choice-card {
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.ns-choice-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, #58a6ff) 45%, var(--border) 55%);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.ns-choice-card-compact {
  max-width: none;
  margin-top: 8px;
  box-shadow: none;
}
.ns-choice-card-compact:hover {
  transform: none;
  box-shadow: none;
}
/* Adopted CWD + worktree on one row; chips bare below. */
.ns-cwd-slot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 2px; width: 100%; max-width: 560px;
}
.ns-cwd-slot .spawn-cwd-row { flex: 0 0 auto; display: flex; }
.ns-cwd-slot .spawn-worktree-row { flex: 0 0 auto; }
.ns-cwd-slot .spawn-cwd-combo { display: flex; }
/* Narrower, taller, dark-themed picker in the chooser */
.ns-cwd-slot .spawn-cwd-picker {
  width: auto; min-width: 200px; max-width: 300px;
  height: 34px; padding: 0 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px 0 0 4px;
  font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
  outline: none;
}
.ns-cwd-slot .spawn-cwd-picker:hover { border-color: var(--accent); }
.ns-cwd-slot .spawn-cwd-picker:focus { border-color: var(--accent); }
.ns-cwd-slot .spawn-cwd-menu-btn,
.ns-cwd-slot .spawn-cwd-browse-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; width: 30px;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border); border-left: 0;
  cursor: pointer; font-size: 12px;
}
.ns-cwd-slot .spawn-cwd-browse-btn { border-radius: 0 4px 4px 0; }
.ns-cwd-slot .spawn-cwd-menu-btn:hover,
.ns-cwd-slot .spawn-cwd-menu-btn[aria-expanded="true"],
.ns-cwd-slot .spawn-cwd-browse-btn:hover {
  color: var(--text); border-color: var(--accent);
}
/* Chips bare below the CWD row */
.ns-chips-below {
  flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px;
}
/* Dropdown from the chooser opens downward */
.ns-cwd-slot .spawn-cwd-combo { position: relative; }
.ns-cwd-slot .spawn-cwd-menu {
  display: none; position: absolute; z-index: 1200;
  top: calc(100% + 4px); bottom: auto; left: 0;
  width: min(480px, calc(100vw - 80px)); max-height: min(360px, 60vh);
  overflow: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.ns-cwd-slot .spawn-cwd-menu.open { display: grid; gap: 2px; }
/* Integration recipes: collapsible toggle in mid-screen */
.ns-recipes-details {
  width: 100%; max-width: 720px; margin-top: 4px;
}
.ns-recipes-summary {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
  cursor: pointer; list-style: none; padding: 5px 0;
  user-select: none;
}
.ns-recipes-summary::-webkit-details-marker { display: none; }
.ns-recipes-summary::before { content: '▶ '; font-size: 9px; opacity: 0.7; }
.ns-recipes-details[open] .ns-recipes-summary::before { content: '▼ '; }
/* While adopted, hide the strip's leftover quick chips */
#convInputContext.cwd-controls-adopted .spawn-cwd-quick-chips { display: none; }

/* ── Sidebar section tabs (CCC-85) ──────────────────────────────────── */
.conv-tab-bar {
  display: flex; gap: 2px;
  position: sticky; top: 0; z-index: 5;
  background: var(--surface);
  padding: 6px 6px 0; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.conv-tab {
  flex: 1; padding: 6px 4px 7px;
  border: none; border-bottom: 2px solid transparent;
  background: transparent; color: var(--text-muted);
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  white-space: nowrap; border-radius: 4px 4px 0 0;
}
.conv-tab:hover { color: var(--text); background: var(--surface-2); }
.conv-tab.is-active {
  color: var(--accent, #58a6ff);
  border-bottom-color: var(--accent, #58a6ff);
}
.conv-tab.is-drop-target {
  color: var(--text);
  background: rgba(88,166,255,0.14);
  outline: 2px dashed var(--accent, #58a6ff);
  outline-offset: -2px;
}
.conv-tab-count {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: rgba(139,148,158,0.18); color: var(--text-muted);
}
.conv-tab.is-active .conv-tab-count {
  background: rgba(88,166,255,0.18); color: var(--accent, #58a6ff);
}
#convList:has(> .shared-queue-host-sidebar) {
  display: flex;
  flex-direction: column;
  overflow-y: hidden !important;
}
#convList:has(> .shared-queue-host-sidebar) > .conv-tab-bar {
  flex: 0 0 auto;
}
.shared-queue-host-sidebar {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.shared-queue-host-sidebar > .files-queue-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  height: auto !important;
  padding: 0 8px 10px;
  border-top: 0;
  background: transparent;
}
/* Section headers double as collapse toggles; inside a tab the section
   label is redundant with the tab itself but harmless — keep for tools
   (1d/7d, grouping) that live in the header. */

.ns-composer-slot { width: 100%; max-width: 720px; margin-top: 4px; }
.conv-input-bar.is-new-session-launch {
  padding: 12px 22px 18px;
  background: color-mix(in srgb, var(--bg) 88%, var(--surface) 12%);
  border-top: 1px solid var(--border);
}
.conv-input-bar.is-new-session-launch textarea {
  min-height: 96px;
  font-size: 15px;
  line-height: 1.45;
  border-color: var(--accent, #58a6ff);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.10);
}
.conv-input-context.visible.is-new-session {
  padding: 8px 22px 0;
}

/* New-project name row + dice (random fun name) */
.ns-name-row { display: flex; gap: 6px; align-items: center; }
.ns-name-row .ns-input { flex: 1; }
.ns-dice-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.12s, border-color 0.15s;
}
.ns-dice-btn:hover { border-color: var(--accent, #58a6ff); transform: rotate(-20deg) scale(1.1); }
.ns-dice-btn:active { transform: rotate(340deg) scale(0.95); }

.files-queue-list {
  flex: 1 1 auto;
  overflow-y: auto; min-height: 0;
  display: flex; flex-direction: column;
}
.fq-row {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; font-size: 14px; line-height: 1.35;
  border-bottom: 1px solid rgba(139,148,158,0.08);
  cursor: pointer;
}
.fq-row:hover { background: rgba(139,148,158,0.08); }
/* Fresh refs from the live queue poll glow once without making the initial
   queue render noisy. */
.fq-row.fq-new-item {
  animation: fq-new-item-glow 4.5s ease-out;
}
@keyframes fq-new-item-glow {
  0% { background: rgba(88,166,255,0.36); box-shadow: inset 0 0 0 1px rgba(88,166,255,0.85), 0 0 18px rgba(88,166,255,0.52); }
  100% { background: transparent; box-shadow: inset 0 0 0 1px transparent, 0 0 0 transparent; }
}
/* Flash for the conversation event a queue-row click jumped to (CCC-105). */
.event.uxq-jump-hit {
  animation: uxq-jump-flash 2.4s ease-out;
}
@keyframes uxq-jump-flash {
  0% { background: rgba(163,113,247,0.28); }
  100% { background: transparent; }
}
.fq-ref {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 12.5px; color: var(--text-muted); flex-shrink: 0; min-width: 44px;
}
/* Queue name on a ticket row — only rendered when the panel scope doesn't
   already say which queue the row belongs to (All queues, or a sub-queue row
   inside a family scope). Same role as q2's .q2-tqueue: cyan, small, clipped
   before it can push the note or signals off the row; full name on hover. */
.fq-queue {
  /* Never shrink — the note truncates instead. A label that collapses on
     chip-crowded (needs-input) rows is exactly where the queue name matters. */
  flex: 0 0 auto; max-width: 12ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--cyan);
}
.fq-note {
  flex: 1 1 0;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fq-run {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(88,166,255,0.35);
  background: rgba(88,166,255,0.12);
  color: var(--accent, #58a6ff);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.fq-run:hover { border-color: var(--accent, #58a6ff); background: rgba(88,166,255,0.18); }
.fq-run:disabled { opacity: 0.45; cursor: wait; }
/* Spinning wheel from the moment ▶ is pressed through "queued to run" — the
   ticket hasn't visibly changed state yet (queue-add or store-write can take
   a beat), so the still triangle read as an unresponsive click. Covers both
   the in-flight POST (:disabled, briefly) and the queued-run wait (until a
   worker claims it and .is-in_progress's pulsing dot takes over). */
.fq-run:disabled,
.fq-row.is-queued-run .fq-run {
  color: transparent;
  position: relative;
}
.fq-run:disabled::after,
.fq-row.is-queued-run .fq-run::after {
  content: '';
  position: absolute;
  width: 11px; height: 11px; box-sizing: border-box;
  border: 2px solid rgba(88,166,255,0.35);
  border-top-color: var(--accent, #58a6ff);
  border-radius: 50%;
  animation: fq-status-pending-spin 0.7s linear infinite;
}
.fq-row.is-queued-run .fq-run::after {
  border-color: color-mix(in srgb, var(--warn, #d29922) 35%, transparent);
  border-top-color: var(--warn, #d29922);
}
@media (prefers-reduced-motion: reduce) {
  .fq-run:disabled::after, .fq-row.is-queued-run .fq-run::after { animation: none; }
}
.files-queue-panel.queue-wrap-titles .fq-row {
  align-items: flex-start;
  flex-wrap: wrap;
}
.fq-row-signals {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.files-queue-panel.queue-wrap-titles .fq-chips {
  flex-wrap: wrap;
}
.files-queue-panel.queue-wrap-titles .fq-note {
  /* Own full-width row below ref + chips, so the note gets all the space. */
  order: 10;
  flex: 0 0 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  padding-top: 3px;
}
.files-queue-panel.queue-wrap-titles .fq-row-signals {
  margin-left: auto;
  align-self: flex-start;
  flex: 0 0 auto;
}
.files-queue-panel.queue-wrap-titles .fq-status {
  margin-top: 2px;
}
/* Status as a compact colored dot (open/in_progress/closed) — the 227px Queue
   panel has no room for a text pill once the triage chips are inline. Hover for
   the word; the color carries the signal. */
.fq-status {
  flex-shrink: 0; width: 14px; height: 14px; padding: 0; border-radius: 50%;
  font-size: 0; align-self: center;
  box-shadow: 0 0 0 2px rgba(139,148,158,0.14);
}
.fq-status.fq-status-action {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; color: transparent; line-height: 1;
}
.fq-status.fq-status-pending {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; box-shadow: none;
}
.fq-status.fq-status-pending::after {
  content: ''; width: 10px; height: 10px; box-sizing: border-box;
  border: 2px solid var(--accent, #58a6ff); border-right-color: transparent;
  border-radius: 50%; animation: fq-status-pending-spin 0.7s linear infinite;
}
@keyframes fq-status-pending-spin { to { transform: rotate(360deg); } }
.fq-status-action:hover,
.fq-status-action:focus-visible {
  color: var(--bg, #0d1117); font-size: 10px;
  outline: 1px solid var(--accent, #58a6ff); outline-offset: 2px;
}
@keyframes fq-status-glow {
  0%, 100% {
    opacity: 0.82;
    box-shadow: 0 0 0 3px rgba(33,150,243,0.28), 0 0 10px rgba(33,150,243,0.5);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(33,150,243,0.45), 0 0 24px rgba(33,150,243,0.95);
  }
}
.fq-row.is-open .fq-status {
  background: var(--text-muted, #8b949e);
  box-shadow: 0 0 0 3px rgba(139,148,158,0.16);
}
.fq-row.is-in_progress .fq-status {
  background: var(--accent, #58a6ff);
  animation: fq-status-glow 1.5s ease-in-out infinite;
  will-change: opacity, box-shadow;
}
/* Historical claim fields can outlive their worker. Keep that stale state
   visible in the tooltip without giving it a live, repeating blue pulse. */
.fq-row.is-in_progress.is-stale-claim .fq-status {
  background: var(--text-muted, #8b949e);
  animation: none;
  box-shadow: 0 0 0 3px rgba(139,148,158,0.16);
}
/* Queued to run (2026-07-26 ▶ design): run_requested is set but no worker has
   claimed the ticket yet. Amber for "waiting its turn" — distinct from plain
   open (grey) and from running (blue, pulsing). It stays a live button because
   a second press cancels the request; the rule sits after .fq-row.is-open so
   it wins on the open rows queued tickets still are. */
.fq-row.is-queued-run .fq-status.fq-run {
  background: color-mix(in srgb, var(--warn, #d29922) 85%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn, #d29922) 22%, transparent);
}
.fq-row.is-queued-run .fq-status.fq-run:hover,
.fq-row.is-queued-run .fq-status.fq-run:focus-visible {
  background: var(--warn, #d29922);
}
/* A claim label without a durable session id cannot prove liveness. Distinguish
   it from both live blue work and an unclaimed grey row without faking activity. */
.fq-row.is-open.is-unverified-claim .fq-status {
  box-sizing: border-box;
  background: transparent;
  border: 2px solid var(--orange, #d29922);
  animation: none;
  box-shadow: 0 0 0 3px rgba(210,153,34,0.16);
}
.fq-age {
  flex-shrink: 0; font-size: 11px; color: var(--text-muted);
  min-width: 34px; text-align: right;
}
.fq-row.is-closed .fq-status { background: var(--green, #3fb950); }
.fq-row .fq-status.fq-status-pending {
  background: transparent; animation: none; box-shadow: none;
}
.fq-row.is-closed .fq-note { color: var(--text-muted); }
.fq-row.is-closed .fq-chip { background: rgba(139,148,158,0.10) !important; color: var(--text-muted) !important; opacity: 0.6; }
/* Closed-but-not-fully-resolved (CCC-420): resolution.unresolved means the
   worker closed the ticket but flagged something it couldn't finish. This is
   an amber follow-up state, distinct from the red "needs input" hard block. */
.fq-row.is-closed.has-unresolved .fq-status { background: var(--orange, #d29922); }
.fq-row.is-closed.has-unresolved .fq-note { color: var(--orange, #d29922); }
.fq-chip.fq-unresolved { background: rgba(210,153,34,0.20); color: var(--orange, #d29922); }
.fq-row.is-closed.has-unresolved .fq-chip.fq-unresolved { opacity: 1 !important; background: rgba(210,153,34,0.20) !important; color: var(--orange, #d29922) !important; }
/* Triage chips (WT-FEATURES-23): type / priority / readiness + value/confidence,
   inline on the row so the queue view shows what the engine sees and picks first. */
.fq-chips { display: inline-flex; flex-wrap: nowrap; flex-shrink: 0; gap: 2px; }
.fq-chip {
  font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: 0.01em;
  padding: 0 4px; border-radius: 999px; text-transform: uppercase; white-space: nowrap;
  background: rgba(139,148,158,0.15); color: var(--text-muted);
}
.fq-type-bug { background: rgba(248,81,73,0.16); color: #f85149; }
.fq-type-feature { background: rgba(163,113,247,0.18); color: #a371f7; }
.fq-prio-p0 { background: rgba(248,81,73,0.24); color: #ff7b72; }
.fq-prio-p1 { background: rgba(210,153,34,0.20); color: #d29922; }
.fq-prio-p2 { background: rgba(139,148,158,0.16); color: var(--text-muted); }
.fq-prio-p3 { background: rgba(139,148,158,0.10); color: var(--text-muted); }
.fq-ready-shovel-ready { background: rgba(63,185,80,0.18); color: #3fb950; }
.fq-ready-needs-spec { background: rgba(88,166,255,0.18); color: #58a6ff; }
.fq-ready-needs-shaping { background: rgba(210,153,34,0.16); color: #d29922; }
.fq-vc { background: rgba(139,148,158,0.12); color: var(--text-muted); }
/* Priority bump button — hidden until row hover (CCC-339). */
.fq-prio-bump {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  padding: 0; margin: 0;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; cursor: pointer;
  font-size: 11px; line-height: 1; color: var(--text-muted);
  opacity: 0; transition: opacity 0.1s, background 0.1s, color 0.1s;
}
.fq-row:hover .fq-prio-bump { opacity: 1; }
.fq-prio-bump:hover {
  background: rgba(88,166,255,0.16);
  border-color: rgba(88,166,255,0.30);
  color: var(--accent, #58a6ff);
}
.fq-priority-chip { position: relative; }
.fq-priority-chip .fq-prio-bump {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  background: var(--bg, #0d1117);
}
.fq-row:hover .fq-priority-chip .fq-prio-bump { opacity: 1; }
.fq-prio-bump.is-top { opacity: 0 !important; pointer-events: none; }

/* Blocked-work (WT-28): a ticket waiting on a human. Red (CCC-465) — it needs
   you, so it "means business"; amber is reserved for in_progress. Sorted top. */
.fq-chip.fq-blocked { background: rgba(248,81,73,0.20); color: #ff7b72; }
.fq-row.is-blocked { background: rgba(248,81,73,0.06); }
.fq-row.is-blocked .fq-status { background: var(--red, #f85149); }
.fq-row.is-blocked .fq-note { color: #ff7b72; }
/* Who a ticket waits on (CCC-244, static/queue-attention.js). Red above is
   only for an owner decision; the label always names the state, and the dot
   shape differs (solid = act/answer flow, ring = someone else), so colour is
   never the only signal. */
.fq-chip.fq-att-owner { background: rgba(248,81,73,0.20); color: #ff7b72; }
.fq-chip.fq-att-external { background: rgba(56,139,253,0.20); color: #79c0ff; }
.fq-chip.fq-att-answer { background: rgba(210,153,34,0.22); color: #e3b341; }
.fq-chip.fq-att-neutral { background: rgba(139,148,158,0.18); color: #b1bac4; }
:root[data-theme="light"] .fq-chip.fq-att-owner { color: #a40e26; background: rgba(207,34,46,0.12); }
:root[data-theme="light"] .fq-chip.fq-att-external { color: #0550ae; background: rgba(9,105,218,0.12); }
:root[data-theme="light"] .fq-chip.fq-att-answer { color: #7d4e00; background: rgba(154,103,0,0.14); }
:root[data-theme="light"] .fq-chip.fq-att-neutral { color: #424a53; background: rgba(87,96,106,0.14); }
.fq-row.is-waiting.is-att-external { background: rgba(56,139,253,0.05); }
.fq-row.is-waiting.is-att-answer { background: rgba(210,153,34,0.05); }
.fq-row.is-waiting .fq-status { background: transparent; box-shadow: inset 0 0 0 2px var(--text-muted, #8b949e); }
.fq-row.is-waiting.is-att-external .fq-status { box-shadow: inset 0 0 0 2px #58a6ff; }
.fq-row.is-waiting.is-att-answer .fq-status { background: #d29922; box-shadow: none; }
.fq-row.is-waiting.is-att-external .fq-note { color: #a5d6ff; }
:root[data-theme="light"] .fq-row.is-waiting.is-att-external .fq-note { color: #0550ae; }
/* Answer handoff on an unblocked row: amber dot and tint while the answer is
   queued/sending; a live worker on a delivered answer (.is-att-working)
   keeps its green pulse and the 'working on answer' title. */
.fq-row.is-open.is-att-answer .fq-status,
.fq-row.is-in_progress.is-att-answer:not(.is-att-working) .fq-status { background: #d29922; box-shadow: 0 0 0 3px rgba(210,153,34,0.22); animation: none; }
.fq-row.is-open.is-att-answer,
.fq-row.is-in_progress.is-att-answer:not(.is-att-working) { background: rgba(210,153,34,0.05); }
/* in_review (WT-5 gate): closed by its worker, waiting on accept/reject. */
.fq-chip.fq-review { background: rgba(163,113,247,0.20); color: #d2a8ff; }
/* WT-4 dependency: replaces READY while a blocked_by ticket is unfinished. */
.fq-chip.fq-waiting-on { background: rgba(139,148,158,0.18); color: var(--text-muted, #8b949e); cursor: pointer; }
.fq-chip.fq-waiting-on:hover, .fq-chip.fq-waiting-on:focus-visible { color: var(--text, #e6edf3); text-decoration: underline; }
.fq-status-blocked { color: var(--text-muted, #8b949e); white-space: nowrap; }
/* Ticket detail: acceptance line + checks (WT-5/WT-6). */
.uxq-check-accept { margin: 2px 0 6px; }
.uxq-check-sentback { margin: 4px 0 6px; color: #ff7b72; white-space: pre-wrap; }
.uxq-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.uxq-check { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.uxq-check-state { font-size: 11px; padding: 0 6px; border-radius: 8px; background: rgba(139,148,158,0.18); color: var(--text-muted, #8b949e); }
.uxq-check-state.is-passed { background: rgba(63,185,80,0.18); color: #56d364; }
.uxq-check-state.is-failed { background: rgba(248,81,73,0.18); color: #ff7b72; }
.uxq-check-state.is-pending { background: rgba(163,113,247,0.20); color: #d2a8ff; }
.uxq-check-meta { color: var(--text-muted, #8b949e); font-size: 12px; }
.uxq-check-session { background: none; border: 0; padding: 0; color: var(--accent, #58a6ff); cursor: pointer; font: inherit; font-size: 12px; }
.uxq-check-session:hover { text-decoration: underline; }
.uxq-check-evidence { flex-basis: 100%; }
.uxq-check-evidence pre { max-height: 240px; overflow: auto; white-space: pre-wrap; font-size: 12px; margin: 4px 0 0; }
.fq-row.is-in_review .fq-status { background: #a371f7; box-shadow: 0 0 0 3px rgba(163,113,247,0.18); }
/* Stage tones (CCC-1243): what WatchTower is doing with an open ticket, read
   from its `stages` model. Cyan = planning, pink = checks/verify, orange =
   stuck (same stage past the queue's stuck window, or a dead worker's claim),
   green with a check = closed after its verify passed. A live claim keeps
   pulsing, in the stage's own color. Needs input (red) is never toned. */
.fq-row.is-stage-planning { --fq-tone: #39c5cf; }
.fq-row.is-stage-verifying { --fq-tone: #db61a2; }
.fq-row.is-stage-stuck { --fq-tone: #f0883e; }
.fq-row.is-stage-planning .fq-status,
.fq-row.is-stage-verifying .fq-status,
.fq-row.is-stage-stuck .fq-status {
  box-sizing: border-box; border: 0;
  background: var(--fq-tone);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fq-tone) 22%, transparent);
  animation: none;
}
.fq-row.is-in_progress.is-stage-planning .fq-status,
.fq-row.is-in_progress.is-stage-verifying .fq-status {
  animation: fq-stage-glow 1.5s ease-in-out infinite;
}
@keyframes fq-stage-glow {
  0%, 100% { opacity: 0.82; box-shadow: 0 0 0 3px color-mix(in srgb, var(--fq-tone) 28%, transparent); }
  50% { opacity: 1; box-shadow: 0 0 0 5px color-mix(in srgb, var(--fq-tone) 45%, transparent), 0 0 18px var(--fq-tone); }
}
.fq-row.is-stage-stuck .fq-note { color: color-mix(in srgb, #f0883e 70%, var(--text)); }
.fq-row.is-closed.is-stage-verified .fq-status {
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px rgba(63,185,80,0.24);
}
.fq-row.is-closed.is-stage-verified .fq-status::after {
  content: '\2713'; font-size: 10px; font-weight: 700; line-height: 1; color: var(--bg, #0d1117);
}
@media (prefers-reduced-motion: reduce) {
  .fq-row.is-in_progress.is-stage-planning .fq-status,
  .fq-row.is-in_progress.is-stage-verifying .fq-status { animation: none; }
}
/* Blocked panel inside the ticket detail modal. */
/* ── Ticket Detail Modal (world-class redesign CCC-387/388) ── */
.uxq-td-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); padding: 16px;
}
.uxq-td-card {
  /* `zoom` scales the element after layout. Counter-scale its layout box so
     the largest saved text size stays inside the fixed overlay viewport. */
  width: min(1020px, calc(98vw / var(--uxq-td-zoom, 1)));
  max-height: calc(92vh / var(--uxq-td-zoom, 1));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  zoom: var(--uxq-td-zoom, 1);
}
/* Top bar */
.uxq-td-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 8px; border-bottom: 1px solid var(--border);
  background: rgba(139,148,158,0.04); flex-shrink: 0;
}
.uxq-td-topbar-left { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.uxq-td-ref {
  font: 700 12px var(--font-mono, ui-monospace, monospace);
  color: var(--accent); letter-spacing: 0.04em;
}
/* Badges */
.uxq-td-badge {
  font: 600 10px var(--font-ui); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; border: 1px solid currentColor;
}
.uxq-bs-open     { color: #6b8fb0; border-color: rgba(107,143,176,0.4); }
.uxq-bs-wip      { color: #a78bfa; border-color: rgba(167,139,250,0.4); }
.uxq-bs-blocked  { color: #f59e0b; border-color: rgba(245,158,11,0.4);  background: rgba(245,158,11,0.08); }
.uxq-bs-closed   { color: #4ade80; border-color: rgba(74,222,128,0.4);  }
.uxq-bs-lane     { color: var(--text-muted); border-color: var(--border); }
.uxq-bs-type     { color: #60a5fa; border-color: rgba(96,165,250,0.4); }
.uxq-bp-p0       { color: #f87171; border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.10); }
.uxq-bp-p1       { color: #fb923c; border-color: rgba(251,146,60,0.35); }
.uxq-bp-p2       { color: #facc15; border-color: rgba(250,204,21,0.35); }
.uxq-bp-p3       { color: var(--text-muted); border-color: var(--border); }
.uxq-td-badge-jump { cursor: pointer; }
.uxq-td-badge-jump:hover, .uxq-td-badge-jump:focus-visible {
  background: rgba(139,148,158,0.16); outline: none;
}
@keyframes uxqJumpFlash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 2px var(--accent, #58a6ff); }
}
.uxq-jump-flash { animation: uxqJumpFlash 0.9s ease; border-radius: 6px; }
.uxq-td-x {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 20px; line-height: 1;
  padding: 0 4px; border-radius: 4px; margin-left: 8px;
}
.uxq-td-x:hover { background: rgba(139,148,158,0.15); color: var(--text); }
/* Font-size zoom controls (CCC-1024) */
.uxq-td-zoom { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.uxq-td-zoom-btn {
  background: none; border: 1px solid var(--border); cursor: pointer;
  color: var(--text-muted); font: 700 12px var(--font-ui); line-height: 1;
  width: 22px; height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.uxq-td-zoom-btn:hover { background: rgba(139,148,158,0.15); color: var(--text); }
.uxq-td-zoom-btn:disabled { opacity: 0.35; cursor: default; }
.uxq-td-zoom-btn:disabled:hover { background: none; color: var(--text-muted); }
/* Title */
.uxq-td-title-wrap {
  padding: 12px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.uxq-td-title {
  max-height: 180px; overflow-y: auto;
  font: 400 14px/1.5 var(--font-ui); color: var(--text);
  overflow-wrap: anywhere; white-space: pre-wrap; outline: none;
  border-radius: 4px; padding: 2px 4px; margin: -2px -4px;
  min-height: 1.3em; cursor: text;
}
.uxq-td-title-first {
  display: block; font-size: 20px; font-weight: 800; line-height: 1.3;
}
.uxq-td-title-rest {
  display: block; margin-top: 6px;
}
.uxq-td-title:focus {
  background: rgba(139,148,158,0.08);
  box-shadow: 0 0 0 2px rgba(88,166,255,0.4);
}
.uxq-td-title:empty::before { content: attr(placeholder); color: var(--text-muted); }
/* Two-column layout */
.uxq-td-cols {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.uxq-td-main {
  flex: 1 1 0; min-width: 0; overflow-y: auto;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 16px;
}
.uxq-td-sidebar {
  flex: 0 0 280px; overflow-y: auto; padding: 14px 14px;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 16px;
  background: rgba(139,148,158,0.03);
}
/* Narrow viewports: the fixed 280px sidebar squeezed the main column
   (timeline, full prompt) into an unreadable sliver next to it — stack
   Activity above Properties/Assignment/Origin instead of side by side. */
@media (max-width: 640px) {
  /* CCC-1230: the fixed overlay skips body's safe-area padding, so under the
     translucent iOS status bar the top bar (close x, zoom, ref) sat behind
     the clock; 100vh also overshot the visible screen. Inset the overlay
     and let the card fill it. */
  .uxq-td-overlay {
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    align-items: stretch;
  }
  .uxq-td-card { width: 100vw; max-height: 100%; height: 100%; border-radius: 0; }
  .uxq-td-cols { flex-direction: column; overflow-y: auto; }
  .uxq-td-main { overflow-y: visible; }
  .uxq-td-sidebar {
    flex: 0 0 auto; width: auto; overflow-y: visible;
    border-left: none; border-top: 1px solid var(--border);
  }
}
/* Sections */
.uxq-td-sec { display: flex; flex-direction: column; gap: 6px; }
.uxq-td-sec-label {
  font: 600 10px var(--font-ui); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted); padding-bottom: 2px; border-bottom: 1px solid var(--border);
}
/* Full prompt */
.uxq-td-prompt {
  font: 12px var(--font-mono, ui-monospace, monospace);
  color: var(--text); background: rgba(139,148,158,0.06);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 200px; overflow-y: auto;
}
/* Images */
.uxq-td-images { display: flex; flex-wrap: wrap; gap: 8px; }
.uxq-td-img-wrap { display: inline-block; }
.uxq-td-img {
  max-width: 100%; max-height: 200px; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer;
  transition: opacity 0.15s; display: block;
}
.uxq-td-img:hover { opacity: 0.85; }
/* Timeline */
.uxq-timeline { display: flex; flex-direction: column; gap: 0; }
.uxq-tl-evt {
  display: flex; gap: 12px; position: relative;
}
.uxq-tl-evt:not(:last-child) .uxq-tl-node::after {
  content: ''; position: absolute; left: 5px; top: 13px;
  width: 2px; background: var(--border); bottom: 0;
}
.uxq-tl-node {
  flex: 0 0 12px; position: relative; display: flex;
  flex-direction: column; align-items: center;
  padding-top: 3px;
}
.uxq-tl-dot {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border);
  background: var(--surface); flex-shrink: 0; z-index: 1;
}
.uxq-tl-filed   .uxq-tl-dot { border-color: var(--text-muted); background: var(--bg); }
.uxq-tl-claimed .uxq-tl-dot { border-color: var(--accent); background: var(--accent); }
.uxq-tl-blocked .uxq-tl-dot { border-color: #f59e0b; background: #f59e0b; }
.uxq-tl-progress .uxq-tl-dot { border-color: #94a3b8; background: #94a3b8; }
.uxq-tl-answer  .uxq-tl-dot { border-color: #4ade80; background: #4ade80; }
.uxq-tl-closed  .uxq-tl-dot { border-color: #4ade80; background: #4ade80; }
.uxq-tl-reopen  .uxq-tl-dot { border-color: #a78bfa; background: #a78bfa; }
.uxq-tl-comment .uxq-tl-dot { border-color: #38bdf8; background: #38bdf8; }
.uxq-tl-edit    .uxq-tl-dot { border-color: #64748b; background: var(--surface); }
.uxq-tl-move    .uxq-tl-dot { border-color: #f97316; background: #f97316; }
.uxq-tl-open    .uxq-tl-dot { border-color: var(--text-muted); background: var(--surface); }
.uxq-timeline:not(.uxq-show-edits) .uxq-tl-edit { display: none; }
.uxq-show-edits {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font: 500 11px var(--font-ui); color: var(--text-muted); text-transform: none;
  letter-spacing: 0; cursor: pointer;
}
.uxq-show-edits input { margin: 0; }
.uxq-tl-body { flex: 1; min-width: 0; padding: 0 0 14px; }
.uxq-tl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 18px; }
.uxq-tl-verb { font: 600 13px var(--font-ui); color: var(--text); }
.uxq-tl-time {
  font: 11px var(--font-ui); color: var(--text-muted); cursor: default;
}
.uxq-tl-worker {
  font: 600 11px var(--font-mono, ui-monospace, monospace);
  color: var(--accent); background: rgba(88,166,255,0.10);
  padding: 1px 5px; border-radius: 3px;
}
.uxq-tl-meta { font: 11px var(--font-ui); color: var(--text-muted); }
.uxq-tl-tag {
  font: 600 10px var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); background: rgba(139,148,158,0.12);
  padding: 1px 6px; border-radius: 3px;
}
.uxq-tl-inline-badge {
  font: 600 10px var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 10px; border: 1px solid currentColor;
}
.uxq-tl-ib-waiting { color: #f59e0b; border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
.uxq-tl-ib-done    { color: #4ade80; border-color: rgba(74,222,128,0.4); }
.uxq-tl-detail {
  margin-top: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.uxq-tl-block-q {
  font: 13px var(--font-ui); color: var(--text); line-height: 1.5;
  background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.25);
  border-radius: 6px; padding: 7px 10px;
}
.uxq-tl-sub-label {
  font: 600 10px var(--font-ui); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); margin-top: 4px;
}
.uxq-tl-sub-note {
  font: 12px var(--font-ui); color: var(--text);
  background: rgba(139,148,158,0.06); border-radius: 5px; padding: 4px 8px;
}
.uxq-tl-sub-answer { background: rgba(74,222,128,0.06); color: var(--text); }
.uxq-tl-edit-fields {
  font: 12px var(--font-mono, ui-monospace, monospace);
  color: var(--text-muted); background: rgba(100,116,139,0.08);
  border-radius: 5px; padding: 5px 8px;
}
.uxq-tl-edit-fields span { color: var(--text); }
.uxq-tl-session-btn {
  font: 600 11px var(--font-ui); color: var(--accent); background: rgba(88,166,255,0.10);
  border: 1px solid rgba(88,166,255,0.25); border-radius: 4px;
  padding: 2px 8px; cursor: pointer;
}
.uxq-tl-session-btn:hover { background: rgba(88,166,255,0.2); }
/* Resolution block inside timeline */
.uxq-tl-res { display: flex; flex-direction: column; gap: 5px; }
.uxq-tl-res-row {
  display: flex; gap: 10px; font-size: 13px; line-height: 1.45;
}
.uxq-tl-res-k {
  flex: 0 0 74px; font-weight: 600; color: var(--text-muted); font-size: 12px;
}
.uxq-tl-res-v { color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
/* Caveat/follow-up/unresolved chips — one per resolution entry, each with an
   ack toggle (parity with WatchTower's own dashboard: queue.ack_resolution /
   is_acked, CCC-997). An acked chip dims + strikes through instead of
   disappearing: the text stays, only the visual alarm clears. */
.uxq-tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.uxq-tl-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; line-height: 1.3; border-radius: 5px;
  padding: 3px 8px; background: rgba(245,158,11,0.10); color: #f59e0b;
}
.uxq-tl-chip.follow { background: rgba(88,166,255,0.10); color: var(--accent); }
.uxq-tl-chip.unresolved { background: rgba(248,113,113,0.10); color: #f87171; }
.uxq-tl-chip.is-acked { background: rgba(255,255,255,0.04); color: var(--text-muted); }
.uxq-tl-chip.is-acked .uxq-tl-chip-v { text-decoration: line-through; }
.uxq-tl-chip-k { font-weight: 600; opacity: 0.85; }
.uxq-tl-chip-v { overflow-wrap: anywhere; }
.uxq-ack-btn {
  border: 1px solid rgba(255,255,255,0.15); background: transparent; color: inherit; opacity: 0.75;
  cursor: pointer; font-size: 11px; line-height: 1.4; padding: 1px 6px; border-radius: 3px;
  margin-left: 4px; white-space: nowrap;
}
.uxq-ack-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.uxq-ack-btn:disabled { opacity: 0.35; cursor: default; }
.uxq-ack-btn.is-acked-btn { border-color: transparent; }
/* Expand a single chip's note into a bigger, more readable modal (CCC-1023) */
.uxq-note-expand-btn {
  border: 1px solid rgba(255,255,255,0.15); background: transparent; color: inherit; opacity: 0.75;
  cursor: pointer; font-size: 12px; line-height: 1; padding: 1px 6px; border-radius: 3px;
  margin-left: 4px;
}
.uxq-note-expand-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }
/* Answer section */
.uxq-td-answer-sec { border: 1px solid rgba(245,158,11,0.3); border-radius: 8px; padding: 12px; background: rgba(245,158,11,0.05); }
.uxq-answer-row { display: flex; gap: 6px; margin: 3px 0 2px; }
.uxq-answer-input {
  flex: 1 1 auto; min-width: 0; font-size: 13px;
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.uxq-answer-input:focus { outline: none; border-color: var(--accent); }
.uxq-answer-send { flex: 0 0 auto; }
.uxq-td-answer-hint { font: 11px var(--font-ui); color: var(--text-muted); margin-top: 4px; }
.uxq-td-answer-hint code { font-family: var(--font-mono, ui-monospace, monospace); }
/* Sidebar property groups */
.uxq-td-pg { display: flex; flex-direction: column; gap: 5px; }
.uxq-td-pg-label {
  font: 700 10px var(--font-ui); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted); padding-bottom: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 1px;
}
.uxq-td-pr {
  display: flex; align-items: center; gap: 6px; min-height: 26px;
}
.uxq-td-pr-k {
  flex: 0 0 74px; font: 500 11px var(--font-ui); color: var(--text-muted);
}
.uxq-td-pr-v { font: 12px var(--font-ui); color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.uxq-td-pr-time { font: 11px var(--font-ui); color: var(--text-muted); }
.uxq-td-pr-empty { font: italic 11px var(--font-ui); color: var(--text-muted); opacity: 0.6; }
.uxq-td-ps {
  flex: 1; font: 12px var(--font-ui); color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 6px; outline: none; cursor: pointer;
}
.uxq-td-ps:hover { border-color: var(--accent); }
.uxq-td-ps:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(88,166,255,0.25); }
.uxq-td-session-btn {
  font: 600 11px var(--font-ui); color: var(--accent);
  background: rgba(88,166,255,0.10); border: 1px solid rgba(88,166,255,0.3);
  border-radius: 5px; padding: 3px 9px; cursor: pointer;
}
.uxq-td-session-btn:hover { background: rgba(88,166,255,0.2); }
.uxq-td-learnings-btn {
  font: 600 11px var(--font-ui); color: var(--accent);
  background: rgba(88,166,255,0.10); border: 1px solid rgba(88,166,255,0.3);
  border-radius: 5px; padding: 3px 9px; cursor: pointer;
}
.uxq-td-learnings-btn:hover { background: rgba(88,166,255,0.2); }
.uxq-td-comment-input {
  width: 100%; box-sizing: border-box; resize: vertical;
  font: 13px var(--font-ui); padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.uxq-td-comment-input:focus { outline: none; border-color: var(--accent); }
.uxq-td-worker-id {
  font: 600 11px var(--font-mono, ui-monospace, monospace);
  color: var(--accent); background: rgba(88,166,255,0.08); padding: 1px 5px; border-radius: 3px;
}
.uxq-td-link { color: var(--accent); word-break: break-all; font-size: 11px; }
.uxq-td-link:hover { text-decoration: underline; }
.uxq-td-mono { font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; color: var(--text-muted); word-break: break-all; }
/* Footer */
.uxq-td-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--border);
  background: rgba(139,148,158,0.04); flex-shrink: 0;
}
.uxq-td-footer-meta { font: 11px var(--font-ui); color: var(--text-muted); }
.uxq-td-footer-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Reopen / Mark-as-closed sections (CCC-422/423): real textareas in the main
   column next to Activity — the old Reopen control squeezed a single-line
   input into the footer button row, which had almost no width to work with,
   and there was no "mark as closed with a note" affordance at all. Mirrors
   the Answer section's box treatment so both read as "still actionable". */
.uxq-td-reopen-sec, .uxq-td-close-sec { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: rgba(139,148,158,0.05); }
.uxq-td-reopen-input, .uxq-td-mark-closed-input {
  width: 100%; min-height: 60px; padding: 8px 10px; font: 13px var(--font-ui);
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text);
  resize: vertical; box-sizing: border-box;
}
.uxq-td-reopen-input:focus, .uxq-td-mark-closed-input:focus { outline: none; border-color: var(--accent); }
.uxq-reopen-row { display: flex; justify-content: flex-end; margin-top: 8px; }

.fq-empty { padding: 12px 10px; font-size: 13px; color: var(--text-muted); }
.fq-history-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-top: 1px solid rgba(139,148,158,0.10);
  border-bottom: 1px solid rgba(139,148,158,0.10);
  color: var(--text-muted); font-size: 11px;
}
.fq-history-pager button {
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 8px;
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
}
.fq-history-pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.fq-history-pager button:disabled { opacity: 0.4; cursor: default; }
.fq-add-row {
  width: 100%; border: 0; border-bottom: 1px solid rgba(139,148,158,0.08);
  padding: 8px 10px; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
}
.fq-add-row:hover, .fq-add-row:focus-visible {
  color: var(--accent); background: var(--surface-hover); outline: none;
}
.fq-create-session-queue-wrap {
  flex: 1 0 auto; min-height: 32px; display: flex; align-items: center; justify-content: center;
  padding: 12px 10px;
}
.fq-create-session-queue {
  border: 1px dashed var(--border); border-radius: 6px; padding: 6px 12px;
  background: transparent; color: var(--text-muted); font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.fq-create-session-queue:hover, .fq-create-session-queue:focus-visible {
  color: var(--accent); border-color: var(--accent); background: var(--surface-hover); outline: none;
}
.fq-empty-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--faint, var(--text-muted));
}
.fq-ticket-dialog {
  width: min(640px, 94vw);
}
/* CCC-129: the global ticket composer docks to the left and barely dims, so
   the conversation it is about stays visible while typing. */
.fq-ticket-composer.upd-overlay {
  justify-content: flex-start;
  padding-left: 24px;
}
.fq-ticket-composer > .upd-backdrop {
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: none;
}
@media (max-width: 700px) {
  .fq-ticket-composer.upd-overlay { justify-content: center; padding-left: 0; }
}
.fq-ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* CCC-214: the ticket composer moves by dragging its header. */
.fq-ticket-composer .fq-ticket-header {
  cursor: move;
  touch-action: none;
  user-select: none;
}
.fq-ticket-composer .fq-ticket-close { cursor: pointer; }
.fq-ticket-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.fq-ticket-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.fq-ticket-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fq-ticket-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.fq-ticket-textarea {
  width: 100%;
  min-height: 150px;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  /* Pin the content box so the pill is the same 22px tall as q2's, whose
     font resolves to a 14px line box. `normal` differs between the two
     stacks and left this 2px taller. */
  line-height: 14px;
}
.fq-ticket-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.14);
}
/* + file picker in the New queue ticket modal, styled like the composer's. */
.fq-ticket-actions .fq-ticket-attach-btn {
  width: 32px; height: 32px; flex-shrink: 0; margin-right: auto;
  border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
  background: transparent; color: var(--text-muted);
  line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.fq-ticket-actions .fq-ticket-attach-btn:hover { background: var(--surface-2); color: var(--text); }
.fq-ticket-actions .fq-ticket-attach-btn svg { display: block; }
.fq-ticket-hide-keyboard { display: none; }
@media (max-width: 700px), (pointer: coarse) {
  /* iOS keeps the layout viewport full-height when the keyboard opens.
     Share the chat shell's visual viewport bounds, including Safari panning. */
  .fq-ticket-composer.upd-overlay {
    top: var(--app-vv-top, 0px);
    bottom: auto;
    height: var(--app-vh, 100dvh);
    padding: 12px;
    box-sizing: border-box;
    justify-content: center;
  }
  .fq-ticket-composer .fq-ticket-dialog {
    box-sizing: border-box;
    width: min(640px, 100%);
    max-height: 100%;
    padding: 12px;
    gap: 10px;
    overflow: hidden;
    /* A desktop drag must not carry outside the viewport after rotation. */
    transform: none !important;
  }
  .fq-ticket-composer .fq-ticket-header,
  .fq-ticket-composer .fq-ticket-actions { flex-shrink: 0; }
  .fq-ticket-composer .fq-ticket-header {
    gap: 6px;
    cursor: default;
    touch-action: auto;
  }
  .fq-ticket-composer .fq-ticket-header .upd-title { flex: 1; min-width: 0; }
  .fq-ticket-hide-keyboard { display: block; min-height: 44px; padding: 8px; font-size: 12px; }
  .fq-ticket-composer .fq-ticket-close { width: 44px; height: 44px; flex-shrink: 0; }
  .fq-ticket-composer .fq-ticket-body { min-height: 0; overflow-y: auto; padding: 3px; }
  .fq-ticket-composer .fq-ticket-textarea { min-height: 90px; flex-shrink: 0; font-size: 16px; line-height: 1.4; }
  .fq-ticket-composer .fq-ticket-queue-select { flex-shrink: 0; font-size: 16px; }
  .fq-ticket-composer .fq-ticket-actions .upd-btn { min-height: 44px; }
  .fq-ticket-composer .fq-ticket-attach-btn { width: 44px; height: 44px; }
}
.files-queue-configure { font-size: 14px; }

/* Plan-to-fleet import dialog (W51). Flat preview list, never a Kanban. */
.fq-import-dialog { width: min(680px, 94vw); max-height: min(800px, 90vh); overflow: auto; }
.fq-import-body { gap: 12px; display: flex; flex-direction: column; }
.fq-import-preview {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px;
  max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
.fq-import-summary { font-size: 12px; font-weight: 650; color: var(--text-muted); padding: 2px 4px 6px; }
.fq-import-summary.fq-import-error { color: var(--danger, #f85149); }
.fq-import-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px;
  border-radius: 6px; font-size: 12px; min-width: 0;
}
.fq-import-row:hover { background: var(--surface-hover); }
.fq-import-row.is-exists { opacity: 0.62; }
.fq-import-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); flex: 0 0 auto; min-width: 42px;
}
.fq-import-row.is-new .fq-import-status { color: var(--accent); }
.fq-import-row.is-filed .fq-import-status { color: var(--success, #3fb950); }
.fq-import-kind {
  font-size: 10px; font-weight: 650; padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); flex: 0 0 auto;
}
.fq-import-kind-feature { color: var(--accent); border-color: var(--accent); }
.fq-import-ttl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.fq-import-ref { font-size: 11px; font-weight: 650; color: var(--success, #3fb950); flex: 0 0 auto; }
.fq-import-src { font-size: 10px; color: var(--faint, var(--text-muted)); flex: 0 0 auto; }
.fq-import-dep { font-size: 10px; color: var(--text-muted); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fq-import-fleet { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fq-import-fleet-head { font-size: 12px; color: var(--text-muted); }
.fq-import-fleet-row { display: flex; align-items: center; gap: 8px; }
.fq-import-fleet-row input[type="number"] { width: 64px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); padding: 6px 8px; font: inherit; }

.fq-config-dialog { width: min(760px, 94vw); max-height: min(780px, 88vh); overflow: auto; }
.fq-config-body { gap: 6px; }
.fq-config-section { padding: 10px 0; border-bottom: 1px solid var(--border); }
.fq-config-section:last-of-type { border-bottom: none; }
.fq-config-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px;
}
.fq-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.fq-config-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fq-config-field.wide { grid-column: 1 / -1; }
.fq-config-field label { font-size: 12px; font-weight: 650; color: var(--text-muted); }
.fq-config-field input, .fq-config-field select { min-width: 0; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); padding: 7px 8px; font: inherit; }
.fq-config-field input:focus, .fq-config-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,0.14); }
.fq-config-help { color: var(--faint, var(--text-muted)); font-size: 11px; line-height: 1.35; }
.fq-config-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; }
.fq-config-checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); }
.fq-config-github[hidden] { display: none; }
/* Segmented pickers (engine / backend) — settings-modal visual language. */
.fq-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 8px; width: fit-content; }
.fq-seg button {
  border: none; background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}
.fq-seg button:hover { color: var(--text); }
.fq-seg button.is-active { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.fq-config-checkrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.fq-config-checkrow-label { font-size: 12.5px; color: var(--text); }

/* Queue-health strip: one glanceable line per project with open tickets,
   above the ticket list. Wraps gracefully at narrow widths. */
/* WatchTower error strip: sits above everything else in the Queue panel so a
   worker that failed to launch (usage limit, auth, API down) or a dead daemon
   is the first thing seen. Red left rail + tinted background so it reads as
   an alert, not another queue row. Each row acks individually; the header
   acks all. Hidden ([hidden]) when there is nothing un-acked. */
.fq-alerts {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 10px 9px 12px;
  background: rgba(248,81,73,0.07);
  border-bottom: 1px solid rgba(248,81,73,0.35);
  box-shadow: inset 3px 0 0 var(--red, #f85149);
  /* ~head + one row; more errors scroll instead of pushing the ticket list off-screen. */
  max-height: min(112px, 20vh); overflow-y: auto;
}
.fq-alerts[hidden] { display: none; }
.fq-alerts-head {
  display: flex; align-items: center; gap: 8px; padding-bottom: 2px;
}
.fq-alerts-dot {
  flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red, #f85149);
  box-shadow: 0 0 0 0 rgba(248,81,73,0.6);
  animation: fqAlertPulse 1.6s ease-out infinite;
}
@keyframes fqAlertPulse {
  0% { box-shadow: 0 0 0 0 rgba(248,81,73,0.55); }
  100% { box-shadow: 0 0 0 7px rgba(248,81,73,0); }
}
.fq-alerts-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em;
  color: var(--red, #f85149); white-space: nowrap; flex: 0 0 auto;
}
.fq-alerts-summary {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; color: var(--text-muted);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fq-alerts-ack-all {
  margin-left: auto; flex: 0 0 auto;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 8px; border-radius: 999px; cursor: pointer;
  color: var(--text-muted); background: rgba(139,148,158,0.10);
  border: 1px solid rgba(139,148,158,0.22);
}
.fq-alerts-ack-all:hover { color: var(--text); border-color: rgba(139,148,158,0.45); }
.fq-alert-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; border-radius: 6px; min-width: 0;
  background: rgba(13,17,23,0.55); border: 1px solid rgba(248,81,73,0.22);
  cursor: pointer; transition: border-color .12s;
}
.fq-alert-row:hover { border-color: rgba(248,81,73,0.55); }
.fq-alert-row.is-warning { border-color: rgba(210,153,34,0.28); }
.fq-alert-row.is-warning:hover { border-color: rgba(210,153,34,0.6); }
.fq-alert-sev {
  flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 4px;
  background: var(--red, #f85149);
}
.fq-alert-row.is-warning .fq-alert-sev { background: var(--yellow, #d29922); }
.fq-alert-row.is-critical .fq-alert-sev { box-shadow: 0 0 0 2px rgba(248,81,73,0.35); }
.fq-alert-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fq-alert-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.fq-alert-queue {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; flex: 0 0 auto;
}
.fq-alert-title {
  font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3;
  min-width: 0; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.fq-alert-detail {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; color: var(--text-muted);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue-wrap-titles .fq-alert-title { -webkit-line-clamp: unset; }
.queue-wrap-titles .fq-alert-detail { white-space: normal; overflow: visible; }
.fq-alert-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; color: var(--text-muted); white-space: nowrap;
  flex: 0 0 auto; margin-left: auto;
}
.fq-alert-count {
  font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 999px;
  background: rgba(248,81,73,0.18); color: var(--red, #f85149);
}
.fq-alert-row.is-warning .fq-alert-count { background: rgba(210,153,34,0.18); color: var(--yellow, #d29922); }
.fq-alert-ack {
  flex: 0 0 auto; width: 22px; height: 22px; margin: -2px -2px -2px 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--text-muted); font-size: 13px; line-height: 1; cursor: pointer;
}
.fq-alert-ack:hover {
  color: var(--green, #3fb950); background: rgba(63,185,80,0.14);
  border-color: rgba(63,185,80,0.35);
}
.fq-alert-investigate {
  flex: 0 0 auto; align-self: flex-start; margin: 0 4px 0 0; padding: 2px 8px;
  border: 1px solid rgba(139,148,158,0.35); border-radius: 999px; background: transparent;
  color: var(--text-muted); font-size: 11px; line-height: 1.4; cursor: pointer;
}
.fq-alert-investigate:hover:not(:disabled) { color: var(--text); border-color: rgba(139,148,158,0.7); }
.fq-alert-investigate:disabled { opacity: 0.6; cursor: default; }
.fq-alert-row.is-acking { opacity: 0.35; pointer-events: none; }

.fq-health {
  flex: 0 0 auto;
  display: flex; flex-direction: column;
  overflow-y: auto;
  /* Default cap: ~3 queue rows (scrolls beyond that) so many configured
     queues can't starve the ticket list below. A height the user dragged via
     #queueHealthResizeHandle is applied inline and overrides this. */
  max-height: min(96px, 18vh);
  border-bottom: 1px solid rgba(139,148,158,0.14);
}
.fq-health:empty { display: none; }
.fq-health:empty + .fq-health-resize-handle { display: none; }

/* CCC-781: "Show queue list on RHS" off — hide the multi-queue health list
   and its resize handle; the compact single-queue status strip (below)
   stands in for it above the ticket list instead. */
.queue-rhs-list-off #queueHealthStrip,
.queue-rhs-list-off #queueHealthResizeHandle { display: none; }

/* Compact single-queue status strip: auto-drain state + live worker(s) and
   what they're claimed on, for the queue currently selected in the scope
   dropdown. Stands in for the full q2.html flow diagram, which assumes a
   440px-wide column the rail doesn't have. */
.fq-status-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(139,148,158,0.14);
  font-size: 11px; color: var(--text-muted);
}
.fq-status-strip[hidden] { display: none; }
/* CCC-789 follow-up: the strip's first line is now the SAME live controls
   the full health-strip row has (gear/drain-toggle/claim-cycle), not just a
   read-only "Auto-drain off" label — this compact view is the only queue
   summary visible when the RHS health list is off, so it needs a real path
   to change auto-drain/claim-types, not just observe them. */
/* Bigger, clearer gear than the dense health-row's hover-only version — this
   strip is the only queue summary on screen, so the settings entry point
   should read as an obvious button, not a barely-there row accent. The base
   .fq-health-config rule sets opacity:0 and color:var(--text-muted) for its
   hover-reveal-on-row behavior; both are overridden here (not just opacity)
   since muted-gray glyph on a muted-gray background read as invisible. */
.fq-status-strip .fq-health-config {
  opacity: 1 !important; font-size: 22px;
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text) !important;
  background: rgba(139,148,158,0.16);
  border: 1px solid rgba(139,148,158,0.30);
}
.fq-status-strip .fq-health-config:hover {
  color: var(--accent) !important;
  background: rgba(88,166,255,0.18); border-color: rgba(88,166,255,0.45);
}
.fq-status-proj { font-weight: 600; color: var(--text); }
.fq-status-sep { color: var(--faint, var(--text-muted)); opacity: 0.7; }
.fq-status-depth, .fq-status-age { color: var(--text-muted); }
.fq-status-live {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(63,185,80,0.15); color: var(--green, #3fb950);
}
.fq-status-learnings-toggle, .fq-status-workers-toggle, .fq-status-log-toggle {
  flex-shrink: 0; cursor: pointer;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(139,148,158,0.10); color: var(--text-muted);
  border: 1px solid rgba(139,148,158,0.18);
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.fq-status-learnings-toggle:hover, .fq-status-workers-toggle:hover, .fq-status-log-toggle:hover {
  background: rgba(139,148,158,0.18); border-color: rgba(139,148,158,0.30);
}
.fq-status-synced { flex-shrink: 0; color: var(--faint, var(--text-muted)); opacity: 0.75; white-space: nowrap; }
/* CCC-1036: effective worker plan (engine · model · effort). Mono so the
   model id reads as an identifier; muted when it's only the CCC default. */
.fq-status-plan {
  flex-shrink: 0; cursor: pointer;
  font: 500 10.5px/1.4 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.01em;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(88,166,255,0.10); color: var(--text);
  border: 1px solid rgba(88,166,255,0.28);
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.fq-status-plan.is-default { color: var(--text-muted); background: rgba(139,148,158,0.10); border-color: rgba(139,148,158,0.18); }
.fq-status-plan:hover { background: rgba(88,166,255,0.18); border-color: rgba(88,166,255,0.45); color: var(--text); }
.fq-status-refresh-toggle {
  flex-shrink: 0; cursor: pointer;
  font-size: 12px; line-height: 1; padding: 1px 6px; border-radius: 999px;
  background: rgba(139,148,158,0.10); color: var(--text-muted);
  border: 1px solid rgba(139,148,158,0.18);
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.fq-status-refresh-toggle:hover:not(:disabled) {
  background: rgba(139,148,158,0.18); border-color: rgba(139,148,158,0.30);
  color: var(--text);
}
.fq-status-refresh-toggle:disabled { opacity: 0.4; cursor: not-allowed; }
.fq-status-refresh-toggle[aria-busy="true"] { animation: fq-status-refresh-spin 0.8s linear infinite; }
@keyframes fq-status-refresh-spin { to { transform: rotate(360deg); } }
/* Non-blocking degraded-sync banner (GitHub-backed queues only): the
   GraphQL quota ran out, the panel is showing the last snapshot it had. */
.fq-status-sync-notice {
  flex-basis: 100%; order: -1;
  font-size: 11px; color: var(--yellow, #d29922);
  background: rgba(210,153,34,0.12);
  border: 1px solid rgba(210,153,34,0.28);
  border-radius: 6px;
  padding: 4px 8px;
}
/* OPS-938: persistent per-queue alarm banner (stuck / no effective worker /
   invalid worker config). Sits above the status strip until health clears —
   deliberately NOT a transient toast. */
.fq-queue-alarm {
  flex-basis: 100%; order: -2;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.45;
}
.fq-queue-alarm.is-error {
  color: var(--red, #f85149);
  background: rgba(248,81,73,0.10);
  border: 1px solid rgba(248,81,73,0.40);
}
.fq-queue-alarm.is-warn {
  color: #f0c24b;
  background: rgba(210,153,34,0.14);
  border: 1px solid rgba(210,153,34,0.35);
}
.fq-queue-alarm-title {
  font-weight: 700;
  margin-bottom: 2px;
}
.fq-queue-alarm-line {
  /* Readable body text: --text-muted washed out on the tinted alarm
     background (near-invisible on dark themes). */
  color: var(--text, #e6edf3);
  font-size: 12px;
}
.fq-queue-alarm-actions {
  display: flex; gap: 8px;
  margin-top: 6px;
}
.fq-queue-alarm-btn {
  font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid currentColor;
  background: transparent; color: inherit;
}
.fq-queue-alarm-btn:hover:not(:disabled), .fq-queue-alarm-btn:focus-visible {
  background: rgba(255,255,255,0.08); outline: none;
}
.fq-queue-alarm-btn:disabled { opacity: 0.5; cursor: default; }

.fq-health-add {
  width: 100%; border: 0; border-top: 1px solid rgba(139,148,158,0.12);
  padding: 7px 10px; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
}
.fq-health-add:hover, .fq-health-add:focus-visible {
  color: var(--accent); background: var(--surface-hover); outline: none;
}
/* Drag bar between the per-project health rows and the ticket list below
   (CCC-426) — the health list can otherwise grow to fill the whole panel
   when many queues are configured, starving the ticket list of room. */
.fq-health-resize-handle {
  flex: 0 0 auto;
  position: relative;
  height: 24px; margin: -1px 0; cursor: ns-resize;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none;
  background: transparent;
  transition: background 0.12s;
}
.fq-health-resize-grip {
  display: block;
  width: 40px; height: 3px; border-radius: 2px;
  background: rgba(139,148,158,0.45);
  transition: background 0.12s, width 0.12s;
}
.fq-health-resize-handle:hover .fq-health-resize-grip,
.fq-health-resize-handle.is-dragging .fq-health-resize-grip {
  background: var(--accent);
  width: 60px;
}
.fq-health-resize-handle .evergreen-log-btn {
  position: absolute;
  right: 8px;
  font-family: inherit;
  line-height: 1.3;
}
.fq-health-resize-handle:hover,
.fq-health-resize-handle.is-dragging {
  background: rgba(88,166,255,0.08);
}
.fq-health-row {
  /* Wrap instead of crushing the queue name to nothing (CCC-770): the badge
     + auto-drain + claim-type pills are fixed-width chrome that, combined
     with the icon buttons, can exceed a narrow rail's width on their own —
     they fall to a second line rather than taking space from the name. */
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  padding: 5px 10px; font-size: 12.5px; line-height: 1.3;
  border-bottom: 1px solid rgba(139,148,158,0.06);
  cursor: pointer; user-select: none;
}
.fq-health-row:hover { background: rgba(139,148,158,0.06); }
.fq-health-row:last-child { border-bottom: none; }
.fq-health-group {
  border-bottom: 1px solid rgba(139,148,158,0.06);
}
.fq-health-group > .fq-health-row { border-bottom: 0; }
.fq-health-worker-list {
  padding: 0 8px 5px 20px;
  background: rgba(139,148,158,0.025);
}
.fq-health-worker-list .conv-evergreen-worker-fallback {
  padding: 3px 4px;
  cursor: default;
}
.fq-health-worker-list [data-fq-worker-sid],
.fq-health-worker-list .cepw-row[data-cepw-sid] { cursor: pointer; }
.fq-health-worker-list [data-fq-worker-sid]:hover,
.fq-health-worker-list .cepw-row[data-cepw-sid]:hover { background: rgba(88,166,255,0.10); }
.wt-worker-session-meta {
  margin-left: auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted); opacity: 0.72; font-size: 10px;
}
.fq-health-worker-list .conv-evergreen-past-workers {
  padding: 4px 4px 0;
}
.fq-health-del {
  flex: 0 0 auto; width: 14px; height: 14px; margin-right: 1px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted);
  font-size: 13px; line-height: 1; padding: 0; border-radius: 3px;
  cursor: pointer; opacity: 0; transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.fq-health-row:hover .fq-health-del { opacity: 0.6; }
.fq-health-del:hover { opacity: 1 !important; background: rgba(248,81,73,0.18); color: var(--red, #f85149); }
.fq-health-del.is-disabled { cursor: not-allowed; }
.fq-health-del.is-disabled:hover { background: transparent; color: var(--text-muted); opacity: 0.6 !important; }
.fq-health-config { flex: 0 0 auto; border: 0; background: transparent; color: var(--text-muted); padding: 0 2px; cursor: pointer; opacity: 0; font-size: 12px; }
.fq-health-row:hover .fq-health-config { opacity: 0.7; }
.fq-health-config:hover { opacity: 1 !important; color: var(--accent); }
.fq-health-proj {
  font-weight: 600; color: var(--text);
  /* The queue name is the primary thing read in this row (CCC-770) — give it
     first claim on space instead of splitting it evenly with the depth/age
     stats, which are secondary and already repeated in the row's title tip. */
  /* A floor, not just a ceiling: without it the name shrinks to near-nothing
     before the badge/drain/claim pills give up their line-1 spot, since they
     are fixed-width and the name is the only flexible item. */
  flex: 1 1 0; min-width: 64px; max-width: 50%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fq-health-sep { color: var(--faint, var(--text-muted)); opacity: 0.7; flex-shrink: 0; }
.fq-health-depth,
.fq-health-age {
  color: var(--text-muted); flex: 0 1 auto; flex-shrink: 1; min-width: 0; max-width: 22%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fq-health-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 1px 7px; border-radius: 999px;
}
.fq-health-badge.is-live {
  background: rgba(63,185,80,0.15); color: var(--green, #3fb950);
}
.fq-health-badge.is-stuck {
  background: rgba(248,81,73,0.18); color: var(--red, #f85149);
}
.fq-health-badge.is-waiting {
  background: rgba(210,153,34,0.16); color: var(--yellow, #d29922);
}
/* Drained-but-recently-active queue: calm neutral, not the active green of LIVE. */
.fq-health-badge.is-clear {
  background: rgba(139,148,158,0.14); color: var(--text-muted);
}
.fq-health-badge.is-nudgeable { cursor: pointer; }
.fq-health-badge.is-nudgeable:hover { background: rgba(248,81,73,0.30); }
.fq-health-drain-toggle {
  flex-shrink: 0; cursor: pointer;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(139,148,158,0.10); color: var(--text-muted);
  border: 1px solid rgba(139,148,158,0.18);
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.fq-health-drain-toggle:hover { background: rgba(139,148,158,0.18); border-color: rgba(139,148,158,0.30); }
.fq-health-drain-toggle.is-on {
  background: rgba(63,185,80,0.10); border-color: rgba(63,185,80,0.22);
  color: var(--green, #3fb950);
}
.fq-health-drain-toggle.is-on:hover { background: rgba(63,185,80,0.18); }
.fq-health-drain-toggle.is-pending {
  font-style: italic;
  pointer-events: none;
}
.fq-health-drain-toggle.is-pending::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: fq-drain-spin 0.7s linear infinite;
}
@keyframes fq-drain-spin { to { transform: rotate(360deg); } }
.fq-health-drain-val { font-weight: 700; }
.fq-health-type-toggle {
  flex-shrink: 0; cursor: pointer;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(139,148,158,0.10); color: var(--text-muted);
  border: 1px solid rgba(139,148,158,0.18);
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.fq-health-type-toggle:hover { background: rgba(139,148,158,0.18); border-color: rgba(139,148,158,0.30); }
.fq-health-type-toggle.is-restricted {
  background: rgba(210,153,34,0.12); border-color: rgba(210,153,34,0.28);
  color: var(--yellow, #d29922);
}
.fq-health-type-toggle.is-restricted:hover { background: rgba(210,153,34,0.20); }
.fq-health-type-val { font-weight: 700; }
.fq-health-clear {
  padding: 8px 10px; font-size: 12.5px;
  color: var(--green, #3fb950); opacity: 0.85;
}
/* Narrow widths: badge keeps right-aligned, the rest can wrap under it. */
@media (max-width: 420px) {
  .fq-health-row { font-size: 12px; }
  .fq-health-badge { margin-left: 0; }
}
/* Past workers (last 24h) — compact chip strip below live worker rows */
.conv-evergreen-past-workers {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 4px 10px 5px 24px;
  border-top: 1px solid rgba(139,148,158,0.08);
}
.cepw-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); opacity: 0.55; flex-shrink: 0; margin-right: 2px;
}
.cepw-row {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border-radius: 999px; font-size: 10.5px;
  background: rgba(139,148,158,0.08); color: var(--text-muted);
  border: 1px solid rgba(139,148,158,0.12);
  white-space: nowrap; cursor: default;
}
.cepw-id { opacity: 0.65; }
.cepw-age { font-weight: 600; opacity: 0.5; }

/* Draggable object-group headers in by-objects mode: above/below insert
   lines while reordering, accent ring while nesting. */
.conv-folder-group-header[draggable="true"] { cursor: grab; }
.conv-folder-group-header.dragging { opacity: 0.5; }
.conv-folder-group-header.drop-above { box-shadow: inset 0 2px 0 var(--accent, #58a6ff); }
.conv-folder-group-header.drop-below { box-shadow: inset 0 -2px 0 var(--accent, #58a6ff); }
.conv-folder-group-header.is-drop-target {
  outline: 1.5px solid var(--accent, #58a6ff);
  outline-offset: -1.5px;
  background: rgba(88,166,255,0.08);
}

/* Empty by-objects group: visible drop target with a quiet hint. */
.conv-object-empty-hint {
  padding: 8px 12px 10px 26px;
  font-size: 11.5px; color: var(--text-muted); font-style: italic;
  opacity: 0.7;
}
.conv-add-object .grouping-opt { color: var(--accent, #58a6ff); }

.flow-object-assign-row {
  display: block;
  width: 100%;
  padding: 8px 12px;
  padding-left: calc(12px + (var(--object-depth, 0) * 18px));
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.flow-object-assign-row:hover,
.flow-object-assign-row:focus-visible {
  background: rgba(88,166,255,0.10);
  outline: none;
}
.flow-object-assign-title {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flow-object-assign-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent, #58a6ff) 72%, var(--text-muted));
  vertical-align: middle;
  opacity: 0.85;
}
.flow-object-assign-path {
  margin-left: 13px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chooser emphasis (CCC-94): the active path is bright, the other dimmed. */
.ns-choice-card { transition: opacity 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.ns-choice-card.is-primary {
  border-color: var(--accent, #58a6ff);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.10);
}
.ns-choice-card.is-dimmed { opacity: 0.55; }
.ns-choice-card.is-dimmed:hover { opacity: 0.85; }

/* Join-link button in the group chat reader header (CCC-98). */
.gc-join-link-btn {
  margin-left: auto;
  padding: 3px 9px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-muted); font-size: 11.5px; cursor: pointer;
  white-space: nowrap;
}
.gc-join-link-btn:hover { color: var(--accent, #58a6ff); border-color: var(--accent, #58a6ff); }

/* ── Add-participant picker (CCC-97) ─────────────────────────────────── */
.gc-addpart-modal {
  position: fixed; inset: 0; z-index: 10010;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
}
.gc-addpart-card {
  width: min(480px, 92vw);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.gc-addpart-title { font-size: 13px; font-weight: 700; color: var(--text); }
.gc-addpart-search {
  width: 100%; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--accent, #58a6ff); background: var(--bg);
  color: var(--text); font-size: 13px; outline: none;
}
.gc-addpart-list { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.gc-addpart-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; color: var(--text);
}
.gc-addpart-row:hover { background: var(--surface-2); }
.gc-addpart-row.is-selected { background: rgba(88,166,255,0.14); outline: 1px solid rgba(88,166,255,0.4); }
.gc-addpart-emoji { flex: 0 0 auto; }
.gc-addpart-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-addpart-repo {
  flex: 0 0 auto; font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: rgba(139,148,158,0.15); color: var(--text-muted);
}
.gc-addpart-when { flex: 0 0 auto; font-size: 11px; color: var(--text-muted); }
.gc-addpart-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 12px; }
.conv-ingroupchat-addpart-btn {
  border: 0; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-muted); padding: 0 4px; line-height: 1;
}
.conv-ingroupchat-addpart-btn:hover { color: var(--accent, #58a6ff); }

/* ONE CWD field above the composer (CCC-102). The adopted spawn-cwd-row
   stretches full width and reads as "this is where the session starts". */
.ns-cwd-unified { width: 100%; max-width: 720px; }
.ns-cwd-unified .spawn-cwd-row { width: 100%; }
.ns-cwd-unified .spawn-cwd-row input#spawnCwdPicker {
  width: 100%; font-size: 13px;
  border-color: color-mix(in srgb, var(--accent, #58a6ff) 45%, var(--border) 55%);
}

/* Mobile swipe-to-rotate feedback pill (see wireConvSwipeRotate in app.js).
   Brief "‹ 2/4 ›" indicator on a recency switch, then fades out. */
.conv-swipe-pill {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 999px;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: opacity 140ms ease, transform 140ms ease;
}
.conv-swipe-pill.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Linux / headless: hide macOS-only desktop conveniences. Driven by body
   classes set in applyConfigToDom() from the server capabilities flag, so the
   server stub and the UI hide stay in lockstep. macOS keeps every control. */
.ccc-no-terminal-launch #jumpBtnConv,
.ccc-no-terminal-launch #launchChoiceBtnConv,
.ccc-no-terminal-launch #launchChoiceMenuConv,
.ccc-no-terminal-launch #cpJumpBtn,
.ccc-no-terminal-launch #cpLaunchChoiceBtn,
.ccc-no-terminal-launch #cpLaunchChoiceMenu {
  display: none !important;
}
.ccc-no-screenshots #bugReportShotSection {
  display: none !important;
}
.ccc-no-screenshots #annotationScreenBtn {
  display: none !important;
}
.ccc-no-annotate [data-flow-action="annotate"] {
  display: none !important;
}
/* Watchtower activity log panel — fills the conversation view */
.wt-log-panel {
  position: absolute; inset: 0;
  /* Confine to the pane's "conv" grid area (the reader region) so the panel
     fills the conversation area like any other session view and leaves the
     right-hand status rail — a sibling grid item in the "rail" column —
     visible. The pane is the containing block, so grid-area scopes inset:0 to
     that cell. Ignored harmlessly on the document.body fallback (not a grid). */
  grid-area: conv;
  background: var(--bg, #0d1117); color: var(--text);
  display: flex; flex-direction: column;
  z-index: 500;
}
.wt-log-panel-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; flex-shrink: 0;
  border-bottom: 1px solid rgba(139,148,158,0.14);
  background: rgba(139,148,158,0.06);
}
.wt-log-panel-title {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.wt-log-panel-path {
  font-size: 11px; color: var(--text-muted); opacity: 0.6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.wt-log-queue-select {
  flex-shrink: 0; font-size: 12px; padding: 2px 6px; border-radius: 4px;
  background: var(--bg, #0d1117); color: var(--text);
  border: 1px solid rgba(139,148,158,0.28); cursor: pointer;
}
.wt-log-panel-close {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; line-height: 1;
  padding: 2px 4px; border-radius: 4px; opacity: 0.7;
}
.wt-log-panel-close:hover { opacity: 1; background: rgba(248,81,73,0.15); color: var(--red, #f85149); }
.wt-log-panel-pre {
  flex: 1; margin: 0; padding: 10px 12px;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 13px; line-height: 1.6;
  overflow-y: auto;
  color: var(--text-muted);
}
.wl-row { display: flex; gap: 10px; align-items: baseline; min-width: 0; padding: 1px 0; }
/* Keep timestamp, queue, ticket, and verb in one compact metadata column.
   Fixed-width standalone cells left a wide empty gutter before every detail. */
.wl-meta { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: baseline; gap: 0 10px; min-width: 0; }
.wl-ts { flex: 0 0 auto; opacity: 0.45; cursor: default; white-space: nowrap; }
.wl-queue { flex: 0 1 auto; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
/* Ticket ref stays before the verb, but takes no space on reconciler rows. */
.wl-ref-col { flex: 0 1 auto; max-width: 124px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-verb { flex: 0 0 auto; white-space: nowrap; }
.wl-worker-col { flex: 0 1 96px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-worker-id { opacity: 0.6; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.92em; }
.wl-detail { flex: 1 1 260px; min-width: 0; opacity: 0.82; word-break: break-word; }
/* CCC-1238: no reserved gutter on rows without a worker id; the human
   sentence reads bold, its key=value fields sit dimmer on the line below. */
.wl-worker-col:empty { display: none; }
.wl-headline { font-weight: 600; color: var(--text); }
.wl-kv { opacity: 0.62; font-size: 0.92em; margin-left: 0.6em; }
.wl-kv.is-block { display: block; margin-left: 0; }
.wl-worker .wl-verb { color: #3fb950; font-weight: 600; }
.wl-reconciler .wl-verb { color: #d29922; font-weight: 600; }
.wl-queue-action .wl-verb { color: #58a6ff; }
.wl-ref { background: rgba(88,166,255,0.12); border-radius: 3px; padding: 0 3px; color: #79c0ff; font-weight: 500; }
/* Collapsed reconciler burst: the summary row's toggle chip and the expanded
   raw member rows (indented, dimmed — they're the audit detail, not the
   headline). */
.wl-burst-toggle {
  flex: 0 0 auto; align-self: baseline;
  font: inherit; font-size: 10px; line-height: 1.5;
  color: var(--text-muted);
  background: rgba(139,148,158,0.12);
  border: 1px solid rgba(139,148,158,0.28);
  border-radius: 8px; padding: 0 7px;
  cursor: pointer; white-space: nowrap;
}
.wl-burst-toggle:hover { background: rgba(139,148,158,0.24); color: var(--text); }
.wl-burst-children { margin: 1px 0 4px 16px; padding-left: 8px; border-left: 1px solid rgba(139,148,158,0.25); }
.wl-burst-children .wl-row { opacity: 0.68; }
/* Floating "jump to end" pill — mirrors .conv-scroll-end-btn, scoped to the
   log panel (which is position:absolute, so it anchors this button). */
.wt-log-end-btn {
  position: absolute; right: 20px; bottom: 20px; z-index: 12;
  height: 32px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.wt-log-end-btn.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.wt-log-end-btn:hover { border-color: var(--accent); background: var(--surface-2); }
.wt-log-end-btn svg { flex: none; }
/* Divider between issue items (ticket ref changes). Subtler than the labeled
   time-gap separator — a single faint rule that just chunks the stream. */
.wl-item-sep { height: 0; margin: 4px 0; border-top: 1px solid rgba(139,148,158,0.16); }
.wl-sep { margin: 5px 0; display: flex; align-items: center; gap: 6px; }
.wl-sep::before, .wl-sep::after { content: ''; flex: 1; height: 1px; background: rgba(139,148,158,0.18); }
.wl-sep-label { font-size: 10px; color: var(--text-muted); opacity: 0.35; white-space: nowrap; }

/* === Hero: Fleet Pulse === */
.ccc-hero {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 28%, rgba(110, 140, 175, 0.15), rgba(13, 17, 23, 0) 34%),
    #0d1117;
  color: #c9d1d9;
  font-family: var(--font-ui), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.ccc-hero.is-instant {
  transition: none;
}
.ccc-hero.is-visible {
  opacity: 1;
}
.ccc-hero.is-instant.is-exiting {
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.ccc-hero.is-exiting {
  opacity: 0;
  transform: scale(1.02);
}
.ccc-hero-glow {
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(57, 210, 192, 0.04), rgba(188, 140, 255, 0.03), rgba(110, 140, 175, 0.04)),
    radial-gradient(circle at 18% 70%, rgba(57, 210, 192, 0.035), transparent 32%);
  filter: blur(18px);
}
.ccc-hero-stage {
  width: min(960px, calc(100vw - 48px));
  min-height: min(720px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 24px);
  text-align: center;
}
.ccc-hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: #8b949e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.35em;
  /* Pin the content box so the pill is the same 22px tall as q2's, whose
     font resolves to a 14px line box. `normal` differs between the two
     stacks and left this 2px taller. */
  line-height: 14px;
}
.ccc-hero-date {
  color: rgba(139, 148, 158, 0.76);
  letter-spacing: 0.22em;
}
.ccc-hero-odometer {
  max-width: 100%;
  color: #c9d1d9;
  font-family: var(--font-ui), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(64px, 12vw, 140px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(110, 140, 175, 0.24), 0 0 80px rgba(57, 210, 192, 0.07);
  white-space: nowrap;
}
.ccc-hero-odo-label {
  margin-top: -8px;
  color: #8b949e;
  font-size: 13px;
  line-height: 1.5;
}
.ccc-hero-skyline {
  width: 100%;
  max-width: 960px;
  padding-top: clamp(6px, 1vh, 12px);
}
.ccc-hero-bars {
  height: clamp(92px, 16vh, 142px);
  display: flex;
  align-items: flex-end;
  gap: clamp(3px, 0.62vw, 8px);
  padding: 0 2px;
}
.ccc-hero-bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, rgba(57, 210, 192, 0.95), rgba(110, 140, 175, 0.88));
  box-shadow: 0 0 16px rgba(57, 210, 192, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  opacity: 0.9;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.62s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.ccc-hero-bars.is-raised .ccc-hero-bar {
  transform: scaleY(1);
}
.ccc-hero-bar.is-night {
  background: linear-gradient(180deg, rgba(188, 140, 255, 0.96), rgba(110, 140, 175, 0.82));
  box-shadow: 0 0 18px rgba(188, 140, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.ccc-hero-bar.is-zero {
  opacity: 0.32;
}
.ccc-hero-axis {
  position: relative;
  height: 22px;
  margin-top: 9px;
  border-top: 1px solid rgba(139, 148, 158, 0.18);
  color: rgba(139, 148, 158, 0.72);
  font: 600 10px/22px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ccc-hero-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}
.ccc-hero-axis span:last-child {
  transform: translateX(-100%);
}
.ccc-hero-live {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.ccc-hero-live-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c9d1d9;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}
.ccc-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.45);
  animation: cccHeroPulse 1.9s ease-out infinite;
}
.ccc-hero-ticker {
  max-width: min(760px, calc(100vw - 56px));
  min-height: 18px;
  overflow: hidden;
  color: rgba(139, 148, 158, 0.94);
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.ccc-hero-ticker.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.ccc-hero-live-left-panel {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  z-index: 100;
  pointer-events: none;
  background: rgba(13, 17, 23, 0.45);
  border: 1px solid rgba(139, 148, 158, 0.12);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ccc-hero-left-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(139, 148, 158, 0.12);
  padding-bottom: 12px;
  margin-bottom: 4px;
}
.ccc-hero-left-status {
  color: #c9d1d9;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}
.ccc-hero-left-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.ccc-hero-left-item {
  background: rgba(22, 27, 34, 0.55);
  border: 1px solid rgba(139, 148, 158, 0.12);
  border-radius: 6px;
  padding: 8px 12px;
  color: rgba(201, 209, 217, 0.9);
  font-size: 11px;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  box-sizing: content-box;

  /* Animation states */
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.4s ease, padding 0.4s ease, margin-bottom 0.4s ease;
  height: 16px;
}
.ccc-hero-left-item.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.ccc-hero-left-item.is-leaving {
  opacity: 0;
  transform: translateX(20px);
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: -8px;
  border-color: transparent;
}
@media (max-width: 1024px) {
  .ccc-hero-live-left-panel {
    display: none !important;
  }
}
.ccc-hero-stats {
  display: inline-flex;
  max-width: min(860px, calc(100vw - 64px));
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ccc-hero-stat {
  min-width: 132px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ccc-hero-stat + .ccc-hero-stat {
  border-left: 1px solid rgba(139, 148, 158, 0.16);
}
.ccc-hero-stat span {
  color: rgba(139, 148, 158, 0.82);
  font-size: 12px;
  line-height: 1.2;
}
.ccc-hero-stat strong {
  color: #c9d1d9;
  font: 700 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}
.ccc-hero-enter {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 34px);
  transform: translateX(-50%);
  color: rgba(139, 148, 158, 0.66);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: cccHeroHint 3.2s ease-in-out infinite;
}
@keyframes cccHeroPulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.42); }
  70% { box-shadow: 0 0 0 8px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}
@keyframes cccHeroHint {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.86; }
}
@media (max-width: 720px) {
  .ccc-hero-stage {
    width: calc(100vw - 28px);
    min-height: calc(100vh - 84px);
    gap: 15px;
  }
  .ccc-hero-eyebrow {
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    letter-spacing: 0.28em;
  }
  .ccc-hero-odo-label {
    max-width: 260px;
  }
  .ccc-hero-bars {
    gap: 3px;
    height: 96px;
  }
  .ccc-hero-stats {
    width: min(360px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .ccc-hero-stat {
    min-width: 0;
    padding: 10px 12px;
  }
  .ccc-hero-stat + .ccc-hero-stat {
    border-left: 0;
  }
  .ccc-hero-stat:nth-child(even) {
    border-left: 1px solid rgba(139, 148, 158, 0.16);
  }
  .ccc-hero-stat:nth-child(n+3) {
    border-top: 1px solid rgba(139, 148, 158, 0.16);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ccc-hero,
  .ccc-hero-bar,
  .ccc-hero-ticker {
    transition: none;
  }
  .ccc-hero-dot,
  .ccc-hero-enter {
    animation: none;
  }
  .ccc-hero-bar {
    transform: scaleY(1);
  }
}

/* --- Group Chat Redesign Styles --- */
.gc-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--surface-2, #1f242c);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  gap: 12px;
}
.gc-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gc-info-right {
  display: flex;
  align-items: center;
  min-width: 0;
}
.gc-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.gc-live-indicator.is-live {
  color: var(--green, #3fb950);
}
.gc-live-indicator.is-idle {
  color: var(--text-muted);
}
.gc-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--green, #3fb950);
}
.gc-live-indicator.is-live .gc-live-dot {
  animation: live-refresh-pulse 1.6s ease-in-out infinite;
}
.gc-part-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  max-width: 100%;
}
.gc-part-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--surface, #161b22);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.gc-part-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.gc-part-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gc-part-initials {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.8;
}
.gc-part-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gc-online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gc-online-dot.is-online {
  background-color: var(--green, #3fb950);
  box-shadow: 0 0 4px var(--green, #3fb950);
}
.gc-online-dot.is-waiting {
  background-color: var(--orange, #f0883e);
  box-shadow: 0 0 4px var(--orange, #f0883e);
}

/* Details and preamble disclosures */
.gc-preamble-disclosure,
.gco-details-disclosure {
  margin: 8px 0;
  width: 100%;
}
.gc-preamble-summary,
.gco-details-summary {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.gc-preamble-summary:hover,
.gco-details-summary:hover {
  color: var(--text);
}
.gc-chat-preamble {
  margin-top: 6px;
}

/* Labeled message indicators */
.gc-message-nudged-row,
.gc-message-receipts-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.gc-row-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.75;
}
.gc-nudged-chip {
  padding: 1px 6px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 4px;
  font-weight: 500;
  color: var(--text);
}
.gc-receipt-chips {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gc-receipt-avatar,
.gc-seen-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.gc-seen-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.75;
  margin-left: 8px;
}

/* Right panel cleanup and details */
.gco-part-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-2, #1f242c);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  gap: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.gco-part-card:hover {
  border-color: var(--accent);
}
.gco-part-card.gco-highlight {
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.3);
  transform: scale(1.02);
}
.gco-part-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gco-part-name-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gco-part-rename-btn {
  flex-shrink: 0;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.gco-part-card:hover .gco-part-rename-btn {
  opacity: 1;
}
.gco-part-rename-btn:hover {
  color: var(--accent);
}
.gco-part-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gco-part-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gco-part-spokentime {
  font-size: 11px;
  color: var(--text-muted);
}
.gco-part-ping-link {
  font-size: 11px;
  color: var(--text-muted);
}
.gco-part-ping-link:not(.is-never) {
  color: var(--accent);
}
.gco-part-card .gco-nudge-btn {
  margin-top: 0;
}
.gco-orchestrator-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.gco-nudge-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}
.gco-nudge-pill.is-active {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green, #3fb950);
  border: 1px solid rgba(63, 185, 80, 0.3);
}
.gco-nudge-pill.is-inactive {
  background: rgba(248, 81, 73, 0.15);
  color: var(--red, #f85149);
  border: 1px solid rgba(248, 81, 73, 0.3);
}
.gco-waiting-row {
  margin: 4px 0 8px;
}
.gco-waiting-text {
  font-style: italic;
  color: var(--text-muted);
}
.gco-details-disclosure {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 12px;
}
.gco-details-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
}

/* Replay mode */
.gc-replay-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface-2, #1f242c);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}
.gc-replay-btn {
  background: var(--surface, #161b22);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.gc-replay-btn:hover {
  background: var(--border);
  border-color: var(--text-muted);
}
.gc-replay-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.gc-replay-transport-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gc-replay-stepback-btn {
  font-weight: 700;
  padding: 4px 12px;
}
.gc-replay-skip-btn {
  color: var(--orange);
  border-color: rgba(240, 136, 62, 0.4);
}
.gc-replay-skip-btn:hover {
  background: rgba(240, 136, 62, 0.1);
  border-color: var(--orange);
}
.gc-replay-speed-group {
  display: flex;
  align-items: center;
  background: var(--surface, #161b22);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
}
.gc-replay-speed-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.gc-replay-speed-btn:hover {
  color: var(--text);
}
.gc-replay-speed-btn.is-active {
  background: var(--accent);
  color: #fff;
}
.gc-replay-word.gc-typing-shimmer,
.conv-live-word.gc-typing-shimmer {
  background: linear-gradient(90deg, var(--text) 30%, var(--accent) 50%, var(--text) 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gc-shimmer-typing 1s linear infinite;
  display: inline-block;
}
@keyframes gc-shimmer-typing {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Group-chat replay presents each participant message as a lower-third, 2x
   "hero" card while its words arrive, then flies that card into the slot
   already reserved by the hidden transcript copy. System lifecycle entries
   stay in the transcript and retain their quieter word reveal. */
.gc-replay-hero-target {
  opacity: 0;
}
.gc-replay-hero-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10010;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.38);
  transition: background-color 240ms ease;
}
.gc-replay-hero-backdrop.is-landing {
  background: transparent;
}
.gc-message.gc-replay-hero {
  position: fixed;
  left: 50%;
  /* Keep the header in the lower part of the viewport, with enough room on
     short screens for the body to grow down instead of shifting upward. */
  top: min(62vh, calc(100vh - 220px));
  z-index: 1;
  max-width: none;
  margin: 0 !important;
  pointer-events: none;
  background: var(--bg);
  transform: translateX(-50%) scale(2);
  transform-origin: top center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  will-change: transform;
}
.gc-in-replay .gc-message-receipts-row,
.gc-in-replay .gc-message-nudged-row {
  margin-top: 4px;
}
/* Queue / ticket-appearance events on the replay timeline (W22/B4). A compact
   full-width chip card that slides in at the moment a ticket was created,
   claimed, or resolved — distinct from conversation bubbles. */
.gc-message.gc-replay-queue-event {
  max-width: none;
  align-self: center;
  width: min(560px, 92%);
  margin: 8px auto;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.gc-message.gc-replay-queue-event.is-shown {
  opacity: 1;
  transform: none;
}
.gc-queue-ev-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface, #161b22);
  color: var(--text-muted);
}
.gc-queue-ev-icon { font-size: 13px; line-height: 1; }
.gc-queue-ev-ref {
  font-family: var(--mono, ui-monospace, monospace);
  color: var(--text);
  letter-spacing: 0.02em;
}
.gc-queue-ev-verb { font-weight: 500; }
.gc-queue-ev-queue {
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
  font-size: 11px;
}
.gc-queue-ev-depth {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 16%, transparent);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.gc-queue-ev-body {
  margin-top: 3px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Kind accents: created (appeared) green, claimed amber, resolved accent. */
.gc-queue-ev-created  .gc-queue-ev-icon { color: var(--green, #3fb950); }
.gc-queue-ev-created  .gc-queue-ev-inner { border-color: color-mix(in srgb, var(--green, #3fb950) 45%, var(--border)); }
.gc-queue-ev-claimed  .gc-queue-ev-icon { color: var(--orange, #d29922); }
.gc-queue-ev-claimed  .gc-queue-ev-inner { border-color: color-mix(in srgb, var(--orange, #d29922) 45%, var(--border)); }
.gc-queue-ev-resolved .gc-queue-ev-icon { color: var(--accent, #58a6ff); }
.gc-queue-ev-resolved .gc-queue-ev-inner { border-color: color-mix(in srgb, var(--accent, #58a6ff) 45%, var(--border)); }
/* Conversation replay */
.conv-replay-launch-btn {
  background: var(--surface, #161b22);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-items: center;
  gap: 4px;
}
.conv-replay-launch-btn:hover {
  color: var(--text);
  background: var(--border);
}
.conv-replay-controls {
  flex-shrink: 0;
}
.conv-replay-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
  opacity: 0.7;
}
.conv-replay-jump {
  display: flex; align-items: center; gap: 4px;
}
.conv-replay-jump-input {
  width: 52px;
  background: var(--surface, #161b22);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
}
.conv-replay-jump-input:focus {
  outline: none;
  border-color: var(--accent);
}
/* Applied to whichever direct child of the view is being held back —
   .event rows AND .tool-call-group wrappers (the latter's "Ran N commands"
   header is not itself an .event and was being left visible). */
.conv-replay-hidden {
  display: none !important;
}
.gc-updated-tick {
  font-size: 10px;
  color: var(--green);
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.2);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 8px;
  transition: opacity 0.5s ease;
  font-weight: 600;
}
.gc-updated-tick.fade-out {
  opacity: 0;
}
.gc-message-new-flash {
  animation: gc-flash-new 2.5s ease-out;
}
@keyframes gc-flash-new {
  0% {
    background: rgba(88, 166, 255, 0.25);
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.25);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

/* ── Stitch / Cyan Mono Terminal Palette overrides ── */

/* User Message bubble styling (Corner-cut + gradient + white/cyan text) */
.conv-pane[data-conv-bg="stitch"] .conversations-view .event.user_text:not(.is-pinned-in-sticky) {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%) !important;
  border-radius: 0 !important;
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.7) 0%, rgba(13, 148, 136, 0.7) 100%) !important;
  color: #e0ffff !important;
  border: 1px solid rgba(58, 74, 73, 0.3) !important;
  padding: 16px 20px !important;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.05) !important;
}

.conv-pane[data-conv-bg="stitch"] .conversations-view .event.user_text:not(.is-pinned-in-sticky) .user-msg {
  color: #e0ffff !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
  line-height: 1.6 !important;
  /* WebUI sessions wrap the text in a second, narrower card (max-width 78%,
     hairline border, own fill) — meant to REPLACE the default bubble. Under
     stitch the outer element already IS the bubble, so the inner card just
     wastes the right ~25% of it. Neutralize it: text fills the bubble. */
  max-width: none !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* Peer reports remain reading text inside the decorative conversation theme. */
.conv-pane[data-conv-bg="stitch"] .conversations-view .event.user_text.peer-message .user-msg {
  color: var(--conv-text, var(--text)) !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
}

/* Cyan >_ prompt at the end of the user message */
.conv-pane[data-conv-bg="stitch"] .conversations-view .event.user_text:not(.is-pinned-in-sticky) .user-msg::after {
  content: ' >_';
  color: #00ffff !important;
  font-weight: bold;
}

/* Reports keep their quiet surface and complete disclosure under stitch's
   important decorative bubble rules, including its clipped corner. */
.conv-pane[data-conv-bg="stitch"] .conversations-view .event.user_text.peer-message:not(.is-pinned-in-sticky) {
  clip-path: none !important;
  border-radius: 12px !important;
  background: color-mix(in srgb, var(--green) 6%, transparent) !important;
  box-shadow: none !important;
}
.conv-pane[data-conv-bg="stitch"] .conversations-view .event.user_text.peer-message .user-msg::after { content: none !important; }

/* Remove terminal prompt from subsequent user messages in the session */
.conv-pane[data-conv-bg="stitch"] .conversations-view .event.user_text:not(.is-pinned-in-sticky) ~ .event.user_text:not(.is-pinned-in-sticky) .user-msg::after {
  content: '' !important;
}

/* Assistant Message Block styling (outline border + background) */
.conv-pane[data-conv-bg="stitch"] .conversations-view .event.assistant {
  background: transparent !important;
  border: none !important;
  padding: 24px 0 4px !important;
  margin-bottom: 8px !important;
  box-shadow: none !important;
}

.conv-pane[data-conv-bg="stitch"] .conversations-view .event.assistant .assistant-text {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
  line-height: 1.6 !important;
  color: var(--conv-text) !important;
  background: var(--conv-surface-2) !important; /* Lighter surface-container #201f20 */
  border: 0 !important;
  border-left: 1px solid var(--conv-accent) !important;
  border-radius: 0 4px 4px 0 !important;
  padding: 16px !important;
  margin-top: 8px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

.conv-pane[data-conv-bg="stitch"] .conversations-view .assistant-text h1,
.conv-pane[data-conv-bg="stitch"] .conversations-view .assistant-text h2,
.conv-pane[data-conv-bg="stitch"] .conversations-view .assistant-text h3 {
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text) !important;
}

/* Blinking cursor / prompt at the end of the assistant greeting */
.conv-pane[data-conv-bg="stitch"] .conversations-view > .event:first-child.assistant .assistant-text::after {
  content: ' >_';
  color: var(--conv-accent) !important;
  font-weight: bold;
}

/* Streaming bubble during active generation */
.conv-pane[data-conv-bg="stitch"] .stream-bubble {
  background: var(--conv-surface-2) !important;
  border-left: 1px solid var(--conv-accent) !important;
  border-radius: 0 4px 4px 0 !important;
  padding: 16px !important;
  margin-bottom: 16px !important;
  font-size: 14px !important;
}
/* The finalized row (.event.assistant .assistant-text, above) gets its own
   font override that beats the base 16px/-apple-system rule via higher
   specificity + !important. This bubble's own font-size:14px above only
   reaches the text by inheritance, which loses to that base rule's more
   specific *direct* selector on .assistant-text — so text rendered 16px
   -apple-system while streaming, then visibly snapped to 14px Inter the
   instant it finalized. Match it explicitly so streaming and finalized
   text render identically and nothing reflows at hand-off. */
.conv-pane[data-conv-bg="stitch"] .stream-bubble .assistant-text {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
  line-height: 1.6 !important;
}

/* Code block wrapping */
.conv-pane[data-conv-bg="stitch"] .cb-wrap {
  border-radius: 0 !important;
  background: #050505 !important;
  border-color: var(--conv-border) !important;
}

.conv-pane[data-conv-bg="stitch"] .cb-head {
  background: #0d0d0e !important;
  border-bottom: 1px solid var(--conv-border) !important;
  color: var(--conv-text-muted) !important;
}

/* Command input area */
.conv-pane[data-conv-bg="stitch"] .conv-input-bar.visible {
  background: var(--conv-bg) !important;
  border: 1px solid var(--conv-border) !important;
  border-radius: 0 !important;
  margin: 12px 16px !important;
  padding: 12px 16px !important;
}

.conv-pane[data-conv-bg="stitch"] .conv-input-bar.visible:focus-within {
  border-color: var(--conv-accent) !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--conv-accent) 20%, transparent) !important;
}

/* Prepend '>' symbol in prompt style inside the input textarea row */
.conv-pane[data-conv-bg="stitch"] .conv-input-row-top::before {
  content: '>';
  color: var(--conv-accent) !important;
  font-weight: bold;
  font-size: 16px;
  margin-right: 12px;
  align-self: center;
}

.conv-pane[data-conv-bg="stitch"] .conv-input-bar textarea {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, Monaco, monospace !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 14px !important;
}

/* Input Buttons layout (Hard 0px corners) */
.conv-pane[data-conv-bg="stitch"] .conv-input-bar button,
.conv-pane[data-conv-bg="stitch"] .conv-input-bar select {
  border-radius: 0 !important;
}
/* The F2 gate's pill wrapper, cost badge, and launch dialog are divs/spans,
   so the button rule above misses them — square them to match. */
.conv-pane[data-conv-bg="stitch"] .conv-input-bar .f2c-panel .route,
.conv-pane[data-conv-bg="stitch"] .conv-input-bar .f2c-panel .cost-badge,
.conv-pane[data-conv-bg="stitch"] .conv-input-bar .f2c-panel .f2c-config {
  border-radius: 0 !important;
}

/* Send button styling */
.conv-pane[data-conv-bg="stitch"] .conv-input-bar .send-btn {
  background: transparent !important;
  border: 1px solid var(--conv-accent) !important;
  color: var(--conv-accent) !important;
}

.conv-pane[data-conv-bg="stitch"] .conv-input-bar .send-btn:hover {
  background: var(--conv-accent) !important;
  color: #000000 !important;
}

/* Scrollbars overrides */
.conv-pane[data-conv-bg="stitch"] .conversations-view::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.conv-pane[data-conv-bg="stitch"] .conversations-view::-webkit-scrollbar-track {
  background: #131314;
}
.conv-pane[data-conv-bg="stitch"] .conversations-view::-webkit-scrollbar-thumb {
  background: #3a4a49;
  border-radius: 3px;
}
.conv-pane[data-conv-bg="stitch"] .conversations-view::-webkit-scrollbar-thumb:hover {
  background: #839493;
}

/* ── Federation "Nodes & peers" modal ─────────────────────────────────
   Opened from the settings popover (openFederationPeersModal in app.js).
   Reuses the .upd-overlay / .upd-dialog shell and .bug-input fields;
   only the fed- section/row primitives below are new. */
.fed-section { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.fed-section-title { font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; }
.fed-self-row { display: flex; align-items: center; gap: 8px; }
.fed-list { display: flex; flex-direction: column; gap: 6px; }
.fed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); }
.fed-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fed-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.fed-btn { padding: 4px 10px; font-size: 12px; }
.fed-peer-name { font-weight: 600; color: var(--text); }
.fed-meta { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.fed-node-id { font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 11px; cursor: help; }
.fed-chip-warn { font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 999px; vertical-align: middle; white-space: nowrap;
  color: var(--orange, #d29922); border: 1px solid var(--orange, #d29922);
  background: rgba(210, 153, 34, 0.12); }
.fed-test-result { font-size: 12px; }
.fed-test-result.ok { color: var(--green); }
.fed-test-result.err { color: var(--red); }
.fed-empty { font-size: 12px; color: var(--text-muted); padding: 4px 2px; }
.fed-add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fed-inline-error { display: none; font-size: 12px; color: var(--red); }

.fed-inline-error.visible { display: block; }

/* ── "Continue on…" session handoff modal ───────────────────
   Opened from the conversation overflow (⋯) menu via openHandoffModal.
   Reuses the .upd-* modal shell and fed- section primitives; only the
   handoff- plan/step/blocker/success primitives below are new. */
.handoff-no-peers { font-size: 12px; color: var(--text-muted); }
.handoff-link { background: none; border: none; padding: 0; color: var(--accent);
  font: inherit; cursor: pointer; text-decoration: underline; }
.handoff-plan { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.handoff-git { font-size: 12px; color: var(--text-muted); line-height: 1.6;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; overflow-wrap: anywhere; }
.handoff-git strong { color: var(--text); font-weight: 600; }
.handoff-commit { font-family: 'SF Mono', SFMono-Regular, Consolas, monospace; }
.handoff-warn-text { color: var(--orange, #d29922); font-weight: 600; }
.handoff-steps { display: flex; flex-direction: column; gap: 4px; }
.handoff-step { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.handoff-step.is-needed { border-color: var(--accent); background: rgba(88,166,255,0.08); }
.handoff-step-name { font-weight: 600; color: var(--text); }
.handoff-step-detail { font-size: 12px; color: var(--text-muted); }
.handoff-blockers { display: flex; flex-direction: column; gap: 6px; }
.handoff-blocker { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px;
  border: 1px solid rgba(248,81,73,0.4); border-radius: 6px;
  background: rgba(248,81,73,0.08); }
.handoff-blocker-code { font-weight: 700; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--red); }
.handoff-blocker-detail { font-size: 12px; color: var(--text); }
.handoff-blocker-files { font-size: 11px; color: var(--text-muted); overflow-wrap: anywhere;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace; }
.handoff-success { display: flex; flex-direction: column; gap: 8px; }
.handoff-success-title { font-size: 14px; color: var(--green); }
.handoff-success-title strong { color: var(--text); }
.handoff-kv { display: flex; align-items: baseline; gap: 8px; font-size: 12px;
  color: var(--text-muted); flex-wrap: wrap; }
.handoff-resume { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--text-muted); }
.handoff-kv code, .handoff-resume code {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace; font-size: 12px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; overflow-wrap: anywhere; }
.handoff-copy { cursor: pointer; }
.handoff-copy:hover { border-color: var(--accent); }
.handoff-warnings { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--orange, #d29922); }
/* "Moved to another node" chip in the conversation breadcrumb. */
.handoff-moved-chip { font-size: 10px; font-weight: 600; padding: 1px 7px;
  border-radius: 999px; white-space: nowrap; vertical-align: middle; cursor: help;
  color: var(--orange, #d29922); border: 1px solid var(--orange, #d29922);
  background: rgba(210,153,34,0.12); }

/* ── Fleet view ───────────────────────────────────────────────────
   The repo × node matrix (openFleetView in app.js). Reuses the .upd-*
   modal shell + fed- primitives; the fleet- classes below add the health
   strip, repo cards, per-dimension chips, the "Who?" attribution popover,
   and the resolve-all plan / job progress. Theme-safe via the shared
   --green/--orange/--red/--accent/--surface/--border variables. */
.fleet-header { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; }
.fleet-header-titles { min-width: 0; flex: 1 1 auto; }
.fleet-header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  flex-wrap: wrap; }
.fleet-refresh-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.fleet-spinner { display: inline-block; width: 12px; height: 12px; margin-right: 6px;
  vertical-align: -1px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: fleet-spin 0.7s linear infinite; }
@keyframes fleet-spin { to { transform: rotate(360deg); } }

.fleet-health-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.fleet-node-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); }
.fleet-node-chip.is-ok { border-color: rgba(63,185,80,0.4); }
.fleet-node-chip.is-err { border-color: rgba(248,81,73,0.4); background: rgba(248,81,73,0.06); }
.fleet-node-chip.is-stale { border-style: dashed; }
.fleet-node-name { font-weight: 600; color: var(--text); }
.fleet-self-marker { font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 1px 5px; border-radius: 999px;
  color: var(--accent); border: 1px solid var(--accent); background: rgba(110,140,175,0.12); }
.fleet-node-status.ok { color: var(--green); }
.fleet-node-status.err { color: var(--red); }
.fleet-stale-badge { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px;
  cursor: help; white-space: nowrap; color: var(--orange, #d29922);
  border: 1px solid var(--orange, #d29922); background: rgba(210,153,34,0.12); }

.fleet-matrix { display: flex; flex-direction: column; gap: 14px; }
.fleet-repo-card { border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  overflow: hidden; }
.fleet-repo-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); }
.fleet-pin { font-size: 12px; }
.fleet-repo-title { font-weight: 600; font-size: 13px; color: var(--text);
  overflow-wrap: anywhere; }
.fleet-repo-kind { font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 7px; }
.fleet-repo-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; padding: 12px; }
.fleet-cell { display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  min-width: 0; }
.fleet-cell.is-err { border-color: rgba(248,81,73,0.4); }
.fleet-cell.is-stale { border-style: dashed; }
.fleet-cell-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fleet-cell-node { font-weight: 600; font-size: 12px; color: var(--text); }
.fleet-cell-detail { font-size: 11px; color: var(--text-muted); overflow-wrap: anywhere; }

.fleet-dim { display: flex; flex-direction: column; gap: 4px; }
.fleet-dim-label { font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); }
.fleet-chip-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.fleet-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: help; }
.fleet-chip .fleet-sha { font-family: 'SF Mono', SFMono-Regular, Consolas, monospace; }
.fleet-chip.chip-red { color: var(--red); border-color: rgba(248,81,73,0.4);
  background: rgba(248,81,73,0.1); }
.fleet-chip.chip-orange { color: var(--orange, #d29922); border-color: rgba(210,153,34,0.4);
  background: rgba(210,153,34,0.1); }
.fleet-chip.chip-green { color: var(--green); border-color: rgba(63,185,80,0.4);
  background: rgba(63,185,80,0.1); }
.fleet-chip.chip-warn { color: var(--orange, #d29922); border-color: rgba(210,153,34,0.4);
  background: rgba(210,153,34,0.1); }
.fleet-chip.chip-muted { color: var(--text-muted); }

.fleet-wt-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.fleet-wt-row { display: flex; align-items: center; gap: 6px; font-size: 11px; min-width: 0; }
.fleet-wt-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text); }
.fleet-wt-dirty { flex: 0 0 auto; color: var(--red); font-weight: 600; }
.fleet-mini-btn { flex: 0 0 auto; padding: 2px 8px; font-size: 11px; }

.fleet-session-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.fleet-session-badge { font-size: 10px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-session-badge.is-live { color: var(--green); border-color: rgba(63,185,80,0.4); }
.fleet-session-badge.more { color: var(--text-muted); }

/* "Who?" attribution popover — appended to <body>, layers above the modal. */
.fleet-attr-popover { position: fixed; z-index: 10001; width: min(320px, 92vw);
  max-height: 60vh; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 8px; }
.fleet-attr-head { font-size: 12px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere; }
.fleet-attr-loading, .fleet-attr-empty { font-size: 12px; color: var(--text-muted); }
.fleet-attr-cand { display: flex; flex-direction: column; gap: 4px; padding: 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.fleet-attr-cand-head { display: flex; align-items: center; gap: 6px; }
.fleet-attr-name { font-weight: 600; font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-attr-conf { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 1px 6px; border-radius: 999px; }
.fleet-attr-conf.conf-high { color: var(--green); border: 1px solid rgba(63,185,80,0.5); }
.fleet-attr-conf.conf-medium { color: var(--orange, #d29922); border: 1px solid rgba(210,153,34,0.5); }
.fleet-attr-conf.conf-low { color: var(--text-muted); border: 1px solid var(--border); }
.fleet-attr-live { font-size: 10px; font-weight: 600; color: var(--green); }
.fleet-attr-ev { font-size: 11px; color: var(--text-muted); overflow-wrap: anywhere; }

/* ── Resolve-all plan / job modal ── */
.fleet-plan-body { display: flex; flex-direction: column; gap: 12px; font-size: 13px;
  max-height: 60vh; overflow-y: auto; }
.fleet-plan-repo { display: flex; flex-direction: column; gap: 8px; }
.fleet-plan-repo-title { font-size: 12px; font-weight: 700; color: var(--text);
  overflow-wrap: anywhere; }
.fleet-plan-node { display: flex; flex-direction: column; gap: 6px; padding-left: 8px;
  border-left: 2px solid var(--border); }
.fleet-plan-node-title { font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; }
.fleet-action { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); cursor: pointer; }
.fleet-action.is-destructive { border-color: rgba(248,81,73,0.55);
  background: rgba(248,81,73,0.05); }
.fleet-action.is-locked { cursor: default; opacity: 0.85; }
.fleet-action-check { margin-top: 3px; flex: 0 0 auto; }
.fleet-action-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.fleet-action-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fleet-kind-badge { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 1px 7px; border-radius: 999px; color: var(--accent);
  border: 1px solid var(--accent); background: rgba(110,140,175,0.12); }
.fleet-kind-badge.is-destructive { color: var(--red); border-color: var(--red);
  background: rgba(248,81,73,0.12); }
.fleet-destructive-tag { font-size: 10px; font-weight: 700; color: var(--red); }
.fleet-status-tag { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); }
.fleet-status-tag.status-blocked { color: var(--orange, #d29922); border-color: rgba(210,153,34,0.5); }
.fleet-status-tag.status-manual { color: var(--text-muted); }
.fleet-action-target { font-size: 11px; color: var(--text-muted);
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.fleet-action-reason { font-size: 12px; color: var(--text); line-height: 1.45; }
.fleet-action-cmd code { font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 11px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; overflow-wrap: anywhere; }
.fleet-action-cmd.is-destructive code { color: var(--red); border-color: rgba(248,81,73,0.4); }
.fleet-action-ev { font-size: 11px; color: var(--text-muted); overflow-wrap: anywhere; }
.fleet-action-blockers { display: flex; flex-wrap: wrap; gap: 4px; }
.fleet-blocker { font-size: 11px; padding: 1px 7px; border-radius: 4px;
  color: var(--text); border: 1px solid rgba(210,153,34,0.4); background: rgba(210,153,34,0.08); }
.fleet-blocker-code { font-weight: 700; text-transform: uppercase; font-size: 10px;
  letter-spacing: 0.03em; color: var(--orange, #d29922); }

.fleet-job-status { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.fleet-job-actions { display: flex; flex-direction: column; gap: 5px; }
.fleet-job-action { display: flex; align-items: center; gap: 8px; font-size: 12px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.fleet-job-action.is-done { border-color: rgba(63,185,80,0.4); }
.fleet-job-action.is-failed { border-color: rgba(248,81,73,0.4); }
.fleet-job-action.is-stale { border-color: rgba(210,153,34,0.4); }
.fleet-job-icon { flex: 0 0 auto; width: 16px; text-align: center; }
.fleet-job-action.is-done .fleet-job-icon { color: var(--green); }
.fleet-job-action.is-failed .fleet-job-icon { color: var(--red); }
.fleet-job-action.is-stale .fleet-job-icon { color: var(--orange, #d29922); }
.fleet-job-kind { font-weight: 600; color: var(--text); }
.fleet-job-target { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-family: 'SF Mono', SFMono-Regular, Consolas, monospace; font-size: 11px; }
.fleet-job-detail { flex: 1 1 100%; font-size: 11px; color: var(--text-muted);
  overflow-wrap: anywhere; }
.fleet-job-log { display: flex; flex-direction: column; gap: 2px; max-height: 180px;
  overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 11px; }
.fleet-log-line { color: var(--text-muted); overflow-wrap: anywhere; }
.fleet-log-line.level-ok { color: var(--green); }
.fleet-log-line.level-warn { color: var(--orange, #d29922); }
.fleet-log-line.level-error { color: var(--red); }
.fleet-log-t { color: var(--text-muted); opacity: 0.7; margin-right: 4px; }

/* ── Codex desktop↔CCC coordination ───────────────────────────────────
   Surfaces who is writing a shared Codex thread (the desktop app / another
   process vs CCC) and the durable coordination notes in the transcript.
   Driven by updateCodexStateBadge + the codex_coordination event branch. */
/* Working pill whose turn is being run by the Codex desktop app (or another
   external process): tint the status dot a distinct blue/purple so it reads
   apart from the normal gold "CCC is working" dot at a glance. */
.conv-codex-state.writer-desktop .ccs-dot { background: #a389f4; }
.conv-codex-state.writer-external .ccs-dot { background: #6ea8fe; }
/* Quiet marker: this thread is also loaded in Codex desktop (even when idle). */
.ccs-desktop-attached {
  margin-left: 6px; font-size: 10px; opacity: 0.7;
  color: var(--text-muted); white-space: nowrap;
}
/* "Grab back" — reclaim an external-writer thread into CCC control. Tuned to
   the external-writer blue so it reads as the resolution to that pill's state. */
.conv-codex-state .ccs-grab-back {
  flex-shrink: 0;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, #6ea8fe 55%, var(--border) 45%);
  background: transparent;
  color: #6ea8fe;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}
.conv-codex-state .ccs-grab-back:hover { background: color-mix(in srgb, #6ea8fe 14%, transparent 86%); }
.conv-codex-state .ccs-grab-back:disabled,
.conv-codex-state .ccs-grab-back.is-busy { opacity: 0.55; cursor: default; }
/* Running token count in the live "Generating…"/active-item strip. */
.conv-live-tool-inline .cl-tokens {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
/* CCC-237: queued input an explicit Stop held. Amber like other "waiting on
   you" states; each message gets its own Release / Cancel. */
.event.system.stop-held-block {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 12px; font-size: 12.5px;
  background: rgba(210, 153, 34, 0.08); border-left-color: rgba(210, 153, 34, 0.55);
}
.event.system.stop-held-block[hidden] { display: none; }
.stop-held-head, .stop-held-item { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.stop-held-sub { flex: 1 1 auto; color: var(--text-muted); }
.stop-held-text {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text);
}
.stop-held-btn {
  flex: 0 0 auto; font: inherit; font-size: 12px; padding: 1px 8px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--text);
}
.stop-held-btn:hover { border-color: rgba(210, 153, 34, 0.7); }
.stop-held-btn:disabled { opacity: 0.5; cursor: default; }
/* Durable coordination note — a meta row, not transcript content. Keep it
   compact, muted and border-free so it never competes with real messages. */
.event.system.codex-coordination {
  display: flex; align-items: baseline; gap: 6px;
  padding: 2px 12px; font-size: 12px; color: var(--text-muted);
  background: transparent; border-left-color: transparent;
}
.event.system.codex-coordination .ccoord-icon { flex: 0 0 auto; opacity: 0.85; }
.event.system.codex-coordination .ccoord-text { flex: 1 1 auto; }
.event.system.codex-app-item {
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 12px; font-size: 12px; color: var(--text-muted);
  background: rgba(88, 166, 255, 0.05); border-left-color: rgba(88, 166, 255, 0.18);
}
.event.system.codex-app-item.is-running {
  color: #9ecbff;
  background: rgba(88, 166, 255, 0.08);
}
.event.system.codex-app-item.is-error {
  color: var(--red);
  background: rgba(248, 81, 73, 0.08);
  border-left-color: rgba(248, 81, 73, 0.35);
}
.event.system.codex-app-item.needs-approval {
  color: var(--warning);
  background: rgba(210, 153, 34, 0.10);
  border-left-color: rgba(210, 153, 34, 0.45);
}
.event.system.codex-app-item .ccoord-icon { flex: 0 0 auto; opacity: 0.85; }
.event.system.codex-app-item .ccoord-text { flex: 1 1 auto; min-width: 0; }
.event.system.codex-app-item .codex-app-item-label { font-weight: 600; }
.event.system.codex-app-item .codex-app-item-detail { opacity: 0.9; }

/* ── Conversation presentation modes ───────────────────────────────────
   Client-only slide views derived from the already-rendered transcript.
   The source events stay mounted under .conv-presentation-stage so Off can
   restore the exact reader instantly and split panes keep isolated state. */
.conv-presentation-toolbar {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
}
.conv-presentation-toolbar[hidden] { display: none; }
.conv-presentation-toolbar-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.conv-presentation-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}
.conv-presentation-mode {
  min-height: 24px;
  padding: 3px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font: 650 11px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.conv-presentation-mode:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.conv-presentation-mode.is-active,
.conv-presentation-mode[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 84%, #7c3aed), #7047eb);
  box-shadow: 0 1px 5px color-mix(in srgb, var(--accent) 28%, transparent);
}
.conv-presentation-zero-cost {
  color: var(--text-muted);
  font: 550 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: 0.72;
  white-space: nowrap;
}
.conv-presentation-toolbar > .conv-presentation-progress {
  flex: 1 1 auto;
  margin-left: auto;
}

.conversations-view.is-presentation-mode {
  display: flex;
  overflow: hidden;
  padding: 12px clamp(10px, 2vw, 24px);
  background:
    radial-gradient(circle at 12% 4%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 38%),
    color-mix(in srgb, var(--bg) 94%, #111827);
}
.conversations-view.is-presentation-mode > :not(.conv-presentation-stage) { display: none !important; }
.conv-presentation-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 9px;
}
.conv-mode3-status {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 140px);
  padding: 6px 10px;
  transform: translateX(-50%);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 7px 20px rgba(0,0,0,0.22);
  color: var(--text-muted);
  font: 650 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}
.conv-mode3-status[hidden] { display: none; }
.conv-mode3-status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: conv-presentation-live-pulse 1.1s ease-in-out infinite;
}
.conv-mode3-status button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.conv-presentation-side-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 68px;
  border: 1px solid color-mix(in srgb, var(--text) 24%, transparent);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.conv-presentation-side-nav.is-prev { left: 12px; }
.conv-presentation-side-nav.is-next { right: 12px; }
.conv-presentation-side-nav:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  box-shadow: 0 12px 34px rgba(0,0,0,0.36), 0 0 18px color-mix(in srgb, var(--accent) 25%, transparent);
  color: color-mix(in srgb, var(--accent) 74%, white);
}
.conv-presentation-side-nav:disabled { opacity: 0.22; cursor: default; }
.conv-presentation-slide-slot {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  justify-content: center;
}
.conv-presentation-measure {
  position: fixed;
  left: -100000px;
  top: 0;
  z-index: -1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  contain: layout style paint;
}
.conv-presentation-live-region {
  flex: 0 0 auto;
  flex-basis: var(--presentation-live-height, 42%);
  min-height: 0;
  max-height: var(--presentation-live-height, 42%);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #58a6ff 42%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, #58a6ff 7%, var(--surface));
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}
.conv-presentation-live-region[hidden] { display: none; }
.conv-presentation-live-resize {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 10px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  background: transparent;
  transition: background 120ms ease;
}
.conv-presentation-live-resize::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: rgba(139,148,158,0.45);
  transition: width 120ms ease, background 120ms ease;
}
.conv-presentation-live-resize:hover,
.conv-presentation-live-resize:focus-visible,
.conv-presentation-live-resize.is-dragging {
  outline: none;
  background: rgba(88,166,255,0.08);
}
.conv-presentation-live-resize:hover::before,
.conv-presentation-live-resize:focus-visible::before,
.conv-presentation-live-resize.is-dragging::before {
  width: 60px;
  background: var(--accent);
}
.conv-presentation-live-region > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 6px 10px;
  border-bottom: 1px solid color-mix(in srgb, #58a6ff 28%, var(--border));
  color: #8fc7ff;
  font: 750 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.conv-presentation-live-list {
  max-height: calc(100% - 40px);
  overflow: auto;
  padding: 7px 9px;
  scrollbar-gutter: stable;
}
.conv-presentation-live-item + .conv-presentation-live-item { margin-top: 7px; }
.conv-presentation-live-item > .event,
.conv-presentation-live-item > .tool-call-group,
.conv-presentation-live-item > .stream-bubble,
.conv-presentation-live-item > .conv-live-tool-inline { margin-block: 0; }
.conv-presentation-projection-fallback { color: var(--text-muted); white-space: pre-wrap; }
.conv-presentation-list-fragment + .conv-presentation-list-fragment { margin-top: -0.55em; }
.conv-presentation-list-fragment > li { margin-block: 0; }
.conv-presentation-slide {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: 1120px;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(18px, 3.5vw, 46px);
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
  border-radius: clamp(12px, 1.8vw, 22px);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 90%, #182033), color-mix(in srgb, var(--bg) 94%, #0f172a));
  box-shadow: 0 20px 55px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.035);
}
.conv-presentation-slide.is-entering { animation: conv-presentation-enter 160ms ease-out; }
@keyframes conv-presentation-enter {
  from { opacity: 0; transform: translateY(5px) scale(0.995); }
  to { opacity: 1; transform: none; }
}
.conv-presentation-slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  margin-bottom: 12px;
}
.conv-presentation-eyebrow {
  color: color-mix(in srgb, var(--accent) 76%, #c4b5fd);
  font: 750 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}
.conv-presentation-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-teal, #39d2c0);
  font: 650 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.conv-presentation-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: conv-presentation-live-pulse 1.1s ease-in-out infinite;
}
@keyframes conv-presentation-live-pulse { 50% { opacity: 0.35; } }
.conv-presentation-prompt {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0 0 clamp(16px, 2.5vh, 26px);
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.conv-presentation-prompt > span {
  color: color-mix(in srgb, var(--accent) 75%, #c4b5fd);
  font: 750 9px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.conv-presentation-prompt > p {
  min-width: 0;
  max-height: 4.5em;
  overflow: auto;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.conv-presentation-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 1px clamp(2px, 1vw, 10px) 10px;
  scrollbar-gutter: stable;
}
.is-presentation-mode .conv-presentation-body.assistant-text {
  font-size: clamp(16px, 1.65vw, 24px);
  line-height: 1.58;
}
.conv-presentation-body > :first-child { margin-top: 0 !important; }
.conv-presentation-body > :last-child { margin-bottom: 0 !important; }
.conv-presentation-body img,
.conv-presentation-body svg { max-width: 100%; height: auto; }
.conv-presentation-body pre,
.conv-presentation-body .code-block,
.conv-presentation-body table { max-height: 100%; overflow: auto; }
.conv-mode3-slide {
  --mode3-accent: #67e8f9;
  position: relative;
  gap: clamp(18px, 3vh, 34px);
  border-color: color-mix(in srgb, var(--mode3-accent) 24%, var(--border));
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--mode3-accent) 16%, transparent), transparent 42%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 90%, #182033), color-mix(in srgb, var(--bg) 94%, #0f172a));
  font-family: "Avenir Next", Avenir, "Segoe UI Variable Display", var(--font-ui);
}
.conv-mode3-slide[data-mode3-theme="cyan"] { --mode3-accent: #67e8f9; }
.conv-mode3-slide[data-mode3-theme="violet"] { --mode3-accent: #a78bfa; }
.conv-mode3-slide[data-mode3-theme="amber"] { --mode3-accent: #fbbf24; }
.conv-mode3-slide[data-mode3-theme="green"] { --mode3-accent: #4ade80; }
.conv-mode3-slide[data-mode3-theme="neutral"] { --mode3-accent: #7dd3fc; }
.conv-mode3-header { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.conv-mode3-heading { min-width: 0; }
.conv-mode3-title { margin: 5px 0 0; color: color-mix(in srgb, var(--mode3-accent) 34%, var(--text)); font-size: clamp(25px, 3.5vw, 46px); font-weight: 720; letter-spacing: -0.025em; line-height: 1.06; }
.conv-mode3-subtitle { margin: 10px 0 0; color: var(--text-muted); font-size: clamp(15px, 1.7vw, 22px); }
.conv-mode3-deck-label { max-width: 28%; color: color-mix(in srgb, var(--mode3-accent) 42%, var(--text-muted)); font: 650 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.conv-mode3-body { display: flex; flex: 1 1 auto; min-height: 0; align-items: safe center; overflow: auto; }
.conv-mode3-slide.layout-bullets .conv-mode3-body { align-items: flex-start; }
.conv-mode3-statement,
.conv-mode3-takeaway { max-width: 22ch; margin: auto 0; font-size: clamp(30px, 5.2vw, 68px); font-weight: 680; line-height: 1.08; text-wrap: balance; }
.conv-mode3-list { width: 100%; margin: 0; padding-left: 1.25em; font-size: clamp(17px, min(2.2vw, 3.4vh), 28px); font-weight: 520; letter-spacing: -0.012em; line-height: 1.28; }
.conv-mode3-list li::marker { color: var(--mode3-accent); font-weight: 760; }
.conv-mode3-list li + li { margin-top: 0.32em; }
.conv-mode3-steps { width: 100%; margin: 0; padding: 0; list-style: none; counter-reset: mode3-step; }
.conv-mode3-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: baseline; counter-increment: mode3-step; }
.conv-mode3-steps li + li { margin-top: 18px; }
.conv-mode3-steps li::before { content: counter(mode3-step, decimal-leading-zero); color: var(--mode3-accent); font: 750 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.conv-mode3-step-label { display: block; font-size: clamp(18px, 2.3vw, 30px); }
.conv-mode3-step-text { display: block; margin-top: 3px; color: var(--text-muted); font-size: clamp(14px, 1.5vw, 19px); }
.conv-mode3-comparison { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.conv-mode3-comparison-side { padding: clamp(16px, 2vw, 26px); border: 1px solid color-mix(in srgb, var(--mode3-accent) 28%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--mode3-accent) 6%, transparent); }
.conv-mode3-comparison-side h3 { margin: 0 0 16px; font-size: clamp(18px, 2.2vw, 28px); }
.conv-mode3-comparison-side .conv-mode3-list { font-size: clamp(14px, 1.65vw, 20px); }
.conv-mode3-metrics { display: grid; width: 100%; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.conv-mode3-metric { padding: clamp(18px, 3vw, 34px); border-top: 3px solid var(--mode3-accent); background: color-mix(in srgb, var(--mode3-accent) 7%, transparent); }
.conv-mode3-metric-value { display: block; color: var(--mode3-accent); font-size: clamp(30px, 4.4vw, 58px); line-height: 1; }
.conv-mode3-metric-label { display: block; margin-top: 12px; color: var(--text-muted); font-size: clamp(14px, 1.5vw, 19px); }
.conv-mode3-quote { max-width: 28ch; margin: auto; font-size: clamp(25px, 3.8vw, 48px); line-height: 1.22; text-wrap: balance; }
.conv-mode3-quote p { margin: 0; }
.conv-mode3-quote cite { display: block; margin-top: 18px; color: var(--mode3-accent); font-size: 0.38em; font-style: normal; }
.conv-mode3-code { width: 100%; max-height: 100%; margin: 0; overflow: auto; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); font-size: clamp(12px, 1.3vw, 17px); line-height: 1.5; }
.conv-mode3-caption { margin: 12px 0 0; color: var(--text-muted); }
.conv-mode3-actions { margin: 24px 0 0; padding-left: 1.2em; font-size: clamp(16px, 2vw, 24px); }
.conv-presentation-slide.is-mode3-fallback { border-style: dashed; }
.conv-presentation-details {
  flex: 0 0 auto;
  max-height: min(34%, 240px);
  margin-top: 12px;
  overflow: auto;
  border-top: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  color: var(--text-muted);
}
.conv-presentation-details > summary {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 2px 6px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}
.conv-presentation-details-body { padding: 2px 0 8px; font-size: 12px; }
.conv-presentation-details-body .tool-call-group { margin: 4px 0; }

.conv-presentation-progress {
  display: grid;
  grid-template-columns: minmax(80px, auto) minmax(28px, 1fr) auto;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-muted);
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.conv-presentation-answer-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-presentation-overall { font-variant-numeric: tabular-nums; white-space: nowrap; }
.conv-presentation-dots { display: flex; align-items: center; justify-content: center; gap: 4px; }
.conv-presentation-dots i { width: 16px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--text) 15%, transparent); }
.conv-presentation-dots i.is-active { background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent); }

/* The optional right-side status rail turns each pane into a grid. Reserve
   an explicit row for the per-pane selector so it does not fall
   into implicit-grid placement or displaces the composer. */
body.status-pos-right .conv-pane.has-status-rail {
  grid-template-rows: auto auto 1fr auto auto auto auto auto auto;
  grid-template-areas:
    "header rail"
    "present-toolbar rail"
    "conv rail"
    "goal rail"
    "model rail"
    "queued rail"
    "input rail"
    "context rail"
    "hint rail";
}
body.status-pos-right .conv-pane.has-status-rail.has-new-session-context {
  grid-template-areas:
    "header rail"
    "present-toolbar rail"
    "conv rail"
    "context rail"
    "goal rail"
    "model rail"
    "queued rail"
    "input rail"
    "hint rail";
}
body.status-pos-right .conv-pane.has-status-rail > .conv-presentation-toolbar { grid-area: present-toolbar; min-width: 0; }
body.status-pos-right.status-rail-collapsed .conv-pane.has-status-rail {
  grid-template-areas:
    "header"
    "present-toolbar"
    "conv"
    "goal"
    "model"
    "queued"
    "input"
    "hint"
    "context";
}
body.status-pos-right.status-rail-collapsed .conv-pane.has-status-rail.has-new-session-context {
  grid-template-areas:
    "header"
    "present-toolbar"
    "conv"
    "context"
    "goal"
    "model"
    "queued"
    "input"
    "hint";
}

@media (max-width: 760px) {
  .conv-presentation-toolbar { gap: 6px; padding-inline: 8px; }
  .conv-presentation-toolbar-label,
  .conv-presentation-zero-cost { display: none; }
  .conv-presentation-segment { width: 100%; }
  .conv-presentation-mode { flex: 1 1 auto; padding-inline: 5px; }
  .conversations-view.is-presentation-mode { padding: 7px; }
  .conv-presentation-side-nav { width: 46px; height: 56px; border-radius: 14px; font-size: 25px; }
  .conv-presentation-side-nav.is-prev { left: 4px; }
  .conv-presentation-side-nav.is-next { right: 4px; }
  .conv-presentation-slide { padding: 16px 14px; border-radius: 12px; }
  .conv-mode3-header { gap: 10px; }
  .conv-mode3-deck-label { display: none; }
  .conv-mode3-comparison { grid-template-columns: 1fr; }
  .conv-presentation-prompt { grid-template-columns: 1fr; gap: 3px; margin-bottom: 13px; }
  .is-presentation-mode .conv-presentation-body.assistant-text { font-size: 16px; line-height: 1.55; }
  .conv-presentation-progress { grid-template-columns: minmax(70px, 1fr) auto; gap: 6px; }
  .conv-presentation-dots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .conv-presentation-slide,
  .conv-presentation-live::before,
  .conv-presentation-live-region .cl-pulse,
  .conv-mode3-status-pulse { animation: none; }
}


/* ── W93 settings modal ── */
/* Command-palette-style replacement for the old gear-button popover menu
   (#settingsPopover, removed — see static/index.html near #settingsModal).
   Markup + styling only in this slice; open/close, search filtering, and
   keyboard nav are wired in Slice B (app.js). Follows the same hidden-by-
   default + .open-class-to-show convention as .upd-overlay/.upd-overlay.open
   elsewhere in this file — Slice B toggles both the `hidden` attribute and
   the `.open` class when it wires the modal up. */
.settings-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
}
.settings-modal-overlay.open { display: flex; }
.settings-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.settings-modal {
  position: relative;
  width: min(1180px, calc(100vw - 40px));
  height: min(820px, calc(100vh - 48px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}

/* Header: search + esc hint + close */
.settings-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.settings-search-wrap {
  position: relative; flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center;
}
.settings-search-icon {
  position: absolute; left: 10px;
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
.settings-search-input {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px 8px 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit; font-size: 13px;
  outline: none;
}
.settings-search-input:focus { border-color: var(--accent); }
.settings-esc-hint {
  flex: 0 0 auto;
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap;
}
.settings-modal-close {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}
.settings-modal-close:hover { background: var(--surface-2); color: var(--text); }

/* Body: rail + pane */
.settings-modal-body {
  flex: 1 1 auto; min-height: 0;
  display: flex;
}
.settings-rail {
  flex: 0 0 200px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 8px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.settings-rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: none;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 13px; font-weight: 500;
  text-align: left; cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}
/* Kimi-web settings look: text-only rail items, soft accent pill when active. */
.settings-rail-item svg { display: none; }
.settings-rail-item span { flex: 1 1 auto; min-width: 0; }
.settings-rail-item:hover { background: var(--surface-2); color: var(--text); }
.settings-rail-item.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.settings-pane {
  flex: 1 1 auto; min-width: 0;
  overflow-y: auto;
  padding: 6px 24px 24px;
}
/* Single-panel mode (kimi-web parity): one section at a time; the search
   view (.is-searching) overrides to show every section with matches. */
.settings-modal:not(.is-searching) .settings-pane .settings-section { display: none; }
.settings-modal:not(.is-searching) .settings-pane .settings-section.is-active-section { display: block; }
/* Sections read as calm groups separated by one hairline (kimi's .sec),
   instead of every row carrying its own border. */
.settings-section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-section-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin-bottom: 10px;
}

/* Intro note under a section eyebrow (e.g. Experimental caveat). */
.settings-section-note {
  font-size: 12px; line-height: 1.5; color: var(--text-muted);
  margin: -2px 0 12px;
}

/* Sub-group heading nested inside a section (e.g. "Default for new
   sessions" / "Default for workers" inside Sessions & Spawning). Smaller
   and less prominent than .settings-section-eyebrow so it reads as a
   subdivision, not a new section. */
.settings-subsection-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  margin: 14px 0 4px;
}
.settings-subsection-label:first-of-type { margin-top: 2px; }

/* Rows: label/desc on the left, control on the right. One of three
   affordances per row (setting / action / launcher) — never mixed.
   No per-row borders (kimi-web look: the section hairline does the
   grouping); compact 38px minimum row height. */
.settings-row[hidden] { display: none; }
.settings-row {
  display: flex; align-items: center; gap: 16px;
  min-height: 38px;
  padding: 7px 0;
  position: relative;
}
a.settings-row {
  text-decoration: none; color: inherit;
  cursor: pointer;
}
.settings-row-main { flex: 1 1 auto; min-width: 0; }
.settings-row-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.settings-row-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
/* Outcome line for a row whose -desc is rewritten by a poller. Keeping it
   separate is the whole point: the 20s control-plane refresh would otherwise
   erase the result of the click you just made. */
.settings-row-note { font-size: 11.5px; margin-top: 5px; line-height: 1.4;
  border-radius: 6px; padding: 5px 8px;
  background: var(--surface-2); color: var(--text-muted); }
.settings-row-note[hidden] { display: none; }
.settings-row-note.is-busy { color: var(--text); }
.settings-row-note.is-ok { color: var(--green, #3fb950);
  background: rgba(63, 185, 80, 0.12); }
.settings-row-note.is-error { color: var(--red);
  background: rgba(248, 81, 73, 0.12); }
.settings-row-control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.settings-row-value { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.settings-row-crumb {
  font-size: 10.5px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 3px;
}

/* Segmented control (Theme / Font) */
.settings-segmented {
  display: inline-flex; padding: 2px;
  background: var(--surface-2);
  border-radius: 8px;
  gap: 2px;
}
.settings-segment {
  border: none; background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}
.settings-segment:hover { color: var(--text); }
.settings-segment.is-active {
  background: var(--accent); color: var(--accent-contrast); font-weight: 600;
}

/* Toggle switch (32x18) */
.settings-toggle {
  border: none; background: transparent; padding: 0; cursor: pointer;
  line-height: 0;
}
.settings-toggle-track {
  display: inline-block; width: 32px; height: 18px;
  border-radius: 999px; background: var(--surface-2);
  position: relative;
  transition: background 0.12s ease-out;
}
.settings-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.12s ease-out, background 0.12s ease-out;
}
.settings-toggle.is-on .settings-toggle-track { background: var(--accent); }
.settings-toggle.is-on .settings-toggle-thumb {
  background: var(--accent-contrast);
  transform: translateX(14px);
}

/* Action rows (bordered button naming the verb) */
.settings-action-btn {
  padding: 6px 14px; font-size: 12.5px; font-weight: 500;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  font-family: inherit; cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease-out, border-color 0.12s ease-out;
}
.settings-action-btn:hover { background: var(--surface-2); }
.settings-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.settings-action-btn.danger {
  color: var(--red);
  border-color: rgba(248,81,73,0.35);
  background: rgba(248,81,73,0.08);
}
.settings-action-btn.danger:hover { background: rgba(248,81,73,0.16); }

/* ── Engines hub (Settings → Engines) ──
   Hero summary, two defaults cards, then one row per engine. Status reads
   left to right in a fixed order (installed, signed in, usage) so the eye
   can scan a column instead of reading each row. */
.eng-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--surface);
}
.eng-hero-main { flex: 1 1 260px; min-width: 0; }
.eng-hero-title { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.eng-hero-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.eng-hero-stats { display: flex; gap: 8px; }
.eng-stat {
  min-width: 74px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
  display: flex; flex-direction: column; gap: 1px;
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.12s ease-out, background 0.12s ease-out;
}
.eng-stat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.eng-stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.eng-stat.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}
.eng-stat-num { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.1; }
.eng-stat-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.eng-stat.is-ok .eng-stat-num { color: var(--green); }
.eng-stat.is-warn .eng-stat-num { color: var(--orange); }

/* Two one-line strips: title, then each control with a short inline label.
   The long descriptions stay in the DOM for settings search only. */
.eng-defaults {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); overflow: hidden;
}
.eng-card { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 18px; padding: 5px 14px; }
.eng-card + .eng-card { border-top: 1px solid var(--border); }
.eng-card-head { flex: 0 0 96px; }
.eng-card-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.eng-card-sub { display: none; }
.eng-defaults-card .settings-row { min-height: 30px; padding: 0; gap: 7px; border: 0; width: auto; flex: 0 0 auto; }
.eng-defaults-card .settings-row-main { flex: 0 0 auto; }
.eng-defaults-card .settings-row-desc { display: none; }
.eng-defaults-card .settings-row-label { font-size: 11.5px; font-weight: 450; color: var(--text-muted); }
.eng-defaults-card .settings-row-control { min-width: 0; gap: 4px; }
.eng-defaults-card .settings-row-control select,
.eng-defaults-card .settings-row-control input[type="text"] { max-width: 170px; font-size: 12px; padding-top: 3px; padding-bottom: 3px; }
.eng-defaults-card .settings-number-input { width: 52px; }
.eng-defaults-card .settings-suffix { font-size: 11.5px; color: var(--text-muted); }

.eng-list-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin: 18px 0 8px;
}
.eng-list-head .settings-subsection-label { margin: 0; }

.eng-list {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); overflow: hidden;
}
.eng-list-empty { padding: 18px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.eng-row + .eng-row { border-top: 1px solid var(--border); }
.eng-row-head { display: flex; align-items: center; gap: 12px; padding-right: 14px; }
.eng-row-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0 10px 14px;
  border: 0; background: transparent; color: inherit; font: inherit;
  text-align: left; cursor: pointer;
}
.eng-row-head:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.eng-row-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.eng-mono {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  color: hsl(var(--eng-hue) 70% 78%);
  background: hsl(var(--eng-hue) 45% 22%);
  border: 1px solid hsl(var(--eng-hue) 45% 32%);
}
[data-theme="light"] .eng-mono {
  color: hsl(var(--eng-hue) 60% 30%);
  background: hsl(var(--eng-hue) 70% 93%);
  border-color: hsl(var(--eng-hue) 50% 82%);
}
.eng-id { flex: 0 0 172px; min-width: 0; display: flex; flex-direction: column; }
.eng-name { font-size: 13.5px; font-weight: 550; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.eng-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Fixed tracks, not wrapping flex: the three signals line up as columns
   down the list whatever each pill happens to say. */
.eng-status {
  flex: 1 1 auto; min-width: 0;
  display: grid; grid-template-columns: 100px 140px minmax(0, 1fr);
  align-items: center; justify-items: start; gap: 6px;
}
.eng-pill {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap;
}
.eng-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.eng-pill.is-ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); background: color-mix(in srgb, var(--green) 9%, transparent); }
.eng-pill.is-bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 9%, transparent); }
.eng-pill.is-muted .eng-pill-dot { opacity: 0.5; }
.eng-usage { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; margin-left: 2px; }
.eng-usage-bar { width: 64px; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.eng-usage-fill { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.eng-usage.is-warn .eng-usage-fill { background: var(--orange); }
.eng-usage.is-warn .eng-usage-text { color: var(--orange); }
.eng-usage.is-bad .eng-usage-fill { background: var(--red); }
.eng-usage.is-bad .eng-usage-text { color: var(--red); }
.eng-row-default { flex: 0 0 194px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.eng-default-for { font-size: 10.5px; color: var(--text-muted); margin-right: 3px; white-space: nowrap; }
.eng-default-chip {
  width: 68px; box-sizing: border-box; text-align: center;
  border: 1px solid var(--border); border-radius: 6px; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 11.5px; padding: 3px 0;
  white-space: nowrap;
  transition: color 0.12s ease-out, border-color 0.12s ease-out, background 0.12s ease-out;
}
button.eng-default-chip { cursor: pointer; }
button.eng-default-chip:hover, button.eng-default-chip:focus-visible {
  color: var(--accent-contrast); background: var(--accent); border-color: var(--accent);
}
.eng-default-chip.is-active {
  font-weight: 600; color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.eng-default-chip.is-blank { border-color: transparent; }
.eng-chev { flex: 0 0 auto; width: 14px; height: 14px; color: var(--text-muted); transition: transform 0.15s ease-out; }
.eng-row.is-open .eng-chev { transform: rotate(180deg); }
.eng-row.is-off .eng-row-main { opacity: 0.5; }

.eng-drawer { padding: 2px 14px 14px 58px; display: flex; flex-direction: column; gap: 10px; }
.eng-step {
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--accent) 9%, transparent); padding: 8px 12px;
}
.eng-step.is-warn { border-left-color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.eng-step-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.eng-step-body { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.eng-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 0; }
.eng-facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.eng-facts dd { margin: 1px 0 0; font-size: 12px; color: var(--text); overflow-wrap: anywhere; font-family: var(--font-mono, ui-monospace, monospace); }
.eng-cmd {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); padding: 6px 6px 6px 10px;
}
.eng-cmd-label { flex: 0 0 auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.eng-cmd code { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--text); overflow-x: auto; white-space: nowrap; background: none; padding: 0; }
.eng-cmd-copy {
  flex: 0 0 auto; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 11.5px; padding: 3px 9px; cursor: pointer;
}
.eng-cmd-copy:hover { background: var(--surface-2); }
.eng-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eng-actions .eng-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.eng-actions .eng-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.eng-links { margin-left: auto; display: inline-flex; gap: 12px; }
.eng-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.eng-link:hover { text-decoration: underline; }
.eng-drawer .settings-row-note { margin-top: 0; }

@media (max-width: 860px) {
  .eng-id { flex-basis: 140px; }
  .eng-row-default { flex-basis: auto; }
  .eng-drawer { padding-left: 14px; }
}
@media (max-width: 620px) {
  .eng-row-main { flex-wrap: wrap; }
  .eng-status { flex-basis: 100%; padding-left: 44px; display: flex; flex-wrap: wrap; }
  .eng-list-head { flex-direction: column; align-items: flex-start; }
}

/* BYOK key-add form + profile chips (Settings → Engines) */
.settings-text-input, .settings-select {
  padding: 6px 10px; font-size: 12.5px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  font-family: inherit;
}
.byok-add-form {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 8px;
}
.byok-add-form .settings-text-input { flex: 1 1 160px; min-width: 120px; }
.byok-profile-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; margin: 2px 4px 2px 0;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 12px;
}
.byok-profile-chip .byok-chip-delete {
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0;
}
.byok-profile-chip .byok-chip-delete:hover { color: var(--red); }

/* Vault (Settings → Vault): add/edit/import form + entry rows */
.vault-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px; margin-top: 8px;
}
.vault-form .settings-text-input, .vault-form .settings-select { width: 100%; box-sizing: border-box; }
.vault-form .vault-form-wide, .vault-form .vault-form-actions { grid-column: 1 / -1; }
.vault-form .settings-text-input[readonly] { opacity: 0.7; }
.vault-form-actions { display: flex; gap: 6px; }
.vault-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.vault-entry {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2);
}
.vault-entry-main { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.vault-entry-main strong { color: var(--text); font-weight: 600; }
.vault-entry-meta { flex-basis: 100%; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.vault-kind-chip {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted);
}
.vault-saved { font-size: 12px; color: var(--text-muted); }
.vault-entry-actions { display: flex; gap: 6px; flex-shrink: 0; }
.vault-entry-actions .vault-danger:hover { color: var(--red); border-color: var(--red); }
@media (max-width: 640px) {
  .vault-form { grid-template-columns: 1fr; }
  .vault-entry { flex-direction: column; }
}

/* Launcher rows ("Open ↗") */
.settings-launcher-btn {
  display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 500; color: var(--accent);
  white-space: nowrap;
}
.settings-launcher-arrow { font-size: 12px; }
a.settings-row:hover .settings-launcher-btn,
a.settings-row:focus-visible .settings-launcher-btn { text-decoration: underline; }

/* Reset-to-defaults quiet text buttons */
.settings-reset-row { padding: 12px 0 4px; }
.settings-reset-btn {
  border: none; background: transparent; padding: 0;
  font-family: inherit; font-size: 12px; color: var(--text-muted);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.settings-reset-btn:hover { color: var(--text); }

/* ✓ Saved pulse — flashes at a row's right edge on any change, fades ~1.2s */
.settings-saved-pulse {
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 12px; font-weight: 600; color: var(--green);
  pointer-events: none;
  animation: settings-saved-fade 1.2s ease-out forwards;
}
.settings-saved-pulse::before { content: "\2713 Saved"; }
@keyframes settings-saved-fade {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .settings-saved-pulse { animation: none; opacity: 0; }
}

/* Search / flat-results mode: rail dims, matched rows show a breadcrumb.
   Slice B toggles `.is-searching` on `.settings-modal` while the search
   input is non-empty and re-renders `.settings-pane` as a flat list. */
.settings-modal.is-searching .settings-rail { opacity: 0.45; }
.settings-modal.is-searching .settings-rail-item.is-active { opacity: 1; }
.settings-modal.is-searching .settings-row-crumb { display: block; }
.settings-row-crumb { display: none; }

/* Empty state ("No settings match '...'") */
.settings-empty-state {
  padding: 40px 20px;
  text-align: center;
}
.settings-empty-state-text {
  font-size: 13px; color: var(--text); margin-bottom: 4px;
}
.settings-empty-state-hint {
  font-size: 11.5px; color: var(--text-muted);
}

/* Tools-section slot: children arrive at boot as arbitrary buttons/pills
   (Terminal, History, Worktrees, Stats, Today, Notes, COO) moved here by
   Slice B's retargeted `_moveToHome`. Force them to read as launcher rows
   regardless of their own class. */
.settings-modal-tools-slot { display: flex; flex-direction: column; }
.settings-modal-tools-slot > * {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box;
  text-align: left !important;
  font-size: 13px !important;
  padding: 9px 4px !important;
  margin: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
}
.settings-modal-tools-slot > *:last-child { border-bottom: none !important; }
.settings-modal-tools-slot > *:hover { background: var(--surface-2) !important; }

/* Appearance section's "Conversation text size" slot: Slice B moves the
   existing `.font-size-controls` (A-/A+ stepper) in here. */
.settings-modal-font-slot:empty { min-width: 0; }

/* Mobile ≤700px: full-screen sheet, rail becomes horizontal scrollable chips */
@media (max-width: 700px) {
  .settings-modal {
    width: 100vw; height: 100%;
    max-width: 100vw; max-height: 100vh;
    border-radius: 0; border: none;
  }
  .settings-modal-body { flex-direction: column; }
  .settings-rail {
    flex: 0 0 auto;
    flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 8px; gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .settings-rail-item {
    flex: 0 0 auto;
    border-left: none; border-bottom: 2px solid transparent;
    border-radius: 999px;
    background: var(--surface-2);
    white-space: nowrap;
  }
  .settings-rail-item.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .settings-pane { padding: 14px 16px 20px; }
  .settings-row { flex-wrap: wrap; }
  .settings-row-control { flex: 1 1 100%; justify-content: flex-start; margin-top: 6px; }
}

/* ── Activity log modal ──────────────────────────────────────────────────
   Reuses .settings-modal-overlay/.settings-modal-backdrop for the shared
   overlay-and-backdrop convention; everything below is specific to this
   modal's content. Opened from the status rail's "Log" button
   (see .status-rail-activity-log-btn) — shows CCC's own spawn/inject/
   kill/codex-app-server-health feed (~/.claude/command-center/logs/
   activity.log), filtered to the open session. */
.activity-log-modal {
  position: relative;
  width: min(720px, calc(100vw - 40px));
  height: min(640px, calc(100vh - 48px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}
.activity-log-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.activity-log-modal-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-log-modal-scope {
  flex: 0 0 auto;
  display: flex; gap: 2px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px;
}
.activity-log-scope-btn {
  border: none; background: transparent; color: var(--text-muted);
  font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer;
}
.activity-log-scope-btn:hover { color: var(--text); }
.activity-log-scope-btn.is-active { background: var(--surface-2); color: var(--text); }
.activity-log-modal-close {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}
.activity-log-modal-close:hover { background: var(--surface-2); color: var(--text); }
.activity-log-modal-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 12px;
}

/* ── Ticket note expand modal ────────────────────────────────────────────
   Also reuses .settings-modal-overlay/.settings-modal-backdrop. Opened via
   the "+" button on a caveat/follow-up/unresolved chip (.uxq-note-expand-btn)
   — a bigger font and more line breathing room than the cramped inline chip
   so a multi-sentence note is actually readable (CCC-1023). */
/* This overlay is opened from inside the ticket-detail modal
   (.uxq-td-overlay, z-index 100000) - needs to stack above it. */
.uxq-note-overlay { z-index: 100010; }
.uxq-note-modal {
  position: relative;
  width: min(640px, calc(100vw - 40px));
  max-height: min(560px, calc(100vh - 48px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}
.uxq-note-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.uxq-note-modal-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.uxq-note-modal-close {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}
.uxq-note-modal-close:hover { background: var(--surface-2); color: var(--text); }
.uxq-note-modal-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  overflow-wrap: anywhere;
}
.uxq-note-modal-body p { margin: 0 0 14px; }
.uxq-note-modal-body p:last-child { margin-bottom: 0; }
.activity-log-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.activity-log-row:hover { background: var(--surface-2); }
.activity-log-ts {
  flex: 0 0 auto;
  color: var(--text-muted); font-size: 11px; white-space: nowrap;
}
.activity-log-verb {
  flex: 0 0 auto;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  padding: 1px 6px; border-radius: 4px;
  text-transform: uppercase;
  background: var(--surface-2); color: var(--text-muted);
  white-space: nowrap;
}
.activity-log-verb.is-good { background: rgba(63,185,80,0.16); color: #3fb950; }
.activity-log-verb.is-bad { background: rgba(248,81,73,0.16); color: #f85149; }
.activity-log-verb.is-warn { background: rgba(210,153,34,0.16); color: #d29922; }
.activity-log-verb.is-info { background: rgba(88,166,255,0.16); color: var(--accent); }
.activity-log-detail {
  flex: 1 1 auto; min-width: 0;
  color: var(--text); word-break: break-word;
  white-space: pre-wrap;
}
.activity-log-row.is-good .activity-log-detail { color: #3fb950; }
.activity-log-row.is-bad .activity-log-detail { color: #f85149; }
.activity-log-row.is-warn .activity-log-detail { color: #d29922; }
.activity-log-empty, .activity-log-error {
  padding: 24px 14px; text-align: center;
  color: var(--text-muted); font-size: 12px;
  font-family: var(--font-ui);
}
.activity-log-error { color: #f85149; }

/* ── F2 cold-session composer ────────────────────────────────────────────
   When a session is BOTH large AND stale (prompt cache likely cold), the
   composer stops offering Send and renders a route stack instead. Two slots
   inside .conv-input-bar: `.f2c-rail` above the textarea (session-row data
   only, so it paints at focus) and `.f2c-panel` below it (needs the typed
   text, so it re-ranks on input).

   The shape is deliberately minimal: ONE line — the priced verdict on the
   left, a single "Start new from here" pill on the right. Send remains the
   ordinary submit. The engine+model+effort choice hides behind a ▾ caret
   that opens a follow-up dialog below the line. Semantic class
   names (.route/.tag/.cost-badge/.verdict/…) are scoped under .f2c-rail /
   .f2c-panel — they are generic enough that unscoped rules would collide
   across a 20k-line stylesheet. Colors come from the CCC vars; the only
   literals are the existing green/amber semantics (#3fb950 free, #d29922
   warning). */
.f2c-rail[hidden], .f2c-panel[hidden] { display: none !important; }

/* CCC-740: the panel now lives inside .conv-input-buttons, in line with
   Esc/TTS/mic/expand/send, rather than its own row above the toolbar — pass
   the layout straight through so `.route` becomes an ordinary flex item of
   that row and picks up its gap/alignment for free. */
.conv-input-buttons > .f2c-panel { display: contents; }
.conv-input-buttons .f2c-panel .routes { display: contents; }

/* Status rail — the part that fires at focus, before a keystroke. */
.f2c-rail {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: #d29922;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.f2c-rail .rail-dot { width: 6px; height: 6px; border-radius: 50%; background: #d29922; flex: none; }
.f2c-rail strong { font-weight: 600; }
.f2c-rail .sep { color: var(--border); }
.f2c-rail .meta { color: var(--text-muted); }

/* Send stays the ordinary submit while the gate is hot — the verdict line
   states the price and the pill offers the alternative; nothing blocks. */
.conv-input-bar.is-f2-cold { border-color: rgba(210,153,34,0.38); }
/* Plain idle offer (no cache/size claim behind it) stays neutral gray
   rather than borrowing the amber "notice" tint the cache warning earns. */
.conv-input-bar.is-f2-idle-only { border-color: rgba(139,148,158,0.38); }

/* CCC-844/CCC-883: this session already moved to a new one (started from
   this window or another). The composer stays fully usable -- someone may
   want to send a different prompt to the older session -- so only the rail
   colors as a heads-up; the textarea itself is never dimmed or blocked. */
.conv-input-bar.is-f2-continued { border-color: rgba(248,81,73,0.55); }
.conv-input-bar.is-f2-continued .f2c-rail { color: #f85149; }
.conv-input-bar.is-f2-continued .f2c-rail .rail-dot { background: #f85149; }

/* The whole gate is ONE line: the price on the left, the one alternative
   pill on the right. The launch dialog (when open) wraps to its own row. The
   price verdict that used to render here as visible text now rides in the
   route pill's tooltip (CCC-740) — the panel now holds only the pill. */
.f2c-panel {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; min-width: 0;
}

.f2c-panel .routes { flex: 0 0 auto; display: flex; }
.f2c-panel .route {
  position: relative;
  display: flex; align-items: stretch; height: 32px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .14s ease, background .14s ease;
}
.f2c-panel .route:hover { border-color: var(--accent); }
.f2c-panel .route.is-recommended { border-color: rgba(63,185,80,0.45); }
.f2c-panel .route.is-recommended:hover { border-color: rgba(63,185,80,0.7); }
/* CCC-763: origin session that already continued into a new one -- a link,
   not an action, so it reads as blue rather than the green "recommended". */
.f2c-panel .route.is-continued { border-color: rgba(88,166,255,0.45); }
.f2c-panel .route.is-continued:hover { border-color: rgba(88,166,255,0.7); }
.f2c-panel .route.is-continued .route-glyph { color: #58a6ff; }

/* The clickable surface is a separate element from .route so the ▾ caret
   can be a real control rather than a button nested inside a button. */
.f2c-panel .route-main {
  display: flex; flex: 1; align-items: center; justify-content: center;
  gap: 7px; min-width: 0;
  background: none; border: none; padding: 0 8px;
  font: inherit; color: var(--text); cursor: pointer;
  border-radius: 8px;
}
.f2c-panel .route-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.f2c-panel .route-main:disabled { opacity: 0.55; cursor: progress; }
.f2c-panel .route-glyph {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px; color: var(--text-muted); line-height: 1.4; flex: none;
}
.f2c-panel .route.is-recommended .route-glyph { color: #3fb950; }
.f2c-panel .route-name {
  font-size: 12px; font-weight: 600; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.f2c-panel .cost-badge {
  flex: none;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}
.f2c-panel .cost-badge.free  { color: #3fb950; background: rgba(63,185,80,0.14); }
.f2c-panel .cost-badge.slice { color: var(--accent); background: rgba(110,140,175,0.18); }
.f2c-panel .cost-badge.warn  { color: #d29922; background: rgba(210,153,34,0.14); }

/* The ▾ caret on Continue — opens the launch-spec dialog. Its tooltip
   states the current engine/model/effort before you ever open it. */
.f2c-panel .f2c-chip {
  flex: none; display: inline-flex; align-items: center;
  font: inherit; font-size: 10px; color: var(--text-muted);
  background: none; border: none; border-left: 1px solid var(--border);
  padding: 0 7px; cursor: pointer;
  border-radius: 0 8px 8px 0;
}
.f2c-panel .f2c-chip:hover { color: var(--text); background: rgba(110,140,175,0.12); }
.f2c-panel .f2c-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The follow-up dialog: engine + model + effort stated as a sentence rather
   than a form. Never a required decision — the caret's tooltip already says
   what the route will launch on. Anchored to .route (its parent, position:
   relative). Open above the composer so the pane's bottom overflow boundary
   cannot clip the model, effort, or quick-pick controls. */
.f2c-panel .f2c-config {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  width: max-content; max-width: 320px;
  margin: 0; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-size: 11.5px; color: var(--text-muted);
}
.f2c-panel .f2c-config .f2c-select {
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 6px; cursor: pointer; max-width: 150px;
}
.f2c-panel .f2c-config .f2c-select:hover { border-color: var(--accent); }
.f2c-panel .f2c-config .f2c-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.f2c-quick-picks {
  display: flex; align-items: center; flex-basis: 100%; flex-wrap: wrap;
  gap: 4px; padding-top: 2px;
}
.f2c-quick-picks-label {
  font-size: 10px; color: var(--text-muted); margin-right: 2px;
}
.f2c-quick-pick {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  height: 22px; padding: 0 7px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); font: inherit; font-size: 10px;
  cursor: pointer;
}
.f2c-quick-pick:hover { color: var(--text); border-color: var(--accent); }
.f2c-quick-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── Continue-in-new-session card ──────────────────────────────────────
   The inline pill was a control; this is a proposal, so it needs room for a
   headline, a rationale, and a symmetric pair of choices. The toolbar row
   flattens .f2c-panel/.routes with `display: contents`, so a card inside it
   would become a stray flex item between the mic and send buttons. Undo that
   locally and float the card above the input bar instead — the toolbar keeps
   its layout and the card gets a full-width line of its own. */
.conv-input-bar { position: relative; }
.conv-input-buttons > .f2c-panel:has(.f2-card),
.f2c-panel:has(.f2-card) .routes { display: block; }
.f2c-panel .f2-card {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  z-index: 30;
  display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid #58a6ff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: f2cSettle .16s ease both;
  text-align: left;
}
.f2c-panel .f2-card-head { position: relative; padding: 12px 14px 10px; }
.f2c-panel .f2-card-title {
  font-size: 13.5px; font-weight: 650; line-height: 1.35;
  color: #58a6ff; letter-spacing: -0.01em;
  padding-right: 26px;
}
.f2c-panel .f2-card-close {
  position: absolute; top: 9px; right: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  font-size: 18px; line-height: 1; color: var(--text-muted);
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer;
  transition: color .14s ease, background .14s ease, border-color .14s ease;
}
.f2c-panel .f2-card-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--border); }
.f2c-panel .f2-card-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.f2c-panel .f2-card-sub {
  margin-top: 4px;
  font-size: 12px; line-height: 1.45; color: var(--text-muted);
}
.f2c-panel .f2-card-actions {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-top: 1px solid var(--border);
}
.f2c-panel .f2-card-primary {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  background: var(--surface-1, transparent);
  border: 1px solid var(--border); border-radius: 7px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.f2c-panel .f2-card-primary:hover { border-color: rgba(63, 185, 80, 0.7); }
.f2c-panel .f2-card-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.f2c-panel .f2-card-primary:disabled { opacity: 0.55; cursor: progress; }
.f2c-panel .f2-card-primary .route-glyph { color: #3fb950; }
/* The caret sits inside the card's action row and names the target model, so
   the spec is readable on the card face instead of only in a tooltip. */
.f2c-panel .f2-card-actions .f2c-chip {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: auto; height: 30px; padding: 0 9px;
  font: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--text-muted); background: transparent;
  border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  max-width: 45%;
}
.f2c-panel .f2-card-actions .f2c-chip:hover { border-color: var(--accent); color: var(--text); }
.f2c-panel .f2-card-actions .f2c-chip[aria-expanded="true"] { border-color: var(--accent); color: var(--text); }
.f2c-panel .f2c-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f2c-panel .f2c-chip-caret { flex: 0 0 auto; opacity: 0.8; }

/* Picker lives in the card as its own row below the actions. */
.f2c-panel .f2-card .f2c-config {
  margin: 0; padding: 9px 12px;
  border: 0; border-top: 1px solid var(--border); border-radius: 0;
  background: rgba(255, 255, 255, 0.02);
}

.f2c-panel .f2-card-ghost {
  height: 30px; padding: 0 10px;
  background: none; border: 1px solid transparent; border-radius: 7px;
  font: inherit; font-size: 12px; color: var(--text-muted); cursor: pointer;
  transition: color .14s ease, background .14s ease;
}
.f2c-panel .f2-card-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.f2c-panel .f2-card-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Push the launch-spec caret to the trailing edge; it is a modifier on the
   primary action, not a third choice. */
.f2c-panel .f2-card-actions .f2c-chip {
  margin-left: auto; border-left: 0;
  padding: 0 6px; height: 30px; border-radius: 7px;
}
@media (prefers-reduced-motion: reduce) {
  .f2c-panel .f2-card { animation: none !important; }
}

@keyframes f2cSettle { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.f2c-panel .routes > .route { animation: f2cSettle .16s ease both; }
@media (prefers-reduced-motion: reduce) {
  .f2c-panel .routes > .route { animation: none !important; }
  .f2c-panel .route { transition: none !important; }
}

/* ── Mobile: keep the Continue-new pill from shoving TTS/mic/send off-screen.
   The pill is flattened into .conv-input-buttons via display:contents; without
   an explicit min-width it refuses to shrink and forces the whole button row
   past the viewport edge. Let the pill and its label/model chip compress, and
   allow the button cluster itself to shrink rather than staying flex-shrink:0. */
@media (max-width: 1200px) {
  .conv-input-buttons { flex: 0 1 auto; min-width: 0; }
  .conv-input-buttons .route {
    min-width: 0;
    flex: 0 1 auto;
  }
  .conv-input-buttons .route-main { min-width: min(70px, 20vw); flex: 1 1 auto; }
  .conv-input-buttons .route-name { min-width: 0; }
  .conv-input-buttons .f2c-chip {
    flex: 0 0 auto;
    min-width: 0;
    max-width: min(90px, 24vw);
  }
  .conv-input-buttons .f2c-chip-label { min-width: 0; }
}

/* The desktop status rail becomes the top status layout on mobile. Its
   content is re-parented by _applyStatusRailLayout when the breakpoint
   changes, so the rail never consumes phone-width conversation space. */
@media (max-width: 1200px) {
  body.status-pos-right:not(.popout-rail-forced) .conv-pane.has-status-rail,
  body.status-pos-right.status-rail-collapsed:not(.popout-rail-forced) .conv-pane.has-status-rail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "present-toolbar"
      "conv"
      "context"
      "goal"
      "model"
      "queued"
      "input"
      "hint";
  }
  body.status-pos-right:not(.popout-rail-forced) .conv-pane.has-status-rail > .status-rail,
  body.status-pos-right.status-rail-collapsed:not(.popout-rail-forced) .conv-pane.has-status-rail > .status-rail {
    display: none;
  }
  body.status-pos-right:not(.popout-rail-forced) .conv-pane.has-status-rail > .status-rail-restore,
  body.status-pos-right.status-rail-collapsed:not(.popout-rail-forced) .conv-pane.has-status-rail > .status-rail-restore {
    display: none;
  }
  body.status-pos-right .conv-sticky-header {
    display: block !important;
    max-height: none;
  }
  body.status-pos-right .conversations-view .event.user_text.is-pinned-in-sticky {
    display: none;
  }
  /* Narrow popout windows are still a real desktop window, not a phone —
     the mobile-collapse fallback above hides the rail with no way back
     (CCC-831: "no side knob to open the RHS view"). #popoutSidePanelBtn
     toggles this override so the user can force the full rail back even
     under the 1200px breakpoint; the rail becomes horizontally scrollable
     at its min width rather than vanishing outright. */
  body.conversation-popout:not(.popout-rail-forced) #popoutSidePanelBtn {
    display: inline-flex;
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(57,210,192,0.55);
    border-radius: 999px;
    background: var(--panel, #161b22);
    color: var(--text);
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    cursor: pointer;
    font: 600 12px/1 inherit;
  }
  body.popout-rail-forced .conv-pane.has-status-rail {
    grid-template-rows: auto 1fr auto auto auto auto auto auto;
    grid-template-columns: minmax(0, 1fr) var(--status-rail-width, 260px);
    grid-template-areas:
      "header  rail"
      "conv    rail"
      "goal    rail"
      "model   rail"
      "queued rail"
      "input   rail"
      "context rail"
      "hint    rail";
  }
  body.popout-rail-forced .conv-pane.has-status-rail > .status-rail {
    display: flex;
  }
  /* CCC-95: same dead end in the main window. A narrow desktop window with
     a conversation open hid the rail with no knob to reopen it. Phones
     (coarse pointer) keep the stacked mobile layout instead. */
  @media not all and (pointer: coarse) {
    body.mobile-show-main:not(.conversation-popout):not(.popout-rail-forced) #popoutSidePanelBtn {
      display: inline-flex;
      position: fixed;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      z-index: 9000;
      align-items: center;
      justify-content: center;
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid rgba(57,210,192,0.55);
      border-radius: 999px;
      background: var(--panel, #161b22);
      color: var(--text);
      box-shadow: 0 2px 10px rgba(0,0,0,0.35);
      cursor: pointer;
      font: 600 12px/1 inherit;
    }
  }
}

/* Narrow or app-embedded pane (composer has .actions-in-menu, set by app.js
   _initConvActionsMenu): the info bar (path, context meter, model chip) sits
   BELOW the composer row instead of above it. Same breakpoint and body
   selectors as the mobile status layout above, so it wins over its areas. */
/* CCC-404: narrow mode keeps the status row (branch, context, model, TS)
   directly BELOW the composer, as in wide mode. New-session panes keep it
   above: that strip holds the folder and model pickers. */
@media (max-width: 1200px) {
  body.status-pos-right:not(.popout-rail-forced) .conv-pane.has-status-rail:not(.has-new-session-context),
  body.status-pos-right.status-rail-collapsed:not(.popout-rail-forced) .conv-pane.has-status-rail:not(.has-new-session-context) {
    grid-template-areas:
      "header"
      "present-toolbar"
      "conv"
      "goal"
      "model"
      "queued"
      "input"
      "context"
      "hint";
  }
}

@media (max-width: 1200px) {
  body.status-pos-right:not(.popout-rail-forced) .conv-pane.has-status-rail:not(.has-new-session-context):has(> .conv-input-bar.actions-in-menu),
  body.status-pos-right.status-rail-collapsed:not(.popout-rail-forced) .conv-pane.has-status-rail:not(.has-new-session-context):has(> .conv-input-bar.actions-in-menu) {
    grid-template-areas:
      "header"
      "present-toolbar"
      "conv"
      "goal"
      "model"
      "queued"
      "input"
      "hint"
      "context";
  }
}

/* =========================================================================
   MOBILE REDESIGN (body.ccc-mobile-redesign)
   Gated by isMobileRedesign() in app.js — matchMedia(max-width:1200px),
   ?mobile=1, or window.CCC_FORCE_MOBILE_REDESIGN. Aligned with the
   existing isMobile()/_mobileMQ pane-navigation breakpoint;
   these rules only ever apply under the .ccc-mobile-redesign body class,
   so desktop and the 768-1200px pane-nav range are unaffected.
   ========================================================================= */

/* ---- Kanban card: one dominant status line + collapsed Details ---- */
body.ccc-mobile-redesign .mobile-status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
body.ccc-mobile-redesign .mobile-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
body.ccc-mobile-redesign .mobile-status-line.is-working .mobile-status-dot {
  background: var(--green);
  animation: mobileStatusPulse 1.8s ease-in-out infinite;
}
body.ccc-mobile-redesign .mobile-status-line.is-stuck .mobile-status-dot { background: #d29922; }
body.ccc-mobile-redesign .mobile-status-line.is-offline .mobile-status-dot { background: var(--text-muted); opacity: 0.6; }
@keyframes mobileStatusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0.25); }
  50% { box-shadow: 0 0 0 5px rgba(63,185,80,0.12); }
}
body.ccc-mobile-redesign .mobile-status-word {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}
body.ccc-mobile-redesign .mobile-status-line.is-working .mobile-status-word { color: var(--green); }
body.ccc-mobile-redesign .mobile-status-line.is-stuck .mobile-status-word { color: #d29922; }
body.ccc-mobile-redesign .mobile-status-line.is-offline .mobile-status-word { color: var(--text-muted); }
body.ccc-mobile-redesign .mobile-status-detail {
  font-size: 12px;
  color: var(--text-muted);
}
body.ccc-mobile-redesign button.mobile-details-toggle {
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  color: var(--text-muted);
  border-radius: 7px;
  font-size: 12px;
  padding: 6px 12px;
  margin-top: 8px;
  min-height: 32px;
}
body.ccc-mobile-redesign button.mobile-details-toggle[aria-pressed="true"] {
  background: rgba(63,185,80,0.12);
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}
body.ccc-mobile-redesign .mobile-details-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
}
body.ccc-mobile-redesign .mobile-details-badges {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ---- Topbar: Simple mode never shows the raw session id ---- */
body.ccc-simple-mode #convSessionId { display: none !important; }

/* ---- Presentation toolbar: mobile plain-language view buttons ---- */
body.ccc-mobile-redesign .conv-presentation-segment { display: none !important; }
body.ccc-mobile-redesign .conv-presentation-toolbar-label { display: none !important; }
.mobile-view-toggle { display: none; }
body.ccc-mobile-redesign button.mobile-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  color: var(--text-muted);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  min-height: 32px;
}
body.ccc-mobile-redesign button.mobile-view-toggle[aria-pressed="true"] {
  background: rgba(63,185,80,0.10);
  border-color: var(--green);
  color: var(--green);
}
/* Collapsed by default — the picker previously stayed permanently open,
   eating the top of the conversation screen on every session. */
.conv-presentation-mobile-list { display: none; }
body.ccc-mobile-redesign .conv-presentation-mobile-list {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
}
body.ccc-mobile-redesign .conv-presentation-mobile-list.is-open { display: flex; }
body.ccc-mobile-redesign button.mobile-view-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  color: var(--text-muted);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
}
body.ccc-mobile-redesign button.mobile-view-btn[aria-pressed="true"] {
  background: rgba(63,185,80,0.10);
  border-color: var(--green);
}
body.ccc-mobile-redesign .mobile-view-name {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 2px;
}
body.ccc-mobile-redesign button.mobile-view-btn[aria-pressed="true"] .mobile-view-name { color: var(--green); }
body.ccc-mobile-redesign .mobile-view-desc {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
}

/* ---- Topbar: mobile "More" menu (collapses secondary actions) ---- */
body.ccc-mobile-redesign .mobile-more-wrap { position: relative; display: inline-flex; }
body.ccc-mobile-redesign button.mobile-more-btn {
  display: inline-flex !important;
  align-items: center;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  color: var(--text);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  min-height: 32px;
  margin-left: 8px;
}
body.ccc-mobile-redesign button.mobile-more-btn[aria-expanded="true"] {
  background: rgba(63,185,80,0.12);
  border-color: var(--green);
  color: var(--green);
}
body.ccc-mobile-redesign .mobile-more-menu {
  position: absolute;
  right: 8px;
  top: 100%;
  margin-top: 4px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
body.ccc-mobile-redesign .mobile-more-menu[hidden] { display: none; }
/* Reparented topbar buttons read as a stacked full-width action list
   inside the menu, instead of the inline pill row they render as in
   #cccTopbar on desktop. */
body.ccc-mobile-redesign .mobile-more-menu > * {
  width: 100%;
  min-height: 40px;
  justify-content: flex-start;
}

/* ---- Main session list (renderConversationList _renderRow): mobile
   status line + Details, same pattern as the kanban card. The desktop
   fragments (rowMetaHtml/hoverMetaRowHtml/etc.) are still built and
   inserted in JS unchanged — these rules just hide the originals and let
   the new mobile-status-line / mobile-details-panel (which contain the
   SAME html, copied not recomputed) stand in for them. ---- */
body.ccc-mobile-redesign .conv-item > .mobile-status-line {
  margin: 4px 8px 6px;
}
body.ccc-mobile-redesign .conv-item .conv-row-meta,
body.ccc-mobile-redesign .conv-item .conv-hover-meta-row,
body.ccc-mobile-redesign .conv-item .conv-history-badge,
body.ccc-mobile-redesign .conv-item .conv-pct-badge,
body.ccc-mobile-redesign .conv-item .conv-qc-badge,
body.ccc-mobile-redesign .conv-item .conv-goal,
body.ccc-mobile-redesign .conv-item .conv-goal-icon-only {
  display: none !important;
}
body.ccc-mobile-redesign .conv-item .mobile-details-toggle {
  margin: 2px 8px 6px;
}
body.ccc-mobile-redesign .conv-item .mobile-details-panel {
  margin: 0 8px 8px;
}
/* Inside the Details panel, the same chip/badge fragments should read as
   plain stacked text/chips again (not hidden by the blanket rule above,
   which only targets the always-visible main-row copies). */
body.ccc-mobile-redesign .conv-item .mobile-details-panel .conv-row-meta,
body.ccc-mobile-redesign .conv-item .mobile-details-panel .conv-hover-meta-row,
body.ccc-mobile-redesign .conv-item .mobile-details-panel .conv-history-badge,
body.ccc-mobile-redesign .conv-item .mobile-details-panel .conv-pct-badge,
body.ccc-mobile-redesign .conv-item .mobile-details-panel .conv-qc-badge,
body.ccc-mobile-redesign .conv-item .mobile-details-panel .conv-goal,
body.ccc-mobile-redesign .conv-item .mobile-details-panel .conv-goal-icon-only {
  display: inline-flex !important;
  margin: 2px 4px 2px 0;
}

/* Core-app frame: q2 overlays the dashboard without unloading #convList.
   Sits under the Applications rail (z-index 1000) and, on phones, above
   the bottom Sessions/Queues bar. */
.ccc-core-app-frame {
  display: none;
  position: fixed;
  top: 0;
  left: var(--ccc-rail-w, 76px);
  z-index: 900;
  border: 0;
  /* iframes ignore inset stretch (intrinsic 300x150); size them explicitly. */
  width: calc(100% - var(--ccc-rail-w, 76px));
  height: 100%;
  background: var(--bg, #0d1117);
}
.ccc-core-app-frame:not([hidden]) { display: block; }
body.has-mobile-bottom-nav .ccc-core-app-frame {
  height: calc(100% - 64px - env(safe-area-inset-bottom, 0px));
}
body.ccc-core-app-open.has-mobile-bottom-nav .mobile-bottom-nav { z-index: 950; }

/* ---- Mobile bottom nav (Simple Home/Tasks/Helpers/More AND Advanced
   Sessions/Queues). Layout lives here so Advanced can reuse the Simple
   chrome; simple.css only adds Simple-mode extras (icon size, sr-only). */
.mobile-bottom-nav { display: none; }
body.has-mobile-bottom-nav .mobile-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  /* Bottom inset is dead space below the icon row — shift the row down into
     it instead of leaving a tall empty strip under the icons. */
  padding: 12px 4px calc(2px + env(safe-area-inset-bottom, 0px));
}
body.has-mobile-bottom-nav .mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 4px;
  min-height: 48px;
}
body.has-mobile-bottom-nav .mobile-nav-btn.is-active {
  color: var(--green);
}
body.has-mobile-bottom-nav .mobile-nav-icon { font-size: 18px; line-height: 1; }
body.has-mobile-bottom-nav .mobile-nav-label { font-size: 10.5px; font-weight: 600; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .mobile-nav-btn[data-nav-chrome="simple"] { display: none; }
body.has-mobile-bottom-nav.ccc-simple-mode .mobile-nav-btn[data-nav-chrome="advanced"] { display: none; }
body.has-mobile-bottom-nav .mobile-nav-label { white-space: nowrap; }
/* ☰ menu: Jobs / Queues / Ask pop up above the bar's right edge. */
body.has-mobile-bottom-nav .mobile-nav-menu {
  position: absolute;
  right: 8px; bottom: calc(100% + 6px);
  display: flex; flex-direction: column;
  min-width: 180px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  /* Long menu (Decisions, Other, Jobs, ... Apps): cap to the space between
     the status-bar inset and the nav so the top items are never clipped
     under the notch, and scroll the rest. */
  max-height: calc(100dvh - 96px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.has-mobile-bottom-nav .mobile-nav-menu[hidden],
body.has-mobile-bottom-nav.ccc-simple-mode .mobile-nav-menu { display: none; }
body.has-mobile-bottom-nav .mobile-nav-menu .mobile-nav-btn {
  flex: 0 0 auto;
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
}
body.has-mobile-bottom-nav .mobile-nav-menu .mobile-nav-label { font-size: 15px; }
/* Phone Advanced: tabs live ONLY in the bottom nav — the in-list tab bar
   duplicates that chrome and eats vertical space. All/Other stay reachable
   via the bottom nav's ⋯ menu. */
body.has-mobile-bottom-nav:not(.ccc-simple-mode) #convList > .conv-tab-bar {
  display: none;
}
/* The hidden tab bar is still :first-child, so Coding/Workers kept the
   18px + hairline meant for a *following* section — a blank band above
   Expand all. Collapse that, and let the filter chips wrap as one row
   instead of parking Expand all on its own line. */
body.has-mobile-bottom-nav:not(.ccc-simple-mode) #convList .conv-archived-section {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
body.has-mobile-bottom-nav:not(.ccc-simple-mode) #convList .conv-archived-section > .conv-archived-tools {
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 6px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  /* Pin just below the also-sticky tab bar (--conv-tab-bar-h, measured in
     JS) — same treatment as the desktop rule. Do not use display:contents
     on the left/right slots: that drops this box and the sticky
     background, so rows ghost through the chips. */
  position: sticky;
  top: var(--conv-tab-bar-h, 0px);
  z-index: 6;
  background: var(--surface);
}
body.has-mobile-bottom-nav:not(.ccc-simple-mode) #convList .conv-inprogress-toolbar {
  position: sticky;
  top: var(--conv-tab-bar-h, 0px);
  background: var(--surface);
}
body.has-mobile-bottom-nav:not(.ccc-simple-mode) #convList .conv-archived-tools-left {
  display: flex;
  flex: 0 0 auto;
}
body.has-mobile-bottom-nav:not(.ccc-simple-mode) #convList .conv-archived-tools-right {
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
/* Reserve room at the bottom of the page so the fixed nav never overlaps
   the last card in the list. */
body.has-mobile-bottom-nav #convList {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* Pull-to-refresh on phone Coding/Workers. Sits above #convList so
   renderArchiveList innerHTML cannot wipe it. Height is driven in JS. */
.conv-ptr {
  flex: 0 0 auto;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.conv-ptr.is-active,
.conv-ptr.is-refreshing { overflow: hidden; }
.conv-ptr-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
}
.conv-ptr-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent, #58a6ff);
  border-radius: 50%;
  flex: 0 0 auto;
}
.conv-ptr.is-refreshing .conv-ptr-spinner {
  animation: conv-ptr-spin 0.7s linear infinite;
}
@keyframes conv-ptr-spin { to { transform: rotate(360deg); } }
.mobile-actions-wrap { position: relative; display: none; }

/* ---- Icon-first Simple mode: chrome communicates via icon+color+shape+
   motion, not English words. Task content (titles, agent replies) is
   untouched — this only affects UI chrome (nav, status, toggles). Text
   stays present for screen readers via .mobile-sr-only (visually hidden,
   not display:none, so assistive tech and text-to-speech still get it). */
.mobile-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   ICON-FIRST SIMPLE MODE — FEED LAYOUT (Instagram-style)
   Only under body.ccc-mobile-redesign.ccc-simple-mode. Structural: replaces
   the two stacked dashboard headers with one slim bar, collapses the
   competing tab/filter/metrics/footer strips so the session list reads as a
   clean feed with the bottom nav as the sole navigation. Desktop + Advanced
   untouched (guarded by the compound body class).
   ========================================================================= */

/* --- Slim header (shown only in simple mode) --- */
.mobile-simple-header { display: none; }
.send-btn .send-btn-label { display: none; }
/* iOS focus-zoom guard. Keep this after conversation-theme rules: themes may
   use !important typography (for example Stitch's 14px monospace composer).
   A focused control under 16px makes WebKit zoom the page and push Back out
   of the frame, unless the viewport has maximum-scale=1 — index.html adds
   that on iOS (pinch-zoom still works there), so the composer can use a
   smaller phone size. #cpInput keeps the 16px floor. */
@media (pointer: coarse), (max-width: 1200px) {
  #cpInput {
    font-size: 16px !important;
  }
  #convInput {
    font-size: 14px !important;
  }
}

/* Mobile original ask: use the otherwise-empty reader toolbar instead of
   floating a large sticky card over the transcript. The disclosure is one
   ellipsized row by default and expands in place only when requested. */
.mobile-original-ask { display: none; }
@media (max-width: 1200px) {
  body .conversations-view .conv-sticky-header {
    display: none !important;
  }
  #convToolbar {
    align-items: flex-start;
  }
  #mobileOriginalAsk:not([hidden]) {
    order: -99;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  #mobileOriginalAsk:not([hidden]):hover,
  #mobileOriginalAsk:not([hidden]):focus-visible {
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  }
  .mobile-original-ask__label {
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .mobile-original-ask__text {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 550;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-original-ask__chevron {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1;
    transition: transform 0.15s ease;
  }
  #mobileOriginalAsk.is-expanded {
    align-items: start;
    max-height: min(40vh, 320px);
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
  }
  #mobileOriginalAsk.is-expanded .mobile-original-ask__text {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  #mobileOriginalAsk.is-expanded .mobile-original-ask__chevron {
    margin-top: 3px;
    transform: rotate(180deg);
  }
}

/* Switch to the q2 queue board. Rides .sh-btn for sizing so it matches the
   other header controls, but keeps its LABEL: every other button in this row
   is icon-only (.sidebar-header-actions hides .sh-action-label), and an
   unlabelled glyph does not read as "go to the queue board". */
/* Switch to the q2 queue board. Deliberately identical to q2's own "Sessions"
   pill (static/q2.css .q2-back) so the control looks the same and sits in the
   same corner going both ways. Its own element in the header rather than a
   .sh-btn: that row hides labels and forces a 30px icon box. */

.q2-navrow .q2-here {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.2px;
  color: var(--text);
  white-space: nowrap;
}
.q2-navrow .q2-switch {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* Spacing belongs to .q2-navrow now; keeping it here pushed the pill off
     the row's centre line and out of alignment with the "Sessions" label. */
  /* `font: ... inherit` is invalid shorthand (family cannot be inherit) and
     was dropped whole, leaving the browser default 14px. Set longhand. */
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  /* Pinned so the pill is the same 22px tall as q2's. `normal` and `1.4`
     both resolve differently against this page's font stack and left it
     two pixels taller than the one it is meant to mirror. */
  line-height: 14px;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 9px;
  white-space: nowrap;
}
.q2-navrow .q2-switch:hover { color: var(--text); border-color: var(--accent); }

/* Queues / Sessions toggle. One control, same corner on both pages: the
   active side is solid, the other is a dim link. Nothing moves when you
   switch, which is the point of a toggle. */
.q2-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.q2-toggle-opt {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 14px;
  padding: 4px 10px;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  white-space: nowrap;
}
a.q2-toggle-opt:hover { color: var(--text); background: var(--surface-2); }
.q2-toggle-opt.is-active {
  color: var(--text);
  background: var(--surface-2);
  cursor: default;
}

/* The sidebar is a stretching flex column, so without align-self the toggle
   grew to the full 360px width instead of hugging its two labels. */
.q2-toggle {
  align-self: flex-start;
  width: auto;
  margin: 8px 12px 0;
}

/* ── Phone chrome condense (≤600px) ──────────────────────────────────
   The sidebar is a pure flex column and #convList is flex:1, so every
   pixel of chrome above/below the list subtracts 1:1 from list height.
   On phones, squeeze the chrome so many more conversations fit:
   - tabs / header / status chip: tighter padding, hide the "Last
     updated · check for updates · what's new" line (the same actions
     live in Settings);
   - the new-session panel becomes ONE line — [+ New session][search]
     [+ Group][▶][≡] — instead of two full-width rows (the group-chat
     label shortens to "+ Group"; the search input and buttons shrink
     via their flex-basis on very narrow screens);
   - filter tab bars and the in-progress tools row lose padding;
   - footer collapses to a single scrollable line (the pill shrink lives
     in the __pollerStripStyle media block in app.js, which must win
     over the pills' inline styles).
   Placed at end of file because the base .new-session-panel rules
   declare flex-wrap: nowrap and equal-specificity ties resolve by
   source order. */
@media (max-width: 600px) {
  .q2-toggle { margin: 3px 10px 0; }
  .q2-toggle-opt { padding: 2px 8px; font-size: 10.5px; line-height: 13px; }

  .sidebar-header { padding: 4px 10px; gap: 4px; }
  .sidebar-header-actions .sh-btn { width: 26px; height: 26px; }
  .sidebar-header-brand .sh-meta-row { display: none; }
  .sh-service-badges { margin: 1px 0 0; }
  .sh-status-chip { margin: 1px 0 0; padding: 2px 7px 2px 5px; }

  .new-session-panel { flex-wrap: nowrap; padding: 5px 10px; gap: 4px; }
  .new-session-primary-row,
  .new-session-secondary-row { flex: 0 1 auto; gap: 4px; }
  .new-session-btn { padding: 5px 8px; font-size: 12px; gap: 4px; }
  .new-session-secondary-row .new-session-icon-btn {
    flex: 0 0 28px; width: 28px; height: 28px; font-size: 12px;
  }
  #sidebarNewGroupChatBtn { flex: 0 1 auto; font-size: 0; }
  #sidebarNewGroupChatBtn .plus { font-size: 12px; }
  #sidebarNewGroupChatBtn::after { content: " Group"; font-size: 12px; }
  .conv-search-input { padding: 4px 24px 4px 8px; font-size: 12px; }

  .conv-tab-bar { padding: 3px 4px 0; margin-bottom: 3px; }
  .conv-tab { padding: 4px 3px 5px; }
  #convList .conv-inprogress-toolbar { padding: 3px 6px; gap: 4px; }

  .sidebar-footer { padding: 3px 6px; }
  .sidebar-footer-btn { width: 26px; height: 26px; }
}
/* Diagnostic/operator surfaces are available only while Debug mode is on. */
html:not(.ccc-debug-mode) [data-debug-hide],
html:not(.ccc-debug-mode) #statsBtn,
html:not(.ccc-debug-mode) #annotationFabBtn,
html:not(.ccc-debug-mode) #annotationScreenBtn,
html:not(.ccc-debug-mode) #annotationNotesBtn,
html:not(.ccc-debug-mode) #statusRailActivityLogBtn,
html:not(.ccc-debug-mode) #cccHealth,
html:not(.ccc-debug-mode) #cccAdvisorPill,
html:not(.ccc-debug-mode) #cccFleetPill,
html:not(.ccc-debug-mode) #cccHeroPulsePill,
html:not(.ccc-debug-mode) #deployPill,
html:not(.ccc-debug-mode) #customNavLinks .q2-toggle-opt[href="/view/reddit"],
html:not(.ccc-debug-mode) [data-role="conv-rowstyle-palette"],
html:not(.ccc-debug-mode) #statsModal {
  display: none !important;
}

/* ===================================================================
   Sidebar session list — design_handoff_sidebar_session_list (variant 2c)
   Slice 2: row content model (§4c), trash lane (§4d), footer line (§5),
   action row (§2), and the reduced-width / reduced-motion polish.

   Slice 1 (hairline lane headers, hover-reveal meta, working dot) shipped
   in v5.23.0; this block finishes the variant.

   State colors (#e0a34a needs-you, #39d2c0 working) stay literal on
   purpose: the handoff calls them out as meaning-carrying and exempt from
   the blue-gray palette substitution applied to surfaces and text.
   =================================================================== */

/* §4c — Time forms a clean right-aligned column across every lane.
   Narrowed 43px → 26px and 11.5px → 11px per the handoff; tabular-nums
   (already set upstream) keeps "9m" / "13h" / "2d" optically aligned. */
#convList .conv-item {
  --conv-time-col: 26px;
}
#convList .conv-item .conv-rel {
  font-size: 11px;
}

/* §4c — the live tool label is 2c's defining addition: a bare mono note
   right after the title, not a filled pill. Only the *working* states get
   the teal treatment; stale / interrupted / needs-approval keep their own
   warning colors, because dropping those to a neutral note would hide a
   real problem behind a design preference. */
#convList .conv-item .conv-live-tool {
  background: transparent;
  border-left: 0;
  padding: 1px 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
}
#convList .conv-item .conv-live-tool .conv-live-name {
  font-weight: 500;
}
#convList .conv-item .conv-live-tool.in-flight,
#convList .conv-item .conv-live-tool.is-question {
  color: #39d2c0;
  background: transparent;
  border-left: 0;
}

/* §4c — the handoff's hover strip also lists engine glyph / context % /
   cost tier. Engine glyph and cost tier already render at rest on the left
   of every row, and the context % badge sits in the always-visible main row
   (a deliberate CCC divergence: % is worth reading without hovering). So
   the hover strip stays id + branch rather than duplicating them. */

/* §"Reduced width" — below ~300px the hover strip is dropped entirely and
   the row falls back to dot + title + time. A container query (rather than
   a viewport media query) so it tracks the *sidebar* width, which is
   user-resizable and independent of the window. */
#convList {
  container-name: convlist;
}

/* §4d — Trash reads as a quiet terminal marker after the last lane, not as
   another section header competing with the project lanes. */
#convList .conv-trash-section {
  margin-top: 14px;
}
#convList .conv-trash-header {
  height: 30px;
  padding: 0 6px;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.85;
}
#convList .conv-trash-header:hover { opacity: 1; }
#convList .conv-trash-count {
  /* the pill treatment is dropped — a plain right-aligned number in the
     same type as the label, per the handoff */
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

/* §2 — Action row. "+ New session" becomes the one amber accent in the
   sidebar (it is the only creative action); search recedes into a well so
   it stops competing with it; collapse is a plain square control. */
.new-session-primary-row .new-session-btn:not(.new-session-btn-secondary) {
  min-height: 30px;
  background: rgba(224,163,74,0.10);
  border-color: rgba(224,163,74,0.38);
  color: #e0a34a;
  font-size: 12.5px;
}
.new-session-primary-row .new-session-btn:not(.new-session-btn-secondary):hover {
  background: rgba(224,163,74,0.18);
  border-color: rgba(224,163,74,0.58);
}
.new-session-primary-row .conv-search-input {
  min-height: 30px;
  background: var(--bg);
  border-color: var(--border);
  font-size: 12.5px;
}
.new-session-primary-row .conv-search-input:focus {
  border-color: rgba(224,163,74,0.45);
}

/* §5 — Footer "needs you N". Amber, mono, and absent at zero so the line
   stays quiet when nothing is blocked. */
#cccNeedsYouFooter {
  flex: 0 0 auto;
  cursor: pointer;
  user-select: none;
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid rgba(224,163,74,0.38);
  background: rgba(224,163,74,0.10);
  color: #e0a34a;
}
#cccNeedsYouFooter:hover {
  background: rgba(224,163,74,0.18);
  border-color: rgba(224,163,74,0.58);
}
#cccNeedsYouFooter[hidden] { display: none; }

/* ── Orchestration pane (status rail, first tab) ─────────────────────── */
.orch-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 14px;
  gap: 12px;
}
.orch-head-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.orch-head-sub {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
}
.orch-empty {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.orch-playbooks {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 6px;
  flex: 0 0 auto;
}
.orch-playbooks.is-disabled .orch-playbook { opacity: 0.45; pointer-events: none; }
.orch-playbook {
  --pb: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 9px 12px 9px 10px;
  border: 1px solid color-mix(in srgb, var(--pb) 35%, var(--border));
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--pb) 14%, transparent), transparent 60%),
    var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  overflow: hidden;
}
.orch-playbook:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--pb) 70%, var(--border));
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--pb) 80%, transparent);
}
.orch-playbook:active { transform: translateY(0) scale(0.99); }
.orch-playbook:focus-visible { outline: 2px solid var(--pb); outline-offset: 2px; }
.orch-playbook-delegate { --pb: #a371f7; }
.orch-playbook-verify   { --pb: #3fb950; }
.orch-playbook-critique { --pb: #d29922; }
.orch-playbook-status   { --pb: #8b949e; }
.orch-playbook-queue    { --pb: #39c5cf; }
.orch-playbook-spawn    { --pb: #58a6ff; }
/* Draft playbooks write into the composer instead of sending: pencil, no push. */
.orch-playbook.is-draft .orch-playbook-arrow { font-size: 15px; }
.orch-playbook.is-draft:hover .orch-playbook-arrow { transform: none; }
/* "More" disclosure: the optional playbooks fold away so the pane stays clean. */
.orch-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin: -6px 0 -4px 2px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.orch-more-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text-muted) 10%, transparent); }
.orch-more-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.orch-more-caret { font-size: 11px; line-height: 1; opacity: 0.8; }
.orch-more-hint { font-weight: 500; opacity: 0.65; }
.orch-more-toggle[aria-expanded="true"] .orch-more-hint { display: none; }
.orch-more { display: flex; flex-direction: column; gap: 16px; }
.orch-more[hidden] { display: none; }
.orch-playbook.is-action .orch-playbook-arrow { font-size: 15px; }
.orch-playbook.is-optional { border-style: dashed; background: var(--surface); min-height: 44px; }
.orch-playbook.is-optional .orch-playbook-title { font-weight: 600; }
.orch-playbook-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.orch-playbook-title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.orch-playbook-sub { font-size: 10.5px; line-height: 1.3; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orch-playbook-meta {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 600;
  color: var(--pb);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orch-playbook-arrow { color: var(--pb); font-size: 18px; line-height: 1; opacity: 0.75; transition: transform 140ms ease, opacity 140ms ease; }
.orch-playbook:hover .orch-playbook-arrow { transform: translateX(-4px); opacity: 1; }
.orch-playbook.is-fired .orch-playbook-arrow { animation: orch-arrow-push 600ms ease-out; }
@keyframes orch-arrow-push {
  0% { transform: translateX(0); }
  40% { transform: translateX(-9px); opacity: 1; }
  100% { transform: translateX(0); }
}
.orch-playbook.is-fired::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--pb) 35%, transparent);
  animation: orch-fire 700ms ease-out forwards;
  pointer-events: none;
}
@keyframes orch-fire {
  0% { opacity: 0.9; transform: scale(0.96); }
  100% { opacity: 0; transform: scale(1.04); }
}
/* Drafted, not sent: a short border glow only. No fill, no scale — the loud
   is-fired pulse stays reserved for a card that actually sent. */
.orch-playbook.is-drafted { animation: orch-draft-glow 300ms ease-out; }
@keyframes orch-draft-glow {
  0%   { box-shadow: 0 0 0 2px color-mix(in srgb, var(--pb) 45%, transparent); }
  100% { box-shadow: 0 0 0 2px transparent; }
}
/* Model tier: the second-level pick under Spawn a sub-agent. */
.orch-tier {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: -2px 0 2px 10px;
  padding: 4px 6px 4px 8px;
  border-left: 2px solid color-mix(in srgb, #a371f7 45%, transparent);
}
.orch-tier-label {
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.orch-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 7px 0 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.orch-tier-chip:hover { color: var(--text); border-color: color-mix(in srgb, #a371f7 60%, var(--border)); }
.orch-tier-chip.is-selected {
  color: var(--text);
  border-color: #a371f7;
  background: color-mix(in srgb, #a371f7 16%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #a371f7 40%, transparent);
}
.orch-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  background: #6e7681;
  flex: 0 0 auto;
}
.orch-glyph-claude { background: #d97757; }
.orch-glyph-codex { background: #10a37f; }
.orch-glyph-antigravity, .orch-glyph-gemini { background: #4285f4; }
.orch-glyph-grok { background: #1d1d1f; border: 1px solid #555; }
.orch-glyph-devin { background: #3b82f6; }
.orch-glyph-kimi { background: #7c3aed; }
.orch-glyph-cursor { background: #111; border: 1px solid #555; }
.orch-glyph-kilo { background: #f59e0b; }
.orch-glyph-hermes { background: #10b981; }
.orch-glyph-opencode { background: #ec4899; }
.orch-glyph-aider { background: #14b8a6; }
.orch-glyph-droid { background: #6366f1; }
.orch-glyph-pi { background: #f97316; }

/* Queue config engine chip container */
.fq-engine-chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* Quick Model Picker right above composer */
.conv-model-picker-strip {
  display: none;
  flex: 0 0 auto;
  padding: 6px 14px 4px 14px;
  background: var(--bg);
  box-sizing: border-box;
}
.conv-model-picker-strip.is-new-session {
  display: flex;
}
.conv-model-picker-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-left: 8px;
  border-left: 2px solid color-mix(in srgb, #a371f7 65%, transparent);
}
.conv-model-picker-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 0 0 auto;
  margin-right: 2px;
}
.conv-model-picker-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}


/* Lane map */
.orch-map-wrap { display: flex; flex-direction: column; gap: 6px; flex: 1 0 auto; }
.orch-map-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 2px; align-items: center; min-width: 0; }
.orch-map-head .orch-map-replay { grid-column: 2; grid-row: 1 / span 2; }
.orch-map-head .orch-map-preview:not(.orch-map-replay) { grid-column: 3; grid-row: 1 / span 2; }
.orch-map-head .orch-map-count { grid-column: 1; grid-row: 2; }
.orch-map-title {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.orch-map-count { min-width: 0; font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orch-map-count.is-preview { color: #d29922; }
.orch-map-preview {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
}
.orch-map-preview:hover { color: var(--text); background: var(--surface-2); }
.orch-map-preview.is-playing { color: #d29922; border-color: #d29922; }
.orch-map {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text-muted) 18%, transparent) 1px, transparent 1.5px) 0 0 / 14px 14px,
    var(--bg);
  padding: 10px 8px 10px;
  min-height: 118px;
  flex: 1 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
}
.orch-map-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.orch-edge { fill: none; stroke-width: 1.5; stroke: color-mix(in srgb, var(--text-muted) 45%, transparent); }
.orch-edge-working { stroke: color-mix(in srgb, #a371f7 60%, transparent); }
.orch-edge-waiting { stroke: #d29922; stroke-dasharray: 3 4; animation: orch-edge-blink 1.2s ease-in-out infinite; }
.orch-edge-flow { stroke: #a371f7; stroke-width: 2; stroke-dasharray: 6 10; animation: orch-edge-flow 900ms linear infinite; }
@keyframes orch-edge-flow { to { stroke-dashoffset: -16; } }
@keyframes orch-edge-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.orch-map-ancestor {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.orch-map.is-narrow .orch-map-ancestor { text-align: left; padding-left: 4px; }
.orch-map-root { position: relative; display: flex; justify-content: center; z-index: 1; }
.orch-map-continuation { position: relative; z-index: 1; font-size: 11px; line-height: 1.5; color: var(--text-muted); overflow-wrap: anywhere; }
.orch-continuation-status { color: #d29922; }
.orch-map-lanes {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 10px;
  margin-top: 26px;
  min-height: 44px;
  z-index: 1;
}
/* Narrow rail: one lane per row, hung off a spine on the left. */
.orch-map.is-narrow .orch-map-root { justify-content: flex-start; }
.orch-map.is-narrow .orch-map-lanes {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  margin: 14px 0 0 40px;
  gap: 14px;
}
.orch-map.is-narrow .orch-map-lanes .orch-node-lane { display: grid; width: 100%; }
.orch-map.is-narrow .orch-node-name { max-width: none; }
.orch-map.is-narrow .orch-map-lanes.is-empty { margin-left: 0; }
.orch-map-lanes.is-empty::before {
  content: attr(data-empty-text);
  display: block;
  width: 100%;
  padding: 10px 8px;
  border: 1px dashed color-mix(in srgb, var(--text-muted) 40%, transparent);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
.orch-map-done-label {
  position: relative;
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--text-muted) 35%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  z-index: 1;
}
.orch-map-done { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; z-index: 1; }
.orch-node {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 480ms cubic-bezier(.2,.8,.2,1), opacity 420ms ease, border-color 200ms ease, box-shadow 200ms ease;
  will-change: transform;
}
button.orch-node { cursor: pointer; }
button.orch-node:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.orch-node-root {
  grid-template-rows: auto;
  padding: 8px 12px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}
.orch-node-root.is-fanning { animation: orch-root-pulse 1.8s ease-in-out infinite; }
.orch-node-root { font: inherit; color: var(--text); text-align: left; cursor: default; }
.orch-node-root[data-conv-id] { cursor: pointer; }
.orch-node-root[data-conv-id]:hover { border-color: var(--accent); }
.orch-node.is-here { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--accent) 75%, transparent); }
.orch-node.is-here .orch-node-name::after { content: ' · here'; font-weight: 500; color: var(--accent); }
@keyframes orch-root-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, #a371f7 12%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, #a371f7 5%, transparent); }
}
.orch-node-glyph { grid-row: 1 / span 2; width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
.orch-node-root .orch-node-glyph { grid-row: 1; width: 26px; height: 26px; font-size: 12px; }
.orch-node-body { display: flex; flex-direction: column; min-width: 0; }
.orch-node-role { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.orch-node-name {
  font-size: 11.5px;
  font-weight: 650;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orch-node-root .orch-node-name { max-width: 200px; }
.orch-node-model { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.orch-node-status {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}
.orch-node-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.orch-node.is-working { border-color: color-mix(in srgb, #a371f7 60%, var(--border)); }
.orch-node.is-working .orch-node-status { color: #a371f7; }
.orch-node.is-working .orch-node-dot { animation: orch-dot 1s ease-in-out infinite; }
@keyframes orch-dot { 0%, 100% { transform: scale(0.7); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 1; } }
.orch-node.is-waiting { border-color: #d29922; box-shadow: 0 0 0 3px color-mix(in srgb, #d29922 18%, transparent); }
.orch-node.is-waiting .orch-node-status { color: #d29922; }
.orch-node.is-idle .orch-node-status { color: #58a6ff; }
.orch-node.is-done { opacity: 0.72; animation: none !important; }
.orch-node.is-done .orch-node-status { color: #3fb950; }
.orch-node.is-done .orch-node-dot { background: none; width: auto; height: auto; animation: none !important; }
.orch-node.is-done .orch-node-dot::before { content: '\2713'; font-size: 10px; }
.orch-node.is-compact { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; border-radius: 999px; }
.orch-node.is-compact .orch-node-glyph { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }
.orch-node.is-compact .orch-node-name { font-size: 11px; max-width: 220px; }
.orch-node.is-compact .orch-node-status { margin: 0; }
.orch-node.is-born { animation: orch-born-glow 900ms ease-out forwards; }
@keyframes orch-born-glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, #a371f7 60%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .orch-node, .orch-edge-flow, .orch-node-root.is-fanning, .orch-node-dot { animation: none !important; transition: none !important; }
}
/* Task-tool subagent lanes: read-only transcripts, not resumable sessions.
   Greyed out with a small "transcript" badge to distinguish them from
   live CCC-spawned lanes. */
.orch-node.is-task-subagent { opacity: 0.5; border-style: dashed; }
.orch-node-task-badge {
  font-size: 8px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}
.orch-node.is-compact .orch-node-task-badge { display: none; }
/* Depth indentation for nested lanes (sub-lanes of lanes). */
.orch-node-indent { display: inline-block; flex-shrink: 0; }

/* Files tab (CCC-1228): the list fills the pane, so the dock-era collapse
   toggle and resize handle have nothing to do here. */
.status-rail-pane[data-rail-pane="files"] > .files-panel .files-toggle { display: none; }
.status-rail-pane[data-rail-pane="files"] > .files-panel.collapsed {
  max-height: none; height: auto !important; overflow: visible; padding: 8px 12px 10px;
}
.status-rail-pane[data-rail-pane="files"] > .files-panel.collapsed .files-list { display: block; }
.files-tab-empty {
  padding: 16px 12px;
  color: var(--text-muted);
  font-size: 12px;
}
.status-rail-tab-count:not(:empty) {
  margin-left: 4px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Ask tab (right rail) — Mazkir Fleet Memory & Intelligence */
.ask-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background:
    radial-gradient(100% 55% at 20% 0%, rgba(99, 179, 255, 0.18) 0%, transparent 75%),
    radial-gradient(90% 50% at 100% 100%, rgba(123, 232, 201, 0.14) 0%, transparent 70%),
    color-mix(in srgb, var(--surface, #242b35) 65%, #3f8fc6);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text, #e6edf3);
}

/* Mazkir Header */
.ask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 9px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
}
.ask-header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.ask-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f5b955 0%, #d48a28 100%);
  color: #121008;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(224, 163, 74, 0.35);
  flex: 0 0 auto;
}
.ask-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ask-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #f0f6fc);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.ask-header-subtitle {
  font-size: 10.5px;
  color: var(--text-muted, #8b949e);
  line-height: 1.2;
}
.ask-header-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(57, 210, 192, 0.08);
  border: 1px solid rgba(57, 210, 192, 0.25);
  font-size: 10.5px;
  color: #39d2c0;
  font-weight: 600;
  flex: 0 0 auto;
}
.ask-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #39d2c0;
}
.ask-status-dot.pulse {
  animation: askPulse 2s ease-in-out infinite;
}

/* Empty State / Welcome Screen */
.ask-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 14px;
  margin: auto 0;
  gap: 10px;
}
.ask-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 30%, rgba(224, 163, 74, 0.25), rgba(224, 163, 74, 0.05));
  border: 1px solid rgba(224, 163, 74, 0.35);
  box-shadow: 0 4px 16px rgba(224, 163, 74, 0.15);
  font-size: 20px;
  margin-bottom: 2px;
}
.ask-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #f0f6fc);
  letter-spacing: -0.01em;
}
.ask-empty-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted, #8b949e);
  max-width: 250px;
}
.ask-empty-prompts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 280px;
  margin-top: 10px;
}
.ask-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px 10px;
  margin: -12px -14px 0;
  position: sticky;
  top: -12px;
  z-index: 2;
  /* .ask-log is transparent, so `inherit` let scrolled answers show through
     the pinned strip. Match the pane's base colour instead. */
  background: color-mix(in srgb, var(--surface, #242b35) 65%, #3f8fc6);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.ask-quick-prompts .ask-prompt-chip {
  padding: 5px 9px;
  font-size: 11px;
}
.ask-prompt-chip {
  text-align: left;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text, #c9d1d9);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
}
.ask-prompt-chip:hover {
  background: rgba(224, 163, 74, 0.1);
  border-color: rgba(224, 163, 74, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

/* Conversation Log */
.ask-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Rail Log pane (CCC-1049): the activity log as a status-rail tab. */
.rail-log-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.rail-log-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.rail-log-scope {
  flex: 0 0 auto;
}
.rail-log-filter {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.rail-log-filter:focus { outline: none; border-color: var(--accent); }
.rail-log-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 12px;
}
/* Stacked rows (the rail is ~half the modal width): timestamp + verb on one
   line, detail full-width below, so long details don't squeeze into a
   one-character column. */
.rail-log-body .activity-log-row {
  flex-wrap: wrap;
  padding: 5px 10px;
  gap: 4px 8px;
}
.rail-log-body .activity-log-detail { flex-basis: 100%; font-size: 11.5px; }
.ask-turn {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ask-turn + .ask-turn {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* User Prompt */
.ask-turn-q {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent, #e0a34a);
}
.ask-user-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #e0a34a);
}
.ask-q-text {
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text, #f0f6fc);
}

/* Assistant Answer */
.ask-turn-a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 2px 2px 6px;
}
.ask-turn-a.is-error {
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--danger, #f85149);
  background: rgba(248, 81, 73, 0.08);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(248, 81, 73, 0.25);
  font-size: 12px;
}
.ask-assistant-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.ask-assistant-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #e0a34a;
  color: #1a1408;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
}
.ask-assistant-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text, #e6edf3);
}
.ask-turn-time {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted, #8b949e);
}
.ask-turn-usage {
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted, #8b949e);
}
.ask-turn-body {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text, #e6edf3);
  word-break: break-word;
}
.ask-turn-body p {
  margin: 0 0 6px 0;
}
.ask-turn-body p:last-child {
  margin-bottom: 0;
}
.ask-turn-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #f0f6fc;
}
.ask-turn-body pre {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #010409;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}
.ask-turn-body pre code {
  background: transparent;
  padding: 0;
}
.ask-turn-body ul, .ask-turn-body ol {
  margin: 4px 0 6px 0;
  padding-left: 18px;
}
.ask-turn-body li {
  margin-bottom: 6px;
}
/* Topic labels ("**CCC feature work** — …") carry the answer; chips are footnotes. */
.ask-turn-body strong {
  font-weight: 700;
  color: var(--text-strong, #fff);
}
.ask-turn-body li > strong:first-child,
.ask-turn-body li > p:first-child > strong:first-child {
  font-size: 13px;
}
.ask-turn-body .ask-session-chip {
  max-width: 200px;
  padding: 0 6px;
  gap: 4px;
  margin: 0 1px;
  font-size: 10.5px;
  line-height: 16px;
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted, #8b949e);
}
.ask-turn-body .ask-session-chip:hover { color: var(--text, #e6edf3); }
.ask-turn-body .ask-session-chip .ask-dot { width: 5px; height: 5px; }

/* What Mazkir looked at, above the answer: debugging aid, kept quiet. */
.ask-trace {
  list-style: disc;
  margin: 0 0 8px;
  padding: 0 0 6px 14px;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 60%, transparent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-muted, #8b949e);
}
.ask-trace li { overflow-wrap: anywhere; }
.ask-trace-tool { color: var(--text, #c9d1d9); opacity: .85; }
.ask-more-sources > summary {
  cursor: pointer;
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted, #8b949e);
}
.ask-more-sources > summary::-webkit-details-marker { display: none; }
.ask-more-caret { display: inline-block; transition: transform 120ms ease; }
.ask-more-sources[open] .ask-more-caret { transform: rotate(90deg); }
.ask-more-sources .ask-session-chip { max-width: 240px; font-size: 11px; padding: 1px 7px; }

/* Assistant Action Toolbar */
.ask-turn-a .assistant-message-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity .14s ease;
  background: rgba(13, 17, 23, 0.85);
  border-radius: 5px;
  padding: 1px 3px;
  backdrop-filter: blur(4px);
}
.ask-turn-a:hover .assistant-message-actions {
  opacity: 1;
}
.ask-turn-a .assistant-message-action {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 120ms ease;
}
.ask-turn-a .assistant-message-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.ask-turn-a .assistant-message-action.copied { color: var(--green, #3dd68c); }
.ask-turn-a .assistant-message-action.speaking { color: var(--accent, #e0a34a); }

/* Thinking State */
.ask-turn-pending {
  padding-right: 0;
}
.ask-thinking-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(57, 210, 192, 0.05);
  border: 1px solid rgba(57, 210, 192, 0.18);
  margin-top: 4px;
  width: fit-content;
}
.ask-thinking {
  font-size: 11.5px;
  font-weight: 500;
  color: #39d2c0;
}
.ask-thinking::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border-radius: 50%;
  background: #39d2c0;
  vertical-align: middle;
  animation: askPulse 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .ask-thinking::after { animation: none !important; }
}

/* Dots & Pulse */
.ask-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #565e68;
  flex: 0 0 auto;
}
.ask-dot.is-live {
  background: #39d2c0;
  animation: askPulse 1.8s ease-in-out infinite;
}
@keyframes askPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57,210,192,.5), 0 0 5px 1px rgba(57,210,192,.4); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(57,210,192,0), 0 0 9px 2px rgba(57,210,192,.12); opacity: .72; }
}
@media (prefers-reduced-motion: reduce) {
  .ask-dot.is-live { animation: none !important; }
}

/* Action button (Spawn follow-up inside answer) */
.ask-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent, #e0a34a);
  background: rgba(224, 163, 74, 0.1);
  color: var(--accent, #e0a34a);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 120ms ease;
}
.ask-action:hover:not(:disabled) {
  background: rgba(224, 163, 74, 0.2);
  transform: translateY(-1px);
}
.ask-action:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Sources: always-visible session chips + a quiet meta line */
.ask-sources {
  margin-top: 6px;
}
.ask-result-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted, #8b949e);
}

/* Confirm cards: actions Mazkir proposed, run only on Confirm */
.ask-confirms { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ask-confirm {
  padding: 9px 11px;
  border: 1px solid var(--accent, #e0a34a);
  border-radius: 8px;
  background: rgba(224, 163, 74, 0.06);
}
.ask-confirm.is-done { border-color: rgba(63, 185, 80, 0.6); background: rgba(63, 185, 80, 0.06); }
.ask-confirm.is-failed { border-color: rgba(248, 81, 73, 0.6); }
.ask-confirm.is-dismissed, .ask-confirm.is-expired { opacity: 0.6; border-color: var(--border); }
.ask-confirm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.ask-confirm-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent, #e0a34a);
}
.ask-confirm-effect { font-size: 12.5px; color: var(--text, #e6edf3); }
.ask-confirm-detail {
  margin: 6px 0 0; padding: 6px 8px; max-height: 140px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  font-size: 11.5px; background: rgba(0, 0, 0, 0.18); border-radius: 6px;
}
.ask-confirm-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ask-confirm-status { font-size: 11.5px; color: var(--text-muted, #8b949e); }

/* Selection Bar */
.ask-sel-bar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 12px 8px 12px;
  padding: 9px 11px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border: 1px solid rgba(88, 166, 255, 0.4);
  border-left: 3px solid #58a6ff;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.ask-sel-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ask-sel-title {
  font-size: 12px;
  font-weight: 600;
  color: #f0f6fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.ask-sel-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #8b949e;
  word-break: break-all;
}
.ask-sel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ask-sel-btn {
  font-size: 11px;
  font-weight: 500;
  color: #c9d1d9;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  flex: 0 0 auto;
  transition: all 120ms ease;
}
.ask-sel-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}
.ask-sel-btn.is-primary {
  color: #000;
  background: linear-gradient(180deg, #f5b955 0%, #d48a28 100%);
  border-color: #f5b955;
  font-weight: 700;
}
.ask-sel-btn.is-primary:hover {
  background: #f5b955;
}
.ask-sel-close {
  font-size: 12px;
  color: #8b949e;
  padding: 2px 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  flex: 0 0 auto;
  border-radius: 4px;
}
.ask-sel-close:hover {
  color: #f0f6fc;
  background: rgba(255, 255, 255, 0.08);
}

/* Bottom Form / Composer */
.ask-form {
  flex: 0 0 auto;
  padding: 10px 12px 10px 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ask-input-wrap {
  width: 100%;
}
.ask-form textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  box-sizing: border-box;
  background: #010409;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: #e6edf3;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.ask-form textarea::placeholder {
  color: #565e68;
}
.ask-form textarea:focus {
  outline: none;
  border-color: var(--accent, #e0a34a);
  box-shadow: 0 0 0 3px rgba(224, 163, 74, 0.18);
}
.ask-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ask-hint {
  margin-left: auto;
  font-size: 10.5px;
  color: #565e68;
}
.ask-hint kbd {
  font-family: inherit;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ask-send {
  font-size: 12px;
  font-weight: 700;
  color: #121008;
  padding: 5px 12px;
  background: linear-gradient(180deg, #f5b955 0%, #d48a28 100%);
  border: 1px solid #e0a34a;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: all 120ms ease;
}
.ask-send svg {
  display: inline-block;
  flex: 0 0 auto;
}
.ask-send:hover:not(:disabled) {
  background: #f5b955;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(224, 163, 74, 0.3);
}
.ask-send:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}
.ask-clear {
  font-size: 11px;
  color: #8b949e;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  transition: all 120ms ease;
}
.ask-clear:hover {
  color: #f0f6fc;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
.ask-range-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #8b949e;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  transition: all 120ms ease;
}
.ask-range-btn:hover {
  color: #f0f6fc;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Persistent source references share the same treatment inside answers. */
.ask-top-sources { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ask-session-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; vertical-align: middle; padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, var(--accent)); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.ask-session-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-session-chip:hover, .ask-session-chip:focus-visible, .ask-session-chip.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.rail-log-toolbar { flex-wrap: wrap; }
.rail-log-kind-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.rail-log-kind-toggle[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border-color: var(--accent);
  color: var(--accent);
}
.rail-log-kind-toggle:hover, .rail-log-kind-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.rail-log-filter { flex-basis: 60px; }
.rail-log-toolbar { gap: 5px; }

#mobileAskHost { position: fixed; inset: 0 0 calc(58px + env(safe-area-inset-bottom, 0px)); z-index: 940; background: var(--surface); }
#mobileAskHost[hidden] { display: none; }
#mobileAskHost > #statusRailAskPane { display: flex; flex-direction: column; height: 100%; padding: 0; overflow: hidden; }
#mobileAskHost .ask-pane { flex: 1; min-height: 0; }
body.mobile-ask-open .mobile-bottom-nav { z-index: 950; }

/* Worker identity stays stable; ticket history has its own compact row. */
.conv-worker-history {
  margin: 4px 0 1px 26px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.7;
}
.conv-worker-history-recent {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.conv-worker-ticket {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.conv-worker-ticket:hover,
.conv-worker-ticket:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.conv-worker-ticket > span { color: var(--text-muted); }
/* An elided chip ("-995") is a continuation of the one before it, so it sits
   tighter against its neighbour and reads as part of the same run. */
.conv-worker-ticket.is-elided {
  padding-left: 3px;
  margin-left: -2px;
}
/* ── Coding and Workers: compact row layout ────────────────────────────────
   Both session lanes use this table treatment in Compact mode. The legacy
   .workers-dense class lives on #convList; Cozy and Detailed restore cards.
   This is display only: rows and lane controls remain available. */
/* Dense rides on #convList (like .compact-rows) so it survives every
   re-render path, and the id gives it the weight to beat the row presets. */
/* Compact = the fixed-column table. Each row becomes its own grid so the
   right-hand columns (context %, age) line up down the list while the title
   and chips size to their content -- the layout the mock proposed.
   .conv-title-row / .conv-main-row go display:contents so their children
   become cells of that grid without any list-specific markup; every cell is
   placed explicitly (column AND row 1) rather than auto-flowed, because the
   ticket chips are a DOM sibling of the title row and sparse auto-placement
   would push them onto a second line. */
#convList.workers-dense .conv-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto 46px 40px;
  align-items: center;
  column-gap: 5px;
  padding-top: 3px;
  padding-bottom: 3px;
  padding-right: 10px;
  margin-bottom: 0;
  min-height: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.05));
}
/* The spacing, delineation and rowstyle presets all declare !important, so
   Compact -- which is a deliberate choice to override them -- has to as well.
   Without this the table renders inside 8px-padded rounded cards with 16px
   titles and reads exactly like the card list it replaces. */
#convList.workers-dense .conv-item {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-left: 3px solid transparent !important;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent) !important;
  border-radius: 0 !important;
}
#convList.workers-dense .conv-item:last-child { border-bottom: 0 !important; }
/* The reset above wipes .conv-item.active too, so the session open in the
   conversation view was indistinguishable in the Workers table. */
#convList.workers-dense .conv-item.active {
  background: color-mix(in srgb, var(--purple) 14%, transparent) !important;
  border-left-color: var(--purple) !important;
}
#convList.workers-dense .conv-item.in-other-pane {
  background: color-mix(in srgb, #58a6ff 14%, transparent) !important;
  border-left-color: #58a6ff !important;
}
/* CCC-1193: the % and age cells are hidden in a very narrow list (see the
   sidebar 400px tier); collapse their fixed tracks so the title gets them. */
@container sidebar (max-width: 400px) {
  #convList.workers-dense .conv-item {
    grid-template-columns: auto minmax(0, 1fr) auto auto 0 0;
  }
}
#convList.workers-dense .conv-item .conv-title {
  font-size: 13px !important;
  line-height: 1.25 !important;
}
/* Descendant, not child: a row that nests these the other way round still
   flattens instead of silently opting out of the table and laying itself out
   on its own private track sizes. */
#convList.workers-dense .conv-item .conv-title-row,
#convList.workers-dense .conv-item .conv-main-row { display: contents; }
/* The chevron and the needs-you dot share one column. Each is optional and
   usually absent, so a dedicated track plus its gap was ~14px of empty gutter
   on every single row. Sharing lets the track collapse to 0 when neither is
   there; the chevron's margin reserves the separation for a row with both. */
#convList.workers-dense .conv-item .conv-nya-chevron {
  grid-column: 1; grid-row: 1; justify-self: start; margin-right: 6px;
}
/* .conv-session-icon already carries an activity dot, so in the table the
   separate working dot is the same signal printed twice in adjacent columns.
   Needs-you is a different signal (blocked on YOU) and keeps its cell. */
#convList.workers-dense .conv-item .conv-working-dot { display: none; }
#convList.workers-dense .conv-item .conv-needs-you {
  grid-column: 1; grid-row: 1; justify-self: end; margin-right: 0;
}
#convList.workers-dense .conv-item .conv-title { grid-column: 2; grid-row: 1; }
#convList.workers-dense .conv-item .conv-meta-col {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
#convList.workers-dense .conv-item .conv-worker-history,
#convList.workers-dense .conv-item .conv-worker-no-tickets { grid-column: 4; grid-row: 1; }
#convList.workers-dense .conv-item .conv-pct-badge {
  grid-column: 5;
  grid-row: 1;
  justify-self: end;
  text-align: right;
}
#convList.workers-dense .conv-item .conv-row-end { grid-column: 6; grid-row: 1; justify-self: end; }
/* Evergreen rows carry a second badge block. They do not appear in the Workers
   lane, but if one ever does it wraps to a second line rather than landing on
   top of the meta cell. */
#convList.workers-dense .conv-item .conv-evergreen-inline-badges { grid-column: 3 / -1; grid-row: 2; }
#convList.workers-dense .conv-item .conv-evergreen-meta-row { grid-column: 1 / -1; grid-row: 2; }
/* A sub-session row indents itself 14px per nesting level by moving
   --conv-icon-left, which --conv-content-left is calc()'d from. In a card list
   that reads as nesting; in a fixed-column table it means the child's title,
   its glyph and its meta cell all sit 14px right of every other row's, and the
   column stops being a column. The table states the nesting with a marker
   inside the title cell instead, which costs no alignment. */
/* The queue-progress chip prints the ticket ref that the chips column already
   carries one cell away, plus a count the Queues tab states better. Two chips
   for one ticket is the repetition this view exists to remove. */
#convList.workers-dense .conv-item .conv-ux-fix-progress { display: none; }
/* A WatchTower worker that has spawned but not yet opened its engine session.
   Same row shape as every other -- the glyph, title, id and age land in the
   normal columns -- so it reads as a worker, not as an alert. */
.conv-item.conv-wt-pending { cursor: pointer; }
.conv-wt-pending-note { color: var(--text-muted); font-style: italic; opacity: 0.75; }
.conv-wt-pending .conv-title { color: var(--text-secondary); }
.conv-wt-pending-id {
  font-size: 10.5px; line-height: 15px; padding: 0 5px;
  border: 1px dashed var(--border); border-radius: 4px;
  color: var(--text-muted); white-space: nowrap; flex: 0 0 auto;
}
.conv-workers-starting { opacity: 0.75; }
#convList.workers-dense .conv-item.is-current-child-row { --conv-icon-left: 10px; }
/* Subordinate sizing: a nested lane is a slimmer row than a full session —
   tighter padding and a step smaller title. Needs !important because the
   dense table pins font-size/padding with !important of its own. */
#convList.workers-dense .conv-item.is-current-child-row {
  padding-top: 1px !important;
  padding-bottom: 1px !important;
}
#convList.workers-dense .conv-item.is-current-child-row .conv-title {
  font-size: 12px !important;
}
#convList.workers-dense .conv-item.is-current-child-row .conv-title::before {
  content: '\21B3';
  margin-right: 5px;
  font-style: normal;
  opacity: 0.5;
}

#convList.workers-dense .conv-item .conv-title,
#convList.wrap-titles.workers-dense .conv-item .conv-title {
  /* CCC-135: a worker's title is the only thing that says what it is working
     on, and one ellipsized line cut most of it ("The New queue ticke...").
     Wrap up to three lines instead; the other cells stay vertically centred,
     so the fixed columns still line up. */
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  /* 13/1.25 is what sets the row height. The card list's 14.5/1.4 is sized for
     a card with room to breathe; in a table it is what makes the rows tall. */
  font-size: 13px;
  line-height: 1.25;
}
/* The second line and the drag affordance are what the table trades away. The
   outcome card comes back under Detailed; nothing here removes a row. */
#convList.workers-dense .conv-item .conv-hover-extras,
#convList.workers-dense .conv-item .conv-last,
#convList.workers-dense .conv-item .conv-outcome,
#convList.workers-dense .conv-item .drag-handle { display: none; }

/* Ticket chips become the meta column instead of a second line: a single
   chip run. */
/* The card list indents the chips onto their own line and gives them a
   1.7 line-height; in a table cell that margin and leading are what set the
   row height. Strip both -- the chips are the tallest thing in the row. */
#convList.workers-dense .conv-item .conv-worker-history {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 10.5px;
  line-height: 15px;
}
#convList.workers-dense .conv-worker-history-recent {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  margin-left: 0;
}
/* A ref must never break mid-token: one wrapped chip makes its row twice as
   tall as every other row, and the column stops reading as a column. */
#convList.workers-dense .conv-worker-ticket {
  padding: 0 5px;
  line-height: 15px;
  white-space: nowrap;
}
#convList.workers-dense .conv-gap-separator { margin: 6px 6px 3px; }

/* A blank chips cell in a fixed-column table reads as "not loaded yet". Say
   what it means -- but only in that layout: on the card list it would be a
   repeated string on every ticketless row. */
.conv-worker-no-tickets { display: none; }
/* ...and only when some row in view actually HAS tickets. On a list where
   nothing is attributed, "no tickets" on all 18 rows is just one more string
   repeated 18 times -- the exact noise this tab came here to lose. */
#convList.workers-dense.workers-tickets-present .conv-item .conv-worker-no-tickets {
  display: inline-block;
  font-size: 10.5px;
  line-height: 15px;
  padding: 0 5px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  opacity: 0.6;
  white-space: nowrap;
}

/* Continuation chains render as one row, so the head states how many legs
   stand behind it. Shown at every density -- it is new information, not
   repetition. */
.conv-chain-badge {
  font-size: 10.5px;
  line-height: 15px;
  padding: 0 5px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  white-space: nowrap;
  flex: 0 0 auto;
}
.conv-chain-badge[data-parent-sid] { cursor: pointer; }
.conv-chain-badge[data-parent-sid]:hover { color: var(--text); border-color: var(--text-muted); }


/* display:contents everywhere else, so the wrapper is invisible to the flex
   layouts every other list uses. */
.conv-meta-col { display: contents; }

/* Idea identity stays in the avatar on both desktop and phone rows. */
.conv-idea-avatar {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--avatar-hue), 52%, 48%), hsl(var(--avatar-hue), 54%, 30%));
  cursor: pointer;
  font: inherit;
}
.conv-item:has(.conv-main-row > .conv-idea-avatar) {
  --conv-content-left: calc(var(--conv-icon-left) + 44px);
  min-height: 54px;
}
.conv-item .conv-session-icon.conv-idea-avatar {
  top: 6px;
  transform: none;
  display: inline-flex;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  z-index: 3;
}
.conv-avatar-number { font: 700 15px/1 system-ui, sans-serif; }
.conv-avatar-project { display: none; }
.conv-avatar-model {
  position: absolute;
  bottom: -5px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: 20px;
  height: 20px;
  justify-content: center;
  box-sizing: border-box;
  padding: 3px;
  border: 0;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font: 8px/1.2 system-ui, sans-serif;
  white-space: nowrap;
}
/* Keep identity readable regardless of repository art or model cost. */
.conv-avatar-engine, .conv-avatar-engine svg { display: block; width: 14px; height: 14px; }
@media (max-width: 1200px) {
  #convList .conv-item > .wa-row:has(.conv-idea-avatar) { gap: 10px; }
  .wa-av.conv-idea-avatar { align-self: flex-start; margin-top: 8px; }
}
.conv-idea-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.conv-family-details { flex: 0 0 auto; min-width: 0; font-size: 11px; color: var(--text-muted); }
.conv-family-details > summary { cursor: pointer; white-space: nowrap; padding: 3px 5px; border: 1px solid var(--border); border-radius: 4px; }
.conv-family-details[open] { flex-basis: 100%; }
.conv-main-row:has(.conv-family-details[open]) { flex-wrap: wrap; }
.conv-family-list { display: grid; gap: 3px; max-height: 180px; overflow: auto; margin: 4px 0; }
.conv-family-link { text-align: start; white-space: normal; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); cursor: pointer; font: inherit; }
.conv-family-link:hover { border-color: var(--accent); }
.conv-orch-family-details { max-width: 100%; }
.conv-orch-family-details > summary.conv-orch-lanes-chip { display: list-item; width: fit-content; margin-left: 14px; }
.conv-orch-family-details[open] { width: 100%; }
.conv-orch-family-details .conv-family-link:disabled { cursor: default; color: var(--text-muted); }
@media (max-width: 1200px) {
  .conv-orch-family-details > summary.conv-orch-lanes-chip,
  .conv-orch-family-details .conv-family-link { min-height: 44px; box-sizing: border-box; }
}

/* Uniform-column hoist. When every worker in view shares an engine and/or a
   cost tier, that per-row glyph is pure repetition: the strip above the list
   states the shared value once and these rules reclaim the column it used to
   occupy. Only the columns that are ACTUALLY uniform get hidden -- a varying
   cost tier keeps its dollars on every row. The activity dot is never hidden:
   working-vs-idle differs per row, which is the whole point. */
.conv-workers-uniform {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 8px 4px;
  padding: 2px 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted, #93a1b0);
}
.conv-workers-uniform b {
  font-weight: 700;
  color: var(--fg, #d8e2ec);
}
.conv-workers-uniform-note {
  color: var(--text-muted);
  font-size: 10px;
}
.conv-workers-uniform-sep { opacity: 0.4; }
/* Same dot as the Queues tab's WORKING NOW strip -- teal, 6px, qPulse -- so
   "live" reads identically in both places. */
.conv-workers-live { display: inline-flex; align-items: center; gap: 5px; }
.conv-workers-live-dot {
  flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%;
  /* Queues' shape and pulse, but the session list's green rather than its
     teal: inside this tab the header dot and the row dots are the same
     signal, and two colours would read as two. */
  background: #49dc88; animation: qPulse 2s ease-in-out infinite;
}
.conv-workers-live.is-idle { opacity: 0.55; }
@media (prefers-reduced-motion: reduce) {
  .conv-workers-live-dot { animation: none; }
}

/* ---- Workers tab: fleet strip, state sections, ticket under the avatar ----
   The Workers tab answers one question: is anything moving, and is anything
   waiting on me. The strip above counts the four states once; the list is
   sectioned by the same four states; each row's ticket sits under its
   avatar so the title is free to say what the worker is doing. */
.conv-workers-uniform .conv-workers-needs b { color: var(--orange, #d29922); }
.conv-workers-uniform .conv-workers-starting b { color: #39d2c0; }
.conv-workers-uniform .conv-workers-idle,
.conv-workers-uniform .conv-workers-done { opacity: 0.75; }
.conv-workers-uniform .conv-workers-uniform-note { flex-basis: 100%; text-align: left; }

/* Section heads: a coloured dot, a small-caps label, the count, and a rule
   that runs to the edge. Sticky so a long Finished section still says what
   it is while you scroll through it. */
#convList .conv-worker-section {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 7px;
  margin: 10px 8px 4px; padding: 3px 2px 3px 4px;
  font-size: 10.5px; line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  background: linear-gradient(var(--surface, #0d1117) 70%, transparent);
}
#convList .conv-worker-section:first-child { margin-top: 4px; }
#convList .conv-worker-section .wk-sec-dot {
  flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted); opacity: 0.6;
}
#convList .conv-worker-section .wk-sec-label { font-weight: 700; color: var(--text); }
#convList .conv-worker-section .wk-sec-count {
  min-width: 16px; padding: 0 5px; border-radius: 8px; text-align: center;
  font-weight: 700; font-size: 10px; letter-spacing: 0;
  background: var(--surface-2); color: var(--text);
}
#convList .conv-worker-section .wk-sec-line { flex: 1 1 auto; height: 1px; background: var(--border); opacity: 0.8; }
#convList .conv-worker-section.wk-working .wk-sec-dot { background: #49dc88; opacity: 1; animation: qPulse 2s ease-in-out infinite; }
#convList .conv-worker-section.wk-working .wk-sec-label { color: #49dc88; }
#convList .conv-worker-section.wk-starting .wk-sec-dot { background: #39d2c0; opacity: 1; animation: qPulse 2s ease-in-out infinite; }
#convList .conv-worker-section.wk-needs-you .wk-sec-dot { background: var(--orange, #d29922); opacity: 1; }
#convList .conv-worker-section.wk-needs-you .wk-sec-label { color: var(--orange, #d29922); }
#convList .conv-worker-section.wk-needs-you .wk-sec-count { background: color-mix(in srgb, var(--orange, #d29922) 22%, transparent); color: var(--orange, #d29922); }
#convList .conv-worker-section.wk-done .wk-sec-dot { opacity: 0.35; }
#convList .conv-worker-section.wk-done .wk-sec-label { color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
  #convList .conv-worker-section .wk-sec-dot { animation: none; }
}

/* Row accents by state: a 2px inset bar on the left edge, the same colour
   as the section dot, so a row still says its state when scrolled away
   from its heading. Finished rows dim; helper rows (verifier, planner,
   assessor) are quieter still, since they are stage work, not workers. */
#convList .conv-item.is-worker-row { position: relative; }
#convList .conv-item.is-worker-row::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  border-radius: 2px; background: transparent; pointer-events: none;
}
#convList .conv-item.is-worker-row.wk-working::before { background: #49dc88; }
#convList .conv-item.is-worker-row.wk-needs-you::before { background: var(--orange, #d29922); }
#convList .conv-item.is-worker-row.wk-needs-you { background: color-mix(in srgb, var(--orange, #d29922) 6%, transparent); }
#convList .conv-item.is-worker-row.wk-idle::before { background: color-mix(in srgb, var(--text-muted) 40%, transparent); }
#convList .conv-item.is-worker-row.wk-done .conv-title { opacity: 0.72; }
#convList .conv-item.is-worker-row.wk-done .conv-idea-avatar { filter: saturate(0.55); opacity: 0.8; }
#convList .conv-item.is-worker-row.is-worker-helper .conv-title { font-style: italic; opacity: 0.85; }

/* Ticket under the avatar. The avatar is absolutely positioned in the
   desktop row, so the stack is display:contents and the chip takes the
   same absolute slot the AUTO switch uses, one line below the portrait.
   Rows with both push the ticket under the switch. Child-mini avatars
   (nested helpers) have no room for it and their owner shows it anyway. */
.conv-avatar-stack { display: contents; }
.conv-item:has(.conv-main-row > .conv-avatar-stack > .conv-idea-avatar) {
  --conv-content-left: calc(var(--conv-icon-left) + 44px);
  min-height: 60px;
}
#convList .conv-item .conv-main-row > .conv-avatar-stack > .conv-avatar-ticket {
  position: absolute; left: calc(var(--conv-icon-left) - 11px); top: 41px; z-index: 4;
  width: 54px;
}
#convList .conv-item .conv-main-row:has(> .conv-auto-switch) > .conv-avatar-stack > .conv-avatar-ticket { top: 57px; }
#convList .conv-item .conv-main-row:has(> .conv-auto-switch) { min-height: 76px; }
#convList .conv-item .conv-main-row > .conv-avatar-stack:has(> .is-child-mini) > .conv-avatar-ticket { display: none; }
.conv-avatar-ticket {
  display: inline-block; box-sizing: border-box;
  max-width: 100%; padding: 0 3px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 45%, transparent);
  border-radius: 4px; background: var(--surface, transparent);
  color: var(--text-muted);
  font: 600 8px/11px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em; text-align: center;
  /* Wrap long refs (BECKY-3363 -> BECKY- / 3363) instead of cutting them with an ellipsis. */
  white-space: normal; overflow-wrap: anywhere; overflow: visible;
  cursor: pointer; opacity: 0.85;
  transition: color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.conv-avatar-ticket:hover, .conv-avatar-ticket:focus-visible {
  opacity: 1; color: var(--accent); border-color: var(--accent); outline: none;
}
#convList .conv-item.is-worker-row.wk-working .conv-avatar-ticket { color: var(--text); border-color: color-mix(in srgb, #49dc88 55%, transparent); }
#convList .conv-item.is-worker-row.wk-needs-you .conv-avatar-ticket { color: var(--orange, #d29922); border-color: color-mix(in srgb, var(--orange, #d29922) 60%, transparent); }
#convList .conv-item .wa-av-col > .conv-avatar-ticket { position: static; width: 54px; }

/* The per-row dot answers "which ones". At 4px hollow-vs-filled it was losing
   that argument, so in the table a live row gets the WORKING NOW dot's size
   and pulse -- the two surfaces now say "live" the same way. */
#convList.workers-dense .conv-item .is-working .session-activity-dot {
  width: 6px; height: 6px; margin-top: -3px; left: -5px;
  animation: qPulse 2s ease-in-out infinite;
}
/* .hoisted-engine / .hoisted-cost mark the rows whose value the banner above
   the list already states. A row that DIFFERS carries neither class and keeps
   its glyph, so the exceptions are exactly what the column still shows. */
#convList.workers-hoist-engine .conv-item .conv-session-icon.hoisted-engine .conv-session-svg,
#convList.workers-hoist-engine .conv-item .conv-session-icon.hoisted-engine > svg {
  display: none;
}
/* The $-tier sits at left:18px to clear the engine glyph; with the glyph gone
   it slides back to the start of the column. */
#convList.workers-hoist-engine .conv-item .conv-session-icon.hoisted-engine .session-tier-cost { left: 2px; }
#convList.workers-hoist-cost .conv-item .conv-session-icon.hoisted-cost .session-tier-cost { display: none; }
/* --conv-content-left is calc()'d off --conv-dot-col on .conv-item, so
   narrowing the column here reflows the title's left edge with it. JS only
   sets .workers-icon-narrow when nothing in the column renders on ANY row --
   an exception still needs room for its glyph, and the width is shared. */
#convList.workers-icon-narrow .conv-item { --conv-dot-col: 12px; }
/* No engine exception means no row draws a glyph, so the gutter only has to
   fit a $-tier -- which slides to the start of the column once the glyph
   beside it is gone. */
#convList.workers-icon-mid .conv-item { --conv-dot-col: 24px; }
/* Overflow chip: same affordance as the ticket chips, muted so it reads as a
   count rather than a fourth ticket ref. Shown in every density. */
.conv-worker-history-more {
  padding: 1px 5px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: default;
}

/* Cozy Workers keeps titles and work previews compact across row presets.
   Match the shared desktop inline-step selector before adding lane specificity. */
#convList#convList.workers-cozy .conv-item,
#convList#convList.workers-cozy .conv-item:has(.conv-main-row.has-inline-step) {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
  margin-bottom: 2px !important;
  min-width: 0;
}
#convList#convList.workers-cozy .conv-item .conv-title,
#convList#convList.workers-cozy .conv-item .conv-main-row.has-inline-step .conv-title {
  font-size: 13px !important;
  line-height: 1.4 !important;
}
#convList#convList.workers-cozy .conv-item .conv-last,
#convList#convList.workers-cozy .conv-item .conv-outcome,
#convList#convList.workers-cozy .conv-item .conv-main-row.has-inline-step > .conv-outcome .conv-outcome-step {
  font-size: 11px;
  line-height: 1.4;
}

/* Readable log entries keep severity and summaries visible, diagnostics expandable. */
.activity-log-entry {
  --log-level: #78b7ff;
  margin: 6px 8px;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--log-level) 24%, var(--border));
  border-left: 3px solid var(--log-level);
  border-radius: 7px;
  background: color-mix(in srgb, var(--log-level) 5%, var(--surface));
  color: var(--text);
  font-family: var(--font-ui, sans-serif);
}
.activity-log-entry.is-error { --log-level: #ff8585; }
.activity-log-entry.is-warning { --log-level: #edbf68; }
.activity-log-entry.is-success { --log-level: #67d7a5; }
.activity-log-summary { display: block; padding: 9px 10px; cursor: pointer; list-style: none; }
.activity-log-summary::-webkit-details-marker { display: none; }
.activity-log-summary:hover { background: color-mix(in srgb, var(--log-level) 5%, transparent); }
.activity-log-summary:focus-visible { outline: 2px solid var(--log-level); outline-offset: 1px; border-radius: 5px; }
.activity-log-entry-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; font-size: 10px; }
.activity-log-level { color: var(--log-level); font-weight: 700; }
.activity-log-time { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.activity-log-repeat { border-radius: 4px; background: color-mix(in srgb, var(--log-level) 15%, transparent); padding: 1px 5px; color: var(--log-level); font-weight: 700; }
.activity-log-headline { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 5px 0; font-size: 13px; line-height: 1.45; font-weight: 550; overflow-wrap: anywhere; }
.activity-log-entry[open] .activity-log-headline { display: block; }
.activity-log-origin { display: flex; flex-wrap: wrap; gap: 3px 8px; font-family: var(--font-mono, monospace); font-size: 9px; color: var(--text-muted); overflow-wrap: anywhere; }
.activity-log-disclosure { margin-left: auto; white-space: nowrap; }
.activity-log-entry[open] .activity-log-disclosure { color: var(--log-level); }
.activity-log-occurrences { padding: 0 10px 10px; min-width: 0; }
.activity-log-occurrence { border-top: 1px solid var(--border); padding-top: 7px; margin-top: 3px; }
.activity-log-occurrence-time { color: var(--text-muted); font-size: 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.activity-log-copy { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--text-muted); cursor: pointer; }
.activity-log-copy:hover { color: var(--text); border-color: var(--border); }
.activity-log-copy.is-copied { color: var(--success, #3fb950); }
.activity-log-raw { margin: 5px 0; font: 11px/1.5 var(--font-mono, monospace); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
:root[data-theme="light"] .activity-log-entry { --log-level: #246ab6; }
:root[data-theme="light"] .activity-log-entry.is-error { --log-level: #b52b35; }
:root[data-theme="light"] .activity-log-entry.is-warning { --log-level: #926000; }
:root[data-theme="light"] .activity-log-entry.is-success { --log-level: #167348; }

/* Keep scope and event toggles together; search gets a full-width row. */
.rail-log-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.rail-log-scope { grid-column: 1; grid-row: 1; justify-self: start; min-width: 0; }
.rail-log-toolbar .activity-log-scope-btn { padding: 3px 5px; min-width: 0; }
.rail-log-kind-filters { grid-column: 2; grid-row: 1; display: flex; gap: 4px; }
.rail-log-filter { grid-column: 1 / -1; grid-row: 2; width: 100%; }

/* Keep the quiet unfinished-turn warning beside the session title. */
.conv-stuck-warning {
  display: inline-flex;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: #eab308;
  align-self: center;
}
.conv-stuck-warning svg { width: 100%; height: 100%; }

/* Model comparison is part of the new-session decision, before launch. */
.ns-stage-quiet { padding-top: clamp(16px, 3vh, 32px); }
.ns-stage-quiet .ns-hero-quiet { width: 100%; min-width: 0; }
.ns-model-comparison { width: 100%; max-width: 960px; text-align: left; color: var(--text); }
.ns-model-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.ns-model-heading label { display: flex; align-items: center; gap: 8px; }
.ns-model-heading select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 5px; padding: 5px; max-width: 200px; }
.ns-model-note { color: var(--text-muted); font-size: 11px; line-height: 1.5; margin: 8px 0; }
.ns-model-table-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.ns-model-comparison table { border-collapse: collapse; width: 100%; font-size: 12px; line-height: 1.45; }
.ns-model-comparison th { text-align: left; position: sticky; top: 0; background: var(--bg); color: var(--text-muted); font-size: 11px; z-index: 1; }
.ns-model-comparison th, .ns-model-comparison td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ns-model-comparison td:first-child { width: 23%; }
.ns-model-comparison .ns-model-cost { width: 28%; font-variant-numeric: tabular-nums; }
.ns-model-comparison small { display: block; color: var(--text-muted); font-size: 10px; margin-top: 5px; }
.ns-model-comparison tr.is-selected { background: color-mix(in srgb, var(--accent, #58a6ff) 12%, transparent); }
.ns-model-choice { border: 0; background: transparent; color: var(--text); padding: 0; text-align: left; font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.ns-model-choice:hover { color: var(--accent, #58a6ff); text-decoration: underline; }
.ns-model-choice:focus-visible { outline: 2px solid var(--accent, #58a6ff); outline-offset: 3px; }
.ns-model-choice:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 600px) {
  .ns-stage-quiet { padding: 14px 8px; }
  .ns-model-comparison th, .ns-model-comparison td { padding: 7px 5px; }
  .ns-model-comparison table { font-size: 11px; }
}
.ns-model-selected { font-size: 12px; line-height: 1.5; margin: 10px 0; font-weight: 600; cursor: pointer; }
.ns-model-details > summary { list-style: revert; }
.ns-model-compare-hint { margin-left: 8px; font-weight: 400; color: var(--accent, #58a6ff); }
.ns-model-details:not([open]) > summary { margin-bottom: 0; }
.ns-model-details[open] .ns-model-compare-hint { display: none; }

.ns-model-rank { font-size: 11px; color: var(--text-muted); }
.ns-model-manual { border: 0; background: transparent; color: var(--text-muted); font: inherit; cursor: pointer; white-space: nowrap; padding: 3px 7px; order: 2; }
.is-depth-ranked > .ccc-free-pill { order: 1; }
.ns-advisor { width: 100%; max-width: 800px; box-sizing: border-box; padding: 18px; margin: 10px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); text-align: left; font-size: 13px; line-height: 1.5; }
/* Composer hierarchy: thinking first, automatic model second. */
.conv-model-picker-strip.has-depth-control { flex-direction: column; gap: 4px; }
#nsComposerAdvisor {
  width: 100%; max-width: none; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: transparent;
}
#nsComposerAdvisor[hidden] { display: none; }
#nsComposerAdvisor .ns-advisor-top { justify-content: flex-start; gap: 10px; }
#nsComposerAdvisor .ns-advisor-depth {
  display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface);
}
#nsComposerAdvisor .ns-advisor-depth button {
  padding: 6px 18px; border-radius: 999px; border-color: transparent;
  background: transparent; font-size: 13px; font-weight: 600; color: var(--text-muted);
}
#nsComposerAdvisor .ns-advisor-depth button[aria-pressed="true"] {
  color: var(--text); border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
  background: color-mix(in srgb, var(--accent) 15%, var(--bg));
}
.ns-advisor-why { font-size: 12px; color: var(--text-muted); }
.ns-advisor-why > summary { cursor: pointer; list-style: none; padding: 8px 4px; }
.ns-advisor-why > summary::-webkit-details-marker { display: none; }
.ns-advisor-explanation {
  padding: 12px; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); max-height: 220px; overflow-y: auto;
}
#nsComposerAdvisor .ns-advisor-result { margin: 0 0 10px; }
#nsComposerAdvisor .ns-advisor-result > strong { font-size: 13px; }
#nsComposerAdvisor .ns-advisor-why[open] { flex: 1 0 100%; }
#nsComposerAdvisor .ns-auto-restore { font-size: 11px; padding: 3px 8px; }
#nsComposerAdvisor .ns-advisor-suggest {
  flex: 1 0 100%; font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
#nsComposerAdvisor .ns-advisor-suggest button { font-size: 11px; padding: 3px 8px; }
.ns-model-overrides { min-width: 0; width: 100%; }
.ns-model-overrides > summary {
  display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%;
  list-style: none; cursor: pointer; color: var(--text-muted); font-size: 11px; padding: 3px 0;
}
.ns-model-overrides > summary::-webkit-details-marker { display: none; }
#nsSelectedModel { display: flex; gap: 7px; min-width: 0; align-items: center; }
.ns-selection-mode { color: var(--accent); font-size: 10px; font-weight: 600; }
.ns-selection-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-model-change { text-decoration: underline; text-underline-offset: 3px; }
.ns-model-overrides .conv-model-picker-inner { margin-top: 8px; }
/* Detailed overrides follow ranked shortcuts; account choice belongs to
   the selected engine inside this disclosure. */
.ns-model-override-selects { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ns-model-override-selects:empty { display: none; }
.ns-model-account-options { margin-top: 8px; }
.ns-model-account-options:not(:has(> :not([hidden]))) { display: none; }
.ns-model-account-options .codex-account-row { flex-wrap: wrap; }
.ns-model-account-options .codex-account-row label { flex: 0 0 auto; }
.ns-model-override-selects > select { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.ns-model-overrides.is-legacy > summary { display: none; }
.conv-pane:has(.conv-model-picker-strip.has-auto-selection) .ns-model-comparison:not(.is-manual-expanded) { display: none; }
.conv-pane.has-new-session-context:has(.has-auto-selection):not(:has(#nsModelOverrides[open])) :is(#convInputEngineSelect, #convInputModelSelect, #convInputEffortSelect) { display: none !important; }
#nsComposerAdvisor.is-editing { padding: 12px; border: 1px solid var(--border); border-radius: 8px; max-height: 50vh; overflow-y: auto; }
@media (max-width: 1200px) {
  #nsComposerAdvisor .ns-advisor-depth button { min-height: 36px; padding: 5px 20px; }
  .ns-model-overrides > summary { min-height: 32px; }
  .ns-model-overrides[open] .conv-model-picker-chips { flex-wrap: wrap !important; overflow: visible; }
}
.ns-advisor-top, .ns-advisor-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.ns-advisor-top > strong { font-size: 14px; }
.ns-advisor button, .ns-advisor input, .ns-advisor select { font: inherit; color: var(--text); border: 1px solid var(--border); border-radius: 6px; background: var(--bg); padding: 5px 9px; }
.ns-advisor button { cursor: pointer; }
.ns-advisor button:disabled { opacity: .5; cursor: default; }
.ns-advisor button:focus-visible, .ns-advisor input:focus-visible, .ns-advisor select:focus-visible { outline: 2px solid var(--accent, #58a6ff); outline-offset: 2px; }
.ns-advisor-depth { display: flex; gap: 4px; }
.ns-advisor-depth button[aria-pressed="true"], .ns-advisor [data-advisor-use], .ns-advisor [data-advisor-save] { border-color: var(--accent, #58a6ff); background: color-mix(in srgb, var(--accent, #58a6ff) 12%, var(--bg)); }
.ns-advisor-caption, .ns-advisor small, .ns-advisor-actions > span { color: var(--text-muted); font-size: 12px; }
.ns-advisor-result { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.ns-advisor-result > strong { font-size: 17px; overflow-wrap: anywhere; }
.ns-advisor-result small { line-height: 1.6; }
.ns-advisor-preferences { margin-top: 14px; }
.ns-advisor-alternatives { margin-top: 14px; }
.ns-advisor-alternatives summary { cursor: pointer; }
.ns-advisor-alternatives li { margin: 10px 0; }
.ns-advisor-alternatives small { display: block; }
.ns-advisor h4 { margin: 18px 0 8px; font-size: 13px; }
.ns-advisor-edit-list { padding-left: 22px; }
.ns-advisor-edit-list li { padding: 4px 0; }
.ns-advisor-edit-list li > span { display: inline-block; width: calc(100% - 120px); vertical-align: middle; overflow-wrap: anywhere; }
.ns-advisor-edit-list button { padding: 2px 7px; margin-left: 3px; }
.ns-advisor-resource { margin: 12px 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.ns-advisor-resource legend { padding: 0 6px; }
.ns-advisor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.ns-advisor-fields label { display: flex; flex-direction: column; gap: 3px; color: var(--text-muted); font-size: 11px; }
.ns-advisor-fields input, .ns-advisor-fields select { min-width: 0; width: 100%; box-sizing: border-box; }
.ns-advisor-error { color: var(--danger, #f87171); }
@media (max-width: 600px) {
  .ns-advisor { padding: 12px; }
  .ns-advisor-fields { grid-template-columns: minmax(0, 1fr); }
  .ns-advisor-result > strong { font-size: 15px; }
}

/* Codex reader: quiet message chrome, readable actions, bounded attachments. */
.conv-pane.is-codex-session .kimi-turn .assistant-text {
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.conv-pane.is-codex-session .kimi-answer-meta {
  opacity: 1;
  color: var(--kw-muted);
  gap: 10px;
  margin-top: 6px;
}
.conv-pane.is-codex-session .kimi-answer-meta .line-num { font-size: 11px; font-variant-numeric: tabular-nums; }
.conv-pane.is-codex-session .kimi-answer-meta .assistant-message-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.conv-pane.is-codex-session .assistant-message-action:focus-visible,
.conv-pane.is-codex-session .codex-attachment:focus-visible {
  outline: 2px solid var(--kw-accent);
  outline-offset: 3px;
}
.conv-pane.is-codex-session .codex-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--kw-accent-bd);
  border-radius: 8px;
  background: var(--kw-accent-soft);
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.conv-pane.is-codex-session .event.result .assistant-message-actions { display: none; }
.conv-pane.is-codex-session .conversations-view > .event.user_text { margin-block: 24px 18px; }
/* The terminal theme's full-width gradient competes with the conversation.
   Keep its palette, while letting Codex use the same rounded message shape. */
.conv-pane.is-codex-session[data-conv-bg="stitch"] .conversations-view .event.user_text:not(.is-pinned-in-sticky):not(.peer-message) {
  clip-path: none !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.conv-pane.is-codex-session[data-conv-bg="stitch"] .conversations-view .event.user_text:not(.is-pinned-in-sticky):not(.peer-message) .user-msg {
  max-width: 100% !important;
  margin-left: auto;
  padding: 12px 16px !important;
  border: 1px solid var(--kw-accent-bd) !important;
  border-radius: 16px 16px 4px 16px !important;
  background: var(--kw-accent-soft) !important;
  letter-spacing: normal !important;
}
.conv-pane.is-codex-session[data-conv-bg="stitch"] .conversations-view .event.user_text .user-msg::after { content: none; }
@media (max-width: 600px) {
  .conv-pane.is-codex-session .conversations-view { padding-inline: 12px; }
  .conv-pane.is-codex-session .event.user_text .user-msg { max-width: 94%; }
}
.conv-pane.is-webui-session .kimi-tool-head[role="button"]:focus-visible,
.conv-pane.is-webui-session .kimi-tool-group-head:focus-visible {
  outline: 2px solid var(--kw-accent);
  outline-offset: -3px;
  border-radius: 6px;
}

.fq-ticket-queue-select {
  width: 100%; margin-bottom: 10px; padding: 6px 8px; font: inherit;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}

/* A steer the engine rejected stays on its queued card until the next attempt. */
.queued-steer-tray .send-queued-error {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--red, #e5534b);
  border-radius: 6px;
  color: var(--red, #e5534b);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Frozen ask: the user message being answered stays at the top of the
   transcript while the reader is scrolled up. The host is a zero-height
   sticky child so it never changes scrollHeight; the bubble hangs below it. */
.conv-frozen-ask {
  position: sticky; top: 0; z-index: 6;
  height: 0; margin: 0; padding: 0;
}
.conv-frozen-ask[hidden] { display: none; }
.conversations-view:has(.conv-live-tool-strip) .conv-frozen-ask {
  top: var(--live-strip-offset, 24px);
}
.conv-frozen-ask__bubble {
  position: absolute; top: 2px; left: 0; right: 0;
  box-sizing: border-box;
  padding: 7px 12px 7px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(88, 166, 255, 0.16), rgba(163, 113, 247, 0.10) 65%, rgba(57, 210, 192, 0.08)) padding-box,
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, rgba(88, 166, 255, 0.50), rgba(163, 113, 247, 0.30) 70%, rgba(57, 210, 192, 0.25)) border-box,
    linear-gradient(var(--bg), var(--bg)) border-box;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.conv-frozen-ask__bubble:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.conv-frozen-ask__bubble > .original-ask-expand { float: right; margin: 1px 0 0 10px; }
.conv-frozen-ask__bubble > .user-msg {
  /* Two lines, always. max-height is the guarantee; the line clamp only
     adds the ellipsis where the engine honours it (a long ask once filled
     a whole phone screen when the clamp alone was trusted). */
  display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  max-height: 2.9em !important;
  overflow: hidden !important;
  white-space: normal !important; overflow-wrap: anywhere;
  margin: 0;
  color: var(--text);
  font-size: 14.5px; line-height: 1.45; font-weight: 410;
}
.conv-frozen-ask__bubble > .user-msg :is(img, .msg-image) { display: none; }
.conv-frozen-ask__bubble { max-height: 64px; overflow: hidden; }

/* CCC-1206: (+) on the Original ask opens it in a large-font reading modal. */
.original-ask-expand {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0;
  margin-left: 8px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer; vertical-align: middle;
  transition: background 0.12s ease-out, color 0.12s ease-out, border-color 0.12s ease-out;
}
.original-ask-expand:hover,
.original-ask-expand:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
.conversations-view .event.user_text.is-pinned-in-sticky .user-msg > .original-ask-expand {
  float: right; margin: 0 0 6px 10px;
}
.uxq-note-overlay.is-original-ask .uxq-note-modal {
  width: min(900px, calc(100vw - 40px));
  max-height: calc(100vh - 64px);
}
.uxq-note-overlay.is-original-ask .uxq-note-modal-body {
  padding: 22px 28px 28px;
  font-size: 20px;
  line-height: 1.75;
}
.uxq-note-overlay.is-original-ask .uxq-note-modal-body .tp-body {
  font-size: inherit; line-height: inherit; max-width: none; max-height: none;
}
.uxq-note-overlay.is-original-ask .uxq-note-modal-body .tp-body code { font-size: 0.85em; }

/* Federated sidebar (static/federated-sidebar.js): peer machines' sessions.
   Deliberately not .conv-item, so the local list's delegated row handlers
   (select, drag, archive, prefetch) never see these rows. */
.fed-peer-section { padding: 4px 6px 8px; border-bottom: 1px solid var(--border); }
.fed-head {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 4px; font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted); cursor: pointer; user-select: none;
}
.fed-head:hover, .fed-head:focus-visible { color: var(--text); outline: none; }
.fed-caret { flex: none; width: 12px; font-size: 13px; line-height: 1; }
.fed-head-count {
  padding: 0 6px; border-radius: 8px; font-size: 10px; line-height: 16px; letter-spacing: 0;
  background: var(--surface-2); border: 1px solid var(--border);
}
/* Swatch that opens the peer-row background palette (persisted in localStorage). */
.fed-color {
  margin-left: auto; flex: none; width: 16px; height: 16px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 50%; background: var(--fed-row-bg, #2a1824);
}
.fed-head-count[hidden] { display: none; }
.fed-bg-popover {
  position: fixed; z-index: 1000; padding: 8px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.fed-peer-section .fed-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 2px;
  border-radius: 6px; border-left: 3px solid transparent; cursor: pointer;
  background: var(--fed-row-bg, #2a1824);
}
.fed-peer-section .fed-title { color: var(--fed-row-text, var(--text)); }
.fed-peer-section .fed-sub, .fed-peer-section .fed-time { color: var(--fed-row-muted, var(--text-muted)); }
.fed-peer-section .fed-row .fed-chip {
  background: var(--fed-row-chip, var(--surface-2)); border-color: var(--fed-row-border, var(--border));
  color: var(--fed-row-muted, var(--text-secondary));
}
.fed-peer-section .fed-row:hover, .fed-peer-section .fed-row:focus-visible { filter: brightness(1.3); outline: none; }
.fed-peer-section .fed-row.active { filter: brightness(1.3); border-left-color: var(--accent); }
.fed-peer-section .fed-row.is-offline { opacity: 0.55; }
.fed-peer-section .fed-row.is-blocked { cursor: default; }
.fed-peer-section .fed-row.is-blocked:hover { filter: none; }
.fed-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.fed-dot.is-live { background: #3fb950; }
.fed-main { flex: 1; min-width: 0; }
.fed-title { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-sub { display: flex; gap: 6px; align-items: center; margin-top: 2px; font-size: 11px; color: var(--text-muted); min-width: 0; }
.fed-cwd, .fed-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-note { font-style: italic; }
.fed-chip {
  flex: none; padding: 0 6px; border-radius: 8px; font-size: 10px; line-height: 16px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.fed-time { flex: none; font-size: 11px; color: var(--text-muted); }
.fed-more {
  width: 100%; margin-top: 2px; padding: 4px 8px; background: none; border: none;
  color: var(--text-muted); font-size: 11px; text-align: left; cursor: pointer;
}
.fed-more:hover { color: var(--text); }
.main.fed-embed-host { position: relative; }
.fed-embed {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--fed-row-bg, #2a1824);
}
.fed-embed-bar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.fed-embed-title { flex: 1; min-width: 0; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-embed-close {
  flex: none; padding: 2px 10px; font-size: 12px; color: var(--text); cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
}
.fed-embed-frame { flex: 1; width: 100%; min-height: 0; border: none; background: var(--fed-row-bg, #2a1824); }
.fed-embed[hidden], .fed-embed-frame[hidden] { display: none; }


/* First-run engines screen: the Settings modal opened on Engines with the
   rail, search and the non-list cards hidden (app.js openEnginesFirstRun). */
.settings-modal.is-first-run .settings-rail,
.settings-modal.is-first-run .settings-search-wrap,
.settings-modal.is-first-run .settings-esc-hint,
.settings-modal.is-first-run .settings-section-eyebrow,
.settings-modal.is-first-run .eng-defaults,
.settings-modal.is-first-run #spawnDefaultsError,
.settings-modal.is-first-run #engList ~ *:not(#engFirstRunDefaults):not(#engTailscaleStep) { display: none !important; }
.settings-modal.is-first-run .settings-modal-header { justify-content: flex-end; border-bottom: none; padding-bottom: 0; }
.settings-modal.is-first-run { width: min(860px, calc(100vw - 40px)); }
.eng-first-run-intro { margin: 0 0 14px; }
.eng-first-run-title { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.eng-first-run-body { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); max-width: 62ch; }
.eng-first-run-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface);
}
.eng-first-run-foot[hidden] { display: none; }
.eng-first-run-foot-note { flex: 1 1 auto; font-size: 12px; color: var(--text-muted); }
.eng-sub-cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
@media (max-width: 720px) {
  .settings-modal.is-first-run { width: 100vw; }
  .eng-first-run-title { font-size: 19px; }
  .eng-first-run-foot { padding: 10px 14px; }
}

.eng-quick { min-width: 68px; padding: 3px 12px; font-size: 11.5px; }

/* Composer notice: the selected engine is not installed on this Mac. */
.engine-missing-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.4;
  color: var(--text); background: var(--surface, var(--bg));
  border: 1px solid var(--border); border-left: 3px solid var(--amber, #d9a441);
  border-radius: 6px;
}
.engine-missing-notice[hidden] { display: none; }
.engine-missing-notice .emn-msg { flex: 1 1 200px; min-width: 0; }
.engine-missing-notice .emn-msg code { font-size: 11.5px; opacity: .85; }
.engine-missing-notice button {
  font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.engine-missing-notice button.emn-primary { background: var(--accent, #4c8dff); border-color: transparent; color: #fff; }
.engine-missing-notice button:disabled { opacity: .6; cursor: default; }

.eng-first-run-defaults { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.eng-first-run-defaults[hidden] { display: none !important; }
.eng-first-run-defaults .efd-label { font-size: 12.5px; font-weight: 600; margin-right: 4px; }
.eng-first-run-defaults select { width: auto; max-width: 100%; }
.eng-first-run-defaults select[hidden] { display: none; }

/* First-run step 2: optional Tailscale card replaces the engine list. */
.settings-modal.is-step-tailscale #settingsSection-engines > *:not(#engTailscaleStep) { display: none !important; }
.settings-modal.is-step-tailscale #engFirstRunFoot { display: none; }
.eng-tailscale-step { padding: 8px 0 4px; }
.eng-tailscale-step[hidden], .ets-install[hidden], .ets-signin[hidden] { display: none !important; }
.ets-status { margin: 16px 0 10px; padding: 10px 12px; font-size: 13px; border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 6px; }
.ets-status.is-ok { border-left-color: var(--green, #3fb27f); }
.ets-status.is-warn { border-left-color: var(--amber, #d9a441); }
.ets-install, .ets-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12.5px; }
.ets-cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 5px; }
.ets-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 14px 0 8px; }
.ets-peers { margin-top: 10px; }

/* ── Jobs tab (sidebar) ─────────────────────────────────────────────── */
#convList:has(> .jobs-host) { display: flex; flex-direction: column; overflow-y: hidden !important; }
#convList:has(> .jobs-host) > .conv-tab-bar { flex: 0 0 auto; }
.jobs-host { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 8px 12px; font-size: 14px; }
.jobs-head { position: sticky; top: 0; z-index: 3; background: var(--surface); padding: 4px 0 6px; }
.jobs-seg { display: flex; gap: 2px; margin-bottom: 5px; }
.jobs-seg-btn {
  flex: 1; padding: 4px 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 4px;
}
.jobs-seg-btn:hover { color: var(--text); background: var(--surface-2); }
.jobs-seg-btn.is-active { color: var(--text); background: var(--surface-2); border-color: var(--accent, #6e8caf); }
.jobs-add-btn {
  flex: 0 0 auto; margin-left: 4px; padding: 3px 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--accent, #6e8caf);
  border: 1px solid var(--accent, #6e8caf); border-radius: 4px;
}
.jobs-add-btn:hover { background: var(--surface-2); }
.jobs-add-overlay {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.jobs-add-card {
  width: min(440px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 9px;
  padding: 16px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.jobs-add-title { font-size: 14px; font-weight: 600; }
.jobs-add-sub { font-size: 11px; color: var(--text-muted); margin-top: -5px; }
.jobs-add-card label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.jobs-add-card input, .jobs-add-card select, .jobs-add-card textarea {
  font: inherit; font-size: 14px; font-weight: 400; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 4px; padding: 5px 7px; resize: vertical;
}
.jobs-add-card .is-invalid { border-color: var(--red); }
.jobs-add-error { font-size: 11px; color: var(--red); }
.jobs-add-actions { display: flex; justify-content: flex-end; gap: 6px; }
.jobs-add-actions button {
  padding: 5px 12px; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 4px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
}
.jobs-add-actions .jobs-add-submit { background: var(--accent, #6e8caf); border-color: var(--accent, #6e8caf); color: #fff; }
.jobs-add-actions .jobs-add-submit:disabled { opacity: 0.6; cursor: default; }
.jobs-summary { font-size: 13px; color: var(--text-muted); }
.jobs-summary.is-bad { color: var(--red); }
.jobs-empty { padding: 18px 6px; color: var(--text-muted); text-align: center; }
.jobs-group > .conv-folder-group-header { position: static; }
.job-row { padding: 8px 8px 8px 10px; border-radius: 6px; cursor: pointer; }
.job-row:hover { background: var(--surface-2); }
.job-row.st-disabled { opacity: 0.5; }
.job-line1, .job-line2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.job-line2 { margin-top: 5px; font-size: 13px; color: var(--text-muted); }
.job-dot { flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--green); }
.st-failed .job-dot { background: var(--red); }
.st-stale .job-dot { background: var(--orange); }
.st-running .job-dot { background: var(--accent, #6e8caf); animation: jobPulse 1.2s ease-in-out infinite; }
.st-disabled .job-dot, .st-unknown .job-dot { background: var(--text-muted); }
@keyframes jobPulse { 50% { opacity: 0.35; } }
.job-name { flex: 0 0 auto; max-width: 55%; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-host {
  flex: 0 0 auto; font-size: 11.5px; padding: 0 5px; border-radius: 999px;
  background: rgba(139,148,158,0.18); color: var(--text-muted);
}
.job-desc-inline { flex: 1 1 0; min-width: 0; color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-strip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; width: 146px; }
.job-track { position: relative; flex: 0 0 114px; height: 14px; }
.job-track::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 1px; background: rgba(139,148,158,0.22); }
.job-tick { position: absolute; top: 1px; width: 3px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--accent, #6e8caf); }
.job-band { position: absolute; left: 0; right: 0; top: 3px; height: 8px; border-radius: 2px; background: var(--accent, #6e8caf); opacity: 0.35; }
.job-band.dense { opacity: 0.6; }
.job-now { position: absolute; top: 0; width: 1px; height: 14px; background: var(--text-muted); opacity: 0.8; }
.job-wd { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.job-mid { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.job-outcome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-outcome.is-raw { font-style: italic; opacity: 0.8; }
.job-out-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.7; font-style: normal; }
.job-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.job-mid .job-chips { flex-wrap: nowrap; }
.job-chip {
  flex: 0 0 auto; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; text-decoration: none;
  background: rgba(110,140,175,0.16); color: var(--accent, #6e8caf); border: 1px solid rgba(110,140,175,0.3);
}
a.job-chip:hover { background: rgba(110,140,175,0.3); }
.job-chip-more { font-size: 12.5px; color: var(--text-muted); }
.job-when { flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
.job-next { flex: 0 0 auto; margin-left: auto; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text); }
.st-failed .job-when { color: var(--red); }
.jobs-hist { display: inline-flex; gap: 2px; align-items: center; }
.jobs-hist i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); display: block; }
.jobs-hist i.bad { background: var(--red); }
.job-detail { margin-top: 8px; cursor: default; display: flex; flex-direction: column; gap: 4px; }
.job-desc, .job-outcome-full, .job-facts { font-size: 13px; color: var(--text-muted); white-space: pre-wrap; word-break: break-word; }
.job-facts { display: flex; align-items: center; gap: 6px; }
.job-log {
  margin: 0; max-height: 320px; overflow: auto; padding: 6px 8px;
  font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
}

.jobs-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.jobs-sort-toggle { margin-left: 0; flex: 0 0 auto; }
.jobs-sort-toggle .grouping-opt { font-size: 12px; cursor: pointer; }
.job-live {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; text-decoration: none;
  font-size: 11.5px; font-weight: 600; padding: 0 8px; border-radius: 999px;
  color: var(--accent, #6e8caf); background: rgba(110,140,175,0.16); border: 1px solid rgba(110,140,175,0.4);
}
.job-live:hover { background: rgba(110,140,175,0.32); }
.job-live i, .job-livenote i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent, #6e8caf); animation: jobPulse 1.2s ease-in-out infinite; display: inline-block; }
.job-livenote { color: var(--accent, #6e8caf); }
.job-livenote.is-done { color: var(--text-muted); }
.job-slot { flex: 0 0 auto; min-width: 3.4em; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.job-row.slot-rep .job-slot { min-width: 0; font-weight: 600; color: var(--accent, #6e8caf); font-size: 12px; }
.job-row.slot-muted, .job-row.slot-muted .job-name { opacity: 0.6; }
.job-row.slot-ok .job-dot { background: var(--green); }
.job-row.slot-bad .job-dot { background: var(--red); }
.job-row.slot-future .job-dot, .job-row.slot-muted .job-dot { background: transparent; border: 1px solid var(--text-muted); box-sizing: border-box; }
.job-row.slot-event .job-dot { background: var(--accent, #6e8caf); }
.job-row.slot-event .job-name { color: var(--text-muted); }
.job-event { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs-day-band { margin: 10px 0 2px; padding: 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.jobs-now { display: flex; align-items: center; gap: 6px; margin: 4px 0; padding: 0 4px; font-size: 13px; font-weight: 700; color: var(--red); }
.jobs-now i { flex: 1 1 auto; height: 2px; background: var(--red); opacity: 0.7; border-radius: 1px; }
.jobs-now-arrow { font-size: 11px; }

/* Jobs tab on phones (reached from the bottom nav's Jobs button). Same
   markup as desktop; this only raises tap targets to 36px+, keeps the log
   scrollable under touch, and fits the "+ Add" dialog to the screen. */
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-host { overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-seg { flex-wrap: wrap; gap: 4px; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-seg-btn,
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-add-btn { min-height: 40px; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-add-btn { margin-left: 0; padding: 0 14px; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-sort-toggle { display: inline-flex; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-sort-toggle .grouping-opt {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px;
}
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .jobs-group > .conv-folder-group-header { min-height: 40px; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .job-row { min-height: 44px; }
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .job-chip,
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .job-live {
  display: inline-flex; align-items: center; min-height: 36px; padding-top: 0; padding-bottom: 0;
}
body.has-mobile-bottom-nav:not(.ccc-simple-mode) .job-log {
  max-height: min(50vh, 420px); overflow: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; touch-action: pan-x pan-y;
}
body.has-mobile-bottom-nav .jobs-add-overlay { align-items: flex-start; overflow-y: auto; padding: 16px 0; box-sizing: border-box; }
body.has-mobile-bottom-nav .jobs-add-card {
  width: calc(100vw - 24px); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; margin: 0 auto;
}
body.has-mobile-bottom-nav .jobs-add-card input,
body.has-mobile-bottom-nav .jobs-add-card select,
body.has-mobile-bottom-nav .jobs-add-card textarea { font-size: 16px; min-height: 40px; box-sizing: border-box; }
body.has-mobile-bottom-nav .jobs-add-actions button { min-height: 40px; padding: 0 16px; }

/* CCC-1234: queue plan chip quick popover (1-tap engine/model/effort) */
.fq-plan-pop {
  position: fixed;
  z-index: 10050;
  width: min(340px, calc(100vw - 16px));
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  font-size: 12px;
  color: var(--text);
}
.fq-plan-pop-head { font-weight: 700; margin-bottom: 6px; }
.fq-plan-pop-label {
  margin: 8px 0 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fq-plan-pop-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fq-plan-pop-chips .orch-tier-chip:not(:has(.orch-glyph)) { padding: 0 8px; }
.fq-plan-pop-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.fq-plan-pop-more {
  border: 0; background: none; padding: 0;
  color: var(--accent, #58a6ff); font: inherit; font-size: 11.5px; cursor: pointer;
}
.fq-plan-pop-more:hover { text-decoration: underline; }
.fq-plan-pop-status { color: var(--text-muted); font-size: 11px; }
.fq-plan-pop-status.is-err { color: #f85149; }
@media (hover: none) {
  .fq-plan-pop-chips .orch-tier-chip { height: 30px; font-size: 12.5px; }
}

/* CCC-1235: queue manager Roles section (planner / plan reviewer / builder / verifier) */
.fq-roles { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.fq-role-row {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.fq-role-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.fq-role-name { font-weight: 600; font-size: 12.5px; color: var(--text); min-width: 96px; }
.fq-role-effective {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--text-muted);
  overflow-wrap: anywhere;
}
.fq-role-source {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted);
}
.fq-role-source.is-queue { color: #58a6ff; border-color: rgba(88,166,255,0.45); }
.fq-role-source.is-policy-fallback { color: #d29922; border-color: rgba(210,153,34,0.5); }
.fq-role-pickers { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.fq-role-pickers select {
  flex: 1 1 160px; min-width: 0; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--text); padding: 6px 8px; font: inherit; font-size: 12.5px;
}
.fq-role-pickers select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,0.14); }
.fq-role-error { margin-top: 4px; font-size: 11.5px; color: #f85149; overflow-wrap: anywhere; }

/* WT-27: worker-spawned session badge (Coding list row + breadcrumb header). */
.ccc-worker-origin {
  display: inline-flex; align-items: center; flex-shrink: 0;
  padding: 1px 7px; margin-right: 6px; border-radius: 999px;
  border: 1px solid rgba(210,153,34,0.55);
  background: rgba(210,153,34,0.16);
  color: var(--yellow, #d29922);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.ccc-worker-origin.is-linked { cursor: pointer; }
.ccc-worker-origin.is-linked:hover { background: rgba(210,153,34,0.30); }

/* Experimental idea tickets: the row's IDEAS-N / SMALL-BUGS-N chip. */
.ccc-idea-ticket {
  display: inline-flex; align-items: center; flex-shrink: 0;
  padding: 1px 7px; margin-right: 6px; border-radius: 999px;
  border: 1px solid rgba(88,166,255,0.5);
  background: rgba(88,166,255,0.12);
  color: var(--accent, #58a6ff);
  font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.ccc-idea-ticket:hover { background: rgba(88,166,255,0.26); }
.conv-idea-line {
  margin: 2px 0 1px 26px;
  min-width: 0;
  line-height: 1.5;
}
.conv-idea-line .ccc-idea-ticket { margin: 0; }

/* Ordered model routing controls in Settings > Engines. */
.model-routing-card { display: block; padding: 16px 14px; }
.model-routing-card .eng-card-head { margin-bottom: 12px; }
.model-routing-card .eng-card-sub { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.model-routing-entry { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.model-routing-entry select { max-width: 100%; }
.model-routing-card .settings-row { gap: 16px; }
@media (max-width: 600px) {
  .model-routing-entry select { flex: 1 1 140px; min-width: 0; }
}

/* Compact transcript view (Compact | Normal | Verbose). Collapses rather
   than shrinks: every message clamps to two lines, thinking and tool
   commands to one, and a tap on any of them expands it (.cc-open, toggled
   in app.js). The newest assistant reply stays fully open. Per-message
   chrome (timestamps, line numbers, token chips, Input/View disclosures)
   is hidden. !important + doubled class: the conv-bg themes (e.g. stitch)
   pad these with !important at 0,6,0 specificity. */
body.conv-compact.conv-compact .conversations-view .event { margin: 0 !important; padding: 1px 8px !important; }
body.conv-compact.conv-compact .conversations-view .event.assistant { padding: 1px 0 !important; margin: 0 !important; }
body.conv-compact.conv-compact .conversations-view .event.assistant .assistant-text {
  padding: 3px 10px !important; margin: 0 !important;
}
body.conv-compact.conv-compact .conversations-view .event.user_text { padding: 3px 10px !important; margin: 2px 0 2px auto !important; }
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta,
body.conv-compact.conv-compact .conversations-view .event-model-meta,
body.conv-compact.conv-compact .conversations-view .event-token-chips,
body.conv-compact.conv-compact .conversations-view .msg-ts,
body.conv-compact.conv-compact .conversations-view .line-num,
body.conv-compact.conv-compact .conversations-view .assistant-message-actions,
body.conv-compact.conv-compact .conversations-view details.tool-command-disclosure { display: none !important; }
/* A schema response is the answer itself, carried in the tool arguments.
   Keep it reachable when routine input disclosures are hidden. */
body.conv-compact.conv-compact .conversations-view details.tool-command-disclosure.tool-structured-output { display: block !important; }
body.conv-compact.conv-compact .conversations-view .event.attachment-event:not(.hook-failed) { display: none !important; }
/* Every assistant text message keeps its speak/copy actions and timestamp
   (a long single-turn Codex run has many narration messages, none of which
   is a "final" card); the rest of the per-message chrome stays hidden.
   :has(> .assistant-text) matters: tool-only events have no text of their
   own, and their absolute-positioned stamps stacked into a smear. */
/* Kimi/Codex turns merge into .kimi-turn, so their per-turn meta row is the
   only place the turn number and time live: keep those (and speak/copy)
   visible in compact too; token chips stay hidden. */
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta { display: flex !important; }
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta .msg-ts,
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta .line-num { display: inline !important; }
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta .assistant-message-actions { display: inline-flex !important; }
body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text) .msg-ts { display: inline !important; }
body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text) .assistant-message-actions { display: inline-flex !important; }
/* Each turn's final card (.cc-final) also keeps speak/copy and its timestamp:
   otherwise only the very last reply in the whole conversation has them, and
   there is no way to tell when an earlier turn happened. */
body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text.cc-final) .msg-ts { display: inline !important; }
body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text.cc-final) .assistant-message-actions { display: inline-flex !important; }
/* Reserve a metadata strip for every assistant text row. Revealing absolute
   controls on hover/focus must not put them over the first line of prose,
   including narration from engines other than Codex. */
body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text) {
  padding-top: 20px !important;
}
@media (hover: hover) {
  body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text) .msg-ts,
  body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text) .assistant-message-actions { opacity: 0; }
  body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text):hover .msg-ts,
  body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text):hover .assistant-message-actions,
  body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text):focus-within .assistant-message-actions { opacity: 0.85; }
}
/* Codex turn ages stay readable without hovering. */
.conv-pane.is-codex-session .conversations-view .event.assistant:has(> .assistant-text) .msg-ts {
  opacity: 0.7 !important;
}
/* The newest reply keeps its per-turn token summary and model line; the
   older turns stay clean. Merged chips ride on tool-call lines, so they stay
   hidden there. */
body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text):not(:has(~ .event.assistant .assistant-text)) > .event-token-chips,
body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text):not(:has(~ .event.assistant .assistant-text)) > .event-model-meta { display: block !important; }
/* User asks can expand on click; assistant commentary stays fully readable. */
body.conv-compact.conv-compact .conversations-view .event.user_text:not(.peer-message):not(.cc-open):not(:has(img)) .user-msg {
  display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; cursor: pointer;
}
/* One-line thinking. */
body.conv-compact.conv-compact .conversations-view .thinking-block { padding: 0 6px; margin: 1px 0; cursor: pointer; }
body.conv-compact.conv-compact .conversations-view .thinking-block:not(.cc-open) .t-body {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
  overflow: hidden; max-height: none;
}
body.conv-compact.conv-compact .conversations-view .thinking-block.cc-open .t-body {
  display: block; -webkit-line-clamp: unset; max-height: none;
}
body.conv-compact.conv-compact .conversations-view .thinking-run.is-expanded > .t-body {
  display: block; -webkit-line-clamp: unset; max-height: none;
}
/* Tool commands wrap so the complete command stays readable. */
body.conv-compact.conv-compact .conversations-view .tool-call { padding: 0 !important; }
body.conv-compact.conv-compact .conversations-view .tool-call:not(.cc-open) .tool-detail {
  white-space: pre-wrap; overflow-wrap: anywhere;
}
body.conv-compact.conv-compact .conversations-view .tool-call:not(.cc-open) pre.tool-result-output { display: none; }
body.conv-compact.conv-compact .conversations-view .tool-call-group { margin: 0; }
body.conv-compact.conv-compact .conversations-view .tool-call-group-header { padding: 1px 8px; }
body.conv-compact.conv-compact .conversations-view .tool-call-group-body { padding: 0 8px 2px; }

/* Folded runs: everything between two text messages collapses into one
   "N tool calls" line (marked by _ccMarkRuns in app.js). The head is a
   .tool-call-group (Claude) or a bare .tool-call / .thinking-block
   (Devin, Codex, ACP engines). */
body.conv-compact.conv-compact .conversations-view .cc-run-tail:not(.cc-run-open) { display: none !important; }
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open) > .tool-call-group-body { display: none; }
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open) > .tool-call-group-header > *,
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open):not(.tool-call-group) > * { display: none !important; }
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open) > .tool-call-group-header::before,
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open):not(.tool-call-group)::before {
  content: "\25B8  " attr(data-cc-run-label);
  font-style: normal; font-size: 12px; color: var(--text-muted); cursor: pointer;
}
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open):not(.tool-call-group) {
  border: 0 !important; background: none !important; padding: 0 6px !important; cursor: pointer;
}
.cc-run-fold { display: none; }
body.conv-compact.conv-compact .conversations-view .cc-run-head.cc-run-open > .tool-call-group-header > .cc-run-fold {
  display: inline-flex; margin-left: auto; flex-shrink: 0;
  border: 0; background: transparent; padding: 1px 4px;
  color: var(--text-muted); font: inherit; font-size: 0.9em; cursor: pointer;
}
body.conv-compact .conversations-view .cc-run-fold:hover {
  color: var(--text); text-decoration: underline;
}
body.conv-compact .conversations-view .cc-run-fold:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Run chip: the folded run's label rides at the end of the preceding
   sentence (empty span + ::before, so copy/read-aloud never pick it up).
   The standalone head line hides while a chip stands in for it. */
.cc-run-chip { display: none; }
body.conv-compact .conversations-view .cc-run-chip {
  display: inline; margin-left: 6px; cursor: pointer; white-space: nowrap;
  font-size: 11px; font-weight: 400; font-style: normal; letter-spacing: normal;
  color: var(--text-muted); opacity: 0.8;
}
body.conv-compact .conversations-view .cc-run-chip::before { content: "\25B8 " attr(data-cc-run-label); }
body.conv-compact .conversations-view .cc-run-chip.cc-run-open::before { content: "\25BE " attr(data-cc-run-label); }
body.conv-compact .conversations-view .cc-run-chip:hover { color: var(--text); opacity: 1; }
body.conv-compact.conv-compact .conversations-view .cc-run-head.cc-run-chipped:not(.cc-run-open) { display: none !important; }

/* Orchestration chip: purple pill for wt / ccc CLI and CCC API use inside a
   folded run. Empty span + ::before (like .cc-run-chip) so copy/read-aloud
   never pick it up; shown in compact only, where the calls are folded away. */
.cc-orch-chip { display: none; }
.te-conversation-annotation { margin: 8px 0 12px; }
.te-conversation-chip {
  display: inline-block; padding: 2px 8px; border-radius: 9px;
  font-size: 11px; font-weight: 600; line-height: 16px;
  color: var(--orch-chip-text); background: rgba(163,113,247,0.16);
  border: 1px solid rgba(163,113,247,0.45);
}
body.conv-compact .conversations-view .cc-orch-chip {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 9px;
  font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap;
  vertical-align: baseline; color: var(--orch-chip-text); background: rgba(163,113,247,0.16);
  border: 1px solid rgba(163,113,247,0.45);
}
body.conv-compact .conversations-view .cc-orch-chip::before { content: attr(data-cc-orch); }
/* A run with no preceding text hosts its chips inside the bare head line,
   whose other children are hidden while folded. */
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open):not(.tool-call-group) > .cc-orch-chip { display: inline-block !important; }
/* Compact runs reveal reasoning before commands, with a persistent way back. */
body.conv-compact .conversations-view .cc-run-head > .tool-call-group-header { flex-wrap: wrap; }
body.conv-compact.conv-compact .conversations-view .cc-run-head.tool-call.cc-run-thinking > :not(.cc-run-fold, .cc-run-tools, .cc-orch-chip, .cc-run-thumbs) { display: none !important; }
.cc-run-tools, .cc-run-preview { display: none; }
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open) > .tool-call-group-header > .cc-orch-chip {
  display: inline-block !important;
}
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open) > .cc-run-preview {
  display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden; white-space: normal; font-style: normal;
  color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin: 4px 0 8px;
}
body.conv-compact.conv-compact .conversations-view .cc-run-head.cc-run-chipped:not(.cc-run-open):has(> .cc-run-preview) {
  display: block !important;
}
body.conv-compact.conv-compact .conversations-view .cc-run-head.cc-run-chipped:not(.cc-run-open)::before { content: none; }
body.conv-compact.conv-compact .conversations-view .cc-run-head.cc-run-open .cc-run-fold,
body.conv-compact.conv-compact .conversations-view .cc-run-head.cc-run-open .cc-run-tools {
  display: inline-flex; border: 0; background: transparent; padding: 2px 6px;
  color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer;
}
body.conv-compact .conversations-view .cc-run-tools:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
body.conv-compact.conv-compact .conversations-view .cc-run-tail.cc-run-thinking:not(.cc-run-thought),
body.conv-compact.conv-compact .conversations-view .cc-run-head.cc-run-thinking > :is(.tool-call-group-body, .kimi-tool-body, .kimi-tool-group-body) {
  display: none !important;
}
body.conv-compact.conv-compact .conversations-view .cc-run-thinking.thinking-block .t-body {
  display: block; -webkit-line-clamp: unset; max-height: none;
}
body.conv-compact.conv-compact .conversations-view .cc-run-thinking.kimi-thinking > .kimi-thinking-full { display: block; }
body.conv-compact.conv-compact .conversations-view .cc-run-thinking.kimi-thinking > .kimi-thinking-teaser { display: none; }
/* Same purple pills in a Codex/Kimi tool-group header, in every view mode
   (CCC-254): the header is all a collapsed group shows. */
.kimi-tg-orch { display: inline-flex; gap: 4px; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.kimi-tg-orch-chip {
  display: inline-block; padding: 0 7px; border-radius: 9px;
  font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap;
  color: var(--orch-chip-text); background: rgba(163,113,247,0.16);
  border: 1px solid rgba(163,113,247,0.45);
}
.kimi-tg-orch-chip::before { content: attr(data-cc-orch); }

/* Toned-down narration in compact: no cards, no heavy weight or wide
   tracking, so it reads as plain prose. User messages keep their theme
   bubble on purpose (user ask). `:not(#cc-compact)` adds ID-level specificity
   so this beats the conv-bg themes (stitch tops out at 0,9,0 !important). */
body.conv-compact:not(#cc-compact) .conversations-view .event.assistant .assistant-text,
body.conv-compact:not(#cc-compact) .conversations-view .kimi-turn .assistant-text {
  background: none !important; border: 0 !important; border-radius: 0 !important;
  box-shadow: none !important; padding: 1px 2px !important; margin: 0 0 10px !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif !important;
  font-weight: 400 !important; letter-spacing: normal !important; line-height: 1.45 !important;
  color: var(--text) !important;
}

/* Each turn's final summary keeps the card look Normal view has (stitch
   surface + accent rule), so it stands out from the toned-down narration. */
body.conv-compact:not(#cc-compact) .conversations-view .event.assistant .assistant-text.cc-final,
body.conv-compact:not(#cc-compact) .conversations-view .kimi-turn .assistant-text.cc-final {
  background: var(--conv-surface-2, rgba(255,255,255,0.05)) !important;
  border-left: 2px solid var(--conv-accent, var(--accent, #58a6ff)) !important;
  border-radius: 0 4px 4px 0 !important;
  padding: 10px 14px !important; margin: 4px 0 12px !important;
}

/* Merged Codex/Kimi turns use the same compact rhythm as other engines.
   Their normal layout adds gaps and output previews to every block. */
body.conv-compact.conv-compact .conversations-view .kimi-turn {
  margin: 0 !important; padding: 1px 0 !important;
}
body.conv-compact.conv-compact .conversations-view .kimi-turn > * + * { margin-top: 0 !important; }
body.conv-compact.conv-compact .conversations-view .kimi-tool-peek { display: none !important; }
body.conv-compact.conv-compact .conversations-view .kimi-tool-group:has(.acp-needs-approval) > .kimi-tool-group-body { display: block !important; }
body.conv-compact.conv-compact .conversations-view :is(.kimi-tool, .kimi-tool-group, .kimi-thinking).cc-run-head.cc-run-open:not(.cc-run-chipped)::before {
  content: "\25BE  fold " attr(data-cc-run-label); display: block;
  padding: 2px 6px; font-size: 12px; color: var(--text-muted); cursor: pointer;
}
/* Keep copy/speak/time available without spending a row per narration.
   The metadata node stays in place for live/saved-event reconciliation. */
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta {
  position: relative; height: 0; min-height: 0; margin: 0 !important;
  padding: 0; overflow: visible; justify-content: flex-end; gap: 6px;
  top: -18px; opacity: 0; pointer-events: none;
}
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta .line-num { display: none !important; }
body.conv-compact.conv-compact .conversations-view .assistant-text:hover + .kimi-answer-meta,
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta:hover,
body.conv-compact.conv-compact .conversations-view .kimi-answer-meta:focus-within {
  opacity: 0.85; pointer-events: auto; background: var(--bg);
}
@media (hover: none) {
  body.conv-compact.conv-compact .conversations-view .kimi-answer-meta {
    height: 18px; top: 0; opacity: 0.7; pointer-events: auto;
  }
}

/* Transcript view segmented control: Compact | Normal | Verbose, all
   visible, one tap. Selected segment follows body[data-conv-view]. */
.conv-view-seg {
  display: inline-flex; align-items: stretch; height: 22px;
  border: 1px solid var(--border); border-radius: 5px; overflow: hidden;
  flex: 0 0 auto;
}
.conv-view-seg > button {
  border: 0; border-left: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 600;
  padding: 0 6px; cursor: pointer; white-space: nowrap; line-height: 1;
}
.conv-view-seg > button:first-child { border-left: 0; }
.conv-view-seg > button:hover { color: var(--text); background: var(--surface-2); }
body[data-conv-view="compact"] .conv-view-seg > [data-conv-view="compact"],
body[data-conv-view="normal"] .conv-view-seg > [data-conv-view="normal"],
body[data-conv-view="verbose"] .conv-view-seg > [data-conv-view="verbose"] {
  background: rgba(88,166,255,0.18); color: var(--text);
}
.mobile-view-seg { display: none; }
.conv-pane-more-menu .conv-view-seg { margin: 2px 6px 4px; }

/* Free-voice name beside the Speak button while it plays. */
.tts-btn[data-tts-voice]::after,
.assistant-message-actions [data-tts-voice]::after {
  content: attr(data-tts-voice);
  margin-left: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

/* Speak button grows to fit the voice name while it plays. */
.conv-input-bar .tts-btn[data-tts-voice] {
  width: auto; min-width: 32px; padding: 0 10px; white-space: nowrap;
}
/* Dark label: white on the bright accent fill was hard to read. */
.conv-input-bar .tts-btn.speaking[data-tts-voice] { color: #0b1620; }

/* Read-aloud progress. */
  background: linear-gradient(to right,
    #0b1620 calc(var(--tts-play, 0) * 100%),
    rgba(11,22,32,0.35) calc(var(--tts-play, 0) * 100%));
}

/* Close button for the Continue-new config panel (the chip that opens it can
   be covered by the panel itself on phones). */
.f2c-close {
  margin-left: auto;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

/* Continue-new dismiss (×) */
.f2c-dismiss {
  flex: 0 0 auto; width: 30px; align-self: stretch;
  font-size: 18px; line-height: 1; color: var(--text-muted);
  background: transparent; border: 1px solid var(--border);
  border-left: none; border-radius: 0 6px 6px 0; cursor: pointer;
}
.f2c-dismiss:hover { color: var(--text); background: var(--surface-2); }

/* Phone toolbar: one wrapping row, in a deliberate order. The offer pill gets
   a full-width row on top (left-aligned, so its config popup opens inside the
   screen); below it ⋯ sits at the left and every icon button (Esc, speaker,
   mic, ⚡, Send) is grouped at the right. `display: contents` flattens the
   button cluster so they all share the one row. */
@media (max-width: 1200px) {
  .conv-input-bar .conv-input-row-top textarea {
    min-width: 0;
    width: 100%;
  }
  .conv-input-bar .conv-input-row-bottom {
    flex-wrap: wrap; align-items: center; gap: 8px 6px;
  }
  .conv-input-bar .conv-input-buttons { display: contents; }
  .conv-input-bar .conv-input-buttons > .f2c-panel:not([hidden]) {
    flex: 1 1 100%; order: -2; display: flex; justify-content: flex-start;
  }
  .conv-input-bar .conv-input-buttons > :not(.f2c-panel) { flex: 0 0 auto; }
  .conv-input-bar .conv-actions-group { margin-right: auto; }
  .conv-input-bar .conv-input-buttons .route { max-width: 100%; }
  .f2c-panel .f2c-config { max-width: min(320px, calc(100vw - 40px)); }
}

/* ── Continue-in-new-session sheet ─────────────────────────────────────
   Labeled stacked fields (rectangular selects), pill chips for recents
   (clearly not selects), one big primary button. A bottom sheet on phones,
   a compact popover on desktop. */
.f2c-panel .f2c-config {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  width: min(360px, calc(100vw - 24px)); max-width: none;
  padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  color: var(--text);
}
.f2c-sheet-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.f2c-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 0; }
.f2c-field-label {
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.f2c-field-row { display: flex; gap: 10px; }
.f2c-panel .f2c-config .f2c-select {
  width: 100%; max-width: none; height: 40px; padding: 0 10px;
  font-size: 14px; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
}
.f2c-panel .f2c-config .f2c-quick-picks {
  flex-basis: auto; flex-wrap: wrap; gap: 6px; padding-top: 0;
}
.f2c-panel .f2c-config .f2c-quick-picks-label {
  flex: 1 0 100%; font-size: 10.5px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin: 0 0 1px;
}
.f2c-panel .f2c-config .f2c-quick-pick {
  height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 500;
  color: color-mix(in srgb, var(--accent) 85%, var(--text));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
}
.f2c-panel .f2c-config .f2c-quick-pick:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.f2c-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.f2c-start {
  height: 48px; font-size: 15px; font-weight: 650; color: #fff; cursor: pointer;
  background: var(--green, #2ea043); border: 0; border-radius: 10px;
}
.f2c-start:active { filter: brightness(0.9); }
.f2c-start:disabled { opacity: 0.6; }
.f2c-actions .f2c-close {
  margin: 0; height: 36px; padding: 0; font-size: 13px; color: var(--text-muted);
  background: transparent; border: 0; cursor: pointer;
}
/* Never taller than the room above the offer row (--f2c-room, measured when
   the sheet opens): the fields scroll and the buttons stay pinned in view. */
.f2c-panel .f2c-config {
  box-sizing: border-box; flex-wrap: nowrap;
  max-height: var(--f2c-room, 70vh); overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: 0;
}
.f2c-panel .f2c-config > * { flex-shrink: 0; }
.f2c-panel .f2c-config .f2c-actions {
  position: sticky; bottom: 0; z-index: 1; margin-top: 0;
  padding: 10px 0 14px; background: inherit;
}
/* While the sheet is open it sits above the pane's floating buttons, and
   the install prompt stays out of the way of its buttons. */
.conv-input-bar:has(.f2c-config) { z-index: 20; }
/* The toolbar row's narrow-width overflow guard would clip the open sheet. */
.conv-input-bar .conv-input-row-bottom:has(.f2c-config) { overflow: visible !important; }
body.has-f2c-config #pwaInstallBanner { display: none !important; }
.conv-pane:has(.f2c-config) .conv-ready-archive-footer:not([hidden]) { display: none; }
@media (max-width: 1200px) {
  /* Opens upward from the offer row, across its full width. Not in flow:
     the composer sits at the bottom of a pane that does not scroll, so an
     in-flow sheet pushed Continue below the screen. Not position:fixed
     either: an ancestor's containment boxed a fixed sheet into a strip. */
  .f2c-panel .route:has(.f2c-config) { display: flex; flex-wrap: wrap; width: 100%; max-width: 100%; }
  .f2c-panel .f2c-config {
    position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
    width: auto; max-width: 100%;
  }
  .f2c-panel .f2c-config .f2c-select { height: 44px; font-size: 16px; }
}

.status-rail .rail-voice-stepper {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.status-rail .rail-voice-stepper button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  padding: 0 7px;
  line-height: 20px;
}
.status-rail .rail-voice-stepper .rail-voice-name {
  flex: 1;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* In-page folder viewer (CCC-62): opens when the server host has no desktop */
.ffv-overlay { position: fixed; inset: 0; z-index: 10000; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.ffv { position: relative; pointer-events: auto; resize: both; min-width: 360px; min-height: 240px; max-width: 100vw; max-height: 100vh; width: min(1100px, 94vw); height: min(720px, 88vh); display: flex; flex-direction: column; background: var(--surface, #161b22); border: 1px solid var(--border, #30363d); border-radius: 10px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.ffv-bar { cursor: move; user-select: none; touch-action: none; display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border, #30363d); }
.ffv-crumb { flex: 1; min-width: 0; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-muted, #8b949e); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ffv-btn { border: 1px solid var(--border, #30363d); background: transparent; color: var(--text, #e6edf3); border-radius: 6px; padding: 4px 10px; font: 12px var(--font-ui); cursor: pointer; text-decoration: none; }
.ffv-btn:hover { background: rgba(139,148,158,0.15); }
body.has-img-lightbox-open .ffv-overlay { visibility: hidden; }
.ffv-body { flex: 1; display: flex; min-height: 0; }
.ffv-list { width: 300px; flex: none; overflow: auto; border-right: 1px solid var(--border, #30363d); }
.ffv-row { display: flex; gap: 8px; align-items: center; padding: 7px 14px; cursor: pointer; font-size: 13px; }
.ffv-row:hover { background: rgba(139,148,158,0.1); }
.ffv-row.sel { background: rgba(88,166,255,0.16); }
.ffv-row small { margin-left: auto; color: var(--text-muted, #8b949e); }
.ffv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ffv-msg, .ffv-nopreview { padding: 16px; color: var(--text-muted, #8b949e); font-size: 13px; }
.ffv-view { flex: 1; min-width: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ffv-pv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 600 13px var(--font-mono, ui-monospace, monospace); }
.ffv-view img, .ffv-view video { max-width: 100%; border-radius: 6px; border: 1px solid var(--border, #30363d); align-self: flex-start; }
.ffv-view iframe { flex: 1; min-height: 400px; border: 1px solid var(--border, #30363d); border-radius: 6px; background: #fff; }
@media (max-width: 700px) { .ffv-body { flex-direction: column; } .ffv-list { width: auto; max-height: 40%; border-right: 0; border-bottom: 1px solid var(--border, #30363d); } }

.ffv { position: fixed; }
.ffv-md { padding: 4px 6px; font-size: 14px; }
.ffv-view:has(.ffv-md) { display: block; }

/* Continue-new dialog: editable copy of the prompt that will be sent. */
.f2c-panel .f2c-config .f2c-prompt {
  width: 100%; box-sizing: border-box; min-height: 84px; max-height: 220px; resize: vertical;
  padding: 8px 10px; font: inherit; font-size: 13px; line-height: 1.45; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
}
.f2c-panel .f2c-config .f2c-prompt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Reader anchoring is done in JS (_observeConvEventSizes) so iOS, which has none, behaves like Chrome. */
.conversations-view { overflow-anchor: none; }

/* CCC-1299 tap-backs: hover chip on agent messages; sent with the next message. */
.event.assistant { position: relative; }
.tapback-bar { position: absolute; right: 6px; bottom: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.event.assistant:hover > .tapback-bar, .tapback-bar:has(button.on) { opacity: 1; }
.tapback-bar button { background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 0 5px; font-size: 13px; cursor: pointer; filter: grayscale(1); opacity: .6; }
.tapback-bar button:hover, .tapback-bar button.on { filter: none; opacity: 1; border-color: var(--border, #444); }

/* ── Phone conversation chrome (Advanced mode) ─────────────────────────────
   #convToolbar is one row: Back, the session's name (#mobileConvTitle, the
   same title as its sidebar row) and the ⋮ menu, which also holds the
   Compact/Normal toggle. The original-ask disclosure, the breadcrumb chips
   (session id, process pill) and the status text are gone. Everything
   tappable is at least 44px. Simple mode keeps its own header (simple.css),
   so the toolbar rules are scoped to body:not(.ccc-simple-mode). */
.mobile-conv-title { display: none; }
@media (max-width: 1200px) {
  body:not(.ccc-simple-mode) #convToolbar {
    flex-wrap: nowrap;
    align-items: center;
    column-gap: 8px;
    padding: 6px 10px;
  }
  body:not(.ccc-simple-mode) #convToolbar #mobileOriginalAsk,
  body:not(.ccc-simple-mode) #convToolbar #cccBreadcrumb,
  body:not(.ccc-simple-mode) #convToolbar #convStatus {
    display: none !important;
  }
  body:not(.ccc-simple-mode) #convToolbar #mobileBackBtn {
    order: -100;
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    justify-content: center;
    font-size: 26px;
    color: var(--text);
    border-radius: 10px;
  }
  /* Usually-empty wrappers: park them after ⋮ and cancel their gaps. */
  body:not(.ccc-simple-mode) #convToolbar > #cccTopbar,
  body:not(.ccc-simple-mode) #convToolbar > .mobile-more-wrap { order: 101; margin-left: -8px !important; }
  body:not(.ccc-simple-mode) #convToolbar .mobile-conv-title:not([hidden]) {
    order: -99;
    display: block;
    flex: 1 1 0;
    min-width: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body:not(.ccc-simple-mode) #convToolbar .mobile-actions-wrap { order: 100; margin-left: 0; flex: 0 0 auto; }
  body:not(.ccc-simple-mode) #convToolbar button.mobile-actions-btn {
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
    font-size: 22px;
    border-radius: 10px;
  }
  /* Compact/Normal lives at the top of the ⋮ menu. */
  #convToolbar .mobile-actions-menu .mobile-view-seg {
    display: flex;
    margin: 0 0 4px;
    height: 48px;
    border-radius: 10px;
  }
  #convToolbar .mobile-actions-menu .mobile-view-seg > button {
    flex: 1 1 0;
    font-size: 16px;
    padding: 0 14px;
  }
  button.mobile-actions-item { font-size: 16px; min-height: 52px; }

  /* Composer: one size for every control. */
  .conv-input-bar .conv-input-row-bottom > button,
  .conv-input-bar .conv-actions-btn,
  .conv-input-bar .conv-input-buttons > button {
    min-width: 48px;
    min-height: 48px;
  }
  .conv-input-bar .conv-input-buttons .send-btn {
    width: 52px;
    height: 52px;
  }
  .conv-input-bar .conv-input-row-bottom svg { width: 22px; height: 22px; }

  /* iMessage-style: an empty composer shows the mic in Send's slot; the
     first character swaps Send back in. A recording mic stays put so it can
     be stopped while its transcript fills the box. */
  .conv-input-bar:not(.has-text) .conv-input-buttons .send-btn { display: none; }
  .conv-input-bar.has-text .mic-btn:not(.recording) { display: none; }
  .conv-input-bar .conv-input-buttons .mic-btn {
    order: 98;
    width: 52px;
    height: 52px;
  }

  /* Floating transcript controls: thumb-sized. */
  .conv-scroll-end-btn,
  .conv-scroll-last-btn,
  .conv-scroll-next-btn,
  .conv-scroll-segment-btn {
    height: 44px;
    padding: 0 16px;
    border-radius: 22px;
  }
  .conv-scroll-end-btn span,
  .conv-scroll-last-btn span,
  .conv-scroll-next-btn span,
  .conv-scroll-segment-btn span { font-size: 15px; }

  /* Per-turn speak/copy icons were 18px. */
  .conversations-view .event.assistant .assistant-message-action {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .conversations-view .event.assistant .msg-ts { right: 148px; }
  /* Keep the larger touch targets above the prose in every view mode. */
  .conv-pane .conversations-view .event.assistant:has(> .assistant-text),
  body.conv-compact.conv-compact .conversations-view .event.assistant:has(> .assistant-text) {
    padding-top: 44px !important;
  }
}

/* ── Phone session list: thumb-sized controls ──────────────────────────────
   Header icons, the New/Ticket/Search row, the Now/1d/7d/All window, the
   section menus, and the in-row chips (lanes, ticket refs, context %) were
   16-30px tall. Standalone controls get a 44px target; in-row chips get 36px
   so a row doesn't balloon. */
@media (max-width: 1200px) {
  .sidebar .sh-share-btn,
  .sidebar .sh-discord-btn,
  .sidebar .sidebar-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .sidebar .sh-share-btn svg,
  .sidebar .sh-discord-btn svg { width: 22px; height: 22px; }
  .sidebar #sidebarNewBtn,
  .sidebar #sidebarNewTicketBtn,
  .sidebar #convSearch,
  .sidebar #sidebarMoreBtn {
    min-height: 44px;
    font-size: 16px;
  }
  .sidebar #sidebarMoreBtn { min-width: 44px; font-size: 22px; }
  .sidebar .conv-grouping-toggle .grouping-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 44px;
    padding: 0 10px;
    font-size: 15px;
  }
  .sidebar .conv-archived-engine-trigger,
  .sidebar .conv-archived-overflow-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 40px;
    font-size: 18px;
  }
  .sidebar .conv-archived-engine-trigger svg { width: 20px; height: 20px; }
  #convList .conv-trash-header { min-height: 48px; font-size: 14px; }
  .sidebar .conv-window-btn {
    min-height: 44px;
    padding: 0 20px;
    font-size: 16px;
    border-radius: 22px;
  }
  .sidebar .sidebar-footer-pill { min-height: 40px; }
  .sidebar .ccc-sav-ticker { min-height: 36px; padding: 0 12px; font-size: 14px; }
}
/* A phone header can't fit the app name next to the bigger icons; it only
   ever showed as "Claud…" anyway. The logo stays. */
@media (max-width: 600px) {
  .sidebar .sh-title-link { display: none; }
}
@media (max-width: 1200px) {
  /* In-row chips. Size only: no display override, so chips the phone layout
     hides (context %, summary toggle) stay hidden. */
  .sidebar .conv-orch-lanes-chip,
  .sidebar .conv-subagent-collapse-btn,
  .sidebar .conv-worker-ticket {
    min-height: 36px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 14px;
  }
  /* Ticket refs: one chip run on one line. At 36px/10px padding three refs
     would wrap to three lines. */
  .sidebar .conv-worker-history { font-size: 14px; margin-left: 0; display: flex; align-items: center; }
  .sidebar .conv-worker-history-recent { flex-wrap: nowrap; gap: 4px; margin-left: 0; min-width: 0; overflow: hidden; }
  .sidebar .conv-worker-history-recent .conv-worker-ticket {
    min-height: 30px;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* Touch composer: Esc lives in the ⋯ menu and the attachment preview strip
   is dropped so the text box keeps its room. Keep explicit Steer available
   on touch too; ordinary Send may queue behind the running turn. */
@media (pointer: coarse) {
  .conv-input-bar #convEscBtn,
  .conv-input-bar .paste-thumb-strip { display: none !important; }
}

/* ── Phone new-session screen: just pick a folder, pick a model, type ─────
   The hero copy, model price/compare table, fresh-folder form, typing help,
   stale LAST WRITTEN line and floating scroll buttons are desktop chrome.
   Folder and model become one swipeable row of chips each; the folder path
   input, worktree toggle, group labels and the Free pill are dropped. */
@media (max-width: 1200px) {
  .conv-pane.has-new-session-context .ns-hero-quiet > :not(.ns-advisor):not(.ns-model-comparison.is-manual-expanded),
  .conv-pane.has-new-session-context .conv-last-written,
  .conv-pane.has-new-session-context .conv-scroll-end-btn,
  .conv-pane.has-new-session-context .conv-scroll-last-btn,
  .conv-pane.has-new-session-context .conv-scroll-next-btn,
  .conv-pane.has-new-session-context .conv-scroll-speak-btn,
  .conv-pane.has-new-session-context .conv-scroll-segment-btn,
  .conv-input-context.is-new-session .spawn-cwd-row,
  .conv-input-context.is-new-session .spawn-worktree-row,
  .conv-input-context.is-new-session .spawn-cwd-chip-group-label,
  .conv-model-picker-strip.is-new-session .conv-model-picker-label,
  .conv-model-picker-strip.is-new-session .ccc-free-pill {
    display: none !important;
  }
  /* Collapsed (default on phones): the folder row is one summary line —
     "Auto · repo-name · Change" — so the selected repo is always visible.
     Change flips body.ccc-spawn-cwd-collapsed off and the full picker +
     chips return. The Smart repo button stays reachable in both states. */
  body.ccc-spawn-cwd-collapsed .conv-input-context.is-new-session .spawn-cwd-row {
    display: flex !important;
    grid-area: chips;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  body.ccc-spawn-cwd-collapsed .conv-input-context.is-new-session .spawn-cwd-row > .smart-repo-status {
    display: inline-flex !important;
    margin-left: auto;
  }
  body:not(.ccc-spawn-cwd-collapsed) .conv-input-context.is-new-session .spawn-cwd-row {
    display: inline-flex !important;
    grid-area: cwd;
  }
  .conv-input-context.is-new-session .spawn-cwd-quick-chips { margin-right: 38px; }
  .conv-input-context.is-new-session .spawn-cwd-quick-chips,
  .conv-model-picker-strip.is-new-session .conv-model-picker-chips {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 2px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .conv-input-context.is-new-session .spawn-cwd-quick-chips::-webkit-scrollbar,
  .conv-model-picker-strip.is-new-session .conv-model-picker-chips::-webkit-scrollbar { display: none; }
  .conv-input-context.is-new-session .spawn-cwd-chip,
  .conv-model-picker-strip.is-new-session .orch-tier-chip {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
    font-size: 15px;
    white-space: nowrap;
  }
  .conv-model-picker-strip.is-new-session .conv-model-picker-inner { display: block; }
  /* The current pick leads its row so it is never scrolled out of sight. */
  .conv-input-context.is-new-session .spawn-cwd-chip.active,
  .conv-model-picker-strip.is-new-session .orch-tier-chip.is-selected { order: -1; }
}

/* ── Phone list header: no row of its own ─────────────────────────────────
   Share and Discord are gone on phones; savings sits with the usage meters.
   The CCC icon
   moves onto the "Usage left" heading line (headroom bars flatten into the
   header grid via display:contents) so the usage chips keep the full width.
   Alerts (update pill etc.) still get their own full-width line. */
@media (max-width: 600px) {
  .sidebar .sidebar-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
  }
  .sidebar .sidebar-header > * { grid-column: 1 / -1; }
  .sidebar .sh-share-btn,
  .sidebar .sh-discord-btn,
  .sidebar .ccc-sav-ticker { display: none !important; }
  .sidebar .sidebar-header > .sidebar-header-brand {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
  }
  .sidebar .sidebar-header-brand .sh-title-row { min-height: 0; padding: 0; gap: 0; }
  .sidebar .sidebar-header-brand .sh-app-icon { width: 26px; height: 26px; }
  .sidebar .sidebar-header > #headroomBars { display: contents; }
  .sidebar #headroomBars > .hb-heading { grid-column: 2; grid-row: 1; margin: 0; }
  .sidebar #headroomBars > :not(.hb-heading) { grid-column: 1 / -1; }
}

/* ── Phone composer card ───────────────────────────────────────────────────
   A soft rounded card instead of the boxed terminal prompt: grey fill, faint
   hairline, no accent glow or ">" glyph, sans-serif text, and round buttons
   (+ menu on the left, Send/mic slot on the right). Prefixed with
   html body .conv-split so it outranks conversation themes' !important
   rules (e.g. Stitch's square corners and monospace) on touch or narrow screens. */
@media (pointer: coarse), (max-width: 1200px) {
  html body .conv-split .conv-pane .conv-input-bar.visible {
    background: color-mix(in srgb, var(--text, #e5e2e3) 8%, var(--bg, #0a0a0b)) !important;
    border: 1px solid color-mix(in srgb, var(--text, #e5e2e3) 14%, transparent) !important;
    border-radius: 24px !important;
    box-shadow: none !important;
    margin: 6px 8px 8px !important;
    padding: 12px 10px 10px 16px !important;
  }
  html body .conv-split .conv-pane .conv-input-bar.visible:focus-within {
    border-color: color-mix(in srgb, var(--text, #e5e2e3) 24%, transparent) !important;
    box-shadow: none !important;
  }
  html body .conv-split .conv-pane .conv-input-row-top::before { content: none !important; display: none !important; }
  html body .conv-split .conv-pane #convInput {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    padding: 2px 36px 2px 0 !important;
  }
  html body .conv-split .conv-pane .conv-input-bar .conv-input-row-bottom { gap: 8px; }
  html body .conv-split .conv-pane .conv-input-bar .conv-actions-btn,
  html body .conv-split .conv-pane .conv-input-bar .mic-btn,
  html body .conv-split .conv-pane .conv-input-bar .send-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }
  html body .conv-split .conv-pane .conv-input-bar .conv-actions-btn,
  html body .conv-split .conv-pane .conv-input-bar .mic-btn:not(.recording) {
    background: color-mix(in srgb, var(--text, #e5e2e3) 10%, transparent) !important;
    border: 0 !important;
    color: var(--text, #e5e2e3) !important;
  }
  html body .conv-split .conv-pane .conv-input-bar .send-btn {
    background: var(--conv-accent, var(--accent)) !important;
    border: 0 !important;
    color: #0b1620 !important;
  }
  html body .conv-split .conv-pane .conv-input-bar .send-btn:disabled {
    background: color-mix(in srgb, var(--text, #e5e2e3) 10%, transparent) !important;
    color: var(--text-muted) !important;
  }
  html body .conv-split .conv-pane .conv-input-bar .conv-actions-btn svg,
  html body .conv-split .conv-pane .conv-input-bar .mic-btn svg,
  html body .conv-split .conv-pane .conv-input-bar .send-btn svg { width: 22px; height: 22px; }
}
/* Cache-adjusted turn total: just the number, at the end of the raw
   in/cached/out chip row (label + math in its tooltip). */
.event-token-chips .cache-adjusted-num { color: #79c0ff; font-weight: 700; }

/* Phone: keep ticket creation directly accessible; the question pill
   folds into the menus, which show its count as a badge. */
.new-session-caret-wrap { display: none; }
.new-session-caret-menu {
  position: fixed;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.new-session-caret-menu[hidden] { display: none; }
.new-session-caret-menu .sh-more-item { display: block; width: 100%; min-height: 48px; font-size: 16px; text-align: left; }
@media (max-width: 1200px) {
  .sidebar #sidebarNewTicketBtn { display: inline-flex; min-height: 44px; }
  .sidebar .new-session-primary-row { flex: 1 1 auto; }
  .sidebar #sidebarNewBtn { min-height: 44px; }
  .qtag-pill { display: none !important; }
  [data-qtag-badge] { position: relative; }
  [data-qtag-badge]:not([data-qtag-count=""])[data-qtag-count]::after {
    content: attr(data-qtag-count);
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #d9a441;
    color: #1b1408;
    font: 700 11px/18px system-ui, sans-serif;
    text-align: center;
    pointer-events: none;
  }
}

/* Floating speaker while being dragged: no slide transition lag. */
.conv-scroll-speak-btn.is-dragging { transition: none !important; opacity: 0.85; }

/* Compact composer on touch and narrow screens: text, + and Send share
   one line initially; the textarea still grows naturally with the draft. */
@media (pointer: coarse), (max-width: 1200px) {
  html body .conv-split .conv-pane .conv-input-bar.visible {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: end;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 4px 8px 8px !important;
  }
  html body .conv-split .conv-pane .conv-input-bar.visible:focus-within { border: 0 !important; }
  html body .conv-split .conv-pane .conv-input-bar > .conv-input-row-top {
    flex: 1 1 160px;
    order: 2;
    width: auto;
    min-width: min(160px, calc(100% - 144px));
    min-height: 44px;
    padding: 9px 14px;
    background: color-mix(in srgb, var(--text, #e5e2e3) 8%, var(--bg, #0a0a0b));
    border: 1px solid color-mix(in srgb, var(--text, #e5e2e3) 14%, transparent);
    border-radius: 22px;
  }
  html body .conv-split .conv-pane .conv-input-bar.visible:focus-within > .conv-input-row-top {
    border-color: color-mix(in srgb, var(--text, #e5e2e3) 26%, transparent);
  }
  html body .conv-split .conv-pane #convInput { padding: 0 !important; min-height: 22px !important; }
  html body .conv-split .conv-pane .conv-input-bar:not([data-composer-mode="expand"]) #convInput {
    max-height: calc(var(--app-vh, 100vh) * 0.3) !important;
  }
  html body .conv-split .conv-pane .conv-input-bar .conv-input-row-bottom,
  html body .conv-split .conv-pane .conv-input-bar .conv-input-buttons,
  html body .conv-split .conv-pane .conv-input-bar .conv-input-selectors { display: contents; }
  /* Hidden session selectors must not leave a growing flex spacer between
     the input and controls. New-session picks still share their own row. */
  html body .conv-split .conv-pane .conv-input-bar.is-new-session-launch .conv-input-selectors {
    display: flex;
    flex: 1 1 100%;
    order: 0;
  }
  html body .conv-split .conv-pane .conv-input-bar .conv-input-row-bottom > *,
  html body .conv-split .conv-pane .conv-input-bar .conv-input-buttons > * { order: 4; }
  html body .conv-split .conv-pane .conv-input-bar .conv-input-row-bottom > .attach-btn,
  html body .conv-split .conv-pane .conv-input-bar .conv-input-row-bottom > .conv-actions-group {
    order: 1;
    flex: 0 0 auto;
    margin: 0;
  }
  html body .conv-split .conv-pane .conv-input-bar .conv-input-buttons > .conv-send-group,
  html body .conv-split .conv-pane .conv-input-bar .conv-input-buttons > .mic-btn {
    order: 3;
    flex: 0 0 auto;
  }
  html body .conv-split .conv-pane .conv-input-bar:not(.has-text) .conv-input-buttons > .conv-send-group,
  html body .conv-split .conv-pane .conv-input-bar.has-text .mic-btn:not(.recording) { display: none; }
  /* The cold-session notice and route choice keep their own full-width rows. */
  html body .conv-split .conv-pane .conv-input-bar > .f2c-rail:not([hidden]) {
    order: 0;
    flex: 1 0 100%;
    min-width: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }
  html body .conv-split .conv-pane .conv-input-bar .conv-input-buttons > .f2c-panel:not([hidden]) {
    flex: 1 0 100%;
  }
}

/* ── Phone session list: chat-app rows ─────────────────────────────────────
   Every session row renders the same .wa-row (built in _renderRow): engine
   avatar, bold one-line name + time, a fixed two-line preview of the last
   reply, and a status mark. On phones the rest of the row's markup is
   hidden so every row has one shape and one height. Child sessions render
   as indented rows with a thread line, collapsible from the parent's ↳ N. */
.wa-row { display: none; }
@media (max-width: 1200px) {
  /* Doubled id: outranks the Workers dense-table and row-style presets
     (#convList.workers-dense .conv-item …), which also use !important. */
  #convList#convList .conv-item {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
  }
  #convList .conv-item > :not(.wa-row) { display: none !important; }
  #convList .conv-item > .wa-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 0 6px;
  }
  #convList .conv-item:active > .wa-row { background: color-mix(in srgb, var(--text, #e6edf3) 6%, transparent); }
  .wa-avatar.orch-glyph {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
  }
  /* Titles are sentences, so they get up to two lines. The text block is a
     fixed 3 lines tall: a one-line title leaves the preview two lines, a
     two-line title leaves it one (the clip falls on a line boundary). */
  .wa-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 78px;
    box-sizing: border-box;
    padding: 8px 14px 8px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text, #e6edf3) 10%, transparent);
  }
  .wa-line1 { display: flex; align-items: flex-start; gap: 8px; min-width: 0; flex: 0 0 auto; }
  .wa-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    font-size: 16px;
    line-height: 21px;
    font-weight: 600;
    color: var(--text);
  }
  .wa-time { flex: 0 0 auto; font-size: 12px; line-height: 21px; color: var(--text-muted); white-space: nowrap; }
  .wa-lanes {
    flex: 0 0 auto;
    align-self: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid color-mix(in srgb, var(--accent, #58a6ff) 45%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent, #58a6ff) 12%, transparent);
    color: var(--accent, #58a6ff);
    font: 600 13px/1 system-ui, sans-serif;
    cursor: pointer;
  }
  .wa-line2 {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }
  .conv-item.is-ready-to-close .wa-body,
  .conv-item.is-archived-row .wa-body { height: 106px; }
  .conv-item.is-ready-to-close .wa-line2,
  .conv-item.is-archived-row .wa-line2 { align-items: center; }
  .wa-explanation-label { color: inherit; font-weight: 500; }
  .conv-item .wa-row .conv-ready-archive { min-height: 44px; }
  .wa-preview {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    line-height: 18px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
  .wa-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--green, #3fb950);
    animation: wa-pulse 1.6s ease-in-out infinite;
  }
  @keyframes wa-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }
  .wa-badge {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #d9a441;
    color: #1b1408;
    font: 700 12px/18px system-ui, sans-serif;
    text-align: center;
  }
  /* Child sessions: indented, smaller avatar, a thread line on the left.
     The cluster's own Collapse footer is replaced by the parent's ↳ N. */
  #convList .conv-subagent-cluster,
  #convList .conv-subagent-cluster-body {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #convList .conv-subagent-cluster-body .conv-item::before,
  #convList .conv-subagent-cluster-body .conv-item::after { display: none !important; }
  #convList .conv-subagent-cluster-body::before {
    content: '';
    position: absolute;
    left: 37px;
    top: 0;
    bottom: 12px;
    width: 2px;
    border-radius: 1px;
    background: color-mix(in srgb, var(--text, #e6edf3) 16%, transparent);
  }
  /* CCC-240: a child shares its parent's ticket, so it drops the avatar and
     reads smaller: text lines up with the parent's title, one-line title and
     preview, tighter padding. */
  #convList .conv-subagent-cluster-body .conv-item > .wa-row { padding-left: 64px; }
  #convList .conv-subagent-cluster-body .wa-avatar { display: none !important; }
  #convList .conv-subagent-cluster-body .wa-body { min-height: 0; padding-top: 6px; padding-bottom: 6px; }
  #convList .conv-subagent-cluster-body .wa-title {
    font-size: 14px;
    line-height: 19px;
    font-weight: 500;
    -webkit-line-clamp: 1;
  }
  #convList .conv-subagent-cluster-body .wa-time { line-height: 19px; }
  #convList .conv-subagent-cluster-body .wa-preview {
    font-size: 13px;
    line-height: 17px;
    -webkit-line-clamp: 1;
  }
  #convList .conv-subagent-cluster-body .wa-avatar.orch-glyph {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  #convList .conv-subagent-collapse-footer { display: none !important; }
}

/* ── Phone list toolbar: time window, engine filter and Other machines live
   in the ⋮ menu. The menu copies carry .is-phone-menu-only (hidden on
   desktop); on phones the toolbar originals are hidden instead. */
.is-phone-menu-only { display: none !important; }
body.ccc-hide-other-machines .fed-peer-section { display: none !important; }
@media (max-width: 1200px) {
  #convList .conv-archived-overflow-menu .is-phone-menu-only { display: inline-flex !important; }
  #convList .conv-archived-tools-right > [data-role="archived-window-toggle"],
  #convList .conv-archived-tools-right > [data-role="archived-engine-filter"] { display: none !important; }
  #convList .conv-archived-overflow { display: inline-flex; align-items: center; }
  /* With the window/engine pills gone the ⋮ is the toolbar: pin it right so
     its right-anchored menu opens on screen. */
  #convList .conv-archived-tools-right { margin-left: auto !important; justify-content: flex-end !important; }
  #convList .conv-archived-overflow-menu { min-width: 240px; padding: 8px; gap: 10px; }
  /* Engine buttons: an always-open row inside the menu, not a hover popup. */
  #convList .conv-archived-engine-filter.is-menu-row { position: static; }
  #convList .conv-archived-engine-filter.is-menu-row .conv-archived-engine-options {
    position: static;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
  }
  #convList .conv-archived-engine-filter.is-menu-row .conv-archived-engine-btn {
    width: 40px;
    height: 40px;
    padding: 9px;
  }
  #convList .conv-archived-engine-filter.is-menu-row .conv-archived-engine-btn svg,
  #convList .conv-archived-engine-filter.is-menu-row .conv-archived-engine-btn .conv-session-svg { width: 20px; height: 20px; }
  #convList .conv-menu-check-opt { min-height: 44px; padding: 0 10px; border-radius: 8px; font-size: 15px; gap: 10px; }
  #convList .conv-other-machines-opt {
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
  }
  #convList .conv-other-machines-opt .conv-check {
    display: inline-flex;
    width: 18px;
    justify-content: center;
    color: var(--green, #3fb950);
    font-weight: 700;
  }
}

/* Session avatars (phone chat rows): a project-themed character on a
   per-session gradient, with a kind-of-work badge in the corner and the
   engine as a small mark beside the time. */
@media (max-width: 1200px) {
  .wa-av {
    position: relative;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.18), inset 0 2px 4px rgba(255, 255, 255, 0.25);
  }
  .wa-face {
    font-size: 27px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  }
  .wa-kind {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: var(--surface, #161b22);
    box-shadow: 0 0 0 2px var(--bg, #0d1117);
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  }
  #convList .conv-subagent-cluster-body .wa-av { flex-basis: 36px; width: 36px; height: 36px; }
  #convList .conv-subagent-cluster-body .wa-face { font-size: 20px; }
  #convList .conv-subagent-cluster-body .wa-kind { width: 17px; height: 17px; font-size: 10px; }
  .wa-time { display: inline-flex; align-items: center; gap: 5px; }
  /* Fits the one preview line left under a two-line title. */
  .wa-preview .ccc-idea-ticket { padding: 0 6px; line-height: 15px; vertical-align: 1px; }
  .wa-engine { display: inline-flex; opacity: 0.7; }
  .wa-engine svg, .wa-engine .conv-session-svg { width: 12px; height: 12px; }
}

/* ── Phone: one ⋮ for the session list ─────────────────────────────────────
   The sidebar ⋮ holds Open questions, the mirrored view filters
   (#sidebarMoreFilters) and Reload page; the list's own ⋮ row goes away.
   App/system items live in a strip at the top of Settings. */
.sh-more-filters { display: grid; gap: 8px; padding: 4px 2px 8px; }
.sh-more-filters[hidden] { display: none; }
.settings-about-strip[hidden] { display: none; }
/* Desktop "Mobile view" (sidebar ⋮): the list's view filters move into the
   sidebar ⋮ like on phones, so show the phone-only entries there too. */
html.ccc-mobile-list-view .sh-more-filters .is-phone-menu-only { display: inline-flex !important; }
html.ccc-mobile-list-view .sh-more-filters > * { max-width: 100%; }
.sh-more-check input { margin: 0; accent-color: var(--accent); }
/* A menu row that is an on/off switch: label left, knob right. */
.sh-more-item.sh-more-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.sh-more-item.sh-more-switch[hidden] { display: none; }
.sh-more-switch[aria-checked="true"] .settings-toggle-track { background: var(--accent); }
.sh-more-switch[aria-checked="true"] .settings-toggle-thumb { background: var(--accent-contrast); transform: translateX(14px); }
@media (max-width: 1200px) {
  #sidebarMoreMenu .sh-more-desktop-only,
  #sidebarMoreMenu .sh-more-divider { display: none !important; }
  #convList .conv-archived-tools:not(:has(.conv-archived-tools-left)) { display: none !important; }
  #sidebarMoreMenu { min-width: min(300px, calc(100vw - 16px)); max-width: calc(100vw - 16px); }
  #sidebarMoreMenu .sh-more-item { min-height: 48px; font-size: 16px; }
  .sh-more-filters .is-phone-menu-only { display: inline-flex !important; }
  .sh-more-filters > * { max-width: 100%; }
  .sh-more-filters .conv-grouping-toggle { display: flex; width: 100%; }
  .sh-more-filters .conv-grouping-toggle .grouping-opt {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 6px;
    font-size: 14px;
    white-space: nowrap;
  }
  .sh-more-filters .conv-archived-engine-filter.is-menu-row { position: static; display: flex; }
  .sh-more-filters .conv-archived-engine-filter.is-menu-row .conv-archived-engine-options {
    position: static;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    display: flex;
    width: 100%;
  }
  .sh-more-filters .conv-archived-engine-btn { flex: 1 1 0; height: 40px; padding: 9px; }
  .sh-more-filters .conv-archived-engine-btn svg,
  .sh-more-filters .conv-archived-engine-btn .conv-session-svg { width: 20px; height: 20px; }
  .sh-more-filters .conv-other-machines-opt {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    text-align: left;
  }
  .sh-more-filters .conv-other-machines-opt .conv-check {
    display: inline-flex;
    width: 18px;
    justify-content: center;
    color: var(--green, #3fb950);
    font-weight: 700;
  }
  .sidebar .sh-app-icon { cursor: pointer; }
  /* Settings: the moved app/system items as a row of big pills. */
  .settings-about-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }
  .settings-about-strip > .sh-more-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface-2, var(--surface));
    color: var(--text);
    font: inherit;
    font-size: 15px;
    text-decoration: none;
    width: auto;
  }
  .settings-about-strip > .sh-more-info { flex: 1 1 100%; font-size: 13px; color: var(--text-muted); padding: 2px 4px 0; }
}

/* Tracked sessions table (prototype): gridded overlay over the main pane,
   positioned in JS to the .main rect below its toolbar. */
.tracked-table-pane {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  border-top: 1px solid var(--border);
  box-sizing: border-box;
}
.tracked-table-pane[hidden] { display: none; }
.tracked-table-pane .tt-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.tracked-table-pane .tt-title { font-size: 14px; font-weight: 600; }
.tracked-table-pane .tt-scope { margin-left: 0; }
.tracked-table-pane .tt-close {
  margin-left: auto; background: none; border: 0; color: var(--text-muted);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.tracked-table-pane .tt-close:hover { color: var(--text); }
.tracked-table-pane .tt-scroll { flex: 1; overflow: auto; padding: 12px 16px 24px; }
.tracked-table-pane .tt-empty-state { padding: 24px 16px; color: var(--text-muted); font-size: 13px; }
.tracked-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.4;
}
.tracked-table th,
.tracked-table td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.tracked-table thead th {
  position: sticky; top: 0;
  background: var(--surface);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
}
.tracked-table th.tt-ref { width: 92px; }
.tracked-table th.tt-name { width: 32%; }
.tracked-table th.tt-status { width: 104px; }
.tracked-table tbody tr { cursor: pointer; }
.tracked-table tbody tr:hover td { background: var(--surface-2); }
.tracked-table tbody tr.is-current td { background: rgba(88,166,255,0.08); }
.tracked-table td.tt-ref { white-space: nowrap; }
.tracked-table td.tt-ref .tt-num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tracked-table td.tt-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.tracked-table td.tt-next { white-space: pre-wrap; word-break: break-word; }
.tracked-table td.tt-next.is-done { color: var(--text-muted); }
.tracked-table .tt-empty { color: var(--text-muted); }
.tracked-table .tt-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  border: 1px solid currentColor;
  color: var(--text-muted);
}
.tracked-table .tt-pill.is-working { color: var(--accent); }
.tracked-table .tt-pill.is-needs-you { color: var(--orange); }
.tracked-table .tt-pill.is-stuck { color: var(--red); }
.tracked-table .tt-pill.is-done,
.tracked-table .tt-pill.is-verified { color: var(--green); }
.tracked-table .tt-pill.is-committed,
.tracked-table .tt-pill.is-pr,
.tracked-table .tt-pill.is-testing { color: var(--purple); }

/* Ready explanations retain the normal title/message layout in compact mode. */
#convList .conv-item.is-ready-to-close .conv-outcome.is-ready { display: flex !important; }
.compact-rows .conv-item.is-ready-to-close .conv-main-row { flex-wrap: wrap; }
.compact-rows .conv-item.is-ready-to-close .conv-title-stack,
.compact-rows .conv-item.is-ready-to-close .conv-main-row > .conv-title { flex: 0 1 38%; }
.compact-rows .conv-item.is-ready-to-close .conv-row-break { display: block; flex-basis: 100%; height: 0; }
.conv-item .conv-main-row > .conv-ready-archive { margin-left: auto; }
#convList .conv-item.is-ready-to-close .conv-main-row > .conv-ready-archive + .conv-pct-badge { margin-left: 0; }
/* A finished row's Close button ends its explanation: the text keeps its
   own width (clamped as usual) and the button follows the last line. */
#convList .conv-item .conv-outcome.is-ready.has-close-btn,
#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline.has-close-btn {
  display: flex !important;
  align-items: flex-end;
  gap: 8px;
}
#convList .conv-item .conv-outcome.has-close-btn .conv-outcome-step,
#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.has-close-btn .conv-outcome-step {
  flex: 0 1 auto;
  width: auto;
}
#convList .conv-item .conv-outcome.has-close-btn .conv-outcome-step::before { content: none; display: none; }
.conv-item .conv-outcome .conv-ready-close { min-height: 24px; padding: 2px 10px; }
.conv-item .conv-ready-close:hover { color: var(--text); border-color: var(--text); }
/* The pending request remains readable beside its scoped one-tap reply. */
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-quick-action, .conv-quick-action-status) {
  display: flex !important;
  align-items: flex-end;
  gap: 8px;
}
#convList#convList .conv-item .conv-outcome:has(.conv-quick-action, .conv-quick-action-status) .conv-outcome-step {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
.conv-quick-action-slot { display: inline-flex; flex: 0 0 auto; min-height: 1px; min-width: 1px; }
/* A decision gets one chip per option on its own line under the choice (CCC-276). */
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-quick-action-slot.is-decision) { flex-wrap: wrap; }
#convList#convList .conv-item .conv-outcome:has(.conv-quick-action-slot.is-decision) .conv-outcome-step { flex-basis: 100%; }
/* The beside-the-title column is too narrow for option chips and they broke
   one letter per line; a decision takes its own full-width line instead. */
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-quick-action-slot.is-decision) { flex: 1 1 100%; order: 5; }
/* The chips share their line with the row pop-out instead of filling it
   and pushing the pop-out onto a line of its own (CCC-281). */
.conv-quick-action-slot.is-decision { flex: 1 1 0; min-width: 0; flex-wrap: wrap; gap: 6px; }
/* Long choices wrap in narrow sidebars; a pill radius turns them into tall
   ovals. Keep the complete label in a compact, left-aligned control. */
.conv-quick-action-slot.is-decision .conv-quick-action {
  max-width: 100%;
  border-radius: 6px;
  padding: 4px 8px;
  text-align: left;
  overflow-wrap: break-word;
  white-space: normal;
}
.conv-row-popout {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; min-width: 32px; min-height: 32px; margin-left: 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); cursor: pointer;
}
.conv-row-popout:hover, .conv-row-popout:focus-visible { color: var(--accent); border-color: var(--accent); }
/* Mouse hover and keyboard focus reveal the pop-out without reflow.
   Opacity keeps the button reachable by Tab on desktop. */
@media not all and (pointer: coarse) {
  #convList .conv-item:not(:hover):not(:focus-within) .conv-row-popout {
    opacity: 0;
    pointer-events: none;
  }
}
/* Session rows open in place on phones; a separate window adds no value. */
@media (max-width: 1200px) {
  #convList .conv-row-popout { display: none; }
}
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-row-popout) {
  display: flex !important; align-items: flex-end; gap: 4px;
}
#convList#convList .conv-item .conv-outcome:has(.conv-row-popout):not(:has(.conv-quick-action-slot.is-decision)) .conv-outcome-step {
  flex: 1 1 auto; min-width: 0; width: auto;
}
/* The inline step clamps at two lines; reserve both so a streamed message
   that wraps does not grow the row under the pointer. */
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-row-popout) .conv-outcome-step {
  min-height: 2lh;
}
.conv-quick-action {
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  padding: 3px 10px;
  min-height: 26px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}
.conv-quick-action:hover, .conv-quick-action:focus-visible { color: var(--text); border-color: var(--text); }
.conv-quick-action:disabled { opacity: .6; cursor: default; }
.conv-quick-action-status {
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .conv-quick-action { min-height: 32px; }
}
.conv-item .conv-main-row .conv-sidebar-session-id-chip,
.conv-item .wa-row-footer .conv-sidebar-session-id-chip {
  display: inline-flex; align-items: center; border: 0; background: none;
  color: var(--text-muted); cursor: pointer; padding: 2px 0; min-width: 0;
}
.conv-sidebar-session-id-chip code { font: 11px/1.2 ui-monospace, monospace; }
.conv-item .wa-row-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
@media (max-width: 1200px) {
  .conv-item .wa-body { height: auto; min-height: 96px; }
  /* The preview and its controls determine this line's height. A zero flex
     basis clips them when a two-line title and the session footer share it. */
  .conv-item .wa-line2 { flex: 0 0 auto; flex-wrap: wrap; row-gap: 4px; }
  .conv-item .wa-preview { flex: 1 1 140px; min-width: min(100%, 140px); }
  /* Put decision choices below the preview, with room for full labels. */
  .conv-item .wa-line2:has(.conv-quick-action-slot.is-decision) .wa-preview { flex-basis: 100%; }
  .conv-item .wa-row-footer { flex: 0 0 auto; }
  .conv-item.is-ready-to-close .wa-body { height: auto; min-height: 128px; }
  .conv-item .wa-row-footer .conv-ready-archive { min-height: 32px; }
}

@media (max-width: 380px) {
  .conv-item .wa-line2:has(.conv-quick-action, .conv-quick-action-status) .wa-preview { flex-basis: 100%; }
}

/* Desktop session rows use the phone list's tight avatar/title/preview
   structure, retaining question chips, lane controls and hover actions. */
@media (min-width: 1201px) {
  #convList#convList .conv-item:has(.conv-main-row.has-inline-step) {
    display: block;
    --conv-content-left: calc(var(--conv-icon-left) + 56px);
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    margin: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent) !important;
    box-shadow: none;
  }
  #convList#convList .conv-item:has(.conv-main-row.has-inline-step):not(.active):not(.in-other-pane) { background: transparent !important; }
  #convList#convList .conv-item .conv-title-row:has(.conv-main-row.has-inline-step) { display: block; }
  #convList#convList .conv-item .conv-main-row.has-inline-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 2px 5px;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step > :is(.conv-title, .conv-title-stack) {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step .conv-title {
    font-size: 16px !important;
    font-weight: 600;
    line-height: 21px !important;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline {
    display: block !important;
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    height: auto;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.has-close-btn { display: flex !important; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome .conv-outcome-step {
    min-width: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 18px;
    -webkit-line-clamp: 2;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome:not(.has-close-btn) .conv-outcome-step::before {
    content: attr(data-label) ": ";
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    font: inherit;
    color: inherit;
    letter-spacing: normal;
    text-transform: none;
    vertical-align: baseline;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-row-break { display: none; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-meta-col {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-width: 0;
    grid-column: 1 / -1;
    grid-row: 3;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-meta-col:empty { display: none; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-pct-badge { grid-column: 2; grid-row: 1; margin: 2px 0 0; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-row-end { grid-column: 3; grid-row: 1; margin: 2px 0 0; min-width: 20px; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-row-end > .conv-rel { position: static; transform: none; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-row-end .conv-row-hover-slot { z-index: 7; background: var(--surface-2); }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-row-end .conv-row-hover-slot > .conv-trash-btn { display: none; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-row-end .conv-row-actions { z-index: 8; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-idea-avatar {
    top: 8px;
    width: 46px;
    height: 46px;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step .conv-avatar-number { font-size: 18px; }
  #convList#convList .conv-item .conv-main-row.has-inline-step .conv-avatar-initials { font-size: 13px; }
  #convList#convList .conv-item .conv-main-row.has-inline-step .conv-avatar-stack > .conv-avatar-number { font-size: 12px; }
  /* CCC-155: right edge, vertically centred in the row (was the avatar's
     top corner); the preview line leaves room so the dot never covers it. */
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-working-dot {
    display: block;
    position: absolute;
    left: auto;
    right: 12px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: 0;
    transform: translateY(-50%);
    background: var(--green, #3fb950);
    z-index: 4;
  }
  #convList#convList .conv-item .conv-main-row.has-inline-step:has(> .conv-working-dot) > .conv-outcome.is-inline { margin-right: 18px; }
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-working-dot::after { background: var(--green, #3fb950); }
  /* CCC-261: a child session is one line: smaller avatar, title, then the
     details in a smaller ellipsized font, then % and age. No preview lines. */
  #convList#convList .conv-item.is-current-child-row:has(.conv-main-row.has-inline-step) {
    --conv-content-left: calc(var(--conv-icon-left) + 36px);
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
  /* CCC-332: a child with no inline step (nothing to say yet) still stays one
     line; without this it fell back to the full-height session row. */
  #convList#convList .conv-item.is-current-child-row:not(:has(.conv-main-row.has-inline-step)) {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    min-height: 0 !important;
    height: auto !important;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row:not(.has-inline-step) {
    min-height: 22px;
    align-items: center;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row:not(.has-inline-step) .conv-title {
    display: block;
    min-height: 0;
    font-size: 14px !important;
    line-height: 18px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #convList#convList .conv-item.is-current-child-row:not(:has(.conv-main-row.has-inline-step)) > :is(.conv-worker-history, .conv-worker-no-tickets) { display: none; }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step {
    grid-template-columns: fit-content(42%) minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 0 6px;
    min-height: 22px;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step .conv-title {
    font-size: 14px !important;
    line-height: 18px !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* The worker's ticket chips are the parent's to show; a child keeps one line. */
  #convList#convList .conv-item.is-current-child-row:has(.conv-main-row.has-inline-step) > :is(.conv-worker-history, .conv-worker-no-tickets) { display: none; }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-outcome.is-inline {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    align-items: center;
    min-height: 0;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-outcome.is-inline .conv-outcome-step {
    display: block;
    min-height: 0;
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Decisions need the row width even when child summaries share the title
     line. Flex sizing alone cannot move an item out of a grid column. */
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-quick-action-slot.is-decision) {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: start;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-quick-action-slot.is-decision) .conv-outcome-step {
    white-space: normal;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-meta-col {
    grid-column: 3;
    grid-row: 1;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-pct-badge { grid-column: 4; margin: 0; }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-row-end { grid-column: 5; margin: 0; }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-idea-avatar {
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
  }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step .conv-avatar-number { font-size: 11px; }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step .conv-avatar-initials { font-size: 8px; }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step .conv-avatar-stack > .conv-avatar-number { font-size: 8px; }
  #convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step .conv-avatar-model {
    transform: scale(0.65);
    transform-origin: bottom right;
  }
  /* In a narrow sidebar, keep the time at the title's right edge while
     context and lane controls share a footer below the preview. */
  @container sidebar (max-width: 460px) {
    #convList#convList .conv-item:not(.is-current-child-row) .conv-main-row.has-inline-step > :is(.conv-title, .conv-title-stack) {
      grid-column: 1 / 3;
    }
    #convList#convList .conv-item:not(.is-current-child-row) .conv-main-row.has-inline-step > .conv-meta-col {
      grid-column: 1 / 3;
    }
    #convList#convList .conv-item:not(.is-current-child-row) .conv-main-row.has-inline-step > .conv-pct-badge {
      grid-column: 3;
      grid-row: 3;
      align-self: center;
      justify-self: end;
    }
    #convList#convList .conv-item:not(.is-current-child-row) .conv-main-row.has-inline-step > .conv-row-end {
      grid-row: 1;
      align-self: start;
    }
  }
  #convList#convList .conv-gap-separator { display: none; }
}

/* Archive for a finished session: anchored just above the composer card, on
   the right, styled like the row's Archive chip. Only the button takes
   clicks, so the transcript under the strip stays usable. */
.conv-ready-archive-footer:not([hidden]) {
  position: absolute;
  bottom: 100%;
  right: 20px;
  z-index: 12;
  display: flex;
  justify-content: flex-end;
  padding: 6px 0;
  pointer-events: none;
}
.conv-ready-archive-footer .conv-ready-archive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid var(--text-muted);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--surface);
  font: 400 13px/1.2 system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}
.conv-ready-archive-footer .conv-ready-archive-btn:hover { color: var(--text); border-color: var(--text); }
.conv-ready-archive-footer .conv-ready-archive-btn:disabled { opacity: 0.5; cursor: default; }
@media (pointer: coarse) {
  .conv-ready-archive-footer .conv-ready-archive-btn { min-height: 44px; padding: 8px 20px; }
}

/* Repository logos share a stable square footprint, with readable fallbacks. */
.repo-avatar { display:inline-flex; position:relative; width:20px; height:20px; flex:0 0 20px; vertical-align:middle; border-radius:5px; overflow:hidden; background:var(--bg-secondary, #334155); color:var(--text, #fff); margin-right:5px; }
.repo-avatar-initials { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font:600 10px sans-serif; }
.repo-avatar img { position:relative; width:100%; height:100%; object-fit:contain; background:var(--bg-secondary, #334155); }
.repo-avatar img[hidden] { display:none; }
.repo-avatar.wa-avatar { width:42px; height:42px; flex-basis:42px; border-radius:12px; }
.repo-avatar.wa-avatar .repo-avatar-initials { font-size:17px; }
.repo-avatar-preview { width:44px; height:44px; flex-basis:44px; border-radius:10px; }
.repo-avatar-preview .repo-avatar-initials { font-size:18px; }
.conv-folder-chip .repo-avatar { width:14px; height:14px; flex-basis:14px; border-radius:3px; }
#repoAvatarControls { flex-wrap:wrap; }
/* The logo leads; a narrow repo-colored rim keeps repository identity visible. */
.conv-idea-avatar.has-repo-background { border-radius:50%; overflow:visible; }
.conv-idea-avatar > .repo-avatar.conv-avatar-background { position:absolute; inset:2px; width:calc(100% - 4px); height:calc(100% - 4px); margin:0; border-radius:50%; overflow:hidden; pointer-events:none; background:transparent; }
.conv-idea-avatar > .conv-avatar-background img { object-fit:cover; background:transparent; opacity:.4; filter:blur(1.5px); }
.conv-avatar-background .repo-avatar-initials { display:none; }
.conv-idea-avatar > .conv-avatar-stack { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:1px; text-shadow:0 1px 3px #000, 0 0 5px #000; }
.conv-avatar-initials { font:700 10px/1 system-ui, sans-serif; letter-spacing:.5px; }
.conv-avatar-stack > .conv-avatar-number { font-size:10px; }
.conv-idea-avatar > .conv-avatar-model { z-index:2; }
.conv-repo-portrait { cursor:default; }
.conv-repo-portrait > .conv-avatar-background img { object-fit:contain; background:var(--bg-secondary, #334155); opacity:1; filter:none; }
.conv-repo-portrait > .conv-avatar-background .repo-avatar-initials { display:flex; font-size:13px; }
.conv-pane-category .conv-idea-avatar { position:relative; display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; }

/* CCC-243: with smart repo on, the new-session folder picker collapses to
   one "Auto · repo · Change" line, matching the model line below it. */
.spawn-cwd-summary { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--text-muted); font-size: 11px; padding: 3px 0; }
.spawn-cwd-summary[hidden] { display: none; }
.spawn-cwd-summary .ns-selection-name { display: inline-flex; align-items: center; min-width: 0; }
.spawn-cwd-summary .repo-avatar { width: 14px; height: 14px; flex-basis: 14px; border-radius: 3px; }
.spawn-cwd-change { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.spawn-cwd-change:hover { color: var(--text); }
body.ccc-spawn-cwd-collapsed #spawnCwdQuickChips,
body.ccc-spawn-cwd-collapsed .spawn-cwd-row > :not(#spawnCwdSummary):not(#spawnCwdGuessChip),
body.ccc-spawn-cwd-collapsed .spawn-cwd-guess-note { display: none !important; }
body.ccc-spawn-cwd-collapsed .conv-input-context.visible.is-new-session { grid-template-areas: "cwd worktree"; }

/* Workload and available capacity, kept visible above filtered ticket rows. */
.fq-workload-summary {
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

/* A scheduled deferral takes precedence over historical claim/stage colors. */
.fq-row.is-deferred.is-att-neutral .fq-status.fq-status { background: var(--text-muted, #8b949e); box-shadow: none; animation: none; }
.fq-row.is-deferred.is-att-neutral .fq-status::after { content: none; display: none; animation: none; }

/* Handoff and needs-you chips (idea tickets): answer a blocked handoff,
   take a handed-off ticket back, or open a session that needs a decision. */
.conv-item .conv-outcome.is-handoff { border-left-color: rgba(163,113,247,0.5); background: rgba(163,113,247,0.06); }
.conv-item .conv-outcome.is-handoff .conv-outcome-step::before { color: #a371f7; }
.conv-item .conv-outcome.is-handoff .conv-outcome-step { color: var(--text-muted); }
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-attn-chip) {
  display: flex !important; align-items: flex-end; gap: 6px;
}
#convList#convList .conv-item .conv-outcome:has(.conv-attn-chip) .conv-outcome-step {
  flex: 1 1 auto; min-width: 0; width: auto;
}
.conv-attn-chip {
  flex: 0 0 auto;
  border: 1px solid var(--text-muted);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 10px;
  min-height: 24px;
  font: 600 12px/18px inherit;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.conv-attn-chip.is-primary { border-color: var(--accent); color: var(--accent); }
.conv-attn-chip:hover, .conv-attn-chip:focus-visible { color: var(--text); border-color: var(--text); }
.conv-attn-chip:disabled { opacity: .6; cursor: default; }

/* AUTO switch under a ticket row's avatar: who drives the work. On narrow
   screens it sits in .wa-av-col below the phone-row avatar. */
#convList .conv-item .wa-av-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#convList .conv-item .conv-main-row > .conv-auto-switch,
#convList .conv-item .wa-av-col > .conv-auto-switch {
  position: absolute;
  left: var(--conv-icon-left);
  top: 42px;
  z-index: 4;
  width: 32px;
  height: 13px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 45%, transparent);
  background: transparent;
  color: var(--text-muted);
  font: 700 7.5px/11px system-ui, sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.4;
  transition: opacity 0.12s ease;
}
#convList .conv-item .conv-main-row.has-inline-step > .conv-auto-switch { top: 58px; left: calc(var(--conv-icon-left) + 7px); }
#convList .conv-item .wa-av-col > .conv-auto-switch { position: static; flex: 0 0 auto; opacity: 0.7; }
#convList .conv-item:hover .conv-main-row > .conv-auto-switch.is-off { opacity: 0.85; }
#convList .conv-item .conv-main-row > .conv-auto-switch.is-on,
#convList .conv-item .conv-main-row > .conv-auto-switch.is-paused,
#convList .conv-item .wa-av-col > .conv-auto-switch.is-on,
#convList .conv-item .wa-av-col > .conv-auto-switch.is-paused { opacity: 1; color: #fff; border-color: transparent; }
#convList .conv-item .conv-main-row > .conv-auto-switch.is-on,
#convList .conv-item .wa-av-col > .conv-auto-switch.is-on {
  background: linear-gradient(90deg, #6d4bd8, #a98bff, #6d4bd8);
  background-size: 200% 100%;
  animation: conv-auto-flow 2.4s linear infinite;
  box-shadow: 0 0 6px rgba(150, 120, 255, 0.55);
}
#convList .conv-item .conv-main-row > .conv-auto-switch.is-paused,
#convList .conv-item .wa-av-col > .conv-auto-switch.is-paused { background: #b7791f; }
.conv-auto-label { position: relative; pointer-events: none; }
@keyframes conv-auto-flow { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .conv-auto-switch.is-on { animation: none; } }

/* Child lanes: no numbered avatar, only a tiny model mark. */
#convList#convList .conv-item .conv-main-row > .conv-idea-avatar.is-child-mini,
#convList#convList .conv-item.is-current-child-row .conv-main-row.has-inline-step > .conv-idea-avatar.is-child-mini {
  width: 14px;
  height: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  box-shadow: none;
}
#convList#convList .conv-item .conv-idea-avatar.is-child-mini .conv-avatar-model {
  transform: none !important;
  position: static;
  width: 14px;
  height: 14px;
  padding: 0;
}
#convList#convList .conv-item .conv-idea-avatar.is-child-mini .conv-avatar-engine,
#convList#convList .conv-item .conv-idea-avatar.is-child-mini .conv-avatar-engine svg { width: 11px; height: 11px; opacity: 1; filter: none; }
/* Doubled id + :has(mini) outranks the CCC-261 desktop child-row indent
   (+36px, sized for the old avatar), so lane titles start beside the mark. */
#convList#convList .conv-item.is-current-child-row:has(.conv-idea-avatar.is-child-mini) { --conv-content-left: calc(var(--conv-icon-left) + 22px); }
/* Same mark in the chat-list (wa) row layout: an inline 14px slot. */
#convList#convList .conv-item .wa-row > .conv-idea-avatar.is-child-mini {
  position: static;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  align-self: center;
  transform: none;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

/* Compact lane clusters (owner request): no tree rail, no divider lines
   between the parent and its lanes, and no reserved empty second step line
   that pushed the "↳ N lanes" chip down. One divider closes the cluster. */
#convList#convList .conv-subagent-cluster.is-expanded > .conv-subagent-cluster-body {
  border-left: 0;
  padding-left: 0;
}
/* !important + doubled id: the row-divider rules pin border-bottom with
   !important at #convList#convList specificity. */
#convList#convList .conv-subagent-cluster.is-expanded > .conv-item.conv-item,
#convList#convList .conv-subagent-cluster-body > .conv-item.conv-item:not(:last-child) {
  border-bottom-color: transparent !important;
}
#convList#convList .conv-subagent-cluster > .conv-item .conv-main-row.has-inline-step > .conv-outcome.is-inline:has(.conv-row-popout) .conv-outcome-step {
  min-height: 0;
}
@media not all and (pointer: coarse) {
  #convList#convList .conv-subagent-cluster .conv-row-popout {
    min-width: 22px;
    min-height: 22px;
    align-self: center;
  }
}

/* Session workspace: categories remain navigation; lifecycle guides attention. */
.session-lifecycle-section { margin: 0 0 12px; }
.session-lifecycle-heading {
  display: flex; align-items: center; gap: 8px; margin: 8px 4px 2px;
  color: var(--text-muted); font-size: 11px; line-height: 18px;
  font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
}
.session-lifecycle-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px;
  padding: 2px 0; border: 0; border-radius: 4px; background: transparent;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
  text-align: left; cursor: pointer;
}
.session-lifecycle-toggle:hover { color: var(--text); }
.session-lifecycle-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.session-lifecycle-arrow { margin-left: auto; font-size: 12px; letter-spacing: 0; }
.session-lifecycle-content[hidden] { display: none !important; }
.session-lifecycle-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
[data-session-section="needs-you"] .session-lifecycle-dot { background: var(--orange, #d9a441); }
[data-session-section="finished"] .session-lifecycle-dot { background: var(--text-muted); }
.session-lifecycle-count { padding: 0 6px; border-radius: 5px; background: var(--surface-2); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.session-lifecycle-empty { padding: 8px 8px 12px; color: var(--text-muted); font-size: 12px; }
#convList.session-workspace { padding-inline: 12px; }
#convList.session-workspace .conv-tab-bar { gap: 2px; padding-top: 2px; margin-bottom: 2px; }
#convList.session-workspace .conv-tab { padding: 6px 7px; font-size: 12px; }
#convList.session-workspace .conv-tab-count { font-size: 10px; }
#convList.session-workspace .conv-archived-section { border-top: 0; margin-top: 0; padding-top: 0; }
#convList.session-workspace .conv-archived-tools { border: 0; padding: 4px; margin: 0; }
#convList#convList.session-workspace .conv-item:not(.is-current-child-row) {
  --conv-content-left: calc(var(--conv-icon-left) + 52px);
  padding-top: 13px !important; padding-bottom: 13px !important;
  border-radius: 8px !important; margin: 2px 0 !important;
  border-bottom-color: color-mix(in srgb, var(--text) 7%, transparent) !important;
  box-shadow: none;
}
#convList#convList.session-workspace .conv-item.active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)) !important;
  box-shadow: inset 3px 0 var(--accent);
}
#convList#convList.session-workspace .conv-item:not(.is-current-child-row) .conv-idea-avatar:not(.is-child-mini),
#convList#convList .conv-item:not(.is-current-child-row) .conv-idea-avatar:not(.is-child-mini) {
  width: 40px; height: 40px; border-radius: 6px; top: 14px;
  flex: 0 0 40px; padding: 0; align-items: center; justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-2));
  box-shadow: none; animation: none;
}
#convList#convList .conv-item:not(.is-current-child-row) { --conv-content-left: calc(var(--conv-icon-left) + 52px); }
#convList#convList .conv-item:not(.is-current-child-row) .conv-idea-avatar > :is(.conv-avatar-background, .session-activity-dot) { display: none; }
#convList#convList .conv-item:not(.is-current-child-row) .conv-avatar-stack { gap: 2px; text-shadow: none; }
#convList#convList .conv-item:not(.is-current-child-row) :is(.conv-avatar-initials, .conv-avatar-project) {
  display: block; color: var(--text); font: 650 13px/1 system-ui, sans-serif; letter-spacing: .02em;
}
#convList .conv-item:not(.is-current-child-row) .wa-av-col { width: 40px; flex: 0 0 40px; align-self: flex-start; }
#convList#convList.session-workspace .conv-item:not(.is-current-child-row) .wa-avatar.conv-idea-avatar,
#convList#convList .conv-item:not(.is-current-child-row) .wa-avatar.conv-idea-avatar { top: auto; margin-top: 0; }
#convList.session-workspace .conv-idea-avatar > .conv-avatar-background { display: none; }
#convList.session-workspace .conv-avatar-stack { text-shadow: none; gap: 3px; }
#convList#convList.session-workspace .conv-avatar-initials { font-size: 10px; }
#convList#convList .conv-item:not(.is-current-child-row) .conv-avatar-stack > .conv-avatar-number { font-size: 11px; opacity: .85; }
#convList#convList.session-workspace .conv-item:not(.is-current-child-row) .conv-main-row > .conv-auto-switch { top: 59px; left: calc(var(--conv-icon-left) + 2px); }
#convList.session-workspace .conv-avatar-model { filter: none; transform: none; }
#convList#convList.session-workspace .conv-main-row.has-inline-step .conv-title { font-size: 15px !important; line-height: 21px !important; font-weight: 550; }
#convList#convList.session-workspace .conv-main-row.has-inline-step > .conv-outcome .conv-outcome-step { font-size: 13px; line-height: 19px; }
#convList.session-workspace .conv-working-dot,
#convList.session-workspace .conv-working-dot::after,
#convList.session-workspace .conv-auto-switch { animation: none !important; box-shadow: none !important; }
#convList.session-workspace .conv-pct-badge { background: transparent; font-size: 10px; opacity: .65; }
#convList.session-workspace .conv-attn-chip,
#convList.session-workspace .conv-ready-close { border-radius: 6px; padding: 5px 9px; font-size: 12px; }
#convList.session-workspace [data-session-section="finished"] .conv-item { opacity: 1; }
.session-usage-drawer { flex: 0 0 auto; border-top: 1px solid var(--border); padding: 9px 18px; color: var(--text-muted); font-size: 12px; }
.session-usage-drawer > summary { cursor: pointer; padding: 4px 0; }
.session-usage-drawer > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.session-usage-drawer #headroomBars { padding: 12px 0 4px; }
.session-usage-drawer .hb-heading { display: none; }
.session-usage-drawer:has(.hb-low) > summary { color: var(--red); }
.session-usage-drawer:has(.hb-low) > summary::after { content: ' · Low capacity'; }
.sidebar:has(.session-workspace) .sidebar-header { padding: 14px 18px 10px; }
.sidebar:has(.session-workspace) .sh-title-main { font-size: 17px; font-weight: 650; background: none; color: var(--text); -webkit-text-fill-color: currentColor; }
.sidebar:has(.session-workspace) .sh-app-icon { width: 25px; height: 25px; }
.sidebar:has(.session-workspace) .new-session-panel { padding: 10px 16px; }
.sidebar:has(.session-workspace) .new-session-primary-row { flex-wrap: wrap; gap: 8px; }
.sidebar:has(.session-workspace) #sidebarNewBtn { background: var(--accent); color: var(--bg, #101318); border-color: var(--accent); border-radius: 7px; font-size: 13px; }
.sidebar:has(.session-workspace) #sidebarNewTicketBtn { border-radius: 7px; font-size: 13px; background: transparent; }
/* Share the action row when a usable search field fits; otherwise wrap it. */
.sidebar:has(.session-workspace) .search-wrap { order: 10; flex: 1 1 120px; }
.sidebar:has(.session-workspace) .conv-search-input { border-radius: 7px; min-height: 36px; font-size: 13px; }
@media (max-width: 1200px) {
  #convList#convList.session-workspace .conv-item .wa-body { min-height: 0; padding-block: 4px; }
  #convList#convList.session-workspace .conv-item:not(.is-current-child-row) { padding-block: 6px !important; }
  #convList#convList.session-workspace .conv-item:not(.is-current-child-row) .wa-row > .conv-idea-avatar:not(.is-child-mini) { position: relative; top: auto; flex: 0 0 40px; }
  #convList.session-workspace .wa-title { font-size: 15px; }
  #convList.session-workspace .wa-preview { font-size: 13px; line-height: 19px; }
  .session-usage-drawer { padding: 6px 14px; }
  #convList .wa-line2:has(.wa-decision-context) .wa-preview {
    display: block; flex-basis: 100%; -webkit-line-clamp: unset; overflow: visible;
  }
  .wa-decision-context { flex: 1 0 100%; min-width: 0; }
  .wa-decision-context-toggle {
    min-height: 32px; padding: 4px 0; border: 0; background: transparent;
    color: var(--accent); font: inherit; font-size: 12px; cursor: pointer;
    text-align: start; text-decoration: underline; text-underline-offset: 3px;
  }
  .wa-decision-context-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .wa-decision-context .conv-session-summary-detail {
    margin: 0 0 4px; padding: 0; border: 0; background: transparent;
  }
  .wa-decision-choice, .wa-decision-reply {
    color: var(--text-muted); font-size: 12px; line-height: 1.5;
    white-space: pre-wrap; overflow-wrap: anywhere;
  }
  .wa-decision-choice { margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  #convList.session-workspace * { animation: none !important; transition: none !important; }
}
@media (max-width: 600px) {
  .sidebar:has(.session-workspace) .sh-title-link { display: inline-flex; min-width: 0; }
  .sidebar:has(.session-workspace) .sh-title-main { font-size: 15px; }
  .sidebar:has(.session-workspace) .new-session-caret { background: var(--accent); border-color: var(--accent); color: var(--bg, #101318); }
}
body.has-mobile-bottom-nav .pwa-install-banner {
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
}
/* Phone search shares the New session row, expanding the existing field. */
.sidebar-search-btn { display: none; }
@media (max-width: 1200px) {
  .sidebar .new-session-primary-row { flex-wrap: wrap; }
  .sidebar .sidebar-search-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .sidebar .sidebar-search-btn.is-filtering { color: var(--accent); }
  .sidebar .new-session-primary-row:not(.is-search-open) > .search-wrap { display: none; }
  .sidebar .new-session-primary-row.is-search-open > .search-wrap {
    display: flex;
    order: 10;
    flex: 1 0 100%;
    min-width: 0;
  }
  .sidebar .new-session-primary-row.is-search-open .conv-search-input { width: 100%; }
}

/* Keep the sidebar toggle beside its divider, outside the wrapping actions. */
@media (min-width: 1201px) {
  .sidebar > .new-session-panel:has(> .conv-list-collapse-btn) { padding-right: 4px; }
}

/* Settings: readable hierarchy, grouped navigation and inspectable routing. */
.settings-title { font-size: 17px; margin: 0 12px 0 4px; }
.settings-rail { flex-basis: 210px; padding: 10px; }
.settings-rail-group { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 18px 10px 6px; }
.settings-rail-group:first-child { padding-top: 4px; }
.settings-rail-item { min-height: 35px; }
.settings-rail-item svg { display: block; width: 15px; height: 15px; flex: 0 0 15px; opacity: .75; }
.settings-pane { padding: 8px 28px 28px; }
.settings-section { border-bottom: 0; }
.settings-section-eyebrow { font-size: 23px; font-weight: 650; text-transform: none; letter-spacing: -.02em; color: var(--text); margin: 8px 0 8px; }
.settings-section-note { font-size: 13px; line-height: 1.6; margin-bottom: 22px; max-width: 75ch; }
.settings-row { padding: 13px 0; gap: 24px; }
.settings-row + .settings-row { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.settings-row-desc { font-size: 12px; line-height: 1.55; max-width: 76ch; }
.settings-row-control { max-width: 55%; flex-wrap: wrap; justify-content: flex-end; }
.settings-pane select, .settings-pane input:not([type=checkbox]):not([type=range]):not([type=file]) { box-sizing: border-box; min-height: 34px; max-width: 100%; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); padding: 6px 9px; font: inherit; }
.settings-pane select { text-overflow: ellipsis; }
.settings-pane .eng-defaults { grid-template-columns: 1fr; }
.settings-pane .eng-defaults-card .settings-row { padding: 12px 16px; }
.settings-subsection-label { margin-top: 24px; font-size: 12px; }
.settings-modal :is(button,input,select,a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.settings-data-card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin: 18px 0; background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.settings-metric-total { font-size: 26px; font-weight: 650; margin: 14px 0; font-variant-numeric: tabular-nums; }
.settings-metric-total span { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.settings-usage-list { max-height: 260px; overflow-y: auto; margin: 12px 0; }
.settings-usage-row { display: grid; grid-template-columns: minmax(140px,1fr) minmax(60px,1fr) 42px; gap: 16px; align-items: center; padding: 9px 0; font-size: 12px; }
.settings-usage-row strong { overflow-wrap: anywhere; }
.settings-usage-row small,.settings-routing-table small { display: block; color: var(--text-muted); margin-top: 4px; }
.settings-usage-row b { text-align: right; font-variant-numeric: tabular-nums; }
.settings-usage-track { background: var(--bg); border-radius: 4px; height: 7px; }
.settings-usage-track span { display: block; background: var(--accent); height: 100%; border-radius: inherit; }
.settings-bulk-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
#settingsQueuePreviewBody { border-left: 3px solid var(--accent); background: var(--bg); padding: 16px; margin: 12px 0; font-size: 12px; line-height: 1.6; }
#settingsQueueStatus { font-size: 12px; margin-top: 12px; }
.settings-table-wrap { overflow-x: auto; margin-top: 16px; }
.settings-routing-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.settings-routing-table th,.settings-routing-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.settings-routing-table thead { color: var(--text-muted); font-size: 11px; }
.settings-source-badge { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); padding: 3px 6px; border-radius: 5px; }
.settings-empty { color: var(--text-muted); padding: 20px 0; font-size: 13px; }
@media(max-width:700px) {
  .settings-title { display:none; }
  .settings-rail { flex-basis:auto; }
  .settings-rail-group { display:none; }
  .settings-rail-item svg { display:none; }
  .settings-pane { padding: 8px 16px 20px; }
  .settings-row-control { max-width:100%; justify-content:flex-start; }
  .settings-section-eyebrow { font-size:21px; }
  .settings-data-card { padding:14px; }
  .settings-usage-row { grid-template-columns:minmax(0,1fr) max-content; gap:8px 12px; }
  .settings-usage-row > b { grid-column:2; grid-row:1; }
  .settings-usage-row > .settings-usage-track { grid-column:1 / -1; grid-row:2; }
}
/* Keep passive notifications behind the active Settings dialog. */
body.has-settings-modal-open #cccNotifyStack { z-index: 9998; }
/* Defaults need labeled rows: compact engine-list strips clip long models. */
:is(#settingsSection-defaults, #routingPolicyEditor) .eng-card { display: block; padding: 18px; }
:is(#settingsSection-defaults, #routingPolicyEditor) .eng-card-head { margin-bottom: 12px; }
:is(#settingsSection-defaults, #routingPolicyEditor) .eng-card-title { font-size: 16px; }
:is(#settingsSection-defaults, #routingPolicyEditor) .eng-card-sub { display: block; color: var(--text-muted); font-size: 12px; margin-top: 5px; }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-row { display: flex; width: auto; padding: 12px 0; gap: 20px; }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-row-main { flex: 1 1 auto; }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-row-desc { display: block; }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-row-label { font-size: 13px; font-weight: 550; color: var(--text); }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-row-control { flex: 0 1 42%; }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-row-control select { width: 100% !important; max-width: 100%; }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-number-input { width: 80px; }
:is(#settingsSection-defaults, #routingPolicyEditor) #spawnDefaultsWorkerInheritanceRow { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: start; flex: 1 0 100%; box-sizing: border-box; width: 100%; }
#spawnDefaultsWorkerInheritanceRow .settings-row-control { grid-column: 2; grid-row: 1; width: auto; max-width: none; margin: 0; padding-top: 4px; }
#spawnDefaultsWorkerInheritanceRow .settings-row-main { flex: 1; min-width: 0; }
#spawnDefaultsWorkerInheritanceRow .settings-row-label { color: var(--text); font-weight: 600; }
#spawnDefaultsWorkerInheritanceRow .settings-row-desc { display: block; overflow-wrap: anywhere; margin-top: 6px; }
#spawnDefaultsWorkerInherit { width: 20px; height: 20px; accent-color: var(--accent); }
#spawnDefaultsWorkerOverrides { width: 100%; min-width: 0; }
#spawnDefaultsWorkerOverrides[hidden] { display: none; }

@media(max-width:700px) { :is(#settingsSection-defaults, #routingPolicyEditor) .settings-row-control { flex-basis:100%; } }
.settings-modal.is-searching .settings-search-miss { display:none; }
.settings-modal.is-searching .eng-card:has(.settings-row):not(:has(.settings-row:not([hidden]))) { display:none; }
@media(max-width:700px) {
  .settings-routing-table { min-width:620px; }
  .settings-routing-table th { white-space:nowrap; }
}
.settings-section-links { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 20px; }
.settings-modal.is-first-run .settings-section-links { display:none; }
:is(#settingsSection-defaults, #routingPolicyEditor) .settings-data-card { display:block; padding:18px; }
@media(max-width:700px) { :is(#settingsSection-defaults, #routingPolicyEditor) .settings-data-card { padding:14px; } }

/* Make the status word scannable without lighting up the whole preview. */
#convList#convList .conv-item .wa-explanation-label[data-status="working"],
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome:not(.has-close-btn) .conv-outcome-step[data-label="Working"]::before {
  color: var(--green, #3fb950);
  font-weight: 650;
  text-shadow: 0 0 8px color-mix(in srgb, var(--green, #3fb950) 30%, transparent);
}
#convList#convList .conv-item .wa-explanation-label[data-status="finished"],
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome:not(.has-close-btn) .conv-outcome-step[data-label="Finished"]::before {
  color: var(--text-secondary, #aab7c4);
  font-weight: 650;
}
@keyframes session-working-glow {
  from { text-shadow: 0 0 6px color-mix(in srgb, var(--green, #3fb950) 22%, transparent); }
  to { text-shadow: 0 0 11px color-mix(in srgb, var(--green, #3fb950) 50%, transparent); }
}
@media (prefers-reduced-motion: no-preference) {
  #convList#convList .conv-item .wa-explanation-label[data-status="working"],
  #convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome:not(.has-close-btn) .conv-outcome-step[data-label="Working"]::before {
    animation: session-working-glow 2.8s ease-in-out infinite alternate;
  }
}

/* Completion and decisions stay distinct when scanning session summaries. */
#convList#convList .conv-item .wa-explanation-label[data-status="waiting for agent"],
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome .conv-outcome-step[data-label="Waiting for agent"]::before {
  color: var(--accent, #58a6ff);
  font-weight: 700;
}
#convList#convList .conv-item .wa-explanation-label[data-status="✓"],
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome .conv-outcome-step[data-label="✓"]::before {
  content: "✓ ";
  display: inline;
  color: var(--green, #3fb950);
  font-weight: 900;
  -webkit-text-stroke: 0.65px currentColor;
  border: 0;
  padding: 0;
  margin-right: 4px;
}
#convList#convList .conv-item .wa-explanation-label[data-status="decide"],
#convList#convList .conv-item .conv-main-row.has-inline-step > .conv-outcome .conv-outcome-step[data-label="Decide"]::before {
  color: var(--orange, #d29922);
  font-weight: 700;
}

  /* A quiet, always-available evidence report beside each session row. */
  .conv-decision-report-btn {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 26px; width: 26px; height: 26px; padding: 0;
    border: 0; border-radius: 5px; background: transparent;
    color: var(--text-muted); opacity: .65; cursor: pointer;
  }
  .conv-decision-report-btn:hover,
  .conv-decision-report-btn:focus-visible {
    opacity: 1; color: var(--text); background: var(--surface-2);
  }
  .conv-decision-report-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .conv-decision-report-btn:disabled { opacity: .35; cursor: progress; }
  .conv-report-editor {
    position: fixed; inset: auto; margin: 0; box-sizing: border-box;
    padding: 14px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text); overflow: auto; z-index: 10000;
    font: 13px/1.4 var(--font-family, system-ui, sans-serif);
  }
  .conv-report-editor label { display: block; margin-bottom: 8px; font-weight: 600; }
  .conv-report-editor label span { font-weight: 400; color: var(--text-muted); }
  .conv-report-editor textarea {
    display: block; box-sizing: border-box; width: 100%; min-height: 80px; max-height: 220px;
    resize: vertical; padding: 9px; border: 1px solid var(--border); border-radius: 5px;
    background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
  }
  .conv-report-editor textarea::placeholder { color: var(--text-muted); }
  .conv-report-controls { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
  .conv-report-controls button {
    min-height: 36px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 5px;
    background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
  }
  .conv-report-controls button[type="submit"] { border-color: var(--accent); color: var(--accent); }
  .conv-report-controls button:hover { border-color: var(--text); }
  .conv-report-editor :is(textarea, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .conv-report-editor :disabled { opacity: .6; cursor: wait; }
  .conv-action-confirm p { margin: 0; }
  .conv-action-confirm [data-confirm-accept] { color: var(--red); }
  .conv-report-error { margin: 8px 0 0; color: var(--red); }
  .wa-line1 > .conv-decision-report-btn { flex-basis: 32px; width: 32px; height: 32px; margin-block: -4px; }
  @media (max-width: 1200px), (pointer: coarse) {
    .wa-line1 > .conv-decision-report-btn { flex-basis: 44px; width: 44px; height: 44px; }
  }

  /* Keep the report inside the existing edge cell in flex and grid rows. */
  #convList#convList .conv-item .conv-main-row > .conv-row-end:has(> .conv-decision-report-btn) {
    box-sizing: border-box; padding-left: 30px;
    flex-basis: 64px; width: 64px; min-width: 64px; max-width: 64px;
  }
  .conv-row-end > .conv-decision-report-btn {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 9;
  }

  .conv-item.is-actions-open .conv-row-end > .conv-decision-report-btn { visibility: hidden; }

/* Task-based settings: six destinations, with specialist controls inline. */
#settingsRail .settings-legacy-tab { display: none !important; }
.settings-disclosure { border-top: 1px solid var(--border); padding: 12px 0; }
.settings-disclosure > summary { cursor: pointer; font-size: 15px; font-weight: 600; padding: 8px 0; color: var(--text); }
.settings-disclosure > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.settings-disclosure[open] > summary { margin-bottom: 14px; }
.settings-disclosure-heading { display: none !important; }
.settings-modal.is-searching .settings-section-note,
.settings-modal.is-searching .settings-section-links { display: none; }
.settings-modal.is-first-run .settings-disclosure > summary { display: none; }
.settings-modal.is-first-run .settings-disclosure { border: 0; padding: 0; }
:is(#settingsSection-defaults, #routingPolicyEditor) .eng-defaults-card { border: 0; border-radius: 0; background: transparent; padding-left: 0; padding-right: 0; }
:is(#settingsSection-defaults, #routingPolicyEditor) .eng-defaults-card + .eng-defaults-card { border-top: 1px solid var(--border); }

/* State grouping is independent of the session ordering toolbar. */
.conv-session-state-tools { display: flex; padding: 4px 0 6px; }
.conv-session-state-tools :where(button.grouping-opt) { font: inherit; background: transparent; border: 0; color: inherit; cursor: pointer; }
.conv-session-state-tools button.grouping-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Saved arguments are distinct from launch-time quota and availability. */
[data-launch-preview] { min-width: 0; overflow-wrap: anywhere; }
[data-launch-preview] h3 { margin: 0 0 8px; font-size: 15px; }
[data-launch-preview] h4 { margin: 18px 0 6px; font-size: 13px; }
.ao-launch-preview { margin: 12px 0; }
.ao-launch-preview > summary { cursor: pointer; color: var(--text-muted); font-size: 12px; }
.ao-launch-preview > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.settings-launch-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.settings-launch-toolbar select { flex: 1 1 180px; min-width: 0; max-width: 100%; }
.settings-launch-output { font-size: 12px; line-height: 1.6; }
.settings-launch-basis { color: var(--text-muted); }
.settings-launch-fields { margin: 12px 0; }
.settings-launch-fields > div { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.settings-launch-fields dt { color: var(--text-muted); }
.settings-launch-fields dd { margin: 0; min-width: 0; }
.settings-launch-fields strong,.settings-launch-fields small { display: block; }
.settings-launch-fields .settings-source-badge { display: inline-block; margin: 5px 0; }
.settings-launch-fields small { color: var(--text-muted); }
.settings-launch-warning { border-left: 3px solid var(--accent); padding-left: 10px; }

.settings-launch-details { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.settings-launch-details > summary { cursor: pointer; font-weight: 600; }
.settings-launch-details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* One staged launch-policy workflow on the existing routing surface. */
#routingPolicyEditor { min-width: 0; }
.routing-policy-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.routing-policy-toolbar select { flex: 1 1 170px; min-width: 0; }
.routing-policy-route { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 16px 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; min-width: 0; }
.routing-policy-route label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.routing-policy-route .routing-policy-toolbar { grid-column: 1 / -1; margin: 4px 0; }
#routingPolicyDiff { overflow-wrap: anywhere; border-top: 1px solid var(--border); padding-top: 16px; }
.routing-policy-diff { padding: 10px 0; border-bottom: 1px solid var(--border); }
.routing-policy-diff p { margin: 5px 0; }
#routingPolicyError { color: var(--danger, #ef7777); overflow-wrap: anywhere; }
#routingPolicyEditor .eng-defaults { grid-template-columns: 1fr; }
#routingPolicyEditor .eng-defaults-card { min-width: 0; }
@media (max-width: 600px) { .routing-policy-route { grid-template-columns: 1fr; } }

.settings-modal.is-first-run #routingPolicyEditor .eng-defaults { display: block !important; }

.routing-policy-first-run { display: none; }
.settings-modal.is-first-run .routing-policy-first-run { display: inline-block; }

/* Keep native transaction controls reachable on touch screens. */
@media (max-width: 600px) {
  .fq-config-dialog button,
  #networkModal button {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
  }
  .fq-config-dialog input:not([type="checkbox"]):not([type="radio"]),
  .fq-config-dialog select {
    min-height: 44px;
  }
  .fq-config-dialog .fq-config-checks label { min-height: 44px; }
  .fq-config-dialog .settings-toggle,
  button.settings-toggle[data-ff-toggle] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }
}

/* Today-only star (left of ticket rows) and the Today group atop Active. */
/* Sits on the avatar's top-left corner (the row body is a grid, the avatar
   and AUTO switch are absolutely placed in the left gutter). */
#convList .conv-item .conv-main-row > .conv-today-star {
  position: absolute; z-index: 3; top: 4px; left: calc(var(--conv-icon-left, 10px) - 8px);
  width: 16px; height: 16px; padding: 0; margin: 0;
  text-shadow: 0 0 3px var(--bg, #0d1117), 0 0 2px var(--bg, #0d1117);
}
.conv-today-star {
  flex: 0 0 auto; width: 16px; padding: 0; margin: 0 2px 0 0;
  background: none; border: 0; cursor: pointer; line-height: 1;
  font-size: 13px; color: var(--text-dim, #8b949e); opacity: 0;
  transition: opacity .12s ease, color .12s ease;
}
.conv-item:hover .conv-today-star,
.conv-item.active .conv-today-star,
.conv-today-star:focus-visible { opacity: .55; }
.conv-today-star:hover { opacity: 1; color: #e3b341; }
.conv-today-star.is-on { opacity: 1; color: #e3b341; }
@media (hover: none) { .conv-today-star { opacity: .35; } }
.today-star-group {
  margin: 2px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, #e3b341 35%, transparent);
}
.today-star-heading {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: #e3b341; padding: 2px 10px 4px;
}

  .codex-account-row { grid-area: account; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
  .codex-account-row[hidden], .codex-session-account[hidden] { display: none; }
  .codex-account-row select { flex: 1; min-width: 0; max-width: 360px; padding: 5px 7px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
  #codexAccountRow select { flex: 0 1 auto; width: auto; max-width: min(16rem, 100%); }
  .codex-account-row a, .codex-session-account { color: var(--text-muted); font-size: 12px; }
  body.ccc-spawn-cwd-collapsed .conv-input-context.visible.is-new-session:has(> .codex-account-row:not([hidden])) {
    grid-template-areas: "cwd worktree" "account account";
  }
  @media (max-width: 1200px) {
    body.ccc-spawn-cwd-collapsed .conv-input-context.visible.is-new-session:has(> .codex-account-row:not([hidden])) {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "chips" "account";
    }
    body:not(.ccc-spawn-cwd-collapsed) .conv-input-context.visible.is-new-session:has(> .codex-account-row:not([hidden])) {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "object" "chips" "cwd" "worktree" "account";
    }
    .codex-account-row { width: 100%; }
  }

/* Settings → Agents at a glance: colorful engine + queue overview. */
.agents-overview { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.ao-block {
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--surface);
}
.ao-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ao-head-main { flex: 1 1 240px; min-width: 0; }
.ao-title { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.ao-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.ao-stats { display: flex; gap: 8px; }
.ao-stats .eng-stat { cursor: default; }
.ao-stats .eng-stat.is-bad .eng-stat-num { color: var(--red); }
.ao-eng-group + .ao-eng-group { margin-top: 18px; }
.ao-group-label { font-size: 10.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px; }
.ao-eng-group.is-signin .ao-group-label { color: var(--red); }
.ao-eng-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.ao-eng-group.is-missing .ao-eng-grid, .ao-eng-group.is-off .ao-eng-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ao-eng-list { display: flex; flex-direction: column; }
.ao-eng {
  display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; padding: 6px 2px;
  border-top: 1px solid var(--border);
}
.ao-eng:first-child { border-top: 0; }
.ao-eng .eng-mono { flex: none; }
.ao-eng .ao-eng-name { flex: 0 0 150px; }
.ao-eng .ao-state { flex: 0 0 120px; }
.ao-eng .ao-accounts { flex: 1 1 auto; flex-direction: row; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ao-eng-action { margin-left: auto; flex: none; }
.ao-eng.is-missing .eng-mono, .ao-eng.is-off .eng-mono { filter: grayscale(1); opacity: 0.55; }
.ao-eng.is-missing .ao-eng-name, .ao-eng.is-off .ao-eng-name { color: var(--text-muted); }
.ao-eng.is-signin .ao-state { color: var(--red); }
@media (max-width: 700px) { .ao-eng { flex-wrap: wrap; } .ao-eng .ao-eng-name { flex: 1 1 110px; } .ao-eng .ao-state { flex: 0 0 auto; } .ao-eng .ao-accounts { flex-basis: 100%; order: 5; } }
.ao-eng:focus-visible, .ao-q-btn:focus-visible, .ao-default:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ao-eng-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ao-eng-id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ao-eng-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.ao-state.is-ok { color: var(--green); }
.ao-state.is-warn { color: var(--orange); }
.ao-cta { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.ao-gear { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.ao-gear:hover { color: var(--text); background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.ao-defaults { display: flex; gap: 6px; }
.ao-default {
  flex: 1 1 0; font: inherit; font-size: 11.5px; font-weight: 600; padding: 4px 6px; border-radius: 7px; cursor: pointer;
  color: var(--text-muted); background: transparent; border: 1px dashed var(--border);
}
.ao-default:hover { color: var(--text); border-style: solid; border-color: hsl(var(--eng-hue) 60% 55%); }
.ao-default.is-active {
  cursor: default; border-style: solid; color: hsl(var(--eng-hue) 75% 80%);
  background: hsl(var(--eng-hue) 55% 30% / 0.55); border-color: hsl(var(--eng-hue) 60% 50%);
}
.ao-accounts { display: flex; flex-direction: column; gap: 3px; }
.ao-account { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.ao-account-role { font-weight: 650; color: var(--text); min-width: 62px; }
.ao-account-left { margin-left: auto; font-variant-numeric: tabular-nums; }
.ao-account.is-ok .ao-account-left { color: var(--green); }
.ao-account.is-warn .ao-account-left { color: var(--orange); }
.ao-account.is-bad .ao-account-left { color: var(--red); }
.ao-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap;
  color: hsl(var(--eng-hue, 210) 70% 75%); background: hsl(var(--eng-hue, 210) 50% 30% / 0.35);
  border: 1px solid hsl(var(--eng-hue, 210) 50% 45% / 0.5);
}
.ao-q-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ao-q {
  display: grid; grid-template-columns: minmax(140px, 1fr) minmax(200px, 260px) minmax(140px, 1fr);
  align-items: center; gap: 10px; padding: 7px 10px 7px 12px; min-width: 0;
  border-left: 3px solid hsl(var(--eng-hue) 65% 55%); background: var(--bg);
}
.ao-q + .ao-q { border-top: 1px solid var(--border); }
.ao-q:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--bg)); }
.ao-q.is-manual { border-left-color: var(--border); }
.ao-q.is-manual .ao-q-name, .ao-q.is-manual .ao-q-counts, .ao-q.is-manual .ao-q-route { opacity: 0.6; }
.ao-q-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ao-q-name { font-size: 13px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-q-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.ao-q-status.is-ok { color: var(--green); } .ao-q-status.is-warn { color: var(--orange); } .ao-q-status.is-bad { color: var(--red); }
.ao-q-counts, .ao-q-workers { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ao-q-blocked { color: var(--orange); }
.ao-q-route { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ao-q-mono { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.ao-q-model { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-q-actions { display: flex; gap: 5px; justify-content: flex-end; }
.ao-q-btn { font: inherit; font-size: 11.5px; padding: 3px 9px; border-radius: 7px; cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.ao-q-btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.ao-q-btn:disabled { opacity: 0.5; cursor: default; }
.ao-setup-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgb(0 0 0 / 0.55); padding: 24px; }
.ao-setup-overlay[hidden] { display: none; }
.ao-setup-card { width: min(720px, 100%); max-height: 86vh; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 20px 60px rgb(0 0 0 / 0.5); }
.ao-setup-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ao-setup-title { font-size: 16px; font-weight: 650; color: var(--text); }
.ao-setup-close { border: 0; background: transparent; color: var(--text-muted); font-size: 20px; cursor: pointer; line-height: 1; }
.ao-setup-body { overflow: auto; padding: 4px 16px 16px; }
.ao-setup-body #engineConnection > h2, .ao-setup-body #engineConnection > p:first-of-type,
.ao-setup-body #engineConnection > label, .ao-setup-body #engineConnectionSelect { display: none; }
[data-theme="light"] .ao-default.is-active { color: hsl(var(--eng-hue) 60% 28%); background: hsl(var(--eng-hue) 70% 90%); }
[data-theme="light"] .ao-badge { color: hsl(var(--eng-hue, 210) 60% 32%); background: hsl(var(--eng-hue, 210) 70% 92%); border-color: hsl(var(--eng-hue, 210) 50% 80%); }

/* CCC-333: thumbnails of images returned inside a folded run, shown beside the
   run chip while folded; the unfolded run shows the full inline images. */
.cc-run-thumbs { display: none; }
body.conv-compact .conversations-view .cc-run-thumbs {
  display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; align-items: center;
}
body.conv-compact .conversations-view .cc-run-chip.cc-run-open ~ .cc-run-thumbs { display: none; }
.cc-run-thumbs .msg-image.cc-run-thumb {
  display: inline-block; width: auto; height: 56px; max-width: 112px; max-height: 56px;
  margin: 0; border-radius: 4px; object-fit: cover;
}
.cc-run-thumbs-more { font-size: 11px; color: var(--text-muted); }
body.conv-compact.conv-compact .conversations-view .cc-run-head:not(.cc-run-open):not(.tool-call-group) > .cc-run-thumbs { display: inline-flex !important; }
body.conv-compact .conversations-view .cc-run-open .cc-run-thumbs { display: none; }

/* Agents tab = the two diagrams. Text sections stay in the DOM for search,
   first-run and pop-ups, but are folded away otherwise. */
.settings-modal:not(.is-first-run):not(.is-searching) :is(#settingsSection-defaults, #settingsSection-engines, #settingsSection-queues, #settingsSection-routing).ao-folded > :not(.agents-overview):not(.ao-setup-overlay) { display: none !important; }
.settings-modal:not(.is-first-run):not(.is-searching) #settingsSection-routing.ao-folded { border: 0; padding: 0; margin: 0; min-height: 0; }
.settings-modal.is-first-run .agents-overview, .settings-modal.is-searching .agents-overview { display: none; }
.ao-head-main { min-width: 0; }
.ao-sub:empty { display: none; }
.ao-defaults-bar { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.ao-def-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ao-def-label { width: 110px; flex: none; font-size: 12px; color: var(--text-muted); }
.ao-def-engine { font-size: 13px; font-weight: 650; color: var(--text); margin-right: 4px; }
.ao-def-follow { font-size: 12.5px; color: var(--text); margin-right: 4px; }
.ao-mini-mono { width: 20px; height: 20px; border-radius: 6px; font-size: 9.5px; flex: none; }
.ao-select { font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 7px; color: var(--text); background: var(--surface); border: 1px solid var(--border); max-width: 220px; min-width: 0; }
.ao-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ao-q-select { flex: 1 1 auto; max-width: none; }
.ao-link { font: inherit; font-size: 12px; margin-top: 12px; padding: 0; border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.ao-link:hover { color: var(--accent); text-decoration: underline; }
.ao-setup-body .settings-section-eyebrow { display: none; }
@media (max-width: 700px) { .ao-q { grid-template-columns: 1fr; } .ao-def-label { width: auto; } }
.agents-overview :is(select, input).ao-select { font-size: 12px !important; line-height: 1.3; height: 26px; min-height: 0; padding: 2px 22px 2px 7px; width: auto; }
.agents-overview select.ao-q-select { width: 100%; }
.agents-overview input.ao-num { width: 72px; padding-right: 6px; }
/* The pop-ups show only what the diagram cannot: no repeated defaults. */
.ao-setup-body #routingPolicyContext option[value="defaults"] { display: none; }
.ao-setup-body #engineConnectionPanel > section.engine-connection-step:nth-of-type(n+2) { display: none; }
#agentsOverview .ao-account-pick { flex: none; padding: 1px 8px; font-size: 10.5px; margin-left: 4px; }
#agentsOverview .ao-account:has(.ao-account-pick.is-active) { outline: 1px solid color-mix(in srgb, hsl(var(--eng-hue) 65% 55%) 60%, transparent); }
#agentsOverview .ao-account:has(.ao-account-picks) { flex-wrap: wrap; row-gap: 4px; padding: 4px 6px; }
#agentsOverview .ao-account-picks { display: flex; gap: 5px; width: 100%; }
#agentsOverview .ao-account-picks .ao-account-pick { flex: 1 1 0; margin-left: 0; }

/* Pasted images mentioned by a session's ask: shown under the expanded pane
   header message and under the rail's description text. */
.conv-pane-last-user-message .pane-header-images { display: none; }
.conv-pane-last-user-message.is-expanded .pane-header-images { display: block; margin-top: 6px; }
.pane-header-images img,
.status-rail-title-images img,
.csh-ask-original .user-msg > a > img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin-top: 6px;
  border-radius: 6px;
}
.status-rail-title-images { margin-top: 6px; }

/* CCC-378: ⋯ menu for the less-used queue strip controls. */
.fq-status-more { position: relative; flex-shrink: 0; }
.fq-status-more-btn {
  list-style: none; cursor: pointer; user-select: none;
  font-size: 14px; line-height: 1; padding: 1px 8px; border-radius: 999px;
  background: rgba(139,148,158,0.10); color: var(--text-muted);
  border: 1px solid rgba(139,148,158,0.18);
}
.fq-status-more-btn::-webkit-details-marker { display: none; }
.fq-status-more-btn:hover, .fq-status-more[open] > .fq-status-more-btn { background: rgba(139,148,158,0.18); color: var(--text); }
.fq-status-more-pop {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 8px; min-width: 150px;
  background: var(--bg-elevated, var(--bg, #161b22)); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.fq-status-stats { flex-basis: 100%; padding: 4px 0 0; border-bottom: 0; }

/* Narrow (701-1200px) layout keeps the app-rail on screen. The conversation
   pane (.main, z-index 800) used to cover the bottom nav here, so it vanished
   whenever a conversation was open, and its left edge slid under the rail.
   Lift the nav above the pane, start it after the rail, and shorten the pane
   so the composer sits above it (CCC-385). Phones (<=700px) keep the
   full-screen pane with the Back button. */
@media (min-width: 701px) and (max-width: 1200px) {
  body.has-mobile-bottom-nav:not(.kanban-split) .mobile-bottom-nav {
    left: var(--ccc-rail-w, 76px);
    z-index: 850;
  }
  body.has-mobile-bottom-nav:not(.kanban-split) .main {
    height: calc(var(--app-vh, 100vh) - env(safe-area-inset-top, 0px) - 64px - env(safe-area-inset-bottom, 0px));
  }
}

/* Settings carries no standalone explanation text: only control labels and
   their own descriptions. Scope help stays in the DOM for aria-describedby. */
#settingsPane .settings-scope-container, #settingsPane .settings-section-note { display: none !important; }
.ao-sub:empty { display: none; }
.agents-overview .ao-def-row select.ao-select { max-width: 190px !important; flex: 0 1 auto; }
.agents-overview .ao-def-row select.ao-def-engine { font-weight: 650; margin-right: 0; max-width: min(100%, 230px) !important; }

/* Narrow layout (bottom nav present): the hamburger menu already lists every
   app, so the left app rail is dropped and everything offset by it collapses. */
@media (max-width: 1200px) {
  html.has-mobile-bottom-nav { --ccc-rail-w: 0px !important; }
  body.has-mobile-bottom-nav { padding-left: 0 !important; }
  body.has-mobile-bottom-nav :is(.ccc-side-nav, .ccc-rail-resizer, .ccc-report-flag, .ccc-account-wrap, .ccc-account-pop) { display: none !important; }
}

/* Reading on a phone gets the whole screen. Back restores the session list
   and its mobile navigation. */
@media (max-width: 700px) {
  body.mobile-show-main:not(.kanban-split) { padding-left: 0 !important; }
  body.mobile-show-main:not(.kanban-split) .main { left: 0; }
  body.mobile-show-main:not(.kanban-split) :is(.ccc-side-nav, .ccc-rail-resizer, .ccc-account-wrap, .ccc-account-pop) { display: none !important; }

  /* Keep the labelled 44px tap targets without covering a column of prose. */
  :is(.conv-scroll-end-btn, .conv-scroll-last-btn, .conv-scroll-next-btn, .conv-scroll-segment-btn) {
    width: 44px; height: 44px; padding: 0; gap: 0;
  }
  :is(.conv-scroll-end-btn, .conv-scroll-last-btn, .conv-scroll-next-btn, .conv-scroll-segment-btn) span {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  :is(.conv-scroll-end-btn, .conv-scroll-last-btn, .conv-scroll-next-btn, .conv-scroll-segment-btn) svg { width: 18px; height: 18px; }
}

/* Queues page: inline add form under the header. */
.ao-q-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin: 0 0 12px; }
.ao-q-add[hidden] { display: none; }
.ao-q-add .settings-text-input, .ao-q-add .settings-select { width: 100%; box-sizing: border-box; }
.ao-q-add-status { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); }
.ao-q-add-status:empty { display: none; }
@media (max-width: 700px) { .ao-q-add { grid-template-columns: 1fr; } .ao-q-add :is(input, select, button) { min-height: 44px; } }

/* Usage & budgets: limits appear only while sessions wait. */
#settingsSection-limits.ccc-limits-empty { display: none !important; }
#cfgConsentModal .settings-scope-container { display: none !important; }

/* Appearance: theme, font, font size, simple mode first; the rest after. */
#settingsPane #appearancePopover.is-active-section { display: flex !important; flex-direction: column; }
#appearancePopover > * { order: 10; }
#appearancePopover > .settings-section-eyebrow { order: 0; }
#appearancePopover > .settings-reset-row { order: 20; }
#appearancePopover > [data-context-home="reader"] { order: 3; }

/* One "Reset all settings" lives on Advanced; per-page resets are hidden. */
#settingsPane :is(.settings-reset-row, [data-reset-list], [aria-label="Reset conversation text size"]) { display: none !important; }
#settingsSection-layout > .settings-section-eyebrow { display: none; }
/* Advanced → Preferences is one row: Export and Import. The review tables,
   history, host profiles and selective resets stay out of sight.
   Scoped to the consolidated Settings page (data-destination). */
#settingsPane #settingsSection-preferences[data-destination] > :not(.ccc-prefs-row):not([data-pref-preview]):not([data-pref-status].is-error) { display: none !important; }
#settingsPane #settingsSection-preferences[data-destination] .ccc-prefs-actions { margin: 0; }
#settingsPane #settingsSection-preferences[data-destination] .ccc-prefs-actions > :not([data-pref-action="export"]):not([data-pref-action="pick"]) { display: none !important; }
#settingsPane #settingsSection-preferences[data-destination] [data-pref-preview] > p { display: none; }
/* Repositories page: the avatar editor sits open with no extra heading. */
#settingsSection-repositories [data-context-preferences] > summary { display: none; }
/* Agents: one-click setup chips, with the fine-tuning selects on the line below. */
.agents-overview .ao-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1 1 0; }
.agents-overview .ao-def-fine { margin: -2px 0 8px; }
.agents-overview .ao-def-fine [data-ao-apply-all] { margin-left: auto; }
/* Queues: name, engine, model, effort on one row. */
.agents-overview .ao-q { grid-template-columns: minmax(110px, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.8fr); }
.agents-overview .ao-q select.ao-q-select { min-width: 0; max-width: 100%; width: 100%; }
@media (max-width: 700px) { .agents-overview .ao-q { grid-template-columns: 1fr; } }
/* Agents: the fallback editor sits on the page without its intro prose. */
.settings-modal:not(.is-first-run) #settingsSection-routing > .settings-section-note,
.settings-modal:not(.is-first-run) #settingsSection-routing #routingPolicyScope { display: none; }

/* Repositories page: one row per repository, no picker. */
#settingsSection-repositories [data-context-home="repo"] { display: none; }
.repo-settings-add { display: flex; gap: 8px; align-items: center; padding: 4px 0 10px; }
.repo-settings-add .settings-text-input { flex: 1 1 auto; min-width: 0; }
.repo-settings-row .settings-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.repo-settings-row .repo-settings-name { display: flex; flex-direction: column; min-width: 0; }
.repo-settings-row .repo-settings-name .settings-row-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-settings-row .repo-settings-mode { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
#settingsSection-repositories > :not(h2):not(#repoSettingsList) { display: none; }
/* Settings shows controls, not collapsed explanations. */
#settingsPane[data-settings-flat] details.choice-eligibility,
#settingsPane[data-settings-flat] #capabilityRows details { display: none; }

/* Engine setup opens in place on the Engines page, not as a pop-up. */
.ao-setup-overlay.ao-setup-inline { position: static; inset: auto; display: block; background: none; padding: 12px 0 0; }
.ao-setup-overlay.ao-setup-inline .ao-setup-card { width: auto; max-height: none; box-shadow: none; }
.ao-setup-overlay.ao-setup-inline .ao-setup-body { overflow: visible; }
#settingsPane[data-settings-flat] .settings-row:has(> .settings-row-control > #configConsentBtn), #settingsPane[data-settings-flat] .settings-row:has(#configConsentBtn):not(:has([data-cfgc-group])) { display: none; }

/* Dialogs opened from Settings render in place under their row. */
.upd-overlay.settings-inline-dialog.open { position: static; inset: auto; z-index: auto; display: block; }
.upd-overlay.settings-inline-dialog .upd-backdrop { display: none; }
.upd-overlay.settings-inline-dialog .upd-dialog { width: auto !important; max-height: none !important; overflow: visible !important; box-shadow: none; margin: 8px 0 12px; }

/* Local CI sits beneath the identity and disappears when runners are idle. */
.local-ci-progress { width: 100%; min-width: 0; margin-top: 7px; }
.local-ci-progress[hidden] { display: none; }
.local-ci-job { display: block; color: var(--text); text-decoration: none; padding: 3px 0; }
.local-ci-job + .local-ci-job { margin-top: 5px; }
a.local-ci-job:hover { color: var(--accent); }
.local-ci-label { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; line-height: 1.5; }
.local-ci-name, .local-ci-step { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.local-ci-percent { flex: none; font-variant-numeric: tabular-nums; }
.local-ci-job progress { display: block; width: 100%; height: 4px; margin: 3px 0; border: 0; border-radius: 2px; overflow: hidden; background: var(--border); accent-color: var(--accent); }
.local-ci-job progress::-webkit-progress-bar { background: var(--border); }
.local-ci-job progress::-webkit-progress-value { background: var(--accent); }
.local-ci-job progress::-moz-progress-bar { background: var(--accent); }
.local-ci-detail { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.local-ci-elapsed { flex: none; font-size: 11px; color: var(--text-secondary, var(--text)); font-variant-numeric: tabular-nums; }
.local-ci-step { display: block; font-size: 11px; color: var(--text-secondary, var(--text)); }
.local-ci-context { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--text-secondary, var(--text)); overflow-wrap: anywhere; }
.local-ci-group { display: flex; align-items: flex-start; gap: 4px; min-width: 0; --ci-color: var(--accent); }
.local-ci-commit { flex: 1; min-width: 0; }
.local-ci-summary { display: flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; font-size: 11px; list-style: none; }
.local-ci-summary::-webkit-details-marker { display: none; }
.local-ci-summary::before { content: ''; flex: 0 0 5px; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); }
.local-ci-commit[open] > .local-ci-summary::before { transform: rotate(45deg); }
.local-ci-summary-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-ci-runner { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--text-secondary, var(--text)); }
.local-ci-runner svg { display: block; width: 14px; height: 14px; }
.local-ci-summary-status { flex: none; color: var(--ci-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.local-ci-overall-progress { flex: 0 0 32px; width: 32px; height: 4px; margin: 0; appearance: none; border: 0; border-radius: 2px; overflow: hidden; background: var(--border); accent-color: var(--ci-color); }
.local-ci-overall-progress::-webkit-progress-bar { background: var(--border); }
.local-ci-overall-progress::-webkit-progress-value { background: var(--ci-color); }
.local-ci-overall-progress::-moz-progress-bar { background: var(--ci-color); }
.local-ci-group[data-outcome="failure"] { --ci-color: var(--red); }
.local-ci-group[data-outcome="success"] { --ci-color: var(--green); }
.local-ci-group[data-outcome="neutral"] { --ci-color: var(--text-muted); }
.local-ci-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.local-ci-checks { padding: 3px 0 6px 10px; }
@media (max-width: 1200px) { .local-ci-summary { min-height: 44px; font-size: 12px; } }

#ciRunnerSetupStatus ul { padding-inline-start: 20px; line-height: 1.6; }

.settings-rail-item[data-section-target="ci-runners"] { text-transform: none; }
#ciRunnerLaunchStatus { margin-top: 10px; font-size: 12px; line-height: 1.5; }

.ci-runner-diagnostics { margin-top: 18px; }
.ci-runner-diagnostics summary { cursor: pointer; color: var(--text); }

.local-ci-progress { max-height: 230px; overflow-y: auto; flex-shrink: 0; }
.local-ci-entry { display: flex; align-items: center; gap: 6px; --ci-color: var(--accent); }
.local-ci-entry + .local-ci-entry { margin-top: 5px; }
.local-ci-entry .local-ci-job { flex: 1 1 0; min-width: 0; }
.local-ci-job:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.local-ci-entry[data-outcome="success"] { --ci-color: var(--green); }
.local-ci-entry[data-outcome="failure"] { --ci-color: var(--red); }
.local-ci-entry[data-outcome="neutral"] { --ci-color: var(--text-muted); }
.local-ci-entry .local-ci-percent { color: var(--ci-color); }
.local-ci-entry progress { accent-color: var(--ci-color); }
.local-ci-entry progress::-webkit-progress-value { background: var(--ci-color); }
.local-ci-entry progress::-moz-progress-bar { background: var(--ci-color); }
.local-ci-dismiss { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 32px; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); cursor: pointer; }
.local-ci-dismiss:hover { background: var(--surface-2); color: var(--text); }
.local-ci-dismiss:disabled { opacity: .5; cursor: wait; }
.local-ci-mobile { display: none; }
/* The header status line replaced the stacked desktop list at every width. */
#localCiProgress { display: none !important; }
.local-ci-mobile-toggle {
  display: flex; align-items: center; gap: 6px; width: auto; min-height: 22px;
  padding: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 11px; text-align: left; cursor: pointer;
  white-space: nowrap;
}
.local-ci-mobile-toggle::before {
  content: ''; flex: 0 0 5px; width: 5px; height: 5px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
}
.local-ci-mobile-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.local-ci-mobile-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.local-ci-mobile:not(.is-expanded) > :not(.local-ci-mobile-toggle) { display: none !important; }
@media (max-width: 1200px) {
  body .sidebar > #localCiMobileList:not([hidden]),
  body .main > #localCiMobileReader:not([hidden]),
  body.ccc-mobile-redesign.ccc-simple-mode .sidebar > #localCiMobileList:not([hidden]) {
    display: block !important; flex: 0 0 auto; width: 100%; margin: 0; padding: 6px 12px;
    max-height: 28vh; overflow-y: auto; border-bottom: 1px solid var(--border); background: var(--surface);
  }
  .local-ci-mobile .local-ci-label, .local-ci-mobile .local-ci-step { font-size: 12px; }
  .local-ci-mobile .local-ci-dismiss { flex-basis: 44px; width: 44px; height: 44px; }
  .local-ci-mobile-toggle { gap: 8px; width: 100%; min-height: 44px; font-size: 12px; }
  .local-ci-mobile-toggle > span { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .local-ci-inline-run, .local-ci-inline-run .local-ci-elapsed { font-size: 12px; }
  body :is(.sidebar > #localCiMobileList, .main > #localCiMobileReader):not([hidden]):not(.is-expanded) { padding-top: 0; padding-bottom: 0; }
}
@media (max-width: 700px) {
  /* Successful checks remain in the list; the reader only needs running or
     unsuccessful checks. Do not reserve an empty strip when all passed. */
  #localCiMobileReader > .local-ci-group[data-outcome="success"] { display: none; }
  body .main > #localCiMobileReader:not([hidden]):not(:has(> :is(.local-ci-group, .local-ci-entry):not([data-outcome="success"]))) { display: none !important; }
}
.session-ref-chip {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: .9em;
  overflow-wrap: anywhere;
  vertical-align: baseline;
  text-decoration: none;
}
.session-ref-chip:hover { text-decoration: underline; }
.session-ref-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A represented ticket owns its session tree; unmatched sessions stay below. */
.conv-workers-activity .fq-recent-state.is-working { color: var(--green); font-weight: 700; }
.conv-workers-activity .fq-recent-state.is-needs-you { color: var(--orange); font-weight: 700; }
.workers-ticket-entry { min-width: 0; border-bottom: 1px solid var(--border); }
.conv-workers-activity .workers-ticket-entry .fq-recent-row { border-bottom: 0; }
 .workers-ticket-heading { display: flex; align-items: center; gap: 6px; min-width: 0; }
.workers-ticket-heading .fq-recent-row { flex: 1 1 auto; min-width: 0; }
.workers-ticket-toggle {
  flex: 0 0 auto; padding: 3px 5px; font: inherit; font-size: 10px;
  color: var(--accent); background: transparent; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px; white-space: nowrap;
}
.workers-ticket-toggle[aria-expanded="true"], .workers-ticket-toggle:hover { background: var(--surface-2); }
.workers-ticket-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.workers-ticket-session-body { min-width: 0; }
.workers-ticket-session-body .conv-subagent-cluster-body { display: block !important; }
.workers-ticket-session-body [data-role="subagent-cluster-toggle"] { display: none !important; }
.conv-workers-activity .fq-recent-rows:has(.workers-ticket-session-body:not([hidden])) { max-height: 60vh; }

#convList.workers-view { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
#convList.workers-view > .conv-tab-bar { flex: 0 0 auto; }
#convList.workers-view > .conv-archived-section {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden;
}
#convList.workers-view .conv-workers-activity,
#convList.workers-view .conv-archived-tools,
#convList.workers-view .conv-workers-uniform { flex: 0 0 auto; }
#convList.workers-view .conv-archived-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
#convList.workers-view .conv-workers-activity .fq-recent-rows { max-height: min(330px, 52.5vh); }
#convList.workers-view .conv-workers-activity .fq-recent-rows:has(.workers-ticket-session-body:not([hidden])) { max-height: 60vh; }

#convList.workers-view .fq-recent-row.is-brief { grid-template-columns: minmax(0, 1fr) auto; }
#convList.workers-view .workers-ticket-session-body[hidden] { display: none; }
@container sidebar (max-width: 420px) {
  .workers-ticket-entry.has-lanes .workers-ticket-heading { flex-wrap: wrap; }
  .workers-ticket-entry.has-lanes .workers-ticket-heading .fq-recent-row { flex-basis: 100%; }
  .workers-ticket-entry.has-lanes .workers-ticket-toggle { margin-bottom: 6px; }
}

.workers-ticket-update {
  margin: -3px 0 6px; font-size: 10px; line-height: 1.35; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.conv-workers-activity .fq-recent-row.is-brief .fq-recent-meta > .conv-working-age { display: inline-flex; }

/* Ticket details and session expansion have separate native controls. */
.workers-ticket-link, .workers-ticket-title {
  appearance: none; border: 0; border-radius: 0; padding: 0;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.workers-ticket-link { flex: 0 0 auto; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.workers-ticket-link:hover { text-decoration: underline; }
.fq-recent-row.is-brief .fq-recent-title { display: flex; align-items: baseline; gap: 4px; }
.workers-ticket-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-workers-ticket-row] { cursor: pointer; }
.workers-ticket-link:focus-visible, .workers-ticket-title:focus-visible {
  outline: 2px solid var(--accent, #58a6ff); outline-offset: 2px;
}
@container sidebar (max-width: 420px) {
  #convList.workers-view .workers-ticket-heading .fq-recent-row.is-brief { grid-template-columns: minmax(0, 1fr); }
}

/* Workers is a ticket list; independent sessions remain available elsewhere. */
#convList.workers-view .conv-archived-list,
#convList.workers-view .conv-archived-tools,
#convList.workers-view .conv-workers-uniform { display: none; }
#convList.workers-view .conv-workers-activity {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden;
}
#convList.workers-view .conv-workers-activity .fq-recent-work {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
}
#convList.workers-view .conv-workers-activity .fq-recent-rows {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain;
}
#convList.workers-view .conv-workers-activity .fq-recent-state.is-open { color: var(--red, #da3633); font-weight: 600; }
#convList.workers-view .conv-workers-activity .fq-recent-rows:has(.workers-ticket-session-body:not([hidden])) { max-height: none; }

.workers-awaiting { flex: 0 0 auto; min-width: 0; padding: 8px 0 10px; border-bottom: 1px solid var(--border); }
.workers-awaiting[hidden] { display: none; }
.workers-awaiting-label { margin-bottom: 6px; font-size: 11px; color: var(--text-secondary, var(--text)); }
.workers-awaiting-label span { margin-left: 4px; font-variant-numeric: tabular-nums; }
.workers-awaiting-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px; overscroll-behavior-x: contain; }
.workers-awaiting-chip { flex: 0 0 auto; min-height: 32px; padding: 4px 8px; font: inherit; font-size: 11px; color: var(--accent); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.workers-awaiting-chip:hover { background: var(--surface-2); }
.workers-awaiting-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.workers-pending-list { margin-top: 12px; }
.workers-pending-entry { padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.workers-pending-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.workers-pending-state, .workers-pending-meta, .workers-pending-entry p { font-size: 11px; line-height: 1.5; }
.workers-pending-state, .workers-pending-meta { color: var(--text-secondary, var(--text)); }
.workers-pending-entry p { margin: 4px 0; color: var(--text-secondary, var(--text)); }
.workers-pending-state.is-active { color: var(--green); }
.workers-pending-state.is-delayed { color: var(--orange); }
.workers-pending-session { padding: 4px 8px; min-height: 32px; font: inherit; font-size: 11px; color: var(--accent); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.workers-pending-session:hover { background: var(--surface-2); }
.workers-pending-session:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Blocked tickets explain the next action; completed workers stay quiet. */
.workers-ticket-context { margin: 0 0 8px; min-width: 0; }
.workers-block-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.workers-block-category { display: inline-block; margin-inline-end: 6px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary, var(--text)); font-size: 10px; line-height: 1.4; vertical-align: baseline; }
.workers-ticket-context .workers-ticket-update { margin: 4px 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.workers-block-choice { max-width: 100%; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--accent); font: inherit; font-size: 11px; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.workers-block-choice:hover { background: var(--surface-2); }
.workers-block-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@container sidebar (max-width: 420px) { .workers-block-choice { min-height: 36px; } }

/* An app's agent pane (embed=app) is narrow, so the phone layout's rules
   apply to it. Those re-show the CI row and the session title bar with more
   specific selectors; this keeps the pane to one conversation and a composer. */
body.ccc-app-embed.conversation-popout .main > #localCiMobileReader,
body.ccc-app-embed.conversation-popout .main > #convToolbar,
body.ccc-app-embed.conversation-popout .main > .toolbar {
  display: none !important;
}

/* Home keeps the existing identity; operational details share one scrollable
   line instead of competing with the conversation for vertical space. */
.sidebar-header:has(> .mobile-home-status) { flex-wrap: wrap !important; }
.sidebar .mobile-home-status {
  display: flex; flex: 1 1 100%; align-items: center; gap: 12px;
  width: 100%; min-width: 0; min-height: 22px; flex-wrap: nowrap;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  white-space: nowrap;
}
.sidebar .mobile-home-status > #localCiMobileList:not([hidden]) {
  display: block !important; flex: 0 0 auto; width: max-content; max-width: none;
  margin: 0; padding: 0; border: 0; max-height: none; overflow: visible;
}
.sidebar .mobile-home-status > #headroomBars:not([hidden]) { display: block; flex: 0 0 auto; width: auto; margin: 0; }
.sidebar #headroomBars .hb-heading,
.sidebar #headroomBars .hb-bar,
.sidebar #headroomBars .hb-sub { display: none; }
.sidebar #headroomBars .hb-grid { display: flex; flex-wrap: nowrap; gap: 12px; }
.sidebar #headroomBars .hb-chip { display: flex; align-items: center; flex: 0 0 auto; padding: 0; }
.sidebar #headroomBars .hb-top { flex-wrap: nowrap; justify-content: flex-start; gap: 4px; }
.sidebar #headroomBars .hb-grid > .ccc-sav-ticker:not([hidden]) { display: inline-flex !important; padding: 0; border: 0; border-radius: 0; background: none; font-size: 11px; }
.sidebar #headroomBars .ccc-sav-ticker-spark { display: none; }
@media (max-width: 1200px) {
  .sidebar .sidebar-header { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px 0; }
  .sidebar .sidebar-header > .sidebar-header-brand { display: flex; order: -2; min-height: 44px; margin: 0; flex: 0 0 auto; }
  .sidebar .sidebar-header-brand .sh-title-row { gap: 8px; }
  .sidebar .sidebar-header-brand .sh-title-link { display: flex; }
  .sidebar .sidebar-header-brand .sh-app-icon { display: block; width: 28px; height: 28px; }
  .sidebar .sidebar-header-brand .sh-title-main {
    font-size: 17px; font-weight: 750; color: transparent; -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, #f0f6fc 0%, #58a6ff 42%, #bc8cff 74%, #3fb950 100%);
    background-clip: text; -webkit-background-clip: text;
  }
  .sidebar .mobile-home-status { order: -1; flex: 0 0 auto; min-height: 44px; scrollbar-width: thin; }
  .mobile-home-status .local-ci-mobile-toggle { width: auto; gap: 6px; }
  .mobile-home-status .local-ci-mobile-toggle > span { overflow: visible; }
  .sidebar #headroomBars .hb-chip { min-height: 44px; }
  .sidebar #headroomBars .hb-grid > .ccc-sav-ticker:not([hidden]) { min-height: 44px; font-size: 12px; }
  html body .main > #localCiMobileReader:not([hidden]) { display: none !important; }
  body.mobile-show-main .sidebar .sidebar-header { visibility: hidden; }
  .conv-input-bar .steer-btn { display: none !important; }
  html body .conv-split .conv-pane .conv-input-bar.visible { flex-shrink: 0; }
}

/* Swipes track directly, then settle; vertical scrolling retains ownership. */
@media (max-width: 1200px), (pointer: coarse) {
  :is(.conv-item, .simple-task-card[data-session-id]) { touch-action: pan-y; }
  :is(.conv-item, .simple-task-card).is-swipe-committed {
    position: relative; overflow: visible; z-index: 2;
    transform: translateX(var(--conv-row-swipe-offset, 0px));
    transition: none; box-shadow: none;
  }
  :is(.conv-item, .simple-task-card).is-swipe-committed::before {
    content: attr(data-swipe-action-label);
    position: absolute; inset-block: 0; right: 100%; width: 112px;
    display: flex; align-items: center; justify-content: center;
    padding: 10px; background: #164b48; color: #e2fffa;
    font-size: 12px; font-weight: 650; text-align: center;
  }
  :is(.conv-item, .simple-task-card).is-swipe-committed.is-swipe-left::before { right: auto; left: 100%; }
  :is(.conv-item, .simple-task-card).is-swipe-armed::before { background: #08786e; }
  :is(.conv-item, .simple-task-card).is-swipe-settling { transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
  .simple-card-archive-btn { border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.conv-item, .simple-task-card).is-swipe-settling { transition: none; }
}

.mobile-home-status .mobile-ci-details {
  position: fixed; z-index: 1100; left: 12px; right: 12px;
  max-height: min(50dvh, 360px); overflow-y: auto; white-space: normal;
  padding: 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); box-shadow: 0 8px 24px #0005;
}
.local-ci-inline-run[data-outcome="failure"] { color: var(--red); }
.local-ci-inline-run[data-outcome="active"] { color: var(--blue, #79a9dc); }
.local-ci-inline-run[data-outcome="success"] { color: var(--green); }
.mobile-home-quick { display: none; }
@media (max-width: 1200px) {
  body.mobile-home-collapsed .sidebar .mobile-home-status:not(.mobile-home-folding),
  body.mobile-home-collapsed .sidebar > .new-session-panel:not(.mobile-home-folding) {
    display: none !important;
  }
  .sidebar .mobile-home-folding {
    position: fixed; top: var(--mobile-home-fold-top); left: var(--mobile-home-fold-left);
    width: var(--mobile-home-fold-width); height: var(--mobile-home-fold-height);
    overflow: hidden !important; pointer-events: none;
  }
  .sidebar .mobile-home-list-moving {
    min-height: var(--mobile-home-fold-height); flex-shrink: 0;
    position: relative; z-index: 1; background: var(--surface); will-change: transform;
  }
  .sidebar:has(> .mobile-home-list-moving) > :not(.mobile-home-list-moving) { flex-shrink: 0; }
  .sidebar .mobile-home-status { flex-shrink: 0; }
  body.mobile-home-collapsed .sidebar .sidebar-header { padding-bottom: 4px; }
  body.mobile-home-collapsed .sidebar .sidebar-header-brand { width: 100%; }
  body.mobile-home-collapsed .sidebar .sh-title-link { margin-right: auto; }
  body.mobile-home-collapsed .mobile-home-quick {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0;
    border-radius: 50%; background: transparent; color: var(--text); font-size: 26px;
  }
  body.mobile-home-collapsed .mobile-home-search { font-size: 28px; }
  .mobile-home-quick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
}

.simple-card-archive-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.simple-card-archive-btn:disabled { opacity: .45; cursor: wait; }

.simple-card-archive-btn { border: 0; background: transparent; color: var(--text-muted); padding: 6px; border-radius: 6px; }
@media (max-width: 1200px) {
  body.ccc-mobile-redesign.ccc-simple-mode .msh-wordmark {
    font-size: 15px; font-weight: 750; color: transparent; -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, #f0f6fc 0%, #58a6ff 42%, #bc8cff 74%, #3fb950 100%);
    background-clip: text; -webkit-background-clip: text;
  }
  .sidebar #mobileSimpleHeader .mobile-home-status { width: calc(100% - 24px); margin-inline: 12px; }
  body.mobile-show-main .sidebar #mobileSimpleHeader { visibility: hidden; }
}
.mobile-home-status:not(:has(> :not([hidden]))) { display: none !important; }
.sidebar .worker-activity-line {
  display: flex; align-items: center; gap: 10px; flex: 0 0 100%;
  width: 100%; min-width: 0; min-height: 26px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
  white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--text); margin: 0;
}
.worker-activity-line > span { flex: 0 0 auto; }
.worker-activity-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.worker-activity-now { color: var(--green); font-weight: 600; }
.worker-activity-recent, .worker-activity-muted { color: var(--text-muted); }
.worker-activity-repo { color: var(--blue, var(--accent)); }
.worker-activity-line:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 1200px) {
  .sidebar .worker-activity-line { flex: 0 0 auto; min-height: 30px; font-size: 12px; order: -1; }
  .sidebar #mobileSimpleHeader .worker-activity-line { width: calc(100% - 24px); margin-inline: 12px; }
  body.mobile-home-collapsed .sidebar .worker-activity-line:not(.mobile-home-folding) { display: none !important; }
}
#convList.session-workspace .conv-item.is-swipe-settling { transition: transform 180ms cubic-bezier(.2,.8,.2,1) !important; }
@media (prefers-reduced-motion: reduce) {
  #convList.session-workspace .conv-item.is-swipe-settling { transition: none !important; }
}

/* Replay: a user-role message the owner did not type (injected brief, lane
   report, worker or peer message) arrives whole, sliding in from above,
   instead of being typed into the composer. */
.conv-replay-incoming {
  animation: conv-replay-incoming-in 0.45s ease-out;
}
@keyframes conv-replay-incoming-in {
  from { opacity: 0; transform: translateY(-10px); box-shadow: 0 0 0 2px var(--accent); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .conv-replay-incoming { animation: none; }
}

/* ── Workers vertical budget ───────────────────────────────────────────────
   Each ticket gets one line for identity (ref, title, state, age, session
   count) and at most one line for context (category, question, answers).
   tests/workers-row-budget.browser.cjs enforces this; a feature that needs
   more height asks the owner for budget instead of adding a line here. */
#convList.workers-view > .conv-archived-section { margin-top: 0; padding-top: 0; border-top: 0; }
#convList.workers-view .conv-workers-activity { margin: 0; }
#convList.workers-view .conv-workers-activity .fq-recent-work { padding: 0 10px; }
#convList.workers-view .conv-workers-activity .fq-recent-rows { margin-top: 0; }
#convList.workers-view .workers-awaiting {
  display: flex; align-items: center; gap: 8px; padding: 4px 0; min-width: 0;
}
#convList.workers-view .workers-awaiting[hidden] { display: none; }
#convList.workers-view .workers-awaiting-label { flex: 0 0 auto; margin: 0; white-space: nowrap; }
#convList.workers-view .workers-awaiting-chips { flex: 1 1 auto; min-width: 0; gap: 4px; padding: 1px; scrollbar-width: none; }
#convList.workers-view .workers-awaiting-chip { min-height: 0; padding: 1px 6px; font-size: 10.5px; }
#convList.workers-view .conv-workers-activity .workers-ticket-heading { flex-wrap: nowrap; }
#convList.workers-view .conv-workers-activity .workers-ticket-heading .fq-recent-row.is-brief {
  flex-basis: auto; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 5px 0 3px;
}
#convList.workers-view .conv-workers-activity .workers-ticket-entry.has-lanes .workers-ticket-toggle { margin: 0; }
#convList.workers-view .workers-ticket-toggle {
  min-width: 18px; padding: 0 4px; font-size: 10px; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums;
}
#convList.workers-view .workers-ticket-context {
  display: flex; align-items: center; gap: 6px; margin: 0 0 5px; min-width: 0;
}
#convList.workers-view .workers-ticket-context .workers-ticket-update {
  display: block; flex: 1 1 auto; min-width: 0; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset;
}
#convList.workers-view .workers-block-category { padding: 0 4px; font-size: 9.5px; line-height: 14px; margin-inline-end: 4px; }
#convList.workers-view .workers-block-choices {
  flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; gap: 4px; margin: 0; overflow: hidden;
}
#convList.workers-view .workers-ticket-context .workers-ticket-update { flex-basis: 30%; }
#convList.workers-view .workers-block-choice {
  flex: 0 1 auto; min-width: 4.5em; max-width: 120px; min-height: 0; padding: 0 6px; font-size: 10px; line-height: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Touch keeps a tappable target, still inside the two-line budget. */
@media (pointer: coarse) {
  #convList.workers-view .workers-block-choice { min-height: 28px; }
}

.local-ci-runner { white-space: nowrap; }
.local-ci-inline-icons { display: inline-flex; gap: 3px; margin-inline-end: 4px; vertical-align: middle; }
.local-ci-inline-icons svg { width: 13px; height: 13px; }

.local-ci-job-provider + .local-ci-name { flex: 1; min-width: 0; }

/* Turn provenance is distinct from process liveness and spawn ancestry. */
.conv-driver {display:inline-block;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;font:12px/1.4 var(--font-ui,system-ui);color:var(--text-secondary,var(--text));white-space:nowrap;vertical-align:middle}
.conv-driver-label {font-weight:500}
.conv-driver-owner {display:block;font-weight:400}
.conv-pane-driver {min-width:0;flex:0 1 260px}
.conv-pane-driver[hidden] {display:none}
.conv-meta-col>.conv-driver {margin:2px 6px}
.wa-row-footer>.conv-driver {flex:0 1 auto}
.conv-pane-driver>.conv-driver, #cccBreadcrumb>.conv-driver {white-space:normal}
#mobileConvTitle>.conv-driver, #simpleConvTitle>.conv-driver {display:block;margin-top:3px;font-size:12px;line-height:1.35;white-space:normal}
.mobile-conv-name {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:1200px) {.conv-pane-driver {flex-basis:180px}}

/* Recorded session inputs in ticket detail. */
.uxq-session-activity summary { cursor: pointer; }
.uxq-session-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.uxq-session-controls label { display: flex; align-items: center; gap: 8px; }
.uxq-session-record { padding: 12px 0; border-top: 1px solid var(--border); }
.uxq-session-record > summary { display: list-item; overflow-wrap: anywhere; }
.uxq-session-record p { margin: 8px 0; }
.uxq-session-record dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.uxq-session-record dd { margin: 0; }
.uxq-session-events { overflow-x: auto; margin-top: 12px; }
.uxq-session-events table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.uxq-session-events th, .uxq-session-events td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.uxq-session-events caption { text-align: left; padding-bottom: 8px; }
.uxq-session-record > summary > span + span { display: block; margin-top: 4px; }
.uxq-session-events table { min-width: 700px; }
.uxq-session-events th:first-child, .uxq-session-events td:first-child { white-space: nowrap; }
.uxq-session-events th:nth-child(3), .uxq-session-events td:nth-child(3) { white-space: nowrap; text-align: right; }

  .sidebar-read-pause {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding: 6px 12px;
    color: var(--text);
    background: var(--surface-2);
    font-size: 12px;
  }
  .sidebar-read-pause[hidden] { display: none; }
  .sidebar-read-pause button {
    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
  }
  .sidebar-read-pause button:hover { background: var(--surface); }
