/* App Wegovy: lilás e rosa suave, letra Nunito */
:root {
  --fundo: #FCF9FD;
  --tinta: #1F1B2D;
  --suave: #5A5470;
  --lilas: #5B3E8C;
  --lilas-esc: #432C69;
  --lilas-claro: #ECE3F7;
  --lilas-med: #7A5FA8;
  --lilas-txt: #E9DDF7;
  --rosa: #F28DB2;
  --rosa-claro: #FCE7F0;
  --rosa-txt: #9C2F5E;
  --sint: #E0558C;
  --coco: #9A7B5F;
  --borda: #ECE4F2;
  --linha: #F2ECF6;
  --campo: #D8CDE2;
  --cinza-seg: #F3ECF8;
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--tinta);
  font: 16px/1.45 'Nunito', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1 { margin: 2px 0 0; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; font-weight: 800; }
p { margin: 0; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--lilas); }

.ecra {
  max-width: 520px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 18px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.ecra.com-nav { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
.ecra.centro { min-height: 80vh; justify-content: center; align-items: center; text-align: center; }
.suave { color: var(--suave); font-size: 14px; }
.rot { font-size: 13px; font-weight: 700; color: var(--suave); }
.tit { font-size: 15px; font-weight: 700; }
.nota { font-size: 13px; color: var(--suave); }
.linha { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topo.linha { align-items: flex-end; }
.dir { text-align: right; }
.demo { margin: 0; padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px; background: var(--rosa-claro); color: var(--rosa-txt); font-size: 13px; font-weight: 700; text-align: center; }

.cartao { background: #fff; border: 1px solid var(--borda); border-radius: 20px; padding: 14px 16px; display: block; color: inherit; text-decoration: none; }
.cartao > h2 { margin-bottom: 8px; }
.cartao.linha { display: flex; }
.cartao.mini { padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.num { font-size: 26px; line-height: 1.1; font-weight: 800; }
.medio { font-size: 19px; line-height: 1.2; font-weight: 800; }
.grande { font-size: 48px; line-height: 1; font-weight: 800; }
.grande small { font-size: 20px; }
.grelha2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grelha3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grelha3 .medio { font-size: 18px; white-space: nowrap; }

.destaque { background: var(--lilas); color: #fff; border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.destaque .rot { color: var(--lilas-txt); }
.destaque > p:last-child { color: var(--lilas-txt); font-size: 14px; }
.barra { height: 12px; background: var(--lilas-med); border-radius: 999px; overflow: hidden; }
.barra span { display: block; height: 100%; background: var(--rosa); border-radius: 999px; }
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tres b { font-size: 17px; white-space: nowrap; }
.tres .meio { text-align: center; }
.frase { background: var(--rosa-claro); border-radius: 20px; padding: 16px 18px; }
.frase .rot { color: var(--rosa-txt); margin-bottom: 4px; }
.frase p:last-child { font-size: 18px; line-height: 1.35; font-weight: 700; }
.pilula { display: inline-flex; align-items: center; gap: 6px; background: var(--rosa-claro); color: var(--rosa-txt); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.pilula svg { width: 16px; height: 16px; stroke-width: 2.2; }
.tag { font-size: 14px; font-weight: 800; color: var(--lilas); white-space: nowrap; }

.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 18px;
  border: 0; border-radius: 16px; background: var(--lilas); color: #fff; font: inherit; font-size: 17px; font-weight: 800;
  text-decoration: none; cursor: pointer;
}
.btn:active { background: var(--lilas-esc); }
.btn.sec { background: #fff; color: var(--lilas); border: 2px solid var(--lilas); }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--rosa); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--lilas); font: inherit; font-weight: 700; min-height: 44px; cursor: pointer; text-decoration: underline; }
.linha-btn { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.icone { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--tinta); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Sim / Não e escolhas segmentadas */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; background: var(--cinza-seg); border-radius: 14px; padding: 4px; }
.seg button, .seg label span { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--suave); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--lilas); color: #fff; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { background: #fff; color: var(--lilas); }
.seg input:focus-visible + span { outline: 3px solid var(--rosa); }
.seg.pequeno { width: 128px; flex-shrink: 0; }

/* Formulários */
.form { display: flex; flex-direction: column; gap: 12px; }
.campos { display: flex; flex-direction: column; }
.campo { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; border: 0; border-bottom: 1px solid var(--linha); margin: 0; padding: 0; }
.campo:last-child { border-bottom: 0; }
fieldset.campo legend { float: left; font-weight: 700; padding: 0; }
fieldset.campo .seg { width: 190px; margin-left: auto; }
.campo label, .item label { font-weight: 700; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--tinta); background: #fff;
  border: 1px solid var(--campo); border-radius: 12px; height: 44px; padding: 0 12px;
}
input[type="date"], select { min-width: 150px; }
.campo > input:not([type="date"]) { width: 170px; }
textarea { width: 100%; height: auto; padding: 10px 12px; resize: vertical; }
.uni { display: inline-flex; align-items: center; gap: 6px; }
.uni input { width: 88px; text-align: center; font-weight: 800; }
.uni span { width: 30px; font-size: 14px; font-weight: 700; color: var(--suave); }
.largo { width: 190px; }
.opcao { display: flex; gap: 12px; align-items: center; min-height: 56px; border-top: 1px solid var(--linha); cursor: pointer; }
.opcao:first-of-type { border-top: 0; }
.opcao input { width: 22px; height: 22px; accent-color: var(--lilas); flex-shrink: 0; }
.opcao small { display: block; color: var(--suave); font-size: 13px; font-weight: 600; }
.msg { color: var(--rosa-txt); font-weight: 700; font-size: 14px; }

/* Login */
.login { min-height: 85vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.login .logo svg { width: 64px; height: 64px; stroke: none; }
.login .form { gap: 8px; }
.login .form input { width: 100%; margin-bottom: 6px; }
.login .btn { margin-top: 6px; }

/* Lista de linhas (diário, perfil) */
.lista { padding-top: 4px; padding-bottom: 4px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--linha); }
.item:last-child { border-bottom: 0; }
.item.col { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 13px; border-radius: 999px; border: 2px solid var(--campo); background: #fff; color: var(--tinta); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--sint); border-color: var(--sint); color: #fff; }

/* Calendário */
.mes { display: flex; align-items: center; gap: 2px; }
.mes b { min-width: 124px; text-align: center; }
.cal { padding: 10px 8px 10px; }
.sem, .dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sem { text-align: center; font-size: 13px; font-weight: 700; color: var(--suave); padding-bottom: 2px; }
.dias { row-gap: 2px; justify-items: center; }
.dia {
  width: 44px; height: 44px; border-radius: 999px; border: 2px solid transparent; background: #fff; color: var(--tinta);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.dia > span:first-child { line-height: 1; }
.dia.hoje { font-weight: 800; color: var(--lilas); }
.dia.inj { border-color: var(--rosa); }
.dia.sel { background: var(--lilas-claro); border-color: var(--lilas); font-weight: 800; }
.dia.futuro { color: #736C85; }
.pontos { display: flex; gap: 2px; height: 6px; }
.pontos i, .legenda i { width: 6px; height: 6px; border-radius: 999px; display: block; }
.p-treino { background: var(--lilas); }
.p-sint { background: var(--sint); }
.p-coco { background: var(--coco); }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 6px 0; font-size: 13px; color: var(--suave); }
.legenda span { display: flex; align-items: center; gap: 5px; }
.legenda i { width: 8px; height: 8px; }
.legenda i.anel { width: 12px; height: 12px; border: 2px solid var(--rosa); }
.sub { font-size: 17px; margin-top: 2px; }

/* Gráfico */
.fig { position: relative; height: 190px; margin-top: 6px; }
.fig svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.fig .eixo { stroke: #E2D8EA; stroke-width: 1; }
.fig .grade { stroke: var(--linha); stroke-width: 1; }
.fig .obj { stroke: var(--rosa); stroke-width: 1.5; stroke-dasharray: 4 4; }
.fig .area { fill: #ECE3F7; }
.fig .linha-g { fill: none; stroke: var(--lilas); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.fig .ponto { fill: var(--rosa); stroke: #fff; stroke-width: 2; }
.fig .t { font-size: 13px; fill: var(--suave); font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.fig .t.forte { fill: var(--tinta); font-weight: 800; font-size: 14px; }

/* Tabela de medidas */
.tabela { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 4px; }
.tabela th { font-size: 13px; color: var(--suave); font-weight: 700; text-align: right; padding: 4px 0; }
.tabela th:first-child, .tabela td:first-child { text-align: left; }
.tabela td { text-align: right; padding: 8px 0; border-top: 1px solid var(--linha); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela td.dif { font-weight: 800; color: var(--lilas); }
details { margin-top: 10px; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details.nova[open] summary { margin-bottom: 8px; }
.hist { list-style: none; margin: 4px 0 0; padding: 0; }
.hist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--linha); font-size: 14px; padding: 4px 0; }

/* Navegação inferior */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff; border-top: 1px solid var(--borda);
  padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--suave); text-decoration: none; font-size: 13px; font-weight: 700; }
.nav a.ativo { color: var(--lilas); font-weight: 800; }
.nav a.ativo svg { stroke-width: 2.3; }

.aviso {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); z-index: 10;
  background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 700;
  max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(31, 27, 45, 0.2);
}

@media (max-width: 370px) {
  .grande { font-size: 40px; }
  .dia { width: 40px; height: 40px; }
  .campo > input:not([type="date"]), .largo { width: 140px; }
}
@media (prefers-reduced-motion: no-preference) {
  .barra span { transition: width 0.6s ease; }
}
