/* ==========================================================================
   Rastreio · track.css
   Pagina publica de consulta. Depende de /assets/base.css (tokens e componentes).
   Estrutura de transportadora: barra da marca, faixa de busca, situacao atual,
   etapas, historico e dados do pedido.
   Cores: azul-marinho (--accent) e a base da pagina. O laranja (--highlight)
   aparece so no botao "Rastrear" e na etapa atual.

   Indice
   1. Estrutura da pagina e barra da marca
   2. Faixa de busca
   3. Antes da consulta (como funciona)
   4. Estados (carregando, erro)
   5. Situacao atual
   6. Etapas (stepper)
   7. Historico e proximas etapas
   8. Dados do pedido
   9. Rodape
   10. Movimento reduzido e impressao
   ========================================================================== */

/* 1. Estrutura da pagina e barra da marca --------------------------------- */

.page {
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1 0 auto;
  padding-bottom: var(--space-12);
}

.page-main:focus-visible,
.result:focus-visible {
  outline: none;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  min-height: var(--control-h);
  color: var(--accent-text);
  text-decoration: none;
}

/* O logo so funciona sobre branco: a barra e sempre clara. */
.brand-logo {
  flex: none;
  width: auto;
  max-width: none;
  height: 2.25rem;
}

.brand-text {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  font-stretch: var(--display-stretch);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.topbar-link {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  line-height: var(--control-h);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .topbar-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
  }
}

@media (min-width: 37.5em) {
  .topbar-in {
    min-height: 4.5rem;
  }

  .brand-logo {
    height: 2.625rem;
  }
}

/* 2. Faixa de busca ------------------------------------------------------- */

.band {
  --band-soft: var(--accent-ink);
  --band-stripe: rgba(255, 255, 255, 0.06);
  /* Distancia da borda da janela ate a borda direita do conteudo. */
  --band-edge: max(var(--gutter), calc((100vw - var(--container)) / 2));

  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--accent);
  color: var(--accent-ink);
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
  .band {
    --band-soft: color-mix(in srgb, var(--accent-ink) 78%, var(--accent));
    --band-stripe: color-mix(in srgb, var(--accent-ink) 7%, var(--accent));
  }
}

/* Faixas diagonais: o mesmo gesto da seta do logo. Ficam no canto, longe do texto. */
.band::before,
.band::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  transform: skewX(-32deg);
  transform-origin: 100% 0;
  pointer-events: none;
}

/* No celular a faixa clara ocupa so o canto de baixo, fora do caminho do texto. */
.band::before {
  right: -1.75rem;
  width: 5rem;
  background: var(--band-stripe);
  transform-origin: 100% 100%;
}

.band::after {
  display: none;
  background: var(--highlight);
}

.band-in {
  padding-block: var(--space-8);
}

.band-title {
  font-size: var(--fs-2xl);
}

.band-tagline {
  margin-top: var(--space-2);
  color: var(--band-soft);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}

.search {
  max-width: 44rem;
  margin-top: var(--space-6);
}

.search .field {
  gap: var(--space-2);
}

.search-label {
  color: inherit;
}

/* No celular o campo e o botao entram direto na coluna do formulario, para a
   mensagem de erro ficar colada no campo (e nao depois do botao). */
.search-row {
  display: contents;
}

.search-input {
  order: 1;
}

.search-error {
  order: 2;
}

.search-btn {
  order: 3;
  margin-top: var(--space-1);
}

.search-hint {
  order: 4;
}

.search-input {
  min-height: 3.5rem;
  padding-inline: var(--space-4);
  border-color: var(--surface);
  font-size: var(--fs-lg);
}

