@import '/ui/tokens.css';
@import '/ui/components.css';
@import '/ui/sidebar.css';

/* KnowledgeBase app — built on the shared design system */

/* Prevent horizontal overflow on any device */
html { overflow-x: hidden; }

/* Extend components.css body with SPA layout */
body { height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }

#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.screen { display: flex; flex: 1; min-height: 0; }
.hidden { display: none !important; }

/* ── Auth ─────────────────────────────────────────────────────────────────── */
/* .auth-box, .auth-header, .auth-icon, .auth-title, .auth-desc, .auth-content
   are defined in components.css so the OAuth page can share them. */

#auth-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--background);
  padding: 1rem;
}


#auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#auth-form button[type="submit"] {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ── Buttons (raw HTML elements, not .btn classes) ────────────────────────── */

button {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-foreground);
  transition: opacity 0.15s;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
}
button:not(.btn):hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--muted-foreground);
}
button.secondary:hover { background: var(--muted); opacity: 1; }

/* ── Shared input defaults ────────────────────────────────────────────────── */

input:focus { border-color: var(--ring); }
input::placeholder { color: var(--muted-foreground); }

.error { color: var(--destructive); font-size: 0.8rem; }

/* ── FlackBack-style header ───────────────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 3.5rem;
  padding: 0 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Vertical rule between trigger and page title */
.header-sep {
  width: 1px;
  height: 1.375rem;
  background: var(--border);
  flex-shrink: 0;
}

.header-page-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.header-spacer { flex: 1; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Route views ──────────────────────────────────────────────────────────── */

.route-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Shared layout component for scrollable content pages (Quick Links, MCP Setup) */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  width: 100%;
}

/* ── Chat route ───────────────────────────────────────────────────────────── */

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  max-width: 75%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-lg);
  line-height: 1.6;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user      { background: var(--primary); color: var(--primary-foreground); align-self: flex-end; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg); }
.message.assistant { background: var(--card); border: 1px solid var(--border); align-self: flex-start; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm); }
.message.error     { background: oklch(from var(--destructive) l c h / 8%); border: 1px solid oklch(from var(--destructive) l c h / 30%); color: var(--destructive); align-self: flex-start; }

/* Ingest log */
#ingest-log {
  margin: 0 1.5rem;
  background: oklch(0.145 0 0);
  color: oklch(0.7 0.2 155);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  font-size: 0.8rem;
  max-height: 160px;
  overflow-y: auto;
  flex-shrink: 0;
}
#ingest-output { font-family: var(--font-mono); white-space: pre-wrap; }

/* Chat input form */
#chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items: flex-end;
}

/* Override .textarea for the auto-resizing chat input */
#chat-input {
  flex: 1;
  min-height: auto;
  resize: none;
  max-height: 8rem;
  overflow-y: auto;
  line-height: 1.4;
}

/* Typing indicator */
.typing::after { content: '▋'; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Thinking dots (before first token arrives) */
.message.assistant.thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.85rem 1rem;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-foreground);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── OpenClaw route ───────────────────────────────────────────────────────── */

.openclaw-page {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.openclaw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0;
}

.openclaw-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.openclaw-desc {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  max-width: 48rem;
}

.openclaw-empty-state {
  margin: 1rem 1.5rem 0;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  font-size: 0.875rem;
}

#openclaw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#openclaw-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items: flex-end;
}

#openclaw-input {
  flex: 1;
  min-height: auto;
  resize: none;
  max-height: 8rem;
  overflow-y: auto;
  line-height: 1.4;
}

/* ── Quick Links route ────────────────────────────────────────────────────── */

.quick-links-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.quick-links-header { display: flex; flex-direction: column; gap: 0.25rem; }
.quick-links-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.quick-links-title  { font-size: 1.25rem; font-weight: 600; }
.quick-links-desc   { font-size: 0.875rem; color: var(--muted-foreground); }

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.quick-link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
}

.quick-link-card:hover {
  background: var(--accent);
  border-color: var(--ring);
  box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 15%);
}

