:root {
  color-scheme: dark;
  --bg: #000;
  --bg-raised: #0a0a0a;
  --surface: rgba(22, 22, 22, .82);
  --surface-solid: #111;
  --surface-hover: #171717;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .16);
  --control: rgba(255, 255, 255, .08);
  --control-hover: rgba(255, 255, 255, .14);
  --inverted: #fff;
  --inverted-text: #000;
  --accent: #d9ff5b;
  --accent-soft: rgba(217, 255, 91, .12);
  --warning: #ff9f0a;
  --danger: #ff453a;
  --success: #32d74b;
  --shadow: 0 24px 80px rgba(0, 0, 0, .5);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f2;
  --bg-raised: #fbfbf9;
  --surface: rgba(255, 255, 255, .8);
  --surface-solid: #fff;
  --surface-hover: #f0f0ed;
  --text: #161616;
  --text-secondary: #676765;
  --text-tertiary: #989894;
  --line: rgba(20, 20, 20, .1);
  --line-strong: rgba(20, 20, 20, .16);
  --control: rgba(20, 20, 20, .055);
  --control-hover: rgba(20, 20, 20, .1);
  --inverted: #151515;
  --inverted-text: #fff;
  --accent: #476b00;
  --accent-soft: rgba(84, 118, 0, .1);
  --warning: #b45f00;
  --danger: #d70015;
  --success: #138a28;
  --shadow: 0 24px 70px rgba(30, 30, 20, .14);
}

* { box-sizing: border-box; }
html { background: var(--bg); min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { color: inherit; font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.app-bar, .workspace-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  padding: max(18px, env(safe-area-inset-top)) clamp(22px, 4vw, 52px) 12px;
}
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-weight: 650; letter-spacing: -.02em; }
.mark { position: relative; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; }
.mark i {
  position: absolute; width: 8px; height: 19px; border-radius: 5px 5px 2px 2px;
  background: var(--text); transform: rotate(32deg) translateX(-3px);
}
.mark i + i { height: 14px; opacity: .38; transform: rotate(32deg) translate(5px, -2px); }
.large-mark { width: 42px; height: 42px; margin-bottom: 18px; }
.large-mark i { width: 13px; height: 34px; }
.large-mark i + i { height: 25px; }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.circle-button {
  display: inline-flex; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--control); color: var(--text);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.circle-button:hover { background: var(--control-hover); border-color: var(--line-strong); }
.circle-button:active { transform: scale(.94); }
.circle-button svg { width: 21px; height: 21px; }
.circle-button.compact { width: 38px; height: 38px; }
.primary-circle { background: var(--inverted); color: var(--inverted-text); border-color: transparent; }
.primary-circle:hover { background: var(--inverted); opacity: .86; }
.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }
:root[data-theme="light"] .theme-toggle .sun-icon { display: none; }
:root[data-theme="light"] .theme-toggle .moon-icon { display: block; }