/* No hover o laranja clareia (e nao escurece): o texto azul ganha contraste em vez de perder. */
.search-btn {
  --btn-bg: var(--highlight);
  --btn-bg-hover: var(--highlight);
  --btn-fg: var(--highlight-ink);
  --btn-bd: var(--highlight);
  --btn-bd-hover: var(--highlight);

  min-height: 3.5rem;
  padding-inline: var(--space-10);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
  .search-btn {
    --btn-bg-hover: color-mix(in srgb, var(--highlight) 86%, #FFFFFF);
    --btn-bd-hover: color-mix(in srgb, var(--highlight) 86%, #FFFFFF);
  }
}

/* Sobre o azul o foco padrao (azul) some: aqui ele usa a cor do texto da faixa. */
.band .search-input:focus-visible,
.band .search-btn:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.band .search-input:focus-visible {
  border-color: var(--surface);
}

.band .search-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.search-hint {
  margin-top: var(--space-1);
  color: var(--band-soft);
}

/* Vermelho direto sobre o azul nao passa no contraste: o erro vem numa etiqueta clara. */
.search-error {
  align-self: flex-start;
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
}

@media (min-width: 37.5em) {
  .band::before {
    right: calc(var(--band-edge) + 3.5rem);
    width: 12rem;
    transform-origin: 100% 0;
  }

  .band-in {
    padding-block: var(--space-12);
  }

  .band-title {
    font-size: var(--fs-3xl);
  }

  .band-tagline {
    font-size: var(--fs-lg);
  }

  .search {
    margin-top: var(--space-8);
  }

  .search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-3);
  }

  .search-btn {
    margin-top: 0;
  }
}

/* A faixa laranja so entra quando sobra espaco ao lado do formulario:
   o topo dela alinha com a borda direita do conteudo. */
@media (min-width: 64em) {
  .band::after {
    display: block;
    right: var(--band-edge);
    width: 1rem;
  }
}

/* Com resultado na tela, o primeiro cartao sobe um pouco sobre a faixa. */
@media (min-width: 60em) {
  .band.is-lifted .band-in {
    padding-bottom: calc(var(--space-12) + var(--space-10));
  }

  .results > .state-loading,
  .results > .result {
    position: relative;
    margin-top: calc(var(--space-10) * -1);
  }
}

/* 3. Antes da consulta ---------------------------------------------------- */

.results > * {
  margin-top: var(--space-6);
}

.results > [role="alert"] {
  margin-top: 0;
}

.howto {
  padding-top: var(--space-4);
}

.howto-title {
  font-size: var(--fs-xl);
}

.howto-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: var(--space-4) 0 0;
  border-top: 1px solid var(--line);
}

.howto-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-4);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.howto-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-text);
}

.howto-icon svg {
  width: 1.375rem;
  height: 1.375rem;
}

.howto-name {
  font-size: var(--fs-lg);
}

.howto-desc {
  margin-top: var(--space-1);
  color: var(--ink-2);
  line-height: var(--lh-snug);
}

.howto-code {
  font-family: var(--font-mono);
  font-size: 0.9375em;
  white-space: nowrap;
}

@media (min-width: 48em) {
  .howto {
    padding-top: var(--space-8);
  }

  .howto-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: var(--space-5);
    border-bottom: 1px solid var(--line);
  }

  .howto-item {
    padding: var(--space-6) var(--space-6) var(--space-6) 0;
    border-bottom: 0;
  }

  .howto-item + .howto-item {
    padding-left: var(--space-6);
    border-left: 1px solid var(--line);
  }
}

.noscript-note {
  max-width: 40rem;
}

/* 4. Estados -------------------------------------------------------------- */

.state-loading,
.result {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sk-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sk-w30 { width: 30%; }
.sk-w40 { width: 40%; }
.sk-w60 { width: 60%; }
.sk-w70 { width: 70%; }

.sk-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.sk-dot {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.sk-dot-lg {
  width: 3rem;
  height: 3rem;
}

.sk-when {
  flex: none;
  width: 4.5rem;
  margin-top: var(--space-1);
}

.sk-lines {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding-top: var(--space-1);
}

.sk-steps {
  display: flex;
  justify-content: space-between;
}

.state-error {
  max-width: 40rem;
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-md);
}

.state-error .btn {
  align-self: flex-start;
  margin-top: var(--space-3);
}

@media (min-width: 37.5em) {
  .state-loading,
  .result {
    gap: var(--space-6);
  }
}

/* 5. Situacao atual ------------------------------------------------------- */

.summary {
  padding: 0;
}

.status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-5) var(--space-4);
  padding: var(--space-5);
}

