:root {
  color-scheme: light;
  --accent: #3b5bdb;
  --accent-soft: color-mix(in srgb, var(--accent) 8%, transparent);
  --accent-ink: #ffffff;
  --ink: #15171c;
  --ink-2: #3f444b;
  --muted: #5b6169;
  --line: #e3e5e8;
  --line-input: #c9ced4;
  --ground: #f6f7f5;
  --surface: #ffffff;
  --canvas: var(--ground);
  --paper: var(--surface);
  --sidebar: #15171c;
  --sidebar-text: #c9cdd3;
  --sidebar-muted: #a3a9b2;
  --sidebar-raise: #22252c;
  --switch-bg: #1d2026;
  --switch-line: #2e323a;
  --mark: var(--accent);
  --banner-bg: #fff8f1;
  --banner-ink: #8a4b0b;
  --agent-edge: var(--accent);
  --ok: #166534;
  --ok-bg: #e9f5ec;
  --ok-dot: #16a34a;
  --warn: #8a4b0b;
  --warn-bg: #fff8f1;
  --warn-line: #f1d9c0;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(21, 23, 28, 0.08);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --font: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  font-family: var(--font);
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--ink); }
a { color: var(--accent); }
a:hover { color: color-mix(in srgb, var(--accent) 80%, #000); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mark {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  color: inherit;
}
.brand-lockup:hover { color: inherit; opacity: 0.88; }
.brand-lockup img {
  display: block;
  height: 28px;
  width: auto;
}
.gate > .brand-lockup { margin-bottom: 0.35rem; }
.product-mark { margin: 0 0 0.85rem; }
.product-mark img { display: block; width: min(100%, 18rem); height: auto; }
.product-line { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.92rem; }

.lede { color: var(--muted); line-height: 1.5; }
.fine { color: var(--muted); font-size: 0.92rem; }
.handle { color: var(--accent); font-weight: 600; }

.banner {
  background: var(--banner-bg);
  color: var(--banner-ink);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
.banner.inset { margin: 0.75rem 1rem 0; }
.is-hidden { display: none; }

.oauth-row { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; }
.oauth {
  display: flex; align-items: center; justify-content: center; height: 48px;
  border: 1px solid var(--line-input); border-radius: 12px; color: var(--ink);
  background: var(--surface); text-decoration: none; font-weight: 500;
}
.oauth:hover { background: var(--ground); color: var(--ink); }
.center { text-align: center; }
.gate {
  max-width: 28rem;
  margin: 8vh auto;
  background: var(--paper);
  padding: 2rem;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.gate.wide { max-width: 40rem; }
.gate-top { display: flex; justify-content: space-between; align-items: center; }
.stack { display: grid; gap: 0.85rem; margin-top: 1.25rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
}
textarea { resize: vertical; }
textarea.agent-instructions { min-height: 32rem; line-height: 1.5; }
.instruction-field { display: grid; gap: 0.35rem; }
.mode-switch {
  display: inline-flex;
  gap: 0.15rem;
  margin: 0.2rem 0 0;
  padding: 0.2rem;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 999px;
}
button.mode-tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
button.mode-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(21, 23, 28, 0.1);
}
.instruction-field[hidden],
.canvas-panel[hidden],
.mode-note[hidden] { display: none !important; }
.profile-top { position: relative; }
.profile-delete { position: absolute; top: 0; right: 0; margin: 0; z-index: 1; }
.profile-actions { display: flex; align-items: center; gap: 0.35rem; }
.profile-actions.has-delete { margin-right: 2.4rem; }
.agent-profile .profile-head {
  display: grid;
  grid-template-columns: 8.75rem minmax(0, 1fr) auto;
  gap: 1.35rem;
  align-items: start;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}
.profile-photo { position: relative; width: 8.75rem; height: 8.75rem; }
.profile-photo .avatar-preview,
.profile-photo .avatar-fallback {
  width: 8.75rem;
  height: 8.75rem;
  border-radius: 50%;
  font-size: 2.4rem;
}
.profile-photo-btn {
  position: absolute;
  right: 0.1rem;
  bottom: 0.1rem;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(21, 23, 28, 0.12);
}
.profile-photo-btn svg { width: 1.05rem; height: 1.05rem; }
.profile-photo-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.profile-id { display: grid; gap: 0.3rem; min-width: 0; align-content: center; }
.profile-name-row { display: flex; align-items: center; gap: 0.5rem; }
.profile-name-row .profile-name { flex: 1; min-width: 0; }
input.profile-name {
  font-size: 1.7rem;
  font-weight: 700;
  border: 0;
  background: transparent;
  padding: 0.1rem 0;
  border-radius: 0;
}
input.profile-name:focus { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.profile-handle { margin: 0; color: var(--muted); font-weight: 600; }
textarea.profile-bio {
  border: 0;
  background: transparent;
  padding: 0.1rem 0;
  min-height: 2.5rem;
  max-width: 36rem;
  resize: none;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 0;
}
textarea.profile-bio:focus { outline: none; box-shadow: inset 0 -2px 0 var(--line-input); }
.profile-generate { display: flex; align-items: center; gap: 0.45rem; max-width: 20rem; }
.profile-generate button { height: 2.15rem; flex: none; }
input.profile-prompt { padding: 0.4rem 0.65rem; font-weight: 500; }
.profile-form { display: grid; gap: 1rem; }
.profile-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.profile-details fieldset,
.profile-details .grant-block,
.profile-details .profile-span { grid-column: 1 / -1; }
.grant-block { display: grid; gap: 0.55rem; }
.grant-block h3 { margin: 0.4rem 0 0; font-size: 0.95rem; }
.grant-block .cards { margin-top: 0; }
[data-grant-form][hidden],
[data-grant-empty][hidden] { display: none !important; }
.profile-span { display: grid; gap: 0.45rem; }
.profile-save { display: flex; justify-content: flex-end; margin-top: 1.25rem; }
.agent-profile .profile-section { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.profile-lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.profile-card {
  margin: 0;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  align-content: start;
}
.profile-card.stack { margin-top: 0; }
.profile-card h2 { margin: 0; font-size: 1.05rem; }
.cards li.memory-file { display: block; }
.memory-add .memory-body { flex: 1 1 100%; }
@media (max-width: 720px) {
  .agent-profile .profile-head,
  .profile-details,
  .profile-lower { grid-template-columns: 1fr; }
}
.canvas-panel { display: grid; gap: 0.6rem; }
.agent-create {
  display: inline-flex;
  flex: none;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  align-self: center;
}
.agent-create form { display: flex; margin: 0; }
a.agent-create-btn, label.agent-create-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  margin: 0;
  padding: 0;
  gap: 0;
  border: 1px solid var(--line-input);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(21, 23, 28, 0.06);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
a.agent-create-btn:hover, label.agent-create-btn:hover {
  background: var(--ground);
  color: var(--ink);
}
.agent-create-btn svg { width: 1.15rem; height: 1.15rem; }
.agent-create-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.share-add { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.share-add label { flex: 1 1 14rem; margin: 0; }
.share-add button { height: 2.7rem; }
.canvas-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.canvas-toolbar .canvas-download { margin-left: auto; }
.canvas-toolbar .canvas-download svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; }
.canvas-toolbar .is-active { outline: 2px solid #005298; }
.workflow-canvas {
  position: relative;
  height: min(70vh, 44rem);
  min-height: 28rem;
  border: 1px solid var(--line, #d6d3d1);
  border-radius: 12px;
  background: #fafaf9;
  overflow: auto;
}
.workflow-surface {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(28,25,23,0.05) 1px, transparent 1px),
    linear-gradient(rgba(28,25,23,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #fafaf9;
}
.workflow-edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.workflow-edge { stroke: #1c1917; stroke-width: 2; fill: none; }
.workflow-arrow { fill: #1c1917; stroke: none; }
.workflow-edge-label {
  fill: #57534e;
  font-size: 9px;
  paint-order: stroke;
  stroke: #fafaf9;
  stroke-width: 3px;
}
.workflow-node {
  position: absolute;
  width: 148px;
  min-height: 48px;
  padding: 0.35rem 0.45rem;
  border: none;
  border-radius: 8px;
  text-align: left;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.12);
  display: grid;
  gap: 0.1rem;
  z-index: 1;
}
.workflow-node strong {
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.workflow-node-kind { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; }
.workflow-node.kind-agent { background: #005298; color: #fff; }
.workflow-node.kind-human { background: #f39a1f; color: #1a1a2e; }
.workflow-node.kind-decision {
  background: #cadcf5;
  color: #1a1a2e;
  border-radius: 8px;
  width: 88px;
  min-height: 88px;
  place-content: center;
  text-align: center;
  padding: 0.45rem 0.35rem;
  clip-path: none;
  box-shadow: inset 0 0 0 1px #00529855;
}
.workflow-node.kind-decision strong { -webkit-line-clamp: 4; font-size: 0.68rem; }
.instruction-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.instruction-head label { margin: 0; }
button.icon-button.instruction-wand { color: var(--accent); }
button.icon-button.instruction-wand svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.enhance-log { display: grid; gap: 0.65rem; max-height: 16rem; overflow: auto; margin: 0.85rem 0; }
.enhance-line { margin: 0; border-radius: 12px; padding: 0.65rem 0.75rem; line-height: 1.45; white-space: pre-wrap; }
.enhance-line.assistant { background: var(--accent-soft); }
.enhance-line.user { background: var(--ground); }
.enhance-draft { min-height: 12rem; line-height: 1.45; }
.channel-description { min-height: 9rem; line-height: 1.45; }
.visibility { display: grid; gap: 0.55rem; }
.private-roster { display: none; gap: 0.45rem; margin-top: 0.35rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.visibility:has(#visibility-private:checked) .private-roster { display: grid; }
.roster-head { margin: 0.45rem 0 0; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 0.45rem;
}
.choice { font-weight: 500; display: flex; gap: 0.5rem; align-items: center; }
.choice input { width: auto; }
.choice.legal { align-items: flex-start; line-height: 1.45; font-weight: 500; }
.choice.legal input { margin-top: 0.2rem; flex: none; }
.choice.legal span { min-width: 0; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
}
button:disabled, .button:disabled {
  background: #c9cdd3;
  color: #5b6169;
  cursor: not-allowed;
}
button.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
button.icon-button svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
button.ghost, a.ghost, .ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-input);
  text-decoration: none;
}
button.ghost:hover, a.ghost:hover {
  background: var(--ground);
  color: var(--ink);
  border-color: #b8bec6;
}
button.text {
  background: transparent;
  color: var(--danger);
  padding: 0.2rem 0.4rem;
}
.org-directory { list-style: none; padding: 0; margin: 0.8rem 0 1.25rem; display: grid; gap: 0.5rem; }
.org-directory li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.org-directory p { margin: 0.15rem 0 0; }
.logo-preview, .org-thumb { object-fit: contain; background: white; border: 1px solid var(--line); border-radius: 12px; }
.logo-preview { width: 8rem; height: 4.5rem; }
.org-thumb { width: 2.6rem; height: 2.6rem; flex: none; }
.org-list { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.org-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-decoration: none;
}
.cards li {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.app {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}
.app.with-members { grid-template-columns: 272px minmax(0, 1fr) 300px; }
.app.with-members.members-collapsed { grid-template-columns: 272px minmax(0, 1fr) 2.5rem; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  color-scheme: dark;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.side-head, .side-foot { padding: 1rem; }
.side-head .mark { color: var(--mark); }
.org-logo { display: block; width: auto; max-width: 100%; max-height: 3.4rem; object-fit: contain; object-position: left center; margin: 0 0 0.2rem; }
.side-nav {
  padding: 0 0.75rem 1rem;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--switch-line) transparent;
}
.side-nav::-webkit-scrollbar { width: 8px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb {
  background: var(--switch-line);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
.side-nav .channel-list { margin-bottom: 0.75rem; }
.side-label, .nav-link, .channel-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.side-label { color: var(--sidebar-muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0.5rem 0.4rem; }
.icon-add {
  width: 1.45rem;
  height: 1.45rem;
  margin: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--sidebar-text);
  background: var(--sidebar-raise);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
}
.icon-add:hover { background: var(--switch-line); }
.channel-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.invite-row { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; padding: 0.2rem 0.45rem; }
.invite-row form { margin: 0; }
.channel-list a, .nav-link {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  justify-content: flex-start;
}
.channel-list a.is-active, .nav-link.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.channel-list a.is-active .hash, .channel-list a.is-active svg { color: #fff; opacity: 0.9; }
.channel-group {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.channel-group a {
  flex: 1;
  min-width: 0;
  color: var(--sidebar-muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 0.15rem;
}
.group-fold {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  border: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.group-fold svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.channel-group.is-folded .group-fold svg { transform: rotate(-90deg); }
.group-fold:hover { background: var(--sidebar-raise); color: var(--sidebar-text); }
.channel-child a { padding-left: 1.35rem; }
.breakout-side { margin-top: 0.85rem; }
.breakout-side-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.breakout-side-head h3 { margin: 0; }
.breakout-side-tools { display: inline-flex; align-items: center; gap: 0.35rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1.1rem 0 0.4rem; }
.panel-head h3 { margin: 0; }
.breakout-side-head .icon-add,
.panel-head .icon-add {
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--accent);
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.breakout-side-head .icon-add:hover,
.panel-head .icon-add:hover { background: var(--canvas); }
.breakout-side-head .icon-add svg { width: 0.95rem; height: 0.95rem; }
.archive-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.archive-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-width: 0; }
.archive-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-decoration: none; }
.archive-list form { margin: 0; flex: none; }
.archive-list button { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.conv-actions form { margin: 0; }
.member-dialog form { display: grid; gap: 0.45rem; }
.member-dialog input[type="search"] { width: 100%; font: inherit; font-size: 0.95rem; }
.member-dialog .member-picks { display: grid; gap: 0.1rem; max-height: 16rem; overflow: auto; margin: 0.15rem 0; }
.member-dialog .member-picks button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: left;
}
.member-dialog .member-picks button:hover { background: var(--accent-soft); }
.member-dialog .member-picks button[hidden] { display: none; }
.breakout-dialog form { display: grid; gap: 0.45rem; }
.breakout-dialog input[type="text"],
.breakout-dialog input:not([type="checkbox"]) { width: 100%; font: inherit; font-size: 0.95rem; }
.breakout-dialog .people-picks {
  border: 0;
  margin: 0.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  max-height: 16rem;
  overflow: auto;
}
.breakout-dialog .people-picks legend { font-size: 0.78rem; color: var(--muted); padding: 0; }
.breakout-dialog .people-picks label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.28rem 0.15rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.breakout-dialog .people-picks input { width: 1rem; height: 1rem; margin: 0; flex: none; }
.breakout-side-list { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.breakout-item { display: grid; gap: 0.25rem; }
.breakout-label { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; min-width: 0; width: 100%; }
.breakout-tools { display: inline-flex; align-items: center; gap: 0.05rem; margin-left: auto; flex: none; }
.breakout-label .icon-btn { width: 1.45rem; height: 1.45rem; }
.breakout-label .icon-btn svg { width: 0.95rem; height: 0.95rem; }
.breakout-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-weight: 650;
}
.breakout-alert {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  flex: none;
  color: var(--muted);
}
.breakout-alert svg { width: 0.95rem; height: 0.95rem; }
.breakout-alert.is-stale { color: var(--accent); }
.breakout-since { font-size: 0.72rem; font-weight: 700; line-height: 1; }
.breakout-summary-fold {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
}
.breakout-summary-fold p { margin: 0; font-size: 0.86rem; }
.breakout-summary-when { margin-top: 0.35rem; font-size: 0.75rem; }
.breakout-roll {
  margin-top: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
}
.channel-label { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.channel-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-list .badge.unread {
  margin-left: auto;
  flex: none;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 1.15rem;
  text-align: center;
  line-height: 1.4;
}
.channel-list a.is-active .badge.unread { background: #fff; color: var(--accent); }
.channel-group:not(.is-folded) .badge.unread { display: none; }
.channel-list a.with-face .dm-name { flex: 1; }
.hash { color: var(--sidebar-muted); margin-right: 0.15rem; display: inline-flex; }
.side-icon { width: 15px; height: 15px; flex: none; opacity: 0.9; }
.pa-pin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 0.25rem 0.65rem;
  border-radius: var(--radius);
  background: var(--sidebar-raise);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
.pa-pin .badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  margin-left: auto;
}
.admin-nav {
  margin-top: auto;
  border-top: 1px solid #2a2e35;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-top: 6px;
  border-radius: var(--radius);
  background: var(--switch-bg);
}
.side-user .avatar-person { width: 30px; height: 30px; font-size: 11px; }
.side-user strong { color: #fff; font-weight: 500; display: block; }
.side-user span { color: var(--sidebar-muted); font-size: 12px; }
.side-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.side-profile:hover strong { text-decoration: underline; }
.side-foot {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.75rem 0.85rem calc(0.75rem + 0.55rem);
  border-top: 0;
}
.side-foot span { display: block; color: var(--sidebar-muted); font-size: 0.8rem; }
.side-foot .ghost { color: var(--sidebar-text); border-color: var(--switch-line); }
.org-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.org-mark {
  width: 36px; height: 36px; border-radius: var(--radius); background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex: none;
}
.org-brand .org-logo {
  width: auto;
  height: 40px;
  max-width: 11.5rem;
  max-height: 40px;
  margin: 0;
  flex: none;
  object-fit: contain;
  object-position: left center;
  border-radius: 6px;
  background: #fff;
}
.org-brand .org-logo.brand-fallback {
  width: 36px;
  height: 36px;
  max-width: 36px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
}
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 0.72rem;
  line-height: 1;
}
.powered-by:hover { color: var(--sidebar-text); }
.side-foot .powered-by span { display: inline; font-size: inherit; color: inherit; }
.powered-by img { display: block; width: 14px; height: 14px; }
.org-brand strong { color: #fff; font-weight: 600; font-size: 15px; display: block; }
.org-brand .slug { font-family: var(--mono); font-size: 11px; color: var(--sidebar-muted); }
.unread-pill {
  background: #3a3f48; color: #fff; font-size: 11px; border-radius: var(--radius-pill); padding: 1px 7px; margin-left: auto;
}

.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: auto; background: var(--ground); }
.stage:has(.workspace-main) { overflow: hidden; }
.workspace-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-wrap: nowrap; align-items: stretch; overflow: hidden; background: var(--ground); }
.conversation {
  flex: 999 1 520px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.thread-panel {
  flex: 1 1 380px;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line);
}
.conv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.conv-head .title-block { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.conv-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.conv-meta { font-size: 13px; color: var(--muted); }
.conv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--radius);
  border: 1px solid #d5d9de;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.head-btn.icon { padding: 8px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.status-pill.neutral { background: #eef0f3; color: var(--ink-2); }
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.status-pill.ok .dot { background: var(--ok-dot); }
.panel {
  width: min(68rem, calc(100% - 2.5rem));
  margin: 1.25rem auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem 1.5rem 1.6rem;
  box-shadow: var(--shadow);
}
.conv-head h1, .panel h1 { margin: 0; font-size: 1.45rem; }
.conv-head h1 { font-size: 1.15rem; }
.channel-title { display: flex; align-items: center; gap: 0.1rem; min-width: 0; }
.breakout-back {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  align-self: flex-start;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.breakout-back:hover { color: var(--ink); }
.breakout-back svg { width: 0.95rem; height: 0.95rem; flex: none; }
.channel-rename { display: flex; align-items: center; gap: 0.15rem; min-width: 0; }
.channel-rename input {
  width: 14rem;
  max-width: 42vw;
  height: 2rem;
  margin: 0;
  padding: 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}
#channel-name-label[hidden],
#channel-rename[hidden],
.channel-rename[hidden],
.group-move .group-name[hidden] { display: none; }
.conv-meta {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-actions { flex-wrap: nowrap; }
.head-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
}
.head-icon svg, .schedule-label svg { width: 1.05rem; height: 1.05rem; }
.head-icon.is-on { color: var(--ok); }
.group-move { display: flex; align-items: center; gap: 0.25rem; margin: 0; }
.group-move select,
.group-move .group-name {
  width: auto;
  height: 2rem;
  margin: 0;
  padding: 0 0.55rem;
  font-size: 0.78rem;
}
.group-move select { min-width: 7.5rem; padding-right: 1.4rem; }
.group-move .group-name { width: 8rem; }
.head-btn.icon { gap: 0.3rem; padding: 0.4rem 0.55rem; }
.head-count { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.schedule-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.panel h1 + .lede, .split .lede { margin: 0.35rem 0 0; }
.conv-head p { margin: 0.25rem 0 0.8rem; color: var(--muted); }
.lock {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--banner-bg);
  color: var(--banner-ink);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  vertical-align: middle;
}
.conv-head, .composer, .schedule-strip { flex: none; }
.schedule-strip {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--ground);
}
.schedule-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}
.schedule-row input[type="time"],
.schedule-row select.zone {
  width: auto;
  padding: 0.35rem 0.5rem;
}
.schedule-row select.zone { width: 11rem; }
.schedule-strip p { margin: 0; }
.transcript { flex: 1; min-height: 0; overflow: auto; padding: 12px 0; }
.day-rule {
  display: flex; align-items: center; gap: 12px; padding: 8px 24px;
  font-size: 12px; color: var(--muted); font-weight: 500;
}
.day-rule::before, .day-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg {
  display: flex;
  gap: 12px;
  padding: 10px 24px;
}
.msg.agent { background: var(--accent-soft); }
.msg.system { color: var(--muted); font-size: 0.92rem; }
.msg.system .avatar { display: none; }
.avatar, .avatar-person, .avatar-agent {
  width: 36px; height: 36px; flex: none;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; overflow: hidden; font-size: 12px;
}
.avatar-person { border-radius: 50%; }
.avatar-agent {
  border-radius: 9px;
  background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--accent);
  font-family: var(--mono); font-size: 11px;
}
.avatar img, .mini-avatar, .avatar-person img, .avatar-agent img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-list a.with-face { display: flex; align-items: center; gap: 0.45rem; }
.channel-list a.with-face .dm-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-face.avatar-person, .side-face.avatar-agent {
  width: 22px;
  height: 22px;
  font-size: 9px;
  flex: none;
}
.side-face.avatar-agent { border-radius: 6px; }
.side-face.avatar-person { background: #e6ddf7; color: #3e2a6b; }
.mini-avatar { width: 1.7rem; height: 1.7rem; border-radius: 8px; flex: none; }
.mini-avatar.person { border-radius: 50%; }
.who-line { display: inline-flex; align-items: center; gap: 0.45rem; }
.avatar-editor { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.avatar-preview.is-hidden, .avatar-fallback.is-hidden { display: none; }
.avatar-preview, .avatar-fallback { width: 4.5rem; height: 4.5rem; border-radius: 16px; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.4rem; }
.avatar-editor .stack { margin-top: 0; }
#avatar-status { min-height: 1.2rem; }
#avatar-status.is-busy { color: var(--ink-2); font-weight: 600; }
#avatar-status.is-error { color: var(--danger); }
#avatar-status.is-ok { color: var(--ok); }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.msg-main header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg-main header strong { font-weight: 600; }
.agent-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef0f3;
  color: var(--ink-2);
}
.msg.agent .agent-tag { background: var(--surface); }
.agent-tag.is-deleted { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.head-btn.danger { color: var(--danger); }
.msg-main time, .tool-line { color: var(--muted); font-size: 12px; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tool-chips span { padding: 2px 6px; background: #f1f3f5; border-radius: 4px; }
.msg.agent .tool-chips span { background: var(--surface); }
.citation-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.citation-chips a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 3px 9px; border: 1px solid #d5d9de; border-radius: var(--radius-pill);
  color: var(--ink-2); text-decoration: none; background: var(--surface);
}
.citation-chips .n { font-family: var(--mono); color: var(--accent); font-weight: 500; }
.action-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid #e1e4e8; border-radius: var(--radius-md);
  background: #fafafb; max-width: 520px;
}
.action-card .check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #8a9099; flex: none; }
.body { margin: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.body.rich { white-space: normal; }
.body.rich > *:first-child { margin-top: 0; }
.body.rich > *:last-child { margin-bottom: 0; }
.body.rich h2, .body.rich h3, .body.rich h4 {
  margin: 16px 0 8px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.body.rich h2 { font-size: 16px; }
.body.rich h3 { font-size: 15px; }
.body.rich h4 { font-size: 14px; }
.body.rich p { margin: 0 0 10px; }
.body.rich ul, .body.rich ol { margin: 0 0 12px; padding-left: 1.2em; }
.body.rich li { margin: 4px 0; }
.body.rich strong { font-weight: 700; }
.body.rich a { color: var(--accent); }
.body.rich blockquote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--line);
  color: var(--ink-2);
}
.body.rich pre {
  margin: 0 0 12px;
  padding: 10px 12px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12px;
}
.msg-table {
  margin: 8px 0 14px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.msg-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.msg-table th, .msg-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eef0f3;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.msg-table th {
  font-weight: 600;
  color: var(--ink-2);
  background: #fafafb;
  white-space: nowrap;
}
.msg-table td.num, .msg-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.msg-table .col-index { width: 2.4rem; white-space: nowrap; color: var(--muted); }
.msg-table tbody tr:last-child td { border-bottom: 0; }
.working {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.msg[data-status="streaming"] .working { display: flex; }
.msg[data-status="streaming"] .tool-chips { display: none; }
.working-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.working-steps {
  list-style: none;
  margin: 0;
  padding: 0 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.working-steps li { position: relative; line-height: 1.35; }
.working-steps li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9cdd3;
}
.working-steps li.is-done::before { background: var(--accent); opacity: 0.35; }
.working-steps li.is-current { color: var(--accent); font-weight: 600; }
.working-steps li.is-current::before { background: var(--accent); opacity: 1; }
.working-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.working-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: working-bounce 1s ease-in-out infinite;
}
.working-dots i:nth-child(2) { animation-delay: 0.15s; }
.working-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes working-bounce {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .working-dots i { animation: none; opacity: 0.7; }
}
.composer-busy {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.composer {
  padding: 12px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
}
.composer-hint { font-size: 12px; color: var(--muted); margin: 0; }
.composer-busy + .composer-box { margin-top: 2px; }
.composer-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-input);
  border-radius: var(--radius-lg);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-box.is-dropping,
.thread-composer.is-dropping {
  border-color: var(--accent);
  border-style: dashed;
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer-box.is-dropping::after,
.thread-composer.is-dropping::after {
  content: "Drop to attach";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: color-mix(in srgb, var(--surface) 72%, var(--accent-soft));
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  z-index: 2;
}
.composer-box textarea {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  max-height: 9rem;
  border: 0;
  padding: 12px 14px 4px;
  resize: none;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.composer-box textarea:focus { outline: none; }
.composer-tools { display: flex; align-items: center; gap: 4px; padding: 6px 8px; }
.mention-menu {
  position: absolute;
  z-index: 30;
  left: 0;
  width: min(22rem, 100%);
  bottom: calc(100% + 6px);
  max-height: 16rem;
  overflow: auto;
  margin: 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-input);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
.mention-menu[hidden] { display: none; }
button.mention-option {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
button.mention-option.is-active,
button.mention-option:hover { background: var(--accent-soft); }
button.mention-option .fine { font-weight: 500; }
.icon-btn {
  position: relative;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--canvas); color: var(--ink); }
button.icon-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
button.icon-btn.is-listening {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.icon-btn input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.icon-btn svg, .send-btn svg { width: 1.15rem; height: 1.15rem; }
.send-btn {
  width: auto;
  height: auto;
  padding: 8px 10px;
  border-radius: var(--radius);
  margin-left: auto;
}
.thread-panel .conv-head { padding: 16px 20px; }
.thread-panel .transcript { padding: 12px 0; }
.thread-panel .msg { padding: 10px 20px; gap: 10px; }
.thread-panel .avatar-person, .thread-panel .avatar-agent { width: 30px; height: 30px; font-size: 10px; }
.thread-panel .composer { padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.thread-composer {
  position: relative;
  display: flex; gap: 8px; align-items: center;
}
.thread-composer input:not([type="file"]) {
  flex: 1; min-width: 0; font: inherit; font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--line-input); border-radius: var(--radius-md);
}
.thread-count {
  display: flex; align-items: center; gap: 10px; padding: 4px 20px;
  font-size: 12px; color: var(--muted);
}
.thread-count::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mono { font-family: var(--mono); }
.file-chip.is-hidden { display: none; }
.file-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
  margin-bottom: 0.35rem;
}
.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.15rem 0.2rem 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--banner-bg);
  color: var(--banner-ink);
  font-size: 0.85rem;
  font-weight: 600;
}
.file-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill button {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--banner-ink);
  font-size: 1rem;
  line-height: 1;
}

.members { position: relative; border-left: 1px solid var(--line); background: var(--paper); padding: 1rem 1rem 1rem 0.85rem; overflow: auto; min-height: 0; }
.members-title { display: flex; align-items: center; gap: 0.15rem; margin: 0 1.8rem 0.35rem 0; }
.members-title h2 { margin: 0; font-size: 1rem; }
.channel-attrs-toggle svg { width: 1.05rem; height: 1.05rem; transition: transform 0.15s ease; }
.channel-attrs-toggle.is-open svg { transform: rotate(180deg); }
#channel-attrs[hidden] { display: none; }
.members-collapse {
  position: absolute;
  top: 0.55rem;
  right: 0.35rem;
  z-index: 1;
}
.members-collapse svg { width: 1.05rem; height: 1.05rem; }
.app.members-collapsed .members { padding: 0.45rem 0.15rem; overflow: hidden; min-height: 2.5rem; }
.app.members-collapsed .members > :not(.members-collapse) { display: none; }
.app.members-collapsed .members-collapse svg { transform: rotate(180deg); }
.members h3 { margin: 1.1rem 0 0.4rem; font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.channel-settings { display: grid; gap: 0.4rem; margin: 0 0 0.2rem; }
.channel-settings input,
.channel-settings textarea,
.channel-settings select {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
}
.channel-settings textarea { min-height: 3rem; }
.settings-row { display: flex; align-items: center; gap: 0.3rem; }
.settings-row select { flex: 1; width: auto; }
.channel-settings .group-name[hidden] { display: none; }
.settings-memory {
  position: relative;
  width: 2rem;
  height: 2rem;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}
.settings-memory input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.settings-memory svg { width: 1.05rem; height: 1.05rem; }
.settings-memory:has(input:checked) { color: var(--ok); }
.settings-readonly { display: flex; align-items: center; gap: 0.35rem; margin: 0; }
.members .schedule-strip { padding: 0; border: 0; background: transparent; }
.members .schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto auto;
  align-items: center;
}
.members .schedule-label { grid-column: 1 / -1; }
.members .schedule-row input[type="time"],
.members .schedule-row select.zone { width: 100%; min-width: 0; }
.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.member-list li { display: flex; justify-content: space-between; gap: 0.35rem; align-items: center; min-width: 0; }
.member-list li > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-list .row-actions { flex: none; flex-wrap: nowrap; gap: 0; }
.member-list .row-actions form, .agent-line form { margin: 0; flex: none; }
.member-list li.agent-row { display: grid; justify-content: stretch; gap: 0.35rem; }
.agent-line { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; min-width: 0; }
.agent-line .who-line { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row > a.button { margin-top: 0.45rem; }
.agent-connections { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.agent-connections li { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.agent-connections li > .conn-name { flex: 1; min-width: 0; }
.agent-connections li > span, .agent-connections li > a { min-width: 0; }
.agent-connections form { margin: 0; }
.agent-connections a, .agent-connections span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}
.agent-connections svg { width: 0.95rem; height: 0.95rem; flex: none; color: var(--ok); }
.agent-connections .people-icon svg { color: currentColor; }
.agent-connections .is-off { color: var(--warn); }
.agent-connections .is-off svg { color: var(--warn); }
.agent-connections .conn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-connections .conn-mask { flex: none; letter-spacing: 0.12em; font-family: ui-monospace, monospace; color: var(--muted); }
.members .conn-add { margin-top: 0.35rem; }
.agent-connections .conn-connect { display: flex; gap: 0.25rem; align-items: center; flex: 1; min-width: 0; margin: 0; }
.agent-connections .conn-connect input { flex: 1; min-width: 0; width: auto; }
.agent-connections form button.text { font-size: 0.75rem; padding: 0; }
.members .conn-add select { width: auto; flex: 1; min-width: 0; }
.conn-google { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; margin: 0.35rem 0 0.15rem; font-size: 0.78rem; }
.conn-google a { color: var(--ink-2); text-decoration: none; }
.conn-google a:hover { text-decoration: underline; }
.member-list em { color: var(--muted); font-style: normal; font-size: 0.82rem; }
.inline-form { display: flex; gap: 0.4rem; margin-top: 0.55rem; }
.inline-form select { flex: 1; }
.split { display: flex; justify-content: space-between; gap: 1.25rem; align-items: center; }
.split .button { flex: none; }
.section-label {
  margin: 1.5rem 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
a.connect-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.7rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
}
a.connect-card::after { content: "Connect"; font-weight: 600; }
.connector-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0.55rem 0;
}
.connector-card p { margin: 0.2rem 0 0; }
.connector-card-stack { flex-direction: column; align-items: stretch; }
.connector-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.resource-list { list-style: none; margin: 0.7rem 0 0; padding: 0; }
.resource-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}
.resource-row .blocked { color: var(--muted); text-decoration: line-through; }
.connector-list { margin-bottom: 1.25rem; }
.connector-list h2 { margin: 0 0 0.35rem; }
.connector-list h3 { margin: 1rem 0 0.35rem; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.connector-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1rem;
  max-width: 34rem;
  width: calc(100% - 2rem);
  background: var(--paper, #fff);
}
.connector-dialog::backdrop { background: rgba(40, 28, 18, 0.45); }
.connector-dialog h2 { margin: 0 0 0.35rem; }
.connector-dialog > form > p { margin: 0 0 0.8rem; }
.region-list { display: grid; gap: 0.15rem; max-height: 22rem; overflow: auto; margin: 0.4rem 0 0.2rem; }
.connector-dialog .region-list label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.45rem 0.35rem;
  font-weight: 500;
}
.connector-dialog .region-list input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  margin: 0.2rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent, #c45c26);
}
.connector-dialog .region-list label > span { display: grid; gap: 0.1rem; min-width: 0; }
.connector-dialog .region-list strong { font-weight: 700; }
.connector-dialog .action-row { justify-content: flex-end; margin-top: 0.8rem; }
.server-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 0.8rem 0;
  display: grid;
  gap: 0.75rem;
}
.mcp-list { display: grid; gap: 0.55rem; margin: 0.9rem 0 1.4rem; }
.mcp-server { display: grid; gap: 0.35rem; }
.mcp-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
.mcp-count {
  flex: none;
  min-width: 1.4rem;
  text-align: right;
  font-weight: 700;
  color: var(--muted);
}
.mcp-tools { display: inline-flex; align-items: center; gap: 0.1rem; flex: none; }
.mcp-tools form { margin: 0; }
.mcp-tools .icon-btn.is-open svg { transform: rotate(180deg); }
.mcp-access { list-style: none; margin: 0 0 0.2rem; padding: 0 0.4rem 0.2rem 0.9rem; display: grid; gap: 0.2rem; }
.mcp-access[hidden] { display: none; }
.mcp-access li { font-weight: 600; }
.mcp-grant-dialog form { display: grid; gap: 0.45rem; }
.mcp-grant-dialog input[type="search"] { width: 100%; font: inherit; font-size: 0.95rem; }
.mcp-grant-dialog .people-picks {
  border: 0;
  margin: 0.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  max-height: 16rem;
  overflow: auto;
}
.mcp-grant-dialog .people-picks label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.28rem 0.15rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.mcp-grant-dialog .people-picks label[hidden] { display: none; }
.mcp-grant-dialog .people-picks input { width: 1rem; height: 1rem; margin: 0; flex: none; }
.cards { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.65rem; }
.cards li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}
.cards li.empty { display: block; color: var(--muted); }
.cards li:has(> a.card-link) { padding: 0; }
.cards a.card-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.cards a.card-link:hover {
  background: var(--accent-soft, rgba(59, 91, 219, 0.08));
}
.cards a.card-link .fine { color: var(--muted); }
.who { display: grid; gap: 0.15rem; min-width: 0; }
.who strong, .who span { overflow-wrap: anywhere; }
.memory-preview {
  margin: 0.75rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 28rem;
  overflow: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}
.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: var(--banner-bg);
  color: var(--banner-ink);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  text-transform: capitalize;
}
.row-actions { display: flex; gap: 0.45rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.action-row { display: flex; align-items: center; gap: 0.4rem; margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.action-row select { width: auto; min-width: 7.25rem; height: 2.45rem; padding: 0 0.65rem; }
button.compact, a.compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.45rem;
  padding: 0 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}
button.compact svg, a.compact svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1.25rem;
}
.invite-row button { height: 2.7rem; }
.files { list-style: none; padding: 0; margin: 0.35rem 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; max-width: 100%; }
.files li { max-width: 100%; min-width: 0; }
.files a {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.files .file-name { min-width: 0; overflow-wrap: anywhere; }
.files a:hover { border-color: var(--accent); }
.file-mark {
  flex: none;
  width: 0.55rem;
  height: 0.7rem;
  margin-top: 0.18rem;
  border: 1.5px solid currentColor;
  border-radius: 1px;
  position: relative;
}
.file-mark::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  border-top: 4px solid var(--canvas);
  border-left: 4px solid currentColor;
}
.thread-link { color: var(--accent); font-size: 0.88rem; }
.reactions { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.reactions form { margin: 0; }
button.reaction, span.reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
}
button.reaction.is-mine, span.reaction.is-mine {
  background: var(--accent-soft);
  border-color: var(--accent);
}
button.reaction:hover { background: var(--canvas); }
.reaction-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.reaction-picker { position: relative; }
.reaction-picker > summary { list-style: none; }
.reaction-picker > summary::-webkit-details-marker { display: none; }
.msg-actions .reaction-picker { display: flex; flex: none; }
.reaction-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.reaction-open svg { width: 1.05rem; height: 1.05rem; display: block; }
.reaction-open:hover { background: var(--canvas); color: var(--ink); }
.reaction-picker:not([open]) > .reaction-menu { display: none; }
.reaction-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  bottom: calc(100% + 4px);
  display: flex;
  gap: 0.15rem;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(21, 23, 28, 0.08);
}
button.reaction-option {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 1.05rem;
  font-weight: 500;
}
button.reaction-option:hover { background: var(--canvas); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 0.15rem; align-items: center; }
.msg-actions form { margin: 0; }
a.msg-icon, button.msg-icon {
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
a.msg-icon:hover, button.msg-icon:hover { background: var(--canvas); color: var(--ink); }
.msg-icon svg { width: 1.05rem; height: 1.05rem; }
.msg-count {
  position: absolute;
  top: 0.05rem;
  right: 0.02rem;
  min-width: 0.85rem;
  height: 0.85rem;
  padding: 0 0.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.6rem;
  line-height: 0.85rem;
  text-align: center;
}
#forward-dialog [hidden], .msg-count[hidden] { display: none; }
.forward-groups { max-height: 22rem; overflow: auto; margin: 0.35rem 0 0.2rem; }
.forward-groups h3 {
  margin: 0.85rem 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
button.forward-target {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-weight: 600;
  text-align: left;
}
button.forward-target:hover { background: var(--accent-soft); }
#forward-dialog #forward-search { width: 100%; margin-top: 0.75rem; }

.people-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}
.people-head .lede { margin: 0.25rem 0 0; }
.people-title { display: flex; align-items: center; gap: 0.55rem; }
.people-title h1 { margin: 0; }
.people-add {
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.people-add:hover { background: var(--accent-soft); }
.people-add:disabled { opacity: 0.45; cursor: not-allowed; }
.meter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 11rem;
}
.meter-label { font-size: 0.75rem; color: var(--warn); font-weight: 600; }
.meter-value { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.1rem; color: var(--warn); }
.meter-bar {
  height: 6px;
  border-radius: 3px;
  background: #f6e6d4;
  display: flex;
  overflow: hidden;
}
.meter-bar > span { display: block; background: #c2410c; border-radius: 3px; }
.meter.is-full .meter-value { color: var(--danger); }
.cap-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  margin-bottom: 1rem;
}
.cap-alert .button {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}
.table-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.people-list { list-style: none; margin: 0; padding: 0; }
.people-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.15rem;
  padding: 0.35rem 0.85rem;
  border-top: 1px solid #eef0f3;
}
.people-list .people-row:first-child { border-top: 0; }
.people-row .who {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}
.people-row .who-id {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  white-space: nowrap;
}
.people-row .who-id strong { font-size: 0.92rem; }
.people-row .who-id .fine {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.people-tools {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: none;
}
.people-tools form { display: flex; margin: 0; }
.people-tools select {
  width: auto;
  height: 2rem;
  min-width: 6.1rem;
  margin: 0;
  padding: 0 1.4rem 0 0.55rem;
  border-radius: 8px;
  font-size: 0.78rem;
}
.people-role {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.35rem;
}
.people-status {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.people-status svg { width: 1.05rem; height: 1.05rem; }
.people-status.ok { color: var(--ok); }
.people-status.warn { color: var(--warn); }
a.people-icon, button.people-icon, label.people-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  text-decoration: none;
}
a.people-icon svg, button.people-icon svg, label.people-icon svg { width: 1.05rem; height: 1.05rem; }
button.people-icon.danger {
  background: transparent;
  color: var(--muted);
}
button.people-icon.danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.people-row .avatar-person {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef0f3;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex: none;
}

.skill-grid {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.85rem;
}
button.skill-card {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  min-height: 11rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
  text-align: left;
  align-items: start;
  justify-content: stretch;
  box-shadow: none;
}
button.skill-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  color: var(--ink);
}
button.skill-card strong {
  font-weight: 700;
  font-size: 1.02rem;
}
button.skill-card .fine {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.skill-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 3.6rem;
  align-items: center;
  margin-bottom: 0.25rem;
}
.skill-thumbs img {
  height: 3.4rem;
  max-width: 7.25rem;
  object-fit: contain;
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
  background: #fff;
  border: 1px solid var(--line);
}
.skill-thumbs img.is-reversed {
  background: #1a1a2e;
  border-color: #1a1a2e;
}
.skill-mark {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
}
.skill-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  max-width: 42rem;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 3rem);
  background: var(--paper, #fff);
  box-shadow: var(--shadow);
}
.skill-dialog::backdrop { background: rgba(21, 23, 28, 0.45); }
.skill-dialog-body {
  padding: 1.2rem 1.3rem 1.15rem;
  overflow: auto;
  max-height: calc(100vh - 3rem);
}
.skill-dialog-body > .split { margin-bottom: 0.85rem; }
.skill-dialog h2 { margin: 0; font-size: 1.2rem; }
.skill-dialog .stack { margin-top: 0.9rem; }
.skill-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}
.skill-previews figure {
  margin: 0;
  padding: 1rem 0.85rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f6fa;
}
.skill-previews figure.is-reversed { background: #1a1a2e; border-color: #1a1a2e; }
.skill-previews img {
  display: block;
  max-width: 100%;
  max-height: 7.5rem;
  margin: 0 auto;
  object-fit: contain;
}
.skill-previews figcaption {
  margin-top: 0.55rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.skill-previews figure.is-reversed figcaption { color: #c9cdd3; }
.skill-dialog .files { margin: 0 0 0.4rem; }
.skill-dialog .section-label { margin: 0.35rem 0 0; }
.skill-dialog form.stack + form.stack {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.profile-nav { display: flex; gap: 0.85rem; align-items: center; }
.profile-nav a { color: var(--ink-2); font-size: 0.9rem; }
.profile-page section { margin: 1.6rem 0; }
.profile-page h2 { margin: 0 0 0.6rem; }
.page-back { margin: 0 0 1rem; }
.avatar-editor.person .avatar-preview,
.avatar-editor.person .avatar-fallback { border-radius: 50%; }
.legal-page h2 { margin: 1.4rem 0 0.5rem; }
.legal-page ul { padding-left: 1.2rem; color: var(--ink-2); }
.danger-zone { border-top: 1px solid var(--line); padding-top: 1.2rem; }
button.danger {
  background: var(--danger);
  color: #fff;
}

@media (max-width: 960px) {
  .app, .app.with-members, .app.with-members.members-collapsed { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .sidebar, .members, .conversation, .stage, .thread-panel { min-height: auto; overflow: visible; }
  .stage:has(.workspace-main) { overflow: visible; }
  .workspace-main { flex-wrap: wrap; overflow: visible; }
  .transcript { overflow: visible; }
  .sidebar { position: sticky; top: 0; z-index: 2; }
  .side-nav { max-height: 40vh; overflow: auto; }
  .members { border-left: 0; border-top: 1px solid var(--line); }
}
