:root {
  --fundo: #eef1f4;
  --placa: #ffffff;
  --linha: #d9dfe6;
  --linha-forte: #b7c1cc;
  --texto: #111a24;
  --texto-2: #3d4a58;
  --texto-3: #5f6c7a;
  --tinta: #0f2233;
  --destaque: #0b7a75;
  --destaque-escuro: #075b57;
  --destaque-suave: #e3f4f2;
  --ok: #1f7a3a;
  --ok-suave: #e5f4ea;
  --tentando: #9a5b00;
  --tentando-suave: #fff3dc;
  --morta: #b42318;
  --morta-suave: #fdecea;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;
  --raio: 12px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
[hidden] {
  display: none !important;
}
body {
  font: 16px/1.5 var(--sans);
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
code,
pre {
  font-family: var(--mono);
  font-size: 0.86em;
}
:focus-visible {
  outline: 3px solid var(--destaque);
  outline-offset: 2px;
}
.sprite {
  position: absolute;
}
.icone {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.largura {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ---------- topo ---------- */
.topo {
  background: var(--tinta);
  color: #e8eef4;
  border-bottom: 3px solid var(--destaque);
}
.topo-linha {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 60px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.topo-desc {
  font-size: 0.85rem;
  color: #a9b7c6;
}
.como-testar {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #3c5268;
  background: transparent;
  color: #e8eef4;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.como-testar .icone {
  width: 16px;
  height: 16px;
}
.como-testar:hover {
  border-color: #6fd3cc;
  color: #6fd3cc;
}
.autor {
  margin-left: auto;
  font-size: 0.8rem;
  color: #a9b7c6;
  text-decoration: none;
  white-space: nowrap;
}
.como-testar:not([hidden]) + .autor {
  margin-left: 0;
}
.autor:hover {
  color: #6fd3cc;
  text-decoration: underline;
}

main {
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

/* ---------- botões ---------- */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 10px;
  border: 1px solid var(--linha-forte);
  background: var(--placa);
  font-weight: 600;
  text-align: left;
}
.botao:hover:not(:disabled) {
  border-color: var(--destaque);
  color: var(--destaque-escuro);
}
.botao:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.botao.primario {
  background: var(--destaque);
  border-color: var(--destaque);
  color: #fff;
}
.botao.primario:hover:not(:disabled) {
  background: var(--destaque-escuro);
  color: #fff;
}
.botao.perigo {
  border-color: #e3b1ab;
  color: var(--morta);
}
.botao.perigo[aria-pressed='true'] {
  background: var(--morta);
  border-color: var(--morta);
  color: #fff;
}
.botao.largo {
  width: 100%;
}
.botao.pequeno {
  min-height: 36px;
  padding: 0 0.75rem;
  font-size: 0.85rem;
}
.botao.pequeno .icone {
  width: 16px;
  height: 16px;
}

/* ---------- guia ---------- */
.guia {
  background: var(--destaque-suave);
  border: 1px solid #a8dcd7;
  border-radius: var(--raio);
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.guia-cabeca {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.guia-cabeca h2 {
  font-size: 1rem;
}
.guia-cabeca h2:focus {
  outline: none;
}
.guia-fechar {
  width: 44px;
  height: 44px;
  margin: -0.5rem -0.5rem -0.5rem 0;
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--texto-3);
  border-radius: 10px;
}
.guia-fechar:hover {
  color: var(--texto);
}
.guia-oque,
.guia-repare {
  color: var(--texto-2);
  font-size: 0.92rem;
}
.guia ol {
  margin: 0.7rem 0 0 1.25rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}
.guia-repare {
  margin: 0.7rem 0 0.9rem;
}

.aviso {
  background: var(--morta-suave);
  color: var(--morta);
  border: 1px solid #f0bdb7;
  border-radius: var(--raio);
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
}

/* ---------- grade ---------- */
.grade {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.coluna-lateral,
.coluna-principal {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}
.cartao {
  background: var(--placa);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 1rem 1.1rem 1.1rem;
  min-width: 0;
}
.cartao h2 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}
.cartao-cabeca {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.cartao-cabeca h2 {
  margin: 0;
}
.dica {
  color: var(--texto-3);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  overflow-wrap: anywhere;
}
.acoes {
  display: grid;
  gap: 0.5rem;
}

.retorno {
  display: block;
  margin-top: 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #f4f6f8;
  border: 1px dashed var(--linha-forte);
  font-size: 0.88rem;
  color: var(--texto-2);
  overflow-wrap: anywhere;
}
.retorno[data-tipo='ok'] {
  background: var(--ok-suave);
  border: 1px solid #b6dec2;
  color: #14532a;
}
.retorno[data-tipo='duplicado'] {
  background: var(--destaque-suave);
  border: 1px solid #a8dcd7;
  color: var(--destaque-escuro);
}
.retorno[data-tipo='erro'] {
  background: var(--morta-suave);
  border: 1px solid #f0bdb7;
  color: var(--morta);
}

/* ---------- destino ---------- */
.selo-destino {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--ok-suave);
  color: var(--ok);
}
.selo-destino[data-fora='1'] {
  background: var(--morta-suave);
  color: var(--morta);
}
.campo {
  display: grid;
  gap: 0.3rem;
  margin-top: 1rem;
  border: 0;
}
.campo label,
.campo legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  width: 100%;
}
.campo legend {
  margin-bottom: 0.4rem;
}
.campo output {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--destaque-escuro);
}
.campo small {
  font-size: 0.78rem;
  color: var(--texto-3);
}
input[type='range'] {
  width: 100%;
  min-height: 32px;
  accent-color: var(--destaque);
}
.opcoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.opcao {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--linha);
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}
.opcao:has(input:checked) {
  border-color: var(--destaque);
  background: var(--destaque-suave);
}
.opcao input {
  accent-color: var(--destaque);
}

.destinos {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.destinos li {
  display: grid;
  gap: 0.1rem;
  font-size: 0.9rem;
}
.destinos code {
  overflow-wrap: anywhere;
  color: var(--texto-2);
}
.destinos .dica {
  margin: 0;
}

/* ---------- entregas ---------- */
.ao-vivo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--texto-3);
}
.ao-vivo .ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulso 1.6s ease-in-out infinite;
}
.ao-vivo[data-estado='erro'] .ponto {
  background: var(--morta);
  animation: none;
}
@keyframes pulso {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ao-vivo .ponto {
    animation: none;
  }
}

.contadores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
}
.contadores div {
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
}
.contadores dt {
  font-size: 0.75rem;
  color: var(--texto-3);
}
.contadores dd {
  font: 700 1.35rem/1.2 var(--mono);
}
.contadores [data-status='aguardando'] dd {
  color: var(--tentando);
}
.contadores [data-status='entregue'] dd {
  color: var(--ok);
}
.contadores [data-status='morta'] dd {
  color: var(--morta);
}

