/* Fit Together · RESTART FT — design tokens extraídos do GPS (roxo / rosa / ciano) */
:root {
  --bg: #FBF5FD;
  --surface: #FFFFFF;
  --surface-2: #F1DAF7;      /* lavanda do cabeçalho do GPS */
  --ink: #2A1233;
  --ink-2: #6B4A78;          /* 7.3:1 sobre branco */
  --line: #E6CFF0;
  --brand: #8E24AA;          /* botões/links: 7:1 com texto branco */
  --brand-deep: #7B1FA2;
  --brand-soft: #E2A9F0;
  --brand-vivid: #CB6BE6;    /* só decorativo (contraste 3:1) */
  --pink: #FF65C3;           /* só decorativo; texto sobre ele usa --ink */
  --cyan: #5CE1E6;
  --mint: #B5E5D5;
  --m-actions: #9B3FC0;      /* cores de dados: uma por métrica, nunca juntas num gráfico */
  --m-water: #0E8F9C;
  --m-steps: #D6379A;
  --m-score: #7B1FA2;
  --good: #1B7F5C; --warn: #9A6200; --bad: #B3261E;
  --shadow: 0 1px 2px rgba(80,20,100,.08), 0 6px 18px rgba(142,36,170,.08);
  --r: 16px; --r-sm: 10px;
  --font-h: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-b: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1226; --surface: #2A1A34; --surface-2: #3A2347; --ink: #F3E6F8; --ink-2: #B59AC2;
    --line: #4A3358; --brand: #C77DE0; --brand-deep: #D79BEA; --brand-soft: #6B2F82;
    --m-actions: #C77DE0; --m-water: #4FD3DA; --m-steps: #FF7ACB; --m-score: #D79BEA;
    --good: #5FD3A5; --warn: #F0B454; --bad: #FF8A80;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #1E1226; --surface: #2A1A34; --surface-2: #3A2347; --ink: #F3E6F8; --ink-2: #B59AC2;
  --line: #4A3358; --brand: #C77DE0; --brand-deep: #D79BEA; --brand-soft: #6B2F82;
  --m-actions: #C77DE0; --m-water: #4FD3DA; --m-steps: #FF7ACB; --m-score: #D79BEA;
  --good: #5FD3A5; --warn: #F0B454; --bad: #FF8A80;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font-b); min-height: 100dvh; }
h1, h2, h3 { font-family: var(--font-h); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 700; } h2 { font-size: 1.25rem; font-weight: 600; } h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .75em; } a { color: var(--brand); }
.cap::first-letter { text-transform: uppercase; }
.muted { color: var(--ink-2); } .small { font-size: .875rem; } .center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 1000; }
.skip:focus { top: 8px; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }

/* ---------- layout ---------- */
.shell { display: block; min-height: 100dvh; }
.side { display: none; }
.main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.main.wide { max-width: 1080px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--font-h); color: var(--ink); text-decoration: none; }
.brand .logo { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.brand small { display: block; font: 500 .7rem var(--font-b); color: var(--ink-2); letter-spacing: .04em; text-transform: uppercase; }
.bottom { position: fixed; inset: auto 0 0 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: flex; z-index: 50; }
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; font-weight: 600;
  color: var(--ink-2); text-decoration: none; min-height: 48px; position: relative; }
.bottom a[aria-current="page"] { color: var(--brand); }
.bottom a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand-vivid); }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
  .side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; min-height: 44px; }
  .side a:hover { background: var(--surface-2); }
  .side a[aria-current="page"] { background: var(--surface-2); color: var(--brand-deep); }
  .side .sep { margin: 12px 8px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
  .bottom { display: none; }
  .main { padding: 28px 32px 48px; max-width: 860px; margin: 0; }
  .main.wide { max-width: 1120px; }
}

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.hero { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: 16px; } .grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } .grid.kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stack > * + * { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--brand);
  background: var(--brand); color: #fff; font: 700 .95rem var(--font-b); cursor: pointer; text-decoration: none; transition: transform .15s ease-out, background .15s, opacity .15s; touch-action: manipulation; }
