/* GERADO por deploy/status/sync-ui.mjs a partir de packages/ui/src (styles.css :root + tokens.css), commit 0c8ef5a.
   Não editar à mão: mude no design system e rode o script de novo. */
:root {
  color-scheme: light;

  /* Cor da marca Nutrype: indigo (marca), lime (conquista, só sobre indigo ou ink), ink (texto), oat (respiro),
     peach (acolhimento). Contrastes conferidos: branco/indigo 6.5:1, lime/indigo 5.3:1, ink/oat 15.7:1. */
  --c-indigo: #3648e8;
  --c-lime: #d8f65b;
  --c-peach: #ffaf83;
  --c-bg: #f5f4ee; /* oat */
  --c-surface: #ffffff;
  --c-sunken: #ecebe4;
  --c-ink: #171a24;
  --c-ink-2: #4c5163; /* texto secundário: 7.9:1 no branco, 7.2:1 no fundo */
  --c-line: rgb(23 26 36 / 9%); /* divisória decorativa, nunca a única pista */
  --c-line-strong: #767b8a; /* borda de campo: 4.2:1 no branco */
  --c-brand: #3648e8; /* 6.5:1 com branco */
  --c-brand-press: #2a39c4;
  --c-brand-soft: #e9ebfd;
  --c-brand-ink: #2433b0;
  --c-water: #0b6577; /* água: verde-azulado, distinto da marca */
  --c-water-soft: #e1f1f3;
  --c-sun-ink: #8a3a12; /* tom peach para destaque acolhedor */
  --c-sun-soft: #ffeadd;
  --c-danger: #a3261d;
  --c-danger-soft: #fbeae8;
  --c-ok-ink: #14513a;
  --c-warn-ink: #5c4300;
  --c-warn-soft: #fff3d1;
  --c-proto: #5b3c99;
  --c-proto-soft: #efe9fa;
  --c-focus: #171a24;

  /* Tipografia: escala ~1.2, base 16px. */
  /* Inter: interface e dados. Manrope: títulos e comunicação. */
  --font-sans:
    "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --font-display:
    "Manrope Variable", "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --t-xs: 0.8125rem; /* 13 */
  --t-sm: 0.875rem; /* 14 */
  --t-md: 1rem; /* 16 */
  --t-lg: 1.125rem; /* 18 */
  --t-xl: 1.375rem; /* 22 */
  --t-2xl: 1.75rem; /* 28 */
  --t-3xl: 2.125rem; /* 34 */
  --lh-tight: 1.2;
  --lh-body: 1.5;

  /* Espaço: grade de 4px. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Forma e profundidade. */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(23 26 36 / 5%), 0 1px 1px rgb(23 26 36 / 3%);
  --shadow-2: 0 4px 16px rgb(23 26 36 / 8%), 0 1px 3px rgb(23 26 36 / 6%);
  --shadow-3: 0 12px 32px rgb(23 26 36 / 14%);

  /* Movimento: curto e discreto. */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --d-fast: 120ms;
  --d-base: 200ms;

  /* Alvos e larguras. */
  --tap: 44px;
  --w-read: 640px;
  --w-app: 560px;
  --w-wide: 1120px;
  /* Telas de trabalho no desktop (listas, agenda, CRM, painel): usam a largura até aqui e centralizam acima. */
  --w-page: 1600px;
  /* Medida de leitura para parágrafos dentro de páginas largas. */
  --w-measure: 75ch;
  --sidebar: 224px;
  --bottom-nav: 68px;
}

/* Tokens semânticos e de densidade (ADR-0047). Os tokens de marca (--c-indigo, --c-ink, --c-bg…) continuam em
   styles.css; aqui ficam os nomes por PAPEL, que telas novas devem usar, e a densidade, que muda por superfície.

   Papel, não cor: "texto secundário" e não "cinza 600". Assim uma superfície pode mudar a cor sem caçar telas
   (padrão Primer/Spectrum/Twenty). Valores conferidos com WCAG 2.2 AA (contrastes nos comentários). */