.home-shell { width: min(1040px, calc(100% - 44px)); margin: 54px auto 160px; }
.home-intro { max-width: 650px; }
.eyebrow {
  margin: 0 0 8px; color: var(--text-tertiary); font-size: 11px; font-weight: 700;
  letter-spacing: .11em; line-height: 1; text-transform: uppercase;
}
.home-intro h1 {
  margin: 0; font-size: clamp(54px, 8vw, 92px); font-weight: 610; letter-spacing: -.065em; line-height: .94;
}
.intro-copy { max-width: 520px; margin: 24px 0 0; color: var(--text-secondary); font-size: clamp(17px, 2vw, 21px); letter-spacing: -.025em; }
.overview { display: flex; gap: clamp(38px, 8vw, 92px); margin: 62px 0 78px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.metric { display: flex; flex-direction: column; gap: 3px; }
.metric strong { font-size: 28px; font-weight: 560; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric span { color: var(--text-tertiary); font-size: 12px; }
.attention-metric strong { color: var(--warning); }
.agent-section + .agent-section { margin-top: 72px; }
.section-heading { display: flex; align-items: baseline; gap: 10px; padding: 0 4px 14px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 15px; font-weight: 630; letter-spacing: -.01em; }
.section-count { color: var(--text-tertiary); font-size: 12px; }
.agent-list { min-height: 70px; }
.agent-row {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 20px;
  gap: 15px; align-items: center; min-height: 88px; padding: 15px 6px;
  border-bottom: 1px solid var(--line); transition: opacity .18s, background .18s;
}
.agent-row:hover { background: linear-gradient(90deg, transparent, var(--control), transparent); }
.agent-avatar {
  position: relative; display: flex; width: 42px; height: 42px; align-items: center; justify-content: center;
  border-radius: 13px; background: var(--control); color: var(--text-secondary); font-size: 13px; font-weight: 720; letter-spacing: -.03em;
}
.agent-avatar::after {
  position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; content: "";
  border: 3px solid var(--bg); border-radius: 50%; background: var(--text-tertiary);
}
.agent-row.working .agent-avatar::after { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.agent-row.needs-input .agent-avatar::after { background: var(--warning); }
.agent-main { min-width: 0; }
.agent-title-line { display: flex; min-width: 0; align-items: center; gap: 9px; }
.agent-title { overflow: hidden; font-size: 16px; font-weight: 560; letter-spacing: -.018em; text-overflow: ellipsis; white-space: nowrap; }
.agent-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 99px; background: var(--control); color: var(--text-tertiary); font-size: 10px; font-weight: 650; text-transform: capitalize; }
.agent-row.needs-input .agent-badge { background: rgba(255, 159, 10, .12); color: var(--warning); }
.agent-detail { display: block; overflow: hidden; margin-top: 4px; color: var(--text-secondary); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.agent-detail .project { color: var(--text-tertiary); }
.agent-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--text-tertiary); font-size: 11px; }
.agent-meta strong { color: var(--text-secondary); font-weight: 520; }
.row-chevron { color: var(--text-tertiary); }
.row-chevron svg { width: 18px; height: 18px; stroke-width: 1.5; }
.empty-list { padding: 28px 6px; color: var(--text-tertiary); }
.list-loading { display: flex; gap: 6px; padding: 34px 6px; }
.list-loading span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-tertiary); animation: dot-pulse 1.2s infinite ease-in-out; }
.list-loading span:nth-child(2) { animation-delay: .15s; }
.list-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes dot-pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
.new-agent-fab {
  position: fixed; z-index: 30; right: max(22px, env(safe-area-inset-right)); bottom: max(24px, calc(var(--safe-bottom) + 18px));
  display: flex; height: 52px; padding: 0 19px 0 14px; align-items: center; gap: 9px;
  border: 0; border-radius: 28px; background: var(--inverted); color: var(--inverted-text);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 650; letter-spacing: -.01em;
  transition: transform .2s ease, opacity .2s;
}
.new-agent-fab:hover { transform: translateY(-2px); }
.new-agent-fab:active { transform: scale(.96); }
.new-agent-fab svg { width: 21px; height: 21px; }

