/* The phone edition: the Talk tab, the key sheet, settings. Everything else is the interface's own stylesheet. */
body{padding-bottom:env(safe-area-inset-bottom)}
#nav{position:sticky;top:0;z-index:5;background:var(--bg);padding-top:env(safe-area-inset-top)}
.talkwrap{display:flex;flex-direction:column;min-height:calc(100vh - 140px);min-height:calc(100dvh - 140px)}
.talkhead{display:flex;justify-content:space-between;align-items:center;margin:4px 0 8px}
.talkbtns{display:flex;gap:6px}
.tb{border:1px solid var(--line);background:var(--surface);color:var(--fg);border-radius:999px;padding:7px 12px;font:inherit;font-size:14px;cursor:pointer;min-height:36px}
.tb.send{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);width:44px;height:44px;padding:0;font-size:20px;border-radius:50%;flex:none}
.tb.send:disabled{opacity:.5}
.tb.mic{width:44px;height:44px;padding:0;border-radius:50%;flex:none;font-size:18px}
.tb.mic.on{background:var(--hot,#c0392b);color:#fff;border-color:transparent}
.chatlog{flex:1;overflow:auto;display:flex;flex-direction:column;gap:10px;padding:4px 0 12px;-webkit-overflow-scrolling:touch}
.cb{max-width:88%;padding:12px 14px;border-radius:18px;line-height:1.5;font-size:16.5px;word-wrap:break-word}
.cb p{margin:0 0 10px}.cb p:last-child{margin:0}
.cb blockquote{margin:6px 0;padding:4px 10px;border-left:3px solid var(--accent);color:var(--muted)}
.cb.u{align-self:flex-end;background:var(--accent);color:var(--accent-ink);border-bottom-right-radius:6px}
.cb.a{align-self:flex-start;background:var(--surface);border:1px solid var(--line);border-bottom-left-radius:6px}
.cb.err{border-color:var(--hot,#c0392b);color:var(--hot,#c0392b)}
.dots i{display:inline-block;width:7px;height:7px;margin:0 2px;border-radius:50%;background:var(--faint);animation:dot 1.2s infinite}
.dots i:nth-child(2){animation-delay:.2s}.dots i:nth-child(3){animation-delay:.4s}
@keyframes dot{0%,80%,100%{opacity:.3}40%{opacity:1}}
.chatbar{position:sticky;bottom:0;display:flex;gap:8px;align-items:flex-end;padding:8px 0 calc(8px + env(safe-area-inset-bottom));background:var(--bg)}
.chatbar textarea{flex:1;resize:none;border:1px solid var(--line);border-radius:22px;padding:11px 14px;font:inherit;font-size:16px;line-height:1.4;background:var(--surface);color:var(--fg);max-height:160px;min-height:44px}
.chatbar textarea:focus{outline:2px solid var(--accent);outline-offset:1px}
.sheet[hidden]{display:none}
.sheet{position:fixed;inset:0;background:rgba(29,26,57,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center;padding:12px}
.sheetcard{background:var(--surface);border-radius:22px;padding:22px 20px calc(22px + env(safe-area-inset-bottom));max-width:520px;width:100%;max-height:92vh;overflow:auto;box-shadow:0 12px 40px rgba(0,0,0,.18)}
.sheetcard h2{margin:4px 0 10px}
.sheetcard p{font-size:16px;line-height:1.5}
.sheetcard input,.sheetcard select{width:100%;box-sizing:border-box;font:inherit;font-size:16px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--fg);margin:6px 0 10px}
.pk-row{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0}
.pk-msg{min-height:1.4em;color:var(--accent);font-weight:600}
.small{font-size:13.5px;color:var(--muted)}
/* one row of tabs that scrolls sideways, instead of three rows */
#nav{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:4px;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:6px}
#nav::-webkit-scrollbar{display:none}
#nav button{flex:none;white-space:nowrap}

.keywarn{background:var(--surface);border:1px solid var(--accent);border-radius:14px;padding:12px 14px;margin:0 0 10px;font-size:15px;line-height:1.45}
.keywarn b{display:block;margin-bottom:4px}
.keywarn .pk-row{margin-top:8px}
.keywarn .tb{font-size:13.5px}
