:root {
  --bg: #16181d; --card: #20232a; --line: #2c3039; --text: #e8e8e8; --muted: #9aa0aa;
  --accent: #d97757; --ok: #5fb878; --warn: #e0b042; --bad: #e06c6c; --blue: #8ab4f8;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { overflow: hidden; }
button { font: inherit; color: var(--text); background: #2d313a; border: 1px solid #3a3f4a; border-radius: 10px; padding: 9px 14px; touch-action: manipulation; }
button:active { filter: brightness(1.3); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ok { color: var(--ok); } button.bad { color: var(--bad); }
button.wide { width: 100%; margin-top: 12px; }
button.icon { background: transparent; border: 0; font-size: 22px; padding: 4px 10px; line-height: 1; }
input[type=text], input[type=password], textarea { font: inherit; color: var(--text); background: #111318; border: 1px solid #3a3f4a; border-radius: 10px; padding: 9px 11px; width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---------- inicio ---------- */
#home { padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom)); overflow: auto; gap: 12px; }
.home-head { display: flex; align-items: center; gap: 10px; }
.home-head h1 { font-size: 22px; margin: 0; flex: 1; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 10px; background: #2d313a; color: var(--muted); }
.pill.on { color: var(--ok); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.msg { background: #2a2420; border: 1px solid #4a3a30; border-radius: 12px; padding: 12px; }
label { display: block; color: var(--muted); margin: 10px 0 5px; font-size: 13px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; margin: 12px 0; }
label.check input { width: 20px; height: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pc { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px; }
.pc .name { font-weight: 600; font-size: 17px; }
.pc .sub { color: var(--muted); font-size: 13px; }
.pc .projects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 9px; background: #2d313a; color: var(--muted); }
.st-working { color: var(--blue); } .st-waiting { color: var(--warn); } .st-done { color: var(--ok); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.on { background: var(--ok); } .dot.locked { background: var(--warn); }

/* ---------- deck ---------- */
#deck { background: #000; }
#bar { display: flex; align-items: center; gap: 4px; padding: calc(4px + var(--safe-top)) 4px 4px; background: var(--bg); border-bottom: 1px solid var(--line); min-height: 44px; }
#title { text-align: center; overflow: hidden; }
#projName { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; justify-content: center; gap: 6px; }
#dots { display: flex; gap: 5px; justify-content: center; margin-top: 3px; height: 7px; }
#dots i { width: 6px; height: 6px; border-radius: 50%; background: #444a55; display: block; }
#dots i.cur { background: var(--text); }
#dots i.working { box-shadow: 0 0 0 1.5px var(--blue); } #dots i.waiting { box-shadow: 0 0 0 1.5px var(--warn); } #dots i.done { box-shadow: 0 0 0 1.5px var(--ok); }
#tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
#tabs button { flex: none; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 12px; font-size: 13px; border-radius: 16px; }
#tabs button.active { border-color: var(--accent); color: #fff; background: #3a2a24; }
#tabs button.plus { font-weight: 700; color: var(--accent); }
#stage { position: relative; flex: 1; overflow: hidden; touch-action: none; background: #000; }
#video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0; will-change: transform; transition: none; }
#video.anim { transition: transform .18s ease-out; }
#stageMsg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--muted); background: rgba(0,0,0,.6); }
#stats { position: absolute; left: 6px; top: 6px; margin: 0; padding: 6px 8px; font: 11px/1.35 ui-monospace, monospace; color: #cfe; background: rgba(0,0,0,.72); border-radius: 6px; pointer-events: none; }
#zoomTag { position: absolute; right: 8px; top: 8px; font-size: 12px; padding: 2px 8px; border-radius: 9px; background: rgba(0,0,0,.6); pointer-events: none; }
/* Sobre o video (nao muda o tamanho do palco, que define o tamanho da janela no PC). */
#perms { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; }
.perm { margin: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(46,39,22,.96); border: 1px solid #5a4a20; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.perm .what { font-size: 13px; color: var(--muted); word-break: break-all; max-height: 4.2em; overflow: hidden; }
.perm .row { display: flex; gap: 8px; margin-top: 8px; }
.perm .row button { flex: 1; }
#quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px; background: var(--bg); border-top: 1px solid var(--line); scrollbar-width: none; }
#quick::-webkit-scrollbar { display: none; }
#quick button { flex: none; padding: 7px 12px; font-size: 14px; }
#prompt { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px calc(6px + var(--safe-bottom)); background: var(--bg); }
#text { resize: none; max-height: 9.5em; min-height: 42px; line-height: 1.35; }
#sendBtn { min-width: 48px; height: 42px; padding: 0 12px; font-size: 18px; }
#micBtn.rec { color: var(--bad); }
#prompt.logon #text { -webkit-text-security: disc; }

/* ---------- folha ---------- */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; z-index: 10; }
.sheet-body { width: 100%; max-height: 85vh; overflow: auto; background: var(--card); border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + var(--safe-bottom)); }
.sheet h3 { margin: 6px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sheet ul { list-style: none; margin: 0; padding: 0; }
.sheet li { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.sheet li.cur { color: var(--accent); }

#toast { position: fixed; left: 50%; bottom: calc(120px + var(--safe-bottom)); transform: translateX(-50%); max-width: 90vw; padding: 9px 14px; border-radius: 12px; background: rgba(40,44,52,.96); border: 1px solid var(--line); z-index: 20; font-size: 14px; text-align: center; }