.sheet {
  width: 100%; height: 100%; max-width: none; max-height: none; padding: 0; border: 0;
  background: transparent; color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, .48); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet-panel {
  position: fixed; left: 50%; bottom: max(16px, var(--safe-bottom)); width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 42px); margin: 0; padding: 28px;
  overflow: auto; transform: translateX(-50%); border: 1px solid var(--line-strong); border-radius: 28px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent); box-shadow: var(--shadow);
  backdrop-filter: blur(32px) saturate(150%); -webkit-backdrop-filter: blur(32px) saturate(150%);
}
.sheet[open] .sheet-panel { animation: sheet-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 18px) scale(.985); } }
.sheet-handle { display: none; width: 36px; height: 5px; margin: -12px auto 20px; border-radius: 4px; background: var(--line-strong); }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sheet-heading h2 { margin: 0; font-size: 28px; font-weight: 590; letter-spacing: -.04em; }
.prompt-field { display: block; padding: 17px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--control); }
.prompt-field textarea { width: 100%; min-height: 112px; padding: 0; resize: none; border: 0; outline: 0; background: transparent; font-size: 18px; letter-spacing: -.02em; line-height: 1.45; }
.prompt-field textarea::placeholder, .composer textarea::placeholder { color: var(--text-tertiary); }
.agent-options { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 10px; margin-top: 12px; }
.agent-options label { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--control); }
.agent-options label > span { display: block; margin-bottom: 4px; color: var(--text-tertiary); font-size: 10px; font-weight: 650; text-transform: uppercase; }
.agent-options input, .agent-options select { width: 100%; padding: 0; overflow: hidden; border: 0; outline: 0; background: transparent; font-size: 13px; text-overflow: ellipsis; }
.launch-button, .sign-in-button {
  display: flex; width: 100%; min-height: 50px; margin-top: 16px; padding: 0 17px; align-items: center; justify-content: space-between;
  border: 0; border-radius: 15px; background: var(--inverted); color: var(--inverted-text); font-weight: 650;
}
.launch-button svg { width: 20px; }
.launch-button:disabled { cursor: wait; opacity: .5; }
.form-error { min-height: 18px; margin: 10px 4px 0; color: var(--danger); font-size: 12px; }
.search-panel { top: 16px; bottom: auto; max-height: calc(100vh - 32px); }
.search-field { display: flex; align-items: center; gap: 12px; }
.search-field > svg { flex: 0 0 auto; width: 21px; color: var(--text-tertiary); }
.search-field input { min-width: 0; flex: 1; padding: 6px 0; border: 0; outline: 0; background: transparent; font-size: 19px; }
.text-button { padding: 8px; border: 0; background: transparent; color: var(--text-secondary); }
.search-results { margin-top: 18px; border-top: 1px solid var(--line); }
.signed-out-panel { max-width: 440px; margin: 90px auto; text-align: center; }
.signed-out-panel h2 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.signed-out-panel p { color: var(--text-secondary); }
.sign-in-button { justify-content: center; }

