/* Visor do gam_checker. Tema escuro fixo, no padrão da UI do Hatchet: chão quase preto, superfícies um
   degrau acima, bordas sutis, texto neutro. Sans para texto, mono só para código, chave e número.
   Estado nunca depende só de cor: todo status leva ícone e palavra. */

:root {
  color-scheme: dark;

  --bg: #0b0c0e;
  --surface: #121316;
  --raised: #1a1c20;
  --line: #24262b;
  --line-strong: #33363d;

  --text: #e7e8ea;
  --muted: #9a9ea6;
  --faint: #6b6f77;

  --accent: #f2f2f2;
  --accent-soft: #23262c;
  --link: #8ab4f8;
  --ok: #5ee6a0;
  --ok-soft: #0f3324;
  --warn: #f5c451;
  --warn-soft: #3b2e0c;
  --bad: #ff7a85;
  --bad-soft: #3d171b;
  --tracked: #c4a8ff;
  --tracked-soft: #2a2140;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --side: 220px;
  --gutter: 28px;
  --radius: 8px;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 8px;
  z-index: 20;
  background: var(--surface);
  padding: 6px 10px;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
h1 .status {
  font-size: 13px;
  font-weight: 500;
}
h2 {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 6px;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.15em;
}

/* ---------------------------------------------------------------- moldura */

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  display: block;
  height: 32px;
  width: auto;
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-section {
  margin: 14px 10px 6px;
  color: var(--faint);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.side nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
}
.side nav a .icon {
  width: 17px;
  height: 17px;
  color: var(--faint);
}
.side nav a:hover {
  background: var(--raised);
  color: var(--text);
  text-decoration: none;
}
.side nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
}
.side nav a[aria-current="page"] .icon {
  color: var(--text);
}

.side-note {
  margin-top: auto;
  padding: 0 8px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
}

main {
  min-width: 0;
  padding: 26px var(--gutter) 56px;
}
/* Página de tabela: a área principal tem a altura da janela e a tabela ocupa o que sobrar, rolando por
   dentro com o cabeçalho fixo. A página em si não rola. */
main:has(> .table-wrap) {
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}
main > .table-wrap {
  flex: 0 0 auto;
  max-height: 50vh;
}
main > .table-wrap:last-of-type {
  flex: 1 1 auto;
  min-height: 240px;
  max-height: none;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 13px;
  margin-bottom: 10px;
}
.crumbs a {
  color: var(--muted);
}

.page-head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-head.network-head {
  padding-bottom: 0;
  border-bottom: 0;
  margin-bottom: 12px;
}
.page-head .lede,
.section-head .lede {
  color: var(--muted);
  max-width: 82ch;
  margin-top: 6px;
}
.bounds {
  margin-top: 10px;
  max-width: 100ch;
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
}

.section-head {
  margin: 2px 0 16px;
}
.section-head.catalogue {
  margin-top: 44px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.doc-title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Fatos do cabeçalho: rótulo pequeno + valor, em linha. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
}
.chip-label {
  color: var(--faint);
  font-size: 12px;
}

/* ---------------------------------------------------------------- pequenos */

.key,
.code {
  font-family: var(--mono);
  font-size: 0.92em;
}
.code {
  color: var(--muted);
}
.nil,
.absent,
.hint {
  color: var(--faint);
}
.nil {
  font-family: var(--mono);
  font-size: 0.92em;
}
.hint {
  font-size: 0.92em;
}
.bool,
.num {
  font-family: var(--mono);
  font-size: 0.92em;
}
.unit {
  color: var(--muted);
  margin-left: 1px;
  font-size: 0.7em;
}
.rel {
  color: var(--text);
}
time {
  color: var(--muted);
  white-space: nowrap;
}

.count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--muted);
  font: 500 11.5px/18px var(--mono);
  vertical-align: 1px;
}
.removed-count {
  color: var(--bad);
  background: var(--bad-soft);
  margin-left: 4px;
}
.removed-count .icon {
  width: 10px;
  height: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}
