/* Agent Friends web app.
   One stylesheet, no external resources: the font (Inter, OFL) and the icons (Lucide, ISC) are served
   from this server. Light and dark follow the system setting. Icons are CSS masks over currentColor,
   so a <span class="icon i-name"> takes the colour of the text around it. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #f7f6f3; --surface: #ffffff; --surface-2: #f2f1ed; --surface-3: #e8e6e0; --hover: #efeee9;
  --ink: #171614; --ink-2: #3d3a35; --muted: #6f6a62; --faint: #a19b91;
  --line: #e6e3dc; --line-strong: #d4d0c6;
  --primary: #171614; --primary-hover: #33302b; --primary-ink: #ffffff;
  --accent: #e0a800; --accent-hover: #c79500; --accent-ink: #171614; --accent-soft: #fff4c7; --accent-line: #f0d77a;
  --link: #1f56c4;
  --ok: #1a7f45; --ok-soft: #e6f4eb; --warn: #a65a00; --warn-soft: #fcf0dc; --bad: #c93434; --bad-soft: #fbe9e8;
  --agent: #6d3fd1; --agent-soft: #f1ebfc;
  --hl-k: #8a3ab9; --hl-s: #2f7a3b; --hl-c: #8b8679; --hl-n: #b25b00; --hl-add: #1a7f45; --hl-add-bg: #e6f4eb; --hl-del: #c93434; --hl-del-bg: #fbe9e8;
  --code-bg: #f6f5f1; --code-line: #e7e4dc; --mark: #ffe680; --mark-ink: #171614; --cache: #c9c3b6;
  --t-claude-code: #c8643b; --t-codex: #0f7f73; --t-opencode: #4b5563; --t-chatgpt: #15803d; --t-claude-ai: #b4572f;
  --t-assistant: #171614; --t-other: #6b7280;
  --radius-s: 5px; --radius: 8px; --radius-l: 10px;
  --shadow-s: none;
  --shadow: 0 1px 0 rgba(23, 22, 20, .04);
  --shadow-l: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", Charter, "Palatino Linotype", Palatino, "Source Serif 4", "Book Antiqua", Georgia, serif;
  --sidebar: 236px; --rail: 56px; --list: 380px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #121110; --surface: #1a1917; --surface-2: #211f1c; --surface-3: #2a2824; --hover: #242220;
    --ink: #eceae5; --ink-2: #cbc7be; --muted: #9b958a; --faint: #6e695f;
    --line: #2b2925; --line-strong: #38352f;
    --primary: #eceae5; --primary-hover: #ffffff; --primary-ink: #121110;
    --accent: #f5c518; --accent-hover: #ffd84d; --accent-ink: #121110; --accent-soft: #332a0b; --accent-line: #5c4b12;
    --link: #8ab4ff;
    --ok: #4cc782; --ok-soft: #132519; --warn: #f0b247; --warn-soft: #2c2210; --bad: #f2716b; --bad-soft: #2e1816;
    --agent: #b49cff; --agent-soft: #241d36;
    --hl-k: #c792ea; --hl-s: #8fcf8f; --hl-c: #7d786d; --hl-n: #f0a35e; --hl-add: #6fd39a; --hl-add-bg: #132519; --hl-del: #f2847e; --hl-del-bg: #2e1816;
    --code-bg: #161513; --code-line: #2a2824; --mark: #6b5600; --mark-ink: #fff6cf; --cache: #4a463d;
    --t-claude-code: #e08a62; --t-codex: #3cc4b4; --t-opencode: #a3acb9; --t-chatgpt: #4cc782; --t-claude-ai: #dc8a63;
    --t-assistant: #eceae5; --t-other: #9ca3af;
    --shadow-s: none; --shadow: none; --shadow-l: 0 16px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme=dark] {
    --bg: #121110; --surface: #1a1917; --surface-2: #211f1c; --surface-3: #2a2824; --hover: #242220;
    --ink: #eceae5; --ink-2: #cbc7be; --muted: #9b958a; --faint: #6e695f;
    --line: #2b2925; --line-strong: #38352f;
    --primary: #eceae5; --primary-hover: #ffffff; --primary-ink: #121110;
    --accent: #f5c518; --accent-hover: #ffd84d; --accent-ink: #121110; --accent-soft: #332a0b; --accent-line: #5c4b12;
    --link: #8ab4ff;
    --ok: #4cc782; --ok-soft: #132519; --warn: #f0b247; --warn-soft: #2c2210; --bad: #f2716b; --bad-soft: #2e1816;
    --agent: #b49cff; --agent-soft: #241d36;
    --hl-k: #c792ea; --hl-s: #8fcf8f; --hl-c: #7d786d; --hl-n: #f0a35e; --hl-add: #6fd39a; --hl-add-bg: #132519; --hl-del: #f2847e; --hl-del-bg: #2e1816;
    --code-bg: #161513; --code-line: #2a2824; --mark: #6b5600; --mark-ink: #fff6cf; --cache: #4a463d;
    --t-claude-code: #e08a62; --t-codex: #3cc4b4; --t-opencode: #a3acb9; --t-chatgpt: #4cc782; --t-claude-ai: #dc8a63;
    --t-assistant: #eceae5; --t-other: #9ca3af;
    --shadow-s: none; --shadow: none; --shadow-l: 0 16px 40px rgba(0, 0, 0, .5);
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }

/* ---- base ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 14.5px/1.55 var(--font); overflow-x: clip;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; letter-spacing: -.01em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--mark); color: var(--mark-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
code, .mono { font-family: var(--mono); font-size: .9em; }

.icon {
  display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor; vertical-align: -3px;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.icon.lg { width: 20px; height: 20px; }
.icon.sm { width: 14px; height: 14px; vertical-align: -2px; }
.i-message-square { --i: url(/icons/message-square.svg); } .i-sparkles { --i: url(/icons/sparkles.svg); }
.i-git-fork { --i: url(/icons/git-fork.svg); } .i-gauge { --i: url(/icons/gauge.svg); }
.i-activity { --i: url(/icons/activity.svg); }
.i-folder-kanban { --i: url(/icons/folder-kanban.svg); } .i-monitor { --i: url(/icons/monitor.svg); }
.i-laptop { --i: url(/icons/laptop.svg); } .i-plug { --i: url(/icons/plug.svg); }
.i-chart-column { --i: url(/icons/chart-column.svg); } .i-monitor-smartphone { --i: url(/icons/monitor-smartphone.svg); }
.i-shield { --i: url(/icons/shield.svg); } .i-building-2 { --i: url(/icons/building-2.svg); }
.i-inbox { --i: url(/icons/inbox.svg); } .i-log-out { --i: url(/icons/log-out.svg); }
.i-search { --i: url(/icons/search.svg); } .i-x { --i: url(/icons/x.svg); }
.i-chevron-down { --i: url(/icons/chevron-down.svg); } .i-chevron-right { --i: url(/icons/chevron-right.svg); }
.i-chevron-left { --i: url(/icons/chevron-left.svg); } .i-arrow-left { --i: url(/icons/arrow-left.svg); }
.i-copy { --i: url(/icons/copy.svg); } .i-check { --i: url(/icons/check.svg); }
.i-trash-2 { --i: url(/icons/trash-2.svg); } .i-terminal { --i: url(/icons/terminal.svg); }
.i-file-text { --i: url(/icons/file-text.svg); } .i-pencil { --i: url(/icons/pencil.svg); }
.i-globe { --i: url(/icons/globe.svg); } .i-list-todo { --i: url(/icons/list-todo.svg); }
.i-bot { --i: url(/icons/bot.svg); } .i-brain { --i: url(/icons/brain.svg); }
.i-wrench { --i: url(/icons/wrench.svg); } .i-circle-alert { --i: url(/icons/circle-alert.svg); }
.i-info { --i: url(/icons/info.svg); } .i-git-branch { --i: url(/icons/git-branch.svg); }
.i-folder { --i: url(/icons/folder.svg); } .i-clock { --i: url(/icons/clock.svg); }
.i-hash { --i: url(/icons/hash.svg); } .i-coins { --i: url(/icons/coins.svg); }
.i-upload { --i: url(/icons/upload.svg); } .i-download { --i: url(/icons/download.svg); }
.i-settings { --i: url(/icons/settings.svg); } .i-ellipsis { --i: url(/icons/ellipsis.svg); }
.i-user { --i: url(/icons/user.svg); } .i-send-horizontal { --i: url(/icons/send-horizontal.svg); }
.i-refresh-cw { --i: url(/icons/refresh-cw.svg); } .i-play { --i: url(/icons/play.svg); }
.i-square { --i: url(/icons/square.svg); } .i-circle-check { --i: url(/icons/circle-check.svg); }
.i-triangle-alert { --i: url(/icons/triangle-alert.svg); } .i-menu { --i: url(/icons/menu.svg); }
.i-funnel { --i: url(/icons/funnel.svg); } .i-arrow-down { --i: url(/icons/arrow-down.svg); } .i-arrow-up { --i: url(/icons/arrow-up.svg); } .i-square-pen { --i: url(/icons/square-pen.svg); }
.i-pin { --i: url(/icons/pin.svg); } .i-archive { --i: url(/icons/archive.svg); } .i-mic { --i: url(/icons/mic.svg); } .i-paperclip { --i: url(/icons/paperclip.svg); } .i-git-pull-request { --i: url(/icons/git-pull-request.svg); } .i-git-commit-horizontal { --i: url(/icons/git-commit-horizontal.svg); } .i-file-diff { --i: url(/icons/file-diff.svg); } .i-image { --i: url(/icons/image.svg); } .i-minimize-2 { --i: url(/icons/minimize-2.svg); }
.i-external-link { --i: url(/icons/external-link.svg); } .i-file-search { --i: url(/icons/file-search.svg); }
.i-file-pen-line { --i: url(/icons/file-pen-line.svg); } .i-circle-stop { --i: url(/icons/circle-stop.svg); }
.i-messages-square { --i: url(/icons/messages-square.svg); } .i-sliders-horizontal { --i: url(/icons/sliders-horizontal.svg); }
.i-arrow-up-right { --i: url(/icons/arrow-up-right.svg); } .i-history { --i: url(/icons/history.svg); }

/* ---- controls ---- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 13px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink);
  font-weight: 550; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-s); transition: background .12s, border-color .12s, color .12s;
}
button:hover, .button:hover { background: var(--hover); text-decoration: none; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger-quiet { color: var(--bad); }
button.danger-quiet:hover { background: var(--bad-soft); border-color: var(--bad); }
button.quiet, .button.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
button.quiet:hover, .button.quiet:hover { background: var(--hover); }
button.small, .button.small { min-height: 28px; padding: 3px 9px; font-size: 12.5px; border-radius: 7px; }
.big { min-height: 42px; padding: 10px 18px; font-size: 15px; }
.icon-button {
  width: 32px; height: 32px; min-height: 32px; padding: 0; border-color: transparent; background: transparent;
  box-shadow: none; color: var(--muted); border-radius: 8px;
}
.icon-button:hover { color: var(--ink); background: var(--hover); }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}

input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--accent); box-shadow: none; }
input[type=file] { padding: 6px; background: var(--surface-2); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 550; font-size: 13px; margin-right: 10px; padding: 5px 12px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
}

/* ---- small text helpers ---- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.num, .chat-when, .meta-count, .rec-time, .live-stats, .ctx, .ctx-meter, .data-table, .list-title .muted, .day-val, .live-clock { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.push { margin-left: auto; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .bad-text { color: var(--bad); }
.empty { color: var(--muted); padding: 6px 0; margin: 0; }
.note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin: 0; }
.loading { color: var(--muted); margin: 10px 0; display: flex; align-items: center; gap: 8px; }
.loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong);
  border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } * { transition: none !important; } }

/* ---- the app frame: sidebar, content, tab bar ---- */
.app { min-height: 100%; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app:has(> .sidebar[hidden]) { grid-template-columns: minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 10px 10px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 14px 7px; white-space: nowrap; color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 22px; height: 22px; flex: none; position: relative; }
.logo-mark::before, .logo-mark::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 4px; }
.logo-mark::before { left: 0; top: 0; background: var(--ink); }
.logo-mark::after { right: 0; bottom: 0; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.side-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
button.nav-item { border: 0; background: transparent; box-shadow: none; min-height: 0; justify-content: flex-start; text-align: left; margin-top: auto; }
button.nav-item:hover { background: var(--hover); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2);
  font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-item[aria-current=page] { background: var(--surface-3); color: var(--ink); font-weight: 600; }
.nav-item[aria-current=page] .icon { color: var(--ink); }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 10px; }
.nav-heading { margin: 14px 10px 4px; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px 4px; border-top: 1px solid var(--line); margin-top: 8px; min-width: 0; }
.avatar {
  width: 28px; height: 28px; border-radius: 6px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 750; font-size: 13px;
}
.me-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.me-name { font-weight: 600; font-size: 13px; }
.me-email { color: var(--muted); font-size: 12px; }
.theme-switch { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); margin: 6px 4px 0; }
.theme-switch button { flex: 1; min-height: 26px; height: 26px; padding: 0 6px; font-size: 11.5px; border: 0; box-shadow: none; background: transparent; color: var(--muted); border-radius: 6px; }
.theme-switch button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.banner { background: var(--bad-soft); color: var(--ink); border-bottom: 1px solid var(--bad); padding: 10px 24px; }
.tabbar { display: none; }

