:root {
  color-scheme: light dark;
  --canvas: #eeebf6;
  --background: #faf9fd;
  --surface: #fff;
  --quiet: #f4f1f8;
  --ink: #201a2d;
  --muted: #655e73;
  --line: #e7e1ef;
  --field-line: #c9bfd8;
  --accent: #5a39b3;
  --on-accent: #fff;
  --tint: #eee8ff;
  --amber: #80500e;
  --amber-bg: #fff5e3;
  --amber-mark: #f6e7ce;
  --amber-line: #ebd5aa;
  --green: #21634c;
  --green-bg: #e7f4ec;
  --red: #922f42;
  --red-bg: #fcebef;
  --shadow: 0 14px 52px #34265b18;
  --composer-shadow: 0 3px 16px #34265b0d;
  --overlay-shadow: 0 8px 30px #34265b26;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #100e16;
    --background: #17141e;
    --surface: #211c2a;
    --quiet: #292334;
    --ink: #f3edf9;
    --muted: #b6a9c3;
    --line: #3a3146;
    --field-line: #64566f;
    --accent: #c8b5ff;
    --on-accent: #231538;
    --tint: #37294f;
    --amber: #f5cb8b;
    --amber-bg: #32261f;
    --amber-mark: #4d3726;
    --amber-line: #65492f;
    --green: #a0dfbc;
    --green-bg: #20372d;
    --red: #ffb9c6;
    --red-bg: #412831;
    --shadow: 0 14px 52px #06040985;
    --composer-shadow: 0 3px 16px #0604094d;
    --overlay-shadow: 0 8px 30px #06040985;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p, pre { margin: 0; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled, button[aria-disabled="true"] { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
code, pre { font-family: var(--mono); }

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--background);
}
.app-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 19px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #8468da, #532eac);
  color: #fff;
  font: 700 19px/1 var(--mono);
  letter-spacing: -.17em;
  padding-right: 3px;
  padding-bottom: 2px;
  box-shadow: inset 0 1px 0 #ffffff52;
}
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.online { color: var(--green); }
.offline { color: var(--muted); }
.chevron { font-size: 17px; line-height: 1; color: var(--muted); }