.status-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.status-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.status.is-final .status-icon {
  background: var(--ok);
  color: #FFFFFF;
}

.status.is-waiting .status-icon {
  box-shadow: inset 0 0 0 1px var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.status-body {
  min-width: 0;
}

.status-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-height: 1.625rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
}

.headline {
  margin-top: 0.125rem;
  color: var(--accent-text);
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.headline-desc {
  max-width: var(--measure);
  margin-top: var(--space-2);
  color: var(--ink-2);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}

.status-when {
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

.status-when time {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.status-code {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.status-code-label {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

.status-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.status-code-value {
  font-size: 1.25rem;
  line-height: var(--lh-tight);
}

/* Um toque seleciona o codigo inteiro. */
#res-code {
  user-select: all;
  -webkit-user-select: all;
}

/* Largura fixa: o rotulo troca para "Copiado" sem o botao mudar de tamanho. */
.copy-btn {
  min-width: 5.75rem;
  min-height: var(--control-h);
}

@media (min-width: 37.5em) {
  .status {
    gap: var(--space-6) var(--space-5);
    padding: var(--space-8);
  }

  .status-icon {
    width: 3.5rem;
    height: 3.5rem;
  }

  .status-icon svg {
    width: 1.75rem;
    height: 1.75rem;
  }

  .headline {
    font-size: 2.125rem;
  }

  .headline-desc {
    font-size: var(--fs-lg);
  }
}

@media (min-width: 60em) {
  .status {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: var(--space-6);
  }

  .status-code {
    grid-column: auto;
    align-self: stretch;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 0 0 var(--space-8);
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .status-code-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .status-code-value {
    font-size: 1.375rem;
  }
}

/* 6. Etapas (stepper) ----------------------------------------------------- */

.journey {
  padding: var(--space-5);
  border-top: 1px solid var(--line);
}

.journey-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}

.journey-title {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  letter-spacing: 0;
}

.journey-count {
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  line-height: var(--lh-snug);
}

/* Modo compacto (celular): so os circulos, numa linha que sempre cabe.
   --dot encolhe conforme a quantidade de etapas (classes vindas do JS). */
.stepper {
  --dot: 2rem;

  display: flex;
  align-items: center;
  margin: var(--space-5) 0 0;
}

/* Com etapa atual, a margem de baixo guarda o lugar do selo "Agora"
   (margem e nao padding: o base.css zera o padding das listas). */
.stepper.has-now {
  margin-bottom: 1.5rem;
}

.stepper.is-mid {
  --dot: 1.75rem;
}

.stepper.is-many {
  --dot: 1rem;
}

.step {
  position: relative;
  display: flex;
  flex: 1 1 0%;
  align-items: center;
  min-width: 0;
}

.step:first-child {
  flex: none;
}

/* Fio que chega na etapa, vindo da anterior. */
.step::before {
  content: "";
  flex: 1 1 0%;
  min-width: 4px;
  height: 2px;
  background: var(--line);
}

.step:first-child::before {
  content: none;
}

.step.is-done::before,
.step.is-current::before,
.step.is-final::before {
  background: var(--accent);
}

.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--dot);
  height: var(--dot);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.step-dot svg {
  width: 56%;
  height: 56%;
}

.step.is-done .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.step.is-final .step-dot {
  border-color: var(--ok);
  background: var(--ok);
  color: #FFFFFF;
}

.step.is-current .step-dot {
  border-color: var(--highlight);
  background: var(--highlight);
  box-shadow: 0 0 0 4px var(--highlight-soft);
  color: var(--highlight-ink);
}

/* Anel que pulsa em volta da etapa atual. */
.step.is-current .step-dot::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border: 2px solid var(--highlight);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: step-pulse 2400ms var(--ease-out) infinite;
}

@keyframes step-pulse {
  0% {
    opacity: 0.7;
    transform: scale(1);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

/* Acima de 7 etapas os circulos viram pontos: sem numero nem icone dentro. */
.stepper.is-many:not(.is-titled) .step-dot > * {
  display: none;
}

.stepper.is-many:not(.is-titled) .step.is-current .step-dot {
  box-shadow: 0 0 0 3px var(--highlight-soft);
}

/* No modo compacto o texto da etapa fica so para leitores de tela;
   o selo "Agora" aparece embaixo do circulo atual. */
.step-text {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: flex;
  justify-content: center;
  width: var(--dot);
}

.stepper:not(.is-titled) .step-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.step-now {
  color: var(--highlight-text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  line-height: 1.3;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Modo com titulos: o JS liga .is-titled quando cada etapa tem largura para o nome. */
.stepper.is-titled {
  --dot: 2.5rem;

  align-items: flex-start;
}

.stepper.is-titled.is-many {
  --dot: 2.25rem;
}

.stepper.is-titled.has-now {
  margin-bottom: 0;
}

.stepper.is-titled .step,
.stepper.is-titled .step:first-child {
  flex: 1 1 0%;
  flex-direction: column;
  padding-inline: var(--space-1);
  text-align: center;
}

.stepper.is-titled .step::before {
  position: absolute;
  top: calc(var(--dot) / 2 - 1px);
  right: 50%;
  left: -50%;
  flex: none;
  min-width: 0;
}

.stepper.is-titled .step-text {
  position: static;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  margin-top: var(--space-3);
}

.stepper.is-titled .step-title {
  max-width: 100%;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  line-height: 1.3;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.stepper.is-titled.is-many .step-title {
  font-size: 0.8125rem;
}

.stepper.is-titled .step.is-pending .step-title {
  color: var(--muted);
  font-weight: var(--fw-regular);
}

.stepper.is-titled .step.is-current .step-title {
  color: var(--accent-text);
  font-weight: var(--fw-bold);
}

@media (min-width: 37.5em) {
  .journey {
    padding: var(--space-6) var(--space-8) var(--space-8);
  }

  .stepper {
    margin-top: var(--space-6);
  }
}

/* 7. Historico e proximas etapas ------------------------------------------ */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.history .card-title,
.order-card .card-title {
  color: var(--accent-text);
  font-size: var(--fs-xl);
}

.events {
  display: flex;
  flex-direction: column;
  margin: var(--space-5) 0 0;
}

/* Linha do historico: data e hora | marcador no fio | titulo e descricao. */
.event {
  display: grid;
  grid-template-columns: 5rem 1rem minmax(0, 1fr);
  column-gap: 0.625rem;
  padding-bottom: var(--space-6);
}

.event:last-child {
  padding-bottom: 0;
}

.event-when {
  display: flex;
  flex-direction: column;
  padding-top: 0.125rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  text-align: right;
  white-space: nowrap;
}

.event-date {
  display: block;
  color: var(--ink);
}

.event-time {
  display: block;
  color: var(--muted);
}

.event-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

/* Fio continuo: passa por tras dos marcadores, do primeiro ao ultimo. */
.event-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: calc(var(--space-6) * -1);
  left: calc(50% - 1px);
  width: 2px;
  background: var(--accent-line);
}

.event:first-child .event-rail::before {
  top: 0.75rem;
}

.event:last-child .event-rail::before {
  bottom: auto;
  height: 0.75rem;
}

.event:first-child:last-child .event-rail::before {
  content: none;
}

.event-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 0.625rem;
  height: 0.625rem;
  margin-top: 0.4375rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface);
  color: var(--accent-ink);
}

.event.is-current .event-mark {
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0.375rem;
  background: var(--highlight);
  box-shadow: 0 0 0 4px var(--highlight-soft);
}

.event.is-final .event-mark {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  background: var(--ok);
  color: #FFFFFF;
}

.event-mark svg {
  width: 0.75rem;
  height: 0.75rem;
}

.event-body {
  min-width: 0;
}

.event-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-width: 0;
}

.event-title {
  font-size: var(--fs-md);
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.event.is-current .event-title,
.event.is-final .event-title {
  color: var(--accent-text);
  font-size: var(--fs-lg);
  line-height: 1.3;
}

.event-desc {
  margin-top: 0.125rem;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}

.chip-now {
  border-color: var(--highlight-line);
  background: var(--highlight-soft);
  color: var(--highlight-text);
}

.events-empty {
  max-width: var(--measure);
  margin-top: var(--space-3);
  color: var(--ink-2);
  line-height: var(--lh-snug);
}

/* Etapa que acabou de mudar numa atualizacao automatica. */
.event.is-fresh .event-body,
.event.is-fresh .event-when {
  animation: tl-arrive var(--dur-4) var(--ease-out) both;
}

.event.is-fresh .event-mark,
.step.is-fresh .step-dot {
  animation: tl-pop var(--dur-4) var(--ease-out) both;
}

@keyframes tl-arrive {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

@keyframes tl-pop {
  from {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

/* Proximas etapas: bloco apagado, sem cartao branco. */
.upcoming {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.upcoming-title {
  color: var(--ink-2);
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
}

.next-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: var(--space-4) 0 0;
}

.next-item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  column-gap: var(--space-3);
}

.next-num {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.next-body {
  min-width: 0;
  padding-top: 0.125rem;
}

.next-title {
  color: var(--ink-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-semi);
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.next-desc {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}

.next-when {
  margin-top: var(--space-1);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

.next-when time {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 37.5em) {
  .detail,
  .detail-main {
    gap: var(--space-6);
  }

  .event {
    grid-template-columns: 5.5rem 1.25rem minmax(0, 1fr);
    column-gap: var(--space-4);
  }

  .upcoming {
    padding: var(--space-6) var(--space-8);
  }

}

@media (min-width: 60em) {
  .detail {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* 8. Dados do pedido ------------------------------------------------------ */

/* Aviso do pedido: fica no cartão de situação, logo acima das etapas, para não se perder no fim da página. */
.order-note {
  margin: 0 var(--space-5) var(--space-5);
}

@media (min-width: 37.5em) {
  .order-note {
    margin: 0 var(--space-8) var(--space-8);
  }
}

.order-note-text {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.data {
  display: flex;
  flex-direction: column;
  margin: var(--space-3) 0 0;
}

.data-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  column-gap: var(--space-3);
  padding-block: var(--space-3);
  border-top: 1px solid var(--line);
}

.data-row:first-child {
  border-top: 0;
}

.data-row:last-child {
  padding-bottom: 0;
}

.data-row dt {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.data-row dd {
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.data-row dd.is-code {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: var(--fw-semi);
  letter-spacing: 0.04em;
}

.data-row time {
  font-variant-numeric: tabular-nums;
}

.updated {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

/* 9. Rodape --------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2) var(--space-8);
  padding-block: var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
}

.foot-id {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.foot-logo {
  align-self: flex-start;
  width: auto;
  height: 1.5rem;
  margin-bottom: var(--space-2);
}

.foot-brand {
  color: var(--ink-2);
  font-weight: var(--fw-semi);
  overflow-wrap: anywhere;
}

.foot-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  font-weight: var(--fw-semi);
  overflow-wrap: anywhere;
}

/* 10. Movimento reduzido e impressao -------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  /* Sem pulso: o anel claro em volta da etapa atual continua marcando o lugar. */
  .step.is-current .step-dot::after {
    display: none;
  }
}

@media print {
  .search,
  .band::before,
  .band::after,
  .copy-btn,
  .topbar-link,
  .foot-link,
  .updated {
    display: none !important;
  }

  .band {
    background: none;
    color: var(--ink);
  }

  .band-tagline {
    color: var(--ink-2);
  }

  .results > .state-loading,
  .results > .result {
    margin-top: var(--space-6);
  }
}
