/* BLYO · segmentos (prefixo sg-)
   A página é um fichário. Na capa, as divisórias fechadas se abrem em leque e viram o índice.
   Depois vem uma ficha por segmento, com aba de pasta: em tela larga e alta as fichas grudam e
   empilham ao rolar (o JS mede e liga .sg-empilha só quando a ficha inteira cabe na tela).
   Cada ficha tem uma telinha de exemplo, que toca a sua cena uma vez quando aparece.
   O desenho base é sempre o estado final: sem JavaScript ou com "reduzir movimento", nada some. */

/* o "o" da marca em duas camadas: o contorno fica e o cheio pousa por cima */
.sg-o { position: relative; flex: none; display: block; width: 20px; height: 18px; }
.sg-o svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.sg-o__anel { fill: none; stroke: currentColor; stroke-width: 7; stroke-linejoin: round; }
.sg-o__cheio { fill: currentColor; transform-origin: 50% 50%; }

/* ---------- Capa: o título e o fichário fechado ---------- */

.sg-capa { padding-bottom: clamp(104px, 15vh, 168px); }
.sg-capa__grade { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 6vh, 56px); }

@media (min-width: 1200px) {
  .sg-capa__grade { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: clamp(48px, 5vw, 72px); align-items: end; }
  .sg-capa .pg-titulo { font-size: clamp(64px, 5.7vw, 86px); }
}
@media (max-width: 420px) {
  .sg-capa .pg-titulo { font-size: 10.4vw; }
}

/* o índice: seis divisórias de papel empilhadas, cada uma um passo para o lado, como num fichário */
.sg-leque { --sg-passo: 14px; --foco: var(--petroleo); container: sg-leque / inline-size; position: relative; width: 100%; max-width: 560px; }
.sg-leque ul { display: grid; padding-right: calc(5 * var(--sg-passo)); }
.sg-leque li { position: relative; margin-left: calc(var(--k) * var(--sg-passo)); margin-right: calc(var(--k) * var(--sg-passo) * -1); }
.sg-leque li + li { margin-top: -10px; }
.sg-leque li:focus-within { z-index: 2; }
.sg-leque li a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 18px 10px 16px;
  border: 1.5px solid var(--petroleo);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--papel);
  color: var(--petroleo);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.1;
  text-decoration: none;
  box-shadow: 6px 5px 0 rgba(4, 18, 15, .55);
  transition: transform .35s var(--entra);
}
.sg-leque li:nth-child(even) a { background: var(--marfim); }
.sg-leque li:last-child a { height: 54px; padding-bottom: 0; border-bottom: 1.5px solid var(--petroleo); border-radius: 10px 10px 4px 4px; box-shadow: 6px 7px 0 rgba(4, 18, 15, .55); }
.sg-leque li a:focus-visible { outline-offset: -6px; }
.sg-leque .sg-o { color: var(--positivo); }
.sg-leque .sg-o__cheio { opacity: 0; transform: scale(.4) rotate(-30deg); transition: opacity .2s, transform .45s var(--entra); }
.sg-leque a:hover .sg-o__cheio, .sg-leque a:focus-visible .sg-o__cheio { opacity: 1; transform: none; }
.sg-leque__nome { min-width: 0; text-wrap: balance; }
.sg-leque__sis { display: none; margin-left: auto; font-size: 14px; font-weight: 520; letter-spacing: 0; color: var(--suave-claro); white-space: nowrap; }
@container sg-leque (min-width: 470px) {
  .sg-leque__sis { display: block; }
}
@media (hover: hover) and (pointer: fine) {
  /* a divisória sai um pouco da pilha, como quem puxa uma ficha */
  .sg-leque li a:hover { transform: translate3d(10px, 0, 0); }
}
.sg-leque__outra {
  --foco: var(--menta);
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.sg-leque__outra:hover { text-decoration-thickness: 2px; }

@media (max-width: 520px) {
  .sg-leque { --sg-passo: 6px; }
  .sg-leque li a { padding-inline: 14px 12px; }
}

/* ---------- O fichário: uma ficha por segmento, com aba de divisória ---------- */

.sg-fichario { position: relative; background: var(--petroleo); }

.sg-ficha {
  --sg-aba-area: 100%;
  --sg-aba-w: 168px;
  position: relative;
  display: grid;
  align-content: center;
  padding: clamp(40px, 6vh, 60px) 0 clamp(84px, 11vh, 112px);
  border-top: 1.5px solid var(--sg-borda);
  background: var(--sg-fundo);
  color: var(--sg-tinta);
  scroll-margin-top: 52px;
}
.sg-ficha--papel { --sg-fundo: var(--papel); }
.sg-ficha--marfim { --sg-fundo: var(--marfim); }
.sg-ficha--papel, .sg-ficha--marfim {
  --sg-tinta: var(--petroleo);
  --sg-suave: var(--suave-claro);
  --sg-borda: var(--petroleo);
  --sg-fio: var(--linha-clara);
  --sg-marca: var(--positivo);
  --sg-sombra: var(--petroleo);
}
.sg-ficha--musgo { --sg-fundo: var(--musgo); }
.sg-ficha--petroleo { --sg-fundo: var(--petroleo); }
.sg-ficha--musgo, .sg-ficha--petroleo {
  --sg-tinta: var(--marfim);
  --sg-suave: var(--suave-escuro);
  --sg-borda: rgba(244, 240, 216, .36);
  --sg-fio: var(--linha-escura);
  --sg-marca: var(--menta);
  --sg-sombra: rgba(4, 18, 15, .6);
}

/* a aba fica presa na borda de cima da ficha, cada uma numa casa, da esquerda para a direita */
.sg-ficha__abas { position: absolute; inset: 0 0 auto; height: 0; }
.sg-aba {
  position: absolute;
  left: calc(var(--k) * (var(--sg-aba-area) - var(--sg-aba-w)) / 5);
  bottom: 0;
  width: var(--sg-aba-w);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1.5px solid var(--sg-borda);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: var(--sg-fundo);
  color: var(--sg-tinta);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1;
  white-space: nowrap;
}
.sg-aba .sg-o { width: 18px; height: 16px; color: var(--sg-marca); }
.sg-aba__nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 900px) {
  .sg-ficha { --sg-aba-w: calc(var(--sg-aba-area) / 6 - 8px); }
}
@media (min-width: 900px) and (max-width: 1399px) {
  .sg-aba { gap: 7px; padding: 0 10px; font-size: 14px; }
}

