:root {
  --bg: #f3faf9;
  --card: #ffffff;
  --ink: #12312e;
  --muted: #5b7470;
  --line: #d9ebe8;        /* divisórias decorativas */
  --field: #6f8f8a;       /* borda de campos e botões: contraste ≥ 3:1 */
  --ring: #0d9488;
  --aqua: #0f766e;
  --aqua-2: #14b8a6;
  --aqua-soft: #ccfbf1;
  --warm: #f59e0b;
  --warm-soft: #fef3c7;
  --rose: #e11d48;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18, 49, 46, .06), 0 4px 16px rgba(18, 49, 46, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 10px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 40; }
.skip:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }

.topbar { padding: 20px 112px 8px 20px; }
.brand { margin: 0; font-weight: 700; font-size: 20px; color: var(--aqua); display: flex; align-items: center; gap: 8px; }
.drop { width: 14px; height: 18px; background: linear-gradient(160deg, var(--aqua-2), var(--aqua)); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; transform: rotate(0deg); display: inline-block; }
.greeting { color: var(--muted); margin: 4px 0 0; font-size: 15px; }

main { padding: 8px 16px 24px; outline: none; }
h2 { font-size: 18px; margin: 22px 4px 10px; }
h2.h { margin: 0 0 8px; font-size: 19px; }
.h-inline { margin: 0; font-size: 16px; }
h4 { margin: 20px 0 8px; font-size: 15px; }
h2 small { color: var(--muted); font-weight: 400; font-size: 14px; }
p.hint { color: var(--muted); margin: 4px 4px 12px; font-size: 14px; line-height: 1.45; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }

.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.title { font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.btn { border: 0; border-radius: 999px; padding: 10px 16px; min-height: 44px; background: var(--aqua); color: #fff; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.btn.ghost { background: transparent; color: var(--aqua); border: 1.5px solid var(--field); }
.btn.soft { background: var(--aqua-soft); color: var(--aqua); }
.btn.small { padding: 7px 12px; min-height: 40px; font-size: 14px; }
.btn.icon { min-width: 40px; padding: 7px 10px; }
.btn.danger-fill { background: var(--rose); color: #fff; }
.btn.block { display: flex; width: 100%; padding: 14px; }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

.check { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ring); background: #fff; flex: none; display: grid; place-items: center; font-size: 16px; color: #fff; }
.check.on { background: var(--aqua); border-color: var(--aqua); }
.linkish { background: none; border: 0; padding: 0; text-align: left; color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.due { color: #b45309; font-weight: 600; }

/* Check-in */
.moods { display: flex; justify-content: space-between; margin: 10px 0 4px; }
.mood { font-size: 30px; min-width: 48px; min-height: 48px; background: none; border: 2px solid transparent; border-radius: 14px; padding: 4px 6px; filter: grayscale(.6); opacity: .75; }
.mood.on { border-color: var(--aqua-2); filter: none; opacity: 1; background: var(--aqua-soft); }
.yesno { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.chip { min-height: 40px; border: 1.5px solid var(--field); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 14px; }
.chip.on { background: var(--aqua); border-color: var(--aqua); color: #fff; }

/* Pessoas */
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--aqua-soft); color: var(--aqua); display: grid; place-items: center; font-weight: 700; flex: none; }
.thermo { height: 6px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.thermo > i { display: block; height: 100%; border-radius: 3px; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--warm-soft); color: #92400e; white-space: nowrap; }
.badge.ok { background: var(--aqua-soft); color: var(--aqua); }

/* Metas */
.board { margin-bottom: 16px; }
.board-head { display: flex; align-items: center; gap: 8px; margin: 18px 4px 8px; font-weight: 700; }
.board-head .tag { font-size: 12px; font-weight: 500; color: var(--muted); }
.progress { font-size: 13px; color: var(--muted); white-space: nowrap; }
.goal-list .card { padding: 12px 14px; margin-bottom: 8px; }

/* Semana */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 12px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar i { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--aqua-2); min-height: 4px; }
.bar i.empty { background: var(--line); }
.bar i.social { background: var(--aqua); }
.bar span { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--aqua); }
.stat span { font-size: 12px; color: var(--muted); }
.insight { background: var(--aqua-soft); color: #134e4a; border-radius: var(--radius); padding: 14px 16px; line-height: 1.45; margin: 12px 0; }

textarea, input[type=text], input[type=tel], input[type=number], input[type=time], input[type=date], input[type=search], select {
  width: 100%; min-height: 44px; border: 1.5px solid var(--field); border-radius: 12px; padding: 11px 12px; background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
label.field { display: block; margin: 12px 0; font-size: 14px; color: var(--muted); }
label.field > span, fieldset.field > legend { display: block; margin-bottom: 6px; }
fieldset.field { border: 0; padding: 0; }
fieldset.field .row select { flex: 1; }
ul.plain { list-style: none; padding: 0; margin: 8px 0; }
ul.plain li { background: #fff; border-radius: 12px; padding: 6px 6px 6px 12px; margin-bottom: 6px; }
.done-today { margin: 16px 4px; }
.done-today summary { color: var(--muted); cursor: pointer; padding: 8px 0; min-height: 40px; }
.imp-list { max-height: 42vh; overflow: auto; margin: 10px 0; }
.pick.imp input { width: 22px; height: 22px; accent-color: var(--aqua); flex: none; }

/* Nav */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
.tabs button { flex: 1; min-height: 52px; max-width: 140px; border: 0; background: none; padding: 6px 0; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs button span { font-size: 20px; filter: grayscale(1); opacity: .7; }
.tabs button.active { color: var(--aqua); font-weight: 600; }
.tabs button.active span { filter: none; opacity: 1; }

/* Ajuda: fixo no topo, acima de tudo (inclusive das janelas), em todas as telas */
.help-btn { position: fixed; right: max(16px, calc(50% - 264px)); top: calc(14px + env(safe-area-inset-top)); min-height: 44px; border: 0; border-radius: 999px; padding: 10px 16px; background: var(--rose); color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(225, 29, 72, .3); z-index: 30; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(18, 49, 46, .4); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.modal[hidden] { display: none; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: calc(100vh - 76px - env(safe-area-inset-top)); overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 8px; font-size: 19px; }
.sheet:focus { outline: none; }

.pick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1.5px solid var(--field); border-radius: 14px; margin-bottom: 8px; width: 100%; text-align: left; }
.pick.on { border-color: var(--aqua); border-width: 2px; background: #f0fdfa; }
.pick .emoji { font-size: 22px; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 35; max-width: 90vw; }
.toast:empty { display: none; }

.empty { text-align: center; color: var(--muted); padding: 20px 10px; font-size: 14px; }
.danger { color: var(--rose); }
.center { text-align: center; }
.mt { margin-top: 12px; }
a { color: var(--aqua); }