.status .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}
.status-ok {
  color: var(--ok);
  background: var(--ok-soft);
}
.status-warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.status-bad {
  color: var(--bad);
  background: var(--bad-soft);
}
.status-off {
  color: var(--muted);
  background: var(--raised);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  font: 400 11.5px/17px var(--sans);
  color: var(--muted);
  white-space: nowrap;
  vertical-align: 1px;
}
.tag .icon {
  width: 9px;
  height: 9px;
}
.tag-tracked {
  color: var(--tracked);
  background: var(--tracked-soft);
  border-color: transparent;
}
.tag-tracked .icon {
  fill: currentColor;
}
.tag-unknown {
  color: var(--warn);
  border-color: var(--warn);
  border-style: dashed;
}
.tag-removed {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: transparent;
}
/* Centrado na altura das letras, não na caixa da linha: por isso o deslocamento para cima. */
.tracked-dot {
  display: inline-flex;
  color: var(--tracked);
  margin-left: 5px;
  transform: translateY(-1.5px);
}
.tracked-dot .icon {
  width: 8px;
  height: 8px;
  fill: currentColor;
}

.empty {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--muted);
  max-width: 78ch;
  background: var(--surface);
}
.empty > .icon {
  width: 22px;
  height: 22px;
  color: var(--faint);
  margin-top: 1px;
}
.empty-title {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.panel .empty {
  padding: 14px 16px;
  background: var(--raised);
  border-style: solid;
  border-color: transparent;
}

.notice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13.5px;
}
.notice ul {
  margin: 0;
  padding-left: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.button:hover {
  background: var(--raised);
  text-decoration: none;
}

/* ---------------------------------------------------------------- filtros e paginação */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding-left: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.field:hover,
.field:focus-within {
  border-color: var(--faint);
}
.field > span:first-child {
  font-weight: 500;
  white-space: nowrap;
}
.field > span:first-child::after {
  content: ":";
}
.field.search {
  flex: 1 1 240px;
  max-width: 420px;
}
.field .input {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  padding-left: 6px;
}
.field .input .icon {
  width: 14px;
  height: 14px;
  color: var(--faint);
  flex: none;
}
.field .input input {
  flex: 1;
  min-width: 0;
}
.field input[type="search"],
.field select {
  border: 0;
  background: transparent;
  height: 32px;
  padding: 0 8px 0 4px;
  color: var(--text);
}
.field input[type="search"]:focus-visible,
.field select:focus-visible {
  outline: none;
}
input[type="search"],
select,
button {
  font: 400 13.5px/1.3 var(--sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 10px;
  height: 34px;
}
input[type="search"]::placeholder {
  color: var(--faint);
}
select {
  padding-right: 28px;
}
button[type="submit"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 500;
  cursor: pointer;
  padding: 0 14px;
}
button[type="submit"]:hover {
  background: #fff;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.check:hover {
  border-color: var(--faint);
}
.check input {
  accent-color: var(--text);
  width: 15px;
  height: 15px;
  margin: 0;
}
.clear {
  align-self: center;
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  height: 34px;
}
.segmented a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}
.segmented a:hover {
  color: var(--text);
  border-color: var(--faint);
  text-decoration: none;
}
.segmented a[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--line-strong);
  color: var(--text);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 10px 0;
  font-size: 13.5px;
}
.pager .pages {
  display: flex;
  gap: 2px;
}
.pager .range,
p.range {
  color: var(--muted);
}
p.range {
  margin-bottom: 8px;
  font-size: 13.5px;
}
.pager a,
.pager .here,
.pager .off,
.pager .gap {
  min-width: 30px;
  padding: 4px 9px;
  text-align: center;
  border-radius: 6px;
}
.pager a:hover {
  background: var(--raised);
  text-decoration: none;
}
.pager .here {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}
.pager .off,
.pager .gap {
  color: var(--faint);
}

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

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap.inner {
  border-radius: 6px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
}
.data tbody a {
  color: var(--text);
}
.data tbody a:hover {
  color: var(--link);
}
.data th,
.data td {
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.data tbody tr:last-child > * {
  border-bottom: 0;
}
.data thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font: 500 12.5px/1.3 var(--sans);
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}
.data thead th a {
  color: inherit;
  display: inline-flex;
  align-items: center;
}
.data thead th a:hover {
  color: var(--text);
  text-decoration: none;
}
.data thead th[aria-sort] {
  color: var(--text);
}
.data thead th.num a {
  justify-content: flex-end;
}
.sort-mark {
  display: inline-flex;
  margin-left: 3px;
  color: var(--text);
}
.sort-mark .icon {
  width: 12px;
  height: 12px;
}
.data tbody th {
  font-weight: 500;
}
.data tbody th.label a {
  font-weight: 500;
}
.data tbody tr:hover > * {
  background: var(--raised);
}
.data td.num,
.data th.num {
  text-align: right;
}
.data td.wrap {
  white-space: normal;
  min-width: 22ch;
  max-width: 60ch;
}
.clip {
  display: inline-block;
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.clip.obj {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--muted);
  max-width: 34ch;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 22ch;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--raised);
  font: 400 11.5px/19px var(--mono);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-more {
  color: var(--muted);
}
.data td.entities {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  max-width: none;
}
.data td.entities .count {
  margin-left: 0;
}

