/*
 * DARK fork — flat UI layer (loaded last). Flat, modern, clean: solid surfaces, 1px hairline borders, no shadows,
 * no glows, no blur. Clear hierarchy: uppercase section labels, 600 names, 500 secondary text, 700 numbers.
 * Only overrides looks; every element, class and behaviour of ui.js stays as it was.
 */
:root {
  --f-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-bg: #14161B;          /* panel surface */
  --f-bg-2: #1C1F26;        /* rows, tiles, chips on a panel */
  --f-bg-3: #262A33;        /* hover / pressed */
  --f-line: #2A2E37;        /* hairline borders and dividers */
  --f-line-2: #3A3F4B;
  --f-text: #F3F4F6;
  --f-muted: #A7ADB9;
  --f-dim: #7D8491;
  --f-working: #4ADE80; --f-waiting: #FBBF24; --f-error: #F87171; --f-done: #818CF8; --f-idle: #9CA3AF;
  --f-r: 12px;              /* card radius */
  --f-r-s: 8px;             /* row radius */
  --bhq-round: var(--f-font);
}

/* ---------- no shadows, glows or blur anywhere in the page chrome ---------- */
*, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
.bhq-glow::before, .bhq-glow::after { display: none !important; }
:is(#topbar, #floors, #panel, #feed, .bhq-dock, .bhq-sheet, .bhq-zoom, .bhq-card, .hqt-pill, .wp-status) {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
.bhq-av-img, .bhq-ava.is-dark .bhq-av-img { filter: none !important; }
.bhq-member:hover, .bhq-cta:not(:disabled):hover { filter: none !important; }

/* ---------- type ---------- */
:where(#topbar, #floors, #panel, #feed, .bhq-zoom, .bhq-dock, .bhq-sheet) {
  font: 500 13px/1.35 var(--f-font); color: var(--f-text); letter-spacing: 0;
}
:where(#topbar, #floors, #panel, #feed, .bhq-zoom, .bhq-dock, .bhq-sheet) :focus-visible { outline: 2px solid #60A5FA; outline-offset: 2px; }

/* ---------- the surface: one solid card ---------- */
.bhq-surface, .bhq-surface[data-s] {
  --base: var(--f-bg); --hi: var(--f-text); --mid: var(--f-muted); --dim: var(--f-dim);
  background: var(--f-bg) !important;
  border: 1px solid var(--f-line);
  color: var(--f-text);
  animation-name: bhq-flat-in;
}
/* a status card (floor team head, bot hero) keeps its meaning with a coloured top rule + tinted number, not a glow */
.bhq-surface[data-s="working"] { border-top: 3px solid var(--f-working); }
.bhq-surface[data-s="waiting_user"], .bhq-surface[data-s="stuck"] { border-top: 3px solid var(--f-waiting); }
.bhq-surface[data-s="error"] { border-top: 3px solid var(--f-error); }
.bhq-surface[data-s="done"] { border-top: 3px solid var(--f-done); }
.bhq-thead[data-s="working"] .bhq-tbig b { color: var(--f-working); }
.bhq-thead:is([data-s="waiting_user"], [data-s="stuck"]) .bhq-tbig b { color: var(--f-waiting); }
.bhq-thead[data-s="error"] .bhq-tbig b { color: var(--f-error); }
@keyframes bhq-flat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* status colours */
:where(#topbar, #floors, #panel, #feed, .bhq-dock, .bhq-sheet) [data-s="working"] { --s: var(--f-working); }
:where(#topbar, #floors, #panel, #feed, .bhq-dock, .bhq-sheet) [data-s="waiting_user"] { --s: var(--f-waiting); }
:where(#topbar, #floors, #panel, #feed, .bhq-dock, .bhq-sheet) [data-s="stuck"] { --s: #FB923C; }
:where(#topbar, #floors, #panel, #feed, .bhq-dock, .bhq-sheet) [data-s="error"] { --s: var(--f-error); }
:where(#topbar, #floors, #panel, #feed, .bhq-dock, .bhq-sheet) [data-s="done"] { --s: var(--f-done); }

/* ---------- small parts ---------- */
.bhq-label, .bhq-fhead { font: 600 11px/1.3 var(--f-font) !important; text-transform: uppercase; letter-spacing: .07em; color: var(--f-dim) !important; }
.bhq-label b, .bhq-fhead b { color: var(--f-muted); font-weight: 600; }
.bhq-note, .bhq-step-empty { font: 500 13px/1.45 var(--f-font); color: var(--f-muted); }
.bhq-dot, .bhq-orb { background: var(--s, var(--f-idle)) !important; }
.bhq-orb { outline-color: var(--f-bg); }
.bhq-sep { background: var(--f-line); }
.bhq-num, .bhq-schip b, .bhq-tbig b, .bhq-stat b, .bhq-usage-pct { font-variant-numeric: tabular-nums; }
.bhq-av-fb { font-family: var(--f-font); font-weight: 700; }

/* the usage meter: a flat bar */
.bhq-slider { height: 6px !important; background: var(--f-line) !important; }
.bhq-slider i { left: 0 !important; top: 0 !important; bottom: 0 !important; width: max(6px, calc(var(--p) * 100%)) !important; background: var(--f-text) !important; }
.bhq-slider[data-level="warn"] i { background: var(--f-waiting) !important; }
.bhq-slider[data-level="error"] i { background: var(--f-error) !important; }

/* ---------- top bar ---------- */
.bhq-brand, .bhq-summary, .bhq-usage { height: 40px; border-radius: 10px; }
.bhq-share { width: 40px; height: 40px; border-radius: 10px; }
.bhq-share:hover { background: var(--f-bg-2) !important; }
.bhq-demo { border-radius: 8px; font: 700 10px/1 var(--f-font); letter-spacing: .1em; color: var(--f-muted); }
.bhq-mark { border-radius: 6px; width: 24px; height: 24px; }
.bhq-word { font: 700 14px/1 var(--f-font); letter-spacing: -.01em; }
.bhq-live { font: 500 12px/1 var(--f-font); color: var(--f-muted); }
@keyframes bhq-live { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.bhq-schip { height: 30px; border-radius: 7px; font: 500 12.5px/1 var(--f-font); color: var(--f-muted); }
.bhq-schip b { font: 700 14px/1 var(--f-font); color: var(--f-text); }
.bhq-schip--lead { color: var(--f-text); font-size: 13px; }
.bhq-schip--lead b { font-size: 18px; }
.bhq-schip.is-alert[data-s="waiting_user"] { background: rgba(251, 191, 36, .14); color: #FCD34D; }
.bhq-schip.is-alert[data-s="error"] { background: rgba(248, 113, 113, .15); color: #FCA5A5; }
.bhq-schip.is-alert b { color: inherit; }
.bhq-usage { font: 500 12px/1 var(--f-font); color: var(--f-muted); gap: 10px; }
.bhq-usage-pct { font: 700 14px/1 var(--f-font); color: var(--f-text); }

/* ---------- floors ---------- */
#floors { padding: 12px 8px 8px; border-radius: var(--f-r); }
.bhq-fhead { padding: 0 8px 8px; }
.bhq-car { border-radius: var(--f-r-s); background: var(--f-bg-2) !important; border: 1px solid var(--f-line-2); }
.bhq-floor { border-radius: var(--f-r-s); min-height: 50px; gap: 10px; color: var(--f-muted); }
.bhq-floor:hover:not([aria-current="true"]) { background: var(--f-bg-2); }
.bhq-fnum { width: 28px; height: 28px; border-radius: 7px; background: var(--f-bg-3); font: 600 13px/1 var(--f-font); color: var(--f-text); }
.bhq-floor[aria-current="true"] .bhq-fnum { background: var(--f-text); color: #0F1115; }
.bhq-fname { font: 600 13.5px/1.2 var(--f-font); color: var(--f-text); }
.bhq-fcount { font: 600 12.5px/1 var(--f-font); color: var(--f-dim); }
.bhq-floor[aria-current="true"] .bhq-fcount { color: var(--f-text); }

/* ---------- right: floor team ---------- */
.bhq-thead { border-radius: var(--f-r); padding: 14px 16px; }
.bhq-h2 { font: 700 17px/1.2 var(--f-font); letter-spacing: -.01em; }
.bhq-tsub { font: 500 12px/1 var(--f-font); color: var(--f-dim); }
.bhq-tbig b { font: 700 30px/1 var(--f-font); letter-spacing: -.02em; }
.bhq-tbig span { font: 500 14px/1 var(--f-font); color: var(--f-muted); }
.bhq-tcounts { font: 500 12px/1.4 var(--f-font); }
.bhq-tcounts em { color: var(--f-dim); }
.bhq-tcounts b { font-weight: 700; }
.bhq-tcard { border-radius: var(--f-r); padding: 6px; }
.bhq-member { border-radius: var(--f-r-s); padding: 8px 10px 8px 8px; }
.bhq-member + .bhq-member { margin-top: 2px; }
.bhq-member:hover { background: var(--f-bg-2); }
.bhq-mname { font: 600 13.5px/1.25 var(--f-font); color: var(--f-text); }
.bhq-mstep { font: 500 12.5px/1.35 var(--f-font); color: var(--f-muted); margin-top: 2px; }
.bhq-mseen { font: 500 11.5px/1 var(--f-font); color: var(--f-dim); }
.bhq-member[data-s="waiting_user"], .bhq-member[data-s="stuck"] { background: rgba(251, 191, 36, .10); box-shadow: none; border-left: 3px solid var(--f-waiting); }
.bhq-member[data-s="error"] { background: rgba(248, 113, 113, .10); border-left: 3px solid var(--f-error); }
.bhq-member[data-s="waiting_user"] .bhq-mstep, .bhq-member[data-s="stuck"] .bhq-mstep { color: #FCD34D; }
.bhq-member[data-s="error"] .bhq-mstep { color: #FCA5A5; }

/* ---------- right: bot card ---------- */
.bhq-hero { border-radius: var(--f-r); padding: 16px; }
.bhq-hero .bhq-h2 { font-size: 19px; }
.bhq-sub { font: 500 12.5px/1.35 var(--f-font); color: var(--f-muted); }
.bhq-close { border-radius: 8px; background: var(--f-bg-2) !important; border: 1px solid var(--f-line); }
.bhq-close:hover { background: var(--f-bg-3) !important; }
.bhq-status { height: 26px; border-radius: 6px; background: var(--f-bg-2) !important; border: 1px solid var(--f-line); font: 600 12px/1 var(--f-font); color: var(--f-text); }
.bhq-now { font: 600 15px/1.4 var(--f-font); color: var(--f-text); }
.bhq-more { border-radius: var(--f-r); }
.bhq-block { margin-bottom: 16px; }
.bhq-task { font: 500 13.5px/1.45 var(--f-font); color: var(--f-text); }
.bhq-stat { border-radius: var(--f-r-s); background: var(--f-bg-2); border: 1px solid var(--f-line); }
.bhq-stat b { font: 700 22px/1.05 var(--f-font); }
.bhq-stat small { font: 500 11.5px/1.2 var(--f-font); color: var(--f-dim); }
.bhq-share { font: 500 12.5px/1 var(--f-font); }
.bhq-step-row { font: 500 12.5px/1.4 var(--f-font); }
.bhq-step-row time { color: var(--f-dim); font-variant-numeric: tabular-nums; }
.bhq-step-row span { color: var(--f-muted); }
.bhq-step-row:first-child span { color: var(--f-text); }
.bhq-cta { height: 42px; border-radius: 10px; background: var(--f-text); color: #0F1115; font: 600 14px/1 var(--f-font); }
.bhq-cta:not(:disabled):hover { background: #FFFFFF; }
.bhq-cta:disabled { background: var(--f-bg-2); color: var(--f-dim); border: 1px solid var(--f-line); }

/* ---------- live feed ---------- */
#feed { border-radius: var(--f-r); padding: 12px 14px 10px; }
#feed .bhq-fhead { padding: 0 0 6px; }
.bhq-frow { height: 26px; font: 500 12.5px/1 var(--f-font); color: var(--f-muted); }
.bhq-frow + .bhq-frow { border-top: 1px solid var(--f-line); }
.bhq-frow time { color: var(--f-dim); font-variant-numeric: tabular-nums; }
.bhq-frow b { color: var(--f-text); font-weight: 600; }

/* ---------- zoom ---------- */
.bhq-zoom { height: 40px; border-radius: 10px; padding: 0 3px; }
.bhq-zbtn { border-radius: 7px; }
.bhq-zbtn:hover { background: var(--f-bg-2); }

/* ---------- dock: waiting on me / finished / routines ---------- */
.bhq-dcard { border-radius: var(--f-r); min-height: 44px; }
.bhq-dtoggle { border-radius: var(--f-r); height: 44px; }
.bhq-dtoggle:hover { background: var(--f-bg-2); }
.bhq-dtitle { font: 600 13.5px/1 var(--f-font); color: var(--f-text); }
.bhq-dcount { height: 20px; min-width: 20px; border-radius: 6px; background: var(--f-bg-3); color: var(--f-muted); font: 600 11.5px/1 var(--f-font); }
.bhq-dcount[data-s="waiting_user"] { background: var(--f-waiting); color: #1A1305; }
.bhq-dcount[data-s="error"] { background: var(--f-error); color: #1A0707; }
.bhq-dcount[data-s="done"] { background: var(--f-working); color: #06170C; }
.bhq-dcard.is-open .bhq-dh { border-bottom: 1px solid var(--f-line); }
.bhq-dcard.is-open .bhq-dbody-in { padding-top: 6px; }
.bhq-eye { border-radius: 7px; }
.bhq-eye:hover, .bhq-eye[aria-pressed="true"] { background: var(--f-bg-3); }
.bhq-wrow { border-radius: var(--f-r-s); background: rgba(251, 191, 36, .10) !important; border-left: 3px solid var(--f-waiting); }
.bhq-wrow[data-s="error"] { background: rgba(248, 113, 113, .10) !important; border-left-color: var(--f-error); }
.bhq-wname, .bhq-tl-name, .bhq-rname, .bhq-ckname { font: 600 13px/1.25 var(--f-font); color: var(--f-text); }
.bhq-wtext { font: 500 12.5px/1.4 var(--f-font); color: #FCD34D; }
.bhq-wrow[data-s="error"] .bhq-wtext { color: #FCA5A5; }
.bhq-wbtn, .bhq-roff { height: 26px; border-radius: 6px; background: var(--f-bg-3) !important; border: 1px solid var(--f-line-2); font: 600 11.5px/1 var(--f-font); }
.bhq-wbtn:hover, .bhq-roff:hover { background: #313642 !important; }
.bhq-tl-row::before { background: var(--f-line); }
.bhq-tl-row .bhq-ava::before { background: var(--f-bg); }
.bhq-tl-time, .bhq-ckat { font: 500 11.5px/1.25 var(--f-font); color: var(--f-dim); font-variant-numeric: tabular-nums; }
.bhq-tl-step, .bhq-rmeta { font: 500 12.5px/1.35 var(--f-font); color: var(--f-muted); }
.bhq-rrow + .bhq-rrow { border-top: 1px solid var(--f-line); }
.bhq-rnext { font: 600 12px/1.25 var(--f-font); }
.bhq-rnote { font: 500 12px/1.3 var(--f-font); color: var(--f-working); }
.bhq-ckrow { border-radius: var(--f-r-s); }
.bhq-ckrow:hover { background: var(--f-bg-2); }
.bhq-ckrow[data-ok="yes"] .bhq-ckat { color: var(--f-working); }
.bhq-ckrow[data-ok="no"] .bhq-ckat { color: var(--f-error); }

/* ---------- phones ---------- */
.bhq-phone .bhq-brand { width: 40px; height: 40px; border-radius: 10px; }
.bhq-phone .bhq-summary, .bhq-phone .bhq-usage { height: 40px; }
.bhq-phone .bhq-share { width: 40px; height: 40px; border-radius: 10px; }
.bhq-phone .bhq-floor { height: 40px; min-height: 40px; border-radius: 10px; padding: 0 12px 0 6px; }
.bhq-phone .bhq-floor:not([aria-current="true"]) { background: var(--f-bg) !important; border: 1px solid var(--f-line); }
.bhq-phone .bhq-floor[aria-current="true"] { background: var(--f-bg-3) !important; border: 1px solid var(--f-line-2); }
.bhq-phone .bhq-floor[data-alert]::after { outline: 2px solid var(--f-bg); }
.bhq-phone .bhq-sheet { background: var(--f-bg) !important; border-top: 1px solid var(--f-line); border-radius: 16px 16px 0 0; }
.bhq-phone .bhq-sheet .bhq-thead { background: none !important; border: 0; border-bottom: 1px solid var(--f-line); border-radius: 0; margin-bottom: 4px; }
.bhq-phone .bhq-sheet .bhq-thead[data-s="working"] .bhq-tbig b { color: var(--f-working); }
.bhq-phone .bhq-sheet .bhq-surface:not(.bhq-thead) { background: var(--f-bg-2) !important; border: 1px solid var(--f-line); }
.bhq-phone .bhq-sheet #feed { border-radius: var(--f-r); }
.bhq-phone .bhq-sgrab i, .bhq-phone .bhq-cgrab::after { background: var(--f-line-2); }
.bhq-phone .bhq-card { background: var(--f-bg) !important; border-top: 1px solid var(--f-line); border-radius: 16px 16px 0 0; }
.bhq-phone .bhq-hero, .bhq-phone .bhq-more { border: 0 !important; border-radius: 0; }
.bhq-phone .bhq-hero { border-bottom: 1px solid var(--f-line) !important; }
.bhq-phone .bhq-close { background: none !important; border: 0; }
.bhq-phone .bhq-close::before { background: var(--f-bg-2); border: 1px solid var(--f-line); }
.bhq-phone .bhq-zoom { height: 44px; border-radius: 10px; }
.bhq-phone .bhq-zbtn { border-radius: 8px; }
.bhq-phone.bhq-land .bhq-sheet, .bhq-phone.bhq-land .bhq-card { border-radius: 0; border-left: 1px solid var(--f-line); }

/* ---------- in-scene name tags: flat pills ---------- */
.hqt-pill, :root[data-daylight] .hqt-pill {
  background: var(--f-bg); border: 1px solid var(--f-line-2); color: var(--f-text); font-weight: 600; border-radius: 8px;
}
.hqt[data-mode="sel"] .hqt-pill, :root[data-daylight] .hqt[data-mode="sel"] .hqt-pill { background: var(--f-text); color: #0F1115; border-color: var(--f-text); }
.hqt-stem, :root[data-daylight] .hqt-stem { background: var(--f-line-2); }
.hq-scene { background-color: #0B0D11; }
.hq-loading, :root[data-daylight="night"] .hq-loading { color: var(--f-muted); }

@media (prefers-contrast: more) {
  .bhq-surface { border-color: #5A6070; }
  :root { --f-muted: #C9CED8; --f-dim: #A7ADB9; }
}

/* ---- DARK v6: static roster (html.bhq-roster). No live data: no task / stats / usage / steps on the bot card, no
   waiting / error counters on the team card, no "last seen" column, no live dot. Every bot is "disponível". */
:where(#topbar, #floors, #panel, .bhq-sheet) [data-s="available"] { --s: #5AC8FA; }
.bhq-dot[data-s="available"] { box-shadow: 0 0 0 3px rgba(90, 200, 250, .18); }
.bhq-thead[data-s="available"] .bhq-tbig b,
.bhq-phone .bhq-sheet .bhq-thead[data-s="available"] .bhq-tbig b { color: #5AC8FA; }
.bhq-roster .bhq-more,
.bhq-roster .bhq-tcounts,
.bhq-roster .bhq-mseen,
.bhq-roster .bhq-live-dot,
.bhq-roster .bhq-usage,
.bhq-roster .bhq-demo,
.bhq-roster #feed,
.bhq-roster .bhq-dock { display: none !important; }
.bhq-roster .bhq-mstep { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
