:root {
  --bg: #f8f4f0;
  --card: #ffffff;
  --text: #2a1d16;
  --muted: #7a675b;
  --line: #ecdfd5;
  --accent: #b5531f;
  --accent-soft: #f7e6da;
  --carbs: #c9962a;
  --protein: #7a4a33;
  --fat: #e0875a;
  --fiber: #6f8f3a;
  --danger: #b3261e;
  --warn: #8a5a00;
  --bronze: linear-gradient(135deg, #f3b07a, #c8692f 45%, #8a3f1a);
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150f0c;
    --card: #1f1612;
    --text: #f1e7df;
    --muted: #a8968a;
    --line: #3a2a22;
    --accent: #e8834a;
    --accent-soft: #3a2216;
    --carbs: #e6b85c;
    --protein: #d9b8a0;
    --fat: #f0a27a;
    --fiber: #a9c77a;
    --danger: #ff8a80;
    --warn: #e0b45c;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }

main { max-width: 640px; margin: 0 auto; padding: 0 16px 24px; outline: none; }

h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: .95rem; margin: 0; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: var(--warn); }

/* ---------- topo ---------- */

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  max-width: 640px; margin: 0 auto;
}
.topbar h1 { font-size: 1.15rem; margin: 0; flex: 1; text-align: center; }
.topbar h1 small { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- menu lateral ---------- */

.topbar-main { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar-spacer { width: 40px; flex: none; }
.menu-btn { border: 0; background: none; }
.menu-btn svg { width: 24px; height: 24px; }

.drawer {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(82vw, 320px);
  background: var(--card); border-right: 1px solid var(--line);
  padding: calc(20px + env(safe-area-inset-top)) 0 calc(16px + env(safe-area-inset-bottom));
  transform: translateX(calc(-100% - 32px)); transition: transform .25s ease; overflow-y: auto;
  box-shadow: 4px 0 24px rgb(0 0 0 / .18);
}
body.drawer-open .drawer { transform: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / .4); opacity: 0; transition: opacity .25s ease; }
body.drawer-open .drawer-backdrop { opacity: 1; }
.drawer-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%;
  padding: 0 20px 18px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
.drawer-head .avatar { cursor: pointer; }
.drawer-name { font-weight: 700; font-size: 1.05rem; }
.drawer-list { list-style: none; margin: 8px 0 0; padding: 0; }
.drawer-list button {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 14px 20px; font-size: 1rem; color: var(--text);
}
.drawer-list button[aria-current="page"] { color: var(--accent); font-weight: 700; background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { transition: none; } }

/* dúvidas frequentes */
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.goals-manual summary { cursor: pointer; }

/* ---------- cartões e listas ---------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 12px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 0; background: none; border: 0; text-align: left; cursor: pointer;
}
.row .grow { flex: 1; min-width: 0; }
.row .name { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--muted); font-size: .9rem; padding: 6px 0 2px; }

/* ---------- resumo do dia ---------- */

.summary { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--line); }
.ring .value { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .3s; }
.ring.over .value { stroke: var(--danger); }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .label b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.ring .label span { font-size: .72rem; color: var(--muted); }

.macro { margin-bottom: 8px; }
.macro:last-child { margin-bottom: 0; }
.macro-top { display: flex; justify-content: space-between; font-size: .85rem; }
.macro-top .num { font-variant-numeric: tabular-nums; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.bar.carbs i { background: var(--carbs); }
.bar.protein i { background: var(--protein); }
.bar.fat i { background: var(--fat); }
.bar.fiber i { background: var(--fiber); }
.bar.kcal i { background: var(--accent); }

/* ---------- botões e formulários ---------- */

.btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; font-weight: 500;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #1f1009; } }
.btn.danger { color: var(--danger); }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1; }

.add-btn {
  border: 0; background: var(--accent-soft); color: var(--accent);
  border-radius: 8px; padding: 4px 10px; font-weight: 600; cursor: pointer;
}