/* empilhadas: todas grudam na mesma altura, e a aba de cada ficha já vista continua na borda.
   As abas param antes do canto direito, onde fica o botão fixo do WhatsApp: a aba da próxima
   ficha aparece no pé da tela e não pode ficar embaixo dele. */
.sg-empilha .sg-ficha {
  --sg-aba-area: calc(100% - 160px);
  position: sticky;
  top: calc(var(--topo-altura) + 52px);
  min-height: calc(100vh - var(--topo-altura) - 52px);
  min-height: calc(100svh - var(--topo-altura) - 52px);
  box-shadow: 0 -6px 0 rgba(4, 18, 15, .16);
}
/* a ficha que fica por baixo recua um pouco enquanto a próxima sobe por cima dela */
.sg-empilha .sg-ficha__dentro {
  transform: scale(calc(1 - var(--sg-cobre, 0) * .035));
  transform-origin: 50% 0;
  opacity: calc(1 - var(--sg-cobre, 0) * .4);
}
/* com a ficha inteira subindo, o conteúdo não entra em separado */
.sg-empilha [data-revela] { opacity: 1; transform: none; transition: none; }

/* o foco do teclado para acima do botão fixo do WhatsApp, que fica no canto de baixo da tela */
.sg-ficha a, .sg-ficha button { scroll-margin-bottom: 88px; }

/* ---------- Dentro da ficha: texto, telinha e vídeo ---------- */

.sg-ficha__dentro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: start; }

.sg-texto { min-width: 0; }
.sg-titulo { font-size: clamp(30px, 3.5vw, 52px); line-height: 1; letter-spacing: -.045em; }
.sg-texto > p { margin-top: 16px; max-width: 42ch; font-size: clamp(16px, 1.25vw, 18px); color: var(--sg-suave); }
.sg-pecas { display: grid; margin-top: 22px; }
.sg-pecas li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 7px 0;
  border-top: 1px solid var(--sg-fio);
  font-size: 16px;
  font-weight: 560;
  line-height: 1.25;
}
.sg-pecas li:last-child { border-bottom: 1px solid var(--sg-fio); }
.sg-pecas svg { flex: none; width: 18px; height: 16px; overflow: visible; fill: none; stroke: var(--sg-marca); stroke-width: 7; stroke-linejoin: round; }
.sg-texto > .sg-nota { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 16px; font-weight: 650; line-height: 1.3; color: var(--sg-tinta); }
.sg-nota svg { flex: none; width: 20px; height: 18px; fill: var(--sg-marca); }
.sg-texto > .sg-acao { margin-top: 18px; color: var(--sg-tinta); }
.sg-link { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.sg-link:hover { text-decoration-thickness: 2px; }

.sg-duplo { display: grid; margin-top: 22px; }
.sg-duplo > div { padding: 16px 0; border-top: 1px solid var(--sg-fio); }
.sg-duplo > div:last-child { border-bottom: 1px solid var(--sg-fio); }
.sg-duplo h3 { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.1; letter-spacing: -.025em; }
.sg-duplo p { margin-top: 6px; max-width: 42ch; font-size: 16px; color: var(--sg-suave); }

.sg-tela { min-width: 0; width: 100%; max-width: 520px; margin: 0; padding-right: 10px; }
.sg-tela--salao, .sg-tela--funil { max-width: 560px; }
.sg-tela--pedido, .sg-tela--campo { max-width: 480px; }
.sg-tela__nota { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 14px; font-size: 14px; line-height: 1.35; color: var(--sg-suave); }
.sg-repete {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--sg-tinta);
  font: 600 14px/1 var(--fonte);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  cursor: pointer;
}
.sg-repete:hover { text-decoration-thickness: 2px; }