/* ---- page ---- */
.main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 32px 80px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.main:focus { outline: none; }
.main.full { max-width: none; padding: 0; gap: 0; flex: 1 1 0; min-height: 0; }
/* the chats screen fills the window and its two panes scroll on their own (so the composer can stick) */
.content:has(> .main.full) { height: 100vh; height: 100dvh; min-height: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 2px; }
.page-head h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -.022em; }
.page-sub { margin: -8px 0 4px; color: var(--muted); max-width: 70ch; }
.page-extra { margin-left: auto; display: flex; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; font-weight: 650; margin: 0; }
.panel h2 { font-size: 15px; font-weight: 650; }
.panel h3 { font-size: 13.5px; font-weight: 650; }
.panel-error {
  background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); color: var(--ink);
  border-radius: 8px; padding: 9px 12px; margin: 0 0 10px; font-size: 13.5px; overflow-wrap: anywhere;
}
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.form-msg { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.form-msg:empty { display: none; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; width: auto; }
.inline-form select { width: auto; flex: none; }
.stack-form { display: grid; gap: 12px; }
.stack-form label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.stack-form input { max-width: 380px; }
.empty-state { padding: 28px 12px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty-state h2 { font-size: 16px; margin: 0; color: var(--ink); }
.empty-state p { margin: 0; max-width: 46ch; }
.empty-state .cmd { text-align: left; width: 100%; max-width: 520px; }
.empty-icon { display: grid; place-items: center; color: var(--faint); margin-bottom: 2px; }
.empty-icon .icon { width: 22px; height: 22px; }
.callout { border-radius: 8px; padding: 7px 11px; font-size: 13.5px; }
.callout.block { padding: 11px 14px; border: 1px solid transparent; display: block; }
.callout.block p { margin: 0 0 6px; }
.callout.block p:last-child { margin: 0; }
.callout.info { background: var(--surface-2); color: var(--ink-2); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout.ok { background: var(--ok-soft); color: var(--ink); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; border-radius: 4px;
  padding: 1px 7px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; line-height: 18px;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.working { background: var(--ok-soft); color: var(--ok); }
.tag.sub { background: var(--agent-soft); color: var(--agent); }
.tag.tool { background: color-mix(in srgb, var(--tc, var(--t-other)) 14%, transparent); color: var(--tc, var(--t-other)); }
.t-claude-code { --tc: var(--t-claude-code); } .t-codex { --tc: var(--t-codex); } .t-opencode { --tc: var(--t-opencode); }
.t-chatgpt { --tc: var(--t-chatgpt); } .t-claude-ai { --tc: var(--t-claude-ai); } .t-assistant { --tc: var(--t-assistant); }
.t-other { --tc: var(--t-other); }
.more { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.more:empty { display: none; }
.more .panel-error { flex: 1; }
.load-more { min-width: 200px; }
.cmd {
  display: flex; align-items: center; gap: 6px; background: var(--code-bg); border: 1px solid var(--code-line);
  border-radius: 8px; padding: 4px 4px 4px 12px; margin: 6px 0; min-width: 0;
}
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 5px 0; font-size: 12.5px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.dot.on { background: var(--ok); }
.dot.off { background: var(--faint); }
.dot.ended { background: var(--line-strong); }
mark { background: var(--mark); color: var(--mark-ink); border-radius: 3px; padding: 0 2px; }

/* ---- sign-in ---- */
.signin { max-width: 420px; margin: 12vh auto 40px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 32px; box-shadow: var(--shadow); }
.signin .logo-mark { width: 36px; height: 36px; margin-bottom: 20px; }
.signin .logo-mark::before, .signin .logo-mark::after { width: 25px; height: 25px; border-radius: 6px; }
.signin h1 { font-size: 22px; margin: 0 0 6px; }
.signin-methods { display: grid; gap: 12px; margin-top: 24px; }
.signin-methods .button.primary { width: 100%; }
.signin-form { display: grid; gap: 6px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.signin-form .row { flex-wrap: nowrap; }
.signin-form input { flex: 1; }

/* ---- chats: two panes ---- */
.split { display: grid; grid-template-columns: var(--list) minmax(0, 1fr); height: 100%; min-height: 0; }
.list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.list-head { padding: 18px 16px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.list-title { display: flex; align-items: baseline; gap: 8px; }
.list-title h1 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -.018em; }
.list-title .muted { font-size: 13px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field .icon { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.search-field input { padding-left: 34px; padding-right: 34px; background: var(--surface-2); border-color: transparent; }
.search-field input:focus { background: var(--surface); }
.search-field .clear { position: absolute; right: 3px; width: 30px; height: 30px; min-height: 30px; }
.chips { display: grid; gap: 6px; min-width: 0; }
.chip-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; min-width: 0; padding-bottom: 1px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > * { flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 550;
  box-shadow: none; cursor: pointer;
}
.chip:hover { background: var(--hover); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--tc, var(--faint)); flex: none; }
.chip .n { color: var(--faint); font-weight: 500; }
.chip[aria-pressed=true] .n { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.chip.picker { padding-right: 7px; }
.chip.picker .icon { width: 13px; height: 13px; }
.chip.picker.set { border-color: var(--ink-2); color: var(--ink); background: var(--accent-soft); }
.popover {
  position: fixed; left: var(--x, 16px); top: var(--y, 120px); z-index: 30; width: 280px; max-width: calc(100vw - 24px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-l); padding: 6px; display: grid; gap: 4px;
}
.popover input { min-height: 32px; }
.popover-list { max-height: 300px; overflow: auto; display: grid; gap: 1px; }
.popover-item {
  display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-start; min-height: 32px; padding: 5px 9px;
  border: 0; border-radius: 6px; background: transparent; box-shadow: none; font-weight: 500; color: var(--ink);
}
.popover-item:hover, .popover-item:focus-visible { background: var(--hover); }
.popover-item[aria-selected=true] { font-weight: 650; background: var(--surface-2); }
.popover-item .n { margin-left: auto; color: var(--faint); font-size: 12px; }
.popover-wrap { position: relative; }
.list-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 8px 16px; }
.list-scroll > .empty-state, .list-scroll > .panel-error, .list-scroll > .loading { margin: 12px 8px; }
.list-panel { display: contents; }
.group-label { margin: 18px 10px 4px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.chat-list, .hit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.chat-link, .hit-link {
  display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 1px 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink); min-width: 0; align-items: start;
}
.chat-link:hover, .hit-link:hover { background: var(--hover); text-decoration: none; }
.chat-link[aria-current=page], .hit-link[aria-current=page] { background: var(--surface-3); }
.tool-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--tc, var(--t-other)); flex: none; display: inline-block; }
.chat-link > .tool-mark, .hit-link > .tool-mark { margin-top: 7px; grid-row: span 2; }
.data-table .tool-mark, .panel-head > .tool-mark { margin-right: 8px; vertical-align: 1px; }
.chat-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.chat-title { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-when { flex: none; white-space: nowrap; color: var(--faint); font-size: 12px; }
.chat-meta { display: flex; gap: 2px 8px; align-items: center; color: var(--muted); font-size: 12px; min-width: 0; overflow: hidden; white-space: nowrap; }
.chat-meta .meta-item { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.meta-count { flex: none; margin-left: auto; color: var(--faint); font-size: 11.5px; }
.meta-count::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; background: currentColor;
  -webkit-mask: url(/icons/message-square.svg) center / contain no-repeat; mask: url(/icons/message-square.svg) center / contain no-repeat; }
.chat-meta .tag { display: none; }
.meta-item { overflow-wrap: anywhere; min-width: 0; }
.repo { font-family: inherit; }
.sub-session .chat-link { padding-left: 26px; }
.sub-session .tool-mark { opacity: .55; }
.sub-session .chat-title { font-weight: 500; color: var(--ink-2); }
.sub-hint { color: var(--agent); font-size: 12px; grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden-note { flex: 1 1 100%; }
.snippet { grid-column: 2; margin: 4px 0 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hit-link .chat-meta .meta-item { flex: none; }
.search-note { margin: 10px 10px 4px; font-size: 12px; color: var(--muted); }
.list-grip, .list-hide, .list-show { display: none; }
.list-show { position: absolute; left: 10px; top: 14px; z-index: 5; }
.detail-pane { min-width: 0; min-height: 0; overflow-y: auto; background: var(--bg); position: relative; overflow-anchor: none; }

/* ---- one chat ---- */
.chat-view { display: flex; flex-direction: column; min-height: 100%; }
.chat-bar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); min-width: 0;
}
.chat-bar .back-btn { display: none; }
.chat-bar-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-h1 { font-size: 15.5px; font-weight: 650; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { display: flex; gap: 4px 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; min-width: 0; }
.chat-sub span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chat-sub .icon { width: 13px; height: 13px; }
.chat-actions { display: flex; gap: 4px; flex: none; }
.chat-info { margin: 16px auto 0; width: calc(100% - 48px); max-width: 820px; }
.chat-head { display: contents; }
.back { margin: 0; }
.records {
  list-style: none; margin: 0 auto; padding: 20px 24px 28px; display: flex; flex-direction: column; gap: 18px;
  width: 100%; max-width: 816px; min-width: 0;
}
.chat-view > .more { padding: 0 24px; }
.load-more.earlier { min-width: 0; font-size: 12.5px; color: var(--muted); border-color: transparent; background: transparent; box-shadow: none; }
.chat-view > .more.top { padding-top: 16px; }
.chat-view > .more:last-child { padding-bottom: 40px; }
.rec { min-width: 0; scroll-margin: 90px 0; border-radius: var(--radius); }
.rec.hl, .step.hl { outline: 2px solid var(--accent); outline-offset: 4px; }
/* the conversation, as the apps lay it out: your messages in a bubble on the right, the answers as
   plain text across the column, the work in between folded into one quiet line */
.r-user { display: flex; justify-content: flex-end; margin-top: 8px; }
.r-user .bubble { background: var(--surface-3); color: var(--ink); border-radius: 18px; padding: 10px 16px; max-width: min(85%, 640px); }
.r-assistant .bubble { padding: 0 2px; }
.for-claude .r-user .bubble { border-radius: 14px; }
.for-gpt .r-user .bubble { border-radius: 22px; }
.for-claude .r-assistant .prose { font-family: var(--serif); font-size: 16.5px; line-height: 1.62; }
.for-claude .r-assistant .prose :is(code, pre, .md-table, .code-head) { font-family: var(--mono); }
.for-claude .r-assistant .prose .md-table { font-family: var(--font); }
.for-gpt .r-assistant .prose { font-size: 15.5px; line-height: 1.7; }
.r-user .prose { font-size: 15px; }
.msg-actions { display: flex; align-items: center; gap: 8px; margin: 2px 0 -6px -6px; min-height: 28px; color: var(--faint); font-size: 12px; opacity: 0; transition: opacity .15s; }
.r-assistant:hover .msg-actions, .r-assistant:focus-within .msg-actions, .r-user:hover .msg-actions, .r-user:focus-within .msg-actions { opacity: 1; }
@media (hover: none) {
  .msg-actions { opacity: 1; }
  .r-user .user-actions { display: none; }
  .r-user:not(:has(~ .r-user)) .user-actions { display: flex; }      /* on a phone, under your last message only */
  .r-user.show-actions .user-actions { display: flex; }                /* or under the one you tapped */
}
.r-user { flex-wrap: wrap; }
/* a long prompt: its first lines, fading out, and "Show more" */
.r-user .prose.clamped {
  max-height: 13.2em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 3.3em), transparent); mask-image: linear-gradient(#000 calc(100% - 3.3em), transparent);
}
.more-btn { margin: 4px 0 0 -9px; color: var(--muted); }
.user-actions { flex-basis: 100%; justify-content: flex-end; margin: 2px -4px 0 0; }
.msg-actions .rec-time { margin-left: 0; }
.copy-btn { width: 28px; height: 28px; min-height: 28px; color: var(--muted); border-radius: 7px; }
.msg-model::before { content: "·"; margin-right: 10px; }
.bubble { min-width: 0; }
.rec-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; min-width: 0; }
.rec-head .who { font: 650 12.5px var(--font); color: var(--ink); }
.rec-time { margin-left: auto; color: var(--faint); }

.prose { overflow-wrap: anywhere; min-width: 0; line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.para { white-space: pre-wrap; margin: 0 0 10px; }
.prose h3.md-h { font-size: 15px; margin: 16px 0 6px; }
.prose h4.md-h { font-size: 14px; margin: 14px 0 4px; }
.prose ul, .prose ol { margin: 4px 0 10px; padding-left: 22px; }
.prose li { margin: 2px 0; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin: 6px 0 10px; padding: 2px 12px; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.prose strong { font-weight: 650; }
.md-table-wrap { overflow-x: auto; margin: 6px 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.md-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.md-table th, .md-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md-table th { background: var(--surface-2); font-weight: 600; }
.md-table tr:last-child td { border-bottom: 0; }
code.inline { background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 5px; padding: 1px 5px; font-size: .86em; overflow-wrap: anywhere; }
.codeblock { margin: 8px 0 12px; min-width: 0; border: 1px solid var(--code-line); border-radius: var(--radius); overflow: hidden; background: var(--code-bg); }
.code-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--code-line); background: var(--surface-2); }
.codeblock .lang { font-size: 11.5px; color: var(--muted); font-family: var(--mono); flex: 1; }
.code-head button { min-height: 24px; height: 24px; padding: 0 8px; font-size: 11.5px; box-shadow: none; border-color: transparent; background: transparent; color: var(--muted); }
.code-head button:hover { color: var(--ink); background: var(--hover); }
.codeblock pre, pre.out {
  margin: 0; padding: 11px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; overflow: auto; max-width: 100%; tab-size: 4;
}
.codeblock pre { white-space: pre; max-height: 70vh; }
pre.out {
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; background: var(--code-bg);
  border: 1px solid var(--code-line); border-radius: 8px;
}

/* tool steps: a call and its result as one row; consecutive steps as one group */
.r-steps { display: block; }
.steps { border: 0; background: transparent; }
.steps > summary {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; margin-left: -4px; cursor: pointer; list-style: none; font-size: 13px;
  color: var(--muted); font-weight: 500; min-width: 0; max-width: 100%; border-radius: 8px;
}
.steps[open] > .step-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 6px; overflow: hidden; }
.steps > summary::-webkit-details-marker { display: none; }
.steps.single > summary { display: none; }
.steps.single:has(.fold.dim) { border-color: transparent; background: transparent; }
.steps.single:has(.fold.dim) .fold > summary { padding-left: 2px; }
.steps.single > .step-list { border: 0; background: transparent; margin-top: 0; }
.steps.single .fold > summary { padding-left: 2px; color: var(--muted); }
.steps > summary .chev { transition: transform .15s; }
.steps[open] > summary .chev { transform: rotate(90deg); }
.steps > summary:hover { color: var(--ink); background: var(--hover); }
.steps-tools { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.steps-tools .icon { width: 14px; height: 14px; }
.step-list { list-style: none; margin: 0; padding: 0; }
.step { border-bottom: 1px solid var(--line); min-width: 0; }
.step:last-child { border-bottom: 0; }
.fold { min-width: 0; }
.fold > summary {
  display: flex; gap: 8px; align-items: center; padding: 6px 12px; cursor: pointer; min-width: 0; font-size: 12.5px;
  list-style: none; overflow: hidden; color: var(--ink-2);
}
.fold > summary:hover { background: var(--hover); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .icon { color: var(--muted); width: 14px; height: 14px; }
.fold-label { font-weight: 600; flex: none; white-space: nowrap; color: var(--ink); }
.preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.preview.mono { font-size: 12px; }
.sep { display: none; }
.size, .kind { flex: none; white-space: nowrap; font-size: 11.5px; color: var(--faint); }
.fold .tag { flex: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.status-dot.bad { background: var(--bad); }
.status-dot.none { background: var(--line-strong); }
.fold-body { padding: 4px 12px 12px; min-width: 0; display: grid; gap: 8px; }
.io-label { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin: 4px 0 -4px; }
.fold.error > summary .fold-label { color: var(--bad); }
.fold.dim > summary { color: var(--muted); }
.fold.dim .fold-label { color: var(--muted); font-weight: 550; }
.fold.lone { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.fold.lone.dim { background: transparent; border-color: transparent; }
.fold.lone.dim > summary { padding-left: 2px; }
.fold.result.error { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.fold.call .tool-name { color: var(--ink); }
.trim-note { margin: 0; padding: 7px 10px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; }
.harness { opacity: .8; }
.full-row { display: grid; gap: 6px; }
.full-row .full-output { justify-self: start; }
.full-msg:empty { display: none; }

/* ---- assistant ---- */
.assist { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 170px); min-height: calc(100dvh - 170px); }
.assist-log { flex: 1; }
.assist .composer { position: sticky; bottom: 16px; }
.assist-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.amsg { max-width: 82%; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; min-width: 0; }
.amsg.out { align-self: flex-end; background: var(--surface-3); border-color: transparent; }
.amsg .rec-head .who { color: var(--ink); }
.amsg.in .rec-head .who { color: var(--agent); }
.amsg.from-assistant { background: var(--agent-soft); border: 1px dashed color-mix(in srgb, var(--agent) 50%, transparent); }
.amsg.from-assistant .who { color: var(--agent); }
.composer {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
}
.composer:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { border: 0; box-shadow: none !important; padding: 4px 6px; min-height: 44px; resize: none; background: transparent; }
.composer .form-msg { grid-column: 1 / -1; }
.composer-side { display: flex; }
.assist-status .callout { display: block; }
.status-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; }
.assist-asks:empty { display: none; }

/* ---- usage ---- */
.limit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px 32px; }
.limit-card { display: grid; gap: 10px; align-content: start; min-width: 0; }
.limit-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.limit-head .push { margin-left: 0; flex-basis: 100%; }
.limit-card { max-width: 380px; }
.limit .meter { width: 100%; }
.limit { display: grid; gap: 4px; }
.limit-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.limit-pct { font-weight: 650; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 2px 0; }
.meter .fill { height: 100%; width: var(--w, 0%); background: var(--ok); border-radius: 99px; }
.meter.warn .fill { background: var(--warn); }
.meter.bad .fill { background: var(--bad); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom-color: var(--line-strong); }
.data-table tbody th { font-weight: 600; }
.data-table tfoot th, .data-table tfoot td { border-bottom: 0; color: var(--ink-2); font-weight: 600; }
.data-table .n { text-align: right; }
.data-table tbody tr:hover { background: var(--hover); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin-bottom: 10px; font-size: 12.5px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.fresh, .seg.fresh { background: var(--accent); }
.sw.cache, .seg.cache { background: var(--cache); }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.day { display: grid; grid-template-columns: 64px minmax(0, 1fr) 56px; gap: 10px; align-items: center; font-size: 12.5px; }
.day-label { color: var(--muted); white-space: nowrap; }
.day-bar { display: flex; height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 0; }
.seg { display: block; height: 100%; width: var(--w, 0%); flex: none; }
.day-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- devices, linking ---- */
.device-list { list-style: none; margin: 0; padding: 0; }
.device { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.device:first-child { border-top: 0; padding-top: 0; }
.device-main { flex: 1 1 240px; min-width: 0; display: grid; gap: 2px; }
.device-name { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.device-facts { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.device.revoked .device-name b { color: var(--muted); text-decoration: line-through; }
.link-panel h2 { font-size: 19px; margin: 4px 0 8px; }
.link-msg { margin-top: 10px; }
.link-result { display: flex; gap: 14px; align-items: flex-start; }
.link-result h2 { margin: 0 0 6px; }
.link-result p { margin: 0 0 6px; }
.ok-mark { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 18px; }
.link-facts { margin: 6px 0 12px; }
.link-warning { font-weight: 600; }

/* ---- privacy ---- */
.stored { margin: 0; display: grid; gap: 12px; }
.stored-item dt { font-weight: 650; }
.stored-item dd { margin: 2px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.audit-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.audit { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.audit th { text-align: left; position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.audit th, .audit td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit td:last-child { overflow-wrap: anywhere; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.danger-zone h2 { color: var(--bad); }

/* ---- dialogs and toasts ---- */
.confirm-backdrop { position: fixed; inset: 0; background: rgba(8, 10, 14, .5); display: grid; place-items: center; z-index: 40; padding: 16px; backdrop-filter: blur(2px); }
.confirm { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 24px; max-width: 480px; width: 100%; box-shadow: var(--shadow-l); }
.confirm h2 { margin: 0 0 8px; font-size: 17px; }
.confirm p { margin: 6px 0; color: var(--ink-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.flash {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 45; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-l); font-weight: 550;
}
.flash.bad { background: var(--bad); color: #fff; }

/* ---- machines, runs, asks ---- */
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); cursor: pointer; white-space: nowrap; font-size: 13px; }
.intro { margin: 0; color: var(--muted); }
.panel.machine { display: grid; gap: 0; padding: 0; }
.machine > * { padding: 16px 20px; border-top: 1px solid var(--line); }
.machine > :first-child { border-top: 0; }
.machine > :empty { display: none; }
.machine h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.machine-title h2 { font-size: 16px; font-weight: 650; margin: 0; }
.machine-state { margin: 3px 0 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.machine-state .not-paired { color: var(--warn); }
.sep-dot { color: var(--faint); }
.machine-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.machine-head h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.machine-asks:empty, .machine-controls:empty, .machine-notice:empty { display: none; }
.tag.not-paired { background: var(--warn-soft); color: var(--warn); }
.pairing p { margin: 0 0 8px; }
.pair-form input { max-width: 220px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.pair-msg, .run-msg, .ask-msg { margin-top: 8px; }
.pair-msg:empty, .run-msg:empty, .ask-msg:empty { display: none; }
.new-run { display: grid; gap: 10px; }
.new-run h3 { margin: 0; }
.new-run textarea { max-width: none; }
.run-list, .ask-list, .upload-list, .folders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.run-list { gap: 0; }
.run { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 6px; min-width: 0; }
.run:first-child { border-top: 0; padding-top: 2px; }
.ask { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.ask { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.run-top, .ask-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.run-title { overflow-wrap: anywhere; min-width: 0; font-weight: 600; }
.run-facts { overflow-wrap: anywhere; }
.run .row-actions { margin-top: 2px; }
.ask-summary { white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-prompt { margin-top: 2px; }
.follow input { flex: 1 1 180px; }
.stop-row { margin-top: 0; }
.upload { display: grid; gap: 4px; }
.upload p { margin: 4px 0; }
.folders { gap: 2px; }
.folders li { overflow-wrap: anywhere; }
.waiting-at-pc p, .at-pc p { margin: 0 0 6px; }
.edit-wait { color: var(--warn); }
.push-msg:empty { display: none; }

/* ---- projects ---- */
.project-list, .member-list, .task-list, .note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.project-link {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 12px 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere;
}
.project-link:hover { border-color: var(--line-strong); background: var(--hover); text-decoration: none; }
.member { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; overflow-wrap: anywhere; }
.member button { margin-left: auto; }
.project-head { display: grid; gap: 12px; }
.project-head .page-head h1 { margin: 0; }
.invite-box:empty { display: none; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 550; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
.project-body { display: grid; gap: 16px; }
.project-log { max-height: none; }
.task-group h3 { font-size: 12px; margin: 0 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.task { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; display: grid; gap: 6px; min-width: 0; background: var(--surface); }
.task-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.task-top select { width: auto; min-height: 30px; padding-top: 3px; padding-bottom: 3px; font-size: 12.5px; }
.task-title { flex: 1 1 160px; overflow-wrap: anywhere; min-width: 0; }
.t-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-note { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.st-doing { background: var(--warn-soft); color: var(--warn); }
.st-blocked { background: var(--bad-soft); color: var(--bad); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.task-note-form input { font-size: 13px; }
.request { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; overflow-wrap: anywhere; background: var(--surface); }
.request.for-you { background: var(--accent-soft); border-color: var(--accent-line); }
.request.closed { opacity: .72; }
.req-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.req-fields input { flex: 1 1 180px; width: auto; }
.pnote { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; display: grid; gap: 6px; background: var(--surface); }
.pnote.k-warning { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.check-row { display: flex !important; gap: 8px; align-items: center; font-weight: 400 !important; overflow-wrap: anywhere; min-width: 0; }
.check-row input { flex: none; }
.check-row code { font-size: 11px; }
.repo-pick { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: grid; gap: 6px; margin: 0; min-width: 0; }
.repo-pick legend { font-weight: 600; padding: 0 4px; font-size: 13px; }
.advanced summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.advanced[open] summary { margin-bottom: 8px; }
.danger-zone-mini summary { color: var(--bad); }
.shared-text p { margin: 0 0 4px; }
.proposals { display: grid; gap: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 16px; }
.proposals h2, .tasks-head { font-size: 15px; margin: 0; }
.proposal { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; display: grid; gap: 6px; background: var(--surface); }
.proposal.from-assistant { border-style: dashed; border-color: color-mix(in srgb, var(--agent) 50%, transparent); }
.prop-titles { margin: 0; padding-left: 18px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.prop-titles li.overlap > span:first-child { font-weight: 600; }
.prop-titles .tag { margin-left: 6px; }
.prop-history { margin: 0; }
.member-controls { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.member-controls select { width: auto; }
.days-row { display: flex !important; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 400 !important; }
.days-row input { width: 6em; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.private-banner p { margin: 0 0 6px; }
.private-banner { overflow-wrap: anywhere; }
.project-id { display: grid; gap: 2px; }
.private-hint:empty { display: none; }
.sealed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sealed-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 7px 10px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.hosted-note { margin: 6px 0 0; }
.a2a-msg { border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.a2a-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.token-box:empty { display: none; }
.project-head > *, .project-id > *, .private-hint > *, .machine > * { min-width: 0; }

/* ---- connect ---- */
.connect-grid { display: grid; gap: 16px; }
.connect-source { display: grid; gap: 10px; }
.connect-source .panel-head { margin-bottom: 0; }
.source-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.connect-source h2 { margin: 0; font-size: 15px; }
.steps-list { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: 6px; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; }
.steps-list li::before {
  content: counter(step); width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2);
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center; margin-top: 1px;
}
.import-status:empty { display: none; }
.import-status { margin: 2px 0; }

/* ---- the More page (phones) ---- */
.more-list { list-style: none; margin: 0; padding: 4px; display: grid; gap: 1px; }
.more-list a, .more-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 10px; color: var(--ink);
  font-weight: 550; justify-content: flex-start; border: 0; background: transparent; box-shadow: none; min-height: 46px;
}
.more-list a:hover, .more-list button:hover { background: var(--hover); text-decoration: none; }
.more-list .icon { color: var(--muted); width: 18px; height: 18px; }
.more-list .go { margin-left: auto; color: var(--faint); }

/* ---- medium screens: a narrower sidebar ---- */
@media (max-width: 1180px) and (min-width: 761px) {
  :root { --list: 340px; }
}

/* ---- wider than a phone: the menu is a rail of icons, and the chat list can be hidden or resized ----
   The menu is always laid out at its full width and only clipped to the rail, so nothing in it moves
   when it opens. It opens over the page while the pointer is on it (or a key has focus in it), and
   takes its own column when pinned (.menu-open, remembered by this browser).
   Every word in it is invisible while it is a rail, and each change waits as long as the width does
   (--wait), so a pointer that only crosses the rail shows nothing: no letters at its edge. */
@media (min-width: 761px) {
  .app { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .app.menu-open { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .sidebar {
    --w: var(--rail); --show: 0; --item: 36px; --sep: 16px; --lift: none; --wait: 0s;
    --wide: calc(var(--sidebar) - 20px);
    width: var(--w); overflow-x: hidden; z-index: 30; box-shadow: var(--lift);
    transition: width .16s ease var(--wait), box-shadow .16s ease var(--wait);
  }
  .sidebar > * { min-width: calc(var(--sidebar) - 20px); }
  .sidebar > .theme-switch { min-width: calc(var(--sidebar) - 28px); }
  .sidebar .nav-item { max-width: var(--item); overflow: hidden; position: relative; flex: none; transition: max-width 0s linear var(--wait), background .12s, color .12s; }
  .sidebar .nav-sep { width: var(--sep); transition: width 0s linear var(--wait); }
  .sidebar :is(.nav-text, .nav-heading, .theme-switch, .me-text, #signout, .brand > span:last-child) { opacity: var(--show); transition: opacity .12s ease var(--wait); }
  .sidebar .nav-item .count { position: absolute; top: 1px; left: 20px; min-width: 15px; height: 15px; padding: 0 4px; line-height: 15px; font-size: 10px; }
  .sidebar:has(:focus-visible) { --w: var(--sidebar); --show: 1; --item: var(--wide); --sep: calc(var(--wide) - 20px); --lift: var(--shadow-l); }
  .app.menu-open .sidebar { --w: var(--sidebar); --show: 1; --item: var(--wide); --sep: calc(var(--wide) - 20px); --lift: none; }

  .split { position: relative; grid-template-columns: min(var(--list), calc(100% - 380px)) minmax(0, 1fr); }
  .list-grip {
    display: block; position: absolute; top: 0; bottom: 0; left: calc(min(var(--list), 100% - 380px) - 4px); width: 9px;
    cursor: col-resize; z-index: 6; touch-action: none;
  }
  .list-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .12s; }
  .list-grip:hover::after, .list-grip:focus-visible::after, .split.resizing .list-grip::after { background: var(--line-strong); }
  .list-grip:focus-visible { outline: none; }
  .split.resizing { user-select: none; -webkit-user-select: none; cursor: col-resize; }
  .list-hide { display: inline-flex; align-self: center; margin-left: -4px; }
  .split.list-off.has-detail { grid-template-columns: minmax(0, 1fr); }
  .split.list-off.has-detail .list-pane, .split.list-off.has-detail .list-grip { display: none; }
  .split.list-off.has-detail .list-show { display: inline-flex; }
  .split.list-off.has-detail .chat-bar { padding-left: 52px; }
}
@media (min-width: 761px) and (hover: hover) {
  .app:not(.menu-open) .sidebar:hover { --w: var(--sidebar); --show: 1; --item: var(--wide); --sep: calc(var(--wide) - 20px); --lift: var(--shadow-l); --wait: .12s; }
}

/* ---- phones ---- */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .content { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom);
  }
  .tabbar[hidden] { display: none; }
  .tab-item {
    display: grid; justify-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: 10.5px; font-weight: 550;
    position: relative; border-radius: 10px; min-height: 52px; align-content: center;
  }
  .tab-item .icon { width: 21px; height: 21px; }
  .tab-item:hover { text-decoration: none; }
  .tab-item[aria-current=page] { color: var(--ink); }
  .tab-item[aria-current=page]::before { content: ""; position: absolute; top: -4px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--accent); }
  .tab-item .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; }
  .main { padding: max(16px, env(safe-area-inset-top)) 14px 32px; gap: 14px; }
  .machine > * { padding: 14px; }
  .panel { padding: 14px; border-radius: 12px; }
  .page-head h1 { font-size: 20px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.has-detail .list-pane { display: none; }
  .split:not(.has-detail) .detail-pane { display: none; }
  .list-pane { border-right: 0; }
  .list-head { padding: max(14px, env(safe-area-inset-top)) 14px 10px; }
  .list-scroll { padding: 4px 6px 16px; }
  .chip-row { margin: 0 -14px; padding: 0 14px 1px; }
  .chat-bar { padding: max(10px, env(safe-area-inset-top)) 12px 10px; gap: 8px; }
  .chat-bar .back-btn { display: inline-flex; }
  .chat-sub { flex-wrap: nowrap; overflow: hidden; }
  .chat-sub span:nth-child(n+2) { display: none; }
  .records { padding: 16px 12px 32px; gap: 12px; }
  .chat-info { width: calc(100% - 24px); }
  .amsg { max-width: 94%; }
  .assist .composer { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: 6px; }
  .data-table .detail { display: none; }
  .data-table th, .data-table td { padding: 9px 8px; }
  .day { grid-template-columns: 52px minmax(0, 1fr) 46px; gap: 6px; }
  .load-more { min-width: 0; width: 100%; }
  .composer { grid-template-columns: minmax(0, 1fr) auto; }
  .signin { margin: 8vh 14px 24px; width: auto; padding: 24px; }
  .confirm-actions button { flex: 1 1 auto; }
  .flash { bottom: calc(72px + env(safe-area-inset-bottom)); }
  button, .button { min-height: 40px; touch-action: manipulation; }
  button.small, .chip { min-height: 34px; }
  .icon-button { width: 38px; height: 38px; min-height: 38px; }
  .fold > summary, .steps > summary { min-height: 40px; }
  input, select, textarea { font-size: 16px; min-height: 42px; }
  .pair-form input { max-width: none; }
  .audit-wrap { max-height: 60vh; }
  .audit thead { display: none; }
  .audit, .audit tbody { display: block; }
  .audit tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  .audit td { padding: 0; border: 0; min-width: 0; }
  .audit td:nth-child(2) { font-weight: 600; }
  .audit td:first-child { color: var(--muted); order: 2; margin-left: auto; }
  .audit td:last-child { flex: 1 1 100%; order: 3; }
  .tab { padding: 10px; }
  .check-row { min-height: 40px; }
}


/* ---- context size ---- */
.ctx { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ctx.small { font-size: 11.5px; margin-left: auto; }
.ctx-mid, .stat.ctx-mid { color: var(--warn); }
.ctx-high, .stat.ctx-high { color: var(--bad); }
.ctx-meter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.meter { width: 96px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.meter-fill { display: block; height: 100%; width: var(--fill, 0%); background: var(--ok); border-radius: 3px; }
.ctx-meter.ctx-mid .meter-fill { background: var(--warn); }
.ctx-meter.ctx-high .meter-fill { background: var(--bad); }
.ctx-meter.ctx-mid { color: var(--warn); }
.ctx-meter.ctx-high { color: var(--bad); }

/* ---- continuing a chat: the dock at the bottom of a chat ---- */
.dock-holder {
  position: sticky; bottom: 0; padding: 18px 24px 16px; margin-top: auto; z-index: 2;
  background: linear-gradient(to bottom, transparent, var(--bg) 22px);
}
.dock-holder:empty { display: none; }
.dock-live:empty { display: none; }
.dock-live { padding: 0 24px 14px; }
.dock { display: grid; gap: 6px; }
.dock-holder .dock > :not(.dock-form) { background: var(--bg); margin: 0; padding: 2px 10px; }   /* hints above the box, over the chat */
.dock-holder .dock-explain, .dock-holder .dock-foot { padding-top: 6px; }
.dock-holder .dock, .dock-live { max-width: 816px; margin-left: auto; margin-right: auto; width: 100%; }
.dock-form {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; padding: 6px 8px 8px 10px;
  box-shadow: 0 6px 24px rgba(16, 18, 22, .08), 0 1px 2px rgba(16, 18, 22, .06); display: grid; gap: 2px;
}
.dock-form:focus-within { border-color: var(--ink-2); }
.dock-bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dock-where { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-gap { flex: 1; }
.for-gpt .dock-form { border-radius: 26px; padding: 8px 10px 8px 14px; }
.model-wrap { position: relative; flex: none; min-width: 0; }
.model-pick {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; box-shadow: none; color: var(--muted);
  font: 550 13px var(--font); padding: 0 8px 0 10px; min-height: 32px; height: 32px; border-radius: 8px; max-width: 200px;
}
.model-pick:hover, .model-pick[aria-expanded=true] { color: var(--ink); background: var(--hover); }
.model-pick .model-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pick .icon { width: 14px; height: 14px; flex: none; }
.model-menu {
  position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 20; width: min(330px, calc(100vw - 28px)); max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-l); padding: 6px; display: grid; gap: 2px;
  grid-template-columns: minmax(0, 1fr);
}
.menu-label { margin: 6px 8px 2px; font-size: 12px; color: var(--muted); font-weight: 600; }
.menu-list { display: grid; gap: 1px; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; box-shadow: none; color: var(--ink);
  font: 500 14px var(--font); padding: 0 10px; min-height: 36px; border-radius: 8px; text-align: left; }
.menu-item:hover { background: var(--hover); }
.menu-item.on { font-weight: 650; }
.effort-seg { flex-wrap: wrap; width: auto; max-width: none; overflow: visible; flex: initial; margin: 0 4px; justify-self: start; }
.menu-note { margin: 4px 8px 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.turn-cost { margin: 0; color: var(--muted); }
.dock-foot { margin: 0 10px; display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: 12.5px; }
.dock-foot:empty { display: none; }
.dock:not(:focus-within) .dock-foot:not(.close) { display: none; }
.dock-locked { display: flex; align-items: center; gap: 12px; }
.dock-locked p { margin: 2px 0 0; }
.grow { flex: 1; min-width: 0; }
.dock-explain { margin: 0 10px; color: var(--muted); line-height: 1.5; font-size: 12.5px; }
.dock:not(:focus-within) .dock-explain:not(:has(.warn-text)) { display: none; }
.warn-text { color: var(--warn); }
.dock-form textarea { border: 0; box-shadow: none !important; background: transparent; padding: 8px 6px 4px; min-height: 38px; max-height: 240px; resize: none; }
.send-btn { height: 34px; min-height: 34px; width: 34px; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.for-claude .send-btn { background: var(--t-claude-code); border-color: var(--t-claude-code); color: #fff; }
.for-claude .send-btn:hover { background: color-mix(in srgb, var(--t-claude-code) 86%, #000); }
.for-gpt .send-btn { border-radius: 50%; }
.send-btn.stop .icon { width: 13px; height: 13px; background: currentColor; -webkit-mask: none; mask: none; border-radius: 2px; }
.dock-msg:empty { display: none; }
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border-radius: 9px; width: max-content; max-width: 100%; overflow-x: auto; flex: none; }
.mode-btn { display: inline-flex; align-items: center; border: 0; background: transparent; color: var(--muted); padding: 0 10px; min-height: 28px; height: 28px; border-radius: 7px; font-size: 12.5px; font-weight: 550; white-space: nowrap; box-shadow: none; }
.mode-btn:hover { color: var(--ink); background: transparent; }
.mode-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 18, 22, .12), 0 0 0 1px var(--line); }

/* ---- a run as it works ---- */
.live { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); padding: 12px 14px; display: grid; gap: 8px; min-width: 0; }
.run-live .live { border: 0; border-radius: 0; padding: 4px 0 0 14px; box-shadow: inset 1px 0 0 var(--line); background: transparent; }
.run-live .live-stats, .run-live .live-stop { display: none; }
.live-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.live-head .live-clock { color: var(--muted); font-size: 12px; margin-right: auto; }
.live-phase { font-size: 13.5px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.live-dot.on { background: var(--accent); animation: af-pulse 1.4s ease-in-out infinite; }
.live-dot.done { background: var(--ok); }
.live-dot.failed { background: var(--bad); }
@keyframes af-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot.on { animation: none; } }
.live-stats { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--muted); }
.stat-mode { color: var(--ink-2); font-weight: 600; }
.live-stats:empty { display: none; }
.stat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.live-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
.run-live .live-items { max-height: 45vh; }
.dock-live { display: grid; gap: 18px; }
.dock-live .live { border: 0; background: transparent; padding: 0 2px; gap: 14px; }
.dock-live .live-items { max-height: none; overflow: visible; gap: 14px; }
.dock-live .live-head { order: 3; }
.dock-live .live-stats { display: none; }
.dock-live .live-tool { margin: -8px 0; }
.dock-live .live-tool .tool-line, .dock-live .live-tool summary { padding: 3px 2px; color: var(--muted); }
.dock-live .live-tool b { font-weight: 550; }
.dock-live .live-foot { order: 5; }
.dock-live .live-head .live-phase { font-weight: 500; color: var(--muted); }
.dock-live .live-stop { display: none; }
.dock-live .live-prompt { background: transparent; padding: 0; display: flex; justify-content: flex-end; }
.dock-live .live-prompt .live-you { display: none; }
.dock-live .live-prompt .prose { background: var(--surface-3); border-radius: 18px; padding: 10px 16px; max-width: min(85%, 640px); font-size: 15px; }
.for-claude .dock-live .live-prompt .prose { border-radius: 14px; }
.for-gpt .dock-live .live-prompt .prose { border-radius: 22px; }
.for-claude .dock-live .live-text .prose { font-family: var(--serif); font-size: 16.5px; line-height: 1.62; }
.for-gpt .dock-live .live-text .prose { font-size: 15.5px; line-height: 1.7; }
.live-item { min-width: 0; }
.live-prompt { background: var(--surface-3); border-radius: var(--radius); padding: 7px 11px; }
.live-you { font-size: 12px; font-weight: 600; color: var(--muted); }
.live-tool .tool-line, .live-tool summary { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.live-tool .tool-line { padding: 6px 12px; border: 1px solid transparent; }
.tool-detail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 12px; }
.tool-state { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.tool-state.running { background: var(--accent); animation: af-pulse 1.4s ease-in-out infinite; }
.tool-state.done { background: var(--ok); }
.tool-state.error { background: var(--bad); }
.live-foot { display: grid; gap: 8px; }
.live-foot:empty { display: none; }
.live-foot .follow input { min-width: 0; }
.run-live:empty { display: none; }
.run-live { margin-top: 8px; }
.run .live-stats { margin-top: 4px; }
@media (max-width: 760px) {
  .dock-holder { padding: 14px 10px 10px; }
  .dock-live { padding: 0 10px 12px; }
  .dock-where { display: none; }
  .model-pick { max-width: 140px; padding-left: 6px; }
  .for-claude .r-assistant .prose, .for-claude .dock-live .live-text .prose { font-size: 16px; }
  .r-user .bubble { max-width: 88%; }
  .mode-btn { padding: 0 9px; min-height: 30px; height: 30px; }
  .send-btn { height: 36px; min-height: 36px; width: 36px; }
}

/* ---- your agents (crew) on the Assistant page ---- */
.crew-panel { display: grid; gap: 12px; margin-bottom: 14px; }
.crew-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.crew-head h2 { margin: 0; font-size: 15px; }
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.crew-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.crew-repo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crew-repo b { min-width: 0; }
.crew-sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crew-who { display: flex; align-items: center; gap: 7px; }
.crew-when { margin-left: auto; font-family: var(--font); font-variant-numeric: tabular-nums; }
.crew-says { font-size: 13px; color: var(--ink-2); margin: 2px 0 0 14px; overflow-wrap: anywhere; }
.crew-log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.crew-log li { padding: 0; }
.crew-from { margin-bottom: 2px; }

/* ---- a new chat, and the folders of a machine ---- */
.list-title .new-chat-btn { margin-left: auto; align-self: center; }
.new-chat { height: 100%; }
.new-view { min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); }
.detail-pane .new-view { min-height: 100%; }
.new-view.started .new-where, .new-view.started .dock-bar .segmented { display: none; }
.new-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 24px 18vh; }
.new-view.started .new-body { justify-content: flex-end; padding-bottom: 24px; }
.new-view.started .new-title { display: none; }
.new-title { font-size: 26px; font-weight: 600; letter-spacing: -.01em; text-align: center; margin: 0 0 6px; }
.for-claude .new-title { font-family: var(--serif); font-weight: 500; font-size: 30px; }
.new-where { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.where-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); min-width: 0; max-width: 100%; }
.where-pick.grow { flex: 0 1 auto; }
.where-pick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; box-shadow: none; color: var(--ink); font: 550 13px var(--font); min-height: 34px; height: 34px; padding: 0 10px 0 0; max-width: min(520px, 76vw); text-overflow: ellipsis; }
.new-note { margin: 0 10px; color: var(--muted); }
.new-view .dock-live:empty { display: none; }
.new-view .chat-bar { border-bottom-color: transparent; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.folders { display: grid; gap: 8px; margin-top: 18px; }
.folders h3 { margin: 0; }
.folder-list { list-style: none; margin: 0; padding: 0; display: grid; }
.folder { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.folder:first-child { border-top: 0; }
.folder-main { display: grid; min-width: 0; }
.folder select { min-height: 32px; height: 32px; font-size: 13px; padding: 0 28px 0 10px; }
.folder-msg { grid-column: 1 / -1; }
.folder-msg:empty { display: none; }
.upgrade { display: grid; gap: 10px; }
.upgrade p { margin: 0; }
@media (max-width: 760px) {
  .new-view { min-height: calc(100dvh - 150px - env(safe-area-inset-bottom)); }
  .new-body { padding: 16px 12px 12vh; }
  .new-title { font-size: 22px; }
  .for-claude .new-title { font-size: 25px; }
  .folder { grid-template-columns: minmax(0, 1fr) auto; }
  .folder .button { display: none; }
}
.dock-offer:empty { display: none; }
.push-offer { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.push-offer p { margin: 0; flex: 1 1 200px; }
.push-offer .row-actions { margin: 0; }

/* the chat's own menu: rename, pin, archive, delete */
.pop-menu { top: calc(100% + 6px); bottom: auto; width: 200px; }
.pop-menu .menu-item { justify-content: flex-start; }
.pop-menu .menu-item .icon { margin-right: 6px; }
.menu-item.danger-item { color: var(--bad); }
.rename-input { font: 650 17px var(--font); padding: 2px 6px; min-height: 32px; width: 100%; }
.chat-sub .i-pin { width: 12px; height: 12px; vertical-align: -1px; }

/* code in colour (highlight()); diffs a line at a time */
.hl-k { color: var(--hl-k); } .hl-s { color: var(--hl-s); } .hl-c { color: var(--hl-c); font-style: italic; } .hl-n { color: var(--hl-n); }
.hl-add { color: var(--hl-add); background: var(--hl-add-bg); display: inline-block; min-width: 100%; }
.hl-del { color: var(--hl-del); background: var(--hl-del-bg); display: inline-block; min-width: 100%; }
.hl-meta { color: var(--muted); }

/* back to the latest message, above the box */
.chat-view { position: relative; }
.jump-wrap { position: sticky; bottom: 120px; height: 0; z-index: 6; display: flex; justify-content: center; overflow: visible; pointer-events: none; }
.jump-wrap[hidden] { display: none; }
.jump-latest {
  pointer-events: auto; transform: translateY(-100%); flex: none; width: 36px; height: 36px; min-height: 36px; padding: 0;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-l); color: var(--ink);
}

/* how full the context is, and Compact */
.ctx-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctx-meter { display: inline-block; width: 64px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.ctx-meter > span { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.ctx-mid .ctx-meter > span { background: var(--warn); }
.ctx-high .ctx-meter > span { background: var(--bad); }
.compact-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }

/* dictation */
.mic-btn { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 8px; color: var(--muted); }
.mic-btn.on { color: var(--bad); background: var(--bad-soft); }
.dock-form.empty .send-btn:not(.stop) { display: none; }
.dock-form:not(.empty) .mic-btn { display: none; }
.dock-form:has(.send-btn.stop) .mic-btn { display: none; }

/* files attached to a message: in the box before sending, and on the sent message */
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 8px 0; }
.file-chips[hidden] { display: none; }
.file-chips.sent { padding: 8px 0 0; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; min-height: 30px; padding: 2px 4px 2px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--ink); }
.file-chips.sent .file-chip { padding-right: 8px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.file-chip.has-thumb { padding-left: 3px; }
.file-chip .thumb { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; flex: none; }
.file-chip .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip-x { width: 22px; height: 22px; min-height: 22px; padding: 0; border-radius: 6px; color: var(--muted); flex: none; }
.attach-btn { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 8px; color: var(--muted); flex: none; }

/* the box's options: how it goes on, and Ask / Plan / Edit */
.opt-menu { left: 0; right: auto; width: min(300px, calc(100vw - 28px)); }
.opt-pick { padding-left: 8px; }
.menu-item.choice { min-height: 44px; padding-top: 5px; padding-bottom: 5px; }
.menu-item.choice:disabled { opacity: .45; }
.mi-text { display: grid; gap: 1px; min-width: 0; }
.mi-label { font-weight: 550; }
.mi-note { font-size: 12px; color: var(--muted); font-weight: 450; white-space: normal; }
.menu-item.choice.on .mi-label { font-weight: 650; }
.tool-row { display: flex; padding: 0 2px; }

/* what a run changed: a line above the box, and a sheet with the diff */
.changes-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 10px !important; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface) !important; margin: 0 0 2px !important; }
.changes-bar[hidden] { display: none; }
.changes-bar .add, .sheet .add, .diff-n .add { color: var(--hl-add); font-variant-numeric: tabular-nums; }
.changes-bar .del, .sheet .del, .diff-n .del { color: var(--hl-del); font-variant-numeric: tabular-nums; }
.changes-bar button { min-height: 28px; height: 28px; }
.changes-bar a { display: inline-flex; align-items: center; gap: 3px; }
.confirm-backdrop.for-sheet { place-items: stretch center; padding: 24px 16px; }
.confirm.sheet { max-width: 920px; display: flex; flex-direction: column; max-height: calc(100dvh - 48px); padding: 0; overflow: hidden; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0 0 2px; font-size: 17px; }
.sheet-head p { margin: 0; }
.sheet-body { overflow-y: auto; padding: 10px 18px; flex: 1; min-height: 80px; }
.sheet-foot { border-top: 1px solid var(--line); padding: 12px 18px 16px; display: grid; gap: 8px; }
.sheet-foot p { margin: 0; }
.commit-label { display: grid; gap: 4px; }
.diff-file { border: 1px solid var(--code-line); border-radius: 8px; margin: 0 0 8px; overflow: hidden; background: var(--code-bg); }
.diff-file summary { display: flex; gap: 10px; align-items: center; padding: 7px 10px; cursor: pointer; background: var(--surface-2); font-size: 13px; }
.diff-path { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.diff-pre { margin: 0; padding: 8px 0; overflow-x: auto; font-size: 12px; line-height: 1.5; }
.diff-pre code { display: block; padding: 0 10px; min-width: max-content; }
@media (max-width: 640px) {
  .confirm-backdrop.for-sheet { padding: 0; }
  .confirm.sheet { max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
}

/* editing one of your messages, and its versions */
.r-user.editing .bubble { width: 100%; max-width: 100%; }
.edit-text { width: 100%; min-height: 70px; resize: none; background: var(--surface); }
.edit-note { margin: 6px 2px 0; }
.edit-actions { justify-content: flex-end; margin-top: 6px; }
.versions { display: inline-flex; align-items: center; gap: 0; color: var(--muted); font-size: 12.5px; margin-right: auto; }
.versions .num { min-width: 34px; text-align: center; }
.versions button:disabled { opacity: .35; }
.user-actions.has-versions { display: flex !important; }

/* a member's shared chat, on its own */
.split.solo-chat { grid-template-columns: minmax(0, 1fr); }
.project-repos { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 6px 0 0; font-size: 13px; }
.project-repos .repo-name { font-weight: 600; }

/* a project's trail */
.trail { list-style: none; margin: 0; padding: 0; }
.trail-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 8px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.trail-item:first-child { border-top: 0; }
.trail-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.k-pr_merged .trail-icon, .k-conflict_resolved .trail-icon { color: var(--ok); background: var(--ok-soft); }
.k-conflict .trail-icon { color: var(--warn); background: var(--warn-soft); }
.k-bug_found .trail-icon { color: var(--bad); background: var(--bad-soft); }
.trail-line { margin: 2px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.trail-line a { display: inline-flex; align-items: center; gap: 2px; }
.trail-extra { margin: 3px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.trail-when { white-space: nowrap; padding-top: 3px; }
.notes-row { margin: 4px 4px 0; color: var(--muted); }
.notes-row[hidden] { display: none !important; }

/* a working agent asks the owner (H-3) */
.approval { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.approval-allowed, .approval-denied, .approval-expired { background: transparent; border-style: dashed; }
.approval-head { display: flex; gap: 6px; align-items: center; }
.approval-detail { font-size: 12.5px; padding: 6px 8px; border-radius: 8px; background: var(--code-bg, var(--panel)); overflow-wrap: anywhere; }
.approval .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* what waits for you, above the chats (G-4) */
.needs-you { padding: 4px 8px 8px; border-bottom: 1px solid var(--line); }
.needs-you[hidden] { display: none; }
.need-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 2px 0; border-radius: 10px; background: var(--warn-soft); color: inherit; text-decoration: none; }
.need-row .grow { display: grid; min-width: 0; }
.need-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* one goal in parts (G-11) */
.split-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; margin: 0 0 8px; }
.split-head { display: flex; gap: 6px; align-items: center; }
.split-parts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.split-part { display: flex; gap: 8px; align-items: flex-start; }
.split-part .grow { min-width: 0; }
.approval-asked { border-style: dashed; }
.split-box, .split-card > *, .split-parts li { min-width: 0; }
.split-card { overflow: hidden; }
.split-card .preview { white-space: normal; overflow-wrap: anywhere; }
.split-card .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* comments on lines of a diff (G-5) */
.dline { display: block; cursor: pointer; min-height: 1.2em; }
.dline.hl-meta { cursor: default; }
.dline:not(.hl-meta):hover, .dline:focus-visible { outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.dline.has-note { box-shadow: inset 3px 0 var(--warn); }
.dnote { display: block; white-space: normal; padding: 4px 8px 6px; }
.dnote input { width: 100%; font: inherit; }
.diff-hint { margin: 6px 2px; }
/* the parts of a split, and several agents' answers (G-11, G-15) */
.split-kids, .compare-list, .sched-list, .suggested { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.compare-item { border-top: 1px solid var(--line); padding-top: 6px; min-width: 0; }
.compare-who { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.compare-open { margin-left: auto; }
.compare-last { margin: 4px 0 0; overflow-wrap: anywhere; }
/* scheduled runs (G-9) */
.sched-item { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; }
.sched-item .grow { min-width: 200px; flex: 1; }
.sched-prompt { margin: 2px 0; overflow-wrap: anywhere; }
.sched-form { display: grid; gap: 8px; margin-top: 8px; }
.sched-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-form textarea { width: 100%; }
/* a suggestion for a teammate's agent (G-2); saved prompts (G-16) */
.suggest-form { display: flex; gap: 8px; align-items: flex-end; }
.suggest-form textarea { flex: 1; min-width: 0; }
.suggested { margin-top: 6px; }
.saved-row { display: flex; align-items: center; gap: 2px; }
.saved-row .menu-item { flex: 1; min-width: 0; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink, #171614); color: var(--bg, #fff); padding: 8px 14px; border-radius: 10px; z-index: 50; max-width: 90vw; }

/* ---- a run's waiting messages, above the box (G-21) ---- */
.queue-box { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 0 0 8px; display: grid; gap: 4px; min-width: 0; }
.queue-box[hidden] { display: none; }
.queue-box p { margin: 0; }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.queue-list li { display: flex; align-items: center; gap: 4px; min-width: 0; }
.queue-list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.queue-list .icon-button { min-height: 28px; height: 28px; width: 28px; }

/* ---- who does a part of a split; rewind; asking for a review ---- */
.part-who { width: auto; max-width: 100%; min-height: 28px; height: 28px; font-size: 13px; padding: 0 24px 0 6px; }
.part-who[hidden], .rewind-to[hidden], .split-part .tag[hidden] { display: none; }
.rewind-to { width: auto; max-width: 190px; }
.review-ask select { width: auto; max-width: 100%; }
.split-kids.handed { margin-bottom: 2px; }

/* ---- a project: who waits for whom, trusted members, files on messages, shared prompts ---- */
.waiting-box:empty { display: none; }
.waiting-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.waiting-list li { overflow-wrap: anywhere; }
.waiting-list li.for-you { border-left: 3px solid var(--warn, #b7791f); padding-left: 8px; }
.trust-holder { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.member .trust-holder button { margin-left: 0; }
.trust-msg:empty { display: none; }
.room-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.room-file { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; max-width: 100%; min-width: 0; }
.room-file .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.room-file.image { padding: 0; overflow: hidden; }
.room-file img { display: block; max-width: min(260px, 100%); max-height: 200px; }
.team-prompts { margin-top: 20px; display: grid; gap: 8px; }
.composer .file-chips { padding: 0 0 6px; grid-column: 1 / -1; }
.composer-side { align-items: center; gap: 4px; }
.composer .attach-btn { align-self: center; }
.trust-holder .pop-menu { left: 0; right: auto; width: min(260px, 80vw); }
.waiting { display: grid; gap: 10px; }
.waiting .tasks-head { margin: 0; }
.room-file img { min-width: 40px; min-height: 40px; object-fit: contain; background: var(--surface); }

/* ---- a chat's folder from the app: files, git, terminal (G-5) ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 8px; }
.crumb { border: 0; background: none; padding: 2px 4px; min-height: 28px; height: auto; font-family: var(--mono, ui-monospace, monospace); font-size: 13px; color: var(--link, inherit); cursor: pointer; }
.file-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; }
.file-row { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; text-align: left; border: 0; background: none; padding: 6px 6px; min-height: 36px; height: auto; border-radius: 6px; font-size: 14px; cursor: pointer; }
.file-row:hover:not(:disabled) { background: color-mix(in srgb, var(--line) 50%, transparent); }
.file-row:disabled { opacity: .6; cursor: default; }
.file-row .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .grow { flex: 1; }
.git-branch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; }
.git-code { font-family: ui-monospace, monospace; min-width: 26px; text-align: center; }
.sheet-body h3 { margin: 12px 0 4px; font-size: 14px; }
.term-log { display: grid; gap: 10px; min-width: 0; }
.term-entry { min-width: 0; }
.term-cmd { font-weight: 600; overflow-wrap: anywhere; }
.term-out { margin: 4px 0 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; }
.term-form { display: flex; gap: 8px; align-items: center; }
.term-form .term-input { flex: 1; min-width: 0; }
.link-button { border: 0; background: none; padding: 0; min-height: 0; height: auto; color: var(--link, inherit); text-decoration: underline; cursor: pointer; font: inherit; }
.tools-extra { margin-top: 10px; }
.key-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-item .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.team-rules { margin-top: 22px; display: grid; gap: 6px; }
.team-rules:empty { display: none; }

/* ---- the task board (G-18): columns where there is room ---- */
.task-board { display: grid; gap: 12px; }
.task-work { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .task-board { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
  .task-board .task-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
  .task-board .task-top { flex-wrap: wrap; }
}
.keep-one, .redo-part { min-height: 28px; height: auto; }
.queue-list li input { flex: 1; min-width: 0; min-height: 30px; height: 30px; font-size: 13px; }
.file-list { grid-template-columns: minmax(0, 1fr); }
.file-list li { min-width: 0; }
.file-row .tag, .file-row .muted { flex: none; }

/* ---- what the PC checked about a run itself (gate.py; ROADMAP R-1 to R-11) ---- */
.gate { display: grid; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.gate-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.gate-what { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-width: 0; }
.gate-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.gate-list { margin: 4px 0 6px; padding-left: 18px; font-size: 13px; }
.gate-list li { margin: 2px 0; overflow-wrap: anywhere; }
.gate-out { display: grid; gap: 4px; }
.gate-out .term-out { max-height: 260px; overflow: auto; }
.gate .review-text { max-height: 340px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.gate .callout.block { margin: 0; }
.live-quiet { margin-left: 8px; }
.part-files code { overflow-wrap: anywhere; }
.works-table th .small { font-weight: 400; }
@media (max-width: 640px) {
  .gate-row { flex-direction: column; align-items: stretch; }
  .gate-acts > button { flex: 1 1 auto; }
}
