:root {
  color-scheme: light;
  --page: #e9e9e5;
  --surface: #f8f8f5;
  --surface-2: #ffffff;
  --surface-3: #eef0eb;
  --text: #17191c;
  --muted: #6f757d;
  --border: #dfe1dc;
  --border-strong: #c9cdc5;
  --user-bubble: #e5e8e1;
  --assistant-bubble: #ffffff;
  --accent: #1f5e42;
  --accent-soft: #dcece1;
  --warning-bg: #fff3df;
  --warning-border: #e6c78e;
  --warning-text: #815b1a;
  --danger: #b23a34;
  --danger-soft: #fbe8e7;
  --shadow: 0 20px 60px rgba(27, 32, 28, 0.14);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #08090b;
    --surface: #111318;
    --surface-2: #181b21;
    --surface-3: #22262d;
    --text: #f1f3f5;
    --muted: #959ca6;
    --border: #2b2f37;
    --border-strong: #3b4049;
    --user-bubble: #262b32;
    --assistant-bubble: #181b21;
    --accent: #b9ef9e;
    --accent-soft: #24372a;
    --warning-bg: #332817;
    --warning-border: #5d4826;
    --warning-text: #f3c66f;
    --danger: #ff8c85;
    --danger-soft: #3c2222;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--text);
}

body {
  min-height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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-shell {
  width: 100%;
  max-width: 560px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
}

.app-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: calc(9px + var(--safe-top)) 14px 9px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 5;
}

.header-button {
  min-width: 48px;
  min-height: 44px;
  padding: 0 5px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.header-button:active {
  background: var(--surface-3);
}

.header-copy {
  min-width: 0;
  flex: 1;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.app-mark,
.empty-mark {
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.app-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 13px;
}

.brand-row h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b929c;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.connection-dot.is-online {
  background: #59b77f;
}

.connection-dot.is-offline {
  background: var(--danger);
}

.connection-dot.is-connecting {
  background: #d2a64d;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.connection-text {
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.thread-title {
  margin: 4px 0 0 35px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-strip {
  flex: 0 0 auto;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
}

.task-strip-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.folder-mark {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  flex: 0 0 auto;
}

.project-name {
  color: var(--text);
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.thread-item-project {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item-project::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 1.5px;
  background: currentColor;
  flex: 0 0 auto;
}

.task-strip-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}

.model-tag {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 9.5px;
}

.chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  scroll-behavior: smooth;
}

.empty-state {
  margin: auto;
  max-width: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  font-size: 21px;
  margin-bottom: 16px;
}

.empty-state h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
}

.empty-state p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 17px;
}

.empty-actions button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.empty-actions button.primary {
  border-color: transparent;
  background: var(--text);
  color: var(--surface);
}

.load-older-wrap {
  display: flex;
  justify-content: center;
  padding: 2px 0 4px;
}

.load-older-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.load-older-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.date-divider {
  align-self: center;
  color: var(--muted);
  font-size: 9.5px;
  padding: 3px 0;
}

.message {
  max-width: 91%;
  display: flex;
  gap: 7px;
  align-items: flex-start;
  animation: message-in 160ms ease-out both;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  justify-content: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.assistant-avatar {
  width: 23px;
  height: 23px;
  margin-top: 2px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--text);
  color: var(--surface);
  font-size: 9px;
  font-weight: 800;
}

.bubble {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.message.user .bubble {
  border-bottom-right-radius: 5px;
  background: var(--user-bubble);
}

.message.assistant .bubble {
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  background: var(--assistant-bubble);
}

.msg-text {
  white-space: pre-wrap;
}

.msg-text .code-block {
  margin: 8px 0;
  padding: 9px 10px;
  border-radius: 9px;
  overflow-x: auto;
  background: var(--surface-3);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
}

.tool-card,
.approval-card,
.input-card,
.plan-card {
  width: 100%;
  align-self: stretch;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--assistant-bubble);
  overflow: hidden;
  animation: message-in 160ms ease-out both;
}

.tool-card {
  padding: 11px 12px;
}

.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 650;
}

.tool-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.tool-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--accent);
}