.sg-video { width: min(100%, 236px); }

@media (min-width: 700px) {
  .sg-ficha__dentro { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(28px, 4vw, 56px); }
  .sg-texto { grid-column: 1; grid-row: 1 / span 2; }
  .sg-tela, .sg-video { grid-column: 2; }
}
@media (min-width: 1200px) {
  .sg-ficha__dentro { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
  .sg-texto { grid-row: 1; }
  .sg-tela { justify-self: center; }
  .sg-ficha--video .sg-ficha__dentro { grid-template-columns: minmax(0, 4.2fr) minmax(0, 5fr) minmax(0, 2.8fr); column-gap: clamp(28px, 3vw, 44px); }
  .sg-ficha--video .sg-tela { grid-column: 2; grid-row: 1; }
  .sg-ficha--video .sg-video { grid-column: 3; grid-row: 1; justify-self: end; margin-right: 14px; }
}

/* ---------- Peças comuns das telinhas ---------- */

.sg-janela {
  container: sg-janela / inline-size;
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--petroleo);
  border-radius: 8px;
  background: var(--papel);
  color: var(--petroleo);
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 9px 11px 0 var(--sg-sombra);
}
.sg-janela i, .sg-janela em { font-style: normal; }
.sg-janela small { font-size: 13px; }

.sg-barra { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; background: var(--petroleo); color: var(--marfim); font-size: 14px; white-space: nowrap; }
.sg-barra b { font-weight: 650; }
.sg-barra__o { flex: none; width: 20px; height: 18px; fill: var(--menta); }
.sg-barra__trilha { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--suave-escuro); }
.sg-barra__trilha::before { content: "/"; margin-right: 10px; opacity: .6; }
.sg-barra__fim { margin-left: auto; font-size: 13px; color: var(--suave-escuro); }

.sg-chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 3px; background: rgba(16, 46, 40, .09); color: var(--petroleo); font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.sg-chip--ok { background: var(--ok-fundo); color: var(--positivo); }
.sg-chip--alerta { background: var(--alerta-fundo); color: var(--alerta); }

.sg-av { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--musgo); color: var(--marfim); font-size: 13px; font-weight: 650; line-height: 1; }
.sg-av--g { width: 32px; height: 32px; font-size: 15px; }

/* troca de estado: os estados no mesmo lugar; no desenho base fica o último */
.sg-troca { display: inline-grid; }
.sg-troca > * { grid-area: 1 / 1; opacity: 0; }
.sg-troca > :last-child { opacity: 1; }

/* toque na tela: anel que abre e some (só aparece com movimento) */
.sg-onda { position: absolute; z-index: 3; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 2px solid var(--positivo); border-radius: 50%; opacity: 0; pointer-events: none; }

/* visto dentro de um círculo ou de uma caixa: no desenho base já está marcado */
.sg-no, .sg-visto { position: relative; z-index: 1; flex: none; display: grid; place-items: center; border: 2px solid var(--positivo); background: var(--positivo); }
.sg-no { width: 22px; height: 22px; border-radius: 50%; }
.sg-visto { width: 18px; height: 18px; border-width: 1.5px; border-radius: 4px; }
.sg-no svg, .sg-visto svg, .sg-vaga__ok svg { width: 12px; height: 12px; fill: none; stroke: var(--papel); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }

/* ---------- Restaurantes: a planta do salão ---------- */

.sg-salao { padding: 12px; }
.sg-planta {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: "bal bal m1 m2" "m3 m4 m5 m5" "m6 m7 m8 por";
  grid-auto-rows: 62px;
  gap: 4px 6px;
  place-items: center;
  padding: 10px 8px 6px;
  border: 2px solid rgba(16, 46, 40, .55);
  border-radius: 6px;
  background: rgba(16, 46, 40, .05);
}
.sg-balcao { grid-area: bal; justify-self: stretch; align-self: start; display: grid; place-items: center; height: 34px; margin: 0 6px; border: 1.5px solid rgba(16, 46, 40, .42); border-radius: 4px; background: rgba(16, 46, 40, .1); font-size: 13px; font-weight: 600; color: var(--suave-claro); }
/* a entrada: um vão na parede de baixo */
.sg-porta { grid-area: por; align-self: end; justify-self: end; padding: 0 4px 2px 0; font-size: 13px; line-height: 1.3; color: var(--suave-claro); }
.sg-porta::after { content: ""; position: absolute; right: 12px; bottom: -2px; width: 46px; height: 2px; background: var(--papel); }

