/* Exstatiq palette (docs/BRAND.md): Obsidian #101410, Electric lime #D6FA8B, Porcelain #F1F4EB, Sage grey #9CA69A */
:root {
  --obsidian: #101410; --lime: #d6fa8b; --porcelain: #f1f4eb; --sage: #9ca69a;
  --bg: var(--porcelain); --fg: var(--obsidian); --muted: #5d665c; --line: #d9ded0; --card: #fbfcf8;
  --field: #ffffff; --bubble: #e7ebdf; --head: var(--obsidian); --head-fg: var(--porcelain);
  --solid: var(--obsidian); --on-solid: var(--porcelain); --mic-fg: var(--lime); --ok: #e9f8c8; --err: #b3261e;
  --font: "Space Grotesk", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--obsidian); --fg: #eef1e8; --muted: var(--sage); --line: #2a3029; --card: #161b16;
    --field: #1b211b; --bubble: #232a22; --head: #1d241c; --head-fg: #eef1e8;
    --solid: var(--lime); --on-solid: var(--obsidian); --mic-fg: var(--obsidian); --ok: #1f2a14; --err: #ff8a80;
  }
}
:root[data-theme="dark"] {
  --bg: var(--obsidian); --fg: #eef1e8; --muted: var(--sage); --line: #2a3029; --card: #161b16;
  --field: #1b211b; --bubble: #232a22; --head: #1d241c; --head-fg: #eef1e8;
  --solid: var(--lime); --on-solid: var(--obsidian); --mic-fg: var(--obsidian); --ok: #1f2a14; --err: #ff8a80;
}
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font); }

.xq-theme { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--fg);
  display: grid; place-items: center; cursor: pointer; }
.xq-theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.xq-theme:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

.xq-widget { width: 100%; max-width: 400px; height: 520px; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px -24px rgb(16 20 16 / .45); }
.xq-widget header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; background: var(--head); color: var(--head-fg); }
.xq-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); flex: none; }
.xq-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xq-live { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--lime); }
.xq-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.xq-log div { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 15px; }
.xq-bot { align-self: flex-start; background: var(--bubble); border-bottom-left-radius: 4px; }
.xq-user { align-self: flex-end; background: var(--solid); color: var(--on-solid); border-bottom-right-radius: 4px; }
.xq-widget footer { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-top: 1px solid var(--line); }
.xq-state { flex: 1; color: var(--muted); font-size: 14px; }
.xq-mic { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: var(--solid); color: var(--mic-fg);
  display: grid; place-items: center; cursor: pointer; transition: box-shadow .2s; }
.xq-mic svg { width: 22px; height: 22px; fill: currentColor; }
.xq-widget[data-state="live"] .xq-mic { box-shadow: 0 0 0 6px color-mix(in srgb, var(--lime) 55%, transparent); animation: xq-pulse 1.6s infinite; }
.xq-widget[data-state="busy"] .xq-mic { opacity: .6; cursor: wait; }
@keyframes xq-pulse { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--lime) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .xq-widget[data-state="live"] .xq-mic { animation: none; } }
.xq-mic:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.xq-by { text-align: center; font-size: 12px; color: var(--muted); padding: 0 0 10px; }
.xq-by b { color: var(--fg); }