/* Rodadas: barra segmentada por status e lista de órfãos. */
.bar {
  display: flex;
  width: 100%;
  min-width: 120px;
  height: 8px;
  border-radius: 4px;
  background: var(--raised);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
}
.bar .done {
  background: var(--ok);
}
.bar .failed {
  background: var(--bad);
}
.bar .running {
  background: var(--warn);
}
.bar .pending {
  background: var(--line-strong);
}
.data td.progress-cell {
  min-width: 140px;
  vertical-align: middle;
}
.panel .bar {
  margin: 4px 0 14px;
}
.stat dd a {
  color: inherit;
}
.orphans {
  padding-left: 18px;
  font-size: 13px;
}
.bad {
  color: var(--bad);
  font-weight: 500;
}
.chip-bad {
  max-width: none;
  color: var(--bad);
  border-color: var(--bad);
  background: var(--bad-soft);
}
.round-grid > .panel:first-child {
  grid-column: span 1;
}

.progress {
  display: inline-block;
  width: 56px;
  height: 5px;
  margin-right: 10px;
  border-radius: 3px;
  background: var(--raised);
  overflow: hidden;
  vertical-align: 2px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--ok);
}

/* Removido: riscado, esmaecido, com etiqueta e barra lateral. Quatro sinais, só um deles é cor. */
.data tr.removed > * {
  color: var(--faint);
}
.data tr.removed .label a .clip {
  text-decoration: line-through;
}
.data tr.removed > :first-child {
  box-shadow: inset 3px 0 0 var(--bad);
}
.data tr.removed a {
  color: var(--faint);
}
.data tr.attention > :first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

/* ---------------------------------------------------------------- página da network */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 4px 0 22px;
  border-bottom: 1px solid var(--line);
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 9px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.tabs a .icon {
  width: 15px;
  height: 15px;
}
.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}
.tabs a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--text);
}
.tabs a.zero {
  color: var(--faint);
}
.tabs a.zero .count {
  background: transparent;
  color: var(--faint);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  min-width: 0;
}
.panel.wide {
  grid-column: 1 / -1;
}
.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 14px;
}
.panel-head h2 {
  display: inline-flex;
  align-items: center;
}
.panel-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  max-width: 96ch;
}
.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
.after-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13.5px;
}
.after-grid a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Coletas: um card por task, ordem da mais recente para a mais velha. */
.tasks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}
.task {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}
.task.stale {
  border-color: var(--warn);
}
.task.never {
  border-style: dashed;
  background: transparent;
}
.task-name {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
}
.task .status {
  align-self: flex-start;
}
.task-when {
  font-size: 12px;
}
.meter {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--raised);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: 3px;
  background: var(--ok);
}
.task.stale .meter > span {
  background: var(--warn);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-bottom: 14px;
}
.stat dt {
  font: 400 12px/1.3 var(--mono);
  color: var(--faint);
}
.stat dd {
  font: 600 22px/1.25 var(--sans);
  letter-spacing: -0.02em;
}
.stat-bad dd {
  color: var(--bad);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px 20px;
  margin-top: 10px;
}
.facts dt {
  font: 400 12px/1.3 var(--mono);
  color: var(--faint);
}
.facts dd {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.account + .account {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.account h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  margin-top: 0;
}
.problems {
  margin-top: 12px;
}
.problems ul {
  margin-top: 4px;
  padding-left: 22px;
}

/* Aba Resumo: barra de contexto e o resumo numa moldura da altura da janela, com alça para esticar. */
.embed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}
.embed-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13.5px;
}
.embed-hint {
  margin: -4px 0 12px;
}
.embed {
  position: relative;
  height: calc(100vh - 360px);
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}
.embed-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: var(--surface);
}
.embed[data-loading] .embed-loading {
  display: flex;
}
.embed[data-dragging] iframe {
  pointer-events: none;
}
.embed-handle {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  cursor: row-resize;
  touch-action: none;
}
.embed-handle span {
  width: 64px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-strong);
}
.embed-handle:hover span {
  background: var(--faint);
}