/* cada mesa com as cadeiras desenhadas por fora */
.sg-mesa {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  width: 56px;
  height: 40px;
  border: 1.5px solid rgba(16, 46, 40, .42);
  border-radius: 6px;
  background: var(--papel);
  color: var(--petroleo);
  line-height: 1;
}
.sg-mesa::before, .sg-mesa::after { content: ""; position: absolute; left: 50%; width: 24px; height: 5px; margin-left: -12px; border-radius: 3px; background: rgba(16, 46, 40, .26); }
.sg-mesa::before { top: -9px; }
.sg-mesa::after { bottom: -9px; }
.sg-mesa b { font-size: 15px; font-weight: 700; }
.sg-mesa small { font-weight: 500; }
.sg-mesa--redonda { width: 42px; height: 42px; border-radius: 50%; }
.sg-mesa--redonda::before, .sg-mesa--redonda::after { top: 50%; bottom: auto; left: auto; width: 5px; height: 20px; margin: -10px 0 0; }
.sg-mesa--redonda::before { left: -9px; }
.sg-mesa--redonda::after { right: -9px; }
.sg-mesa--longa { width: min(100%, 124px); }
.sg-mesa--longa::before, .sg-mesa--longa::after { box-shadow: -36px 0 0 rgba(16, 46, 40, .26), 36px 0 0 rgba(16, 46, 40, .26); }
.sg-mesa--ocupada { border-color: var(--musgo); background: var(--musgo); color: var(--marfim); }
.sg-mesa--ocupada small { color: var(--menta); }
/* a mesa 4 tem os três estados no mesmo lugar; no desenho base fica o último */
.sg-mesa--foco { border-color: transparent; background: none; }
.sg-face { position: absolute; inset: -1.5px; display: grid; place-content: center; justify-items: center; gap: 2px; border: 1.5px solid rgba(16, 46, 40, .42); border-radius: 6px; background: var(--papel); opacity: 0; }
.sg-face--ocupada { border-color: var(--musgo); background: var(--musgo); color: var(--marfim); }
.sg-face--ocupada small { color: var(--menta); }
.sg-face--conta { border-color: var(--alerta); background: var(--alerta-fundo); color: var(--alerta); opacity: 1; }
.sg-face--conta small { font-weight: 650; }

.sg-salao__linha { display: flex; align-items: baseline; gap: 8px; min-height: 22px; margin-top: 10px; font-size: 14px; }
.sg-salao__linha b { flex: none; font-weight: 700; }
.sg-t1-linha { justify-items: start; color: var(--suave-claro); }

/* ---------- Educação: as quatro colunas do funil ---------- */

.sg-funil { padding: 12px; }
.sg-raias { --g: 6px; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--g); }
.sg-raia > b { display: block; height: 22px; overflow: hidden; font-size: 13px; font-weight: 650; line-height: 22px; color: var(--suave-claro); white-space: nowrap; text-overflow: ellipsis; }
.sg-raia__corpo { display: grid; align-content: start; gap: 6px; height: 128px; padding: 6px; border-radius: 6px; background: rgba(16, 46, 40, .06); }
/* a casa por onde a ficha passa: fica o contorno do "o" de quem já passou */
.sg-pista { display: grid; place-items: center; height: 44px; }
.sg-pista svg { width: 22px; height: 20px; overflow: visible; fill: none; stroke: var(--positivo); stroke-width: 7; stroke-linejoin: round; }
.sg-vulto { height: 22px; border-radius: 4px; background: rgba(16, 46, 40, .1); }
/* a ficha anda numa faixa da largura de uma coluna mais o vão: 100% dela é exatamente um passo */
.sg-anda { position: absolute; z-index: 2; left: 0; top: 28px; width: calc((100% - 3 * var(--g)) / 4 + var(--g)); height: 44px; padding: 0 calc(var(--g) + 6px) 0 6px; transform: translate3d(300%, 0, 0); }
.sg-anda__cartao { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 6px; overflow: hidden; border: 1px solid rgba(16, 46, 40, .22); border-radius: 6px; background: var(--papel); box-shadow: 3px 4px 0 rgba(16, 46, 40, .18); font-size: 13px; white-space: nowrap; }
.sg-anda__cartao b { font-weight: 650; }
@container sg-janela (max-width: 419px) {
  .sg-anda__cartao .sg-av { display: none; }
}

