/* Painel Infinity GO — grafite + âmbar da marca, letra grande, celular primeiro.
   Tema escuro é o padrão; [data-theme=light] liga o claro (theme.js). Sem estilo inline (CSP). */

@font-face {
  font-family: "Mulish";
  src: url("/static/fonts/mulish-latin-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #191919;
  --surface: #202020;
  --surface-2: #2a2a2a;
  --line: #313131;
  --line-strong: #474747;
  --text: #f5f5f5;
  --muted: #b4b4b4;
  --brand: #f2af34;
  --brand-2: #ce7e2c;
  --on-brand: #191919;
  --link: #f2af34;
  --ok: #5bd69a;
  --warn: #f7c548;
  --bad: #ff7a6b;
  --none: #a3a3a3;
  --ok-bg: rgba(91, 214, 154, .13);
  --warn-bg: rgba(247, 197, 72, .14);
  --bad-bg: rgba(255, 122, 107, .15);
  --none-bg: rgba(163, 163, 163, .13);
  --zone-ok: #2f7a55;
  --zone-warn: #a58321;
  --zone-bad: #a8443a;
  --series-2: #5aa9e6;
  --field: #161616;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --radius-l: 20px;
  --radius: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f3f0;
  --surface: #fcfcfc;
  --surface-2: #efede9;
  --line: #e2dfda;
  --line-strong: #c9c5be;
  --text: #191919;
  --muted: #555;
  --link: #9a5410;
  --ok: #1b7a4b;
  --warn: #8a5800;
  --bad: #b9332a;
  --none: #5f5f5f;
  --ok-bg: rgba(27, 122, 75, .1);
  --warn-bg: rgba(242, 175, 52, .2);
  --bad-bg: rgba(185, 51, 42, .1);
  --none-bg: rgba(95, 95, 95, .1);
  --zone-ok: #8fd1ae;
  --zone-warn: #f2cf73;
  --zone-bad: #ee9d93;
  --series-2: #2f78b5;
  --field: #fff;
  --shadow: 0 1px 2px rgba(25, 25, 25, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  font-feature-settings: "tnum" 1;
}
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; margin: 0; font-weight: 800; }
h3 { font-size: 1rem; margin: 0; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mt { margin-top: 16px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; margin: 0; }

/* Ícones do sprite */
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---------- Topo ---------- */
header.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px 6px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; margin-right: auto; min-height: 44px; }
.brand img { height: 26px; width: auto; display: block; }
.logo-light { display: none !important; }
:root[data-theme="light"] .logo-dark { display: none !important; }
:root[data-theme="light"] .logo-light { display: block !important; }
.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; border-radius: 12px;
  background: none; border: 0; color: var(--text); cursor: pointer; padding: 0; text-decoration: none;
}
.iconbtn:hover { background: var(--surface-2); filter: none; }
.theme-light-only { display: none; }
:root[data-theme="light"] .theme-dark-only { display: none; }
:root[data-theme="light"] .theme-light-only { display: inline; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .panel {
  position: absolute; right: 0; top: 50px; min-width: 250px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 6px; display: grid; box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.usermenu .panel a, .usermenu .panel button {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; width: 100%;
}
.usermenu .panel a:hover, .usermenu .panel button:hover { background: var(--surface-2); filter: none; }
.usermenu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; color: var(--muted); font-size: .9rem; }
.usermenu .who b { color: var(--text); display: block; font-size: 1rem; }
.usermenu form { margin: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }

/* ---------- Cabeçalho da página ---------- */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.updated { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; min-height: 32px; }
.updated .ic { width: 18px; height: 18px; }

/* ---------- Selos de estado (sempre ícone + texto) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px;
  font-size: .86rem; font-weight: 800; white-space: nowrap;
}
.badge .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.lvl-ok { --c: var(--ok); --cb: var(--ok-bg); }
.lvl-warn { --c: var(--warn); --cb: var(--warn-bg); }
.lvl-bad { --c: var(--bad); --cb: var(--bad-bg); }
.lvl-none { --c: var(--none); --cb: var(--none-bg); }
.badge[class*="lvl-"] { color: var(--c); background: var(--cb); }
/* telas de admin ainda usam .pill */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .86rem; font-weight: 800; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.off { color: var(--none); background: var(--none-bg); }

/* ---------- Saúde geral (topo) ---------- */
.health {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center;
  padding: 20px 18px; border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: inset 0 6px 0 var(--c);
}
.health::after {
  content: ""; position: absolute; right: -50px; bottom: -40px; width: 280px; height: 140px;
  background: url("/static/brand/infinity-mark.svg") no-repeat center / contain; opacity: .06; pointer-events: none;
}
.seal {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cb); color: var(--c); border: 3px solid var(--c);
}
.seal .ic { width: 34px; height: 34px; stroke-width: 2.2; }
.health .kicker { font-size: .9rem; font-weight: 700; color: var(--muted); }
.health h2 { font-size: 1.45rem; line-height: 1.15; letter-spacing: -.015em; margin: 2px 0 0; color: var(--text); }
.health .sub { grid-column: 1 / -1; color: var(--muted); max-width: 62ch; }
.health .counts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 720px) {
  .health { grid-template-columns: auto 1fr auto; padding: 26px 28px; }
  .health .sub { grid-column: 2; }
  .health .counts { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; }
  .health h2 { font-size: 2rem; }
  .seal { grid-row: 1 / span 2; width: 84px; height: 84px; }
}

