:root { --bg:#0f1115; --panel:#171a21; --line:#2a2f3a; --fg:#e6e8ee; --muted:#8b93a7; --accent:#6ea8fe; --danger:#ff6b6b; --ok:#57d39b; }
* { box-sizing:border-box; }
html,body { margin:0; height:100%; overflow:hidden; overscroll-behavior:none; background:var(--bg); color:var(--fg); font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; }
.hidden { display:none !important; }
.muted { color:var(--muted); } .small { font-size:12px; } .error { color:var(--danger); min-height:1em; }
.spacer { flex:1; }
button, .button, input, select, textarea { font:inherit; color:inherit; }
button, .button { background:#242938; border:1px solid var(--line); border-radius:6px; padding:6px 12px; cursor:pointer; text-decoration:none; display:inline-block; }
button:hover, .button:hover { border-color:var(--accent); }
button.danger { color:var(--danger); } button.link { background:none; border:none; color:var(--muted); padding:0; }
button.small, .button.small { padding:3px 8px; font-size:12px; }
input, select, textarea { background:#0c0e12; border:1px solid var(--line); border-radius:6px; padding:6px 8px; }
label { display:flex; flex-direction:column; gap:4px; }
.controls label { flex-direction:row; align-items:center; gap:6px; }
code { background:#0c0e12; padding:1px 4px; border-radius:4px; }

.screen { height:100%; }
#login { display:flex; align-items:center; justify-content:center; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:28px; width:320px; display:flex; flex-direction:column; gap:12px; }
.card h1 { margin:0 0 8px; font-size:20px; }

#app { display:grid; grid-template-columns:240px 1fr; height:100%; }
#sidebar { background:var(--panel); border-right:1px solid var(--line); display:flex; flex-direction:column; }
.side-head { display:flex; justify-content:space-between; align-items:center; padding:12px; border-bottom:1px solid var(--line); }
/* the footer: who you are on one line, then the menu as a two-column grid
   with sign out on a rule of its own, so nothing has to share a line by luck */
.side-foot { padding:10px 8px 8px; border-top:1px solid var(--line); margin-top:auto; }
.foot-user { display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:0 6px 8px; }
.foot-user #who { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.foot-links { display:grid; grid-template-columns:1fr 1fr; gap:1px 4px; }
.foot-links button.link { text-align:left; padding:5px 6px; border-radius:5px; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.foot-links button.link:hover { background:#20242e; color:var(--fg); }
.foot-links button.sign-out { grid-column:1/-1; margin-top:5px; padding-top:7px; border-top:1px solid var(--line); border-radius:0; }
#ws-list { list-style:none; margin:0; padding:6px; overflow:auto; }
#ws-list li { padding:8px 4px 8px 10px; border-radius:6px; cursor:pointer; display:flex; align-items:center; gap:6px; }
#ws-list .ws-info { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#ws-list .ws-menu { font-size:16px; padding:0 6px; line-height:1; visibility:hidden; }
#ws-list li:hover .ws-menu, #ws-list li.active .ws-menu { visibility:visible; }
.popmenu { position:fixed; z-index:40; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:4px; display:flex; flex-direction:column; min-width:132px; box-shadow:0 6px 20px rgba(0,0,0,.5); }
.popmenu button { background:none; border:none; text-align:left; padding:6px 10px; border-radius:4px; }
.popmenu button:hover { background:#243049; }
#ws-list li:hover { background:#20242e; } #ws-list li.active { background:#243049; }
#ws-list li .muted { display:block; font-size:11px; }
/* a turn is running in this workspace (GET /api/events): a pulsing dot before the ⋯ */
#ws-list li .busy-dot { display:none; width:8px; height:8px; border-radius:50%; background:var(--accent); flex-shrink:0; animation:pulse 1.4s ease-in-out infinite; }
#ws-list li.running .busy-dot { display:inline-block; }
@keyframes pulse { 0%,100% { opacity:.35 } 50% { opacity:1 } }

#main { display:flex; flex-direction:column; height:100%; overflow:hidden; }
#empty-state { margin:auto; color:var(--muted); }
#workspace { display:flex; flex-direction:column; height:100%; }
#ws-head { position:relative; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 16px; border-bottom:1px solid var(--line); flex-shrink:0; }
#ws-head h2 { margin:0; font-size:18px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
#ws-meta { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; flex-shrink:1; }
button.icon { padding:2px 10px; font-size:18px; line-height:1.2; flex-shrink:0; }
.popmenu.anchored { position:absolute; right:12px; top:calc(100% - 4px); }
.popmenu a.button { background:none; border:none; text-align:left; padding:6px 10px; border-radius:4px; display:block; }
.popmenu a.button:hover { background:#243049; }

#panes { display:grid; grid-template-columns:1fr 340px; flex:1; min-height:0; }
#chat-pane { display:flex; flex-direction:column; min-height:0; border-right:1px solid var(--line); }
#chat { flex:1; overflow:auto; padding:16px; display:flex; flex-direction:column; gap:12px; }
.msg { max-width:100%; min-width:0; }
/* Grid and flex children default to min-width:auto, so one unbreakable token (a URL, a path, a hash)
   in a message would widen #chat-pane past the viewport; #main clips the overflow, so it cannot be scrolled to.
   Let the panes shrink to the viewport and break long tokens instead. */
#main, #workspace, #panes, #chat-pane, #live-pane, #files-pane, #live-transcript-col, #live-answers-col, #chat, .answer-block, .ws-title { min-width:0; }
#chat, #live-transcript, .answer, #wrap-body, #viewer-body, #empty-state { overflow-wrap:anywhere; word-break:break-word; }
.msg.assistant .body img { max-width:100%; }
.msg.user { align-self:flex-end; background:#243049; padding:8px 12px; border-radius:10px; white-space:pre-wrap; max-width:80%; }
.msg.assistant { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:10px 14px; }
.msg.assistant .body :is(p,ul,ol,pre) { margin:6px 0; }
.msg.assistant pre { background:#0c0e12; padding:8px; border-radius:6px; overflow:auto; }
.msg .meta { color:var(--muted); font-size:11px; margin-top:6px; }

/* markdown tables (chat replies, the wrap-up, .md files in the viewer).
   md() wraps every table in .table-wrap: the wrapper scrolls, the table keeps
   its own layout, and min-width keeps it a grid rather than one word per line
   on a phone. Cells wrap, so a long sentence in a cell does not force a
   sideways scroll on the desktop. */
.table-wrap { overflow-x:auto; margin:10px 0; border:1px solid var(--line); border-radius:8px; }
.table-wrap table { border-collapse:collapse; width:100%; min-width:480px; font-size:13px; background:#12151c; }
/* #chat breaks long tokens anywhere so a URL cannot widen the pane; in a cell that
   chops ordinary words into a column one letter wide. The wrapper scrolls instead. */
.table-wrap :is(th,td) { padding:7px 10px; vertical-align:top; overflow-wrap:normal; word-break:normal; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.table-wrap :is(th,td):not([align]) { text-align:left; }  /* marked puts GFM :---: alignment in an align attribute */
.table-wrap :is(th,td):last-child { border-right:none; }
.table-wrap tr:last-child td { border-bottom:none; }
.table-wrap th { background:#1d2230; font-weight:600; color:var(--fg); white-space:nowrap; }
.table-wrap tbody tr:nth-child(even) { background:rgba(255,255,255,.025); }
.table-wrap td code { background:#0c0e12; }
.tools { font-size:12px; color:var(--muted); margin-bottom:6px; }
.tools summary { cursor:pointer; }
.tools li { font-family:ui-monospace,monospace; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tools li.ok::before { content:"✓ "; color:var(--ok); } .tools li.fail::before { content:"✗ "; color:var(--danger); } .tools li.pending::before { content:"… "; }
.msg.assistant .parts .tools { margin:6px 0; }
.status { color:var(--muted); font-size:12px; font-style:italic; }
.changed { font-size:12px; color:var(--ok); }
.msg.error { color:var(--danger); }
#prompt-form { display:flex; gap:8px; padding:12px 16px; border-top:1px solid var(--line); }
#prompt { flex:1; resize:vertical; }
.send-col { display:flex; flex-direction:column; gap:6px; }

#files-pane { display:flex; flex-direction:column; min-height:0; }
.pane-head { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); }
.drop { margin:10px 12px; padding:14px; border:1px dashed var(--line); border-radius:8px; text-align:center; color:var(--muted); font-size:12px; }
.drop.over { border-color:var(--accent); color:var(--fg); }
#file-list { list-style:none; margin:0; padding:0 8px 12px; overflow:auto; font-size:13px; }
#file-list li { padding:3px 6px; border-radius:4px; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#file-list li:hover { background:#20242e; }
#file-list li.dir { color:var(--muted); cursor:default; }
#file-list li.changed { color:var(--ok); }
#file-list li .size { color:var(--muted); font-size:11px; margin-left:6px; }

.modal { position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; padding:24px; }
.modal-box { background:var(--panel); border:1px solid var(--line); border-radius:10px; width:min(1000px,100%); height:min(85vh,100%); display:flex; flex-direction:column; gap:10px; padding:16px; }
.modal-box.narrow { width:420px; height:auto; }
.modal-head { display:flex; align-items:center; gap:8px; }
#viewer-body { flex:1; overflow:auto; background:#0c0e12; border-radius:6px; padding:12px; }
#viewer-body pre { white-space:pre-wrap; margin:0; }
#viewer-body img { max-width:100%; }
#viewer-editor { flex:1; resize:none; font-family:ui-monospace,monospace; }
.row { display:flex; justify-content:flex-end; gap:8px; }
.mobile-only { display:none !important; }
.ws-title { display:flex; align-items:center; gap:8px; flex:1; min-width:0; }
.tabs { flex-shrink:0; } .tab { white-space:nowrap; }
.chat-bar { flex-shrink:0; } .chat-bar button { white-space:nowrap; }
@media (max-width:900px) {
  .mobile-only { display:inline-block !important; }
  #app { grid-template-columns:1fr; }
  /* the workspace list becomes a drawer, opened with ☰ */
  #sidebar { position:fixed; top:0; left:0; bottom:0; width:min(85vw,300px); z-index:20; transform:translateX(-100%); transition:transform .15s; box-shadow:4px 0 16px rgba(0,0,0,.5); }
  #sidebar.open { transform:none; }
  #drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:19; }
  #panes { grid-template-columns:1fr; }
  #files-pane { display:none; }
  body[data-tab="files"] #files-pane { display:flex; }
  #chat-pane, #live-pane { border-right:none; }
  #live-cols { grid-template-columns:1fr; }
  #ws-head { padding:6px 10px; gap:8px; } #ws-head h2 { font-size:16px; } #ws-meta { display:none; }
  #ws-list .ws-menu { visibility:visible; } #chat { padding:10px; } .msg.user { max-width:95%; }
  .side-foot { padding:12px 10px calc(10px + env(safe-area-inset-bottom)); }
  .foot-links button.link { padding:8px 8px; font-size:13px; }
  .foot-links button.sign-out { padding-top:10px; }
  .modal { padding:8px; } .modal-box.narrow, .modal-box.wide { width:100%; }
  .tabs { padding:0 6px; } .tab { padding:6px 10px; }
  /* chat bar: the chat picker on its own line, then the three chat buttons, then agent and model side by side */
  .chat-bar { padding:6px 8px; gap:6px; }
  .chat-bar .spacer, .chat-bar .sep, .chat-bar .lbl, #live-enc-note { display:none; }
  #sel-chat { flex:1 1 100%; max-width:none; }
  #chat-pane .chat-bar label.inline { flex:1 1 40%; min-width:0; }
  #chat-pane .chat-bar label.inline select, #inp-model { flex:1; min-width:0; width:100%; }
  /* live rows: buttons share the width, settings pair up */
  .live-row button { flex:1 1 auto; padding:5px 8px; font-size:12px; }
  .live-row label.inline { flex:1 1 auto; min-width:0; }
  .live-row.settings label.inline:first-child { flex:1 1 100%; }
  .live-row.settings label.inline select, #live-model { flex:1; min-width:0; width:100%; }
  #live-status { padding:4px 10px; }
  #prompt-form { padding:8px 10px; }
  .table-wrap table { font-size:12px; min-width:420px; }
  .table-wrap :is(th,td) { padding:5px 8px; }
}

.chat-bar { gap:6px; flex-wrap:wrap; }
.chat-bar select { max-width:280px; }
#live-model, #sel-new-model { max-width:280px; }
label.inline { flex-direction:row; align-items:center; gap:5px; font-size:12px; color:var(--muted); }
#repo-list { list-style:none; margin:0; padding:0 8px 12px; overflow:auto; font-size:13px; }
#repo-list li { padding:6px; border:1px solid var(--line); border-radius:6px; margin:6px 4px; }
#repo-list li .muted { display:block; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.modal-box.wide { width:640px; }
#key-list { list-style:none; margin:0; padding:0; max-height:40vh; overflow:auto; }
#key-list li { border:1px solid var(--line); border-radius:6px; padding:8px; margin-bottom:6px; }
#key-list code { display:block; word-break:break-all; white-space:pre-wrap; font-size:11px; margin:4px 0; user-select:all; }
#files-pane { overflow:auto; }
#file-list { max-height:45vh; flex:none; }

.tabs { display:flex; gap:2px; padding:0 16px; border-bottom:1px solid var(--line); }
.tab { background:none; border:none; border-bottom:2px solid transparent; border-radius:0; padding:8px 12px; color:var(--muted); }
.tab.active { color:var(--fg); border-bottom-color:var(--accent); }
#live-pane { display:flex; flex-direction:column; min-height:0; border-right:1px solid var(--line); }
#live-status { padding:4px 16px; }
#live-cols { display:grid; grid-template-columns:1fr 1fr; flex:1; min-height:0; }
#live-transcript-col, #live-answers-col { display:flex; flex-direction:column; min-height:0; }
#live-transcript-col, #chat-pane, .modal-box { position:relative; }
/* "↓ latest": sits just above the pane's input row; shown only while the reader has scrolled up and new content arrived */
.jump-latest { position:absolute; left:50%; transform:translateX(-50%); bottom:48px; z-index:4; background:var(--accent); color:#0f1115; border:none; border-radius:14px; padding:3px 12px; box-shadow:0 2px 8px rgba(0,0,0,.35); } .jump-latest.hidden { display:none; }
#chat-pane .jump-latest { bottom:112px; } .modal-box .jump-latest { bottom:44px; }
#live-transcript-col { border-right:1px solid var(--line); }
#live-transcript { flex:1; overflow:auto; padding:10px 14px; font-size:13px; }
#live-transcript .line { margin:3px 0; } #live-transcript .line .ts { color:var(--muted); font-size:11px; margin-right:6px; }
#live-transcript .line.ours { background:rgba(110,168,254,.10); border-left:2px solid var(--accent); border-radius:4px; padding:3px 8px; margin:5px 0; }
#live-transcript .line.ours .tag { display:inline-block; background:var(--accent); color:#0f1115; font-size:10px; font-weight:600; border-radius:3px; padding:0 5px; margin-right:6px; vertical-align:1px; }
#live-transcript .line.mine { background:rgba(87,211,155,.08); border-left:2px solid var(--ok); border-radius:4px; padding:3px 8px; margin:5px 0; }
#live-transcript .line.mine .tag { display:inline-block; background:var(--ok); color:#0f1115; font-size:10px; font-weight:600; border-radius:3px; padding:0 5px; margin-right:6px; vertical-align:1px; }
#live-transcript .partial.mine { background:rgba(87,211,155,.08); border-left:2px solid var(--ok); border-radius:4px; padding:3px 8px; margin:5px 0; }
#live-transcript .partial { font-style:italic; } #live-transcript .partial .stable { color:var(--fg); } #live-transcript .partial .tail { color:var(--muted); }
#live-typed { display:flex; gap:6px; padding:8px 12px; border-top:1px solid var(--line); } #live-typed input { flex:1; }
/* a pasted image: thumbnail, then what the model read in it, folded */
#live-transcript .line.image { background:rgba(255,196,110,.08); border-left:2px solid var(--warn, #f0b35a); border-radius:4px; padding:3px 8px; margin:5px 0; }
#live-transcript .line.image .tag { display:inline-block; background:var(--warn, #f0b35a); color:#0f1115; font-size:10px; font-weight:600; border-radius:3px; padding:0 5px; margin-right:6px; vertical-align:1px; }
#live-transcript .line.image img { display:block; max-height:120px; max-width:100%; border-radius:4px; margin:4px 0; }
#live-transcript .line.image details summary { cursor:pointer; color:var(--muted); font-size:12px; }
#live-transcript .line.image details .md { font-size:12px; margin-top:4px; max-height:260px; overflow:auto; }
#live-transcript .line.image details .md pre { font-size:11px; white-space:pre-wrap; }
#live-transcript .line.image.failed { border-left-color:var(--danger, #e5484d); }
#live-transcript.drop-over { outline:2px dashed var(--accent); outline-offset:-4px; }
.answer-block { display:flex; flex-direction:column; flex:1; min-height:0; }
.answer { flex:1; overflow:auto; padding:12px 16px; font-size:17px; line-height:1.5; white-space:pre-wrap; }
.answer.not-addressed { color:var(--muted); font-size:14px; }
.answer.stale { opacity:.5; }
.stt-error { color:var(--danger); background:#2a1518; padding:6px 8px; border-radius:6px; }
#live-question { display:flex; gap:6px; padding:8px 12px; border-top:1px solid var(--line); } #live-question input { flex:1; }
.repo-head { display:flex; align-items:center; gap:4px; }
.repo-head .branch { font-family:ui-monospace,monospace; max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.menu { position:relative; } .menu-items { position:absolute; right:0; top:100%; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:4px; z-index:5; min-width:180px; }
.menu-items button { display:block; width:100%; text-align:left; background:none; border:none; padding:6px 8px; color:var(--danger); }
.menu-items button:hover { background:#20242e; }
.result { min-height:1em; margin-top:3px; } .result.error { color:var(--danger); }
select.small { padding:2px 4px; font-size:12px; }
button.primary { background:var(--accent); color:#0b1020; border-color:var(--accent); font-weight:600; }
button.primary:disabled { opacity:.4; }
#wrap-body { flex:1; overflow:auto; font-size:15px; }
#wrap-changed { padding:6px 16px; }
.live-row { border-bottom:1px solid var(--line); }
.live-row.settings { background:#131620; font-size:12px; }
.sep { width:1px; height:18px; background:var(--line); margin:0 4px; }
input[list] { font-family:ui-monospace,monospace; font-size:12px; }
.working { color:var(--accent); margin-top:8px; }
.dots::after { content:""; animation:dots 1.2s steps(4,end) infinite; }
@keyframes dots { 0%{content:""} 25%{content:"."} 50%{content:".."} 75%{content:"..."} }
.badge { font-size:10px; letter-spacing:.06em; text-transform:uppercase; padding:1px 6px; border-radius:4px; background:#5a3b12; color:#ffc107; border:1px solid #8a5a16; }
.badge.paid { background:#173a2a; color:var(--ok); border-color:#1f5a3f; }
#accounts-table { width:100%; border-collapse:collapse; font-size:13px; }
#accounts-table th, #accounts-table td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); }
#accounts-table td.actions { white-space:nowrap; }
#accounts-table td.actions button { margin-right:4px; }
.account-form { display:flex; flex-direction:column; gap:8px; border-top:1px solid var(--line); padding-top:12px; margin-top:8px; }
.radios { display:flex; gap:16px; }
#account-result { color:var(--ok); user-select:all; }

/* inside the Android app (android/): the page runs in a WebView that exposes window.RemoteAgentApp.
   Tab capture, popups and installer links make no sense there; the phone's microphone does. */
.app-only { display:none !important; }
body.ra-app .app-only { display:inline-block !important; }
body.ra-app .no-app { display:none !important; }

/* downloads dialog */
.dl-list { list-style:none; margin:0; padding:0; max-height:60vh; overflow:auto; }
.dl-list li { display:flex; gap:12px; align-items:center; border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin-bottom:8px; }
.dl-list .dl-info { flex:1; min-width:0; }
.dl-list .dl-info strong { display:block; }
.dl-list .dl-info .name { font-family:ui-monospace,monospace; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.dl-list .dl-info p { margin:4px 0 0; font-size:12px; color:var(--muted); }

/* encrypted transport */
.encrypt-row { margin-top: 2px; }
.badge.enc { background: #1f3b2a; color: #7ee2a8; }
#enrol { border-top: 1px solid #2a2f3a; margin-top: 10px; padding-top: 10px; }

/* interview mode adaptation */
body[data-kind="interview"] #tab-btn-chat,
body[data-kind="interview"] #chat-pane,
body[data-kind="interview"] #live-grounded-settings,
body[data-kind="interview"] #live-provider-settings,
body[data-kind="interview"] #agent-answer-block,
body[data-kind="interview"] #repos-head,
body[data-kind="interview"] #repo-list,
body[data-kind="interview"] #drop,
body[data-kind="interview"] #upload-knowledge-label {
  display: none !important;
}
body[data-kind="interview"] #fast-answer-block {
  flex: 1;
}
body[data-kind="interview"] #fast-answer {
  font-size: 19px;
  line-height: 1.55;
}

.fallback-warn {
  color: #f59f00;
  font-weight: 500;
  font-size: 11px;
}

#chain-table th, #chain-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
#chain-table td button {
  padding: 2px 6px;
  font-size: 11px;
  margin-right: 2px;
}

/* context meter in the chat bar: how full the chat's session is */
.ctx { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); white-space:nowrap; cursor:default; }
.ctx .bar { width:64px; height:6px; border-radius:3px; background:#0c0e12; border:1px solid var(--line); overflow:hidden; }
.ctx .fill { display:block; height:100%; width:0; background:var(--accent); border-radius:3px; transition:width .3s; }
.ctx.warn .fill { background:#c98500; } .ctx.high .fill { background:var(--danger); }
.ctx.nolimit .bar { display:none; }

/* usage dialog */
.usage-box { max-height:90vh; overflow:auto; gap:12px; }
.usage-box > * { flex-shrink:0; }  /* the box scrolls; a flex column would otherwise squash the tables to nothing on a phone */
.tiles { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.tile { background:#0c0e12; border:1px solid var(--line); border-radius:8px; padding:10px 12px; min-width:0; }
.tile .lbl { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.tile .val { font-size:22px; font-weight:600; line-height:1.2; margin-top:2px; }
.tile .sub { font-size:12px; color:var(--muted); margin-top:2px; }
.plan { border:1px solid var(--line); border-radius:8px; padding:8px 12px; font-size:12px; display:flex; flex-direction:column; gap:4px; }
.plan .win { display:flex; align-items:center; gap:8px; }
.plan .win .bar { width:120px; height:6px; border-radius:3px; background:#0c0e12; border:1px solid var(--line); overflow:hidden; flex-shrink:0; }
.plan .win .fill { display:block; height:100%; background:var(--accent); border-radius:3px; }
.plan .win.warn .fill { background:#c98500; } .plan .win.high .fill { background:var(--danger); }
.chart-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.legend { display:flex; gap:10px; flex-wrap:wrap; font-size:12px; color:var(--muted); }
.legend .key { display:inline-flex; align-items:center; gap:4px; }
.legend .sw { width:10px; height:10px; border-radius:2px; display:inline-block; }
.chart { position:relative; }
.chart svg { display:block; width:100%; height:auto; }
.chart .grid { stroke:#2a2f3a; stroke-width:1; }
.chart .axis { fill:var(--muted); font-size:11px; }
.chart .hit { fill:transparent; cursor:default; }
.chart .hit:hover + g rect, .chart g.hot rect { filter:brightness(1.25); }
.tip { position:absolute; z-index:5; background:#0c0e12; border:1px solid var(--line); border-radius:6px; padding:6px 8px; font-size:12px; pointer-events:none; min-width:140px; box-shadow:0 6px 20px rgba(0,0,0,.5); }
.tip .row { display:flex; justify-content:space-between; gap:12px; }
.tip .row b { font-weight:600; }
.tip .row .k { display:inline-block; width:10px; height:2px; vertical-align:middle; margin-right:5px; border-radius:1px; }
.usage-table { width:100%; border-collapse:collapse; font-size:12px; }
.usage-table th, .usage-table td { text-align:right; padding:4px 6px; border-bottom:1px solid var(--line); white-space:nowrap; }
.usage-table th:first-child, .usage-table td:first-child { text-align:left; }
.usage-table td .sw { width:8px; height:8px; border-radius:2px; display:inline-block; margin-right:6px; vertical-align:middle; }
.usage-days summary { cursor:pointer; }
.tbl-wrap { overflow-x:auto; }
@media (max-width:900px) { .tiles { grid-template-columns:1fr 1fr 1fr; gap:6px; } .tile .val { font-size:18px; } .ctx .bar { width:44px; } }
/* Speak into call: never hidden; dimmed while a precondition is unmet, the reason sits next to it */
#fast-speak.blocked { opacity:.55; }
#speak-status.flash { color:var(--accent); font-weight:600; }
/* the quick-reply header: the button stays on the title row, the (often long) status gets its own line */
#fast-answer-block .pane-head { flex-wrap:wrap; }
#fast-answer-block .pane-head #fast-speak { white-space:nowrap; flex:none; }
#speak-status { flex-basis:100%; order:10; white-space:normal; line-height:1.35; }
#speak-status:empty { display:none; }
#live-answers-col { min-width:0; }
