:root {
  --bg: #ffffff; --fg: #14181b; --muted: #55606a; --line: #d8dee3; --card: #f4f7f8;
  --accent: #0f6b6b; --accent-fg: #ffffff; --accent-soft: #dff0ef; --danger: #a8281f;
  --bubble: #f1f4f5; --bubble-claude: #e3f1f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1214; --fg: #eef2f3; --muted: #a2adb4; --line: #2a3338; --card: #161d20;
    --accent: #4fc3bd; --accent-fg: #06201f; --accent-soft: #14312f; --danger: #ff8a80;
    --bubble: #182024; --bubble-claude: #123130;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1214; --fg: #eef2f3; --muted: #a2adb4; --line: #2a3338; --card: #161d20;
  --accent: #4fc3bd; --accent-fg: #06201f; --accent-soft: #14312f; --danger: #ff8a80;
  --bubble: #182024; --bubble-claude: #123130;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-size: 17px; line-height: 1.45; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input[type=text], input[type=password], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 16px;
  color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; }
label { display: block; font-weight: 600; margin: 0 0 4px; }
.field { margin-bottom: 14px; }
.btn {
  min-height: 44px; min-width: 44px; padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 8px;
}
.btn.primary { color: var(--accent-fg); background: var(--accent); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.error { color: var(--danger); font-weight: 600; margin: 8px 0; }
.muted { color: var(--muted); }
.banner { padding: 10px 14px; background: var(--accent-soft); border-radius: 8px; font-weight: 600; }
.stack > * + * { margin-top: 12px; }

/* shared message content */
.msg-html > :first-child { margin-top: 0; }
.msg-html > :last-child { margin-bottom: 0; }
.msg-html img { max-width: 100%; }
.msg-html pre { overflow-x: auto; background: var(--card); padding: 8px; border-radius: 6px; }
.msg-html table { border-collapse: collapse; display: block; overflow-x: auto; }
.msg-html th, .msg-html td { border: 1px solid var(--line); padding: 4px 8px; }
.thumb { display: block; max-width: 240px; max-height: 240px; border-radius: 8px; border: 1px solid var(--line); }
.file-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.file-link img { width: 32px; height: 32px; }
.badge { display: inline-block; padding: 1px 8px; font-size: .75rem; font-weight: 700; color: var(--accent-fg); background: var(--accent); border-radius: 99px; }
