:root { --bg:#0b0e14; --panel:#12161f; --panel2:#171c28; --text:#e6e9ef; --muted:#9aa3b2; --accent:#38bdf8; --green:#34d399; --amber:#fbbf24; --red:#f87171; --border:#232a38; }
* { box-sizing:border-box; }
html,body { margin:0; padding:0; background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; font-size:16px; }
a { color:var(--accent); }
button { background:var(--panel2); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:8px 12px; cursor:pointer; font-size:14px; }
button:hover { border-color:var(--accent); }
input,textarea,select { background:var(--panel2); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:10px 12px; font-size:15px; width:100%; }
input:focus,textarea:focus,select:focus { outline:2px solid var(--accent); border-color:var(--accent); }
code { background:#0a0d13; padding:1px 5px; border-radius:4px; font-size:13px; }

#topbar { display:flex; gap:8px; align-items:center; padding:10px; position:sticky; top:0; background:var(--bg); z-index:10; border-bottom:1px solid var(--border); }
.wordmark { font-weight:800; letter-spacing:2px; color:var(--accent); white-space:nowrap; font-size:15px; }
#cmd-form { display:flex; gap:6px; flex:1; }
#cmd-input { flex:1; }
#cmd-go { background:var(--accent); color:#04121d; font-weight:700; border:none; }
#voice-btn { font-size:18px; padding:6px 10px; }
#mirror-toggle { white-space:nowrap; }

#tabbar { display:flex; gap:6px; padding:8px 10px 0; overflow-x:auto; }
#tabs { display:flex; gap:6px; overflow-x:auto; flex:1; }
.tab { display:flex; gap:6px; align-items:center; background:var(--panel); border:1px solid var(--border); border-radius:8px 8px 0 0; padding:6px 10px; white-space:nowrap; max-width:180px; overflow:hidden; cursor:pointer; }
.tab.active { background:var(--panel2); border-bottom-color:var(--accent); }
.tab .close { padding:0 4px; border:none; background:none; color:var(--muted); }
#new-tab { border-radius:8px 8px 0 0; }

#chips { display:flex; gap:6px; padding:8px 10px; overflow-x:auto; border-bottom:1px solid var(--border); }
#chips button { white-space:nowrap; }

#main { display:flex; min-height:55vh; }
#browser-pane { flex:1; display:flex; flex-direction:column; min-width:0; }
#browser-pane.split { flex:1; }
#browser-toolbar { display:flex; gap:6px; align-items:center; padding:8px 10px; }
#browser-toolbar button { padding:6px 10px; }
#browser-status { color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.spacer { flex:1; }
#browser-frame, #mirror-frame { flex:1; width:100%; min-height:52vh; border:none; background:#fff; }
#home { padding:24px 18px; max-width:640px; }
#home h1 { margin:0 0 8px; font-size:28px; }
#home p { color:var(--muted); line-height:1.5; }
#home-quick { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.fine { color:var(--muted); font-size:13px; line-height:1.5; }
#answer { padding:14px 18px; border-bottom:1px solid var(--border); background:var(--panel); line-height:1.55; }
#answer h2 { margin:0 0 6px; font-size:18px; }
#answer .sources { margin-top:10px; font-size:13px; color:var(--muted); }
#frame-blocked { padding:18px; background:var(--panel); }

#mirror-pane { flex:1; display:flex; flex-direction:column; min-width:0; border-left:1px solid var(--border); background:#000; }
#mirror-toolbar { display:flex; gap:8px; align-items:center; padding:8px 10px; background:var(--panel); }
.health { font-weight:700; padding:4px 10px; border-radius:6px; font-size:13px; }
.health.live { background:#052e1b; color:var(--green); }
.health.stale { background:#3a2a05; color:var(--amber); }
.health.offline { background:#3a0d0d; color:var(--red); }
.health.unknown { background:var(--panel2); color:var(--muted); }
#mirror-age { color:var(--muted); font-size:13px; }
#mirror-offpixel { padding:16px; background:var(--panel); }
.big-btn { display:block; text-align:center; background:var(--accent); color:#04121d; font-weight:800; padding:14px; text-decoration:none; font-size:17px; }
#mirror-pane .fine { padding:8px 12px; }

#panels { padding:0 10px 16px; }
#panels details { background:var(--panel); border:1px solid var(--border); border-radius:10px; margin-top:10px; }
#panels summary { padding:12px; cursor:pointer; font-weight:700; }
.panel-body { padding:0 12px 14px; }
.panel-body textarea { margin-bottom:8px; }
.row { display:flex; gap:8px; align-items:end; }
.row label { flex:1; }
#build-result { margin-top:10px; line-height:1.55; }
#build-result .fix { background:var(--panel2); border:1px solid var(--border); border-radius:8px; padding:12px; margin-top:8px; }
#checklist { list-style:none; padding:0; }
#checklist li { padding:10px 0; border-top:1px solid var(--border); }
.ck-status { font-weight:700; }
.ck-status.ok { color:var(--green); } .ck-status.bad { color:var(--red); } .ck-status.warn { color:var(--amber); }
.ck-cmd { display:block; color:var(--muted); font-size:13px; margin-top:4px; }
#history-list { list-style:none; padding:0; }
#history-list li { padding:6px 0; border-top:1px solid var(--border); font-size:14px; word-break:break-all; }
#history-list .h-meta { color:var(--muted); font-size:12px; }
#status-body table { border-collapse:collapse; width:100%; font-size:14px; }
#status-body td, #status-body th { border-top:1px solid var(--border); padding:8px 4px; text-align:left; vertical-align:top; }
#status-body td:first-child { font-weight:700; white-space:nowrap; padding-right:12px; }

footer { display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between; padding:14px; border-top:1px solid var(--border); color:var(--muted); font-size:13px; }
@media (max-width:700px) {
  #main { flex-direction:column; }
  #mirror-pane { border-left:none; border-top:1px solid var(--border); }
  .wordmark { display:none; }
}
