/* movind painel: estilo ERP sóbrio. Tudo que se repete mora aqui (sem style inline). */

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-alt: #fafafa;
  --text: #333333;
  --text-strong: #1c2733;
  --muted: #6b7280;
  --border: #dfe2e7;
  --border-strong: #c5cad2;
  --navy: #1e2d3d;
  --navy-soft: #2c3e50;
  --accent: #1976d2;
  --accent-hover: #155fa8;
  --accent-soft: #e8f1fb;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok: #2e7d32;
  --ok-soft: #e8f5e9;
  --warn: #8a5a00;
  --warn-soft: #fff6e0;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 40, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  min-height: 100vh;
}

h1, h2, h3 { color: var(--text-strong); margin: 0; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------- topo */

.topbar { background: var(--navy); color: #e6ebf1; }
.topbar-inner {
  width: 100%; margin: 0 auto; padding: 0 20px;
  height: 52px; display: flex; align-items: center; gap: 24px;
}
.brand { color: #fff; font-weight: 600; font-size: 16px; letter-spacing: 0.2px; }
.brand:hover { text-decoration: none; }
.brand span { font-weight: 400; color: #aebccb; }
.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topnav a {
  color: #c9d3de; padding: 6px 12px; border-radius: var(--radius);
}
.toplinks { display: flex; gap: 2px; }
.toplinks a { color: #aebccb; padding: 6px 10px; border-radius: var(--radius); font-size: 13px; }
.toplinks a:hover { background: var(--navy-soft); color: #fff; text-decoration: none; }
.topnav a:hover { background: var(--navy-soft); color: #fff; text-decoration: none; }
.topnav a[aria-current="page"] { background: var(--navy-soft); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.topuser { display: flex; align-items: center; gap: 12px; }
.topuser-email { color: #aebccb; font-size: 13px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn-ghost { color: #e6ebf1; border-color: #4a5b6e; }
.topbar .btn-ghost:hover { background: var(--navy-soft); }

/* --------------------------------------------------------- layout */

.app-main { width: 100%; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .muted { margin-top: 2px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 600; margin: 0 0 10px; }

/* --------------------------------------------------------- botões */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-strong);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn:focus-visible, .nav-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { color: var(--danger); border-color: #e3b7b3; background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #8f1d17; border-color: #8f1d17; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------ formulários */

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; width: 100%;
}
textarea { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
input:disabled, select:disabled { background: var(--bg); color: var(--muted); }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; margin-bottom: 0; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ---------------------------------------------------- avisos e estados */

.banner {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 12px; max-width: min(640px, calc(100vw - 24px));
  padding: 10px 12px 10px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: 0 4px 14px rgba(20, 30, 40, 0.14); color: var(--text-strong);
}
.banner.is-error { border-color: #e3b7b3; background: var(--danger-soft); color: #5c1410; }
.banner.is-info { border-color: #b9d4ef; background: var(--accent-soft); color: #123a63; }
.banner-text { flex: 1; font-size: 13px; }
.banner-close { border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; padding: 0 2px; }

.alert { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-alt); margin-bottom: 12px; font-size: 13px; }
.alert-error { border-color: #e3b7b3; background: var(--danger-soft); color: #5c1410; }
.alert-ok { border-color: #b7dbb9; background: var(--ok-soft); color: #1b4d1f; }
.alert-warn { border-color: #ecd49a; background: var(--warn-soft); color: #5b3c00; }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 0; color: var(--muted); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong);
  border-top-color: var(--accent); animation: spin 0.9s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* ------------------------------------------------------------ tabelas */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid th { background: var(--surface-alt); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 600; }
table.grid tbody tr:nth-child(even) td { background: #fbfbfc; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid .actions { white-space: nowrap; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* -------------------------------------------------------- badges e dots */

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
  border-radius: 10px; font-size: 12px; font-weight: 500; border: 1px solid var(--border-strong);
  background: var(--surface-alt); color: var(--text); white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); border-color: #b9d4ef; color: #123a63; }
.badge-ok { background: var(--ok-soft); border-color: #b7dbb9; color: #1b4d1f; }
.badge-warn { background: var(--warn-soft); border-color: #ecd49a; color: #5b3c00; }
.badge-muted { color: var(--muted); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #aab2bd; flex: none; }
.dot.is-on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* ------------------------------------------------------------ medidores */

.meter { width: 100%; height: 8px; border-radius: 4px; appearance: none; -webkit-appearance: none; overflow: hidden; background: #e7eaee; border: 0; }
.meter::-webkit-progress-bar { background: #e7eaee; border-radius: 4px; }
.meter::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
.meter::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.meter.is-low::-webkit-progress-value { background: var(--danger); }
.meter.is-low::-moz-progress-bar { background: var(--danger); }
.meter.is-mid::-webkit-progress-value { background: #d89614; }
.meter.is-mid::-moz-progress-bar { background: #d89614; }
.meter.is-high::-webkit-progress-value { background: var(--ok); }
.meter.is-high::-moz-progress-bar { background: var(--ok); }

.batt { display: inline-flex; align-items: center; gap: 8px; }
.batt-cells { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 3px; }
.batt-cells span { width: 6px; height: 10px; border-radius: 1px; background: #e1e5ea; }
.batt-cells span.on { background: var(--ok); }
.batt-cells span.on.is-low { background: var(--danger); }
.batt-cells span.on.is-mid { background: #d89614; }
.batt-cells-cap { width: 2px; height: 5px; background: var(--border-strong); margin-left: -2px; align-self: center; }

.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars span { width: 4px; background: #d3d8df; border-radius: 1px; }
.bars span:nth-child(1) { height: 4px; }
.bars span:nth-child(2) { height: 7px; }
.bars span:nth-child(3) { height: 10px; }
.bars span:nth-child(4) { height: 14px; }
.bars span.on { background: var(--accent); }
.bars.is-off span { background: #d3d8df; }

/* -------------------------------------------------- cards de aparelho */

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.device-card {
  display: flex; flex-direction: column; gap: 12px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; transition: border-color 0.15s;
}
.device-card:hover { border-color: #aeb8c6; text-decoration: none; }
.device-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.device-name { font-size: 15px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.device-presence { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.device-rows { display: grid; grid-template-columns: 90px 1fr; gap: 8px 10px; align-items: center; font-size: 13px; border-top: 1px solid var(--border); padding-top: 12px; }
.device-rows dt { color: var(--muted); }
.device-rows dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.device-foot { font-size: 12px; color: var(--muted); margin-top: auto; }

/* ------------------------------------------------- tela do aparelho */

.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.page-title h1 { margin-right: 4px; }
.page-title .spacer { flex: 1; }
.device-titulo { flex: 1; min-width: 0; }

/* Layout: tela à esquerda (ocupa quase tudo), coluna de estado à direita (~340px), recolhível. */
.dev-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.dev-layout.is-lateral-off { grid-template-columns: minmax(0, 1fr); }
.dev-layout.is-lateral-off .dev-side { display: none; }
.dev-main, .dev-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dev-barra { display: flex; flex-direction: column; }
.detail-full { margin-top: 16px; }

/* Barra do navegador do cliente */
.chrome-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tabs-strip { display: flex; align-items: flex-end; gap: 2px; padding: 6px 6px 0; background: #e9ecf1; border-bottom: 1px solid var(--border); overflow-x: auto; min-height: 38px; }
.tabs-vazio { padding: 8px 10px; }
.tab-chip { display: flex; align-items: center; max-width: 230px; min-width: 120px; height: 32px; background: #dde2e9; border-radius: 6px 6px 0 0; }
.tab-chip.is-active { background: var(--surface); box-shadow: inset 0 2px 0 var(--accent); }
.tab-chip-main { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; height: 100%; padding: 0 6px 0 10px; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.tab-chip-main:disabled { cursor: not-allowed; opacity: 0.6; }
.tab-chip-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-chip.is-active .tab-chip-title { color: var(--text-strong); font-weight: 600; }
.tab-fav { width: 14px; height: 14px; flex: none; }
.tab-chip-close { width: 24px; height: 24px; margin-right: 4px; border: 0; background: transparent; border-radius: 4px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tab-chip-close:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.tab-new { width: 30px; height: 30px; margin: 0 0 2px 4px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tab-new:hover:not(:disabled) { background: var(--surface-alt); }
.nav-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.nav-ico { width: 32px; padding: 0; }
.address { display: flex; flex: 1; gap: 6px; min-width: 0; }
.address-input { flex: 1; min-width: 0; }
.chrome-aviso { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }

/* Barra do Android */
.android-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.key-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.key-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 8px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius); font: inherit; font-size: 13px; color: var(--text-strong); cursor: pointer; }
.key-btn:hover:not(:disabled) { background: var(--surface-alt); }
.key-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.key-row-apps { display: flex; }
.key-btn-apps { min-width: 140px; }

/* Tela */
.screen-frame { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.screen-frame:fullscreen { border: 0; border-radius: 0; background: #111; }
.screen-toolbar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.tb-grupo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tb-qual { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sel-qual { width: auto; height: 28px; font-size: 13px; padding: 0 6px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg-btn { border: 0; border-radius: 0; background: transparent; height: 28px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn[aria-pressed="true"] { background: var(--accent-soft); color: #123a63; font-weight: 600; }
.btn-icon { padding: 0 8px; }
.btn[aria-pressed="true"], .btn.is-on { background: var(--accent-soft); border-color: #b9d4ef; color: #123a63; }
.ico { display: inline-flex; flex: none; }
.ico svg { display: block; }

.screen-viewport {
  position: relative; height: 68vh; min-height: 320px; overflow: auto;
  display: flex; background: #eceff3; outline: none; cursor: default;
}
.screen-viewport:focus-visible, .screen-frame.is-digitando .screen-viewport { box-shadow: inset 0 0 0 2px var(--accent); }
.screen-viewport.is-pan-pronto { cursor: grab; }
.screen-frame.is-arrastando .screen-viewport { cursor: grabbing; }
.screen-img {
  display: block; margin: auto; max-width: 100%; max-height: 100%; height: auto; width: auto;
  user-select: none; -webkit-user-drag: none; touch-action: none; cursor: crosshair;
}
.screen-img.is-fit { max-width: 100%; max-height: 100%; }
.screen-img:not(.is-fit) { max-width: none; max-height: none; flex: none; }
.screen-placeholder { margin: auto; color: var(--muted); font-size: 13px; padding: 40px; text-align: center; }

.screen-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.screen-status { flex: 1; min-width: 0; }
.screen-fps { font-variant-numeric: tabular-nums; }
.screen-dica { display: none; color: var(--accent); font-weight: 600; }
.screen-frame.is-digitando .screen-dica { display: inline; }
.screen-frame:fullscreen { height: 100vh; }
.screen-frame:fullscreen .screen-viewport { flex: 1; height: auto; min-height: 0; }

/* Ferramentas do Chrome */
.tools-card { padding: 12px 14px; }
.tools-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; flex-wrap: wrap; }
.tools-tab { height: 32px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.tools-tab[aria-selected="true"] { color: var(--text-strong); border-bottom-color: var(--accent); font-weight: 600; }
.tools-tab:disabled { opacity: 0.5; cursor: not-allowed; }
.tools-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tools-head h3 { margin: 0; }
.tools-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tools-corpo { min-height: 80px; max-height: 360px; overflow: auto; }
.tool-lista { list-style: none; margin: 0; padding: 0; }
.tool-linha { display: grid; grid-template-columns: 70px auto minmax(0, 1fr); gap: 4px 10px; align-items: baseline; padding: 6px 4px; border-top: 1px solid var(--border); font-size: 13px; }
.tool-linha:first-child { border-top: 0; }
.tool-linha.is-ruim { background: var(--danger-soft); }
.tool-hora { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.tool-met { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tool-texto { overflow-wrap: anywhere; color: var(--text-strong); }
.tool-sub { grid-column: 3; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.tool-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin: 0; max-height: 300px; overflow: auto; }
.badge-danger { background: var(--danger-soft); border-color: #e3b7b3; color: #7a1d17; }

/* Apps e atalhos */
.app-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.app-list li + li { border-top: 1px solid var(--border); }
.app-item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 0; background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.app-item:hover { background: var(--accent-soft); }
.app-nome { color: var(--text-strong); }
.app-pacote { font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; }
.app-busca, .modal-input { width: 100%; }
.atalhos dt { font-weight: 600; color: var(--text-strong); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-strong); min-width: 0; overflow-wrap: anywhere; }
.kv-divider { border-top: 1px solid var(--border); margin: 12px 0; }
.bar-block { margin-top: 10px; }
.bar-caption { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: baseline;
  padding: 9px 4px; border-top: 1px solid var(--border); font-size: 13px;
}
.timeline li:first-child { border-top: 0; }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.timeline .what { color: var(--text-strong); }
.timeline .detail { color: var(--muted); font-size: 12px; }
.timeline .tag { font-size: 11px; }

/* Tela pequena: tudo empilha; a página não rola para o lado */
@media (max-width: 1000px) {
  .dev-layout { grid-template-columns: minmax(0, 1fr); }
  .dev-layout.is-lateral-off .dev-side { display: none; }
  .screen-viewport { height: auto; min-height: 260px; max-height: 70vh; }
}
@media (max-width: 800px) {
  .tab-chip { min-width: 100px; max-width: 170px; }
  .tb-grupo { width: 100%; }
  .timeline li { grid-template-columns: 84px 1fr; }
  .timeline .tag { display: none; }
  .kv { grid-template-columns: 120px 1fr; }
}

/* --------------------------------------------------------- código e modal */

.pair-code {
  font-family: var(--mono); font-size: 34px; letter-spacing: 3px; color: var(--text-strong);
  background: var(--surface-alt); border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 18px 20px; text-align: center; user-select: all; margin: 12px 0;
}
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 4px; }
.pair-state { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.narrow { max-width: 640px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 30, 40, 0.42); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(20, 30, 40, 0.25);
  width: min(440px, 100%); padding: 20px;
}
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--text); }

/* ------------------------------------------------------------ login */

.login-wrap { min-height: calc(100vh - 0px); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); text-align: center; }
.login-card .brand-big { font-size: 22px; font-weight: 600; color: var(--text-strong); margin-bottom: 4px; }
.login-card .brand-big span { font-weight: 400; color: var(--muted); }
.login-card p.muted { margin-bottom: 20px; }
.login-btn { display: flex; justify-content: center; min-height: 44px; }
.login-card .alert { text-align: left; }

.card-title { margin-bottom: 12px; }
.form-stack { display: flex; flex-direction: column; }
.form-stack .form-actions { margin-top: 8px; }

/* ------------------------------------------------ responsivo (<800px) */

@media (max-width: 800px) {
  .app-main { padding: 12px; }
  .topbar-inner { height: auto; padding: 10px 12px; flex-wrap: wrap; gap: 8px 16px; }
  .topnav { order: 3; width: 100%; }
  .topuser-email { display: none; }
  .device-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
  .pair-code { font-size: 24px; letter-spacing: 1px; }
  .timeline li { grid-template-columns: 84px 1fr; }
  .timeline .tag { display: none; }
}
.grid-title { grid-column: 1 / -1; margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