label.field { display: block; margin-top: 10px; font-size: .85rem; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea {
  display: block; width: 100%; margin-top: 4px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  font-size: 1rem; color: var(--text);
}
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; align-items: end; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; align-items: end; }
/* Campos alinhados pela caixa, mesmo quando um rótulo quebra em duas linhas. */
.grid2 > label.field, .grid3 > label.field { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- folha (dialog) ---------- */

.sheet {
  width: 100%; max-width: 640px; max-height: 92vh;
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: 18px 18px 0 0;
  background: var(--card); color: var(--text);
  overflow: hidden;
}
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 18px; } }
.sheet::backdrop { background: rgb(0 0 0 / .4); }
.sheet-inner { display: flex; flex-direction: column; max-height: 92vh; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; }
.sheet-body { padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; }

.search {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); font-size: 1rem; margin-top: 12px;
}
.chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 5px 12px; font-size: .85rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.badge { font-size: .7rem; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-left: 4px; vertical-align: 1px; }

.nutri-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.nutri-table td { padding: 6px 0; border-top: 1px solid var(--line); }
.nutri-table td:last-child { text-align: right; }
.nutri-table tr:first-child td { border-top: 0; }

.star { font-size: 1.3rem; line-height: 1; }
.star[aria-pressed="true"] { color: #e09a3c; }

/* ---------- gráfico de peso ---------- */

.chart svg { width: 100%; height: 180px; display: block; }
.chart .axis { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 10px; }
.chart .raw { fill: var(--muted); opacity: .6; }
.chart .trend { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem;
  transition: .2s; z-index: 20; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- abertura ---------- */

.splash {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  background: #1d110b; color: #f6e6d8; cursor: pointer;
  transition: opacity .35s ease, visibility .35s;
}
.splash.hide { opacity: 0; visibility: hidden; }

/* A arte ocupa a tela inteira como "cover", mantendo a proporção da imagem,
   para o brilho poder ser posicionado em cima da logo em % da imagem. */
.splash-art {
  position: absolute; left: 50%; top: 50%;
  width: max(100vw, 100vh * 810 / 1440); aspect-ratio: 810 / 1440;
  transform: translate(-50%, -50%);
  animation: splash-art .6s cubic-bezier(.2, .7, .2, 1) both;
}
.splash-art img { width: 100%; height: 100%; display: block; }
/* brilho que passa uma vez pela logo */
.splash-shine {
  position: absolute; left: 13%; top: 28%; width: 74%; height: 37%;
  background: linear-gradient(110deg, transparent 38%, rgb(255 226 196 / .8) 50%, transparent 62%);
  background-size: 260% 100%; background-position: 130% 0;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent);
          mask-image: radial-gradient(closest-side, #000 70%, transparent);
  animation: splash-shine 1s .45s ease-in-out both;
}

.splash-text {
  position: absolute; left: 0; right: 0; bottom: calc(9vh + env(safe-area-inset-bottom));
  text-align: center; animation: splash-text .5s .55s ease-out both;
  text-shadow: 0 2px 12px rgb(0 0 0 / .5);
}
.splash-text h1 {
  margin: 0; font-size: 2.6rem; letter-spacing: .04em; font-weight: 800;
  background: var(--bronze); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.splash-text p { margin: 6px 0 0; font-size: .8rem; letter-spacing: .32em; text-transform: uppercase; color: #e2c0a4; }
.splash-text b { color: #f0b98c; font-weight: 700; }

@keyframes splash-art { from { opacity: 0; transform: translate(-50%, -50%) scale(1.06); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes splash-shine { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@keyframes splash-text { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .splash-art, .splash-text { animation: none; }
  .splash-shine { display: none; }
}

/* ---------- sobre ---------- */

.about-hero {
  display: flex; align-items: center; gap: 14px;
  margin: 12px 0 0; padding: 16px; border-radius: var(--radius);
  background: radial-gradient(120% 140% at 0% 0%, #3a1f12, #1a0f0a); color: #f6e6d8;
}
.about-hero img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }
.about-hero h2 { font-size: 1.3rem; background: var(--bronze); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about-hero p { margin: 2px 0 0; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: #c9a58a; }
.about h3 { margin-top: 14px; color: var(--accent); }
.about h3:first-child { margin-top: 0; }
.about p { margin: 4px 0 0; }
.about ul { margin: 6px 0 0; padding-left: 18px; }
.about li { margin-top: 4px; }

/* ---------- macros por alimento e refeição ---------- */

.macros { color: var(--muted); font-variant-numeric: tabular-nums; }
.macros b { font-weight: 700; }
.macros .p { color: var(--protein); }
.macros .c { color: var(--carbs); }
.macros .g { color: var(--fat); }
.meal-total { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); }
.meal-total .macros { color: var(--text); }

.section-title { margin: 16px 0 4px; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.recipe { margin: 6px 0 0; }

/* ---------- dieta ---------- */

.targets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.targets div { background: var(--accent-soft); border-radius: 10px; padding: 8px 4px; text-align: center; }
.targets b { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.targets span { font-size: .7rem; color: var(--muted); }
@media (max-width: 380px) { .targets { grid-template-columns: repeat(3, 1fr); } }

/* ---------- código de barras ---------- */

.scanner { margin-top: 12px; }
.scanner video { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; background: #000; display: block; }
.scanner p { margin: 6px 0 0; }
.row .macros { display: block; }

/* área do aluno */
label.field > textarea { resize: vertical; min-height: 70px; }
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-head h2 { margin: 0; }
.profile-head p { margin: 2px 0 8px; }
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; padding: 0;
  border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; cursor: pointer;
}
.avatar.lg { width: 84px; height: 84px; font-size: 2rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.time {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle;
}

/* impressão / PDF do cardápio */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; color: #000; background: #fff; font-size: 11pt; }
  body { background: #fff !important; }
  .print-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid #b5531f; padding-bottom: 8px; }
  .print-head img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
  .print-head h1 { margin: 0; font-size: 18pt; }
  .print-head p { margin: 2px 0 0; color: #555; }
  #print-area h2 { font-size: 12pt; margin: 14px 0 4px; break-after: avoid; }
  #print-area h2 small { font-weight: 400; color: #555; }
  #print-area table { width: 100%; border-collapse: collapse; break-inside: avoid; }
  #print-area td { border-bottom: 1px solid #ddd; padding: 4px 6px; }
  #print-area td:first-child { width: 55%; }
  #print-area td:nth-child(2), #print-area td:nth-child(3) { text-align: right; white-space: nowrap; }
  .print-goals { margin: 10px 0; }
  .print-note { color: #666; font-size: 9pt; margin-top: 14px; }
}
[hidden] { display: none !important; }

/* ---------- biblioteca de produtos ---------- */
.status { display: inline-block; font-size: .7rem; padding: 1px 6px; border-radius: 6px; border: 1px solid currentColor; white-space: nowrap; }
.status-ok { color: var(--fiber); }
.status-part { color: var(--warn); }
.status-pend { color: var(--muted); }
.prod-table th { font-size: .75rem; font-weight: 600; text-align: right; padding: 4px 0 6px 8px; vertical-align: bottom; }
.prod-table th:first-child { text-align: left; }
.prod-table td { padding-left: 8px; }
.prod-table td:first-child { padding-left: 0; }
.prod-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.prov { margin: 0; padding-left: 18px; }
.prov li { margin: 2px 0; }

/* perguntas da dieta */
.field-set { border: 0; padding: 0; margin: 12px 0 0; }
.field-set legend { font-size: .85rem; color: var(--muted); padding: 0; }
.chip.check { display: inline-flex; align-items: center; gap: 6px; }
.chip.check input { accent-color: var(--accent); margin: 0; }
.chip.check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* iPhone: data, hora e número sem o visual nativo, com a mesma altura e largura dos outros campos. */
label.field > input, label.field > select {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%;
  height: 46px; line-height: 24px; box-sizing: border-box; text-align: left;
}
label.field > select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a8968a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; text-overflow: ellipsis; white-space: nowrap;
}
input[type="date"], input[type="time"] { display: block; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input::-webkit-datetime-edit { padding: 0; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* blocos do formulário da dieta */
.form-block { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.form-block:first-of-type { border-top: 0; padding-top: 0; }
.form-block h3 { margin: 0; font-size: .95rem; }
.faq h2 { margin-bottom: 4px; }
.faq-note p { margin: 8px 0 0; color: var(--muted); }

/* ---------- botão de texto ---------- */

.link { background: none; border: 0; padding: 6px 0; color: var(--accent); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.link:disabled { opacity: .4; cursor: default; }

/* ---------- boas-vindas ---------- */

.welcome {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto;
  display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 0%, #3a2216, #1d110b 70%); color: #f6e6d8;
  transition: opacity .3s ease;
}
.welcome.hide { opacity: 0; }
body.welcome-on { overflow: hidden; }
.welcome-box { width: min(100%, 360px); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.welcome h1 { margin: 8px 0 0; font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
.welcome h1 b { display: block; font-size: 2rem; font-weight: 800; color: #fff; }
.welcome .muted { color: #c9b3a3; margin: 0; }
.avatar.xl { width: 128px; height: 128px; font-size: 3rem; border-width: 3px; }
.welcome-photo { display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; color: #f3b07a; cursor: pointer; font: inherit; }
.welcome-name {
  width: 100%; font: inherit; font-size: 1.1rem; text-align: center; padding: 14px 16px; border-radius: 14px;
  border: 1px solid #5a3a28; background: #2a1a12; color: #fff;
}
.welcome-name::placeholder { color: #8f7464; }
.welcome-enter { width: 100%; padding: 15px; font-size: 1.1rem; margin-top: 6px; }
.welcome-enter:disabled { opacity: .45; }
.welcome .link { color: #f3b07a; }

/* ---------- hidratação ---------- */

.water {
  position: relative; overflow: hidden; color: #f6e6d8;
  background: linear-gradient(160deg, #4a2a1a, #2a1810 70%); border-color: #5a3422; padding: 22px 20px 14px;
}
.water > *:not(.water-art) { position: relative; }
.water-art { position: absolute; right: -14px; bottom: -14px; width: 190px; height: 190px; fill: none; stroke: rgb(243 176 122 / .14); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.water-kicker { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #f3b07a; }
.water-total { margin: 6px 0 12px; font-size: 1.1rem; font-weight: 700; color: #fff; }
.water-total b { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.water-total span { font-weight: 400; color: rgb(246 230 216 / .7); font-size: 1.4rem; }
.water-bar { height: 12px; border-radius: 99px; background: rgb(0 0 0 / .3); overflow: hidden; }
.water-bar i { display: block; height: 100%; border-radius: inherit; background: var(--bronze); transition: width .35s ease; }
.water-left { margin: 10px 0 14px; font-size: .95rem; color: rgb(246 230 216 / .85); }
.water-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.water-btns button {
  border: 1px solid rgb(243 176 122 / .25); border-radius: 14px; padding: 14px 4px; background: #1d110b; color: #f3b07a;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.water-btns button:active { transform: scale(.97); }
.water-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.water .link { color: #f6e6d8; }

/* ---------- equivalências ---------- */

.eq-how p { margin: 6px 0 0; }
.eq-example { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 12px; text-align: center; }
.eq-example span:not(.eq-eq) { background: var(--accent-soft); border-radius: 12px; padding: 10px 6px; }
.eq-example small { display: block; color: var(--muted); font-size: .75rem; }
.eq-eq { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.eq-jump { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; }
.eq-jump a { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: .85rem; color: var(--text); text-decoration: none; }
.eq-anchor { scroll-margin-top: 80px; }
.eq-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.eq-portion { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.eq-list { list-style: none; margin: 8px 0 0; padding: 0; }
.eq-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.eq-list .name { display: block; font-weight: 600; }
.eq-w { flex: none; width: 58px; font-weight: 800; color: var(--accent); }
.eq-kcal { flex: none; text-align: right; font-weight: 700; }
.eq-kcal small { font-weight: 400; color: var(--muted); }
.eq-note { margin: 6px 0 0; }
.eq-text p, .eq-tip p { margin: 6px 0 0; }
.eq-warn { border-color: var(--accent); }
.eq-warn h2 { color: var(--accent); }
.eq-foot { margin: 12px 4px 0; }

/* ---------- lista de compras ---------- */

.shop-list { list-style: none; margin: 6px 0 0; padding: 0; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.shop-item input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex: none; }
.shop-item.done .grow, .shop-item.done .num { text-decoration: line-through; color: var(--muted); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.shop-item .grow { flex: 1; min-width: 0; }
.shop-item .num { flex: none; font-weight: 600; }

/* ---------- foto: recorte ---------- */

.avatar { position: relative; }
.avatar img { position: absolute; inset: 0; }
.cropper {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow-y: auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  background: #140c08; color: #f6e6d8;
}
.cropper-inner { width: min(100%, 340px); text-align: center; }
.cropper h2 { margin: 0; }
.cropper p { margin: 6px 0 16px; color: #c9b3a3; }
.crop-frame {
  position: relative; width: min(78vw, 280px); aspect-ratio: 1; margin: 0 auto; overflow: hidden;
  border-radius: 50%; outline: 3px solid #e8834a; outline-offset: 2px; background: #000;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-zoom { width: 100%; margin: 20px 0 6px; accent-color: #e8834a; }
.cropper .btn-row { justify-content: center; }
.cropper .btn:not(.primary) { background: transparent; color: #f6e6d8; border-color: #5a3a28; }
.water-rule { font-size: .85rem; color: rgb(246 230 216 / .7); align-self: center; }

/* ---------- marca d'água (símbolo JP) ---------- */

body::after {
  content: ""; position: fixed; left: 50%; top: 52%; z-index: 4; pointer-events: none;
  width: min(78vw, 440px); aspect-ratio: 660 / 540; transform: translate(-50%, -50%);
  background: url("../assets/marca.svg") center / contain no-repeat;
  opacity: .035;
}
@media (prefers-color-scheme: dark) { body::after { opacity: .05; } }
@media print { body::after { display: none; } }

/* ---------- assistente ---------- */

.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; line-height: 1.45; white-space: normal; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg b { display: block; margin-bottom: 4px; }
.msg small { display: block; margin-top: 8px; color: var(--muted); font-size: .75rem; }
.chat-sugg { margin: 14px 0 0; }
.chat-form { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; margin-top: 14px; padding: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 4px 18px rgb(0 0 0 / .08); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; border: 0; background: transparent; color: var(--text); padding: 8px 6px; outline: none; }
.msg .refs { margin-top: 6px; font-size: .75rem; color: var(--muted); }
.msg .refs summary { cursor: pointer; }
.msg .refs ul { margin: 4px 0 0; padding-left: 16px; }
.msg-sep { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.msg-team { margin: 10px 0 0; }
.msg-intro { margin: 0 0 6px; }
.msg-opts { margin-top: 8px; }
.msg-rel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-rel span { flex-basis: 100%; font-size: .75rem; color: var(--muted); }
.msg-rel .chip { font-size: .8rem; text-align: left; }
.msg-who { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--accent); margin-bottom: 4px; }
