:root { color-scheme: light dark; --bg: #f6f7f9; --card: #fff; --fg: #111827; --dim: #6b7280; --line: #d9dde3; --me: #dbeafe; --accent: #1d4ed8; --bad: #b91c1c; --good: #15803d; }
@media (prefers-color-scheme: dark) { :root { --bg: #0f1218; --card: #181d26; --fg: #e5e7eb; --dim: #9ca3af; --line: #2c3340; --me: #1e3a5f; --accent: #60a5fa; --bad: #f87171; --good: #4ade80; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 42px; }
button { cursor: pointer; }
#login { max-width: 340px; margin: 0 auto; padding: 48px 20px; }
#login form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
#app { display: flex; flex-direction: column; height: 100%; height: 100dvh; max-width: 800px; margin: 0 auto; }
header { display: flex; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; border-bottom: 1px solid var(--line); }
header select { flex: 1; min-width: 0; }
header button { padding: 8px; font-size: 14px; white-space: nowrap; }
#mode.auto { color: var(--bad); border-color: var(--bad); font-weight: 600; }
#log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
#log > * { flex-shrink: 0; }
.me { align-self: flex-end; max-width: 85%; background: var(--me); border-radius: 14px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.text p { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre { margin: 6px 0; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.tool { color: var(--dim); font-size: 14px; }
.tool summary { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool.failed summary { color: var(--bad); }
pre.removed { border-left: 4px solid var(--bad); }
pre.added { border-left: 4px solid var(--good); }
.error { color: var(--bad); white-space: pre-wrap; overflow-wrap: anywhere; }
.record { border-left: 3px solid var(--accent); padding-left: 10px; font-size: 14px; }
.record .a { color: var(--accent); white-space: pre-wrap; }
#askBox { border-top: 2px solid var(--accent); background: var(--card); padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 65%; overflow-y: auto; }
#askBox > * { flex-shrink: 0; }
#askBox .q { font-weight: 600; white-space: pre-wrap; }
#askBox .note { color: var(--dim); font-size: 14px; }
#askBox .choice { text-align: left; }
#askBox form, #askBox .row { display: flex; gap: 8px; }
#askBox form input, #askBox .row button { flex: 1; min-width: 0; }
button.allow { background: var(--good); color: var(--bg); border-color: var(--good); }
button.deny { color: var(--bad); border-color: var(--bad); }
footer { border-top: 1px solid var(--line); padding: 4px 8px calc(8px + env(safe-area-inset-bottom)); }
#status { min-height: 20px; font-size: 13px; color: var(--dim); }
#composer { display: flex; gap: 6px; align-items: flex-end; }
#text { flex: 1; min-width: 0; resize: none; }
/* voice mode */
.voice { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.voice-bar { display: flex; align-items: center; gap: 8px; }
.voice-mic { border-radius: 999px; white-space: nowrap; }
.voice-mic.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.voice-mic.on.listening { animation: voice-pulse 1.4s ease-in-out infinite; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent); } 50% { box-shadow: 0 0 0 4px transparent; } }
.voice-status { flex: 1; min-width: 0; font-size: 13px; color: var(--dim); }
.voice-bar select, .voice-hush { font-size: 12px; max-width: 110px; }
.voice-held { display: flex; gap: 8px; flex-wrap: wrap; border: 1px solid var(--accent); border-radius: 10px; padding: 8px 10px; font-size: 14px; max-height: 40vh; overflow-y: auto; }
.voice-held .what { flex: 1 1 100%; overflow-wrap: anywhere; }
.voice-held .go { background: var(--accent); color: var(--bg); border-color: var(--accent); }