/* Workspace */
.workspace-page { padding-bottom: 160px; }
.workspace-bar {
  position: sticky; top: 0; height: 78px; padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
}
.workspace-identity { position: absolute; left: 50%; top: 50%; max-width: 52%; text-align: center; transform: translate(-50%, -50%); }
.workspace-identity h1 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.presence { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--text-tertiary); font-size: 10px; }
.presence i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-tertiary); }
.presence.live i { background: var(--success); }
.presence.working i { background: var(--accent); }
.presence.attention i { background: var(--warning); }
.workspace-shell { width: min(820px, calc(100% - 40px)); margin: 30px auto 0; }
.session-context { display: flex; gap: 8px; margin-bottom: 34px; overflow-x: auto; scrollbar-width: none; }
.session-context::-webkit-scrollbar { display: none; }
.context-chip {
  display: inline-flex; min-width: max-content; padding: 7px 11px; align-items: baseline; gap: 7px;
  border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text);
}
.context-chip span { color: var(--text-tertiary); font-size: 10px; }
.context-chip strong { max-width: 210px; overflow: hidden; font-size: 11px; font-weight: 540; text-overflow: ellipsis; white-space: nowrap; }
.task-card {
  margin: 0 0 42px; padding: 20px 22px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
}
.task-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.task-card h2 { margin: 0; font-size: 15px; font-weight: 630; }
.task-card header > span { color: var(--text-tertiary); font-size: 11px; }
.task-card ol { margin: 0; padding: 0; list-style: none; }
.task-card li { position: relative; min-height: 34px; padding: 7px 0 7px 27px; border-top: 1px solid var(--line); color: var(--text-secondary); font-size: 12px; }
.task-card li::before { position: absolute; left: 2px; top: 12px; width: 9px; height: 9px; content: ""; border: 1px solid var(--text-tertiary); border-radius: 50%; }
.task-card li.completed { color: var(--text-tertiary); text-decoration: line-through; }
.task-card li.completed::before { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 2px var(--surface-solid); }
.task-card li.in_progress { color: var(--text); }
.task-card li.in_progress::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.conversation { min-height: 34vh; }
.conversation-empty { padding: 90px 10px; text-align: center; color: var(--text-secondary); }
.conversation-empty h2 { margin: 0; color: var(--text); font-size: 19px; font-weight: 590; letter-spacing: -.025em; }
.conversation-empty p { margin: 6px 0; font-size: 13px; }
.turn { margin-bottom: 46px; }
.user-message { display: flex; justify-content: flex-end; margin: 0 0 27px; }
.user-bubble {
  max-width: min(82%, 620px); padding: 11px 15px; border-radius: 18px 18px 5px 18px;
  background: var(--surface-solid); border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap;
}
.agent-stream { color: var(--text); font-size: 14px; line-height: 1.67; }
.agent-prose { overflow-wrap: anywhere; }
.agent-prose p { margin: 0 0 15px; }
.agent-prose h3 { margin: 26px 0 9px; font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.agent-prose ul, .agent-prose ol { margin: 0 0 16px; padding-left: 22px; }
.agent-prose li { margin: 5px 0; padding-left: 3px; }
.agent-prose code { padding: 2px 5px; border-radius: 5px; background: var(--control); font-family: var(--mono); font-size: .88em; }
.code-block { margin: 16px 0; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-raised); font: 12px/1.6 var(--mono); }
.thinking-block { margin: 10px 0; color: var(--text-tertiary); font-size: 12px; font-style: italic; }
.tool-group { margin: 14px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.tool-summary {
  display: grid; width: 100%; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  padding: 11px 13px; border: 0; background: transparent; text-align: left;
}
.tool-summary svg { width: 15px; height: 15px; color: var(--text-tertiary); transition: transform .18s; }
.tool-group.open .tool-summary svg { transform: rotate(90deg); }
.tool-summary strong { overflow: hidden; font-size: 12px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.tool-summary span { color: var(--text-tertiary); font-size: 10px; }
.tool-detail { display: none; max-height: 260px; margin: 0; padding: 12px 13px; overflow: auto; border-top: 1px solid var(--line); color: var(--text-secondary); font: 11px/1.55 var(--mono); white-space: pre-wrap; }
.tool-group.open .tool-detail { display: block; }
.mode-banner { margin: 14px 0; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--accent-soft); color: var(--text-secondary); font-size: 12px; }
.change-card { margin: 15px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.change-heading {
  display: grid; width: 100%; grid-template-columns: 32px minmax(0, 1fr) auto 18px; gap: 10px; align-items: center;
  padding: 12px 13px; border: 0; background: transparent; text-align: left;
}
.change-icon { display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 9px; background: var(--control); color: var(--text-secondary); }
.change-icon svg { width: 17px; height: 17px; }
.change-copy { display: flex; min-width: 0; flex-direction: column; }
.change-copy strong { font-size: 12px; font-weight: 620; }
.change-copy > span { overflow: hidden; color: var(--text-tertiary); font: 10px/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.change-delta { display: flex; gap: 5px; font: 11px var(--mono); }
.change-delta b { color: var(--success); font-weight: 500; }
.change-delta i { color: var(--danger); font-style: normal; }
.change-chevron { color: var(--text-tertiary); transition: transform .18s; }
.change-chevron svg { width: 16px; height: 16px; }
.change-card.open .change-chevron { transform: rotate(90deg); }
.change-raw { display: none; max-height: 360px; margin: 0; padding: 14px; overflow: auto; border-top: 1px solid var(--line); color: var(--text-secondary); background: var(--bg-raised); font: 10px/1.55 var(--mono); white-space: pre-wrap; }
.change-card.open .change-raw { display: block; }
.activity {
  display: flex; min-height: 36px; margin: -22px 0 40px; align-items: center; gap: 12px;
  color: var(--text-secondary); font-size: 13px;
}
.classic-spinner { --duration: 1.2s; position: relative; display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-secondary); }
.classic-spinner-track { position: absolute; inset: 50%; width: 100%; height: 100%; }
.classic-spoke {
  position: absolute; top: -3.5%; left: -9%; display: block; width: 22%; height: 7%;
  border-radius: 99px; background: currentColor; animation: loading-ui-classic-fade var(--duration) linear infinite;
}
.classic-spoke:nth-child(1) { transform: rotate(0deg) translate(150%); animation-delay: -1.2s; }
.classic-spoke:nth-child(2) { transform: rotate(30deg) translate(150%); animation-delay: -1.1s; }
.classic-spoke:nth-child(3) { transform: rotate(60deg) translate(150%); animation-delay: -1s; }
.classic-spoke:nth-child(4) { transform: rotate(90deg) translate(150%); animation-delay: -.9s; }
.classic-spoke:nth-child(5) { transform: rotate(120deg) translate(150%); animation-delay: -.8s; }
.classic-spoke:nth-child(6) { transform: rotate(150deg) translate(150%); animation-delay: -.7s; }
.classic-spoke:nth-child(7) { transform: rotate(180deg) translate(150%); animation-delay: -.6s; }
.classic-spoke:nth-child(8) { transform: rotate(210deg) translate(150%); animation-delay: -.5s; }
.classic-spoke:nth-child(9) { transform: rotate(240deg) translate(150%); animation-delay: -.4s; }
.classic-spoke:nth-child(10) { transform: rotate(270deg) translate(150%); animation-delay: -.3s; }
.classic-spoke:nth-child(11) { transform: rotate(300deg) translate(150%); animation-delay: -.2s; }
.classic-spoke:nth-child(12) { transform: rotate(330deg) translate(150%); animation-delay: -.1s; }
@keyframes loading-ui-classic-fade { 0% { opacity: 1; } 100% { opacity: .14; } }
.shimmer-text {
  display: inline-block; color: transparent;
  background: linear-gradient(90deg, var(--text-tertiary) 0%, var(--text-tertiary) 32%, var(--text) 48%, var(--text-tertiary) 64%, var(--text-tertiary) 100%);
  background-size: 240% 100%; background-clip: text; -webkit-background-clip: text;
  animation: text-shimmer-wave 2.6s linear infinite;
}
@keyframes text-shimmer-wave { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.queued-messages { margin-bottom: 16px; }
.queued-item { max-width: 70%; margin: 8px 0 8px auto; padding: 9px 13px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--text-secondary); font-size: 12px; }
.attention-banner {
  position: sticky; z-index: 15; top: 78px; display: flex; min-height: 58px; padding: 11px max(24px, calc((100vw - 820px) / 2));
  align-items: center; gap: 11px; border-bottom: 1px solid rgba(255, 159, 10, .2); background: color-mix(in srgb, var(--bg) 82%, var(--warning) 18%);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.attention-icon { display: flex; width: 25px; height: 25px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 50%; background: var(--warning); color: #000; font-size: 12px; font-weight: 800; }
.attention-banner strong { font-size: 12px; }
.attention-banner p { margin: 1px 0 0; color: var(--text-secondary); font-size: 11px; }
.composer-dock {
  position: fixed; z-index: 25; right: 0; bottom: 0; left: 0; padding: 12px 18px max(18px, calc(var(--safe-bottom) + 10px));
  pointer-events: none; background: linear-gradient(transparent, var(--bg) 32%);
}
.composer {
  width: min(820px, 100%); margin: 0 auto; padding: 12px 12px 10px;
  border: 1px solid var(--line-strong); border-radius: 24px; background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  box-shadow: 0 12px 54px rgba(0, 0, 0, .22); pointer-events: auto;
  backdrop-filter: blur(32px) saturate(150%); -webkit-backdrop-filter: blur(32px) saturate(150%);
}
.composer textarea { display: block; width: 100%; max-height: 160px; padding: 3px 7px 10px; resize: none; border: 0; outline: 0; background: transparent; font-size: 15px; line-height: 1.45; }
.composer-actions { display: flex; align-items: center; gap: 9px; }
.attach-button, .send-button {
  display: inline-flex; width: 36px; height: 36px; flex: 0 0 auto; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--control); color: var(--text-secondary);
}
.attach-button input { display: none; }
.attach-button svg, .send-button svg { width: 20px; height: 20px; }
.composer-meta { min-width: 0; display: flex; flex: 1; align-items: center; gap: 6px; overflow: hidden; color: var(--text-tertiary); font-size: 11px; white-space: nowrap; }
.composer-meta span { overflow: hidden; text-overflow: ellipsis; }
.meta-separator { opacity: .55; }
.send-button { background: var(--inverted); color: var(--inverted-text); transition: opacity .18s, transform .18s; }
.send-button:disabled { cursor: default; opacity: .18; }
.send-button:not(:disabled):active { transform: scale(.9); }
.attachments { display: flex; gap: 8px; padding: 0 5px; overflow-x: auto; }
.attachment { position: relative; flex: 0 0 auto; width: 48px; height: 48px; margin-bottom: 8px; overflow: hidden; border-radius: 10px; }
.attachment img { width: 100%; height: 100%; object-fit: cover; }
.attachment button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .72); color: white; line-height: 1; }
.controls-panel { width: min(520px, calc(100% - 28px)); }
.control-group { padding: 16px 0; border-top: 1px solid var(--line); }
.control-group > span { display: block; margin-bottom: 10px; color: var(--text-tertiary); font-size: 11px; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 12px; background: var(--control); }
.segmented-control button { padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text-secondary); font-size: 12px; }
.segmented-control button.selected { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 5px rgba(0, 0, 0, .14); }
.key-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.key-grid button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--control); color: var(--text-secondary); font-size: 11px; }
.danger-button { width: 100%; padding: 12px; border: 0; border-radius: 12px; background: rgba(255, 69, 58, .1); color: var(--danger); font-weight: 600; }
.setting-row {
  display: flex; width: 100%; padding: 16px 0; align-items: center; justify-content: space-between;
  border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); font-size: 12px;
}
.setting-value { display: flex; align-items: center; gap: 7px; color: var(--text-tertiary); }
.setting-value svg { width: 16px; height: 16px; }
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: max(30px, calc(var(--safe-bottom) + 20px)); max-width: calc(100% - 40px);
  padding: 10px 14px; opacity: 0; transform: translate(-50%, 8px); border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface-solid); box-shadow: var(--shadow); color: var(--text); font-size: 12px; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 680px) {
  .app-bar { height: 76px; padding-right: 18px; padding-left: 18px; }
  .wordmark > span:last-child { display: none; }
  .home-shell { width: calc(100% - 34px); margin-top: 46px; }
  .home-intro h1 { font-size: 58px; }
  .intro-copy { max-width: 330px; font-size: 17px; }
  .overview { margin: 48px 0 60px; gap: 44px; }
  .metric strong { font-size: 23px; }
  .agent-row { grid-template-columns: 40px minmax(0, 1fr) 15px; min-height: 80px; gap: 12px; padding-right: 3px; padding-left: 3px; }
  .agent-avatar { width: 39px; height: 39px; border-radius: 12px; }
  .agent-meta { display: none; }
  .agent-title { font-size: 15px; }
  .agent-detail { font-size: 12px; }
  .new-agent-fab span { display: none; }
  .new-agent-fab { width: 52px; padding: 0; justify-content: center; }
  .sheet-panel { right: 0; bottom: 0; left: 0; width: 100%; max-height: calc(100vh - 24px); padding: 25px 18px max(22px, calc(var(--safe-bottom) + 16px)); transform: none; border-width: 1px 0 0; border-radius: 28px 28px 0 0; }
  .sheet[open] .sheet-panel { animation-name: mobile-sheet-in; }
  @keyframes mobile-sheet-in { from { opacity: 0; transform: translateY(24px); } }
  .sheet-handle { display: block; }
  .agent-options { grid-template-columns: 1fr 1fr; }
  .agent-options label:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .search-panel { top: max(10px, env(safe-area-inset-top)); bottom: auto; left: 10px; width: calc(100% - 20px); border: 1px solid var(--line-strong); border-radius: 22px; }
  .workspace-bar { height: 70px; padding-right: 14px; padding-left: 14px; }
  .workspace-bar .theme-toggle { display: none; }
  .workspace-identity { max-width: 55%; }
  .workspace-shell { width: calc(100% - 30px); margin-top: 20px; }
  .session-context { margin-bottom: 28px; }
  .directory-chip { display: none; }
  .conversation { min-height: 46vh; }
  .turn { margin-bottom: 36px; }
  .user-bubble { max-width: 90%; }
  .agent-stream { font-size: 14px; line-height: 1.62; }
  .composer-dock { padding-right: 10px; padding-bottom: max(10px, calc(var(--safe-bottom) + 6px)); padding-left: 10px; }
  .composer { border-radius: 22px; }
  .attention-banner { top: 70px; padding-right: 18px; padding-left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .classic-spoke { opacity: .5; }
  .shimmer-text { color: var(--text-secondary); background: none; }
}