.quick-link-card svg {
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.quick-link-favicon { flex-shrink: 0; border-radius: 4px; }

.quick-link-card-text  { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.quick-link-card-label,
.quick-link-card-url,
.quick-link-card-desc  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-link-card-label { font-weight: 500; }
.quick-link-card-url,
.quick-link-card-desc  { font-size: 0.75rem; color: var(--muted-foreground); }

.quick-link-actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.125rem;
  opacity: 0;
  transition: opacity 150ms;
}
.quick-link-card:hover .quick-link-actions { opacity: 1; }

.quick-link-action-btn {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  transition: background 150ms, color 150ms, border-color 150ms;
}
.quick-link-action-btn:hover {
  background: var(--muted);
  border-color: var(--border);
  color: var(--foreground);
}
.quick-link-action-btn.danger:hover {
  background: oklch(from var(--destructive) l c h / 10%);
  border-color: oklch(from var(--destructive) l c h / 30%);
  color: var(--destructive);
}

/* ── Tasks route ─────────────────────────────────────────────────────────── */

.tasks-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tasks-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tasks-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.tasks-desc {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.tasks-layout {
  display: grid;
  grid-template-columns: minmax(min(18rem, 100%), 24rem) minmax(0, 1fr);
  gap: 1rem;
  min-height: 32rem;
}

.tasks-list-panel,
.task-detail-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 0;
}

.tasks-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tasks-list-header,
.task-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
}

.tasks-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.task-list-item {
  padding: 1rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  cursor: pointer;
}

.task-list-item:last-child { border-bottom: 0; }
.task-list-item:hover { background: var(--accent); opacity: 1; }
.task-list-item[data-active="true"] {
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: inset 3px 0 0 var(--primary);
}

.task-list-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.task-list-item-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.task-list-item-desc {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.task-list-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.task-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  border: 1px solid var(--border);
}

.task-status-badge[data-status="open"] {
  background: oklch(0.97 0.02 95);
  color: oklch(0.46 0.09 95);
}

.task-status-badge[data-status="in_progress"] {
  background: oklch(0.95 0.03 235);
  color: oklch(0.42 0.12 245);
}

.task-status-badge[data-status="waiting_on"] {
  background: oklch(0.96 0.04 30);
  color: oklch(0.5 0.14 35);
}

.task-status-badge[data-status="done"] {
  background: oklch(0.96 0.03 150);
  color: oklch(0.44 0.11 150);
}

.task-detail-panel {
  padding: 1.25rem;
  overflow-y: auto;
}

.task-empty-state {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  text-align: center;
  padding: 2rem;
}

.task-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-detail-header,
.task-detail-actions,
.task-status-actions,
.task-comment-actions,
.task-handoff-quick,
.task-handoff-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.task-detail-header {
  align-items: flex-start;
  justify-content: space-between;
}

.task-detail-title {
  margin: 0.5rem 0 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.task-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--muted);
  border-radius: var(--radius-lg);
}

.task-detail-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.task-clock-text,
.task-updated-text {
  font-size: 0.875rem;
}

.task-detail-description {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 0.925rem;
}

