:root { color-scheme: dark; --bg:#0e1621; --panel:#17212b; --text:#f5f5f5; --muted:#a4b1bf; --accent:#6ab3f3; --line:#2b3947; --root-h:100dvh; --root-top:0px; font:15px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); height:var(--root-h); position:relative; top:var(--root-top); display:flex; flex-direction:column; overflow:hidden; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
/* Высоту iframe и safe-area задаёт оболочка. Не дублируем её поля внутри. */
html { height:100%; }
body.embedded { height:100%; top:0; padding:0; }
[hidden] { display:none!important; }
header { display:flex; align-items:center; gap:10px; min-height:56px; padding:6px 12px; background:var(--panel); flex-shrink:0; border-bottom:1px solid var(--line); }
h1 { font-size:18px; margin:0; flex:1; font-weight:600; white-space:nowrap; }
header a { font-size:13px; }
.embedded header { min-height:0; justify-content:flex-end; padding:0 12px; border:0; background:var(--bg); }
.embedded #logout { margin-top:6px; }
a { color:var(--accent); text-decoration:none; min-height:44px; display:inline-flex; align-items:center; }
button,input,select,textarea { font:inherit; color:inherit; border:1px solid var(--line); border-radius:10px; background:var(--panel); min-height:44px; padding:10px 12px; max-width:100%; }
button { cursor:pointer; flex-shrink:0; }
button:disabled { opacity:.5; cursor:default; }
button.primary { color:#0e1621; background:var(--accent); border-color:var(--accent); font-weight:600; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
input,textarea { width:100%; font-size:16px; }
textarea { resize:none; min-height:70px; max-height:25dvh; }
label { display:flex; flex-direction:column; gap:5px; min-width:0; font-size:13px; color:var(--muted); }
#notice { margin:0; padding:8px 14px; color:var(--muted); flex-shrink:0; overflow-wrap:anywhere; }
#notice:empty { display:none; }
#notice.error { color:#ffb1b1; }
#login-view { overflow-y:auto; padding:24px 14px; }
.card { display:grid; gap:18px; max-width:420px; margin:auto; padding:22px; border:1px solid var(--line); border-radius:16px; background:var(--panel); }
h2 { margin:0; font-size:19px; font-weight:500; }
#chat-view { display:flex; flex-direction:column; flex:1; min-height:0; width:100%; max-width:900px; margin:auto; }
#feed { overflow-y:auto; flex:1; min-height:0; padding:14px; overscroll-behavior:contain; }
#empty { color:var(--muted); text-align:center; margin:30px 0; }
.turn { margin:0 0 18px; overflow-wrap:anywhere; }
.turn .question,.turn .answer { white-space:pre-wrap; margin:6px 0; border-radius:12px; padding:12px; }
.turn .question { background:#20364b; margin-left:24px; }
.turn .answer { background:var(--panel); margin-right:12px; }
.turn .meta { color:var(--muted); font-size:12px; padding:0 4px; }
.turn .error { color:#ffb1b1; white-space:pre-wrap; }
#composer { padding:10px 14px; border-top:1px solid var(--line); background:var(--bg); flex-shrink:0; }
.selection { display:flex; align-items:end; gap:8px; margin-bottom:8px; }
.selection label:first-child { flex:1; }
.selection label { min-width:0; }
select { width:100%; padding:10px 5px; font-size:13px; }
.message-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.compose-actions { display:flex; align-items:center; gap:8px; margin-top:8px; }
#activity { flex:1; color:var(--muted); font-size:12px; min-width:0; overflow-wrap:anywhere; }
@media(max-width:760px) { .compose-actions { flex-wrap:wrap; justify-content:flex-end; } .compose-actions #activity { flex-basis:100%; } .compose-actions #activity:empty { display:none; } }
@media(max-width:360px) { header { gap:6px; padding:6px 8px; } header a { font-size:12px; } #composer,#feed { padding:10px; } #effort-label { max-width:100px; } .card { padding:16px; } }