.attention { margin-top: 12px; display: grid; gap: 8px; }
.attention a {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  border-radius: var(--radius); background: var(--cb); color: var(--text); text-decoration: none; font-weight: 800;
}
.attention a > .ic:first-child { color: var(--c); }
.attention a .go { margin-left: auto; color: var(--muted); }
.attention .what { display: block; font-weight: 500; color: var(--muted); font-size: .88rem; }

/* ---------- Grupos e cartões de indicador ---------- */
.group { margin-top: 30px; }
.group > header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.group > header > .ic { color: var(--brand); }
.group > header .aside { margin-left: auto; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.wide { grid-column: 1 / -1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card > h2 + * { margin-top: 10px; }

.ind { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 80px; }
.ind .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ind .title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: .95rem; }
.ind .title .ic { width: 20px; height: 20px; }
.ind .value { font-size: 2.1rem; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ind .detail { color: var(--muted); font-size: .92rem; }
.ind .meaning { font-size: .98rem; }

.scale { display: block; width: 100%; height: 14px; margin: 4px 0 2px; overflow: visible; }
.scale .z-ok { fill: var(--zone-ok); }
.scale .z-warn { fill: var(--zone-warn); }
.scale .z-bad { fill: var(--zone-bad); }
.scale .mark { fill: var(--text); stroke: var(--surface); stroke-width: .6; }

details.explain { border-top: 1px solid var(--line); margin-top: auto; }
details.explain summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; color: var(--link); font-weight: 700; list-style: none;
}
details.explain summary::-webkit-details-marker { display: none; }
details.explain summary .ic { width: 20px; height: 20px; }
details.explain summary .chev { margin-left: auto; transition: transform .15s; }
details.explain[open] summary .chev { transform: rotate(90deg); }
details.explain .body { display: grid; gap: 10px; padding-bottom: 6px; font-size: .95rem; }
.ranges { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ranges li { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.ranges li .ic { width: 18px; height: 18px; color: var(--c); }
.ranges li b { min-width: 5.4em; }

/* ---------- Portas ---------- */
.ports { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .ports { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .ports { grid-template-columns: repeat(3, 1fr); } }
.port { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.port .jack { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; grid-row: span 2; background: var(--cb); color: var(--c); }
.port .jack .ic { width: 28px; height: 28px; }
.port.down .jack { background: transparent; border: 2px dashed var(--line-strong); color: var(--none); }
.port .name { font-weight: 800; overflow-wrap: anywhere; }
.port .meta { color: var(--muted); font-size: .88rem; grid-column: 2; }
.port .state { grid-row: 1 / span 2; grid-column: 3; }
.port .notes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------- Gráficos ---------- */
.charts-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.charts-head h2 { display: flex; align-items: center; gap: 10px; }
.charts-head h2 .ic { color: var(--brand); }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button {
  min-height: 44px; min-width: 64px; padding: 0 14px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font-weight: 700;
}
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.chartcard > h3 { font-size: 1.05rem; }
.chartcard .hint { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.chart { min-height: 220px; margin-top: 10px; }
.chart.is-error { min-height: 0; padding: 18px 0; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .86rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.sw.ok { background: var(--zone-ok); }
.sw.warn { background: var(--zone-warn); }
.sw.bad { background: var(--zone-bad); }
.portpick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-weight: 700; }
.portpick select { width: auto; min-width: 220px; }

.uplot { font-family: inherit; width: 100% !important; }
.u-legend { font-size: .86rem; color: var(--text); text-align: left; margin-top: 4px; }
.u-legend .u-marker { border-radius: 3px; }
.u-legend th { font-weight: 700; }

/* Carregando */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 12px; min-height: 200px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Ao vivo ---------- */
.live header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.live header .ic { color: var(--brand); }
.livestate { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: .9rem; font-weight: 700; color: var(--muted); }
.livestate .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--none); }
.live.on .livestate { color: var(--ok); }
.live.on .livestate .dot { background: var(--ok); animation: pulse 2s infinite; }
.live.warn .livestate { color: var(--warn); }
.live.warn .livestate .dot { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }
.speeds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.speed { padding: 14px; border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
.speed .lbl { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.speed .n { font-size: 2.3rem; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; margin-top: 4px; }
.speed .u { font-size: .95rem; font-weight: 700; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.speed.rx .lbl .ic { color: var(--brand); }
.speed.tx .lbl .ic { color: var(--series-2); }
.gauge { display: block; width: 100%; max-width: 170px; margin-top: 8px; }
.gauge .track { stroke: var(--line-strong); }
.gauge .fill { stroke: var(--brand); transition: stroke-dasharray .6s ease; }
.speed.tx .gauge .fill { stroke: var(--series-2); }
.gauge text { fill: var(--muted); font-size: 11px; font-weight: 700; font-family: inherit; }
.cpu-live { margin-top: 10px; color: var(--muted); font-size: .92rem; }
.liveports { display: grid; gap: 6px; margin: 12px 0 0; list-style: none; padding: 0; }
.liveports li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .92rem; }
.liveports li b { margin-right: auto; }
.liveports li.off { color: var(--muted); }

/* ---------- Listas, tabelas e formulários ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a.row { display: flex; align-items: center; gap: 12px; min-height: 48px; text-decoration: none; color: var(--text); font-size: 1.08rem; font-weight: 700; }

.sites { display: grid; gap: 10px; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
@media (min-width: 680px) { .sites { grid-template-columns: repeat(2, 1fr); } }
.sitecard { display: flex; align-items: center; gap: 14px; min-height: 80px; text-decoration: none; color: var(--text); }
.sitecard:hover { border-color: var(--brand); }
.sitecard .mark { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex: none; }
.sitecard b { font-size: 1.15rem; display: block; }
.sitecard .go { margin-left: auto; color: var(--muted); }

.rows { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.rows > li { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.rows .lead { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--cb, var(--surface-2)); color: var(--c, var(--muted)); grid-row: span 2; }
.rows .main { font-weight: 800; overflow-wrap: anywhere; }
.rows .sub { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; grid-column: 2; }
.rows .end { grid-row: 1 / span 2; grid-column: 3; text-align: right; display: grid; justify-items: end; gap: 4px; }
.rows details { grid-column: 1 / -1; }
.rows details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--link); font-weight: 700; font-size: .92rem; }
.rows details p { color: var(--muted); font-size: .9rem; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
th { color: var(--muted); font-weight: 700; }

.kv { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.big { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }

form.stack { display: grid; gap: 14px; max-width: 460px; }
label { display: grid; gap: 6px; font-size: .95rem; font-weight: 700; }
/* 16px+ nos campos evita o zoom automático do iOS ao focar. */
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: 1rem; font-weight: 500; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--field); color: var(--text); width: 100%;
}
textarea { min-height: 96px; }
.check { display: flex; gap: 12px; align-items: center; font-weight: 600; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
legend { color: var(--muted); padding: 0 6px; font-weight: 700; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 0;
  font: inherit; font-size: 1rem; font-weight: 800; cursor: pointer; text-decoration: none;
  background: var(--brand); color: var(--on-brand);
}
button:hover, .btn:hover { filter: brightness(1.06); }
button.secondary, .btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }
button.danger { background: var(--bad); color: #1a0705; }
button.link { background: none; color: var(--link); padding: 0 8px; min-height: 44px; font-weight: 700; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: .95rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.row-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-actions form { margin: 0; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 12px 0; align-items: end; }
@media (min-width: 680px) { .filters { grid-template-columns: 2fr 1fr auto; } }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; overflow-wrap: anywhere; user-select: all; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 14px; font-weight: 600; }
.alert.error { background: var(--bad-bg); color: var(--text); border-left: 4px solid var(--bad); }
.alert.info { background: var(--ok-bg); color: var(--text); border-left: 4px solid var(--ok); }
.alert .ic { flex: none; }
.alert.error .ic { color: var(--bad); }
.alert.info .ic { color: var(--ok); }

.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 30px 16px; }
.empty > .ic { width: 46px; height: 46px; color: var(--muted); stroke-width: 1.6; }
.empty h3 { font-size: 1.1rem; }
.empty p { color: var(--muted); max-width: 42ch; }

.stat { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* ---------- Abas do cliente ---------- */
.sitetabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 2px; }
.sitetabs a {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 12px;
  color: var(--muted); text-decoration: none; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; font-weight: 700;
}
.sitetabs a[aria-current=page] { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
/* No celular, as abas viram uma barra fixa embaixo (como um app). */
@media (max-width: 679px) {
  .sitetabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0; gap: 0;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .sitetabs a { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; font-size: .72rem; min-height: 58px; padding: 4px 2px; border: 0; background: none; }
  .sitetabs a[aria-current=page] { background: none; color: var(--link); }
  .sitetabs .ic { width: 26px; height: 26px; }
  main:has(.sitetabs) { padding-bottom: 100px; }
}

/* ---------- Ajuda ---------- */
.help-list { display: grid; gap: 12px; }
.help-item { scroll-margin-top: 80px; }
.help-item header { display: flex; align-items: center; gap: 10px; }
.help-item header .ic { color: var(--brand); }
.help-item p { margin-top: 8px; max-width: 70ch; }
.help-item .ranges { margin-top: 12px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem; }
.intro { max-width: 64ch; color: var(--muted); margin-top: 6px; }

/* ---------- Entrar (login/2FA): fundo âmbar da marca ---------- */
body.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: #f2af34 url("/static/brand/infinity-mark.svg") no-repeat right -70px bottom -30px / 440px auto;
}
body.auth main { width: 100%; max-width: 440px; padding: 0; }
.authcard {
  background: #191919; color: #f5f5f5; border-radius: 24px; padding: 30px 24px 26px;
  box-shadow: 0 24px 60px rgba(80, 40, 0, .35);
  --text: #f5f5f5; --muted: #b4b4b4; --field: #111; --line-strong: #474747; --bad: #ff7a6b; --bad-bg: rgba(255, 122, 107, .15);
}
.authcard .logo { height: 34px; width: auto; display: block; margin-bottom: 26px; }
.authcard h1 { font-size: 1.45rem; }
.authcard .lead { color: #b4b4b4; margin: 6px 0 20px; }
.authcard form.stack { max-width: none; }
.authcard button { width: 100%; margin-top: 4px; background: #f2af34; color: #191919; }
.authcard .foot { margin-top: 18px; color: #b4b4b4; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Telas de admin com título solto */
main > h1 { margin-bottom: 14px; }
main > h1 + p { margin-bottom: 14px; }
.ports { list-style: none; padding: 0; margin: 0; }

/* Celular: selo de estado vai para baixo do texto, para o título não espremer. */
@media (max-width: 679px) {
  .rows > li { grid-template-columns: auto 1fr; }
  .rows .end { grid-row: auto; grid-column: 2; justify-items: start; text-align: left; margin-top: 6px; }
  .rows .lead { grid-row: span 3; align-self: start; }
  .port { grid-template-columns: auto 1fr; }
  .port .state { grid-row: auto; grid-column: 2; margin-top: 4px; }
  .port .jack { grid-row: span 3; align-self: start; }
}