.tool-dot.is-running {
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.tool-dot.is-failed {
  background: var(--danger);
}

.tool-status {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
}

.command-line,
.file-path {
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.tool-output {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 7px;
}

.tool-output summary,
.file-diff summary {
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  user-select: none;
}

.tool-output pre,
.file-diff pre {
  margin: 7px 0 0;
  max-height: 240px;
  overflow: auto;
  padding: 9px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.file-change-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.file-change-row {
  border-top: 1px solid var(--border);
  padding-top: 7px;
}

.file-change-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.file-kind {
  color: var(--muted);
  font-size: 9.5px;
  margin-left: 6px;
}

.reasoning-card {
  align-self: stretch;
  border: 1px dashed var(--border-strong);
  border-radius: 13px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.reasoning-card summary {
  color: var(--muted);
  cursor: pointer;
}

.reasoning-card p {
  margin: 8px 0 0;
  color: var(--text);
  white-space: pre-wrap;
}

.approval-card {
  padding: 12px;
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.approval-eyebrow {
  color: var(--warning-text);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.approval-title {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
}

.approval-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 7px;
  margin-top: 10px;
}

.approval-actions button,
.input-submit,
.danger-button {
  min-height: 42px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.approval-actions .deny {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.approval-actions .allow {
  border: 1px solid transparent;
  background: var(--text);
  color: var(--surface);
}

.approval-result {
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.4;
}

.working-card {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--assistant-bubble);
  color: var(--muted);
  font-size: 11px;
}

.working-bars {
  display: flex;
  gap: 2px;
  height: 13px;
  align-items: flex-end;
}

.working-bars i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  animation: working-bar 1s ease-in-out infinite;
}

.working-bars i:nth-child(1) { height: 7px; animation-delay: 0s; }
.working-bars i:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.working-bars i:nth-child(3) { height: 8px; animation-delay: 0.3s; }

@keyframes working-bar {
  0%, 100% { opacity: 0.4; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

.error-card {
  align-self: stretch;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  border-radius: 13px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.composer-wrap {
  flex: 0 0 auto;
  padding: 6px 12px calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.composer-status {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 3px 3px;
  color: var(--muted);
  font-size: 9.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.composer-status.is-ready .status-dot { background: #59b77f; }
.composer-status.is-busy .status-dot { background: var(--accent); animation: pulse-dot 1.2s infinite; }
.composer-status.is-error .status-dot { background: var(--danger); }
.composer-status.is-readonly .status-dot { background: var(--warning-text); }

.composer-box {
  padding: 8px 9px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.composer-input {
  display: block;
  width: 100%;
  min-height: 34px;
  max-height: 140px;
  padding: 2px 2px 6px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.48;
}

.composer-input::placeholder {
  color: var(--muted);
}

.composer-input:disabled {
  opacity: 0.65;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-button {
  min-width: 48px;
  min-height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}

.composer-button.is-listening {
  background: var(--accent-soft);
  color: var(--accent);
}

.composer-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.composer-spacer {
  flex: 1;
}

.send-button {
  min-width: 60px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: var(--text);
  color: var(--surface);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.send-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.threads-drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  width: min(88vw, 380px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(18px + var(--safe-top)) 14px calc(14px + var(--safe-bottom));
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 60px rgba(0, 0, 0, 0.24);
  transform: translateX(105%);
  transition: transform 200ms ease;
}

.threads-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.drawer-header h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.drawer-close {
  min-width: 48px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.new-thread-button {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.new-thread-plus {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  font-size: 20px;
  line-height: 1;
}

.new-thread-button strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.new-thread-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
}

.thread-search {
  width: 100%;
  min-height: 42px;
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
}

.thread-search::placeholder {
  color: var(--muted);
}

.thread-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.thread-item {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.thread-item:hover,
.thread-item:active {
  background: var(--surface-3);
}

.thread-item.is-selected {
  border-color: var(--border);
  background: var(--surface-2);
}

.thread-item-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.thread-item-dot.is-active {
  background: #59b77f;
}

.thread-item-copy {
  min-width: 0;
}

.thread-item-title {
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item-preview {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-item-time {
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
  padding-top: 1px;
}

.drawer-footer {
  flex: 0 0 auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.security-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.security-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #59b77f;
}

.drawer-footer p {
  margin: 7px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.install-banner {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(78px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(92vw, 500px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 10.5px;
}

.install-banner span {
  flex: 1;
  line-height: 1.4;
}

.install-banner button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: var(--text);
  color: var(--surface);
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

.install-banner .banner-dismiss {
  min-width: 34px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(142px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: min(88vw, 440px);
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--text);
  color: var(--surface);
  font-size: 10.5px;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow);
}

.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 42%),
    var(--page);
}

.auth-card {
  width: min(100%, 390px);
  padding: 26px 22px 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
}

.auth-brand .app-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 16px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.auth-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.auth-card h2 {
  margin: 0 0 7px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.auth-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.auth-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.auth-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 10.5px;
  line-height: 1.45;
}

.auth-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

@media (min-width: 700px) {
  .app-shell {
    margin-top: 18px;
    margin-bottom: 18px;
    height: calc(100dvh - 36px);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
  }

  .app-header {
    padding-top: 9px;
  }

  body {
    background:
      radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 48%),
      var(--page);
  }
}

@media (max-width: 360px) {
  .app-header {
    padding-inline: 10px;
  }

  .header-button {
    min-width: 42px;
  }

  .chat {
    padding-inline: 11px;
  }

  .message {
    max-width: 94%;
  }

  .bubble {
    font-size: 12.5px;
  }

  .composer-wrap {
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.pair-card {
  width: min(100%, 390px);
  padding: 24px 20px 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pair-card h2 {
  margin: 0 0 7px;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.pair-qr {
  width: 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  margin: 17px 0 10px;
  padding: 10px;
  border-radius: 18px;
  background: #ffffff;
}

.pair-qr canvas,
.pair-qr img {
  display: block;
  max-width: 100%;
  height: auto;
}

.pair-loading {
  color: #72777f;
  font-size: 12px;
}

.pair-error {
  padding: 14px;
  color: var(--danger);
  font-size: 12px;
  text-align: center;
}

.pair-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

.pair-actions {
  display: flex;
  justify-content: center;
}

.pair-actions .auth-submit {
  margin-top: 0;
}

/* install reminder disabled */
.install-banner {
  display: none !important;
}

.speak-button {
  display: block;
  min-height: 25px;
  margin: 6px 0 0 auto;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
}

.speak-button.is-speaking {
  color: var(--accent);
}

.composer-button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.composer-button {
  white-space: nowrap;
}