.entregas {
  list-style: none;
  display: grid;
  gap: 0.7rem;
}
.entregas .vazio {
  color: var(--texto-3);
  font-size: 0.9rem;
  padding: 1.5rem 0;
  text-align: center;
}
.entrega {
  border: 1px solid var(--linha);
  border-left: 4px solid var(--tentando);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
.entrega[data-status='entregue'] {
  border-left-color: var(--ok);
}
.entrega[data-status='morta'] {
  border-left-color: var(--morta);
  background: #fffafa;
}
.entrega-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.evento {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.selo {
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--tentando-suave);
  color: var(--tentando);
}
.selo[data-status='entregue'] {
  background: var(--ok-suave);
  color: var(--ok);
}
.selo[data-status='morta'] {
  background: var(--morta-suave);
  color: var(--morta);
}
.entrega-meta {
  font-size: 0.8rem;
  color: var(--texto-3);
  margin: 0.15rem 0 0.55rem;
}

.linha-tempo {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem;
}
.linha-tempo > li {
  font-size: 0.8rem;
}
.tentativa details {
  border-radius: 8px;
  border: 1px solid var(--linha);
  background: #f7f9fa;
}
.tentativa[data-resultado='sucesso'] details {
  border-color: #b6dec2;
  background: var(--ok-suave);
}
.tentativa[data-resultado='temporaria'] details {
  border-color: #f0d199;
  background: var(--tentando-suave);
}
.tentativa[data-resultado='definitiva'] details {
  border-color: #f0bdb7;
  background: var(--morta-suave);
}
.tentativa summary {
  list-style: none;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.tentativa summary::-webkit-details-marker {
  display: none;
}
.tentativa .num,
.tentativa .ms {
  color: var(--texto-3);
  font-family: var(--mono);
}
.tentativa b {
  font-family: var(--mono);
}
.detalhe {
  display: grid;
  gap: 0.2rem;
  padding: 0 0.55rem 0.45rem;
  max-width: 300px;
  font-size: 0.78rem;
  color: var(--texto-2);
}
.detalhe code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.espera,
.proxima,
.final {
  align-self: center;
  padding: 0.3rem 0.1rem;
  color: var(--texto-3);
  font-family: var(--mono);
}
.espera::before {
  content: '→ ';
}
.proxima {
  color: var(--tentando);
  font-weight: 600;
}
.final.ok {
  color: var(--ok);
  font-weight: 700;
}
.final.ok::before {
  content: '✓ ';
}

.morta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #f0bdb7;
  font-size: 0.85rem;
  color: var(--morta);
}

/* ---------- curl ---------- */
.codigo {
  position: relative;
  margin-bottom: 0.8rem;
}
.codigo pre {
  background: var(--tinta);
  color: #d7e3ee;
  border-radius: 10px;
  padding: 0.9rem 1rem 3.2rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.55;
}
.codigo pre code {
  font-size: inherit;
}
.copiar {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: #1c3850;
  border-color: #3c5268;
  color: #e8eef4;
}
.copiar:hover:not(:disabled) {
  color: #6fd3cc;
  border-color: #6fd3cc;
}

.rodape {
  padding-bottom: 2rem;
  font-size: 0.8rem;
  color: var(--texto-3);
}

/* ---------- telas menores ---------- */
@media (max-width: 900px) {
  /* No celular vira uma coluna só: disparar, ver as entregas, depois mexer no destino. */
  .grade {
    grid-template-columns: 1fr;
  }
  .coluna-lateral,
  .coluna-principal {
    display: contents;
  }
  [aria-labelledby='t-disparar'] {
    order: 1;
  }
  [aria-labelledby='t-entregas'] {
    order: 2;
  }
  [aria-labelledby='t-destino'] {
    order: 3;
  }
  [aria-labelledby='t-curl'] {
    order: 4;
  }
  [aria-labelledby='t-destinos'] {
    order: 5;
  }
}
@media (max-width: 560px) {
  .topo-desc {
    display: none;
  }
  .topo-linha {
    gap: 0.6rem;
  }
  .contadores {
    grid-template-columns: repeat(2, 1fr);
  }
  .morta {
    flex-direction: column;
    align-items: flex-start;
  }
}