.sg-lead { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(16, 46, 40, .25); }
.sg-lead__txt b { display: block; font-size: 15px; font-weight: 650; line-height: 1.2; }
.sg-lead__txt small { display: block; color: var(--suave-claro); }
.sg-lead__rastro { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Clínicas: a grade de horários e o lembrete ---------- */

.sg-agenda { padding: 12px; }
.sg-agenda__grade { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; }
.sg-agenda__grade > b { overflow: hidden; font-size: 13px; font-weight: 650; color: var(--suave-claro); white-space: nowrap; text-overflow: ellipsis; }
.sg-agenda__grade > time { font: 13px var(--mono); color: var(--suave-claro); }
.sg-vaga { position: relative; display: flex; align-items: center; height: 36px; padding: 0 9px; overflow: hidden; border: 1.5px dashed rgba(16, 46, 40, .3); border-radius: 5px; font-size: 13px; color: var(--suave-claro); white-space: nowrap; }
.sg-vaga--cheia { border: 1.5px solid transparent; background: rgba(16, 46, 40, .09); color: var(--petroleo); font-weight: 600; }
.sg-vaga--foco { padding: 0; overflow: visible; border: 0; }
.sg-vaga__antes { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 9px; border: 1.5px dashed rgba(16, 46, 40, .3); border-radius: 5px; opacity: 0; }
.sg-vaga__nova { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 7px 0 9px; border-radius: 5px; background: var(--ok-fundo); color: var(--petroleo); box-shadow: 3px 4px 0 rgba(16, 46, 40, .2); }
.sg-vaga__nova b { min-width: 0; overflow: hidden; font-weight: 650; text-overflow: ellipsis; }
.sg-t3-estado { flex: none; justify-items: end; align-items: center; }
.sg-vaga__tag { padding: 2px 6px; border-radius: 3px; background: var(--papel); color: var(--positivo); font-weight: 600; line-height: 1.25; }
.sg-vaga__ok { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--positivo); }

.sg-conversa { display: grid; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(16, 46, 40, .25); }
.sg-balao { max-width: 88%; padding: 8px 11px; border-radius: 10px; font-size: 14px; line-height: 1.35; }
.sg-balao small { display: block; margin-bottom: 2px; font-weight: 650; color: var(--positivo); }
.sg-balao--sai { justify-self: end; border-bottom-right-radius: 3px; background: var(--ok-fundo); transform-origin: 100% 0; }
.sg-balao--vem { justify-self: start; border-bottom-left-radius: 3px; background: rgba(16, 46, 40, .08); transform-origin: 0 100%; }

/* ---------- Distribuidoras: o caminho do pedido ---------- */

.sg-pedido { padding: 14px; }
.sg-pedido__cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sg-pedido__cab b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.sg-pedido__cab small { display: block; margin-top: 2px; color: var(--suave-claro); }
.sg-t4-estado { flex: none; justify-items: end; }
.sg-trilha { display: grid; margin-top: 12px; padding-top: 6px; border-top: 1px dashed rgba(16, 46, 40, .25); }
.sg-trilha li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; height: 48px; }
/* o trecho até a próxima etapa: a altura fixa da linha faz ele encostar nos dois círculos */
.sg-trilha li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 35px; width: 2px; height: 26px; background: var(--positivo); transform-origin: 50% 0; }
.sg-trilha p b { display: block; font-size: 14px; font-weight: 650; line-height: 1.25; }
.sg-trilha p small { display: block; color: var(--suave-claro); line-height: 1.25; }
.sg-trilha time { font: 13px var(--mono); color: var(--suave-claro); }

/* ---------- Campo: a rota do dia e a ordem de serviço ---------- */