.task-handoff-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.task-handoff-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.task-handoff-header span {
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

.task-waiting-on-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.task-waiting-on-form .input {
  flex: 1;
  min-width: 0;
}

.task-comments-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.task-comments-list {
  display: flex;
  flex-direction: column;
}

.task-comment-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.task-comment-item:last-child { border-bottom: 0; }

.task-comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.task-comment-body {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 0.875rem;
}

.task-comment-item-actions {
  display: flex;
  gap: 0.4rem;
}

.task-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Developer route ─────────────────────────────────────────────────────── */

.developer-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.developer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.developer-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.developer-desc {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.developer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.developer-card-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.developer-card-copy h3 {
  margin: 0;
  font-size: 1rem;
}

.developer-card-copy p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.developer-log {
  background: oklch(0.145 0 0);
  color: oklch(0.7 0.2 155);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-size: 0.8rem;
  max-height: 24rem;
  overflow-y: auto;
  border: 1px solid oklch(0.22 0 0);
}

.developer-log pre {
  margin: 0;
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 8px 32px oklch(0 0 0 / 20%);
}

.modal-title { font-size: 1.1rem; font-weight: 600; }

.modal form { display: flex; flex-direction: column; gap: 1rem; }

/* .form-field is defined in components.css — gap, flex layout */
.form-field label { font-size: 0.875rem; font-weight: 500; }
.field-optional { font-weight: 400; color: var(--muted-foreground); }
/* Inputs inside form fields use the .input class (components.css) */

.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }

/* ── Claude MCP route ─────────────────────────────────────────────────────── */

.mcp-setup-page {
  padding: 2rem;
}

.mcp-setup-header { margin-bottom: 2rem; }
.mcp-setup-title  { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.4rem; }
.mcp-setup-desc   { font-size: 0.875rem; color: var(--muted-foreground); margin: 0; }

.mcp-setup-section { margin-bottom: 2rem; }
.mcp-setup-section h3 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); margin: 0 0 0.75rem; }
.mcp-section-copy { margin: 0 0 0.875rem; font-size: 0.9rem; color: var(--muted-foreground); line-height: 1.6; }

.mcp-url-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--sidebar-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
}
.mcp-url-box code { flex: 1; font-size: 0.9rem; font-family: monospace; }
.mcp-copy-btn { flex-shrink: 0; font-size: 0.8125rem; padding: 0.3rem 0.75rem; }
.mcp-url-list { display: flex; flex-direction: column; gap: 0.75rem; }

.mcp-callout {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: color-mix(in srgb, var(--sidebar-accent) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mcp-callout strong { font-size: 0.95rem; }
.mcp-callout span { color: var(--muted-foreground); font-size: 0.9rem; line-height: 1.6; }

.mcp-config-card {
  padding: 1rem;
  background: var(--sidebar-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mcp-config-card p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}
.mcp-config-block {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--background);
  border: 1px solid var(--border);
}
.mcp-config-block code {
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

.mcp-steps {
  margin: 0;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.mcp-tools {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mcp-tools li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  background: var(--sidebar-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mcp-tools code { font-size: 0.875rem; font-weight: 600; }
.mcp-tools span { font-size: 0.875rem; color: var(--muted-foreground); }

.mcp-notes {
  padding-left: 1.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ── Voice route ──────────────────────────────────────────────────────────── */

.voice-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.voice-interface {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
}

.voice-status {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  min-height: 1.25rem;
  text-align: center;
}

.voice-orb {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
  cursor: default;
}

.voice-orb[data-mode="idle"] {
  cursor: pointer;
}

.voice-orb[data-mode="idle"]:hover {
  background: var(--primary);
  opacity: 0.8;
}

.voice-orb[data-mode="connecting"] {
  background: var(--muted);
  animation: voice-pulse 1.8s ease-in-out infinite;
}

.voice-orb[data-mode="listening"] {
  background: var(--primary);
  animation: voice-pulse 2.4s ease-in-out infinite;
}

.voice-orb[data-mode="speaking"] {
  background: oklch(0.55 0.18 150);
  animation: voice-pulse 0.8s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, currentColor 30%, transparent); transform: scale(1); }
  50%       { box-shadow: 0 0 0 14px transparent; transform: scale(1.06); }
}

.voice-conversation {
  width: 100%;
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.voice-exchange {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.voice-user-msg {
  align-self: flex-end;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  max-width: 80%;
}

.voice-assistant-msg {
  align-self: flex-start;
  background: var(--muted);
  color: var(--foreground);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  max-width: 80%;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  header { padding: 0 1rem; }
  #messages { padding: 1rem; }
  #chat-form { padding: 0.75rem 1rem; }
  .page { padding: 1rem; }
  .quick-links-grid { grid-template-columns: 1fr; }
  .tasks-layout { grid-template-columns: 1fr; }
  .task-detail-meta { grid-template-columns: 1fr; }
  .developer-card { flex-direction: column; align-items: stretch; }
}
