:root {
  color-scheme: light;
  --canvas: #f4f4f2;
  --paper: #fff;
  --conversation: #fafaf8;
  --ink: #292927;
  --brand: #A94D36;
  --muted: #686864;
  --line: #e5e5e1;
  --accent: #474743;
  --tint: #eaeae7;
  --danger: #8a3627;
  --width: 680px;
  --header-height: 48px;
  --mono: "SF Mono", ui-monospace, Consolas, monospace;
  font: 14px/1.5 system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.control, .text-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  font-weight: 600;
  font-size: 12px;
}
.control {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.control:hover, .session:hover, .file:hover { background: var(--tint); }
.loading { margin: 36px auto; color: var(--muted); }

.app {
  --rail-width: 43px;
  --detail-width: clamp(278px, 30vw, 580px);
  position: relative;
  display: grid;
  grid-template: "rail chats workspace files" minmax(0, 1fr)
    / var(--rail-width) var(--left-tray, 0px) minmax(0, 1fr) var(--right-tray, 0px);
  flex: 1;
  min-height: 0;
}
.app.sidebar-open { --left-tray: var(--chat-width); }
.app.details-open { --right-tray: var(--detail-width); }
.sidebar, .rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #f6f6f4;
}
.sidebar { position: relative; grid-area: chats; min-width: 0; padding: 0 6px 12px; }
.rail { grid-area: rail; align-items: center; gap: 6px; padding: 10px 0; }
.rail-settings { margin-top: auto; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.glyph { display: block; flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-header, .task-heading, .participants, .profile-card {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-header {
  min-height: var(--header-height);
  padding-inline: 10px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.02em;
}
.tray-close { margin-left: auto; color: var(--muted); }
.brand-mark {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 7px;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 650;
  font-size: 14px;
}
.new-chat, .sidebar-item, .icon-control {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}
.new-chat, .sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  min-height: 33px;
  min-width: 0;
  text-align: left;
}
.new-chat { margin-inline: 3px; font-weight: 500; }

.sidebar-item {
  width: 100%;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.chat-item { display: block; }
.sidebar-item > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.sidebar-item[aria-current] {
  background: #e7e7e4;
  color: var(--accent);
  font-weight: 550;
}
.sidebar-item:hover, .icon-control:hover { background: #eaeae7; }
.new-chat:hover { background: var(--tint); }
.sidebar-content { min-height: 0; flex: 1; overflow: auto; padding: 16px 3px 3px; }
.sidebar h2 { margin: 0 0 4px; padding-inline: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
#workspace-scope { display: grid; gap: 2px; margin: 0 0 16px; }
#workspace-scope strong { font-size: 13px; font-weight: 600; }
#workspace-scope code { overflow-wrap: anywhere; font: 11px/1.5 var(--mono); color: var(--muted); }
.sidebar nav + h2 { margin-top: 18px; }

.icon-control { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 0 5px; font-size: 17px; }
.avatar {
  display: grid;
  flex: none;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--speaker) 12%, white);
  color: var(--speaker);
  font-size: 10px;
  font-weight: 750;
}
.participant {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.participant:hover .avatar { background: #d9dad5; }
.participants { gap: 4px; margin-right: 4px; }
.participant-count { font-size: 11px; color: var(--muted); }
.workspace {
  grid-area: workspace;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--conversation);
}
.task-header {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  min-height: var(--header-height);
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
}
.task-heading { min-width: 0; }
.task-actions {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
}
.task-actions .control { justify-content: center; width: 32px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.task-actions .control:hover { color: var(--ink); background: var(--tint); }

#show-details[aria-expanded="true"] {
  background: var(--tint);
  border-color: transparent;
  color: var(--accent);
}
.recording {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}
h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.verification {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--tint);
  color: var(--accent);
  font-size: 11px;
}
.verification.failed { background: #faeee3; color: #80491b; }

.chat {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.session-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
#sessions {
  display: flex;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}
#sessions .session, #back { flex: none; white-space: nowrap; }
#back { margin-left: auto; font-size: 12px; }
.session {
  min-height: 32px;
  padding: 3px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  overflow-wrap: anywhere;
}
.session[aria-current="true"] {
  background: var(--tint);
  color: var(--accent);
  font-weight: 700;
}
#change-model { margin-left: auto; }
.speaker-name, .session::before { color: var(--speaker); }
.session::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: currentColor; }

.thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px max(20px, calc((100% - var(--width)) / 2)) 20px;
  scrollbar-width: thin;
}
.hide-timestamps .thread time { display: none; }
.thread:focus-visible, pre:focus-visible { outline-offset: -3px; }
.turn { scroll-margin-top: 12px; }
.turn-label, .finish {
  margin: 10px 0;
  color: var(--muted);
  font-size: 11px;
}
.turn-label { display: flex; align-items: center; gap: 10px; }
.turn-label::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.message {
  max-width: 100%;
  margin: 20px 0 28px;
}
.message.user {
  width: fit-content;
  max-width: min(84%, 58ch);
}
.user .bubble {
  padding: 10px 15px;
  border-radius: 17px;
  background: color-mix(in srgb, var(--speaker) 8%, var(--paper));
}
.initiating-speaker { margin-left: auto; }
.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}
.initiating-speaker .message-meta { justify-content: end; }
.message-meta strong, .review-link { color: var(--speaker, var(--ink)); font-weight: 700; }
.message-body, .long-text {
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-body code, .long-text code {
  padding: 1px 3px;
  border-radius: 3px;
  background: #2929270c;
  font-family: var(--mono);
  font-size: .88em;
}
.message.review {
  padding: 4px 0 3px 12px;
  border-left: 2px solid color-mix(in srgb, var(--speaker) 60%, white);
}
.review-link {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.review .evidence { margin-top: 2px; }
.text-limit { margin-top: 3px; }
.text-limit summary { color: var(--accent); font-size: 11px; padding: 3px 0; }
.text-limit .long-text { max-height: 310px; overflow: auto; margin-top: 4px; }

.notice, .child-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
}
.notice time, .child-link time { margin-left: auto; white-space: nowrap; }
.child-link .jump, .notice button, .evidence {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.child-link .jump { font-weight: 670; }
.activity { margin: 10px 0; }
.activity summary, .tool summary {
  padding: 7px 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.activity > summary { color: var(--muted); }
.activity > summary::marker { color: var(--accent); }
.activity > summary time { margin-left: 8px; font-size: 10px; white-space: nowrap; }
.activity > summary:hover { color: var(--accent); }
.activity-body { padding: 0 5px 4px 12px; }
.tool + .tool { border-top: 1px solid var(--line); }
.tool-content { padding: 2px 8px 9px; }
.tool-state { margin-left: 8px; color: var(--muted); font-size: 10px; font-weight: 450; }
.tool-state.error { color: var(--danger); }
.tool pre {
  max-height: 190px;
  overflow: auto;
  margin: 3px 0 8px;
  padding: 7px 8px;
  background: var(--canvas);
}
pre {
  font: 12px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.part-label, .evidence { font-size: 11px; }
.part-label { font-weight: 650; color: var(--muted); }
.evidence { margin-right: 9px; }
mark { background: #fce6a6; color: #382d11; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 5px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.search > span:first-child { font-size: 20px; line-height: 1; }
.search input {
  flex: 1;
  min-width: 0;
  min-height: 29px;
  padding: 4px;
  border: 0;
  background: transparent;
  font-size: 12px;
  outline-offset: 0;
}
#matches { font-size: 11px; white-space: nowrap; }
.empty { color: var(--muted); font-size: 13px; }
.composer {
  flex: none;
  padding: 10px max(20px, calc((100% - var(--width)) / 2)) max(14px, env(safe-area-inset-bottom));
  background: var(--conversation);
}
.live-actions {
  flex: none;
  max-height: 24dvh;
  overflow: auto;
  padding: 0 max(14px, calc((100% - var(--width)) / 2));
  font-size: 12px;
}
.live-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
}
.action-buttons { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.live-action + .live-action { margin-top: 4px; }
.compose-box {
  border: 1px solid #deded9;
  border-radius: 20px;
  box-shadow: 0 3px 18px #2424200b;
  background: var(--paper);
}
.composer.read-only .compose-box { border: 0; box-shadow: none; background: transparent; }
.composer.read-only .compose-actions { padding: 0 4px; }
.compose-box:focus-within { border-color: #a3a39b; }
.compose-box textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  field-sizing: content;
  max-height: min(30vh, 180px);
  padding: 13px 15px 0;
  resize: none;
  border: 0;
  border-radius: 12px;
  outline: none;
  background: transparent;
}
.compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 8px;
  color: var(--muted);
  font-size: 11px;
}
.compose-control {
  min-height: 30px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  border-radius: 7px;
  padding: 3px 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.compose-control:hover { background: var(--canvas); color: var(--ink); }
#mention-agent { font-size: 17px; }
.agent-activity {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 max(18px, calc((100% - var(--width)) / 2));
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
}
.agent-activity::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .agent-activity::before { animation: activity-pulse 1.5s ease-in-out infinite alternate; }
  @keyframes activity-pulse { to { opacity: .35; } }
}
#compose-status { flex: 1; }
#send-message {
  flex: none;
  width: 33px;
  height: 33px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 21px;
}
#send-message:disabled { background: var(--tint); color: var(--muted); cursor: default; }
.profile-card, .preferences { padding: 12px 16px; }
.profile-role { color: var(--muted); font-size: 12px; }
.preferences { display: grid; justify-items: start; gap: 8px; }
.preferences label { display: flex; align-items: center; gap: 6px; }
.preferences :is(input:not([type="checkbox"]), select, textarea) {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.preferences p[role="alert"] { margin: 0; color: var(--danger); }
.preferences p[role="alert"]:empty { display: none; }
#add-agent { margin-top: 7px; }

dialog {
  width: min(570px, calc(100% - 24px));
  max-height: 85dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
}
dialog::backdrop { background: #29292760; }
.dialog-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.dialog-header h2 { margin: 0; font-size: 16px; }
.dialog-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.dialog-header p:empty { display: none; }
dialog pre {
  max-height: 65dvh;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  background: var(--canvas);
}
.details {
  grid-area: files;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--conversation);
}
.details-header {
  display: flex;
  flex: none;
  align-items: center;
  min-height: var(--header-height);
  padding: 0 10px 0 15px;
  border-bottom: 1px solid var(--line);
}
.details-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 15px 15px;
}
.details-body section {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.details-body h3 { margin: 0 0 6px; font-size: 12px; }
.details-body .message-body, .details-body .long-text { font-size: 13px; }
.details-body #archive { margin-top: 13px; }
.results-heading { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.check-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.check-tabs button {
  min-height: 32px;
  padding: 3px 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 11px;
}
.check-tabs button[aria-pressed="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.metric-table { width: 100%; border-collapse: collapse; font-size: 11px; line-height: 1.35; }
.metric-table th, .metric-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.metric-table th:first-child { text-align: left; }
.metric-table thead th { color: var(--muted); font-weight: 620; }
.metric-table tbody th { font-weight: 530; }
.metric-table td.different { color: var(--danger); font-weight: 700; }
#files { display: flex; flex-wrap: wrap; gap: 6px; }
.file {
  min-height: 30px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  font: 11px var(--mono);
  overflow-wrap: anywhere;
}

.tray-scrim {
  position: absolute;
  z-index: 1;
  inset: 0 0 0 var(--rail-width);
  background: #1e2b2540;
}

@media (max-width: 960px) {
  .app.sidebar-open, .app.details-open { --left-tray: 0px; --right-tray: 0px; }
  .details, .sidebar { position: absolute; grid-area: auto; z-index: 2; }
  .details { inset: 0 0 0 auto; width: var(--detail-width); }
  .sidebar { inset: 0 auto 0 var(--rail-width); width: var(--chat-width); }
}

@media (max-width: 680px) {
  .task-header { display: grid; gap: 0; padding: 5px 10px; }
  .task-heading > div { min-width: 0; }
  .task-heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .task-actions { justify-content: end; }
  #task-people { margin-right: auto; }
  .task-actions .control { min-height: 30px; }

  .message.user { max-width: 94%; }
}

@media (max-height: 440px) {
  .compose-box textarea { min-height: 32px; }
  .composer { padding-block: 4px; }
}

.title-row > .glyph { color: var(--muted); margin-right: 4px; }
.title-row h1 { min-width: 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.title-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
#rename-chat { min-width: 28px; min-height: 28px; color: var(--muted); font-size: 15px; }
#rename-form { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
#chat-name { width: min(220px, 42vw); min-width: 0; padding: 4px 8px; }
#workspace-scope h2 { margin: 0; padding: 0; }
#workspace-scope code { color: var(--ink); }
#project-files { list-style: none; margin: 4px 0 0; padding: 0; max-height: 45vh; overflow: auto; }
#project-files li { font: 13px/1.7 system-ui,sans-serif; white-space: nowrap; }
#file-status { color: var(--muted); font-size: 11px; }
.activity > .tool { padding-block: 5px; }
.tool-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; font: 12px/1.5 var(--mono); overflow-wrap: anywhere; }
.activity time { margin-inline-start: 6px; color: var(--muted); font: 10px/1.5 system-ui,sans-serif; }
.tool-content pre { max-height: none; overflow: visible; }
.reply-model { font-family: var(--mono); overflow-wrap: anywhere; }

#mobile-files { display: none; }
@media (max-width: 680px) {
  #mobile-files { display: block; max-width: 74vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 0; padding: 1px 0 3px; color: var(--muted); background: transparent; text-align: left; font-size: 12px; }
}

#model-dialog { width: min(740px, calc(100% - 24px)); }
#model-form { grid-template-columns: minmax(0, 1fr); }
#model-choice { border: 0; margin: 0; padding: 0; width: 100%; min-width: 0; }
#model-label { font-size: 12px; color: var(--muted); padding: 0 0 5px; }
#model-list { max-height: min(48dvh, 420px); overflow: auto; }
#model-list .model-row, .model-columns {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: center;
  gap: 8px; padding: 8px; border-bottom: 1px solid var(--line);
}
#model-list.with-prices :is(.model-row, .model-columns) { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(5ch, 0.18fr)); }
.model-columns { position: sticky; top: 0; background: var(--paper); color: var(--muted); font-size: 12px; text-align: right; }
.model-columns > :first-child { text-align: left; }
.model-row, .route-name, .route-default { width: 100%; appearance: none; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.model-row:hover, .model-row[aria-current], .route-default:hover, .endpoint-table tr:has(button:enabled):hover, .endpoint-table tr:has([aria-current=true]) { background: var(--tint); }
.route-default, .route-name { padding: 5px 7px; border-radius: 5px; }
.route-default { padding: 9px; border: 1px solid var(--line); }
.route-default small { margin-left: 5px; color: var(--muted); }
.route-name { padding: 0; font-weight: 600; }
.route-name:disabled { cursor: default; }
.endpoint-table tr:has(button:enabled) { cursor: pointer; }
.model-row[aria-current=true] .model-name::before, :is(.route-name,.route-default)[aria-current=true]::before { content: '✓ '; color: var(--muted); }
#model-search { margin-bottom: 8px; }
#model-list button:focus-visible, #model-endpoints button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#model-dialog .dialog-header { justify-content: flex-start; }
#close-model { margin-inline-start: auto; }
#back-models { flex-shrink: 0; }
.model-name { overflow-wrap: anywhere; }
.model-name small { display: block; margin-top: 2px; color: var(--muted); }
.model-price { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; overflow-wrap: anywhere; }
#model-title { min-width: 0; overflow-wrap: anywhere; }
#model-search { width: 100%; }
#model-error:empty, #endpoint-status:empty { display: none; }
#model-endpoints { width: 100%; min-width: 0; }
#endpoint-heading { margin: 12px 0 5px; font-size: 14px; }
#endpoint-status { margin: 6px 0; color: var(--muted); font-size: 13px; }
#endpoint-table { max-height: min(54dvh, 480px); overflow: auto; }
.endpoint-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.endpoint-table :is(th, td) { padding: 6px 7px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.endpoint-table thead th { position: sticky; top: 0; background: var(--paper); color: var(--muted); font-weight: normal; }
.endpoint-table small { display: block; color: var(--muted); font-weight: normal; overflow-wrap: anywhere; }
.endpoint-table :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(4)) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .endpoint-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .endpoint-table tbody tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px 8px; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .endpoint-table tbody :is(th, td) { padding: 0; border: 0; text-align: left; }
  .endpoint-table tbody th { grid-column: 1 / -1; }
  .endpoint-table small { display: inline; margin-inline-start: 6px; }
  .endpoint-table td:nth-child(5) { grid-column: span 2; }
  .endpoint-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; }
}
#export-status {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 3;
  max-width: min(28rem, 100%, calc(100vw - 24px));
  width: max-content;
  overflow-wrap: anywhere;
  pointer-events: none;
}
#export-status:not(:empty) {
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  box-shadow: 0 2px 8px #0002;
}
#export-status code { display: block; margin-top: 2px; font: 11px/1.5 var(--mono); }
.files-heading { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.file-link { display:flex; align-items:center; gap:8px; width:100%; padding:5px 6px; overflow:hidden; text-overflow:ellipsis; text-align:left; white-space:nowrap; border:0; background:transparent; color:var(--ink); font:inherit; cursor:pointer; }
.file-link:hover, .file-link:focus-visible { background:var(--tint); border-radius:6px; }
.file-link span { overflow:hidden; text-overflow:ellipsis; }
#inspector .dialog-header > div { flex:1; min-width:0; overflow-wrap:anywhere; }
#inspector-body { overflow:auto; max-height:68dvh; }
#file-body table { border-collapse:separate; border-spacing:0; min-width:100%; font:12px/1.5 var(--mono); }
#file-body td, #file-body th { padding:6px 12px; border-bottom:1px solid var(--line); text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; }
#file-body th { position:sticky; top:0; background:var(--canvas); }
#file-body img, #file-body video { display:block; max-width:calc(100% - 24px); max-height:65dvh; margin:clamp(16px, 4vh, 40px) auto; }
#file-body iframe { display:block; border:0; width:100%; height:62dvh; }
#file-body > p, #file-body audio { margin:14px; }

.thread-navigation { position: relative; flex: none; align-self: center; }
#jump-latest {
  position: absolute;
  bottom: 10px;
  left: 0;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 2px 6px #2929271a;
  font-size: 18px;
}
@media (min-width: 961px) {
  .task-header .task-heading > div { min-width: 0; }
}
#file-preview { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--paper); }
#file-meta { color: var(--muted); font-size: 11px; }
#file-body { overflow: auto; flex: 1; min-height: 0; }
#file-body pre { margin: 0; padding: 12px; }

#task-people { position: relative; min-width: 0; }
#participants {
  display: flex; align-items: center; gap: 4px; max-width: clamp(90px, 17vw, 200px);
  white-space: nowrap; padding: 5px 8px; border-radius: 7px; font-size: 12px;
  color: var(--muted); cursor: pointer; list-style: none;
}
#participants::-webkit-details-marker { display: none; }
.participant-names { overflow: hidden; text-overflow: ellipsis; }
.participant-count { flex: none; padding: 1px 5px; border-radius: 8px; background: var(--tint); font-variant-numeric: tabular-nums; }
#participants:hover, #task-people[open] summary { background: var(--tint); }
.roster {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 3;
  width: 202px; max-height: 65dvh; overflow: auto; padding: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  box-shadow: 0 6px 24px #0002;
}
.roster h2 { font-size: 12px; padding: 0 8px; margin: 4px 0 6px; }
.brand-mark::before { content: ""; position: absolute; inset: -6px; }
.brand-mark:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.details-header { padding: 0 5px; gap: 4px; background: var(--canvas); }
#file-tabs { display: flex; flex: 1; min-width: 0; gap: 3px; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
#file-tabs button {
  border: 0; background: transparent; color: var(--muted); font: inherit;
  font-size: 12px; padding: 5px 7px; cursor: pointer; white-space: nowrap;
}
#browse-files, .file-tab { display: inline-flex; flex: none; align-items: center; gap: 4px; border-radius: 7px; }
#browse-files[aria-current="true"], .file-tab:has([aria-current="true"]) { background: var(--paper); box-shadow: 0 1px 3px #0002; }
.file-tab button:first-child { max-width: 14ch; text-overflow: ellipsis; overflow: hidden; }
#file-tabs button:hover { background: var(--tint); border-radius: 6px; }
#file-location { display: flex; align-items: center; gap: 2px; padding: 4px 7px; border-bottom: 1px solid var(--line); }
#file-location .icon-control { min-width: 28px; min-height: 28px; }
#file-location button:disabled { opacity: .3; cursor: default; }
#file-address { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 18px; padding: 6px 10px; background: var(--tint); font: 12px var(--mono); }
#file-meta { padding: 3px 12px; }
#file-meta:empty { display: none; }
#files { display: grid; gap: 2px; }
#files .file { width: 100%; border: 0; text-align: left; font: inherit; }

.tray-divider {
  position: absolute; z-index: 1; inset-block: 0; width: 10px;
  cursor: col-resize; touch-action: none; outline: none;
}
#file-divider { left: -5px; }
#chat-divider { right: -5px; }
.tray-divider::before {
  content: ""; position: absolute; top: calc(50% - 13px); left: 3px;
  width: 3px; height: 26px; border-radius: 2px; background: #b9b9b4;
}
.tray-divider:is(:hover, :focus-visible, .dragging)::before { background: #666660; }
.app.resizing { cursor: col-resize; user-select: none; }
.app.resizing iframe { pointer-events: none; }

.child-link .jump, .notice .evidence { color: var(--speaker, var(--accent)); }

.workspace-picker, .scope-chip { border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.workspace-picker { font: inherit; padding: 5px 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-picker::after, .scope-chip::after { content: "⌄"; margin-left: 5px; color: var(--muted); }
.scope-chip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 4px; border-radius: 5px; color: var(--muted); font-size: 12px; }
.scope-chip:hover, .workspace-picker:hover { background: var(--tint); }
.scope-dialog { width: min(350px, calc(100% - 24px)); }
.scope-options { display: grid; gap: 3px; padding: 10px; }
.scope-options > label, #audience-people label { display: flex; gap: 9px; align-items: center; padding: 7px; cursor: pointer; }
#audience-dialog input { accent-color: var(--brand); }
.scope-options p, #space-form small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.scope-options p { padding-inline: 7px; margin: 6px 0 9px; }
.scope-options > .control { justify-self: end; }
#space-list .sidebar-item[aria-current]::after { content: "✓"; margin-left: auto; }
#audience-people { margin-left: 24px; max-height: 150px; overflow: auto; }

#audience-line { display: flex; align-items: center; min-width: 0; }
#compact-space { max-width: 45%; }
.app.sidebar-open #compact-space { display: none; }
#compact-space::after { content: " /"; }

.hosting-entry { max-width: 28rem; margin: 18vh auto; padding: 1.5rem; }
.hosting-entry h1 { margin: 1.5rem 0; font-size: 1.6rem; }
.hosting-entry a.control { display: inline-block; text-decoration: none; }

.compose-box { position: relative; }
#mention-options { position: absolute; z-index: 4; bottom: calc(100% + 4px); left: 0; max-width: 100%; min-width: min(15rem, 100%); max-height: 12rem; overflow: auto; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 3px 14px #0001; }
#mention-options button { display: block; width: 100%; padding: 6px 10px; border: 0; border-radius: 6px; text-align: left; background: transparent; color: inherit; cursor: pointer; }
#mention-options button:is(:hover, [aria-selected=true]) { background: var(--tint); }
.person-mention { font-weight: 600; }
.mentioned-you .person-mention { text-decoration: underline; text-underline-offset: 2px; }

.code-block { margin: .65em 0; border: 1px solid #dddcd8; border-radius: 8px; background: #f7f7f5; color: #242422; overflow: hidden; }
.code-block small { display: block; padding: 5px 12px; border-bottom: 1px solid #e3e2df; font: 12px system-ui; }
.code-block pre { margin: 0; max-height: 24rem; padding: 10px 12px; overflow: auto; white-space: pre; overflow-wrap: normal; }
.code-block pre code { padding: 0; background: transparent; font: inherit; }
.message-body, .long-text { white-space: normal; min-width: 0; }
.message-body p, .long-text p { margin: .55em 0; }
.message-body > :first-child, .long-text > :first-child { margin-top: 0; }
.message-body > :last-child, .long-text > :last-child { margin-bottom: 0; }

#project-files ul { padding-inline-start: 14px; margin: 0 0 0 9px; list-style: none; border-inline-start: 1px solid var(--line); }
.tree-row { display: flex; align-items: center; }
.tree-row .file-link { min-width: 0; }
.file-save { margin-inline-start: auto; padding: 4px 7px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.file-save:hover, .file-save:focus-visible { color: var(--ink); background: var(--tint); }
