:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --accent: #1677ff;
  --bg: #f7f8fa;
  --border: rgba(31, 35, 40, 0.11);
  --card: rgba(255, 255, 255, 0.9);
  --muted: #667085;
  --sidebar: #fafbfc;
  --text: #1f2328;
  --palette-blue-cell-bg: linear-gradient(145deg, rgba(22, 119, 255, .065), rgba(255, 255, 255, .42));
  --palette-blue-cell-border: rgba(22, 119, 255, .14);
  --palette-violet-cell-bg: linear-gradient(145deg, rgba(135, 91, 247, .075), rgba(255, 255, 255, .38));
  --palette-violet-cell-border: rgba(135, 91, 247, .16);
  --palette-teal-cell-bg: linear-gradient(145deg, rgba(12, 153, 128, .07), rgba(255, 255, 255, .4));
  --palette-teal-cell-border: rgba(12, 153, 128, .16);
  --aggregate-sidebar-width: 345px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }
.aggregate-shell { height: 100%; }

.aggregate-sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  left: 0;
  position: fixed;
  top: 0;
  width: var(--aggregate-sidebar-width);
  z-index: 40;
}
.sidebar-header, .board-header, .new-topic-dialog header, .new-topic-dialog footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.sidebar-header { padding: 18px 16px 12px; }
.sidebar-header-actions, .board-header-actions { align-items: center; display: flex; gap: 8px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
h1, h2, p { margin: 0; }
h1 { font-size: 22px; letter-spacing: -.04em; }
h2 { font-size: 24px; letter-spacing: -.03em; }
.icon-button {
  align-items: center; background: transparent; border: 1px solid var(--border); border-radius: 9px;
  cursor: pointer; display: inline-flex; font-size: 20px; height: 34px; justify-content: center; width: 34px;
}
.icon-button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.board-button {
  align-items: center; background: transparent; border: 0; border-radius: 8px; cursor: pointer;
  display: flex; gap: 9px; margin: 0 10px 8px; min-height: 38px; padding: 0 11px; text-align: left;
}
.board-button:hover, .board-button.active { background: rgba(22, 119, 255, .09); color: var(--accent); }
.search-box {
  align-items: center; background: rgba(127, 127, 127, .07); border: 1px solid transparent;
  border-radius: 9px; display: flex; gap: 7px; margin: 0 10px 9px; min-height: 36px; padding: 0 10px;
}
.search-box:focus-within { border-color: rgba(22, 119, 255, .5); }
.search-box input { background: transparent; border: 0; color: inherit; min-width: 0; outline: 0; width: 100%; }
.topic-tree { flex: 1; overflow: auto; padding: 0 7px 12px; scrollbar-width: thin; }
.machine-group, .folder-group { margin: 3px 0; }
.machine-group > summary, .folder-group > summary { cursor: pointer; list-style: none; }
.machine-group > summary::-webkit-details-marker, .folder-group > summary::-webkit-details-marker { display: none; }
.machine-summary {
  align-items: center; display: flex; font-size: 13px; font-weight: 750; gap: 8px; min-height: 38px; padding: 0 8px;
}
.machine-summary::before, .folder-summary::before { content: "›"; display: inline-block; transition: transform .14s ease; }
details[open] > .machine-summary::before, details[open] > .folder-summary::before { transform: rotate(90deg); }
.machine-count { color: var(--muted); font-size: 11px; font-weight: 500; margin-left: auto; }
.machine-mark { border-radius: 50%; height: 8px; width: 8px; }
.machine-mark.palette-blue { background: #1677ff; }
.machine-mark.palette-violet { background: #875bf7; }
.machine-mark.palette-teal { background: #0c9980; }
.machine-mark.palette-amber, .skill-viewer-machine-dot.palette-amber { background: #bc8336; }
.folder-group { margin-left: 14px; }
.folder-summary {
  color: var(--muted); display: flex; font-size: 11px; gap: 6px; min-height: 30px; padding: 7px 8px 5px;
}
.folder-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-item { align-items: center; display: flex; gap: 2px; min-width: 0; }
.topic-link {
  align-items: center; background: transparent; border: 0; border-radius: 7px; cursor: pointer;
  display: grid; flex: 1; gap: 6px; grid-template-columns: minmax(0, 1fr) auto; margin: 1px 0; min-height: 36px;
  min-width: 0; padding: 6px 7px 6px 21px; text-align: left;
}
.topic-link:hover, .topic-link.active { background: rgba(127, 127, 127, .09); }
.topic-link.active { box-shadow: inset 2px 0 var(--accent); }
.topic-title { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-link-meta, .board-topic-meta-leading, .topic-running {
  align-items: center; display: inline-flex;
}
.topic-link-meta, .board-topic-meta-leading { gap: 6px; }
.topic-running { height: 17px; justify-content: center; width: 12px; }
.topic-running-dot {
  animation: topic-working-pulse 1.2s ease-in-out infinite; background: linear-gradient(135deg, #69b1ff, #1677ff);
  border-radius: 50%; box-shadow: 0 0 0 0 rgba(22, 119, 255, .42); height: 8px; width: 8px;
}
@keyframes topic-working-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 119, 255, .4); opacity: 1; transform: scale(1); }
  50% { box-shadow: 0 0 0 4px rgba(22, 119, 255, 0); opacity: .58; transform: scale(.72); }
}
.topic-archive {
  align-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--muted);
  cursor: pointer; display: inline-flex; flex: none; height: 28px; justify-content: center; padding: 0; width: 28px;
}
.topic-archive:hover, .topic-archive:focus-visible { background: rgba(217, 45, 32, .09); color: #d92d20; }
.topic-archive:disabled { cursor: not-allowed; opacity: .4; }
.topic-delete { border:0; border-radius:6px; background:transparent; color:#b42318; padding:5px 7px; font:inherit; font-size:12px; cursor:pointer; flex-shrink:0; }
.topic-delete:hover, .topic-delete:focus-visible { background:rgba(217,45,32,.1); }
.topic-delete:disabled { opacity:.4; cursor:not-allowed; }
.board-topic-item > .topic-delete { position:absolute; bottom:7px; right:36px; }
.board-topic-item .board-topic { padding-bottom:35px; }
.topic-archive svg { height: 15px; width: 15px; }
.topic-archive.pending svg { display: none; }
.topic-archive.pending::after {
  animation: archive-spin .7s linear infinite; border: 1.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%; content: ""; height: 12px; width: 12px;
}
.topic-unarchive {
  align-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--accent);
  cursor: pointer; display: inline-flex; height: 28px; justify-content: center; padding: 0; width: 28px;
}
.topic-unarchive:hover, .topic-unarchive:focus-visible { background: rgba(22, 119, 255, .1); }
.topic-unarchive:disabled { cursor: wait; opacity: .55; }
.topic-unarchive svg { height: 16px; width: 16px; }
.topic-unarchive.pending svg { display: none; }
.topic-unarchive.pending::after {
  animation: archive-spin .7s linear infinite; border: 1.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%; content: ""; height: 12px; width: 12px;
}
@keyframes archive-spin { to { transform: rotate(360deg); } }
.agent-badge {
  border: 1px solid currentColor; border-radius: 999px; font-size: 9px; font-weight: 750; letter-spacing: .02em;
  line-height: 17px; opacity: .82; padding: 0 5px; white-space: nowrap;
}
.agent-badge.codex { color: #087443; }
.agent-badge.claude-code { color: #bd5b26; }
.sidebar-footer {
  align-items: center; border-top: 1px solid var(--border); color: var(--muted); display: flex;
  font-size: 10px; gap: 7px; min-height: 40px; padding: 0 11px;
}
.sync-dot { background: #98a2b3; border-radius: 50%; flex: none; height: 8px; width: 8px; }
.sync-dot.live, .sync-dot.syncing {
  animation: global-heartbeat 1.8s ease-out infinite; background: linear-gradient(135deg, #69b1ff, #1677ff);
}
.sync-dot.syncing { animation-duration: .85s; }
.sync-dot.paused { background: #98a2b3; }
.sync-dot.error { background: #d92d20; }
@keyframes global-heartbeat {
  0%, 35% { box-shadow: 0 0 0 0 rgba(22, 119, 255, .42); opacity: 1; }
  75%, 100% { box-shadow: 0 0 0 5px rgba(22, 119, 255, 0); opacity: .72; }
}

.aggregate-main { height: 100%; }
.paper-launch-mode .board-view {
  align-items: center;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}
.paper-launch-mode .board-view::before {
  color: var(--muted);
  content: "正在准备论文 Agent 对话…";
  font-size: 12px;
}
.paper-launch-mode .dashboard-overview,
.paper-launch-mode .dashboard-workspace,
.paper-launch-mode .conversation-back { display: none !important; }
.paper-launch-mode .conversation-context {
  left: 8px;
  max-width: calc(100% - 16px);
  right: 8px;
}
.agent-frame { background: var(--bg); border: 0; height: 100%; inset: 0; position: fixed; width: 100%; z-index: 1; }
.agent-frame[hidden] { display: none; }
.agent-frame[data-background-bridge] { opacity: 0; pointer-events: none; }
.board-view {
  background:
    radial-gradient(circle at 14% 10%, rgba(22, 119, 255, .09), transparent 28%),
    radial-gradient(circle at 85% 7%, rgba(135, 91, 247, .08), transparent 25%), var(--bg);
  height: 100%; left: 0; overflow: auto; padding: 28px clamp(20px, 4vw, 64px) 64px; position: fixed;
  overscroll-behavior-y: contain; right: 0; scrollbar-gutter: stable; top: 0; z-index: 5;
}
.board-view[hidden] { display: none; }
.file-link-preview { display: block; width: min(240px, 100%); height: 150px; margin: 8px 0;
  padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: rgba(127,127,127,.04);
  color: var(--muted); font: inherit; font-size: 11px; cursor: zoom-in; overflow: hidden; }
.file-link-preview:disabled { cursor: default; }
.file-link-thumbnail { width: 100%; height: 100%; object-fit: contain; }
.file-preview-dialog { width: min(1100px, 96vw); max-width: 96vw; height: 90dvh; max-height: 90dvh;
  padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text); }
.file-preview-dialog::backdrop { background: rgba(0,0,0,.6); }
.file-preview-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.file-preview-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 60px; }
.file-preview-toolbar button { border: 1px solid var(--border); background: transparent; color: inherit;
  border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.file-preview-page { color: var(--muted); font-size: 12px; }
.file-preview-stage { overflow: auto; height: calc(100% - 72px); padding: 12px; }
.file-preview-large { display: block; width: 100%; max-width: none; height: auto; }
.dashboard-overview {
  padding-bottom: 0;
}
.dashboard-overview + .dashboard-workspace {
  padding-top: 0;
}
.board-view[data-dashboard-page="topics"] #machine-board,
.board-view[data-dashboard-page="machines"] #dashboard-workspace { display: none; }
.dashboard-page-toggle { flex-shrink:0; white-space:nowrap; }
.workspace-toolbar {
  align-items: center; display: grid; gap: 16px; grid-template-columns: auto minmax(120px, 1fr) auto;
  margin: 0 auto 24px; max-width: 1320px;
}
.workspace-toolbar h2 { font-size: 26px; }
.workspace-toolbar > div:first-child { display:flex; align-items:center; gap:10px; }
.dashboard-usage {
  display:inline-flex; flex:none; align-items:center; gap:5px; height:24px;
  padding:0 7px; border:1px solid var(--border); border-radius:7px;
  color:var(--muted); background:var(--card); font-size:10px; font-weight:400;
  white-space:nowrap; text-decoration:none; font-variant-numeric:tabular-nums;
}
.dashboard-usage strong { color:var(--accent); font-size:11px; min-width:4ch; text-align:right; }
.dashboard-usage[data-stale="true"] strong { color:var(--muted); }
.dashboard-usage:hover { border-color:var(--accent); }
.dashboard-usage select { max-width:90px; background:transparent; color:inherit; border:0; font:inherit; }
.workspace-search { margin: 0; min-width: 0; max-width: 320px; width: 100%; }
.workspace-actions { align-items: center; display: flex; gap: 10px; justify-content: flex-end; }
.global-heartbeat {
  align-items: center; color: var(--muted); display: inline-flex; font-size: 10px; gap: 7px;
  min-height: 36px; white-space: nowrap;
}
.interface-toggle, .cell-layout-toggle {
  align-items: center; color: var(--muted); cursor: pointer; display: inline-flex; font-size: 10px; gap: 7px;
  min-height: 36px; white-space: nowrap;
}
.process-toggle { display:none !important; }
.interface-toggle { border:0; background:transparent; padding:0; }
.interface-toggle[aria-checked="true"] .toggle-track { background:var(--accent); }
.interface-toggle[aria-checked="true"] .toggle-track span { transform:translateX(15px); }
.interface-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:4px; }
.theme-toggle {
  align-items: center; color: var(--muted); cursor: pointer; display: inline-flex; gap: 5px;
  min-height: 36px;
}
.theme-toggle input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.theme-toggle input:checked + .toggle-track { background: #5b6472; }
.theme-toggle input:checked + .toggle-track span { transform: translateX(15px); }
.theme-toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(22, 119, 255, .16); }
.theme-symbol { font-size: 12px; line-height: 1; }
.push-toggle {
  align-items: center; background: rgba(127, 127, 127, .055); border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer; display: inline-flex; flex: none; font-size: 15px; height: 34px;
  justify-content: center; padding: 0; position: relative; width: 34px;
}
.push-toggle[hidden] { display: none; }
.push-toggle:hover, .push-toggle:focus-visible { border-color: rgba(22, 119, 255, .45); outline: 0; }
.push-toggle:focus-visible { box-shadow: 0 0 0 3px rgba(22, 119, 255, .13); }
.push-toggle:disabled { cursor: wait; opacity: .62; }
.push-toggle-dot {
  background: #98a2b3; border: 2px solid var(--card); border-radius: 50%; bottom: 5px; height: 8px;
  position: absolute; right: 5px; width: 8px;
}
.push-toggle[data-state="enabled"] .push-toggle-dot { background: #12a150; }
.push-toggle[data-state="denied"] .push-toggle-dot { background: #d99000; }
.push-toggle[data-state="error"] .push-toggle-dot { background: #d92d20; }
.push-toggle[data-state="busy"] .push-toggle-dot {
  animation: global-heartbeat .85s ease-out infinite; background: var(--accent);
}
.process-toggle input, .cell-layout-toggle input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.toggle-track {
  background: rgba(127, 127, 127, .24); border-radius: 999px; display: inline-flex; height: 20px;
  padding: 2px; transition: background .16s; width: 35px;
}
.toggle-track span { background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .22); height: 16px; transition: transform .16s; width: 16px; }
.process-toggle input:checked + .toggle-track, .cell-layout-toggle input:checked + .toggle-track { background: var(--accent); }
.process-toggle input:checked + .toggle-track span, .cell-layout-toggle input:checked + .toggle-track span { transform: translateX(15px); }
.process-toggle input:focus-visible + .toggle-track, .cell-layout-toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(22, 119, 255, .16); }
.board-header { gap: 24px; margin: 0 auto 28px; max-width: 1320px; }
.primary-button, .secondary-button {
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer; min-height: 38px; padding: 0 15px;
}
.primary-button { background: var(--accent); border-color: var(--accent); color: #fff; }
.secondary-button { background: transparent; }
.machine-board { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: auto; max-width: 1320px; }
.dashboard-workspace {
  display: grid; gap: 20px; margin: 20px auto 0; max-width: 1320px; min-width: 0;
}
.dashboard-topics { min-width: 0; }
.notification-rail {
  left: max(8px, env(safe-area-inset-left)); min-width: 0; position: fixed; top: 50%;
  transform: translateY(-50%); width: 44px; z-index: 18;
}
.notification-rail[hidden] { display: none; }
.notification-rail-toggle {
  align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 13px;
  box-shadow: 0 7px 24px rgba(0, 0, 0, .14); color: inherit; cursor: pointer; display: inline-flex;
  font-size: 17px; height: 44px; justify-content: center; padding: 0; position: relative; width: 44px;
}
.notification-rail-toggle:hover, .notification-rail-toggle:focus-visible {
  border-color: rgba(22, 119, 255, .46); outline: 0;
}
.notification-rail-dot {
  background: #e5484d; border: 2px solid var(--card); border-radius: 50%; height: 9px;
  position: absolute; right: 5px; top: 5px; width: 9px;
}
.notification-rail-count {
  background: #d92d20; border: 2px solid var(--card); border-radius: 999px; color: #fff;
  font-size: 8px; font-weight: 750; line-height: 15px; min-width: 19px; padding: 0 3px;
  position: absolute; right: -7px; text-align: center; top: -7px;
}
.notification-rail:not([data-expanded="true"]) .notification-board { display: none; }
.notification-rail[data-expanded="true"] {
  display: flex; flex-direction: column; gap: 7px; max-height: calc(100vh - 32px);
  overflow: auto; scrollbar-width: thin; top: max(16px, env(safe-area-inset-top)); transform: none;
  width: min(320px, calc(100vw - 24px));
}
.notification-rail[data-expanded="true"] .notification-rail-toggle { flex: none; }
.board-column { background: var(--card); border: 1px solid var(--border); border-radius: 15px; min-width: 0; overflow: hidden; }
.board-column-header { align-items: center; border-bottom: 1px solid var(--border); display: flex; gap: 10px; padding: 16px 17px; }
.board-column-header h3 { font-size: 16px; margin: 0; }
.board-column-header .machine-cells-toggle { margin-left: auto; flex-shrink: 0; font-size: 11px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.board-column-header .machine-cells-toggle[aria-pressed="true"] { color: var(--text); background: var(--border); }
#topic-cells.hide-machine-palette-blue > [data-machine="palette-blue"],
#topic-cells.hide-machine-palette-violet > [data-machine="palette-violet"],
#topic-cells.hide-machine-palette-teal > [data-machine="palette-teal"],
#topic-cells.hide-machine-palette-amber > [data-machine="palette-amber"] { display: none !important; }
.board-column-header > span:last-of-type { color: var(--muted); font-size: 11px; margin-left: auto; }
.board-folders { display: grid; gap: 14px; padding: 15px; }
.board-folder h4 { color: var(--muted); font-size: 11px; margin: 0 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-topic-grid { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.board-topic-item { min-width: 0; position: relative; }
.board-topic {
  background: rgba(127, 127, 127, .045); border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
  min-height: 68px; padding: 10px 48px 10px 10px; text-align: left; width: 100%;
}
.board-topic:hover { border-color: rgba(22, 119, 255, .46); transform: translateY(-1px); }
.board-topic-item.archived .board-topic { opacity: .76; padding-right: 44px; }
.board-topic-item.archived .board-topic:hover { opacity: 1; }
.board-topic-archive { bottom: 7px; position: absolute; right: 6px; }
.board-topic-unarchive { bottom: 7px; position: absolute; right: 7px; }
.board-topic-title-row { align-items: center; display: flex; gap: 7px; margin-bottom: 8px; min-width: 0; }
.board-topic-title { display: block; flex: 1; font-size: 12px; font-weight: 650; line-height: 1.4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-topic-meta { align-items: center; color: var(--muted); display: flex; font-size: 10px; justify-content: space-between; }
.board-hidden-folder { border-top: 1px solid var(--border); padding-top: 10px; }
.board-hidden-summary {
  align-items: center; color: var(--muted); cursor: pointer; display: flex; font-size: 10px; gap: 6px;
  list-style: none; min-height: 30px; padding: 0 3px; user-select: none;
}
.board-hidden-summary::-webkit-details-marker { display: none; }
.board-hidden-chevron { font-size: 16px; line-height: 1; transition: transform .14s ease; }
.board-hidden-folder[open] .board-hidden-chevron { transform: rotate(90deg); }
.board-hidden-label { color: var(--text); font-size: 11px; font-weight: 650; }
.board-hidden-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-hidden-count { margin-left: auto; }
.board-hidden-topic-grid { margin-top: 8px; }
.archive-pager { align-items: center; display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.archive-pager button { background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text); cursor: pointer; font-size: 11px; min-height: 30px; padding: 3px 9px; }
.archive-pager button:hover:not(:disabled) { border-color: rgba(22, 119, 255, .46); }
.archive-pager button:disabled { cursor: default; opacity: .4; }
.archive-page-range, .archive-page-error { color: var(--muted); font-size: 11px; }
.archive-page-error { margin-top: 6px; text-align: center; }
.empty-state { color: var(--muted); font-size: 12px; padding: 18px; }

.conversation-context {
  align-items: center; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 6px 22px rgba(0, 0, 0, .09); display: flex; gap: 8px;
  left: 118px; min-height: 40px; padding: 4px 7px; position: fixed; top: 8px; z-index: 20;
}
.conversation-context[hidden] { display: none; }
.context-selectors { align-items: center; display: flex; gap: 6px; }
.context-pill, .context-selectors select {
  background: rgba(127, 127, 127, .07); border: 1px solid var(--border); border-radius: 7px; color: inherit;
  font-size: 11px; min-height: 28px; padding: 0 8px;
}

.new-topic-dialog { background: var(--card); border: 1px solid var(--border); border-radius: 16px; color: inherit; max-width: 520px; padding: 0; width: calc(100% - 28px); }
.new-topic-dialog::backdrop { background: rgba(11, 18, 32, .42); backdrop-filter: blur(3px); }
.new-topic-dialog form { padding: 20px; }
.new-topic-dialog header { margin-bottom: 18px; }
.new-topic-dialog h2 { font-size: 20px; }
.new-topic-dialog fieldset { border: 0; margin: 0 0 16px; padding: 0; }
.new-topic-dialog legend { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.choice-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-card { position: relative; }
.choice-card input { opacity: 0; position: absolute; }
.choice-card span {
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; display: block; font-size: 12px;
  min-height: 58px; padding: 10px;
}
.choice-card strong, .choice-card small { display: block; }
.choice-card small { color: var(--muted); margin-top: 4px; }
.choice-card input:checked + span { background: rgba(22, 119, 255, .08); border-color: var(--accent); }
.directory-field { display: grid; gap: 6px; }
.directory-field input {
  background: rgba(127, 127, 127, .06); border: 1px solid var(--border); border-radius: 9px; color: inherit;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; min-height: 40px;
  outline: 0; padding: 0 11px; width: 100%;
}
.directory-field input:focus { border-color: rgba(22, 119, 255, .62); box-shadow: 0 0 0 3px rgba(22, 119, 255, .09); }
.directory-field input:invalid:not(:placeholder-shown) { border-color: rgba(217, 45, 32, .62); }
.directory-field span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.directory-browser { border: 1px solid var(--border); border-radius: 10px; margin-top: 9px; overflow: hidden; }
.directory-browser-toolbar {
  align-items: center; background: rgba(127, 127, 127, .045); border-bottom: 1px solid var(--border);
  display: flex; gap: 5px; min-height: 38px; padding: 5px 7px;
}
.directory-tool {
  background: var(--card); border: 1px solid var(--border); border-radius: 7px; color: inherit; cursor: pointer;
  flex: none; font-size: 10px; min-height: 27px; padding: 0 8px;
}
.directory-tool:hover:not(:disabled) { border-color: rgba(22, 119, 255, .45); color: var(--accent); }
.directory-tool:disabled { cursor: default; opacity: .42; }
.directory-browser-path {
  color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px;
  margin-left: auto; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.directory-list { max-height: 220px; min-height: 72px; overflow: auto; padding: 5px; scrollbar-width: thin; }
.directory-entry {
  align-items: center; background: transparent; border: 0; border-radius: 7px; color: inherit; cursor: pointer;
  display: flex; font-size: 11px; gap: 8px; min-height: 32px; padding: 4px 8px; text-align: left; width: 100%;
}
.directory-entry::before { color: #d99000; content: "▰"; flex: none; font-size: 12px; transform: skewX(-6deg); }
.directory-entry::after { color: var(--muted); content: "›"; margin-left: auto; }
.directory-entry:hover, .directory-entry:focus-visible { background: rgba(22, 119, 255, .08); outline: 0; }
.directory-entry span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-browser-status { color: var(--muted); font-size: 9px; min-height: 25px; padding: 5px 9px 7px; }
.directory-browser-status.error { color: #d92d20; }
.directory-browser-status.loading::before {
  animation: archive-spin .7s linear infinite; border: 1.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%; content: ""; display: inline-block; height: 9px; margin-right: 6px; vertical-align: -1px; width: 9px;
}
.new-topic-dialog footer { gap: 8px; justify-content: flex-end; margin-top: 20px; }
.mobile-menu, .sidebar-scrim { display: none; }

.conversation-back {
  align-items: center; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 5px 18px rgba(0, 0, 0, .08); cursor: pointer; display: inline-flex;
  font-size: 11px; font-weight: 700; gap: 7px; left: 10px; min-height: 40px; padding: 0 13px;
  position: fixed; top: 8px; z-index: 22;
}
.conversation-back[hidden] { display: none; }
.conversation-back:hover { border-color: rgba(22, 119, 255, .42); color: var(--accent); }

.notification-board {
  background: var(--card); border: 1px solid var(--border); border-radius: 15px; margin: 0;
  max-width: none; overflow: hidden;
}
.notification-board[hidden], .notification-list[hidden] { display: none; }
.notification-board.arrived { animation: notification-arrived 1.1s ease-out; }
.notification-board > header {
  align-items: center; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between;
  padding: 16px 18px;
}
.notification-board h2 { font-size: 20px; margin-top: 2px; }
.notification-unread-summary {
  background: rgba(127, 127, 127, .09); border-radius: 999px; color: var(--muted); font-size: 10px;
  font-weight: 700; padding: 5px 9px;
}
.notification-unread-summary.has-unread { background: rgba(217, 45, 32, .1); color: #d92d20; }
.notification-actions { align-items: center; display: flex; gap: 8px; }
.notification-clear {
  background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
  cursor: pointer; font-size: 10px; min-height: 27px; padding: 0 9px;
}
.notification-clear:hover, .notification-clear:focus-visible { border-color: rgba(22, 119, 255, .4); color: var(--accent); }
.notification-clear:disabled { cursor: wait; opacity: .55; }
.notification-group { padding: 13px 15px 15px; }
.notification-group + .notification-group { border-top: 1px solid var(--border); }
.notification-list { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.notification-empty {
  color: var(--muted); font-size: 11px; grid-column: 1 / -1; padding: 18px 10px; text-align: center;
}
.notification-item {
  align-items: flex-start; background: rgba(127, 127, 127, .045); border: 1px solid var(--border);
  border-radius: 13px; color: inherit; cursor: pointer; display: grid; gap: 10px;
  grid-template-columns: 10px minmax(0, 1fr); min-width: 0; padding: 12px 13px; text-align: left; width: 100%;
}
.notification-item:hover { border-color: rgba(22, 119, 255, .4); transform: translateY(-1px); }
.notification-item.unread { background: rgba(217, 45, 32, .045); border-color: rgba(217, 45, 32, .17); }
.notification-state-dot { border-radius: 50%; height: 8px; margin-top: 5px; width: 8px; }
.notification-item.unread .notification-state-dot { background: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, .12); }
.notification-copy { min-width: 0; }
.notification-topic { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-message { color: var(--muted); display: block; font-size: 11px; line-height: 1.45; margin-top: 3px; }
.notification-meta { align-items: center; color: var(--muted); display: flex; font-size: 9px; gap: 7px; margin-top: 7px; }
@keyframes notification-arrived {
  0% { border-color: rgba(229, 72, 77, .68); box-shadow: 0 0 0 0 rgba(229, 72, 77, .22); transform: translateY(8px); }
  45% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); }
  100% { border-color: var(--border); transform: translateY(0); }
}

.skill-viewer-rail {
  bottom: max(16px, env(safe-area-inset-bottom)); position: fixed;
  right: max(14px, env(safe-area-inset-right)); z-index: 32;
}
.skill-viewer-toggle, .skill-viewer-collapse, .skill-viewer-back {
  align-items: center; background: color-mix(in srgb, var(--card) 96%, transparent);
  border: 1px solid var(--border); color: inherit; cursor: pointer; display: inline-flex;
  justify-content: center;
}
.skill-viewer-toggle {
  border-radius: 12px; box-shadow: 0 7px 24px rgba(0, 0, 0, .14); font-size: 18px;
  height: 42px; padding: 0; width: 42px;
}
.skill-viewer-toggle:hover, .skill-viewer-toggle:focus-visible,
.skill-viewer-collapse:hover, .skill-viewer-collapse:focus-visible,
.skill-viewer-back:hover, .skill-viewer-back:focus-visible {
  border-color: rgba(22, 119, 255, .46); color: var(--accent); outline: 0;
}
.skill-viewer-rail[data-open="true"] .skill-viewer-toggle { display: none; }
.skill-viewer-panel {
  background: color-mix(in srgb, var(--card) 97%, transparent); border: 1px solid var(--border);
  border-radius: 15px; bottom: max(14px, env(safe-area-inset-bottom)); box-shadow: 0 14px 42px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column; max-height: calc(100vh - 92px); overflow: hidden;
  position: fixed; right: max(14px, env(safe-area-inset-right)); top: 70px;
  width: min(330px, calc(100vw - 28px));
}
.skill-viewer-panel[hidden] { display: none; }
.skill-viewer-header {
  align-items: center; border-bottom: 1px solid var(--border); display: flex; flex: none;
  gap: 7px; min-height: 48px; padding: 7px 8px 7px 12px;
}
.skill-viewer-header h2 { font-size: 17px; letter-spacing: -.02em; }
.skill-viewer-sync {
  color: var(--muted); font-size: 8px; margin-left: auto; max-width: 105px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.skill-viewer-sync[data-tone="live"]::before,
.skill-viewer-sync[data-tone="stale"]::before,
.skill-viewer-sync[data-tone="error"]::before {
  background: #12a150; border-radius: 50%; content: ""; display: inline-block; height: 6px;
  margin-right: 5px; vertical-align: 1px; width: 6px;
}
.skill-viewer-sync[data-tone="stale"]::before { background: #d99000; }
.skill-viewer-sync[data-tone="error"]::before { background: #d92d20; }
.skill-viewer-collapse, .skill-viewer-back {
  border-radius: 8px; flex: none; font-size: 22px; height: 31px; line-height: 1; padding: 0; width: 31px;
}
.skill-viewer-back { font-size: 25px; }
.skill-viewer-back[hidden] { display: none; }
.skill-viewer-list-view, .skill-viewer-detail {
  min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px; scrollbar-width: thin;
}
.skill-viewer-list-view[hidden], .skill-viewer-detail[hidden] { display: none; }
.skill-viewer-machines { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-viewer-machines button {
  background: rgba(127, 127, 127, .055); border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); cursor: pointer; flex: 1 1 auto; font-size: 8px; min-height: 26px;
  padding: 0 7px;
}
.skill-viewer-machines button:hover, .skill-viewer-machines button:focus-visible {
  border-color: rgba(22, 119, 255, .4); color: var(--accent); outline: 0;
}
.skill-viewer-machines button[aria-pressed="true"] {
  background: rgba(22, 119, 255, .1); border-color: rgba(22, 119, 255, .35); color: var(--accent);
}
.skill-viewer-search {
  align-items: center; background: rgba(127, 127, 127, .055); border: 1px solid var(--border);
  border-radius: 9px; display: flex; gap: 6px; margin-top: 8px; min-height: 32px; padding: 0 8px;
}
.skill-viewer-search:focus-within { border-color: rgba(22, 119, 255, .48); }
.skill-viewer-search input {
  background: transparent; border: 0; color: inherit; font-size: 10px; min-width: 0; outline: 0; width: 100%;
}
.skill-viewer-context {
  color: var(--muted); font-size: 8px; line-height: 1.4; margin: 8px 2px 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.skill-viewer-context[hidden] { display: none; }
.skill-viewer-list { display: grid; gap: 6px; margin-top: 8px; }
.skill-viewer-empty, .skill-viewer-error {
  color: var(--muted); font-size: 10px; line-height: 1.55; padding: 20px 8px; text-align: center;
}
.skill-viewer-error { color: #c47a12; }
.skill-viewer-device-error {
  align-items: center; background: rgba(217, 144, 0, .06); border: 1px solid rgba(217, 144, 0, .18);
  border-radius: 9px; color: #b56e00; display: flex; font-size: 8px; justify-content: space-between;
  padding: 7px 8px;
}
.skill-viewer-item {
  background: rgba(127, 127, 127, .04); border: 1px solid var(--border); border-radius: 10px;
  color: inherit; cursor: pointer; display: grid; gap: 4px; min-width: 0; padding: 9px 10px;
  text-align: left; width: 100%;
}
.skill-viewer-item:hover, .skill-viewer-item:focus-visible {
  border-color: rgba(22, 119, 255, .42); outline: 0; transform: translateY(-1px);
}
.skill-viewer-item-title { align-items: center; display: flex; gap: 6px; min-width: 0; }
.skill-viewer-item-name {
  flex: 1; font-size: 11px; font-weight: 750; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.skill-viewer-item-description {
  color: var(--muted); display: -webkit-box; font-size: 9px; line-height: 1.42; overflow: hidden;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.skill-viewer-item-meta { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 8px; gap: 5px; }
.skill-viewer-machine-dot { border-radius: 50%; display: inline-block; height: 6px; width: 6px; }
.skill-viewer-machine-dot.palette-blue { background: #1677ff; }
.skill-viewer-machine-dot.palette-violet { background: #875bf7; }
.skill-viewer-machine-dot.palette-teal { background: #0c9980; }
.skill-viewer-scope {
  background: rgba(127, 127, 127, .09); border-radius: 999px; color: var(--muted); padding: 2px 5px;
}
.skill-viewer-detail { font-size: 10px; line-height: 1.55; }
.skill-viewer-detail-heading { border-bottom: 1px solid var(--border); margin-bottom: 12px; padding: 2px 2px 10px; }
.skill-viewer-detail-heading h3 { font-size: 15px; margin: 0 0 5px; overflow-wrap: anywhere; }
.skill-viewer-detail-description { color: var(--muted); font-size: 9px; line-height: 1.5; margin-top: 7px; }
.skill-viewer-detail .cell-markdown { overflow-wrap: anywhere; }
.skill-viewer-detail-loading { color: var(--muted); padding: 26px 8px; text-align: center; }

.topic-cell-board {
  margin: 0; max-width: none;
}
.topic-cells { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-cell-columns="2"] .topic-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-cell-columns="3"] .topic-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.topic-cell {
  background: rgba(127, 127, 127, .035); border: 1px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; min-height: 400px; min-width: 0; overflow: hidden;
}
@media (min-width: 721px) {
  html[data-cell-columns="3"] .topic-cell:not([data-expanded="true"]) { min-height: 600px; }
  html[data-cell-columns="3"] .topic-cell:not([data-expanded="true"]) .topic-cell-messages { max-height: 498px; }
}
@supports (content-visibility: auto) {
  .topic-cell { contain-intrinsic-block-size: auto 400px; content-visibility: auto; }
  @media (min-width: 721px) {
    html[data-cell-columns="3"] .topic-cell:not([data-expanded="true"]) {
      contain-intrinsic-block-size: auto 600px;
    }
  }
}
.topic-cell[data-expanded="true"] {
  grid-column: 1 / -1;
  min-height: var(--topic-cell-expanded-min-height, 460px);
}
html[data-cell-columns] .topic-cell[data-expanded="true"] { grid-column: span 2; }
.topic-cell[data-expanded="true"] .topic-cell-messages { max-height: 648px; min-height: 304px; }
.topic-cell[data-machine="palette-blue"] {
  background: var(--palette-blue-cell-bg);
  border-color: var(--palette-blue-cell-border);
}
.topic-cell[data-machine="palette-violet"] {
  background: var(--palette-violet-cell-bg);
  border-color: var(--palette-violet-cell-border);
}
.topic-cell[data-machine="palette-teal"] {
  background: var(--palette-teal-cell-bg);
  border-color: var(--palette-teal-cell-border);
}
.topic-cell[data-machine="palette-amber"] {
  background: linear-gradient(145deg, rgba(188, 131, 54, .10), var(--card));
  border-color: rgba(188, 131, 54, .25);
}
.topic-cell:hover { border-color: rgba(22, 119, 255, .3); }
.topic-cell[data-unread="true"] { box-shadow: inset 3px 0 rgba(229, 72, 77, .72); }
.topic-cell.notification-focus {
  animation: notification-cell-focus 1.8s ease-out; border-color: rgba(22, 119, 255, .78);
  box-shadow: 0 0 0 5px rgba(22, 119, 255, .13);
}
@keyframes notification-cell-focus {
  0%, 28% { border-color: rgba(22, 119, 255, .78); box-shadow: 0 0 0 5px rgba(22, 119, 255, .13); }
  100% { border-color: var(--border); box-shadow: none; }
}
.topic-cell-header { align-items: flex-start; border-bottom: 1px solid var(--border); display: flex; gap: 6px; padding: 7px 10px 6px; }
.topic-cell-heading { flex: 1; min-width: 0; }
.topic-cell-category {
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); cursor: pointer; flex: none; font: inherit; font-size: 9px;
  max-width: 90px; min-height: 22px; padding: 1px 3px 1px 6px;
}
.topic-cell-category option { background: var(--bg); color: var(--text); }
.topic-cell-category:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-cell-category:disabled { cursor: wait; opacity: .6; }
.topic-category-badge { color: var(--muted); font-size: 9px; white-space: nowrap; }
.topic-cell-title-row { align-items: center; display: flex; gap: 7px; min-width: 0; }
.topic-cell-title {
  background: transparent; border: 0; color: inherit; cursor: text; display: block; font: inherit; font-size: 13px;
  font-weight: 750; line-height: 1.25; max-width: 100%; overflow: hidden; padding: 0 17px 0 0; position: relative; text-align: left;
  text-overflow: ellipsis; white-space: nowrap; width: 100%;
}
.topic-cell-title-row .topic-cell-title { flex: 1; min-width: 0; width: auto; }
.cell-id-copy { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 16px; padding: 0; border: 0; border-radius: 4px; background: transparent;
  color: var(--muted); cursor: pointer; opacity: .65; vertical-align: middle; }
.cell-id-copy svg { width: 14px; height: 14px; }
.cell-id-copy:hover, .cell-id-copy:focus-visible { opacity: 1; background: rgba(127,127,127,.12); }
.cell-id-copy[data-state="copied"] { color: #16a05d; opacity: 1; }
.cell-id-copy[data-state="error"] { color: #d43838; opacity: 1; }
#notification-title { display: inline; }
.topic-working-spinner {
  animation: cell-title-spin .75s linear infinite; border: 2px solid rgba(22, 119, 255, .2);
  border-radius: 50%; border-top-color: var(--accent); flex: none; height: 13px; width: 13px;
}
.topic-working-spinner[hidden] { display: none; }
.cell-message-working { display: flex; align-items: center; min-height: 20px; padding: 4px 6px; flex: none; }
.cell-message-working[hidden] { display: none; }
@keyframes cell-title-spin { to { transform: rotate(360deg); } }
.topic-cell-unread-dot {
  background: #e5484d; border-radius: 50%; box-shadow: 0 0 0 3px rgba(229, 72, 77, .11);
  flex: none; height: 7px; margin: 0 3px; width: 7px;
}
.topic-cell-unread-dot[hidden] { display: none; }
.topic-cell-title::after { content: "✎"; font-size: 11px; opacity: 0; position: absolute; right: 1px; top: 1px; transition: opacity .15s ease; }
.topic-cell-title:hover::after, .topic-cell-title:focus-visible::after { opacity: .55; }
.topic-cell-title:focus-visible { outline: 1px solid rgba(22, 119, 255, .45); outline-offset: 2px; }
.topic-cell-title-editor { align-items: center; display: flex; gap: 4px; min-width: 0; width: 100%; }
.topic-cell-title-editor[hidden] { display: none; }
.topic-cell-title-input {
  background: var(--card); border: 1px solid rgba(22, 119, 255, .52); border-radius: 6px; color: inherit;
  flex: 1; font-size: 12px; font-weight: 650; height: 25px; min-width: 0; outline: 0; padding: 0 6px;
}
.topic-cell-title-input:focus { box-shadow: 0 0 0 3px rgba(22, 119, 255, .08); }
.topic-cell-title-save, .topic-cell-title-cancel {
  background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); cursor: pointer;
  flex: none; font-size: 14px; height: 25px; line-height: 1; padding: 0; width: 25px;
}
.topic-cell-title-save { color: #12a150; }
.topic-cell-title-save:disabled, .topic-cell-title-cancel:disabled { cursor: wait; opacity: .45; }
.topic-cell-subtitle { color: var(--muted); display: block; font-size: 9px; line-height: 1.2; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-cell-pin {
  align-items: center; background: transparent; border: 0; border-radius: 7px; cursor: pointer;
  display: inline-flex; flex: none; font-size: 15px; height: 26px; justify-content: center;
  line-height: 1; opacity: .28; padding: 0; transition: background .15s ease, opacity .15s ease, transform .15s ease;
  width: 26px;
}
.topic-cell-expand {
  align-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--muted); cursor: pointer;
  display: inline-flex; flex: none; height: 26px; justify-content: center; padding: 0; transition: background .15s ease, color .15s ease;
  width: 26px;
}
.topic-cell-mark-unread, .cell-branch, .cell-compact {
  align-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--muted);
  cursor: pointer; display: inline-flex; flex: none; height: 28px; justify-content: center; padding: 0;
  transition: background .15s ease, color .15s ease, opacity .15s ease, transform .15s ease; width: 28px;
}
.topic-cell-mark-unread svg, .cell-branch svg { height: 16px; width: 16px; }
.cell-compact { height: 25px; width: 25px; }
.cell-compact svg { height: 14px; width: 14px; }
.cell-branch:hover, .cell-branch:focus-visible { background: rgba(22, 119, 255, .09); color: var(--accent); }
.cell-compact:hover, .cell-compact:focus-visible { background: rgba(124, 92, 255, .09); color: #7c5cff; }
.cell-branch:active { transform: scale(.92); }
.cell-compact:active { transform: scale(.92); }
.cell-branch:disabled, .cell-compact:disabled { cursor: not-allowed; opacity: .42; }
.topic-cell-mark-unread:hover, .topic-cell-mark-unread:focus-visible {
  background: rgba(229, 72, 77, .09); color: #d92d20;
}
.topic-cell-mark-unread[data-unread="true"] {
  background: rgba(229, 72, 77, .09); color: #d92d20;
}
.topic-cell-mark-unread:active { transform: scale(.92); }
.topic-cell-mark-unread:disabled { cursor: default; opacity: .48; }
.topic-cell-mark-unread:disabled[data-unread="true"] { opacity: 1; }
.topic-cell-expand svg { height: 16px; width: 16px; }
.topic-cell-expand:hover, .topic-cell-expand:focus-visible { background: rgba(22, 119, 255, .09); color: var(--accent); }
.topic-cell-expand[aria-pressed="true"] { background: rgba(22, 119, 255, .11); color: var(--accent); }
.topic-cell-pin:hover, .topic-cell-pin:focus-visible { background: rgba(217, 144, 0, .1); opacity: .75; }
.topic-cell-pin[data-pinned="true"] { background: rgba(217, 144, 0, .13); opacity: 1; }
.topic-cell-pin:active { transform: scale(.92); }
.topic-cell-pin:disabled { cursor: wait; opacity: .45; }
.topic-cell-header .agent-badge { flex: none; font-size: 8px; line-height: 15px; margin-left: auto; padding: 0 4px; }
.cell-heartbeat {
  align-items: center; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); display: inline-flex;
  flex: none; font-size: 9px; gap: 6px; min-height: 22px; padding: 0 7px; white-space: nowrap;
}
.cell-heartbeat-dot { background: #98a2b3; border-radius: 50%; height: 7px; width: 7px; }
.cell-heartbeat[data-status="ready"] .cell-heartbeat-dot { background: #12a150; }
.cell-heartbeat[data-status="working"] .cell-heartbeat-dot {
  animation: topic-working-pulse 1.2s ease-in-out infinite; background: #1677ff;
}
.cell-heartbeat[data-status="queued"] .cell-heartbeat-dot,
.cell-heartbeat[data-status="reserved"] .cell-heartbeat-dot,
.cell-heartbeat[data-status="completed"] .cell-heartbeat-dot { background: #d99000; }
.cell-heartbeat[data-status="offline"] .cell-heartbeat-dot,
.cell-heartbeat[data-status="unreachable"] .cell-heartbeat-dot { background: #d92d20; }
.cell-heartbeat[data-status="attention"] .cell-heartbeat-dot,
.cell-heartbeat[data-status="external_busy"] .cell-heartbeat-dot,
.cell-heartbeat[data-status="degraded"] .cell-heartbeat-dot { background: #e67e22; }
.topic-cell-messages {
  --message-gap: 7px;
  display: flex; flex: 1; flex-direction: column; gap: 7px; max-height: 348px; min-height: 176px;
  overflow: auto; overscroll-behavior: contain; padding: 11px 12px; scrollbar-width: thin;
}
.cell-message-row { align-items: flex-start; align-self: flex-start; display: flex; flex-direction: column; max-width: 92%; min-width: 0; }
.cell-message-row.user { align-items: flex-end; align-self: flex-end; }
.cell-message { border-radius: 10px; box-sizing: border-box; cursor: text; font-size: 10px; line-height: 1.5; max-width: 100%; padding: 8px 10px; word-break: break-word; }
.cell-message.user { background: rgba(22, 119, 255, .1); }
.cell-message.assistant { background: rgba(127, 127, 127, .075); }
.cell-message-timestamp { color: var(--muted); font-size: 8px; line-height: 1.2; opacity: .62; padding: 3px 3px 0; white-space: nowrap; }
.cell-message-row.user .cell-message-timestamp { text-align: right; }
.cell-handoff-divider { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 8px; margin: 8px 0; text-align: center; }
.cell-handoff-divider::before, .cell-handoff-divider::after { background: color-mix(in srgb, currentColor 28%, transparent); content: ""; flex: 1; height: 1px; }
.cell-compaction-record { align-items: center; color: var(--muted); display: flex; flex-direction: column; font-size: 10px; gap: 2px; margin: 8px 0; opacity: .75; text-align: center; }
.cell-message-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.cell-message-attachment {
  background: rgba(127, 127, 127, .06); border: 1px solid rgba(127, 127, 127, .16);
  border-radius: 8px; display: grid; gap: 4px; max-width: 180px; min-width: 0; overflow: hidden;
}
.cell-message-attachment.file { padding: 5px 7px; }
.cell-message-attachment-preview { background: rgba(127, 127, 127, .08); display: block; line-height: 0; }
.cell-message-attachment-preview img {
  display: block; height: 86px; object-fit: cover; width: 128px;
}
.cell-message-attachment-label {
  color: var(--muted); display: block; font-size: 9px; line-height: 1.3; overflow: hidden;
  padding: 0 6px 5px; text-overflow: ellipsis; white-space: nowrap;
}
.cell-message-attachment.file .cell-message-attachment-label { padding: 0; }
.cell-history-status {
  align-self: center; color: var(--muted); font-size: 9px; line-height: 1.4; max-width: 92%;
  padding: 2px 8px; text-align: center;
}
.cell-history-status.loading { color: var(--accent); }
.cell-history-status.error, .cell-history-status.limit { color: #c47a12; }
.cell-message-continuation {
  align-items: center; border-top: 1px solid rgba(127, 127, 127, .16); display: flex; gap: 8px;
  justify-content: space-between; margin-top: 8px; padding-top: 7px;
}
.cell-message-continuation-note { color: var(--muted); font-size: 9px; line-height: 1.35; }
.cell-message-continuation-toggle {
  background: rgba(22, 119, 255, .08); border: 1px solid rgba(22, 119, 255, .3); border-radius: 7px;
  color: var(--accent); cursor: pointer; flex: none; font-size: 9px; min-height: 24px; padding: 0 8px;
}
.cell-message-continuation-toggle:hover, .cell-message-continuation-toggle:focus-visible {
  background: rgba(22, 119, 255, .14); border-color: rgba(22, 119, 255, .5); outline: 0;
}
.cell-message-continuation-toggle:disabled { cursor: wait; opacity: .55; }
.cell-markdown > :first-child { margin-top: 0; }
.cell-markdown > :last-child { margin-bottom: 0; }
.cell-markdown p { margin: 0 0 7px; }
.cell-markdown h1, .cell-markdown h2, .cell-markdown h3,
.cell-markdown h4, .cell-markdown h5, .cell-markdown h6 {
  font-size: 1.08em; line-height: 1.35; margin: 8px 0 5px;
}
.cell-markdown ul, .cell-markdown ol { margin: 5px 0 7px; padding-left: 20px; }
.cell-markdown li + li { margin-top: 2px; }
.cell-markdown blockquote { border-left: 2px solid rgba(127, 127, 127, .35); color: var(--muted); margin: 6px 0; padding-left: 8px; }
.cell-markdown code { background: rgba(127, 127, 127, .12); border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; padding: 1px 3px; }
.cell-code-block { margin: 6px 0; max-width: 100%; position: relative; }
.cell-markdown pre { background: rgba(18, 18, 18, .86); border-radius: 7px; color: #f5f5f5; margin: 0; max-width: 100%; overflow: auto; padding: 8px 34px 8px 8px; }
.cell-markdown pre code { background: transparent; padding: 0; white-space: pre; }
.cell-code-copy {
  align-items: center; background: rgba(38, 42, 48, .9); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px; color: rgba(255, 255, 255, .8); cursor: pointer; display: inline-flex; height: 25px;
  justify-content: center; opacity: 0; padding: 0; position: absolute; right: 5px; top: 5px;
  transition: background .14s, color .14s, opacity .14s; width: 25px;
}
.cell-code-block:hover .cell-code-copy, .cell-code-block:focus-within .cell-code-copy { opacity: 1; }
.cell-code-copy:hover, .cell-code-copy:focus-visible { background: rgba(64, 70, 79, .96); color: #fff; outline: 0; }
.cell-code-copy[data-state="copied"] { color: #66dda1; }
.cell-code-copy[data-state="error"] { color: #ff8a80; }
@media (hover: none) { .cell-code-copy { opacity: .82; } }
.cell-markdown a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cell-markdown hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
.cell-markdown table { border-collapse: collapse; display: block; margin: 6px 0; max-width: 100%; overflow-x: auto; }
.cell-markdown th, .cell-markdown td { border: 1px solid var(--border); padding: 3px 6px; text-align: left; }
.cell-message.tool, .cell-process {
  align-self: stretch; background: rgba(217, 144, 0, .07); border: 1px solid rgba(217, 144, 0, .14);
  color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px;
  max-width: 100%;
}
.cell-process { border-radius: 9px; cursor: text; line-height: 1.45; padding: 7px 9px; white-space: pre-wrap; word-break: break-word; }
.cell-process strong { color: #b56e00; display: block; font-family: Inter, ui-sans-serif, sans-serif; font-size: 9px; margin-bottom: 3px; }
.cell-command-entry {
  background: rgba(127, 127, 127, .045); border-color: var(--border); color: var(--muted); overflow: hidden;
  padding: 0; white-space: normal;
}
.cell-command-summary { align-items: center; display: flex; gap: 8px; min-height: 34px; min-width: 0; padding: 0 7px 0 9px; }
.cell-command-summary .cell-command-label {
  align-items: center; color: inherit; display: inline-flex; flex: none; font-weight: 750; gap: 5px; margin: 0;
  max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-command-summary .cell-command-label::before {
  background: rgba(22, 119, 255, .1); border-radius: 5px; color: var(--accent); content: ">_"; flex: none;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; padding: 2px 4px;
}
.cell-command-preview { color: inherit; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-command-toggle {
  background: rgba(22, 119, 255, .08); border: 1px solid rgba(22, 119, 255, .28); border-radius: 7px; color: var(--accent);
  cursor: pointer; flex: none; font-family: Inter, ui-sans-serif, sans-serif; font-size: 9px; min-height: 22px; padding: 0 7px;
}
.cell-command-toggle:hover { background: rgba(22, 119, 255, .14); border-color: rgba(22, 119, 255, .5); }
.cell-command-detail {
  border-top: 1px solid var(--border); color: inherit; line-height: 1.5; margin: 0; max-height: 280px;
  overflow: auto; padding: 9px; white-space: normal;
}
.cell-command-detail[hidden] { display: none; }
.cell-command-detail .cell-command-section-label {
  color: inherit; display: block; font-family: Inter, ui-sans-serif, sans-serif; font-size: 9px; margin: 0 0 5px;
}
.cell-command-detail .cell-command-section-label:not(:first-child) { border-top: 1px dashed var(--border); margin-top: 9px; padding-top: 8px; }
.cell-command-content { color: inherit; font: inherit; margin: 0; white-space: pre-wrap; word-break: break-word; }
.cell-message-empty { align-items: center; color: var(--muted); display: flex; flex: 1; font-size: 10px; justify-content: center; min-height: 105px; text-align: center; }
.cell-composer { border-top: 1px solid var(--border); display: grid; gap: 7px; padding: 8px 11px 9px; }
.cell-btw { flex: 0 1 auto; min-height: 0; border-top: 1px solid var(--border); background: rgba(127, 127, 127, .045); padding: 5px 11px; }
.cell-btw-heading { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cell-btw-status { flex: 1; }
.cell-btw button { border: 1px solid var(--border); border-radius: 7px; background: transparent; color: inherit; cursor: pointer; padding: 4px 8px; font-size: 12px; }
.cell-btw button:disabled { opacity: .5; cursor: not-allowed; }
.cell-btw-messages { display: flex; flex-direction: column; gap: 7px; max-height: 210px; overflow: auto; overscroll-behavior: contain; padding: 7px 0; }
.cell-btw-form { display: flex; align-items: flex-end; gap: 7px; }
.cell-btw-draft { flex: 1; min-width: 0; resize: vertical; max-height: 90px; border: 1px solid var(--border); border-radius: 9px; padding: 8px; background: transparent; color: inherit; font: inherit; }
.cell-btw-error { color: var(--muted); font-size: 11px; }
@media (max-width: 640px) { .cell-btw-draft { font-size: 16px; } .cell-btw-messages { max-height: 160px; } }
.cell-composer.skill-drop-target { background: rgba(22, 119, 255, .055); box-shadow: inset 0 0 0 1px rgba(22, 119, 255, .34); }
.cell-composer-tools { align-items: center; display: flex; gap: 5px; min-height: 29px; min-width: 0; }
.cell-composer-row { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 7px; position: relative; }
.cell-command-menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 15; max-height: min(300px, 45vh); overflow-y: auto; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 25px rgba(0,0,0,.16); padding: 6px; font-size: 12px; }
.cell-command-menu[hidden] { display: none; }
.cell-command-option { width: 100%; text-align: left; border: 0; background: transparent; color: inherit; padding: 7px 9px; border-radius: 7px; display: flex; gap: 10px; align-items: baseline; cursor: pointer; font: inherit; }
.cell-command-option strong { min-width: 58px; font-family: ui-monospace, monospace; }
.cell-command-option span { color: var(--muted); font-size: 11px; }
.cell-command-option[aria-selected="true"] { background: rgba(22,119,255,.10); }
.cell-command-option[aria-disabled="true"] { opacity: .65; }
.cell-command-detail { border-top: 1px solid var(--border); margin: 5px 3px 0; padding: 8px 6px 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.cell-command-docs { display: block; margin-top: 5px; color: var(--accent); }
.cell-command-unavailable { margin-top: 4px; color: #b7791f; }
.cell-mode-exit { border: 1px solid var(--border); border-radius: 6px; padding: 2px 5px; font-size: 10px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.cell-questions { flex: 0 1 auto; max-height: min(320px, 40vh); overflow: auto; overscroll-behavior: contain; padding: 10px 14px; border-top: 1px solid var(--border); background: rgba(217, 144, 0, .06); font-size: 12px; }
.cell-questions[hidden] { display: none; }
.cell-question-field { border: 0; padding: 4px 0; margin: 4px 0; min-width: 0; }
.cell-question-field legend { color: var(--muted); font-size: 11px; }
.cell-question-field p { margin: 3px 0 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cell-question-option { display: flex; gap: 8px; align-items: start; padding: 6px 8px; margin: 4px 0; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.cell-question-option input { margin-top: 3px; flex: none; }
.cell-question-option small { display: block; color: var(--muted); font-size: 11px; }
.cell-question-text { box-sizing: border-box; width: 100%; border: 1px solid var(--border); border-radius: 8px; color: inherit; background: transparent; padding: 7px; font: inherit; resize: vertical; }
.cell-question-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cell-question-status { color: var(--muted); font-size: 11px; }
.cell-question-submit { background: var(--accent); color: white; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
.cell-question-submit:disabled { opacity: .5; cursor: default; }
.cell-question-skip { border: 0; background: none; color: var(--muted); padding: 7px; margin-left: auto; cursor: pointer; }
.cell-composer-row[data-expanded="true"] { justify-content: flex-end; }
.cell-composer-row[data-expanded="true"] .cell-draft { flex-basis: 100%; width: 100%; }
.cell-tool-button {
  background: rgba(127, 127, 127, .045); border: 1px solid var(--border); border-radius: 7px; color: var(--muted);
  align-items: center; cursor: pointer; display: inline-flex; height: 28px; justify-content: center; padding: 0;
  position: relative; width: 30px;
}
.cell-tool-button svg { display: block; }
.cell-tool-badge {
  align-items: center; background: var(--accent); border: 1px solid var(--card); border-radius: 8px; color: #fff;
  display: flex; font-size: 8px; font-weight: 700; height: 13px; justify-content: center; min-width: 13px;
  padding: 0 3px; position: absolute; right: -4px; top: -4px;
}
.cell-tool-badge[hidden] { display: none; }
.cell-tool-button:hover, .cell-tool-button[aria-expanded="true"] { border-color: rgba(22, 119, 255, .4); color: var(--accent); }
.cell-tool-button:disabled { cursor: not-allowed; opacity: .5; }
.cell-control-summary {
  color: var(--muted); flex: 1 1 auto; font-size: 9px; line-height: 1.2; margin-left: 3px; min-width: 0; opacity: .78;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-control-summary[hidden] { display: none; }
.cell-plugin-panel {
  align-items: center; background: rgba(127, 127, 127, .04); border: 1px solid var(--border); border-radius: 9px;
  display: flex; flex-wrap: wrap; gap: 7px; padding: 8px;
}
.cell-plugin-panel[hidden] { display: none; }
.cell-attachment-row {
  align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 7px; display: flex;
  gap: 5px; max-width: 180px; min-width: 0; padding: 4px 5px 4px 7px;
}
.cell-attachment-name { font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-attachment-remove {
  background: transparent; border: 0; color: var(--muted); cursor: pointer; flex: none; font-size: 15px; line-height: 1;
}
.cell-plugin-action {
  background: transparent; border: 1px solid var(--accent); border-radius: 7px; color: var(--accent); cursor: pointer;
  font-size: 9px; min-height: 25px; padding: 0 8px;
}
.cell-plugin-action:disabled, .cell-attachment-remove:disabled { cursor: not-allowed; opacity: .45; }
.cell-plugin-note, .cell-plugin-error { font-size: 9px; }
.cell-plugin-note { color: var(--muted); }
.cell-plugin-error { color: #d92d20; flex-basis: 100%; }
.cell-skill-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.cell-skill-chips[hidden] { display: none; }
.cell-skill-chip {
  align-items: center; background: rgba(22, 119, 255, .085); border: 1px solid rgba(22, 119, 255, .28);
  border-radius: 999px; color: var(--accent); display: inline-flex; font-size: 9px; gap: 4px; max-width: 180px;
  min-height: 23px; padding: 0 4px 0 8px;
}
.cell-skill-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-skill-chip-remove {
  align-items: center; background: transparent; border: 0; border-radius: 50%; color: inherit; cursor: pointer;
  display: inline-flex; font-size: 14px; height: 18px; justify-content: center; line-height: 1; padding: 0; width: 18px;
}
.cell-skill-chip-remove:hover { background: rgba(22, 119, 255, .12); }
.cell-skill-chip-remove:disabled { cursor: not-allowed; opacity: .45; }
.cell-skill-search {
  background: var(--card); border: 1px solid var(--border); border-radius: 7px; color: inherit; font-size: 9px;
  height: 28px; outline: 0; padding: 0 8px; width: 100%;
}
.cell-skill-search:focus { border-color: rgba(22, 119, 255, .48); }
.cell-skill-list { display: grid; gap: 5px; max-height: 190px; overflow: auto; width: 100%; }
.cell-skill-option {
  background: var(--card); border: 1px solid var(--border); border-radius: 7px; color: inherit; cursor: grab;
  display: grid; gap: 2px; min-width: 0; padding: 6px 8px; text-align: left;
}
.cell-skill-option[hidden] { display: none; }
.cell-skill-option:hover { border-color: rgba(22, 119, 255, .38); }
.cell-skill-option[data-selected="true"] { background: rgba(22, 119, 255, .085); border-color: rgba(22, 119, 255, .45); }
.cell-skill-option:disabled { cursor: not-allowed; opacity: .5; }
.cell-skill-option-name { color: inherit; font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-skill-option-meta { color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-model-options, .cell-effort-options { display: flex; flex-wrap: wrap; gap: 5px; }
.cell-model-options { flex-basis: 100%; }
.cell-model-option, .cell-effort-option, .cell-fast-control {
  background: var(--card); border: 1px solid var(--border); border-radius: 7px; color: var(--muted); cursor: pointer;
  font-size: 9px; min-height: 27px; padding: 0 8px;
}
.cell-model-option[data-selected="true"], .cell-effort-option[data-selected="true"],
.cell-fast-control[data-selected="true"] {
  background: rgba(22, 119, 255, .09); border-color: rgba(22, 119, 255, .48); color: var(--accent);
}
.cell-model-option:disabled, .cell-effort-option:disabled, .cell-fast-control:disabled { cursor: not-allowed; opacity: .5; }
.cell-draft {
  background: rgba(127, 127, 127, .055); border: 1px solid var(--border); border-radius: 9px; color: inherit;
  box-sizing: border-box; flex: 1; font-size: 10px; line-height: 1.45; max-height: min(240px, 32vh);
  min-height: 38px; min-width: 0; outline: 0; overflow-y: hidden; padding: 8px 9px; resize: none;
}
.cell-draft:focus { border-color: rgba(22, 119, 255, .52); box-shadow: 0 0 0 3px rgba(22, 119, 255, .08); }
.cell-draft:disabled { cursor: not-allowed; opacity: .55; }
.cell-send {
  background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; color: #fff; cursor: pointer;
  flex: none; font-size: 10px; min-height: 32px; padding: 0 10px;
}
.cell-send:disabled { border-color: var(--border); color: var(--muted); cursor: not-allowed; opacity: .6; }
.cell-interrupt, .cell-interrupt-send {
  background: transparent; border: 1px solid rgba(217, 45, 32, .5); border-radius: 8px; color: #d92d20;
  cursor: pointer; flex: none; font-size: 9px; min-height: 32px; padding: 0 8px;
}
.cell-interrupt:hover, .cell-interrupt-send:hover { background: rgba(217, 45, 32, .07); }
.cell-interrupt:disabled, .cell-interrupt-send:disabled { cursor: not-allowed; opacity: .5; }
.cell-interrupt[hidden], .cell-interrupt-send[hidden] { display: none; }
.cell-after-completion {
  align-items: center; background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); cursor: pointer; display: inline-flex; flex: none; font-size: 14px; height: 32px;
  justify-content: center; padding: 0; width: 32px;
}
.cell-after-completion:hover { border-color: rgba(22, 119, 255, .45); color: var(--accent); }
.cell-after-completion:disabled { cursor: not-allowed; opacity: .5; }
.cell-after-completion[hidden] { display: none; }
.cell-followup-timing {
  color: var(--muted); font-size: 8px; line-height: 1.2; margin: 2px 5px 0; opacity: .78;
}
.cell-followup-buffer-divider {
  align-items: center; align-self: stretch; color: var(--muted); display: flex; font-size: 8px;
  gap: 8px; line-height: 1.2; margin: 5px 0 1px; opacity: .7; text-align: center;
}
.cell-followup-buffer-divider::before, .cell-followup-buffer-divider::after {
  background: color-mix(in srgb, currentColor 30%, transparent); content: ""; flex: 1; height: 1px;
}
.cell-followup-buffer-divider span { flex: none; }
.cell-preview-state { color: var(--muted); font-size: 9px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-preview-state[hidden] { display: none; }
.cell-preview-state[data-tone="error"] { color: #d92d20; }
.cell-preview-state[data-tone="success"] { color: #12a150; }
.cell-preview-state[data-tone="warning"] { color: #b56e00; }
.cell-actions { align-items: center; display: flex; flex: none; gap: 5px; margin-left: auto; }
.cell-composer-actions { min-width: 0; }
.cell-enter {
  background: transparent; border: 1px solid var(--accent); border-radius: 8px; color: var(--accent); cursor: pointer;
  font-size: 10px; min-height: 29px; padding: 0 11px;
}
.cell-archive { height: 29px; width: 29px; }
.topic-cells-empty { color: var(--muted); font-size: 12px; grid-column: 1 / -1; padding: 42px 20px; text-align: center; }

@media (min-width: 1900px) and (min-aspect-ratio: 2 / 1) {
  .machine-board { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1980px; }
  .dashboard-workspace { max-width: 1980px; }
  .topic-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topic-cell[data-expanded="true"] { grid-column: span 2; }
}
@media (min-width: 1880px) {
  html[data-cell-columns="2"] .dashboard-workspace {
    gap: 0; grid-template-columns: 0 minmax(0, 1fr) 0;
  }
  html[data-cell-columns="2"] .dashboard-workspace.has-notifications .notification-rail {
    align-self: start; grid-column: 1; grid-row: 1; overflow: auto;
    position: sticky; scrollbar-width: thin; top: 100px; max-height: calc(100vh - 116px); transform: translateX(-280px); width: 260px; z-index: 7;
  }
  html[data-cell-columns="2"] .dashboard-workspace.has-notifications .notification-rail-toggle { display: none; }
  html[data-cell-columns="2"] .dashboard-workspace.has-notifications .notification-board { display: block; }
  html[data-cell-columns="2"] .dashboard-workspace .dashboard-topics {
    grid-column: 2; grid-row: 1;
  }
  html[data-cell-columns="2"] .dashboard-workspace.has-notifications .notification-list {
    grid-template-columns: minmax(0, 1fr);
  }
  html[data-cell-columns="2"] .dashboard-workspace .skill-viewer-rail {
    align-self: start; bottom: auto; grid-column: 3; grid-row: 1; position: sticky; right: auto;
    top: 16px; transform: translateX(20px); width: 42px; z-index: 7;
  }
  html[data-cell-columns="2"] .dashboard-workspace .skill-viewer-rail[data-open="true"] { width: 260px; }
  html[data-cell-columns="2"] .dashboard-workspace .skill-viewer-panel {
    bottom: auto; max-height: calc(100vh - 32px); position: static; right: auto; top: auto; width: 260px;
  }
}
@media (min-width: 2540px) {
  html[data-cell-columns="3"] .dashboard-workspace {
    gap: 0; grid-template-columns: 0 minmax(0, 1fr) 0;
  }
  html[data-cell-columns="3"] .dashboard-workspace.has-notifications .notification-rail {
    align-self: start; grid-column: 1; grid-row: 1; overflow: auto;
    position: sticky; scrollbar-width: thin; top: 100px; max-height: calc(100vh - 116px); transform: translateX(-280px); width: 260px; z-index: 7;
  }
  html[data-cell-columns="3"] .dashboard-workspace.has-notifications .notification-rail-toggle { display: none; }
  html[data-cell-columns="3"] .dashboard-workspace.has-notifications .notification-board { display: block; }
  html[data-cell-columns="3"] .dashboard-workspace .dashboard-topics {
    grid-column: 2; grid-row: 1;
  }
  html[data-cell-columns="3"] .dashboard-workspace.has-notifications .notification-list {
    grid-template-columns: minmax(0, 1fr);
  }
  html[data-cell-columns="3"] .dashboard-workspace .skill-viewer-rail {
    align-self: start; bottom: auto; grid-column: 3; grid-row: 1; position: sticky; right: auto;
    top: 16px; transform: translateX(20px); width: 42px; z-index: 7;
  }
  html[data-cell-columns="3"] .dashboard-workspace .skill-viewer-rail[data-open="true"] { width: 260px; }
  html[data-cell-columns="3"] .dashboard-workspace .skill-viewer-panel {
    bottom: auto; max-height: calc(100vh - 32px); position: static; right: auto; top: auto; width: 260px;
  }
}
@media (max-width: 980px) {
  .workspace-toolbar { grid-template-columns: auto 1fr; }
  .workspace-actions { grid-column: 1 / -1; justify-content: space-between; }
  .machine-board { grid-template-columns: 1fr; }
  .board-topic-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .board-view {
    left: 0;
    padding: 18px max(28px, env(safe-area-inset-right))
      calc(40px + env(safe-area-inset-bottom) + var(--cell-keyboard-space, 0px))
      max(28px, env(safe-area-inset-left));
  }
  .cell-draft { font-size: 16px; min-height: 44px; }
  .cell-composer-tools, .cell-composer-actions { flex-wrap: wrap; }
  .cell-composer-actions { max-width: 100%; }
  .workspace-toolbar { align-items: start; gap: 12px; grid-template-columns: 1fr; }
  .workspace-search, .workspace-actions { grid-column: 1; }
  .workspace-actions { align-items: stretch; flex-wrap: wrap; justify-content: flex-start; }
  .global-heartbeat { flex: 0 0 auto; }
  .board-header { align-items: flex-start; }
  .conversation-context { left: 108px; max-width: calc(100vw - 116px); overflow-x: auto; }
  .context-selectors { white-space: nowrap; }
  .notification-list { grid-template-columns: 1fr; }
  .notification-board > header { padding: 14px; }
  .notification-group { padding: 12px; }
  .notification-rail { left: max(6px, env(safe-area-inset-left)); }
  .notification-rail[data-expanded="true"] {
    max-height: calc(100vh - 16px); top: max(8px, env(safe-area-inset-top));
    width: min(300px, calc(100vw - 16px));
  }
  .cell-layout-toggle { display: none; }
  html[data-cell-columns="2"] .topic-cells,
  html[data-cell-columns="3"] .topic-cells { grid-template-columns: minmax(0, 1fr); }
  html[data-cell-columns] .topic-cell[data-expanded="true"] { grid-column: 1; }
  .skill-viewer-panel {
    bottom: max(8px, env(safe-area-inset-bottom)); max-height: none; right: max(8px, env(safe-area-inset-right));
    top: max(8px, env(safe-area-inset-top)); width: calc(100vw - 16px);
  }
}

@media (max-width: 420px) {
  .cell-composer-tools { gap: 3px; }
  .cell-tool-button { height: 27px; width: 27px; }
  .cell-control-summary { font-size: 8px; margin-left: 1px; }
  .cell-composer-actions { gap: 2px; }
  .cell-composer-actions .cell-heartbeat { font-size: 8px; gap: 4px; max-width: 92px; padding: 0 4px; }
  .cell-composer-actions .cell-heartbeat > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .cell-composer-actions .topic-cell-mark-unread,
  .cell-composer-actions .cell-branch,
  .cell-composer-actions .cell-compact,
  .cell-composer-actions .cell-archive { height: 26px; width: 26px; }
  .cell-composer-actions .cell-enter { font-size: 9px; min-height: 27px; padding: 0 6px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315; --border: rgba(255, 255, 255, .1); --card: rgba(27, 30, 34, .94);
    --muted: #98a2b3; --sidebar: #141619; --text: #f0f2f5;
    --palette-blue-cell-bg: linear-gradient(145deg, rgba(31, 91, 153, .18), rgba(20, 24, 29, .9));
    --palette-blue-cell-border: rgba(88, 166, 255, .2);
    --palette-violet-cell-bg: linear-gradient(145deg, rgba(104, 76, 164, .2), rgba(22, 21, 29, .9));
    --palette-violet-cell-border: rgba(174, 139, 255, .2);
    --palette-teal-cell-bg: linear-gradient(145deg, rgba(18, 120, 105, .2), rgba(21, 28, 28, .9));
    --palette-teal-cell-border: rgba(69, 204, 176, .2);
  }
  .agent-badge.codex { color: #48cf8b; }
  .agent-badge.claude-code { color: #ef986b; }
}

:root[data-theme="light"] {
  color-scheme: light; --bg: #f7f8fa; --border: rgba(31, 35, 40, .11); --card: rgba(255, 255, 255, .9);
  --muted: #667085; --sidebar: #fafbfc; --text: #1f2328;
  --palette-blue-cell-bg: linear-gradient(145deg, rgba(22, 119, 255, .065), rgba(255, 255, 255, .42));
  --palette-blue-cell-border: rgba(22, 119, 255, .14);
  --palette-violet-cell-bg: linear-gradient(145deg, rgba(135, 91, 247, .075), rgba(255, 255, 255, .38));
  --palette-violet-cell-border: rgba(135, 91, 247, .16);
  --palette-teal-cell-bg: linear-gradient(145deg, rgba(12, 153, 128, .07), rgba(255, 255, 255, .4));
  --palette-teal-cell-border: rgba(12, 153, 128, .16);
}
:root[data-theme="dark"] {
  color-scheme: dark; --bg: #111315; --border: rgba(255, 255, 255, .1); --card: rgba(27, 30, 34, .94);
  --muted: #98a2b3; --sidebar: #141619; --text: #f0f2f5;
  --palette-blue-cell-bg: linear-gradient(145deg, rgba(31, 91, 153, .18), rgba(20, 24, 29, .9));
  --palette-blue-cell-border: rgba(88, 166, 255, .2);
  --palette-violet-cell-bg: linear-gradient(145deg, rgba(104, 76, 164, .2), rgba(22, 21, 29, .9));
  --palette-violet-cell-border: rgba(174, 139, 255, .2);
  --palette-teal-cell-bg: linear-gradient(145deg, rgba(18, 120, 105, .2), rgba(21, 28, 28, .9));
  --palette-teal-cell-border: rgba(69, 204, 176, .2);
}
:root[data-theme="dark"] .agent-badge.codex { color: #48cf8b; }
:root[data-theme="dark"] .agent-badge.claude-code { color: #ef986b; }
:root[data-theme="light"] .agent-badge.codex { color: #087443; }
:root[data-theme="light"] .agent-badge.claude-code { color: #bd5b26; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .sync-dot, .topic-running-dot, .topic-archive.pending::after, .topic-unarchive.pending::after, .notification-board,
  .cell-heartbeat-dot, .topic-working-spinner, .push-toggle[data-state="busy"] .push-toggle-dot { animation: none !important; }
}
.cell-followup-withdraw {
  border: 0; background: transparent; color: inherit; font: inherit;
  cursor: pointer; padding: 0 4px; text-decoration: underline;
}
.cell-followup-withdraw:disabled { opacity: .5; cursor: wait; }
.cell-context-meter { display:inline-flex; align-items:center; gap:4px; font-size:11px; color:#8590a3; white-space:nowrap; flex:none; }
.cell-context-pie { width:13px; height:13px; border-radius:50%; background:conic-gradient(currentColor var(--context-fill,0%), transparent 0); border:1px solid currentColor; box-sizing:border-box; }
.cell-context-meter.unknown .cell-context-pie { background:none; border-style:dashed; opacity:.6; }

/* Optional messenger presentation. The live Cell DOM/composers remain shared. */
.chat-list-panel, .chat-detail-nav, .chat-detail-empty, .chat-banner, .chat-tools-toggle { display: none; }
html[data-interface="chat"] { --chat-bg: #ededed; --chat-list: #f7f7f7; --chat-selected: #e2e2e2; --chat-bubble: #fff; --chat-user: #a9ea7a; }
html[data-theme="dark"][data-interface="chat"] { --chat-bg: #191b1d; --chat-list: #222427; --chat-selected: #34383b; --chat-bubble: #303438; --chat-user: #406c37; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"])[data-interface="chat"] { --chat-bg: #191b1d; --chat-list: #222427; --chat-selected: #34383b; --chat-bubble: #303438; --chat-user: #406c37; }
}
html[data-interface="chat"] .board-view { position:fixed; top:var(--chat-viewport-top, 0px); left:0; width:100%; display:flex; flex-direction:column; height:var(--chat-viewport-height, 100dvh); padding:0; overflow:hidden; }
html[data-interface="chat"] .board-view[hidden] { display:none; }
html[data-interface="chat"] .dashboard-overview { flex:none; padding:0; border-bottom:1px solid var(--border); background:var(--chat-list); }
html[data-interface="chat"] .workspace-toolbar { display:flex; max-width:none; margin:0; padding:8px 16px; gap:14px; min-height:56px; }
html[data-interface="chat"] .board-view[data-dashboard-page="topics"] .dashboard-overview,
html[data-interface="chat"] .skill-viewer-rail:not([data-open="true"]) { display:none !important; }
html[data-interface="chat"] .workspace-toolbar h2 { font-size:18px; letter-spacing:-.03em; }
html[data-interface="chat"] .workspace-actions { flex:1; min-width:0; gap:8px; overflow-x:auto; scrollbar-width:none; justify-content:flex-end; }
html[data-interface="chat"] .workspace-actions > * { flex-shrink:0; }
html[data-interface="chat"] .workspace-actions button:not(.interface-toggle) { min-height:32px; border-radius:7px; padding:6px 10px; font-size:12px; box-shadow:none; }
html[data-interface="chat"] .cell-layout-toggle { display:none; }
html[data-interface="chat"] .primary-button { background:#198b56; border-color:#198b56; }
html[data-interface="chat"] .dashboard-workspace { display:grid !important; flex:1; min-height:0; width:100%; max-width:none !important; margin:0; padding:0; gap:0; grid-template-columns:clamp(240px, 28vw, 340px) minmax(0,1fr) !important; }
html[data-interface="chat"] .board-view[data-dashboard-page="machines"] { overflow:auto; }
html[data-interface="chat"] .board-view[data-dashboard-page="machines"] .dashboard-workspace { display:none !important; }
html[data-interface="chat"] .board-view[data-dashboard-page="machines"] .machine-board { padding:20px; }
html[data-interface="chat"] .notification-rail { display:none !important; }
html[data-interface="chat"] .skill-viewer-rail { position:fixed !important; right:8px !important; top:48px !important; bottom:auto !important; transform:none; z-index:30; }
html[data-interface="chat"] .skill-viewer-rail:not([data-open="true"]) { width:34px !important; }
html[data-interface="chat"] .skill-viewer-toggle { width:32px; height:32px; font-size:17px; opacity:.7; }
html[data-interface="chat"] .skill-viewer-panel { max-height:calc(100dvh - 110px); overflow:auto; }
html[data-interface="chat"] .chat-list-panel { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--chat-list); border-right:1px solid var(--border); overflow:hidden; }
.chat-list-heading { display:flex; align-items:center; gap:8px; min-height:48px; padding:6px 12px; }
.chat-list-heading h2 { font-size:18px; font-weight:650; }
.chat-count { font-size:12px; color:var(--muted); }
.chat-unread-summary { margin-left:auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--muted); }
.chat-home-toggle { flex:none; display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border:0; border-radius:7px; padding:0; background:transparent; color:var(--text); font-size:26px; cursor:pointer; }
.chat-home-toggle:hover, .chat-home-toggle[aria-expanded="true"] { background:var(--chat-selected); }
.chat-home-menu { flex:none; padding:0 12px 8px; }
.chat-home-menu[hidden] { display:none; }
html[data-interface="chat"] .chat-home-menu .workspace-actions { flex-wrap:wrap; justify-content:flex-start; align-items:center; overflow:visible; }
.chat-search-host { padding:0 12px 8px; }
.chat-search-host .workspace-search { width:100%; max-width:none; min-height:34px; font-size:13px; }
.chat-list { display:flex; flex:1; min-height:0; flex-direction:column; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.chat-row { display:flex; flex:none; align-items:center; gap:12px; width:100%; min-height:82px; padding:15px 16px; background:transparent; border:0; border-bottom:1px solid color-mix(in srgb,var(--border) 45%,transparent); text-align:left; cursor:pointer; }
.chat-row:hover { background:color-mix(in srgb,var(--chat-selected) 55%,transparent); }
.chat-row.pinned { background:color-mix(in srgb,var(--chat-selected) 35%,transparent); }
.chat-row[aria-current="true"] { background:var(--chat-selected); }
.chat-row:focus-visible { outline:2px solid #198b56; outline-offset:-2px; }
.chat-avatar { display:inline-flex; flex:none; position:relative; align-items:center; justify-content:center; width:46px; height:46px; border-radius:11px; background:#d4e8de; color:#236c4c; font-size:21px; font-weight:650; }
.chat-avatar[data-machine="palette-violet"] { background:#e6def5; color:#6c51a0; }
.chat-avatar[data-machine="palette-teal"] { background:#d4e7ef; color:#366b80; }
.chat-avatar[data-machine="palette-amber"] { background:#f0e1cb; color:#8f6530; }
.chat-unread { position:absolute; right:-6px; top:-5px; border-radius:12px; min-width:19px; height:19px; padding:0 5px; background:#e54d47; color:#fff; font-size:11px; line-height:19px; font-weight:600; text-align:center; box-shadow:0 0 0 2px var(--chat-list); }
.chat-row-copy { min-width:0; flex:1; display:flex; flex-direction:column; gap:7px; }
.chat-row-line { display:flex; align-items:center; min-width:0; gap:8px; }
.chat-row-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:600; }
.chat-row-time { flex:none; font-size:10px; color:var(--muted); opacity:.8; }
.chat-row-preview { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; }
.chat-row-preview.has-draft { color:#be6b42; }
.chat-working, .chat-pin { flex:none; font-size:10px; color:#198b56; }
.chat-working::before { display:inline-block; content:""; width:5px; height:5px; border-radius:50%; background:currentColor; margin-right:4px; animation:topic-working-pulse 1.5s infinite; }
.chat-pin { color:var(--muted); opacity:.65; }
.chat-no-results { padding:32px 20px; color:var(--muted); font-size:13px; text-align:center; }
html[data-interface="chat"] .dashboard-topics { position:relative; display:flex; flex-direction:column; min-height:0; width:auto !important; min-width:0; background:var(--chat-bg); }
html[data-interface="chat"] .chat-detail-nav { display:flex; flex:none; align-items:center; gap:6px; min-height:44px; border-bottom:1px solid var(--border); padding:4px 10px; background:var(--chat-list); }
.chat-back { flex:none; background:transparent; border:0; width:32px; height:32px; font-size:28px; cursor:pointer; line-height:1; border-radius:8px; }
.chat-back:hover { background:var(--chat-selected); }
.chat-detail-heading { min-width:0; display:flex; align-items:baseline; gap:8px; flex:1; }
.chat-detail-title { min-width:0; flex:0 1 auto; padding:0; background:transparent; border:0; text-align:left; font-size:16px; font-weight:600; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-detail-subtitle { flex:0 1 auto; max-width:35%; font-size:10px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-header-toggle { flex:none; width:28px; height:28px; border:0; border-radius:6px; padding:0; background:transparent; font-size:22px; cursor:pointer; }
.chat-header-toggle:hover, .chat-header-toggle[aria-expanded="true"] { background:var(--chat-selected); }
.chat-header-toggle[hidden] { display:none; }
html[data-interface="chat"] .topic-cell:not([data-chat-header-open="true"]) .topic-cell-header,
html[data-interface="chat"] .topic-cell:not([data-chat-tools-open="true"]) .cell-composer-tools { display:none !important; }
html[data-interface="chat"] .chat-tools-toggle { display:inline-flex; flex:none; align-items:center; justify-content:center; width:32px; height:36px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--muted); font-size:28px; cursor:pointer; }
html[data-interface="chat"] .chat-tools-toggle:hover, html[data-interface="chat"] .chat-tools-toggle[aria-expanded="true"] { background:var(--chat-selected); }
html[data-interface="chat"] .cell-composer-row .cell-draft { flex:1 1 100px; width:auto; }
html[data-interface="chat"] .topic-cell-board { flex:1; min-height:0; }
html[data-interface="chat"] #topic-cells { height:100%; display:flex; gap:0; }
html[data-interface="chat"] #topic-cells > .topic-cell { display:none !important; }
html[data-interface="chat"] #topic-cells > .topic-cell.chat-selected:not([hidden]) { display:flex !important; flex:1; width:100%; height:100%; min-height:0 !important; max-height:none; content-visibility:visible; contain-intrinsic-block-size:none; border:0; border-radius:0; background:var(--chat-bg); }
html[data-interface="chat"] .topic-cell .topic-cell-header { flex:none; padding:6px 18px; justify-content:flex-end; background:transparent; }
html[data-interface="chat"] .topic-cell-heading, html[data-interface="chat"] .topic-cell-expand { display:none; }
html[data-interface="chat"] .topic-cell .topic-cell-messages { flex:1; min-height:0 !important; max-height:none !important; padding:16px 24px; gap:14px; --message-gap:14px; }
html[data-interface="chat"] .board-view[data-chat-compact="true"] .topic-cell .topic-cell-messages { padding-top:6px; padding-bottom:6px; }
html[data-interface="chat"] .cell-message-row { max-width:88%; }
html[data-interface="chat"] .cell-message { font-size:14px; line-height:1.65; padding:11px 14px; border-radius:9px; }
html[data-interface="chat"] .cell-message.assistant { background:var(--chat-bubble); box-shadow:0 1px 2px rgba(0,0,0,.035); }
html[data-interface="chat"] .cell-message.user { background:var(--chat-user); }
html[data-interface="chat"] .cell-message-timestamp { font-size:10px; padding:4px 1px 0; }
html[data-interface="chat"] .cell-composer { flex:none; background:var(--chat-list); padding:10px 18px max(10px,env(safe-area-inset-bottom)); }
html[data-interface="chat"] .cell-draft { font-size:14px; background:var(--chat-bubble); border-radius:9px; min-height:40px; }
html[data-interface="chat"] .cell-send { background:#198b56; border-color:#198b56; }
html[data-interface="chat"] .topic-cells-empty { display:none; }
html[data-interface="chat"] .chat-detail-empty { display:flex; position:absolute; inset:44px 0 0; align-items:center; justify-content:center; flex-direction:column; gap:14px; pointer-events:none; color:var(--muted); }
.chat-empty-icon { font-size:72px; color:#99ada1; line-height:1.2; }
.chat-detail-empty h2 { font-size:20px; font-weight:500; }
.chat-detail-empty p { font-size:13px; }
.chat-banner { position:fixed; z-index:200; top:max(12px,env(safe-area-inset-top)); left:50%; transform:translateX(-50%); width:min(420px,calc(100vw - 24px)); display:flex; align-items:center; background:var(--card); border:1px solid var(--border); border-radius:17px; box-shadow:0 8px 40px rgba(0,0,0,.17); backdrop-filter:blur(18px); padding:12px; }
.chat-banner-open { display:flex; flex:1; gap:12px; min-width:0; align-items:center; background:transparent; border:0; padding:0; text-align:left; cursor:pointer; }
.chat-banner-copy { display:flex; flex-direction:column; min-width:0; gap:5px; }
.chat-banner-copy strong { font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-banner-copy > span { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-banner-dismiss { flex:none; border:0; background:transparent; width:28px; height:32px; font-size:22px; color:var(--muted); cursor:pointer; }
.chat-list-panel[hidden], .chat-detail-nav[hidden], .chat-detail-empty[hidden], .chat-banner[hidden], .chat-no-results[hidden] { display:none !important; }
@media (orientation: portrait) {
  html[data-interface="chat"] .dashboard-workspace { grid-template-columns:minmax(0,1fr) !important; }
  html[data-interface="chat"] .dashboard-workspace[data-chat-open="false"] .dashboard-topics,
  html[data-interface="chat"] .dashboard-workspace[data-chat-open="true"] .chat-list-panel { display:none !important; }
  html[data-interface="chat"] .workspace-toolbar { padding:7px 10px; min-height:48px; }
  html[data-interface="chat"] .workspace-toolbar > div:first-child { display:none; }
  html[data-interface="chat"] .workspace-actions { justify-content:flex-start; }
  html[data-interface="chat"] .workspace-actions .process-toggle { font-size:11px; }
  html[data-interface="chat"] .chat-detail-nav { min-height:44px; padding:4px 6px; }
  html[data-interface="chat"] .topic-cell .topic-cell-messages { padding:14px 12px; }
  html[data-interface="chat"] .cell-composer { padding-left:10px; padding-right:10px; }
  html[data-interface="chat"] .cell-draft { font-size:16px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  html[data-interface="chat"] .workspace-toolbar { min-height:40px; padding:4px 10px; }
  html[data-interface="chat"] .chat-detail-nav { min-height:44px; padding:4px 8px; }
  html[data-interface="chat"] .cell-composer { padding-top:5px; padding-bottom:5px; }
}
@media (prefers-reduced-motion: reduce) { .chat-working::before { animation:none; } }

/* Offscreen messages keep measured space, without retaining Markdown/image DOM. */
.topic-cell-messages.message-window { overflow-anchor: none; }
.message-window-header:empty { display:none; }
.message-window-header:not(:empty) { padding-bottom:var(--message-gap); }
.message-window-header, .message-window-body { flex:none; min-width:0; }
.message-window-item { display:flex; flex-direction:column; gap:var(--message-gap); padding-bottom:var(--message-gap); min-width:0; }
.message-window-spacer { pointer-events:none; }

/* Quota appointments live beneath the affected reply, without a new toolbar. */
.cell-quota-resume { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; max-width:100%; padding:7px 10px; margin-top:5px; border:1px solid var(--border-color, #8884); border-radius:9px; font-size:12px; line-height:1.5; color:inherit; background:var(--bg-secondary, #8881); overflow-wrap:anywhere; }
.cell-quota-resume small { opacity:.65; }
.cell-quota-resume button { margin-left:auto; flex-shrink:0; }
/* Independent detail mode reuses the existing cell without another document. */
.standalone-detail .standalone-detail-cell {
  position: fixed; inset: 60px 16px 16px; z-index: 150;
  width: auto !important; height: auto !important; min-height: 0 !important;
  background: var(--panel, Canvas); backdrop-filter: blur(30px);
}
.standalone-detail #conversation-back { position: fixed; top: 10px; right: 20px; z-index: 151; }
.import-session-field { display:grid; gap:8px; margin:16px 0; }
.import-session-field input, .import-session-field select { width:100%; min-width:0; padding:10px; border:1px solid var(--border); border-radius:8px; background:var(--card); color:inherit; font:inherit; box-sizing:border-box; }
.import-session-list { display:grid; gap:8px; max-height:280px; overflow:auto; }
.import-session-choice { display:grid; gap:4px; width:100%; padding:12px; text-align:left; border:1px solid var(--border); border-radius:8px; background:var(--card); color:inherit; cursor:pointer; }
.import-session-choice small, .import-session-choice strong { overflow-wrap:anywhere; }
.import-session-choice small { opacity:.7; }
.import-session-choice[aria-pressed="true"] { outline:2px solid #1677ff; outline-offset:-2px; }
#import-session-status { min-height:1.5em; overflow-wrap:anywhere; }
