:root { --bg: #0b0f17; --panel: #141a27; --line: rgba(255,255,255,.1); --text: #e8ecf4; --muted: #9aa5bb; --acc: #6b5cff; --user: #2a3350; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; background: #1d2536; border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer; }
button.primary { background: var(--acc); color: #fff; }
button.link { background: none; color: var(--muted); text-decoration: underline; padding: 6px; }
button.danger { color: #ff8a8a; }
input, textarea { font: inherit; color: var(--text); background: #0e1320; border: 1px solid var(--line); border-radius: 12px; padding: 12px; width: 100%; }
.muted { color: var(--muted); }
#auth { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; } .brand img { width: 40px; height: 40px; border-radius: 10px; }
.tabs { display: flex; gap: 6px; margin: 14px 0; } .tabs button { flex: 1; } .tabs button.on { background: var(--acc); color: #fff; }
form { display: grid; gap: 10px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); } .consent input { width: auto; margin-top: 3px; }
.err { color: #ff8a8a; min-height: 22px; margin-top: 10px; font-size: 14px; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 10px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
header .title { flex: 1; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#drawer { position: absolute; top: calc(env(safe-area-inset-top) + 54px); left: 0; bottom: 0; width: min(320px, 86vw); background: var(--panel); border-right: 1px solid var(--line); z-index: 5; display: flex; flex-direction: column; }
.dhead { padding: 12px 14px; font-weight: 600; } #convList { flex: 1; overflow: auto; } #convList button { display: block; width: 100%; text-align: left; background: none; border-radius: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dfoot { display: grid; padding: 10px; padding-bottom: calc(env(safe-area-inset-bottom) + 10px); }
main#msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--user); border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.bot .acts { display: flex; gap: 4px; margin-top: 6px; } .msg.bot .acts button { padding: 4px 10px; font-size: 13px; background: #1d2536; }
.msg.bot .acts button.on { background: #5b2a2a; }
.msg .src { margin-top: 6px; font-size: 12px; } .msg .src a { color: #9db4ff; margin-right: 8px; }
.stage { color: var(--muted); font-size: 13px; font-style: italic; }
.welcome { margin: auto; text-align: center; color: var(--muted); padding: 20px; } .welcome img { width: 64px; border-radius: 16px; }
#banner { margin: 0 12px 8px; padding: 10px 12px; border-radius: 12px; background: #2b2410; color: #ffd98a; font-size: 14px; }
footer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px); border-top: 1px solid var(--line); background: var(--bg); }
footer textarea { resize: none; max-height: 140px; border-radius: 20px; padding: 10px 14px; }
#sendBtn { border-radius: 50%; width: 44px; height: 44px; padding: 0; background: var(--acc); color: #fff; flex: none; }
.hold { border-radius: 50%; width: 44px; height: 44px; padding: 0; flex: none; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold.rec { background: #c0392b; transform: scale(1.12); }
.flagbox { display: flex; gap: 6px; margin-top: 6px; } .flagbox input { padding: 8px; font-size: 14px; }
#tour { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: end center; z-index: 20; padding: 16px; padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
.tcard { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.tcard h3 { margin: 0 0 6px; } .trow { display: flex; justify-content: space-between; margin-top: 12px; }

/* v0.9.134 answer & voice mode buttons */
#modes { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px 0; justify-content: center; }
.seg { display: flex; background: #0e1320; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border-radius: 0; background: none; padding: 6px 10px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--acc); color: #fff; }
.hold.dict { background: #1d2536; } .hold.dict.rec { background: #c0392b; }
/* v0.9.143 private chats */
#lock { min-height: 100%; display: grid; place-items: center; padding: 20px; }
#lock form { display: grid; gap: 10px; margin-top: 8px; }
#privAsk { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: end center; z-index: 21; padding: 16px; padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
#privAsk input { margin: 8px 0; }
#segPin button { flex: 1; padding: 9px 10px; }
.privnote { font-size: 13px; line-height: 1.45; color: var(--muted); background: #0e1320; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.privnote b { color: inherit; }