:root {
  /* Texto */
  --c-text: var(--c-ink); /* 15,7:1 no fundo */
  --c-text-muted: var(--c-ink-2); /* 7,2:1 no fundo, 7,9:1 no branco */
  --c-text-on-accent: #fff; /* 6,5:1 sobre --c-accent */

  /* Superfícies */
  --c-surface-subtle: #fbfaf7; /* cabeçalho de tabela, linha em foco, refeição feita */
  --c-surface-2: var(
    --c-sunken
  ); /* era usado sem definição (avatar com foto) */
  --c-row-hover: rgb(23 26 36 / 3.5%);
  --c-row-selected: var(--c-brand-soft);

  /* Linhas */
  --c-border: var(--c-line); /* divisória decorativa, nunca a única pista */
  --c-border-control: var(
    --c-line-strong
  ); /* borda de campo: 4,2:1 (>= 3:1, WCAG 1.4.11) */

  /* Ação e foco */
  --c-accent: var(--c-brand);
  --c-accent-hover: var(--c-brand-press);
  --c-accent-soft-hover: #dfe2fc; /* realce do fundo suave da marca */
  --focus-ring: 0 0 0 3px rgb(54 72 232 / 28%); /* halo indigo junto da borda ink do campo */

  /* Estados (par fundo suave + texto escuro; sempre com texto ou ícone, nunca só cor) */
  --c-ok-soft: var(--c-brand-soft);
  --c-danger-ink: #8a1f17; /* 7,4:1 sobre --c-danger-soft */
  --c-info-ink: #164a7c; /* 7,6:1 sobre --c-info-soft */
  --c-info-soft: var(--c-water-soft);

  /* Densidade confortável (padrão): app da equipe dos consultórios, app do paciente, site.
     Acolhedor, alvo de 44 px, campo de 48 px. */
  --ctl-h: var(--tap);
  --ctl-h-sm: 36px;
  --btn-px: var(--s-5);
  --field-h: 48px;
  --field-py: var(--s-3);
  --field-px: var(--s-4);
  --cell-py: var(--s-3);
  --cell-px: var(--s-4);
  --row-min: 60px;
  --ui-text: var(--t-md);
}

/* Densidade operacional: painel interno (ops), CRM e outras ferramentas usadas horas por dia.
   Só com mouse e tela de computador; no toque tudo volta a 44 px (alvo do projeto e WCAG 2.5.8 folgado).
   Ativa com <body class="ops"> (ops e CRM já usam) ou data-density="compact" em qualquer contêiner. */
@media (min-width: 1024px) and (pointer: fine) {
  .ops,
  [data-density="compact"] {
    --ctl-h: 36px;
    --ctl-h-sm: 30px;
    --btn-px: var(--s-4);
    --field-h: 36px;
    --field-py: 6px;
    --field-px: var(--s-3);
    --cell-py: var(--s-2);
    --cell-px: var(--s-3);
    --row-min: 44px;
    --ui-text: var(--t-sm);
  }
}

/* Página de status (status.nutrype.com, ADR-0049). Só tokens do design system (assets/ui-tokens.css, gerado por
   sync-ui.mjs a partir de packages/ui, commit no topo daquele arquivo). Densidade confortável. Sem estilo inline
   (a CSP bloqueia) e sem JavaScript. Estados sempre com texto e ícone, nunca só cor. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope.woff2) format("woff2-variations");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--t-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}
h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: var(--lh-tight);
}
h1 {
  font-size: var(--t-2xl);
  font-weight: 750;
}
h2 {
  font-size: var(--t-lg);
  font-weight: 700;
}
h3 {
  font-size: var(--t-md);
  font-weight: 650;
  line-height: 1.35;
}
p {
  max-width: var(--w-measure);
}
a {
  color: var(--c-accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--c-accent-hover);
}
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--s-2);
  top: var(--s-2);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  background: var(--c-surface);
  padding: var(--s-2) var(--s-3);
  z-index: 5;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
}
.muted {
  color: var(--c-text-muted);
}
.small {
  font-size: var(--t-sm);
}

/* ---------- Estrutura ---------- */
.st-wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--s-4);
}
.st-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-5) 0;
}
.st-home {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap);
  color: var(--c-text);
  text-decoration: none;
}
.brand-logo svg {
  height: 26px;
  width: auto;
  display: block;
}
.brand-logo-symbol {
  fill: var(--c-brand);
}
.brand-logo-word {
  fill: var(--c-ink);
}
.st-product {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-brand-ink);
  background: var(--c-brand-soft);
  border-radius: var(--r-pill);
  padding: 2px var(--s-2);
}
.st-langs {
  display: flex;
  gap: var(--s-1);
  list-style: none;
  padding: 0;
}
.st-langs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 var(--s-2);
  border-radius: var(--r-sm);
  color: var(--c-text-muted);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
}
.st-langs a:hover {
  background: var(--c-sunken);
  color: var(--c-text);
}
.st-langs a[aria-current="true"] {
  color: var(--c-brand-ink);
  background: var(--c-brand-soft);
}
main {
  display: grid;
  align-content: start;
  gap: var(--s-8);
  padding-bottom: var(--s-12);
}
.st-section {
  display: grid;
  gap: var(--s-3);
}
.st-section-head a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.st-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* ---------- Faixa de estado geral ---------- */
.st-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-6);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--c-border);
}
.st-hero h1 {
  font-size: var(--t-xl);
}
.st-hero p {
  color: var(--c-text-muted);
}
.st-hero-operational {
  background: var(--c-ok-soft);
}
.st-hero-maintenance {
  background: var(--c-info-soft);
}
.st-hero-degraded,
.st-hero-partial {
  background: var(--c-warn-soft);
}
.st-hero-major {
  background: var(--c-danger-soft);
}
.st-icon {
  width: 40px;
  height: 40px;
  flex: none;
}
.st-icon-sm {
  width: 20px;
  height: 20px;
  flex: none;
}
.st-ico-operational {
  fill: var(--c-ok-ink);
}
.st-ico-maintenance {
  fill: var(--c-info-ink);
}
.st-ico-degraded,
.st-ico-partial {
  fill: var(--c-warn-ink);
}
.st-ico-major {
  fill: var(--c-danger-ink);
}

