/* Central — painel web. Tema escuro, responsivo, sem fontes externas. */

:root {
  color-scheme: dark;
  --bg: #0a0d14;
  --bg-2: #0d121c;
  --surface: #121926;
  --surface-2: #172031;
  --surface-3: #1d283c;
  --border: #233049;
  --border-2: #2f3e5c;
  --text: #e7ecf5;
  --text-2: #b9c3d6;
  --muted: #8592ab;
  --accent: #5b8cff;
  --accent-2: #8b5cff;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --accent-ring: rgba(91, 140, 255, 0.45);
  --ok: #34d47f;
  --ok-soft: rgba(52, 212, 127, 0.14);
  --warn: #f5b73b;
  --warn-soft: rgba(245, 183, 59, 0.14);
  --crit: #ff5c6c;
  --crit-soft: rgba(255, 92, 108, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --topbar-h: 58px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(139, 92, 255, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.has-modal, body.no-scroll { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }

code, pre, .mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::selection { background: rgba(91, 140, 255, 0.35); }

/* -------------------------------------------------------------- topo */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: rgba(10, 13, 20, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 28px; height: 28px; display: block; }

.topnav { display: flex; gap: 4px; margin-left: 12px; flex: 1; min-width: 0; }
.topnav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 9px;
  color: var(--text-2); font-weight: 550; font-size: 14px; white-space: nowrap;
}
.topnav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav-link.active { background: var(--accent-soft); color: #cfe0ff; }
.nav-ico { display: inline-flex; }

.conn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-2); white-space: nowrap;
}
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn-open .conn-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn-connecting .conn-dot, .conn-reconnecting .conn-dot { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.conn-closed .conn-dot, .conn-idle .conn-dot { background: var(--crit); }
.conn-reconnecting { cursor: pointer; border-color: rgba(245, 183, 59, 0.45); }
.conn-reconnecting:hover { background: var(--surface-2); }
/* Sem conexão em tempo real: os estados online/offline podem estar desatualizados. */
body.ws-down .status-pill, body.ws-down .pc-meters { opacity: 0.55; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ------------------------------------------------------------- página */
.app { outline: none; }

.boot {
  min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--muted);
}

.noscript { padding: 24px; text-align: center; color: var(--warn); }

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.page-narrow { max-width: 960px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-sub { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-content { display: flex; flex-direction: column; gap: 18px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* ------------------------------------------------------------ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 15px;
  border-radius: 10px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  cursor: pointer; white-space: nowrap; user-select: none; -webkit-user-select: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-3); border-color: #3a4b6d; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #4f7dff, #7457ff); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(91, 110, 255, 0.28);
}
.btn-primary:hover { background: linear-gradient(135deg, #6290ff, #8468ff); border-color: transparent; }
.btn-danger { background: #c9303f; border-color: transparent; color: #fff; }
.btn-danger:hover { background: #dd3a4a; border-color: transparent; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; border-color: rgba(255, 92, 108, 0.45); color: #ff8d98; }
.btn-danger-ghost:hover { background: var(--crit-soft); border-color: var(--crit); }
.btn-wake { border-color: rgba(245, 183, 59, 0.45); color: #ffd27a; background: rgba(245, 183, 59, 0.08); }
.btn-wake:hover { background: rgba(245, 183, 59, 0.16); border-color: var(--warn); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-lg { min-height: 46px; padding: 11px 20px; font-size: 15px; }
.btn-xl { min-height: 56px; padding: 14px 26px; font-size: 17px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding-left: 9px; padding-right: 9px; }
.btn-sm.btn-icon { padding-left: 7px; padding-right: 7px; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy .icon { opacity: 0; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; left: 50%; top: 50%; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border); text-decoration: none; }
.icon-btn.is-danger:hover { background: var(--crit-soft); color: #ff8d98; border-color: rgba(255, 92, 108, 0.4); }

/* -------------------------------------------------------- formulários */
.input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border-radius: 10px; border: 1px solid var(--border-2);
  background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #5f6b83; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: 0.55; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select.input option { background: var(--surface); color: var(--text); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.45; }
.input-sm { min-height: 34px; padding: 5px 10px; font-size: 14px; border-radius: 8px; }
select.input-sm { padding-right: 30px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
.input-lg { min-height: 48px; font-size: 16px; padding: 10px 14px; }
.input.mono { font-family: var(--mono); font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--text-2); font-weight: 550; }
.field-error, .form-error { color: #ff8d98; font-size: 14px; }
.form-error { background: var(--crit-soft); border: 1px solid rgba(255, 92, 108, 0.35); padding: 9px 12px; border-radius: 9px; }
.form-hint { font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.form-hint p { margin: 0 0 6px; }
.form-hint code { display: inline-block; margin: 2px 0 8px; }
.form-hint .code-wrap { margin: 2px 0 10px; }
.form-hint .code-box { font-size: 12px; }
.form-hint .code-box code { display: inline; margin: 0; }

.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 46px; }
.input-addon {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--muted); border-radius: 8px; cursor: pointer;
}
.input-addon:hover { color: var(--text); background: var(--surface-3); }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; -webkit-user-select: none; font-size: 14px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch-track {
  position: relative; width: 40px; height: 23px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border-2); transition: background 0.2s, border-color 0.2s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: #c5cee0; transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, #4f7dff, #7457ff); border-color: transparent; }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(17px); background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.stack-lg { display: flex; flex-direction: column; gap: 18px; }

/* ------------------------------------------------------------- cartões */
.card {
  background: linear-gradient(180deg, rgba(23, 32, 49, 0.85), rgba(18, 25, 38, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  min-width: 0;
}
.card > h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.card > h2 .icon { color: var(--accent); }
.card-danger { border-color: rgba(255, 92, 108, 0.28); }
.card-danger > h2 .icon { color: var(--crit); }
.card-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-color: rgba(91, 140, 255, 0.35); background: linear-gradient(135deg, rgba(79, 125, 255, 0.14), rgba(116, 87, 255, 0.10)); }
.hero-text { flex: 1; min-width: 240px; }
.hero-text h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 19px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #4f7dff, #7457ff); color: #fff; font-size: 14px; font-weight: 700; flex: none;
}
.card > h2 .step-num { margin-right: 2px; }

.sub-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 16px 0 8px; font-weight: 650; }

/* ------------------------------------------------------------ login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(180deg, rgba(23, 32, 49, 0.92), rgba(15, 21, 33, 0.96));
  border: 1px solid var(--border); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow-lg);
  text-align: left;
}
.login-card h1 { font-size: 28px; text-align: center; }
.login-card > p { text-align: center; margin-top: -6px; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 2px; display: block; filter: drop-shadow(0 8px 22px rgba(91, 110, 255, 0.35)); }

.code-inline {
  font-family: var(--mono); font-size: 0.9em; background: var(--bg-2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 6px; color: #d3defa; overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ painel */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }

.pc-card {
  display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(180deg, rgba(25, 34, 52, 0.9), rgba(17, 24, 37, 0.95));
  border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}
.pc-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.pc-card.is-offline { background: linear-gradient(180deg, rgba(21, 27, 39, 0.85), rgba(15, 20, 30, 0.92)); }
.pc-card.is-offline .pc-os { opacity: 0.55; }

.pc-card-head { display: flex; align-items: flex-start; gap: 12px; }
.pc-os {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--border-2); color: #dbe4f5;
}
.pc-os .icon { width: 24px; height: 24px; }
.pc-os .os-windows { color: #59a8ff; }
.pc-os .os-macos { color: #e9edf5; }
.pc-os-lg { width: 52px; height: 52px; border-radius: 14px; }
.pc-os-lg .icon { width: 28px; height: 28px; }
.pc-title { flex: 1; min-width: 0; }
.pc-name { display: block; color: var(--text); font-weight: 650; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-name:hover { color: #fff; }
.pc-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--border);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.is-online .status-pill { background: var(--ok-soft); color: #7deaae; border-color: rgba(52, 212, 127, 0.3); }
.is-online .status-pill .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 212, 127, 0.2); }
.is-offline .status-pill .dot { background: #6b7690; }

.pc-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pc-meters .meter-wide { grid-column: 1 / -1; }
/* No cartão o valor nunca desce de linha: o rótulo é que corta com reticências. */
.pc-meters .meter-head { flex-wrap: nowrap; }
.pc-meters .meter-label { flex: 1 1 auto; min-width: 0; }
.pc-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 10px 12px; background: var(--bg-2); border: 1px dashed var(--border); border-radius: 10px; }
.pc-note .loading { padding: 0; }
.pc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pc-actions .btn-primary { flex: 1; min-width: 110px; }

/* ------------------------------------------------------------ medidores */
.meter { min-width: 0; }
.meter-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 8px; margin-bottom: 5px; }
.meter-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-label .icon { color: var(--muted); width: 14px; height: 14px; flex: none; }
.meter-label span { overflow: hidden; text-overflow: ellipsis; }
.meter-val { margin-left: auto; font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-bar { height: 7px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #4f7dff, #7f6bff); transition: width 0.6s ease; }
.lvl-warn .meter-fill { background: linear-gradient(90deg, #e9a62a, #f5c451); }
.lvl-crit .meter-fill { background: linear-gradient(90deg, #e2414f, #ff6b7a); }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip .icon { width: 13px; height: 13px; color: var(--muted); }
.chip.lvl-ok { color: #8eeab8; }
.chip.lvl-warn { color: #ffd27a; border-color: rgba(245, 183, 59, 0.35); background: var(--warn-soft); }
.chip.lvl-crit { color: #ff9aa4; border-color: rgba(255, 92, 108, 0.4); background: var(--crit-soft); }
.chip-btn { cursor: pointer; font: inherit; font-size: 13px; padding: 5px 11px; }
.chip-btn:hover { background: var(--accent-soft); border-color: rgba(91, 140, 255, 0.45); color: var(--text); }
.chip-btn.is-off { opacity: 0.55; }
.chip-hint { border-style: dashed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-right: 2px; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); }
.badge.lvl-ok { background: var(--ok-soft); color: #7deaae; }
.badge.lvl-warn { background: var(--warn-soft); color: #ffd27a; }
.badge.lvl-crit { background: var(--crit-soft); color: #ff9aa4; }

/* ---------------------------------------------- estados e carregamento */
.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--border-2); border-radius: 18px; background: rgba(18, 25, 38, 0.6); }
.empty-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty-icon .icon { width: 30px; height: 30px; }
.empty h2 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 520px; margin: 0 auto 18px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px 4px; font-size: 14px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; }
.banner > .icon { margin-top: 2px; }
.banner-body { flex: 1; min-width: 0; }
.banner-body p { margin: 0 0 8px; }
.banner-body p:last-child { margin-bottom: 0; }
.banner-error { border-color: rgba(255, 92, 108, 0.4); background: var(--crit-soft); }
.banner-error > .icon { color: var(--crit); }
.banner-warning { border-color: rgba(245, 183, 59, 0.4); background: var(--warn-soft); }
.banner-warning > .icon { color: var(--warn); }
.banner-info > .icon { color: var(--accent); }
.tab-body > .banner { margin-bottom: 14px; }

/* ------------------------------------------------------------ toasts */
.toasts {
  position: fixed; z-index: 200; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px;
  width: min(420px, calc(100vw - 32px)); pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 12px;
  background: #1a2436; border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); color: var(--text);
  font-size: 14px; pointer-events: auto; cursor: pointer;
  opacity: 0; transform: translateY(10px); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(6px); }
.toast > .icon { margin-top: 2px; }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 0; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.toast-close:hover { color: var(--text); }
.toast-success { border-color: rgba(52, 212, 127, 0.4); }
.toast-success > .icon { color: var(--ok); }
.toast-error { border-color: rgba(255, 92, 108, 0.5); }
.toast-error > .icon { color: var(--crit); }
.toast-warning { border-color: rgba(245, 183, 59, 0.45); }
.toast-warning > .icon { color: var(--warn); }
.toast-info > .icon { color: var(--accent); }

/* ------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(4, 6, 12, 0.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.15s;
}
.modal-backdrop.show { opacity: 1; }
.modal-backdrop:not(.show) { pointer-events: none; }
.modal {
  width: 100%; max-width: 470px; max-height: calc(100vh - 32px); overflow: auto;
  background: #141c2b; border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.98); transition: transform 0.15s;
}
.modal-backdrop.show .modal { transform: none; }
.modal-wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal-head h2 { font-size: 18px; overflow-wrap: anywhere; }
.modal-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.modal-icon.is-danger { background: var(--crit-soft); color: var(--crit); }
.modal-body { padding: 10px 22px 6px; color: var(--text-2); display: flex; flex-direction: column; gap: 12px; overflow-wrap: anywhere; }
.modal-body p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; flex-wrap: wrap; }

/* ------------------------------------------------------------ página do PC */
.page-pc { padding-top: 18px; }
.pc-header { margin-bottom: 14px; }
.pc-header-main { display: flex; align-items: center; gap: 14px; }
.pc-header-text { flex: 1; min-width: 0; }
.pc-h1-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pc-h1 { font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pc-header .page-sub { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-header-actions { display: flex; gap: 8px; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin: 0 0 18px;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px;
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
  border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab.active .icon { color: var(--accent); }

/* Visão geral */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.card-live { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 16px; margin: 8px 0 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.lines > div { overflow-wrap: anywhere; }
.lines.mono { font-size: 13px; }
.gpu-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.gpu-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-weight: 600; }
.gpu-head > .icon { color: var(--accent-2); }
.gpu-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-live .kv { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.id-row { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.id-row .code-inline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Energia */
.power-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.power-btn {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px; text-align: left;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.power-btn:hover { border-color: rgba(91, 140, 255, 0.5); background: var(--surface-2); }
.power-btn.is-danger:hover { border-color: rgba(255, 92, 108, 0.55); }
.power-btn:disabled { opacity: 0.6; cursor: wait; }
.power-ico { width: 38px; height: 38px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.power-btn.is-danger .power-ico { background: var(--crit-soft); color: var(--crit); }
.power-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.power-text strong { font-size: 15px; }
.power-text span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.power-btn.is-busy .power-ico { animation: pulse 1s ease-in-out infinite; }

.exec-row { display: flex; gap: 10px; align-items: stretch; margin: 10px 0 12px; }
.exec-row textarea { flex: 1; min-width: 0; }
.exec-side { display: flex; flex-direction: column; gap: 8px; width: 150px; flex: none; }
.exec-side .btn { flex: 1; }
.exec-out { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.exec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exec-cmd { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.out-pre {
  margin: 0; padding: 14px; border-radius: 11px; background: #070a10; border: 1px solid var(--border);
  font-size: 13px; line-height: 1.45; color: #d4dcea; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 520px; overflow: auto;
}
.out-pre.is-stderr { color: #ffb3ba; border-color: rgba(255, 92, 108, 0.3); }
.stderr-label { font-size: 13px; color: #ff9aa4; font-weight: 600; }
.chips + .chips { margin-top: 8px; }

/* ------------------------------------------------------------ Tela */
.screen-tab { display: flex; flex-direction: column; gap: 10px; }
.screen-toolbar, .term-toolbar, .files-toolbar, .procs-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.tb-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.screen-toolbar select.input { width: auto; max-width: 230px; }
.screen-status, .term-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-live .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 212, 127, 0.2); }
.st-wait .dot { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.st-off .dot { background: var(--crit); }

.screen-warn {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid rgba(245, 183, 59, 0.4); color: #ffe1a3; font-size: 14px;
}
.screen-warn > span { flex: 1; }
.screen-warn > .icon { color: var(--warn); }

.screen-stage {
  position: relative; width: 100%; max-height: calc(100vh - 290px); min-height: 200px;
  background: #000; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
@supports (height: 100dvh) {
  .screen-stage { max-height: calc(100dvh - 290px); }
}
/* Canvas visível: o screen.js desenha a imagem do PC nele em px do aparelho (área x
   devicePixelRatio) e fixa a largura/altura em px; sem object-fit nem transform. */
.screen-canvas {
  position: absolute; left: 0; top: 0; display: block; width: 100%; height: 100%; outline: none;
  image-rendering: auto; background: #000; cursor: default;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* imagem do PC em tamanho real e cópias: no DOM (Safari antigo), mas invisíveis */
.screen-fbbox { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.screen-fbbox canvas { display: block; width: 1px; height: 1px; }
.screen-stage.controlling { border-color: rgba(91, 140, 255, 0.6); box-shadow: 0 0 0 3px var(--accent-soft); }
.screen-stage.controlling .screen-canvas { touch-action: none; }
.screen-stage.controlling .screen-canvas:focus { box-shadow: inset 0 0 0 2px rgba(91, 140, 255, 0.55); }
.screen-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(5, 8, 14, 0.78); color: var(--text-2); text-align: center; padding: 20px; font-size: 15px;
}
.screen-overlay.is-error .screen-overlay-text { color: #ffc2c8; }
.screen-overlay-text { max-width: 560px; overflow-wrap: anywhere; }

.fs-bar { display: none; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); gap: 8px; z-index: 3; opacity: 0.35; transition: opacity 0.2s; }
.fs-bar:hover, .fs-bar:focus-within { opacity: 1; }
.screen-stage.is-full .fs-bar { display: flex; }
.fs-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: rgba(16, 22, 34, 0.9); border: 1px solid var(--border-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.fs-chip.on { border-color: var(--accent); color: #cfe0ff; }
.screen-stage.is-full { max-height: none !important; height: 100%; border-radius: 0; border: 0; aspect-ratio: auto !important; }
.screen-stage:fullscreen { width: 100vw; height: 100vh; max-height: none !important; border-radius: 0; border: 0; }
.screen-stage:-webkit-full-screen { width: 100vw; height: 100vh; max-height: none !important; border-radius: 0; border: 0; }
.screen-stage.pseudo-fs { position: fixed; inset: 0; z-index: 120; width: 100vw; height: 100vh; max-height: none !important; border-radius: 0; border: 0; }
@supports (height: 100dvh) {
  .screen-stage.pseudo-fs { height: 100dvh; }
}

.shortcut-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.text-panel { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.text-panel-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.text-panel-row .muted { flex: 1; }
.screen-tip { margin: 0; }

/* Tela no celular (toque). A "vista" recorta a imagem; o zoom é desenhado no próprio canvas. */
.screen-view { position: absolute; inset: 0; overflow: hidden; }
.screen-stage.touch-ui .screen-view,
.screen-stage.touch-ui .screen-canvas {
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.screen-stage.touch-ui .screen-canvas:focus { box-shadow: none; }
.screen-tab.touch-ui .shortcut-row { display: none; }
.screen-stage.is-full.touch-ui .fs-bar { display: none; }
html.screen-fs, html.screen-fs body { overscroll-behavior: none; }
.screen-stage.is-full { overscroll-behavior: none; }

/* marcador do último clique, setinha do touchpad, lupa, zoom, dicas */
.tmark {
  position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.95), 0 0 10px rgba(0, 0, 0, 0.6);
  pointer-events: none; z-index: 2; opacity: 0; transition: opacity 0.25s;
}
.tmark.on { opacity: 0.95; }
/* setinha local do touchpad e setinha do PC (modo retângulos): sempre do mesmo tamanho */
.tcursor, .rcursor { position: absolute; left: 0; top: 0; width: 20px; height: 28px; margin: -1.5px 0 0 -1.5px; pointer-events: none; z-index: 3; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.tcursor svg, .rcursor svg { display: block; width: 20px; height: 28px; }
.rcursor { z-index: 2; }
.tlupa {
  position: absolute; left: 0; top: 0; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: #000;
  border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.9), 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none; z-index: 4;
}
.tlupa-cv { display: block; width: 100%; height: 100%; }
.tzoom {
  position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(10, 13, 20, 0.78);
  border: 1px solid var(--border-2); color: var(--text); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums;
  pointer-events: none; z-index: 3;
}
.thint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5;
  width: max-content; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 13px; border-radius: 12px; background: rgba(16, 22, 34, 0.96); border: 1px solid var(--border-2);
  box-shadow: var(--shadow); color: var(--text); font-size: 13.5px; line-height: 1.35; touch-action: manipulation;
}
.thint-text { flex: 1 1 auto; min-width: 0; }
.thint-btn {
  flex: 0 0 auto; min-height: 40px; padding: 6px 14px; border-radius: 9px; border: 0; background: var(--accent); color: #fff;
  font: inherit; font-weight: 650; cursor: pointer; touch-action: manipulation;
}
.thint-x {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation;
}
.thint-x .icon { width: 16px; height: 16px; }
/* textarea invisível do teclado do celular (16px: o iPhone não dá zoom ao focar) */
.tkb {
  position: absolute; left: 0; top: 0; width: 2px; height: 2px; margin: 0; padding: 0; border: 0; outline: none; opacity: 0;
  font-size: 16px; line-height: 1; resize: none; overflow: hidden; background: transparent; color: transparent;
  caret-color: transparent; pointer-events: none; z-index: 0; -webkit-user-select: text; user-select: text;
}

/* barra de botões do celular */
.mdock { display: flex; flex-direction: column; gap: 8px; }
.mbar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.mbar-g { display: flex; gap: 5px; }
.mbar-fs { display: none; }
.mbtn {
  flex: 0 0 auto; min-width: 50px; height: 52px; padding: 4px 6px; display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.mbtn .icon { width: 22px; height: 22px; vertical-align: 0; }
.mbtn-cap { font-size: 10.5px; line-height: 1.1; color: var(--text-2); white-space: nowrap; }
.mbtn-glyph { font-size: 14px; font-weight: 750; line-height: 22px; height: 22px; letter-spacing: -0.02em; }
.mbtn:active { transform: scale(0.95); }
.mbtn.on { background: var(--accent-soft); border-color: var(--accent); color: #d6e4ff; }
.mbtn.on .mbtn-cap { color: #d6e4ff; }
.mbtn:disabled { opacity: 0.4; cursor: default; transform: none; }
.mhandle { display: none; }

/* som do PC e microfone: ligando = ícone piscando; pausado = borda tracejada;
   microfone ligado = vermelho com bolinha (privacidade: tem que dar para ver de longe) */
.btn.som-btn.on { background: var(--accent-soft); border-color: var(--accent); color: #d6e4ff; }
.mbtn.is-wait .icon, .btn.som-btn.is-wait .icon, .fs-chip.is-wait .icon { animation: pulse 1.2s ease-in-out infinite; }
.mbtn.is-paused, .btn.som-btn.is-paused, .fs-chip.is-paused { border-style: dashed; }
.mbtn.mic-on, .btn.som-btn.mic-on, .fs-chip.mic-on { position: relative; background: rgba(255, 92, 108, 0.18); border-color: var(--crit); color: #ffd3d8; }
.mbtn.mic-on .mbtn-cap { color: #ffd3d8; }
.mbtn.mic-on::after, .btn.som-btn.mic-on::after, .fs-chip.mic-on::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--crit); box-shadow: 0 0 0 2px rgba(255, 92, 108, 0.32); pointer-events: none;
}
.screen-tab.touch-ui .tb-som .som-btn { display: none; } /* no celular ficam na barra de baixo */
.msheet-som { flex-wrap: wrap; }

/* Tela do PC: resolução, tela principal e monitor virtual (painel no computador, seção no
   menu Teclas do celular) e "A imagem voltou? Manter / Voltar" por cima da imagem */
.btn.dsp-btn.on { background: var(--accent-soft); border-color: var(--accent); color: #d6e4ff; }
.dsp-panel {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}
.dsp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dsp-head strong { font-size: 15px; }
.dsp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dsp-row select.input { width: auto; flex: 1 1 200px; max-width: 360px; min-width: 0; }
.dsp-label { font-size: 14px; color: var(--text-2); }
.dsp-now { margin: 0; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dsp-now.dsp-vstatus { font-size: 13px; overflow-wrap: anywhere; }
.screen-tab.touch-ui .dsp-btn, .screen-tab.touch-ui .dsp-panel { display: none; } /* no celular: menu Teclas */
.msheet-dsp { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.msheet-dsp strong { font-size: 15px; }
.msheet-dsp .dsp-row select.input { min-height: 44px; font-size: 16px; max-width: none; } /* 16px: o iPhone não dá zoom */
.dconfirm {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 7;
  width: max-content; max-width: calc(100% - 20px); display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  padding: 9px 10px 9px 13px; border-radius: 12px; background: rgba(16, 22, 34, 0.97); border: 1px solid var(--accent);
  box-shadow: var(--shadow); color: var(--text); font-size: 14px; line-height: 1.35; touch-action: manipulation;
}
.dconfirm-text { flex: 1 1 180px; min-width: 0; }
.dconfirm-back {
  flex: 0 0 auto; min-height: 40px; padding: 6px 14px; border-radius: 9px; border: 1px solid var(--border-2);
  background: transparent; color: var(--text); font: inherit; font-weight: 650; cursor: pointer; touch-action: manipulation;
}
.msheet-opts { display: flex; flex: 1 1 190px; gap: 6px; }
.msheet-opts .mkey { flex: 1 1 0; min-width: 56px; }

/* painel de teclas / ajuda */
.msheet {
  padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.msheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.msheet-head strong { font-size: 15px; }
.msheet-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.mkey {
  min-height: 44px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 14px; cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; -webkit-tap-highlight-color: transparent;
}
.mkey:active { background: var(--accent-soft); }
.mkey-long { grid-column: span 2; }
.mkey.is-off { opacity: 0.55; }
.mkey.hint { border-style: dashed; }
.mkey.on { border-color: var(--accent); color: #d6e4ff; }
.mkey-wide { flex: 1 1 180px; }
.msheet-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msheet-range { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--text-2); }
.msheet-range input { flex: 1 1 80px; min-width: 80px; min-height: 36px; accent-color: var(--accent); }
.msheet-val { flex: 0 0 auto; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.mhelp { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mhelp li { display: flex; gap: 12px; align-items: flex-start; }
.mhelp .gico {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: #cfe0ff;
  display: inline-flex; align-items: center; justify-content: center;
}
.mhelp .gico .icon { width: 24px; height: 24px; vertical-align: 0; }
.mhelp b { display: block; font-size: 14px; }
.mhelp li span:not(.gico) { font-size: 13px; color: var(--text-2); }
.mhelp-foot { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* tela cheia no celular: imagem + barra lado a lado (paisagem) ou em cima/embaixo (retrato) */
.screen-stage.is-full.touch-ui { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.screen-stage.is-full.touch-ui .screen-view { position: relative; inset: auto; flex: 1 1 auto; min-width: 0; min-height: 0; }
.screen-stage.is-full .mdock { flex: 0 0 auto; display: block; }
/* 12 botões: retrato = 6 colunas x 2 linhas (cabe em 375 px); paisagem = coluna lateral */
.screen-stage.is-full .mbar {
  display: grid; grid-template-columns: repeat(6, 48px); grid-auto-rows: 48px; gap: 5px; justify-content: center;
  padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: rgba(10, 13, 20, 0.94); border-top: 1px solid var(--border);
}
.screen-stage.is-full .mbar-g, .screen-stage.is-full .mbar-fs { display: contents; }
.screen-stage.is-full .mbtn { width: 48px; min-width: 0; height: 48px; padding: 2px; border-radius: 11px; }
.screen-stage.is-full .mbtn-cap { font-size: 9.5px; }
.screen-stage.is-full .msheet,
.screen-stage.is-full.touch-ui .text-panel {
  position: absolute; z-index: 6; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right)); max-width: 620px; margin: 0 auto; max-height: calc(100% - 140px);
  overflow-y: auto; box-shadow: var(--shadow-lg); touch-action: pan-y;
}
.screen-stage.is-full.mbar-min .mdock { display: none; }
.screen-stage.is-full.mbar-min .mhandle {
  display: flex; position: absolute; z-index: 5; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom));
  width: 46px; height: 46px; border-radius: 50%; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(16, 22, 34, 0.72); border: 1px solid var(--border-2); color: var(--text); touch-action: manipulation;
}
.mhandle .icon { width: 22px; height: 22px; vertical-align: 0; }
@media (max-width: 340px) {
  /* celular estreito (320 px): 6 x 44 px ainda cabem */
  .screen-stage.is-full .mbar { grid-template-columns: repeat(6, 44px); grid-auto-rows: 44px; gap: 4px; }
  .screen-stage.is-full .mbtn { width: 44px; height: 44px; }
}
/* Paisagem: barra lateral de 2 colunas x 6 linhas de 44 px (~300 px de altura). A largura da
   barra (2 x 44 + 4 + 12 de folga + 1 de borda = 105 px) entra no "right" do painel de teclas. */
@media (orientation: landscape) {
  .screen-stage.is-full.touch-ui { flex-direction: row; }
  .screen-stage.is-full .mbar {
    height: 100%; grid-template-columns: repeat(2, 44px); grid-auto-rows: 44px; gap: 4px; align-content: center; overflow-y: auto;
    padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) 6px;
    border-top: 0; border-left: 1px solid var(--border);
  }
  .screen-stage.is-full .mbtn { width: 44px; height: 44px; }
  .screen-stage.is-full .msheet,
  .screen-stage.is-full.touch-ui .text-panel { right: calc(116px + env(safe-area-inset-right)); max-height: calc(100% - 16px); }
}
/* Paisagem baixa (iPhone pequeno com as barras do Safari): 3 colunas x 4 linhas (188 px);
   largura 3 x 44 + 8 + 13 = 153 px. Se ainda não couber, a barra rola. */
@media (orientation: landscape) and (max-height: 330px) {
  .screen-stage.is-full .mbar { grid-template-columns: repeat(3, 44px); }
  .screen-stage.is-full .msheet,
  .screen-stage.is-full.touch-ui .text-panel { right: calc(164px + env(safe-area-inset-right)); }
}

/* ------------------------------------------------------------ Terminal */
.term-tab { display: flex; flex-direction: column; gap: 10px; }
.term-frame { background: #0b0f17; border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px 6px 12px; }
.term-host { height: calc(100vh - 330px); min-height: 300px; width: 100%; overflow: hidden; }
@supports (height: 100dvh) {
  .term-host { height: calc(100dvh - 330px); }
}
.term-host .xterm { height: 100%; }
.term-host .xterm-viewport { background-color: #0b0f17 !important; }
.term-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.term-keys .chip-btn { font-family: var(--mono); font-size: 12.5px; }
.term-toolbar .btn-sm:not(.btn-icon) { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ Arquivos */
.files-tab { display: flex; flex-direction: column; gap: 10px; }
.path-form { flex: 1; min-width: 200px; }
.crumbs {
  display: flex; align-items: center; gap: 2px; overflow-x: auto; white-space: nowrap; scrollbar-width: thin;
  padding: 4px 2px; font-size: 14px;
}
.crumb { background: transparent; border: 0; color: var(--text-2); font: inherit; padding: 4px 8px; border-radius: 7px; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 650; cursor: default; }
.crumb-sep { display: inline-flex; color: #4a5671; }
.crumb-sep .icon { width: 14px; height: 14px; }
.crumb-ico { color: var(--muted); margin: 0 2px 0 4px; }

.uploads { display: flex; flex-direction: column; gap: 8px; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.up-item > .icon { color: var(--accent); }
.up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.up-line { display: flex; justify-content: space-between; gap: 10px; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.up-status { white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-item .meter-bar { height: 6px; }
.up-item.is-ok > .icon { color: var(--ok); }
.up-item.is-ok .meter-fill { background: var(--ok); }
.up-item.is-error { border-color: rgba(255, 92, 108, 0.4); }
.up-item.is-error > .icon, .up-item.is-error .up-status { color: #ff9aa4; }
.up-item.is-skip { opacity: 0.7; }

.file-list-wrap { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; transition: opacity 0.15s; }
.file-list-wrap.is-loading .file-list { opacity: 0.55; pointer-events: none; }
.file-list-wrap.drag-over { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drop-hint {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 10px;
  background: rgba(13, 20, 34, 0.86); color: #cfe0ff; font-weight: 650; font-size: 16px; pointer-events: none;
}
.drop-hint .icon { width: 26px; height: 26px; }
.file-list-wrap.drag-over .drop-hint { display: flex; }
.file-list > .banner, .file-list > .loading { margin: 12px; }

.frow {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 110px 150px 112px; align-items: center;
  min-height: 46px; padding: 0 10px; border-top: 1px solid rgba(35, 48, 73, 0.6);
}
.frow:first-child { border-top: 0; }
.frow:hover:not(.fhead) { background: rgba(29, 40, 60, 0.55); }
.fhead { min-height: 40px; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.fcell { min-width: 0; font-size: 14px; }
.fico { display: flex; align-items: center; color: var(--muted); }
.frow.is-dir .fico { color: #7fa6ff; }
.frow.is-up .fico { color: var(--muted); }
.fname { display: flex; flex-direction: column; justify-content: center; }
.fname-btn {
  background: transparent; border: 0; padding: 4px 0; font: inherit; color: var(--text); text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
a.fname-btn { display: block; }
.fname-btn:hover { color: #fff; text-decoration: underline; }
.frow.is-dir .fname-btn { font-weight: 600; }
.fsize, .fdate { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fsize { text-align: right; padding-right: 18px; }
.fact { display: flex; justify-content: flex-end; gap: 2px; }
.fmeta-mobile { display: none; color: var(--muted); font-size: 12.5px; }
.th-btn { background: transparent; border: 0; padding: 0; font: inherit; color: var(--muted); font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.th-btn:hover, .th-btn.active { color: var(--text); }
.sort-ind { font-size: 9px; }
.fhead .fsize { text-align: right; }
.file-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 16px; color: var(--muted); }
.files-footer { padding: 0 4px; }

/* ------------------------------------------------------------ Processos */
.procs-tab { display: flex; flex-direction: column; gap: 10px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 520px; }
.search-box > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 36px; }
.table-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: auto; background: var(--surface); max-height: calc(100vh - 290px); }
@supports (height: 100dvh) {
  .table-wrap { max-height: calc(100dvh - 290px); }
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; padding: 10px 12px; color: var(--muted); font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table th.num { text-align: right; }
.table th.num .th-btn { justify-content: flex-end; }
.table td { padding: 7px 12px; border-top: 1px solid rgba(35, 48, 73, 0.6); white-space: nowrap; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: rgba(29, 40, 60, 0.55); }
.c-pid { width: 80px; color: var(--muted); font-size: 13px; }
.c-name { max-width: 260px; }
.pname { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.c-user { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.c-cpu, .c-mem { width: 100px; font-variant-numeric: tabular-nums; }
.c-cpu.hot { color: #ffd27a; font-weight: 650; }
.c-cmd { max-width: 420px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.c-act { width: 44px; text-align: right; }
.procs-info { padding: 0 4px; }

/* ------------------------------------------------------------ Adicionar PC */
.enroll-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.enroll-code {
  font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: 0.12em;
  padding: 10px 20px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border-2);
  color: #dfe8ff; user-select: all; -webkit-user-select: all;
}
.os-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.os-col { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.os-col h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 16px; }
.os-col h3 .os-windows { color: #59a8ff; }
.steps { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 14.5px; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.steps strong { color: var(--text); }
.tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tips li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 14.5px; }
.tips li > .icon { color: var(--accent); margin-top: 3px; width: 18px; height: 18px; }
.tips strong { color: var(--text); }
.bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 14.5px; }
.code-wrap { position: relative; }
.code-box {
  margin: 0; padding: 14px 16px; padding-right: 104px; border-radius: 11px; background: #070a10; border: 1px solid var(--border);
  color: #d4e0fa; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.code-wrap .btn { position: absolute; top: 8px; right: 8px; }
.update-note { margin: 10px 0 0; }
.cmd-title { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-size: 14px; color: var(--text-2); }
.cmd-title .os-windows { color: #59a8ff; }

/* ------------------------------------------------------------ responsivo */
@media (max-width: 980px) {
  .frow { grid-template-columns: 36px minmax(0, 1fr) 100px 112px; }
  .frow .fdate { display: none; }
  .c-cmd { display: none; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --topbar-h: 54px; }
  body { font-size: 14.5px; }
  h1 { font-size: 22px; }
  .topbar { gap: 8px; }
  .brand-name { display: none; }
  .topnav { margin-left: 4px; gap: 2px; }
  .topnav-link { padding: 8px 10px; }
  .topnav-link .nav-label { display: none; }
  .topnav-link .icon { width: 20px; height: 20px; }
  .conn { padding: 5px 9px; }
  .page { padding-top: 18px; }
  .page-head { margin-bottom: 16px; }
  .pc-grid { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: 1fr; }
  .os-columns, .form-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .pc-h1 { font-size: 20px; }
  .pc-header-main { flex-wrap: wrap; }
  .pc-header-actions { width: 100%; }
  .pc-header-actions .btn { flex: 1; }
  .tab { padding: 9px 11px; }
  .exec-row { flex-direction: column; }
  .exec-side { width: 100%; flex-direction: row; }
  .exec-side select { flex: 1; }
  .frow { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 4px 8px; min-height: 52px; }
  .frow .fsize, .frow .fdate { display: none; }
  .fhead .fsize, .fhead .fdate { display: none; }
  .fmeta-mobile { display: block; }
  .frow.is-up .fmeta-mobile, .fhead .fmeta-mobile { display: none; }
  .c-user { display: none; }
  .c-pid { width: 64px; }
  .c-name { max-width: 150px; }
  .screen-toolbar select.input { max-width: 46vw; }
  .screen-stage { max-height: calc(100vh - 250px); }
  .term-host { height: calc(100vh - 300px); min-height: 260px; }
  .enroll-code { font-size: 24px; letter-spacing: 0.08em; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .toasts { left: 16px; right: 16px; width: auto; bottom: 12px; }
  .modal-actions .btn { flex: 1; }
  .code-box { padding-right: 16px; padding-top: 48px; }
  .search-box { max-width: none; }
}

@media (max-width: 420px) {
  .pc-meters { grid-template-columns: 1fr; }
  .tb-group { gap: 6px; }
  .screen-toolbar .tb-group:first-child { width: 100%; }
  .screen-toolbar .tb-group:first-child select.input { flex: 1 1 45%; max-width: none; }
}

@media (pointer: coarse) {
  .icon-btn { width: 38px; height: 38px; }
  .chip-btn { padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

/* ------------------------------------------- Abrir/instalar (Arquivos) e UAC (Energia) */
.file-list.can-open .frow { grid-template-columns: 36px minmax(0, 1fr) 110px 150px 160px; }
.icon-btn.is-open { color: var(--accent); }
.uac-modes { margin: 8px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 14px; }
.uac-modes strong { color: var(--text); }
.uac-now { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; min-height: 26px; }
.uac-note { margin: 10px 0 0; }
.uac-tip { margin: 12px 0 0; }

@media (max-width: 980px) {
  .file-list.can-open .frow { grid-template-columns: 36px minmax(0, 1fr) 100px 160px; }
}

@media (max-width: 760px) {
  .file-list.can-open .frow { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .file-list.can-open .frow:not(.fhead) .fact { display: grid; grid-template-columns: repeat(2, auto); gap: 2px; justify-content: end; }
  .uac-actions .btn { flex: 1 1 100%; }
}

/* ------------------------------------------------------------ Controle de jogo (jogo.js, 1.4)
   Por cima da imagem: analógico (esquerda), mira (direita) e botões. Vários dedos ao mesmo
   tempo; nada de rolar/zoom do navegador aqui. --jb = tamanho dos botões (Pequenos/Médios/
   Grandes; menor numa área baixa); --jm = folga das bordas (entalhe do iPhone incluído); --jbt =
   folga de baixo (fora da faixa do gesto de "início" do iPhone). */
.jogo {
  --jb: 60px; --jm: max(12px, env(safe-area-inset-right)); --jl: max(12px, env(safe-area-inset-left));
  --jbt: max(12px, env(safe-area-inset-bottom));
  position: absolute; inset: 0; z-index: 4; overflow: hidden; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.jogo.jogo-tam-p { --jb: 48px; }
.jogo.jogo-tam-g { --jb: 74px; }
.jogo.jogo-compacto { --jb: 42px; }
.jogo.jogo-compacto.jogo-tam-g { --jb: 50px; }
/* baixa e estreita ao mesmo tempo (ou muito baixa): 40 px em qualquer tamanho, nada se encosta */
.jogo.jogo-minimo, .jogo.jogo-minimo.jogo-tam-g { --jb: 40px; }
.screen-overlay:not([hidden]) ~ .jogo { display: none; } /* conectando/desconectado: o aviso fica visível */
.jogo-zona { position: absolute; top: 0; bottom: 0; }
.jogo-zona-stick { left: 0; width: 42%; }
.jogo-zona-mira { right: 0; width: 58%; border-left: 1px dashed rgba(255, 255, 255, 0.12); }
.jogo-zona-txt {
  position: absolute; bottom: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(10, 13, 20, 0.45);
  color: rgba(231, 236, 245, 0.7); font-size: 11.5px; white-space: nowrap; pointer-events: none;
}
.jogo-zona-stick .jogo-zona-txt { left: var(--jl); }
.jogo-zona-mira .jogo-zona-txt { left: 50%; transform: translateX(-50%); }
.jogo-compacto .jogo-zona-txt { display: none; }
.jogo-stick {
  position: absolute; left: 0; top: 0; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45); background: rgba(10, 13, 20, 0.28); pointer-events: none;
}
.jogo-stick.repouso { left: calc(var(--jl) + 70px); top: auto; bottom: 46px; margin: 0 0 -56px -56px; opacity: 0.45; }
.jogo-compacto .jogo-stick.repouso { left: calc(var(--jl) + 50px); bottom: 50px; }
.jogo-knob {
  position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%;
  background: rgba(231, 236, 245, 0.55); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.jogo-b {
  position: absolute; width: var(--jb); height: var(--jb); padding: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: rgba(16, 22, 34, 0.5); border: 2px solid rgba(255, 255, 255, 0.4); color: #fff;
  font: inherit; font-size: 12px; font-weight: 700; line-height: 1.05; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  touch-action: none; cursor: pointer;
}
.jogo-b.on { background: rgba(91, 140, 255, 0.6); border-color: #cfe0ff; transform: scale(0.94); }
.jogo-b-sub { font-size: 10px; font-weight: 600; opacity: 0.8; }
.jogo-compacto .jogo-b { font-size: 10px; }
.jogo-compacto .jogo-b-sub { display: none; }
/* grupo da direita, contado a partir do canto de baixo (unidades de --jb). 1.4.1: Atirar maior
   (1,45) e Mirar mais longe dele (vão de ~0,66 entre os círculos, antes 0,2: o polegar indo no
   Atirar acertava o Mirar e o botão direito ficava apertado). Atirar continua o maior alvo.
   O grupo sobe até 12px + 4,3 x --jb (Usar): jogo.js (ALTURA_MIN) passa para jogo-baixo quando
   a área não tem essa altura mais a fileira de cima (Grandes: 400 px). */
.jb-pular { right: var(--jm); bottom: var(--jbt); }
.jb-agachar { right: calc(var(--jm) + 1.3 * var(--jb)); bottom: var(--jbt); }
.jb-atirar { right: var(--jm); bottom: calc(var(--jbt) + 1.35 * var(--jb)); width: calc(1.45 * var(--jb)); height: calc(1.45 * var(--jb)); font-size: 14px; }
.jb-mirar { right: calc(var(--jm) + 2 * var(--jb)); bottom: calc(var(--jbt) + 2.2 * var(--jb)); }
.jb-recarregar { right: var(--jm); bottom: calc(var(--jbt) + 3.15 * var(--jb)); }
.jb-usar { right: calc(var(--jm) + 1.25 * var(--jb)); bottom: calc(var(--jbt) + 3.3 * var(--jb)); }
/* área baixa (deitado com pouca altura): Recarregar e Usar descem para a fileira de baixo, à
   esquerda de Agachar, para o grupo não subir até a fileira de cima */
.jogo-baixo .jb-recarregar { right: calc(var(--jm) + 2.5 * var(--jb)); bottom: var(--jbt); }
.jogo-baixo .jb-usar { right: calc(var(--jm) + 3.65 * var(--jb)); bottom: var(--jbt); }
.jb-correr { left: var(--jl); bottom: calc(46px + 112px + 8px); }
/* área baixa: a fileira de cima pode quebrar em duas linhas; Correr vai para o lado do analógico */
.jogo-baixo .jb-correr { left: calc(var(--jl) + 110px); bottom: var(--jbt); }
/* fileira de cima: armas, 4, Comprar, Tab e Esc (esquerda; quebra em duas linhas se faltar
   espaço), Ajustes, Teclado e Esconder (direita) */
.jogo-topo {
  position: absolute; top: max(8px, env(safe-area-inset-top)); left: var(--jl); display: flex; flex-wrap: wrap; gap: 6px;
  max-width: calc(100% - var(--jl) - var(--jm) - 290px);
}
.jogo-compacto .jogo-topo { max-width: calc(100% - var(--jl) - var(--jm) - 218px); gap: 5px; }
.jogo-topo .jogo-b { position: static; width: calc(0.8 * var(--jb)); height: calc(0.62 * var(--jb)); border-radius: 10px; font-size: 13px; }
.jogo-topo .jb-comprar, .jogo-topo .jb-placar { width: auto; min-width: calc(0.8 * var(--jb)); padding: 0 10px; flex-direction: row; gap: 5px; }
.jogo-compacto .jogo-topo .jogo-b { width: calc(0.7 * var(--jb)); height: calc(0.62 * var(--jb)); font-size: 12px; }
.jogo-compacto .jogo-topo .jb-comprar, .jogo-compacto .jogo-topo .jb-placar { width: auto; padding: 0 7px; }
.jogo-ui { position: absolute; top: max(8px, env(safe-area-inset-top)); right: var(--jm); display: flex; gap: 6px; }
.jogo-compacto .jogo-ui { gap: 4px; }
.jogo-compacto .jogo-ui-btn { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.jogo-ui-btn[hidden] { display: none; }
.jogo-ui-btn {
  min-height: 36px; padding: 6px 12px; border-radius: 10px; background: rgba(16, 22, 34, 0.78); border: 1px solid var(--border-2);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; touch-action: manipulation;
}
.jogo-ui-btn.on { border-color: var(--accent); color: #d6e4ff; }
.jogo-esconder { border-color: rgba(255, 255, 255, 0.35); }
.jogo-ajustes {
  position: absolute; z-index: 2; top: calc(max(8px, env(safe-area-inset-top)) + 44px); right: var(--jm);
  width: min(340px, calc(100% - 24px)); max-height: calc(100% - 64px); overflow-y: auto; touch-action: pan-y;
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px;
  background: rgba(16, 22, 34, 0.97); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); color: var(--text); font-size: 14px;
}
.jogo-ajustes[hidden] { display: none; }
.jogo-linha { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.jogo-linha input[type="range"] { flex: 1 1 120px; min-height: 36px; accent-color: var(--accent); }
.jogo-linha input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.jogo-val { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.jogo-opt {
  flex: 1 1 0; min-height: 40px; padding: 6px 8px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 13px; cursor: pointer; touch-action: manipulation;
}
.jogo-opt.on { border-color: var(--accent); color: #d6e4ff; }
.jogo-nota { margin: 0; font-size: 12.5px; color: var(--muted); }
/* "Jogo aberto: … Abrir o controle?" (mesmo visual do "A imagem voltou?") */
.dconfirm.jogo-pergunta { z-index: 8; }
/* botão "Controle": barra de cima (computador) e fichas da tela cheia */
.btn.jogo-tb-btn.on { background: var(--accent-soft); border-color: var(--accent); color: #d6e4ff; }
.screen-tab.touch-ui .jogo-tb-btn { display: none; } /* no celular fica na barra de baixo */
/* com o controle aberto: a imagem fica com a tela toda (a barra volta ao esconder o controle) */
.screen-stage.jogo-on .fs-bar,
.screen-stage.is-full.jogo-on .mdock,
.screen-stage.is-full.jogo-on .mhandle { display: none !important; }
/* tela cheia no celular com o botão "Controle": 13 botões. Retrato: 7 colunas de 46 px
   (7 x 46 + 6 x 5 + 12 = 364 px, cabe em 375); estreito (320 px): 7 x 40. */
.screen-stage.is-full .mbar { grid-template-columns: repeat(7, 46px); grid-auto-rows: 46px; }
.screen-stage.is-full .mbtn { width: 46px; height: 46px; }
@media (max-width: 340px) {
  .screen-stage.is-full .mbar { grid-template-columns: repeat(7, 40px); grid-auto-rows: 40px; gap: 4px; }
  .screen-stage.is-full .mbtn { width: 40px; height: 40px; }
}
@media (orientation: landscape) {
  .screen-stage.is-full .mbar { grid-template-columns: repeat(2, 44px); grid-auto-rows: 44px; }
  .screen-stage.is-full .mbtn { width: 44px; height: 44px; }
}
@media (orientation: landscape) and (max-height: 330px) {
  .screen-stage.is-full .mbar { grid-template-columns: repeat(3, 44px); }
}