.screen { flex: 1; min-width: 0; padding: 23px 19px 28px; }
.screen-head, .split, .actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.screen-head { margin-bottom: 17px; }
.screen-title { min-width: 0; font-size: 29px; line-height: 1.2; font-weight: 750; letter-spacing: -.045em; overflow-wrap: anywhere; }
.screen-title:focus { outline: none; }
.section-title { margin: 21px 0 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.subtext { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.section-title:first-child { margin-top: 0; }

.button {
  display: inline-flex;
  min-height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 660;
  white-space: nowrap;
}
a.button { text-decoration: none; }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.button.quiet { background: transparent; border-color: transparent; color: var(--accent); }
.button.back { margin: -10px 0 6px -8px; padding-inline: 8px; color: var(--muted); }
.button.danger { color: var(--red); }
.button.wide { width: 100%; }

.connection-message, .error-note, .info-note {
  padding: 10px 12px;
  border-radius: 11px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.connection-message {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 19px 0;
  padding-block: 4px;
  background: var(--amber-bg);
  color: var(--amber);
}
.connection-message > [role="status"] { display: flex; flex: 1 1 150px; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.connection-actions { display: flex; gap: 4px; margin-inline-start: auto; }
.connection-message .button { padding-inline: 8px; color: inherit; }
.connection-message [data-action="return-home"] { font-weight: 700; }
.error-note { margin: 0 0 14px; background: var(--red-bg); color: var(--red); }
.info-note { margin-bottom: 14px; background: var(--quiet); color: var(--muted); }
.empty-state { padding: 23px 14px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 23px 14px;
  color: var(--muted);
  text-align: center;
}
.loading-state::before, .loading-spinner {
  content: '';
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .loading-state::before, .loading-spinner { animation: loading-spin 850ms linear infinite; }
  @keyframes loading-spin { to { transform: rotate(360deg); } }
}
.empty-state strong { display: block; margin: 0 0 4px; color: var(--ink); }
.empty-state .button { margin-top: 12px; }

.item-list, .approval-list, .file-list, .messages { margin: 0; padding: 0; list-style: none; }
.item-list { border: 1px solid var(--line); overflow: hidden; border-radius: 15px; background: var(--surface); }
.item-list > li + li { border-top: 1px solid var(--line); }
.item-row {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.item-row:focus-visible { outline-offset: -3px; }
.item-content { flex: 1; min-width: 0; }
.item-label { display: block; font-weight: 680; overflow-wrap: anywhere; }
.item-detail { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.item-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 11px;
  background: var(--tint);
  color: var(--accent);
  font: 650 15px/1 var(--mono);
}
.status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--quiet);
  color: var(--muted);
  font-size: 12px;
  font-weight: 670;
  white-space: nowrap;
}
.status .dot { width: 6px; height: 6px; }
.status.running { background: var(--tint); color: var(--accent); }
.status.approval { background: var(--amber-bg); color: var(--amber); }
.status.completed { background: var(--green-bg); color: var(--green); }
.status.failed { background: var(--red-bg); color: var(--red); }

/* The same three destinations stay in the desktop sidebar and the mobile tab bar. */
.section-nav {
  display: grid;
  flex: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}
.section-nav .section-link {
  gap: 5px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.section-nav .section-link:hover { background: var(--workspace-hover); }
.section-nav .section-link[aria-current="page"] { border-color: var(--line); background: var(--tint); color: var(--accent); }
.section-person { position: relative; display: block; width: 16px; height: 16px; flex: none; }
.section-person::before, .section-person::after { content: ''; position: absolute; inset-inline: 0; margin-inline: auto; border: 1.5px solid currentColor; }
.section-person::before { top: 1px; width: 6px; height: 6px; border-radius: 50%; }
.section-person::after { bottom: 1px; width: 12px; height: 5px; border-radius: 5px 5px 0 0; }
.workspace-sections { margin: 0 12px 12px; padding: 3px; border-radius: 10px; background: var(--workspace-hover); }
.workspace-sections .section-link { min-height: 37px; }
.app-nav {
  position: sticky;
  z-index: 2;
  bottom: 0;
  padding: 3px max(10px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.app-nav .section-link { flex-direction: column; gap: 2px; min-height: 44px; font-size: 12px; line-height: 1.15; }
.app-navigation:has(.app-nav:not([hidden])) .conversation-screen { padding-bottom: 6px; }

.form { display: grid; gap: 13px; }
.form label { display: grid; min-width: 0; gap: 6px; font-size: 13px; font-weight: 660; }
.field {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 11px;
  border: 1px solid var(--field-line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 420;
}
textarea.field { min-height: 107px; resize: vertical; }
.field::placeholder { color: var(--muted); }
.form .info-note { margin: 0; }
.form-context { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.form-context code { color: var(--ink); }
.pair-screen { max-width: 405px; margin: 6vh auto 0; }
.pair-mark { width: 45px; height: 45px; margin-bottom: 13px; font-size: 20px; }
.pair-screen .screen-title { margin-bottom: 7px; }
.pair-screen > .subtext { margin: 0 0 22px; }
.pair-confirmation {
  margin: 16px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--amber-line);
  border-radius: 11px;
  background: var(--amber-bg);
  color: var(--amber);
  line-height: 1.65;
}
.pair-confirmation p + p { margin-top: 6px; font-size: 13px; }
.pair-screen .field { font-family: var(--mono); letter-spacing: .12em; }
.pair-hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.pair-local-link { display: inline-block; margin-top: 18px; color: var(--accent); text-underline-offset: 3px; }
.manual-pair { margin-top: 25px; border-top: 1px solid var(--line); }
.manual-pair summary { padding-block: 15px; color: var(--muted); cursor: pointer; }
.manual-pair .form { margin-top: 0; }
.scan-dialog { width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 17px; overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); }
.scan-dialog::backdrop { background: #070510b8; }
.scan-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 13px; }
.scan-heading h2 { margin: 0; font-size: 17px; }
.scan-preview { overflow: hidden; aspect-ratio: 1; border-radius: 13px; background: #111; }
.scan-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-dialog > .subtext { margin-top: 13px; min-height: 3em; }
.pairing-screen { padding-top: 28px; padding-bottom: 30px; }
.pairing-screen > .subtext { margin-top: 8px; }
.pairing-screen > .form-context { margin-top: 9px; }
.pairing-screen > .info-note, .pairing-screen > .error-note { margin-top: 18px; }
.pairing-qr { display: grid; place-items: center; width: min(100%, 312px); margin: 24px auto 0; overflow: hidden; border: 1px solid #e7e1ef; border-radius: 14px; padding: 12px; background: #fff; color: #000; }
.pairing-qr svg { display: block; width: 100%; height: auto; }
#pairing-expiry { text-align: center; }
#pairing-origin-note { margin-top: 20px; }
.pairing-code { display: grid; gap: 3px; margin-top: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.pairing-code strong { color: var(--ink); font: 600 29px/1.5 var(--mono); letter-spacing: .18em; padding-left: .18em; }
.pairing-actions { display: grid; gap: 10px; margin-top: 22px; }

.history-filter { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.history-meta { margin: -6px 0 13px; }
.history-note { margin: 12px 0 0; }
.history-lock {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
  width: calc(100% - var(--chat-gutter) * 2);
  max-width: calc(var(--chat-column) - var(--chat-gutter) * 2);
  margin: 0 auto max(12px, env(safe-area-inset-bottom));
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--composer-shadow);
}
.history-lock > .ui-icon { flex: none; width: 22px; height: 22px; }
.history-lock-copy { flex: 1; min-width: 0; }
.history-lock-copy h2 { font-size: 15px; font-weight: 650; }
.history-lock-copy p { margin-top: 3px; color: var(--muted); font-size: 14px; }
.history-lock-actions { display: flex; flex: none; gap: 6px; padding-inline-start: 16px; border-inline-start: 1px solid var(--line); }
.history-lock-actions .button { min-height: 44px; padding-inline: 10px; color: var(--ink); white-space: nowrap; }
.history-more { margin-top: 12px; }
.history-earlier { margin-bottom: 12px; }
.history-icon::before {
  content: "";
  width: 13px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 4px 4px 4px 0;
}
.app-chat {
  --chat-height: var(--visible-height, 100dvh);
  height: var(--chat-height);
  min-height: 0;
}
.app-chat > .app-header { display: none; }
.ui-icon { display: block; width: 16px; height: 16px; flex: none; stroke-width: 1.7; }
.conversation-screen {
  --chat-gutter: 28px;
  --chat-column: 790px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 0 max(8px, env(safe-area-inset-bottom));
  background: var(--surface);
  container: chat / inline-size;
}
.conversation-screen > .error-note { flex: none; margin-inline: var(--chat-gutter); }
.conversation-header { position: relative; z-index: 1; flex: none; }
.chat-concurrency-row {
  display: flex;
  justify-content: flex-end;
  padding: 6px max(var(--chat-gutter), env(safe-area-inset-right)) 0 max(var(--chat-gutter), env(safe-area-inset-left));
}
.chat-concurrency {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--quiet);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chat-concurrency strong { color: var(--ink); }
.chat-concurrency.is-full strong { color: var(--red); }
.chat-thread-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 57px;
  padding: env(safe-area-inset-top) max(var(--chat-gutter), env(safe-area-inset-right)) 0 max(var(--chat-gutter), env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
.chat-thread-heading { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.chat-thread-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; letter-spacing: 0; }
.chat-project-crumb { position: relative; flex: 0 2 auto; min-width: 0; max-width: 56%; }
.chat-project-crumb select {
  display: block;
  max-width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  padding: 0 24px 0 25px;
  appearance: none;
  field-sizing: content;
  text-overflow: ellipsis;
  background: var(--workspace-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.chat-project-crumb .ui-icon { position: absolute; inset: 50% auto auto 6px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.chat-project-crumb .ui-icon:last-child { inset-inline: auto 5px; width: 13px; }
.chat-path-separator { color: var(--muted); }
.chat-path-separator .ui-icon { width: 13px; }
.chat-thread-heading .status { padding: 1px 6px; font-size: 11px; }
.chat-branch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 22%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--workspace-bg);
  color: var(--muted);
  font-size: 11px;
}
.chat-branch code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-branch .ui-icon { width: 13px; height: 13px; }
.button.chat-thread-action { flex: none; min-height: 34px; gap: 5px; padding-inline: 7px; border-color: var(--line); border-radius: 7px; color: var(--ink); font-size: 12px; white-space: nowrap; }
.changed-count { min-width: 16px; padding-inline: 4px; border-radius: 5px; background: var(--tint); color: var(--accent); text-align: center; font: 650 11px/16px var(--mono); }
.conversation-log { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; overflow-anchor: none; }
.conversation-log:focus-visible { outline-offset: -2px; }
.conversation-feed {
  display: flex;
  flex-direction: column;
  justify-content: safe flex-end;
  min-height: 100%;
  max-width: var(--chat-column);
  margin-inline: auto;
  padding: 13px max(var(--chat-gutter), env(safe-area-inset-right)) 8px max(var(--chat-gutter), env(safe-area-inset-left));
}
.conversation-feed:has(.conversation-empty, .conversation-intro .loading-state) { justify-content: safe center; }
.conversation-date { display: flex; align-items: center; gap: 11px; margin: 7px 0 17px; color: var(--muted); font-size: 11px; }
.conversation-date::before, .conversation-date::after { flex: 1; height: 1px; background: var(--line); content: ''; }
.conversation-history-tools { display: flex; justify-content: center; margin-bottom: 8px; }
.conversation-history-tools .history-earlier { min-height: 31px; margin: 0; gap: 5px; font-size: 12px; }
.conversation-approval { flex: none; width: calc(100% - var(--chat-gutter) * 2); max-width: calc(var(--chat-column) - var(--chat-gutter) * 2); max-height: 35%; margin-inline: auto; overflow: auto; }
.conversation-approval .approval-card { gap: 6px; margin: 0 0 8px; padding: 9px 10px; border-radius: 9px; }
.conversation-approval .approval-card > pre { max-height: min(25dvh, 170px); overflow: auto; }
.conversation-approval .approval-card h2 { font-size: 13px; }
.conversation-jump { position: relative; z-index: 1; flex: none; align-self: center; }
.button.chat-latest {
  position: absolute;
  bottom: 10px;
  left: 50%;
  min-height: 44px;
  padding-inline: 14px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--composer-shadow);
  white-space: nowrap;
}
.conversation-intro:empty, .conversation-date:empty, .conversation-question:empty, .conversation-progress:empty, .conversation-approval:empty { display: none; }
.conversation-empty { padding: 20px 0; text-align: center; }
.conversation-empty .brand-mark { width: 33px; height: 33px; margin: 0 auto 10px; border-radius: 8px; background: var(--tint); color: var(--accent); font-size: 17px; box-shadow: none; }
.conversation-empty h2 { font-size: 15px; font-weight: 650; }
.conversation-empty p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.messages { display: grid; gap: 10px; }
.message { min-width: 0; max-width: 100%; border-radius: 17px; }
.message.user { display: grid; gap: 8px; justify-items: end; justify-self: end; max-width: min(86%, 520px); }
.user-bubble { min-width: 0; max-width: 100%; padding: 10px 14px; border-radius: 20px; background: light-dark(#f3f3f3, #303030); }
.message.user > .attachment-list { justify-content: flex-end; gap: 8px; margin: 0; }
.message.user .chat-image-preview { max-width: min(128px, 100%); max-height: 128px; border: 1px solid var(--line); border-radius: 12px; }
.message.assistant { padding: 3px 0; }
.message.assistant.commentary .message-body { color: var(--muted); }
.message-role .brand-mark { width: 20px; height: 20px; border-radius: 5px; padding: 0 2px 1px 0; font-size: 12px; }
.message.activity { padding: 0; border-radius: 0; }
.message.activity + .message.activity { margin-top: -6px; }
.message.plan { padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); }
.message-role { display: flex; align-items: center; gap: 6px; margin: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.message-body { overflow-wrap: anywhere; }
.chat-image-attachment { min-width: 0; max-width: 100%; }
.chat-image-attachment a { display: block; }
.chat-image-preview { display: block; max-width: 100%; max-height: 65vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.plain-message { white-space: pre-wrap; }
.message-delivery { margin-top: 4px; color: var(--muted); font-size: 12px; }
.message-delivery.failed { display: flex; align-items: center; gap: 6px; color: var(--red); overflow-wrap: anywhere; }
.message-delivery .button { flex: none; min-height: 44px; padding-inline: 8px; font-size: inherit; }
.activity-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}
.activity-summary::-webkit-details-marker { display: none; }
.activity-summary::marker { content: ''; }
.activity-icon { flex: none; width: 16px; height: 16px; }
.activity-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subagent-activity .activity-label { white-space: normal; overflow-wrap: anywhere; }
.activity-chevron { flex: none; width: 6px; height: 6px; margin-left: 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.activity-disclosure[open] .activity-chevron { transform: translateY(-2px) rotate(45deg); }
.activity-warning { color: var(--amber); }
.activity-detail { margin: 2px 0 8px 24px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--quiet); }
.activity-output { max-height: min(320px, 50dvh); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 var(--mono); }

.approval-card {
  display: grid;
  gap: 9px;
  margin-top: 13px;
  padding: 13px;
  border: 1px solid var(--amber-line);
  border-radius: 15px;
  background: var(--amber-bg);
}
.approval-card > h2 { font-size: 16px; color: var(--amber); }
.approval-card > pre { padding: 10px; border-radius: 9px; background: var(--surface); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.approval-card .actions { flex-wrap: wrap; justify-content: flex-end; }
.approval-card .subtext { color: var(--amber); }
.approval-card .approval-scope { color: var(--muted); font-size: 12px; line-height: 1.5; }
.chat-composer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: none;
  gap: 4px;
  min-width: 0;
  width: calc(100% - var(--chat-gutter) * 2);
  max-width: calc(var(--chat-column) - var(--chat-gutter) * 2);
  margin-inline: auto;
  padding: 7px 8px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--composer-shadow);
}
.chat-composer:focus-within { border-color: var(--accent); }
.composer-context { display: grid; gap: 4px; max-height: clamp(0px, calc(var(--chat-height) - 270px), 105px); overflow: auto; padding: 0 5px; }
.composer-context:not(:has(> *)) { display: none; }
.composer-editing { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 3px; padding-inline-start: 6px; border-radius: 6px; background: var(--quiet); color: var(--muted); font-size: 12px; }
.composer-editing .button { min-height: 30px; padding-inline: 8px; font-size: inherit; }
.composer-note { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.composer-error { color: var(--red); }
.composer-option-error { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: var(--muted); font-size: 12px; }
.composer-option-error .button { min-height: 32px; padding-inline: 6px; font-size: 12px; }
.composer-input-row { display: flex; min-width: 0; align-items: flex-end; }
.chat-input {
  display: block;
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  max-height: min(104px, max(42px, calc(var(--chat-height) * .25)));
  padding: 5px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  field-sizing: content;
  resize: none;
}
.chat-input:focus { outline: none; }
.chat-input::placeholder { color: var(--muted); }
.composer-voice-control { flex: none; }
.composer-voice {
  display: grid;
  width: 36px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.composer-voice[data-voice-phase="idle"]:not(:disabled):hover,
.composer-voice[data-voice-phase="transcribing"] { background: var(--quiet); }
.composer-voice:is([data-voice-phase="starting"], [data-voice-phase="recording"]) { background: var(--red-bg); color: var(--red); }
.voice-mark { position: relative; width: 16px; height: 18px; }
.voice-mark::before, .voice-mark::after {
  position: absolute;
  border: 1.5px solid currentColor;
  content: "";
}
.voice-mark::before { inset: 0 4px auto; height: 12px; border-radius: 6px; }
.voice-mark::after { inset: 6px 1px auto; height: 9px; border-top: 0; border-radius: 0 0 7px 7px; }
.voice-mark i { position: absolute; inset: 14px auto 0 7px; width: 2px; border-radius: 2px; background: currentColor; }
.composer-controls { display: flex; min-width: 0; align-items: center; gap: 4px; }
.composer-tools { display: contents; }
.composer-delivery { max-width: 65px; min-height: 33px; padding: 0 3px; border: 0; border-radius: 7px; color: var(--accent); background: var(--tint); font: inherit; font-size: 12px; }
.composer-queue { max-height: 150px; overflow: auto; margin-bottom: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.composer-queue-heading, .composer-queue li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-queue ol { margin: 3px 0 0; padding: 0; list-style: none; }
.composer-queue li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-queue .button { min-height: 26px; flex: none; padding: 2px 6px; font-size: 12px; }
.chat-fork { display: inline-flex; flex: none; align-items: center; gap: 4px; white-space: nowrap; }
.chat-fork-short { display: none; }
.composer-file, .composer-send, .button.composer-stop {
  display: grid;
  width: 33px;
  height: 33px;
  min-height: 0;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
}
.composer-file { background: transparent; color: var(--muted); }
.composer-file:hover { background: var(--quiet); }
.composer-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 48%;
  min-height: 33px;
  gap: 6px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.composer-picker[aria-expanded="true"] { background: var(--tint); color: var(--accent); }
.composer-picker:not(:disabled):hover { background: var(--quiet); }
.composer-picker > .ui-icon:last-child { width: 12px; height: 12px; color: var(--muted); }
.composer-model-label, .composer-permission-label { overflow: hidden; text-overflow: ellipsis; }
.composer-effort-label { flex: none; color: var(--muted); font-size: 11px; font-weight: 500; }
.composer-submit { display: flex; align-items: center; flex: none; gap: 4px; margin-inline-start: auto; }
.composer-key-hint { margin-inline-end: 4px; white-space: nowrap; color: var(--muted); font-size: 11px; }
.composer-send, .button.composer-stop { background: var(--accent); color: var(--on-accent); }
.composer-send:disabled { background: var(--tint); color: var(--accent); opacity: 1; }
.stop-icon { width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.composer-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-start: 41px;
  z-index: 3;
  width: min(calc(100% - 41px), 276px);
  max-height: max(44px, min(300px, calc(var(--chat-height) * .46), calc(var(--chat-height) - 190px - env(safe-area-inset-bottom))));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--overlay-shadow);
}
.composer-popover[data-menu="permission"] { inset-inline-start: 121px; width: min(calc(100% - 121px), 250px); }
.composer-settings { display: grid; }
.composer-model-slider { padding: 2px 4px 5px; }
.composer-model-range { display: block; width: 100%; margin: 0; min-height: 28px; accent-color: var(--accent); cursor: pointer; }
.composer-model-steps { display: flex; justify-content: space-between; gap: 5px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.composer-model-steps > span { min-width: 0; overflow-wrap: anywhere; }
.composer-model-steps [data-selected] { color: var(--accent); font-weight: 650; }
.composer-permissions { display: grid; gap: 2px; min-width: 0; margin: 0; padding: 0; border: 0; }
.composer-permissions label { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.composer-permissions input { margin: 0; accent-color: var(--accent); }
.composer-permissions label:has(input:checked) { background: var(--tint); color: var(--accent); }
.composer-permissions:disabled { opacity: .65; }
.settings-title { padding: 0 4px 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.settings-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 130px);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding-inline: 4px;
  font-size: 13px;
  font-weight: 600;
}
.settings-select { position: relative; min-width: 0; }
.settings-select::after {
  position: absolute;
  inset: calc(50% - 5px) 12px auto auto;
  width: 7px;
  height: 7px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
  content: "";
}
.settings-select select {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 0 27px 0 10px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--quiet);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.settings-select select:not(:disabled):hover { border-color: var(--field-line); }
.settings-select select:disabled { background: var(--surface); color: var(--muted); opacity: 1; cursor: default; }
.settings-select:has(select:disabled)::after { display: none; }
.settings-mode { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }
.mode-toggle {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: start;
}
.mode-toggle:not(:disabled):hover { background: var(--quiet); }
.mode-toggle:focus-visible { outline-offset: -2px; }
.settings-switch {
  display: flex;
  flex: none;
  align-items: center;
  width: 34px;
  height: 20px;
  padding: 3px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--muted) 72%, var(--surface));
}
.settings-switch::after { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); content: ""; }
.mode-toggle[aria-checked="true"] .settings-switch { justify-content: flex-end; background: var(--accent); }
.mode-toggle[aria-checked="true"] .settings-switch::after { background: var(--on-accent); }
.settings-note { padding: 0 4px 4px; color: var(--muted); font-size: 12px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 3px 0; padding: 0; list-style: none; }
.composer-context .attachment-list { flex-wrap: nowrap; overflow-x: auto; }
.attachment-chip { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--quiet); }
.composer-context .attachment-chip { flex: 0 0 auto; max-width: 85%; }
.attachment-icon { display: grid; width: 22px; height: 24px; flex: none; place-items: center; border-radius: 5px; background: var(--tint); color: var(--accent); }
.attachment-icon::before { width: 9px; height: 12px; border: 1px solid currentColor; border-radius: 2px; content: ""; }
.attachment-icon.image::before { width: 12px; height: 10px; border-radius: 2px; background: linear-gradient(145deg, transparent 55%, currentColor 57%, currentColor 63%, transparent 65%); }
.attachment-label { min-width: 0; font-size: 12px; }
.attachment-label b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-label small { display: block; color: var(--muted); font-size: 10px; }
.attachment-annotate { flex: none; min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: var(--tint); color: var(--accent); font-size: 12px; font-weight: 650; }
.attachment-remove { width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; }
.image-annotation-dialog {
  inset: 0;
  width: min(780px, calc(100% - 24px));
  height: min(720px, calc(100dvh - 24px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--overlay-shadow);
}
.image-annotation-dialog[open] { display: flex; flex-direction: column; }
.image-annotation-dialog::backdrop { background: light-dark(#1f13366b, #070410b8); }
.image-annotation-header { display: flex; flex: none; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.image-annotation-heading { flex: 1; min-width: 0; }
.image-annotation-heading h2 { font-size: 16px; font-weight: 700; }
.image-annotation-heading p { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.image-annotation-stage {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(var(--line) 1px, transparent 1px) center / 16px 16px var(--background);
}
.image-annotation-stage canvas {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--composer-shadow);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.image-annotation-stage .subtext { padding: 12px; text-align: center; }
.image-annotation-note { margin: 5px 12px; font-size: 12px; }
.image-annotation-toolbar { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.image-annotation-toolbar > div { display: flex; align-items: center; gap: 2px; }
.image-annotation-tools { padding: 2px; border-radius: 11px; background: var(--quiet); }
.image-annotation-actions { margin-inline-start: auto; }
.image-annotation-toolbar button { min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.image-annotation-tools button[aria-pressed="true"] { background: var(--tint); color: var(--accent); }
.image-annotation-actions button:not(:disabled) { color: var(--accent); }
.image-annotation-colors button { display: grid; place-items: center; padding: 0; }
.image-annotation-colors button::before { width: 20px; height: 20px; border-radius: 50%; background: var(--annotation-color); content: ""; }
.image-annotation-colors button[aria-pressed="true"]::before { outline: 2px solid var(--ink); outline-offset: 2px; }
[data-annotation-color="red"] { --annotation-color: #eb2446; }
[data-annotation-color="blue"] { --annotation-color: #2c6df5; }
[data-annotation-color="yellow"] { --annotation-color: #ffca2c; }

@media (max-width: 520px) {
  .image-annotation-dialog {
    width: 100%;
    height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    border: 0;
    border-radius: 0;
  }
  .image-annotation-toolbar { display: grid; grid-template-columns: 1fr auto; }
  .image-annotation-tools { grid-column: 1 / -1; }
  .image-annotation-tools button { flex: 1; }
}

.question-card, .plan-card { display: grid; gap: 8px; margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.question-card h2, .plan-card h2 { font-size: 16px; }
.question-card .button, .plan-card .button { justify-self: start; }
.question-fields { display: grid; gap: 5px; min-width: 0; margin: 0; padding: 6px 0 0; border: 0; }
.question-fields legend { font-weight: 700; }
.question-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.question-choice:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.question-choice input { flex: none; accent-color: var(--accent); }
.question-choice small { display: block; color: var(--muted); font-size: 12px; }
.question-custom { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.plan-head { display: flex; align-items: center; gap: 10px; }
.plan-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.task-error { margin-top: 12px; }

.file-list { display: grid; gap: 8px; margin-top: 9px; }
.file-list > li { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.file-list .item-row { min-height: 49px; gap: 7px; padding: 8px 10px; }
.file-list .item-label { font: 620 13px/1.4 var(--mono); }
.file-counts { display: flex; flex: none; gap: 6px; font: 12px var(--mono); }
.plus { color: var(--green); }
.minus { color: var(--red); }
.diff { padding: 2px 0; border-top: 1px solid var(--line); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff span { display: block; padding: 3px 9px; line-height: 1.35; }
.diff .plus { background: var(--green-bg); }
.diff .minus { background: var(--red-bg); }
.diff .meta { color: var(--muted); background: var(--quiet); }
.device-card { margin-top: 10px; }
.device-card .item-row { min-height: 71px; }
.device-options { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 17px; }
.device-options .pair-local-link { margin: 0; }
.switch-label { color: var(--accent); white-space: nowrap; font-size: 13px; }
.navigation-account { display: grid; justify-items: start; gap: 20px; max-width: 460px; padding: clamp(14px, 3vw, 24px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.navigation-account-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.navigation-account-identity > div { min-width: 0; overflow-wrap: anywhere; }
.navigation-account-balance { display: grid; gap: 4px; }
.navigation-account-balance strong { font-size: 26px; font-variant-numeric: tabular-nums; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(.96); }
  :is(.item-row, .app-nav > button, .button.quiet):not(:disabled):hover { background: var(--quiet); }
}
@media (min-width: 660px) {
  .app { min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px); margin-block: 20px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
  .app-chat { --chat-height: calc(var(--visible-height, 100dvh) - 40px); min-height: 0; }
  .app-header { border-radius: 21px 21px 0 0; }
  .app-nav { border-radius: 0 0 21px 21px; }
  .app-header, .screen { padding-inline: 24px; }
  .connection-message { margin-inline: 24px; }
}
@media (max-width: 360px) {
  .app-header, .screen { padding-inline: 13px; }
  .connection-message { margin-inline: 13px; }
  .brand { gap: 6px; }
  .item-row { gap: 8px; }
}

/* The same sidebar moves into a modal drawer on phones. */
.app-workspace {
  --workspace-bg: light-dark(#f8f7fb, #211d2a);
  --workspace-hover: light-dark(#efedf5, #312a3c);
  max-width: none;
  background: var(--surface);
  font-size: 14px;
}
.workspace-sidebar { display: none; min-width: 0; background: var(--workspace-bg); }
.workspace-toggle, .workspace-icon-button {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.workspace-toggle > span { position: relative; width: 16px; height: 13px; border: 1.5px solid currentColor; border-radius: 3px; }
.workspace-toggle > span::before { position: absolute; inset: 0 auto 0 4px; border-left: 1.5px solid currentColor; content: ''; }
.button.chat-sidebar-toggle { display: grid; width: 34px; min-height: 34px; height: 34px; padding: 0; margin-inline-start: -6px; border-radius: 7px; color: var(--muted); }
.workspace-icon-button:hover, .workspace-toggle:hover { background: var(--workspace-hover); }
.app-workspace .app-header .brand { flex: 1; }
.app-workspace .conversation-screen { padding-inline: 0; }
.workspace-drawer, .files-dialog { padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--overlay-shadow); }
.workspace-drawer::backdrop, .files-dialog::backdrop { background: light-dark(#1f133652, #070410a3); }
.workspace-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, calc(100% - 38px));
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
  border-width: 0 1px 0 0;
  background: var(--workspace-bg);
}
.workspace-drawer[open], .files-dialog[open] { display: flex; flex-direction: column; }
.workspace-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; }
.workspace-brand-row, .files-dialog-head {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 57px;
  padding-inline: 12px;
}
.workspace-brand-row .brand { font-size: 16px; }
.workspace-brand-row .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; }
.workspace-primary { flex: none; padding: 2px 12px 10px; }
.button.workspace-new {
  justify-content: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  text-align: start;
  font-size: 14px;
  line-height: 1.25;
}
.button.workspace-new:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 90%, var(--ink)); }
.workspace-new-label { display: grid; min-width: 0; gap: 3px; }
.workspace-new-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; }
.workspace-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 12px 12px; }
.workspace-section-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; padding-inline-start: 9px; border-top: 1px solid var(--line); }
.workspace-section-head h2 { color: var(--muted); font-size: 12px; font-weight: 650; }
.button.workspace-projects-link { min-height: 32px; color: var(--muted); font-size: 12px; }
.workspace-project-group + .workspace-project-group { margin-top: 4px; }
.workspace-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: start;
}
.workspace-row:focus-visible { outline-offset: -2px; }
.workspace-row:hover { background: var(--workspace-hover); }
.workspace-row[aria-current="page"] { background: var(--tint); color: var(--accent); font-weight: 650; }
.workspace-project { min-height: 36px; border-radius: 9px; font-weight: 650; }
.workspace-project-group[data-selected] .workspace-project { background: var(--workspace-hover); color: var(--ink); }
.workspace-project > .ui-icon:last-child { width: 12px; height: 12px; margin-inline-start: auto; }
.workspace-project[aria-expanded="true"] > .ui-icon:last-child { transform: rotate(90deg); }
.workspace-project .ui-icon, .workspace-chat:not([aria-current]) .ui-icon { color: var(--muted); }
.workspace-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-active-label { flex: none; margin-inline-start: auto; color: var(--amber); font-size: 11px; font-weight: 500; white-space: nowrap; }
.workspace-chat .loading-spinner { width: 13px; height: 13px; margin-inline-start: auto; border-width: 1.5px; }
.workspace-thread-list { margin: 2px 0 9px 10px; padding: 0 0 0 8px; border-inline-start: 1px solid var(--line); list-style: none; }
.workspace-thread-list li + li { margin-top: 2px; }
.workspace-chat { font-size: 12px; }
.workspace-chat .ui-icon { width: 13px; height: 13px; }
.workspace-chat-item { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 7px; }
.workspace-chat-item:hover, .workspace-chat-item:focus-within { background: var(--workspace-hover); }
.workspace-chat-item:has([aria-current="page"]) { background: var(--tint); }
.workspace-chat-item .workspace-chat { flex: 1; min-width: 0; width: auto; padding-inline-end: 3px; }
.workspace-chat-item .workspace-chat:hover { background: transparent; }
.chat-menu-trigger { display: grid; flex: none; place-items: center; width: 28px; height: 30px; margin-inline-end: 3px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); opacity: 0; }
.chat-menu-trigger .ui-icon { width: 17px; height: 17px; }
.workspace-chat-item:hover .chat-menu-trigger, .workspace-chat-item:focus-within .chat-menu-trigger,
.chat-list-row:hover .chat-menu-trigger, .chat-list-row:focus-within .chat-menu-trigger,
.chat-menu-trigger[aria-expanded="true"] { opacity: 1; }
.chat-menu-trigger:hover, .chat-menu-trigger[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.chat-list-row { position: relative; display: flex; align-items: stretch; }
.chat-list-row > .item-row { flex: 1; min-width: 0; width: 100%; padding-inline-end: 42px; }
.chat-list-row > .chat-menu-trigger { position: absolute; inset-inline-end: 8px; top: 50%; width: 32px; height: 34px; margin: 0; transform: translateY(-50%); }
@media (hover: none) { .chat-menu-trigger { opacity: 1; min-width: 34px; min-height: 38px; } }
.workspace-empty { margin: 5px 7px; color: var(--muted); font-size: 12px; }
.button.workspace-more { justify-content: flex-start; gap: 5px; min-height: 32px; padding-inline: 7px; color: var(--muted); font-size: 12px; }
.workspace-more .ui-icon { width: 12px; height: 12px; }
.workspace-device-status { display: flex; flex: none; align-items: center; gap: 7px; margin: 0 12px; padding: 12px 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.workspace-device-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message.assistant .message-body { color: var(--ink); line-height: 1.68; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body :is(p, ul, ol, pre, blockquote, table) { margin: .65em 0; }
.markdown-body :is(h1, h2, h3, h4, h5, h6) { margin: .9em 0 .4em; font-size: 1.04em; }
.markdown-body :is(ul, ol) { padding-inline-start: 1.48em; }
.markdown-body li + li { margin-block-start: .2em; }
.markdown-body a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .15em; }
.message-reference { color: var(--accent); }
.markdown-body code { padding: .12em .32em; border-radius: 5px; background: var(--quiet); font-size: .88em; }
.markdown-body pre { overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--quiet); }
.markdown-body pre code { padding: 0; background: none; }
.markdown-body blockquote { padding-inline-start: 12px; border-inline-start: 2px solid var(--field-line); color: var(--muted); }
.markdown-body table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
.markdown-body :is(th, td) { padding: 4px 8px; border: 1px solid var(--line); }
.markdown-body input[type="checkbox"] { margin-inline: 0 6px; }
.reply-timing { margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.user-bubble .reply-timing { margin-block: 2px 0; }
.reply-timing summary { display: inline-flex; align-items: center; gap: 9px; min-height: 30px; list-style: none; cursor: pointer; }
.reply-timing summary::-webkit-details-marker { display: none; }
.reply-timing[open] .activity-chevron { transform: translateY(-2px) rotate(45deg); }
.reply-timing-detail { display: flex; flex-wrap: wrap; gap: 5px 18px; padding: 3px 0 6px; }
.reply-timing-detail time { font-variant-numeric: tabular-nums; }
.reply-footer { display: flex; align-items: center; gap: 4px; margin: 4px 0 1px -4px; color: var(--muted); }
.reply-footer time { margin-inline-start: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.prompt-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: 2px; }
.conversation-screen:not(:has(.chat-composer)) [data-action="edit-prompt"] { display: none; }
.reply-control {
  display: grid;
  width: 38px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.reply-control:hover, .reply-control[aria-expanded="true"] { border-color: var(--line); background: var(--quiet); color: var(--accent); }
.copy-mark { position: relative; width: 11px; height: 11px; margin: 3px 3px 0 0; border: 1.4px solid currentColor; border-radius: 3px; }
.copy-mark::after { position: absolute; inset: -4px -4px 3px 3px; border: 1.4px solid currentColor; border-bottom: none; border-left: none; border-radius: 0 3px 0 0; content: ''; }
.edit-mark { position: relative; width: 13px; height: 6px; margin-inline-start: 3px; border: 1.4px solid currentColor; border-radius: 0 2px 2px 0; transform: rotate(-45deg); }
.edit-mark::before { position: absolute; top: -1.4px; left: -5px; width: 0; height: 0; border-block: 3px solid transparent; border-right: 4px solid currentColor; content: ''; }
.edit-mark::after { position: absolute; top: 0; right: 2px; height: 100%; border-inline-start: 1px solid currentColor; content: ''; }
.reply-control.copied { color: var(--green); }
.reply-control.copied .copy-mark { width: 7px; height: 13px; margin: -3px 0 0; border: 0; border-right: 2px solid; border-bottom: 2px solid; border-radius: 0; transform: rotate(45deg); }
.reply-control.copied .copy-mark::after { display: none; }
.more-mark { width: 3px; height: 3px; border-radius: 50%; background: currentColor; box-shadow: -5px 0 currentColor, 5px 0 currentColor; }
.reply-menu {
  position: fixed;
  inset: auto;
  z-index: 5;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--overlay-shadow);
}
.reply-menu-action { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding-inline: 10px; border: none; border-radius: 8px; background: var(--quiet); font-size: 13px; font-weight: 650; }
.reply-menu-action > span:first-child { color: var(--accent); }
.reply-menu p { padding: 3px 10px 5px; color: var(--muted); font-size: 11px; }
.chat-menu { position: fixed; inset: auto; z-index: 6; width: 204px; max-width: calc(100vw - 16px); margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); box-shadow: var(--overlay-shadow); }
.chat-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 13px; text-align: start; }
.chat-menu button:hover, .chat-menu button:focus-visible { background: var(--quiet); }
.chat-menu button:disabled { opacity: .45; cursor: default; }
.chat-menu button.danger { color: var(--red); }
.chat-menu .ui-icon { flex: none; width: 16px; height: 16px; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-menu-separator { height: 1px; margin: 4px 5px; background: var(--line); }
.chat-menu-note { padding: 5px 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.chat-action-dialog { width: min(390px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 23px; overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); box-shadow: var(--overlay-shadow); }
.chat-action-dialog::backdrop { background: light-dark(#1f133652, #070410a3); }
.chat-action-dialog h2 { margin: 0 0 14px; font-size: 17px; }
.chat-action-description { overflow-wrap: anywhere; color: var(--muted); font-size: 13px; line-height: 1.6; }
.chat-action-description:empty { display: none; }
.chat-name-field { display: grid; gap: 7px; font-size: 13px; }
.chat-name-field input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.chat-action-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.chat-action-buttons .button { min-width: 72px; }
.chat-action-buttons .button.danger { border-color: var(--red); background: var(--red); color: white; }
.clipboard-field { position: fixed; inset: 0 auto auto 0; width: 1px; height: 1px; opacity: 0; }
.connection-activity, .timeline-status { display: flex; align-items: center; gap: 8px; min-height: 30px; color: var(--muted); font-size: 13px; }
.connection-activity .activity-output { font: inherit; }
.connection-activity-mark { flex: none; width: 12px; height: 12px; margin-inline: 2px; border: 1.4px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.timeline-status { margin-block: 8px 2px; }
.reply-changes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 9px;
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--workspace-bg);
  color: var(--ink);
  font-size: 12px;
  text-align: start;
}
.reply-changes > .ui-icon { color: var(--muted); }
.reply-changes-link { display: flex; align-items: center; gap: 3px; margin-inline-start: auto; color: var(--accent); }
.reply-changes-link .ui-icon { width: 12px; }
.files-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(426px, calc(100% - 18px));
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) 0;
  border-width: 0 0 0 1px;
}
.files-dialog-head { padding-inline: 14px 10px; min-height: 52px; border-bottom: 1px solid var(--line); }
.files-dialog-head h2 { font-size: 15px; font-weight: 650; }
.files-dialog-head .button { min-width: 35px; min-height: 35px; padding: 0; color: var(--muted); font-size: 20px; }
.files-dialog-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 13px; }
.files-dialog-summary { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.file-list > li { border-radius: 8px; }
.file-list .item-row { min-height: 38px; }
.file-list .item-row .ui-icon { width: 14px; color: var(--muted); }
.file-list .item-label { font-size: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .files-dialog[open] { animation: files-drawer-enter 180ms ease-out; }
  @keyframes files-drawer-enter { from { transform: translateX(100%); } }
  .workspace-drawer[open] { animation: workspace-drawer-enter 160ms ease-out; }
  @keyframes workspace-drawer-enter { from { transform: translateX(-100%); } }
}

@media (min-width: 681px) {
  .app-workspace {
    --chat-height: calc(var(--visible-height, 100dvh) - 40px);
    display: grid;
    grid-template-columns: clamp(218px, 23vw, 252px) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    width: calc(100% - 40px);
    max-width: 1440px;
    min-height: 0;
    height: var(--chat-height);
    border-radius: 12px;
  }
  .app-workspace.workspace-collapsed { grid-template-columns: 0 minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .app-workspace:not(.workspace-collapsed) :is(.app-header, .workspace-toggle, .app-nav) { display: none; }
  .app-workspace.workspace-collapsed .app-nav { grid-area: 4 / 2; border-radius: 0 0 11px 11px; }
  .app-workspace.workspace-collapsed .app-nav .section-link { flex-direction: row; gap: 6px; }
  .app-workspace > .app-header { position: static; grid-area: 1 / 2; min-height: 57px; border-radius: 0 11px 0 0; }
  .app-workspace:not(.workspace-collapsed) .workspace-sidebar { display: flex; grid-area: 1 / 1 / 4 / 2; min-height: 0; border-inline-end: 1px solid var(--line); border-radius: 11px 0 0 11px; }
  .app-workspace .connection-message { grid-area: 2 / 2; margin-block: 6px 0; }
  .app-workspace .screen { grid-area: 3 / 2; min-height: 0; }
  .app-workspace .screen:not(.conversation-screen) { justify-self: center; width: 100%; max-width: 790px; overflow: auto; }
  .app-workspace .conversation-screen { border-radius: 0 11px 11px 0; }
}
@container chat (max-width: 520px) {
  .history-lock { flex-wrap: wrap; gap: 10px 12px; padding: 14px; border-radius: 16px; }
  .history-lock-copy { flex-basis: calc(100% - 34px); }
  .history-lock-actions { margin-inline-start: auto; padding: 0; border: 0; }
  .chat-thread-header:has(.chat-fork) .chat-branch { display: none; }
  .button.chat-fork { min-height: 32px; padding: 4px 6px; font-size: 12px; }
  .chat-thread-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 5px; }
  .chat-path-separator { display: none; }
  .chat-thread-title { grid-area: 1 / 1; }
  .chat-project-crumb { grid-area: 2 / 1; justify-self: start; max-width: 100%; }
  .chat-thread-heading .status { grid-area: 1 / 2 / 3; }
}
@container chat (max-width: 380px) {
  .chat-thread-header, .chat-thread-heading { gap: 5px; }
  .chat-project-crumb select { padding-inline: 6px 19px; font-size: 11px; }
  .chat-project-crumb .ui-icon:first-child, .changed-label { display: none; }
  .composer-picker { gap: 4px; padding-inline: 4px; }
  .composer-settings-toggle > .ui-icon:first-child { width: 14px; }
}
@media (pointer: coarse) {
  .chat-input, .settings-select select { font-size: 16px; }
  .composer-key-hint { display: none; }
  .reply-control, .composer-voice, .workspace-icon-button, .workspace-toggle, .button.chat-sidebar-toggle,
  .composer-file, .composer-send, .button.composer-stop { width: 44px; height: 44px; }
  .button.chat-thread-action, .button.workspace-new, .workspace-row,
  .file-list .item-row, .composer-picker, .composer-permissions label, .composer-model-range, .settings-select select,
  .mode-toggle, .reply-changes, .reply-menu-action, .reply-timing summary, .composer-editing .button, .conversation-history-tools .history-earlier,
  .button.workspace-more, .button.workspace-projects-link, .files-dialog-head .button { min-height: 44px; }
}

@media (max-width: 680px) {
  html:has(.app-chat) { overscroll-behavior: none; }
  body:has(.app-chat) { overflow: hidden; }
  .app-workspace { --chat-height: var(--visible-height, 100dvh); margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .app-workspace > .app-header { min-height: 0; padding: max(4px, env(safe-area-inset-top)) 12px 4px; }
  .app-workspace > .screen:not(.conversation-screen) { padding: 12px 14px 20px; }
  .app-workspace .screen-head { margin-bottom: 10px; }
  .app-workspace .screen-head .screen-title { font-size: 24px; }
  .app-workspace .section-title { margin: 14px 0 6px; }
  .app-workspace .history-filter { margin-bottom: 7px; }
  .app-workspace .item-row { min-height: 50px; gap: 8px; padding: 6px 9px; }
  .app-workspace .item-icon { width: 30px; height: 30px; border-radius: 8px; }
  .app-workspace .chat-list-row > .item-row { padding-inline-end: 50px; }
  .chat-list-row > .chat-menu-trigger { inset-inline-end: 4px; min-width: 44px; min-height: 44px; }
  .device-options { margin-top: 10px; }
  .pair-screen { margin-top: 12px; }
  .pair-screen > .subtext { margin-bottom: 14px; }
  .pair-mark { width: 36px; height: 36px; margin-bottom: 8px; border-radius: 10px; }
  .pair-local-link { margin-top: 10px; }
  .manual-pair { margin-top: 13px; }
  .manual-pair summary { min-height: 44px; padding-block: 11px; }
  .pairing-screen { padding: 14px 16px 20px; }

  .app-chat {
    position: fixed;
    inset: var(--viewport-top, 0px) 0 auto;
    overflow: hidden;
  }
  .workspace-brand-row { min-height: 48px; padding-inline: 10px; }
  .workspace-brand-row .brand { gap: 7px; font-size: 15px; user-select: none; }
  .workspace-brand-row .brand-mark { width: 28px; height: 28px; }
  .workspace-primary { padding: 0 10px 5px; }
  .button.workspace-new { gap: 8px; min-height: 44px; padding: 4px 9px; border-radius: 10px; }
  .workspace-new-label { gap: 1px; }
  .workspace-scroll { padding: 0 10px 6px; }
  .workspace-section-head { margin-bottom: 0; padding-inline-start: 7px; }
  .workspace-project-group + .workspace-project-group { margin-top: 2px; }
  .workspace-sections { display: none; }
  .workspace-device-status { padding-block: 8px max(8px, env(safe-area-inset-bottom)); }
  .workspace-drawer .workspace-chat { font-size: 13px; }
  .workspace-drawer .chat-menu-trigger { min-width: 44px; min-height: 44px; margin-inline-end: 0; }
  .workspace-drawer :is(button, summary), .composer-send { touch-action: manipulation; user-select: none; }
  .workspace-toggle { -webkit-tap-highlight-color: transparent; }
  .files-dialog-head { min-height: 47px; }
  .files-dialog-body { padding: 9px 10px 13px; }
  .file-list { gap: 6px; margin-top: 6px; }
  .chat-action-dialog { padding: 16px; }
  .chat-action-dialog h2 { margin-bottom: 8px; }
  .chat-action-buttons { margin-top: 13px; }
  .chat-name-field input { min-height: 44px; font-size: 16px; }
  .conversation-screen {
    --chat-gutter: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
    padding-block-end: max(6px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, light-dark(#f3effb, #231c2e), var(--background) 225px);
  }

  .conversation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(3px + env(safe-area-inset-top)) var(--chat-gutter) 2px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
  }
  .chat-thread-header {
    flex: 1;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
  }
  .chat-concurrency-row {
    flex: none;
    align-items: center;
    padding: 0;
  }
  .button.chat-sidebar-toggle, .button.chat-fork, .button.chat-thread-action {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    padding-inline: 10px;
  }
  .button.chat-sidebar-toggle { margin-inline-start: 0; }
  .button.chat-thread-action { color: var(--muted); }
  .chat-thread-header :is(.button, select):active:not(:disabled) { background: var(--tint); }
  .chat-thread-header :is(.chat-thread-title, .chat-project-crumb, .chat-path-separator, .changed-files) { display: none; }
  .chat-thread-heading { display: flex; justify-content: flex-end; }
  .chat-project-crumb select {
    min-height: 29px;
    padding-inline: 24px 21px;
    border-radius: 12px;
    background: transparent;
    font-size: 16px;
  }
  .chat-thread-title { font-size: 15px; }
  .chat-project-crumb .ui-icon:first-child { display: block; inset-inline-start: 5px; width: 14px; }
  .chat-project-crumb .ui-icon:last-child { inset-inline-end: 5px; }

  .conversation-feed { padding-block: 12px 8px; }
  .conversation-feed:not(:has(.conversation-empty, .conversation-intro .loading-state)) { justify-content: flex-start; }
  .conversation-feed:has(.conversation-empty) { justify-content: safe flex-end; padding-block-end: 2px; }
  .conversation-date {
    width: fit-content;
    margin: 0 auto 9px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--quiet);
    font-weight: 650;
  }
  .conversation-date::before, .conversation-date::after { content: none; }
  .conversation-empty {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1px 8px;
    padding: 6px 7px;
    text-align: start;
  }
  .conversation-empty .brand-mark {
    grid-row: 1 / 3;
    width: 31px;
    height: 31px;
    margin: 0;
    border-radius: 9px;
    font-size: 16px;
  }
  .conversation-empty h2 { font-size: 14px; overflow-wrap: anywhere; }
  .conversation-empty p { margin: 0; font-size: 12px; }

  .messages { gap: 8px; }
  .message.user { max-width: min(90%, 520px); }
  .user-bubble {
    padding: 10px 14px;
  }
  .message-body { font-size: 15px; line-height: 1.55; }
  .prompt-actions { gap: 0; margin: 0; }
  .message.assistant:not(.commentary) { padding: 0 1px 2px; }
  .message.assistant .message-body { line-height: 1.6; }
  .markdown-body :is(p, ul, ol, pre, blockquote, table) { margin-block: .5em; }
  .message.assistant:not(.commentary) .message-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 1px;
  }
  .message.assistant:not(.commentary) .message-role {
    gap: 8px;
    min-height: 44px;
    margin: 0;
    color: var(--ink);
    font-size: 13px;
  }
  .message.assistant:not(.commentary) .brand-mark { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
  .message.assistant:not(.commentary) .reply-timing { max-width: 60%; margin: 0; text-align: end; }
  .message.assistant:not(.commentary) .reply-timing:not(details) { padding-block: 13px; }
  .reply-timing summary { min-height: 44px; gap: 7px; padding-inline: 5px; border-radius: 10px; }
  .reply-timing-detail { justify-content: flex-end; }
  .reply-footer { gap: 0; margin: 0 -6px; }
  .reply-footer time { margin-inline: auto 8px; }
  .reply-control { width: 44px; height: 44px; border-radius: 12px; }

  .chat-composer {
    gap: 1px;
    margin-block-start: 4px;
    padding: 5px;
    border-color: var(--line);
    border-radius: 18px;
    box-shadow: 0 5px 20px light-dark(#33235b12, #08060e55), 0 1px 3px light-dark(#33235b0a, #08060e50);
  }
  .chat-composer:focus-within {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent), var(--composer-shadow);
  }
  .chat-input { min-height: 44px; padding: 9px 8px; font-size: 16px; }
  .composer-controls { gap: 4px; min-width: 0; }
  .composer-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 1 auto;
    min-width: 0;
    border-radius: 15px;
    background: color-mix(in srgb, var(--quiet) 76%, var(--surface));
  }
  .composer-file, .composer-voice, .composer-send, .button.composer-stop {
    width: 44px;
    height: 44px;
    border-radius: 15px;
  }
  .composer-picker {
    min-width: 44px;
    max-width: none;
    min-height: 44px;
    gap: 5px;
    padding-inline: 8px;
    border-radius: 13px;
    background: transparent;
  }
  .composer-settings-toggle { flex: none; color: var(--muted); }
  .composer-picker[aria-expanded="true"], .composer-picker:not(:disabled):active { background: var(--tint); color: var(--accent); }
  .composer-delivery { min-height: 44px; padding-inline: 6px; border-radius: 12px; }
  .composer-send:not(:disabled) { background: linear-gradient(145deg, light-dark(#7354ca, #d7c6ff), var(--accent)); }
  .composer-send .ui-icon { width: 19px; height: 19px; stroke-width: 2; }
  .button.composer-stop { background: var(--red-bg); color: var(--red); }
  .composer-key-hint { display: none; }
  .composer-popover, .composer-popover[data-menu="permission"] {
    inset-inline-start: 0;
    width: min(100%, 276px);
    border-radius: 16px;
  }

  @media (prefers-reduced-motion: no-preference) {
    .chat-composer { transition: border-color .16s ease, box-shadow .16s ease; }
    .composer-send:not(:disabled) { transition: transform .14s ease; }
    .composer-send:not(:disabled):active { transform: scale(.94); }
  }
}

@media (max-width: 480px) {
  .composer-controls:has(.composer-stop) :is(.composer-permission-label, .composer-effort-label, .composer-settings-toggle .ui-icon:last-child) { display: none; }
  .composer-controls:has(.composer-stop) .composer-settings-toggle { padding-inline: 4px; }
  .composer-delivery { max-width: 62px; }
}

@media (max-width: 420px) {
  .chat-thread-header:has(.chat-thread-heading .status) .chat-branch { display: none; }
  .chat-fork-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .chat-fork-short { display: inline; }
}

@media (max-width: 380px) {
  .chat-project-crumb select { padding-inline: 22px 18px; }
  .chat-project-crumb .ui-icon:last-child { inset-inline-end: 3px; width: 12px; }
  .composer-effort-label { display: none; }
  .composer-picker { padding-inline: 6px; }
}