/* ---------- Serviços ---------- */
.st-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.st-components {
  list-style: none;
  padding: 0;
}
.st-component {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
}
.st-component + .st-component {
  border-top: 1px solid var(--c-border);
}
.st-component-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.st-component-name {
  display: grid;
}
.st-component-about {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
}
.st-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--t-sm);
  font-weight: 650;
  border-radius: var(--r-pill);
  padding: 2px var(--s-3) 2px var(--s-2);
}
.st-pill-operational {
  color: var(--c-ok-ink);
  background: var(--c-ok-soft);
}
.st-pill-maintenance {
  color: var(--c-info-ink);
  background: var(--c-info-soft);
}
.st-pill-degraded,
.st-pill-partial {
  color: var(--c-warn-ink);
  background: var(--c-warn-soft);
}
.st-pill-major {
  color: var(--c-danger-ink);
  background: var(--c-danger-soft);
}
.st-pill-neutral {
  color: var(--c-text-muted);
  background: var(--c-sunken);
}

/* Barra de 90 dias: SVG com rótulo por dia (title), sem estilo inline. */
.st-bar {
  display: block;
  width: 100%;
  height: 32px;
}
.st-bar rect {
  rx: 1.5px;
}
.st-d-ok {
  fill: var(--c-ok-ink);
}
.st-d-warn {
  fill: var(--c-sun-ink);
}
.st-d-bad {
  fill: var(--c-danger);
}
.st-d-none {
  fill: var(--c-sunken);
}
.st-bar-90 {
  display: none;
}
@media (min-width: 640px) {
  .st-bar-90 {
    display: block;
  }
  span.st-bar-90 {
    display: inline;
  }
  .st-bar-30 {
    display: none;
  }
}
.st-bar-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
  font-size: var(--t-xs);
  color: var(--c-text-muted);
}
.st-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  list-style: none;
  padding: 0;
  font-size: var(--t-sm);
  color: var(--c-text-muted);
}
.st-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.st-legend svg {
  width: 10px;
  height: 18px;
}

/* ---------- Incidentes ---------- */
.st-incidents {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}
.st-incident {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
}
.st-incident-plain {
  padding: 0;
}
.st-incident h3 a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--c-text);
  text-decoration: none;
}
.st-incident h3 a:hover {
  text-decoration: underline;
}
.st-incident-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  font-size: var(--t-sm);
  color: var(--c-text-muted);
}
.st-updates {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s-4);
}
.st-update {
  display: grid;
  gap: var(--s-1);
  padding-left: var(--s-4);
  border-left: 3px solid var(--c-border-control);
}
.st-update p {
  white-space: pre-line;
}
.st-day {
  display: grid;
  gap: var(--s-2);
}
.st-day + .st-day {
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border);
}

details summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  cursor: pointer;
}

/* ---------- Formulário ---------- */
.st-subscribe {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
}
.st-form {
  display: grid;
  gap: var(--s-3);
}
@media (min-width: 640px) {
  .st-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-weight: 600;
  font-size: var(--t-sm);
}
.field input,
.field select,
.field textarea {
  min-height: var(--field-h);
  padding: var(--field-py) var(--field-px);
  font: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-control);
  border-radius: var(--r-md);
  width: 100%;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--c-focus);
  box-shadow: var(--focus-ring);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--ctl-h);
  padding: 0 var(--btn-px);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--c-accent);
  color: var(--c-text-on-accent);
}
.btn-primary:hover {
  background: var(--c-accent-hover);
  color: var(--c-text-on-accent);
}
.btn-secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border-control);
}
.btn-danger {
  background: var(--c-danger);
  color: #fff;
}
.notice {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-weight: 600;
}
.notice-ok {
  background: var(--c-ok-soft);
  color: var(--c-ok-ink);
}
.notice-warn {
  background: var(--c-warn-soft);
  color: var(--c-warn-ink);
}
.notice-info {
  background: var(--c-info-soft);
  color: var(--c-info-ink);
}

.st-foot {
  border-top: 1px solid var(--c-border);
  padding: var(--s-6) 0 var(--s-10);
  display: grid;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--c-text-muted);
}
.st-foot a {
  color: var(--c-text-muted);
}

/* ---------- Painel de emergência (/admin) ---------- */
.st-admin {
  display: grid;
  gap: var(--s-6);
}
.st-admin form {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
}
.st-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  border: 0;
  padding: 0;
  margin: 0;
}
.st-checks label {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap);
  font-weight: 500;
}
.st-checks legend {
  font-weight: 600;
  font-size: var(--t-sm);
  margin-bottom: var(--s-1);
}
.st-checks input {
  width: 20px;
  height: 20px;
}

@media (min-width: 1024px) {
  .st-wrap {
    padding: 0 var(--s-6);
  }
  .st-hero {
    padding: var(--s-8);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: background-color var(--d-fast) var(--ease);
  }
}