:root[data-theme="dark"] .btn { color: #1E1226; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #1E1226; } }
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); } .btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--brand); } :root[data-theme="dark"] .btn.ghost { color: var(--brand); }
.btn.ghost:hover { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.ghost { color: var(--brand); } }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--surface-2); border-color: var(--bad); }
:root[data-theme="dark"] .btn.danger { color: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: var(--bad); } }
/* botão de tema no topo: só no computador (no celular fica em Mais) */
.deskbar { display: none; }
@media (min-width: 900px) {
  .deskbar { display: flex; justify-content: flex-end; padding: 16px 32px 0; }
  .deskbar + .main { padding-top: 4px; }
}
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: .85rem; }
.btn.icon { padding: 0; width: 44px; } .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
.hint { font-size: .85rem; color: var(--ink-2); margin: 2px 0 6px; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
textarea { min-height: 92px; resize: vertical; } input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); flex: none; }
.field { margin-bottom: 14px; } .err { color: var(--bad); font-size: .88rem; margin-top: 4px; font-weight: 600; }
.alert { padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid; font-size: .92rem; margin-bottom: 12px; display: flex; gap: 10px; align-items: flex-start; }
.alert.info { background: color-mix(in srgb, var(--cyan) 22%, var(--surface)); border-color: var(--m-water); }
.alert.warn { background: color-mix(in srgb, #FFD27A 28%, var(--surface)); border-color: var(--warn); }
.alert.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .9rem var(--font-b); cursor: pointer; transition: background .15s, border-color .15s; touch-action: manipulation; }
.chip:hover { border-color: var(--brand); } .chip[aria-pressed="true"], .chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.chip .fr { color: var(--ink-2); font-weight: 400; font-size: .78rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--brand-deep); }
.tag.good { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--good); } .tag.warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }
.tag.bad { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 12px; }
.tabs button { min-height: 40px; padding: 6px 18px; border: 0; background: transparent; color: var(--ink); font: 700 .9rem var(--font-b); border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--brand-deep); box-shadow: var(--shadow); }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-vivid), var(--pink)); border-radius: 99px; transition: width .3s ease-out; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; min-height: 48px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; } .check.done .t { text-decoration: line-through; color: var(--ink-2); }
.check .t { font-weight: 700; } .check .d { font-size: .85rem; color: var(--ink-2); }
.kpi-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.kpi-box .v { font: 700 1.9rem/1.1 var(--font-h); font-variant-numeric: tabular-nums; } .kpi-box .l { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; } th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.tbl-wrap { overflow-x: auto; } tr.click { cursor: pointer; } tr.click:hover { background: var(--surface-2); }
details { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; margin-top: 8px; } summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.step-grid { display: grid; gap: 8px; }
.stepper { display: flex; gap: 6px; margin-bottom: 14px; } .stepper i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); } .stepper i.on { background: var(--brand-vivid); }
.smart { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); } .smart:last-child { border: 0; }
.smart .k { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 700 1.2rem var(--font-h); color: var(--ink); }
.k.s { background: #B5E5D5; } .k.m { background: #4DF0B8; } .k.a { background: #5BB5C0; } .k.r { background: #E2A9F0; } .k.t { background: #4DF0C0; }
.phase { border-left: 6px solid var(--brand-vivid); } .phase.menstrual { border-color: #CB6BE6; } .phase.follicular { border-color: #5CE1E6; } .phase.ovulation { border-color: #FF65C3; } .phase.luteal { border-color: #E2A9F0; }
.ring { position: relative; width: 96px; height: 96px; flex: none; } .ring svg { transform: rotate(-90deg); } .ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.3rem var(--font-h); }
.chart { width: 100%; max-width: 720px; height: auto; display: block; overflow: visible; } .chart text { font: 600 12px var(--font-b); fill: var(--ink-2); } .chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { transition: opacity .15s; } .chart .bar:hover, .chart .bar:focus { opacity: .8; outline: none; stroke: var(--ink); stroke-width: 2; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin: 6px 0 0; } .legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
#tip { position: fixed; z-index: 200; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: .8rem; font-weight: 700; opacity: 0; transition: opacity .1s; max-width: 220px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 300; max-width: 90vw; box-shadow: var(--shadow); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.modal-bg { position: fixed; inset: 0; background: rgba(30,18,38,.55); display: grid; place-items: center; z-index: 150; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--r); padding: 22px; max-width: 460px; width: 100%; max-height: 90dvh; overflow: auto; box-shadow: var(--shadow); }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--surface-2), transparent 55%), radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--cyan) 30%, transparent), transparent 50%), var(--bg); }
.auth .card { max-width: 420px; width: 100%; } .skeleton { height: 90px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sh 1.4s infinite; margin-bottom: 16px; }
@keyframes sh { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-2); }
.energy button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 1rem var(--font-h); cursor: pointer; } .energy button[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* ---------- v0.3: boas-vindas, chat, materiais, blocos, impressão ---------- */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font: 700 .72rem var(--font-b); margin-left: auto; }
.bottom a .badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
.topbar a .badge { position: absolute; transform: translate(10px, -10px); }
.topbar a[data-nav] { position: relative; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; margin: 12px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.phases { padding-left: 1.2em; margin: 0; } .phases li { margin-bottom: 10px; }
.chat { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.chat-card .chat { max-height: min(60vh, 520px); overflow-y: auto; padding-right: 4px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; white-space: pre-line; word-wrap: break-word; line-height: 1.45; }
.bubble.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
:root[data-theme="dark"] .bubble.me { color: #1E1226; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bubble.me { color: #1E1226; } }
.bubble .who { display: block; font-size: .75rem; font-weight: 700; opacity: .8; margin-bottom: 2px; }
.bubble .when { display: block; font-size: .7rem; opacity: .7; margin-top: 4px; text-align: right; }
.chat-input { display: grid; gap: 8px; }
.steps { list-style: none; padding: 0; margin: 12px 0 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.steps .dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; }
.steps li.done .dot { background: var(--good); border-color: var(--good); }
.block .num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-deep); font: 700 1rem var(--font-h); }
.block.ok .num { background: var(--good); color: #fff; }
.block-body { margin-top: 12px; } .block .cat + .cat { margin-top: 16px; }
.plate-meal { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
table.mini { border-collapse: collapse; } table.mini th, table.mini td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: .92rem; } table.mini th { font-weight: 600; }
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.comment { padding: 6px 0; font-size: .92rem; }
a.alert { display: flex; }
@media print {
  .side, .bottom, .deskbar, .no-print, .skip, .toast, button, [data-print] { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .video { display: none; }
  a { color: #000; text-decoration: none; }
}

/* ---------- Raio X: tela só de conversa ---------- */
.chat-screen { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-head .logo { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.chat-body .chat { margin: 0; }
.chat-body .bubble { animation: pop .18s ease-out; }
.chat-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.chat-foot:empty { display: none; }
.chat-foot input { font-size: 16px; } /* evita o zoom automático do iPhone */
.bubble .summary { margin-top: 10px; display: grid; gap: 6px; min-width: 220px; }
.bubble .summary .row { border-bottom: 1px solid var(--line); padding-bottom: 4px; gap: 16px; }
.bubble .video { width: min(320px, 70vw); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); opacity: .5; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: .9; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chat-body .bubble, .typing i { animation: none; } }

/* ---------- GPS: uma pergunta por tela ---------- */
.q-field { border: 0; padding: 0; margin: 0; }
.q-legend { display: block; font: 600 1.15rem/1.35 var(--font-h); margin: 0 0 12px; color: var(--ink); }
.q-page .chips .chip { min-height: 44px; }

/* ---------- Logo: versão clara/escura conforme o tema ---------- */
.logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 12px; }
.auth-brand .logo { width: 96px; height: 96px; }
