:root { --bg:#0f1420; --card:#182234; --ink:#e7ecf3; --muted:#93a1b5; --line:#2a3852;
        --accent:#4f8cff; --danger:#e0533d; --tag:#22314c; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink);
       font:15px/1.5 -apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif; }
header { display:flex; align-items:center; gap:20px; padding:12px 24px;
         border-bottom:1px solid var(--line); background:#111a29; position:sticky; top:0; }
.brand { font-weight:700; text-decoration:none; color:var(--ink); }
nav a { color:var(--muted); text-decoration:none; margin-left:12px; }
main { max-width:820px; margin:0 auto; padding:24px; }
h1 { font-size:22px; margin:8px 0 16px; } h2 { font-size:16px; margin:26px 0 8px; color:var(--muted); }
h3 { font-size:14px; margin:0 0 10px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
a { color:var(--accent); }
.muted { color:var(--muted); } .err { color:var(--danger); }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin:14px 0; }
.row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:8px; }
input, select, textarea { background:#0e1728; color:var(--ink); border:1px solid var(--line);
       border-radius:7px; padding:9px 10px; font:inherit; }
input { flex:1; min-width:140px; } textarea { width:100%; }
.addjob input[name=url] { width:100%; }
button { background:var(--accent); color:#fff; border:0; border-radius:7px; padding:9px 14px;
         font:inherit; font-weight:600; cursor:pointer; }
button.danger { background:var(--danger); }
table.pipeline { width:100%; border-collapse:collapse; }
.pipeline th { text-align:left; color:var(--muted); font-weight:600; font-size:12px; padding:6px 8px; border-bottom:1px solid var(--line); }
.pipeline td { padding:8px; border-bottom:1px solid var(--line); }
.tag { background:var(--tag); border-radius:20px; padding:2px 10px; font-size:12px; white-space:nowrap; }
.tag.full { background:#4a2a1f; color:#ffcf6b; }
.tag.v-apply { background:#1e4d2b; color:#9ef0b0; } .tag.v-apply-with-caveat { background:#3f3a1a; color:#ffe08a; }
.tag.v-park { background:#3a2a2a; color:#f0a0a0; } .tag.v-none { color:var(--muted); }
table.queue td { vertical-align:top; font-size:13px; } table.queue td.q { max-width:260px; color:var(--muted); }
.strip { padding:10px 14px; } .strip h3 { margin-bottom:6px; } .strip h3 a { text-decoration:none; }
.striprow { font-size:13px; padding:3px 0; border-top:1px solid var(--line); }
.today ul, .docs, .acts { margin:6px 0 0; padding-left:18px; }
.acts { list-style:none; padding:0; } .acts li { padding:4px 0; border-bottom:1px solid var(--line); font-size:13px; }
.result { margin-top:14px; border-top:1px solid var(--line); padding-top:12px; }
.gate { color:#ffcf6b; } .shot { max-width:100%; border:1px solid var(--line); border-radius:8px; margin-top:10px; }
code { background:#0e1728; padding:1px 5px; border-radius:4px; font-size:12px; }

/* chat terminal */
main.chat { padding-bottom:96px; }
#chat { display:flex; flex-direction:column; gap:12px; padding:8px 0; }
.msg { display:flex; }
.msg.user { justify-content:flex-end; }
.bubble { max-width:82%; padding:10px 14px; border-radius:13px; white-space:pre-wrap; word-wrap:break-word; }
.msg.user .bubble { background:var(--accent); color:#fff; border-bottom-right-radius:3px; }
.msg.assistant .bubble { background:var(--card); border:1px solid var(--line); border-bottom-left-radius:3px; }
/* live progress while the agent works (chat.html progress()) */
.bubble.working { min-width:260px; position:relative; padding-right:56px; }
.bubble.working .p-status { opacity:.85; }
.bubble.working .p-status:empty { display:none; }
.bubble.working .p-status::after { content:'…'; display:inline-block; width:1.2em; text-align:left;
  animation:p-dots 1.2s steps(4,end) infinite; }
@keyframes p-dots { 0%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} }
.p-steps { list-style:none; margin:6px 0 0; padding:0; font-size:.92em; }
.p-steps li { padding:2px 0 2px 18px; position:relative; opacity:.75; }
.p-steps li::before { content:'✓'; position:absolute; left:0; color:var(--accent); }
.p-steps li.running { opacity:1; }
.p-steps li.running::before { content:''; width:9px; height:9px; border:2px solid var(--accent); border-top-color:transparent;
  border-radius:50%; top:.45em; animation:p-spin .8s linear infinite; }
@keyframes p-spin { to { transform:rotate(360deg); } }
.p-clock { position:absolute; right:12px; top:9px; font-size:.8em; opacity:.55; font-variant-numeric:tabular-nums; }
.p-trace { margin-top:8px; font-size:.85em; opacity:.7; }
.p-trace summary { cursor:pointer; }
.p-trace .p-steps li.running::before { content:'✓'; border:0; animation:none; width:auto; height:auto; }
/* picker (ask_user): recommended first, Defer last, "Something else" opens the box */
.picker { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.picker .pick { text-align:left; padding:8px 12px; border:1px solid var(--line); border-radius:9px;
  background:transparent; color:inherit; cursor:pointer; font:inherit; display:flex; flex-direction:column; gap:2px; }
.picker .pick:hover:not(:disabled) { border-color:var(--accent); }
.picker .pick.rec { border-color:var(--accent); }
.picker .pick .lab { font-weight:600; }
.picker .pick .desc { font-size:.88em; opacity:.7; }
.picker .pick.defer, .picker .pick.other { opacity:.7; font-size:.92em; }
.picker .pick.other { border-style:dashed; }
.picker.chosen .pick { opacity:.35; cursor:default; }
.picker.chosen .pick.picked { opacity:1; border-color:var(--accent); background:rgba(127,127,255,.08); }
/* the watchable browser: noVNC of this user's own virtual display, inside the bubble */
.browserpanel { margin-top:10px; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#0c1320; }
.bp-bar { display:flex; align-items:center; gap:8px; padding:6px 10px; background:#111a29; border-bottom:1px solid var(--line);
  font-size:.86em; }
.bp-dot { width:8px; height:8px; border-radius:50%; background:#3ddc84; flex:none; animation:bp-pulse 1.6s ease-in-out infinite; }
@keyframes bp-pulse { 50% { opacity:.35; } }
.bp-title { flex:1; opacity:.85; }
.bp-pop { font:inherit; font-size:.92em; padding:2px 8px; border-radius:6px; border:1px solid var(--line);
  background:transparent; color:inherit; cursor:pointer; }
.bp-pop:hover { border-color:var(--accent); }
.bp-frame { display:block; width:100%; height:460px; border:0; background:#0c1320; }
@media (max-width:600px) { .bp-frame { height:320px; } }
/* suggestion chips: latest reply only, fill the box, never auto-send */
.chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:10px; padding-top:8px;
  border-top:1px dashed var(--line); }
.chips .lead { font-size:.82em; opacity:.6; margin-right:2px; }
.chips .chip { font:inherit; font-size:.86em; padding:4px 10px; border-radius:999px; border:1px solid var(--line);
  background:transparent; color:inherit; cursor:pointer; opacity:.85; }
.chips .chip:hover { border-color:var(--accent); opacity:1; }
#f { position:fixed; bottom:0; left:0; right:0; display:flex; gap:8px; justify-content:center;
     padding:12px 24px; background:#111a29; border-top:1px solid var(--line); }
#f .inner { display:flex; gap:8px; width:100%; max-width:820px; }
#f input { flex:1; }
