:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1e3f;
  --bg-deep: #06142b;
  --surface: rgba(10, 30, 63, 0.92);
  --surface-strong: #142c56;
  --surface-subtle: rgba(20, 44, 86, 0.72);
  --line: rgba(147, 175, 214, 0.26);
  --text: #f7f8fa;
  --muted: #bccde6;
  --cyan: #93afd6;
  --cyan-soft: rgba(64, 103, 166, 0.22);
  --input-bg: rgba(3, 9, 20, 0.72);
  --message-bg: rgba(6, 20, 43, 0.8);
  --overlay-bg: rgba(6, 20, 43, 0.98);
  --topbar-bg: rgba(6, 20, 43, 0.9);
  --code-bg: rgba(3, 9, 20, 0.82);
  --primary-bg: #93afd6;
  --primary-text: #06142b;
  --brand-glow: rgba(64, 103, 166, 0.2);
  --gold-soft: rgba(198, 161, 91, 0.11);
  --warning: #ffc76b;
  --danger: #ff7f91;
  --success: #68e0b3;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --bg-deep: #f0f4fa;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #f0f4fa;
  --surface-subtle: #fafafa;
  --line: #dce5f2;
  --text: #18181b;
  --muted: #52525b;
  --cyan: #2c4f8c;
  --cyan-soft: rgba(44, 79, 140, 0.1);
  --input-bg: #ffffff;
  --message-bg: #ffffff;
  --overlay-bg: rgba(255, 255, 255, 0.98);
  --topbar-bg: rgba(247, 248, 250, 0.92);
  --code-bg: #06142b;
  --primary-bg: #2c4f8c;
  --primary-text: #ffffff;
  --brand-glow: rgba(44, 79, 140, 0.12);
  --gold-soft: rgba(198, 161, 91, 0.12);
  --warning: #a15c00;
  --danger: #b42336;
  --success: #057a55;
  --shadow: 0 20px 55px rgba(24, 24, 27, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
#cockpit:not([hidden]) { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
html { min-width: 320px; background: var(--bg-deep); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, var(--brand-glow), transparent 31rem),
    radial-gradient(circle at 86% 16%, var(--gold-soft), transparent 28rem),
    linear-gradient(145deg, var(--bg-deep), var(--bg));
}
body.drawer-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.58; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--primary-text);
  background: var(--cyan);
  border-radius: 10px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.token-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: min(100%, 430px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, var(--surface), var(--surface-strong));
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--cyan);
  background: linear-gradient(145deg, var(--cyan-soft), var(--gold-soft));
  box-shadow: 0 0 34px var(--brand-glow);
  font-size: 26px;
  font-weight: 800;
}
.brand-mark-small { width: 44px; height: 44px; margin: 0; border-radius: 13px; font-size: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: 0.15em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(24px, 4vw, 34px); }
h2 { margin-bottom: 8px; font-size: clamp(21px, 3vw, 28px); }
p { color: var(--muted); line-height: 1.6; }
.gate-copy { margin-bottom: 26px; }
.stack-form { display: grid; gap: 10px; }
label { color: var(--text); font-size: 13px; font-weight: 680; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 160ms ease, background 160ms ease;
}
input, select { padding: 0 13px; }
textarea { min-height: 112px; padding: 13px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: var(--cyan); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.72; }
.primary-button, .secondary-button, .ghost-button, .approval-button { border-radius: 12px; padding: 0 17px; font-weight: 730; }
.primary-button {
  border: 1px solid var(--primary-bg);
  color: var(--primary-text);
  background: var(--primary-bg);
  box-shadow: 0 12px 30px var(--brand-glow);
}
.secondary-button, .approval-button { border: 1px solid var(--line); color: var(--text); background: var(--surface-strong); }
.ghost-button { border: 1px solid transparent; color: var(--muted); background: transparent; }
.form-error { min-height: 24px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(20px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
}
.brand-lockup, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.account-name { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.theme-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.theme-control select { width: auto; min-width: 112px; }
.brand-lockup h1 { margin: 0; font-size: 19px; }
.brand-lockup .eyebrow { font-size: 9px; }
.health-pill { padding: 8px 12px; border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, 0.04); font-size: 12px; }
.health-pill.is-online { color: var(--success); background: rgba(104, 224, 179, 0.1); }
.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 calc(46px + env(safe-area-inset-bottom)); }
.intro-panel, .timeline-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.intro-panel { display: grid; grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.7fr); gap: 34px; padding: 30px; }
.command-form { display: grid; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1.25fr 0.8fr 0.9fr; gap: 12px; }
.form-grid > div { display: grid; gap: 7px; }
.command-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 3px; }
.command-actions p { margin: 0; font-size: 12px; }
.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.status-strip article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-subtle);
}
.status-strip span { color: var(--muted); font-size: 13px; }
.status-strip strong { color: var(--cyan); font-size: 27px; font-variant-numeric: tabular-nums; }
.timeline-panel { padding: 28px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; }
.section-heading time { color: var(--muted); font-size: 12px; }
.task-timeline { display: grid; gap: 13px; }
.empty-state { padding: 42px 20px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; color: var(--muted); }
.task-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-subtle); }
.task-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.task-card h3 { margin: 0 0 5px; font-size: 16px; line-height: 1.45; }
.task-id { color: var(--muted); font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.badge { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--cyan); background: var(--cyan-soft); font-size: 10px; font-weight: 800; letter-spacing: 0.05em; }
.badge-WAITING_APPROVAL { color: var(--warning); background: rgba(255, 199, 107, 0.11); }
.badge-FAILED, .badge-REJECTED { color: var(--danger); background: rgba(255, 127, 145, 0.11); }
.badge-COMPLETED { color: var(--success); background: rgba(104, 224, 179, 0.1); }
.task-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.task-details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.task-details summary { min-height: 44px; display: flex; align-items: center; color: var(--text); cursor: pointer; }
.detail-grid { display: grid; gap: 7px; padding: 5px 0 8px; color: var(--muted); font-size: 12px; }
.detail-grid strong { color: var(--text); }
.approval-panel { display: grid; grid-template-columns: 1fr auto auto; gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 199, 107, 0.2); }
.approval-button.approve { color: var(--success); }
.approval-button.reject { color: var(--danger); }
.live-status {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: min(390px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.live-status.is-visible { opacity: 1; transform: translateY(0); }
.live-status.is-error { border-color: rgba(255, 127, 145, 0.45); color: #ffdbe1; }

.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; }
.chat-shell { width: min(1480px, calc(100% - 32px)); height: 100%; min-height: 0; margin: 0 auto; padding: 18px 0 calc(24px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; }
.conversation-sidebar, .chat-panel, .governance-panel, .settings-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.conversation-sidebar { padding: 18px 12px; overflow: hidden; }
.sidebar-heading, .chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sidebar-heading { padding: 0 6px 16px; }
.sidebar-heading h2, .chat-heading h2 { margin: 0; font-size: 19px; }
.icon-button { width: 44px; min-width: 44px; border: 1px solid var(--line); border-radius: 12px; color: var(--cyan); background: var(--cyan-soft); font-size: 24px; }
.conversation-list { display: grid; gap: 6px; max-height: calc(100vh - 160px); overflow-y: auto; }
.conversation-button { min-height: 62px; display: grid; gap: 5px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; color: var(--text); background: transparent; text-align: left; }
.conversation-button:hover, .conversation-button.is-active { border-color: var(--line); background: var(--cyan-soft); }
.conversation-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conversation-button time { color: var(--muted); font-size: 10px; }
.chat-panel { position: relative; height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; }
.chat-heading { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.model-status { padding: 7px 10px; border-radius: 999px; color: var(--warning); background: rgba(255, 199, 107, 0.1); font-size: 11px; }
.model-status.is-online { color: var(--success); background: rgba(104, 224, 179, 0.1); }
.chat-messages { display: flex; flex-direction: column; gap: 18px; min-height: 0; padding: 28px max(24px, calc((100% - 820px) / 2)); overflow-y: auto; }
.chat-empty { align-self: center; max-width: 520px; margin: auto; text-align: center; }
.chat-empty .brand-mark { margin: 0 auto 20px; }
.chat-empty h3 { margin-bottom: 8px; font-size: 25px; }
.chat-message { width: min(86%, 760px); padding: 17px 19px; border: 1px solid var(--line); border-radius: 18px; background: var(--message-bg); }
.message-user { align-self: flex-end; border-color: rgba(70, 230, 255, 0.28); background: var(--cyan-soft); border-bottom-right-radius: 6px; }
.message-assistant { align-self: flex-start; border-bottom-left-radius: 6px; }
.message-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.message-role { color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; }
.message-actions { display: flex; align-items: center; gap: 6px; }
.copy-message, .copy-code { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; }
.copy-message:hover, .copy-code:hover { color: var(--text); background: var(--cyan-soft); }
.copy-fallback { position: fixed; left: -9999px; width: 1px; height: 1px; }
.message-content { color: var(--text); font-size: 14px; line-height: 1.68; overflow-wrap: anywhere; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p, .message-content ul, .message-content ol, .message-content blockquote { margin: 0 0 12px; color: inherit; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4 { margin: 20px 0 9px; line-height: 1.3; }
.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 18px; }
.message-content h3 { font-size: 16px; }
.message-content h4 { font-size: 14px; }
.message-content ul, .message-content ol { padding-left: 24px; }
.message-content blockquote { padding: 8px 14px; border-left: 3px solid var(--cyan); background: var(--cyan-soft); }
.message-content a { color: var(--cyan); text-underline-offset: 3px; }
.message-content :not(pre) > code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--cyan-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.message-code { margin: 13px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); }
.message-code-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 7px 9px 7px 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; text-transform: uppercase; }
.message-code pre { max-height: 520px; margin: 0; padding: 15px; overflow: auto; }
.message-code code { color: #f7f8fa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.65; white-space: pre; }
.markdown-table-scroll { max-width: 100%; margin: 13px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.markdown-table-scroll table { width: 100%; border-collapse: collapse; font-size: 12px; }
.markdown-table-scroll th, .markdown-table-scroll td { min-width: 110px; padding: 9px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.markdown-table-scroll th { color: var(--text); background: var(--cyan-soft); }
.message-chart { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-subtle); }
.message-chart figcaption { margin-bottom: 9px; font-weight: 750; }
.chart-svg { display: block; width: 100%; min-width: 420px; height: auto; }
.message-chart { overflow-x: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis-label { fill: var(--muted); font-size: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 11px; }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-legend span { width: 10px; height: 10px; border-radius: 3px; }
.chart-data { margin-top: 10px; color: var(--muted); font-size: 11px; }
.chart-data summary { cursor: pointer; }
.chart-error { color: var(--danger) !important; font-size: 12px; }
.tool-evidence { margin-top: 13px; padding: 9px 11px; border: 1px solid rgba(70, 230, 255, 0.18); border-radius: 10px; background: rgba(70, 230, 255, 0.05); color: var(--muted); font-size: 11px; }
.tool-evidence summary { color: var(--cyan); cursor: pointer; font-weight: 700; }
.tool-evidence-list { display: grid; gap: 5px; margin: 9px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.tool-trace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.message-time { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.is-pending { color: var(--muted); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.jump-to-latest { position: absolute; z-index: 6; right: 50%; bottom: 112px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: var(--surface-strong); box-shadow: var(--shadow); transform: translateX(50%); }
.chat-form { position: sticky; z-index: 5; bottom: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 14px max(20px, calc((100% - 860px) / 2)); border-top: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(18px); }
.chat-form textarea { min-height: 62px; max-height: 188px; resize: none; font-size: 14px; }
.record-button { width: 58px; min-width: 58px; padding: 0 8px; color: var(--cyan); font-size: 12px; }
.record-button.is-recording { border-color: var(--danger); color: var(--danger); background: rgba(220, 38, 38, 0.1); animation: pulse 1.4s ease-in-out infinite; }
.record-button.is-transcribing { color: var(--warning); background: var(--gold-soft); }
.chat-form .primary-button { min-width: 86px; }
.chat-disclaimer { margin: 0; padding: 0 22px 13px; text-align: center; font-size: 10px; }
.drawer-backdrop { position: fixed; z-index: 25; inset: 0; min-height: 100%; border: 0; border-radius: 0; background: rgba(3, 9, 20, 0.58); backdrop-filter: blur(3px); }
.governance-panel, .settings-panel { position: fixed; z-index: 30; top: 78px; right: 16px; bottom: 16px; width: min(680px, calc(100vw - 32px)); padding: 22px; overflow-y: auto; background: var(--overlay-bg); }
.settings-panel { width: min(560px, calc(100vw - 32px)); }
.drawer-heading { position: sticky; z-index: 2; top: -22px; margin: -22px -22px 18px; padding: 22px; border-bottom: 1px solid var(--line); background: var(--overlay-bg); }
.drawer-heading-actions, .subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-heading-actions { justify-content: flex-end; }
.drawer-close { color: var(--text); font-size: 24px; }
.drawer-primary-action { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.drawer-primary-action .primary-button { min-width: 118px; }
.task-creator { margin: 16px 0 22px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-subtle); }
.subsection-heading h3 { margin: 0; font-size: 16px; }
.drawer-list-section { margin-top: 24px; }
.drawer-list-section > h3 { margin: 0 0 12px; font-size: 15px; }
.settings-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--text); }
.settings-icon { font-size: 18px; line-height: 1; }
.settings-section { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-subtle); }
.settings-section-heading h3 { margin: 0 0 4px; font-size: 16px; }
.settings-section-heading p { margin: 0 0 14px; font-size: 12px; }
.settings-panel .theme-control { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.settings-panel .theme-control select { width: 100%; }
.settings-status { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--warning); background: var(--gold-soft); font-size: 12px; }
.settings-status.is-online { color: var(--success); background: rgba(104, 224, 179, 0.08); }
.agent-identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.agent-identity strong { color: var(--text); }
.agent-model-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.agent-model-form label { grid-column: 1 / -1; }
.capability-list, .executor-list { display: grid; gap: 8px; }
.capability-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.capability-card, .executor-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); }
.capability-card span, .executor-card span { color: var(--muted); font-size: 11px; }
.capability-card strong, .executor-state { color: var(--warning); font-size: 11px; }
.capability-card.is-enabled strong, .executor-card.is-connected .executor-state { color: var(--success); }
.executor-card > div { display: grid; gap: 3px; }
.executor-card > div strong { font-size: 13px; }
.governance-panel .status-strip { margin: 14px 0; }
.manual-task { margin: 16px 0; padding: 0 16px 16px; border: 1px solid var(--line); border-radius: 14px; }
.manual-task summary { min-height: 50px; display: flex; align-items: center; cursor: pointer; }
.manual-task .secondary-button { justify-self: end; }
.schedule-list { display: grid; gap: 10px; margin-top: 16px; }
.schedule-card { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-subtle); }
.schedule-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.schedule-card-header > div { display: grid; gap: 4px; }
.schedule-card-header span, .schedule-next { color: var(--muted); font-size: 11px; }
.schedule-goal { margin: 10px 0 6px; color: var(--text); font-size: 13px; }
.schedule-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.schedule-actions .ghost-button { min-height: 38px; }
.schedule-empty { padding: 20px; }

@media (max-width: 720px) {
  .topbar { position: static; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  .brand-lockup .eyebrow, .health-pill, .account-name { display: none; }
  .brand-lockup h1 { display: none; }
  .topbar-actions > * { flex: 0 0 auto; }
  .topbar-actions button { white-space: nowrap; }
  .theme-control > span { display: none; }
  .topbar-actions { gap: 5px; }
  .settings-label { display: none; }
  .secondary-button, .ghost-button { padding: 0 11px; }
  .shell { width: min(100% - 24px, 680px); padding-top: 16px; }
  .intro-panel { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .command-actions { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-strip article { min-height: 68px; padding: 13px 15px; }
  .timeline-panel { padding: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .task-card { padding: 16px; }
  .approval-panel { grid-template-columns: 1fr 1fr; }
  .approval-panel input { grid-column: 1 / -1; }
  .chat-shell { width: 100%; height: 100%; min-height: 0; padding: 0; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 0; }
  .conversation-sidebar { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 9px 12px; box-shadow: none; }
  .sidebar-heading { padding: 0; }
  .sidebar-heading > div { display: none; }
  .conversation-list { display: flex; max-height: none; gap: 7px; overflow-x: auto; }
  .conversation-button { min-width: 150px; min-height: 48px; padding: 7px 10px; }
  .icon-button { order: -1; }
  .chat-panel { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .chat-heading { padding: 13px 16px; }
  .chat-heading .eyebrow { display: none; }
  .chat-messages { padding: 20px 14px; }
  .chat-message { width: 92%; padding: 14px 15px; }
  .copy-message, .copy-code, .schedule-actions .ghost-button { min-height: 44px; }
  .chat-form { position: sticky; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .chat-form .primary-button { min-width: 70px; padding: 0 13px; }
  .chat-disclaimer { display: none; }
  .governance-panel, .settings-panel { top: 68px; right: 8px; bottom: 8px; width: calc(100vw - 16px); padding: 16px; }
  .drawer-heading { top: -16px; margin: -16px -16px 16px; padding: 16px; }
  .agent-model-form { grid-template-columns: 1fr; }
  .capability-list { grid-template-columns: 1fr; }
  .schedule-card-header { align-items: stretch; flex-direction: column; }
}
@media (max-width: 380px) {
  .brand-lockup h1 { font-size: 16px; }
  .brand-mark-small { width: 38px; height: 38px; }
  .status-strip { gap: 8px; }
  .status-strip article { padding: 11px; }
  .status-strip strong { font-size: 22px; }
  .task-card-header { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .is-pending { animation: none; }
}
