:root { --bg:#0e0f13; --panel:#171920; --line:#2a2d38; --text:#eceef3; --muted:#9aa0ad; --accent:#ff6fa8; --ok:#3ecf8e; --exp:#f5b942; --na:#6b7080; --danger:#e5484d; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--text); font:15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display:none !important; }
header#top { display:flex; align-items:center; gap:12px; padding:10px 18px; border-bottom:1px solid var(--line); }
.brand { font-weight:800; letter-spacing:.3px; } .brand span { color:var(--accent); }
.who { margin-left:auto; color:var(--muted); }
main { padding:18px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px; max-width:760px; margin:24px auto; }
.card.narrow { max-width:420px; }
h1 { margin:0 0 6px; font-size:22px; } h2 { font-size:16px; margin:22px 0 8px; } h3 { font-size:14px; margin:16px 0 6px; color:var(--muted); }
.muted { color:var(--muted); } .small { font-size:12.5px; } .error { color:var(--danger); min-height:1.2em; }
label { display:block; margin:10px 0; color:var(--muted); font-size:13.5px; }
input, select { width:100%; margin-top:4px; padding:9px 11px; border-radius:9px; border:1px solid var(--line); background:#0f1117; color:var(--text); font:inherit; }
input[type=range], input[type=checkbox] { width:auto; }
button { padding:9px 15px; border-radius:10px; border:0; background:var(--accent); color:#1a0a12; font-weight:700; cursor:pointer; font:inherit; font-weight:700; }
button:disabled { opacity:.4; cursor:default; }
button.ghost { background:transparent; color:var(--muted); border:1px solid var(--line); }
.row { display:flex; gap:10px; flex-wrap:wrap; margin:14px 0; }
.key { font:600 18px ui-monospace, Consolas, monospace; letter-spacing:1px; background:#0f1117; padding:12px; border-radius:9px; word-break:break-all; }
.features { list-style:none; padding:0; margin:0; columns:2; column-gap:22px; }
.features li { break-inside:avoid; padding:4px 0; font-size:13.5px; }
.pill { display:inline-block; min-width:78px; text-align:center; padding:1px 8px; border-radius:99px; font-size:11.5px; font-weight:700; background:#2a2d38; color:var(--muted); }
.pill.working { background:rgba(62,207,142,.15); color:var(--ok); } .pill.experimental { background:rgba(245,185,66,.15); color:var(--exp); } .pill.unavailable { background:rgba(107,112,128,.2); color:var(--na); }

/* room */
#room { display:grid; grid-template-columns: 1fr 340px; grid-template-rows: 1fr auto; gap:12px; height:calc(100vh - 90px); }
#stage { display:flex; flex-direction:column; gap:12px; min-height:0; }
.tile { position:relative; background:#000; border-radius:12px; overflow:hidden; border:1px solid var(--line); }
.tile video { width:100%; height:100%; object-fit:cover; display:block; }
.tile .label { position:absolute; left:8px; bottom:8px; background:rgba(0,0,0,.55); padding:2px 8px; border-radius:6px; font-size:12.5px; }
.tile.sophie { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; background:radial-gradient(ellipse at 50% 35%, #2a1622, #0b0b10 70%); min-height:260px; }
.sophie-face { position:relative; width:180px; height:180px; display:grid; place-items:center; }
.sophie-face .ring { position:absolute; inset:0; border-radius:50%; border:3px solid var(--accent); opacity:.55; transition:transform 60ms linear; }
.sophie-face.talking .ring { opacity:1; box-shadow:0 0 30px rgba(255,111,168,.45); }
.sophie-face .initial { width:150px; height:150px; border-radius:50%; background:linear-gradient(160deg,#ff8fbc,#7a3b9a); display:grid; place-items:center; font-size:64px; font-weight:800; color:#fff; }
.sophie-name { margin-top:14px; font-size:20px; font-weight:800; } .sophie-name .pill { margin-left:8px; vertical-align:middle; }
.caption { max-width:80%; margin-top:14px; text-align:center; font-size:18px; min-height:2.6em; color:#f3e9ef; }
.novideo { position:absolute; top:10px; left:12px; font-size:12px; color:var(--muted); }
.tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px,1fr)); gap:10px; max-height:34vh; overflow:auto; }
.tiles .tile { aspect-ratio:16/9; }
#side { background:var(--panel); border:1px solid var(--line); border-radius:12px; display:flex; flex-direction:column; min-height:0; }
.tabs { display:flex; border-bottom:1px solid var(--line); }
.tabs button { flex:1; background:none; color:var(--muted); border-radius:0; padding:10px; font-weight:600; }
.tabs button.on { color:var(--text); box-shadow:inset 0 -2px 0 var(--accent); }
.tab { flex:1; overflow:auto; padding:12px; display:flex; flex-direction:column; min-height:0; }
.chatlog { flex:1; overflow:auto; font-size:14px; }
.msg { padding:4px 0; } .msg.sys { color:var(--muted); font-style:italic; } .msg.sophie b { color:var(--accent); } .msg.mine b { color:var(--ok); }
.chatform { display:flex; gap:8px; margin-top:8px; } .chatform input { margin:0; }
table.diag { width:100%; border-collapse:collapse; font-size:13px; } table.diag td { padding:4px 2px; border-bottom:1px solid var(--line); } table.diag td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.diaglog { font-size:12.5px; color:var(--muted); } .diaglog div { padding:2px 0; }
.switch { display:flex; gap:8px; align-items:center; color:var(--text); }
#controls { grid-column:1 / -1; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.ctl { width:auto; background:#232633; color:var(--text); margin:0; } .ctl.off { background:#3a2327; color:#ffb4b8; }
select.ctl { max-width:190px; padding:8px; }
.ctl.warn { background:#3b3220; color:var(--exp); } .ctl.danger { background:var(--danger); color:#fff; margin-left:auto; }
.overlay { position:fixed; top:56px; right:370px; background:rgba(0,0,0,.6); padding:4px 10px; border-radius:8px; font-size:12.5px; color:#cfd3dc; pointer-events:none; }
.overlay:empty, body.nodiag .overlay { display:none; }
/* full-screen Sophie: just her, captions and the controls */
body.full header#top, body.full #side, body.full .tiles { display:none; }
body.full main { padding:0; } body.full #room { grid-template-columns:1fr; height:100vh; padding:12px; }
body.full .tile.sophie { border:0; } body.full .caption { font-size:24px; }
@media (max-width: 900px) { #room { grid-template-columns:1fr; height:auto; } #side { min-height:320px; } .features { columns:1; } }