.sg-campo { display: grid; gap: 12px; padding: 12px; }
.sg-mapa { position: relative; aspect-ratio: 300 / 120; overflow: hidden; border-radius: 6px; background: rgba(16, 46, 40, .1); }
.sg-mapa svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sg-mapa__ruas { fill: none; stroke: var(--papel); stroke-width: 9; }
.sg-mapa__rota { fill: none; stroke: var(--positivo); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.sg-pino { position: absolute; display: grid; place-items: center; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 2px solid var(--papel); border-radius: 50%; background: var(--petroleo); color: var(--marfim); font-size: 13px; font-weight: 700; line-height: 1; }

.sg-os__cab { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sg-os__cab b { font-size: 15px; font-weight: 700; }
.sg-os__cab small { color: var(--suave-claro); }
.sg-t5-estado { margin-left: auto; justify-items: end; }
.sg-check { display: grid; gap: 7px; margin-top: 10px; }
.sg-check li { display: flex; align-items: center; gap: 9px; font-size: 14px; line-height: 1.25; }
.sg-visto svg { width: 11px; height: 11px; }
.sg-assina { display: flex; align-items: flex-end; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(16, 46, 40, .25); }
.sg-assina svg { flex: none; width: 120px; height: 34px; fill: none; stroke: var(--petroleo); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.sg-assina small { padding-bottom: 3px; color: var(--suave-claro); }

/* ---------- Atendimento: a fila de chamados ---------- */

/* alturas fixas: os chamados antigos descem exatamente uma linha quando o novo entra */
.sg-fila { --sg-linha: 62px; --sg-vao: 8px; padding: 10px 12px 14px; }
.sg-fila__cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 28px; font-size: 13px; color: var(--suave-claro); }
.sg-fila__cab b { font-weight: 650; }
.sg-t6-conta { justify-items: end; }
.sg-chamados { display: grid; gap: var(--sg-vao); margin-top: 6px; }
.sg-chamado {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 5px 8px;
  height: var(--sg-linha);
  padding: 0 12px;
  border: 1px solid rgba(16, 46, 40, .14);
  border-radius: 6px;
  background: var(--papel);
  font-size: 14px;
}
.sg-chamado > i { font-size: 13px; color: var(--suave-claro); }
.sg-chamado > b { grid-column: 2 / -1; overflow: hidden; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.sg-chamado > .sg-resp, .sg-t6-resp { grid-column: 1 / 3; grid-row: 2; justify-self: start; }
.sg-t6-resp { justify-items: start; align-items: center; }
.sg-resp { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.sg-prazo { grid-column: 3; grid-row: 2; font-size: 13px; color: var(--suave-claro); text-align: right; white-space: nowrap; }
.sg-prazo .sg-troca { justify-items: end; }
.sg-prazo--alerta { font-weight: 600; color: var(--alerta); }
.sg-chamado--novo { border-color: rgba(16, 46, 40, .34); box-shadow: 3px 4px 0 rgba(16, 46, 40, .16); }

/* ---------- Fecho: a ficha em branco, à espera da próxima operação ---------- */

.sg-fecho__grade { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.sg-branco { display: none; width: 100%; max-width: 380px; height: auto; overflow: visible; fill: none; stroke: var(--petroleo); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sg-branco__aba { stroke-dasharray: 7 6; }
.sg-branco text { fill: var(--petroleo); stroke: none; font: 650 17px var(--fonte); letter-spacing: -.01em; }
@media (min-width: 900px) {
  .sg-fecho__grade { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: clamp(40px, 6vw, 96px); }
  .sg-branco { display: block; justify-self: end; }
}

/* ---------- Celular ---------- */

@media (max-width: 599px) {
  .sg-ficha { padding-top: 36px; }
  .sg-pecas li { font-size: 15.5px; }
  .sg-tela__nota { align-items: flex-start; }
  .sg-tela__nota > span { padding-top: 4px; }
  .sg-texto .botao { width: 100%; }
}

/* ---------- Movimento: só com movimento liberado ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* capa: as divisórias começam todas no lugar da primeira e descem uma a uma, abrindo o fichário */
  .js .sg-leque li { transform: translate3d(calc(var(--k) * var(--sg-passo) * -1), calc(var(--k) * -48px), 0); transition: transform 1.1s var(--entra) calc(var(--k) * 80ms + 350ms); }
  .js.carregou .sg-leque li { transform: none; }
  .js .sg-leque__outra { opacity: 0; transition: opacity .6s ease 1.35s; }
  .js.carregou .sg-leque__outra { opacity: 1; }

  /* o "o" da aba pousa quando a ficha chega */
  .sg-aba .sg-o__cheio { transition: opacity .25s ease .15s, transform .6s var(--entra) .15s; }
  .sg-arma .sg-ficha:not(.sg-toca) .sg-aba .sg-o__cheio { opacity: 0; transform: scale(.4) rotate(-30deg); }

  /* as cenas ficam paradas no primeiro quadro (.sg-arma) e rodam uma vez com .sg-toca */

  /* restaurantes: dois toques na mesa 4, que passa de livre para ocupada e depois para conta */
  .sg-arma .sg-salao .sg-onda { animation: sg-onda 1.6s var(--ease) .4s 2 both paused; }
  .sg-arma .sg-mesa--foco { animation: sg-quique .45s var(--ease) .7s both paused, sg-quique .45s var(--ease) 2.3s both paused; }
  .sg-arma .sg-face--livre { animation: sg-some .25s ease .7s both paused; }
  .sg-arma .sg-face--ocupada { animation: sg-surge .25s ease .7s both paused, sg-some .25s ease 2.3s forwards paused; }
  .sg-arma .sg-face--conta { animation: sg-surge .25s ease 2.3s both paused; }
  .sg-arma .sg-t1-hora > :nth-child(1), .sg-arma .sg-t1-linha > :nth-child(1) { animation: sg-sai .26s ease .7s both paused; }
  .sg-arma .sg-t1-hora > :nth-child(2), .sg-arma .sg-t1-linha > :nth-child(2) { animation: sg-entra .3s ease .8s both paused, sg-sai .26s ease 2.3s forwards paused; }
  .sg-arma .sg-t1-hora > :nth-child(3), .sg-arma .sg-t1-linha > :nth-child(3) { animation: sg-entra .3s ease 2.4s both paused; }

  /* educação: a ficha pula de coluna em coluna; em cada uma fica um "o" e a ficha de baixo ganha um registro */
  .sg-arma .sg-anda { animation: sg-atravessa 3s linear .4s both paused; }
  .sg-arma .sg-raia:nth-child(1) .sg-pista svg { animation: sg-pousa-o .5s var(--entra) .8s both paused; }
  .sg-arma .sg-raia:nth-child(2) .sg-pista svg { animation: sg-pousa-o .5s var(--entra) 1.7s both paused; }
  .sg-arma .sg-raia:nth-child(3) .sg-pista svg { animation: sg-pousa-o .5s var(--entra) 2.6s both paused; }
  .sg-arma .sg-lead__rastro li:nth-child(2) { animation: sg-registro .4s var(--entra) 1.2s both paused; }
  .sg-arma .sg-lead__rastro li:nth-child(3) { animation: sg-registro .4s var(--entra) 2.1s both paused; }
  .sg-arma .sg-lead__rastro li:nth-child(4) { animation: sg-registro .4s var(--entra) 3s both paused; }

  /* clínicas: a consulta encaixa na vaga livre, o lembrete sai e a resposta volta */
  .sg-arma .sg-vaga__antes { animation: sg-some .2s ease .6s both paused; }
  .sg-arma .sg-vaga__nova { animation: sg-encaixa .6s var(--entra) .5s both paused; }
  .sg-arma .sg-balao--sai { animation: sg-balao .5s var(--entra) 1.4s both paused; }
  .sg-arma .sg-balao--vem { animation: sg-balao .5s var(--entra) 2.4s both paused; }
  .sg-arma .sg-t3-estado > :first-child { animation: sg-sai .22s ease 3s both paused; }
  .sg-arma .sg-t3-estado > :last-child { animation: sg-pop .4s var(--entra) 3.1s both paused; }
  .sg-arma .sg-vaga__ok path { animation: sg-traco .35s var(--ease) 3.25s both paused; }

  /* distribuidoras: cada etapa é marcada, a linha desce até a próxima e o estado do pedido muda */
  .sg-arma .sg-trilha li:nth-child(1) { --t: .4s; }
  .sg-arma .sg-trilha li:nth-child(2) { --t: 1s; }
  .sg-arma .sg-trilha li:nth-child(3) { --t: 1.6s; }
  .sg-arma .sg-trilha li:nth-child(4) { --t: 2.2s; }
  .sg-arma .sg-trilha .sg-no { animation: sg-marcado .3s ease var(--t) both paused; }
  .sg-arma .sg-trilha .sg-no path { animation: sg-traco .3s var(--ease) calc(var(--t) + .1s) both paused; }
  .sg-arma .sg-trilha li > p, .sg-arma .sg-trilha li > time { animation: sg-acende .35s ease var(--t) both paused; }
  .sg-arma .sg-trilha li:not(:last-child)::after { animation: sg-liga .4s var(--ease) calc(var(--t) + .2s) both paused; }
  .sg-arma .sg-t4-estado > :nth-child(1) { animation: sg-sai .24s ease 1s both paused; }
  .sg-arma .sg-t4-estado > :nth-child(2) { animation: sg-entra .28s ease 1.08s both paused, sg-sai .24s ease 1.6s forwards paused; }
  .sg-arma .sg-t4-estado > :nth-child(3) { animation: sg-entra .28s ease 1.68s both paused, sg-sai .24s ease 2.2s forwards paused; }
  .sg-arma .sg-t4-estado > :nth-child(4) { animation: sg-entra .28s ease 2.28s both paused; }

  /* campo: a rota se desenha de parada em parada, o checklist é marcado e o cliente assina */
  .sg-arma .sg-mapa__rota { animation: sg-traco 1.5s cubic-bezier(.45, 0, .55, 1) .4s both paused; }
  .sg-arma .sg-pino:nth-of-type(1) { animation: sg-pop .4s var(--entra) .3s both paused; }
  .sg-arma .sg-pino:nth-of-type(2) { animation: sg-pop .4s var(--entra) 1.2s both paused; }
  .sg-arma .sg-pino:nth-of-type(3) { animation: sg-pop .4s var(--entra) 1.85s both paused; }
  .sg-arma .sg-check li:nth-child(1) { --t: 2.2s; }
  .sg-arma .sg-check li:nth-child(2) { --t: 2.5s; }
  .sg-arma .sg-check li:nth-child(3) { --t: 2.8s; }
  .sg-arma .sg-visto { animation: sg-marcado .25s ease var(--t) both paused; }
  .sg-arma .sg-visto path { animation: sg-traco .28s var(--ease) calc(var(--t) + .06s) both paused; }
  .sg-arma .sg-assina path { animation: sg-traco .9s cubic-bezier(.4, 0, .3, 1) 3.2s both paused; }
  .sg-arma .sg-t5-estado > :first-child { animation: sg-sai .24s ease 4.1s both paused; }
  .sg-arma .sg-t5-estado > :last-child { animation: sg-entra .28s ease 4.18s both paused; }

  /* atendimento: o chamado novo entra no topo, a fila desce, chega o responsável e o prazo conta */
  .sg-arma .sg-chamado--desce { animation: sg-fila-desce .7s var(--entra) .45s both paused; }
  .sg-arma .sg-chamado--novo { animation: sg-fila-entra .6s var(--entra) .6s both paused; }
  .sg-arma .sg-t6-conta > :first-child { animation: sg-sai .24s ease .7s both paused; }
  .sg-arma .sg-t6-conta > :last-child { animation: sg-entra .28s ease .78s both paused; }
  .sg-arma .sg-t6-resp > :first-child { animation: sg-sai .24s ease 1.7s both paused; }
  .sg-arma .sg-t6-resp > :last-child { animation: sg-pop .4s var(--entra) 1.8s both paused; }
  .sg-arma .sg-t6-prazo { animation: sg-entra .3s ease 2.3s both paused; }
  .sg-arma .sg-t6-prazo .sg-troca > :nth-child(1) { animation: sg-sai .16s ease 3.3s both paused; }
  .sg-arma .sg-t6-prazo .sg-troca > :nth-child(2) { animation: sg-entra .18s ease 3.34s both paused, sg-sai .16s ease 4.3s forwards paused; }
  .sg-arma .sg-t6-prazo .sg-troca > :nth-child(3) { animation: sg-entra .18s ease 4.34s both paused, sg-sai .16s ease 5.3s forwards paused; }
  .sg-arma .sg-t6-prazo .sg-troca > :nth-child(4) { animation: sg-entra .18s ease 5.34s both paused; }

  /* "running" com !important vence as regras de cada peça, que são mais específicas e trazem "paused" */
  .sg-arma .sg-toca .sg-janela *, .sg-arma .sg-toca .sg-janela *::before, .sg-arma .sg-toca .sg-janela *::after { animation-play-state: running !important; }
  /* "Repetir": tira as animações por um instante para elas recomeçarem do primeiro quadro */
  .sg-zera .sg-janela *, .sg-zera .sg-janela *::before, .sg-zera .sg-janela *::after { animation: none !important; }
}

@keyframes sg-some { from { opacity: 1; } to { opacity: 0; } }
@keyframes sg-surge { from { opacity: 0; } to { opacity: 1; } }
@keyframes sg-sai { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(0, -6px, 0); } }
@keyframes sg-entra { from { opacity: 0; transform: translate3d(0, 6px, 0); } to { opacity: 1; transform: none; } }
@keyframes sg-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes sg-onda {
  0% { opacity: 0; transform: scale(.35); }
  2% { opacity: .95; transform: scale(.35); }
  38%, 100% { opacity: 0; transform: scale(1.8); }
}
@keyframes sg-quique { 0%, 100% { transform: none; } 40% { transform: scale(1.1); } }
@keyframes sg-atravessa {
  0% { transform: translate3d(0, 0, 0); }
  8% { transform: translate3d(0, 0, 0); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
  17% { transform: translate3d(50%, -8px, 0) rotate(-2.5deg); animation-timing-function: cubic-bezier(.1, .4, .5, 1); }
  26% { transform: translate3d(100%, 0, 0); }
  38% { transform: translate3d(100%, 0, 0); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
  47% { transform: translate3d(150%, -8px, 0) rotate(-2.5deg); animation-timing-function: cubic-bezier(.1, .4, .5, 1); }
  56% { transform: translate3d(200%, 0, 0); }
  68% { transform: translate3d(200%, 0, 0); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
  77% { transform: translate3d(250%, -8px, 0) rotate(-2.5deg); animation-timing-function: cubic-bezier(.1, .4, .5, 1); }
  86%, 100% { transform: translate3d(300%, 0, 0); }
}
@keyframes sg-pousa-o { from { opacity: 0; transform: scale(.4) rotate(-30deg); } to { opacity: 1; transform: none; } }
@keyframes sg-registro { from { opacity: 0; transform: translate3d(-8px, 0, 0) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes sg-encaixa {
  from { opacity: 0; transform: translate3d(0, -18px, 0) scale(1.08); }
  35% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes sg-balao { from { opacity: 0; transform: translate3d(0, -8px, 0) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes sg-traco { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sg-marcado { from { border-color: rgba(16, 46, 40, .32); background-color: var(--papel); } to { border-color: var(--positivo); background-color: var(--positivo); } }
@keyframes sg-acende { from { opacity: .45; } to { opacity: 1; } }
@keyframes sg-liga { from { transform: scaleY(0); } to { transform: none; } }
@keyframes sg-fila-desce { from { transform: translate3d(0, calc(-1 * (var(--sg-linha) + var(--sg-vao))), 0); } to { transform: none; } }
@keyframes sg-fila-entra { from { opacity: 0; transform: translate3d(0, -60%, 0) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .sg-onda { display: none; }
  .sg-leque li a { transition: none; }
}