/* ---------------------------------------------------------------- documento e linha do tempo */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  gap: 16px;
  align-items: start;
}

.tree {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  font-size: 13.5px;
}
.tree > .row {
  display: contents;
}
.tree > .row > dt,
.tree > .row > dd {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.tree > .row > dt {
  padding-right: 22px;
  color: var(--muted);
  white-space: nowrap;
}
.tree > .row > dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tree > .row:last-child > dt,
.tree > .row:last-child > dd {
  border-bottom: 0;
}
/* Objeto ou lista: a chave ocupa a linha e o conteúdo desce recuado, com um fio à esquerda. */
.tree > .row.nested > dt {
  grid-column: 1 / -1;
  border-bottom: 0;
  padding-bottom: 0;
}
.tree > .row.nested > dd {
  grid-column: 1 / -1;
  margin-left: 6px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  border-bottom: 0;
  margin-bottom: 8px;
}
.str {
  white-space: pre-wrap;
}

.list {
  padding-left: 0;
  list-style: none;
  counter-reset: item;
  font-size: 13.5px;
}
.list > li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  padding: 2px 0;
  overflow-wrap: anywhere;
}
.list > li::before {
  content: counter(item);
  color: var(--faint);
  font: 400 12px/21px var(--mono);
}
.list.lines {
  font-family: var(--mono);
  font-size: 13px;
}

.missing {
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px dashed var(--warn);
  background: var(--warn-soft);
  border-radius: 8px;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.missing strong {
  font-weight: 600;
}
.secret-note {
  margin-top: 12px;
}

.raw {
  margin-top: 16px;
}
.raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13.5px;
}
pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 400 12.5px/1.5 var(--mono);
  overflow-x: auto;
  max-height: 520px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin-left: 6px;
  border-left: 2px solid var(--line);
}
.timeline > li {
  position: relative;
  padding: 0 0 18px 20px;
}
.timeline > li:last-child {
  padding-bottom: 2px;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--tracked);
}
.change-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 13px;
}
.change-head .key {
  color: var(--tracked);
  font-weight: 500;
}
.change-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 13px;
}
.change-body.inline {
  display: inline-flex;
  margin: 0 0 0 8px;
  vertical-align: top;
  white-space: normal;
}
.change-body .from {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}
.change-body pre.from {
  text-decoration: none;
}
.change-body .to {
  color: var(--text);
}
.change-body .arrow {
  display: inline-flex;
  color: var(--faint);
}
.change-body pre {
  margin: 0;
  max-height: 260px;
  max-width: 100%;
  font-size: 12px;
}
.change-body .status,
.change-body .hint {
  font-family: var(--sans);
}
.sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  width: 100%;
}
.sides > div {
  min-width: 0;
}
.diff {
  list-style: none;
  padding: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.diff .del {
  color: var(--muted);
}
.diff .del span {
  color: var(--bad);
  font-weight: 600;
}
.diff .add span {
  color: var(--ok);
  font-weight: 600;
}

/* ---------------------------------------------------------------- telas estreitas */

@media (max-width: 1000px) {
  :root {
    --gutter: 16px;
  }
  body {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
    height: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
  }
  .brand {
    padding: 0 4px;
  }
  .side nav {
    flex-direction: row;
  }
  .side-note {
    display: none;
  }
  .grid,
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .embed {
    height: calc(100vh - 260px);
  }
  /* Com a barra no topo não cabe fixar a altura: a página volta a rolar e a tabela fica limitada. */
  main:has(> .table-wrap) {
    height: auto;
    overflow: visible;
    display: block;
  }
  main > .table-wrap:last-of-type {
    max-height: 70vh;
  }
}

/* ---------------------------------------------------------------- resumo no desenho do dash legado */

.resumo {
  max-width: 1280px;
}
.rs-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}
.rs-hero h1 {
  font-size: 26px;
}
.rs-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.rs-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rs-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.rs-badge .icon {
  width: 12px;
  height: 12px;
}
.rs-badge-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: color-mix(in oklab, var(--ok) 40%, transparent);
}
.rs-badge-warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.rs-badge-bad {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: color-mix(in oklab, var(--bad) 40%, transparent);
}
.rs-badge-off {
  color: var(--muted);
  background: var(--raised);
}

