:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-synthesis: none;
  --accent: #536f28;
  --accent-ink: #f8faef;
  --accent-soft: #e0ecc9;
  --background: #f7f7f5;
  --danger: #b23a32;
  --line: rgba(34, 36, 31, 0.11);
  --muted: #6f7169;
  --shadow: 0 16px 48px rgba(34, 36, 31, 0.12);
  --surface: #ffffff;
  --surface-2: #ecece8;
  --text: #20221e;
  --user-bubble: #e9e9e5;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  -webkit-font-smoothing: antialiased;
  background: var(--background);
  color: var(--text);
  font-feature-settings: "kern";
  overflow: hidden;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: 0.45; }
pre { font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.screen {
  background: var(--background);
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}
@supports (height: 100dvh) { .screen { height: 100dvh; } }

.topbar {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
}
.list-topbar { align-items: flex-end; justify-content: space-between; }
.topbar-actions { align-items: center; display: flex; gap: 8px; }
.session-button { background: transparent; border: 0; color: var(--muted); font-size: 13px; min-height: 36px; padding: 6px; }
.topbar h1 { font-size: 30px; letter-spacing: -0.035em; line-height: 1; margin: 0; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: 0.12em; margin: 0 0 8px; text-transform: uppercase; }

.connection-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 650;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
}
.connection-badge i { background: #64a340; border-radius: 50%; height: 8px; width: 8px; }
.connection-badge.offline i, .connection-badge.unavailable i { background: var(--danger); }
.connection-badge.loading i, .connection-badge.reconnecting i { animation: pulse 1.2s infinite; background: #c48b34; }

.list-scroll, .timeline { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; }
.timeline { -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.list-scroll { padding: 8px 12px 24px; }
.catalog-section { margin: 10px 0 22px; }
.catalog-heading { align-items: center; display: flex; gap: 8px; min-height: 34px; padding: 0 7px; }
.catalog-heading h2 { color: var(--muted); flex: 1; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; margin: 0; text-transform: uppercase; }
.catalog-heading span { color: var(--muted); font-size: 11px; }
.project-group { margin: 2px 0; }
.project-header { align-items: center; display: flex; }
.project-header .project-toggle { flex: 1; min-width: 0; }
.project-create { background: transparent; border: 0; border-radius: 10px; color: var(--muted); flex: 0 0 44px; font-size: 27px; height: 44px; padding: 0; }
.project-create:active { background: var(--surface-2); }
.project-empty { color: var(--muted); font-size: 13px; margin: 12px 10px; }
.create-name { color: var(--muted); display: grid; font-size: 13px; gap: 8px; }
.create-name input { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 16px; min-height: 44px; padding: 10px 12px; width: 100%; }
.project-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: 26px minmax(0, 1fr) auto 20px;
  min-height: 52px;
  padding: 8px 7px;
  text-align: left;
  width: 100%;
}
.project-toggle:active { background: var(--surface-2); }
.project-folder { align-items: center; display: inline-flex; height: 24px; justify-content: center; width: 24px; }
.project-folder svg { fill: none; height: 22px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 22px; }
.project-name { font-size: 16px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-count { background: var(--surface-2); border-radius: 999px; color: var(--muted); font-size: 11px; min-width: 23px; padding: 3px 7px; text-align: center; }
.project-chevron { color: var(--muted); font-size: 21px; line-height: 1; transform: rotate(0deg); transition: transform 140ms ease; }
.project-toggle[aria-expanded="true"] .project-chevron { transform: rotate(90deg); }
.task-stack { border-left: 1px solid var(--line); margin: 0 0 9px 18px; padding: 1px 0 1px 8px; }
.flat-task-stack { border-left: 0; margin: 0; padding: 0; }
.project-more {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  font-weight: 650;
  gap: 8px;
  min-height: 44px;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}
.project-more:active { color: var(--text); }
.task-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) 16px;
  min-height: 60px;
  padding: 8px 6px 8px 10px;
  text-align: left;
  width: 100%;
}
.task-row:active { background: var(--surface-2); }
.task-main { display: grid; gap: 5px; min-width: 0; }
.task-main strong { font-size: 16px; font-weight: 590; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-main small { color: var(--muted); font-size: 12.5px; }
.task-state.loaded { color: var(--accent); font-weight: 650; }
.task-state.not-loaded { color: var(--muted); }
.chevron { color: var(--muted); font-size: 19px; }

.search-dock {
  align-items: center;
  background: linear-gradient(transparent, var(--background) 22%);
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 12px);
}
.search-box { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; display: flex; flex: 1; gap: 8px; min-height: 50px; padding: 0 14px; }
.search-box span { font-size: 25px; transform: rotate(-18deg); }
.search-box input { background: transparent; border: 0; font-size: 16px; min-width: 0; outline: 0; width: 100%; }
.icon-button, .back-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  display: inline-flex;
  font-size: 24px;
  height: 48px;
  justify-content: center;
  min-width: 48px;
}