.rs-kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 18px;
  padding: 14px 8px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.rs-kpis li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-left: 1px solid var(--line);
  text-align: center;
}
.rs-kpis li:first-child {
  border-left: 0;
}
.rs-kpis strong {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.rs-kpis span {
  color: var(--muted);
  font-size: 12.5px;
}
.rs-kpis li.bad strong {
  color: var(--bad);
}
.rs-kpis-small {
  margin: 0 0 14px;
  padding: 8px 4px;
  background: var(--bg);
}
.rs-kpis-small strong {
  font-size: 18px;
}

.rs-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}
.rs-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rs-stack {
  display: grid;
  gap: 16px;
}
.rs-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  margin-bottom: 16px;
}
.rs-grid .rs-card,
.rs-stack .rs-card {
  margin-bottom: 0;
}
.rs-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.rs-card-head h3 {
  margin: 0;
  font-size: 15px;
}
.rs-count,
.rs-muted {
  color: var(--muted);
  font-size: 13px;
}
.rs-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
.rs-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.rs-row:last-child {
  border-bottom: 0;
}
.rs-label {
  color: var(--muted);
}
.rs-value {
  overflow-wrap: anywhere;
}
.rs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.rs-table th,
.rs-table td {
  padding: 9px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}
.rs-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
}
.rs-table tbody tr:last-child td {
  border-bottom: 0;
}
.rs-table .neg {
  color: var(--bad);
}
.rs-empty {
  padding: 16px 18px;
  color: var(--muted);
  font-size: 13.5px;
}
.rs-pre {
  margin: 0;
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: transparent;
  max-height: 260px;
}
.rs-problems {
  margin: 0;
  padding-left: 18px;
}
.rs-mcms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 14px 18px;
}
.rs-mcm {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
}
.rs-mcm strong {
  font-size: 14px;
}
.rs-mcm p {
  color: var(--muted);
}
.rs-chart {
  display: block;
  width: 100%;
  height: auto;
  padding: 14px 18px 6px;
}
.rs-chart rect {
  fill: var(--ok);
  opacity: 0.85;
}
.rs-chart text {
  fill: var(--muted);
  font-size: 12px;
}
.rs-foot {
  color: var(--faint);
  font-size: 12.5px;
  margin-top: 8px;
}
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

@media (max-width: 1000px) {
  .rs-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .rs-kpis li {
    border-left: 0;
  }
  .rs-grid,
  .rs-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- login (modo hospedado) */

/* Padrão das telas de login da casa (Pop-up Creative Generator): fundo preto, cartão centrado, leão, nome do app, Login azul. */
.login-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 100vh;
  background: #0b0b0d;
}
.login {
  width: min(400px, calc(100% - 32px));
  padding: 36px 32px 32px;
  border: 1px solid #2e2e34;
  border-radius: 14px;
  background: linear-gradient(180deg, #15151a 0%, #101014 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  text-align: center;
}
.login-logo {
  display: block;
  margin: 0 auto 14px;
  filter: drop-shadow(0 6px 18px rgba(255, 120, 40, 0.28));
}
/* Mais específico que o h1 geral do app, que alinha à esquerda. */
.login h1.login-app {
  display: block;
  text-align: center;
  color: #f4f4f7;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  padding: 0;
}
.login-sub {
  color: #8b8b95;
  font-size: 13.5px;
  margin: 0 0 26px;
}
.login form {
  display: grid;
  gap: 14px;
  text-align: left;
}
.login label {
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: #d8d8de;
}
.login input {
  font: 400 14.5px/1.3 var(--sans);
  color: #f0f0f4;
  background: #0b0b0d;
  border: 1px solid #3a3a42;
  border-radius: 8px;
  padding: 11px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login input::placeholder {
  color: #66666f;
}
.login input:focus {
  outline: none;
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}
/* Mais específico que o button[type=submit] geral, que pinta o botão de branco. */
.login button[type="submit"].login-button {
  margin-top: 6px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #2b8fff 0%, #0a7aff 100%);
  color: #fff;
  font: 600 15px/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(10, 122, 255, 0.35);
  transition: filter 0.15s, transform 0.05s;
}
.login button[type="submit"].login-button:hover {
  filter: brightness(1.08);
}
.login button[type="submit"].login-button:active {
  transform: translateY(1px);
}
.login-error {
  color: var(--bad);
  font-size: 13px;
}