.thread-topbar { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.thread-topbar .back-button { background: transparent; border: 0; font-size: 38px; margin-left: -8px; }
.thread-heading { flex: 1; min-width: 0; }
.thread-heading h1 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-heading p { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.thread-topbar .connection-badge { font-size: 0; min-height: 34px; padding: 8px; width: 34px; }
.thread-topbar .connection-badge i { height: 9px; width: 9px; }

.settings-panel { border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.settings-panel summary { align-items: center; cursor: pointer; display: flex; gap: 10px; list-style: none; min-height: 44px; padding: 8px 16px; }
.settings-panel summary::-webkit-details-marker { display: none; }
.settings-panel summary span { font-size: 14px; font-weight: 700; }
.settings-panel summary small { color: var(--muted); flex: 1; font-size: 12px; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.settings-panel summary::after { color: var(--muted); content: "⌄"; }
.settings-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; padding: 4px 16px 14px; }
.settings-grid label, .mcp-fields label { color: var(--muted); display: grid; font-size: 12px; gap: 5px; }
.settings-grid select, .mcp-fields input, .mcp-fields select { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 15px; min-height: 42px; padding: 7px 9px; width: 100%; }
.cwd-row { color: var(--muted); font: 11px/1.4 ui-monospace, monospace; grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; }
.settings-save { grid-column: 1 / -1; }
.queue-list { border-top: 1px solid var(--line); display: grid; gap: 7px; padding: 10px 16px 14px; }
.queue-list h3 { font-size: 12px; margin: 0; }
.queue-list > div { align-items: center; background: var(--surface-2); border-radius: 10px; display: flex; gap: 8px; padding: 8px 10px; }
.queue-list span { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-list button { background: transparent; border: 0; color: var(--danger); font-size: 12px; min-height: 32px; }

.timeline { padding: 24px 16px 34px; scroll-behavior: smooth; }
.transcript { margin: 0 auto; max-width: 720px; width: 100%; }
.history-sentinel { height: 1px; }
.history-status {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin: -10px auto 22px;
  min-height: 28px;
  padding: 5px 10px;
  text-align: center;
  width: 100%;
}
.history-error { color: var(--danger); cursor: pointer; }
.history-end { opacity: 0.72; }
.turn-block {
  contain-intrinsic-size: auto 480px;
  content-visibility: auto;
  display: flow-root;
}
.turn-detail-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin: -8px 0 22px;
  min-height: 34px;
  padding: 5px 2px;
}
.turn-detail-button:disabled { opacity: 0.6; }
.turn-status {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  color: var(--danger);
  margin: 0 2px 12px;
  padding: 9px 11px;
}
.turn-status strong { display: block; font-size: 13px; }
.turn-status p { font-size: 12px; line-height: 1.5; margin: 3px 0 0; }
.turn-status + .turn-detail-button { margin-top: 0; }
.message { font-size: clamp(16px, 3.85vw, 16.5px); line-height: 1.62; margin: 0 0 22px; position: relative; }
.user-message {
  background: var(--user-bubble);
  border-radius: 17px;
  margin-left: auto;
  max-width: 88%;
  padding: 12px 14px;
  width: fit-content;
}
.assistant-message { background: transparent; max-width: 100%; padding: 0 2px; width: 100%; }
.assistant-message + .user-message { margin-top: 28px; }
.message-text { overflow-wrap: anywhere; word-break: break-word; }
.message-text > :first-child { margin-top: 0; }
.message-text > :last-child { margin-bottom: 0; }
.message-text p { margin: 0 0 15px; }
.message-text h2, .message-text h3, .message-text h4 {
  letter-spacing: -0.015em;
  line-height: 1.32;
  margin: 24px 0 10px;
}
.message-text h2 { font-size: 21px; }
.message-text h3 { font-size: 18px; }
.message-text h4 { font-size: 16.5px; }
.message-text ul, .message-text ol { margin: 8px 0 16px; padding-left: 1.4em; }
.message-text li { margin: 5px 0; padding-left: 0.15em; }
.message-text blockquote { border-left: 3px solid var(--line); color: var(--muted); margin: 14px 0 16px; padding: 2px 0 2px 13px; }
.message-text hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.message-text a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.message-text :not(pre) > code {
  background: var(--surface-2);
  border-radius: 5px;
  font: 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 0.12em 0.34em;
}
.markdown-code {
  background: #ecece8;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #242622;
  margin: 14px 0 18px;
  max-height: 55dvh;
  overflow: auto;
  padding: 12px 13px;
  white-space: pre;
}
.markdown-code code { font: inherit; }
.markdown-table { margin: 14px 0 18px; max-width: 100%; overflow-x: auto; }
.markdown-table table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.markdown-table th, .markdown-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.markdown-table th { color: var(--muted); font-weight: 650; }
.task-marker { border: 1px solid var(--muted); border-radius: 4px; display: inline-flex; font-size: 10px; height: 15px; justify-content: center; margin: 0 7px 0 -1.25em; vertical-align: 1px; width: 15px; }
.message-tools { float: right; margin: -5px -5px 3px 8px; }
.assistant-message .message-tools { margin-right: 0; }
.mini-button { background: transparent; border: 0; color: var(--muted); font-size: 11px; min-height: 28px; padding: 3px 6px; }
.user-message .mini-button { color: var(--muted); }
.attachment-row, .attachment-previews { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.attachment-row span, .attachment-previews span { align-items: center; background: rgba(127, 127, 127, 0.15); border-radius: 9px; display: inline-flex; font-size: 12px; gap: 4px; max-width: 100%; padding: 6px 8px; }
.attachment-previews span { background: var(--surface-2); }
.attachment-previews button { background: transparent; border: 0; font-size: 17px; height: 22px; padding: 0; width: 22px; }

.activity { background: transparent; border: 0; border-radius: 0; margin: 0 0 5px; overflow: visible; }
.activity > summary, .activity > header { align-items: center; display: flex; gap: 8px; list-style: none; min-height: 38px; padding: 5px 2px; }
.activity > summary { border-radius: 8px; cursor: pointer; }
.activity > summary:active { background: var(--surface-2); }
.activity > summary::-webkit-details-marker { display: none; }
.activity > summary strong, .activity > header strong { flex: 1; font-size: 13px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity > summary small { color: var(--muted); font-size: 11px; }
.activity-icon { align-items: center; color: var(--muted); display: inline-flex; font: 12px ui-monospace, monospace; height: 26px; justify-content: center; min-width: 26px; }
.activity > pre, .reasoning pre {
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0 8px 8px 0;
  margin: 1px 0 10px 34px;
  max-height: 320px;
  padding: 9px 11px;
}
.activity > p { margin-left: 34px; }
.activity > .mini-button { margin: 0 0 2px 34px; }
.reasoning > summary { color: var(--muted); font-size: 13px; }
.file-change { border: 0; border-left: 2px solid var(--line); margin: 0 0 8px 34px; }
.file-change summary { display: flex; font: 12px/1.4 ui-monospace, monospace; gap: 8px; list-style: none; overflow-wrap: anywhere; padding: 9px 10px; }
.file-change summary span { color: var(--accent); font-weight: 750; text-transform: uppercase; }
.file-change pre { background: #181a17; color: #e7ebdf; max-height: 360px; padding: 11px; }
.code-tools { background: #181a17; padding: 5px 8px 0; text-align: right; }
.code-tools .mini-button { color: #b8bdaf; }
.muted { color: var(--muted); font-size: 13px; }

.running-indicator { align-items: center; color: var(--muted); display: flex; font-size: 13px; gap: 8px; padding: 8px 4px; }
.running-indicator i { animation: pulse 1.1s infinite; background: var(--accent); border-radius: 50%; height: 8px; width: 8px; }
.request-banner { align-items: center; background: #fff1cf; border: 0; border-top: 1px solid #e8d5a7; color: #5a461a; display: grid; flex: 0 0 auto; gap: 3px 8px; grid-template-columns: 1fr auto; min-height: 58px; padding: 8px 16px; text-align: left; width: 100%; }
.request-banner span:first-child { font-size: 12px; grid-column: 1; }
.request-banner strong { font-size: 14px; grid-column: 1; }
.request-banner span:last-child { font-size: 24px; grid-column: 2; grid-row: 1 / 3; }

.composer-shell { background: linear-gradient(transparent, var(--background) 18px); flex: 0 0 auto; padding: 18px 12px calc(env(safe-area-inset-bottom) + 9px); }
.composer-inner { margin: 0 auto; max-width: 740px; width: 100%; }
.delivery-toggle { background: var(--surface-2); border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 7px; padding: 3px; }
.delivery-toggle button { background: transparent; border: 0; border-radius: 8px; font-size: 12px; min-height: 30px; }
.delivery-toggle button.selected { background: var(--surface); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.09); font-weight: 700; }
.composer-row { align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 7px 24px rgba(28, 30, 25, 0.09); display: flex; gap: 3px; padding: 5px; }
.composer-row .icon-button { background: transparent; border: 0; border-radius: 50%; font-size: 23px; height: 44px; min-width: 44px; }
.composer-input { background: transparent; border: 0; flex: 1; min-width: 0; padding: 9px 5px; }
.composer-input textarea { background: transparent; border: 0; display: block; font-size: 16px; line-height: 1.4; max-height: 20dvh; min-height: 23px; outline: 0; resize: none; width: 100%; }
.send-button, .stop-button { border: 0; height: 44px; min-width: 44px; }
.send-button { background: var(--accent); border-radius: 50%; color: var(--accent-ink); font-size: 22px; }
.stop-button { background: #f1d8d4; border-radius: 15px; color: var(--danger); font-size: 12px; font-weight: 750; }
.composer-meta { align-items: center; color: var(--muted); display: flex; font-size: 11px; justify-content: space-between; min-height: 24px; padding: 3px 9px 0 48px; }
.composer-meta button { background: transparent; border: 0; color: var(--muted); font-size: 11px; min-height: 24px; }

.latest-button { align-self: center; background: #242720; border: 0; border-radius: 999px; bottom: 140px; color: white; font-size: 12px; padding: 8px 12px; position: absolute; z-index: 4; }
.failure-banner { align-items: center; background: #f5dcd8; color: #682b26; display: flex; flex: 0 0 auto; font-size: 13px; gap: 10px; justify-content: space-between; padding: 9px 14px; }
.failure-banner button { background: transparent; border: 0; color: inherit; font-weight: 750; min-height: 36px; }

.sheet-backdrop { align-items: flex-end; background: rgba(17, 18, 16, 0.4); display: flex; inset: 0; padding-top: env(safe-area-inset-top); position: fixed; z-index: 20; }
.bottom-sheet { background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow); max-height: calc(100dvh - env(safe-area-inset-top) - 18px); padding: 8px 20px calc(env(safe-area-inset-bottom) + 14px); width: 100%; }
.sheet-handle { background: var(--line); border-radius: 99px; height: 5px; margin: 0 auto 20px; width: 44px; }
.bottom-sheet h2 { font-size: 24px; letter-spacing: -0.025em; margin: 0 0 14px; }
.bottom-sheet > p, .sheet-scroll > p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.sheet-actions { display: grid; gap: 10px; grid-template-columns: 1fr 1.5fr; margin-top: 18px; }
.primary-button, .secondary-button, .danger-button { border-radius: 13px; font-size: 15px; font-weight: 700; min-height: 48px; padding: 9px 12px; }
.primary-button { background: var(--accent); border: 1px solid var(--accent); color: var(--accent-ink); }
.secondary-button { background: var(--surface-2); border: 1px solid var(--line); }
.danger-button { background: #f5dcd8; border: 1px solid #e8bbb4; color: var(--danger); }
.wide { margin-top: 14px; width: 100%; }
.request-sheet { display: flex; flex-direction: column; max-height: min(88dvh, 820px); }
.request-sheet .sheet-scroll { min-height: 0; overflow: auto; }
.request-sheet > .sheet-actions { flex: 0 0 auto; grid-template-columns: 1fr; }
.request-details { display: grid; gap: 12px; margin: 0; }
.request-details div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.request-details dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.request-details dd { font-size: 14px; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.decision-grid { display: grid; gap: 9px; margin-top: 16px; }
.json-field { color: var(--muted); display: grid; font-size: 12px; gap: 6px; margin-top: 14px; }
.json-field textarea, .other-answer input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; font: 14px/1.45 ui-monospace, monospace; padding: 10px; }
.question { border: 1px solid var(--line); border-radius: 14px; margin: 14px 0; padding: 12px; }
.question legend { font-size: 13px; font-weight: 750; padding: 0 5px; }
.question > p { font-size: 15px; margin: 4px 0 10px; }
.question > label { align-items: flex-start; display: flex; gap: 9px; min-height: 44px; padding: 7px 0; }
.question label span { display: grid; gap: 3px; }
.question label small { color: var(--muted); }
.other-answer { display: grid !important; }
.desktop-required { background: #fff1cf; border-radius: 12px; color: #5a461a; font-size: 14px; line-height: 1.5; margin-top: 14px; padding: 12px; }
.mcp-fields { display: grid; gap: 12px; margin: 14px 0; }

.empty-state { color: var(--muted); margin: auto; max-width: 280px; padding: 48px 20px; text-align: center; }
.empty-state strong { color: var(--text); font-size: 17px; }
.empty-state p { font-size: 14px; line-height: 1.5; }
.skeletons { display: grid; gap: 14px; padding: 30px 16px; }
.skeletons i { animation: shimmer 1.4s infinite; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; border-radius: 18px; height: 90px; }
.skeletons i:nth-child(2) { height: 140px; margin-left: 12%; }
.auth-screen { align-items: center; justify-content: center; padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 24px); }
.auth-panel { margin-top: -8vh; max-width: 360px; text-align: center; width: 100%; }
.auth-mark { align-items: center; background: var(--text); border-radius: 18px; color: var(--background); display: inline-flex; font-size: 27px; font-weight: 760; height: 58px; justify-content: center; margin-bottom: 24px; width: 58px; }
.auth-panel h1 { font-size: 29px; letter-spacing: -0.035em; margin: 0 0 12px; }
.auth-panel > p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 auto 24px; }
.auth-panel > small { color: var(--muted); display: block; font-size: 12px; line-height: 1.5; margin: 18px auto 0; max-width: 300px; }
.auth-label { color: var(--muted); display: grid; font-size: 12px; gap: 6px; margin: 0 0 14px; text-align: left; }
.auth-label input { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; font-size: 16px; min-height: 48px; padding: 10px 12px; width: 100%; }
.auth-error { background: #f5dcd8; border-radius: 12px; color: #682b26; font-size: 13px; line-height: 1.45; margin: 0 0 12px; padding: 10px 12px; text-align: left; }
.visually-hidden { height: 1px !important; margin: -1px !important; overflow: hidden !important; padding: 0 !important; position: absolute !important; width: 1px !important; clip: rect(0 0 0 0) !important; }

@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.85); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; } }

@media (max-width: 380px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .list-scroll, .timeline { padding-left: 12px; padding-right: 12px; }
  .connection-badge { font-size: 12px; }
  .settings-grid { padding-left: 12px; padding-right: 12px; }
  .user-message { max-width: 96%; }
  .composer-shell { padding-left: 8px; padding-right: 8px; }
  .composer-row { gap: 5px; }
  .stop-button { min-width: 42px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #a7ca6e;
    --accent-ink: #17200c;
    --accent-soft: #29351d;
    --background: #151614;
    --danger: #ff9a90;
    --line: rgba(235, 238, 228, 0.12);
    --muted: #a0a39a;
    --shadow: 0 18px 54px rgba(0, 0, 0, 0.5);
    --surface: #20211f;
    --surface-2: #2a2b28;
    --text: #edeee9;
    --user-bubble: #2b2c29;
  }
  .connection-badge { background: rgba(29, 31, 27, 0.78); }
  .state-pill.loaded { color: #b9dc83; }
  .markdown-code { background: #20211f; color: #eceee8; }
  .request-banner, .desktop-required { background: #3b3017; border-color: #5a4820; color: #f0d899; }
  .failure-banner, .danger-button, .stop-button { background: #48221f; border-color: #67302b; }
}
